From 608fb6f9529ce51291ef682638a5efc7dd51ac63 Mon Sep 17 00:00:00 2001
From: zwl <1051256694@qq.com>
Date: 星期二, 18 十一月 2025 08:21:08 +0800
Subject: [PATCH] 1.完善找库位 2.新增erp订单删除后,wms订单跟着删除功能 3.新增订单完成后,上报erp,erp报错后显现在出货单中 4.新增一键查询到异常完成订单 5.对销售单据和其他单据进行区分出库 6.对中间表订单状态进行完善 7.新增锁单功能 8.新增任务查询维护加上订单号

---
 src/main/java/com/zy/asrs/entity/OrderDetl.java |  112 +++++++++++++++++++++++++++++++-------------------------
 1 files changed, 62 insertions(+), 50 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..aca72cb 100644
--- a/src/main/java/com/zy/asrs/entity/OrderDetl.java
+++ b/src/main/java/com/zy/asrs/entity/OrderDetl.java
@@ -6,20 +6,19 @@
 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.DocTypeService;
 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;
+import java.util.Objects;
 
 @Data
 @TableName("man_order_detl")
@@ -58,11 +57,27 @@
     /**
      * 浣滀笟鏁伴噺
      *
-     *  1. 鍏ュ簱 : qty 馃憜
-     *  1. 鍑哄簱 : qty 馃憜
+     *  鍏ュ簱 : 缁勬墭瀹屾垚锛岀粍鎵樻。銆佸伐浣滄。銆佸叆搴撳畬鎴愭暟閲�
+     *  鍑哄簱 : 宸ヤ綔妗c�佸嚭搴撳畬鎴愭暟閲�
      */
     @ApiModelProperty(value= "浣滀笟鏁伴噺")
+    @TableField("work_qty")
+    private Double workQty;
+
+    /**
+     * 瀹屾垚鏁伴噺
+     *
+     *  鍏ュ簱 : qty 馃憜
+     *  鍑哄簱 : qty 馃憜
+     */
+    @ApiModelProperty(value= "瀹屾垚鏁伴噺")
     private Double qty;
+
+    /**
+     * 涓婃姤鏁伴噺
+     */
+    @ApiModelProperty(value= "涓婃姤鏁伴噺")
+    private Double units=0.0;
 
     /**
      * 鍟嗗搧缂栫爜
@@ -124,11 +139,6 @@
     @ApiModelProperty(value= "sku")
     private String sku;
 
-    /**
-     * 鍗曚綅閲�
-     */
-    @ApiModelProperty(value= "鍗曚綅閲�")
-    private Double units;
 
     /**
      * 鏉$爜
@@ -156,9 +166,9 @@
     private String manuDate;
 
     /**
-     * 鍝侀」鏁�
+     * 浠撳簱
      */
-    @ApiModelProperty(value= "鍝侀」鏁�")
+    @ApiModelProperty(value= "浠撳簱")
     @TableField("item_num")
     private String itemNum;
 
@@ -208,9 +218,9 @@
     private String suppCode;
 
     /**
-     * 鏄惁鎵规 1: 鏄�  0: 鍚�
+     * 绾㈣摑瀛�
      */
-    @ApiModelProperty(value= "鏄惁鎵规 1: 鏄�  0: 鍚�  ")
+    @ApiModelProperty(value= "绾㈣摑瀛�")
     @TableField("be_batch")
     private Integer beBatch;
 
@@ -235,9 +245,9 @@
     private Integer source;
 
     /**
-     * 瑕佹眰妫�楠� 1: 鏄�  0: 鍚�
+     * 涓婃姤娆℃暟
      */
-    @ApiModelProperty(value= "瑕佹眰妫�楠� 1: 鏄�  0: 鍚�  ")
+    @ApiModelProperty(value= "涓婃姤娆℃暟")
     private Integer inspect;
 
     /**
@@ -341,6 +351,33 @@
         return null;
     }
 
+    public String getAnfme$(){
+        if(Objects.equals(this.qty, this.anfme)){
+            return "宸插畬鎴�";
+        }else if(this.workQty==0){
+            return "寰呭鐞�";
+        }else if(this.anfme>this.qty){
+            return "浣滀笟涓�";
+        }else if(this.anfme<this.qty){
+            return "寮傚父";
+        }
+        return "";
+    }
+
+    public String getDanger$(){
+        DocTypeService service = SpringUtils.getBean(DocTypeService.class);
+        OrderService orderServicer=SpringUtils.getBean(OrderService.class);
+        if(Cools.isEmpty(this.orderNo)){
+            return null;
+        }
+        Order order = orderServicer.selectByNo(this.orderNo);
+        DocType docType = service.selectById(order.getDocType());
+        if (!Cools.isEmpty(docType)){
+            return String.valueOf(docType.getDocName());
+        }
+        return null;
+    }
+
     public String getBeBatch$(){
         if (null == this.beBatch){ return null; }
         switch (this.beBatch){
@@ -376,18 +413,6 @@
                 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);
         }
     }
 
@@ -436,30 +461,17 @@
     }
 
     public Double getEnableQty() {
-        if (null != this.anfme && this.qty != null) {
-            return this.anfme - this.qty;
+        if (null != this.anfme && this.workQty != null) {
+            return this.anfme - this.workQty;
         }
+//        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