自动化立体仓库 - WMS系统
zhangc
2024-12-12 5dc8a9f9aba3310fd21cad9509635bb7ec2f007f
src/main/java/com/zy/asrs/entity/OrderDetl.java
@@ -6,17 +6,14 @@
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.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;
@@ -65,21 +62,28 @@
    private Double qty;
    /**
     * 商品编码
     * 库存数量
     */
    @ApiModelProperty(value= "商品编码")
    @ApiModelProperty(value= "库存数量")
    @TableField(exist = false)
    private Double stock;
    /**
     * 物料号
     */
    @ApiModelProperty(value= "物料号")
    private String matnr;
    /**
     * 商品名称
     * 物料号
     */
    @ApiModelProperty(value= "商品名称")
    @ApiModelProperty(value= "物料号")
    private String maktx;
    /**
     * 批号
     * 序列码
     */
    @ApiModelProperty(value= "批号")
    @ApiModelProperty(value= "序列码")
    private String batch;
    /**
@@ -89,9 +93,9 @@
    private String specs;
    /**
     * 型号
     * 批次
     */
    @ApiModelProperty(value= "型号")
    @ApiModelProperty(value= "批次")
    private String model;
    /**
@@ -125,9 +129,9 @@
    private String sku;
    /**
     * 单位量
     * 包数
     */
    @ApiModelProperty(value= "单位量")
    @ApiModelProperty(value= "包数")
    private Double units;
    /**
@@ -137,9 +141,9 @@
    private String barcode;
    /**
     * 产地
     * 物料状态
     */
    @ApiModelProperty(value= "产地")
    @ApiModelProperty(value= "物料状态")
    private String origin;
    /**
@@ -149,9 +153,9 @@
    private String manu;
    /**
     * 生产日期
     * 单据时间
     */
    @ApiModelProperty(value= "生产日期")
    @ApiModelProperty(value= "单据时间")
    @TableField("manu_date")
    private String manuDate;
@@ -182,9 +186,9 @@
    private Double length;
    /**
     * 体积
     * 换算率
     */
    @ApiModelProperty(value= "体积")
    @ApiModelProperty(value= "换算率")
    private Double volume;
    /**
@@ -288,9 +292,19 @@
    @ApiModelProperty(value= "备注")
    private String memo;
    /**
     * 工序状态
     */
    @ApiModelProperty(value= "工序状态 1:待加工,2:已加工,3:无需加工")
    @TableField("process_sts")
    private Integer processSts;
    @TableField("report_qty")
    private Double reportQty;
    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,Integer processSts) {
        this.orderId = orderId;
        this.orderNo = orderNo;
        this.anfme = anfme;
@@ -330,6 +344,7 @@
        this.updateBy = updateBy;
        this.updateTime = updateTime;
        this.memo = memo;
        this.processSts = processSts;
    }
    public String getOrderId$(){
@@ -339,6 +354,22 @@
            return String.valueOf(order.getId());
        }
        return null;
    }
    public String getProcessSts$(){
        if (null == this.processSts){ return null; }
        switch (this.processSts){
            case 0:
                return "其他";
            case 1:
                return "待加工";
            case 2:
                return "已加工";
            case 3:
                return "无需加工";
            default:
                return String.valueOf(this.processSts);
        }
    }
    public String getBeBatch$(){
@@ -436,30 +467,19 @@
    }
    public Double getEnableQty() {
        Double enableQty = null;
        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;
                    }
                }
            enableQty = this.anfme - this.qty;
            if (enableQty < 0) {
                enableQty = 0.0D;
            }
        } catch (Exception e) {
            throw new CoolException("属性复制失败:" + e.getMessage());
//            return this.anfme - this.qty;
        }
        return enableQty;
    }
    public void sync(Object source) {
        Synchro.Copy(source, this);
    }
}