肖洋
2024-12-24 e2655143a06ee42eec06a97b045f33a09fbb3a3f
Code Management/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/Task/Dt_TaskService.cs
@@ -1,5 +1,6 @@
using Mapster;
using Masuit.Tools;
using SixLabors.Fonts.Tables.AdvancedTypographic;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using WIDESEA_Core.Const;
@@ -1028,7 +1029,7 @@
        {
            // 根据托盘类型查询库存信息
            DtStockInfo stockInfo = tag == (int)TaskOutboundTypeEnum.Outbound
                ? areaCodes == null ? await QueryStockInfoForRealTrayAsync(areaCode, productionLine) : await QueryStockInfoForRealTrayCWAsync(areaCodes, productionLine)
                ? areaCode != "CWSC1" ? await QueryStockInfoForRealTrayAsync(areaCode, areaCodes, productionLine) : await QueryStockInfoForRealTrayCWAsync(areaCodes, productionLine)
                : await QueryStockInfoForEmptyTrayAsync(areaCode);
            if (stockInfo == null)
@@ -1076,7 +1077,7 @@
    /// <summary>
    /// 查询实盘库存信息
    /// </summary>
    private async Task<DtStockInfo> QueryStockInfoForRealTrayAsync(string areaCode, string productionLine)
    private async Task<DtStockInfo> QueryStockInfoForRealTrayAsync(string areaCode, List<string> devices, string productionLine)
    {
        var area = await _areaInfoRepository.QueryFirstAsync(x => x.AreaCode == areaCode);
@@ -1086,6 +1087,7 @@
            .Where(x => x.AreaCode == areaCode && x.OutboundTime < DateTime.Now && x.IsFull == true) // 过滤条件
            .WhereIF(!productionLine.IsNullOrEmpty(), x => x.ProductionLine == productionLine)
            .Where(x => x.LocationInfo.LocationStatus == (int)LocationEnum.InStock && x.LocationInfo.AreaId == area.AreaID) // 过滤条件
            .WhereIF(!devices.IsNullOrEmpty(), x => devices.Contains(x.LocationInfo.RoadwayNo))
            .OrderBy(x => x.OutboundTime) // 排序
            .FirstAsync(); // 获取第一个元素
@@ -1096,7 +1098,7 @@
    }
    /// <summary>
    /// 查询实盘库存信息
    /// 查询常温实盘库存信息
    /// </summary>
    private async Task<DtStockInfo> QueryStockInfoForRealTrayCWAsync(List<string> areaCodes, string productionLine)
    {
@@ -1145,7 +1147,7 @@
    {
        return new Dt_Task
        {
            Grade = 1,
            Grade = tag == 104 ? 2 : 1,
            Roadway = stockInfo.LocationInfo.RoadwayNo,
            TargetAddress = position,
            Dispatchertime = DateTime.Now,
@@ -1172,7 +1174,7 @@
        return new WMSTaskDTO
        {
            TaskNum = task.TaskNum.Value,
            Grade = 1,
            Grade = task.Grade.Value,
            PalletCode = task.PalletCode,
            RoadWay = task.Roadway,
            SourceAddress = task.SourceAddress,