|
|
@@ -283,6 +283,20 @@ public class ProdInOutServiceImpl extends CommonBaseServiceImpl<ProdInOutMapper,
|
|
|
baseDTOs.getBaseDTOs().size() == 0) {
|
|
|
return "没有可审核单据。";
|
|
|
}
|
|
|
+ //存在已审核单据,单据编号:XXXX
|
|
|
+ String msg = prodInOutMapper.validateAudit(baseDTOs.getBaseDTOs());
|
|
|
+ if (null != msg) {
|
|
|
+ String message = BizExceptionCode.SALE_ORDER_HASAUDIT.getMessage();
|
|
|
+ int code = BizExceptionCode.SALE_ORDER_HASAUDIT.getCode();
|
|
|
+ throw new BizException(code, String.format(message, msg));
|
|
|
+ }
|
|
|
+ //存在已关闭单据,单据编号:XXXX
|
|
|
+ msg = prodInOutMapper.validateClose(baseDTOs.getBaseDTOs());
|
|
|
+ if (null != msg) {
|
|
|
+ String message = BizExceptionCode.SALE_ORDER_ISCOLSED.getMessage();
|
|
|
+ int code = BizExceptionCode.SALE_ORDER_ISCOLSED.getCode();
|
|
|
+ throw new BizException(code, String.format(message, msg));
|
|
|
+ }
|
|
|
StringBuffer errorMsg = new StringBuffer();
|
|
|
for (DocBaseDTO base : baseDTOs.getBaseDTOs()) {
|
|
|
try{
|
|
|
@@ -291,7 +305,7 @@ public class ProdInOutServiceImpl extends CommonBaseServiceImpl<ProdInOutMapper,
|
|
|
ProdInOutDTO prodInOutDTO = BeanMapper.map(prodInOut,ProdInOutDTO.class);
|
|
|
singleAudit(prodInOutDTO);
|
|
|
}catch (Exception e){
|
|
|
- String msg = BizExceptionCode.DEAL_FAILED.getMessage();
|
|
|
+ msg = BizExceptionCode.DEAL_FAILED.getMessage();
|
|
|
errorMsg.append(String.format(msg, base.getCode(), e.getMessage()));
|
|
|
}
|
|
|
}
|
|
|
@@ -337,6 +351,20 @@ public class ProdInOutServiceImpl extends CommonBaseServiceImpl<ProdInOutMapper,
|
|
|
baseDTOs.getBaseDTOs().size() == 0) {
|
|
|
return "无可反审核单据。";
|
|
|
}
|
|
|
+ //存在未审核单据,单据编号:XXXX
|
|
|
+ String msg = prodInOutMapper.validateBatchUnAudit(baseDTOs.getBaseDTOs());
|
|
|
+ if (null != msg) {
|
|
|
+ String message = BizExceptionCode.SALE_ORDER_ISUNAUDIT.getMessage();
|
|
|
+ int code = BizExceptionCode.SALE_ORDER_ISUNAUDIT.getCode();
|
|
|
+ throw new BizException(code, String.format(message, msg));
|
|
|
+ }
|
|
|
+ //存在已关闭单据,单据编号:XXXX
|
|
|
+ msg = prodInOutMapper.validateClose(baseDTOs.getBaseDTOs());
|
|
|
+ if (null != msg) {
|
|
|
+ String message = BizExceptionCode.SALE_ORDER_ISCOLSED.getMessage();
|
|
|
+ int code = BizExceptionCode.SALE_ORDER_ISCOLSED.getCode();
|
|
|
+ throw new BizException(code, String.format(message, msg));
|
|
|
+ }
|
|
|
StringBuffer errorMsg = new StringBuffer();
|
|
|
for (DocBaseDTO base : baseDTOs.getBaseDTOs()) {
|
|
|
try {
|
|
|
@@ -345,7 +373,7 @@ public class ProdInOutServiceImpl extends CommonBaseServiceImpl<ProdInOutMapper,
|
|
|
ProdInOutDTO prodInOutDTO = BeanMapper.map(prodInOut,ProdInOutDTO.class);
|
|
|
singleUnAudit(prodInOutDTO);
|
|
|
}catch (Exception e){
|
|
|
- String msg = BizExceptionCode.DEAL_FAILED.getMessage();
|
|
|
+ msg = BizExceptionCode.DEAL_FAILED.getMessage();
|
|
|
errorMsg.append(String.format(msg, base.getCode(), e.getMessage()));
|
|
|
}
|
|
|
}
|