Commit 4531d6205d2ce99afe76b92d65a50f8f6f3f9ea4
1 parent
96c22a2a
逾期保险自动生成下一年的保险
Showing
2 changed files
with
32 additions
and
1 deletions
fw-valhalla-service/src/main/java/cn/fw/valhalla/service/bus/follow/strategy/AbstractFollowStrategy.java
... | ... | @@ -851,7 +851,7 @@ public abstract class AbstractFollowStrategy implements FollowStrategy { |
851 | 851 | vo.setTimes(sum); |
852 | 852 | } |
853 | 853 | |
854 | - private void onStopClue(CustomerCluePool clue, TaskDefeatTypeEnum defeatTypeEnum) { | |
854 | + protected void onStopClue(CustomerCluePool clue, TaskDefeatTypeEnum defeatTypeEnum) { | |
855 | 855 | FollowTask task = followTaskService.queryOngoingTaskByClueId(clue.getId()); |
856 | 856 | if (Objects.isNull(task)) { |
857 | 857 | return; | ... | ... |
fw-valhalla-service/src/main/java/cn/fw/valhalla/service/bus/follow/strategy/impl/IRFollowStrategy.java
... | ... | @@ -25,6 +25,7 @@ import cn.fw.valhalla.service.bus.follow.strategy.AbstractFollowStrategy; |
25 | 25 | import cn.fw.valhalla.service.event.CancelApproveEvent; |
26 | 26 | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
27 | 27 | import lombok.extern.slf4j.Slf4j; |
28 | +import org.springframework.beans.BeanUtils; | |
28 | 29 | import org.springframework.stereotype.Component; |
29 | 30 | import org.springframework.transaction.annotation.Transactional; |
30 | 31 | import org.springframework.util.CollectionUtils; |
... | ... | @@ -277,6 +278,36 @@ public class IRFollowStrategy extends AbstractFollowStrategy { |
277 | 278 | |
278 | 279 | @Override |
279 | 280 | @Transactional(rollbackFor = Exception.class) |
281 | + public void forceStopClue(CustomerCluePool clue) { | |
282 | + onStopClue(clue, TaskDefeatTypeEnum.A); | |
283 | + clue.setClueStatus(ClueStatusEnum.FAILURE); | |
284 | + clue.setCloseTime(new Date()); | |
285 | + customerCluePoolService.updateById(clue); | |
286 | + | |
287 | + | |
288 | + Customer customer = customerService.queryById(clue.getRefererId()); | |
289 | + | |
290 | + if (Objects.isNull(customer)) { | |
291 | + return; | |
292 | + } | |
293 | + CustomerCluePool nextClue = new CustomerCluePool(); | |
294 | + BeanUtils.copyProperties(clue, nextClue); | |
295 | + nextClue.setId(null); | |
296 | + nextClue.setClueStatus(ClueStatusEnum.WAITING); | |
297 | + nextClue.setStartTime(DateUtil.getExpiredYear(clue.getStartTime(), 1)); | |
298 | + nextClue.setCloseTime(null); | |
299 | + nextClue.setDeadline(DateUtil.getExpiredYear(clue.getDeadline(), 1)); | |
300 | + nextClue.setAddTime(new Date()); | |
301 | + nextClue.setRedistribution(Boolean.FALSE); | |
302 | + nextClue.setCloseTime(new Date()); | |
303 | + nextClue.setUpdateTime(new Date()); | |
304 | + customerCluePoolService.save(nextClue); | |
305 | + this.createFirstNotice(clue, nextClue.getStartTime()); | |
306 | + } | |
307 | + | |
308 | + | |
309 | + @Override | |
310 | + @Transactional(rollbackFor = Exception.class) | |
280 | 311 | public void overdueProcessing(FollowRecord record) { |
281 | 312 | super.overdueProcessing(record); |
282 | 313 | } | ... | ... |