From 5171d3f59b89389bf75293afd210cfa6de4ccff7 Mon Sep 17 00:00:00 2001
From: wanshenmean <cathay_xy@163.com>
Date: 星期五, 10 四月 2026 23:03:49 +0800
Subject: [PATCH] feat: 添加堆垛机相关常量类并重构代码使用常量

---
 Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Filter/CustomProfile.cs |   22 ++++++++++------------
 1 files changed, 10 insertions(+), 12 deletions(-)

diff --git a/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Filter/CustomProfile.cs b/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Filter/CustomProfile.cs
index 2f33853..dc716d8 100644
--- a/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Filter/CustomProfile.cs
+++ b/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Filter/CustomProfile.cs
@@ -1,9 +1,4 @@
-锘縰sing AutoMapper;
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
+锘縰sing Mapster;
 using WIDESEA_DTO.System;
 using WIDESEAWCS_DTO.TaskInfo;
 using WIDESEAWCS_Model.Models;
@@ -13,17 +8,20 @@
 
 namespace WIDESEAWCS_WCSServer.Filter
 {
-    public class CustomProfile : Profile
+    public static class CustomProfile
     {
         /// <summary>
         /// 閰嶇疆鏋勯�犲嚱鏁帮紝鐢ㄦ潵鍒涘缓鍏崇郴鏄犲皠
         /// </summary>
-        public CustomProfile() 
+        public static void Register(TypeAdapterConfig config)
         {
-            CreateMap<Sys_Menu, MenuDTO>();
-            CreateMap<Dt_DeviceInfo,DeviceInfoDTO>();
-            CreateMap<WMSTaskDTO, Dt_Task>();
-            CreateMap<Dt_Task, ConveyorLineTaskCommand>().ForMember(a => a.TargetAddress, b => b.MapFrom(b => b.NextAddress)).ForMember(a => a.Barcode, b => b.MapFrom(b => b.PalletCode)).ForMember(a => a.TaskNum, b => b.MapFrom(b => b.TaskNum));
+            config.NewConfig<Sys_Menu, MenuDTO>();
+            config.NewConfig<Dt_DeviceInfo, DeviceInfoDTO>();
+            config.NewConfig<WMSTaskDTO, Dt_Task>();
+            config.NewConfig<Dt_Task, ConveyorLineTaskCommand>()
+                .Map(dest => dest.TargetAddress, src => src.NextAddress)
+                .Map(dest => dest.Barcode, src => src.PalletCode)
+                .Map(dest => dest.TaskNum, src => src.TaskNum);
         }
     }
 }

--
Gitblit v1.9.3