|
@@ -274,8 +274,9 @@ public class QrPackageServiceImpl implements QrPackageService {
|
|
|
|
|
|
//3-SAP:根据物料ID查询物料类型,判断码类型,保存至码包表中
|
|
|
//预订单:直接预订单放入
|
|
|
+ BaseMaterial material = null;
|
|
|
if (CodePackageOrderTypeEnum.SAP_ORDER.is(req.getOrderType())) {
|
|
|
- BaseMaterial material = baseMaterialMapper.selectById(req.getMaterialId());
|
|
|
+ material = baseMaterialMapper.selectById(req.getMaterialId());
|
|
|
AssertUtil.isNull(material, "物料信息不存在");
|
|
|
req.setQrType(getPackageCode(material.getMaterialType()));
|
|
|
} else {
|
|
@@ -299,6 +300,25 @@ public class QrPackageServiceImpl implements QrPackageService {
|
|
|
req.setBoxCodeFormatId(beerFormat.getId());
|
|
|
}
|
|
|
|
|
|
+ //5-备用量 根据物料自动计算
|
|
|
+ // 罐盖:2%
|
|
|
+ // 瓶盖:码数量≤1000万:3% 1000万<码数量≤2000万:2% 码数量≥2000万:1%
|
|
|
+ if (material!=null) {
|
|
|
+ if(MaterialTypeEnum.JAR.is(material.getMaterialType())){
|
|
|
+ req.setStandbyRatio(2);
|
|
|
+ }else if(MaterialTypeEnum.BOTTLE_CAP.is(material.getMaterialType())){
|
|
|
+ Long qrNumber = req.getQrNumber();
|
|
|
+ int standbyRatio = 0;
|
|
|
+ if(qrNumber<=1000*10000){
|
|
|
+ standbyRatio = 3;
|
|
|
+ }else if(qrNumber>1000*10000 && qrNumber<=2000*10000){
|
|
|
+ standbyRatio = 2;
|
|
|
+ }else{
|
|
|
+ standbyRatio = 1;
|
|
|
+ }
|
|
|
+ req.setStandbyRatio(standbyRatio);
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
/**
|