From 8b1159f7744c752e9499ffd82de393d255b4b2e0 Mon Sep 17 00:00:00 2001
From: zrg <z1873@LAPTOP-EAVL132E>
Date: 星期二, 19 八月 2025 16:09:10 +0800
Subject: [PATCH] 优化产线包装组托单方法,进出站报错提示,基础老包装车间方法到这个api

---
 WebAPI/Controllers/CJGL/Cj_StationOutBillController.cs |   46 ++++++++++++++++++++++++++++++++++++----------
 1 files changed, 36 insertions(+), 10 deletions(-)

diff --git a/WebAPI/Controllers/CJGL/Cj_StationOutBillController.cs b/WebAPI/Controllers/CJGL/Cj_StationOutBillController.cs
index e2268f6..05373d9 100644
--- a/WebAPI/Controllers/CJGL/Cj_StationOutBillController.cs
+++ b/WebAPI/Controllers/CJGL/Cj_StationOutBillController.cs
@@ -153,6 +153,7 @@
                 double HBackWorkByMaterQty = list[0].HBackWorkByMaterQty;//閬楀け鏁伴噺
                 int HMouldID = list[0].HMouldID;//妯″叿id
                 double HMachineWorkTimes = list[0].HMachineWorkTimes;//璁惧宸ユ椂
+                int HIsTimeFlag = list[0].HIsTimeFlag;
                 LogService.Write($"1.瀛楁璧嬪�硷紝鐢ㄦ椂" + sw.Elapsed );
 
                 //鍗曟嵁瀹屾暣鎬у垽鏂�
@@ -413,7 +414,7 @@
                     ",HMainSourceInterID,HMainSourceBillNo,HMainSourceBillType,HLastSubProc" +
                     ",HEmpID2,HEmpID3,HEmpID4,HEmpID5,HDSQty,HChongQty,HPriceRate,HWorkTimes,HQCCheckID,HMainInterID,HPRDOrgID" +
                     ",HmaterOutqty,HProcPriceRate,HTemporaryAreaID,HWasterQty_Work,HWasterQty_Mater,HBackWorkQty,HShiftsID" +
-                    ",HToCheckQty,HLossQty,HBackWorkByMaterQty,HMouldID,HMachineWorkTimes " +
+                    ",HToCheckQty,HLossQty,HBackWorkByMaterQty,HMouldID,HMachineWorkTimes,HIsTimeFlag " +
                     ") " +
                     " values('" + BillType + "','" + (OperationType == "5" ? "SUB" : HBillSubType)  + "'," + HInterID + ",'" + HBillNo + "'," + HBillStatus + ",'"+ HDate + "','" + HMaker + "',getdate(),'" + HMouldNum + "'" +
                     "," + HYear + "," + HPeriod + ",'" + HRemark + "','" + HSourceName + "'," + HPieceQty + "," + HWasterQty + "," + HPlanPieceQty + "," + HBadPNL +
@@ -424,7 +425,7 @@
                     "," + HMainSourceInterID + ",'" + HMainSourceBillNo + "','" + HMainSourceBillType + "'," + Convert.ToString(HLastSubProc ? 1 : 0) +
                     "," + HEmpID2 + "," + HEmpID3 + "," + HEmpID4 + "," + HEmpID5 + "," + HDSQty + "," + HChongQty + "," + HPriceRate + "," + HWorkTimes + "," + HQCCheckID + "," + HMainInterID + "," + HPRDOrgID +
                     "," + HmaterOutqty + "," + HProcPriceRate + "," + HTemporaryAreaID + "," + HWasterQty_Work + "," + HWasterQty_Mater + "," + HBackWorkQty +
-                    "," + HShiftsID + "," + HToCheckQty + "," + HLossQty + ","+ HBackWorkByMaterQty + "," + HMouldID + ",'" + HMachineWorkTimes + "') ");
+                    "," + HShiftsID + "," + HToCheckQty + "," + HLossQty + ","+ HBackWorkByMaterQty + "," + HMouldID + ",'" + HMachineWorkTimes + "',"+ HIsTimeFlag + ") ");
 
                     LogService.Write($"4.鏂板缁撴潫锛岀敤鏃�" + sw.Elapsed);
                     LogService.Write("鐢ㄦ埛:" + user + ",鏃ユ湡:" + DateTime.Now + ",鏂板宸ュ簭鍑虹珯鍗曟嵁:" + HBillNo);
@@ -471,7 +472,8 @@
                     ",HBackWorkQty=" + HBackWorkQty +
                     ",HBackWorkByMaterQty=" + HBackWorkByMaterQty +
                     ",HMouldID=" + HMouldID +
-                    ",HMachineWorkTimes=" + HMachineWorkTimes +  
+                    ",HMachineWorkTimes=" + HMachineWorkTimes +
+                    ",HIsTimeFlag=" + HIsTimeFlag +
                     " where HInterID=" + HInterID);
 
                     LogService.Write("鐢ㄦ埛:" + user + ",鏃ユ湡:" + DateTime.Now + ",淇敼宸ュ簭鍑虹珯鍗曟嵁:" + HBillNo);
@@ -515,7 +517,7 @@
                     oCN.RollBack();
                     objJsonResult.code = "0";
                     objJsonResult.count = 0;
-                    objJsonResult.Message = "[0000-2-015]鏁伴噺鎺у埗," + ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBackRemark"]);
+                    objJsonResult.Message = ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBackRemark"]);
                     objJsonResult.data = null;
                     return objJsonResult;
                 }
@@ -2643,6 +2645,7 @@
         [HttpGet]
         public object set_ShowBillJudge(string HBillNo)
         {
+            string sReturn = "";
             try
             {
                 ds = oCN.RunProcReturn("exec h_p_MES_StationOutBill_DelCtrl  '" + HBillNo + "'", "h_p_MES_StationOutBill_DelCtrl");
@@ -2658,7 +2661,7 @@
                 {
                     objJsonResult.code = "0";
                     objJsonResult.count = 0;
-                    objJsonResult.Message = "[0000-1-038]" + Pub_Class.ClsPub.isStrNull(ds.Tables[0].Rows[0][1]);
+                    objJsonResult.Message = Pub_Class.ClsPub.isStrNull(ds.Tables[0].Rows[0][1]);
                     objJsonResult.data = null;
                     return objJsonResult;
                 }
@@ -2673,11 +2676,34 @@
             }
             catch (Exception e)
             {
-                objJsonResult.code = "0";
-                objJsonResult.count = 0;
-                objJsonResult.Message = "[0000-1-038]Exception锛�" + e.ToString();
-                objJsonResult.data = null;
-                return objJsonResult;
+                if (oSystemParameter.ShowBill(ref sReturn) == true)
+                {
+                    if (oSystemParameter.omodel.WMS_CampanyName == "鏉窞鏂帿灏�") //绯荤粺鍙傛暟  鍒ゆ柇瀹㈡埛
+                    {
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = e.ToString();
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
+                    else
+                    {
+
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "[0000-1-038]Exception锛�" + e.ToString();
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
+                }
+                else
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "[0000-1-038]Exception锛�" + e.ToString();
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
             }
         }
         #endregion

--
Gitblit v1.9.1