纽威
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

525 lines
26 KiB

3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
  1. using ICSSoft.Common;
  2. using ICSSoft.Entity;
  3. using Newtonsoft.Json;
  4. using System;
  5. using System.Collections.Generic;
  6. using System.Data;
  7. using System.Data.SqlClient;
  8. using System.Linq;
  9. using System.Text;
  10. using System.Threading.Tasks;
  11. namespace ICSSoft.DataProject
  12. {
  13. /// <summary>
  14. /// 委外退料
  15. /// </summary>
  16. public class OutsourcingIssueDoNegative
  17. {
  18. private static log4net.ILog log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
  19. private static string connString = System.Configuration.ConfigurationManager.AppSettings["ERPConnStr"];
  20. private static string ERPDB = System.Configuration.ConfigurationManager.AppSettings["ERPDB"];
  21. private static string Type = System.Configuration.ConfigurationManager.AppSettings["Type"];
  22. public string Get(List<ICSOutsourcingIssueDoc> infos)
  23. {
  24. List<ICSOutsourcingIssueDoc> szJson = new List<ICSOutsourcingIssueDoc>();
  25. DataTable dt = null;
  26. DataTable dtNew = null;
  27. string connS = "";
  28. string json = "";
  29. if (infos.Count <= 0)
  30. {
  31. throw new Exception("传送数据为空!");
  32. }
  33. string res = string.Empty;
  34. SqlConnection conn = new SqlConnection();
  35. SqlCommand cmd = new SqlCommand();
  36. string sql = string.Empty;
  37. foreach (ICSOutsourcingIssueDoc info in infos)
  38. {
  39. try
  40. {
  41. connS = string.Format(connString, info.WorkPoint);
  42. conn = new System.Data.SqlClient.SqlConnection(connS);
  43. conn.Open();
  44. SqlTransaction sqlTran = conn.BeginTransaction();
  45. cmd = new SqlCommand();
  46. cmd.Transaction = sqlTran;
  47. cmd.Connection = conn;
  48. if (info.MTime < new DateTime(2000, 01, 01))
  49. throw new Exception("请输入正确的操作时间:" + info.MTime);
  50. sql = @" select a.ID,iMPoIds,iordercode,a.cCode,a.cDepCode,c.cDepName,a.cWhCode,
  51. d.cWhName,a.cSource,a.cMaker,dnmaketime,cHandler,dnverifytime,cSourceCodeLs,
  52. b.AutoID ,b.irowno,b.cInvCode,b.iQuantity,e.MoDetailsID,b.iNum,e.csocode
  53. from rdrecord11 a
  54. left join rdrecords11 b on a.ID=b.ID
  55. left join Department c on a.cDepCode=c.cDepCode
  56. left join Warehouse d on a.cWhCode=d.cWhCode
  57. left join OM_MODetails e on b.iOMoDID=e.MoDetailsID
  58. where a.cBusType=''and b.iQuantity<0";
  59. if (!string.IsNullOrWhiteSpace(info.IssueCode))
  60. {
  61. sql += " and a.cCode='{0}'";
  62. }
  63. if (!string.IsNullOrWhiteSpace(info.MTime.ToString()))
  64. {
  65. sql += " and ISNULL(a.dnmodifytime,ISNULL(a.dnverifytime, ISNULL(a.dnmodifytime, a.dnmaketime)))>='{1}'";
  66. }
  67. if (!string.IsNullOrWhiteSpace(info.User))
  68. {
  69. sql += "and a.CMAKER='{2}'";
  70. }
  71. sql = string.Format(sql, info.IssueCode, info.MTime, info.User);
  72. dt = DBHelper.SQlReturnData(sql, cmd);
  73. if (dt.Rows.Count <= 0 || dt == null)
  74. throw new Exception("委外发料单:" + info.IssueCode + ",无信息!");
  75. dtNew.Merge(dt);
  76. cmd.Transaction.Commit();
  77. }
  78. catch (Exception ex)
  79. {
  80. cmd.Transaction.Rollback();
  81. log.Error(ex.Message);
  82. throw new Exception(ex.Message);
  83. }
  84. finally
  85. {
  86. if (conn.State == ConnectionState.Open)
  87. {
  88. conn.Close();
  89. }
  90. conn.Dispose();
  91. }
  92. }
  93. json = JsonConvert.SerializeObject(dtNew);
  94. return json;
  95. }
  96. public string CreateOutsourcingIssueDoNegative(List<ICSOutsourcingIssueDoc> Bills)
  97. {
  98. string msg = "";
  99. string sql = string.Empty;
  100. DataTable dt = null;
  101. DataTable dtNew1 = null;
  102. DataTable dtNew2 = null;
  103. string connS = "";
  104. int num = 0;
  105. //取得out库单的默认显示模版
  106. //取得采购入库单单据 表头ID,表体DID
  107. VouchKey key = new VouchKey();
  108. SqlConnection conn = new SqlConnection();
  109. SqlCommand cmd = new SqlCommand();
  110. if (Bills.Count <= 0)
  111. {
  112. throw new Exception("传送数据为空!");
  113. }
  114. LogInfo(Bills);
  115. foreach (ICSOutsourcingIssueDoc head in Bills)
  116. {
  117. try
  118. {
  119. string iFatherIdTwo = "";
  120. connS = string.Format(connString, head.WorkPoint);
  121. conn = new System.Data.SqlClient.SqlConnection(connS);
  122. conn.Open();
  123. SqlTransaction sqlTran = conn.BeginTransaction();
  124. cmd = new SqlCommand();
  125. cmd.Transaction = sqlTran;
  126. cmd.Connection = conn;
  127. string[] ss = head.WorkPoint.Split('_');
  128. ERPDB = ss[1];
  129. if (head.details.Count <= 0)
  130. {
  131. throw new Exception("表体信息不存在!");
  132. }
  133. #region 判断委外订单是否已关闭
  134. sql = @"SELECT distinct isnull(b.cbCloser,'') as CloseUser
  135. from dbo.OM_MOMaterials a
  136. INNER JOIN OM_MODetails b ON a.MoDetailsID = b.MoDetailsID
  137. where a.MOMaterialsID='" + head.details[0].SourceDetailID + "'";
  138. DataTable dtClose = DBHelper.SQlReturnData(sql, cmd);
  139. if (dtClose != null && dtClose.Rows.Count > 0)
  140. {
  141. if (!string.IsNullOrEmpty(dtClose.Rows[0][0].ToString()))
  142. {
  143. throw new Exception("该委外订单行已关闭,无法领料!");
  144. }
  145. }
  146. #endregion
  147. #region 判断物料是否超额领取
  148. foreach (ICSOutsourcingIssueDocs body in head.details)
  149. {
  150. sql = @"SELECT isnull(b.fOutExcess,0) as fOutExcess,isnull(a.iSendQTY,0) as IssQty,a.iQuantity
  151. FROM dbo.OM_MOMaterials a
  152. LEFT JOIN dbo.Inventory b ON a.cInvCode=b.cInvCode
  153. WHERE a.MOMaterialsID='" + body.SourceDetailID + "'";
  154. DataTable dtQty = DBHelper.SQlReturnData(sql, cmd);
  155. if (dtQty != null && dtQty.Rows.Count > 0)
  156. {
  157. //可超领比率
  158. decimal fOutExcess = Convert.ToDecimal(dtQty.Rows[0]["fOutExcess"]);
  159. //已领数量
  160. decimal IssQty = Convert.ToDecimal(dtQty.Rows[0]["IssQty"]);
  161. //应领数量
  162. decimal Qty = Convert.ToDecimal(dtQty.Rows[0]["iQuantity"]);
  163. //当前可总领数量
  164. decimal TotalQty = Qty + fOutExcess * Qty;
  165. //if (head.IsReturn != "1")
  166. //{
  167. //if (IssQty + body.Quantity > TotalQty)
  168. //{
  169. // throw new Exception("物料领取超过当前可领用最大数,AllocateId:" + body.SourceDetailID);
  170. //}
  171. //}
  172. //else
  173. //{
  174. if (IssQty < body.Quantity)
  175. {
  176. throw new Exception("物料退料超过当前已领用最大数,AllocateId:" + body.SourceDetailID);
  177. }
  178. //}
  179. }
  180. else
  181. {
  182. throw new Exception("委外订单行子件不存在!AllocateId:" + body.SourceDetailID);
  183. }
  184. }
  185. #endregion
  186. #region 委外退料表头
  187. num = head.details.Count();
  188. //取得out库单的默认显示模版
  189. Dictionary<string, int> dic = DBHelper.GetAllCode("" + ERPDB + "", "rd", "" + num + "");
  190. int iFatherId = Convert.ToInt32(dic["iFatherId"].ToString());
  191. int iChildId = Convert.ToInt32(dic["iChildId"].ToString());
  192. DateTime date = DateTime.Now;
  193. string iBaseCodeLen = DBHelper.GetAllRDCode("26", "" + date + "", "admin");
  194. sql = @"
  195. INSERT INTO dbo.rdrecord11
  196. ( ID ,bRdFlag ,cVouchType ,cBusType ,cSource ,
  197. cWhCode ,dDate ,cCode ,cRdCode ,cDepCode,
  198. cPersonCode,cHandler ,bTransFlag ,cMaker ,dVeriDate ,
  199. bpufirst ,biafirst ,VT_ID ,bIsSTQc ,cPsPcode ,
  200. cMPoCode ,iproorderid ,bFromPreYear ,bIsLsQuery ,bIsComplement ,
  201. iDiscountTaxType ,ireturncount ,iverifystate ,iswfcontrolled ,dnmaketime ,
  202. dnverifytime ,bredvouch ,iPrintCount,cVenCode,iMQuantity)
  203. SELECT distinct @ID,0,'11','','',
  204. @cWhCode,CONVERT(NVARCHAR(15),GETDATE(),23),@cCode,'22',c.cDepCode,
  205. c.cPersonCode,@cHandler,0,@cMaker,CONVERT(NVARCHAR(15),GETDATE(),23),
  206. 0,0,@VT_ID,0,b.cInvCode,
  207. c.cCode,a.MoId,0,0,0,
  208. 0,0,0,0,GETDATE(),
  209. GETDATE(),@bredvouch,0,c.cVenCode,b.iQuantity
  210. from dbo.OM_MOMaterials a
  211. INNER JOIN dbo.OM_MODetails b ON a.MoDetailsID = b.MoDetailsID
  212. LEFT JOIN dbo.OM_MOMain c ON b.MOID = c.MOID
  213. WHERE a.MOMaterialsID='" + head.details[0].SourceDetailID + "'";
  214. cmd.Parameters.Clear();
  215. cmd.Parameters.Add(new SqlParameter("@ID", iFatherId));
  216. cmd.Parameters.Add(new SqlParameter("@cWhCode", head.WHCode));
  217. cmd.Parameters.Add(new SqlParameter("@cCode", iBaseCodeLen));
  218. cmd.Parameters.Add(new SqlParameter("@cHandler", head.User));
  219. cmd.Parameters.Add(new SqlParameter("@cMaker", head.User));
  220. cmd.Parameters.Add(new SqlParameter("@VT_ID", iChildId));
  221. cmd.Parameters.Add(new SqlParameter("@bredvouch", "0"));
  222. cmd.CommandText = sql;
  223. try
  224. {
  225. int count = cmd.ExecuteNonQuery();
  226. if (count <= 0)
  227. {
  228. log.Error("生成材料出库单表头失败,受影响行数<=0;");
  229. throw new Exception("生成材料出库单表头失败,受影响行数<=0;");
  230. }
  231. }
  232. catch (Exception ex)
  233. {
  234. log.Error("生成材料出库单表头失败!SQL:\r\n" + sql, ex);
  235. throw new Exception("生成材料出库单表头失败!SQL:\r\n" + sql, ex);
  236. }
  237. #endregion
  238. #region 委外退料表体
  239. string iNQuantity = "";
  240. foreach (ICSOutsourcingIssueDocs body in head.details)
  241. {
  242. body.Quantity = -body.Quantity;
  243. iNQuantity = "-a.iQuantity";
  244. sql = @"INSERT INTO dbo.rdrecords11
  245. ( AutoID,ID ,cInvCode,iQuantity ,cBatch ,
  246. iFlag ,cItemCode ,cName ,iNQuantity ,iMPoIds ,
  247. bLPUseFree ,iOriTrackID ,bCosting ,bVMIUsed ,cmocode ,
  248. invcode ,imoseq ,iopseq ,iExpiratDateCalcu ,iorderdid ,
  249. iordertype ,isotype ,ipesodid ,ipesotype ,cpesocode ,
  250. ipesoseq ,irowno ,bcanreplace ,iposflag,iOMoDID,
  251. iOMoMID,comcode,cFree1,cFree2,cFree3,cFree4,cFree5,cFree6,cFree7,cFree8,cFree9,cFree10)
  252. SELECT distinct
  253. @AutoID,@ID,a.cInvCode,@iQuantity,@cBatch,
  254. 0,null,null,@iQuantity,NULL,
  255. 0,0,1,0,NULL,
  256. b.cInvCode,NULL,NULL,0,0,
  257. 0,0,a.MOMaterialsID,'6',c.cCode,
  258. NULL, @irowno,0,NULL,b.MODetailsID,
  259. a.MOMaterialsID,c.cCode,@cFree1,@cFree2,@cFree3,@cFree4,@cFree5,@cFree6,@cFree7,@cFree8,@cFree9,@cFree10
  260. FROM dbo.OM_MOMaterials a
  261. INNER JOIN dbo.OM_MODetails b ON a.MoDetailsID=b.MODetailsID
  262. INNER JOIN dbo.OM_MOMain c ON b.MOID=c.MOID
  263. WHERE a.MOMaterialsID='" + body.SourceDetailID + "'";
  264. cmd.Parameters.Clear();
  265. cmd.Parameters.Add(new SqlParameter("@AutoID", iChildId));
  266. cmd.Parameters.Add(new SqlParameter("@ID", iFatherId));
  267. cmd.Parameters.Add(new SqlParameter("@iQuantity", body.Quantity));
  268. //cmd.Parameters.Add(new SqlParameter("@cCode", iBaseCodeLen));
  269. cmd.Parameters.Add(new SqlParameter("@cBatch", body.BatchCode));
  270. cmd.Parameters.Add(new SqlParameter("@irowno", body.Sequence));
  271. cmd.Parameters.Add(new SqlParameter("@iNQuantity", iNQuantity));
  272. cmd.Parameters.Add(new SqlParameter("@cFree1", body.cFree1));
  273. cmd.Parameters.Add(new SqlParameter("@cFree2", body.cFree2));
  274. cmd.Parameters.Add(new SqlParameter("@cFree3", body.cFree3));
  275. cmd.Parameters.Add(new SqlParameter("@cFree4", body.cFree4));
  276. cmd.Parameters.Add(new SqlParameter("@cFree5", body.cFree5));
  277. cmd.Parameters.Add(new SqlParameter("@cFree6", body.cFree6));
  278. cmd.Parameters.Add(new SqlParameter("@cFree7", body.cFree7));
  279. cmd.Parameters.Add(new SqlParameter("@cFree8", body.cFree8));
  280. cmd.Parameters.Add(new SqlParameter("@cFree9", body.cFree9));
  281. cmd.Parameters.Add(new SqlParameter("@cFree10", body.cFree10));
  282. cmd.CommandText = sql;
  283. try
  284. {
  285. int count = cmd.ExecuteNonQuery();
  286. if (count <= 0)
  287. {
  288. log.Error("生产退料单表体失败,受影响行数<=0;");
  289. throw new Exception("生产退料单表体失败,受影响行数<=0;");
  290. }
  291. }
  292. catch (Exception ex)
  293. {
  294. log.Error("生产退料单表体失败" + sql, ex);
  295. throw new Exception("生产退料单表体失败 " + sql, ex);
  296. }
  297. if (head.UpdateStock)
  298. {
  299. //更新现存量
  300. key.cBustypeUN = "委外发料";
  301. key.cVouchTypeUN = "11";
  302. key.TableName = "IA_ST_UnAccountVouch11";
  303. //DBHelper.UpdateCurrentStock(cmd, body.InvCode, head.WHCode, "", -body.Quantity, key);
  304. DBHelper.UpdateCurrentStockNEW(cmd, body.InvCode, head.WHCode, body.BatchCode, -body.Quantity, body.cFree1, body.cFree2, body.cFree3, body.cFree4, body.cFree5, body.cFree6, body.cFree7, body.cFree8, body.cFree9, body.cFree10, key);
  305. }
  306. #region 回写工单子件已领数量
  307. sql = "update OM_MOMaterials set iSendQTY=isnull(iSendQTY,0)+" + body.Quantity + " where MOMaterialsID='" + body.SourceDetailID + "' ";
  308. DBHelper.CmdExecuteNonQuery(sql, cmd, "回写委外订单子件已领数量失败!");
  309. #endregion
  310. iFatherIdTwo += "'" + iFatherId + "',";
  311. iChildId--;
  312. }
  313. #endregion
  314. #region 查询
  315. sql = @"select a.ID as ID,a.ID as IDs,a.cCode as IssueNEGCode,a.cDepCode,c.cDepName,a.cWhCode,
  316. d.cWhName,a.cSource,cMPoCode,a.cMaker,dnmaketime,cHandler,dnverifytime
  317. from rdrecord11 a
  318. left join Department c on a.cDepCode=c.cDepCode
  319. left join Warehouse d on a.cWhCode=d.cWhCode
  320. where a.cBusType='' and a.ID in ({0})
  321. select a.ID as IDs,iOMoMID as SourceDetailID,b.irowno as Sequence ,iordercode,b.cInvCode,b.iQuantity,b.iNum,b.AutoID as DetailID
  322. from rdrecord11 a
  323. left join rdrecords11 b on a.ID=b.ID
  324. left join Department c on a.cDepCode=c.cDepCode
  325. left join Warehouse d on a.cWhCode=d.cWhCode
  326. left join OM_MODetails e on b.iOMoDID=e.MoDetailsID
  327. where a.cBusType='' and a.ID in ({0})";
  328. sql = string.Format(sql, iFatherIdTwo.TrimEnd(','));
  329. DataSet ds = DBHelper.SQlReturnDataSet(sql, cmd);
  330. dtNew1.Merge(ds.Tables[0]);
  331. dtNew2.Merge(ds.Tables[1]);
  332. // sql = @" select a.ID as ID,iMPoIds,iordercode,a.cCode,a.cDepCode,c.cDepName,a.cWhCode,
  333. // d.cWhName,a.cSource,a.cMaker,dnmaketime,cHandler,dnverifytime,cSourceCodeLs,
  334. // b.AutoID ,b.irowno,b.cInvCode,b.iQuantity,e.MoDetailsID,b.iNum,e.csocode
  335. // from rdrecord11 a
  336. // left join rdrecords11 b on a.ID=b.ID
  337. // left join Department c on a.cDepCode=c.cDepCode
  338. // left join Warehouse d on a.cWhCode=d.cWhCode
  339. // left join OM_MODetails e on b.iOMoDID=e.MoDetailsID
  340. // where a.cBusType='委外发料'and b.iQuantity<0 and a.ID in ({0})";
  341. // sql = string.Format(sql, iFatherIdTwo.TrimEnd(','));
  342. // dt = DBHelper.SQlReturnData(sql, cmd);
  343. #endregion
  344. cmd.Transaction.Commit();
  345. }
  346. catch (Exception ex)
  347. {
  348. cmd.Transaction.Rollback();
  349. log.Error(ex.Message);
  350. throw new Exception(ex.Message);
  351. }
  352. finally
  353. {
  354. if (conn.State == ConnectionState.Open)
  355. {
  356. conn.Close();
  357. }
  358. conn.Dispose();
  359. }
  360. }
  361. string RelationName = "details";
  362. DataRelation dh = new DataRelation(RelationName, dtNew1.Columns["IDs"], dtNew2.Columns["IDs"]);
  363. DataSet dz = new DataSet();
  364. dz.Relations.Add(dh);
  365. msg = DBHelper.DataSetToJson(dz, RelationName);
  366. return msg;
  367. }
  368. public string Approve(List<ICSOutsourcingIssueDoc> infos)
  369. {
  370. List<ICSOutsourcingIssueDoc> szJson = new List<ICSOutsourcingIssueDoc>();
  371. string connS = "";
  372. string json = "";
  373. if (infos.Count <= 0)
  374. {
  375. throw new Exception("传送数据为空!");
  376. }
  377. string res = string.Empty;
  378. SqlConnection conn = new SqlConnection();
  379. SqlCommand cmd = new SqlCommand();
  380. string sql = string.Empty;
  381. foreach (ICSOutsourcingIssueDoc info in infos)
  382. {
  383. try
  384. {
  385. connS = string.Format(connString, info.WorkPoint);
  386. conn = new System.Data.SqlClient.SqlConnection(connS);
  387. conn.Open();
  388. SqlTransaction sqlTran = conn.BeginTransaction();
  389. cmd = new SqlCommand();
  390. cmd.Transaction = sqlTran;
  391. cmd.Connection = conn;
  392. if (info.MTime < new DateTime(2000, 01, 01))
  393. throw new Exception("请输入正确的操作时间:" + info.MTime);
  394. sql = @"UPDATE dbo.rdrecord11 SET cHandler ='" + info.User + @"' ,
  395. dnmodifytime =CONVERT(VARCHAR(50),GETDATE(),112),dModifyDate =GETDATE() WHERE ID='{0}'";
  396. sql = string.Format(sql, info.ID);
  397. DBHelper.CmdExecuteNonQuery(sql, cmd, "未查询到对应数据!");
  398. cmd.Transaction.Commit();
  399. }
  400. catch (Exception ex)
  401. {
  402. cmd.Transaction.Rollback();
  403. log.Error(ex.Message);
  404. throw new Exception(ex.Message);
  405. }
  406. finally
  407. {
  408. if (conn.State == ConnectionState.Open)
  409. {
  410. conn.Close();
  411. }
  412. conn.Dispose();
  413. }
  414. }
  415. return json;
  416. }
  417. /// <summary>
  418. /// 删除请购单
  419. /// </summary>
  420. /// <param name="infos"></param>
  421. /// <returns></returns>
  422. public string Delete(List<ICSOutsourcingIssueDoc> infos)
  423. {
  424. List<ICSOutsourcingIssueDoc> szJson = new List<ICSOutsourcingIssueDoc>();
  425. if (infos.Count <= 0)
  426. {
  427. throw new Exception("传送数据为空!");
  428. }
  429. DataTable dtNew = null;
  430. string connS = "";
  431. string res = string.Empty;
  432. SqlConnection conn = new SqlConnection();
  433. SqlCommand cmd = new SqlCommand();
  434. string sql = string.Empty;
  435. foreach (ICSOutsourcingIssueDoc info in infos)
  436. {
  437. try
  438. {
  439. connS = string.Format(connString, info.WorkPoint);
  440. conn = new System.Data.SqlClient.SqlConnection(connS);
  441. conn.Open();
  442. SqlTransaction sqlTran = conn.BeginTransaction();
  443. cmd = new SqlCommand();
  444. cmd.Transaction = sqlTran;
  445. cmd.Connection = conn;
  446. if (info.MTime < new DateTime(2000, 01, 01))
  447. throw new Exception("请输入正确的操作时间:" + info.MTime);
  448. sql = @" DELETE dbo.rdrecord11 WHERE ID='{0}'";
  449. sql = string.Format(sql, info.ID);
  450. DBHelper.CmdExecuteNonQuery(sql, cmd, "未查询到对应数据!");
  451. cmd.Transaction.Commit();
  452. }
  453. catch (Exception ex)
  454. {
  455. cmd.Transaction.Rollback();
  456. log.Error(ex.Message);
  457. throw new Exception(ex.Message);
  458. }
  459. finally
  460. {
  461. if (conn.State == ConnectionState.Open)
  462. {
  463. conn.Close();
  464. }
  465. conn.Dispose();
  466. }
  467. }
  468. return res;
  469. }
  470. /// <summary>
  471. ///
  472. /// 记录日志
  473. /// </summary>
  474. /// <param name="Bills"></param>
  475. private void LogInfo(List<ICSOutsourcingIssueDoc> Bills)
  476. {
  477. string HeadList = string.Empty;
  478. string BodyList = string.Empty;
  479. foreach (ICSOutsourcingIssueDoc head in Bills)
  480. {
  481. HeadList += "\r\n 表头主键ID:" + head.ID + ",仓库:" + head.WHCode + ",用户:" + head.User + ",站点:" + head.WorkPoint;
  482. foreach (ICSOutsourcingIssueDocs body in head.details)
  483. {
  484. BodyList += "\r\n 表体主键ID: " + body.SourceDetailID + ",数量:" + body.Quantity;
  485. }
  486. }
  487. log.Info(HeadList);
  488. log.Info(BodyList);
  489. }
  490. }
  491. }