刘磊
2024-11-23 06cbf02daf958a1f4687691e5d9d741a21a2fe53
Code Management/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/Task/Dt_TaskService.cs
@@ -12,6 +12,7 @@
using WIDESEA_StorageBasicRepository;
using WIDESEA_StorageTaskRepository;
using WIDESEA_StoragIntegrationServices;
using WIDESEAWCS_BasicInfoRepository;
namespace WIDESEA_StorageOutTaskServices;
@@ -38,6 +39,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,
@@ -59,7 +61,8 @@
                                IDt_AreaInfoRepository areaInfoRepository,
                                IAgingInOrOutInputService agingInOrOutInputService,
                                IStockInfoDetailRepository stockInfoDetailRepository,
                                IProductionRepository productionRepository) : base(BaseDal)
                                IProductionRepository productionRepository,
                                IDt_StationManagerRepository stationManagerRepository) : base(BaseDal)
    {
        _unitOfWorkManage = unitOfWorkManage;
        _outOrderRepository = outOrderRepository;
@@ -81,6 +84,7 @@
        _agingInOrOutInputService = agingInOrOutInputService;
        _stockInfoDetailRepository = stockInfoDetailRepository;
        _productionRepository = productionRepository;
        _stationManagerRepository = stationManagerRepository;
    }
    #region 外部接口方法
@@ -98,10 +102,12 @@
                //var process = await SqlSugarHelper.Db.Queryable<Dt_EquipmentProcess>()
                //    .FirstAsync(x => x.EquipmentName == task.Roadway);
                //var info = JsonConvert.DeserializeObject<ResponseEqptRunDto>(process.ProcessValue);
                var agingOutputDto = MapToAgingOutputDto(stock);
                content = await _agingInOrOutInputService.GetOCVOutputAsync(agingOutputDto);
                ValidateResponse(content);
                if (!task.Roadway.Contains("FR"))  //非分容库区均上报MOM出入站
                {
                    var agingOutputDto = MapToAgingOutputDto(stock);
                    content = await _agingInOrOutInputService.GetOCVOutputAsync(agingOutputDto);
                    ValidateResponse(content);
                }
            }
            // 更新库存状态和任务状态
@@ -434,6 +440,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);