feat(ic): 仅同步电缆类销售出库单和盘点单至金思维系统

- 在 AfterApprovingSynchronizeRule 和 AfterSigningSynchronizeRule 中添加组织代码判断逻辑
- 仅当组织代码为 "0001A1100000000026O5" 或 "1001A11000000KFE18FO" 时才执行同步操作
- 优化了同步流程,减少了不必要的网络请求
This commit is contained in:
张明 2025-05-15 18:19:53 +08:00
parent efa0b80ea8
commit 137c78408a
2 changed files with 24 additions and 10 deletions

View File

@ -40,11 +40,13 @@ public class AfterSigningSynchronizeRule implements IRule<SaleOutVO> {
SaleOutBodyVO[] bvos = (SaleOutBodyVO[]) saleOutVO.getChildrenVO();
// 构建要发送的数据
JSONObject syncData = buildSyncData(hvo, bvos);
// 发送数据到金思维系统使用HttpPostOtherSysImpl处理网络请求
String mesResponse = httpPostOtherSys.callMes(SALE_OUT_URL, syncData);
obmlog.debug("AfterSigningSynchronizeRule-金思维系统响应: " + mesResponse);
// 解析响应处理结果
processResponse(hvo.getVbillcode(), mesResponse);
if (syncData != null) {
// 发送数据到金思维系统使用HttpPostOtherSysImpl处理网络请求
String mesResponse = httpPostOtherSys.callMes(SALE_OUT_URL, syncData);
obmlog.debug("AfterSigningSynchronizeRule-金思维系统响应: " + mesResponse);
// 解析响应处理结果
processResponse(hvo.getVbillcode(), mesResponse);
}
}
} catch (Exception e) {
obmlog.error("AfterSigningSynchronizeRule-处理异常:" + e.getMessage(), e);
@ -56,6 +58,11 @@ public class AfterSigningSynchronizeRule implements IRule<SaleOutVO> {
* 按照NCC/YonBIP字段映射到金思维系统字段
*/
private JSONObject buildSyncData(SaleOutHeadVO hvo, SaleOutBodyVO[] bvos) {
obmlog.debug("AfterSigningSynchronizeRule-开始处理销售出库单: " + hvo.getVbillcode());
if (!hvo.getPk_org().equals("0001A1100000000026O5") || !hvo.getPk_org().equals("1001A11000000KFE18FO")) {
obmlog.debug("AfterSigningSynchronizeRule-跳过处理销售出库单,因为此单据组织非电缆: " + hvo.getVbillcode());
return null;
}
JSONObject requestData = new JSONObject();
requestData.put("operation_type", "I");

View File

@ -45,12 +45,14 @@ public class AfterApprovingSynchronizeRule implements IRule<InvCountBillVO> {
// 构建要发送的数据
JSONObject syncData = buildSyncData(hvo, bvos);
// 发送数据到金思维系统使用HttpPostOtherSysImpl处理网络请求
String mesResponse = httpPostOtherSys.callMes(INV_COUNT_URL, syncData);
obmlog.debug("AfterApprovingSynchronizeRule-金思维系统响应: " + mesResponse);
if (syncData != null) {
// 发送数据到金思维系统使用HttpPostOtherSysImpl处理网络请求
String mesResponse = httpPostOtherSys.callMes(INV_COUNT_URL, syncData);
obmlog.debug("AfterApprovingSynchronizeRule-金思维系统响应: " + mesResponse);
// 解析响应处理结果
processResponse(hvo.getVbillcode(), mesResponse);
// 解析响应处理结果
processResponse(hvo.getVbillcode(), mesResponse);
}
}
} catch (Exception e) {
obmlog.error("AfterApprovingSynchronizeRule-处理异常:" + e.getMessage(), e);
@ -62,6 +64,11 @@ public class AfterApprovingSynchronizeRule implements IRule<InvCountBillVO> {
* 按照接口文档要求构建JSON结构
*/
private JSONObject buildSyncData(InvCountHeaderVO hvo, InvCountBodyVO[] bvos) throws BusinessException {
obmlog.debug("AfterApprovingSynchronizeRule-开始处理盘点单: " + hvo.getVbillcode());
if (!hvo.getPk_org().equals("0001A1100000000026O5") || !hvo.getPk_org().equals("1001A11000000KFE18FO")) {
obmlog.debug("AfterApprovingSynchronizeRule-跳过处理销售出库单,因为此单据组织非电缆: " + hvo.getVbillcode());
return null;
}
JSONObject requestData = new JSONObject();
// 操作类型为新增
requestData.put("operation_type", "I");