Commit 0d6ab86a222494a2050ca34c0fe7caa6e4fad62c
1 parent
0ad10f71
feat(*): 调整事故车二次跟进截止时间
- 调整事故车二次跟进截止时间
Showing
15 changed files
with
118 additions
and
4 deletions
fw-shirasawa-sdk/src/main/java/cn/fw/shirasawa/sdk/param/FollowChangeUserDTO.java
fw-shirasawa-service/src/main/java/cn/fw/shirasawa/service/bus/follow/FollowBizService.java
... | ... | @@ -534,11 +534,16 @@ public class FollowBizService { |
534 | 534 | if (Objects.isNull(task)) { |
535 | 535 | return; |
536 | 536 | } |
537 | - | |
537 | + boolean isSecondTask = Boolean.TRUE.equals(dto.getSecondTask()); | |
538 | 538 | boolean sameFollow = task.getFollowUser().equals(userId) && task.getFollowShop().equals(shopId); |
539 | - if (emptyMobile && sameFollow) { | |
539 | + if (emptyMobile && sameFollow && !isSecondTask) { | |
540 | 540 | return; |
541 | 541 | } |
542 | + if (isSecondTask) { | |
543 | + BV.notNull(dto.getDeadline(), () -> "二次分配任务截止日期不能为空"); | |
544 | + task.setState(TaskStateEnum.ONGOING); | |
545 | + task.setDeadline(DateUtil.date2LocalDateTime(dto.getDeadline())); | |
546 | + } | |
542 | 547 | if (!sameFollow) { |
543 | 548 | task.setFollowUser(userId); |
544 | 549 | task.setFollowShop(shopId); |
... | ... | @@ -566,6 +571,10 @@ public class FollowBizService { |
566 | 571 | } |
567 | 572 | } |
568 | 573 | followTaskService.updateById(task); |
574 | + if (isSecondTask) { | |
575 | + FollowStrategy strategy = followMap.get(followTypeEnum); | |
576 | + strategy.secondTaskStopRecord(task.getId()); | |
577 | + } | |
569 | 578 | } |
570 | 579 | |
571 | 580 | /** | ... | ... |
fw-shirasawa-service/src/main/java/cn/fw/shirasawa/service/bus/follow/strategy/AbstractFollowStrategy.java
... | ... | @@ -527,6 +527,33 @@ public abstract class AbstractFollowStrategy implements FollowStrategy { |
527 | 527 | } |
528 | 528 | |
529 | 529 | /** |
530 | + * 二次分配终止任务 | |
531 | + * | |
532 | + * @param taskId | |
533 | + */ | |
534 | + @Override | |
535 | + @Transactional(rollbackFor = Exception.class) | |
536 | + public void secondTaskStopRecord(final Long taskId) { | |
537 | + FollowRecord record = followRecordService.getOngoingRecord(taskId); | |
538 | + if (Objects.isNull(record)) { | |
539 | + return; | |
540 | + } | |
541 | + record.setReason(FollowCloseReason.LEAD_EXPIRES); | |
542 | + record.setRemark(record.getRemark() + "+二次分配"); | |
543 | + record.setCloseTime(LocalDateTime.now()); | |
544 | + record.setFollowStatus(FollowStatusEnum.CLOSED); | |
545 | + if (!Boolean.TRUE.equals(record.getAddTodo())) { | |
546 | + record.setYn(Boolean.FALSE); | |
547 | + } | |
548 | + markSecretReportHistory(record); | |
549 | + followRecordService.updateById(record); | |
550 | + if (Boolean.TRUE.equals(record.getAddTodo())) { | |
551 | + BackLogItemDTO dto = new BackLogItemDTO(record.getUserId(), record.getTodoCode(), record.getId().toString()); | |
552 | + todoRpcService.cancel(dto); | |
553 | + } | |
554 | + } | |
555 | + | |
556 | + /** | |
530 | 557 | * 重复校验 |
531 | 558 | * |
532 | 559 | * @param originalData | ... | ... |
fw-shirasawa-service/src/main/java/cn/fw/shirasawa/service/bus/follow/strategy/FollowStrategy.java
... | ... | @@ -163,4 +163,11 @@ public interface FollowStrategy { |
163 | 163 | */ |
164 | 164 | @Transactional(rollbackFor = Exception.class) |
165 | 165 | void markSecretReportHistory(FollowRecord record); |
166 | + | |
167 | + /** | |
168 | + * 二次分配终止任务 | |
169 | + * @param taskId | |
170 | + */ | |
171 | + @Transactional(rollbackFor = Exception.class) | |
172 | + void secondTaskStopRecord(final Long taskId); | |
166 | 173 | } | ... | ... |
fw-shirasawa-service/src/main/java/cn/fw/shirasawa/service/bus/follow/strategy/impl/ACFollowStrategy.java
... | ... | @@ -106,6 +106,12 @@ public class ACFollowStrategy extends AbstractFollowStrategy { |
106 | 106 | } |
107 | 107 | |
108 | 108 | @Override |
109 | + @Transactional(rollbackFor = Exception.class) | |
110 | + public void secondTaskStopRecord(final Long taskId) { | |
111 | + // 没有二次分配 | |
112 | + } | |
113 | + | |
114 | + @Override | |
109 | 115 | public ACDetailVO queryDetail(FollowRecord record) { |
110 | 116 | FollowTask followTask = followTaskService.getById(record.getTaskId()); |
111 | 117 | BV.notNull(followTask, "跟进任务不存在"); | ... | ... |
fw-shirasawa-service/src/main/java/cn/fw/shirasawa/service/bus/follow/strategy/impl/AFFollowStrategy.java
... | ... | @@ -16,6 +16,7 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
16 | 16 | import lombok.extern.slf4j.Slf4j; |
17 | 17 | import org.springframework.beans.factory.annotation.Autowired; |
18 | 18 | import org.springframework.stereotype.Component; |
19 | +import org.springframework.transaction.annotation.Transactional; | |
19 | 20 | |
20 | 21 | import java.util.Objects; |
21 | 22 | |
... | ... | @@ -121,4 +122,10 @@ public class AFFollowStrategy extends AbstractFollowStrategy { |
121 | 122 | ); |
122 | 123 | return count > 0; |
123 | 124 | } |
125 | + | |
126 | + @Override | |
127 | + @Transactional(rollbackFor = Exception.class) | |
128 | + public void secondTaskStopRecord(final Long taskId) { | |
129 | + // 没有二次分配 | |
130 | + } | |
124 | 131 | } | ... | ... |
fw-shirasawa-service/src/main/java/cn/fw/shirasawa/service/bus/follow/strategy/impl/CFFollowStrategy.java
... | ... | @@ -4,6 +4,7 @@ import cn.fw.shirasawa.domain.enums.FollowTypeEnum; |
4 | 4 | import cn.fw.shirasawa.service.bus.follow.strategy.AbstractFollowStrategy; |
5 | 5 | import lombok.extern.slf4j.Slf4j; |
6 | 6 | import org.springframework.stereotype.Component; |
7 | +import org.springframework.transaction.annotation.Transactional; | |
7 | 8 | |
8 | 9 | /** |
9 | 10 | * @author : kurisu |
... | ... | @@ -20,5 +21,9 @@ public class CFFollowStrategy extends AbstractFollowStrategy { |
20 | 21 | public FollowTypeEnum getFollowType() { |
21 | 22 | return FollowTypeEnum.CF; |
22 | 23 | } |
23 | - | |
24 | + @Override | |
25 | + @Transactional(rollbackFor = Exception.class) | |
26 | + public void secondTaskStopRecord(final Long taskId) { | |
27 | + // 没有二次分配 | |
28 | + } | |
24 | 29 | } | ... | ... |
fw-shirasawa-service/src/main/java/cn/fw/shirasawa/service/bus/follow/strategy/impl/FAFollowStrategy.java
... | ... | @@ -23,4 +23,9 @@ public class FAFollowStrategy extends AbstractFollowStrategy { |
23 | 23 | public FollowTypeEnum getFollowType() { |
24 | 24 | return FollowTypeEnum.FA; |
25 | 25 | } |
26 | + @Override | |
27 | + @Transactional(rollbackFor = Exception.class) | |
28 | + public void secondTaskStopRecord(final Long taskId) { | |
29 | + // 没有二次分配 | |
30 | + } | |
26 | 31 | } | ... | ... |
fw-shirasawa-service/src/main/java/cn/fw/shirasawa/service/bus/follow/strategy/impl/MAFollowStrategy.java
... | ... | @@ -11,6 +11,7 @@ import cn.fw.shirasawa.service.bus.follow.strategy.AbstractFollowStrategy; |
11 | 11 | import lombok.extern.slf4j.Slf4j; |
12 | 12 | import org.springframework.beans.factory.annotation.Autowired; |
13 | 13 | import org.springframework.stereotype.Component; |
14 | +import org.springframework.transaction.annotation.Transactional; | |
14 | 15 | |
15 | 16 | import java.util.Objects; |
16 | 17 | |
... | ... | @@ -75,4 +76,9 @@ public class MAFollowStrategy extends AbstractFollowStrategy { |
75 | 76 | } |
76 | 77 | return vo; |
77 | 78 | } |
79 | + @Override | |
80 | + @Transactional(rollbackFor = Exception.class) | |
81 | + public void secondTaskStopRecord(final Long taskId) { | |
82 | + // 没有二次分配 | |
83 | + } | |
78 | 84 | } | ... | ... |
fw-shirasawa-service/src/main/java/cn/fw/shirasawa/service/bus/follow/strategy/impl/OTFollowStrategy.java
... | ... | @@ -22,5 +22,9 @@ public class OTFollowStrategy extends AbstractFollowStrategy { |
22 | 22 | public FollowTypeEnum getFollowType() { |
23 | 23 | return FollowTypeEnum.OT; |
24 | 24 | } |
25 | - | |
25 | + @Override | |
26 | + @Transactional(rollbackFor = Exception.class) | |
27 | + public void secondTaskStopRecord(final Long taskId) { | |
28 | + // 没有二次分配 | |
29 | + } | |
26 | 30 | } | ... | ... |
fw-shirasawa-service/src/main/java/cn/fw/shirasawa/service/bus/follow/strategy/impl/PFFollowStrategy.java
... | ... | @@ -4,6 +4,7 @@ import cn.fw.shirasawa.domain.enums.FollowTypeEnum; |
4 | 4 | import cn.fw.shirasawa.service.bus.follow.strategy.AbstractFollowStrategy; |
5 | 5 | import lombok.extern.slf4j.Slf4j; |
6 | 6 | import org.springframework.stereotype.Component; |
7 | +import org.springframework.transaction.annotation.Transactional; | |
7 | 8 | |
8 | 9 | /** |
9 | 10 | * @author : kurisu |
... | ... | @@ -20,4 +21,9 @@ public class PFFollowStrategy extends AbstractFollowStrategy { |
20 | 21 | public FollowTypeEnum getFollowType() { |
21 | 22 | return FollowTypeEnum.PF; |
22 | 23 | } |
24 | + @Override | |
25 | + @Transactional(rollbackFor = Exception.class) | |
26 | + public void secondTaskStopRecord(final Long taskId) { | |
27 | + // 没有二次分配 | |
28 | + } | |
23 | 29 | } | ... | ... |
fw-shirasawa-service/src/main/java/cn/fw/shirasawa/service/bus/follow/strategy/impl/PLFollowStrategy.java
... | ... | @@ -13,6 +13,7 @@ import cn.fw.shirasawa.service.bus.follow.strategy.AbstractFollowStrategy; |
13 | 13 | import lombok.extern.slf4j.Slf4j; |
14 | 14 | import org.springframework.beans.factory.annotation.Autowired; |
15 | 15 | import org.springframework.stereotype.Component; |
16 | +import org.springframework.transaction.annotation.Transactional; | |
16 | 17 | |
17 | 18 | import java.util.Objects; |
18 | 19 | |
... | ... | @@ -97,4 +98,9 @@ public class PLFollowStrategy extends AbstractFollowStrategy { |
97 | 98 | return vo; |
98 | 99 | } |
99 | 100 | |
101 | + @Override | |
102 | + @Transactional(rollbackFor = Exception.class) | |
103 | + public void secondTaskStopRecord(final Long taskId) { | |
104 | + // 没有二次分配 | |
105 | + } | |
100 | 106 | } | ... | ... |
fw-shirasawa-service/src/main/java/cn/fw/shirasawa/service/bus/follow/strategy/impl/RCFollowStrategy.java
... | ... | @@ -4,6 +4,7 @@ import cn.fw.shirasawa.domain.enums.FollowTypeEnum; |
4 | 4 | import cn.fw.shirasawa.service.bus.follow.strategy.AbstractFollowStrategy; |
5 | 5 | import lombok.extern.slf4j.Slf4j; |
6 | 6 | import org.springframework.stereotype.Component; |
7 | +import org.springframework.transaction.annotation.Transactional; | |
7 | 8 | |
8 | 9 | /** |
9 | 10 | * @author : kurisu |
... | ... | @@ -19,4 +20,9 @@ public class RCFollowStrategy extends AbstractFollowStrategy { |
19 | 20 | public FollowTypeEnum getFollowType() { |
20 | 21 | return FollowTypeEnum.RC; |
21 | 22 | } |
23 | + @Override | |
24 | + @Transactional(rollbackFor = Exception.class) | |
25 | + public void secondTaskStopRecord(final Long taskId) { | |
26 | + // 没有二次分配 | |
27 | + } | |
22 | 28 | } | ... | ... |
fw-shirasawa-service/src/main/java/cn/fw/shirasawa/service/bus/follow/strategy/impl/RVFollowStrategy.java
... | ... | @@ -4,6 +4,7 @@ import cn.fw.shirasawa.domain.enums.FollowTypeEnum; |
4 | 4 | import cn.fw.shirasawa.service.bus.follow.strategy.AbstractFollowStrategy; |
5 | 5 | import lombok.extern.slf4j.Slf4j; |
6 | 6 | import org.springframework.stereotype.Component; |
7 | +import org.springframework.transaction.annotation.Transactional; | |
7 | 8 | |
8 | 9 | /** |
9 | 10 | * @author : kurisu |
... | ... | @@ -20,4 +21,9 @@ public class RVFollowStrategy extends AbstractFollowStrategy { |
20 | 21 | return FollowTypeEnum.RV; |
21 | 22 | } |
22 | 23 | |
24 | + @Override | |
25 | + @Transactional(rollbackFor = Exception.class) | |
26 | + public void secondTaskStopRecord(final Long taskId) { | |
27 | + // 没有二次分配 | |
28 | + } | |
23 | 29 | } | ... | ... |
fw-shirasawa-service/src/main/java/cn/fw/shirasawa/service/bus/follow/strategy/impl/SFFollowStrategy.java
... | ... | @@ -4,6 +4,7 @@ import cn.fw.shirasawa.domain.enums.FollowTypeEnum; |
4 | 4 | import cn.fw.shirasawa.service.bus.follow.strategy.AbstractFollowStrategy; |
5 | 5 | import lombok.extern.slf4j.Slf4j; |
6 | 6 | import org.springframework.stereotype.Component; |
7 | +import org.springframework.transaction.annotation.Transactional; | |
7 | 8 | |
8 | 9 | /** |
9 | 10 | * 补贴跟进 |
... | ... | @@ -23,4 +24,9 @@ public class SFFollowStrategy extends AbstractFollowStrategy { |
23 | 24 | public FollowTypeEnum getFollowType() { |
24 | 25 | return FollowTypeEnum.SF; |
25 | 26 | } |
27 | + @Override | |
28 | + @Transactional(rollbackFor = Exception.class) | |
29 | + public void secondTaskStopRecord(final Long taskId) { | |
30 | + // 没有二次分配 | |
31 | + } | |
26 | 32 | } | ... | ... |