From 58b8a83a4f30d44d1c17ef9b67b594b90f90281f Mon Sep 17 00:00:00 2001 From: zrg <z18737863051@163.com> Date: 星期五, 19 一月 2024 17:27:58 +0800 Subject: [PATCH] 获取收料通知单,采购入库单的源单类型 --- WebAPI/Controllers/SCGL/日计划管理/JIT_DayPlanPlatFormBillController.cs | 31 ++++++++++++++++++++++++------- 1 files changed, 24 insertions(+), 7 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 325f71c..b25d7cd 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" @@ -160,7 +160,7 @@ LogService.CustomWriteLog("2:", DateTime.Now.ToString("yyyy-MM-dd")); int TrueCount = 0, SumCount = 0; - + LogService.CustomWriteLog("list.Count:"+ list.Count, DateTime.Now.ToString("yyyy-MM-dd")); for (int i = 0; i < list.Count; i++) { TrueCount = 0; @@ -169,6 +169,7 @@ var HBillNo = ""; if (list[i]["鍗曟嵁鍙�"].ToString() == "" && list[i]["hmainid"].ToString() == "") { + LogService.CustomWriteLog("2.01:" + i, DateTime.Now.ToString("yyyy-MM-dd")); var HICMOBillNo = list[i]["鐢熶骇璁㈠崟鍙�"].ToString(); var HOrderType = list[i]["璁㈠崟绫诲瀷"].ToString(); var HICMOEntrySEQ = list[i]["鐢熶骇璁㈠崟鏄庣粏琛屽彿"].ToString(); @@ -178,7 +179,7 @@ var HProdORGID = list[i]["HProdORGID"].ToString(); var HMaterID = list[i]["HMaterID"].ToString(); var HMaterName = list[i]["鐗╂枡鍚嶇О"].ToString(); - var HMaterModel = list[i]["瑙勬牸鍨嬪彿"].ToString(); + var HMaterModel = list[i]["瑙勬牸鍨嬪彿"].ToString().Replace("'", "''"); var HUnitID = list[i]["HUnitID"].ToString(); var HSeOrderBillQty = list[i]["閿�鍞鍗曟暟閲�"].ToString(); //var HOrderNeedQty = list[i]["璁㈠崟闇�姹傛暟閲�"].ToString(); @@ -195,6 +196,8 @@ var HMainSourceEntryID = list[i]["婧愬崟瀛愬唴鐮�"].ToString(); var HPlanQty = list[i]["璁″垝鏁伴噺"].ToString(); + LogService.CustomWriteLog("2.05:" + i, DateTime.Now.ToString("yyyy-MM-dd")); + if (HSourceID == ""|| HSourceID == "0") { objJsonResult.code = "0"; @@ -204,7 +207,7 @@ return objJsonResult; } - ds = oCN.RunProcReturn($"select * from Sc_WorkBillSortBillMain a inner join Sc_WorkBillSortBillSub b on a.HInterID = b.HInterID where HMainSourceInterID={HMainSourceInterID}" + + ds = oCN.RunProcReturn($"select * from Sc_WorkBillSortBillMain where HMainSourceInterID={HMainSourceInterID}" + $" and HMainSourceEntryID={HMainSourceEntryID} and HICMOBillNo='{HICMOBillNo}' and HICMOEntrySEQ={HICMOEntrySEQ} and HSourceID={HSourceID}", "Sc_WorkBillSortBillMain"); if (ds.Tables[0].Rows.Count > 0) { @@ -242,6 +245,7 @@ } else { + LogService.CustomWriteLog("2.0:" + i, DateTime.Now.ToString("yyyy-MM-dd")); HBillNo = list[i]["鍗曟嵁鍙�"].ToString(); HInterID = int.Parse(list[i]["hmainid"].ToString()); var HMainSourceInterID = list[i]["婧愬崟涓诲唴鐮�"].ToString(); @@ -259,6 +263,8 @@ var HOrderCommitDate = list[i]["璁㈠崟浜よ揣鏈�"].ToString(); var HPlanEndDate = list[i]["璁″垝缁撴潫鏃ユ湡"].ToString(); var HSplitQty = list[i]["鎷嗗崟鏁伴噺"].ToString(); + + LogService.CustomWriteLog("2.1:"+i, DateTime.Now.ToString("yyyy-MM-dd")); if (HSourceID == "" || HSourceID == "0") { @@ -283,12 +289,16 @@ if (ds.Tables[0].Rows.Count > 1) { + LogService.CustomWriteLog("绗�" + i + 1 + "琛岀敓浜ц祫婧愭湁閲嶅,璇蜂慨鏀�", DateTime.Now.ToString("yyyy-MM-dd")); + LogService.CustomWriteLog($"select * from Sc_WorkBillSortBillMain where HMainSourceInterID={HMainSourceInterID}" + + $" and HMainSourceEntryID={HMainSourceEntryID} and HICMOBillNo='{HICMOBillNo}' and HICMOEntrySEQ={HICMOEntrySEQ} and HSourceID={HSourceID}", DateTime.Now.ToString("yyyy-MM-dd")); objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = $"绗瑊i + 1}琛岀敓浜ц祫婧愭湁閲嶅,璇蜂慨鏀�!"; objJsonResult.data = null; return objJsonResult; } + LogService.CustomWriteLog("2.2:" + i, DateTime.Now.ToString("yyyy-MM-dd")); oCN.RunProc($"update Sc_WorkBillSortBillMain set HSourceID={(HSourceID == "" ? 0.ToString() : HSourceID)},HYX={HYX}" + $",HWorkQty={HWorkQty},HProdTimes={HProdTimes},HReadyTimes={HReadyTimes},HLastBeginDate='{HLastBeginDate}'" + @@ -300,6 +310,7 @@ int SumDay = 31; //鍔ㄦ�佷袱鏈堜箣宸� DateTime.Now.AddMonths(1).AddDays(-1).Subtract(DateTime.Now).Days; + LogService.CustomWriteLog("2.3:" + i, DateTime.Now.ToString("yyyy-MM-dd")); for (int j = 0; j < SumDay; j++) { //涓昏〃瀛愯〃閮芥湁鏁版嵁 @@ -325,6 +336,8 @@ } } + LogService.CustomWriteLog("2.4:" + i, DateTime.Now.ToString("yyyy-MM-dd")); + if (TrueCount != SumCount) { objJsonResult.code = "0"; @@ -334,9 +347,13 @@ return objJsonResult; } } - + + LogService.CustomWriteLog("2.5:", DateTime.Now.ToString("yyyy-MM-dd")); + //鍚屾鏃ヨ鍒掑伐鍗� oCN.RunProc("exec REALESE_SC_ICMOBILLSTATUS_TMP"); + + LogService.CustomWriteLog("2.6:", DateTime.Now.ToString("yyyy-MM-dd")); objJsonResult.code = "1"; objJsonResult.count = 1; @@ -355,7 +372,7 @@ } public json AddBillSub(string HInterID, string HBillNo, DateTime date, double HQTY, Dictionary<string, string> dic) - { + { //鑾峰彇琛ㄦ牸鏁版嵁 ds = oCN.RunProcReturn($"select * from h_v_JIT_Sc_WorkBillSortBillList where 鍗曟嵁鍙�='{HBillNo}'", "h_v_JIT_Sc_WorkBillSortBillList"); int count = 0; @@ -372,14 +389,14 @@ } } } - + if (count != 1) { //鎻掑叆瀛愯〃 oCN.RunProc("insert into Sc_WorkBillSortBillSub(HInterID,HSEQ," + "HMasterDate,HQty,HUseTimes)" + $"values({HInterID}, {(ds.Tables[0].Rows.Count + 1)}," + - $" '{date}', {HQTY},{(dic["灏忔椂浜ц兘"] == "0" ? 0 : HQTY / float.Parse(dic["灏忔椂浜ц兘"].ToString()))})"); + $" '{date}', {HQTY},{(dic["灏忔椂浜ц兘"] == "0" ? 0 : HQTY / float.Parse(dic["灏忔椂浜ц兘"].ToString()))})"); } objJsonResult.code = "1"; -- Gitblit v1.9.1