自动化立体仓库 - WMS系统
#
lsh
2024-12-17 b9cd7d99e4916d5a6b721d43644b0ae080ddfd7c
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;
@@ -58,10 +55,20 @@
    /**
     * 作业数量
     *
     *  1. 入库 : qty 👆
     *  1. 出库 : qty 👆
     *  入库 : 组托完成,组托档、工作档、入库完成数量
     *  出库 : 工作档、出库完成数量
     */
    @ApiModelProperty(value= "作业数量")
    @TableField("work_qty")
    private Double workQty;
    /**
     * 完成数量
     *
     *  入库 : qty 👆
     *  出库 : qty 👆
     */
    @ApiModelProperty(value= "完成数量")
    private Double qty;
    /**
@@ -179,7 +186,8 @@
     * 长度
     */
    @ApiModelProperty(value= "长度")
    private Double length;
    @TableField("man_length")
    private Double manLength;
    /**
     * 体积
@@ -229,7 +237,7 @@
    private Integer deadWarn;
    /**
     * 制购 1: 制造  2: 采购  3: 外协
     * 制购 1: 制造  2: 采购  3: 外协     、、宜科:  是否确认   1: 确认  2: 未确认
     */
    @ApiModelProperty(value= "制购 1: 制造  2: 采购  3: 外协  ")
    private Integer source;
@@ -288,9 +296,23 @@
    @ApiModelProperty(value= "备注")
    private String memo;
    /**
     * 状态 0:未知,1:入库,2:出库
     */
    @ApiModelProperty(value= "入出库类型(0:未知,1:入库,2:出库)")
    @TableField("pakin_pakout_status")
    private Integer pakinPakoutStatus;
    /**
     * 行号
     */
    @ApiModelProperty(value= "行号")
    @TableField("line_number")
    private Integer lineNumber;
    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 manLength, 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) {
        this.orderId = orderId;
        this.orderNo = orderNo;
        this.anfme = anfme;
@@ -313,7 +335,7 @@
        this.itemNum = itemNum;
        this.safeQty = safeQty;
        this.weight = weight;
        this.length = length;
        this.manLength = manLength;
        this.volume = volume;
        this.threeCode = threeCode;
        this.supp = supp;
@@ -331,6 +353,51 @@
        this.updateTime = updateTime;
        this.memo = memo;
    }
    public OrderDetl(OrderDetl orderDetl) {
        this.orderId = orderDetl.getOrderId();
        this.orderNo = orderDetl.getOrderNo();
        this.anfme = orderDetl.getAnfme();
        this.qty = orderDetl.getQty();
        this.matnr = orderDetl.getMatnr();
        this.maktx = orderDetl.getMaktx();
        this.batch = orderDetl.getBatch();
        this.specs = orderDetl.getSpecs();
        this.model = orderDetl.getModel();
        this.color = orderDetl.getColor();
        this.brand = orderDetl.getBrand();
        this.unit = orderDetl.getUnit();
        this.price = orderDetl.getPrice();
        this.sku = orderDetl.getSku();
        this.units = orderDetl.getUnits();
        this.barcode = orderDetl.getBarcode();
        this.origin = orderDetl.getOrigin();
        this.manu = orderDetl.getManu();
        this.manuDate = orderDetl.getManuDate();
        this.itemNum = orderDetl.getItemNum();
        this.safeQty = orderDetl.getSafeQty();
        this.weight = orderDetl.getWeight();
        this.manLength = orderDetl.getManLength();
        this.volume = orderDetl.getVolume();
        this.threeCode = orderDetl.getThreeCode();
        this.supp = orderDetl.getSupp();
        this.suppCode = orderDetl.getSuppCode();
        this.beBatch = orderDetl.getBeBatch();
        this.deadTime = orderDetl.getDeadTime();
        this.deadWarn = orderDetl.getDeadWarn();
        this.source = orderDetl.getSource();
        this.inspect = orderDetl.getInspect();
        this.danger = orderDetl.getDanger();
        this.status = orderDetl.getStatus();
        this.createBy = orderDetl.getCreateBy();
        this.createTime = orderDetl.getCreateTime();
        this.updateBy = orderDetl.getUpdateBy();
        this.updateTime = orderDetl.getUpdateTime();
        this.memo = orderDetl.getMemo();
        this.pakinPakoutStatus = orderDetl.getPakinPakoutStatus();
        this.lineNumber = orderDetl.getLineNumber();
    }
    public String getOrderId$(){
        OrderService service = SpringUtils.getBean(OrderService.class);
@@ -436,30 +503,36 @@
    }
    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 String getQty$(){
        if (getAnfme().equals(getQty())){
            return "已完成";
        }
        return "未完成";
    }
    public String getPakinPakoutStatus$(){
        switch (this.pakinPakoutStatus){
            case 1:
                return "Y";
            case 2:
                return "N";
            default:
                return null;
        }
    }
}
    public void sync(Object source) {
        Synchro.Copy(source, this);
    }
}