Commit 3c832cf52976031172373d88c4e8e737928e5f0d
Merge remote-tracking branch 'origin/test'
Showing
8 changed files
with
32 additions
and
13 deletions
fw-valhalla-server/src/main/java/cn/fw/valhalla/controller/api/CustomerApiServiceImpl.java
... | ... | @@ -73,7 +73,7 @@ public class CustomerApiServiceImpl implements CustomerApiService { |
73 | 73 | final String msg = "查询保有客档案[queryById]"; |
74 | 74 | log.info("{}: param[{}]", msg, customerId); |
75 | 75 | try { |
76 | - CustomerDetailDto detailDto = customerBiz.queryById(customerId); | |
76 | + CustomerDetailDto detailDto = customerBiz.queryById(customerId, Boolean.FALSE); | |
77 | 77 | if (Objects.isNull(detailDto)) { |
78 | 78 | log.info("{} 成功: 查无此档案", msg); |
79 | 79 | return success(); | ... | ... |
fw-valhalla-service/src/main/java/cn/fw/valhalla/service/bus/cust/CustomerBizService.java
... | ... | @@ -96,7 +96,7 @@ public class CustomerBizService extends AbstractCustomerService { |
96 | 96 | * @return |
97 | 97 | */ |
98 | 98 | public CustomerDetailVO getDetailById(final Long cusId) { |
99 | - CustomerDetailDto detailDto = queryById(cusId); | |
99 | + CustomerDetailDto detailDto = queryById(cusId, Boolean.FALSE); | |
100 | 100 | BV.notNull(detailDto, () -> "查无此档案"); |
101 | 101 | CustomerDetailVO vo = new CustomerDetailVO(); |
102 | 102 | BeanUtils.copyProperties(detailDto, vo); |
... | ... | @@ -296,8 +296,13 @@ public class CustomerBizService extends AbstractCustomerService { |
296 | 296 | * @param cusId |
297 | 297 | * @return |
298 | 298 | */ |
299 | - public CustomerDetailDto queryById(final Long cusId) { | |
300 | - Customer customer = customerService.queryById(cusId); | |
299 | + public CustomerDetailDto queryById(final Long cusId, final Boolean needInvalid) { | |
300 | + Customer customer; | |
301 | + if (Boolean.TRUE.equals(needInvalid)) { | |
302 | + customer = customerService.queryByIdWithInvalid(cusId); | |
303 | + } else { | |
304 | + customer = customerService.queryById(cusId); | |
305 | + } | |
301 | 306 | if (Objects.isNull(customer)) { |
302 | 307 | return null; |
303 | 308 | } |
... | ... | @@ -335,7 +340,7 @@ public class CustomerBizService extends AbstractCustomerService { |
335 | 340 | */ |
336 | 341 | @Transactional(rollbackFor = Exception.class) |
337 | 342 | public void abandon(final Long customerId, final String reason) { |
338 | - CustomerDetailDto detailDto = queryById(customerId); | |
343 | + CustomerDetailDto detailDto = queryById(customerId, Boolean.FALSE); | |
339 | 344 | BV.notNull(detailDto, () -> "档案不存在"); |
340 | 345 | if (publicPoolService.queryByPlate(detailDto.getPlateNo(), detailDto.getGroupId()).isPresent()) { |
341 | 346 | return; |
... | ... | @@ -364,7 +369,7 @@ public class CustomerBizService extends AbstractCustomerService { |
364 | 369 | */ |
365 | 370 | @Transactional(rollbackFor = Exception.class) |
366 | 371 | public void abandon(final FollowTask task, boolean flow) { |
367 | - CustomerDetailDto detailDto = queryById(task.getCustomerId()); | |
372 | + CustomerDetailDto detailDto = queryById(task.getCustomerId(), Boolean.FALSE); | |
368 | 373 | if (Objects.isNull(detailDto)) { |
369 | 374 | return; |
370 | 375 | } | ... | ... |
fw-valhalla-service/src/main/java/cn/fw/valhalla/service/bus/follow/strategy/impl/ACFollowStrategy.java
... | ... | @@ -287,7 +287,7 @@ public class ACFollowStrategy extends AbstractFollowStrategy { |
287 | 287 | vo.setPlateNo(accidentPool.getPlateNo()); |
288 | 288 | vo.setCarModel(getStrWithDefault(accidentPool.getBrandName(),"") + " " + getStrWithDefault(accidentPool.getSeriesName(), "")); |
289 | 289 | if (Objects.nonNull(customer)) { |
290 | - CustomerDetailDto customerDetailDto = customerBizService.queryById(customer.getId()); | |
290 | + CustomerDetailDto customerDetailDto = customerBizService.queryById(customer.getId(), Boolean.TRUE); | |
291 | 291 | vo.setCustomerId(customer.getId()); |
292 | 292 | vo.setAdviserId(customerDetailDto.getAdviserId()); |
293 | 293 | vo.setAdviserName(customerDetailDto.getAdviserName()); | ... | ... |
fw-valhalla-service/src/main/java/cn/fw/valhalla/service/bus/follow/strategy/impl/FMFollowStrategy.java
... | ... | @@ -52,7 +52,7 @@ public class FMFollowStrategy extends AbstractFollowStrategy { |
52 | 52 | vo.setTaskId(followRecord.getTaskId()); |
53 | 53 | vo.setCustomerId(followRecord.getCustomerId()); |
54 | 54 | vo.setDeadline(followRecord.getDeadline()); |
55 | - CustomerDetailDto customerDetailDto = customerBizService.queryById(followRecord.getCustomerId()); | |
55 | + CustomerDetailDto customerDetailDto = customerBizService.queryById(followRecord.getCustomerId(), Boolean.FALSE); | |
56 | 56 | if (Objects.nonNull(customerDetailDto)) { |
57 | 57 | vo.setName(customerDetailDto.getName()); |
58 | 58 | vo.setPlateNo(customerDetailDto.getPlateNo()); |
... | ... | @@ -174,7 +174,7 @@ public class FMFollowStrategy extends AbstractFollowStrategy { |
174 | 174 | |
175 | 175 | @Override |
176 | 176 | public FMDetailVO assemble(Long customerId) { |
177 | - CustomerDetailDto customerDetailDto = customerBizService.queryById(customerId); | |
177 | + CustomerDetailDto customerDetailDto = customerBizService.queryById(customerId, Boolean.TRUE); | |
178 | 178 | FMDetailVO vo = new FMDetailVO(); |
179 | 179 | vo.setVin(customerDetailDto.getFrameNo()); |
180 | 180 | vo.setCustomerId(customerId); | ... | ... |
fw-valhalla-service/src/main/java/cn/fw/valhalla/service/bus/follow/strategy/impl/IRFollowStrategy.java
... | ... | @@ -62,7 +62,7 @@ public class IRFollowStrategy extends AbstractFollowStrategy { |
62 | 62 | vo.setTaskId(followRecord.getTaskId()); |
63 | 63 | vo.setCustomerId(followRecord.getCustomerId()); |
64 | 64 | vo.setDeadline(followRecord.getDeadline()); |
65 | - CustomerDetailDto customerDetailDto = customerBizService.queryById(followRecord.getCustomerId()); | |
65 | + CustomerDetailDto customerDetailDto = customerBizService.queryById(followRecord.getCustomerId(), Boolean.TRUE); | |
66 | 66 | vo.setName(customerDetailDto.getName()); |
67 | 67 | vo.setCarImage(customerDetailDto.getCarImage()); |
68 | 68 | vo.setPlateNo(customerDetailDto.getPlateNo()); |
... | ... | @@ -408,7 +408,7 @@ public class IRFollowStrategy extends AbstractFollowStrategy { |
408 | 408 | |
409 | 409 | @Override |
410 | 410 | public IRDetailVO assemble(Long customerId) { |
411 | - CustomerDetailDto detailDto = customerBizService.queryById(customerId); | |
411 | + CustomerDetailDto detailDto = customerBizService.queryById(customerId, Boolean.TRUE); | |
412 | 412 | IRDetailVO vo = new IRDetailVO(); |
413 | 413 | vo.setCustomerId(customerId); |
414 | 414 | vo.setAdviserId(detailDto.getAdviserId()); | ... | ... |
fw-valhalla-service/src/main/java/cn/fw/valhalla/service/bus/follow/strategy/impl/RMFollowStrategy.java
... | ... | @@ -73,7 +73,7 @@ public class RMFollowStrategy extends AbstractFollowStrategy { |
73 | 73 | vo.setTaskId(followRecord.getTaskId()); |
74 | 74 | vo.setCustomerId(followRecord.getCustomerId()); |
75 | 75 | vo.setDeadline(followRecord.getDeadline()); |
76 | - CustomerDetailDto customerDetailDto = customerBizService.queryById(followRecord.getCustomerId()); | |
76 | + CustomerDetailDto customerDetailDto = customerBizService.queryById(followRecord.getCustomerId(), Boolean.TRUE); | |
77 | 77 | vo.setName(customerDetailDto.getName()); |
78 | 78 | vo.setCarImage(customerDetailDto.getCarImage()); |
79 | 79 | vo.setPlateNo(customerDetailDto.getPlateNo()); |
... | ... | @@ -237,7 +237,7 @@ public class RMFollowStrategy extends AbstractFollowStrategy { |
237 | 237 | |
238 | 238 | @Override |
239 | 239 | public RMDetailVO assemble(Long customerId) { |
240 | - CustomerDetailDto customerDetailDto = customerBizService.queryById(customerId); | |
240 | + CustomerDetailDto customerDetailDto = customerBizService.queryById(customerId, Boolean.TRUE); | |
241 | 241 | RMDetailVO vo = new RMDetailVO(); |
242 | 242 | vo.setCustomerId(customerId); |
243 | 243 | vo.setName(customerDetailDto.getName()); | ... | ... |
fw-valhalla-service/src/main/java/cn/fw/valhalla/service/data/CustomerService.java
... | ... | @@ -36,6 +36,13 @@ public interface CustomerService extends IService<Customer> { |
36 | 36 | Customer queryById(Long id); |
37 | 37 | |
38 | 38 | /** |
39 | + * 查询档案需要无效的 | |
40 | + * @param id | |
41 | + * @return | |
42 | + */ | |
43 | + Customer queryByIdWithInvalid(Long id); | |
44 | + | |
45 | + /** | |
39 | 46 | * 根据车牌号查询档案信息 |
40 | 47 | * |
41 | 48 | * @param plateNo | ... | ... |
fw-valhalla-service/src/main/java/cn/fw/valhalla/service/data/impl/CustomerServiceImpl.java
... | ... | @@ -41,6 +41,13 @@ public class CustomerServiceImpl extends ServiceImpl<CustomerMapper, Customer> i |
41 | 41 | } |
42 | 42 | |
43 | 43 | @Override |
44 | + public Customer queryByIdWithInvalid(Long id) { | |
45 | + return this.getBaseMapper().selectOne(Wrappers.<Customer>lambdaQuery() | |
46 | + .eq(Customer::getId, id) | |
47 | + .last("limit 1")); | |
48 | + } | |
49 | + | |
50 | + @Override | |
44 | 51 | public Customer queryByPlateNo(String plateNo, Long groupId) { |
45 | 52 | return this.getBaseMapper().selectOne(Wrappers.<Customer>lambdaQuery() |
46 | 53 | .eq(Customer::getPlateNo, plateNo) | ... | ... |