Commit d99d248a7182d911310a29f14971767ddfcb2136
1 parent
12c6f43e
bug修复
Showing
1 changed file
with
10 additions
and
0 deletions
fw-valhalla-service/src/main/java/cn/fw/valhalla/service/bus/setting/SettingBizService.java
@@ -15,6 +15,8 @@ import org.springframework.util.CollectionUtils; | @@ -15,6 +15,8 @@ import org.springframework.util.CollectionUtils; | ||
15 | import java.util.*; | 15 | import java.util.*; |
16 | import java.util.stream.Collectors; | 16 | import java.util.stream.Collectors; |
17 | 17 | ||
18 | +import static cn.fw.common.businessvalidator.Validator.BV; | ||
19 | + | ||
18 | /** | 20 | /** |
19 | * @author : kurisu | 21 | * @author : kurisu |
20 | * @className : SettingBizService | 22 | * @className : SettingBizService |
@@ -63,6 +65,14 @@ public class SettingBizService { | @@ -63,6 +65,14 @@ public class SettingBizService { | ||
63 | FollowTypeEnum followTypeEnum = FollowTypeEnum.ofValue(category); | 65 | FollowTypeEnum followTypeEnum = FollowTypeEnum.ofValue(category); |
64 | boolean allMatch = list.stream().allMatch(r -> Objects.equals(category, r.getCategory())); | 66 | boolean allMatch = list.stream().allMatch(r -> Objects.equals(category, r.getCategory())); |
65 | boolean expression = Objects.nonNull(followTypeEnum) && Boolean.TRUE.equals(allMatch); | 67 | boolean expression = Objects.nonNull(followTypeEnum) && Boolean.TRUE.equals(allMatch); |
68 | + for (SettingDTO dto : list) { | ||
69 | + if (SettingTypeEnum.NOTICE_CYCLE.getValue().equals(dto.getType())) { | ||
70 | + BV.isTrue(dto.getDetailValue() > 5, () -> "消息推送间隔必须大于5天"); | ||
71 | + } | ||
72 | + if (SettingTypeEnum.NOTICE_TIMES.getValue().equals(dto.getType())) { | ||
73 | + BV.isTrue(dto.getDetailValue() <= 2, () -> "消息提醒次数不能大于两次"); | ||
74 | + } | ||
75 | + } | ||
66 | Assert.isTrue(expression, "跟进类型不正确"); | 76 | Assert.isTrue(expression, "跟进类型不正确"); |
67 | 77 | ||
68 | SettingStrategy strategy = processorMap.get(followTypeEnum); | 78 | SettingStrategy strategy = processorMap.get(followTypeEnum); |