using Autofac.Core; 
 | 
using HslCommunication; 
 | 
using HslCommunication.Core; 
 | 
using HslCommunication.WebSocket; 
 | 
using Microsoft.Extensions.Hosting; 
 | 
using Microsoft.VisualBasic.FileIO; 
 | 
using Newtonsoft.Json; 
 | 
using Quartz; 
 | 
using SixLabors.ImageSharp.PixelFormats; 
 | 
using System; 
 | 
using System.Collections.Generic; 
 | 
using System.ComponentModel; 
 | 
using System.Diagnostics.CodeAnalysis; 
 | 
using System.Linq; 
 | 
using System.Reflection; 
 | 
using System.Text; 
 | 
using System.Threading.Tasks; 
 | 
using WIDESEAWCS_Common.LocationEnum; 
 | 
using WIDESEAWCS_Common.TaskEnum; 
 | 
using WIDESEAWCS_Communicator; 
 | 
using WIDESEAWCS_Core.BaseRepository; 
 | 
using WIDESEAWCS_Core.Helper; 
 | 
using WIDESEAWCS_ISystemServices; 
 | 
using WIDESEAWCS_ITaskInfoService; 
 | 
using WIDESEAWCS_IWMSPart; 
 | 
using WIDESEAWCS_Model.Models; 
 | 
using WIDESEAWCS_QuartzJob; 
 | 
using WIDESEAWCS_QuartzJob.DeviceBase; 
 | 
using WIDESEAWCS_QuartzJob.StackerCrane.Enum; 
 | 
using WIDESEAWCS_TaskInfoService; 
 | 
using WIDESEAWCS_Tasks.OHT; 
 | 
using static System.Collections.Specialized.BitVector32; 
 | 
  
 | 
namespace WIDESEAWCS_Tasks 
 | 
{ 
 | 
    [DisallowConcurrentExecution] 
 | 
    public class GZJJob : JobBase, IJob 
 | 
    { 
 | 
        private readonly ITaskService _taskService; 
 | 
        private readonly Idt_ErrormsginfoService _ErrormsginfoService; 
 | 
        private readonly IRepository<dt_stationInfo> _dt_stationInfoRepository; 
 | 
        private readonly IRepository<Dt_Task> _dt_taskRepositiry; 
 | 
        private readonly ILocationInfoService _locationInfoService; 
 | 
        private readonly IRepository<dt_storagemode> _storagemodeRepository; 
 | 
        private readonly IRepository<dt_outstockinfo> _outStockRepository; 
 | 
        private readonly IRepository<dt_batchInfo> _batchInfoRepository; 
 | 
        private readonly IRepository<Dt_StockInfo> _StockInfoRepository; 
 | 
        private readonly IRepository<Dt_LocationInfo> _LocationInfoRepository; 
 | 
        private readonly IUnitOfWorkManage _unitOfWorkManage; 
 | 
  
 | 
        WebSocketServer _webSocketServer; 
 | 
        public GZJJob(ITaskService taskService, WebSocketServer webSocketServer, Idt_ErrormsginfoService errormsginfoService, 
 | 
            Idt_StationinfoService stationinfoService, 
 | 
            IRepository<dt_stationInfo> dt_stationInfoRepository, 
 | 
            IRepository<Dt_Task> dt_taskRepositiry, 
 | 
            ILocationInfoService locationInfoService, 
 | 
            IRepository<dt_outstockinfo> outStockRepository, 
 | 
            IRepository<dt_storagemode> storagemodeRepository, 
 | 
            IRepository<dt_batchInfo> batchInfoRepository, 
 | 
            IRepository<Dt_StockInfo> StockInfoRepository, 
 | 
            IRepository<Dt_LocationInfo> LocationInfoRepository, 
 | 
            IUnitOfWorkManage unitOfWorkManage) 
 | 
        { 
 | 
            _taskService = taskService;//注入 
 | 
            _webSocketServer = webSocketServer; 
 | 
            _ErrormsginfoService = errormsginfoService; 
 | 
            _dt_stationInfoRepository = dt_stationInfoRepository; 
 | 
            _dt_taskRepositiry = dt_taskRepositiry; 
 | 
            _locationInfoService = locationInfoService; 
 | 
            _storagemodeRepository = storagemodeRepository; 
 | 
            _outStockRepository = outStockRepository; 
 | 
            _batchInfoRepository = batchInfoRepository; 
 | 
            _StockInfoRepository = StockInfoRepository; 
 | 
            _LocationInfoRepository = LocationInfoRepository; 
 | 
            _unitOfWorkManage = unitOfWorkManage; 
 | 
        } 
 | 
  
 | 
        public Task Execute(IJobExecutionContext context) 
 | 
        { 
 | 
            
 | 
            bool flag = context.JobDetail.JobDataMap.TryGetValue("JobParams", out object? value); 
 | 
            if (flag && value != null) 
 | 
            { 
 | 
                OtherDevice device = (OtherDevice)value; 
 | 
                try 
 | 
                { 
 | 
                    #region 生成入库任务 
 | 
                    if (!OHTJob.oHTReadData.R_GZJ_isWork) 
 | 
                    { 
 | 
                        throw new Exception($"规整机投入使用信号为false"); 
 | 
                    } 
 | 
                    var Inisout = _outStockRepository.QueryFirst(v => v.Id == 1); 
 | 
                    if (Inisout.InOut==1) 
 | 
                    { 
 | 
                        Dt_Task task = new Dt_Task(); 
 | 
                        var storagemode = _storagemodeRepository.QueryFirst(v => v.Id == 1); 
 | 
                        if (OHTJob.oHTReadData.R_RGVMode && OHTJob.oHTReadData.R_DK_isready)//RGV上料模式,且东跨架子有上料信号 
 | 
                        { 
 | 
                             
 | 
                            var station = _dt_stationInfoRepository.QueryFirst(v => v.msg == "东跨架子"); 
 | 
                            task.SourceAddress = station.Row + "-" + station.Column + "-1"; 
 | 
                            var oldhtytask = _dt_taskRepositiry.QueryFirst(v => v.SourceAddress == task.SourceAddress); 
 | 
                            if (oldhtytask !=null)  
 | 
                            { 
 | 
                                task.TargetAddress = _locationInfoService.GetInLocation(storagemode.storagemode).LocationCode; 
 | 
                                task.Grade = 1; 
 | 
                                task.Remark = (int)MateTypeEnum.ZiChan; 
 | 
                                //查找相邻的库位 
 | 
                                Dt_LocationInfo Towlocation = new Dt_LocationInfo(); 
 | 
                                var Onelocation = _LocationInfoRepository.QueryFirst(v => v.LocationCode == task.TargetAddress); 
 | 
                                if (Onelocation.Depth == 1) 
 | 
                                { 
 | 
                                    Towlocation = _LocationInfoRepository.QueryFirst(v => v.Row == Onelocation.Row && v.Column == Onelocation.Column && v.Depth == 2); 
 | 
                                } 
 | 
                                else 
 | 
                                { 
 | 
                                    Towlocation = _LocationInfoRepository.QueryFirst(v => v.Row == Onelocation.Row && v.Column == Onelocation.Column && v.Depth == 1); 
 | 
                                } 
 | 
                                task.NextAddress = Towlocation.LocationCode; 
 | 
                                task.Roadway = "TC01"; 
 | 
                                task.TaskType = (int)TaskInboundTypeEnum.Inbound; 
 | 
                                task.TaskState = (int)TaskInStatusEnum.InNew; 
 | 
                                task.PalletCode = "text"; 
 | 
                                task.CurrentAddress = "text"; 
 | 
                                task.WMSId = 3; 
 | 
                                _dt_taskRepositiry.AddData(task); 
 | 
                            } 
 | 
                        } 
 | 
                        if (OHTJob.oHTReadData.R_RGVMode && OHTJob.oHTReadData.R_XK_isready)//RGV上料模式,且西跨架子有上料信号 
 | 
                        { 
 | 
                            var station = _dt_stationInfoRepository.QueryFirst(v => v.msg == "西跨架子"); 
 | 
                            task.SourceAddress = station.Row + "-" + station.Column + "-1"; 
 | 
                            var oldhtytask = _dt_taskRepositiry.QueryFirst(v => v.SourceAddress == task.SourceAddress); 
 | 
                            if (oldhtytask!=null) 
 | 
                            { 
 | 
                                task.TargetAddress = _locationInfoService.GetInLocation(storagemode.storagemode).LocationCode; 
 | 
                                var DKstation = _dt_stationInfoRepository.QueryFirst(v => v.msg == "东跨架子"); 
 | 
                                string address = DKstation.Row + "-" + DKstation.Column + "-1"; 
 | 
                                var oldtask = _dt_taskRepositiry.QueryFirst(v => v.SourceAddress == address); 
 | 
                                if (oldtask != null && oldtask.TaskState == (int)TaskInStatusEnum.InNew) 
 | 
                                { 
 | 
                                    task.Grade = 2; 
 | 
                                } 
 | 
                                else 
 | 
                                { 
 | 
                                    task.Grade = 1; 
 | 
                                } 
 | 
                                task.Remark = (int)MateTypeEnum.ZiChan; 
 | 
                                //查找相邻的库位 
 | 
                                Dt_LocationInfo Towlocation = new Dt_LocationInfo(); 
 | 
                                var Onelocation = _LocationInfoRepository.QueryFirst(v => v.LocationCode == task.TargetAddress); 
 | 
                                if (Onelocation.Depth == 1) 
 | 
                                { 
 | 
                                    Towlocation = _LocationInfoRepository.QueryFirst(v => v.Row == Onelocation.Row && v.Column == Onelocation.Column && v.Depth == 2); 
 | 
                                } 
 | 
                                else 
 | 
                                { 
 | 
                                    Towlocation = _LocationInfoRepository.QueryFirst(v => v.Row == Onelocation.Row && v.Column == Onelocation.Column && v.Depth == 1); 
 | 
                                } 
 | 
                                task.NextAddress = Towlocation.LocationCode; 
 | 
                                task.Roadway = "TC01"; 
 | 
                                task.TaskType = (int)TaskInboundTypeEnum.Inbound; 
 | 
                                task.TaskState = (int)TaskInStatusEnum.InNew; 
 | 
                                task.PalletCode = "text"; 
 | 
                                task.CurrentAddress = "text"; 
 | 
                                task.WMSId = 3; 
 | 
                                _dt_taskRepositiry.AddData(task); 
 | 
                            } 
 | 
                        } 
 | 
                        if (OHTJob.oHTReadData.R_CCMode && OHTJob.oHTReadData.R_XK_isready)//人工叉车上料模式,且西跨架子有上料信号 
 | 
                        { 
 | 
                            var station = _dt_stationInfoRepository.QueryFirst(v => v.msg == "西跨架子"); 
 | 
                            task.SourceAddress = station.Row + "-" + station.Column + "-1"; 
 | 
                            var oldhtytask = _dt_taskRepositiry.QueryFirst(v => v.SourceAddress == task.SourceAddress); 
 | 
                            if (oldhtytask!=null) 
 | 
                            { 
 | 
                                task.TargetAddress = _locationInfoService.GetInLocation(storagemode.storagemode).LocationCode; 
 | 
                                task.Grade = 1; 
 | 
                                task.Remark = (int)MateTypeEnum.WaiGou; 
 | 
                                //查找相邻的库位 
 | 
                                Dt_LocationInfo Towlocation = new Dt_LocationInfo(); 
 | 
                                var Onelocation = _LocationInfoRepository.QueryFirst(v => v.LocationCode == task.TargetAddress); 
 | 
                                if (Onelocation.Depth == 1) 
 | 
                                { 
 | 
                                    Towlocation = _LocationInfoRepository.QueryFirst(v => v.Row == Onelocation.Row && v.Column == Onelocation.Column && v.Depth == 2); 
 | 
                                } 
 | 
                                else 
 | 
                                { 
 | 
                                    Towlocation = _LocationInfoRepository.QueryFirst(v => v.Row == Onelocation.Row && v.Column == Onelocation.Column && v.Depth == 1); 
 | 
                                } 
 | 
                                task.NextAddress = Towlocation.LocationCode; 
 | 
                                task.Roadway = "TC01"; 
 | 
                                task.TaskType = (int)TaskInboundTypeEnum.Inbound; 
 | 
                                task.TaskState = (int)TaskInStatusEnum.InNew; 
 | 
                                task.PalletCode = "text"; 
 | 
                                task.CurrentAddress = "text"; 
 | 
                                task.WMSId = 3; 
 | 
                                _dt_taskRepositiry.AddData(task); 
 | 
                            } 
 | 
                        } 
 | 
                        if (OHTJob.oHTReadData.R_CCMode && OHTJob.oHTReadData.R_DK_isready)//人工叉车上料模式,且东跨架子有上料信号 
 | 
                        { 
 | 
                            var station = _dt_stationInfoRepository.QueryFirst(v => v.msg == "东跨架子"); 
 | 
                            task.SourceAddress = station.Row + "-" + station.Column + "-1"; 
 | 
                            var oldhtytask = _dt_taskRepositiry.QueryFirst(v => v.SourceAddress == task.SourceAddress); 
 | 
                            if (true) 
 | 
                            { 
 | 
                                task.TargetAddress = _locationInfoService.GetInLocation(storagemode.storagemode).LocationCode; 
 | 
                                var XKstation = _dt_stationInfoRepository.QueryFirst(v => v.msg == "西跨架子"); 
 | 
                                string address = XKstation.Row + "-" + XKstation.Column + "-1"; 
 | 
                                var oldtask = _dt_taskRepositiry.QueryFirst(v => v.SourceAddress == address); 
 | 
                                if (oldtask != null && oldtask.TaskState == (int)TaskInStatusEnum.InNew) 
 | 
                                { 
 | 
                                    task.Grade = 2; 
 | 
                                } 
 | 
                                else 
 | 
                                { 
 | 
                                    task.Grade = 1; 
 | 
                                } 
 | 
                                task.Remark = (int)MateTypeEnum.WaiGou; 
 | 
                                //查找相邻的库位 
 | 
                                Dt_LocationInfo Towlocation = new Dt_LocationInfo(); 
 | 
                                var Onelocation = _LocationInfoRepository.QueryFirst(v => v.LocationCode == task.TargetAddress); 
 | 
                                if (Onelocation.Depth == 1) 
 | 
                                { 
 | 
                                    Towlocation = _LocationInfoRepository.QueryFirst(v => v.Row == Onelocation.Row && v.Column == Onelocation.Column && v.Depth == 2); 
 | 
                                } 
 | 
                                else 
 | 
                                { 
 | 
                                    Towlocation = _LocationInfoRepository.QueryFirst(v => v.Row == Onelocation.Row && v.Column == Onelocation.Column && v.Depth == 1); 
 | 
                                } 
 | 
                                task.NextAddress = Towlocation.LocationCode; 
 | 
                                task.Roadway = "TC01"; 
 | 
                                task.TaskType = (int)TaskInboundTypeEnum.Inbound; 
 | 
                                task.TaskState = (int)TaskInStatusEnum.InNew; 
 | 
                                task.PalletCode = "text"; 
 | 
                                task.CurrentAddress = "text"; 
 | 
                                task.WMSId = 3; 
 | 
                                _dt_taskRepositiry.AddData(task); 
 | 
                            } 
 | 
                        } 
 | 
                         
 | 
                    } 
 | 
                    else if(Inisout.InOut == 2) 
 | 
                    { 
 | 
                        if (!OHTJob.oHTReadData.R_ZXJ_TCMode || !OHTJob.oHTReadData.R_HC_isReadyWork) 
 | 
                        { 
 | 
                            throw new Exception($"整形机不属于天车上料模式或天车放板信号为false"); 
 | 
                        } 
 | 
                        Dt_Task outtask = new Dt_Task(); 
 | 
                        if (OHTJob.oHTReadData.R_RGVMode && OHTJob.oHTReadData.R_DK_isready ) 
 | 
                        { 
 | 
                            var Stastation = _dt_stationInfoRepository.QueryFirst(v => v.msg == "东跨架子"); 
 | 
                            outtask.SourceAddress = Stastation.Row + "-" + Stastation.Column + "-1"; 
 | 
  
 | 
                        } 
 | 
                        else if (OHTJob.oHTReadData.R_RGVMode && OHTJob.oHTReadData.R_XK_isready) 
 | 
                        { 
 | 
                            var Stastation = _dt_stationInfoRepository.QueryFirst(v => v.msg == "西跨架子"); 
 | 
                            outtask.SourceAddress = Stastation.Row + "-" + Stastation.Column + "-1"; 
 | 
                        } 
 | 
                        else if (OHTJob.oHTReadData.R_CCMode && OHTJob.oHTReadData.R_XK_isready) 
 | 
                        { 
 | 
                            var Stastation = _dt_stationInfoRepository.QueryFirst(v => v.msg == "西跨架子"); 
 | 
                            outtask.SourceAddress = Stastation.Row + "-" + Stastation.Column + "-1"; 
 | 
                        } 
 | 
                        else if (OHTJob.oHTReadData.R_CCMode && OHTJob.oHTReadData.R_DK_isready) 
 | 
                        { 
 | 
                            var Stastation = _dt_stationInfoRepository.QueryFirst(v => v.msg == "东跨架子"); 
 | 
                            outtask.SourceAddress = Stastation.Row + "-" + Stastation.Column + "-1"; 
 | 
                        } 
 | 
                         
 | 
                        var Endstation = _dt_stationInfoRepository.QueryFirst(v => v.msg == "整形机放料位"); 
 | 
                        outtask.TargetAddress = Endstation.Row + "-" + Endstation.Column + "-1"; 
 | 
                        outtask.Grade = 1; 
 | 
                        outtask.NextAddress = Endstation.Row + "-" + Endstation.Column + "-1"; 
 | 
                        outtask.Roadway = "TC01"; 
 | 
                        outtask.TaskType = (int)TaskOutboundTypeEnum.OutInventory; 
 | 
                        outtask.TaskState = (int)TaskOutStatusEnum.OutNew; 
 | 
                        outtask.WMSId = 3; 
 | 
                        outtask.PalletCode = "text"; 
 | 
                        outtask.CurrentAddress = "text"; 
 | 
                        var oldtask = _dt_taskRepositiry.QueryFirst(v => v.SourceAddress == outtask.SourceAddress &&v.TargetAddress== outtask.SourceAddress); 
 | 
                        if (oldtask == null)  
 | 
                        { 
 | 
                            _dt_taskRepositiry.AddData(outtask); 
 | 
                        } 
 | 
                    } 
 | 
                    #endregion 
 | 
                } 
 | 
                catch (Exception ex) 
 | 
                { 
 | 
                    _ErrormsginfoService.UpdateErrorMsg(ex.Message, 2); 
 | 
                } 
 | 
  
 | 
                try 
 | 
                { 
 | 
                    #region 生成出库任务 
 | 
                    if (!OHTJob.oHTReadData.R_ZXJ_isWork) 
 | 
                    { 
 | 
                        throw new Exception($"整形机投入使用信号为false"); 
 | 
                    } 
 | 
                    var isout = _outStockRepository.QueryFirst(v => v.Id == 1); 
 | 
                    if (isout.isout == 1) 
 | 
                    { 
 | 
                        if (!OHTJob.oHTReadData.R_ZXJ_TCMode || !OHTJob.oHTReadData.R_HC_isReadyWork) 
 | 
                        { 
 | 
                            throw new Exception($"整形机不属于天车上料模式或天车放板信号为false"); 
 | 
                        } 
 | 
                        //查询当前任务池中是否存在出库任务,出库任务只能存在一条 
 | 
                        var oldtask = _dt_taskRepositiry.QueryFirst(v => v.TaskType == (int)TaskOutboundTypeEnum.Outbound); 
 | 
                        if (oldtask != null) 
 | 
                        { 
 | 
                            throw new Exception($"当前任务池中已存在一条出库任务"); 
 | 
                        } 
 | 
                        //查询当前需要出库的批次号,以及出库物料类型 
 | 
                        var batch = _batchInfoRepository.QueryFirst(v => v.Id == 1); 
 | 
                        //查询库存物料库存信息 
 | 
                        var stocks = _StockInfoRepository.QueryData(v => v.Remark == batch.materType && v.BatchNo == batch.OutBatch && v.StockStatus == 0) 
 | 
                            .OrderBy(v => v.CreateDate).ToList(); 
 | 
                        if (stocks.Count <= 0) 
 | 
                        { 
 | 
                            throw new Exception($"当前库存中没有【{batch.materType}】(0自产 1外购)且批次为【{batch.OutBatch}】的物料"); 
 | 
                        } 
 | 
                        //查询货位 
 | 
                        var locaOne = _LocationInfoRepository.QueryFirst(v => v.LocationCode == stocks[0].LocationCode); 
 | 
                        //查询相邻的货位 
 | 
                        Dt_LocationInfo locaTow = new Dt_LocationInfo(); 
 | 
                        if (locaOne.Depth == 1) 
 | 
                        { 
 | 
                            locaTow = _LocationInfoRepository.QueryFirst(v => v.Row == locaOne.Row && v.Column == locaOne.Column && v.Depth == 2); 
 | 
                        } 
 | 
                        else 
 | 
                        { 
 | 
                            locaTow = _LocationInfoRepository.QueryFirst(v => v.Row == locaOne.Row && v.Column == locaOne.Column && v.Depth == 1); 
 | 
                        } 
 | 
                        locaOne.LocationStatus = (int)LocationStatusEnum.Lock; 
 | 
                        locaTow.LocationStatus = (int)LocationStatusEnum.Lock; 
 | 
                        //查询相邻的库存 
 | 
                        var BBstock = _StockInfoRepository.QueryFirst(v => v.LocationCode == locaTow.LocationCode); 
 | 
                        BBstock.StockStatus = 1; 
 | 
                        stocks[0].StockStatus = 1; 
 | 
                        //查询终点站台信息 
 | 
                        var station = _dt_stationInfoRepository.QueryFirst(v => v.msg == "整形机放料位"); 
 | 
                        //开始创建任务 
 | 
                        Dt_Task outtask = new Dt_Task(); 
 | 
                        outtask.Roadway = "TC01"; 
 | 
                        outtask.TaskType = (int)TaskOutboundTypeEnum.Outbound; 
 | 
                        outtask.TaskState = (int)TaskOutStatusEnum.OutNew; 
 | 
                        outtask.SourceAddress = stocks[0].LocationCode; 
 | 
                        outtask.TargetAddress = station.Row + "-" + station.Column + "-1"; 
 | 
                        outtask.NextAddress = locaTow.LocationCode; 
 | 
                        outtask.Grade = 1; 
 | 
                        outtask.WMSId = 3; 
 | 
                        outtask.Remark = batch.materType; 
 | 
                        outtask.PalletCode = "text"; 
 | 
                        outtask.CurrentAddress = "text"; 
 | 
  
 | 
                        _unitOfWorkManage.BeginTran(); 
 | 
                        _LocationInfoRepository.UpdateData(locaOne); 
 | 
                        _LocationInfoRepository.UpdateData(locaTow); 
 | 
                        _StockInfoRepository.UpdateData(BBstock); 
 | 
                        _dt_taskRepositiry.AddData(outtask); 
 | 
                        _StockInfoRepository.UpdateData(stocks[0]); 
 | 
                        _unitOfWorkManage.CommitTran(); 
 | 
                    } 
 | 
                     
 | 
                    #endregion 
 | 
                } 
 | 
                catch (Exception ex) 
 | 
                { 
 | 
                    _unitOfWorkManage.RollbackTran(); 
 | 
                    _ErrormsginfoService.UpdateErrorMsg(ex.Message, 3); 
 | 
                } 
 | 
  
 | 
                 
 | 
                try 
 | 
                { 
 | 
                    #region 生成天车移动任务 
 | 
                    if (!OHTJob.oHTReadData.R_ZXJ_isWork || !OHTJob.oHTReadData.R_HC_isReady) 
 | 
                    { 
 | 
                        throw new Exception($"整形机投入使用信号为false或者行车可准备取板为false"); 
 | 
                    } 
 | 
                    //查询当前需要出库的批次号,以及出库物料类型 
 | 
                    var batch = _batchInfoRepository.QueryFirst(v => v.Id == 1); 
 | 
                    //查询库存物料库存信息 
 | 
                    var stocks = _StockInfoRepository.QueryData(v => v.Remark == batch.materType && v.BatchNo == batch.OutBatch && v.StockStatus == 0) 
 | 
                        .OrderBy(v => v.CreateDate).ToList(); 
 | 
                     
 | 
                    //开始创建任务 
 | 
                    Dt_Task outtask = new Dt_Task(); 
 | 
                    outtask.Roadway = "TC01"; 
 | 
                    outtask.TaskType = (int)TaskMoveEnum.Mowe; 
 | 
                    outtask.TaskState = (int)TaskMoveStatusEnum.OutNewMove; 
 | 
                    outtask.SourceAddress = "text"; 
 | 
                    outtask.TargetAddress = stocks[0].LocationCode; 
 | 
                    outtask.NextAddress = "text"; 
 | 
                    outtask.Grade = 1; 
 | 
                    outtask.WMSId = 3; 
 | 
                    outtask.Remark = batch.materType; 
 | 
                    outtask.PalletCode = "text"; 
 | 
                    outtask.CurrentAddress = "text"; 
 | 
                    _dt_taskRepositiry.AddData(outtask); 
 | 
                    #endregion 
 | 
                } 
 | 
                catch (Exception ex) 
 | 
                { 
 | 
                    _ErrormsginfoService.UpdateErrorMsg(ex.Message, 4); 
 | 
                } 
 | 
            } 
 | 
            return Task.CompletedTask; 
 | 
        } 
 | 
    } 
 | 
} 
 |