yanjinhui
4 天以前 79cea1bc2685b73f2f6a29379f37580ca1a38c79
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/TSJJob.cs
@@ -14,6 +14,7 @@
using System.Text;
using System.Threading.Tasks;
using WIDESEAWCS_Common;
using WIDESEAWCS_Common.LocationEnum;
using WIDESEAWCS_Common.TaskEnum;
using WIDESEAWCS_Communicator;
using WIDESEAWCS_Core.Helper;
@@ -33,10 +34,13 @@
    {
        private readonly ITaskService _taskService;
        private readonly IStationMangerService _stationMangerService;
        public TSJJob(ITaskService taskService, IStationMangerService stationMangerService)
        private readonly IStationInfoService _stationInfoService;
        public TSJJob(ITaskService taskService, IStationMangerService stationMangerService, IStationInfoService stationInfoService)
        {
            _taskService = taskService;//注入
            _stationMangerService = stationMangerService;
            _stationInfoService = stationInfoService;
        }
        public Task Execute(IJobExecutionContext context)
@@ -207,10 +211,19 @@
                                }
                                else
                                {
                                    RK3FTask.CurrentAddress = RK3FTask.TargetAddress;
                                    if (!string.IsNullOrEmpty(Verification.Message)) RK3FTask.TargetAddress = Verification.Message;
                                    //如果料箱检验成功就写入读码器的值
                                    var result = _taskService.Hikvisiontaskscontinue(RK3FTask.WMSTaskNum, RK3FTask.TargetAddress);
                                    //如果质检通过就不改变RK3FTask.TargetAddress的值,
                                    if (!string.IsNullOrEmpty(Verification.Message))
                                    {
                                        //寻找平库货位
                                        var Location = _stationInfoService.Repository.QueryFirst(x=>x.StationRegion==Verification.Message.ObjToInt()&&x.StationStatus==(int)LocationStatusEnum.Free&&x.FloorNumber=="CC"&&x.IsOccupied==(int)LocationStatusEnum.Free);
                                        RK3FTask.NextAddress = Location.StationCode;
                                        RK3FTask.TargetAddress = Location.StationCode;
                                        RK3FTask.CurrentAddress = RK3FTask.TargetAddress;
                                        _taskService.UpdateData(RK3FTask);
                                    }
                                        //调用海康进行执行完成接口
                                        var result = _taskService.Hikvisiontaskscontinue(RK3FTask.WMSTaskNum, RK3FTask.NextAddress);
                                    if (result.Status)
                                    {
                                        RK3FTask.ExceptionMessage = "";