From 1818e4c439221ff459a87844f53199bb0f07e8cb Mon Sep 17 00:00:00 2001
From: yangle <admin@YINMOU>
Date: 星期一, 05 六月 2023 09:22:08 +0800
Subject: [PATCH] 出站单列表增加多选审核功能,增加判断条件,反审核人和审核人必须是同一个

---
 Model/车间管理/ClsSc_ProcessExchangeBillSub.cs                  |    1 
 Model/车间管理/ClsSc_ProcessExchangeBillMain.cs                 |    2 
 WebAPI/Controllers/CJGL/Cj_StationOutBillController.cs      |  186 ++++++++++++++++++++++++++++------------------
 WebAPI/Controllers/CJGL/Sc_ProcessExchangeBillController.cs |    2 
 WebAPI/Controllers/LMESController.cs                        |    7 +
 DAL/车间管理/ClsSc_ProcessExchangeBill.cs                       |    4 
 6 files changed, 124 insertions(+), 78 deletions(-)

diff --git "a/DAL/\350\275\246\351\227\264\347\256\241\347\220\206/ClsSc_ProcessExchangeBill.cs" "b/DAL/\350\275\246\351\227\264\347\256\241\347\220\206/ClsSc_ProcessExchangeBill.cs"
index fcb96aa..0f49233 100644
--- "a/DAL/\350\275\246\351\227\264\347\256\241\347\220\206/ClsSc_ProcessExchangeBill.cs"
+++ "b/DAL/\350\275\246\351\227\264\347\256\241\347\220\206/ClsSc_ProcessExchangeBill.cs"
@@ -176,7 +176,7 @@
                       ",HLastProc,HKeyProc,HFstProc,HICMOInterID,HICMOBillNo,HWWOrderInterID," +
                       "HWWOrderEntryID,HWWOrderBillNo,HReportQty,HBackProc" +
                       ",HSupID,HSupFlag,HOverRate,HMaxQty,HTechnologyParameter,HProcCheckNote,HPicNum" +
-                      ",HMouldNo,HProcWorkNum,HSeOrderInterID,HSeOrderEntryID" +
+                      ",HMouldNo,HProcWorkNum,HSeOrderInterID,HSeOrderEntryID,HRelationQty_OutBad" +
                       ") values("
                       + omodel.HInterID.ToString() + "," + oSub.HEntryID.ToString() + ",'" + omodel.HBillNo + "'" +
                       ",'" + oSub.HCloseMan + "','" + oSub.HEntryCloseDate + "'," + Convert.ToString(oSub.HCloseType ? 1 : 0) + ",'" + oSub.HRemark + "'" +
@@ -194,7 +194,7 @@
                       ",'" + oSub.HKeyProc + "','" + oSub.HFstProc + "'," + oSub.HICMOInterID.ToString() + ",'" + oSub.HICMOBillNo + "'," + oSub.HWWOrderInterID.ToString() +
                       "," + oSub.HWWOrderEntryID.ToString() + ",'" + oSub.HWWOrderBillNo + "'," + oSub.HReportQty.ToString() + "," + Convert.ToString(oSub.HBackProc ? 1 : 0) +
                       "," + oSub.HSupID.ToString() + "," + Convert.ToString(oSub.HSupFlag ? 1 : 0) + "," + oSub.HOverRate.ToString() + "," + oSub.HMaxQty.ToString() + ",'" + oSub.HTechnologyParameter + "','" + oSub.HProcCheckNote + "','" + oSub.HPicNum + "'" +
-                      ",'" + oSub.HMouldNo + "','" + oSub.HProcWorkNum + "','" + DBUtility.ClsPub.isStrNull(omodel.HSeOrderInterID) + "','" + DBUtility.ClsPub.isStrNull(omodel.HSeOrderEntryID) + "'"+
+                      ",'" + oSub.HMouldNo + "','" + oSub.HProcWorkNum + "','" + DBUtility.ClsPub.isStrNull(omodel.HSeOrderInterID) + "','" + DBUtility.ClsPub.isStrNull(omodel.HSeOrderEntryID) + "','" + oSub.HRelationQty_OutBad + "'" +
                       ") ");
                     oCn.RunProc(sql1);
                 }
diff --git "a/Model/\350\275\246\351\227\264\347\256\241\347\220\206/ClsSc_ProcessExchangeBillMain.cs" "b/Model/\350\275\246\351\227\264\347\256\241\347\220\206/ClsSc_ProcessExchangeBillMain.cs"
index 821d217..1adc16c 100644
--- "a/Model/\350\275\246\351\227\264\347\256\241\347\220\206/ClsSc_ProcessExchangeBillMain.cs"
+++ "b/Model/\350\275\246\351\227\264\347\256\241\347\220\206/ClsSc_ProcessExchangeBillMain.cs"
@@ -94,7 +94,7 @@
         public int HSplitSumQty;//拆分总量
         public int HSplitColorQty;//分缸号
         public string HMachineLine;//机台
-
+       
         public string HRemark2;//备注2
         public string HRemark3;//底部备注
     }
diff --git "a/Model/\350\275\246\351\227\264\347\256\241\347\220\206/ClsSc_ProcessExchangeBillSub.cs" "b/Model/\350\275\246\351\227\264\347\256\241\347\220\206/ClsSc_ProcessExchangeBillSub.cs"
index 74eb8ad..7b46ba5 100644
--- "a/Model/\350\275\246\351\227\264\347\256\241\347\220\206/ClsSc_ProcessExchangeBillSub.cs"
+++ "b/Model/\350\275\246\351\227\264\347\256\241\347\220\206/ClsSc_ProcessExchangeBillSub.cs"
@@ -71,6 +71,7 @@
         public string HTechnologyParameter;//工艺参数
         public string HMouldNo;//模具编号
         public string HProcWorkNum;//程序号
+        public string HRelationQty_OutBad;//不合格数量
     }
 }
 
diff --git a/WebAPI/Controllers/CJGL/Cj_StationOutBillController.cs b/WebAPI/Controllers/CJGL/Cj_StationOutBillController.cs
index cc792f5..ae497c1 100644
--- a/WebAPI/Controllers/CJGL/Cj_StationOutBillController.cs
+++ b/WebAPI/Controllers/CJGL/Cj_StationOutBillController.cs
@@ -2128,7 +2128,7 @@
         #region 瀹℃牳
         [Route("Cj_StationOutBill/set_CheckBill")]
         [HttpGet]
-        public object set_CheckBill(int HInterID, string CurUserName)
+        public object set_CheckBill(string HInterID, string CurUserName)
         {
             try
             {
@@ -2142,54 +2142,64 @@
                     objJsonResult.data = null;
                     return objJsonResult;
                 }
-
-                if (HInterID == 0)
-                {
-                    objJsonResult.code = "0";
-                    objJsonResult.count = 0;
-                    objJsonResult.Message = "鍗曟嵁ID涓�0锛屼笉鑳藉鏍革紒";
-                    objJsonResult.data = null;
-                    return objJsonResult;
-                }
+                var HBillNo = HInterID.Split(',');
                 DAL.ClsSc_StationOutBill oBill = new DAL.ClsSc_StationOutBill();
-                //鏌ョ湅鏄惁宸插鏍�,鍏抽棴,浣滃簾
-                if (oBill.ShowBill(HInterID, ref DBUtility.ClsPub.sExeReturnInfo))
+
+                for (int i = 0; i < HBillNo.Length; i++)
                 {
-                    if (oBill.omodel.HChecker.Trim() != "")
+                    if (HBillNo[i] == "0")
                     {
                         objJsonResult.code = "0";
                         objJsonResult.count = 0;
-                        objJsonResult.Message = "鍗曟嵁宸插鏍�!涓嶈兘鍐嶆瀹℃牳";
+                        objJsonResult.Message = "绗�"+(i+1)+"琛�:鍗曟嵁ID涓�0锛屼笉鑳藉鏍革紒";
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
+                    //鏌ョ湅鏄惁宸插鏍�,鍏抽棴,浣滃簾
+                    if (oBill.ShowBill(long.Parse(HBillNo[i]), ref DBUtility.ClsPub.sExeReturnInfo))
+                    {
+                        if (oBill.omodel.HChecker.Trim() != "")
+                        {
+                            objJsonResult.code = "0";
+                            objJsonResult.count = 0;
+                            objJsonResult.Message = "绗�" + (i + 1) + "琛�:鍗曟嵁宸插鏍�!涓嶈兘鍐嶆瀹℃牳";
+                            objJsonResult.data = null;
+                            return objJsonResult;
+                        }
+                    }
+                    else
+                    {
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "绗�" + (i + 1) + "琛�:鍗曟嵁涓嶅瓨鍦�!鍘熷洜:" + DBUtility.ClsPub.sExeReturnInfo;
                         objJsonResult.data = null;
                         return objJsonResult;
                     }
                 }
-                else
+
+                int j = 0;
+                for (int i = 0; i < HBillNo.Length; i++)
                 {
-                    objJsonResult.code = "0";
-                    objJsonResult.count = 0;
-                    objJsonResult.Message = "鍗曟嵁涓嶅瓨鍦�!鍘熷洜:" + DBUtility.ClsPub.sExeReturnInfo;
-                    objJsonResult.data = null;
-                    return objJsonResult;
-                }
-                //瀹℃牳
-                if (Cj_StationOutBillCheckBill(HInterID, CurUserName, oBill.omodel.HLastSubProc, ref DBUtility.ClsPub.sExeReturnInfo))
-                {
-                    objJsonResult.code = "1";
-                    objJsonResult.count = 1;
-                    objJsonResult.Message = "瀹℃牳鎴愬姛!";
-                    objJsonResult.data = null;
-                    return objJsonResult;
-                }
-                else
-                {
-                    objJsonResult.code = "0";
-                    objJsonResult.count = 0;
-                    objJsonResult.Message = "瀹℃牳澶辫触!鍘熷洜:" + DBUtility.ClsPub.sExeReturnInfo;
-                    objJsonResult.data = null;
-                    return objJsonResult;
+                    //瀹℃牳
+                    if (Cj_StationOutBillCheckBill(long.Parse(HBillNo[i]), CurUserName, oBill.omodel.HLastSubProc, ref DBUtility.ClsPub.sExeReturnInfo))
+                    {
+                        j += 1;
+                    }
+                    else
+                    {
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "鎴愬姛:" + j + "琛�,绗�" + (i + 1) + "琛�:瀹℃牳澶辫触!鍘熷洜:" + DBUtility.ClsPub.sExeReturnInfo;
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
                 }
 
+                objJsonResult.code = "1";
+                objJsonResult.count = 1;
+                objJsonResult.Message = "鍏ㄩ儴鎵ц鎴愬姛!";
+                objJsonResult.data = null;
+                return objJsonResult;
             }
             catch (Exception e)
             {
@@ -2246,7 +2256,7 @@
         #region 鍙嶅鏍�
         [Route("Cj_StationOutBill/set_AbandonCheck")]
         [HttpGet]
-        public object set_AbandonCheck(int HInterID, string CurUserName)
+        public object set_AbandonCheck(string HInterID, string CurUserName)
         {
             try
             {
@@ -2261,52 +2271,82 @@
                     return objJsonResult;
                 }
 
-                if (HInterID == 0)
-                {
-                    objJsonResult.code = "0";
-                    objJsonResult.count = 0;
-                    objJsonResult.Message = "鍗曟嵁ID涓�0锛屼笉鑳藉弽瀹℃牳锛�";
-                    objJsonResult.data = null;
-                    return objJsonResult;
-                }
+                var HBillNo = HInterID.Split(',');
                 DAL.ClsSc_StationOutBill oBill = new DAL.ClsSc_StationOutBill();
-                //鏌ョ湅鏄惁宸插鏍�,鍏抽棴,浣滃簾
-                if (oBill.ShowBill(HInterID, ref DBUtility.ClsPub.sExeReturnInfo))
+
+                //鑾峰彇绯荤粺鍙傛暟
+                string Ret = "";
+                oSystemParameter.ShowBill(ref Ret);
+
+                    for (int i = 0; i < HBillNo.Length; i++)
                 {
-                    if (oBill.omodel.HChecker.Trim() == "")
+                    if (long.Parse(HBillNo[i]) == 0)
                     {
                         objJsonResult.code = "0";
                         objJsonResult.count = 0;
-                        objJsonResult.Message = "鍗曟嵁鏈鏍�!涓嶉渶瑕佸弽瀹℃牳!";
+                        objJsonResult.Message = "绗�" + (i + 1) + "琛�:鍗曟嵁ID涓�0锛屼笉鑳藉弽瀹℃牳锛�";
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
+
+                    //鏌ョ湅鏄惁宸插鏍�,鍏抽棴,浣滃簾
+                    if (oBill.ShowBill(long.Parse(HBillNo[i]), ref DBUtility.ClsPub.sExeReturnInfo))
+                    {
+                        if (oBill.omodel.HChecker.Trim() == "")
+                        {
+                            objJsonResult.code = "0";
+                            objJsonResult.count = 0;
+                            objJsonResult.Message = "绗�" + (i + 1) + "琛�:鍗曟嵁鏈鏍�!涓嶉渶瑕佸弽瀹℃牳!";
+                            objJsonResult.data = null;
+                            return objJsonResult;
+                        }
+
+                        //瀹℃牳浜哄繀椤诲拰鍙嶅鏍镐汉淇濇寔涓�鑷�  涔斾竴
+                        if (oSystemParameter.omodel.WMS_CampanyName == "涔斾竴")
+                        {
+                            if (oBill.omodel.HChecker.Trim() != CurUserName)
+                            {
+                                objJsonResult.code = "0";
+                                objJsonResult.count = 0;
+                                objJsonResult.Message = "绗�" + (i + 1) + "琛�:瀹℃牳浜哄拰鍙嶅鏍镐汉涓嶄竴鑷�!";
+                                objJsonResult.data = null;
+                                return objJsonResult;
+                            }
+                        }
+                    }
+                    else
+                    {
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "绗�" + (i + 1) + "琛�:鍗曟嵁涓嶅瓨鍦�!鍘熷洜:" + DBUtility.ClsPub.sExeReturnInfo;
                         objJsonResult.data = null;
                         return objJsonResult;
                     }
                 }
-                else
+
+                int j = 0;
+                for (int i = 0; i < HBillNo.Length; i++)
                 {
-                    objJsonResult.code = "0";
-                    objJsonResult.count = 0;
-                    objJsonResult.Message = "鍗曟嵁涓嶅瓨鍦�!鍘熷洜:" + DBUtility.ClsPub.sExeReturnInfo;
-                    objJsonResult.data = null;
-                    return objJsonResult;
+                    //鍙嶅鏍�
+                    if (Cj_StationOutBillAbandonCheckBill(long.Parse(HBillNo[i]), CurUserName, oBill.omodel.HLastSubProc, ref DBUtility.ClsPub.sExeReturnInfo))
+                    {
+                        j += 1;
+                    }
+                    else
+                    {
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "鎴愬姛:" + j + "琛�,绗�" + (i + 1) + "琛�:鍙嶅鏍稿け璐�!鍘熷洜:" + DBUtility.ClsPub.sExeReturnInfo;
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
                 }
-                //鍙嶅鏍�
-                if (Cj_StationOutBillAbandonCheckBill(HInterID, CurUserName, oBill.omodel.HLastSubProc, ref DBUtility.ClsPub.sExeReturnInfo))
-                {
-                    objJsonResult.code = "1";
-                    objJsonResult.count = 1;
-                    objJsonResult.Message = "鍙嶅鏍告垚鍔�!";
-                    objJsonResult.data = null;
-                    return objJsonResult;
-                }
-                else
-                {
-                    objJsonResult.code = "0";
-                    objJsonResult.count = 0;
-                    objJsonResult.Message = "鍙嶅鏍稿け璐�!鍘熷洜:" + DBUtility.ClsPub.sExeReturnInfo;
-                    objJsonResult.data = null;
-                    return objJsonResult;
-                }
+
+                objJsonResult.code = "1";
+                objJsonResult.count = 1;
+                objJsonResult.Message = "鍏ㄩ儴鎵ц鎴愬姛!";
+                objJsonResult.data = null;
+                return objJsonResult;
             }
             catch (Exception e)
             {
diff --git a/WebAPI/Controllers/CJGL/Sc_ProcessExchangeBillController.cs b/WebAPI/Controllers/CJGL/Sc_ProcessExchangeBillController.cs
index 3fca236..336f225 100644
--- a/WebAPI/Controllers/CJGL/Sc_ProcessExchangeBillController.cs
+++ b/WebAPI/Controllers/CJGL/Sc_ProcessExchangeBillController.cs
@@ -802,7 +802,7 @@
                                                 宸ヤ綔涓績 HCenterName,HSupID,渚涘簲鍟嗕唬鐮� HSupNumber,渚涘簲鍟� HSupName,isEntrust HSupFlag,璁″垝鏁伴噺 HQty,鍔犲伐鍗曚环 HOutPrice, 琛ㄤ綋澶囨敞 HRemark,
                                             杩涚珯鍏宠仈鏁伴噺 HRelationQty_In,鍑虹珯鍏宠仈鏁伴噺 HRelationQty_Out,濮斿宸ュ崟鏁伴噺 HRelationQty_WWOrder,涓嶅悎鏍兼暟閲� HRelationQty_Bad,瓒呴姣斾緥 HOverRate,
                                             鑹巼 HPassRate,绱鑹巼 HSumPassRate,鍥剧焊缂栧彿 HPicNum,鏈伐搴忕‘璁よ褰� HProcCheckNote,宸ヨ壓鍙傛暟 HTechnologyParameter,HDeptID,
-                                            鍔犲伐杞﹂棿浠g爜 HDeptNumber,鍔犲伐杞﹂棿 HDeptName
+                                            鍔犲伐杞﹂棿浠g爜 HDeptNumber,鍔犲伐杞﹂棿 HDeptName,鍑虹珯鎶ュ簾鍏宠仈鏁伴噺 HRelationQty_OutBad
                                             from h_v_Sc_ProcessExchangeBillQuerySub");
                 ds = oCN.RunProcReturn(sql+ " where hmainid="+ HInterID + "  order by cast(娴佹按鍙� as int) ", "h_v_Sc_ProcessExchangeBillQuerySub");
                 objJsonResult.code = "0";
diff --git a/WebAPI/Controllers/LMESController.cs b/WebAPI/Controllers/LMESController.cs
index cf9b9bf..816c3c2 100644
--- a/WebAPI/Controllers/LMESController.cs
+++ b/WebAPI/Controllers/LMESController.cs
@@ -425,7 +425,12 @@
                 }
                 else
                 {
-                    string sql1 = "select top 1000 * from h_v_Gy_RoutingBillList where 1 = 1 ";
+                    string sql1 = "select * from h_v_Gy_RoutingBillList where 1 = 1 ";
+                    //瀹㈡埛鑷畾涔�
+                    if (oSystemParameter.omodel.WMS_CampanyName == "鐟炰笌绁�")
+                    {
+                         sql1 = "select top 1000 * from h_v_Gy_RoutingBillList where 1 = 1 ";
+                    }
                     string sql = sql1 + sWhere + " order by hmainid desc,cast(宸ュ簭鍙� as int)";
                     ds = oCN.RunProcReturn(sql, "h_v_Gy_RoutingBillList");
                 }

--
Gitblit v1.9.1