借料入库弹窗-数据校验提示调整

This commit is contained in:
mzr 2025-08-12 08:49:41 +08:00
parent 994bfbb60b
commit cdd49483ac
1 changed files with 17 additions and 9 deletions

View File

@ -3,6 +3,7 @@ package nccloud.web.mmpac.pickm.query;
import nc.bs.dao.BaseDAO;
import nc.jdbc.framework.processor.ColumnProcessor;
import nc.util.mmf.framework.base.MMValueCheck;
import nccloud.commons.lang.StringUtils;
import nccloud.dto.mmpac.pickm.pub.entity.PickmQueryInfoDTO;
import nccloud.framework.core.exception.ExceptionUtils;
import nccloud.framework.core.json.IJson;
@ -10,10 +11,7 @@ import nccloud.framework.web.action.itf.ICommonAction;
import nccloud.framework.web.container.IRequest;
import nccloud.framework.web.json.JsonFactory;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.*;
/**
* 备料计划-借料入库弹窗-数据校验
@ -29,18 +27,28 @@ public class PickmItemsQuery implements ICommonAction {
try {
String[] cpickmbids = queryInfo.getCpickmbids();
List<String> bids = new ArrayList<>();
Set<String> codeSet = new HashSet<>();
if (null != cpickmbids && cpickmbids.length != 0) {
for (String cpickmbid : cpickmbids) {
String countSql = "SELECT count(1) FROM ic_generalin_b"
+ " WHERE dr = 0 and csourcebillbid = '" + cpickmbid + "'";
Integer num = (Integer) new BaseDAO().executeQuery(countSql, new ColumnProcessor());
if (num <= 0) {
// String countSql = "SELECT count(1) FROM ic_generalin_b"
// + " WHERE dr = 0 and csourcebillbid = '" + cpickmbid + "'";
String countSql = "SELECT h.vbillcode" +
" FROM ic_generalin_b b" +
" LEFT JOIN ic_generalin_h h ON b.cgeneralhid = h.cgeneralhid" +
" WHERE b.dr = 0" +
" AND b.csourcebillbid = '" + cpickmbid + "'";
String vbillcode = (String) new BaseDAO().executeQuery(countSql, new ColumnProcessor());
if (StringUtils.isNotEmpty(vbillcode) &&
!"~".equals(vbillcode) && !"null".equals(vbillcode)) {
codeSet.add(vbillcode);
} else {
bids.add(cpickmbid);
}
}
if (MMValueCheck.isEmpty(bids)) {
ExceptionUtils.wrapBusinessException("不存在符合条件的备料计划明细");
String codeStr = String.join(",", codeSet);
ExceptionUtils.wrapBusinessException("存在有关联的其它入库,单号:" + codeStr);
}
Map<String, Object> returnMap = new HashMap<>();