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 +++++++++++++++++++++++++++++++++++++++- 1 files changed, 79 insertions(+), 3 deletions(-) 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 -- Gitblit v1.9.1