From 85384dd5eaa81be10caeaea5fc827c9e6f7495f7 Mon Sep 17 00:00:00 2001
From: dytyqx <1342948614@qq.com>
Date: 星期一, 30 三月 2026 21:39:35 +0800
Subject: [PATCH] Merge branch 'master' of http://101.37.171.70:10101/r/MES-WEB-API

---
 WebAPI/Controllers/物流管理/出运单/WLYayBillController.cs |   87 ++++++++++++++++++++++++++++++++++++++++---
 DAL/ClsWL_YayBillMain.cs                           |   22 +++++-----
 Model/物流管理/ClsWL_YayBillMainBillSub.cs             |    7 +++
 3 files changed, 99 insertions(+), 17 deletions(-)

diff --git a/DAL/ClsWL_YayBillMain.cs b/DAL/ClsWL_YayBillMain.cs
index 5a7a9f1..6214bad 100644
--- a/DAL/ClsWL_YayBillMain.cs
+++ b/DAL/ClsWL_YayBillMain.cs
@@ -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,7 +167,10 @@
                + (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);
                 }
 
@@ -236,7 +236,7 @@
                 string sql = "Insert Into WL_YayBillMain " +
                            "(HInterID,HYear,HPeriod,HBillType,HBillSubType,HDate,HBillNo,HBillStatus," +
                            "HRemark,HMaker,HMakeDate,HMainSourceBillType,HMainSourceInterID,HMainSourceEntryID,HMainSourceBillNo," +
-                           "HOrgID,HCusID,HBeginAddr,HEndAddr,HPickAddr,HArriverAddr,HTransType,HCarTypeID,HCarTypeMaxVolume,HTotalVolume," +
+                           "HOrgID,HBeginAddr,HEndAddr,HTransType,HCarTypeID,HCarTypeMaxVolume,HTotalVolume," +
                            "HLoadingRate,HContractTransportInterID,HContractTransportEntryID," +
                            "HContractTransportBillNo,HCarrierID,HDistance,HTransportTimes," +
                            "HTransportTyep,HSSID,HCurID,HMoney,HDateForRequestedPick," +
@@ -258,11 +258,8 @@
                            ",'" + omodel.HMainSourceEntryID + "'" +
                            ",'" + omodel.HMainSourceBillNo + "'" +
                            ",'" + omodel.HOrgID + "'" +
-                           ",'" + omodel.HCusID + "'" +
                            ",'" + omodel.HBeginAddr + "'" +
                            ",'" + omodel.HEndAddr + "'" +
-                           ",'" + omodel.HPickAddr + "'" +
-                           ",'" + omodel.HArriverAddr + "'" +
                            ",'" + omodel.HTransType + "'" +
                            ",'" + omodel.HCarTypeID + "'" +
                            ",'" + omodel.HCarTypeMaxVolume + "'" +
@@ -292,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
@@ -317,7 +314,10 @@
               + (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);
                 }
                     //=========================淇濆瓨鍚庢帶鍒�  
diff --git "a/Model/\347\211\251\346\265\201\347\256\241\347\220\206/ClsWL_YayBillMainBillSub.cs" "b/Model/\347\211\251\346\265\201\347\256\241\347\220\206/ClsWL_YayBillMainBillSub.cs"
index 17ac56a..364d10f 100644
--- "a/Model/\347\211\251\346\265\201\347\256\241\347\220\206/ClsWL_YayBillMainBillSub.cs"
+++ "b/Model/\347\211\251\346\265\201\347\256\241\347\220\206/ClsWL_YayBillMainBillSub.cs"
@@ -30,6 +30,13 @@
         public decimal HRelationQty { get; set; }              // 关联数量
         public decimal HRelationMoney { get; set; }            // 关联金额
 
+        public int HCusID { get; set; }                // 客户ID
+
+
+        public string HPickAddr { get; set; }                // 提货地址
+
+        public string HArriverAddr { get; set; }                // 到货地址
+
         // 自增列
         public int HItemSubID { get; set; }                    // 自增列
 
diff --git "a/WebAPI/Controllers/\347\211\251\346\265\201\347\256\241\347\220\206/\345\207\272\350\277\220\345\215\225/WLYayBillController.cs" "b/WebAPI/Controllers/\347\211\251\346\265\201\347\256\241\347\220\206/\345\207\272\350\277\220\345\215\225/WLYayBillController.cs"
index 9a41d24..ca1e21c 100644
--- "a/WebAPI/Controllers/\347\211\251\346\265\201\347\256\241\347\220\206/\345\207\272\350\277\220\345\215\225/WLYayBillController.cs"
+++ "b/WebAPI/Controllers/\347\211\251\346\265\201\347\256\241\347\220\206/\345\207\272\350\277\220\345\215\225/WLYayBillController.cs"
@@ -428,11 +428,11 @@
                 return objJsonResult;
             }
 
-            DataSet ds = oCN.RunProcReturn("select * from WL_YayBillMain a inner join WL_YayBillSub_Material b on b.HInterID=a.HInterID where a.HInterID=" + HInterID + " and b.HEntryID = " + HEntryID, "WL_YayBillMain");
+            DataSet ds = oCN.RunProcReturn("select * from WL_YayBillMain where HInterID=" +HInterID  , "WL_YayBillMain");
             if (ds != null || ds.Tables[0].Rows.Count > 0)
             {
                 oCN.BeginTran();
-                oCN.RunProc("update WL_YayBillSub_Material set HScatteredVolume= " + ScatteredVolume + " where HInterID=" + HInterID + "and HEntryID=" + HEntryID);
+                oCN.RunProc("update WL_YayBillMain set HScatteredVolume= " + ScatteredVolume + " where HInterID=" + HInterID );
                 oCN.Commit();
 
                 objJsonResult.code = "1";
@@ -553,11 +553,15 @@
                     objJsonResult.data = null;
                     return objJsonResult;
                 }
-
+               
                 if (IsAudit == 1)
                 {
+
+                    ds = oCN.RunProcReturn("select * from gy_car where  HItemID=" + HcheckID + "", "gy_car");
+                    var HNumber = ds.Tables[0].Rows[0]["HNumber"].ToString(); 
+                    var HName = ds.Tables[0].Rows[0]["HName"].ToString();
                     oCN.BeginTran();
-                    oCN.RunProc("update WL_YayBillMain set HCarID='" + HcheckID + "' where HInterID=" + HInterID);
+                    oCN.RunProc("update WL_YayBillMain set HCarID='" + HcheckID + "', CarHNumber='" + HNumber + "', CarHName='" + HName + "' where HInterID=" + HInterID);
                     oCN.Commit();
 
                     objJsonResult.code = "1";
@@ -569,8 +573,11 @@
                 else
                 {
 
+                    ds = oCN.RunProcReturn("select * from Gy_Driver where  HItemID=" + HcheckID + "", "Gy_Driver");
+                    var HName = ds.Tables[0].Rows[0]["HName"].ToString();
+                    var HIDCard = ds.Tables[0].Rows[0]["HIDCard"].ToString();
                     oCN.BeginTran();
-                    oCN.RunProc("update WL_YayBillMain set HDriverID='" + HcheckID + "',HDate_AllocationDriver=getdate()  where HInterID=" + HInterID);
+                    oCN.RunProc("update WL_YayBillMain set HDriverID='" + HcheckID + "', DriverHName='" + HName + "', DriverHIDCard='" + HIDCard + "' where HInterID=" + HInterID);
                     oCN.Commit();
 
                     objJsonResult.code = "1";
@@ -579,6 +586,74 @@
                     objJsonResult.data = null;
                     return objJsonResult;
                 }
+            }
+            catch (Exception e)
+            {
+                oCN.RollBack();
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "澶辫触锛�" + e.ToString();
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
+        #endregion
+
+
+        #region 鍑鸿繍鍗� 缁存姢鍙告満(骞冲彴)
+        [Route("WLYayBillController/selectDriver1")]
+        [HttpGet]
+        public object selectDriver1(string CarHNumber, string CarHName,string DriverHName,string DriverHIDCard, string CurUserName, int HInterID)
+        {
+            try
+            {
+                //if (!DBUtility.ClsPub.Security_Log("WLYayBill_SelectDriver1", 1, false, CurUserName))
+                //{
+                //    objJsonResult.code = "0";
+                //    objJsonResult.count = 0;
+                //    objJsonResult.Message = "鏃犳煡鐪嬫潈闄愶紒";
+                //    objJsonResult.data = null;
+                //    return objJsonResult;
+                //}
+
+                DataSet ds = oCN.RunProcReturn("select * from WL_YayBillMain where HInterID=" + HInterID, "WL_YayBillMain");
+                if (ds == null || ds.Tables[0].Rows.Count == 0)
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "鑾峰彇鍗曟嵁淇℃伅澶辫触锛屽崟鎹笉瀛樺湪锛屾棤娉曡繘琛屽垎閰嶈溅杈嗐�佸徃鏈烘搷浣滐紒锛�";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+
+                if (DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HChecker"]) == "")
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "鍗曟嵁鏈鏍革紝鏃犳硶杩涜鍒嗛厤杞﹁締銆佸徃鏈烘搷浣滐紒锛�";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+
+                if (ds.Tables[0].Rows[0]["HDate_CarrierSure"] == null)
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "鍗曟嵁鏈繘琛屼緵搴斿晢纭銆傝鍏堣繘琛屼緵搴斿晢纭锛岀劧鍚庡啀杩涜鍒嗛厤杞﹁締銆佸徃鏈烘搷浣滐紒锛�";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+
+                    oCN.BeginTran();
+                    oCN.RunProc("update WL_YayBillMain set CarHNumber='" + CarHNumber + "', CarHName='" + CarHName + "', DriverHName='" + DriverHName + "', DriverHIDCard='" + DriverHIDCard + "',HDate_AllocationDriver=getdate() where HInterID=" + HInterID);
+                    oCN.Commit();
+                    objJsonResult.code = "1";
+                    objJsonResult.count = 1;
+                    objJsonResult.Message = "鎴愬姛";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                
+              
             }
             catch (Exception e)
             {
@@ -637,7 +712,7 @@
                         return objJsonResult;
                     }
 
-                    if (ds.Tables[0].Rows[0]["HDate_AllocationDriver"] == null || ds.Tables[0].Rows[0]["HDriverID"].ToString() == "0" || ds.Tables[0].Rows[0]["HCarID"].ToString() == "0")
+                    if (ds.Tables[0].Rows[0]["HDate_AllocationDriver"] == null || ds.Tables[0].Rows[0]["CarHName"].ToString() == "0" || ds.Tables[0].Rows[0]["DriverHName"].ToString() == "0")
                     {
                         objJsonResult.code = "0";
                         objJsonResult.count = 0;

--
Gitblit v1.9.1