From d19fcd70a3b11339eb0c50b5c734eeca855a9a95 Mon Sep 17 00:00:00 2001 From: yusijie <ysj@hz-kingdee.com> Date: 星期三, 12 二月 2025 14:05:50 +0800 Subject: [PATCH] Merge branch 'master' of http://101.37.171.70:10101/r/MES-WEB-API --- WebAPI/Controllers/SCGL/日计划管理/JIT_DayPlanPlatFormBillController.cs | 24 +++++++++++++++++++++--- 1 files changed, 21 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 d24395d..d88b974 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" @@ -9,7 +9,7 @@ using Newtonsoft.Json.Linq; using System.Diagnostics; using System.Threading; - +using System.Globalization; namespace WebAPI.Controllers.SCGL.鏃ヨ鍒掔鐞� { public class JIT_DayPlanPlatFormBillController : ApiController @@ -357,7 +357,20 @@ 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)}'"); - int SumDay = 31; //鍔ㄦ�佷袱鏈堜箣宸� DateTime.Now.AddMonths(1).AddDays(-1).Subtract(DateTime.Now).Days; + int SumDay = 0; //鍔ㄦ�佷袱鏈堜箣宸� DateTime.Now.AddMonths(1).AddDays(-1).Subtract(DateTime.Now).Days; + + // 缁熻鎬诲ぉ鏁� + HashSet<DateTime> uniqueDates = new HashSet<DateTime>(); + + foreach (var key in list[i].Keys) + { + if (DateTime.TryParseExact(key, "yyyy-M-d", CultureInfo.InvariantCulture, DateTimeStyles.None, out DateTime date)) + { + uniqueDates.Add(date); + } + } + + SumDay = uniqueDates.Count; if (oSystemParameter.omodel.WMS_CampanyName == "娣诲悍绉戞妧") //绯荤粺鍙傛暟 瀹㈡埛瀹氬埗鍖栧悕绉� 绌虹櫧涓洪�氱敤 { @@ -383,7 +396,7 @@ } } //涓昏〃鏈夋暟鎹� 瀛愯〃鏃犳暟鎹� - if (j == 30 && SumCount == 0 && HInterID != 0 && HBillNo != "") + if (j == SumDay-1 && SumCount == 0 && HInterID != 0 && HBillNo != "") { //LogService.CustomWriteLog("3:"+ HInterID+","+ HBillNo, DateTime.Now.ToString("yyyy-MM-dd")); objJsonResult = AddBillSub(HInterID.ToString(), HBillNo, DateTime.Parse(DateTime.Now.ToString("yyyy-MM-dd").ToString()), 0, list[i]); @@ -1641,12 +1654,17 @@ { sqlName = "AIS20240809105013"; } + else if (oSystemParameter.omodel.WMS_CampanyName == "瀹濆伐") + { + sqlName = "AIS20250102123554"; + } else { sqlName = "AIS20210811135644"; } } + if (HTLType == "缂烘枡") { objJsonResult = (json)JIT_QL(fProWorkShopId, fPrdOrgId, user, sqlName); -- Gitblit v1.9.1