瀏覽代碼

更新!

TRX 1 年之前
父節點
當前提交
a846877f8d

+ 6 - 8
FullCardClient/src/main/java/com/zhongshu/card/client/model/paySetting/payConfig/FrictionlessUnionConfigModel.java

@@ -19,17 +19,9 @@ import lombok.NoArgsConstructor;
 @NoArgsConstructor
 public class FrictionlessUnionConfigModel {
 
-    //----------------------------业务信息 start-----------------
-
     @Schema(description = "商户号")
     private String mchId;
 
-    @Schema(description = "无感支付签约状态通知地址")
-    private String notifyUrl = "";
-
-    @Schema(description = "支付结果通知地址")
-    private String payNotifyUrl = "";
-
     @Schema(description = "无感支付 秘钥 测试环境通知加密密钥")
     private String notifySecret;
 
@@ -54,6 +46,12 @@ public class FrictionlessUnionConfigModel {
     @Schema(description = "商户订单号固定开头")
     private String orderStart = "";
 
+    @Schema(description = "无感支付签约状态通知地址")
+    private String notifyUrl = "";
+
+    @Schema(description = "支付结果通知地址")
+    private String payNotifyUrl = "";
+
     @Schema(description = "订单交易过期时间")
     private Long expireTime = 30 * 60 * 1000L;
 

+ 6 - 0
FullCardClient/src/main/java/com/zhongshu/card/client/model/paySetting/paySetting/ProjectMainPaySettingModel.java

@@ -56,11 +56,17 @@ public class ProjectMainPaySettingModel {
     @Max(value = 100)
     private Integer days;
 
+    @Schema(description = "d+N的时间")
+    private String dnTimeStr;
+
     //---------------定期结算 设置
 
     @Schema(description = "定期类型")
     private RegularType regularType;
 
+    @Schema(description = "定期结算时间")
+    private String regularTimeStr;
+
     @Schema(description = "当前的时间,如:12:30")
     @NotEmpty
     private String timeStr;

+ 6 - 0
FullCardClient/src/main/java/com/zhongshu/card/client/model/paySetting/paySetting/ProjectMainPaySettingParam.java

@@ -39,12 +39,18 @@ public class ProjectMainPaySettingParam {
     @Schema(description = "天数,>= 1")
     private Integer days;
 
+    @Schema(description = "d+N的时间")
+    private String dnTimeStr;
+
     //---------------定期结算 设置
 
     @Schema(description = "定期类型")
     @NotNull
     private RegularType regularType;
 
+    @Schema(description = "定期结算时间")
+    private String regularTimeStr;
+
     @Schema(description = "当前的时间,如:12:30")
     private String timeStr;
 

+ 17 - 0
FullCardServer/src/main/java/com/zhongshu/card/server/core/domain/paySetting/ProjectMainPaySetting.java

@@ -54,14 +54,31 @@ public class ProjectMainPaySetting extends SuperMain {
     @Schema(description = "天数,>= 1")
     private Integer days;
 
+    @Schema(description = "d+N的时间")
+    private String dnTimeStr;
+
     //---------------定期结算 设置
 
     @Schema(description = "定期类型")
     private RegularType regularType;
 
+    @Schema(description = "定期结算时间")
+    private String regularTimeStr;
+
     @Schema(description = "当前的时间,如:12:30")
     private String timeStr;
 
+    public String getTimeStr() {
+        if (settlementRulesType != null) {
+            if (settlementRulesType == SettlementRulesType.Dn) {
+                return dnTimeStr;
+            } else if (settlementRulesType == SettlementRulesType.Regular) {
+                return regularTimeStr;
+            }
+        }
+        return "";
+    }
+
     //----------------------------提现规则 start --------------
 
     @Schema(description = "提现规则类型")

+ 7 - 0
FullCardServer/src/main/java/com/zhongshu/card/server/core/service/paySetting/ProjectMainPaySettingService.java

@@ -3,6 +3,7 @@ package com.zhongshu.card.server.core.service.paySetting;
 import com.github.microservice.net.ResultContent;
 import com.github.microservice.types.payment.PaymentType;
 import com.zhongshu.card.client.model.paySetting.paySetting.*;
+import com.zhongshu.card.client.type.paySetting.SettlementRulesType;
 import com.zhongshu.card.server.core.dao.org.OrganizationDao;
 import com.zhongshu.card.server.core.dao.projectAbout.PayShareListDao;
 import com.zhongshu.card.server.core.dao.projectAbout.ProjectMainPaySettingDao;
@@ -70,6 +71,12 @@ public class ProjectMainPaySettingService extends SuperService {
         if (orgPaySettingInfo.getIsDefault() == null || !orgPaySettingInfo.getIsDefault()) {
             return ResultContent.buildFail("选择的不是主账户类型");
         }
+        if (param.getSettlementRulesType() == SettlementRulesType.Dn && StringUtils.isEmpty(param.getDnTimeStr())) {
+            return ResultContent.buildFail("dnTimeStr不能为空");
+        }
+        if (param.getSettlementRulesType() == SettlementRulesType.Regular && StringUtils.isEmpty(param.getRegularTimeStr())) {
+            return ResultContent.buildFail("regularTimeStr不能为空");
+        }
 
         ProjectMainPaySetting mainPaySetting = projectMainPaySettingDao.findTopByProjectOidAndChannelType(
                 param.getProjectOid(), orgPaySettingInfo.getChannelType());

+ 28 - 16
FullCardServer/src/main/java/com/zhongshu/card/server/core/service/paySetting/ProjectPaySettingServiceImpl.java

@@ -5,6 +5,7 @@ import com.github.microservice.net.ResultContent;
 import com.github.microservice.net.ResultMessage;
 import com.github.microservice.pay.client.model.AccountModel;
 import com.github.microservice.pay.client.product.miniApp.weChat.conf.WeChatMiniAppConf;
+import com.github.microservice.pay.client.product.senseless.chinaumsSenseless.conf.ChinaumsSenselessConf;
 import com.github.microservice.pay.client.ret.ResultState;
 import com.github.microservice.pay.client.service.PayProductAccountService;
 import com.github.microservice.pay.client.type.PayProductChannelType;
@@ -588,9 +589,10 @@ public class ProjectPaySettingServiceImpl extends SuperService {
      * @return
      */
     public ResultContent upsertPayAccount(String projectOid, PaymentType paymentType) {
+        log.info("upsertPayAccount 维护支付中心的支付账号");
         ProjectMainPaySetting projectMainPaySetting = projectMainPaySettingDao.findTopByProjectOidAndChannelType(projectOid, paymentType);
         if (ObjectUtils.isEmpty(projectMainPaySetting)) {
-            log.error("upsertPayAccount 项目未配置");
+            log.error("upsertPayAccount 项目未配置; {} {}", paymentType.getRemark(), projectOid);
             return ResultContent.buildFail("项目未配置");
         }
         ProjectOrgPaySettingInfo entity = projectMainPaySetting.getPaySettingInfo();
@@ -604,6 +606,7 @@ public class ProjectPaySettingServiceImpl extends SuperService {
         AccountModel accountModel = new AccountModel();
         accountModel.setName(payAccountName);
 
+        String remark = "";
         Boolean disable = Boolean.FALSE;
         if (ObjectUtils.isNotEmpty(entity)) {
             if (paymentType == PaymentType.WeChat) {
@@ -622,28 +625,34 @@ public class ProjectPaySettingServiceImpl extends SuperService {
                 // 银联无感支付
                 accountModel.setProductChannelType(PayProductChannelType.ChinaumsSenseless);
 
-                WxPayConfigModel model = (WxPayConfigModel) entity.getPayConfig();
-
-                WeChatMiniAppConf appConf = new WeChatMiniAppConf();
+                FrictionlessUnionConfigModel model = (FrictionlessUnionConfigModel) entity.getPayConfig();
+                ChinaumsSenselessConf appConf = new ChinaumsSenselessConf();
                 appConf.setAppId(model.getAppId());
-                appConf.setMchId(model.getMchId());
-                appConf.setMchSerialNo(model.getMchSerialNo());
-                appConf.setPriKeyPath(model.getPrivateKeyStr());
-                appConf.setApiV3KeyPath(model.getApiV3Key());
-                appConf.setNotifyUrl(model.getNotifyUrl());
                 accountModel.setConf(appConf);
             }
 
-            // 查看平台支付产品状态
-            PayChannelConfig channelConfig = payChannelConfigDao.findTopByPaymentType(paymentType);
-            if (ObjectUtils.isNotEmpty(channelConfig)) {
-                if (channelConfig.getState() == null || channelConfig.getState() != DataState.Enable) {
-                    disable = Boolean.FALSE;
+            if (!disable) {
+                // 机构配置为开启
+                if (entity.getState() == null || entity.getState() != DataState.Enable) {
+                    disable = Boolean.TRUE;
+                    remark = "机构配置未启用";
+                }
+            }
+
+            if (!disable) {
+                // 查看平台支付产品状态
+                PayChannelConfig channelConfig = payChannelConfigDao.findTopByPaymentType(paymentType);
+                if (ObjectUtils.isNotEmpty(channelConfig)) {
+                    if (channelConfig.getState() == null || channelConfig.getState() != DataState.Enable) {
+                        disable = Boolean.FALSE;
+                    } else {
+                        remark = "平台支付产品未启用";
+                        disable = Boolean.TRUE;
+                    }
                 } else {
+                    remark = "平台支付产品不存在";
                     disable = Boolean.TRUE;
                 }
-            } else {
-                disable = Boolean.TRUE;
             }
 
             if (!disable) {
@@ -651,13 +660,16 @@ public class ProjectPaySettingServiceImpl extends SuperService {
                 ProjectPaySetting projectPaySetting = projectPaySettingDao.findTopByProjectOidAndChannelType(projectOid, paymentType);
                 if (projectPaySetting.getState() == null || projectPaySetting.getState() == DataState.Disable) {
                     disable = Boolean.TRUE;
+                    remark = "项目上支付渠道未启用";
                 }
             }
         } else {
             // 不可用
             disable = Boolean.TRUE;
+            remark = "关联的主账户信息不存在";
         }
         accountModel.setDisable(disable);
+        accountModel.setRemark(remark);
         com.github.microservice.pay.client.ret.ResultContent<Void> resultContent = payProductAccountService.upsert(accountModel);
         if (resultContent.getState() == ResultState.Success) {
             log.info("更新支付产品账户成功...");

+ 1 - 0
FullCardServer/src/main/java/com/zhongshu/card/server/core/service/schedule/ScheduleTaskConfigService.java

@@ -69,6 +69,7 @@ public class ScheduleTaskConfigService {
                     taskConfig.setScheduleType(ScheduleType.SettlementTask);
                     String expression = "";
                     String timeStr = entity.getTimeStr();
+                    
                     String[] timeParts = timeStr.split(":");
                     String hour = timeParts[0];
                     String minute = timeParts[1];