傅行帆 3 年 前
コミット
1e80a4a1b6

+ 5
- 0
src/main/java/com/yunzhi/marketing/entity/TaRecommendCustomer.java ファイルの表示

@@ -151,6 +151,11 @@ public class TaRecommendCustomer implements Serializable {
151 151
 
152 152
     private LocalDateTime verifyDate;
153 153
 
154
+    /**
155
+     * 流转使劲
156
+     */
157
+    private LocalDateTime circulationTime;
158
+
154 159
     /**
155 160
      * 组织结构id
156 161
      */

+ 32
- 0
src/main/java/com/yunzhi/marketing/job/CustomerTimeJob.java ファイルの表示

@@ -0,0 +1,32 @@
1
+package com.yunzhi.marketing.job;
2
+
3
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
4
+import com.yunzhi.marketing.common.CommConstant;
5
+import com.yunzhi.marketing.entity.TaRecommendCustomer;
6
+import com.yunzhi.marketing.service.ITaRecommendCustomerService;
7
+import org.springframework.beans.factory.annotation.Autowired;
8
+
9
+import java.time.LocalDateTime;
10
+import java.util.List;
11
+
12
+public class CustomerTimeJob {
13
+
14
+    @Autowired
15
+    private ITaRecommendCustomerService taRecommendCustomerService;
16
+
17
+    //    @Scheduled(cron = "* 0/1 * * * ?")
18
+    private void customerTimeJob() {
19
+        LocalDateTime nowDate = LocalDateTime.now();
20
+        LocalDateTime beforeTime = nowDate.plusDays(-15);
21
+        LambdaQueryWrapper<TaRecommendCustomer> queryWrapper = new LambdaQueryWrapper<>();
22
+        queryWrapper.between(TaRecommendCustomer::getCirculationTime,beforeTime,nowDate);
23
+        queryWrapper.eq(TaRecommendCustomer::getVerifyStatus, CommConstant.VERIFY_AGREE);
24
+        List<TaRecommendCustomer> list = taRecommendCustomerService.list(queryWrapper);
25
+        list.forEach(e -> {
26
+            e.setBuildingId(null);
27
+            e.setRealtyConsultant(null);
28
+            e.setRecommendPerson(null);
29
+        });
30
+        taRecommendCustomerService.updateBatchById(list);
31
+    }
32
+}

+ 2
- 0
src/main/java/com/yunzhi/marketing/service/impl/TaRecommendCustomerServiceImpl.java ファイルの表示

@@ -533,6 +533,7 @@ public class TaRecommendCustomerServiceImpl extends ServiceImpl<TaRecommendCusto
533 533
             recommendCustomer.setVerifyStatus(CommConstant.VERIFY_AGREE);
534 534
             recommendCustomer.setStatus(CommConstant.CUSTOMER_REPORT);
535 535
             recommendCustomer.setRecommendPerson(consultant.getPersonId());
536
+            recommendCustomer.setCirculationTime(LocalDateTime.now());
536 537
             customerFrom.setIsProjectFirst(true);
537 538
             customerFrom.setIsOrgFirst(true);
538 539
         }
@@ -1003,6 +1004,7 @@ public class TaRecommendCustomerServiceImpl extends ServiceImpl<TaRecommendCusto
1003 1004
             }
1004 1005
         }
1005 1006
 
1007
+        taRecommendCustomer.setCirculationTime(LocalDateTime.now());
1006 1008
         int row = taRecommendCustomerMapper.insert(taRecommendCustomer);
1007 1009
         if (row < 1) {
1008 1010
             return ResponseBean.error("报备客户失败", ResponseBean.ERROR_UNAVAILABLE);

+ 4
- 0
src/main/java/com/yunzhi/marketing/xlk/service/impl/ChannelCustomerServiceImpl.java ファイルの表示

@@ -78,6 +78,7 @@ public class ChannelCustomerServiceImpl extends ServiceImpl<ChannelCustomerMappe
78 78
             taRecommendCustomer.setEntryType(CommConstant.ENTRY_VERIFY);
79 79
             taRecommendCustomer.setStatus(CommConstant.CUSTOMER_REPORT);
80 80
             taRecommendCustomer.setRealtyConsultant(channelCustomerDTO.getRealtyConsultant());
81
+            taRecommendCustomer.setCirculationTime(LocalDateTime.now());
81 82
             taRecommendCustomerMapper.insert(taRecommendCustomer);
82 83
             return ResponseBean.success("审核成功");
83 84
         }
@@ -131,6 +132,7 @@ public class ChannelCustomerServiceImpl extends ServiceImpl<ChannelCustomerMappe
131 132
                 taRecommendCustomer.setEntryType(CommConstant.ENTRY_VERIFY);
132 133
                 taRecommendCustomer.setStatus(CommConstant.CUSTOMER_VISITE);
133 134
                 taRecommendCustomer.setRealtyConsultant(params.getRealtyConsultant());
135
+                taRecommendCustomer.setCirculationTime(LocalDateTime.now());
134 136
                 taRecommendCustomerMapper.insert(taRecommendCustomer);
135 137
                 return ResponseBean.success("审核成功");
136 138
             }
@@ -146,6 +148,7 @@ public class ChannelCustomerServiceImpl extends ServiceImpl<ChannelCustomerMappe
146 148
                 recommendCustomer.setVerifyStatus(CommConstant.VERIFY_AGREE);
147 149
                 recommendCustomer.setStatus(CommConstant.CUSTOMER_VISITE);
148 150
                 recommendCustomer.setRealtyConsultant(params.getRealtyConsultant());
151
+                recommendCustomer.setCirculationTime(LocalDateTime.now());
149 152
                 taRecommendCustomerMapper.updateById(recommendCustomer);
150 153
                 return ResponseBean.success("审核成功");
151 154
             }
@@ -154,6 +157,7 @@ public class ChannelCustomerServiceImpl extends ServiceImpl<ChannelCustomerMappe
154 157
             TaRecommendCustomer taRecommendCustomer = taRecommendCustomerMapper.selectById(params.getId());
155 158
             taRecommendCustomer.setVerifyStatus(CommConstant.VERIFY_AGREE);
156 159
             taRecommendCustomer.setStatus(CommConstant.CUSTOMER_VISITE);
160
+            taRecommendCustomer.setCirculationTime(LocalDateTime.now());
157 161
             taRecommendCustomerMapper.updateById(taRecommendCustomer);
158 162
             return ResponseBean.success("审核成功");
159 163
         }