自动化立体仓库 - WMS系统
#
whycq
2022-11-29 cf269d332d09474de53d32f7d9f07010ed80ec77
src/main/java/com/zy/asrs/utils/VersionUtils.java
@@ -1,9 +1,9 @@
package com.zy.asrs.utils;
import com.zy.asrs.entity.LocMast;
import com.zy.asrs.entity.MatCode;
import com.zy.asrs.entity.Mat;
import com.zy.asrs.entity.result.Pakin;
import com.zy.common.model.LocTypeDto;
import com.zy.common.utils.excel.matcode.MatCodeExcel;
/**
 * Created by vincent on 2020/7/14
@@ -13,13 +13,13 @@
    // 业务 ----------------------------------------------------------------------
//    public static void setWrkDetl(WrkDetl wrkDetl, Mat mat) {
    //    public static void setWrkDetl(WrkDetl wrkDetl, Mat mat) {
//        wrkDetl.setMatnr(matCode.getMatNo()); // 物料编号
//        wrkDetl.setMaktx(matCode.getMatName()); // 物料描述
//        wrkDetl.setLgnum(matCode.getStr2()); // 规格
//        wrkDetl.setType(matCode.getStr5()); // 型号
//        wrkDetl.setColor(matCode.getBarcode()); // 条码
//        wrkDetl.setSupplier(matCode.getStr6()); // 批号
//        wrkDetl.setSupplier(matCode.getStr6()); // 序列码
//        wrkDetl.setWarehouse(matCode.getStr7()); // 单据编号
//        wrkDetl.setBrand(matCode.getStr3()); // 品项数
//        wrkDetl.setAltme(matCode.getStr1()); // 单位
@@ -34,7 +34,7 @@
//        wrkDetl.setLgnum(locDetl.getLgnum()); // 规格
//        wrkDetl.setType(locDetl.getType()); // 型号
//        wrkDetl.setColor(locDetl.getColor()); // 条码
//        wrkDetl.setSupplier(locDetl.getSupplier()); // 批号
//        wrkDetl.setSupplier(locDetl.getSupplier()); // 序列码
//        wrkDetl.setWarehouse(locDetl.getWarehouse()); // 单据编号
//        wrkDetl.setBrand(locDetl.getBrand()); // 品项数
//        wrkDetl.setAltme(locDetl.getAltme()); // 单位
@@ -48,7 +48,7 @@
//        locDetl.setLgnum(matCode.getStr2()); // 规格
//        locDetl.setType(matCode.getStr5()); // 型号
//        locDetl.setColor(matCode.getBarcode()); // 条码
//        locDetl.setSupplier(matCode.getStr6()); // 批号
//        locDetl.setSupplier(matCode.getStr6()); // 序列码
//        locDetl.setWarehouse(matCode.getStr7()); // 单据编号
//        locDetl.setBrand(matCode.getStr3()); // 品项数
//        locDetl.setAltme(matCode.getStr1()); // 单位
@@ -63,7 +63,7 @@
//        locDetl.setLgnum(wrkDetl.getLgnum()); // 规格
//        locDetl.setType(wrkDetl.getType()); // 型号
//        locDetl.setColor(wrkDetl.getColor()); // 条码
//        locDetl.setSupplier(wrkDetl.getSupplier()); // 批号
//        locDetl.setSupplier(wrkDetl.getSupplier()); // 序列码
//        locDetl.setWarehouse(wrkDetl.getWarehouse()); // 单据编号
//        locDetl.setBrand(wrkDetl.getBrand()); // 品项数
//        locDetl.setAltme(wrkDetl.getAltme()); // 单位
@@ -77,7 +77,7 @@
//        waitPakIn.setLgnum(matCode.getStr2()); // 规格
//        waitPakIn.setType(matCode.getStr5()); // 型号
//        waitPakIn.setColor(matCode.getBarcode()); // 条码
//        waitPakIn.setSupplier(matCode.getStr6()); // 批号
//        waitPakIn.setSupplier(matCode.getStr6()); // 序列码
//        waitPakIn.setWarehouse(matCode.getStr7()); // 单据编号
//        waitPakIn.setBrand(matCode.getStr3()); // 品项数
//        waitPakIn.setAltme(matCode.getStr1()); // 单位
@@ -88,7 +88,7 @@
//        orderDetl.setMatnr(matCode.getMatNo()); // 物料编号
//        orderDetl.setMaktx(matCode.getMatName()); // 物料描述
//        orderDetl.setSpecs(matCode.getStr2()); // 规格
//        orderDetl.setSupplier(matCode.getStr6()); // 批号
//        orderDetl.setSupplier(matCode.getStr6()); // 序列码
//    }
//
//    public static void setWaitPakIn(WaitPakin waitPakIn, OrderDetl orderDetl) {
@@ -98,7 +98,7 @@
//        waitPakIn.setOrderNo(orderDetl.getOrderNo());
//        waitPakIn.setLgnum(orderDetl.getSpecs()); // 规格
//        waitPakIn.setType(orderDetl.getModel()); // 型号
//        waitPakIn.setSupplier(orderDetl.getSupplier()); // 批号
//        waitPakIn.setSupplier(orderDetl.getSupplier()); // 序列码
//        waitPakIn.setAltme(orderDetl.getUnit()); // 单位
//    }
//
@@ -109,89 +109,27 @@
//        wrkDetl.setOrderNo(orderDetl.getOrderNo());
//        wrkDetl.setLgnum(orderDetl.getSpecs()); // 规格
//        wrkDetl.setType(orderDetl.getModel()); // 型号
//        wrkDetl.setSupplier(orderDetl.getSupplier()); // 批号
//        wrkDetl.setSupplier(orderDetl.getSupplier()); // 序列码
//        wrkDetl.setAltme(orderDetl.getUnit()); // 单位
//    }
    // excel ----------------------------------------------------------------------
    public static MatCodeExcel getExcel(MatCode matCode) {
        return new MatCodeExcel(
                matCode.getMatNo(),
                matCode.getBarcode(),
                matCode.getMatName(),
                matCode.getStr1(),
                matCode.getStr2(),
                matCode.getStr3(),
                matCode.getStr4(),
                matCode.getStr5(),
                matCode.getStr6(),
                matCode.getStr7(),
                matCode.getStr8(),
                matCode.getStr9(),
                matCode.getStr10(),
                matCode.getStr11(),
                matCode.getStr12(),
                matCode.getStr13(),
                matCode.getStr14(),
                matCode.getStr15(),
                matCode.getStr16(),
                matCode.getStr17(),
                matCode.getStr18(),
                matCode.getStr19(),
                matCode.getStr20(),
                matCode.getStr21(),
                matCode.getStr22(),
                matCode.getStr23(),
                matCode.getNum1(),
                matCode.getNum2(),
                matCode.getNum3(),
                matCode.getNum4(),
                matCode.getNum5(),
                matCode.getNum6()
        );
    public static void setPakin(Pakin pakin, Mat mat) {
        pakin.setMatnr(mat.getMatnr());
        pakin.setMaktx(mat.getMaktx());
        pakin.setName(mat.getName());
        pakin.setSpecs(mat.getSpecs());
        pakin.setModel(mat.getModel());
        pakin.setUnit(mat.getUnit());
        pakin.setBarcode(mat.getBarcode());
        pakin.setItemNum(Integer.valueOf(mat.getItemNum()));
        pakin.setPrice(mat.getPrice());
        pakin.setWeight(mat.getWeight());
    }
    public static void setMatCode(MatCode matCode, MatCodeExcel excel) {
        matCode.setMatNo(excel.getMatNo());
        matCode.setMatName(excel.getMatName());
        matCode.setBarcode(excel.getBarcode());
        matCode.setStr1(excel.getStr1());
        matCode.setStr2(excel.getStr2());
        matCode.setStr3(excel.getStr3());
        matCode.setStr4(excel.getStr4());
        matCode.setStr5(excel.getStr5());
        matCode.setStr6(excel.getStr6());
        matCode.setStr7(excel.getStr7());
        matCode.setStr8(excel.getStr8());
        matCode.setStr9(excel.getStr9());
        matCode.setStr10(excel.getStr10());
        matCode.setStr11(excel.getStr11());
        matCode.setStr12(excel.getStr12());
        matCode.setStr13(excel.getStr13());
        matCode.setStr14(excel.getStr14());
        matCode.setStr15(excel.getStr15());
        matCode.setStr16(excel.getStr16());
        matCode.setStr17(excel.getStr17());
        matCode.setStr18(excel.getStr18());
        matCode.setStr19(excel.getStr19());
        matCode.setStr20(excel.getStr20());
        matCode.setStr21(excel.getStr21());
        matCode.setStr22(excel.getStr22());
        matCode.setStr23(excel.getStr23());
        matCode.setNum1(excel.getNum1());
        matCode.setNum2(excel.getNum2());
        matCode.setNum3(excel.getNum3());
        matCode.setNum4(excel.getNum4());
        matCode.setNum5(excel.getNum5());
        matCode.setNum6(excel.getNum6());
    }
    /**
     *  库位移转时类型检测
     * 库位移转时类型检测
     **/
    public static boolean locMoveCheckLocType(LocMast loc, LocTypeDto dto){
    public static boolean locMoveCheckLocType(LocMast loc, LocTypeDto dto) {
        // 如果源库位是高库位,目标库位是低库位
        if (dto.getLocType1() == 2 && loc.getLocType1() == 1) {
            return false;