|  |  |  | 
|---|
|  |  |  | package com.zy.asrs.utils; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import com.zy.asrs.entity.LocDetl; | 
|---|
|  |  |  | import com.zy.asrs.entity.MatCode; | 
|---|
|  |  |  | import com.zy.asrs.entity.WaitPakin; | 
|---|
|  |  |  | 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.getStr2()); // 规格 | 
|---|
|  |  |  | wrkDetl.setColor(matCode.getStr3()); // 助记码 | 
|---|
|  |  |  | wrkDetl.setAltme(matCode.getStr1()); // 单位 | 
|---|
|  |  |  | wrkDetl.setBname(matCode.getStr4()); // 客户 | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 库位移转时类型检测 | 
|---|
|  |  |  | * 兼容版 | 
|---|
|  |  |  | **/ | 
|---|
|  |  |  | 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.setColor(locDetl.getColor()); // 助记码 | 
|---|
|  |  |  | wrkDetl.setBname(locDetl.getBname()); // 客户 | 
|---|
|  |  |  | 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.getStr2()); // 规格 | 
|---|
|  |  |  | locDetl.setColor(matCode.getStr3()); // 助记码 | 
|---|
|  |  |  | locDetl.setBname(matCode.getStr4()); // 客户 | 
|---|
|  |  |  | 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.setColor(wrkDetl.getColor()); // 助记码 | 
|---|
|  |  |  | locDetl.setBname(wrkDetl.getBname()); // 客户 | 
|---|
|  |  |  | locDetl.setAnfme(wrkDetl.getAnfme()); // 数量 | 
|---|
|  |  |  | locDetl.setAltme(wrkDetl.getAltme()); // 单位 | 
|---|
|  |  |  | locDetl.setZpallet(wrkDetl.getZpallet()); // 托盘条码 | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public static void setWaitPakIn(WaitPakin waitPakIn, MatCode matCode) { | 
|---|
|  |  |  | waitPakIn.setMatnr(matCode.getMatNo()); // 物料编号 | 
|---|
|  |  |  | waitPakIn.setMaktx(matCode.getMatName()); // 物料描述 | 
|---|
|  |  |  | waitPakIn.setLgnum(matCode.getStr2()); // 规格 | 
|---|
|  |  |  | waitPakIn.setColor(matCode.getStr3()); // 助记码 | 
|---|
|  |  |  | waitPakIn.setAltme(matCode.getStr1()); // 单位 | 
|---|
|  |  |  | waitPakIn.setBname(matCode.getStr4()); // 客户 | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | // 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()); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|