From 4b6e6d95ae6fbbccc4351db366b99fa05288877f Mon Sep 17 00:00:00 2001
From: zjj <3272660260@qq.com>
Date: 星期三, 11 六月 2025 10:09:38 +0800
Subject: [PATCH] #

---
 src/main/java/com/zy/asrs/entity/OrderDetl.java |  140 ++++++++++++++++++++++++++++++++++++----------
 1 files changed, 108 insertions(+), 32 deletions(-)

diff --git a/src/main/java/com/zy/asrs/entity/OrderDetl.java b/src/main/java/com/zy/asrs/entity/OrderDetl.java
index 2ab47e1..f3ae21a 100644
--- a/src/main/java/com/zy/asrs/entity/OrderDetl.java
+++ b/src/main/java/com/zy/asrs/entity/OrderDetl.java
@@ -1,22 +1,21 @@
 package com.zy.asrs.entity;
 
+import com.alibaba.excel.annotation.ExcelProperty;
 import com.baomidou.mybatisplus.annotations.TableField;
 import com.baomidou.mybatisplus.annotations.TableId;
 import com.baomidou.mybatisplus.annotations.TableName;
 import com.baomidou.mybatisplus.enums.IdType;
 import com.core.common.Cools;
 import com.core.common.SpringUtils;
-import com.core.exception.CoolException;
+import com.zy.asrs.service.LocOwnerService;
 import com.zy.asrs.service.OrderService;
+import com.zy.common.utils.Synchro;
 import com.zy.system.entity.User;
 import com.zy.system.service.UserService;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 import org.springframework.format.annotation.DateTimeFormat;
 
-import java.beans.BeanInfo;
-import java.beans.Introspector;
-import java.beans.PropertyDescriptor;
 import java.io.Serializable;
 import java.text.SimpleDateFormat;
 import java.util.Date;
@@ -46,6 +45,7 @@
      */
     @ApiModelProperty(value= "鍗曟嵁缂栧彿")
     @TableField("order_no")
+    @ExcelProperty({"鍗曟嵁", "鍗曟嵁缂栧彿"})
     private String orderNo;
 
 
@@ -53,27 +53,42 @@
      * 鏁伴噺
      */
     @ApiModelProperty(value= "鏁伴噺")
+    @ExcelProperty({"鍗曟嵁", "鏁伴噺"})
     private Double anfme;
 
     /**
      * 浣滀笟鏁伴噺
      *
-     *  1. 鍏ュ簱 : qty 馃憜
-     *  1. 鍑哄簱 : qty 馃憜
+     *  鍏ュ簱 : 缁勬墭瀹屾垚锛岀粍鎵樻。銆佸伐浣滄。銆佸叆搴撳畬鎴愭暟閲�
+     *  鍑哄簱 : 宸ヤ綔妗c�佸嚭搴撳畬鎴愭暟閲�
      */
     @ApiModelProperty(value= "浣滀笟鏁伴噺")
+    @TableField("work_qty")
+    @ExcelProperty({"鍗曟嵁", "浣滀笟鏁伴噺"})
+    private Double workQty;
+
+    /**
+     * 瀹屾垚鏁伴噺
+     *
+     *  鍏ュ簱 : qty 馃憜
+     *  鍑哄簱 : qty 馃憜
+     */
+    @ApiModelProperty(value= "瀹屾垚鏁伴噺")
+    @ExcelProperty({"鍗曟嵁", "瀹屾垚鏁伴噺"})
     private Double qty;
 
     /**
      * 鍟嗗搧缂栫爜
      */
     @ApiModelProperty(value= "鍟嗗搧缂栫爜")
+    @ExcelProperty({"鍗曟嵁", "鍟嗗搧缂栫爜"})
     private String matnr;
 
     /**
      * 鍟嗗搧鍚嶇О
      */
     @ApiModelProperty(value= "鍟嗗搧鍚嶇О")
+    @ExcelProperty({"鍗曟嵁", "鍟嗗搧鍚嶇О"})
     private String maktx;
 
     /**
@@ -86,6 +101,7 @@
      * 瑙勬牸
      */
     @ApiModelProperty(value= "瑙勬牸")
+    @ExcelProperty({"鍗曟嵁", "瑙勬牸"})
     private String specs;
 
     /**
@@ -113,9 +129,9 @@
     private String unit;
 
     /**
-     * 鍗曚环
+     * 宸蹭笂鎶ユ暟閲�
      */
-    @ApiModelProperty(value= "鍗曚环")
+    @ApiModelProperty(value= "宸蹭笂鎶ユ暟閲�")
     private Double price;
 
     /**
@@ -173,12 +189,13 @@
      * 閲嶉噺
      */
     @ApiModelProperty(value= "閲嶉噺")
+    @ExcelProperty({"鍗曟嵁", "閲嶉噺"})
     private Double weight;
 
     /**
-     * 闀垮害
+     * 宸蹭笂鎶ユ暟閲�
      */
-    @ApiModelProperty(value= "闀垮害")
+    @ApiModelProperty(value= "宸蹭笂鎶ユ暟閲�")
     private Double length;
 
     /**
@@ -208,9 +225,9 @@
     private String suppCode;
 
     /**
-     * 鏄惁鎵规 1: 鏄�  0: 鍚�
+     * 琛孖D
      */
-    @ApiModelProperty(value= "鏄惁鎵规 1: 鏄�  0: 鍚�  ")
+    @ApiModelProperty(value= "琛孖D")
     @TableField("be_batch")
     private Integer beBatch;
 
@@ -288,9 +305,73 @@
     @ApiModelProperty(value= "澶囨敞")
     private String memo;
 
+    /**
+     * 婧愪粨搴�
+     */
+    @ApiModelProperty(value= "婧愪粨搴�")
+    @TableField("source_loc_name")
+    private String sourceLocName;
+
+    /**
+     * 鐩爣浠撳簱
+     */
+    @ApiModelProperty(value= "鐩爣浠撳簱")
+    @TableField("target_loc_name")
+    private String targetLocName;
+
+    /**
+     * 鎷ユ湁鑰�
+     */
+    @ApiModelProperty(value= "鎷ユ湁鑰� 1: 鏉板厠   ")
+    @ExcelProperty({"鍗曟嵁", "璐т富ID"})
+    private Integer owner;
+
+    /**
+     * 璐х墿褰㈡��:0锛氫唬閲囥��1锛氫粨鍌�
+     */
+    @ApiModelProperty(value= "璐х墿褰㈡��:0锛氫唬閲囥��1锛氫粨鍌�")
+    @ExcelProperty({"鍗曟嵁", "璐х墿褰㈡�両D"})
+    private Integer payment;
+
+    /**
+     * uuid鏃堕棿鎴�
+     */
+    @ApiModelProperty(value= "uuid")
+    @TableId(value = "uuid", type = IdType.ID_WORKER_STR)
+    @TableField("uuid")
+    private String uuid;
+
+    public String getOwner$(){
+        LocOwnerService service = SpringUtils.getBean(LocOwnerService.class);
+        LocOwner locOwner = service.selectById(this.owner);
+        if (!Cools.isEmpty(locOwner)){
+            return String.valueOf(locOwner.getOwner());
+        }
+        return null;
+    }
+
+    public String getPayment$(){
+        if (null == this.payment){ return null; }
+        switch (this.payment){
+            case 1:
+                return "浠撳偍";
+            case 0:
+                return "浠i噰";
+            default:
+                return String.valueOf(this.payment);
+        }
+    }
+
     public OrderDetl() {}
 
-    public OrderDetl(Long orderId, String orderNo, Double anfme, Double qty, String matnr, String maktx, String batch, String specs, String model, String color, String brand, String unit, Double price, String sku, Double units, String barcode, String origin, String manu, String manuDate, String itemNum, Double safeQty, Double weight, Double length, Double volume, String threeCode, String supp, String suppCode, Integer beBatch, String deadTime, Integer deadWarn, Integer source, Integer inspect, Integer danger, Integer status, Long createBy, Date createTime, Long updateBy, Date updateTime, String memo) {
+    public OrderDetl(Long orderId, String orderNo, Double anfme, Double qty, String matnr,
+                     String maktx, String batch, String specs, String model, String color,
+                     String brand, String unit, Double price, String sku, Double units,
+                     String barcode, String origin, String manu, String manuDate, String itemNum,
+                     Double safeQty, Double weight, Double length, Double volume, String threeCode,
+                     String supp, String suppCode, Integer beBatch, String deadTime, Integer deadWarn,
+                     Integer source, Integer inspect, Integer danger, Integer status, Long createBy,
+                     Date createTime, Long updateBy, Date updateTime, String memo,int owner ,int payment,String uuid) {
         this.orderId = orderId;
         this.orderNo = orderNo;
         this.anfme = anfme;
@@ -330,6 +411,9 @@
         this.updateBy = updateBy;
         this.updateTime = updateTime;
         this.memo = memo;
+        this.owner = owner;
+        this.payment = payment;
+        this.uuid = uuid;
     }
 
     public String getOrderId$(){
@@ -419,6 +503,13 @@
         return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.createTime);
     }
 
+    public String getTime$(){
+        if (Cools.isEmpty(this.createTime)){
+            return "";
+        }
+        return new SimpleDateFormat("yyyy-MM-dd").format(this.createTime);
+    }
+
     public String getUpdateBy$(){
         UserService service = SpringUtils.getBean(UserService.class);
         User user = service.selectById(this.updateBy);
@@ -436,30 +527,15 @@
     }
 
     public Double getEnableQty() {
+
         if (null != this.anfme && this.qty != null) {
             return this.anfme - this.qty;
         }
         return null;
     }
 
-    public void sync(Object dest) {
-        try {
-            BeanInfo sourceBean = Introspector.getBeanInfo(this.getClass(),Object.class);
-            PropertyDescriptor[] sourceProperty = sourceBean.getPropertyDescriptors();
-            BeanInfo destBean = Introspector.getBeanInfo(dest.getClass(),Object.class);
-            PropertyDescriptor[] destProperty = destBean.getPropertyDescriptors();
-            for (PropertyDescriptor propertyDescriptor : sourceProperty) {
-                for (PropertyDescriptor descriptor : destProperty) {
-                    if (propertyDescriptor.getName().equals(descriptor.getName()) && propertyDescriptor.getPropertyType() == descriptor.getPropertyType()) {
-                        descriptor.getWriteMethod().invoke(dest, propertyDescriptor.getReadMethod().invoke(this));
-                        break;
-                    }
-                }
-            }
-        } catch (Exception e) {
-            throw new CoolException("灞炴�у鍒跺け璐�:" + e.getMessage());
-        }
+    public void sync(Object source) {
+        Synchro.Copy(source, this);
     }
 
-
-}
+}
\ No newline at end of file

--
Gitblit v1.9.1