gongchunyi
13 小时以前 a24a2d86d2ae9f8c2f72ce14ed787c894b86061b
src/main/java/com/ruoyi/basic/service/impl/CustomerServiceImpl.java
@@ -173,17 +173,17 @@
                    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());
@@ -276,7 +276,7 @@
    @Override
    public void syncCustomerJob() {
        syncCustomerData(2);
        syncCustomerData();
    }
    @Override
@@ -322,11 +322,7 @@
     * 同步数据
     */
    @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();
@@ -368,9 +364,6 @@
        } catch (Exception e) {
            log.error("同步客户信息异常", e);
        } finally {
            // 释放锁
            syncLock.unlock();
        }
    }