From 2566524594675a8d742f9ba0eff35dd5d8d33fa2 Mon Sep 17 00:00:00 2001
From: duhe <226547893@qq.com>
Date: 星期一, 31 三月 2025 12:43:22 +0800
Subject: [PATCH] 排产:Excel导入功能,上传文件时,如果时宝工,则返回excel文件中维护的数量,不然则取生产订单的数量

---
 WebAPI/Controllers/SCGL/Sc_MESTransFerWorkBillController.cs |   58 ++++++++++++++++++++++++++++++++++++++++++++++++++++------
 1 files changed, 52 insertions(+), 6 deletions(-)

diff --git a/WebAPI/Controllers/SCGL/Sc_MESTransFerWorkBillController.cs b/WebAPI/Controllers/SCGL/Sc_MESTransFerWorkBillController.cs
index e5a9bec..6cf5e4b 100644
--- a/WebAPI/Controllers/SCGL/Sc_MESTransFerWorkBillController.cs
+++ b/WebAPI/Controllers/SCGL/Sc_MESTransFerWorkBillController.cs
@@ -5485,8 +5485,32 @@
                 //杩涜闇�瑕佽繘琛岀殑浣滃簾/鍙嶄綔搴熸搷浣�
                 if (IsAudit == 0) //浣滃簾鎻愪氦
                 {
-                    //浣滃簾鎻愪氦
-                    if (oBill.Cancelltion(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo) == true)
+                    //瀹℃牳鍓嶆帶鍒�=========================================      
+                    string sql1 = "exec h_p_OA_AndengFlowRuleBill_BeforeDropCtrl " + oBill.omodel.HInterID + ",'" + oBill.omodel.HBillNo + "','" + CurUserName + "'";
+                    ds = oCN.RunProcReturn(sql1, "h_p_OA_AndengFlowRuleBill_BeforeDropCtrl");
+                    if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
+                    {
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 1;
+                        objJsonResult.Message = "瀹℃牳澶辫触!鍘熷洜:瀹℃牳鍓嶅垽鏂け璐ワ紝璇蜂笌缃戠粶绠$悊浜哄憳鑱旂郴";
+                        objJsonResult.data = null;
+                        oCN.RollBack();
+                        return objJsonResult;
+                    }
+
+                    if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0")
+                    {
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 1;
+                        objJsonResult.Message = "瀹℃牳澶辫触!鍘熷洜:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ;
+                        objJsonResult.data = null;
+                        oCN.RollBack();
+                        return objJsonResult;
+                    }
+                    //==================================================================================      
+
+                    //瀹℃牳鎻愪氦
+                    if (oBill.Cancelltion(oBill.omodel.HInterID, oBill.omodel.HBillNo, "h_p_OA_AndengFlowRuleBill_AfterDropCtrl", CurUserName, ref DBUtility.ClsPub.sExeReturnInfo) == true)
                     {
                         objJsonResult.code = "1";
                         objJsonResult.count = 1;
@@ -5503,10 +5527,32 @@
                         return objJsonResult;
                     }
                 }
-                if (IsAudit == 1) //鍙嶅叧闂彁浜�
+                if (IsAudit == 1) //鍙嶄綔搴熸彁浜�
                 {
-                    //鍙嶅叧闂彁浜�
-                    if (oBill.AbandonCancelltion(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo) == true)
+                    //鍙嶅鏍稿墠鎺у埗=========================================        
+                    string sql1 = "exec h_p_OA_AndengFlowRuleBill_BeforeUnDropCtrl " + oBill.omodel.HInterID + ",'" + oBill.omodel.HBillNo + "','" + CurUserName + "'";
+                    ds = oCN.RunProcReturn(sql1, "h_p_OA_AndengFlowRuleBill_BeforeUnDropCtrl");
+                    if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
+                    {
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 1;
+                        objJsonResult.Message = "鍙嶅鏍稿け璐�!鍘熷洜:鍙嶅鏍稿墠鍒ゆ柇澶辫触锛岃涓庣綉缁滅鐞嗕汉鍛樿仈绯�";
+                        objJsonResult.data = null;
+                        return objJsonResult;
+
+                    }
+                    if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0")
+                    {
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 1;
+                        objJsonResult.Message = "鍙嶅鏍稿け璐�!鍘熷洜:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ;
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
+                    //===========================================================          
+
+                    //鍙嶄綔搴熸彁浜�
+                    if (oBill.AbandonCancelltion(lngBillKey, oBill.omodel.HBillNo, "h_p_Sc_MouldMaintainRuleBill_AfterUnDropCtrl", CurUserName, ref DBUtility.ClsPub.sExeReturnInfo) == true)
                     {
                         objJsonResult.code = "1";
                         objJsonResult.count = 1;
@@ -6835,7 +6881,7 @@
                 List<object> columnNameList = new List<object>();
 
                 string sql = "select a.HSourceBillNo 娴佽浆鍗″彿,a.HSourceBillType 娴佽浆鍗$被鍨�,a.HSourceInterID 娴佽浆鍗′富鍐呯爜,a.HSourceEntryID 娴佽浆鍗″瓙鍐呯爜,b.HNumber 鐗╂枡浠g爜,b.HName 鐗╂枡鍚嶇О,b.HModel 瑙勬牸鍨嬪彿,a.HDatePlanQty 璁″垝鏁伴噺,a.HSourceID,c.HName 鐢熶骇璧勬簮 from Sc_ICMOBillStatus_Tmp a " +
-                    "left join Gy_Material b on a.HMaterID=b.HItemID  left join Gy_Source c on a.HSourceID=c.HItemID where HSourceBillNo='" + HSourceBill + "'";
+                    "left join Gy_Material b on a.HMaterID=b.HItemID  left join Gy_Source c on a.HSourceID=c.HItemID where HSourceBillNo='" + HSourceBill + "' and a.HICMOStatus=1";
                 ds = oCN.RunProcReturn(sql, "Sc_ICMOBillStatus_Tmp");
 
                 //娣诲姞鍒楀悕

--
Gitblit v1.9.1