wanshenmean
2025-04-15 21cd52c5592aad3687be74599a932012d9dd77a4
´úÂë¹ÜÀí/NEWCode/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob/CommonConveyorLineJob.cs
@@ -53,8 +53,6 @@
        public Task Execute(IJobExecutionContext context)
        {
            try
            {
@@ -131,7 +129,7 @@
                }
                // åˆ›å»ºå¹¶æ·»åŠ æ–°ä»»åŠ¡åˆ°ä»»åŠ¡ä»“åº“
                task = CreateTask(fromAdd, czTask.TaskEndAddress, czTask.TaskOrderNo, czTask.TaskProductCode, taskType);
                task = CreateTask(fromAdd, czTask.TaskEndAddress, czTask.TaskOrderNo, czTask.TaskProductCode, taskType, czTask.Id);
                _taskRepository.AddData(task);
                ConsoleHelper.WriteInfoLine($"{nameof(CommonConveyorLineJob)}: {taskType}{requestType},任务已生成,等待执行......");
            }
@@ -148,7 +146,7 @@
                }
                string fromAdd = request.Value;
                string taskType = request.Value.Contains("ZJXL") ? "正极" : "负极";
                string taskType = "负极"; //request.Value.Contains("ZJXL") ? "正极" :
                // æ ¹æ®ä»»åŠ¡ç±»åž‹ç¡®å®šè¯·æ±‚åœ°å€
                (string upRequest, string gmRequest, string gmState) = GetRequestAddresses(taskType);
@@ -191,8 +189,13 @@
        }
        // è¾…助方法:创建任务对象
        private Dt_Task CreateTask(string currentAddress, string targetAddress, string remark, string palletCode, string taskType)
        private Dt_Task CreateTask(string currentAddress, string targetAddress, string remark, string palletCode, string taskType, int czTaskID = 0)
        {
            Dt_Task dt_Task = _taskRepository.QueryFirst(x => x.SourceAddress == currentAddress);
            if (dt_Task != null)
            {
                return null;
            }
            return new Dt_Task
            {
                TaskNum = _taskService.GetTaskNum(),
@@ -208,7 +211,7 @@
                NextAddress = targetAddress,
                Barcode = "",
                Roadway = $"{taskType}AGV",
                WMSId = 0,
                WMSId = czTaskID > 0 ? czTaskID : 0,
                Remark = remark
            };
        }