肖洋
2025-01-09 1164314b1f0183dadf760171e5a494eda53a1c95
Code Management/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/Task/Dt_TaskService.cs
@@ -1,20 +1,14 @@
using AngleSharp.Dom;
using log4net.Core;
using Mapster;
using Mapster;
using Masuit.Tools;
using SixLabors.Fonts.Tables.AdvancedTypographic;
using System.Diagnostics;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using WIDESEA_Core.Const;
using WIDESEA_DTO.MOM;
using WIDESEA_DTO.WMS;
using WIDESEA_IServices;
using WIDESEA_IStoragIntegrationServices;
using WIDESEA_StorageBasicRepository;
using WIDESEA_StoragIntegrationServices;
using WIDESEAWCS_BasicInfoRepository;
using WIDESEAWCS_QuartzJob.Models;
namespace WIDESEA_StorageTaskServices;
@@ -204,8 +198,8 @@
                    await DeleteStockInfoAsync(stock.Id);
                    await DeleteStockInfoDetailsAsync(stock.StockInfoDetails);
                    await AddStockInfoHtyAsync(stockInfo_Hty);
                    await UpdateLocationAsync(loc); //质检任务需要持续锁定库位
                }
                await UpdateLocationAsync(loc);
                await DeleteTaskAsync(task.TaskId);
                await AddTaskHtyAsync(taskHty);
            });
@@ -264,7 +258,7 @@
                        ParameterDesc = parameterInfo.Description,
                        ParameterResult  = "OK", //isNG.ToString(),
                        TargetValue = parameterInfo.TargetValue,
                        LowerLomit = parameterInfo.LowerSpecificationsLimit,
                        LowerLimit = parameterInfo.LowerSpecificationsLimit,
                        UpperLimit = parameterInfo.UpperSpecificationsLimit,
                        DefectCode = defectCode,
                        UOMCode = parameterInfo.UOMCode,
@@ -1383,6 +1377,10 @@
            {
                return content.Error("未查询到对应的库存信息");
            }
            if (stockInfo.LocationInfo.LocationStatus != (int)LocationEnum.InStock)
            {
                return content.Error("该货位状态不等于【有货】请查看是否已经有任务!");
            }
            var task = await BaseDal.QueryFirstAsync(x => x.PalletCode == palletCode);
            if (task != null)
@@ -1403,9 +1401,12 @@
            }
            else
            {
                if (stockInfo.LocationInfo.RoadwayNo == "JZSC1")
                if (stockInfo.LocationInfo.RoadwayNo.Contains("JZSC"))
                {
                    task = CreateTask(stockInfo, "002-021-001", taskType);
                    var targetAddress = "002-021-001";
                    if (stockInfo.LocationInfo.RoadwayNo == "JZSC4")
                        targetAddress = "001-021-001";
                    task = CreateTask(stockInfo, targetAddress, taskType);
                }
            }
            //var taskId = await BaseDal.AddDataAsync(task);
@@ -1767,6 +1768,8 @@
    #endregion 外部接口方法
    #region 内部调用方法
    /// <summary>
@@ -1959,6 +1962,10 @@
        taskHty.TaskId = 0;
        taskHty.OperateType = isHand ? (int)OperateTypeEnum.人工删除 : (int)OperateTypeEnum.自动完成;
        taskHty.SourceId = task.TaskId;
        if (isHand)
        {
            taskHty.Creater = App.User.UserName != null ? App.User.UserName : "System";
        }
        taskHty.TaskState = TaskOutStatusEnum.OutFinish.ObjToInt();
        return taskHty;
    }
@@ -2410,7 +2417,7 @@
                        ParameterDesc = parameterInfo.Description,
                        ParameterResult  = "OK",
                        TargetValue = parameterInfo.TargetValue,
                        LowerLomit = parameterInfo.LowerSpecificationsLimit,
                        LowerLimit = parameterInfo.LowerSpecificationsLimit,
                        UpperLimit = parameterInfo.UpperSpecificationsLimit,
                        DefectCode = defectCode,
                    }