From 69967cc5f88abdf438f8072762d64a68eae66bb9 Mon Sep 17 00:00:00 2001
From: llj <132905093+newwwwwwtree@users.noreply.github.com>
Date: 星期三, 04 三月 2026 09:46:40 +0800
Subject: [PATCH] 1

---
 WebAPI/Controllers/物流管理/出运单/WLYayBillController.cs |  240 ++++++++++++++++++++++++++++++++++++++++++++++++++++++-----
 1 files changed, 219 insertions(+), 21 deletions(-)

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 c851767..dba79a1 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"
@@ -31,7 +31,7 @@
             try
             {
                 List<object> columnNameList = new List<object>();
-                if (!DBUtility.ClsPub.Security_Log("Gy_QCVerificationBillMain_Query", 1, false, user))
+                if (!DBUtility.ClsPub.Security_Log("WLYayBill_Query", 1, false, user))
                 {
                     objJsonResult.code = "0";
                     objJsonResult.count = 0;
@@ -93,10 +93,10 @@
                 }
                 ListMaterial = ListMaterial.Replace(';', ',');
                 List<object> columnNameList = new List<object>();
-                
 
 
-                    ds = oCN.RunProcReturn("select a.*,b.HUnitID from h_v_Gy_MaterialPackingRelationList_Edit a left JOIN Gy_Material b on a.HMaterID=b.HItemID where HDefaultSendPackFlag=1 and  HMaterID in (" + ListMaterial+")", "锘縣_v_Gy_MaterialPackingRelationList");
+
+                ds = oCN.RunProcReturn("select a.*,b.HUnitID from h_v_Gy_MaterialPackingRelationList_Edit a left JOIN Gy_Material b on a.HMaterID=b.HItemID where HDefaultSendPackFlag=1 and 瀹℃牳浜�='' and  HMaterID in (" + ListMaterial + ")", "锘縣_v_Gy_MaterialPackingRelationList");
 
 
                 //娣诲姞鍒楀悕
@@ -269,7 +269,7 @@
             try
             {
                 //瀹℃牳鏉冮檺
-                if (!DBUtility.ClsPub.Security_Log_second("Gy_Supplier_Check", 1, false, CurUserName))
+                if (!DBUtility.ClsPub.Security_Log_second("WLYayBill_Check", 1, false, CurUserName))
                 {
                     objJsonResult.code = "0";
                     objJsonResult.count = 0;
@@ -365,26 +365,33 @@
             try
             {
                 //瀹℃牳鏉冮檺
-                if (!DBUtility.ClsPub.Security_Log_second("Gy_Supplier_Check", 1, false, CurUserName))
+                if (!DBUtility.ClsPub.Security_Log_second("WLYayBill_SupConfirm", 1, false, CurUserName))
                 {
                     objJsonResult.code = "0";
                     objJsonResult.count = 0;
-                    objJsonResult.Message = "瀹℃牳澶辫触锛佹棤鏉冮檺锛�";
+                    objJsonResult.Message = "纭澶辫触锛佹棤鏉冮檺锛�";
                     objJsonResult.data = null;
                     return objJsonResult;
                 }
 
                 var ds = oCN.RunProcReturn("select * from WL_YayBillMain where HInterID=" + HInterID, "WL_YayBillMain");
-              
+                if (ds.Tables[0].Rows[0]["HChecker"] == null || ds.Tables[0].Rows[0]["HChecker"].ToString() == "")
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "璇峰厛瀹℃牳鍗曟嵁锛�";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
                 oCN.BeginTran();
 
 
-                    oCN.RunProc("update WL_YayBillMain set HDate_CarrierSure='" + DateTime.Now.ToString("yyyy-MM-dd") + "' where HInterID=" + HInterID);
+                oCN.RunProc("update WL_YayBillMain set HDate_CarrierSure='" + DateTime.Now.ToString("yyyy-MM-dd") + "' where HInterID=" + HInterID);
 
-                    objJsonResult.code = "1";
-                    objJsonResult.count = 1;
-                    objJsonResult.Message = "鎴愬姛";
-                    objJsonResult.data = null;
+                objJsonResult.code = "1";
+                objJsonResult.count = 1;
+                objJsonResult.Message = "鎴愬姛";
+                objJsonResult.data = null;
                 oCN.Commit();
 
                 return objJsonResult;
@@ -417,7 +424,7 @@
             try
             {
                 //瀹℃牳鏉冮檺
-                if (!DBUtility.ClsPub.Security_Log_second("Gy_Supplier_Check", 1, false, CurUserName))
+                if (!DBUtility.ClsPub.Security_Log_second("WLYayBill_Check", 1, false, CurUserName))
                 {
                     objJsonResult.code = "0";
                     objJsonResult.count = 0;
@@ -429,22 +436,94 @@
                 var ds = oCN.RunProcReturn("select * from WL_YayBillMain where HInterID=" + HInterID, "WL_YayBillMain");
 
                 oCN.BeginTran();
-                if(IsAudit== 1)
+                if (IsAudit == 1)
                 {
+                    if (!DBUtility.ClsPub.Security_Log_second("WLYayBill_arriveConfirm", 1, false, CurUserName))
+                    {
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "鍒板満纭澶辫触锛佹棤鏉冮檺锛�";
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
+                    if (ds.Tables[0].Rows[0]["HDate_AllocationDriver"] == null || ds.Tables[0].Rows[0]["HDate_AllocationDriver"].ToString() == ""|| ds.Tables[0].Rows[0]["HDate_CarrierSure"].ToString() == "" || ds.Tables[0].Rows[0]["HDriverID"].ToString() == "0")
+                    {
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "璇峰厛鍒嗛厤鍙告満锛�";
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
                     oCN.RunProc("update WL_YayBillMain set HSurer_Arrive='" + CurUserName + "',HDate_Arrive=getdate()  where HInterID=" + HInterID);
                 }
-                else if(IsAudit == 2)
+                else if (IsAudit == 2)
                 {
+                    if (!DBUtility.ClsPub.Security_Log_second("WLYayBill_arriveConfirm", 1, false, CurUserName))
+                    {
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "鍒板満纭澶辫触锛佹棤鏉冮檺锛�";
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
+                    if (!DBUtility.ClsPub.Security_Log_second("WLYayBill_pickConfirm", 1, false, CurUserName))
+                    {
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "鎻愯揣澶辫触锛佹棤鏉冮檺锛�";
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
+                    if (ds.Tables[0].Rows[0]["HSurer_Arrive"] == null)
+                    {
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "璇峰厛鍒板巶纭锛�";
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
                     oCN.RunProc("update WL_YayBillMain set HSurer_Pick='" + CurUserName + "',HDate_Pick=getdate()  where HInterID=" + HInterID);
 
                 }
-                else if(IsAudit == 3)
+                else if (IsAudit == 3)
                 {
+                    if (!DBUtility.ClsPub.Security_Log_second("WLYayBill_tranConfirm", 1, false, CurUserName))
+                    {
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "鍑哄巶杩愯緭澶辫触锛佹棤鏉冮檺锛�";
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
+                    if (ds.Tables[0].Rows[0]["HSurer_Pick"] == null || ds.Tables[0].Rows[0]["HSurer_Pick"].ToString() == "" )
+                    {
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "璇峰厛鎻愯揣纭锛�";
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
                     oCN.RunProc("update WL_YayBillMain set HSurer_Trans='" + CurUserName + "',HDate_Trans=getdate()  where HInterID=" + HInterID);
 
                 }
-                else if(IsAudit == 4)
+                else if (IsAudit == 4)
                 {
+                    if (!DBUtility.ClsPub.Security_Log_second("WLYayBill_receiveConfirm", 1, false, CurUserName))
+                    {
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "绛炬敹澶辫触锛佹棤鏉冮檺锛�";
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
+                    if (ds.Tables[0].Rows[0]["HSurer_Trans"] == null || ds.Tables[0].Rows[0]["HSurer_Trans"].ToString() == "")
+                    {
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "璇峰厛鍑哄巶杩愯緭纭锛�";
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
                     oCN.RunProc("update WL_YayBillMain set HSurer_Receive='" + CurUserName + "',HDate_Receive=getdate()  where HInterID=" + HInterID);
 
                 }
@@ -484,14 +563,33 @@
         /// <returns></returns>
         [Route("WLYayBillController/selectDriver")]
         [HttpGet]
-        public object selectDriver(int HInterID,int HcheckID, int IsAudit, string CurUserName)
+        public object selectDriver(int HInterID, int HcheckID, int IsAudit, string CurUserName)
         {
             try
             {
-                DataSet ds;
-                if(IsAudit==1)     
+                if (!DBUtility.ClsPub.Security_Log("WLYayBill_SelectDriver", 1, false, CurUserName))
                 {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "鏃犳煡鐪嬫潈闄愶紒";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+                DataSet ds;
+                var dss = oCN.RunProcReturn("select * from WL_YayBillMain where HInterID=" + HInterID, "WL_YayBillMain");
+                if (dss.Tables[0].Rows[0]["HDate_CarrierSure"] == null || dss.Tables[0].Rows[0]["HDate_CarrierSure"].ToString() == "" || dss.Tables[0].Rows[0]["HChecker"].ToString() == "" || dss.Tables[0].Rows[0]["HDate_CarrierSure"] == "2000-01-01 00:00:00.000")
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "璇峰厛渚涘簲鍟嗙‘璁わ紒";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+                if (IsAudit == 1)
+                {
+                    
                     ds = oCN.RunProcReturn("select * from h_v_Gy_CarList where HItemID=" + HcheckID, "h_v_Gy_CarList");
+                    
                     if (ds.Tables[0].Rows.Count > 0)
                     {
                         oCN.BeginTran();
@@ -507,7 +605,7 @@
                         return objJsonResult;
                     }
 
-                   
+
                 }
                 else
                 {
@@ -547,5 +645,105 @@
             }
         }
         #endregion
+
+
+        [Route("WLYayBillController/deleteBill")]
+        [HttpGet]
+        public object deleteBill(string HItemID, string user)
+        {
+            DataSet ds;
+            //string ModRightNameCheck = "Sc_ProcessReport_check";
+            try
+            {
+                //鍒犻櫎鏉冮檺
+                if (!DBUtility.ClsPub.Security_Log("WLYayBill_Delete", 1, false, user))
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "鏃犲垹闄ゆ潈闄愶紒";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+
+                SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
+                if (string.IsNullOrWhiteSpace(HItemID))
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "HItemID涓虹┖锛�";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+                oCN.BeginTran();//寮�濮嬩簨鍔�
+                ds = oCN.RunProcReturn("select * from WL_YayBillMain where HInterID=" + HItemID, "WL_YayBillMain");
+                DataSet dds = oCN.RunProcReturn("select * from WL_YayBillSub_Material where HInterID=" + HItemID, "WL_YayBillSub_Material");
+                if (ds == null || ds.Tables[0].Rows.Count == 0)
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "娌℃湁鏁版嵁锛屾棤娉曞垹闄わ紒";
+                    objJsonResult.data = null;
+                    return objJsonResult; ;
+                }
+
+
+                oCN.RunProc("delete WL_YayBillMain where HInterID=" + HItemID);
+                if (dds != null || dds.Tables[0].Rows.Count != 0)
+                {
+                    oCN.RunProc("delete WL_YayBillSub_Material where HInterID=" + HItemID);
+                }
+                oCN.Commit();//鎻愪氦浜嬪姟
+                objJsonResult.code = "0";
+                objJsonResult.count = 1;
+                objJsonResult.Message = "鏁版嵁鍒犻櫎鎴愬姛锛�";
+                objJsonResult.data = null;
+                return objJsonResult; ;
+
+            }
+            catch (Exception e)
+            {
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "鍒犻櫎澶辫触锛�" + e.ToString();
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
+
+
+        [Route("WLYayBillController/updateBillMEs")]
+        [HttpGet]
+        public object updateBillMEs(int HInterID,int HEntryID, int ScatteredVolume, string CurUserName)
+        {
+            //鍒犻櫎鏉冮檺
+            if (!DBUtility.ClsPub.Security_Log("WLYayBill_ScatteredVolume", 1, false, CurUserName))
+            {
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "鏃犳潈闄愶紒";
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+            var ds = oCN.RunProcReturn("select * from WL_YayBillMain a inner join WL_YayBillSub_Material b on b.HInterID=a.HInterID where a.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);
+                objJsonResult.code = "1";
+                objJsonResult.count = 1;
+                objJsonResult.Message = "鎴愬姛";
+                objJsonResult.data = null;
+                oCN.Commit();
+                return objJsonResult;
+            }
+            else
+            {
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "鏇存柊澶辫触锛�";
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
     }
 }

--
Gitblit v1.9.1