纽威
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.

503 lines
26 KiB

  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 SalesShipmentDoc
  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. string bustype = string.Empty;
  23. /// <summary>
  24. /// 获取销售出库单
  25. /// </summary>
  26. /// <param name="infos"></param>
  27. /// <returns></returns>
  28. public string Get(List<ICSSalesShipmentDoc> infos)
  29. {
  30. List<ICSSalesShipmentDoc> szJson = new List<ICSSalesShipmentDoc>();
  31. DataTable dt = null;
  32. string json = "";
  33. if (infos.Count <= 0)
  34. {
  35. throw new Exception("传送数据为空!");
  36. }
  37. string res = string.Empty;
  38. SqlConnection conn = new System.Data.SqlClient.SqlConnection(connString);
  39. conn.Open();
  40. SqlTransaction sqlTran = conn.BeginTransaction();
  41. SqlCommand cmd = new SqlCommand();
  42. cmd.Transaction = sqlTran;
  43. cmd.Connection = conn;
  44. try
  45. {
  46. string sql = string.Empty;
  47. foreach (ICSSalesShipmentDoc info in infos)
  48. {
  49. if (info.MTime < new DateTime(2000, 01, 01))
  50. throw new Exception("请输入正确的操作时间:" + info.MTime);
  51. sql = @" select a.ID,a.cCode,a.cCusCode,c.cCusName,a.cWhCode,d.cWhName,e.cordercode ,a.cMaker ,a.dnmaketime ,a.cHandler ,a.dnverifytime ,
  52. b.AutoID,b.iRSRowNO ,b.cInvCode ,b.iQuantity ,b.iNum,e.AutoID
  53. from rdrecord32 a
  54. inner join rdrecords32 b on a.ID=b.ID
  55. left join DispatchLists e on a.cDLCode=e.DLID
  56. left join Customer c on a.cCusCode=c.cCusCode
  57. left join Warehouse d on a.cWhCode=d.cWhCode WHERE 1=1 ";
  58. if (!string.IsNullOrWhiteSpace(info.SSDCode))
  59. {
  60. sql += " and a.cCode='{0}'";
  61. }
  62. if (!string.IsNullOrWhiteSpace(info.MTime.ToString()))
  63. {
  64. sql += " and ISNULL(a.dnmodifytime ,ISNULL(a.dnverifytime , ISNULL(a.dnmodifytime , a.dnmaketime )))>='{1}'";
  65. }
  66. if (!string.IsNullOrWhiteSpace(info.User))
  67. {
  68. sql += "and a.CMAKER='{2}'";
  69. }
  70. sql = string.Format(sql, info.SSDCode, info.MTime, info.User);
  71. dt = DBHelper.SQlReturnData(sql, cmd);
  72. if (dt.Rows.Count <= 0 || dt == null)
  73. throw new Exception("销售出库单号:" + info.SSDCode + ",无信息!");
  74. json = JsonConvert.SerializeObject(dt);
  75. }
  76. cmd.Transaction.Commit();
  77. return json;
  78. }
  79. catch (Exception ex)
  80. {
  81. cmd.Transaction.Rollback();
  82. log.Error(ex.Message);
  83. throw new Exception(ex.Message);
  84. }
  85. finally
  86. {
  87. if (conn.State == ConnectionState.Open)
  88. {
  89. conn.Close();
  90. }
  91. conn.Dispose();
  92. }
  93. }
  94. /// <summary>
  95. /// 创建销售出库单
  96. /// </summary>
  97. /// <param name="Bills"></param>
  98. /// <returns></returns>
  99. public string CreateSalesShipmentDoc(List<ICSSalesShipmentDoc> Bills)
  100. {
  101. string sql = "";
  102. string msg = "";
  103. DataTable dt = null;
  104. int iFatherId = 0;
  105. int iChildId = 0;
  106. string iFatherIdTwo = "";
  107. //bool ResultFlag = false;
  108. SqlConnection conn = new System.Data.SqlClient.SqlConnection(connString);
  109. conn.Open();
  110. SqlTransaction sqlTran = conn.BeginTransaction();
  111. SqlCommand cmd = new SqlCommand();
  112. cmd.Transaction = sqlTran;
  113. cmd.Connection = conn;
  114. VouchKey key = new VouchKey();
  115. try
  116. {
  117. if (Bills.Count <= 0)
  118. {
  119. throw new Exception("传送数据为空!");
  120. }
  121. LogInfo(Bills);
  122. foreach (ICSSalesShipmentDoc head in Bills)
  123. {
  124. #region 检查 发货单状态
  125. sql = @"SELECT a.DLID,a.cBusType,c.cRdCode,a.cSTCode,b.AutoID,b.irowno,a.cPersonCode,a.cCusCode,b.iDLsID,
  126. a.cMemo,a.cShipAddress,a.cDepCode,cCusInvName,b.cBatch,a.caddcode,a.cCloser,a.cVerifier FROM dbo.DispatchList a INNER JOIN
  127. dbo.DispatchLists b ON a.DLID=b.DLID
  128. LEFT JOIN dbo.SaleType c ON c.cSTCode=a.cSTCode
  129. WHERE a.cDLCode ='" + head.SDNCode + "'";
  130. cmd.CommandText = sql;
  131. DataTable dtDisCheck = DBHelper.SQlReturnData(sql, cmd);
  132. if (dtDisCheck != null && dtDisCheck.Rows.Count > 0)
  133. {
  134. foreach (DataRow item in dtDisCheck.Rows)
  135. {
  136. if (!string.IsNullOrEmpty(item["cCloser"].ToString()))
  137. {
  138. log.Info("DLID:" + head.ID);
  139. throw new Exception("ERP发货单已关闭,无法发货!发货单号:" + head.details);
  140. }
  141. }
  142. bustype = dtDisCheck.Rows[0]["cBusType"].ToString();
  143. }
  144. else
  145. {
  146. throw new Exception("销售发货单单号:" + head.ID + "在ERP内不存在!");
  147. }
  148. #endregion
  149. #region 检验发货单数量
  150. foreach (ICSSalesShipmentDocs body in head.details)
  151. {
  152. sql = "SELECT isnull(fOutQuantity,0) as fOutQuantity,ABS(iQuantity) as iQuantity FROM dbo.DispatchLists WHERE AutoID='" + body.SDNDetailID + "'";
  153. DataTable dtfOutQty = DBHelper.SQlReturnData(sql, cmd);
  154. if (dtfOutQty != null && dtfOutQty.Rows.Count > 0)
  155. {
  156. decimal fOutQty = Convert.ToDecimal(dtfOutQty.Rows[0]["fOutQuantity"]);
  157. decimal iQuantity = Convert.ToDecimal(dtfOutQty.Rows[0]["iQuantity"]);
  158. if (fOutQty + body.Quantity > iQuantity)
  159. {
  160. throw new Exception("出库数量超过发货单表体可出库数量!");
  161. }
  162. }
  163. else
  164. {
  165. throw new Exception("发货单表体不存在!");
  166. }
  167. }
  168. #endregion
  169. #region 销售出库单表头
  170. int num = 0;
  171. foreach (ICSSalesShipmentDoc heads in Bills)
  172. {
  173. num = heads.details.Count();
  174. }
  175. DateTime time = DateTime.Now;
  176. Dictionary<string, int> dic = DBHelper.GetAllCode("" + ERPDB + "", "ShipmentDoc", "" + num + "");
  177. iFatherId = Convert.ToInt32(dic["iFatherId"].ToString());
  178. iChildId = Convert.ToInt32(dic["iChildId"].ToString());
  179. DateTime date = DateTime.Now;
  180. string iBaseCodeLen = DBHelper.GetAllRDCode("0303", "" + time + "", "admin");
  181. sql = @"INSERT INTO dbo.rdrecord32
  182. ( ID ,bRdFlag ,cVouchType ,cBusType ,cSource ,cBusCode ,cWhCode ,
  183. dDate ,cCode ,cRdCode ,cDepCode ,cPersonCode ,cSTCode ,cCusCode ,
  184. cDLCode ,cHandler ,cMemo ,bTransFlag ,cMaker ,cDefine1 ,cDefine2 ,
  185. cDefine3 ,cDefine4 ,cDefine5 ,cDefine6 ,cDefine7 ,cDefine8 ,cDefine9 ,
  186. cDefine10 ,dVeriDate ,bpufirst ,biafirst ,VT_ID ,bIsSTQc ,cDefine11 ,
  187. cDefine12 ,cDefine13 ,cDefine14 ,cDefine15 ,cDefine16 ,cShipAddress ,
  188. caddcode ,bOMFirst ,bFromPreYear ,bIsComplement ,iDiscountTaxType ,
  189. ireturncount ,iverifystate ,iswfcontrolled ,dnmaketime ,dnverifytime ,
  190. iPrintCount ,cinvoicecompany)
  191. SELECT @ID,0,32,a.cBusType,'',a.cDLCode,@cWhCode,
  192. CONVERT(NVARCHAR(15),GETDATE(),23),@cCode,'21',a.cDepCode,a.cPersonCode,a.cSTCode,a.cCusCode,
  193. a.DLID,@cHandler,a.cMemo,0,@cMaker,a.cDefine1,a.cDefine2,
  194. a.cDefine3,a.cDefine4,a.cDefine5,a.cDefine6,a.cDefine7,a.cDefine8,a.cDefine9,
  195. a.cDefine10,CONVERT(NVARCHAR(15),GETDATE(),23),0,0,@VT_ID,0,a.cDefine11,
  196. a.cDefine12,a.cDefine13,a.cDefine14,a.cDefine15,a.cDefine16,a.cShipAddress,
  197. a.caddcode,null,0,0,0,
  198. 0,0,0,GETDATE(),GETDATE(),
  199. 0,a.cinvoicecompany
  200. FROM dbo.DispatchList a WHERE a.cDLCode ='" + head.SDNCode + "'";
  201. cmd.Parameters.Clear();
  202. cmd.Parameters.Add(new SqlParameter("@ID", iFatherId));
  203. cmd.Parameters.Add(new SqlParameter("@cWhCode",head.WHCode));
  204. cmd.Parameters.Add(new SqlParameter("@cCode", iBaseCodeLen));
  205. cmd.Parameters.Add(new SqlParameter("@cDepCode", ""));
  206. cmd.Parameters.Add(new SqlParameter("@cHandler", head.User));
  207. cmd.Parameters.Add(new SqlParameter("@cMaker", head.User));
  208. cmd.Parameters.Add(new SqlParameter("@VT_ID", iChildId));
  209. //cmd.Parameters.Add(new SqlParameter("@dDate", data.dMate));
  210. cmd.CommandText = sql;
  211. try
  212. {
  213. int count = cmd.ExecuteNonQuery();
  214. if (count <= 0)
  215. {
  216. log.Error("生成销售出库单表头失败,受影响行数<=0;");
  217. throw new Exception("生成销售出库单表头失败,受影响行数<=0;");
  218. }
  219. }
  220. catch (Exception ex)
  221. {
  222. log.Error("生成销售出库单表头失败!销售出库单号:" + head.SSDCode + ";异常:" + ex.Message + ";SQL:\r\n" + sql, ex);
  223. throw new Exception("生成销售出库单表头失败!销售出库单号:" + head.SSDCode + ";异常:" + ex.Message + ";SQL:\r\n" + sql, ex);
  224. }
  225. #endregion
  226. #region 销售出库单表体
  227. foreach (ICSSalesShipmentDocs body in head.details)
  228. {
  229. //if (head.IsReturn == "1")
  230. //{
  231. // body.iQuantity = -body.iQuantity;
  232. //}
  233. //else
  234. //{
  235. //判断物料批号与现存量表批号是否一致、数量不能超过现存量物料数量
  236. sql = @"SELECT cBatch,iQuantity from CurrentStock WHERE cInvCode='" + body.InvCode + "'AND cBatch='" + "" + "'and cWhCode='" + head.WHCode + "'";
  237. DataTable dtItem = DBHelper.SQlReturnData(sql, cmd);
  238. if (dtItem != null && dtItem.Rows.Count > 0)
  239. {
  240. //if (!dtItem.Rows[0]["cBatch"].ToString().Equals(body.cBatch))
  241. //{
  242. // throw new Exception("物料条码的批号与U8现存量物料批号不一致,物料:" + body.cInvCode);
  243. //}
  244. if (Convert.ToDecimal(dtItem.Rows[0]["iQuantity"].ToString()) < body.Quantity)
  245. {
  246. throw new Exception("物料条码的数量大于U8现存量物料数量,物料:" + body.InvCode);
  247. }
  248. }
  249. else
  250. {
  251. throw new Exception("物料:" + body.InvCode + "在现存量表中不存在!");
  252. }
  253. //}
  254. sql = @"INSERT INTO dbo.rdrecords32
  255. ( AutoID ,ID ,cInvCode ,iQuantity ,cBatch ,iFlag ,
  256. cDefine22 ,cDefine23 ,cDefine24 ,cDefine25 ,cDefine26 ,
  257. cDefine27 ,cItem_class ,cItemCode ,iDLsID ,iNQuantity ,
  258. cDefine28 ,cDefine29 ,cDefine30 ,cDefine31 ,cDefine32 ,
  259. cDefine33 ,cDefine34 ,cDefine35 ,cDefine36 ,cDefine37 ,
  260. bLPUseFree ,iRSRowNO ,iOriTrackID ,ccusinvcode,ccusinvname,bCosting ,bVMIUsed ,
  261. cbdlcode ,iExpiratDateCalcu ,iorderdid ,iordertype ,
  262. iordercode ,iorderseq ,ipesodid ,ipesotype ,cpesocode ,
  263. ipesoseq ,isodid ,isotype ,csocode ,isoseq ,irowno ,
  264. bIAcreatebill ,bsaleoutcreatebill ,isaleoutid ,bneedbill,iposflag )
  265. SELECT @AutoID,@ID,@cInvCode,@iQuantity,@cBatch,0,
  266. a.cDefine22,a.cDefine23,a.cDefine24,a.cDefine25,a.cDefine26,
  267. a.cDefine27,a.cItem_class,a.cItemCode,a.AutoID,a.iQuantity,
  268. a.cDefine28,a.cDefine29,a.cDefine30,a.cDefine31,a.cDefine32,
  269. a.cDefine33,a.cDefine34,a.cDefine35,a.cDefine36,a.cDefine37,
  270. 0,0,0,a.cCusInvCode,a.cCusInvName,1,0,
  271. b.cDLCode,0,a.iSOsID,1,
  272. d.cSOCode,c.iRowNo,a.iSOsID,1,d.cSOCode,
  273. 1,a.iSOsID,1,d.cSOCode,c.iRowNo,@irowno,
  274. 1,1,@AutoID,1,null
  275. FROM dbo.DispatchLists a
  276. INNER JOIN dbo.DispatchList b ON a.DLID=b.DLID
  277. LEFT JOIN dbo.SO_SODetails c ON a.iSOsID=c.iSOsID
  278. LEFT JOIN dbo.SO_SOMain d ON c.ID=d.ID WHERE a.AutoID='" + body.SDNDetailID + "'";
  279. cmd.Parameters.Clear();
  280. cmd.Parameters.Add(new SqlParameter("@AutoID", iChildId));
  281. cmd.Parameters.Add(new SqlParameter("@ID", iFatherId));
  282. cmd.Parameters.Add(new SqlParameter("@cInvCode",body.InvCode));
  283. cmd.Parameters.Add(new SqlParameter("@iQuantity",body.Quantity));
  284. cmd.Parameters.Add(new SqlParameter("@cBatch", ""));
  285. cmd.Parameters.Add(new SqlParameter("@irowno",body.Sequence));
  286. cmd.CommandText = sql;
  287. try
  288. {
  289. int count = cmd.ExecuteNonQuery();
  290. if (count <= 0)
  291. {
  292. log.Error("生成销售出库单表体失败,受影响行数<=0;");
  293. throw new Exception("生成销售出库单表体失败,受影响行数<=0;");
  294. }
  295. }
  296. catch (Exception ex)
  297. {
  298. log.Error("生成销售出库单表体失败!销售出库单号:" + head.SSDCode + ";异常:" + ex.Message + ";SQL:\r\n" + sql, ex);
  299. throw new Exception("生成销售出库单表体失败!销售出库单号:" + head.SSDCode + ";异常:" + ex.Message + ";SQL:\r\n" + sql, ex);
  300. }
  301. #region 更新现存量 现存量表待出库数量扣减
  302. key.cBustypeUN = bustype;
  303. key.cVouchTypeUN = "32";
  304. key.TableName = "IA_ST_UnAccountVouch32";
  305. DBHelper.UpdateCurrentStock(cmd, body.InvCode, head.WHCode, "", -body.Quantity, key);
  306. #endregion
  307. log.Debug(sql);
  308. #region 回写销售订单累计发货数量,回写销售发货单累计出库数量
  309. sql = @"UPDATE a SET a.foutquantity=ISNULL(a.foutquantity,0)+" + body.Quantity + @"
  310. FROM dbo.SO_SODetails a LEFT JOIN dbo.DispatchLists b ON a.iSOsID=b.iSOsID
  311. WHERE b.AutoID='" + body.SDNDetailID + "'";
  312. DBHelper.CmdExecuteNonQuery(sql, cmd, "回写销售订单累计发货数量失败!");
  313. sql = "Update DispatchLists set fOutQuantity=isnull(fOutQuantity,0)+" + body.Quantity + " where AutoID='" + body.SDNDetailID + "' ";
  314. DBHelper.CmdExecuteNonQuery(sql, cmd, "回写销售发货单累计出库数量失败!");
  315. iChildId--;
  316. #endregion
  317. }
  318. #endregion
  319. iFatherIdTwo += "'" + iFatherId + "',";
  320. }
  321. #region 查询
  322. sql = @"
  323. select distinct a.ID as ID, a.ID as IDs,a.cCode as SSDCode,a.cCusCode as CusCode,
  324. c.cCusName as CusName,a.cWhCode as WHCode,d.cWhName as WHName,e.cordercode ,
  325. a.cMaker as CreateUser ,a.dnmaketime as CreateDateTime ,a.cHandler as Checker ,
  326. a.dnverifytime as CheckDateTime
  327. from rdrecord32 a
  328. left join DispatchLists e on a.cDLCode=e.DLID
  329. left join Customer c on a.cCusCode=c.cCusCode
  330. left join Warehouse d on a.cWhCode=d.cWhCode WHERE 1=1 and a.ID in({0})
  331. select distinct a.ID as IDs,b.AutoID as DetailID,b.irowno as Sequence,b.cInvCode as InvCode ,b.iQuantity as Quantity ,
  332. b.iNum as Amount,b.iDLsID as SDNDetailID
  333. from rdrecord32 a
  334. inner join rdrecords32 b on a.ID=b.ID
  335. left join Customer c on a.cCusCode=c.cCusCode
  336. left join Warehouse d on a.cWhCode=d.cWhCode WHERE 1=1 and a.ID in({0})";
  337. sql = string.Format(sql, iFatherIdTwo.TrimEnd(','));
  338. DataSet ds = DBHelper.SQlReturnDataSet(sql, cmd);
  339. string RelationName = "details";
  340. DataRelation dr = new DataRelation(RelationName, ds.Tables[0].Columns["IDs"], ds.Tables[1].Columns["IDs"]);
  341. ds.Relations.Add(dr);
  342. #endregion
  343. msg = DBHelper.DataSetToJson(ds, RelationName);
  344. cmd.Transaction.Commit();
  345. //ResultFlag = true;
  346. return msg;
  347. }
  348. catch (Exception ex)
  349. {
  350. cmd.Transaction.Rollback();
  351. log.Error(ex.Message);
  352. throw new Exception(ex.Message);
  353. }
  354. finally
  355. {
  356. if (conn.State == ConnectionState.Open)
  357. {
  358. conn.Close();
  359. }
  360. conn.Dispose();
  361. }
  362. }
  363. /// <summary>
  364. /// 审核销售出库单
  365. /// </summary>
  366. /// <param name="infos"></param>
  367. /// <returns></returns>
  368. public string Approve(List<ICSSalesShipmentDoc> infos)
  369. {
  370. List<ICSSalesShipmentDoc> szJson = new List<ICSSalesShipmentDoc>();
  371. DataTable dt = null;
  372. string json = "";
  373. if (infos.Count <= 0)
  374. {
  375. throw new Exception("传送数据为空!");
  376. }
  377. string res = string.Empty;
  378. SqlConnection conn = new System.Data.SqlClient.SqlConnection(connString);
  379. conn.Open();
  380. SqlTransaction sqlTran = conn.BeginTransaction();
  381. SqlCommand cmd = new SqlCommand();
  382. cmd.Transaction = sqlTran;
  383. cmd.Connection = conn;
  384. try
  385. {
  386. string sql = string.Empty;
  387. foreach (ICSSalesShipmentDoc info in infos)
  388. {
  389. if (info.MTime < new DateTime(2000, 01, 01))
  390. throw new Exception("请输入正确的操作时间:" + info.MTime);
  391. sql = @"UPDATE rdrecord32 SET cHandler ='" + info.User + @"' ,
  392. dnverifytime=CONVERT(VARCHAR(50),GETDATE(),112),dVeriDate=GETDATE() WHERE ID='{0}'";
  393. sql = string.Format(sql, info.ID);
  394. DBHelper.CmdExecuteNonQuery(sql, cmd, "审核销售出单失败!");
  395. }
  396. cmd.Transaction.Commit();
  397. return json;
  398. }
  399. catch (Exception ex)
  400. {
  401. cmd.Transaction.Rollback();
  402. log.Error(ex.Message);
  403. throw new Exception(ex.Message);
  404. }
  405. finally
  406. {
  407. if (conn.State == ConnectionState.Open)
  408. {
  409. conn.Close();
  410. }
  411. conn.Dispose();
  412. }
  413. }
  414. /// <summary>
  415. /// 删除销售出库单
  416. /// </summary>
  417. /// <param name="infos"></param>
  418. /// <returns></returns>
  419. public string Delete(List<ICSSalesShipmentDoc> infos)
  420. {
  421. List<ICSSalesShipmentDoc> szJson = new List<ICSSalesShipmentDoc>();
  422. if (infos.Count <= 0)
  423. {
  424. throw new Exception("传送数据为空!");
  425. }
  426. string res = string.Empty;
  427. SqlConnection conn = new System.Data.SqlClient.SqlConnection(connString);
  428. conn.Open();
  429. SqlTransaction sqlTran = conn.BeginTransaction();
  430. SqlCommand cmd = new SqlCommand();
  431. cmd.Transaction = sqlTran;
  432. cmd.Connection = conn;
  433. try
  434. {
  435. string sql = string.Empty;
  436. foreach (ICSSalesShipmentDoc info in infos)
  437. {
  438. if (info.MTime < new DateTime(2000, 01, 01))
  439. throw new Exception("请输入正确的操作时间:" + info.MTime);
  440. sql = @"delete rdrecord11 where rdrecord32.ID='" + info.ID + "'";
  441. sql += @"delete rdrecords11 where rdrecords32.ID='" + info.ID + "'";
  442. //UPDATE dbo.rdrecord11 a SET cHandler='" + info.User + @"' ,
  443. // dVeriDate=CONVERT(VARCHAR(50),GETDATE(),112),dnverifytime=GETDATE()
  444. // WHERE a.ID='" + info.ID + "'";
  445. DBHelper.CmdExecuteNonQuery(sql, cmd, "删除销售出单失败!");
  446. }
  447. cmd.Transaction.Commit();
  448. return res;
  449. ;
  450. }
  451. catch (Exception ex)
  452. {
  453. cmd.Transaction.Rollback();
  454. log.Error(ex.Message);
  455. throw new Exception(ex.Message);
  456. }
  457. finally
  458. {
  459. if (conn.State == ConnectionState.Open)
  460. {
  461. conn.Close();
  462. }
  463. conn.Dispose();
  464. }
  465. }
  466. /// <summary>
  467. ///
  468. /// 记录日志
  469. /// </summary>
  470. /// <param name="Bills"></param>
  471. private void LogInfo(List<ICSSalesShipmentDoc> Bills)
  472. {
  473. string HeadList = string.Empty;
  474. string BodyList = string.Empty;
  475. foreach (ICSSalesShipmentDoc head in Bills)
  476. {
  477. HeadList += "\r\n 表头主键ID:" + head.ID + ",仓库:" + head.WHCode + ",用户:" + head.User;
  478. foreach (ICSSalesShipmentDocs body in head.details)
  479. {
  480. BodyList += "\r\n 表体主键ID: " + body.SDNDetailID + ",数量:" + body.Quantity;
  481. }
  482. }
  483. log.Info(HeadList);
  484. log.Info(BodyList);
  485. }
  486. }
  487. }