|
@@ -792,25 +792,29 @@ public class QrPackageServiceImpl implements QrPackageService {
|
|
|
//查询物料类型及suk名称
|
|
|
MaterialVO materialVO=baseMaterialMapper.getPackageCodeType(req);
|
|
|
AssertUtil.isNull(materialVO, "物料不存在");
|
|
|
+ //根据物料类型转换箱码类型
|
|
|
+ Integer qrType = getPackageCode(materialVO.getMaterialType());
|
|
|
//转化出参
|
|
|
GetPackageCodeRes res = PojoConverterUtils.copy(materialVO, GetPackageCodeRes.class);
|
|
|
//码类型赋值
|
|
|
- res.setQrType(getPackageCode(materialVO.getMaterialType()));
|
|
|
+ res.setQrType(qrType);
|
|
|
return res;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 根据物料类型转换码类型
|
|
|
- * 物料类型: 4-瓶盖 5-纸板箱
|
|
|
+ * 物料类型: 3-罐子 4-瓶盖 5-纸板箱
|
|
|
* 码类型:1-箱码 2-盖码
|
|
|
* @param type
|
|
|
* @return
|
|
|
*/
|
|
|
public Integer getPackageCode(Integer type){
|
|
|
- if (MaterialTypeEnum.BOTTLE_CAP.is(type)) {
|
|
|
+ if (MaterialTypeEnum.CARTON.is(type)) {
|
|
|
+ return QrTypeEnum.CARTON.getCode();
|
|
|
+ }else if(MaterialTypeEnum.BOTTLE_CAP.is(type) || MaterialTypeEnum.JAR.is(type)){
|
|
|
return QrTypeEnum.CAP.getCode();
|
|
|
}else{
|
|
|
- return QrTypeEnum.CARTON.getCode();
|
|
|
+ throw new BusinessException("物料类型和对应的箱码类型不匹配!");
|
|
|
}
|
|
|
|
|
|
}
|