|
@@ -24,14 +24,7 @@ import com.abi.qms.platform.dao.vo.result.*;
|
|
|
import com.abi.qms.platform.dto.req.*;
|
|
|
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;
|
|
|
-import com.abi.qms.platform.infrastructure.util.OssFileDownloadUtil;
|
|
|
-import com.abi.qms.platform.infrastructure.util.PageUtil;
|
|
|
-import com.abi.qms.platform.infrastructure.util.RandomCodeUtils;
|
|
|
-import com.abi.qms.platform.infrastructure.util.SendmailUtil;
|
|
|
-import com.abi.qms.platform.infrastructure.util.SmsUtil;
|
|
|
-import com.abi.qms.platform.infrastructure.util.UserUtil;
|
|
|
+import com.abi.qms.platform.infrastructure.util.*;
|
|
|
import com.abi.qms.platform.service.QrPackageService;
|
|
|
import com.abi.task.common.api.exception.BusinessException;
|
|
|
import com.abi.task.common.api.exception.ErrorCodeEnum;
|
|
@@ -141,6 +134,9 @@ public class QrPackageServiceImpl implements QrPackageService {
|
|
|
if (!isAdd) {
|
|
|
qrPackageMapper.updateById(qrPackage);
|
|
|
} else {
|
|
|
+ //先这么写,切面不知道为啥不生效
|
|
|
+ qrPackage.setCreateBy(TokenUtil.getUser().getId());
|
|
|
+ //新增
|
|
|
qrPackageMapper.insert(qrPackage);
|
|
|
}
|
|
|
|
|
@@ -198,6 +194,10 @@ public class QrPackageServiceImpl implements QrPackageService {
|
|
|
//3-如果是盖码,那么查询盖码得默认箱码幅面,并放入入参
|
|
|
//TODO
|
|
|
|
|
|
+ //4-根据物料ID查询物料类型,判断码类型,保存至码包表中
|
|
|
+ BaseMaterial material = baseMaterialMapper.selectById(req.getMaterialId());
|
|
|
+ AssertUtil.isNull(material, "物料信息不存在");
|
|
|
+ req.setQrType(getPackageCode(material.getMaterialType()));
|
|
|
|
|
|
}
|
|
|
|
|
@@ -276,13 +276,8 @@ public class QrPackageServiceImpl implements QrPackageService {
|
|
|
qrPackage.setStandbyRatio(req.getStandbyRatio());
|
|
|
qrPackage.setReasonApply(req.getReasonApply());
|
|
|
qrPackage.setInvalid(InvalidEnum.NOT_INVALID.getCode());
|
|
|
- //sta 根据物料ID查询物料类型,判断码类型,保存至码包表中
|
|
|
- GetPackageCodeReq Material=new GetPackageCodeReq();
|
|
|
- Material.setId(req.getMaterialId());
|
|
|
- MaterialVO vo=baseMaterialMapper.getPackageCodeType(Material);
|
|
|
- AssertUtil.isNull(vo, "物料信息不存在");
|
|
|
- qrPackage.setQrType(getPackageCode(vo.getMaterialType()));
|
|
|
- //end
|
|
|
+ qrPackage.setQrType(req.getQrType());
|
|
|
+
|
|
|
return qrPackage;
|
|
|
}
|
|
|
|
|
@@ -333,6 +328,14 @@ public class QrPackageServiceImpl implements QrPackageService {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ //查询物料信息
|
|
|
+ BaseMaterial material = baseMaterialMapper.selectById(req.getMaterialId());
|
|
|
+ AssertUtil.isNull(material, "物料信息不存在");
|
|
|
+ if(QrTypeEnum.CARTON.is(getPackageCode(material.getMaterialType()))
|
|
|
+ && req.getBoxCodeFormatId()==null){
|
|
|
+ throw new BusinessException("箱码幅面为空");
|
|
|
+ }
|
|
|
+
|
|
|
//若当前登录用户为包材厂用户,则:
|
|
|
UserInfo wholeUser = userUtil.getWholeUser();
|
|
|
BaseFactory factoryCover = baseFactoryMapper.selectById(req.getFactoryCoverId());
|