浏览代码

修改机构在像平台支付的时候查询配置表的部门id

hgw 3 年之前
父节点
当前提交
498e6ba106
共有 1 个文件被更改,包括 21 次插入6 次删除
  1. 21 6
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/TenantInfoServiceImpl.java

+ 21 - 6
mec-biz/src/main/java/com/ym/mec/biz/service/impl/TenantInfoServiceImpl.java

@@ -94,6 +94,8 @@ public class TenantInfoServiceImpl extends ServiceImpl<TenantInfoDao, TenantInfo
     private SysMessageService sysMessageService;
     @Autowired
     private TenantInfoSendMsgService tenantInfoSendMsgService;
+    @Autowired
+    private SysConfigService sysConfigService;
 
     /**
      * 新增机构
@@ -440,12 +442,16 @@ public class TenantInfoServiceImpl extends ServiceImpl<TenantInfoDao, TenantInfo
      * 机构开通缴费
      */
     public Map<String, Object> tenantOpenPay(Integer tenantId) throws Exception {
+        SysConfig config = sysConfigService.findByParamName("platform_collection_organ");
+        if(Objects.isNull(config)){
+            throw new BizException("未查询到机构收款分部信息!");
+        }
+
         TenantOrderRecordEnum tenantEnum = TenantOrderRecordEnum.TENANT_OPEN;
         Map<String, Object> result = new HashMap<>();
         TenantProductInfo productInfo = getProductInfo(tenantId);
         //生成订单编号
         String orderNo = idGenerator.generatorId("payment") + "";
-        String baseApiUrl = sysConfigDao.findConfigValue("base_api_url");
         int orderState = 0;
         //消费大于0元则拉起支付
         if (productInfo.getPayAmount().compareTo(BigDecimal.ZERO) > 0) {
@@ -453,11 +459,11 @@ public class TenantInfoServiceImpl extends ServiceImpl<TenantInfoDao, TenantInfo
                     productInfo.getPayAmount(),
                     BigDecimal.ZERO,
                     orderNo,
-                    baseApiUrl + "/api-web/tenantInfo/notify",
-                    baseApiUrl + "/api-student/studentOrder/paymentResult?orderNo=" + orderNo,
+                    null,
+                    null,
                     tenantEnum.getMsg(),
                     tenantEnum.getMsg(),
-                    1,//todo 机构开通付款临时写死
+                    config.getParanValue(Integer.class),
                     tenantEnum.getCode()
             );
         } else {
@@ -482,6 +488,11 @@ public class TenantInfoServiceImpl extends ServiceImpl<TenantInfoDao, TenantInfo
      * @param val      购买周期
      */
     public Map<String, Object> tenantRenewPay(Integer tenantId, Integer val) throws Exception {
+        SysConfig config = sysConfigService.findByParamName("platform_collection_organ");
+        if(Objects.isNull(config)){
+            throw new BizException("未查询到机构收款分部信息!");
+        }
+
         TenantOrderRecordEnum tenantEnum = TenantOrderRecordEnum.TENANT_RENEW;
         Map<String, Object> result = new HashMap<>();
         TenantProductInfo productInfo = getProductInfo(tenantId);
@@ -500,7 +511,7 @@ public class TenantInfoServiceImpl extends ServiceImpl<TenantInfoDao, TenantInfo
                     null,
                     tenantEnum.getMsg(),
                     tenantEnum.getMsg(),
-                    1,//临时写死
+                    config.getParanValue(Integer.class),
                     tenantEnum.getCode()
             );
             //操作续费信息,把续费周期存起来
@@ -695,6 +706,10 @@ public class TenantInfoServiceImpl extends ServiceImpl<TenantInfoDao, TenantInfo
 
     @Override
     public Map<String, Object> recharge(Integer tenantId, BigDecimal amount) throws Exception {
+        SysConfig config = sysConfigService.findByParamName("platform_collection_organ");
+        if(Objects.isNull(config)){
+            throw new BizException("未查询到机构收款分部信息!");
+        }
         log.error("机构 " + tenantId.toString() + "充值");
         Optional.of(tenantId)
                 .map(baseMapper::selectById)
@@ -720,7 +735,7 @@ public class TenantInfoServiceImpl extends ServiceImpl<TenantInfoDao, TenantInfo
                     null,
                     tenantEnum.getMsg(),
                     tenantEnum.getMsg(),
-                    1,//临时写死
+                    config.getParanValue(Integer.class),
                     tenantEnum.getCode()
             );
         } else {