From 2fa71a673f27b62038ceba4da0413dd7bc0f3497 Mon Sep 17 00:00:00 2001
From: chenhaozhe <cgz@hz-kingdee.com>
Date: 星期四, 16 十月 2025 13:20:03 +0800
Subject: [PATCH] Merge branch 'master' of http://101.37.171.70:10101/r/MES-WEB-API

---
 DAL/车间管理/ClsSc_ProcessExchangeBill.cs |   71 ++++++++++++++++++++++++++++++-----
 1 files changed, 61 insertions(+), 10 deletions(-)

diff --git "a/DAL/\350\275\246\351\227\264\347\256\241\347\220\206/ClsSc_ProcessExchangeBill.cs" "b/DAL/\350\275\246\351\227\264\347\256\241\347\220\206/ClsSc_ProcessExchangeBill.cs"
index 4a758c2..fec84bb 100644
--- "a/DAL/\350\275\246\351\227\264\347\256\241\347\220\206/ClsSc_ProcessExchangeBill.cs"
+++ "b/DAL/\350\275\246\351\227\264\347\256\241\347\220\206/ClsSc_ProcessExchangeBill.cs"
@@ -82,6 +82,7 @@
                 ",HPRDORGID='" + omodel.HPRDORGID.ToString() + "'" +
                 ",HPeriod='" + omodel.HPeriod.ToString() + "'" +
                 ",HRemark='" + omodel.HRemark + "'" +
+                ",HMouldNum='" + omodel.HMouldNum + "'" +
                 ",HUpDater='" + DBUtility.ClsPub.CurUserName + "'" +
                 ",HUpDateDate=getdate()" +
                 ",HMainSourceBillSubType='" + omodel.HMainSourceBillSubType + "'" +
@@ -124,6 +125,10 @@
                 ",HWeight='" + omodel.HWeight + "'" +
                 ",HAuxQty='" + omodel.HAuxQty + "'" +
                 ",HAuxUnit='" + omodel.HAuxUnit + "'" +
+
+                ",HAuxQty2='" + omodel.HAuxQty2 + "'" +
+                ",HAuxUnit2='" + omodel.HAuxUnit2 + "'" +
+
                 ",HSplitNo='" + omodel.HSplitNo + "'" +
                 ",HHeight='" + omodel.HHeight + "'" +
                 ",HInches='" + omodel.HInches + "'" +
@@ -196,7 +201,7 @@
                       ",HLastProc,HKeyProc,HFstProc,HICMOInterID,HICMOBillNo,HWWOrderInterID," +
                       "HWWOrderEntryID,HWWOrderBillNo,HReportQty,HBackProc" +
                       ",HSupID,HSupFlag,HOverRate,HMaxQty,HTechnologyParameter,HProcCheckNote,HPicNum" +
-                      ",HMouldNo,HProcWorkNum,HSeOrderInterID,HSeOrderEntryID,HRelationQty_OutBad,HSNCtrl" +
+                      ",HMouldNo,HProcWorkNum,HSeOrderInterID,HSeOrderEntryID,HRelationQty_OutBad,HSNCtrl,HRoutingBillMainID,HRoutingBillEntryID" +
                       ") values("
                       + omodel.HInterID.ToString() + "," + oSub.HEntryID.ToString() + ",'" + omodel.HBillNo + "'" +
                       ",'" + oSub.HCloseMan + "','" + oSub.HEntryCloseDate + "'," + Convert.ToString(oSub.HCloseType ? 1 : 0) + ",'" + oSub.HRemark + "'" +
@@ -215,6 +220,7 @@
                       "," + oSub.HWWOrderEntryID.ToString() + ",'" + oSub.HWWOrderBillNo + "'," + oSub.HReportQty.ToString() + "," + Convert.ToString(oSub.HBackProc ? 1 : 0) +
                       "," + oSub.HSupID.ToString() + "," + Convert.ToString(oSub.HSupFlag ? 1 : 0) + "," + oSub.HOverRate.ToString() + "," + oSub.HMaxQty.ToString() + ",'" + oSub.HTechnologyParameter + "','" + oSub.HProcCheckNote + "','" + oSub.HPicNum + "'" +
                       ",'" + oSub.HMouldNo + "','" + oSub.HProcWorkNum + "','" + DBUtility.ClsPub.isInt(omodel.HSeOrderInterID) + "','" + DBUtility.ClsPub.isInt(omodel.HSeOrderEntryID) + "','" + DBUtility.ClsPub.isInt(oSub.HRelationQty_OutBad) + "'," + Convert.ToString(oSub.HSNCtrl ? 1 : 0) +
+                      "," + oSub.HRoutingBillMainID + "," + oSub.HRoutingBillEntryID +
                       ") ");
                     oCn.RunProc(sql1);
                 }
@@ -337,7 +343,26 @@
             try
             {
                 //寰楀埌mainid
-                omodel.HInterID = DBUtility.ClsPub.CreateBillID(BillType, ref DBUtility.ClsPub.sExeReturnInfo);
+                if (omodel.HInterID == 0 || omodel.HInterID.ToString() == null || omodel.HInterID.ToString() == "undefined")
+                {
+                    omodel.HInterID = DBUtility.ClsPub.CreateBillID(BillType, ref DBUtility.ClsPub.sExeReturnInfo);
+                }
+
+                //妫�鏌ヤ富琛ㄥ唴鐮佹槸鍚﹂噸澶嶏紝鑻ラ噸澶嶅垯閲嶆柊鐢熸垚骞剁户缁鏌ワ紝鐩村埌涓嶅啀閲嶅
+                DataSet ds_repeat;
+                while (true)
+                {
+                    ds_repeat = oCn.RunProcReturn("select * from Sc_ProcessExchangeBillMain where HInterID = " + omodel.HInterID, "Sc_ProcessExchangeBillMain");
+                    if (ds_repeat != null && ds_repeat.Tables[0].Rows.Count > 0)
+                    {
+                        omodel.HInterID = DBUtility.ClsPub.CreateBillID(BillType, ref DBUtility.ClsPub.sExeReturnInfo);
+                    }
+                    else
+                    {
+                        break;
+                    }
+                }
+
                 //鑻AINDI閲嶅鍒欓噸鏂拌幏鍙�
 
                 //淇濆瓨鍓嶆帶鍒�=========================================
@@ -370,10 +395,11 @@
                 ",HMaterNumber_B,HMaterNumber_C,HMaterNumber_D,HProdType,HMaterShortName" +
                 ",HMaterIDA,HMaterIDB,HMaterIDC,HMaterIDD,HICMOEntryID" +       
 ",HPicNumVer,HPicNumAssemble,HMaterTexture,HProductNum,HVerNum,HPRDORGID,HBLFlag,HCusNumber,HPickLabel,HPickLabelNumber,HXTNumber,HXTModel,HWorkBillSortNo" +
-               ", HRoutingBillID,HMaterModel,HWidth,HWeight,HAuxQty,HAuxUnit,HSplitNo" +
+               ", HRoutingBillID,HMaterModel,HWidth,HWeight,HAuxQty,HAuxUnit,HAuxQty2,HAuxUnit2,HSplitNo" +
                ",HHeight,HInches,HAl1Long,HDensity,HTela,HUnderTela,HSizing,HSellDate" +
                ",HRemark2,HRemark3,HEmpID,HCusID,HColorRemark,HSplitSumQty,HSplitColorQty,HMachineLine" +
-               ",HMainSourceInterID,HMainSourceEntryID,HMainSourceBillNo,HOrderLevID,HWidth_New,HRemark_New,HWeight_New,HPlanOrderProcNo) " +
+               ",HMainSourceInterID,HMainSourceEntryID,HMainSourceBillNo,HOrderLevID,HWidth_New,HRemark_New,HWeight_New,HPlanOrderProcNo" +
+               ",HMouldNum) " +
                 " values('" + this.BillType + "','" + omodel.HBillSubType + "','" + (omodel.HMainSourceBillSubType==null?"": omodel.HMainSourceBillSubType) + "'," + omodel.HInterID.ToString() + ",'" + omodel.HBillNo + "','" + omodel.HDate + "','" + omodel.HMaker + "',getdate()," + "" + (omodel.HPrevMainSourceInterID == 0 ? omodel.HInterID : omodel.HPrevMainSourceInterID) +
                 "," + omodel.HYear.ToString() + "," + omodel.HPeriod.ToString() + ",'" + omodel.HRemark + "','" + omodel.HBatchNo + "'," + omodel.HMainMaterID.ToString() + "," + omodel.HKeyMaterID.ToString() + "," + omodel.HNo.ToString() + ",'" + omodel.HOrderProcNO + "'" +
                 "," + omodel.HWWOrderInterID.ToString() + "," + omodel.HWWOrderEntryID.ToString() + ",'" + omodel.HWWOrderBillNo + "'," + omodel.HICMOInterID.ToString() + "," + omodel.HEquipMentID.ToString() +
@@ -385,10 +411,11 @@
                 ",'" + omodel.HMaterNumber_B + "','" + omodel.HMaterNumber_C + "','" + omodel.HMaterNumber_D + "','" + omodel.HProdType + "','" + omodel.HMaterShortName + "'" +
                 ",'" + omodel.HMaterIDA + "','" + omodel.HMaterIDB + "','" + omodel.HMaterIDC + "','" + omodel.HMaterIDD + "'," + omodel.HICMOEntryID +
                 ",'" + omodel.HPicNumVer + "','" + omodel.HPicNumAssemble + "','" + omodel.HMaterTexture + "','" + omodel.HProductNum + "','" + omodel.HVerNum + "','"+ omodel.HPRDORGID+ "','" + (omodel.HBLFlag ? 1 : 0) + "','" + omodel.HCusNumber + "','" + omodel.HPickLabel + "','" + omodel.HPickLabelNumber + "','" + omodel.HXTNumber + "','" + omodel.HXTModel + "','" + omodel.HWorkBillSortNo + 
-                "','"+ omodel.HRoutingBillID + "','"+ omodel.HMaterModel + "',"+ omodel.HWidth + ","+ omodel.HWeight + ","+ omodel.HAuxQty + ","+ omodel.HAuxUnit +","+ omodel.HSplitNo +"" +
+                "','"+ omodel.HRoutingBillID + "','"+ omodel.HMaterModel + "',"+ omodel.HWidth + ","+ omodel.HWeight + ","+ omodel.HAuxQty + ","+ omodel.HAuxUnit + "," + omodel.HAuxQty2 + "," + omodel.HAuxUnit2 + ","+ omodel.HSplitNo +"" +
                 ",'" + omodel.HHeight + "','" + omodel.HInches + "','" + omodel.HAl1Long + "','" + omodel.HDensity + "','" + omodel.HTela + "','" + omodel.HUnderTela + "','" + omodel.HSizing + "','" + omodel.HSellDate + "'" +
                 ",'"+ omodel.HRemark2 + "','"+ omodel.HRemark3 + "',"+ omodel.HEmpID + "," + omodel.HCusID + ",'"+ omodel.HColorRemark + "',"+ omodel.HSplitSumQty + ","+ omodel.HSplitColorQty + ",'"+ omodel.HMachineLine + "'" +
                 ","+ omodel.HMainSourceInterID + "," + omodel.HMainSourceEntryID + ",'" + omodel.HMainSourceBillNo + "','" + omodel.HOrderLevID + "'," + omodel.HWidth_New + ",'" + omodel.HRemark_New + "'," + omodel.HWeight_New + ",'" + omodel.HPlanOrderProcNo + "'" +
+                ",'"+ omodel.HMouldNum + "'" +
                 ")");
                 sErr = sErr + "1;";
                 //鎻掑叆瀛愯〃
@@ -412,7 +439,7 @@
                       ",HLastProc,HKeyProc,HFstProc,HICMOInterID,HICMOBillNo,HWWOrderInterID," +
                       "HWWOrderEntryID,HWWOrderBillNo,HReportQty,HBackProc" +
                       ",HSupID,HSupFlag,HOverRate,HMaxQty,HTechnologyParameter,HProcCheckNote,HPicNum" +
-                      ",HMouldNo,HProcWorkNum,HSeOrderInterID,HSeOrderEntryID,HSNCtrl" +
+                      ",HMouldNo,HProcWorkNum,HSeOrderInterID,HSeOrderEntryID,HSNCtrl,HRoutingBillMainID,HRoutingBillEntryID" +
                       ") values("
                       + omodel.HInterID.ToString() + "," + oSub.HEntryID.ToString() + ",'" + omodel.HBillNo + "'" +
                       ",'" + oSub.HCloseMan + "','" + oSub.HEntryCloseDate + "'," + Convert.ToString(oSub.HCloseType ? 1 : 0) + ",'" + oSub.HRemark + "'" +
@@ -430,7 +457,8 @@
                       ",'" + oSub.HKeyProc + "','" + oSub.HFstProc + "'," + oSub.HICMOInterID.ToString() + ",'" + oSub.HICMOBillNo + "'," + oSub.HWWOrderInterID.ToString() +
                       "," + oSub.HWWOrderEntryID.ToString() + ",'" + oSub.HWWOrderBillNo + "'," + oSub.HReportQty.ToString() + "," + Convert.ToString(oSub.HBackProc ? 1 : 0) +
                       "," + oSub.HSupID.ToString() + "," + Convert.ToString(oSub.HSupFlag ? 1 : 0) + "," + oSub.HOverRate.ToString() + "," + oSub.HMaxQty.ToString() + ",'" + oSub.HTechnologyParameter + "','" + oSub.HProcCheckNote + "','" + oSub.HPicNum + "'" +
-                      ",'" + oSub.HMouldNo + "','" + oSub.HProcWorkNum + "','" + DBUtility.ClsPub.isStrNull( omodel.HSeOrderInterID) + "','" + DBUtility.ClsPub.isStrNull(omodel.HSeOrderEntryID) + "'," + Convert.ToString(oSub.HSNCtrl ? 1 : 0) +
+                      ",'" + oSub.HMouldNo + "','" + oSub.HProcWorkNum + "','" + DBUtility.ClsPub.isStrNull( omodel.HSeOrderInterID) + "','" + DBUtility.ClsPub.isStrNull(omodel.HSeOrderEntryID) + "'," + Convert.ToString(oSub.HSNCtrl ? 1 : 0) + "," + oSub.HRoutingBillMainID
+                      + "," + oSub.HRoutingBillEntryID +
                       ") ");
                     sErr = sErr + sql1 + "2;";
                     oCn.RunProc(sql1);
@@ -489,12 +517,34 @@
                 {
                     if (oSystemParameter.omodel.Sc_ProcessExchangeBill_AutoBarCode == "Y") //绯荤粺鍙傛暟  宸ュ簭娴佽浆鍗′繚瀛樻椂鑷姩鍚屾鏉$爜淇℃伅鑷虫潯鐮佹。妗�
                     {
-                        oCn.RunProc("insert into Gy_BarCodeBill (HBarCode,HBarCodeType,HMaterID,HUnitID,HQty" +
+                        Int64 HBarCodeInterID =  DBUtility.ClsPub.CreateBillID_Prod("85", ref DBUtility.ClsPub.sExeReturnInfo);
+
+                        if (oSystemParameter.omodel.WMS_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,HGiveAwayFlag" +
+                            ",HSTOCKORGID,HOWNERID,HSeOrderBillNo,HInterID,HEntryID,HGiveAwayFlag" +
+                            ",HMaterName,HMaterModel,HPinfan,HAuxPropID,HMTONo,HInnerBillNo" +
+                            ") values ("
+                            + "'" + omodel.HBillNo + "','鍞竴鏉$爜'," + omodel.HMaterID.ToString() + "," + omodel.HUnitID.ToString() + "," + omodel.HQty.ToString()
+                            + ",'" + omodel.HBatchNo + "'," + omodel.HSupID.ToString() + ",0,'" + omodel.HMaker + "',getdate(),0," + omodel.HQty.ToString()
+                            + ", " + omodel.HICMOInterID.ToString() + "," + omodel.HICMOEntryID + ",'" + omodel.HICMOBillNo + "','3710',''"
+                            + ",1,1,0,0,0,'宸ュ簭娴佽浆鍗′繚瀛樿嚜鍔ㄥ悓姝�'"
+                            + ",0,'',getdate(),'',getdate()"
+                            + ", " + omodel.HPRDORGID + "," + omodel.HPRDORGID + ",''," + HBarCodeInterID + ",1,0"
+                            + ",'','','',0,'','')");
+                        }
+                        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" +
                             ") values ("
                             + "'" + omodel.HBillNo + "','鍞竴鏉$爜'," + omodel.HMaterID.ToString() + "," + omodel.HUnitID.ToString() + "," + omodel.HQty.ToString()
@@ -502,8 +552,9 @@
                             + ", " + omodel.HInterID.ToString() + ",1,'" + omodel.HBillNo + "','3772',''"
                             + ",1,1,0,0,0,'宸ュ簭娴佽浆鍗′繚瀛樿嚜鍔ㄥ悓姝�'"
                             + ",0,'',getdate(),'',getdate()"
-                            + ", " + omodel.HPRDORGID + "," + omodel.HPRDORGID + ",'',0,0"
+                            + ", " + omodel.HPRDORGID + "," + omodel.HPRDORGID + ",''," + HBarCodeInterID + ",1,0"
                             + ",'','','',0,'','')");
+                        }                        
                     }
                 }
                 else

--
Gitblit v1.9.1