自动化立体仓库 - WMS系统
#
lsh
2024-12-18 19838a8bf458e94bed799363d11b35b517ab15df
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;
@@ -238,7 +246,7 @@
     * 要求检验 1: 是  0: 否
     */
    @ApiModelProperty(value= "要求检验 1: 是  0: 否  ")
    private Integer check;
    private Integer inspect;
    /**
     * 危险品 1: 是  0: 否
@@ -288,9 +296,41 @@
    @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;
    /**
     * 备用1
     */
    @ApiModelProperty(value= "备用1")
    private String standby1;
    /**
     * 备用2
     */
    @ApiModelProperty(value= "备用2")
    private String standby2;
    /**
     * 备用3
     */
    @ApiModelProperty(value= "备用3")
    private String standby3;
    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 check, 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 +353,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;
@@ -322,7 +362,7 @@
        this.deadTime = deadTime;
        this.deadWarn = deadWarn;
        this.source = source;
        this.check = check;
        this.inspect = inspect;
        this.danger = danger;
        this.status = status;
        this.createBy = createBy;
@@ -331,6 +371,54 @@
        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();
        this.standby1 = orderDetl.getStandby1();
        this.standby2 = orderDetl.getStandby2();
        this.standby3 = orderDetl.getStandby3();
    }
    public String getOrderId$(){
        OrderService service = SpringUtils.getBean(OrderService.class);
@@ -367,15 +455,15 @@
        }
    }
    public String getCheck$(){
        if (null == this.check){ return null; }
        switch (this.check){
    public String getInspect$(){
        if (null == this.inspect){ return null; }
        switch (this.inspect){
            case 1:
                return "是";
            case 0:
                return "否";
            default:
                return String.valueOf(this.check);
                return String.valueOf(this.inspect);
        }
    }
@@ -436,30 +524,49 @@
    }
    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 boolean beSimilar(OrderDetl orderDetl){
        return (
                this.orderNo.equals(orderDetl.getOrderNo())
                        && this.matnr.equals(orderDetl.getMatnr())
                        && this.batch.equals(orderDetl.getBatch())
                        && this.brand.equals(orderDetl.getBrand())
                        && this.standby1.equals(orderDetl.getStandby1())
                        && this.standby2.equals(orderDetl.getStandby2())
                        && this.standby3.equals(orderDetl.getStandby3())
        );
    }
    public String getPakinPakoutStatus$(){
        if (Cools.isEmpty(this.pakinPakoutStatus)) return null;
        switch (this.pakinPakoutStatus){
            case 1:
                return "Y";
            case 2:
                return "N";
            default:
                return null;
        }
    }
}
    public void sync(Object source) {
        Synchro.Copy(source, this);
    }
}