From 6866dbd4b0b8703811872669179a68841eea803d Mon Sep 17 00:00:00 2001
From: yusijie <ysj@hz-kingdee.com>
Date: 星期二, 24 三月 2026 18:28:50 +0800
Subject: [PATCH] 合并

---
 WebAPI/Controllers/仓存管理/条码生成/Sc_BarCodeController.cs |  109 +++++++++++++++++++++++++++++++++++++++++-------------
 1 files changed, 82 insertions(+), 27 deletions(-)

diff --git "a/WebAPI/Controllers/\344\273\223\345\255\230\347\256\241\347\220\206/\346\235\241\347\240\201\347\224\237\346\210\220/Sc_BarCodeController.cs" "b/WebAPI/Controllers/\344\273\223\345\255\230\347\256\241\347\220\206/\346\235\241\347\240\201\347\224\237\346\210\220/Sc_BarCodeController.cs"
index 45d5111..75375cf 100644
--- "a/WebAPI/Controllers/\344\273\223\345\255\230\347\256\241\347\220\206/\346\235\241\347\240\201\347\224\237\346\210\220/Sc_BarCodeController.cs"
+++ "b/WebAPI/Controllers/\344\273\223\345\255\230\347\256\241\347\220\206/\346\235\241\347\240\201\347\224\237\346\210\220/Sc_BarCodeController.cs"
@@ -188,9 +188,17 @@
                 switch (HSouceBillType)
                 {
                     case "鐢熶骇璁㈠崟":
-                        tabname = "h_v_IFCLD_ICMOBillList_Source"; 
-                        count = new SQLHelper.ClsCN().RunProcReturn("select * from h_v_IFCLD_ICMOBillList_Source "+sWhere+ " and 浠诲姟鏁伴噺>isnull(鍏ュ簱鏁伴噺,0)  and 鐘舵��<>'缁撴' order by 鍗曟嵁鍙�", tabname).Tables[0].Rows.Count;
-                        sql = string.Format(@"select * from(select row_number() over (order by 鍗曟嵁鍙�) as HRowNumber,* from h_v_IFCLD_ICMOBillList_Source " + sWhere + " and 浠诲姟鏁伴噺>isnull(鍏ュ簱鏁伴噺,0)  and 鐘舵��<>'缁撴')   as A where HRowNumber >" + pageSize + " *(" + pageNum + "-1)");
+                        tabname = "h_v_IFCLD_ICMOBillList_Source";
+                        if (oSystemParameter.omodel.WMS_CampanyName == "鍗庤垷")
+                        {
+                            count = new SQLHelper.ClsCN().RunProcReturn("select * from h_v_IFCLD_ICMOBillList_Source " + sWhere + "  order by 鍗曟嵁鍙�", tabname).Tables[0].Rows.Count;
+                            sql = string.Format(@"select * from(select row_number() over (order by 鍗曟嵁鍙�) as HRowNumber,* from h_v_IFCLD_ICMOBillList_Source " + sWhere + " )   as A where HRowNumber >" + pageSize + " *(" + pageNum + "-1)");
+                        }
+                        else
+                        {
+                            count = new SQLHelper.ClsCN().RunProcReturn("select * from h_v_IFCLD_ICMOBillList_Source " + sWhere + " and 浠诲姟鏁伴噺>isnull(鍏ュ簱鏁伴噺,0)  and 鐘舵��<>'缁撴' order by 鍗曟嵁鍙�", tabname).Tables[0].Rows.Count;
+                            sql = string.Format(@"select * from(select row_number() over (order by 鍗曟嵁鍙�) as HRowNumber,* from h_v_IFCLD_ICMOBillList_Source " + sWhere + " and 浠诲姟鏁伴噺>isnull(鍏ュ簱鏁伴噺,0)  and 鐘舵��<>'缁撴')   as A where HRowNumber >" + pageSize + " *(" + pageNum + "-1)");
+                        }                                              
                         break;
                     case "鐢熶骇姹囨姤鍗�":
                         tabname = "h_v_IF_ICMOReportBillList_Source";
@@ -1451,7 +1459,14 @@
                                 TM = HNumber + "@" + sHMTONo.Replace(" ","") + "@" + HBatchNo.Replace(" ","") + "@" + sHQty;
                             }
                         }
-                        
+                        if (CampanyName == "鍗庤垷") //绯荤粺鍙傛暟  瀹㈡埛瀹氬埗鍖栧悕绉�
+                        {
+                            barcode.JMHSupID = ordrlist[j].JMHSupID;
+                            barcode.JMHSupNumber = ordrlist[j].JMHSupNumber;
+                            barcode.JMHSupName = ordrlist[j].JMHSupName;
+                            barcode.HTH = ordrlist[j].HTH;
+                        }
+
                         barcode.HBarCode2 = TM;
                         barcode.HEntryID2 = ClsPub.isStrNull(j + 1);
                         barcode.HMaterID2 = ordrlist[j].HMaterID;
@@ -1573,6 +1588,12 @@
             string HCusMaterName2 = "";
             string HCheckEmpName2 = "";
 
+            //鍗庤垷
+            Int64 JMHSupID = 0;
+            string JMHSupNumber = "";
+            string JMHSupName = "";
+            string HTH = "";
+
             try
             {
                 oCN.BeginTran();
@@ -1592,8 +1613,14 @@
                         {
                             HBarCode = HBarCode + ClsPub.isStrNull(ListRows[i].HMTONo2);
                         }
-                       
-                        //
+                        if (CampanyName == "鍗庤垷")
+                        {
+                            JMHSupID = ClsPub.isLong(ListRows[i].JMHSupID);
+                            JMHSupNumber = ClsPub.isStrNull(ListRows[i].JMHSupNumber);
+                            JMHSupName = ClsPub.isStrNull(ListRows[i].JMHSupName);
+                            HTH = ClsPub.isStrNull(ListRows[i].HTH);
+                        }
+
                         HMaterID = ClsPub.isLong(ListRows[i].HMaterID2);
                         HEntryID = ClsPub.isLong(ListRows[i].HEntryID2);
                         HAuxPropID = ClsPub.isLong(ListRows[i].HAuxPropID2);
@@ -1635,25 +1662,51 @@
                         HCusModel2 = ClsPub.isStrNull(ListRows[i].HCusModel2);
                         HCusMaterName2 = ClsPub.isStrNull(ListRows[i].HCusMaterName2);
                         HCheckEmpName2 = ClsPub.isStrNull(ListRows[i].HCheckEmpName2);
-                        oCN.RunProc("insert into Gy_BarCodeBill (HBarCode,HBarCodeType,HMaterID,HUnitID,HQty" +
-                                    ",HBatchNo,HSupID,HGroupID,HMaker,HMakeDate,HPrintQty,HinitQty" +
-                                    ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HEndQty " +
-                                    ",HBarcodeQtys,HBarcodeNo,HDeptID,HWhID,HSPID,HRemark " +
-                                    ",HCusID,HCusType,HEndDate,HWorkLineName,HBarCodeDate " +
-                                    ",HSTOCKORGID,HOWNERID,HSeOrderBillNo,HInterID,HEntryID " +
-                                    ",HGiveAwayFlag " +
-                                    ",HMaterName,HMaterModel,HPinfan,HAuxPropID,HMTONo,HInnerBillNo" +
-                                    ",HCoilNO,HFurnaceNO,HFactory,HAuxQty,HheatNO,HProduceDate,HExpiryDate,HEmpID,HCusModel,HCusMaterName,HCheckEmpName " +
-                                    ") values ("
-                                    + "'" + HBarCode + "','" + HBarCodeType + "'," + HMaterID.ToString() + "," + HUnitID.ToString() + "," + HQty2.ToString()
-                                    + ",'" + HBatchNo2 + "'," + HSupID.ToString() + "," + HGroupID2.ToString() + ",'" + ClsPub.CurUserName + "',getdate()," + HPrintQty.ToString() + "," + HQty2.ToString()
-                                    + ", " + HSourceInterID.ToString() + "," + HSourceEntryID.ToString() + ",'" + HSourceBillNo + "','" + HSourceBillType + "','" + HWei + "'"
-                                    + ", " + HBarcodeQtys.ToString() + "," + HBarcodeNo.ToString() + "," + HDeptID.ToString() + "," + HWhID.ToString() + "," + HSPID.ToString() + ",'" + HRemark + "'"
-                                    + ", " + HCusID.ToString() + ",'" + HCusType + "','" + HEndDate.ToShortDateString() + "','" + HWorkLineName + "','" + sDate + "'"
-                                    + ", " + HOrgID.ToString() + "," + HOrgID.ToString() + ",'" + HSeOrderBillNo + "'," + HInterID.ToString() + "," + HEntryID.ToString() + ""
-                                    + ", " + DBUtility.ClsPub.BoolToString(HGiveAwayFlag)
-                                    + ",'" + HMaterName + "','" + HMaterModel + "','" + HPinfan + "'," + HAuxPropID.ToString() + ",'" + HMTONo + "','" + HInnerBillNo + "'"
-                                    + ",'" + HCoilNO2 + "','" + HFurnaceNO2 + "','" + HFactory2 + "'," + HAuxQty2 + ",'" + HheatNO2 + "','" + HProduceDate + "','" + HExpiryDate + "'," + HEmpID2.ToString() + ",'" + HCusModel2 + "','" + HCusMaterName2 + "','" + HCheckEmpName2 + "'" + ")");
+                        if (CampanyName == "鍗庤垷")
+                        {
+                            oCN.RunProc("insert into Gy_BarCodeBill (HBarCode,HBarCodeType,HMaterID,HUnitID,HQty" +
+                                   ",HBatchNo,HSupID,HGroupID,HMaker,HMakeDate,HPrintQty,HinitQty" +
+                                   ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HEndQty " +
+                                   ",HBarcodeQtys,HBarcodeNo,HDeptID,HWhID,HSPID,HRemark " +
+                                   ",HCusID,HCusType,HEndDate,HWorkLineName,HBarCodeDate " +
+                                   ",HSTOCKORGID,HOWNERID,HSeOrderBillNo,HInterID,HEntryID " +
+                                   ",HGiveAwayFlag,JMHSupID,JMHSupNumber,JMHSupName,HTH" +
+                                   ",HMaterName,HMaterModel,HPinfan,HAuxPropID,HMTONo,HInnerBillNo" +
+                                   ",HCoilNO,HFurnaceNO,HFactory,HAuxQty,HheatNO,HProduceDate,HExpiryDate,HEmpID,HCusModel,HCusMaterName,HCheckEmpName " +
+                                   ") values ("
+                                   + "'" + HBarCode + "','" + HBarCodeType + "'," + HMaterID.ToString() + "," + HUnitID.ToString() + "," + HQty2.ToString()
+                                   + ",'" + HBatchNo2 + "'," + HSupID.ToString() + "," + HGroupID2.ToString() + ",'" + ClsPub.CurUserName + "',getdate()," + HPrintQty.ToString() + "," + HQty2.ToString()
+                                   + ", " + HSourceInterID.ToString() + "," + HSourceEntryID.ToString() + ",'" + HSourceBillNo + "','" + HSourceBillType + "','" + HWei + "'"
+                                   + ", " + HBarcodeQtys.ToString() + "," + HBarcodeNo.ToString() + "," + HDeptID.ToString() + "," + HWhID.ToString() + "," + HSPID.ToString() + ",'" + HRemark + "'"
+                                   + ", " + HCusID.ToString() + ",'" + HCusType + "','" + HEndDate.ToShortDateString() + "','" + HWorkLineName + "','" + sDate + "'"
+                                   + ", " + HOrgID.ToString() + "," + HOrgID.ToString() + ",'" + HSeOrderBillNo + "'," + HInterID.ToString() + "," + HEntryID.ToString() + ""
+                                   + ", " + DBUtility.ClsPub.BoolToString(HGiveAwayFlag)+",'"+ JMHSupID.ToString()+"','"+ JMHSupNumber+"','"+ JMHSupName+"','"+ HTH
+                                   + "','" + HMaterName + "','" + HMaterModel + "','" + HPinfan + "'," + HAuxPropID.ToString() + ",'" + HMTONo + "','" + HInnerBillNo + "'"
+                                   + ",'" + HCoilNO2 + "','" + HFurnaceNO2 + "','" + HFactory2 + "'," + HAuxQty2 + ",'" + HheatNO2 + "','" + HProduceDate + "','" + HExpiryDate + "'," + HEmpID2.ToString() + ",'" + HCusModel2 + "','" + HCusMaterName2 + "','" + HCheckEmpName2 + "'" + ")");
+                        }
+                        else
+                        {
+                            oCN.RunProc("insert into Gy_BarCodeBill (HBarCode,HBarCodeType,HMaterID,HUnitID,HQty" +
+                                   ",HBatchNo,HSupID,HGroupID,HMaker,HMakeDate,HPrintQty,HinitQty" +
+                                   ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HEndQty " +
+                                   ",HBarcodeQtys,HBarcodeNo,HDeptID,HWhID,HSPID,HRemark " +
+                                   ",HCusID,HCusType,HEndDate,HWorkLineName,HBarCodeDate " +
+                                   ",HSTOCKORGID,HOWNERID,HSeOrderBillNo,HInterID,HEntryID " +
+                                   ",HGiveAwayFlag " +
+                                   ",HMaterName,HMaterModel,HPinfan,HAuxPropID,HMTONo,HInnerBillNo" +
+                                   ",HCoilNO,HFurnaceNO,HFactory,HAuxQty,HheatNO,HProduceDate,HExpiryDate,HEmpID,HCusModel,HCusMaterName,HCheckEmpName " +
+                                   ") values ("
+                                   + "'" + HBarCode + "','" + HBarCodeType + "'," + HMaterID.ToString() + "," + HUnitID.ToString() + "," + HQty2.ToString()
+                                   + ",'" + HBatchNo2 + "'," + HSupID.ToString() + "," + HGroupID2.ToString() + ",'" + ClsPub.CurUserName + "',getdate()," + HPrintQty.ToString() + "," + HQty2.ToString()
+                                   + ", " + HSourceInterID.ToString() + "," + HSourceEntryID.ToString() + ",'" + HSourceBillNo + "','" + HSourceBillType + "','" + HWei + "'"
+                                   + ", " + HBarcodeQtys.ToString() + "," + HBarcodeNo.ToString() + "," + HDeptID.ToString() + "," + HWhID.ToString() + "," + HSPID.ToString() + ",'" + HRemark + "'"
+                                   + ", " + HCusID.ToString() + ",'" + HCusType + "','" + HEndDate.ToShortDateString() + "','" + HWorkLineName + "','" + sDate + "'"
+                                   + ", " + HOrgID.ToString() + "," + HOrgID.ToString() + ",'" + HSeOrderBillNo + "'," + HInterID.ToString() + "," + HEntryID.ToString() + ""
+                                   + ", " + DBUtility.ClsPub.BoolToString(HGiveAwayFlag)
+                                   + ",'" + HMaterName + "','" + HMaterModel + "','" + HPinfan + "'," + HAuxPropID.ToString() + ",'" + HMTONo + "','" + HInnerBillNo + "'"
+                                   + ",'" + HCoilNO2 + "','" + HFurnaceNO2 + "','" + HFactory2 + "'," + HAuxQty2 + ",'" + HheatNO2 + "','" + HProduceDate + "','" + HExpiryDate + "'," + HEmpID2.ToString() + ",'" + HCusModel2 + "','" + HCusMaterName2 + "','" + HCheckEmpName2 + "'" + ")");
+                        }
+                       
 
 
                         //HNumber = ClsPub.isStrNull(grdSub.Rows[i].Cells[HMaterID2Col].Value);
@@ -2829,6 +2882,7 @@
                             HBarCode_Temp = HPOOrderBillMTO_TMN + "|" + HMaterNumber_BarCode + "|" + HInspectionDate_BarCode + "|" + HQty_BarCode + "|" + LSH;
 
                             HBarCodeList barcode = new HBarCodeList();
+                            barcode.HSourceBillSEQ = ordrlist[i].HSourceBillSEQ;  // 婧愬崟琛屽彿
                             barcode.HBarCode2 = HBarCode_Temp;
                             barcode.HBarCodeType2 = "鍞竴鏉$爜";
                             barcode.HBarCodeSubType2 = "";
@@ -2974,10 +3028,10 @@
                         string HInspectionDate = ListRows[i].HInspectionDate;
                         int HInspectionCycle = ClsPub.isInt(ListRows[i].HInspectionCycle);
                         string HReInspectionDate = ListRows[i].HInspectionDate;
+                        int HSourceBillSEQ = ClsPub.isInt(ListRows[i].HSourceBillSEQ);
                         string HCustomBatchNo = ClsPub.isStrNull(ListRows[i].HInspectionDate).Replace("-","");
                         string HBarCodeStatus = "姝e父";
                         string HPOOrderBillNoMTO = ClsPub.isStrNull(ListRows[i].HPOOrderBillMTO);
-
                         string sql_produceBarCode = "insert into Gy_BarCodeBill (HBarCode,HBarCodeType,HBarCodeSubType,HMaterID,HUnitID,HQty" +
                                     ",HBatchNo,HSupID,HGroupID,HMaker,HMakeDate,HPrintQty,HinitQty" +
                                     ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HEndQty " +
@@ -2987,7 +3041,7 @@
                                     ",HGiveAwayFlag " +
                                     ",HMaterName,HMaterModel,HPinfan,HAuxPropID,HMTONo,HInnerBillNo" +
                                     ",HCoilNO,HFurnaceNO,HFactory,HAuxQty,HheatNO,HProduceDate,HExpiryDate,HEmpID,HCusModel,HCusMaterName,HCheckEmpName,HCustomBatchNo,HBarCodeStatus,HOrderBillNo" +
-                                    ",HReInspectionFlag,HInspectionDate,HInspectionCycle,HReInspectionDate " +
+                                    ",HReInspectionFlag,HInspectionDate,HInspectionCycle,HReInspectionDate,HSourceBillSEQ " +
                                     ") values ("
                                     + "'" + HBarCode + "','" + HBarCodeType + "','" + HBarCodeSubType + "'," + HMaterID.ToString() + "," + HUnitID.ToString() + "," + HQty2.ToString()
                                     + ",'" + HBatchNo2 + "'," + HSupID.ToString() + "," + HGroupID2.ToString() + ",'" + ClsPub.CurUserName + "',getdate()," + HPrintQty.ToString() + "," + HQty2.ToString()
@@ -2999,6 +3053,7 @@
                                     + ",'" + HMaterName + "','" + HMaterModel + "','" + HPinfan + "'," + HAuxPropID.ToString() + ",'" + HMTONo + "','" + HInnerBillNo + "'"
                                     + ",'" + HCoilNO2 + "','" + HFurnaceNO2 + "','" + HFactory2 + "'," + HAuxQty2 + ",'" + HheatNO2 + "','" + HProduceDate + "','" + HExpiryDate + "'," + HEmpID2.ToString() + ",'" + HCusModel2 + "','" + HCusMaterName2 + "','" + HCheckEmpName2 + "','" + HCustomBatchNo + "','" + HBarCodeStatus + "','" + HPOOrderBillNoMTO + "'" +
                                     "," + HReInspectionFlag + "," + (HInspectionDate == null ? "null" : "'" + HInspectionDate + "'") + "," + HInspectionCycle + "," + (HReInspectionDate == null ? "null" : "'" + HReInspectionDate + "'") +
+                                    "," + HSourceBillSEQ +
                                     ")";
 
                         oCN.RunProc(sql_produceBarCode);

--
Gitblit v1.9.1