diff --git a/fw-valhalla-service/src/main/java/cn/fw/valhalla/service/bus/follow/strategy/AbstractFollowStrategy.java b/fw-valhalla-service/src/main/java/cn/fw/valhalla/service/bus/follow/strategy/AbstractFollowStrategy.java index d445f3e..1d71a3b 100644 --- a/fw-valhalla-service/src/main/java/cn/fw/valhalla/service/bus/follow/strategy/AbstractFollowStrategy.java +++ b/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 { vo.setTimes(sum); } - private void onStopClue(CustomerCluePool clue, TaskDefeatTypeEnum defeatTypeEnum) { + protected void onStopClue(CustomerCluePool clue, TaskDefeatTypeEnum defeatTypeEnum) { FollowTask task = followTaskService.queryOngoingTaskByClueId(clue.getId()); if (Objects.isNull(task)) { return; diff --git a/fw-valhalla-service/src/main/java/cn/fw/valhalla/service/bus/follow/strategy/impl/IRFollowStrategy.java b/fw-valhalla-service/src/main/java/cn/fw/valhalla/service/bus/follow/strategy/impl/IRFollowStrategy.java index be46112..65c8472 100644 --- a/fw-valhalla-service/src/main/java/cn/fw/valhalla/service/bus/follow/strategy/impl/IRFollowStrategy.java +++ b/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; import cn.fw.valhalla.service.event.CancelApproveEvent; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.BeanUtils; import org.springframework.stereotype.Component; import org.springframework.transaction.annotation.Transactional; import org.springframework.util.CollectionUtils; @@ -277,6 +278,36 @@ public class IRFollowStrategy extends AbstractFollowStrategy { @Override @Transactional(rollbackFor = Exception.class) + public void forceStopClue(CustomerCluePool clue) { + onStopClue(clue, TaskDefeatTypeEnum.A); + clue.setClueStatus(ClueStatusEnum.FAILURE); + clue.setCloseTime(new Date()); + customerCluePoolService.updateById(clue); + + + Customer customer = customerService.queryById(clue.getRefererId()); + + if (Objects.isNull(customer)) { + return; + } + CustomerCluePool nextClue = new CustomerCluePool(); + BeanUtils.copyProperties(clue, nextClue); + nextClue.setId(null); + nextClue.setClueStatus(ClueStatusEnum.WAITING); + nextClue.setStartTime(DateUtil.getExpiredYear(clue.getStartTime(), 1)); + nextClue.setCloseTime(null); + nextClue.setDeadline(DateUtil.getExpiredYear(clue.getDeadline(), 1)); + nextClue.setAddTime(new Date()); + nextClue.setRedistribution(Boolean.FALSE); + nextClue.setCloseTime(new Date()); + nextClue.setUpdateTime(new Date()); + customerCluePoolService.save(nextClue); + this.createFirstNotice(clue, nextClue.getStartTime()); + } + + + @Override + @Transactional(rollbackFor = Exception.class) public void overdueProcessing(FollowRecord record) { super.overdueProcessing(record); }