From eaeff1134f0e4e35ba050d0809500d05ee869cc8 Mon Sep 17 00:00:00 2001
From: wangyi <2946747746@qq.com>
Date: 星期一, 30 三月 2026 18:33:07 +0800
Subject: [PATCH] 出运单修改

---
 DAL/ClsWL_YayBillMain.cs |  149 ++++++++++++++++++-------------------------------
 1 files changed, 56 insertions(+), 93 deletions(-)

diff --git a/DAL/ClsWL_YayBillMain.cs b/DAL/ClsWL_YayBillMain.cs
index d45d241..6214bad 100644
--- a/DAL/ClsWL_YayBillMain.cs
+++ b/DAL/ClsWL_YayBillMain.cs
@@ -63,7 +63,7 @@
 
                 //淇濆瓨鍓嶆帶鍒�=========================================
                 string HBillNote = "";
-                DataSet ds = oCn.RunProcReturn("Exec h_p_Gy_QCVerificationBill_BeforeSaveCtrl " + omodel.HInterID.ToString() + ", '" + omodel.HBillNo + "','" + HBillNote + "',2 ", "h_p_Gy_QCVerificationBill_BeforeSaveCtrl");
+                DataSet ds = oCn.RunProcReturn("Exec h_p_WL_YayBill_BeforeSaveCtrl " + omodel.HInterID.ToString() + ", '" + omodel.HBillNo + "','" + HBillNote + "',2 ", "h_p_Gy_QCVerificationBill_BeforeSaveCtrl");
                 if (ds == null)
                 {
                     sReturn = "淇濆瓨鍓嶅垽鏂け璐ワ紒";
@@ -92,11 +92,8 @@
                 ",HMainSourceInterID='" + omodel.HMainSourceInterID.ToString() + "'" +
                 ",HMainSourceEntryID='" + omodel.HMainSourceEntryID.ToString() + "'" +
 
-                ",HCusID='" + omodel.HCusID.ToString() + "'" +
                 ",HBeginAddr='" + omodel.HBeginAddr.ToString() + "'" +
                 ",HEndAddr='" + omodel.HEndAddr.ToString() + "'" +
-                ",HPickAddr='" + omodel.HPickAddr.ToString() + "'" +
-                ",HArriverAddr='" + omodel.HArriverAddr.ToString() + "'" +
                 ",HTransType='" + omodel.HTransType.ToString() + "'" +
                 ",HCarTypeID='" + omodel.HCarTypeID.ToString() + "'" +
                 ",HCarTypeMaxVolume='" + omodel.HCarTypeMaxVolume.ToString() + "'" +
@@ -145,7 +142,7 @@
                "(HInterID,HBillNo_bak,HEntryID,HCloseMan,HEntryCloseDate,HCloseType,HRemark" +
                ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney" +
                ",HMaterID,HUnitID,HMouldID,HMouldLength,HMouldHeight,HMouldWidth" +
-               ",HMouldFoldHeight,HVolume,HQty,HSNP,HScatteredVolume,HMouldQty) values("
+               ",HMouldFoldHeight,HVolume,HQty,HSNP,HScatteredVolume,HMouldQtym,,HCusID,HPickAddr,HArriverAddr) values("
                + SafeInt(omodel.HInterID.ToString(), 0) + ",'" // HInterID int
                + SafeString(omodel.HBillNo.ToString()) + "'," // HBillNo_bak varchar(50)
                + (oSub.HEntryID) + ",'" // HEntryID int
@@ -170,12 +167,15 @@
                + (oSub.HQty.ToString() == "" ? 0 : oSub.HQty) + "," // HQty dec(18,8)
                + (oSub.HSNP.ToString() == "" ? 0 : oSub.HSNP) + "," // HSNP dec(18,8)
                + (oSub.HScatteredVolume) + "," // HSNP dec(18,8)
-               + (oSub.HMouldQty.ToString() == "" ? 0 : oSub.HMouldQty) + ")"; // HMouldQty dec(18,8)
+               + (oSub.HMouldQty.ToString() == "" ? 0 : oSub.HMouldQty) + ","
+               + (oSub.HCusID) + "," // HSNP dec(18,8)
+               + "'" + SafeString(oSub.HPickAddr?.ToString(), "") + "',"
+               + "'" + SafeString(oSub.HArriverAddr?.ToString(), "") + "')"; // HMouldQty dec(18,8)
                     oCn.RunProc(sql);
                 }
 
                 //=========================淇濆瓨鍚庢帶鍒�  
-                DataSet ds2 = oCn.RunProcReturn("Exec h_p_Gy_QCVerificationBill_AfterSaveCtrl " + omodel.HInterID.ToString() + ", '" + omodel.HBillNo + "',2 ", "h_p_Gy_QCVerificationBill_AfterSaveCtrl");
+                DataSet ds2 = oCn.RunProcReturn("Exec h_p_WL_YayBill_AfterSaveCtrl " + omodel.HInterID.ToString() + ", '" + omodel.HBillNo + "',2 ", "h_p_Gy_QCVerificationBill_AfterSaveCtrl");
 
 
                 if (ds2 == null)
@@ -213,7 +213,7 @@
 
                 //淇濆瓨鍓嶆帶鍒�=========================================
                 string HBillNote = "";
-                DataSet ds = oCn.RunProcReturn("Exec h_p_Gy_QCVerificationBill_BeforeSaveCtrl " + omodel.HInterID.ToString() + ", '" + omodel.HBillNo + "','" + HBillNote + "',1 ", "h_p_Gy_QCVerificationBill_BeforeSaveCtrl");
+                DataSet ds = oCn.RunProcReturn("Exec h_p_WL_YayBill_BeforeSaveCtrl " + omodel.HInterID.ToString() + ", '" + omodel.HBillNo + "','" + HBillNote + "',1 ", "h_p_Gy_QCVerificationBill_BeforeSaveCtrl");
                 if (ds == null)
                 {
                     sReturn = "淇濆瓨鍓嶅垽鏂け璐ワ紒";
@@ -231,94 +231,54 @@
                 // 鑾峰彇褰撳墠鏃ユ湡鏃堕棿锛岀敤浜庣┖鏃ユ湡瀛楁鐨勯粯璁ゅ��
                 // 鑾峰彇褰撳墠鏃ユ湡鏃堕棿
                 string currentDateTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
+                string safeDateTime = "null";
                 // 杈呭姪鏂规硶锛氬畨鍏ㄨ浆鎹负瀛楃涓诧紝澶勭悊null鍜岀┖瀛楃涓�
-
-
                 string sql = "Insert Into WL_YayBillMain " +
                            "(HInterID,HYear,HPeriod,HBillType,HBillSubType,HDate,HBillNo,HBillStatus," +
-                           "HCheckItemNowID,HCheckItemNextID,HCheckFlowID,HRemark,HBacker,HBackDate," +
-                           "HBackRemark,HChecker,HCheckDate,HMaker,HMakeDate,HUpDater,HUpDateDate," +
-                           "HCloseMan,HCloseDate,HCloseType,HDeleteMan,HDeleteDate," +
-                           "HMainSourceBillType,HMainSourceInterID,HMainSourceEntryID,HMainSourceBillNo," +
-                           "HPrintQty,HOrgID,HCusID,HBeginAddr,HEndAddr,HPickAddr," +
-                           "HArriverAddr,HTransType,HCarTypeID,HCarTypeMaxVolume,HTotalVolume," +
+                           "HRemark,HMaker,HMakeDate,HMainSourceBillType,HMainSourceInterID,HMainSourceEntryID,HMainSourceBillNo," +
+                           "HOrgID,HBeginAddr,HEndAddr,HTransType,HCarTypeID,HCarTypeMaxVolume,HTotalVolume," +
                            "HLoadingRate,HContractTransportInterID,HContractTransportEntryID," +
                            "HContractTransportBillNo,HCarrierID,HDistance,HTransportTimes," +
                            "HTransportTyep,HSSID,HCurID,HMoney,HDateForRequestedPick," +
-                           "HDataForRequestedArrived,HCarryStatus,HDate_CarrierSure," +
-                           "HDate_AllocationDriver,HCarID,HDriverID,HSurer_Arrive,HDate_Arrive," +
-                           "HSurer_Pick,HDate_Pick,HSurer_Trans,HDate_Trans,HSurer_Receive,HExRate," +
-                           "HDate_Receive,HSurer_Accounting,HDate_Accounting) " +
-                           "values(" +
-                           SafeInt(omodel.HInterID.ToString(), 0) + "," + // HInterID
-                           "0,0," + // HYear, HPeriod - 闇�瑕佷粠HDate璁$畻锛岃繖閲屽厛缁�0
-                           "'" + SafeString(this.BillType) + "'," +
-                           "'" + SafeString(this.HBillSubType) + "'," +
-                           SafeDateTime(omodel.HDate.ToString(), "'" + currentDateTime + "'") + "," +
-                           "'" + SafeString(omodel.HBillNo) + "'," +
-                           SafeInt(omodel.HBillStatus.ToString(), 1) + "," + // HBillStatus
-                           SafeInt(omodel.HCheckItemNowID.ToString(), 0) + "," + // HCheckItemNowID
-                           SafeInt(omodel.HCheckItemNextID.ToString(), 0) + "," + // HCheckItemNextID
-                           SafeInt(omodel.HCheckFlowID.ToString(), 0) + "," + // HCheckFlowID
-                           "'" + SafeString(omodel.HRemark) + "'," +
-                           "'" + SafeString(omodel.HBacker) + "'," +
-                           SafeDateTime(omodel.HBackDate?.ToString(), "NULL") + "," +
-                           "'" + SafeString(omodel.HBackRemark) + "'," +
-                           "'" + SafeString(omodel.HChecker) + "'," +
-                           SafeDateTime(omodel.HCheckDate?.ToString(), "NULL") + "," +
-                           "'" + SafeString(omodel.HMaker) + "',getdate()," + // HMaker, HMakeDate
-                           "'" + SafeString(omodel.HUpDater) + "'," +
-                           SafeDateTime(omodel.HUpDateDate?.ToString(), "NULL") + "," +
-                           "'" + SafeString(omodel.HCloseMan) + "'," +
-                           SafeDateTime(omodel.HCloseDate?.ToString(), "NULL") + "," +
-                           (omodel.HCloseType.ToString() == "1" ? "1" : "0") + "," + // HCloseType
-                           "'" + SafeString(omodel.HDeleteMan) + "'," +
-                           SafeDateTime(omodel.HDeleteDate?.ToString(), "NULL") + "," +
-                           "'" + SafeString(omodel.HMainSourceBillType) + "'," +
-                           SafeInt(omodel.HMainSourceInterID.ToString(), 0) + "," + // HMainSourceInterID
-                           SafeInt(omodel.HMainSourceEntryID.ToString(), 0) + "," + // HMainSourceEntryID
-                           "'" + SafeString(omodel.HMainSourceBillNo) + "'," +
-                           SafeInt(omodel.HPrintQty.ToString(), 0) + "," + // HPrintQty
-                           SafeInt(omodel.HOrgID.ToString(), 0) + "," + // HOrgID
-                           SafeInt(omodel.HCusID?.ToString(), 0) + "," + // HCusID
-                           SafeInt(omodel.HBeginAddr?.ToString(), 0) + "," + // HBeginAddr
-                           SafeInt(omodel.HEndAddr?.ToString(), 0) + "," + // HEndAddr
-                           "'" + SafeString(omodel.HPickAddr) + "'," +
-                           "'" + SafeString(omodel.HArriverAddr) + "'," +
-                           "'" + SafeString(omodel.HTransType) + "'," +
-                           SafeInt(omodel.HCarTypeID?.ToString(), 0) + "," + // HCarTypeID
-                           SafeDecimal(omodel.HCarTypeMaxVolume?.ToString(), 0) + "," + // HCarTypeMaxVolume
-                           SafeDecimal(omodel.HTotalVolume?.ToString(), 0) + "," + // HTotalVolume
-                           SafeDecimal(omodel.HLoadingRate?.ToString(), 0) + "," + // HLoadingRate
-                           SafeInt(omodel.HContractTransportInterID?.ToString(), 0) + "," + // HContractTransportInterID
-                           SafeInt(omodel.HContractTransportEntryID?.ToString(), 0) + "," + // HContractTransportEntryID
-                           "'" + SafeString(omodel.HContractTransportBillNo) + "'," +
-                           SafeInt(omodel.HCarrierID?.ToString(), 0) + "," + // HCarrierID
-                           SafeDecimal(omodel.HDistance?.ToString(), 0) + "," + // HDistance
-                           SafeDecimal(omodel.HTransportTimes?.ToString(), 0) + "," + // HTransportTimes
-                           "'" + SafeString(omodel.HTransportTyep) + "'," +
-                           SafeInt(omodel.HSSID?.ToString(), 0) + "," + // HSSID
-                           SafeInt(omodel.HCurID?.ToString(), 0) + "," + // HCurID
-                           SafeDecimal(omodel.HMoney?.ToString(), 0) + "," + // HMoney
-                           SafeDateTime(omodel.HDateForRequestedPick?.ToString(), "'" + currentDateTime + "'") + "," +
-                           SafeDateTime(omodel.HDataForRequestedArrived?.ToString(), "'" + currentDateTime + "'") + "," +
-                           SafeInt(omodel.HCarryStatus?.ToString(), 1) + "," + // HCarryStatus
-                           SafeDateTime(omodel.HDate_CarrierSure?.ToString(), "'" + currentDateTime + "'") + "," +
-                           SafeDateTime(omodel.HDate_AllocationDriver?.ToString(), "'" + currentDateTime + "'") + "," +
-                           SafeInt(omodel.HCarID?.ToString(), 0) + "," + // HCarID
-                           SafeInt(omodel.HDriverID?.ToString(), 0) + "," + // HDriverID
-                           "'" + SafeString(omodel.HSurer_Arrive) + "'," +
-                           SafeDateTime(omodel.HDate_Arrive?.ToString(), "'" + currentDateTime + "'") + "," +
-                           "'" + SafeString(omodel.HSurer_Pick) + "'," +
-                           SafeDateTime(omodel.HDate_Pick?.ToString(), "'" + currentDateTime + "'") + "," +
-                           "'" + SafeString(omodel.HSurer_Trans) + "'," +
-                           SafeDateTime(omodel.HDate_Trans?.ToString(), "'" + currentDateTime + "'") + "," +
-                           "'" + SafeString(omodel.HSurer_Receive) + "'," +
-                           "'" + omodel.HExRate + "'," +
-                           SafeDateTime(omodel.HDate_Receive?.ToString(), "'" + currentDateTime + "'") + "," +
-                           "'" + SafeString(omodel.HSurer_Accounting) + "'," +
-                           SafeDateTime(omodel.HDate_Accounting?.ToString(), "'" + currentDateTime + "'") + ")"; 
-
+                           "HDataForRequestedArrived,HExRate" +
+                           ") values(" +
+                           "" + omodel.HInterID + "" +
+                           "," + "year(getdate())" + "" +
+                           "," + "month(getdate())" + "" +
+                           ",'" + this.BillType + "'" +
+                           ",'" + this.HBillSubType + "'" +
+                           ",'" + omodel.HDate + "'" +
+                           ",'" + omodel.HBillNo + "'" +
+                           "," + 1 + "" +
+                           ",'" + omodel.HRemark + "'" +
+                           ",'" + omodel.HMaker + "'" +
+                           "," + "getdate()" + "" +
+                           ",'" + omodel.HMainSourceBillType + "'" +
+                           ",'" + omodel.HMainSourceInterID + "'" +
+                           ",'" + omodel.HMainSourceEntryID + "'" +
+                           ",'" + omodel.HMainSourceBillNo + "'" +
+                           ",'" + omodel.HOrgID + "'" +
+                           ",'" + omodel.HBeginAddr + "'" +
+                           ",'" + omodel.HEndAddr + "'" +
+                           ",'" + omodel.HTransType + "'" +
+                           ",'" + omodel.HCarTypeID + "'" +
+                           ",'" + omodel.HCarTypeMaxVolume + "'" +
+                           ",'" + omodel.HTotalVolume + "'" +
+                           ",'" + omodel.HLoadingRate + "'" +
+                           ",'" + omodel.HContractTransportInterID + "'" +
+                           ",'" + omodel.HContractTransportEntryID + "'" +
+                           ",'" + omodel.HContractTransportBillNo + "'" +
+                           ",'" + omodel.HCarrierID + "'" +
+                           ",'" + omodel.HDistance + "'" +
+                           ",'" + omodel.HTransportTimes + "'" +
+                           ",'" + omodel.HTransportTyep + "'" +
+                           ",'" + omodel.HSSID + "'" +
+                           ",'" + omodel.HCurID + "'" +
+                           ",'" + omodel.HMoney + "'" +
+                           ",'" + omodel.HDateForRequestedPick + "'" +
+                           ",'" + omodel.HDataForRequestedArrived + "'" +
+                           ",'" + omodel.HExRate + "'" +
+                           ")";
                 oCn.RunProc(sql);
                 //涓昏〃              
                 //鎻掑叆瀛愯〃
@@ -329,7 +289,7 @@
               "(HInterID,HBillNo_bak,HEntryID,HCloseMan,HEntryCloseDate,HCloseType,HRemark" +
               ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney" +
               ",HMaterID,HUnitID,HMouldID,HMouldLength,HMouldHeight,HMouldWidth" +
-              ",HMouldFoldHeight,HVolume,HQty,HSNP,HScatteredVolume,HMouldQty) values("
+              ",HMouldFoldHeight,HVolume,HQty,HSNP,HScatteredVolume,HMouldQty,HCusID,HPickAddr,HArriverAddr) values("
               + SafeInt(omodel.HInterID.ToString(), 0) + ",'" // HInterID int
               + SafeString(omodel.HBillNo.ToString()) + "'," // HBillNo_bak varchar(50)
               + (oSub.HEntryID) + ",'" // HEntryID int
@@ -354,11 +314,14 @@
               + (oSub.HQty.ToString() == "" ? 0 : oSub.HQty) + "," // HQty dec(18,8)
               + (oSub.HSNP.ToString() == "" ? 0 : oSub.HSNP) + "," // HSNP dec(18,8)
               + (oSub.HScatteredVolume) + "," // HSNP dec(18,8)
-              + (oSub.HMouldQty.ToString() == "" ? 0 : oSub.HMouldQty) + ")"; // HMouldQty dec(18,8)
+              + (oSub.HMouldQty.ToString() == "" ? 0 : oSub.HMouldQty) + ","
+              + (oSub.HCusID) + "," // HSNP dec(18,8)
+              + "'" + SafeString(oSub.HPickAddr?.ToString(), "") + "',"
+              + "'" + SafeString(oSub.HArriverAddr?.ToString(), "") + "')"; // HMouldQty dec(18,8)
                     oCn.RunProc(sql);
                 }
                     //=========================淇濆瓨鍚庢帶鍒�  
-                    DataSet ds2 = oCn.RunProcReturn("Exec h_p_Gy_QCVerificationBill_AfterSaveCtrl " + omodel.HInterID.ToString() + ", '" + omodel.HBillNo + "',1", "h_p_Gy_QCVerificationBill_AfterSaveCtrl");
+                    DataSet ds2 = oCn.RunProcReturn("Exec h_p_WL_YayBill_AfterSaveCtrl " + omodel.HInterID.ToString() + ", '" + omodel.HBillNo + "',1", "h_p_Gy_QCVerificationBill_AfterSaveCtrl");
 
                 if (ds2 == null)
                 {

--
Gitblit v1.9.1