From 17bca2d690f283ec110c0c327a8508ed8fba9d21 Mon Sep 17 00:00:00 2001 From: wangxinhui <wangxinhui@hnkhzn.com> Date: 星期四, 05 六月 2025 09:21:19 +0800 Subject: [PATCH] 最新代码提交 --- 代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Controllers/AGV/CTU_AGVController .cs | 6 代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Model/Models/TaskInfo/Dt_Task.cs | 8 代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_ITaskInfoService/ITaskService.cs | 4 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_DTO/Task/WMSTaskDTO.cs | 5 代码管理/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/1c314e67-7b22-4b95-82d8-39953c4ffcb1.vsidx | 0 代码管理/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/9c8323bc-3d97-4f52-8315-faf14a56756c.vsidx | 0 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService_Inbound.cs | 67 ++++++ 代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/PP仓/ConveyorLineJob_PP.cs | 31 ++ 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService_Outbound.cs | 4 代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/辅料仓/ConveyorLineJob_FL.cs | 39 ++- 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Stock/Dt_StockInfo.cs | 5 代码管理/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/bfe4e4fb-c551-4c7f-94ec-d7011d126854.vsidx | 0 代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_DTO/TaskInfo/WMSTaskDTO.cs | 5 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/TaskInfo/Dt_Task.cs | 7 代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob/ConveyorLineTaskCommand.cs | 9 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_ITaskInfoService/ITaskService.cs | 2 代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs | 66 +++-- 代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerCraneJob/StackerCraneTaskCommandGMPP.cs | 87 +++++++ 项目资料/24KH244 深圳美瑞安 淮安特创立体库项目电控软件开发、测试及维护服务-技术协议-2024.11.21.pdf | 0 代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob/R_ConveyorLineDBName.cs | 6 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_InboundService/InboundOrderService.cs | 215 +++++++++++++++++++ 代码管理/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/05de9a72-8eef-42af-bb91-2884b11682fc.vsidx | 0 代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/干膜仓/ConveyorLineJob_GM.cs | 28 ++ 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_IInboundService/IInboundOrderService.cs | 2 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService.cs | 4 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/TaskInfo/TaskController.cs | 4 /dev/null | 0 代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/干膜仓/StackerCraneJob_GM.cs | 8 代码管理/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/fc24c9bc-a681-4021-afee-e9730bbda510.vsidx | 0 29 files changed, 549 insertions(+), 63 deletions(-) diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/009c71ac-3f6b-4e87-8d77-9e67b15f196a.vsidx" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/009c71ac-3f6b-4e87-8d77-9e67b15f196a.vsidx" deleted file mode 100644 index 9464ede..0000000 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/009c71ac-3f6b-4e87-8d77-9e67b15f196a.vsidx" +++ /dev/null Binary files differ diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/05de9a72-8eef-42af-bb91-2884b11682fc.vsidx" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/05de9a72-8eef-42af-bb91-2884b11682fc.vsidx" new file mode 100644 index 0000000..d4a315e --- /dev/null +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/05de9a72-8eef-42af-bb91-2884b11682fc.vsidx" Binary files differ diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/1c314e67-7b22-4b95-82d8-39953c4ffcb1.vsidx" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/1c314e67-7b22-4b95-82d8-39953c4ffcb1.vsidx" new file mode 100644 index 0000000..6e5b28d --- /dev/null +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/1c314e67-7b22-4b95-82d8-39953c4ffcb1.vsidx" Binary files differ diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/30faed0f-10c1-4ef3-8430-efc0de767fc3.vsidx" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/30faed0f-10c1-4ef3-8430-efc0de767fc3.vsidx" deleted file mode 100644 index 79ae590..0000000 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/30faed0f-10c1-4ef3-8430-efc0de767fc3.vsidx" +++ /dev/null Binary files differ diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/9c8323bc-3d97-4f52-8315-faf14a56756c.vsidx" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/9c8323bc-3d97-4f52-8315-faf14a56756c.vsidx" new file mode 100644 index 0000000..f8ffb07 --- /dev/null +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/9c8323bc-3d97-4f52-8315-faf14a56756c.vsidx" Binary files differ diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/be38a26a-2b17-43c8-b4f8-d9fd5f3264c6.vsidx" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/be38a26a-2b17-43c8-b4f8-d9fd5f3264c6.vsidx" deleted file mode 100644 index 6271774..0000000 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/be38a26a-2b17-43c8-b4f8-d9fd5f3264c6.vsidx" +++ /dev/null Binary files differ diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/f8161659-1011-4682-a876-a3c22814902c.vsidx" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/fc24c9bc-a681-4021-afee-e9730bbda510.vsidx" similarity index 100% rename from "\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/f8161659-1011-4682-a876-a3c22814902c.vsidx" rename to "\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/fc24c9bc-a681-4021-afee-e9730bbda510.vsidx" Binary files differ diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_DTO/TaskInfo/WMSTaskDTO.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_DTO/TaskInfo/WMSTaskDTO.cs" index a65c3e7..b6cb732 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_DTO/TaskInfo/WMSTaskDTO.cs" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_DTO/TaskInfo/WMSTaskDTO.cs" @@ -60,6 +60,11 @@ /// </summary> public string GroupId { get; set; } + /// <summary> + /// 浠诲姟鐗╂枡闀垮害 + /// </summary> + public int TaskLength { get; set; } + public string AGVArea { get; set; } public int PalletType { get; set; } diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_ITaskInfoService/ITaskService.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_ITaskInfoService/ITaskService.cs" index 99e985b..2921662 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_ITaskInfoService/ITaskService.cs" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_ITaskInfoService/ITaskService.cs" @@ -64,7 +64,7 @@ /// <param name="palletCode">鎵樼洏鍙�</param> /// <param name="sourceAddress">璧峰鍦板潃</param> /// <returns></returns> - WebResponseContent RequestWMSTask(string palletCode, string sourceAddress); + WebResponseContent RequestWMSTask(string palletCode, string sourceAddress, string materielBoxCode = ""); /// <summary> /// 鍚慦MS鐢宠浠诲姟 @@ -81,7 +81,7 @@ /// <param name="sourceAddress">璧峰鍦板潃</param> /// <param name="roadway">宸烽亾鍙�</param> /// <returns></returns> - WebResponseContent RequestWMSTask(string palletCode, string sourceAddress, string roadway); + //WebResponseContent RequestWMSTask(string palletCode, string sourceAddress, string roadway); /// <summary> /// diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Model/Models/TaskInfo/Dt_Task.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Model/Models/TaskInfo/Dt_Task.cs" index 69f9064..8e18944 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Model/Models/TaskInfo/Dt_Task.cs" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Model/Models/TaskInfo/Dt_Task.cs" @@ -183,7 +183,13 @@ [ExporterHeader(DisplayName = "浠诲姟缁�")] [SugarColumn(IsNullable = true, ColumnDescription = "浠诲姟缁�")] public string GroupId { get; set; } - + /// <summary> + /// 浠诲姟鐗╂枡闀垮害 + /// </summary> + [ImporterHeader(Name = "浠诲姟鐗╂枡闀垮害")] + [ExporterHeader(DisplayName = "浠诲姟鐗╂枡闀垮害")] + [SugarColumn(IsNullable = true, ColumnDescription = "浠诲姟鐗╂枡闀垮害")] + public int TaskLength { get; set; } /// <summary> /// 澶囨敞 /// </summary> diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Controllers/AGV/CTU_AGVController .cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Controllers/AGV/CTU_AGVController .cs" index 455052e..f0bb5e2 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Controllers/AGV/CTU_AGVController .cs" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Controllers/AGV/CTU_AGVController .cs" @@ -293,12 +293,12 @@ //璋冪敤AGV棰勮皟搴︽帴鍙� AgvScheduleTaskDTO agvScheduleTask = new AgvScheduleTaskDTO() { - PositionCode = task.CurrentAddress, - NextTask = "60", + PositionCode = "8001", + NextTask = "90", UseableLayers = "1", CacheCount = "1", Update = "0", - AgvTyp = "11", + AgvTyp = "10", PreTaskQty = "1", ReqCode = Guid.NewGuid().ToString().Replace("-", ""), ReqTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs" index d2a4a74..5a885e6 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs" @@ -386,7 +386,7 @@ /// <param name="palletCode">鎵樼洏鍙�</param> /// <param name="sourceAddress">璧峰鍦板潃</param> /// <returns></returns> - public WebResponseContent RequestWMSTask(string palletCode, string sourceAddress) + public WebResponseContent RequestWMSTask(string palletCode, string sourceAddress, string materielBoxCode = "") { WebResponseContent content = new WebResponseContent(); try @@ -401,7 +401,15 @@ { return WebResponseContent.Instance.Error($"鏈壘鍒癢MSApi鍦板潃"); } - string responseStr = HttpHelper.Get($"{address}/api/Task/DeviceRequestInboundTask?stationCode={sourceAddress}&roadwayNo={stationManger.StackerCraneCode}&palletCode={palletCode}"); + string responseStr = ""; + if (!string.IsNullOrEmpty(materielBoxCode)) + { + responseStr = HttpHelper.Get($"{address}/api/Task/DeviceRequestInboundTask?stationCode={sourceAddress}&roadwayNo={stationManger.StackerCraneCode}&palletCode={palletCode}&materielBoxCode={materielBoxCode}"); + } + else + { + responseStr = HttpHelper.Get($"{address}/api/Task/DeviceRequestInboundTask?stationCode={sourceAddress}&roadwayNo={stationManger.StackerCraneCode}&palletCode={palletCode}"); + } WebResponseContent? responseContent = JsonConvert.DeserializeObject<WebResponseContent>(responseStr); if (responseContent != null && responseContent.Status && responseContent.Data != null) { @@ -462,34 +470,34 @@ /// <param name="sourceAddress"></param> /// <param name="roadway"></param> /// <returns></returns> - public WebResponseContent RequestWMSTask(string palletCode, string sourceAddress, string roadway) - { - WebResponseContent content = new WebResponseContent(); - try - { - string address = AppSettings.Get("WMSApiAddress"); - if (string.IsNullOrEmpty(address)) - { - return WebResponseContent.Instance.Error($"鏈壘鍒癢MSApi鍦板潃"); - } - string responseStr = HttpHelper.Get($"{address}/api/Task/DeviceRequestInboundTask?stationCode={sourceAddress}&roadwayNo={roadway}&palletCode={palletCode}"); - WebResponseContent? responseContent = JsonConvert.DeserializeObject<WebResponseContent>(responseStr); - if (responseContent != null && responseContent.Status && responseContent.Data != null) - { - WMSTaskDTO? taskDTO = JsonConvert.DeserializeObject<WMSTaskDTO>(responseContent.Data.ToString()); - if (taskDTO != null) - { - content = ReceiveWMSTask(new List<WMSTaskDTO> { taskDTO }); - } - } + //public WebResponseContent RequestWMSTask(string palletCode, string sourceAddress, string roadway) + //{ + // WebResponseContent content = new WebResponseContent(); + // try + // { + // string address = AppSettings.Get("WMSApiAddress"); + // if (string.IsNullOrEmpty(address)) + // { + // return WebResponseContent.Instance.Error($"鏈壘鍒癢MSApi鍦板潃"); + // } + // string responseStr = HttpHelper.Get($"{address}/api/Task/DeviceRequestInboundTask?stationCode={sourceAddress}&roadwayNo={roadway}&palletCode={palletCode}"); + // WebResponseContent? responseContent = JsonConvert.DeserializeObject<WebResponseContent>(responseStr); + // if (responseContent != null && responseContent.Status && responseContent.Data != null) + // { + // WMSTaskDTO? taskDTO = JsonConvert.DeserializeObject<WMSTaskDTO>(responseContent.Data.ToString()); + // if (taskDTO != null) + // { + // content = ReceiveWMSTask(new List<WMSTaskDTO> { taskDTO }); + // } + // } - } - catch (Exception ex) - { - content = WebResponseContent.Instance.Error(ex.Message); - } - return content; - } + // } + // catch (Exception ex) + // { + // content = WebResponseContent.Instance.Error(ex.Message); + // } + // return content; + //} /// <summary> /// diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob/ConveyorLineTaskCommand.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob/ConveyorLineTaskCommand.cs" index aeab7d8..ac89d7e 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob/ConveyorLineTaskCommand.cs" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob/ConveyorLineTaskCommand.cs" @@ -163,6 +163,15 @@ /// </summary> public short CheckPos { get; set; } } + public class R_ConveyorLineGMInfo : DeviceCommand + { + /// <summary> + /// 绠卞彿 + /// </summary> + /// <summary> + [DataLength(120)] + public string Boxcode { get; set; } + } public class R_ConveyorLineFLInfo : DeviceCommand { /// <summary> diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob/R_ConveyorLineDBName.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob/R_ConveyorLineDBName.cs" index b22c8ee..81453e9 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob/R_ConveyorLineDBName.cs" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob/R_ConveyorLineDBName.cs" @@ -118,7 +118,11 @@ /// <summary> /// 鍝嶅簲淇″彿 /// </summary> - ACK + ACK, + /// <summary> + /// 鏉$爜 + /// </summary> + Boxcode } public enum R_ConveyorLineWorkType diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/PP\344\273\223/ConveyorLineJob_PP.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/PP\344\273\223/ConveyorLineJob_PP.cs" index df75641..30cad43 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/PP\344\273\223/ConveyorLineJob_PP.cs" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/PP\344\273\223/ConveyorLineJob_PP.cs" @@ -73,14 +73,41 @@ { if (conveyorLineSignalRead.STB && conveyorLineStatus.Online && conveyorLineStatus.Goods && !conveyorLineStatus.Alarm && !conveyorLineSignalWrite.ACK) { - if (!string.IsNullOrEmpty(conveyorLineInfoRead.Barcode)) + string boxcode = device.GetValue<R_ConveyorLineDB, string>(R_ConveyorLineDB.Boxcode, item.StationCode); + + if (!string.IsNullOrEmpty(boxcode)) { - WebResponseContent content = _taskService.RequestWMSTask(conveyorLineInfoRead.Barcode, item.StationCode); + string sc = device.Communicator.Read<string>("DB900.598.0"); + WriteError(device.DeviceName, $"璇诲彇鍊硷細{boxcode},瀵规瘮{sc}"); + string boxEndCode = ""; + if (boxcode.LastIndexOf(",SC:") >= 0) + { + boxEndCode = "M" + boxcode.Substring(0, boxcode.LastIndexOf(",SC:")) + sc.Substring(sc.IndexOf(",SC:")).Replace("\0", ""); + } + else if (boxcode.LastIndexOf(",SC") > 0) + { + boxEndCode = "M" + boxcode.Substring(0, boxcode.LastIndexOf(",SC")) + sc.Substring(sc.IndexOf("SC:")).Replace("\0", ""); + } + else if (boxcode.LastIndexOf(",S") > 0) + { + boxEndCode = "M" + boxcode.Substring(0, boxcode.LastIndexOf(",S")) + sc.Substring(sc.IndexOf("SC:")).Replace("\0", ""); + } + + //鍏ュ簱鐢宠浠诲姟 + WebResponseContent content = _taskService.RequestWMSTask(conveyorLineInfoRead.Barcode, item.StationCode, boxEndCode); if (content.Status) { device.SetValue(W_ConveyorLineDB.ACK, true, item.StationCode); } } + //if (!string.IsNullOrEmpty(conveyorLineInfoRead.Barcode)) + //{ + // WebResponseContent content = _taskService.RequestWMSTask(conveyorLineInfoRead.Barcode, item.StationCode); + // if (content.Status) + // { + // device.SetValue(W_ConveyorLineDB.ACK, true, item.StationCode); + // } + //} } else if (!conveyorLineSignalRead.STB && conveyorLineStatus.Online && conveyorLineStatus.Goods && !conveyorLineStatus.Alarm && conveyorLineSignalWrite.ACK) { diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerCraneJob/StackerCraneTaskCommandGMPP.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerCraneJob/StackerCraneTaskCommandGMPP.cs" new file mode 100644 index 0000000..1e1c346 --- /dev/null +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerCraneJob/StackerCraneTaskCommandGMPP.cs" @@ -0,0 +1,87 @@ +锘�#region << 鐗� 鏈� 娉� 閲� >> +/*---------------------------------------------------------------- + * 鍛藉悕绌洪棿锛歐IDESEAWCS_Tasks.StackerCraneJob + * 鍒涘缓鑰咃細鑳$搴� + * 鍒涘缓鏃堕棿锛�2024/8/2 16:13:36 + * 鐗堟湰锛歏1.0.0 + * 鎻忚堪锛� + * + * ---------------------------------------------------------------- + * 淇敼浜猴細 + * 淇敼鏃堕棿锛� + * 鐗堟湰锛歏1.0.1 + * 淇敼璇存槑锛� + * + *----------------------------------------------------------------*/ +#endregion << 鐗� 鏈� 娉� 閲� >> + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using WIDESEAWCS_Model.Models; +using WIDESEAWCS_QuartzJob.DeviceBase; + +namespace WIDESEAWCS_Tasks.StackerCraneJob +{ + public class StackerCraneTaskCommandGMPP : DeviceCommand + { + #region <Public Menber> + /// <summary> + /// 浠诲姟鍙� + /// </summary> + public int TaskNum { get; set; } + + /// <summary> + /// 浣滀笟绫诲瀷 + /// </summary> + public short WorkType { get; set; } + + /// <summary> + /// 鎵樼洏绫诲瀷 + /// </summary> + public short TrayType { get; set; } + + /// <summary> + /// 璧峰琛� + /// </summary> + public short StartRow { get; set; } + + /// <summary> + /// 璧峰鍒� + /// </summary> + public short StartColumn { get; set; } + + /// <summary> + /// 璧峰灞� + /// </summary> + public short StartLayer { get; set; } + + /// <summary> + /// 鐩爣琛� + /// </summary> + public short EndRow { get; set; } + + /// <summary> + /// 鐩爣鍒� + /// </summary> + public short EndColumn { get; set; } + + /// <summary> + /// 鐩爣灞� + /// </summary> + public short EndLayer { get; set; } + + /// <summary> + /// 鎵樼洏鍙� + /// </summary> + [DataLength(30)] + public string Barcode { get; set; } + /// <summary> + /// 鐗╂枡闀垮害 + /// </summary> + public short TaskLength { get; set; } + #endregion <Public Menber> + } +} diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/\345\271\262\350\206\234\344\273\223/ConveyorLineJob_GM.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/\345\271\262\350\206\234\344\273\223/ConveyorLineJob_GM.cs" index c50fe36..8e3b890 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/\345\271\262\350\206\234\344\273\223/ConveyorLineJob_GM.cs" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/\345\271\262\350\206\234\344\273\223/ConveyorLineJob_GM.cs" @@ -1,4 +1,5 @@ -锘縰sing Newtonsoft.Json; +锘縰sing Microsoft.IdentityModel.Tokens; +using Newtonsoft.Json; using Quartz; using System; using System.Collections.Generic; @@ -94,10 +95,28 @@ { if (conveyorLineSignalRead.STB && conveyorLineStatus.Online && conveyorLineStatus.Goods && !conveyorLineStatus.Alarm && !conveyorLineSignalWrite.ACK) { - if (!string.IsNullOrEmpty(conveyorLineInfoRead.Barcode)) + string boxcode = device.GetValue<R_ConveyorLineDB, string>(R_ConveyorLineDB.Boxcode, item.StationCode); + + if (!string.IsNullOrEmpty(boxcode)) { + string sc = device.Communicator.Read<string>("DB900.508.0"); + WriteError(device.DeviceName, $"璇诲彇鍊硷細{boxcode},瀵规瘮{sc}"); + string boxEndCode = ""; + if (boxcode.LastIndexOf(",SC:") >=0) + { + boxEndCode = "M"+ boxcode.Substring(0,boxcode.LastIndexOf(",SC:")) + sc.Substring(sc.IndexOf(",SC:")).Replace("\0", ""); + } + else if (boxcode.LastIndexOf(",SC") > 0) + { + boxEndCode = "M" + boxcode.Substring(0, boxcode.LastIndexOf(",SC")) + sc.Substring(sc.IndexOf("SC:")).Replace("\0", ""); + } + else if (boxcode.LastIndexOf(",S") > 0) + { + boxEndCode = "M" + boxcode.Substring(0, boxcode.LastIndexOf(",S")) + sc.Substring(sc.IndexOf("SC:")).Replace("\0", ""); + } + //鍏ュ簱鐢宠浠诲姟 - WebResponseContent content = _taskService.RequestWMSTask(conveyorLineInfoRead.Barcode, item.StationCode); + WebResponseContent content = _taskService.RequestWMSTask(conveyorLineInfoRead.Barcode, item.StationCode, boxEndCode); if (content.Status) { device.SetValue(W_ConveyorLineDB.ACK, true, item.StationCode); @@ -106,7 +125,8 @@ } else if (!conveyorLineSignalRead.STB && conveyorLineStatus.Online && conveyorLineStatus.Goods && !conveyorLineStatus.Alarm && conveyorLineSignalWrite.ACK) { - Dt_Task task = _taskRepository.QueryFirst(x => x.CurrentAddress == item.StationCode && x.PalletCode == conveyorLineInfoRead.Barcode && x.DeviceCode == item.StationDeviceCode && x.TaskState == TaskStatusEnum.New.ObjToInt()); + string boxcode = device.GetValue<R_ConveyorLineDB, string>(R_ConveyorLineDB.Boxcode, item.StationCode); + Dt_Task task = _taskRepository.QueryFirst(x => x.CurrentAddress == item.StationCode && boxcode.Contains(x.PalletCode) && x.TaskState == TaskStatusEnum.New.ObjToInt()); if (task != null) { _taskService.UpdateTask(task, TaskStatusEnum.SC_Execute, currentAddress: item.StackerCraneStationCode, deviceCode: task.Roadway, nextAddress: task.TargetAddress); diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/\345\271\262\350\206\234\344\273\223/StackerCraneJob_GM.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/\345\271\262\350\206\234\344\273\223/StackerCraneJob_GM.cs" index 4a42c24..eb35201 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/\345\271\262\350\206\234\344\273\223/StackerCraneJob_GM.cs" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/\345\271\262\350\206\234\344\273\223/StackerCraneJob_GM.cs" @@ -92,6 +92,12 @@ commonStackerCrane.LastTaskType = task.TaskType; task.Dispatchertime = DateTime.Now; task.ExceptionMessage = ""; + if (task.TaskLength<=0) + { + WriteInfo(commonStackerCrane.DeviceCode, $"鐗╂枡闀垮害閿欒{task.TaskLength}"); + return Task.CompletedTask; + } + commonStackerCrane.Communicator.Write("DB105.58", (short)task.TaskLength); _taskService.UpdateTask(task, TaskStatusEnum.SC_Executing); commonStackerCrane.Communicator.Write("DB105.54", (short)1); //寤舵椂1s @@ -297,7 +303,7 @@ stackerCraneTaskCommand.Barcode = task.PalletCode; stackerCraneTaskCommand.TaskNum = task.TaskNum; stackerCraneTaskCommand.WorkType = 1; - stackerCraneTaskCommand.TrayType = (Int16)task.PalletType; + stackerCraneTaskCommand.TrayType = 0; if (task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.InboundGroup)//鍒ゆ柇鏄惁鏄叆搴撲换鍔� { string[] startCodes = task.CurrentAddress.Split("-"); diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/\350\276\205\346\226\231\344\273\223/ConveyorLineJob_FL.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/\350\276\205\346\226\231\344\273\223/ConveyorLineJob_FL.cs" index d3e2a4a..4e0c629 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/\350\276\205\346\226\231\344\273\223/ConveyorLineJob_FL.cs" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/\350\276\205\346\226\231\344\273\223/ConveyorLineJob_FL.cs" @@ -60,31 +60,38 @@ public Task Execute(IJobExecutionContext context) { - bool flag = context.JobDetail.JobDataMap.TryGetValue("JobParams", out object? value); - if (flag && value != null) + try { - OtherDevice device = (OtherDevice)value; - List<string> deviceStations = device.DeviceProDTOs.Select(x => x.DeviceChildCode).ToList(); - List<Dt_StationManger> stationMangers = _stationMangerRepository.QueryData(x => x.StationDeviceCode == device.DeviceCode); - foreach (var item in stationMangers.Where(x => deviceStations.Contains(x.StationCode))) + bool flag = context.JobDetail.JobDataMap.TryGetValue("JobParams", out object? value); + if (flag && value != null) { - DeviceProDTO? deviceProRead = device.DeviceProDTOs.Where(x => x.DeviceChildCode == item.StationCode && x.DeviceProParamType == nameof(R_ConveyorLineFLDB)).OrderBy(x => x.DeviceProOffset).FirstOrDefault(); - if (item.StationType == StationTypeEnum.StationType_OnlyInbound.ObjToInt() && deviceProRead != null) + OtherDevice device = (OtherDevice)value; + List<string> deviceStations = device.DeviceProDTOs.Select(x => x.DeviceChildCode).ToList(); + List<Dt_StationManger> stationMangers = _stationMangerRepository.QueryData(x => x.StationDeviceCode == device.DeviceCode); + foreach (var item in stationMangers.Where(x => deviceStations.Contains(x.StationCode))) { - R_ConveyorLineFLInfo conveyorLineInfoRead = device.Communicator.ReadCustomer<R_ConveyorLineFLInfo>(deviceProRead.DeviceProAddress); - bool conveyArrivaled = device.GetValue<R_ConveyorLineFLDB, bool>(R_ConveyorLineFLDB.ConveyArrivaled, item.StationCode); - if (conveyArrivaled) + DeviceProDTO? deviceProRead = device.DeviceProDTOs.Where(x => x.DeviceChildCode == item.StationCode && x.DeviceProParamType == nameof(R_ConveyorLineFLDB)).OrderBy(x => x.DeviceProOffset).FirstOrDefault(); + if (item.StationType == StationTypeEnum.StationType_OnlyInbound.ObjToInt() && deviceProRead != null) { - Dt_Task newTask = _taskRepository.QueryFirst(x => x.TaskNum== conveyorLineInfoRead.TaskNum.ObjToInt() && x.PalletCode == conveyorLineInfoRead.Barcode && x.TaskState == TaskStatusEnum.New.ObjToInt() && x.DeviceCode== item.StackerCraneCode && !string.IsNullOrEmpty(x.DeviceCode)); - if (newTask != null) + R_ConveyorLineFLInfo conveyorLineInfoRead = device.Communicator.ReadCustomer<R_ConveyorLineFLInfo>(deviceProRead.DeviceProAddress); + bool conveyArrivaled = device.GetValue<R_ConveyorLineFLDB, bool>(R_ConveyorLineFLDB.ConveyArrivaled, item.StationCode); + if (conveyArrivaled) { - _taskService.UpdateTask(newTask, TaskStatusEnum.AGV_Execute); + Dt_Task newTask = _taskRepository.QueryFirst(x => x.TaskNum == conveyorLineInfoRead.TaskNum.ObjToInt() && x.PalletCode == conveyorLineInfoRead.Barcode && x.TaskState == TaskStatusEnum.New.ObjToInt() && x.DeviceCode == item.StackerCraneCode && !string.IsNullOrEmpty(x.DeviceCode)); + if (newTask != null) + { + _taskService.UpdateTask(newTask, TaskStatusEnum.AGV_Execute); + } + WriteError(item.StationName, $"鍏ュ簱鍒颁綅淇″彿锛屾墭鐩樺彿{conveyorLineInfoRead.Barcode},浠诲姟鍙�:{conveyorLineInfoRead.TaskNum}"); } - WriteError(item.StationName, $"鍏ュ簱鍒颁綅淇″彿锛屾墭鐩樺彿{conveyorLineInfoRead.Barcode},浠诲姟鍙�:{conveyorLineInfoRead.TaskNum}"); } } - } + } + } + catch (Exception ex) + { + WriteError(nameof(ConveyorLineJob_FL), ex.Message, ex); } return Task.CompletedTask; } diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/b157c59e-a4e0-4f94-a6da-466245995b56.vsidx" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/b157c59e-a4e0-4f94-a6da-466245995b56.vsidx" deleted file mode 100644 index 902edc3..0000000 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/b157c59e-a4e0-4f94-a6da-466245995b56.vsidx" +++ /dev/null Binary files differ diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/bfe4e4fb-c551-4c7f-94ec-d7011d126854.vsidx" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/bfe4e4fb-c551-4c7f-94ec-d7011d126854.vsidx" new file mode 100644 index 0000000..69f5df9 --- /dev/null +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/bfe4e4fb-c551-4c7f-94ec-d7011d126854.vsidx" Binary files differ diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_DTO/Task/WMSTaskDTO.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_DTO/Task/WMSTaskDTO.cs" index 4d92f04..be404a5 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_DTO/Task/WMSTaskDTO.cs" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_DTO/Task/WMSTaskDTO.cs" @@ -67,6 +67,11 @@ public string GroupId { get; set; } /// <summary> + /// 浠诲姟鐗╂枡闀垮害 + /// </summary> + public int TaskLength { get; set; } + + /// <summary> /// /// </summary> public string AGVArea { get; set; } diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_IInboundService/IInboundOrderService.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_IInboundService/IInboundOrderService.cs" index 1e4d934..1dff918 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_IInboundService/IInboundOrderService.cs" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_IInboundService/IInboundOrderService.cs" @@ -28,6 +28,8 @@ //WebResponseContent FeedbackInboundOrder(int id); WebResponseContent MaterielGroup(SaveModel saveModel); + + WebResponseContent MaterielPPorGM(string materielBoxCode=""); /// <summary> /// 鍏ュ簱瀹屾垚涓婃姤 /// </summary> diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_ITaskInfoService/ITaskService.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_ITaskInfoService/ITaskService.cs" index d1eb330..aa30edb 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_ITaskInfoService/ITaskService.cs" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_ITaskInfoService/ITaskService.cs" @@ -87,7 +87,7 @@ /// <param name="roadwayNo"></param> /// <param name="palletCode"></param> /// <returns></returns> - WebResponseContent DeviceRequestInboundTask(string stationCode, string roadwayNo, string palletCode); + WebResponseContent DeviceRequestInboundTask(string stationCode, string roadwayNo, string palletCode,string materielBoxCode = ""); /// <summary> /// 浠呯敵璇蜂换鍔★紝璁¦CS鏍规嵁璺敱纭畾涓嬩竴鍦板潃 diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_InboundService/InboundOrderService.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_InboundService/InboundOrderService.cs" index a608a7f..8eaeef9 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_InboundService/InboundOrderService.cs" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_InboundService/InboundOrderService.cs" @@ -3,6 +3,7 @@ using Microsoft.AspNetCore.Mvc.RazorPages; using Newtonsoft.Json; using OfficeOpenXml.FormulaParsing.Excel.Functions.DateTime; +using OfficeOpenXml.FormulaParsing.Excel.Functions.RefAndLookup; using SqlSugar; using System; using System.Collections; @@ -900,6 +901,220 @@ } return content; } + public WebResponseContent MaterielPPorGM(string materielBoxCode = "") + { + WebResponseContent content = new WebResponseContent(); + try + { + string SerNum = materielBoxCode.Substring(0, materielBoxCode.LastIndexOf("SC:")-1); + MatSerNumAnalysisModel model = CodeAnalysisHelper.CodeAnalysis<MatSerNumAnalysisModel>(AnalysisCodeEnum.MatSerNumAnalysis, SerNum); + //楠岃瘉鍒ゆ柇鏃堕棿鏍煎紡 + WebResponseContent IsValidContent = IsValidMCDates(new List<MatSerNumAnalysisModel>() { model }); + if (!IsValidContent.Status) + { + return content.Error(IsValidContent.Message); + } + string result = materielBoxCode.Substring(materielBoxCode.LastIndexOf("SC:") + 3); + //鑾峰彇鍏ュ簱鍗曟槑缁� + Dt_InboundOrderDetail inboundOrderDetail = _inboundRepository.InboundOrderDetailRepository.QueryFirst(x=>x.BatchNo== model.LotNo && x.MaterielCode== model.MaterielCode); + if (inboundOrderDetail == null) + { + return InOtherGMOrPP(model, result); + } + Dt_InboundOrder inboundOrder = BaseDal.Db.Queryable<Dt_InboundOrder>().First(x => x.Id == inboundOrderDetail.OrderId); + + if (inboundOrder == null) + { + return WebResponseContent.Instance.Error($"鏈壘鍒板叆搴撳崟淇℃伅"); + } + Dt_Warehouse warehouse = _basicRepository.WarehouseRepository.QueryFirst(x => x.WarehouseId == inboundOrder.WarehouseId); + //闄ら噰璐叆搴撳崟浠ュ鍏朵粬鍏ュ簱鍗曠粍鐩樻暟鎹鐞� + if (inboundOrder.OrderType != InOrderTypeEnum.Purchase.ObjToInt()) + { + return OtherInGroup(inboundOrder, model.LotNo, 0, warehouse, new List<MatSerNumAnalysisModel>() { model }); + } + Dt_ReceiveOrder receiveOrder = _inboundRepository.ReceiveOrderRepository.Db.Queryable<Dt_ReceiveOrder>().Where(x => x.ReceiveOrderNo == inboundOrder.UpperOrderNo).Includes(x => x.Details).First(); + if (receiveOrder == null) + { + return WebResponseContent.Instance.Error($"鏈壘鍒板搴旂殑鏀惰揣鍗�"); + } + if (receiveOrder.Details == null || receiveOrder.Details.Count <= 0) + { + return WebResponseContent.Instance.Error($"鏈壘鍒板搴旂殑鏀惰揣鍗曟槑缁�"); + } + + List<string> purchaseOrderNos = receiveOrder.Details.Select(x => x.PurchaseOrderNo).ToList(); + + string materielCode = model?.MaterielCode ?? ""; + Dt_MaterielInfo materielInfo = _basicRepository.MaterielInfoRepository.QueryFirst(x => x.MaterielCode == materielCode); + if (materielInfo == null) + { + return WebResponseContent.Instance.Error($"鏈壘鍒拌鐗╂枡鐨勪俊鎭�"); + } + + float beforeQuantity = 0; + + Dt_StockInfo stockInfo = _stockRepository.StockInfoRepository.Db.Queryable<Dt_StockInfo>().Where(x => x.PalletCode == model.LotNo).Includes(x => x.Details).First(); + if (stockInfo == null) + { + stockInfo = new Dt_StockInfo() + { + PalletCode = model.LotNo, + StockStatus = StockStatusEmun.缁勭洏鏆傚瓨.ObjToInt(), + WarehouseId = inboundOrder.WarehouseId, + PalletType = GetPalletTypeGMOrPP(warehouse, result.Split("*")[0]), + StockLength = result.Split("*")[0].ObjToInt(), + Details = new List<Dt_StockInfoDetail>() + }; + } + else + { + if (stockInfo.StockStatus != StockStatusEmun.缁勭洏鏆傚瓨.ObjToInt()) + { + return WebResponseContent.Instance.Error($"鎵樼洏鍙烽噸澶�"); + } + } + if (stockInfo.PalletType==-1) + { + return WebResponseContent.Instance.Error($"鎵樼洏绫诲瀷涓嶅瓨鍦�"); + } + List<Dt_StockInfoDetail> stockInfoDetails = new List<Dt_StockInfoDetail>(); + if (purchaseOrderNos.FirstOrDefault(x => x == model.PurchaseOrderNo) == null) + { + return WebResponseContent.Instance.Error($"鏈湪鏀惰揣鏄庣粏涓壘鍒拌閲囪喘鍗�"); + } + + if (inboundOrderDetail.OrderDetailStatus > OrderDetailStatusEnum.Inbounding.ObjToInt() || inboundOrderDetail.OrderQuantity == inboundOrderDetail.ReceiptQuantity) + { + return WebResponseContent.Instance.Error($"璇ョ墿鏂欏湪璇ュ叆搴撳崟涓凡鍏ㄩ儴缁勭洏瀹屾垚"); + } + Dt_StockInfoDetail stockInfoDetail = new Dt_StockInfoDetail() + { + BatchNo = model.LotNo, + MaterielCode = materielInfo.MaterielCode, + MaterielName = materielInfo.MaterielName, + MaterielSpec = materielInfo.MaterielSpec, + OrderNo = inboundOrder.InboundOrderNo, + SerialNumber = model.SerialNumber, + StockQuantity = model.Quantity, + OutboundQuantity = 0, + Unit = materielInfo.MaterielUnit, + Status = StockStatusEmun.缁勭洏鏆傚瓨.ObjToInt(), + ProductionDate = model.ProductionDate, + EffectiveDate = model.EffectiveDate, + InboundOrderRowNo = inboundOrderDetail.RowNo, + }; + + stockInfo.Details.Add(stockInfoDetail); + + stockInfoDetails.Add(stockInfoDetail); + + inboundOrderDetail.ReceiptQuantity += model.Quantity; + if (inboundOrderDetail.ReceiptQuantity > inboundOrderDetail.OrderQuantity) + { + return WebResponseContent.Instance.Error($"缁勭洏鏁伴噺婧㈠嚭{inboundOrderDetail.ReceiptQuantity - inboundOrderDetail.OrderQuantity}"); + } + if (inboundOrderDetail.OrderDetailStatus == OrderDetailStatusEnum.New.ObjToInt()) + { + inboundOrderDetail.OrderDetailStatus = OrderDetailStatusEnum.GroupAndInbound.ObjToInt(); + } + float totalQuantity = stockInfo.Details.Sum(x => x.StockQuantity); + if (inboundOrder.OrderStatus == InOrderStatusEnum.鏈紑濮�.ObjToInt()) + { + inboundOrder.OrderStatus = InOrderStatusEnum.鍏ュ簱涓�.ObjToInt(); + } + _inboundRepository.InboundOrderDetailRepository.UpdateData(inboundOrderDetail); + _inboundRepository.InboundOrderRepository.UpdateData(inboundOrder); + _recordService.StockQuantityChangeRecordService.AddStockChangeRecord(stockInfo, stockInfoDetails, beforeQuantity, totalQuantity, StockChangeTypeEnum.MaterielGroup); + content.OK(data: stockInfo); + } + catch (Exception ex) + { + content.Error(ex.Message); + } + return content; + } + public WebResponseContent InOtherGMOrPP(MatSerNumAnalysisModel model,string request = "") + { + string materielCode = model?.MaterielCode ?? ""; + Dt_MaterielInfo materielInfo = _basicRepository.MaterielInfoRepository.QueryFirst(x => x.MaterielCode == materielCode); + if (materielInfo == null) + { + return WebResponseContent.Instance.Error($"鏈壘鍒拌鐗╂枡鐨勪俊鎭�"); + } + float beforeQuantity = 0; + Dt_Warehouse warehouse = _basicRepository.WarehouseRepository.QueryFirst(x => x.WarehouseId == materielInfo.WarehouseId); + Dt_StockInfo stockInfo = _stockRepository.StockInfoRepository.Db.Queryable<Dt_StockInfo>().Where(x => x.PalletCode == model.LotNo).Includes(x => x.Details).First(); + if (stockInfo == null) + { + stockInfo = new Dt_StockInfo() + { + PalletCode = model.LotNo, + StockStatus = StockStatusEmun.缁勭洏鏆傚瓨.ObjToInt(), + WarehouseId = warehouse.WarehouseId, + PalletType = GetPalletTypeGMOrPP(warehouse, request.Split("*")[0]), + StockLength = request.Split("*")[0].ObjToInt(), + Details = new List<Dt_StockInfoDetail>() + }; + } + else + { + if (stockInfo.StockStatus != StockStatusEmun.缁勭洏鏆傚瓨.ObjToInt()) + { + return WebResponseContent.Instance.Error($"鎵樼洏鍙烽噸澶�"); + } + } + if (stockInfo.PalletType == -1) + { + return WebResponseContent.Instance.Error($"鎵樼洏绫诲瀷涓嶅瓨鍦�"); + } + List<Dt_StockInfoDetail> stockInfoDetails = new List<Dt_StockInfoDetail>(); + Dt_StockInfoDetail stockInfoDetail = new Dt_StockInfoDetail() + { + BatchNo = model.LotNo, + MaterielCode = materielInfo.MaterielCode, + MaterielName = materielInfo.MaterielName, + MaterielSpec = materielInfo.MaterielSpec, + OrderNo = "", + SerialNumber = model.SerialNumber, + StockQuantity = model.Quantity, + OutboundQuantity = 0, + Unit = materielInfo.MaterielUnit, + Status = StockStatusEmun.缁勭洏鏆傚瓨.ObjToInt(), + ProductionDate = model.ProductionDate, + EffectiveDate = model.EffectiveDate, + InboundOrderRowNo = 0, + }; + + stockInfo.Details.Add(stockInfoDetail); + + stockInfoDetails.Add(stockInfoDetail); + float totalQuantity = stockInfo.Details.Sum(x => x.StockQuantity); + _recordService.StockQuantityChangeRecordService.AddStockChangeRecord(stockInfo, stockInfoDetails, beforeQuantity, totalQuantity, StockChangeTypeEnum.MaterielGroup); + return WebResponseContent.Instance.OK(data: stockInfo); + } + public int GetPalletTypeGMOrPP(Dt_Warehouse warehouse, string boxWidth) + { + if (warehouse.WarehouseCode == WarehouseEnum.HA152.ToString()) + { + + if (boxWidth.ObjToInt() <= 690 && boxWidth.ObjToInt()>=515) + { + return 15; + } + else if (boxWidth.ObjToInt() > 690 && boxWidth.ObjToInt() <= 1400) + { + return 16; + } + + } + else if (warehouse.WarehouseCode == WarehouseEnum.HA58.ToString()) + { + Dt_PalletTypeInfo palletTypeInfo = _palletTypeInfoRepository.QueryFirst(x => x.WarehouseId == warehouse.WarehouseId); + return palletTypeInfo.PalletType; + } + return -1; + } public WebResponseContent OtherInGroup(Dt_InboundOrder inboundOrder,string? palletCode,int Initiallife,Dt_Warehouse warehouse,List<MatSerNumAnalysisModel> models) { WebResponseContent content = new WebResponseContent(); diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Stock/Dt_StockInfo.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Stock/Dt_StockInfo.cs" index 85fea92..73cc45c 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Stock/Dt_StockInfo.cs" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Stock/Dt_StockInfo.cs" @@ -55,6 +55,11 @@ /// </summary> [SugarColumn(IsNullable = true, ColumnDescription = "澶囨敞")] public string Remark { get; set; } + /// <summary> + /// 搴撳瓨鐗╂枡闀垮害GM/PP + /// </summary> + [SugarColumn(IsNullable = true, ColumnDescription = "搴撳瓨鐗╂枡闀垮害")] + public int StockLength { get; set; } /// <summary> /// 搴撳瓨鏄庣粏 diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/TaskInfo/Dt_Task.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/TaskInfo/Dt_Task.cs" index 9cefadd..8b5eb89 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/TaskInfo/Dt_Task.cs" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/TaskInfo/Dt_Task.cs" @@ -142,6 +142,13 @@ [SugarColumn(IsNullable = true, ColumnDescription = "浠诲姟缁�")] public string GroupId { get; set; } /// <summary> + /// 浠诲姟鐗╂枡闀垮害 + /// </summary> + [ImporterHeader(Name = "浠诲姟鐗╂枡闀垮害")] + [ExporterHeader(DisplayName = "浠诲姟鐗╂枡闀垮害")] + [SugarColumn(IsNullable = true, ColumnDescription = "浠诲姟鐗╂枡闀垮害")] + public int TaskLength { get; set; } + /// <summary> /// 澶囨敞 /// </summary> [ImporterHeader(Name = "澶囨敞")] diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService.cs" index 4e74fc0..4755722 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService.cs" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService.cs" @@ -687,6 +687,10 @@ { x.Status = StockStatusEmun.鍑哄簱瀹屾垚.ObjToInt(); }); + if (stockInfo.StockLength>0) + { + stockInfo.StockLength = 0; + } _stockRepository.StockInfoRepository.UpdateData(stockInfo); _stockRepository.StockInfoDetailRepository.UpdateData(stockInfo.Details); } diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService_Inbound.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService_Inbound.cs" index a225003..11bc704 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService_Inbound.cs" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService_Inbound.cs" @@ -278,7 +278,7 @@ /// <param name="roadwayNo"></param> /// <param name="palletCode"></param> /// <returns></returns> - public WebResponseContent DeviceRequestInboundTask(string stationCode, string roadwayNo, string palletCode) + public WebResponseContent DeviceRequestInboundTask(string stationCode, string roadwayNo, string palletCode,string materielBoxCode = "") { try { @@ -293,7 +293,72 @@ { return WebResponseContent.Instance.Error($"璇ョ珯鐐瑰凡鏈夋湭鎵ц鐨勪换鍔�"); } + if (!string.IsNullOrEmpty(materielBoxCode)) + { + _unitOfWorkManage.BeginTran(); + WebResponseContent responseGroup = _inboundOrderService.MaterielPPorGM(materielBoxCode); + if (!responseGroup.Status) + { + return WebResponseContent.Instance.Error($"{responseGroup.Message}"); + } + Dt_StockInfo stockInfoPPorGM = responseGroup.Data as Dt_StockInfo ?? null; + if (stockInfoPPorGM==null) + { + return WebResponseContent.Instance.Error($"缁勭洏鏁版嵁杞崲澶辫触"); + } + Dt_LocationInfo? locationInfoPPorGM = _basicService.LocationInfoService.AssignLocation(roadwayNo, stockInfoPPorGM.PalletType, stockInfoPPorGM.WarehouseId); + if (locationInfoPPorGM == null) + { + return WebResponseContent.Instance.Error($"璐т綅鍒嗛厤澶辫触,鏈壘鍒板彲鍒嗛厤璐т綅"); + } + Dt_Task newTaskPPorGM = new Dt_Task() + { + CurrentAddress = stationCode, + Grade = 0, + NextAddress = locationInfoPPorGM.LocationCode, + PalletCode = stockInfoPPorGM.PalletCode, + Roadway = roadwayNo, + SourceAddress = stationCode, + TargetAddress = locationInfoPPorGM.LocationCode, + TaskType = TaskTypeEnum.Inbound.ObjToInt(), + TaskStatus = TaskStatusEnum.New.ObjToInt(), + WarehouseId = stockInfoPPorGM.WarehouseId, + PalletType = stockInfoPPorGM.PalletType, + TaskLength= stockInfoPPorGM.StockLength + }; + //鑾峰彇鏄惁瀛樺湪鍏ュ簱鍗� + Dt_InboundOrder? inboundOrderPPorGM = null; + if (stockInfoPPorGM != null && stockInfoPPorGM.Details.Count > 0) + { + string? orderNo = stockInfoPPorGM.Details.FirstOrDefault()?.OrderNo ?? ""; + inboundOrderPPorGM = _inboundOrderService.Repository.QueryFirst(x => x.InboundOrderNo == orderNo && x.OrderStatus < InOrderStatusEnum.鍏ュ簱瀹屾垚.ObjToInt()); + } + + if (inboundOrderPPorGM != null) + { + if (inboundOrderPPorGM.OrderType == InOrderTypeEnum.Allocat.ObjToInt()) + { + newTaskPPorGM.TaskType = TaskTypeEnum.InAllocate.ObjToInt(); + } + else if (inboundOrderPPorGM.OrderType == InOrderTypeEnum.Return.ObjToInt()) + { + newTaskPPorGM.TaskType = TaskTypeEnum.ProductionReturn.ObjToInt(); + } + } + stockInfoPPorGM.StockStatus = StockStatusEmun.鍏ュ簱纭.ObjToInt(); + LocationStatusEnum lastStatusPPorGM = (LocationStatusEnum)locationInfoPPorGM.LocationStatus; + _recordService.LocationStatusChangeRecordSetvice.AddLocationStatusChangeRecord(locationInfoPPorGM, lastStatusPPorGM, LocationStatusEnum.Lock, LocationChangeType.InboundAssignLocation); + _basicService.LocationInfoService.UpdateLocationStatus(locationInfoPPorGM, newTaskPPorGM.PalletType, LocationStatusEnum.Lock, newTaskPPorGM.WarehouseId); + int taskIdPPorGM = BaseDal.AddData(newTaskPPorGM); + newTaskPPorGM.TaskId = taskIdPPorGM; + _stockRepository.StockInfoRepository.Db.InsertNav(stockInfoPPorGM).Include(x => x.Details).ExecuteCommand(); + _unitOfWorkManage.CommitTran(); + WMSTaskDTO wMSTaskDTOPPorGM = _mapper.Map<WMSTaskDTO>(newTaskPPorGM); + + PushTasksToWCS(new List<Dt_Task> { newTaskPPorGM }); + return WebResponseContent.Instance.OK(data: wMSTaskDTOPPorGM); + } Dt_StockInfo stockInfo = _stockRepository.StockInfoRepository.Db.Queryable<Dt_StockInfo>().Where(x => x.PalletCode == palletCode).Includes(x => x.Details).First(); if (stockInfo == null) { diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService_Outbound.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService_Outbound.cs" index e295122..cd80741 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService_Outbound.cs" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService_Outbound.cs" @@ -526,6 +526,10 @@ PalletType = stockInfo.PalletType, WarehouseId = stockInfo.WarehouseId, }; + if (stockInfo.StockLength>0) + { + task.TaskLength = stockInfo.StockLength; + } tasks.Add(task); } } diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/TaskInfo/TaskController.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/TaskInfo/TaskController.cs" index 8bb450b..2c768e0 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/TaskInfo/TaskController.cs" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/TaskInfo/TaskController.cs" @@ -75,9 +75,9 @@ /// <param name="palletCode"></param> /// <returns></returns> [HttpPost, HttpGet, Route("DeviceRequestInboundTask"), AllowAnonymous] - public WebResponseContent DeviceRequestInboundTask(string stationCode, string roadwayNo, string palletCode) + public WebResponseContent DeviceRequestInboundTask(string stationCode, string roadwayNo, string palletCode,string materielBoxCode = "") { - return Service.DeviceRequestInboundTask(stationCode, roadwayNo, palletCode); + return Service.DeviceRequestInboundTask(stationCode, roadwayNo, palletCode, materielBoxCode); } /// <summary> diff --git "a/\351\241\271\347\233\256\350\265\204\346\226\231/24KH244 \346\267\261\345\234\263\347\276\216\347\221\236\345\256\211 \346\267\256\345\256\211\347\211\271\345\210\233\347\253\213\344\275\223\345\272\223\351\241\271\347\233\256\347\224\265\346\216\247\350\275\257\344\273\266\345\274\200\345\217\221\343\200\201\346\265\213\350\257\225\345\217\212\347\273\264\346\212\244\346\234\215\345\212\241-\346\212\200\346\234\257\345\215\217\350\256\256-2024.11.21.pdf" "b/\351\241\271\347\233\256\350\265\204\346\226\231/24KH244 \346\267\261\345\234\263\347\276\216\347\221\236\345\256\211 \346\267\256\345\256\211\347\211\271\345\210\233\347\253\213\344\275\223\345\272\223\351\241\271\347\233\256\347\224\265\346\216\247\350\275\257\344\273\266\345\274\200\345\217\221\343\200\201\346\265\213\350\257\225\345\217\212\347\273\264\346\212\244\346\234\215\345\212\241-\346\212\200\346\234\257\345\215\217\350\256\256-2024.11.21.pdf" index 1853596..befa547 100644 --- "a/\351\241\271\347\233\256\350\265\204\346\226\231/24KH244 \346\267\261\345\234\263\347\276\216\347\221\236\345\256\211 \346\267\256\345\256\211\347\211\271\345\210\233\347\253\213\344\275\223\345\272\223\351\241\271\347\233\256\347\224\265\346\216\247\350\275\257\344\273\266\345\274\200\345\217\221\343\200\201\346\265\213\350\257\225\345\217\212\347\273\264\346\212\244\346\234\215\345\212\241-\346\212\200\346\234\257\345\215\217\350\256\256-2024.11.21.pdf" +++ "b/\351\241\271\347\233\256\350\265\204\346\226\231/24KH244 \346\267\261\345\234\263\347\276\216\347\221\236\345\256\211 \346\267\256\345\256\211\347\211\271\345\210\233\347\253\213\344\275\223\345\272\223\351\241\271\347\233\256\347\224\265\346\216\247\350\275\257\344\273\266\345\274\200\345\217\221\343\200\201\346\265\213\350\257\225\345\217\212\347\273\264\346\212\244\346\234\215\345\212\241-\346\212\200\346\234\257\345\215\217\350\256\256-2024.11.21.pdf" Binary files differ -- Gitblit v1.9.3