刘磊
2024-11-23 222d2040c2a5e958b5fbd0b7047a8e802ec14288
Code Management/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/Task/Dt_TaskService.cs
@@ -10,6 +10,7 @@
using WIDESEA_StorageBasicRepository;
using WIDESEA_StorageTaskRepository;
using WIDESEA_StoragIntegrationServices;
using WIDESEAWCS_BasicInfoRepository;
namespace WIDESEA_StorageOutTaskServices;
@@ -36,6 +37,7 @@
    private readonly IDt_AreaInfoRepository _areaInfoRepository; //区域
    private readonly IAgingInOrOutInputService _agingInOrOutInputService; //静置\陈化
    private readonly IProductionRepository _productionRepository; //生产
    private readonly IDt_StationManagerRepository _stationManagerRepository;
    public Dt_TaskService(IDt_TaskRepository BaseDal,
                                IUnitOfWorkManage unitOfWorkManage,
@@ -57,7 +59,8 @@
                                IDt_AreaInfoRepository areaInfoRepository,
                                IAgingInOrOutInputService agingInOrOutInputService,
                                IStockInfoDetailRepository stockInfoDetailRepository,
                                IProductionRepository productionRepository) : base(BaseDal)
                                IProductionRepository productionRepository,
                                IDt_StationManagerRepository stationManagerRepository) : base(BaseDal)
    {
        _unitOfWorkManage = unitOfWorkManage;
        _outOrderRepository = outOrderRepository;
@@ -79,6 +82,7 @@
        _agingInOrOutInputService = agingInOrOutInputService;
        _stockInfoDetailRepository = stockInfoDetailRepository;
        _productionRepository = productionRepository;
        _stationManagerRepository = stationManagerRepository;
    }
    #region 外部接口方法
@@ -96,10 +100,12 @@
                //var process = await SqlSugarHelper.Db.Queryable<Dt_EquipmentProcess>()
                //    .FirstAsync(x => x.EquipmentName == task.Roadway);
                //var info = JsonConvert.DeserializeObject<ResponseEqptRunDto>(process.ProcessValue);
                if (!task.Roadway.Contains("FR"))  //非分容库区均上报MOM出入站
                {
                var agingOutputDto = MapToAgingOutputDto(stock);
                content = await _agingInOrOutInputService.GetOCVOutputAsync(agingOutputDto);
                ValidateResponse(content);
                }
            }
            // 更新库存状态和任务状态
@@ -352,7 +358,8 @@
            LocationId = loation.Id,
            StockInfoDetails = boxDetail,
        };
        if (!task.Roadway.Contains("FR")) //非分容库区均上报MOM出入站
        {
        // 处理请求参数
        AgingInputDto agingInputDto = new AgingInputDto()
        {
@@ -371,7 +378,7 @@
        //2024年11月16日:新增字段计算应出库时间
        stock.OutboundTime = Convert.ToDateTime(respone.LinedProcessFeedbackTime).AddHours(Convert.ToDouble(respone.SpecialParameterDuration));
        stock.ProductionLine = respone.ProductionLine;
        }
        // 记录日志
        LogFactory.GetLog("任务完成").InfoFormat(true, "入库任务完成", $"货位地址:{task.TargetAddress},修改后货位数据:{locationInf}");
@@ -403,6 +410,11 @@
        }
        LogFactory.GetLog("任务完成").InfoFormat(true, "验证任务是否存在", JsonConvert.SerializeObject(task));
        if(task.TaskType == (int)TaskOutboundTypeEnum.InToOut)
        {
           return await CompleteInToOutTaskAsync(task);
        }
        // 验证库存是否存在
        var stock = await _stockInfoRepository.QueryFirstNavAsync(x => x.PalletCode == task.PalletCode);