Commit 8bf465d6d3841efa1b853a3fc2ee26eb7ae9eb1b
1 parent
38443fbb
feature(*): 修改人员站岗信息
- 修改人员站岗信息
Showing
13 changed files
with
107 additions
and
73 deletions
fw-valhalla-domain/src/main/java/cn/fw/valhalla/domain/enums/TaskDefeatTypeEnum.java
fw-valhalla-service/src/main/java/cn/fw/valhalla/component/consumer/FollowFlowConsumer.kt
1 | 1 | package cn.fw.valhalla.component.consumer; |
2 | 2 | |
3 | 3 | import cn.fw.shirasawa.sdk.mq.FollowApproveDTO |
4 | +import cn.fw.valhalla.domain.enums.FollowTypeEnum | |
4 | 5 | import cn.fw.valhalla.service.bus.cust.CustomerBizService |
5 | 6 | import cn.fw.valhalla.service.data.ClueTaskService |
6 | -import cn.fw.valhalla.service.data.FollowClueService | |
7 | 7 | import com.alibaba.fastjson.JSONObject |
8 | 8 | import org.apache.rocketmq.spring.annotation.RocketMQMessageListener |
9 | 9 | import org.apache.rocketmq.spring.core.RocketMQListener |
... | ... | @@ -24,8 +24,7 @@ import org.springframework.stereotype.Component |
24 | 24 | ) |
25 | 25 | class FollowFlowConsumer( |
26 | 26 | private val customerBizService: CustomerBizService, |
27 | - private val clueTaskService: ClueTaskService, | |
28 | - private val followClueService: FollowClueService | |
27 | + private val clueTaskService: ClueTaskService | |
29 | 28 | ) : RocketMQListener<FollowApproveDTO> { |
30 | 29 | |
31 | 30 | private val log: Logger = LoggerFactory.getLogger(this.javaClass) |
... | ... | @@ -33,11 +32,8 @@ class FollowFlowConsumer( |
33 | 32 | override fun onMessage(dto: FollowApproveDTO?) { |
34 | 33 | log.info("跟进审批通过MQ消息回调:{}", JSONObject.toJSONString(dto)); |
35 | 34 | dto?.let { data -> |
36 | - val clue = followClueService.getById(data.detailId.toLong()) | |
37 | - clue?.let { | |
38 | - clueTaskService.queryOngoingTaskByClueId(it.id)?.apply { | |
39 | - customerBizService.abandon(this) | |
40 | - } | |
35 | + clueTaskService.queryOngoingTaskByClueId(data.detailId.toLong(), FollowTypeEnum.ofValue(data.type))?.apply { | |
36 | + customerBizService.abandon(this) | |
41 | 37 | } |
42 | 38 | } |
43 | 39 | } | ... | ... |
fw-valhalla-service/src/main/java/cn/fw/valhalla/service/bus/CustomEventListener.java
... | ... | @@ -4,6 +4,7 @@ import cn.fw.valhalla.domain.db.follow.ClueTask; |
4 | 4 | import cn.fw.valhalla.domain.enums.FollowTypeEnum; |
5 | 5 | import cn.fw.valhalla.domain.vo.setting.SettingVO; |
6 | 6 | import cn.fw.valhalla.service.bus.follow.FollowBizService; |
7 | +import cn.fw.valhalla.service.bus.follow.strategy.impl.PubFollowStrategy; | |
7 | 8 | import cn.fw.valhalla.service.bus.setting.SettingBizService; |
8 | 9 | import cn.fw.valhalla.service.event.PublicPoolEvent; |
9 | 10 | import cn.fw.valhalla.service.event.SettingChangeEvent; |
... | ... | @@ -29,12 +30,15 @@ import java.util.Optional; |
29 | 30 | public class CustomEventListener { |
30 | 31 | private final SettingBizService settingBizService; |
31 | 32 | private final FollowBizService followBizService; |
33 | + private final PubFollowStrategy pubFollowStrategy; | |
32 | 34 | |
33 | 35 | @Autowired |
34 | 36 | public CustomEventListener(final SettingBizService settingBizService, |
35 | - final FollowBizService followBizService) { | |
37 | + final FollowBizService followBizService, | |
38 | + final PubFollowStrategy pubFollowStrategy) { | |
36 | 39 | this.settingBizService = settingBizService; |
37 | 40 | this.followBizService = followBizService; |
41 | + this.pubFollowStrategy = pubFollowStrategy; | |
38 | 42 | } |
39 | 43 | |
40 | 44 | /** |
... | ... | @@ -73,7 +77,8 @@ public class CustomEventListener { |
73 | 77 | Long groupId = event.getGroupId(); |
74 | 78 | boolean fromTask = event.isFromTask(); |
75 | 79 | |
76 | - followBizService.stopClue(vin, groupId,fromTask); | |
80 | + followBizService.stopClue(vin, groupId, fromTask); | |
81 | + pubFollowStrategy.clueConvertFailedFromFlow(vin, groupId); | |
77 | 82 | } |
78 | 83 | |
79 | 84 | /** | ... | ... |
fw-valhalla-service/src/main/java/cn/fw/valhalla/service/bus/cust/AccidentPoolBizService.java
... | ... | @@ -107,7 +107,7 @@ public class AccidentPoolBizService { |
107 | 107 | @Transactional(rollbackFor = Exception.class) |
108 | 108 | public void closeTask(FollowClue clue) { |
109 | 109 | clue.setClueState(ClueStatusEnum.FAILURE); |
110 | - ClueTask clueTask = clueTaskService.queryOngoingTaskByClueId(clue.getId()); | |
110 | + ClueTask clueTask = clueTaskService.queryOngoingTaskByClueId(clue.getId(), clue.getClueType()); | |
111 | 111 | if (Objects.nonNull(clueTask)) { |
112 | 112 | clueTask.setState(TaskStateEnum.DEFEAT); |
113 | 113 | clueTask.setReason(TaskDefeatTypeEnum.C); | ... | ... |
fw-valhalla-service/src/main/java/cn/fw/valhalla/service/bus/follow/FollowApiBizService.kt
... | ... | @@ -122,6 +122,6 @@ class FollowApiBizService( |
122 | 122 | if (Objects.isNull(lastOngoingClue)) { |
123 | 123 | return null; |
124 | 124 | } |
125 | - return clueTaskService.queryOngoingTaskByClueId(lastOngoingClue.id); | |
125 | + return clueTaskService.queryOngoingTaskByClueId(lastOngoingClue.id, lastOngoingClue.clueType); | |
126 | 126 | } |
127 | 127 | } | ... | ... |
fw-valhalla-service/src/main/java/cn/fw/valhalla/service/bus/follow/NoticeBizService.java
... | ... | @@ -160,7 +160,7 @@ public class NoticeBizService { |
160 | 160 | record.setStatusDesc(templateResult.getSceneToken().toString()); |
161 | 161 | if (SendStatusEnum.FAILED.equals(record.getStatus())) { |
162 | 162 | Long staffId = customer.getAdviserId(); |
163 | - ClueTask task = clueTaskService.queryOngoingTaskByClueId(cluePool.getId()); | |
163 | + ClueTask task = clueTaskService.queryOngoingTaskByClueId(cluePool.getId(), cluePool.getClueType()); | |
164 | 164 | if (Objects.nonNull(task)) { |
165 | 165 | staffId = task.getFollowUser(); |
166 | 166 | } |
... | ... | @@ -200,7 +200,7 @@ public class NoticeBizService { |
200 | 200 | record.setStatusDesc(templateResult.getSceneToken().toString()); |
201 | 201 | if (SendStatusEnum.FAILED.equals(record.getStatus())) { |
202 | 202 | Long staffId = null; |
203 | - ClueTask task = clueTaskService.queryOngoingTaskByClueId(cluePool.getId()); | |
203 | + ClueTask task = clueTaskService.queryOngoingTaskByClueId(cluePool.getId(), cluePool.getClueType()); | |
204 | 204 | if (Objects.nonNull(task)) { |
205 | 205 | staffId = task.getFollowUser(); |
206 | 206 | } |
... | ... | @@ -239,7 +239,7 @@ public class NoticeBizService { |
239 | 239 | record.setStatusDesc(templateResult.getSceneToken().toString()); |
240 | 240 | if (SendStatusEnum.FAILED.equals(record.getStatus())) { |
241 | 241 | Long staffId = null; |
242 | - ClueTask task = clueTaskService.queryOngoingTaskByClueId(cluePool.getId()); | |
242 | + ClueTask task = clueTaskService.queryOngoingTaskByClueId(cluePool.getId(), cluePool.getClueType()); | |
243 | 243 | if (Objects.nonNull(task)) { |
244 | 244 | staffId = task.getFollowUser(); |
245 | 245 | } | ... | ... |
fw-valhalla-service/src/main/java/cn/fw/valhalla/service/bus/follow/strategy/AbstractFollowStrategy.java
... | ... | @@ -265,7 +265,7 @@ public abstract class AbstractFollowStrategy implements FollowStrategy { |
265 | 265 | clue.setCloseTime(LocalDateTime.now()); |
266 | 266 | followClueService.updateById(clue); |
267 | 267 | redisTemplate.opsForSet().add(generateStopKey(), String.valueOf(clue.getId())); |
268 | - ClueTask task = clueTaskService.queryOngoingTaskByClueId(clue.getId()); | |
268 | + ClueTask task = clueTaskService.queryOngoingTaskByClueId(clue.getId(), clue.getClueType()); | |
269 | 269 | if (Objects.isNull(task)) { |
270 | 270 | return; |
271 | 271 | } |
... | ... | @@ -308,7 +308,7 @@ public abstract class AbstractFollowStrategy implements FollowStrategy { |
308 | 308 | @Override |
309 | 309 | @Transactional(rollbackFor = Exception.class) |
310 | 310 | public void onFollowComplete(FollowClue clue, boolean overdue) { |
311 | - ClueTask task = clueTaskService.queryOngoingTaskByClueId(clue.getId()); | |
311 | + ClueTask task = clueTaskService.queryOngoingTaskByClueId(clue.getId(), clue.getClueType()); | |
312 | 312 | if (!overdue && Objects.nonNull(task)) { |
313 | 313 | Integer times = Optional.ofNullable(task.getTimes()).orElse(0); |
314 | 314 | task.setTimes(times + 1); |
... | ... | @@ -419,7 +419,7 @@ public abstract class AbstractFollowStrategy implements FollowStrategy { |
419 | 419 | if (Objects.isNull(followClue)) { |
420 | 420 | return; |
421 | 421 | } |
422 | - ClueTask clueTask = clueTaskService.queryOngoingTaskByClueId(followClue.getId()); | |
422 | + ClueTask clueTask = clueTaskService.queryOngoingTaskByClueId(followClue.getId(), followClue.getClueType()); | |
423 | 423 | if (Objects.isNull(clueTask)) { |
424 | 424 | return; |
425 | 425 | } | ... | ... |
fw-valhalla-service/src/main/java/cn/fw/valhalla/service/bus/follow/strategy/impl/ACFollowStrategy.java
... | ... | @@ -192,7 +192,7 @@ public class ACFollowStrategy extends AbstractFollowStrategy { |
192 | 192 | if (Objects.isNull(followClue)) { |
193 | 193 | return; |
194 | 194 | } |
195 | - ClueTask clueTask = clueTaskService.queryOngoingTaskByClueId(followClue.getId()); | |
195 | + ClueTask clueTask = clueTaskService.queryOngoingTaskByClueId(followClue.getId(), followClue.getClueType()); | |
196 | 196 | if (Objects.isNull(clueTask)) { |
197 | 197 | return; |
198 | 198 | } | ... | ... |
fw-valhalla-service/src/main/java/cn/fw/valhalla/service/bus/follow/strategy/impl/PubFollowStrategy.java
... | ... | @@ -22,6 +22,7 @@ import cn.fw.valhalla.service.bus.follow.strategy.FollowStrategy; |
22 | 22 | import cn.fw.valhalla.service.bus.setting.SettingBizService; |
23 | 23 | import cn.fw.valhalla.service.data.ClueTaskService; |
24 | 24 | import cn.fw.valhalla.service.data.PubCluePoolService; |
25 | +import com.baomidou.mybatisplus.core.toolkit.Wrappers; | |
25 | 26 | import lombok.extern.slf4j.Slf4j; |
26 | 27 | import org.springframework.beans.factory.annotation.Autowired; |
27 | 28 | import org.springframework.stereotype.Component; |
... | ... | @@ -84,6 +85,7 @@ public class PubFollowStrategy implements FollowStrategy { |
84 | 85 | */ |
85 | 86 | @Override |
86 | 87 | public boolean origin2task(final OriginalData originalData) { |
88 | + // 公共池线索不存在这种场景 | |
87 | 89 | return false; |
88 | 90 | } |
89 | 91 | |
... | ... | @@ -131,7 +133,7 @@ public class PubFollowStrategy implements FollowStrategy { |
131 | 133 | pubClue.setState(PublicClueStateEnum.COMPLETE); |
132 | 134 | pubClue.setCloseTime(LocalDateTime.now()); |
133 | 135 | |
134 | - ClueTask clueTask = clueTaskService.queryOngoingTaskByClueId(pubClue.getId()); | |
136 | + ClueTask clueTask = clueTaskService.queryOngoingTaskByClueId(pubClue.getId(), FollowTypeEnum.PL); | |
135 | 137 | if (Objects.nonNull(clueTask)) { |
136 | 138 | clueTask.setCloseTime(LocalDateTime.now()); |
137 | 139 | clueTask.setFinishUser(pubClue.getAdviserId()); |
... | ... | @@ -152,8 +154,9 @@ public class PubFollowStrategy implements FollowStrategy { |
152 | 154 | public void clueConvertFailed(final PubCluePool pubClue, Long userId, Long shopId) { |
153 | 155 | pubClue.setState(PublicClueStateEnum.DEFEAT); |
154 | 156 | pubClue.setCloseTime(LocalDateTime.now()); |
157 | + pubClue.setDefeatReason(TaskDefeatTypeEnum.F); | |
155 | 158 | |
156 | - ClueTask clueTask = clueTaskService.queryOngoingTaskByClueId(pubClue.getId()); | |
159 | + ClueTask clueTask = clueTaskService.queryOngoingTaskByClueId(pubClue.getId(), FollowTypeEnum.PL); | |
157 | 160 | if (Objects.nonNull(clueTask)) { |
158 | 161 | clueTask.setCloseTime(LocalDateTime.now()); |
159 | 162 | clueTask.setFinishUser(pubClue.getAdviserId()); |
... | ... | @@ -171,6 +174,39 @@ public class PubFollowStrategy implements FollowStrategy { |
171 | 174 | pubCluePoolService.updateById(pubClue); |
172 | 175 | } |
173 | 176 | |
177 | + /** | |
178 | + * 审批而来的数据 | |
179 | + * | |
180 | + * @param vin | |
181 | + * @param groupId | |
182 | + */ | |
183 | + @Transactional(rollbackFor = Exception.class) | |
184 | + public void clueConvertFailedFromFlow(final String vin, final Long groupId) { | |
185 | + PubCluePool cluePool = pubCluePoolService.getOne(Wrappers.<PubCluePool>lambdaQuery() | |
186 | + .eq(PubCluePool::getVin, vin) | |
187 | + .eq(PubCluePool::getGroupId, groupId) | |
188 | + , false); | |
189 | + if (Objects.isNull(cluePool)) { | |
190 | + return; | |
191 | + } | |
192 | + cluePool.setState(PublicClueStateEnum.DEFEAT); | |
193 | + cluePool.setCloseTime(LocalDateTime.now()); | |
194 | + cluePool.setDefeatReason(TaskDefeatTypeEnum.A); | |
195 | + | |
196 | + ClueTask clueTask = clueTaskService.queryOngoingTaskByClueId(cluePool.getId(), FollowTypeEnum.PL); | |
197 | + if (Objects.nonNull(clueTask)) { | |
198 | + clueTask.setCloseTime(LocalDateTime.now()); | |
199 | + clueTask.setState(TaskStateEnum.DEFEAT); | |
200 | + clueTask.setReason(TaskDefeatTypeEnum.A); | |
201 | + boolean rpcSucess = rpcStopTask(clueTask); | |
202 | + clueTask.setRpcSuccess(rpcSucess); | |
203 | + clueTaskService.updateById(clueTask); | |
204 | + } | |
205 | + if (PublicClueStateEnum.ONGOING.equals(cluePool.getState())) { | |
206 | + pubCluePoolService.updateById(cluePool); | |
207 | + } | |
208 | + } | |
209 | + | |
174 | 210 | @Override |
175 | 211 | @Transactional(rollbackFor = Exception.class) |
176 | 212 | public void onRoleChangeCloseTask(final ClueTask task) { |
... | ... | @@ -193,7 +229,7 @@ public class PubFollowStrategy implements FollowStrategy { |
193 | 229 | |
194 | 230 | @Override |
195 | 231 | public void onFollowComplete(final FollowClue clue, final boolean overdue) { |
196 | - ClueTask task = clueTaskService.queryOngoingTaskByClueId(clue.getId()); | |
232 | + ClueTask task = clueTaskService.queryOngoingTaskByClueId(clue.getId(), FollowTypeEnum.PL); | |
197 | 233 | if (!overdue && Objects.nonNull(task)) { |
198 | 234 | Integer times = Optional.ofNullable(task.getTimes()).orElse(0); |
199 | 235 | task.setTimes(times + 1); | ... | ... |
fw-valhalla-service/src/main/java/cn/fw/valhalla/service/bus/pub/PubDistributeBizService.java
... | ... | @@ -267,7 +267,7 @@ public class PubDistributeBizService { |
267 | 267 | , Boolean.FALSE |
268 | 268 | ); |
269 | 269 | if (Objects.nonNull(clue)) { |
270 | - ClueTask clueTask = clueTaskService.queryOngoingTaskByClueId(clue.getId()); | |
270 | + ClueTask clueTask = clueTaskService.queryOngoingTaskByClueId(clue.getId(), clue.getClueType()); | |
271 | 271 | Long followUser = clueTask.getFollowUser(); |
272 | 272 | List<UserRoleDataRangeDTO> roleDataRange = userService.getUserRoleDataRange(followUser, RoleCode.FWGW); |
273 | 273 | if (!staffInfo.getStaffId().equals(followUser) && !CollectionUtils.isEmpty(roleDataRange)) { | ... | ... |
fw-valhalla-service/src/main/java/cn/fw/valhalla/service/bus/pub/PubStandBizService.java
... | ... | @@ -30,9 +30,6 @@ import org.springframework.beans.factory.annotation.Value; |
30 | 30 | import org.springframework.data.redis.core.BoundListOperations; |
31 | 31 | import org.springframework.data.redis.core.StringRedisTemplate; |
32 | 32 | import org.springframework.stereotype.Service; |
33 | -import org.springframework.transaction.PlatformTransactionManager; | |
34 | -import org.springframework.transaction.TransactionDefinition; | |
35 | -import org.springframework.transaction.TransactionStatus; | |
36 | 33 | import org.springframework.transaction.annotation.Transactional; |
37 | 34 | import org.springframework.util.Assert; |
38 | 35 | import org.springframework.util.CollectionUtils; |
... | ... | @@ -65,8 +62,6 @@ public class PubStandBizService { |
65 | 62 | private final PubStandStaffInfoService pubStandStaffInfoService; |
66 | 63 | private final ShirasawaRpcService shirasawaRpcService; |
67 | 64 | private final StringRedisTemplate redisTemplate; |
68 | - private final PlatformTransactionManager platformTransactionManager; | |
69 | - private final TransactionDefinition transactionDefinition; | |
70 | 65 | private final SettingBizService settingBizService; |
71 | 66 | @Value("${spring.cache.custom.global-prefix}:stand:pub") |
72 | 67 | @Getter |
... | ... | @@ -166,7 +161,6 @@ public class PubStandBizService { |
166 | 161 | * |
167 | 162 | * @param staffId |
168 | 163 | */ |
169 | - @DisLock(prefix = "#this.getKeyPrefix()", key = "#staffId", message = "请勿重复站岗") | |
170 | 164 | public void join(final Long staffId) { |
171 | 165 | this.join(staffId, true); |
172 | 166 | } |
... | ... | @@ -174,6 +168,7 @@ public class PubStandBizService { |
174 | 168 | /** |
175 | 169 | * 重置状态 |
176 | 170 | */ |
171 | + @Transactional(rollbackFor = Exception.class) | |
177 | 172 | public void reset() { |
178 | 173 | pubStandStaffInfoService.update(Wrappers.<PubStandStaffInfo>lambdaUpdate() |
179 | 174 | .set(PubStandStaffInfo::getNoInvolved, Boolean.FALSE) |
... | ... | @@ -187,51 +182,46 @@ public class PubStandBizService { |
187 | 182 | * @param staffId |
188 | 183 | * @param manual 手动站岗 |
189 | 184 | */ |
185 | + @DisLock(prefix = "#this.getKeyPrefix()", key = "#staffId", message = "请勿重复站岗") | |
186 | + @Transactional(rollbackFor = Exception.class) | |
190 | 187 | public boolean join(final Long staffId, final boolean manual) { |
191 | - TransactionStatus transactionStatus = platformTransactionManager.getTransaction(transactionDefinition); | |
192 | - try { | |
193 | - final UserInfoDTO user = ehrRpcService.user(staffId); | |
194 | - BV.notNull(user, () -> "人员信息读取失败,请稍后重试"); | |
195 | - List<UserRoleDataRange> range = userRoleRpcService.getUserRoleDataRange(staffId, RoleCode.FWGW); | |
196 | - if (CollectionUtils.isEmpty(range)) { | |
197 | - if (manual) { | |
198 | - throw new BusinessException("非服务顾问无法站岗"); | |
199 | - } | |
200 | - return false; | |
201 | - } | |
202 | - UserRoleDataRange dataRange = range.get(0); | |
203 | - final Long shopId = dataRange.getRangeValue(); | |
204 | - ShopDTO shop = oopService.shop(shopId); | |
205 | - BV.notNull(shop, () -> "门店信息读取失败,请稍后重试"); | |
206 | - final String shopName = shop.getShortName(); | |
207 | - final String cityBh = shop.getCityBh(); | |
208 | - final Long groupId = user.getGroupId(); | |
209 | - Optional<PubStandStaffInfo> staffInfo = pubStandStaffInfoService.queryStaffByGroupId(staffId, groupId); | |
210 | - PubStandStaffInfo info = staffInfo.orElseGet(() -> this.generateStandInfo(user)) | |
211 | - .setShopId(shopId) | |
212 | - .setAreaCode(cityBh) | |
213 | - .setShopName(shopName); | |
188 | + final UserInfoDTO user = ehrRpcService.user(staffId); | |
189 | + BV.notNull(user, () -> "人员信息读取失败,请稍后重试"); | |
190 | + List<UserRoleDataRange> range = userRoleRpcService.getUserRoleDataRange(staffId, RoleCode.FWGW); | |
191 | + if (CollectionUtils.isEmpty(range)) { | |
214 | 192 | if (manual) { |
215 | - info.setNoInvolved(Boolean.FALSE); | |
216 | - } | |
217 | - boolean notodo = Boolean.FALSE.equals(shirasawaRpcService.hasOngoingFollow(staffId)); | |
218 | - if (!notodo && Boolean.FALSE.equals(info.getNoInvolved())) { | |
219 | - info.setLining(Boolean.FALSE); | |
220 | - info.setQueueable(Boolean.FALSE); | |
221 | - info.setReasonOfNoLining("跟进待办未完成"); | |
222 | - pubStandStaffInfoService.saveOrUpdate(info); | |
223 | - } else { | |
224 | - info.setLining(Boolean.TRUE); | |
225 | - info.setQueueable(Boolean.TRUE); | |
226 | - info.setReasonOfNoLining(""); | |
227 | - this.join(info); | |
193 | + throw new BusinessException("非服务顾问无法站岗"); | |
228 | 194 | } |
229 | - platformTransactionManager.commit(transactionStatus); | |
230 | - return true; | |
231 | - } catch (Exception e) { | |
232 | - platformTransactionManager.rollback(transactionStatus); | |
233 | - throw e; | |
195 | + return false; | |
196 | + } | |
197 | + UserRoleDataRange dataRange = range.get(0); | |
198 | + final Long shopId = dataRange.getRangeValue(); | |
199 | + ShopDTO shop = oopService.shop(shopId); | |
200 | + BV.notNull(shop, () -> "门店信息读取失败,请稍后重试"); | |
201 | + final String shopName = shop.getShortName(); | |
202 | + final String cityBh = shop.getCityBh(); | |
203 | + final Long groupId = user.getGroupId(); | |
204 | + Optional<PubStandStaffInfo> staffInfo = pubStandStaffInfoService.queryStaffByGroupId(staffId, groupId); | |
205 | + PubStandStaffInfo info = staffInfo.orElseGet(() -> this.generateStandInfo(user)) | |
206 | + .setShopId(shopId) | |
207 | + .setAreaCode(cityBh) | |
208 | + .setShopName(shopName); | |
209 | + if (manual) { | |
210 | + info.setNoInvolved(Boolean.FALSE); | |
211 | + } | |
212 | + boolean notodo = Boolean.FALSE.equals(shirasawaRpcService.hasOngoingFollow(staffId)); | |
213 | + if (!notodo && Boolean.FALSE.equals(info.getNoInvolved())) { | |
214 | + info.setLining(Boolean.FALSE); | |
215 | + info.setQueueable(Boolean.FALSE); | |
216 | + info.setReasonOfNoLining("跟进待办未完成"); | |
217 | + pubStandStaffInfoService.saveOrUpdate(info); | |
218 | + } else { | |
219 | + info.setLining(Boolean.TRUE); | |
220 | + info.setQueueable(Boolean.TRUE); | |
221 | + info.setReasonOfNoLining(""); | |
222 | + this.join(info); | |
234 | 223 | } |
224 | + return true; | |
235 | 225 | } |
236 | 226 | |
237 | 227 | /** | ... | ... |
fw-valhalla-service/src/main/java/cn/fw/valhalla/service/data/ClueTaskService.java
... | ... | @@ -3,6 +3,7 @@ package cn.fw.valhalla.service.data; |
3 | 3 | import cn.fw.valhalla.domain.db.follow.ClueTask; |
4 | 4 | import cn.fw.valhalla.domain.dto.FollowPoolDTO; |
5 | 5 | import cn.fw.valhalla.domain.dto.ShouldBeCompletedDTO; |
6 | +import cn.fw.valhalla.domain.enums.FollowTypeEnum; | |
6 | 7 | import cn.fw.valhalla.domain.query.BeCompletedQuery; |
7 | 8 | import cn.fw.valhalla.domain.query.FollowPoolQueryVO; |
8 | 9 | import com.baomidou.mybatisplus.extension.service.IService; |
... | ... | @@ -24,9 +25,10 @@ public interface ClueTaskService extends IService<ClueTask> { |
24 | 25 | * 跟进线索id查询进行中的线索任务 |
25 | 26 | * |
26 | 27 | * @param clueId |
28 | + * @param followType | |
27 | 29 | * @return |
28 | 30 | */ |
29 | - ClueTask queryOngoingTaskByClueId(Long clueId); | |
31 | + ClueTask queryOngoingTaskByClueId(Long clueId, FollowTypeEnum followType); | |
30 | 32 | |
31 | 33 | /** |
32 | 34 | * 跟进池查询 | ... | ... |
fw-valhalla-service/src/main/java/cn/fw/valhalla/service/data/impl/ClueTaskServiceImpl.java
... | ... | @@ -4,6 +4,7 @@ import cn.fw.valhalla.dao.mapper.ClueTaskMapper; |
4 | 4 | import cn.fw.valhalla.domain.db.follow.ClueTask; |
5 | 5 | import cn.fw.valhalla.domain.dto.FollowPoolDTO; |
6 | 6 | import cn.fw.valhalla.domain.dto.ShouldBeCompletedDTO; |
7 | +import cn.fw.valhalla.domain.enums.FollowTypeEnum; | |
7 | 8 | import cn.fw.valhalla.domain.enums.TaskStateEnum; |
8 | 9 | import cn.fw.valhalla.domain.query.BeCompletedQuery; |
9 | 10 | import cn.fw.valhalla.domain.query.FollowPoolQueryVO; |
... | ... | @@ -16,6 +17,8 @@ import java.util.ArrayList; |
16 | 17 | import java.util.List; |
17 | 18 | import java.util.Optional; |
18 | 19 | |
20 | +import static cn.fw.common.businessvalidator.Validator.BV; | |
21 | + | |
19 | 22 | /** |
20 | 23 | * 跟进线索任务 |
21 | 24 | * |
... | ... | @@ -28,9 +31,11 @@ import java.util.Optional; |
28 | 31 | @Service |
29 | 32 | public class ClueTaskServiceImpl extends ServiceImpl<ClueTaskMapper, ClueTask> implements ClueTaskService { |
30 | 33 | @Override |
31 | - public ClueTask queryOngoingTaskByClueId(Long clueId) { | |
34 | + public ClueTask queryOngoingTaskByClueId(Long clueId, FollowTypeEnum followType) { | |
35 | + BV.notNull(followType, () -> "跟进类型不正确"); | |
32 | 36 | return this.getOne(Wrappers.<ClueTask>lambdaQuery() |
33 | 37 | .eq(ClueTask::getClueId, clueId) |
38 | + .eq(ClueTask::getType, followType) | |
34 | 39 | .eq(ClueTask::getState, TaskStateEnum.ONGOING) |
35 | 40 | , Boolean.FALSE); |
36 | 41 | } | ... | ... |