diff --git a/pu/src/client/nccloud/web/pu/arrival/action/QCAction.java b/pu/src/client/nccloud/web/pu/arrival/action/QCAction.java index 4985d2cf..02e86d73 100644 --- a/pu/src/client/nccloud/web/pu/arrival/action/QCAction.java +++ b/pu/src/client/nccloud/web/pu/arrival/action/QCAction.java @@ -7,10 +7,14 @@ package nccloud.web.pu.arrival.action; import java.util.HashMap; import java.util.Map; + +import nc.bs.uapbd.util.MyHelper; import nc.pubitf.pu.m23.pubquery.IArrivePubQuery; import nc.vo.ml.NCLangRes4VoTransl; +import nc.vo.org.OrgVO; import nc.vo.pu.m23.entity.ArriveItemVO; import nc.vo.pu.m23.entity.ArriveVO; +import nc.vo.pub.BusinessException; import nc.vo.pub.lang.UFDateTime; import nccloud.dto.pu.arrival.entity.ExeInfo; import nccloud.dto.pu.arrival.entity.PkTsParamsVO; @@ -45,6 +49,21 @@ public class QCAction implements ICommonAction { if (idTsMap.size() > 0) { IArrivePubQuery query = (IArrivePubQuery)ServiceLocator.find(IArrivePubQuery.class); ArriveVO[] vos = query.queryAggVOByBids((String[])idTsMap.keySet().toArray(new String[idTsMap.keySet().size()])); + Map configParams = MyHelper.getConfigParams("xb-config", null); + if (configParams.isEmpty()) { + throw new BusinessException("箱变的QMS接口缺少配置"); + } + for (ArriveVO vo : vos) { + String pkOrg = vo.getHVO().getPk_org(); + String orgCode = MyHelper.transferField(OrgVO.getDefaultTableName(), OrgVO.CODE, OrgVO.PK_ORG, pkOrg); + if (!checkIfOrg(orgCode, configParams)) { + ArriveVO allVo = query.queryAggVOByHid(vo.getPrimaryKey()); + if(allVo.getBVO().length != vo.getBVO().length){ + throw new BusinessException("箱变的到货单校验必须全体校验!"); + } + } + } + if (vos != null && vos.length > 0) { for(ArriveItemVO item : vos[0].getBVO()) { item.setTs((UFDateTime)idTsMap.get(item.getPk_arriveorder_b())); @@ -70,4 +89,17 @@ public class QCAction implements ICommonAction { return null; } + private boolean checkIfOrg(String code, Map configParams) throws BusinessException { + String targetCode = configParams.get("xbOrg"); + if (targetCode == null || nc.vo.am.common.util.StringUtils.isEmpty(targetCode)) { + throw new BusinessException("未配置组织参数"); + } + String[] orgItem = targetCode.split(","); + for (String orgCode : orgItem) { + if (!orgCode.isEmpty() && orgCode.equals(code)) { + return false; + } + } + return true; + } }