|
|
@@ -136,6 +136,10 @@ public class KwoTradeOrderService {
|
|
|
* 贸易合同/贸易订单代理单位类型。
|
|
|
*/
|
|
|
static final String AGENT_UNIT_TYPE = "3";
|
|
|
+ /**
|
|
|
+ * 服务费冻结使用的固定供应方企业名称。
|
|
|
+ */
|
|
|
+ private static final String SERVICE_FEE_SUPPLY_ENTERPRISE_NAME = "四川开物信息技术有限公司";
|
|
|
|
|
|
@DubboReference(version = "1.0.0", group = "design", check = false)
|
|
|
private RemoteSystemService remoteSystemService;
|
|
|
@@ -2568,7 +2572,7 @@ public class KwoTradeOrderService {
|
|
|
|
|
|
// 收费策略开启时冻结采购方服务费,并记录订单收费策略信息
|
|
|
Long purchaseEntId = resolvePurchaseEntId(tradeContractResDto.getUnitList());
|
|
|
- Long supplyEntId = resolveSupplyEntId(tradeContractResDto.getUnitList());
|
|
|
+ Long supplyEntId = resolveSupplyEntIdByEnterpriseName(SERVICE_FEE_SUPPLY_ENTERPRISE_NAME);
|
|
|
ParkingWalletFeeFreezeParam feeFreezeParam = new ParkingWalletFeeFreezeParam();
|
|
|
feeFreezeParam.setOrderNo(order.getTOrderNo());
|
|
|
feeFreezeParam.setProEntId(purchaseEntId);
|
|
|
@@ -2816,6 +2820,42 @@ public class KwoTradeOrderService {
|
|
|
/**
|
|
|
* 回填贸易订单收费策略信息
|
|
|
*/
|
|
|
+ /**
|
|
|
+ * 根据企业名称查询服务费冻结使用的供应方企业ID。
|
|
|
+ *
|
|
|
+ * @param enterpriseName 企业名称
|
|
|
+ * @return 企业ID
|
|
|
+ */
|
|
|
+ private Long resolveSupplyEntIdByEnterpriseName(String enterpriseName) {
|
|
|
+ if (StrUtil.isBlank(enterpriseName)) {
|
|
|
+ throw new BusinessException("供应方企业名称不能为空");
|
|
|
+ }
|
|
|
+ try {
|
|
|
+ KwsEnterpriseResDto enterprise = remoteSystemService.findEnterpriseByName(enterpriseName);
|
|
|
+ return resolveEnterpriseIdByName(enterprise, enterpriseName);
|
|
|
+ } catch (BusinessException e) {
|
|
|
+ throw e;
|
|
|
+ } catch (Exception e) {
|
|
|
+ log.error("根据企业名称查询固定企业ID失败,enterpriseName={}", enterpriseName, e);
|
|
|
+ throw new BusinessException("查询固定企业信息失败");
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 校验企业名称查询结果并提取企业ID。
|
|
|
+ *
|
|
|
+ * @param enterprise 企业信息
|
|
|
+ * @param enterpriseName 企业名称
|
|
|
+ * @return 企业ID
|
|
|
+ */
|
|
|
+ static Long resolveEnterpriseIdByName(KwsEnterpriseResDto enterprise, String enterpriseName) {
|
|
|
+ if (enterprise == null || enterprise.getId() == null) {
|
|
|
+ log.warn("根据企业名称未查询到有效企业,enterpriseName={}", enterpriseName);
|
|
|
+ throw new BusinessException("钱包固定企业不存在:" + enterpriseName);
|
|
|
+ }
|
|
|
+ return enterprise.getId();
|
|
|
+ }
|
|
|
+
|
|
|
private void fillChargeStrategyInfo(KwoTradeOrder order, ParkingWalletFeeFreezeResult feeFreezeResult) {
|
|
|
if (feeFreezeResult == null) {
|
|
|
order.setApplyChargeStrategy(Global.NO);
|