From 3e778155459a2d5a2f0214f57ff83c3760ed8381 Mon Sep 17 00:00:00 2001
From: dengjunjie <dengjunjie@hnkhzn.com>
Date: 星期一, 10 二月 2025 14:36:43 +0800
Subject: [PATCH] 添加WMSapi接口调用接口日志记录、添加WMSswagger访问接口账号密码、添加WMS到期时间6-30

---
 项目代码/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ProductionLineJob/CommonProductionLineJob.cs |   45 ++++++++++++++++++++++++++++++++++-----------
 1 files changed, 34 insertions(+), 11 deletions(-)

diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ProductionLineJob/CommonProductionLineJob.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ProductionLineJob/CommonProductionLineJob.cs"
index f656c2f..5bcb690 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ProductionLineJob/CommonProductionLineJob.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ProductionLineJob/CommonProductionLineJob.cs"
@@ -1,45 +1,68 @@
-锘縰sing AutoMapper;
-using Quartz;
+锘縰sing Quartz;
 using System;
 using System.Collections.Generic;
 using System.Linq;
 using System.Text;
 using System.Threading.Tasks;
+using WIDESEAWCS_DTO.WMSInfo;
+using WIDESEAWCS_ITaskInfoRepository;
 using WIDESEAWCS_ITaskInfoService;
 using WIDESEAWCS_QuartzJob;
 using WIDESEAWCS_QuartzJob.Service;
+using WIDESEAWCS_Tasks.ProductionLineJob;
+using WIDESEAWCS_Tasks.StackerCraneJob;
+using static System.Collections.Specialized.BitVector32;
 
 namespace WIDESEAWCS_Tasks
 {
     [DisallowConcurrentExecution]
-    public class CommonProductionLineJob : JobBase, IJob
+    public partial class CommonProductionLineJob : JobBase, IJob
     {
         private readonly ITaskService _taskService;
         private readonly ITaskExecuteDetailService _taskExecuteDetailService;
+        private readonly ITaskRepository _taskRepository;
         private readonly IRouterService _routerService;
-        private readonly IMapper _mapper;
 
-        public CommonProductionLineJob(ITaskService taskService, ITaskExecuteDetailService taskExecuteDetailService, IRouterService routerService, IMapper mapper)
+        public CommonProductionLineJob(ITaskService taskService, ITaskExecuteDetailService taskExecuteDetailService, ITaskRepository taskRepository, IRouterService routerService)
         {
             _taskService = taskService;
             _taskExecuteDetailService = taskExecuteDetailService;
+            _taskRepository = taskRepository;
             _routerService = routerService;
-            _mapper = mapper;
         }
         public Task Execute(IJobExecutionContext context)
         {
             try
             {
-                CommonConveyorLine conveyorLine = (CommonConveyorLine)context.JobDetail.JobDataMap.Get("JobParams");
-                if (conveyorLine != null)
+                OtherDevice ProductionLine = (OtherDevice)context.JobDetail.JobDataMap.Get("JobParams");
+                short[] shorts = { 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4 };
+                ProductionLineDTO MaterielGroupDTO = new ProductionLineDTO()
                 {
-                    Console.Out.WriteLine(nameof(CommonProductionLineJob) + ":" + DateTime.Now);
-
+                    Barcode = "A1001",
+                    batchNo = "20241212001T1",
+                    stationCode = "Z1",
+                    productQty = string.Join(",", shorts),
+                    traytype = 4
+                };
+                ProductionLineToWMSRequest(MaterielGroupDTO);
+                if (ProductionLine != null)
+                {
+                    switch (ProductionLine.DeviceName)
+                    {
+                        case "鍏ュ簱浜х嚎":
+                            ProductionLineIn(ProductionLine);
+                            break;
+                        case "鍑哄簱浜х嚎":
+                            ProductionLineOut(ProductionLine);
+                            break;
+                        default:
+                            throw new Exception("鏈畾涔変骇绾�");
+                    }
                 }
             }
             catch (Exception ex)
             {
-                Console.Out.WriteLine(nameof(CommonConveyorLineJob) + ":" + ex.ToString());
+                Console.Out.WriteLine(nameof(CommonProductionLineJob) + ":" + ex.ToString());
             }
             return Task.CompletedTask;
         }

--
Gitblit v1.9.3