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

469 lines
24 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
  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 SalesDeliveryNotice
  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<ICSSalesDeliveryNotice> infos)
  29. {
  30. List<ICSSalesDeliveryNotice> szJson = new List<ICSSalesDeliveryNotice>();
  31. DataTable dt = null;
  32. DataTable dtNew = null;
  33. string connS = "";
  34. string json = "";
  35. if (infos.Count <= 0)
  36. {
  37. throw new Exception("传送数据为空!");
  38. }
  39. string res = string.Empty;
  40. SqlConnection conn = new SqlConnection();
  41. SqlCommand cmd = new SqlCommand();
  42. string sql = string.Empty;
  43. foreach (ICSSalesDeliveryNotice info in infos)
  44. {
  45. try
  46. {
  47. connS = string.Format(connString, info.WorkPoint);
  48. conn = new System.Data.SqlClient.SqlConnection(connS);
  49. conn.Open();
  50. SqlTransaction sqlTran = conn.BeginTransaction();
  51. cmd = new SqlCommand();
  52. cmd.Transaction = sqlTran;
  53. cmd.Connection = conn;
  54. if (info.MTime < new DateTime(2000, 01, 01))
  55. throw new Exception("请输入正确的操作时间:" + info.MTime);
  56. sql = @" select a.DLID ,a.cDLCode ,a.cCusCode,c.cCusName,a.cDepCode ,
  57. d.cDepName,b.cordercode ,a.cMaker ,a.dcreatesystime ,
  58. b.AutoID ,b.irowno,b.cInvCode ,b.iQuantity ,b.iNum ,b.iSOsID
  59. FROM dbo.DispatchList a
  60. INNER JOIN dbo.DispatchLists b ON a.DLID = b.DLID
  61. LEFT JOIN dbo.Customer c ON a.cCusCode = c.cCusCode
  62. left join Department d on a.cDepCode=d.cDepCode ";
  63. if (!string.IsNullOrWhiteSpace(info.SDNCode))
  64. {
  65. sql += " and a.cDLCode='{0}'";
  66. }
  67. if (!string.IsNullOrWhiteSpace(info.MTime.ToString()))
  68. {
  69. sql += " and ISNULL(a.dnmodifytime ,ISNULL(a.dverifydate , ISNULL(a.dnmodifytime , a.dcreatesystime )))>='{1}'";
  70. }
  71. if (!string.IsNullOrWhiteSpace(info.User))
  72. {
  73. sql += "and a.CMAKER='{2}'";
  74. }
  75. sql = string.Format(sql, info.SOCode, info.MTime, info.User);
  76. dt = DBHelper.SQlReturnData(sql, cmd);
  77. if (dt.Rows.Count <= 0 || dt == null)
  78. throw new Exception("销售发货单号:" + info.SOCode + ",无信息!");
  79. if (dtNew == null)
  80. dtNew = dt;
  81. else
  82. dtNew.Merge(dt);
  83. cmd.Transaction.Commit();
  84. }
  85. catch (Exception ex)
  86. {
  87. cmd.Transaction.Rollback();
  88. log.Error(ex.Message);
  89. throw new Exception(ex.Message);
  90. }
  91. finally
  92. {
  93. if (conn.State == ConnectionState.Open)
  94. {
  95. conn.Close();
  96. }
  97. conn.Dispose();
  98. }
  99. }
  100. json = JsonConvert.SerializeObject(dtNew);
  101. return json;
  102. }
  103. /// <summary>
  104. /// 创建销售发货
  105. /// </summary>
  106. /// <param name="Bills"></param>
  107. /// <returns></returns>
  108. public string CerateSalesDeliveryNotice(List<ICSSalesDeliveryNotice> Bills)
  109. {
  110. string msg = "";
  111. DataTable dt = null;
  112. DataTable dtNew = null;
  113. string connS = "";
  114. //bool ResultFlag = false;
  115. SqlConnection conn = new SqlConnection();
  116. SqlCommand cmd = new SqlCommand();
  117. VouchKey key = new VouchKey();
  118. if (Bills.Count <= 0)
  119. {
  120. throw new Exception("传送数据为空!");
  121. }
  122. LogInfo(Bills);
  123. foreach (ICSSalesDeliveryNotice head in Bills)
  124. {
  125. try
  126. {
  127. string sql = "";
  128. connS = string.Format(connString, head.WorkPoint);
  129. conn = new System.Data.SqlClient.SqlConnection(connS);
  130. conn.Open();
  131. SqlTransaction sqlTran = conn.BeginTransaction();
  132. cmd = new SqlCommand();
  133. cmd.Transaction = sqlTran;
  134. cmd.Connection = conn;
  135. string[] ss = head.WorkPoint.Split('_');
  136. ERPDB = ss[1];
  137. #region 销售发货单表头
  138. int num = 0;
  139. foreach (ICSSalesDeliveryNotice heads in Bills)
  140. {
  141. num = heads.details.Count();
  142. }
  143. string SO_SOMain_VT_ID = DBHelper.GetDefaultTemplate("05", cmd);//目标账套销售订单VT_ID模板
  144. DateTime time = DateTime.Now;
  145. Dictionary<string, int> dic = DBHelper.GetAllCode("" + ERPDB + "", "DelNote", "" + num + "", head.WorkPoint);
  146. int iFatherId = Convert.ToInt32(dic["iFatherId"].ToString());
  147. int iChildId = Convert.ToInt32(dic["iChildId"].ToString());
  148. DateTime date = DateTime.Now;
  149. string iBaseCodeLen = DBHelper.GetAllRDCode("05", "" + time + "", "admin", head.WorkPoint);
  150. sql = string.Format(@"INSERT INTO dbo.DispatchList
  151. (@DLID , @cDLCode , @cVouchType , cSTCode ,CONVERT(NVARCHAR(50),GETDATE(),23)
  152. , @cDepCode ,SBVID , @cSOCode , @cCusCode , cPayCode
  153. , cSCCode, cCusOAddress , cexch_name , iExchRate , iTaxRate , 0 , bReturnFlag
  154. , bFirst , cMemo , cVerifier , cMaker , iSale, (select cCusName from {0}.dbo.Customer where cCusCode='@cCusCode')
  155. , iVTid , ufts , cBusType , cCloser , cAccounter , cCreChpName
  156. , bIAFirst , ioutgolden , cgatheringplan , dCreditStart , dGatheringDate , icreditdays , bCredit
  157. , caddcode , iverifystate , ireturncount , iswfcontrolled , icreditstate , bARFirst
  158. , cmodifier , dmoddate , dverifydate , ccusperson , dcreatesystime , dverifysystime , dmodifysystime
  159. , csvouchtype , iflowid , bsigncreate , bcashsale , cgathingcode , cChanger , cChangeMemo
  160. , outid , bmustbook , cBookDepcode , cBookType , bSaUsed , bneedbill , baccswitchflag
  161. , iPrintCount , ccuspersoncode , cSourceCode , bsaleoutcreatebill , cSysBarCode , cCurrentAuditor
  162. , csscode , cinvoicecompany , fEBweight , cEBweightUnit , cEBExpressCode , iEBExpressCoID
  163. , SeparateID , bNotToGoldTax , cEBTrnumber , cEBBuyer , cEBBuyerNote , ccontactname , cEBprovince
  164. , cEBcity , cEBdistrict , cmobilephone , cInvoiceCusName , cweighter , dweighttime , cPickVouchCode
  165. , cGCRouteCode)
  166. SELECT
  167. @DLID , @cDLCode , @cVouchType , cSTCode ,CONVERT(NVARCHAR(50),GETDATE(),23)
  168. , @cDepCode , 0 , @cSOCode , @cCusCode , cPayCode
  169. , cSCCode, cCusOAddress , cexch_name , iExchRate , iTaxRate , 0 , bReturnFlag
  170. , 0 , cMemo , cVerifier , cMaker , 0 , (select cCusName from dbo.Customer where cCusCode='@cCusCode')
  171. , @iVTid , ufts , cBusType , cCloser , NULL , NULL
  172. , 0 , null , cgatheringplan , CONVERT(NVARCHAR(50),GETDATE(),23) ,NULL , NULL , 0
  173. , caddcode , iverifystate , ireturncount , iswfcontrolled , icreditstate , 0
  174. , NULL , NULL , NULL , ccusperson , CONVERT(NVARCHAR(50),GETDATE(),23) , dverifysystime , dmodifysystime
  175. , csvouchtype , iflowid , 0 , 0 , cgathingcode , NULL , NULL
  176. , outid , bmustbook , NULL , NULL , NULL , 0 , 0
  177. , 0 , ccuspersoncode , NULL , 0 , cSysBarCode , cCurrentAuditor
  178. , csscode , cinvoicecompany , NULL , NULL , NULL , NULL
  179. , NULL , 0 , NULL , NULL , NULL , NULL , NULL
  180. , NULL , NULL , NULL , NULL , NULL , NULL , NULL
  181. , NULL FROM SO_SOMain a
  182. where a.cSOCode ='" + head.SOCode + "'");
  183. cmd.Parameters.Clear();
  184. cmd.Parameters.Add(new SqlParameter("@DLID", iFatherId));
  185. cmd.Parameters.Add(new SqlParameter("@cDLCode", iBaseCodeLen));
  186. cmd.Parameters.Add(new SqlParameter("@cVouchType", "05"));
  187. cmd.Parameters.Add(new SqlParameter("@cDepCode", head.DepCode));
  188. cmd.Parameters.Add(new SqlParameter("@cSOCode", head.SOCode));
  189. cmd.Parameters.Add(new SqlParameter("@cCusCode", head.CusCode));
  190. cmd.Parameters.Add(new SqlParameter("@iVTid", SO_SOMain_VT_ID));
  191. //cmd.Parameters.Add(new SqlParameter("@dDate", data.dMate));
  192. cmd.CommandText = sql;
  193. try
  194. {
  195. int count = cmd.ExecuteNonQuery();
  196. if (count <= 0)
  197. {
  198. log.Error("生成销售出库单表头失败,受影响行数<=0;");
  199. throw new Exception("生成销售出库单表头失败,受影响行数<=0;");
  200. }
  201. }
  202. catch (Exception ex)
  203. {
  204. log.Error("生成销售出库单表头失败!销售订单号:" + head.SDNCode + ";异常:" + ex.Message + ";SQL:\r\n" + sql, ex);
  205. throw new Exception("生成销售出库单表头失败!销售订单号:" + head.SDNCode + ";异常:" + ex.Message + ";SQL:\r\n" + sql, ex);
  206. }
  207. #endregion
  208. #region 销售出库单表体
  209. foreach (ICSSalesDeliveryNotices body in head.details)
  210. {
  211. #region 销售顶订单表体
  212. sql = string.Format(@"INSERT INTO dbo.DispatchLists
  213. (AutoID , DLID , iCorID , cWhCode , cInvCode , iQuantity , iNum
  214. , iQuotedPrice , iUnitPrice , iTaxUnitPrice , iMoney , iTax , iSum , iDisCount , iNatUnitPrice
  215. , iNatMoney , iNatTax , iNatSum , iNatDisCount , iSettleNum , iSettleQuantity , iBatch , cBatch
  216. , bSettleAll , cMemo , iTB , dvDate , TBQuantity , TBNum , iSOsID , iDLsID
  217. , KL , KL2 , cInvName , iTaxRate
  218. , fOutQuantity , fOutNum , cItemCode , cItem_class , fSaleCost , fSalePrice , cVenAbbName
  219. , cItemName , cItem_CName
  220. , bIsSTQc , iInvExchRate , cUnitID , cCode , iRetQuantity , fEnSettleQuan , fEnSettleSum , iSettlePrice , dMDate , bGsp
  221. , cGspState , cSoCode , cCorCode , iPPartSeqID , iPPartID , iPPartQty , cContractID , cContractTagCode , cContractRowGuid
  222. , iMassDate , cMassUnit , bQANeedCheck , bQAUrgency , bQAChecking , bQAChecked , iQAQuantity , iQANum
  223. , cCusInvCode , cCusInvName , fsumsignquantity , fsumsignnum , cbaccounter , bcosting , cordercode
  224. , iorderrowno , fcusminprice , icostquantity , icostsum , ispecialtype , cvmivencode , iexchsum
  225. , imoneysum , irowno , frettbquantity , fretsum , iExpiratDateCalcu , dblPreExchMomey , dblPreMomey , idemandtype
  226. , cdemandcode , cdemandmemo , cdemandid , idemandseq , cvencode , cReasonCode , cInvSN , iInvSNCount , bneedsign
  227. , bsignover , bneedloss , flossrate , frlossqty , fulossqty , isettletype , crelacuscode , cLossMaker
  228. , dLossDate , dLossTime , icoridlsid , fretoutqty , body_outid , fVeriBillQty
  229. , fVeriBillSum , fVeriRetQty , fVeriRetSum , fLastSettleQty
  230. , fLastSettleSum , cBookWhcode , cInVouchType , cPosition , fretqtywkp , fretqtyykp , frettbqtyykp
  231. , fretsumykp , dkeepdate , cSCloser , isaleoutid , bsaleprice , bgift , bmpforderclosed
  232. , cbSysBarCode , fxjquantity , fxjnum
  233. , bIAcreatebill , cParentCode , cChildCode , fchildqty , fchildrate , iCalcType , fappretwkpqty , fappretwkpsum
  234. , fappretykpqty , fappretykpsum , fappretwkptbqty , fappretykptbqty , irtnappid , crtnappcode , fretailrealamount
  235. , fretailsettleamount , cFactoryCode , GCSourceId , GCSourceIds , cConfirmer , dConfirmDate )
  236. SELECT
  237. @AutoID , @DLID , @cWhCode , @cInvCode , @iQuantity , @iNum
  238. , iQuotedPrice , iUnitPrice , iTaxUnitPrice , iMoney , iTax , iSum , iDisCount , iNatUnitPrice
  239. , iNatMoney , iNatTax , iNatSum , iNatDisCount , NULL , NULL
  240. , 0 , cMemo , 0 , NULL , 0 , NULL , iSOsID , NULL
  241. , KL , KL2 , cInvName , iTaxRate
  242. , fOutQuantity , fOutNum , cItemCode , cItem_class , fSaleCost , fSalePrice ,NUll
  243. , cItemName , cItem_CName
  244. , 0 , iInvExchRate , cUnitID , NULL , 0 , 0 , 0 , 0 , NULL , 0
  245. , NULL , @cSoCode , NULL , iPPartSeqID , iPPartID , iPPartQty , cContractID , cContractTagCode , cContractRowGuid
  246. , NULL , NULL , 0 , 0 , 0 , 0 , 0 , 0
  247. , cCusInvCode , cCusInvName , 0 , 0 , NULL , 0 , @cordercode
  248. , NULL , fcusminprice , icostquantity , icostsum , NULL , NULL , iexchsum
  249. , imoneysum , @irowno , 0 , 0 , NULL , 0 , 0 , NULL
  250. , NULL , NULL , NULL , NULL , NULL , NULL , NULL , NULL , NULL
  251. , NULL , NULL , NULL , 0 , 0 , NULL , NULL , NULL
  252. , NULL , NULL , NULL , NULL , NULL , NULL
  253. , NULL , NULL , NULL , NULL
  254. , NULL , NULL , NULL , NULL , NULL , NULL , NULL
  255. , NULL , NULL , NULL , isaleoutid , 1 , 0 , 0
  256. , cbSysBarCode , NULL , NULL
  257. , 1 , NULL , NULL , NULL , NULL , NULL , NULL , NULL
  258. , NULL , NULL , NULL , NULL , NULL , NULL , NULL
  259. , NULL , NULL , NULL , NULL , NULL , NULL FROM SO_SODetails a
  260. where a.AutoID ='" + body.SODetailID + "'");
  261. cmd.Parameters.Clear();
  262. cmd.Parameters.Add(new SqlParameter("@AutoID", iChildId));
  263. cmd.Parameters.Add(new SqlParameter("@DLID", iFatherId));
  264. cmd.Parameters.Add(new SqlParameter("@cInvCode", body.InvCode));
  265. cmd.Parameters.Add(new SqlParameter("@iQuantity", body.Quantity));
  266. cmd.Parameters.Add(new SqlParameter("@iNum", body.Amount));
  267. cmd.Parameters.Add(new SqlParameter("@cSoCode", head.SOCode));
  268. cmd.Parameters.Add(new SqlParameter("@cordercode", head.SOCode));
  269. cmd.Parameters.Add(new SqlParameter("@irowno", body.Sequence));
  270. //cmd.Parameters.Add(new SqlParameter("@dDate", data.dMate));
  271. cmd.CommandText = sql;
  272. try
  273. {
  274. int count = cmd.ExecuteNonQuery();
  275. if (count <= 0)
  276. {
  277. log.Error("生成销售出库单表体失败,受影响行数<=0;");
  278. throw new Exception("生成销售出库单表体失败,受影响行数<=0;");
  279. }
  280. }
  281. catch (Exception ex)
  282. {
  283. log.Error("生成销售出库单表体失败!销售订单号:" + head.SOCode + ";异常:" + ex.Message + ";SQL:\r\n" + sql, ex);
  284. throw new Exception("生成销售出库单表体失败!销售订单号:" + head.SOCode + ";异常:" + ex.Message + ";SQL:\r\n" + sql, ex);
  285. }
  286. #endregion
  287. iChildId--;
  288. }
  289. #endregion
  290. sql = @"
  291. select a.DLID ,a.cDLCode ,a.cCusCode,c.cCusName,a.cDepCode ,
  292. d.cDepName,b.cordercode ,a.cMaker ,a.dcreatesystime ,
  293. b.AutoID ,b.irowno,b.cInvCode ,b.iQuantity ,b.iNum ,b.iSOsID
  294. FROM dbo.DispatchList a
  295. INNER JOIN dbo.DispatchLists b ON a.DLID = b.DLID
  296. LEFT JOIN dbo.Customer c ON a.cCusCode = c.cCusCode
  297. left join Department d on a.cDepCode=d.cDepCode WHERE a.DLID = '{0}' ";
  298. sql = string.Format(sql, iFatherId);
  299. dt = DBHelper.SQlReturnData(sql, cmd);
  300. if (dtNew == null)
  301. dtNew = dt;
  302. else
  303. dtNew.Merge(dt);
  304. cmd.Transaction.Commit();
  305. }
  306. catch (Exception ex)
  307. {
  308. cmd.Transaction.Rollback();
  309. log.Error(ex.Message);
  310. throw new Exception(ex.Message);
  311. }
  312. finally
  313. {
  314. if (conn.State == ConnectionState.Open)
  315. {
  316. conn.Close();
  317. }
  318. conn.Dispose();
  319. }
  320. }
  321. msg = JsonConvert.SerializeObject(dtNew);
  322. cmd.Transaction.Commit();
  323. return msg;
  324. }
  325. /// <summary>
  326. /// 审核销售发货
  327. /// </summary>
  328. /// <param name="infos"></param>
  329. /// <returns></returns>
  330. public string Approve(List<ICSSalesDeliveryNotice> infos)
  331. {
  332. List<ICSSalesDeliveryNotice> szJson = new List<ICSSalesDeliveryNotice>();
  333. string connS = "";
  334. string json = "";
  335. if (infos.Count <= 0)
  336. {
  337. throw new Exception("传送数据为空!");
  338. }
  339. string res = string.Empty;
  340. SqlConnection conn = new SqlConnection();
  341. SqlCommand cmd = new SqlCommand();
  342. string sql = string.Empty;
  343. foreach (ICSSalesDeliveryNotice info in infos)
  344. {
  345. try
  346. {
  347. connS = string.Format(connString, info.WorkPoint);
  348. conn = new System.Data.SqlClient.SqlConnection(connS);
  349. conn.Open();
  350. SqlTransaction sqlTran = conn.BeginTransaction();
  351. cmd = new SqlCommand();
  352. cmd.Transaction = sqlTran;
  353. cmd.Connection = conn;
  354. if (info.MTime < new DateTime(2000, 01, 01))
  355. throw new Exception("请输入正确的操作时间:" + info.MTime);
  356. sql = @"UPDATE DispatchList SET cMaker ='" + info.User + @"' ,
  357. dverifysystime =CONVERT(VARCHAR(50),GETDATE(),112),dverifydate =GETDATE() WHERE DLID='{0}'";
  358. sql = string.Format(sql, info.ID);
  359. DBHelper.CmdExecuteNonQuery(sql, cmd, "未查询到对应数据!");
  360. cmd.Transaction.Commit();
  361. }
  362. catch (Exception ex)
  363. {
  364. cmd.Transaction.Rollback();
  365. log.Error(ex.Message);
  366. throw new Exception(ex.Message);
  367. }
  368. finally
  369. {
  370. if (conn.State == ConnectionState.Open)
  371. {
  372. conn.Close();
  373. }
  374. conn.Dispose();
  375. }
  376. }
  377. return json;
  378. }
  379. /// <summary>
  380. /// 删除销售发货
  381. /// </summary>
  382. /// <param name="infos"></param>
  383. /// <returns></returns>
  384. public string Delete(List<ICSSalesDeliveryNotice> infos)
  385. {
  386. List<ICSSalesDeliveryNotice> szJson = new List<ICSSalesDeliveryNotice>();
  387. if (infos.Count <= 0)
  388. {
  389. throw new Exception("传送数据为空!");
  390. }
  391. string res = string.Empty;
  392. string connS = "";
  393. SqlConnection conn = new SqlConnection();
  394. SqlCommand cmd = new SqlCommand();
  395. string sql = string.Empty;
  396. foreach (ICSSalesDeliveryNotice info in infos)
  397. {
  398. try
  399. {
  400. connS = string.Format(connString, info.WorkPoint);
  401. conn = new System.Data.SqlClient.SqlConnection(connS);
  402. conn.Open();
  403. SqlTransaction sqlTran = conn.BeginTransaction();
  404. cmd = new SqlCommand();
  405. cmd.Transaction = sqlTran;
  406. cmd.Connection = conn;
  407. if (info.MTime < new DateTime(2000, 01, 01))
  408. throw new Exception("请输入正确的操作时间:" + info.MTime);
  409. sql = @" DELETE DispatchList WHERE DLID={0}";
  410. sql = string.Format(sql, info.ID);
  411. DBHelper.CmdExecuteNonQuery(sql, cmd, "未查询到对应数据!");
  412. cmd.Transaction.Commit();
  413. }
  414. catch (Exception ex)
  415. {
  416. cmd.Transaction.Rollback();
  417. log.Error(ex.Message);
  418. throw new Exception(ex.Message);
  419. }
  420. finally
  421. {
  422. if (conn.State == ConnectionState.Open)
  423. {
  424. conn.Close();
  425. }
  426. conn.Dispose();
  427. }
  428. }
  429. return res;
  430. }
  431. /// <summary>
  432. ///
  433. /// 记录日志
  434. /// </summary>
  435. /// <param name="Bills"></param>
  436. private void LogInfo(List<ICSSalesDeliveryNotice> Bills)
  437. {
  438. string HeadList = string.Empty;
  439. string BodyList = string.Empty;
  440. foreach (ICSSalesDeliveryNotice head in Bills)
  441. {
  442. HeadList += "\r\n 表头主键ID:" + head.ID + ",用户:" + head.User + ",站点:" + head.WorkPoint;
  443. foreach (ICSSalesDeliveryNotices body in head.details)
  444. {
  445. BodyList += "\r\n 表体主键ID:数量:" + body.Quantity;
  446. }
  447. }
  448. log.Info(HeadList);
  449. log.Info(BodyList);
  450. }
  451. }
  452. }