Commit 1c1626f7741690b078b4dfdbe8d6999527ce6667
Merge remote-tracking branch 'origin/test'
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 | 15 | import java.util.*; |
16 | 16 | import java.util.stream.Collectors; |
17 | 17 | |
18 | +import static cn.fw.common.businessvalidator.Validator.BV; | |
19 | + | |
18 | 20 | /** |
19 | 21 | * @author : kurisu |
20 | 22 | * @className : SettingBizService |
... | ... | @@ -63,6 +65,14 @@ public class SettingBizService { |
63 | 65 | FollowTypeEnum followTypeEnum = FollowTypeEnum.ofValue(category); |
64 | 66 | boolean allMatch = list.stream().allMatch(r -> Objects.equals(category, r.getCategory())); |
65 | 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 | 76 | Assert.isTrue(expression, "跟进类型不正确"); |
67 | 77 | |
68 | 78 | SettingStrategy strategy = processorMap.get(followTypeEnum); | ... | ... |