From 5921ea84c8339cdf9e9d91d4d41bfe15c4764f2a Mon Sep 17 00:00:00 2001
From: yangle <admin@YINMOU>
Date: 星期五, 16 六月 2023 13:26:13 +0800
Subject: [PATCH] Merge branch 'master' of http://101.37.171.70:10101/r/MES-WEB-API

---
 WebAPI/Controllers/CJGL/Cj_StationEntrustInBillController.cs |   47 +++++++++++++++++++++++++++++++++++++++--------
 1 files changed, 39 insertions(+), 8 deletions(-)

diff --git a/WebAPI/Controllers/CJGL/Cj_StationEntrustInBillController.cs b/WebAPI/Controllers/CJGL/Cj_StationEntrustInBillController.cs
index eec616b..5accdda 100644
--- a/WebAPI/Controllers/CJGL/Cj_StationEntrustInBillController.cs
+++ b/WebAPI/Controllers/CJGL/Cj_StationEntrustInBillController.cs
@@ -164,20 +164,51 @@
                     NewBarCode = sBillBarCode.Split(Convert.ToChar("#"));
                     sBillBarCode = NewBarCode[0];
                 }
-                string sBillNo = sBillBarCode;
-                //鎴彇鏉$爜绫诲瀷
-                string BillNoType = sBillNo.Substring(0, Math.Min(3, sBillNo.Length));
-                //鎴彇鏉$爜绫诲瀷2
-                string BillNoType2 = sBillNo.Substring(0, Math.Min(4, sBillNo.Length));
+                string sBillNo = sBillBarCode; //鏉″舰鐮�
+
+                string[] arr = sBillNo.Split('&'); //浠ョ鍙封��&鈥欏垎鍓叉潯褰㈢爜
+                string BillNo_PGD = arr[0]; //鍗曟嵁鍙�
+                string entryid_PGD = "";//瀛恑d
+                if(arr.Length > 1)
+                {
+                    entryid_PGD = arr[1];
+                }
+
+                //鎴彇鏉$爜绫诲瀷 鍓嶄笁浣�
+                string BillNoType = BillNo_PGD.Substring(0, Math.Min(3, BillNo_PGD.Length));
+                //鎴彇鏉$爜绫诲瀷2 鍓嶅洓浣�
+                string BillNoType2 = BillNo_PGD.Substring(0, Math.Min(4, BillNo_PGD.Length));
                 //鎴彇鍐呯爜
-                string BillNo = sBillNo.Substring(3, Math.Min(sBillNo.Length - 3,sBillNo.Length));
+                string BillNo = BillNo_PGD.Substring(3, Math.Min(BillNo_PGD.Length - 3, BillNo_PGD.Length));
                 switch (BillNoType2)
                 {
                     case "GXLZ"://宸ュ簭娴佽浆娲惧伐
-                        ds = oCN.RunProcReturn("select * from h_v_Sc_ProcExchSendWorkBill  where 娲惧伐鍗曟嵁鍙� = '" + sBillNo + "'", "h_v_Sc_ProcExchSendWorkBill");
+                        ds = oCN.RunProcReturn("select * from h_v_Sc_ProcExchSendWorkBill  where 娲惧伐鍗曟嵁鍙� = '" + BillNo_PGD + "'" + " and HEntryID ='" + entryid_PGD + "'", "h_v_Sc_ProcExchSendWorkBill");
                         break;
                     case "GXLX"://娴佽浆鍗�
-                        ds = oCN.RunProcReturn("select top 1 * from h_v_Sc_ProcessExchangeBillList  where 鍗曟嵁鍙�= '" + sBillNo + "'", "h_v_Sc_ProcessExchangeBillList");
+                        string sErr = "";
+                        if (oSystemParameter.ShowBill(ref sErr))
+                        {
+                            if (oSystemParameter.omodel.WMS_CampanyName == "涔斾竴")
+                            { //绯荤粺鍙傛暟鏄惁涓哄彧鏄剧ず褰撳墠鐧诲綍鐢ㄦ埛鍏宠仈鐨勫伐搴忎俊鎭�,N涓哄惁锛孻涓烘槸
+                                if (oSystemParameter.omodel.MES_StationInBill_ShowUSERProcess == "Y")
+                                {
+                                    ds = oCN.RunProcReturn($"exec h_p_ProcessExchangeBillLastHProNo '{BillNo_PGD}','{UserID}','{HBillType}'", "h_v_Gy_ProcessList_GetProcNoByUser");
+                                }
+                                else
+                                {
+                                    ds = oCN.RunProcReturn("select top 1 * from h_v_Sc_ProcessExchangeBillList  where 鍗曟嵁鍙�= '" + BillNo_PGD + "'", "h_v_Sc_ProcessExchangeBillList");
+                                }
+                            }
+                            else if (entryid_PGD != "") //濡傛灉瀛恑d涓嶄负绌哄垯鍔犲叆瀛恑d杩囨护锛�
+                            {
+                                ds = oCN.RunProcReturn("select * from h_v_Sc_ProcessExchangeBillList  where 鍗曟嵁鍙�= '" + BillNo_PGD + "'" + " and hsubid ='" + entryid_PGD + "'", "h_v_Sc_ProcessExchangeBillList");
+                            }
+                            else
+                            {
+                                ds = oCN.RunProcReturn("select top 1 * from h_v_Sc_ProcessExchangeBillList  where 鍗曟嵁鍙�= '" + BillNo_PGD + "'", "h_v_Sc_ProcessExchangeBillList");
+                            }
+                        }
                         break;
                 }
                 switch (BillNoType)

--
Gitblit v1.9.1