From 3443d00c1c23f84d8559e802a27eb9ba7ff0858a Mon Sep 17 00:00:00 2001
From: wangxinhui <wangxinhui@hnkhzn.com>
Date: 星期二, 10 六月 2025 16:32:34 +0800
Subject: [PATCH] 1
---
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_External/Model/QMSReceiveCheckModel.cs | 65 +++++
代码管理/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/84af00d5-ba67-4076-8ddf-2b24626091ba.vsidx | 0
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Controllers/AGV/CTU_AGVController .cs | 23 +
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Controllers/AGV/ZH_AGVController.cs | 7
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_ITaskInfoService/ITaskService.cs | 2
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_Common/APIEnum/APIEnum.cs | 7
代码管理/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/4f9889c8-bc2e-456e-9b47-f0fa2eeb365c.vsidx | 0
代码管理/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/3e16d87e-9dfc-4339-acea-a3e8fc3006cc.vsidx | 0
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_External/IQMSService/IInvokeQMSService.cs | 23 +
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/MesTaskService.cs | 44 +++
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService_Inbound.cs | 92 +++++++
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/PP仓/ConveyorLineJob_PP.cs | 17
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService_Outbound.cs | 2
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_Common/WareHouseEnum/WarehouseEnum.cs | 7
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/PP仓/TSJConveyorLineJob_PP.cs | 4
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/Service/AssignLocation/LocationInfoService_GM.cs | 64 ++++
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_DTO/Agv/AgvUpdateDTO.cs | 1
代码管理/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/67049f81-98c9-4b14-ac45-8781b4667d93.vsidx | 0
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/QMS/QmsController.cs | 78 ++++++
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_ITaskInfoService/ITaskService.cs | 3
代码管理/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/73055691-0933-46e5-8aec-b97ad0bfe09e.vsidx | 0
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs | 38 ++
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_Core/Helper/HttpQmsHelper.cs | 60 ++++
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/AssignInboundTaskLocation_BC.cs | 2
代码管理/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/3f7cc6f5-3187-454f-b270-cee6e70c2744.vsidx | 0
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_InboundService/InboundOrderService.cs | 27 +
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_Common/TaskEnum/TaskTypeEnum.cs | 6
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/TaskInfo/TaskController.cs | 14
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_Core/Helper/HttpMesHelper.cs | 31 --
/dev/null | 0
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/干膜仓/StackerCraneJob_GM.cs | 60 ++++
代码管理/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/89e89d9b-deaa-4861-a50e-511b40507585.vsidx | 0
代码管理/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/fe5a1663-e219-46ba-811e-e4993b5c3069.vsidx | 0
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_DTO/QMS/CheckResultDTO.cs | 35 ++
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_DTO/MES/MesLotModel.cs | 18 +
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_External/QMSService/InvokeQMSService.cs | 45 +++
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_StockService/ProStockInfoService.cs | 2
37 files changed, 713 insertions(+), 64 deletions(-)
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/LargeScreen/CP-Screen.zip" "b/\344\273\243\347\240\201\347\256\241\347\220\206/LargeScreen/CP-Screen.zip"
deleted file mode 100644
index 801a3dc..0000000
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/LargeScreen/CP-Screen.zip"
+++ /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/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"
deleted file mode 100644
index 6e5b28d..0000000
--- "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"
+++ /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/3f7cc6f5-3187-454f-b270-cee6e70c2744.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/9c8323bc-3d97-4f52-8315-faf14a56756c.vsidx"
rename to "\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/3f7cc6f5-3187-454f-b270-cee6e70c2744.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/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/4f9889c8-bc2e-456e-9b47-f0fa2eeb365c.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/05de9a72-8eef-42af-bb91-2884b11682fc.vsidx"
rename to "\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/4f9889c8-bc2e-456e-9b47-f0fa2eeb365c.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/fc24c9bc-a681-4021-afee-e9730bbda510.vsidx" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/73055691-0933-46e5-8aec-b97ad0bfe09e.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/fc24c9bc-a681-4021-afee-e9730bbda510.vsidx"
rename to "\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/73055691-0933-46e5-8aec-b97ad0bfe09e.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/84af00d5-ba67-4076-8ddf-2b24626091ba.vsidx" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/84af00d5-ba67-4076-8ddf-2b24626091ba.vsidx"
new file mode 100644
index 0000000..c44bf32
--- /dev/null
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/84af00d5-ba67-4076-8ddf-2b24626091ba.vsidx"
Binary files differ
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_DTO/Agv/AgvUpdateDTO.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_DTO/Agv/AgvUpdateDTO.cs"
index 98307d4..613bdb8 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_DTO/Agv/AgvUpdateDTO.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_DTO/Agv/AgvUpdateDTO.cs"
@@ -107,5 +107,6 @@
/// 璁惧缂栧彿
/// </summary>
public string EqpCode { get; set; }
+ public string PodTyp { 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 2921662..e90eadd 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"
@@ -65,6 +65,8 @@
/// <param name="sourceAddress">璧峰鍦板潃</param>
/// <returns></returns>
WebResponseContent RequestWMSTask(string palletCode, string sourceAddress, string materielBoxCode = "");
+
+ WebResponseContent RequestWMSZHTask(string agvTaskCode, string palletCode, string palletType,string materialLot);
/// <summary>
/// 鍚慦MS鐢宠浠诲姟
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 f0bb5e2..9ecc331 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"
@@ -311,6 +311,29 @@
return agvResponseContent;
}
}
+ else //绾夸綋鏃犱换鍔�
+ {
+ //璋冪敤AGV棰勮皟搴︽帴鍙�
+ AgvScheduleTaskDTO agvScheduleTask = new AgvScheduleTaskDTO()
+ {
+ PositionCode = "8001",
+ NextTask = "15",
+ UseableLayers = "1",
+ CacheCount = "1",
+ Update = "0",
+ AgvTyp = "10",
+ PreTaskQty = "1",
+ ReqCode = Guid.NewGuid().ToString().Replace("-", ""),
+ ReqTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"),
+ };
+ WebResponseContent contentFL = _taskService.AgvPreScheduleTask(agvScheduleTask);
+ if (!contentFL.Status)
+ {
+ agvResponseContent.Code = "1";
+ agvResponseContent.Message = contentFL.Message;
+ return agvResponseContent;
+ }
+ }
//鑾峰彇璋冨叆鍙傛暟
AGVBoxApplyPassDTO boxApplyPassDTO = new AGVBoxApplyPassDTO()
{
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Controllers/AGV/ZH_AGVController.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Controllers/AGV/ZH_AGVController.cs"
index 3320450..67617af 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Controllers/AGV/ZH_AGVController.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Controllers/AGV/ZH_AGVController.cs"
@@ -92,8 +92,11 @@
if (task == null) throw new Exception($"鏈壘鍒颁换鍔�,浠诲姟鍙枫�恵agvUpdateModel.TaskCode}銆�");
switch (agvUpdateModel.Method)
{
- case "start":
- break;
+ case "begin":
+ WebResponseContent requestZH = _taskService.RequestWMSZHTask(agvUpdateModel.TaskCode, agvUpdateModel.PodCode,agvUpdateModel.PodTyp,agvUpdateModel.MaterialLot);
+ agvResponseContent.Code = requestZH.Status ? "0" : "1";
+ agvResponseContent.Message = requestZH.Status ? "鎴愬姛" : "澶辫触";
+ return agvResponseContent;
case "outbin"://鍑哄簱鏍规嵁杩欎釜淇″彿鍒ゆ柇鍙栬揣瀹屾垚
if (task.TaskType == TaskTypeEnum.Outbound.ObjToInt())
{
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 5a885e6..9af1fe7 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"
@@ -427,7 +427,45 @@
}
return content;
}
+ public WebResponseContent RequestWMSZHTask(string agvTaskCode, string palletCode, string palletType, string materialLot)
+ {
+ WebResponseContent content = new WebResponseContent();
+ try
+ {
+ Dt_Task task = BaseDal.QueryFirst(x => x.AgvTaskNum == agvTaskCode);
+ if (task != null)
+ {
+ return WebResponseContent.Instance.Error($"浠诲姟鍙穥task.TaskNum}瀵瑰簲浠诲姟宸插瓨鍦�");
+ }
+ string address = AppSettings.Get("WMSApiAddress");
+ if (string.IsNullOrEmpty(address))
+ {
+ return WebResponseContent.Instance.Error($"鏈壘鍒癢MSApi鍦板潃");
+ }
+ string responseStr = "";
+ if (string.IsNullOrEmpty(materialLot))
+ {
+ return content.Error("鐗╂枡鎵规涓虹┖");
+
+ }
+ responseStr = HttpHelper.Get($"{address}/api/Task/RequestZHInboundTask?agvTaskCode={agvTaskCode}&palletCode={palletCode}&palletType={palletType}&materialLot={materialLot}");
+ 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;
+ }
/// <summary>
///
/// </summary>
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 30cad43..485a7ae 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"
@@ -77,20 +77,20 @@
if (!string.IsNullOrEmpty(boxcode))
{
- string sc = device.Communicator.Read<string>("DB900.598.0");
+ string sc = device.Communicator.Read<string>("DB900.580.0");
WriteError(device.DeviceName, $"璇诲彇鍊硷細{boxcode},瀵规瘮{sc}");
string boxEndCode = "";
- if (boxcode.LastIndexOf(",SC:") >= 0)
+ if (boxcode.LastIndexOf(",PO:") >= 0)
{
- boxEndCode = "M" + boxcode.Substring(0, boxcode.LastIndexOf(",SC:")) + sc.Substring(sc.IndexOf(",SC:")).Replace("\0", "");
+ boxEndCode = "M" + boxcode.Substring(0, boxcode.LastIndexOf(",PO:")) + sc.Substring(sc.IndexOf(",PO:")).Replace("\0", "");
}
- else if (boxcode.LastIndexOf(",SC") > 0)
+ else if (boxcode.LastIndexOf(",PO") > 0)
{
- boxEndCode = "M" + boxcode.Substring(0, boxcode.LastIndexOf(",SC")) + sc.Substring(sc.IndexOf("SC:")).Replace("\0", "");
+ boxEndCode = "M" + boxcode.Substring(0, boxcode.LastIndexOf(",PO")) + sc.Substring(sc.IndexOf("PO:")).Replace("\0", "");
}
- else if (boxcode.LastIndexOf(",S") > 0)
+ else if (boxcode.LastIndexOf(",P") > 0)
{
- boxEndCode = "M" + boxcode.Substring(0, boxcode.LastIndexOf(",S")) + sc.Substring(sc.IndexOf("SC:")).Replace("\0", "");
+ boxEndCode = "M" + boxcode.Substring(0, boxcode.LastIndexOf(",P")) + sc.Substring(sc.IndexOf("PO:")).Replace("\0", "");
}
//鍏ュ簱鐢宠浠诲姟
@@ -111,7 +111,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.DeviceCode == item.StationDeviceCode && 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/PP\344\273\223/TSJConveyorLineJob_PP.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/PP\344\273\223/TSJConveyorLineJob_PP.cs"
index 377fb7e..2a48f12 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/PP\344\273\223/TSJConveyorLineJob_PP.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/PP\344\273\223/TSJConveyorLineJob_PP.cs"
@@ -112,7 +112,7 @@
{
if (!conveyorLineSignalRead.STB && !conveyorLineSignalRead.ACK && conveyorLineStatus.Online && !conveyorLineStatus.Goods && !conveyorLineStatus.Alarm && !conveyorLineSignalWrite.STB && !conveyorLineSignalWrite.ACK)
{
- Dt_Task task = _taskRepository.QueryFirst(x => _taskService.TaskOutboundTypes.Contains(x.TaskType) && x.TaskState == TaskStatusEnum.New.ObjToInt() && string.IsNullOrEmpty(x.TargetAddress) && !string.IsNullOrEmpty(x.NextAddress));
+ Dt_Task task = _taskRepository.QueryFirst(x => _taskService.TaskOutboundTypes.Contains(x.TaskType) && x.DeviceCode == item.StackerCraneCode && x.TaskState == TaskStatusEnum.New.ObjToInt() && string.IsNullOrEmpty(x.TargetAddress) && !string.IsNullOrEmpty(x.NextAddress));
if (task != null)
{
_taskService.UpdateTask(task, TaskStatusEnum.SC_Execute, nextAddress: item.StationCode, deviceCode: item.StackerCraneCode, targetAddress: item.StationCode);
@@ -121,7 +121,7 @@
if (conveyorLineSignalRead.STB && conveyorLineStatus.Online && conveyorLineStatus.Goods && !conveyorLineStatus.Alarm && !conveyorLineSignalWrite.ACK)//鍏ュ簱
{
- Dt_Task task = _taskRepository.QueryFirst(x => x.TaskNum == conveyorLineInfoRead.TaskNum && x.NextAddress == item.StationCode);
+ Dt_Task task = _taskRepository.QueryFirst(x => x.TaskNum == conveyorLineInfoRead.TaskNum && x.DeviceCode == item.StationDeviceCode && x.NextAddress == item.StationCode);
if (task != null && task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.InboundGroup)
{
Dt_StationManger? stationManger = stationMangers.FirstOrDefault(x => x.StationCode == item.StationCode);
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 eb35201..3d1aa80 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"
@@ -26,6 +26,8 @@
using WIDESEAWCS_Core.Caches;
using WIDESEAWCS_Tasks.ConveyorLineJob;
using WIDESEAWCS_QuartzJob.Repository;
+using WIDESEAWCS_DTO.TaskInfo;
+using AutoMapper;
namespace WIDESEAWCS_Tasks
{
@@ -39,9 +41,10 @@
private readonly IRouterService _routerService;
private readonly IStationMangerRepository _stationMangerRepository;
private readonly IRouterRepository _routerRepository;
+ private readonly IMapper _mapper;
private List<Dt_ApiInfo> apiInfos;
- public StackerCraneJob_GM(ITaskService taskService, ICacheService cacheService, ITaskExecuteDetailService taskExecuteDetailService, ITaskRepository taskRepository, IRouterService routerService, IStationMangerRepository stationMangerRepository, IRouterRepository routerRepository)
+ public StackerCraneJob_GM(ITaskService taskService, ICacheService cacheService, ITaskExecuteDetailService taskExecuteDetailService, ITaskRepository taskRepository, IRouterService routerService, IStationMangerRepository stationMangerRepository, IRouterRepository routerRepository, IMapper mapper)
{
_taskService = taskService;
_taskExecuteDetailService = taskExecuteDetailService;
@@ -50,6 +53,7 @@
_stationMangerRepository = stationMangerRepository;
_cacheService = cacheService;
_routerRepository = routerRepository;
+ _mapper = mapper;
string? apiInfoStr = _cacheService.Get("apiInfos");
if (!string.IsNullOrEmpty(apiInfoStr))
@@ -244,11 +248,61 @@
if (string.IsNullOrEmpty(url))
{
_taskExecuteDetailService.AddTaskExecuteDetail(task.TaskNum, $"鏈壘鍒癢MS绉诲簱鍒ゆ柇鎺ュ彛");
- WriteInfo(commonStackerCrane.DeviceCode, $"鏈壘鍒癢MS绉诲簱鍒ゆ柇鎺ュ彛");
+ WriteError(commonStackerCrane.DeviceCode, $"鏈壘鍒癢MS绉诲簱鍒ゆ柇鎺ュ彛");
_taskService.UpdateTaskExceptionMessage(task.TaskNum, $"鏈壘鍒癢MS绉诲簱鍒ゆ柇鎺ュ彛");
return null;
}
- //HttpHelper.Post($"{url}?taskNum={task.TaskNum}&locationCode={task.NextAddress}", "");//todo 璋冪敤WMS浠诲姟瀹屾垚鏂规硶
+ string response = HttpHelper.Post($"{url}?taskNum={task.TaskNum}&locationCode={task.CurrentAddress}", "");//todo 璋冪敤WMS浠诲姟瀹屾垚鏂规硶
+ if (string.IsNullOrEmpty(response))
+ {
+ _taskExecuteDetailService.AddTaskExecuteDetail(task.TaskNum, $"绉诲簱鎺ュ彛璋冪敤閿欒");
+ WriteError(commonStackerCrane.DeviceCode, $"绉诲簱鎺ュ彛璋冪敤閿欒");
+ _taskService.UpdateTaskExceptionMessage(task.TaskNum, $"绉诲簱鎺ュ彛璋冪敤閿欒");
+ return null;
+ }
+ WebResponseContent? responseContent = JsonConvert.DeserializeObject<WebResponseContent>(response);
+ if (responseContent == null || !responseContent.Status)
+ {
+ _taskExecuteDetailService.AddTaskExecuteDetail(task.TaskNum, $"绉诲簱鎺ュ彛璋冪敤閿欒");
+ WriteError(commonStackerCrane.DeviceCode, $"绉诲簱鎺ュ彛璋冪敤閿欒");
+ _taskService.UpdateTaskExceptionMessage(task.TaskNum, $"绉诲簱鎺ュ彛璋冪敤閿欒");
+ return null;
+ }
+ WMSTaskDTO? taskDTO = JsonConvert.DeserializeObject<WMSTaskDTO>(responseContent.Data.Serialize());
+ if (taskDTO == null)
+ {
+ _taskExecuteDetailService.AddTaskExecuteDetail(task.TaskNum, $"绉诲簱鎺ュ彛璋冪敤閿欒");
+ WriteError(commonStackerCrane.DeviceCode, $"绉诲簱鎺ュ彛璋冪敤閿欒");
+ _taskService.UpdateTaskExceptionMessage(task.TaskNum, $"绉诲簱鎺ュ彛璋冪敤閿欒");
+ return null;
+
+ }
+ if (task.TaskNum == taskDTO.TaskNum)
+ {
+ return task;
+ }
+ else
+ {
+ Dt_Task reloTask = _mapper.Map<Dt_Task>(taskDTO);
+ //鍒ゆ柇绉诲簱璐т綅浠诲姟鏄惁宸插瓨鍦紝濡傚瓨鍦ㄥ厛鎵ц
+ Dt_Task existTask = _taskService.QueryStackerExistTask(reloTask.PalletCode, reloTask.SourceAddress);
+ if (existTask != null)
+ {
+ return existTask;
+ }
+ else
+ {
+ reloTask.TaskState = TaskStatusEnum.SC_Execute.ObjToInt();
+ reloTask.CurrentAddress = taskDTO.SourceAddress;
+ reloTask.NextAddress = taskDTO.TargetAddress;
+ reloTask.DeviceCode = task.DeviceCode;
+ reloTask.TaskType = TaskTypeEnum.Relocation.ObjToInt();
+ int taskId = _taskRepository.AddData(reloTask);
+ reloTask.TaskId = taskId;
+ }
+ return reloTask;
+
+ }
}
return task;
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/3c89de48-4a08-4fe0-8316-5c4d4bd0d410.vsidx" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/3c89de48-4a08-4fe0-8316-5c4d4bd0d410.vsidx"
deleted file mode 100644
index 2e319cd..0000000
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/3c89de48-4a08-4fe0-8316-5c4d4bd0d410.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/3e16d87e-9dfc-4339-acea-a3e8fc3006cc.vsidx" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/3e16d87e-9dfc-4339-acea-a3e8fc3006cc.vsidx"
new file mode 100644
index 0000000..e215482
--- /dev/null
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/3e16d87e-9dfc-4339-acea-a3e8fc3006cc.vsidx"
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/67049f81-98c9-4b14-ac45-8781b4667d93.vsidx" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/67049f81-98c9-4b14-ac45-8781b4667d93.vsidx"
new file mode 100644
index 0000000..6e76dd2
--- /dev/null
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/67049f81-98c9-4b14-ac45-8781b4667d93.vsidx"
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/89e89d9b-deaa-4861-a50e-511b40507585.vsidx" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/89e89d9b-deaa-4861-a50e-511b40507585.vsidx"
new file mode 100644
index 0000000..e40ceb0
--- /dev/null
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/89e89d9b-deaa-4861-a50e-511b40507585.vsidx"
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"
deleted file mode 100644
index 69f5df9..0000000
--- "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"
+++ /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/fe5a1663-e219-46ba-811e-e4993b5c3069.vsidx" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/fe5a1663-e219-46ba-811e-e4993b5c3069.vsidx"
new file mode 100644
index 0000000..a0cfaf6
--- /dev/null
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/fe5a1663-e219-46ba-811e-e4993b5c3069.vsidx"
Binary files differ
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/Service/AssignLocation/LocationInfoService_GM.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/Service/AssignLocation/LocationInfoService_GM.cs"
index 3691af7..82cb34c 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/Service/AssignLocation/LocationInfoService_GM.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/Service/AssignLocation/LocationInfoService_GM.cs"
@@ -43,6 +43,8 @@
List<string> lockLocationCodes = locationCaches_GM.Select(x => x.LocationCode).ToList();
List<Dt_LocationInfo> locationInfos = Repository.QueryData(x => x.RoadwayNo == roadwayNo);
+ //鑾峰彇鎵�鏈変簩娣变綅璐т綅鏁版嵁
+ List<Dt_LocationInfo> locationInfoDepth = Repository.QueryData(x => x.RoadwayNo == roadwayNo && x.Depth== locationInfos.Max(v=>v.Depth));
if (locationInfos == null || locationInfos.Count == 0)
{
throw new Exception($"鏈壘鍒拌宸烽亾鐨勮揣浣嶄俊鎭�,宸烽亾鍙�:{roadwayNo}");
@@ -83,6 +85,37 @@
Dt_LocationInfo? locationInfo = GetUsableLocation_GM(locationInfos, definedTypeEmptyLocation, palletType, palletTypeInfo);
if (locationInfo != null)
{
+ if (locationInfo.Depth<locationInfoDepth.Max(x=>x.Depth) && palletTypeInfo.LocaitonCount<2)
+ {
+ Dt_LocationInfo? locationInfoExist = null;
+ int Column = locationInfo.Column;
+ if (Column % 2 == 0)
+ {
+ Column -= 1;
+ }
+ if (locationInfo.Row - locationInfo.Depth == locationInfo.Depth)
+ {
+ locationInfoExist = locationInfoDepth.FirstOrDefault(x => x.Row == (locationInfo.Row-1) && x.Column== Column && x.Layer==locationInfo.Layer && x.LocationStatus==LocationStatusEnum.InStock.ObjToInt());
+ }
+ else
+ {
+ locationInfoExist = locationInfoDepth.FirstOrDefault(x => x.Row == (locationInfo.Row + 1) && x.Column == Column && x.Layer == locationInfo.Layer && x.LocationStatus == LocationStatusEnum.InStock.ObjToInt());
+ }
+ //鑾峰彇娣变綅璐т綅绫诲瀷
+ if (locationInfoExist==null)
+ {
+ continue;
+ }
+ Dt_PalletTypeInfo palletTypeInfoDepth = _basicRepository.PalletTypeInfoRepository.QueryFirst(x => x.WarehouseId == locationInfoExist.WarehouseId && x.PalletType == locationInfoExist.LocationType);
+ if (palletTypeInfoDepth == null)
+ {
+ continue;
+ }
+ if (palletTypeInfoDepth.LocaitonCount==2 && palletTypeInfo.LocaitonCount==1)
+ {
+ continue;
+ }
+ }
locationCaches_GM.Add(new LocationCache { LocationCode = locationInfo.LocationCode, DateTime = DateTime.Now });
return locationInfo;
}
@@ -103,6 +136,37 @@
Dt_LocationInfo? locationInfo = GetUsableLocation_GM(locationInfos, undefinedTypeEmptyLocation, palletType, palletTypeInfo);
if (locationInfo != null)
{
+ if (locationInfo.Depth < locationInfoDepth.Max(x => x.Depth) && palletTypeInfo.LocaitonCount < 2)
+ {
+ Dt_LocationInfo? locationInfoExist = null;
+ int Column = locationInfo.Column;
+ if (Column % 2 == 0)
+ {
+ Column -= 1;
+ }
+ if (locationInfo.Row - locationInfo.Depth == locationInfo.Depth)
+ {
+ locationInfoExist = locationInfoDepth.FirstOrDefault(x => x.Row == (locationInfo.Row - 1) && x.Column == Column && x.Layer == locationInfo.Layer && x.LocationStatus == LocationStatusEnum.InStock.ObjToInt());
+ }
+ else
+ {
+ locationInfoExist = locationInfoDepth.FirstOrDefault(x => x.Row == (locationInfo.Row + 1) && x.Column == Column && x.Layer == locationInfo.Layer && x.LocationStatus == LocationStatusEnum.InStock.ObjToInt());
+ }
+ //鑾峰彇娣变綅璐т綅绫诲瀷
+ if (locationInfoExist == null)
+ {
+ continue;
+ }
+ Dt_PalletTypeInfo palletTypeInfoDepth = _basicRepository.PalletTypeInfoRepository.QueryFirst(x => x.WarehouseId == locationInfoExist.WarehouseId && x.PalletType == locationInfoExist.LocationType);
+ if (palletTypeInfoDepth == null)
+ {
+ continue;
+ }
+ if (palletTypeInfoDepth.LocaitonCount == 2)
+ {
+ continue;
+ }
+ }
locationCaches_GM.Add(new LocationCache { LocationCode = locationInfo.LocationCode, DateTime = DateTime.Now });
return locationInfo;
}
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Common/APIEnum/APIEnum.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Common/APIEnum/APIEnum.cs"
index aa2255b..516daa7 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Common/APIEnum/APIEnum.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Common/APIEnum/APIEnum.cs"
@@ -71,6 +71,11 @@
/// 鍥炶皟WCS浠诲姟瀹屾垚
/// </summary>
[Description("鍥炶皟WCS浠诲姟瀹屾垚")]
- FeedBackWCSTaskCompleted
+ FeedBackWCSTaskCompleted,
+ /// <summary>
+ /// QMS鏉ユ枡妫�楠屾帴鍙�
+ /// </summary>
+ [Description("QMS鏉ユ枡妫�楠屾帴鍙�")]
+ WMS_QMSReceiveCheckApi,
}
}
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Common/TaskEnum/TaskTypeEnum.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Common/TaskEnum/TaskTypeEnum.cs"
index 6782f68..1191fdb 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Common/TaskEnum/TaskTypeEnum.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Common/TaskEnum/TaskTypeEnum.cs"
@@ -147,7 +147,11 @@
/// </summary>
[Description("鎴愬搧绌烘鍥炲簱")]
EmptyProductBack = 630,
-
+ /// <summary>
+ /// 闃荤剨鍏ュ簱
+ /// </summary>
+ [Description("闃荤剨鍏ュ簱")]
+ InZHProduct = 640,
/// <summary>
/// 宸烽亾鍐呯Щ搴�
/// </summary>
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Common/WareHouseEnum/WarehouseEnum.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Common/WareHouseEnum/WarehouseEnum.cs"
index 70dabe9..cf9f55b 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Common/WareHouseEnum/WarehouseEnum.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Common/WareHouseEnum/WarehouseEnum.cs"
@@ -71,7 +71,12 @@
/// 娌瑰ⅷ浠�
/// </summary>
[Description("娌瑰ⅷ浠�")]
- HA153
+ HA153,
+ /// <summary>
+ /// 闃荤剨浠�
+ /// </summary>
+ [Description("闃荤剨浠�")]
+ HA154
}
public enum WarehouseTypEnum
{
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Core/Helper/HttpMesHelper.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Core/Helper/HttpMesHelper.cs"
index 1bfabba..5c7cba4 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Core/Helper/HttpMesHelper.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Core/Helper/HttpMesHelper.cs"
@@ -56,36 +56,5 @@
Logger.Add(serviceAddress, requestJson == null ? "" : requestJson, result, beginDate);
}
}
- public static string GetStr(string textToEncrypt)
- {
- string publicKey;
- string privateKey;
- GenerateRSAKeyPair(out publicKey, out privateKey);
- byte[] encryptedBytes = RSAEncrypt(textToEncrypt, publicKey);
- // 鍙互灏嗗姞瀵嗗悗鐨勫瓧鑺傛暟缁勮浆鎹负Base64瀛楃涓叉柟渚垮悗缁鐞嗭紝渚嬪浼犺緭绛�
- string encryptedBase64 = Convert.ToBase64String(encryptedBytes);
- return encryptedBase64;
- }
- public static void GenerateRSAKeyPair(out string publicKey, out string privateKey)
- {
- using (RSACryptoServiceProvider rsa = new RSACryptoServiceProvider(2048))
- {
- publicKey = rsa.ToXmlString(false);
- privateKey = rsa.ToXmlString(true);
- }
- }
- public static byte[] RSAEncrypt(string plainText, string publicKey)
- {
- byte[] encryptedData;
- using (RSACryptoServiceProvider rsa = new RSACryptoServiceProvider())
- {
- rsa.FromXmlString(publicKey);
- // 灏嗘枃鏈浆鎹负UTF8缂栫爜鐨勫瓧鑺傛暟缁�
- byte[] plainBytes = Encoding.UTF8.GetBytes(plainText);
- // 浣跨敤SHA1鍝堝笇绠楁硶浠ュ強Pkcs1濉厖瑙勫垯杩涜鍔犲瘑
- encryptedData = rsa.Encrypt(plainBytes, true);
- }
- return encryptedData;
- }
}
}
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Core/Helper/HttpQmsHelper.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Core/Helper/HttpQmsHelper.cs"
new file mode 100644
index 0000000..525ae13
--- /dev/null
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Core/Helper/HttpQmsHelper.cs"
@@ -0,0 +1,60 @@
+锘縰sing System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Net.Http.Headers;
+using WIDESEA_Core.LogHelper;
+using System.Security.Cryptography;
+
+namespace WIDESEA_Core.Helper
+{
+ public class HttpQmsHelper
+ {
+ public static string Post(string serviceAddress, string requestJson = null, string contentType = "application/json", Dictionary<string, string>? headers = null)
+ {
+ string result = string.Empty;
+ DateTime beginDate = DateTime.Now;
+ try
+ {
+ using (HttpContent httpContent = new StringContent(requestJson))
+ {
+ httpContent.Headers.ContentType = new MediaTypeHeaderValue("application/json");
+
+ using HttpClient httpClient = new HttpClient();
+ httpClient.Timeout = new TimeSpan(0, 0, 60);
+ //姝e紡
+ //string authorization = "AppKey 1930944618148245504";
+ //娴嬭瘯
+ string authorization = "AppKey 1930944618148245504";
+
+
+ headers = new Dictionary<string, string>
+ {
+ { "Authorization", authorization },
+ //姝e紡
+ //{ "Site_tenant_id", "6ec60d66-b08e-4ff3-90fa-57748053f79b" }
+ //娴嬭瘯
+ { "Site_tenant_id", "6ec60d66-b08e-4ff3-90fa-57748053f79b" }
+ };
+ if (headers != null)
+ {
+ foreach (var header in headers)
+ httpClient.DefaultRequestHeaders.Add(header.Key, header.Value);
+ }
+ HttpResponseMessage responseMessage = httpClient.PostAsync(serviceAddress, httpContent).Result;
+ result = responseMessage.Content.ReadAsStringAsync().Result;
+ }
+ return result;
+ }
+ catch (Exception e)
+ {
+ throw new Exception(e.Message);
+ }
+ finally
+ {
+ Logger.Add(serviceAddress, requestJson == null ? "" : requestJson, result, beginDate);
+ }
+ }
+ }
+}
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_DTO/MES/MesLotModel.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_DTO/MES/MesLotModel.cs"
new file mode 100644
index 0000000..5744eb6
--- /dev/null
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_DTO/MES/MesLotModel.cs"
@@ -0,0 +1,18 @@
+锘縰sing System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace WIDESEA_DTO.MES
+{
+ public class MesLotInfoModel
+ {
+ public string Product { get; set; }
+ public string ProductVersion { get; set; }
+ public decimal Qty { get; set; }
+ public string DateCode { get; set; }
+ public string LotNo { get; set; }
+ public bool IsFullNumber { get; set; }
+ }
+}
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_DTO/QMS/CheckResultDTO.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_DTO/QMS/CheckResultDTO.cs"
new file mode 100644
index 0000000..1ca78d5
--- /dev/null
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_DTO/QMS/CheckResultDTO.cs"
@@ -0,0 +1,35 @@
+锘縰sing System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace WIDESEA_DTO.QMS
+{
+ /// <summary>
+ /// Qms鍥炰紶
+ /// </summary>
+ public class CheckResultDTO
+ {
+ /// <summary>
+ /// 鏀惰揣鍗曞彿
+ /// </summary>
+ public string EntryNumber { get; set; }
+ /// <summary>
+ /// 鏀惰揣琛屽彿
+ /// </summary>
+ public int RowNumber { get; set; }
+ /// <summary>
+ /// 鏉ユ枡妫�楠屽崟鍙�
+ /// </summary>
+ public string InspectionNumber { get; set; }
+ /// <summary>
+ /// 缁撴灉
+ /// </summary>
+ public string Result { get; set; }
+ /// <summary>
+ /// 澶囨敞
+ /// </summary>
+ public string Remark { get; set; }
+ }
+}
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_External/IQMSService/IInvokeQMSService.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_External/IQMSService/IInvokeQMSService.cs"
new file mode 100644
index 0000000..b37ed7b
--- /dev/null
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_External/IQMSService/IInvokeQMSService.cs"
@@ -0,0 +1,23 @@
+锘縰sing System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using WIDESEA_Core;
+using WIDESEA_External.Model;
+
+namespace WIDESEA_External.QMSService
+{
+ /// <summary>
+ /// 璋冪敤ERP鎺ュ彛
+ /// </summary>
+ public interface IInvokeQMSService : IDependency
+ {
+ /// <summary>
+ /// QMS鏀惰揣鏉ユ枡妫�楠屾帴鍙h皟鐢�
+ /// </summary>
+ /// <param name="receiveModel"></param>
+ /// <returns></returns>
+ string InvokeReceiveCheckApi(QMSReceiveCheckModel model);
+ }
+}
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_External/Model/QMSReceiveCheckModel.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_External/Model/QMSReceiveCheckModel.cs"
new file mode 100644
index 0000000..f1ade45
--- /dev/null
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_External/Model/QMSReceiveCheckModel.cs"
@@ -0,0 +1,65 @@
+锘縰sing System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace WIDESEA_External.Model
+{
+ public class QMSReceiveCheckModel
+ {
+ /// <summary>
+ /// 鏀惰揣鍗曞彿
+ /// </summary>
+ public string EntryNumber { get; set; }
+ /// <summary>
+ /// 鐗╂枡缂栫爜
+ /// </summary>
+ public string MaterialCode { get; set; }
+ /// <summary>
+ /// 鐗╂枡鍚嶇О
+ /// </summary>
+ public string MaterialName { get; set; }
+ /// <summary>
+ /// 鏁伴噺
+ /// </summary>
+ public decimal Quantity { get; set; }
+ /// <summary>
+ /// 渚涘簲鍟嗙紪鐮�
+ /// </summary>
+ public string SupplierCode { get; set; }
+ /// <summary>
+ /// 渚涘簲鍟嗗悕绉�
+ /// </summary>
+ public string SupplierName { get; set; }
+ /// <summary>
+ /// 渚涘簲鍟嗘壒娆″彿
+ /// </summary>
+ public string BatchNumber { get; set; }
+ /// <summary>
+ /// 閫佽揣鍗曞彿
+ /// </summary>
+ public string DeliveryNumber { get; set; }
+ /// <summary>
+ /// 閲囪喘鍗曞彿
+ /// </summary>
+ public string PurchaseNumber { get; set; }
+ /// <summary>
+ /// 鏀惰揣鍗曡鍙�
+ /// </summary>
+ public int RowNumber { get; set; }
+ /// <summary>
+ /// 浠撳簱
+ /// </summary>
+ public string WarehouseCode { get; set; }
+ /// <summary>
+ /// 鏀舵枡鏃堕棿
+ /// </summary>
+ public string ReceiptDate { get; set; }
+ /// <summary>
+ /// 鏀舵枡澶囨敞
+ /// </summary>
+ public string Remark { get; set; }
+
+ }
+}
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_External/QMSService/InvokeQMSService.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_External/QMSService/InvokeQMSService.cs"
new file mode 100644
index 0000000..f174660
--- /dev/null
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_External/QMSService/InvokeQMSService.cs"
@@ -0,0 +1,45 @@
+锘縰sing Newtonsoft.Json;
+using Newtonsoft.Json.Serialization;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using WIDESEA_Common.APIEnum;
+using WIDESEA_Core.Helper;
+using WIDESEA_DTO;
+using WIDESEA_DTO.MES;
+using WIDESEA_External.Model;
+using WIDESEA_IBasicRepository;
+using WIDESEA_Model.Models;
+
+namespace WIDESEA_External.QMSService
+{
+ public class InvokeQMSService: IInvokeQMSService
+ {
+ private readonly IApiInfoRepository _apiInfoRepository;
+ public InvokeQMSService(IApiInfoRepository apiInfoRepository)
+ {
+ _apiInfoRepository = apiInfoRepository;
+ }
+ JsonSerializerSettings settings = new JsonSerializerSettings
+ {
+ ContractResolver = new CamelCasePropertyNamesContractResolver()
+ };
+ public string InvokeReceiveCheckApi(QMSReceiveCheckModel model)
+ {
+ Dt_ApiInfo apiInfo = _apiInfoRepository.QueryFirst(x => x.ApiCode == APIEnum.WMS_QMSReceiveCheckApi.ToString());
+ MESRoot<QMSReceiveCheckModel> requestModel = new MESRoot<QMSReceiveCheckModel>()
+ {
+ From = "WMS",
+ DateTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"),
+ Content = model
+ };
+
+ string request = JsonConvert.SerializeObject(model,settings);
+
+ string response = HttpHelper.Post(apiInfo.ApiAddress, request);
+ return response;
+ }
+ }
+}
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 aa30edb..c14fa72 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"
@@ -125,6 +125,8 @@
/// <returns></returns>
WebResponseContent AssignInboundTaskLocationByHeight(int taskNum, string roadwayNo, int heightType);
+ WebResponseContent RequestZHInboundTask(string agvTaskCode, string palletCode, string palletType, string materialLot);
+
/// <summary>
///
/// </summary>
@@ -373,5 +375,6 @@
/// 浜哄伐閫夋嫨搴撳瓨
/// </summary>
WebResponseContent OutProductSelect(int orderDetailId, List<ProStockViewDTO> proStockViews);
+ WebResponseContent GetZHMesMaterialLot(string materialLot);
}
}
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 c5528bd..3613253 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"
@@ -4,6 +4,7 @@
using Newtonsoft.Json;
using OfficeOpenXml.FormulaParsing.Excel.Functions.DateTime;
using OfficeOpenXml.FormulaParsing.Excel.Functions.RefAndLookup;
+using Org.BouncyCastle.Asn1.Ocsp;
using SqlSugar;
using System;
using System.Collections;
@@ -912,7 +913,15 @@
WebResponseContent content = new WebResponseContent();
try
{
- string SerNum = materielBoxCode.Substring(0, materielBoxCode.LastIndexOf("SC:")-1);
+ string SerNum = "";
+ if (materielBoxCode.LastIndexOf("SC:")<0)
+ {
+ SerNum = materielBoxCode;
+ }
+ else
+ {
+ SerNum = materielBoxCode.Substring(0, materielBoxCode.LastIndexOf("SC:") - 1);
+ }
MatSerNumAnalysisModel model = CodeAnalysisHelper.CodeAnalysis<MatSerNumAnalysisModel>(AnalysisCodeEnum.MatSerNumAnalysis, SerNum);
//楠岃瘉鍒ゆ柇鏃堕棿鏍煎紡
WebResponseContent IsValidContent = IsValidMCDates(new List<MatSerNumAnalysisModel>() { model });
@@ -920,7 +929,11 @@
{
return content.Error(IsValidContent.Message);
}
- string result = materielBoxCode.Substring(materielBoxCode.LastIndexOf("SC:") + 3);
+ string result = "";
+ if (materielBoxCode.LastIndexOf("SC:") > 0)
+ {
+ 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)
@@ -968,8 +981,8 @@
PalletCode = model.LotNo,
StockStatus = StockStatusEmun.缁勭洏鏆傚瓨.ObjToInt(),
WarehouseId = inboundOrder.WarehouseId,
- PalletType = GetPalletTypeGMOrPP(warehouse, result.Split("*")[0]),
- StockLength = result.Split("*")[0].ObjToInt(),
+ PalletType = GetPalletTypeGMOrPP(warehouse, result.IsNullOrEmpty() ? "" : result.Split("*")[0]),
+ StockLength = result.IsNullOrEmpty() ? 0 : result.Split("*")[0].ObjToInt(),
Details = new List<Dt_StockInfoDetail>()
};
}
@@ -1058,8 +1071,8 @@
PalletCode = model.LotNo,
StockStatus = StockStatusEmun.缁勭洏鏆傚瓨.ObjToInt(),
WarehouseId = warehouse.WarehouseId,
- PalletType = GetPalletTypeGMOrPP(warehouse, request.Split("*")[0]),
- StockLength = request.Split("*")[0].ObjToInt(),
+ PalletType = GetPalletTypeGMOrPP(warehouse, request.IsNullOrEmpty() ?"":request.Split("*")[0]),
+ StockLength = request.IsNullOrEmpty()?0:request.Split("*")[0].ObjToInt(),
Details = new List<Dt_StockInfoDetail>()
};
}
@@ -1104,7 +1117,7 @@
if (warehouse.WarehouseCode == WarehouseEnum.HA152.ToString())
{
- if (boxWidth.ObjToInt() <= 690 && boxWidth.ObjToInt()>=515)
+ if (boxWidth.ObjToInt() <= 690 && boxWidth.ObjToInt()>=520)
{
return 15;
}
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_StockService/ProStockInfoService.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_StockService/ProStockInfoService.cs"
index 99a9bb7..3db069b 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_StockService/ProStockInfoService.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_StockService/ProStockInfoService.cs"
@@ -134,7 +134,7 @@
&& (isCanLot ? isCanLot : x.BagNo == outOrderDetail.PLot)
&& (isCanDate ? isCanDate : x.DateCode == outOrderDetail.DateCode))
.Sum(x => x.StockPcsQty - x.OutboundQuantity);
- if (useableStockQuantity < needQuantity)
+ if (useableStockQuantity < needQuantity && useableStockQuantity >0)
{
stockInfo.proStockInfoDetails.Where(x => x.ProductCode == outOrderDetail.PCode && x.ProductVersion.StartsWith(outOrderDetail.PVer.Substring(0, 1))
&& (isCanLot ? isCanLot : x.BagNo == outOrderDetail.PLot)
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/AssignInboundTaskLocation_BC.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/AssignInboundTaskLocation_BC.cs"
index fd9691d..3b97fd6 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/AssignInboundTaskLocation_BC.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/AssignInboundTaskLocation_BC.cs"
@@ -225,7 +225,7 @@
string roadwayNo=string.Empty;
foreach (var location in locationCounts.OrderBy(x => x.Count))
{
- if (location.Count == 1)
+ if (location.Count <= 2)
continue;
roadwayNo = location?.RoadwayNo ?? "";
break;
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/MesTaskService.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/MesTaskService.cs"
index 0df30d5..1181cd4 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/MesTaskService.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/MesTaskService.cs"
@@ -77,7 +77,7 @@
(x.EnableStatus == (int)EnableStatusEnum.Normal || x.EnableStatus == (int)EnableStatusEnum.OnlyOut));
if (locationInfo == null)
{
- return responseContent.Error($"娴嬭瘯鏋惰揣浣嶃�傘�傘�傘�傘�傘�傘�傘�傘��:{stockInfo.LocationCode}鍑哄簱鏉′欢涓嶆弧瓒�");
+ return responseContent.Error($"娴嬭瘯鏋惰揣浣�:{stockInfo.LocationCode}鍑哄簱鏉′欢涓嶆弧瓒�");
}
//鐢熸垚娴嬭瘯鏋跺嚭搴撲换鍔� 閿佸畾搴撳瓨 鏇存敼璐т綅鐘舵��
Dt_Task taskOut = new()
@@ -1424,6 +1424,46 @@
return WebResponseContent.Instance.Error(ex.Message);
}
}
-
+ /// <summary>
+ /// 鑾峰彇MES闃荤剨鎵规淇℃伅
+ /// </summary>
+ /// <param name="model"></param>
+ /// <returns></returns>
+ public WebResponseContent GetZHMesMaterialLot(string materialLot)
+ {
+ WebResponseContent content = new WebResponseContent();
+ try
+ {
+ Dt_ApiInfo apiInfo = _apiInfoRepository.QueryFirst(x => x.ApiCode == APIEnum.WMS_MES_GetProductByLot.ToString());
+ object obj = new { LotNo = materialLot };
+ MESRoot<object> root = new MESRoot<object>()
+ {
+ From = "WMS",
+ DateTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"),
+ Content = obj
+ };
+ JsonSerializerSettings settings = new JsonSerializerSettings
+ {
+ ContractResolver = new CamelCasePropertyNamesContractResolver()
+ };
+ string request = JsonConvert.SerializeObject(root, settings);
+ string response = HttpMesHelper.Post(apiInfo.ApiAddress, request);
+ MesResponseContent mesResponseContent = response.DeserializeObject<MesResponseContent>();
+ //璋冪敤鎺ュ彛
+ if (mesResponseContent.BSucc == true)
+ {
+ content.OK(mesResponseContent.StrMsg, mesResponseContent.Content);
+ }
+ else
+ {
+ content.Error(mesResponseContent.StrMsg);
+ }
+ }
+ catch (Exception ex)
+ {
+ content.Error(ex.Message);
+ }
+ return content;
+ }
}
}
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 8a041a3..ac7efdb 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"
@@ -1,4 +1,5 @@
-锘縰sing OfficeOpenXml.FormulaParsing.Excel.Functions.RefAndLookup;
+锘縰sing Newtonsoft.Json;
+using OfficeOpenXml.FormulaParsing.Excel.Functions.RefAndLookup;
using System;
using System.Collections;
using System.Collections.Generic;
@@ -9,12 +10,14 @@
using WIDESEA_Common.CommonEnum;
using WIDESEA_Common.LocationEnum;
using WIDESEA_Common.OrderEnum;
+using WIDESEA_Common.OtherEnum;
using WIDESEA_Common.StockEnum;
using WIDESEA_Common.TaskEnum;
using WIDESEA_Common.WareHouseEnum;
using WIDESEA_Core;
using WIDESEA_Core.Helper;
using WIDESEA_DTO;
+using WIDESEA_DTO.MES;
using WIDESEA_DTO.Task;
using WIDESEA_Model.Models;
@@ -736,6 +739,93 @@
return WebResponseContent.Instance.Error(ex.Message);
}
}
+
+ public WebResponseContent RequestZHInboundTask(string agvTaskCode, string palletCode, string palletType, string materialLot)
+ {
+ WebResponseContent content = new WebResponseContent();
+ try
+ {
+ //鑾峰彇娴嬭瘯鏋跺師搴撳瓨淇℃伅
+ Dt_Warehouse warehouse = _basicRepository.WarehouseRepository.QueryFirst(x => x.WarehouseCode == WarehouseEnum.HA154.ToString());
+ //鑾峰彇搴撳瓨璁板綍
+ List<Dt_StockInfo> stockInfos = _stockRepository.StockInfoRepository.Db.Queryable<Dt_StockInfo>().Where(x =>
+ x.WarehouseId == warehouse.WarehouseId).Includes(x => x.Details).ToList();
+ Dt_StockInfo? stockInfoOld = stockInfos.FirstOrDefault(x => x.Details.Any(x => x.BatchNo == materialLot));
+ if (stockInfoOld != null)
+ {
+ return content.Error($"搴撳瓨淇℃伅宸插瓨鍦�");
+ }
+ Dt_PalletTypeInfo palletTypeInfo = _palletTypeInfoRepository.QueryFirst(x=>x.CodeStartStr== palletType);
+ if (palletTypeInfo != null)
+ {
+ return content.Error($"鎵樼洏绫诲瀷淇℃伅涓嶅瓨鍦�");
+ }
+ //鑾峰彇闃荤剨鎵规
+ WebResponseContent requestLotInfo = GetZHMesMaterialLot(materialLot);
+ if (!requestLotInfo.Status)
+ {
+ return content.Error($"{requestLotInfo.Message}");
+ }
+ MesLotInfoModel mesLotInfo = JsonConvert.DeserializeObject<MesLotInfoModel>(requestLotInfo.Data.ToString());
+ Dt_StockInfoDetail stockInfoDetail = new Dt_StockInfoDetail()
+ {
+ MaterielSpec = mesLotInfo.ProductVersion,
+ BatchNo = materialLot,
+ EffectiveDate = mesLotInfo.DateCode,
+ MaterielCode = mesLotInfo.Product,
+ InboundOrderRowNo = 0,
+ MaterielName = mesLotInfo.Product,
+ ProductionDate = mesLotInfo.DateCode,
+ OrderNo = "",
+ OutboundQuantity = 0,
+ SerialNumber = materialLot,
+ StockQuantity = (float)mesLotInfo.Qty,
+ Status = StockStatusEmun.鍏ュ簱纭.ObjToInt(),
+ Unit = "Lot",
+ Remark= mesLotInfo.IsFullNumber?"婊ot":"涓嶆弧Lot"
+ };
+ Dt_StockInfo stockInfo = new Dt_StockInfo()
+ {
+ PalletCode = palletCode,
+ PalletType = palletTypeInfo.PalletType,
+ WarehouseId = warehouse.WarehouseId,
+ StockStatus = StockStatusEmun.鍏ュ簱纭.ObjToInt(),
+ Details = new List<Dt_StockInfoDetail> { stockInfoDetail }
+ };
+
+ //鐢熸垚閫�搴撲换鍔�
+ Dt_Task taskIn = new()
+ {
+ CurrentAddress = "AGV_ZH",
+ Grade = 0,
+ PalletCode = palletCode,
+ NextAddress = "",
+ Roadway = "",
+ SourceAddress = "AGV_ZH",
+ TargetAddress = "",
+ TaskStatus = (int)TaskStatusEnum.New,
+ TaskType = (int)TaskTypeEnum.InZHProduct,
+ TaskNum = BaseDal.GetTaskNum(nameof(SequenceEnum.SeqTaskNum)),
+ PalletType = palletTypeInfo.PalletType,
+ WarehouseId = warehouse.WarehouseId,
+ };
+ _unitOfWorkManage.BeginTran();
+ Db.InsertNav(stockInfo).Include(x => x.Details).ExecuteCommand();
+ BaseDal.AddData(taskIn);
+ //BaseDal.AddData(task);
+ _unitOfWorkManage.CommitTran();
+ //灏嗕换鍔℃帹閫佸埌WCS
+ PushTasksToWCS(new List<Dt_Task>() { taskIn }, "AGV_ZH"); ;
+ content.OK();
+ }
+ catch (Exception ex)
+ {
+ _unitOfWorkManage.RollbackTran();
+ content.Error(ex.Message);
+ }
+ return content;
+ }
+
public readonly string[] OutStartPonits = { "5230", "5237", "5244" };
/// <summary>
/// 鎴愬搧浣欐枡閫�搴撳叆浠�
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 192ee8c..1574e33 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"
@@ -124,7 +124,7 @@
}
if (result.Item1 != null && result.Item1.Count > 0)
{
- Dt_Task? task = BaseDal.QueryData(x=>x.TaskType==TaskTypeEnum.OutProduct.ObjToInt()).OrderByDescending(x=>x.Grade).FirstOrDefault();
+ Dt_Task? task = BaseDal.QueryData(x=>x.TaskType==TaskTypeEnum.OutProduct.ObjToInt()).OrderBy(x=>x.Grade).FirstOrDefault();
//鏇存柊鍑哄簱鐩殑浣嶇疆
result.Item1.ForEach(x =>
{
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/QMS/QmsController.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/QMS/QmsController.cs"
new file mode 100644
index 0000000..4d4ba43
--- /dev/null
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/QMS/QmsController.cs"
@@ -0,0 +1,78 @@
+锘縰sing Microsoft.AspNetCore.Authorization;
+using Microsoft.AspNetCore.Http;
+using Microsoft.AspNetCore.Mvc;
+using SqlSugar;
+using WIDESEA_Common.CommonEnum;
+using WIDESEA_Common.MaterielEnum;
+using WIDESEA_Common.OrderEnum;
+using WIDESEA_Core;
+using WIDESEA_Core.Attributes;
+using WIDESEA_Core.Helper;
+using WIDESEA_DTO;
+using WIDESEA_DTO.Basic;
+using WIDESEA_DTO.ERP;
+using WIDESEA_DTO.QMS;
+using WIDESEA_External.ERPService;
+using WIDESEA_External.Model;
+using WIDESEA_External.QMSService;
+using WIDESEA_IBasicRepository;
+using WIDESEA_IBasicService;
+using WIDESEA_IInboundRepository;
+using WIDESEA_IInboundService;
+using WIDESEA_InboundService;
+using WIDESEA_IOutboundService;
+using WIDESEA_Model.Models;
+using static WIDESEA_DTO.ErpResponseContent;
+
+namespace WIDESEA_WMSServer.Controllers.QMS
+{
+ /// <summary>
+ /// ERP鎺ュ彛
+ /// </summary>
+ [Route("api/Erp")]
+ [ApiController]
+ public class QmsController : ControllerBase
+ {
+ private readonly IBasicService _basicService;
+ private readonly IOutboundService _outboundService;
+ private readonly IInboundService _inboundService;
+ private readonly IInvokeERPService _invokeERPService;
+ private readonly IReturnOrderService _returnOrderService;
+ private readonly IInvokeQMSService _invokeQMSService;
+
+ public QmsController(IBasicService basicService, IOutboundService outboundService, IInboundService inboundService,
+ IInvokeERPService invokeERPService, IReturnOrderService returnOrderService, IInvokeQMSService invokeQMSService)
+ {
+ _basicService = basicService;
+ _outboundService = outboundService;
+ _inboundService = inboundService;
+ _invokeERPService = invokeERPService;
+ _returnOrderService = returnOrderService;
+ _invokeQMSService = invokeQMSService;
+ }
+
+ ///// <summary>
+ ///// 妫�楠屽崟鍥炰紶鏇存柊
+ ///// </summary>
+ ///// <param name="model"></param>
+ ///// <returns></returns>
+ //[HttpPost, Route("CheckResultReturn"), AllowAnonymous, MethodParamsValidate]
+ //public ErpResponseContent ReceivePurchaseOrder([FromBody] Root<CheckResultDTO> model)
+ //{
+ // WebResponseContent content = _inboundService.PurchaseOrderService.ReceivePurchaseOrder(model.Content);
+ // if (content.Status) return Instance.OK();
+ // else return Instance.Error(content.Message);
+ //}
+ /// <summary>
+ /// 妫�楠屽崟鍥炰紶鏇存柊
+ /// </summary>
+ /// <param name="model"></param>
+ /// <returns></returns>
+ [HttpPost, Route("CheckResultReturn"), AllowAnonymous, MethodParamsValidate]
+ public string ReceivePurchaseOrder([FromBody] QMSReceiveCheckModel model)
+ {
+ string content = _invokeQMSService.InvokeReceiveCheckApi(model);
+ return content;
+ }
+ }
+}
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 2c768e0..fe6c647 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"
@@ -130,7 +130,10 @@
{
return Service.AssignInboundTaskLocationByHeight(taskNum, roadwayNo, heightType);
}
-
+ public WebResponseContent RequestZHInboundTask(string agvTaskCode, string palletCode, string palletType, string materialLot)
+ {
+ return Service.RequestZHInboundTask(agvTaskCode,palletCode,palletType,materialLot);
+ }
/// <summary>
/// 鍏ュ簱浠诲姟瀹屾垚
/// </summary>
@@ -260,7 +263,6 @@
{
return await Service.TaskCompleted(taskNum);
}
-
/// <summary>
/// 鍗曚釜浠诲姟鎺ㄩ�佽嚦WCS
/// </summary>
@@ -374,5 +376,13 @@
{
return Service.OutProductSelect(orderDetailId, proStockViews);
}
+ /// <summary>
+ /// 闃荤剨鎵规鐗╂枡鏌ヨ
+ /// </summary>
+ [HttpPost, Route("GetZHMesMaterialLot"), AllowAnonymous]
+ public WebResponseContent GetZHMesMaterialLot(string materialLot)
+ {
+ return Service.GetZHMesMaterialLot(materialLot);
+ }
}
}
--
Gitblit v1.9.3