|
@@ -22,10 +22,7 @@ import com.abi.qms.platform.dao.mapper.*;
|
|
|
import com.abi.qms.platform.dao.tablestore.entity.QrCode;
|
|
|
import com.abi.qms.platform.dao.vo.result.*;
|
|
|
import com.abi.qms.platform.dto.req.*;
|
|
|
-import com.abi.qms.platform.dto.res.GetQrPackageDetailRes;
|
|
|
-import com.abi.qms.platform.dto.res.GetQrSingleCheckDetailRes;
|
|
|
-import com.abi.qms.platform.dto.res.ListQrPackageRes;
|
|
|
-import com.abi.qms.platform.dto.res.ValidSAPOrderNoAndMaterialRes;
|
|
|
+import com.abi.qms.platform.dto.res.*;
|
|
|
import com.abi.qms.platform.infrastructure.mq.GenerateCodeConsumer;
|
|
|
import com.abi.qms.platform.infrastructure.util.AssertUtil;
|
|
|
import com.abi.qms.platform.infrastructure.util.FreeMarkerUtils;
|
|
@@ -279,15 +276,12 @@ public class QrPackageServiceImpl implements QrPackageService {
|
|
|
qrPackage.setStandbyRatio(req.getStandbyRatio());
|
|
|
qrPackage.setReasonApply(req.getReasonApply());
|
|
|
qrPackage.setInvalid(InvalidEnum.NOT_INVALID.getCode());
|
|
|
- //20210602 lgs sta 根据物料ID查询物料类型,判断码类型,保存至码包表中
|
|
|
- GetMaterialReq Material=new GetMaterialReq();
|
|
|
+ //sta 根据物料ID查询物料类型,判断码类型,保存至码包表中
|
|
|
+ GetPackageCodeReq Material=new GetPackageCodeReq();
|
|
|
Material.setId(req.getMaterialId());
|
|
|
- MaterialVO vo=baseMaterialMapper.getMaterialDetail(Material);
|
|
|
- if (MaterialTypeEnum.BOTTLE_CAP.is(vo.getMaterialType())) {
|
|
|
- qrPackage.setQrType(QrTypeEnum.CAP.getCode());
|
|
|
- }else{
|
|
|
- qrPackage.setQrType(QrTypeEnum.CARTON.getCode());
|
|
|
- }
|
|
|
+ MaterialVO vo=baseMaterialMapper.getPackageCodeType(Material);
|
|
|
+ AssertUtil.isNull(vo, "物料信息不存在");
|
|
|
+ qrPackage.setQrType(getPackageCode(vo.getMaterialType()));
|
|
|
//end
|
|
|
return qrPackage;
|
|
|
}
|
|
@@ -791,6 +785,33 @@ public class QrPackageServiceImpl implements QrPackageService {
|
|
|
throw new BusinessException("更新tableStore异常");
|
|
|
}
|
|
|
}
|
|
|
+ @Override
|
|
|
+ public GetPackageCodeRes getPackageCodeType(GetPackageCodeReq req){
|
|
|
+ //判断ID是否为空
|
|
|
+ AssertUtil.isNull(req.getId(),"物料ID为空");
|
|
|
+ //查询物料类型及suk名称
|
|
|
+ MaterialVO materialVO=baseMaterialMapper.getPackageCodeType(req);
|
|
|
+ AssertUtil.isNull(materialVO, "物料不存在");
|
|
|
+ //转化出参
|
|
|
+ GetPackageCodeRes res = PojoConverterUtils.copy(materialVO, GetPackageCodeRes.class);
|
|
|
+ //码类型赋值
|
|
|
+ res.setQrType(getPackageCode(materialVO.getMaterialType()));
|
|
|
+ return res;
|
|
|
+ }
|
|
|
|
|
|
+ /**
|
|
|
+ * 根据物料类型转换码类型
|
|
|
+ * 物料类型: 4-瓶盖 5-纸板箱
|
|
|
+ * 码类型:1-箱码 2-盖码
|
|
|
+ * @param type
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public Integer getPackageCode(Integer type){
|
|
|
+ if (MaterialTypeEnum.BOTTLE_CAP.is(type)) {
|
|
|
+ return QrTypeEnum.CAP.getCode();
|
|
|
+ }else{
|
|
|
+ return QrTypeEnum.CARTON.getCode();
|
|
|
+ }
|
|
|
|
|
|
+ }
|
|
|
}
|