From 511d159574c3de94d8d3e43da9f5485f764fa7c8 Mon Sep 17 00:00:00 2001 From: hudong <Administrator@PC-20250329JZUF> Date: 星期四, 19 六月 2025 17:22:35 +0800 Subject: [PATCH] 平高项目 生成出库单逻辑修改 --- process/TaskProcess.cs | 90 ++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 89 insertions(+), 1 deletions(-) diff --git a/process/TaskProcess.cs b/process/TaskProcess.cs index 6307977..bf342fc 100644 --- a/process/TaskProcess.cs +++ b/process/TaskProcess.cs @@ -15,6 +15,7 @@ using static HH.WCS.Mobox3.pinggao.models.SapRoot.WcReturnRoot; using static HH.WCS.Mobox3.pinggao.api.OtherModel; using NLog.Fluent; +using System.Xml.Linq; namespace HH.WCS.Mobox3.pinggao.process { @@ -165,7 +166,7 @@ .ToList(); if (TN_Task.N_ERR == 2)//鍓嶇Щ杞� { - + endlist = endlist.Where(s => s.N_LAYER < 7).ToList(); } foreach (var item in endlist) @@ -567,6 +568,93 @@ } + public static DateTime? ParseCustomFormatDate(string dateStr) + { + // 鍋囪鏃ユ湡鏍煎紡鏄�yy:mm + if (DateTime.TryParseExact(dateStr, "HH:mm", null, System.Globalization.DateTimeStyles.None, out DateTime result)) + { + return result; + } + return null; + } + public static bool SendCd() + { + var db = new SqlHelper<object>().GetInstance(); + var dstart = db.Queryable<TN_CD>().Where(s => s.N_STATE == 0).First(); + + var result = false; + if (dstart != null) + { + DateTime currentDate = DateTime.Now; + // 鏍煎紡鍖栬緭鍑烘椂鍒嗛儴鍒�+ string currentHourMinute = currentDate.ToString("HH:mm"); + + if (dstart.S_TIME == currentHourMinute) + { + var dic = new Dictionary<string, string>(); + var dic1 = new Dictionary<string, string>(); + var no = WMSHelper.GenerateTaskNo(); + dic.Add("No", no); + dic.Add("Pri", "0"); + dic1.Add("ExtDeviceNo", "1"); + + //鍒ゆ柇 + var res = NDC.OrderAdd(99, dic, dic1); + if (res != null && (res.Res.ErrCode == 0 || res.Res.ErrCode == 50009)) + { + // dstart.N_STATE = 1; + // db.Updateable<TN_CD>(dstart).UpdateColumns(a => new { a.N_STATE }).ExecuteCommand(); + + // result = true; + } + + + var dic12 = new Dictionary<string, string>(); + var dic11 = new Dictionary<string, string>(); + var no1 = WMSHelper.GenerateTaskNo(); + dic12.Add("No", no1); + dic12.Add("Pri", "0"); + dic11.Add("ExtDeviceNo", "2"); + + //鍒ゆ柇 + var res1 = NDC.OrderAdd(99, dic12, dic11); + if (res1 != null && (res1.Res.ErrCode == 0 || res1.Res.ErrCode == 50009)) + { + dstart.N_STATE = 1; + db.Updateable<TN_CD>(dstart).UpdateColumns(a => new { a.N_STATE }).ExecuteCommand(); + + result = true; + } + } + + } + + return result; + } + + public static bool SendCZ() + { + var db = new SqlHelper<object>().GetInstance(); + var dstart = db.Queryable<TN_CD>().Where(s => s.N_STATE == 1).First(); + + var result = false; + if (dstart != null) + { + DateTime currentDate = DateTime.Now; + // 鏍煎紡鍖栬緭鍑烘椂鍒嗛儴鍒�+ string currentHourMinute = currentDate.ToString("HH:mm"); + if (currentHourMinute == "00:00") + { + + dstart.N_STATE = 0; + db.Updateable<TN_CD>(dstart).UpdateColumns(a => new { a.N_STATE }).ExecuteCommand(); + } + result = true; + + } + + return result; + } /// <summary> /// 鎺ㄩ�浠诲姟 /// </summary> -- Gitblit v1.9.1