TRX 1 ano atrás
pai
commit
fa361180d1

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

@@ -57,6 +57,12 @@ public class ProjectMainPaySettingModel {
     @Schema(description = "提现方式")
     private WithdrawMethodType withdrawMethodType;
 
+    @Schema(description = "最小的提现额度")
+    private Long minWithdraw = 0L;
+
+    @Schema(description = "最大的提现额度")
+    private Long maxWithdraw = 0L;
+
     //---------------D+N结算 设置
     @Schema(description = "天数,>= 1")
     @Min(value = 1)

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

@@ -63,6 +63,12 @@ public class ProjectMainPaySettingParam {
     @Schema(description = "提现方式")
     private WithdrawMethodType withdrawMethodType;
 
+    @Schema(description = "最小的提现额度")
+    private Long minWithdraw = 0L;
+
+    @Schema(description = "最大的提现额度")
+    private Long maxWithdraw = 0L;
+
     //---------------------------分账规则配置 start ------------
     @Schema(description = "最小分账金额, 单位分")
     private Long minSharing = 0L;

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

@@ -88,6 +88,12 @@ public class ProjectMainPaySetting extends SuperMain {
     @Schema(description = "提现方式")
     private WithdrawMethodType withdrawMethodType;
 
+    @Schema(description = "最小的提现额度")
+    private Long minWithdraw = 0L;
+    
+    @Schema(description = "最大的提现额度")
+    private Long maxWithdraw = 0L;
+
     //---------------------------分账规则配置 start ------------
     @Schema(description = "最小分账金额, 单位分")
     private Long minSharing = 0L;

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

@@ -88,16 +88,14 @@ public class ProjectMainPaySettingService extends SuperService {
         // 项目 的分成
         BigDecimal projectScale = param.getProjectScale();
         if (projectScale != null) {
-            if (BigDecimal.ZERO.compareTo(projectScale) == 1 ||
-                    BigDecimal.valueOf(100).compareTo(projectScale) == -1) {
+            if (BigDecimal.ZERO.compareTo(projectScale) == 1 || BigDecimal.valueOf(100).compareTo(projectScale) == -1) {
                 return ResultContent.buildFail("projectScale不符合要求");
             }
         }
         // 机构 的分成
         BigDecimal orgScale = param.getOrgScale();
         if (projectScale != null) {
-            if (BigDecimal.ZERO.compareTo(orgScale) == 1 ||
-                    BigDecimal.valueOf(100).compareTo(orgScale) == -1) {
+            if (BigDecimal.ZERO.compareTo(orgScale) == 1 || BigDecimal.valueOf(100).compareTo(orgScale) == -1) {
                 return ResultContent.buildFail("orgScale不符合要求");
             }
         }
@@ -106,8 +104,16 @@ public class ProjectMainPaySettingService extends SuperService {
             return ResultContent.buildFail("项目分成和机构分成之和不等100");
         }
 
-        ProjectMainPaySetting mainPaySetting = projectMainPaySettingDao.findTopByProjectOidAndChannelType(
-                param.getProjectOid(), orgPaySettingInfo.getChannelType());
+        Long minWithdraw = param.getMinWithdraw();
+        Long maxWithdraw = param.getMaxWithdraw();
+        if (minWithdraw <= 0 || maxWithdraw <= 0) {
+            return ResultContent.buildFail("minWithdraw或maxWithdraw不能小于等于0");
+        }
+        if (minWithdraw > maxWithdraw) {
+            return ResultContent.buildFail("minWithdraw不能大于maxWithdraw");
+        }
+
+        ProjectMainPaySetting mainPaySetting = projectMainPaySettingDao.findTopByProjectOidAndChannelType(param.getProjectOid(), orgPaySettingInfo.getChannelType());
         if (ObjectUtils.isEmpty(mainPaySetting)) {
             mainPaySetting = new ProjectMainPaySetting();
         }
@@ -132,8 +138,7 @@ public class ProjectMainPaySettingService extends SuperService {
      * @return
      */
     public ResultContent<ProjectMainPaySettingModel> getMainPaySetting(String projectOid, PaymentType paymentType) {
-        ProjectMainPaySetting mainPaySetting = projectMainPaySettingDao.findTopByProjectOidAndChannelType(
-                projectOid, paymentType);
+        ProjectMainPaySetting mainPaySetting = projectMainPaySettingDao.findTopByProjectOidAndChannelType(projectOid, paymentType);
         ProjectMainPaySettingModel model = toMainModel(mainPaySetting);
         model.setProjectOid(projectOid);
         return ResultContent.buildSuccess(model);
@@ -177,16 +182,14 @@ public class ProjectMainPaySettingService extends SuperService {
         // 项目 的分成
         BigDecimal projectScale = param.getProjectScale();
         if (projectScale != null) {
-            if (BigDecimal.ZERO.compareTo(projectScale) == 1 ||
-                    BigDecimal.valueOf(100).compareTo(projectScale) == -1) {
+            if (BigDecimal.ZERO.compareTo(projectScale) == 1 || BigDecimal.valueOf(100).compareTo(projectScale) == -1) {
                 return ResultContent.buildFail("projectScale不符合要求");
             }
         }
         // 机构 的分成
         BigDecimal orgScale = param.getOrgScale();
         if (projectScale != null) {
-            if (BigDecimal.ZERO.compareTo(orgScale) == 1 ||
-                    BigDecimal.valueOf(100).compareTo(orgScale) == -1) {
+            if (BigDecimal.ZERO.compareTo(orgScale) == 1 || BigDecimal.valueOf(100).compareTo(orgScale) == -1) {
                 return ResultContent.buildFail("orgScale不符合要求");
             }
         }