检验单弃审时验证到货单是否已入库

This commit is contained in:
mzr 2024-10-15 18:00:05 +08:00
parent 168f1283e9
commit b6f1d11950
1 changed files with 8 additions and 6 deletions

View File

@ -452,8 +452,8 @@ public class DhjydMasterVOServiceImpl extends ServiceSupport implements IDhjydMa
return;
}
List<AggDhjydMasterVO> list = Arrays.stream(vos).filter(item -> item.getParentVO() != null).filter(item -> {
String csourceid = (String) item.getParentVO().getAttributeValue("csourceid");
return csourceid != null && !"".equals(csourceid);
String otherId = (String) item.getParentVO().getAttributeValue("srcbillid");
return otherId != null && !"".equals(otherId);
}).map(item -> item).collect(Collectors.toList());
if (list == null || list.size() == 0) {
return;
@ -462,15 +462,16 @@ public class DhjydMasterVOServiceImpl extends ServiceSupport implements IDhjydMa
for (AggDhjydMasterVO vo : list) {
DhjydMasterVO jydMasterVO = vo.getParentVO();
// 到货单的id 采购入库单的来源主键是到货单的主键
String csourceid = jydMasterVO.getAttributeValue("csourceid") + "";
if ("".equals(csourceid) || "null".equals(csourceid)) {
String otherId = jydMasterVO.getAttributeValue("srcbillid") + "";
if ("".equals(otherId) || "null".equals(otherId)) {
continue;
}
// 查询采购入库单是否存在该id
String countSql = "select count(1) from IC_PURCHASEIN_B where csourcebillhid = " + csourceid;
String countSql = "select count(1) from IC_PURCHASEIN_B where csourcebillhid = '[otherId]';";
countSql = countSql.replace("[otherId]", otherId);
Integer num = (Integer) getBaseDAO().executeQuery(countSql, new ColumnProcessor());
if (num > 0) {
errors += "单据号:[" + jydMasterVO.getAttributeValue("vbillcode") + "]收回失败,失败原因:到货单已入库,请勿收回。\n";
errors += "单据号:[" + jydMasterVO.getAttributeValue("code") + "]收回失败,失败原因:到货单已入库,请勿收回。\n";
}
}
if (!"".equals(errors)) {
@ -519,6 +520,7 @@ public class DhjydMasterVOServiceImpl extends ServiceSupport implements IDhjydMa
validateTs(tsMap, vos);
// 批量收回前校验及业务逻辑
validateUnCommitAggDhjydMasterVO(vos);
validateUnCommitInOrder(vos);
Map<String, Object> res = this.execFlows(actionName, "DHJY", vos);
// 批量收回后业务逻辑
return res;