From 2bb3673239583ad491a6247de834ef80c079f5bb Mon Sep 17 00:00:00 2001
From: yusijie <ysj@hz-kingdee.com>
Date: 星期三, 18 十月 2023 13:35:20 +0800
Subject: [PATCH] 凯贝生成送货单

---
 WebAPI/Controllers/BarCodeController.cs |   20 ++++++++++++++++----
 1 files changed, 16 insertions(+), 4 deletions(-)

diff --git a/WebAPI/Controllers/BarCodeController.cs b/WebAPI/Controllers/BarCodeController.cs
index 6e9d2a5..ae04a00 100644
--- a/WebAPI/Controllers/BarCodeController.cs
+++ b/WebAPI/Controllers/BarCodeController.cs
@@ -628,6 +628,8 @@
                             bar.HSupID = oItemSub.HSupID;
                             bar.HEndQty = WeiShu;
                             bar.HMTONO = oItemSub.HMTONO;
+                            bar.HSupBatchNo = oItemSub.HSupBatchNo;
+                            bar.HSupMaterNumber = oItemSub.HSupMaterNumber;
                             ls2.Add(bar);
                         }
                     }
@@ -708,6 +710,8 @@
                             bar2.HSupID = oItemSub2.HSupID;
                             bar2.HEndQty = WeiShu1;
                             bar2.HMTONO = oItemSub2.HMTONO;
+                            bar2.HSupBatchNo = DBUtility.ClsPub.isStrNull(oItemSub2.HSupBatchNo);
+                            bar2.HSupMaterNumber = DBUtility.ClsPub.isStrNull(oItemSub2.HSupMaterNumber);
                             ls3.Add(bar2);
                             //LogService.Write("娴嬭瘯鍔�+++" + oItemSub2.HSupID);
                         }
@@ -732,6 +736,8 @@
                 string HKFDQDate = "";
                 string HWei = "";
                 string HMTONO = "";
+                string HSupBatchNo = "";
+                string HSupMaterNumber = "";
                 oCn.BeginTran();
                 foreach (Model.ClsGy_MaterialList_WMS_Model oItemSub in ls)
                 {
@@ -760,6 +766,8 @@
                         HSourceBillNo = ClsPub.isStrNull(oItemSub.HSourceBillNo);
                         HSourceBillType = ClsPub.isStrNull(oItemSub.HSourceBillType);
                         HWei = ClsPub.isStrNull(oItemSub.HEndQty);
+                        HSupBatchNo = ClsPub.isStrNull(oItemSub.HSupBatchNo);
+                        HSupMaterNumber = ClsPub.isStrNull(oItemSub.HSupMaterNumber);
                         if (FCusName.Contains("澶忓疂"))
                         {
                             HBarCode = $"{oItemSub.HMaterID}";
@@ -767,11 +775,12 @@
                         }
                         string sql = "insert into Gy_BarCodeBill (HInterID,HBarCode,HBarCodeType,HMaterID,HUnitID,HQty,HKFDate,HKFPeriod,HKFDQDate" +
                                     ",HBatchNo,HSupID,HGroupID,HMaker,HMakeDate,HPrintQty,HEndQty,HSupflag" +
-                                    ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HMTONO " +
+                                    ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HMTONO,HSupBatchNo,HSupMaterNumber " +
                                     ") values ("
                                     + linterid.ToString() + ",'" + HBarCode + "','" + HBarCodeType + "'," + HMaterID + "," + HUnitID + "," + HQty2 + ",'" + HKFDate + "'," + HKFPeriod + ",'" + HKFDQDate
                                     + "','" + HBatchNo + "'," + HSupID + "," + HGroupID + ",'" + ClsPub.CurUserName + "','" + DateTime.Today + "'," + HPrintQty + ",'" + HWei + "',1"
-                                    + "," + HSourceInterID + "," + HSourceEntryID + ",'" + HSourceBillNo + "','" + HSourceBillType + "','" + HMTONO + "')";
+                                    + "," + HSourceInterID + "," + HSourceEntryID + ",'" + HSourceBillNo + "','" + HSourceBillType + "','" + HMTONO + "','" + HSupBatchNo+ "','" + HSupMaterNumber + "'" +
+                                    ")";
                         oCn.RunProc(sql);
                         //LogService.Write(sql);
                         sql = "exec setLSH '" + DateTime.Today + "'";
@@ -800,6 +809,8 @@
                         HSourceBillNo = ClsPub.isStrNull(oItemSub.HSourceBillNo);
                         HSourceBillType = ClsPub.isStrNull(oItemSub.HSourceBillType);
                         HWei = ClsPub.isStrNull(oItemSub.HEndQty);
+                        HSupBatchNo = ClsPub.isStrNull(oItemSub.HSupBatchNo);
+                        HSupMaterNumber = ClsPub.isStrNull(oItemSub.HSupMaterNumber);
                         if (FCusName.Contains("澶忓疂"))
                         {
                             HBarCode = $"{oItemSub.HMaterID}";
@@ -807,11 +818,12 @@
                         }
                         string sql = "insert into Gy_BarCodeBill (HInterID,HBarCode,HBarCodeType,HMaterID,HUnitID,HQty,HKFDate,HKFPeriod,HKFDQDate" +
                                     ",HBatchNo,HSupID,HGroupID,HMaker,HMakeDate,HPrintQty,HEndQty,HSupflag" +
-                                    ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HMTONO " +
+                                    ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HMTONO ,HSupBatchNo,HSupMaterNumber" +
                                     ") values ("
                                     + linterid.ToString() + ",'" + HBarCode + "','" + HBarCodeType + "'," + HMaterID + "," + HUnitID + "," + HQty2 + ",'" + HKFDate + "'," + HKFPeriod + ",'" + HKFDQDate
                                     + "','" + HBatchNo + "'," + HSupID + "," + HGroupID + ",'" + ClsPub.CurUserName + "','" + DateTime.Today + "'," + HPrintQty + ",'" + HWei + "',1"
-                                    + "," + HSourceInterID + "," + HSourceEntryID + ",'" + HSourceBillNo + "','" + HSourceBillType + "','" + HMTONO + "')";
+                                    + "," + HSourceInterID + "," + HSourceEntryID + ",'" + HSourceBillNo + "','" + HSourceBillType + "','" + HMTONO +  "','" +
+                                    HSupBatchNo + "','" + HSupMaterNumber + "'" + ")";
                         oCn.RunProc(sql);
                         //LogService.Write(sql);
                     }

--
Gitblit v1.9.1