Browse Source

修改码类型查询

liguosong 4 years ago
parent
commit
ac772f5df1

+ 1 - 0
abi-cloud-qr-platform-server/src/main/java/com/abi/qms/platform/dao/enums/MaterialTypeEnum.java

@@ -29,6 +29,7 @@ public enum MaterialTypeEnum {
 //	TRAY(8,"托盘");
 
 	//物料类型: 3-罐子 4-瓶盖 5-纸板箱
+	JAR(3,"罐子"),
 	BOTTLE_CAP(4,"瓶盖"),
 	CARTON(5,"纸板箱");
 

+ 8 - 4
abi-cloud-qr-platform-server/src/main/java/com/abi/qms/platform/service/impl/QrPackageServiceImpl.java

@@ -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("物料类型和对应的箱码类型不匹配!");
         }
 
     }