From 261e4f0953cee0070fd790d299372d375087e500 Mon Sep 17 00:00:00 2001
From: yangle <admin@YINMOU>
Date: 星期一, 24 七月 2023 13:31:49 +0800
Subject: [PATCH] 生产订单编辑 加 客户规格型号   客户物料名称 客户订单报表增加两字段(业务状态、备注取生产订单),报表增加两个按钮,可以去变更两个字段的值。(业务状态修改成完工之后,报表就显示ok,选择其中一行变更后反写到生产订单当中)

---
 WebAPI/Controllers/SCGL/日计划管理/JIT_DayPlanPlatFormBillController.cs |   82 +++++++++++++++++++
 Model/生产管理/ClsSc_ICMOBillSub.cs                                    |    4 +
 WebAPI/Controllers/LMESController.cs                               |  119 +++++++++++++++++++++++++++++
 WebAPI/Controllers/SBGL/Gy_EquipFileMainController.cs              |    2 
 WebAPI/Controllers/生产管理/生产任务单/Sc_ICMOBillController.cs             |    6 
 5 files changed, 204 insertions(+), 9 deletions(-)

diff --git "a/Model/\347\224\237\344\272\247\347\256\241\347\220\206/ClsSc_ICMOBillSub.cs" "b/Model/\347\224\237\344\272\247\347\256\241\347\220\206/ClsSc_ICMOBillSub.cs"
index 546334f..6a6bb3f 100644
--- "a/Model/\347\224\237\344\272\247\347\256\241\347\220\206/ClsSc_ICMOBillSub.cs"
+++ "b/Model/\347\224\237\344\272\247\347\256\241\347\220\206/ClsSc_ICMOBillSub.cs"
@@ -40,5 +40,9 @@
         public double HWidth; //幅宽
         public double HWeight; //克重
         public string HColorRemark; //染色要求
+
+        public string HCusMaterName; //客户物料名称
+        public string HCusModel; //客户规格型号 
+
     }
 }
diff --git a/WebAPI/Controllers/LMESController.cs b/WebAPI/Controllers/LMESController.cs
index 97bc966..6b74fad 100644
--- a/WebAPI/Controllers/LMESController.cs
+++ b/WebAPI/Controllers/LMESController.cs
@@ -428,7 +428,7 @@
                 {
                     string sql1 = "select * from h_v_Gy_RoutingBillList where 1 = 1 ";
                     //瀹㈡埛鑷畾涔�
-                    if (oSystemParameter.omodel.WMS_CampanyName == "鐟炰笌绁�")
+                    if (oSystemParameter.omodel.WMS_CampanyName == "鐟炰笌绁�" || oSystemParameter.omodel.WMS_CampanyName == "鍑礉濂堢壒")
                     {
                          sql1 = "select top 1000 * from h_v_Gy_RoutingBillList where 1 = 1 ";
                     }
@@ -495,7 +495,7 @@
                 {
                     string sql1 = "select * from h_v_Gy_RoutingBillList_His where 1 = 1 ";
                     //瀹㈡埛鑷畾涔�
-                    if (oSystemParameter.omodel.WMS_CampanyName == "鐟炰笌绁�")
+                    if (oSystemParameter.omodel.WMS_CampanyName == "鐟炰笌绁�"|| oSystemParameter.omodel.WMS_CampanyName == "鍑礉濂堢壒")
                     {
                         sql1 = "select top 1000 * from h_v_Gy_RoutingBillList_His where 1 = 1 ";
                     }
@@ -868,6 +868,121 @@
             return GetObjectJson(ds);
         }
 
+        #region 瀹㈡埛璁㈠崟  鐢熶骇璁㈠崟瀹屽伐
+        [Route("LEMS/sc_ICOMReportClose")]
+        [HttpPost]
+        public object sc_ICOMReportClose([FromBody] JObject sMainSub)
+        {
+            DataSet ds;
+            try
+            {
+                var _value = sMainSub["sMainSub"].ToString();
+                string[] sArray = _value.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries);
+                string HICOMBillNoNum = sArray[0].ToString(); 
+                string user = sArray[1].ToString(); 
+
+                //鍒ゆ柇鏄惁鏈夋煡璇㈡潈闄�
+                if (!DBUtility.ClsPub.Security_Log("Sc_ICMOBill_Edit", 1, false, user))
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "鏃犳潈闄愭煡璇�!";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+                var HICOMBillNo = HICOMBillNoNum.Split(',');
+
+                oCN.BeginTran();
+                for (int i = 0; i < HICOMBillNo.Length; i++)
+                {
+                    ds = oCN.RunProcReturn("select * from Sc_ICMOBillMain where HBillNo='" + HICOMBillNo[i] + "'", "Sc_ICMOBillMain");
+                    if (ds.Tables[0].Rows.Count == 0)
+                    {
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "鏌ユ棤鏁版嵁锛�";
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
+                    oCN.RunProc("update Sc_ICMOBillSub set HSTATUS=5 where HInterID=" + ds.Tables[0].Rows[0]["HInterID"].ToString());
+                }
+                oCN.Commit();
+
+                objJsonResult.code = "1";
+                objJsonResult.count = 1;
+                objJsonResult.Message = "鎴愬姛瀹屽伐璁㈠崟!";
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+            catch (Exception e)
+            {
+                oCN.RollBack();
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "娌℃湁杩斿洖浠讳綍璁板綍锛�" + e.ToString();
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
+        #endregion
+
+        #region 瀹㈡埛璁㈠崟  鐢熶骇璁㈠崟娣诲姞澶囨敞
+        [Route("LEMS/sc_ICOMReportAddHRemark")]
+        [HttpPost]
+        public object sc_ICOMReportAddHRemark([FromBody] JObject sMainSub)
+        {
+            DataSet ds;
+            try
+            {
+                var _value = sMainSub["sMainSub"].ToString();
+                string[] sArray = _value.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries);
+                string HICOMBillNo = sArray[0].ToString();
+                string HRemark = sArray[1].ToString();
+                string user = sArray[2].ToString();
+
+                //鍒ゆ柇鏄惁鏈夋煡璇㈡潈闄�
+                if (!DBUtility.ClsPub.Security_Log("Sc_ICMOBill_Edit", 1, false, user))
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "鏃犳潈闄愭煡璇�!";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+
+                oCN.BeginTran();
+
+                ds = oCN.RunProcReturn("select * from Sc_ICMOBillMain where HBillNo='" + HICOMBillNo + "'", "Sc_ICMOBillMain");
+                if (ds.Tables[0].Rows.Count == 0)
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "鏌ユ棤鏁版嵁锛�";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+                oCN.RunProc("update Sc_ICMOBillMain set HRemark2='" + HRemark + "' where HBillNo='" + HICOMBillNo + "'");
+
+                oCN.Commit();
+
+                objJsonResult.code = "1";
+                objJsonResult.count = 1;
+                objJsonResult.Message = "淇濆瓨鎴愬姛!";
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+            catch (Exception e)
+            {
+                oCN.RollBack();
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "娌℃湁杩斿洖浠讳綍璁板綍锛�" + e.ToString();
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
+        #endregion
+
         #region 鍒ゆ柇涓嬫帹鐨勭敓浜ц鍗曟槸鍚﹀鏍�
         [Route("LEMS/ICMOBillCheck")]
         [HttpGet]
diff --git a/WebAPI/Controllers/SBGL/Gy_EquipFileMainController.cs b/WebAPI/Controllers/SBGL/Gy_EquipFileMainController.cs
index fd4b567..188a2a3 100644
--- a/WebAPI/Controllers/SBGL/Gy_EquipFileMainController.cs
+++ b/WebAPI/Controllers/SBGL/Gy_EquipFileMainController.cs
@@ -228,7 +228,7 @@
                 oCN.RunProc("Insert into Gy_EquipFileBillMain " +
                    " (hbillno,HEquipFileNumber,HEquipFileNo,HName,HModel,HModel2,HMaterID,HUnitID,HOutComDate" +
                    ",HOutComNo,HDeptID,HUseEmpID,HRepairEmpID,HAddress,HSetupDate,HStartupDate,HStatus," +
-                   "HEquipFileTypeID,HProNum,HBarCode,HWorkArea,HLogo,HSellSupID,HMakeSupID,hbilltype,HDate,HYear,HMaker,HMakeDate,HEquipMaintainRuleInterID,HEquipDotCheckRuleInterID,HSourceID) " +
+"HEquipFileTypeID,HProNum,HBarCode,HWorkArea,HLogo,HSellSupID,HMakeSupID,hbilltype,HDate,HYear,HMaker,HMakeDate,HEquipMaintainRuleInterID,HEquipDotCheckRuleInterID,HSourceID) " +
                    " Values('" + hbillno + "','" + HEquipFileNumber + "','" + HEquipFileNo + "','" + HName + "','" + HModel + "','" + HModel2 + "'," + HMaterID + "," + HUnitID +
                    ",'" + HOutComDate + "','" + HOutComNo + "'," + HDeptID + "," + HUseEmpID + "," + HRepairEmpID + ",'" + HAddress +
                    "','" + HSetupDate + "','" + HStartupDate + "','" + HStatus + "'," + HEquipFileTypeID + ",'" + HProNum +
diff --git "a/WebAPI/Controllers/SCGL/\346\227\245\350\256\241\345\210\222\347\256\241\347\220\206/JIT_DayPlanPlatFormBillController.cs" "b/WebAPI/Controllers/SCGL/\346\227\245\350\256\241\345\210\222\347\256\241\347\220\206/JIT_DayPlanPlatFormBillController.cs"
index 3e81c3e..231d35d 100644
--- "a/WebAPI/Controllers/SCGL/\346\227\245\350\256\241\345\210\222\347\256\241\347\220\206/JIT_DayPlanPlatFormBillController.cs"
+++ "b/WebAPI/Controllers/SCGL/\346\227\245\350\256\241\345\210\222\347\256\241\347\220\206/JIT_DayPlanPlatFormBillController.cs"
@@ -8,6 +8,7 @@
 using Newtonsoft.Json;
 using Newtonsoft.Json.Linq;
 using System.Diagnostics;
+using System.Threading;
 
 namespace WebAPI.Controllers.SCGL.鏃ヨ鍒掔鐞�
 {
@@ -221,14 +222,16 @@
                             " HMaterID, HMaterName, HMaterModel, HUnitID, HSeOrderBillQty," +
                             " HOrderNeedQty, HSplitQty, HDayPlanSumQty,HPlanBeginDate," +
                             "HSeOrderBillNo,HICMOBillType,HSourceStockInQty,HLeftPlanQty,HOrderLev,HPreparatDate," +
-                            "HMainSourceInterID,HMainSourceEntryID,HICMOInterID_Sec,HICMOEntryID_Sec,HPlanQty)values" +
+                            "HMainSourceInterID,HMainSourceEntryID,HICMOInterID_Sec,HICMOEntryID_Sec,HPlanQty" +
+                            ",HICMOInterID,HICMOEntryID)values" +
                             $"({HInterID},'{HBillNo}',{DateTime.Now.Year},{DateTime.Now.Month},'{BillType}'," +
                             $"'{BillType}',GETDATE(),1,'{user}',getdate(),'{HICMOBillNo}','{HOrderType}'," +
                             $"{(HICMOEntrySEQ == "" ? 0.ToString() : HICMOEntrySEQ)},{(HWorkShopID == "" ? 0.ToString() : HWorkShopID)},{(HSourceID == "" ? 0.ToString() : HSourceID)}, {(HYX == "" ? 0.ToString() : HYX)}, {(HProdORGID == "" ? 0.ToString() : HProdORGID)}," +
                             $" {(HMaterID == "" ? 0.ToString() : HMaterID)}, '{HMaterName}', '{HMaterModel}', {(HUnitID == "" ? 0.ToString() : HUnitID)}, {(HSeOrderBillQty == "" ? 0.ToString() : HSeOrderBillQty)}," +
                             $" 0, {(HSplitQty == "" ? 0.ToString() : HSplitQty)}, {(HDayPlanSumQty == "" ? 0.ToString() : HDayPlanSumQty)},'{HPlanBeginDate}'," +
                             $"'{HSeOrderBillNo}','{HICMOBillType}',{(HSourceStockInQty == "" ? 0.ToString() : HSourceStockInQty)},{(HLeftPlanQty == "" ? 0.ToString() : HLeftPlanQty)},'{HOrderLev}',getdate()," +
-                            $"{HMainSourceInterID},{HMainSourceEntryID},{HMainSourceInterID},{HMainSourceEntryID},{HPlanQty})";
+                            $"{HMainSourceInterID},{HMainSourceEntryID},{HMainSourceInterID},{HMainSourceEntryID},{HPlanQty}," +
+                            $"{HMainSourceInterID},{HMainSourceEntryID})";
 
                         //LogService.Write("sql:" + sql);
                         //涓昏〃
@@ -242,6 +245,13 @@
                         var HICMOEntrySEQ = list[i]["鐢熶骇璁㈠崟鏄庣粏琛屽彿"].ToString();
                         var HSourceID = list[i]["HSourceID"].ToString();
                         var HYX = list[i]["浼樺厛绾�"].ToString();
+                        var HWorkQty = list[i]["灏忔椂浜ц兘"].ToString();
+                        var HProdTimes = list[i]["鐢熶骇鍛ㄦ湡"].ToString();
+                        var HReadyTimes = list[i]["寮�宸ヤ綑閲�"].ToString();
+                        var HLastBeginDate = list[i]["鏈�杩熷紑宸ユ棩鏈�"].ToString();
+                        var HLastEndDate = list[i]["鏈�杩熷畬宸ユ棩鏈�"].ToString();
+                        var HOrderNeedQty = list[i]["璁㈠崟闇�姹傛暟閲�"].ToString();
+                        var HOrderCommitDate = list[i]["璁㈠崟浜よ揣鏈�"].ToString();
 
                         if (HSourceID == "" || HSourceID == "0")
                         {
@@ -273,7 +283,10 @@
                             return objJsonResult;
                         }
 
-                        oCN.RunProc($"update Sc_WorkBillSortBillMain set HSourceID={(HSourceID == "" ? 0.ToString() : HSourceID)},HYX={HYX} where HInterID={list[i]["hmainid"].ToString()} and HBillNo='{list[i]["鍗曟嵁鍙�"].ToString()}'");
+                        oCN.RunProc($"update Sc_WorkBillSortBillMain set HSourceID={(HSourceID == "" ? 0.ToString() : HSourceID)},HYX={HYX}" +
+                            $",HWorkQty={HWorkQty},HProdTimes={HProdTimes},HReadyTimes={HReadyTimes},HLastBeginDate='{HLastBeginDate}'" +
+                            $",HLastEndDate='{HLastEndDate}',HOrderNeedQty={HOrderNeedQty},HOrderCommitDate='{HOrderCommitDate}'" +
+                            $" where HInterID={list[i]["hmainid"].ToString()} and HBillNo='{list[i]["鍗曟嵁鍙�"].ToString()}'");
                     }
 
                     oCN.RunProc($"update Sc_WorkBillSortBillMain set HDayPlanSumQty={list[i]["鏃ヨ鍒掓暟閲忔�婚噺"].ToString()} where HInterID={(HInterID==0?int.Parse(list[i]["hmainid"].ToString()):HInterID)} and HBillNo='{(HBillNo==""?list[i]["鍗曟嵁鍙�"].ToString(): HBillNo)}'");
@@ -2588,5 +2601,68 @@
         }
         #endregion
 
+        #region 鐢熶骇鏃ヨ鍒掑钩鍙� 鏁版嵁鍑嗗 璁剧疆浠诲姟鍗曠浉鍏充俊鎭�
+        [Route("JIT_DayPlanPlatFormBill/ReadyData")]
+        [HttpGet]
+        public object ReadyData(string HICOMNum)
+        {
+            try
+            {
+                var list = HICOMNum.Split(',');
+                DataTable dt = new DataTable("date");
+                dt.Columns.Add("HICMOInterID", typeof(string));
+                dt.Columns.Add("HICMOEntryID", typeof(string));
+                dt.Columns.Add("灏忔椂浜ц兘", typeof(string));
+                dt.Columns.Add("鐢熶骇鍛ㄦ湡", typeof(decimal));
+                dt.Columns.Add("寮�宸ヤ綑閲�", typeof(decimal));
+                dt.Columns.Add("鏈�杩熷紑宸ユ棩鏈�", typeof(DateTime));
+                dt.Columns.Add("鏈�杩熷畬宸ユ棩鏈�", typeof(DateTime));
+                dt.Columns.Add("璁㈠崟闇�姹傛暟閲�", typeof(decimal));
+                dt.Columns.Add("璁㈠崟浜よ揣鏈�", typeof(DateTime));
+
+                for (int i = 0; i < list.Length; i++)
+                {
+                    string HICMOInterID = list[i].Split(';')[0].ToString();
+                    string HICMOEntryID = list[i].Split(';')[1].ToString();
+
+                    Thread.Sleep(100);
+                    ds = oCN.RunProcReturn("exec h_p_Sc_GetInfoByICMOBillNo " + HICMOInterID+","+ HICMOEntryID, "h_p_Sc_GetInfoByICMOBillNo");
+                    if (ds == null || ds.Tables[0].Rows.Count == 0)
+                    {
+                        
+                    }
+                    else
+                    {
+                        DataRow dr = dt.NewRow();
+                        dr["灏忔椂浜ц兘"] = DBUtility.ClsPub.isSingle(ds.Tables[0].Rows[0]["浜ц兘"]);
+                        dr["鐢熶骇鍛ㄦ湡"] = DBUtility.ClsPub.isSingle(ds.Tables[0].Rows[0]["鐢熶骇鍛ㄦ湡"]);
+                        dr["寮�宸ヤ綑閲�"] = DBUtility.ClsPub.isSingle(ds.Tables[0].Rows[0]["寮�宸ヤ綑閲�"]);
+                        dr["鏈�杩熷紑宸ユ棩鏈�"] = DBUtility.ClsPub.isDate(ds.Tables[0].Rows[0]["鏈�杩熷紑宸ユ棩鏈�"]);
+                        dr["鏈�杩熷畬宸ユ棩鏈�"] = DBUtility.ClsPub.isDate(ds.Tables[0].Rows[0]["鏈�杩熷畬宸ユ棩鏈�"]);
+                        dr["璁㈠崟闇�姹傛暟閲�"] = DBUtility.ClsPub.isSingle(ds.Tables[0].Rows[0]["璁㈠崟闇�姹傛暟"]);
+                        dr["璁㈠崟浜よ揣鏈�"] = DBUtility.ClsPub.isDate(ds.Tables[0].Rows[0]["璁㈠崟浜よ揣鏈�"]);
+                        dr["HICMOInterID"] = DBUtility.ClsPub.isSingle(ds.Tables[0].Rows[0]["HICMOInterID"]);
+                        dr["HICMOEntryID"] = DBUtility.ClsPub.isSingle(ds.Tables[0].Rows[0]["HICMOEntryID"]);
+                        dt.Rows.Add(dr);
+                    }
+                }
+
+                objJsonResult.code = "1";
+                objJsonResult.count = 1;
+                objJsonResult.Message = "Sucess锛�";
+                objJsonResult.data = dt;
+                return objJsonResult;
+            }
+            catch (Exception e)
+            {
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "Exception锛�" + e.ToString();
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
+        #endregion
+
     }
 }
\ No newline at end of file
diff --git "a/WebAPI/Controllers/\347\224\237\344\272\247\347\256\241\347\220\206/\347\224\237\344\272\247\344\273\273\345\212\241\345\215\225/Sc_ICMOBillController.cs" "b/WebAPI/Controllers/\347\224\237\344\272\247\347\256\241\347\220\206/\347\224\237\344\272\247\344\273\273\345\212\241\345\215\225/Sc_ICMOBillController.cs"
index e09ae6e..427a570 100644
--- "a/WebAPI/Controllers/\347\224\237\344\272\247\347\256\241\347\220\206/\347\224\237\344\272\247\344\273\273\345\212\241\345\215\225/Sc_ICMOBillController.cs"
+++ "b/WebAPI/Controllers/\347\224\237\344\272\247\347\256\241\347\220\206/\347\224\237\344\272\247\344\273\273\345\212\241\345\215\225/Sc_ICMOBillController.cs"
@@ -446,6 +446,7 @@
                 string HMaker = user;//鍒跺崟浜�
                 string HIsStockQty = mainList[0].HIsStockQty;
                 string HRemark3 = mainList[0].HRemark3;
+              
 
                 ds = oCN.RunProcReturn("select * from h_v_IF_ICMOBillList where hmainid=" + HInterID + " and 鍗曟嵁鍙�='" + HBillNo + "'", "h_v_IF_ICMOBillList");
 
@@ -569,15 +570,14 @@
                 ,HMaterID,HUnitID,HRemark,HSourceID,HDeptID,HSTATUS
                 ,HBomID,HEntryCusID,HSTOCKINORGID
 				,HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney
-                ,HAuxQty,HAuxUnit,HWidth,HWeight,HColorRemark) 
+                ,HAuxQty,HAuxUnit,HWidth,HWeight,HColorRemark,HCusMaterName,HCusModel) 
                  values({HInterID},{HEntryID},{(oSub.HQty == null ? 0 : oSub.HQty)}
                 ,'{(oSub.HPlanBeginDate == null ? DateTime.Now.ToString("yyyy-MM-dd") : oSub.HPlanBeginDate.ToString())}','{(oSub.HPlanEndDate == null ? DateTime.Now.AddDays(1).ToString("yyyy-MM-dd") : oSub.HPlanEndDate.ToString())}'
                 ,'{(oSub.HBeginDate == null ? DateTime.Now.ToString("yyyy-MM-dd") : oSub.HBeginDate.ToString())}','{(oSub.HEndDate == null ? DateTime.Now.AddDays(1).ToString("yyyy-MM-dd") : oSub.HEndDate.ToString())}'
                 ,{oSub.HMaterID},{oSub.HUnitID},'{oSub.HRemark}',{oSub.HSourceID},{oSub.HDeptID},{oSub.HSTATUS}
                  ,{oSub.HBomID}  ,{oSub.HCusID} ,{oSub.HSTOCKINORGID}
 	                    ,0,0,'','',0,0
-                ,{oSub.HAuxQty},{oSub.HAuxUnit},{oSub.HWidth},{oSub.HWeight},'{oSub.HColorRemark}')");
-
+                ,{oSub.HAuxQty},{oSub.HAuxUnit},{oSub.HWidth},{oSub.HWeight},'{oSub.HColorRemark}','{oSub.HCusMaterName}','{oSub.HCusModel}')");
 
             objJsonResult.code = "1";
             objJsonResult.count = 1;

--
Gitblit v1.9.1