From 0b2869539598059704e1d208e2bcb18603b0fe0f Mon Sep 17 00:00:00 2001
From: wanshenmean <cathay_xy@163.com>
Date: 星期五, 01 五月 2026 00:00:30 +0800
Subject: [PATCH] feat(出库时效): 添加出库时效配置功能
---
Code/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService.cs | 33 +++++++++++++++++++++++++--------
1 files changed, 25 insertions(+), 8 deletions(-)
diff --git a/Code/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService.cs b/Code/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService.cs
index e06a6cf..2367be1 100644
--- a/Code/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService.cs
+++ b/Code/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService.cs
@@ -4,10 +4,12 @@
using SqlSugar;
using System.DirectoryServices.Protocols;
using System.Text.Json;
+using WIDESEA_Common.Constants;
using WIDESEA_Common.LocationEnum;
using WIDESEA_Common.StockEnum;
using WIDESEA_Common.TaskEnum;
using WIDESEA_Common.WareHouseEnum;
+using Microsoft.Extensions.Options;
using WIDESEA_Core;
using WIDESEA_Core.BaseRepository;
using WIDESEA_Core.BaseServices;
@@ -16,7 +18,6 @@
using WIDESEA_Core.Helper;
using WIDESEA_DTO.GradingMachine;
using WIDESEA_DTO.MES;
-using WIDESEA_DTO.Stock;
using WIDESEA_DTO.Task;
using WIDESEA_IBasicService;
using WIDESEA_IRecordService;
@@ -39,6 +40,11 @@
private readonly IStockInfo_HtyService _stockInfo_HtyService;
private readonly IUnitOfWorkManage _unitOfWorkManage;
private readonly IRecordService _recordService;
+ private readonly IMESDeviceConfigService _mesDeviceConfigService;
+ private readonly IMesLogService _mesLogService;
+ private readonly IMesUploadHelper _mesUploadHelper;
+ private readonly ISqlSugarClient _sqlSugarClient;
+ private readonly IOptionsMonitor<OutboundTimeConfigOptions> _outboundTimeOptions;
public IRepository<Dt_Task> Repository => BaseDal;
@@ -63,7 +69,12 @@
ITask_HtyService task_HtyService,
IStockInfo_HtyService stockInfo_HtyService,
IUnitOfWorkManage unitOfWorkManage,
- IRecordService recordService) : base(BaseDal)
+ IRecordService recordService,
+ IMESDeviceConfigService mesDeviceConfigService,
+ IMesLogService mesLogService,
+ IMesUploadHelper mesUploadHelper,
+ ISqlSugarClient sqlSugarClient,
+ IOptionsMonitor<OutboundTimeConfigOptions> outboundTimeOptions) : base(BaseDal)
{
_mapper = mapper;
_stockInfoService = stockInfoService;
@@ -76,6 +87,11 @@
_stockInfo_HtyService = stockInfo_HtyService;
_unitOfWorkManage = unitOfWorkManage;
_recordService = recordService;
+ _mesDeviceConfigService = mesDeviceConfigService;
+ _mesLogService = mesLogService;
+ _mesUploadHelper = mesUploadHelper;
+ _sqlSugarClient = sqlSugarClient;
+ _outboundTimeOptions = outboundTimeOptions;
}
/// <summary>
@@ -146,7 +162,7 @@
private string DetermineTargetAddress(string roadway, Dictionary<string, List<string>> addressMap)
{
if (string.IsNullOrWhiteSpace(roadway))
- return "10080";
+ return TaskAddressConstants.DEFAULT_ADDRESS;
string? matchedPrefix = null;
foreach (var kvp in addressMap)
@@ -159,10 +175,10 @@
}
if (matchedPrefix == null)
- return "10080";
+ return TaskAddressConstants.DEFAULT_ADDRESS;
if (!addressMap.TryGetValue(matchedPrefix, out var addresses) || addresses == null || addresses.Count == 0)
- return "10080";
+ return TaskAddressConstants.DEFAULT_ADDRESS;
if (addresses.Count == 1)
return addresses[0];
@@ -180,9 +196,9 @@
{
return remark switch
{
- "GW_1" => _roundRobinService.GetNextAddress("GW_1", new List<string> { "11001", "11010" }),
- "GW_2" => "CWSC1",
- "CW_1" => "22001",
+ StockRemarkConstants.GW1 => _roundRobinService.GetNextAddress(StockRemarkConstants.GW1, TaskAddressConstants.GW1_ADDRESSES.ToList()),
+ StockRemarkConstants.GW2 => TaskAddressConstants.GW2_ADDRESS,
+ StockRemarkConstants.CW1 => TaskAddressConstants.CW1_ADDRESS,
_ => DetermineTargetAddress(roadway, addressMap)
};
}
@@ -190,5 +206,6 @@
// Remark 涓虹┖鏃讹紝鍥為��鍒板贩閬撻厤缃�
return DetermineTargetAddress(roadway, addressMap);
}
+
}
}
\ No newline at end of file
--
Gitblit v1.9.3