From a1a7c03eae40f4b0344fce652e1a240cf5283624 Mon Sep 17 00:00:00 2001
From: Junjie <540245094@qq.com>
Date: 星期五, 13 九月 2024 16:37:42 +0800
Subject: [PATCH] #合并订单出库,统一转波次出库前最新代码

---
 zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/entity/TaskDetlLog.java |   82 ++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 80 insertions(+), 2 deletions(-)

diff --git a/zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/entity/TaskDetlLog.java b/zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/entity/TaskDetlLog.java
index fd97a50..b1c0a87 100644
--- a/zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/entity/TaskDetlLog.java
+++ b/zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/entity/TaskDetlLog.java
@@ -1,9 +1,13 @@
 package com.zy.asrs.wms.asrs.entity;
 
 import com.baomidou.mybatisplus.annotation.TableLogic;
-import java.text.SimpleDateFormat;
-import java.util.Date;
 
+import java.lang.reflect.Field;
+import java.text.SimpleDateFormat;
+import java.util.*;
+
+import com.fasterxml.jackson.annotation.JsonAnyGetter;
+import com.zy.asrs.common.utils.Synchro;
 import com.zy.asrs.wms.asrs.service.MatService;
 import com.zy.asrs.wms.asrs.service.OrderDetlLogService;
 import com.zy.asrs.wms.asrs.service.OrderLogService;
@@ -233,6 +237,24 @@
         return null;
     }
 
+    public Mat getMat$(){
+        MatService service = SpringUtils.getBean(MatService.class);
+        Mat mat = service.getById(this.matId);
+        if (!Cools.isEmpty(mat)){
+            return mat;
+        }
+        return null;
+    }
+
+    public TaskLog getTask$(){
+        TaskLogService service = SpringUtils.getBean(TaskLogService.class);
+        TaskLog taskLog = service.getById(this.getTaskId());
+        if (!Cools.isEmpty(taskLog)){
+            return taskLog;
+        }
+        return null;
+    }
+
     public String getHostId$(){
         HostService service = SpringUtils.getBean(HostService.class);
         Host host = service.getById(this.hostId);
@@ -298,5 +320,61 @@
         return null;
     }
 
+    public void sync(Object source) {
+        Synchro.Copy(source, this);
+    }
+
+    //鍔ㄦ�佹墿灞曞瓧娈�
+    public transient Map<String, Object> dynamicFields = new HashMap<>();
+
+    @JsonAnyGetter
+    public Map<String,Object> getDynamicFields() {
+        return dynamicFields;
+    }
+
+    public void syncField(List<TaskDetlFieldLog> list) {
+        ArrayList<String> keys = new ArrayList<>();
+        Field[] fields = this.getClass().getFields();
+        for (Field field : fields) {
+            keys.add(field.getName());
+        }
+
+        Map<String, Object> dynamicFields = new HashMap<>();
+        for (TaskDetlFieldLog taskDetlFieldLog : list) {
+            if (keys.contains(taskDetlFieldLog.getName())) {
+                continue;
+            }
+            dynamicFields.put(taskDetlFieldLog.getName(), taskDetlFieldLog.getValue());
+        }
+
+        this.dynamicFields = dynamicFields;
+    }
+
+    public void syncFieldMap(Map<String, Object> map) {
+        ArrayList<String> keys = new ArrayList<>();
+        Field[] fields = this.getClass().getDeclaredFields();
+        for (Field field : fields) {
+            keys.add(field.getName());
+        }
+        keys.add("detlId");
+
+        Map<String, Object> dynamicFields = new HashMap<>();
+        for (Map.Entry<String, Object> entry : map.entrySet()) {
+            if (keys.contains(entry.getKey())) {
+                continue;
+            }
+            dynamicFields.put(entry.getKey(), entry.getValue());
+        }
+
+        this.dynamicFields = dynamicFields;
+    }
+
+    public String getFieldString(String key) {
+        return dynamicFields.get(key).toString();
+    }
+
+    public void setField(String key, Object value) {
+        dynamicFields.put(key, value);
+    }
 
 }

--
Gitblit v1.9.1