| | |
| | | package com.zy.asrs.utils; |
| | | |
| | | import com.zy.asrs.entity.LocDetl; |
| | | import com.zy.asrs.entity.MatCode; |
| | | import com.zy.asrs.entity.WrkDetl; |
| | | import com.zy.common.utils.excel.matcode.MatCodeExcel; |
| | | import com.zy.asrs.entity.LocMast; |
| | | import com.zy.asrs.entity.Mat; |
| | | import com.zy.asrs.entity.result.Pakin; |
| | | import com.zy.common.model.LocTypeDto; |
| | | |
| | | /** |
| | | * Created by vincent on 2020/7/14 |
| | | */ |
| | | public class VersionUtils { |
| | | |
| | | // 业务 ---------------------------------------------------------------------- |
| | | |
| | | public static void setWrkDetl(WrkDetl wrkDetl, MatCode matCode) { |
| | | wrkDetl.setMatnr(matCode.getMatNo()); // 物料编号 |
| | | wrkDetl.setMaktx(matCode.getMatName()); // 物料描述 |
| | | wrkDetl.setLgnum(matCode.getStr3()); // 规格 |
| | | wrkDetl.setType(matCode.getStr2()); // 商品类别 |
| | | wrkDetl.setMnemonic(matCode.getStr5()); // 助记码 |
| | | wrkDetl.setSupplier(matCode.getStr6()); // 默认供应商 |
| | | wrkDetl.setWarehouse(matCode.getStr7()); // 默认仓库 |
| | | wrkDetl.setBrand(matCode.getStr8()); // 品牌 |
| | | wrkDetl.setAltme(matCode.getStr1()); // 单位 |
| | | /** |
| | | * 库位移转时类型检测 |
| | | * 兼容版 |
| | | **/ |
| | | public static boolean locMoveCheckLocType(LocMast loc, LocTypeDto dto) { |
| | | // 如果源库位是高库位,目标库位是低库位 |
| | | if (dto.getLocType1() == 2 && loc.getLocType1() == 1) { |
| | | return false; |
| | | } |
| | | return true; |
| | | } |
| | | |
| | | public static void setWrkDetl(WrkDetl wrkDetl, LocDetl locDetl) { |
| | | wrkDetl.setMatnr(locDetl.getMatnr()); // 物料编号 |
| | | wrkDetl.setMaktx(locDetl.getMaktx()); // 物料描述 |
| | | wrkDetl.setLgnum(locDetl.getLgnum()); // 规格 |
| | | wrkDetl.setType(locDetl.getType()); // 商品类别 |
| | | wrkDetl.setMnemonic(locDetl.getMnemonic()); // 助记码 |
| | | wrkDetl.setSupplier(locDetl.getSupplier()); // 默认供应商 |
| | | wrkDetl.setWarehouse(locDetl.getWarehouse()); // 默认仓库 |
| | | wrkDetl.setBrand(locDetl.getBrand()); // 品牌 |
| | | wrkDetl.setAltme(locDetl.getAltme()); // 单位 |
| | | wrkDetl.setZpallet(locDetl.getZpallet()); // 托盘条码 |
| | | /** |
| | | * 类型检测 |
| | | * 完全检测 |
| | | **/ |
| | | public static boolean locMoveCheckLocTypeComplete(LocMast loc, LocTypeDto dto) { |
| | | // 如果源库位是高库位,目标库位是低库位 |
| | | return dto.getLocType1().equals(loc.getLocType1()); |
| | | } |
| | | |
| | | public static void setLocDetl(LocDetl locDetl, MatCode matCode) { |
| | | locDetl.setMatnr(matCode.getMatNo()); // 物料编号 |
| | | locDetl.setMaktx(matCode.getMatName()); // 物料描述 |
| | | locDetl.setLgnum(matCode.getStr3()); // 规格 |
| | | locDetl.setType(matCode.getStr2()); // 商品类别 |
| | | locDetl.setMnemonic(matCode.getStr5()); // 助记码 |
| | | locDetl.setSupplier(matCode.getStr6()); // 默认供应商 |
| | | locDetl.setWarehouse(matCode.getStr7()); // 默认仓库 |
| | | locDetl.setBrand(matCode.getStr8()); // 品牌 |
| | | locDetl.setAltme(matCode.getStr1()); // 单位 |
| | | } |
| | | |
| | | public static void setLocDetl(LocDetl locDetl, WrkDetl wrkDetl) { |
| | | locDetl.setMatnr(wrkDetl.getMatnr()); // 物料编号 |
| | | locDetl.setMaktx(wrkDetl.getMaktx()); // 物料描述 |
| | | locDetl.setLgnum(wrkDetl.getLgnum()); // 规格 |
| | | locDetl.setType(wrkDetl.getType()); // 商品类别 |
| | | locDetl.setMnemonic(wrkDetl.getMnemonic()); // 助记码 |
| | | locDetl.setSupplier(wrkDetl.getSupplier()); // 默认供应商 |
| | | locDetl.setWarehouse(wrkDetl.getWarehouse()); // 默认仓库 |
| | | locDetl.setBrand(wrkDetl.getBrand()); // 品牌 |
| | | locDetl.setAnfme(wrkDetl.getAnfme()); // 数量 |
| | | locDetl.setAltme(wrkDetl.getAltme()); // 单位 |
| | | locDetl.setZpallet(wrkDetl.getZpallet()); // 托盘条码 |
| | | } |
| | | |
| | | // 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 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()); |
| | | } |
| | | |
| | | |
| | | } |