From 77b8a87b6f2d39c38db276e42e030362b9df4000 Mon Sep 17 00:00:00 2001
From: zjj <3272660260@qq.com>
Date: 星期四, 14 九月 2023 13:00:13 +0800
Subject: [PATCH] #上架时判断小数给price字段插入1,不是小数插入2,订单出库优先出小数

---
 src/main/java/com/zy/asrs/entity/OrderDetl.java |  338 +++++++++++++++++++++++++++++++++++++++++++++++---------
 1 files changed, 283 insertions(+), 55 deletions(-)

diff --git a/src/main/java/com/zy/asrs/entity/OrderDetl.java b/src/main/java/com/zy/asrs/entity/OrderDetl.java
index ebfe9c2..9dcc5aa 100644
--- a/src/main/java/com/zy/asrs/entity/OrderDetl.java
+++ b/src/main/java/com/zy/asrs/entity/OrderDetl.java
@@ -1,12 +1,15 @@
 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.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;
@@ -42,6 +45,7 @@
      */
     @ApiModelProperty(value= "鍗曟嵁缂栧彿")
     @TableField("order_no")
+    @ExcelProperty({"鍗曟嵁", "鍗曟嵁缂栧彿"})
     private String orderNo;
 
 
@@ -49,36 +53,55 @@
      * 鏁伴噺
      */
     @ApiModelProperty(value= "鏁伴噺")
+    @ExcelProperty({"鍗曟嵁", "鏁伴噺"})
     private Double anfme;
 
     /**
      * 浣滀笟鏁伴噺
+     *
+     *  鍏ュ簱 : 缁勬墭瀹屾垚锛岀粍鎵樻。銆佸伐浣滄。銆佸叆搴撳畬鎴愭暟閲�
+     *  鍑哄簱 : 宸ヤ綔妗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;
 
     /**
-     * 鍚嶇О
+     * 鎵瑰彿
      */
-    @ApiModelProperty(value= "鍚嶇О")
-    private String name;
+    @ApiModelProperty(value= "鎵瑰彿")
+    private String batch;
 
     /**
      * 瑙勬牸
      */
     @ApiModelProperty(value= "瑙勬牸")
+    @ExcelProperty({"鍗曟嵁", "瑙勬牸"})
     private String specs;
 
     /**
@@ -88,10 +111,16 @@
     private String model;
 
     /**
-     * 鎵瑰彿
+     * 棰滆壊
      */
-    @ApiModelProperty(value= "鎵瑰彿")
-    private String batch;
+    @ApiModelProperty(value= "棰滆壊")
+    private String color;
+
+    /**
+     * 鍝佺墝
+     */
+    @ApiModelProperty(value= "鍝佺墝")
+    private String brand;
 
     /**
      * 鍗曚綅
@@ -100,42 +129,139 @@
     private String unit;
 
     /**
-     * 鍟嗗搧鏉$爜
-     */
-    @ApiModelProperty(value= "鍟嗗搧鏉$爜")
-    private String barcode;
-
-    /**
-     * 渚涘簲鍟�
-     */
-    @ApiModelProperty(value= "渚涘簲鍟�")
-    private String supplier;
-
-    /**
      * 鍗曚环
      */
     @ApiModelProperty(value= "鍗曚环")
-    @TableField("unit_price")
-    private Double unitPrice;
+    private Double price;
+
+    /**
+     * sku
+     */
+    @ApiModelProperty(value= "sku")
+    private String sku;
+
+    /**
+     * 鍗曚綅閲�
+     */
+    @ApiModelProperty(value= "鍗曚綅閲�")
+    private Double units;
+
+    /**
+     * 鏉$爜
+     */
+    @ApiModelProperty(value= "鏉$爜")
+    private String barcode;
+
+    /**
+     * 浜у湴
+     */
+    @ApiModelProperty(value= "浜у湴")
+    private String origin;
+
+    /**
+     * 鍘傚
+     */
+    @ApiModelProperty(value= "鍘傚")
+    private String manu;
+
+    /**
+     * 鐢熶骇鏃ユ湡
+     */
+    @ApiModelProperty(value= "鐢熶骇鏃ユ湡")
+    @TableField("manu_date")
+    private String manuDate;
 
     /**
      * 鍝侀」鏁�
      */
     @ApiModelProperty(value= "鍝侀」鏁�")
     @TableField("item_num")
-    private Integer itemNum;
+    private String itemNum;
 
     /**
-     * 鏁伴噺
+     * 瀹夊叏搴撳瓨閲�
      */
-    @ApiModelProperty(value= "鏁伴噺")
-    private Double count;
+    @ApiModelProperty(value= "瀹夊叏搴撳瓨閲�")
+    @TableField("safe_qty")
+    private Double safeQty;
 
     /**
      * 閲嶉噺
      */
     @ApiModelProperty(value= "閲嶉噺")
+    @ExcelProperty({"鍗曟嵁", "閲嶉噺"})
     private Double weight;
+
+    /**
+     * 闀垮害
+     */
+    @ApiModelProperty(value= "闀垮害")
+    private Double length;
+
+    /**
+     * 浣撶Н
+     */
+    @ApiModelProperty(value= "浣撶Н")
+    private Double volume;
+
+    /**
+     * 涓夋柟缂栫爜
+     */
+    @ApiModelProperty(value= "涓夋柟缂栫爜")
+    @TableField("three_code")
+    private String threeCode;
+
+    /**
+     * 渚涘簲鍟�
+     */
+    @ApiModelProperty(value= "渚涘簲鍟�")
+    private String supp;
+
+    /**
+     * 渚涘簲鍟嗙紪鐮�
+     */
+    @ApiModelProperty(value= "渚涘簲鍟嗙紪鐮�")
+    @TableField("supp_code")
+    private String suppCode;
+
+    /**
+     * 鏄惁鎵规 1: 鏄�  0: 鍚�
+     */
+    @ApiModelProperty(value= "鏄惁鎵规 1: 鏄�  0: 鍚�  ")
+    @TableField("be_batch")
+    private Integer beBatch;
+
+    /**
+     * 淇濊川鏈�
+     */
+    @ApiModelProperty(value= "淇濊川鏈�")
+    @TableField("dead_time")
+    private String deadTime;
+
+    /**
+     * 棰勮澶╂暟
+     */
+    @ApiModelProperty(value= "棰勮澶╂暟")
+    @TableField("dead_warn")
+    private Integer deadWarn;
+
+    /**
+     * 鍒惰喘 1: 鍒堕��  2: 閲囪喘  3: 澶栧崗
+     */
+    @ApiModelProperty(value= "鍒惰喘 1: 鍒堕��  2: 閲囪喘  3: 澶栧崗  ")
+    private Integer source;
+
+    /**
+     * 瑕佹眰妫�楠� 1: 鏄�  0: 鍚�
+     */
+    @ApiModelProperty(value= "瑕佹眰妫�楠� 1: 鏄�  0: 鍚�  ")
+    private Integer inspect;
+
+    /**
+     * 鍗遍櫓鍝� 1: 鏄�  0: 鍚�
+     */
+    @ApiModelProperty(value= "鍗遍櫓鍝� 1: 鏄�  0: 鍚�  ")
+    private Integer danger;
 
     /**
      * 鐘舵�� 1: 姝e父  0: 绂佺敤
@@ -179,55 +305,102 @@
     @ApiModelProperty(value= "澶囨敞")
     private String memo;
 
+    /**
+     * 鎷ユ湁鑰�
+     */
+    @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,Double anfme,String matnr,String maktx,String name,String specs,String model,String batch,String unit,String barcode,String supplier,Double unitPrice,Integer itemNum,Double count,Double weight,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;
+        this.qty = qty;
         this.matnr = matnr;
         this.maktx = maktx;
-        this.name = name;
+        this.batch = batch;
         this.specs = specs;
         this.model = model;
-        this.batch = batch;
+        this.color = color;
+        this.brand = brand;
         this.unit = unit;
+        this.price = price;
+        this.sku = sku;
+        this.units = units;
         this.barcode = barcode;
-        this.supplier = supplier;
-        this.unitPrice = unitPrice;
+        this.origin = origin;
+        this.manu = manu;
+        this.manuDate = manuDate;
         this.itemNum = itemNum;
-        this.count = count;
+        this.safeQty = safeQty;
         this.weight = weight;
+        this.length = length;
+        this.volume = volume;
+        this.threeCode = threeCode;
+        this.supp = supp;
+        this.suppCode = suppCode;
+        this.beBatch = beBatch;
+        this.deadTime = deadTime;
+        this.deadWarn = deadWarn;
+        this.source = source;
+        this.inspect = inspect;
+        this.danger = danger;
         this.status = status;
         this.createBy = createBy;
         this.createTime = createTime;
         this.updateBy = updateBy;
         this.updateTime = updateTime;
         this.memo = memo;
+        this.owner = owner;
+        this.payment = payment;
+        this.uuid = uuid;
     }
-
-//    OrderDetl orderDetl = new OrderDetl(
-//            null,    // 璁㈠崟鍐呯爜
-//            null,    // 鏁伴噺
-//            null,    // 鍟嗗搧缂栫爜
-//            null,    // 鍟嗗搧鍚嶇О
-//            null,    // 鍚嶇О
-//            null,    // 瑙勬牸
-//            null,    // 鍨嬪彿
-//            null,    // 鎵瑰彿
-//            null,    // 鍗曚綅
-//            null,    // 鍟嗗搧鏉$爜
-//            null,    // 渚涘簲鍟�
-//            null,    // 鍗曚环
-//            null,    // 鍝侀」鏁�
-//            null,    // 鏁伴噺
-//            null,    // 閲嶉噺
-//            null,    // 鐘舵��
-//            null,    // 娣诲姞浜哄憳
-//            null,    // 娣诲姞鏃堕棿
-//            null,    // 淇敼浜哄憳
-//            null,    // 淇敼鏃堕棿
-//            null    // 澶囨敞
-//    );
 
     public String getOrderId$(){
         OrderService service = SpringUtils.getBean(OrderService.class);
@@ -236,6 +409,56 @@
             return String.valueOf(order.getId());
         }
         return null;
+    }
+
+    public String getBeBatch$(){
+        if (null == this.beBatch){ return null; }
+        switch (this.beBatch){
+            case 1:
+                return "鏄�";
+            case 0:
+                return "鍚�";
+            default:
+                return String.valueOf(this.beBatch);
+        }
+    }
+
+    public String getSource$(){
+        if (null == this.source){ return null; }
+        switch (this.source){
+            case 1:
+                return "鍒堕��";
+            case 2:
+                return "閲囪喘";
+            case 3:
+                return "澶栧崗";
+            default:
+                return String.valueOf(this.source);
+        }
+    }
+
+    public String getInspect$(){
+        if (null == this.inspect){ return null; }
+        switch (this.inspect){
+            case 1:
+                return "鏄�";
+            case 0:
+                return "鍚�";
+            default:
+                return String.valueOf(this.inspect);
+        }
+    }
+
+    public String getDanger$(){
+        if (null == this.danger){ return null; }
+        switch (this.danger){
+            case 1:
+                return "鏄�";
+            case 0:
+                return "鍚�";
+            default:
+                return String.valueOf(this.danger);
+        }
     }
 
     public String getStatus$(){
@@ -283,10 +506,15 @@
     }
 
     public Double getEnableQty() {
+
         if (null != this.anfme && this.qty != null) {
             return this.anfme - this.qty;
         }
         return null;
     }
 
-}
+    public void sync(Object source) {
+        Synchro.Copy(source, this);
+    }
+
+}
\ No newline at end of file

--
Gitblit v1.9.1