|
|
@@ -1,5 +1,6 @@
|
|
|
package com.malk.eastar.schedule;
|
|
|
|
|
|
+import cn.hutool.core.date.DateUtil;
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.malk.eastar.service.AitableService;
|
|
|
@@ -34,6 +35,91 @@ public class ScheduleTask3 {
|
|
|
@Autowired
|
|
|
private DDCoreClient ddCoreClient;
|
|
|
|
|
|
+ /**
|
|
|
+ * 客户数据清洗(建联状态)
|
|
|
+ */
|
|
|
+// @Scheduled(cron = "0 30 17 * * ?")
|
|
|
+ public void cleanCustomerData20260821() {
|
|
|
+ System.out.println("客户数据清洗(进入私海时间)开始");
|
|
|
+
|
|
|
+ /*
|
|
|
+ 获取所有客户
|
|
|
+ */
|
|
|
+ List<Map> ltcCustomerData = new ArrayList<>();
|
|
|
+ try {
|
|
|
+ System.out.println("查询(易思达)客户名册");
|
|
|
+ ltcCustomerData = yidaService.queryLtcAllCustomerData();
|
|
|
+ System.out.println("易思达系统客户数量="+ltcCustomerData.size());
|
|
|
+ } catch (Exception e) {
|
|
|
+ log.error("查询(易思达)客户名册异常",e);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ /*
|
|
|
+ 获取所有询价与报价
|
|
|
+ */
|
|
|
+ List<Map> rfqData = new ArrayList<>();
|
|
|
+ try {
|
|
|
+ System.out.println("查询询价与报价记录");
|
|
|
+ rfqData = yidaService.queryLtcRFQData();
|
|
|
+ System.out.println("询价与报价记录数量="+rfqData.size());
|
|
|
+ } catch (Exception e) {
|
|
|
+ log.error("查询询价与报价记录异常",e);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ /*
|
|
|
+ 筛选客户
|
|
|
+ 私海客户、建联状态不等于已建联、询价与报价记录存在
|
|
|
+ */
|
|
|
+ List<Map> customerDataWithEmptyPrivateTime = new ArrayList<>();
|
|
|
+ String customerCode1;
|
|
|
+ String customerCode2;
|
|
|
+ for(Map ltcCustomerRecord : ltcCustomerData){
|
|
|
+ try{
|
|
|
+ if("公".equals(ltcCustomerRecord.get("seaType").toString())){
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ if(ltcCustomerRecord.get("establishStatus")!=null && "已建联".equals(ltcCustomerRecord.get("establishStatus").toString())){
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ customerCode1 = ltcCustomerRecord.get("customerCode").toString();
|
|
|
+ for (int i = 0; i < rfqData.size(); i++) {
|
|
|
+ customerCode2 = rfqData.get(i).get("customerCode").toString();
|
|
|
+ if(customerCode1.equals(customerCode2)){ //有询报价记录
|
|
|
+ System.out.println("customerCode="+customerCode1);
|
|
|
+ customerDataWithEmptyPrivateTime.add(ltcCustomerRecord);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } catch (Exception e) {
|
|
|
+ log.error("筛选客户异常",e);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ System.out.println("筛选客户数量="+customerDataWithEmptyPrivateTime.size());
|
|
|
+
|
|
|
+ /*
|
|
|
+ 进入私海时间、最近跟进时间更新为2026-08-21 00:00:00
|
|
|
+ */
|
|
|
+ String formInstId;
|
|
|
+ long today = DateUtil.parse("2026-08-21 00:00:00").getTime();
|
|
|
+ System.out.println(today);
|
|
|
+ int count = 0;
|
|
|
+ for(Map customerData : customerDataWithEmptyPrivateTime){
|
|
|
+ formInstId = customerData.get("formInstId").toString();
|
|
|
+ try {
|
|
|
+ yidaService.updateLtcCustomerBasicInfo8(formInstId,today,today);
|
|
|
+ count++;
|
|
|
+ System.out.println("更新进度:"+count+"/"+customerDataWithEmptyPrivateTime.size());
|
|
|
+ } catch (Exception e) {
|
|
|
+ log.error("更新易思达系统客户记录异常",e);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ System.out.println("客户数据清洗(进入私海时间)结束");
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 对比易思达系统和项目总表的客户业务员差异
|
|
|
*/
|