feat(ic): 仅同步电缆类销售出库单和盘点单至金思维系统
- 在 AfterApprovingSynchronizeRule 和 AfterSigningSynchronizeRule 中添加组织代码判断逻辑 - 仅当组织代码为 "0001A1100000000026O5" 或 "1001A11000000KFE18FO" 时才执行同步操作 - 优化了同步流程,减少了不必要的网络请求
This commit is contained in:
		
							parent
							
								
									efa0b80ea8
								
							
						
					
					
						commit
						137c78408a
					
				|  | @ -40,11 +40,13 @@ public class AfterSigningSynchronizeRule implements IRule<SaleOutVO> { | ||||||
|                 SaleOutBodyVO[] bvos = (SaleOutBodyVO[]) saleOutVO.getChildrenVO(); |                 SaleOutBodyVO[] bvos = (SaleOutBodyVO[]) saleOutVO.getChildrenVO(); | ||||||
|                 // 构建要发送的数据 |                 // 构建要发送的数据 | ||||||
|                 JSONObject syncData = buildSyncData(hvo, bvos); |                 JSONObject syncData = buildSyncData(hvo, bvos); | ||||||
|                 // 发送数据到金思维系统(使用HttpPostOtherSysImpl处理网络请求) |                 if (syncData != null) { | ||||||
|                 String mesResponse = httpPostOtherSys.callMes(SALE_OUT_URL, syncData); |                     // 发送数据到金思维系统(使用HttpPostOtherSysImpl处理网络请求) | ||||||
|                 obmlog.debug("AfterSigningSynchronizeRule-金思维系统响应: " + mesResponse); |                     String mesResponse = httpPostOtherSys.callMes(SALE_OUT_URL, syncData); | ||||||
|                 // 解析响应,处理结果 |                     obmlog.debug("AfterSigningSynchronizeRule-金思维系统响应: " + mesResponse); | ||||||
|                 processResponse(hvo.getVbillcode(), mesResponse); |                     // 解析响应,处理结果 | ||||||
|  |                     processResponse(hvo.getVbillcode(), mesResponse); | ||||||
|  |                 } | ||||||
|             } |             } | ||||||
|         } catch (Exception e) { |         } catch (Exception e) { | ||||||
|             obmlog.error("AfterSigningSynchronizeRule-处理异常:" + e.getMessage(), e); |             obmlog.error("AfterSigningSynchronizeRule-处理异常:" + e.getMessage(), e); | ||||||
|  | @ -56,6 +58,11 @@ public class AfterSigningSynchronizeRule implements IRule<SaleOutVO> { | ||||||
|      * 按照NCC/YonBIP字段映射到金思维系统字段 |      * 按照NCC/YonBIP字段映射到金思维系统字段 | ||||||
|      */ |      */ | ||||||
|     private JSONObject buildSyncData(SaleOutHeadVO hvo, SaleOutBodyVO[] bvos) { |     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(); |         JSONObject requestData = new JSONObject(); | ||||||
|         requestData.put("operation_type", "I"); |         requestData.put("operation_type", "I"); | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -45,12 +45,14 @@ public class AfterApprovingSynchronizeRule implements IRule<InvCountBillVO> { | ||||||
|                 // 构建要发送的数据 |                 // 构建要发送的数据 | ||||||
|                 JSONObject syncData = buildSyncData(hvo, bvos); |                 JSONObject syncData = buildSyncData(hvo, bvos); | ||||||
| 
 | 
 | ||||||
|                 // 发送数据到金思维系统(使用HttpPostOtherSysImpl处理网络请求) |                 if (syncData != null) { | ||||||
|                 String mesResponse = httpPostOtherSys.callMes(INV_COUNT_URL, syncData); |                     // 发送数据到金思维系统(使用HttpPostOtherSysImpl处理网络请求) | ||||||
|                 obmlog.debug("AfterApprovingSynchronizeRule-金思维系统响应: " + mesResponse); |                     String mesResponse = httpPostOtherSys.callMes(INV_COUNT_URL, syncData); | ||||||
|  |                     obmlog.debug("AfterApprovingSynchronizeRule-金思维系统响应: " + mesResponse); | ||||||
| 
 | 
 | ||||||
|                 // 解析响应,处理结果 |                     // 解析响应,处理结果 | ||||||
|                 processResponse(hvo.getVbillcode(), mesResponse); |                     processResponse(hvo.getVbillcode(), mesResponse); | ||||||
|  |                 } | ||||||
|             } |             } | ||||||
|         } catch (Exception e) { |         } catch (Exception e) { | ||||||
|             obmlog.error("AfterApprovingSynchronizeRule-处理异常:" + e.getMessage(), e); |             obmlog.error("AfterApprovingSynchronizeRule-处理异常:" + e.getMessage(), e); | ||||||
|  | @ -62,6 +64,11 @@ public class AfterApprovingSynchronizeRule implements IRule<InvCountBillVO> { | ||||||
|      * 按照接口文档要求构建JSON结构 |      * 按照接口文档要求构建JSON结构 | ||||||
|      */ |      */ | ||||||
|     private JSONObject buildSyncData(InvCountHeaderVO hvo, InvCountBodyVO[] bvos) throws BusinessException { |     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(); |         JSONObject requestData = new JSONObject(); | ||||||
|         // 操作类型为新增 |         // 操作类型为新增 | ||||||
|         requestData.put("operation_type", "I"); |         requestData.put("operation_type", "I"); | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue