| | |
| | | c.setAddressPhone(address + "(" + phone + ")"); |
| | | |
| | | // 查询最新的跟进记录 |
| | | CustomerFollowUp followUp = customerFollowUpService.getOne( |
| | | new LambdaQueryWrapper<CustomerFollowUp>() |
| | | .eq(CustomerFollowUp::getCustomerId, c.getId()) |
| | | .orderByDesc(CustomerFollowUp::getFollowUpTime) |
| | | .last("LIMIT 1") |
| | | ); |
| | | |
| | | if (followUp != null) { |
| | | c.setFollowUpLevel(followUp.getFollowUpLevel()); |
| | | c.setFollowUpTime(followUp.getFollowUpTime()); |
| | | } |
| | | // CustomerFollowUp followUp = customerFollowUpService.getOne( |
| | | // new LambdaQueryWrapper<CustomerFollowUp>() |
| | | // .eq(CustomerFollowUp::getCustomerId, c.getId()) |
| | | // .orderByDesc(CustomerFollowUp::getFollowUpTime) |
| | | // .last("LIMIT 1") |
| | | // ); |
| | | // |
| | | // if (followUp != null) { |
| | | // c.setFollowUpLevel(followUp.getFollowUpLevel()); |
| | | // c.setFollowUpTime(followUp.getFollowUpTime()); |
| | | // } |
| | | }) |
| | | .collect(Collectors.toList()); |
| | | |
| | |
| | | |
| | | @Override |
| | | public void syncCustomerJob() { |
| | | syncCustomerData(2); |
| | | syncCustomerData(); |
| | | } |
| | | |
| | | @Override |
| | |
| | | * 同步数据 |
| | | */ |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void syncCustomerData(Integer dataSyncType) { |
| | | if (!syncLock.tryLock()) { |
| | | log.warn("同步正在进行中,本次 {} 同步请求被跳过", dataSyncType == 1 ? "手动" : "定时任务"); |
| | | return; |
| | | } |
| | | public void syncCustomerData() { |
| | | try { |
| | | JSONArray searchConditions = new JSONArray(); |
| | | JSONObject statusCondition = new JSONObject(); |
| | |
| | | |
| | | } catch (Exception e) { |
| | | log.error("同步客户信息异常", e); |
| | | } finally { |
| | | // 释放锁 |
| | | syncLock.unlock(); |
| | | } |
| | | } |
| | | |