材料出库签字后修改高压ims-代码调整
This commit is contained in:
parent
6c784436d8
commit
79c6682b5d
|
|
@ -1,14 +1,14 @@
|
||||||
package nc.bs.ic.m4d.sign.rule;
|
package nc.bs.ic.m4d.sign.rule;
|
||||||
|
|
||||||
import nc.bs.dao.BaseDAO;
|
import nc.bs.dao.BaseDAO;
|
||||||
import nc.bs.uapbd.util.ImsDaoUtil;
|
import nc.bs.logging.Log;
|
||||||
import nc.bs.uapbd.util.MyHelper;
|
import nc.bs.uapbd.util.MyHelper;
|
||||||
import nc.vo.fi.pub.SqlUtils;
|
|
||||||
import nc.vo.ic.m4d.entity.MaterialOutVO;
|
|
||||||
|
|
||||||
import nc.impl.pubapp.pattern.rule.IRule;
|
import nc.impl.pubapp.pattern.rule.IRule;
|
||||||
|
import nc.vo.ic.m4d.entity.MaterialOutHeadVO;
|
||||||
|
import nc.vo.ic.m4d.entity.MaterialOutVO;
|
||||||
import nc.vo.org.OrgVO;
|
import nc.vo.org.OrgVO;
|
||||||
import nc.vo.pub.BusinessException;
|
import nc.vo.pub.BusinessException;
|
||||||
|
import nc.vo.pubapp.pattern.exception.ExceptionUtils;
|
||||||
|
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
@ -21,6 +21,8 @@ import java.util.stream.Collectors;
|
||||||
* 本月(2025-11-30)
|
* 本月(2025-11-30)
|
||||||
*/
|
*/
|
||||||
public class UpdateGyimsRule implements IRule<MaterialOutVO> {
|
public class UpdateGyimsRule implements IRule<MaterialOutVO> {
|
||||||
|
private static final String LOG_INFO_NAME = "gyimslog";
|
||||||
|
private static final Log logger = Log.getInstance(LOG_INFO_NAME);
|
||||||
// IMS数据源
|
// IMS数据源
|
||||||
public BaseDAO imsDao;
|
public BaseDAO imsDao;
|
||||||
private Map<String, String> configParams;
|
private Map<String, String> configParams;
|
||||||
|
|
@ -49,14 +51,14 @@ public class UpdateGyimsRule implements IRule<MaterialOutVO> {
|
||||||
throw new BusinessException("高压的gyims接口缺少配置");
|
throw new BusinessException("高压的gyims接口缺少配置");
|
||||||
}
|
}
|
||||||
for (MaterialOutVO materialOutVO : materialOutVOS) {
|
for (MaterialOutVO materialOutVO : materialOutVOS) {
|
||||||
|
MaterialOutHeadVO head = materialOutVO.getHead();
|
||||||
// 判断物料的业务单元是否是高压公司,不是则跳过
|
// 判断物料的业务单元是否是高压公司,不是则跳过
|
||||||
String pkOrg = materialOutVO.getHead().getPk_org();
|
String pkOrg = head.getPk_org();
|
||||||
String orgCode = MyHelper.transferField(OrgVO.getDefaultTableName(), OrgVO.CODE, OrgVO.PK_ORG, pkOrg);
|
String orgCode = MyHelper.transferField(OrgVO.getDefaultTableName(), OrgVO.CODE, OrgVO.PK_ORG, pkOrg);
|
||||||
if (checkIfOrg(orgCode, configParams)) {
|
if (checkIfOrg(orgCode, configParams)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
imsIdSet.add(materialOutVO.getHead().getVbillcode());
|
imsIdSet.add(head.getVbillcode());
|
||||||
}
|
}
|
||||||
if (!imsIdSet.isEmpty()) {
|
if (!imsIdSet.isEmpty()) {
|
||||||
// 修改状态为 完成:优化SQL条件拼接,避免语法错误和SQL注入风险
|
// 修改状态为 完成:优化SQL条件拼接,避免语法错误和SQL注入风险
|
||||||
|
|
@ -69,13 +71,15 @@ public class UpdateGyimsRule implements IRule<MaterialOutVO> {
|
||||||
String updateSql = "update BIPOutMainTab set status = '2' where vbillcode in (" + ids + ")";
|
String updateSql = "update BIPOutMainTab set status = '2' where vbillcode in (" + ids + ")";
|
||||||
|
|
||||||
// 3. 执行更新(注意:这里不需要再传递参数,SQL已拼接完成)
|
// 3. 执行更新(注意:这里不需要再传递参数,SQL已拼接完成)
|
||||||
int rows = ImsDaoUtil.executeUpdate(updateSql,ids);
|
int rows = getImsDao().executeUpdate(updateSql);
|
||||||
|
|
||||||
}
|
}
|
||||||
} catch (BusinessException e) {
|
} catch (BusinessException e) {
|
||||||
throw new RuntimeException(e);
|
logger.error("UpdateGyimsRule-exp:" + e.getMessage(), e);
|
||||||
|
ExceptionUtils.wrappException(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean checkIfOrg(String code, Map<String, String> configParams) throws BusinessException {
|
private boolean checkIfOrg(String code, Map<String, String> configParams) throws BusinessException {
|
||||||
String targetCode = configParams.get("imsOrg");
|
String targetCode = configParams.get("imsOrg");
|
||||||
if (targetCode == null || nc.vo.am.common.util.StringUtils.isEmpty(targetCode)) {
|
if (targetCode == null || nc.vo.am.common.util.StringUtils.isEmpty(targetCode)) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue