浏览代码

停用部分定时任务,5月9日客户数据清洗

lvjs 2 月之前
父节点
当前提交
f42c063f11

+ 4 - 3
src/main/java/com/malk/eastar/schedule/ScheduleTask.java

@@ -49,8 +49,9 @@ public class ScheduleTask {
     //add by Jason 20260313 end
 
     /**
+     * 客户私海流出
      */
-    @Scheduled(cron = "0 0 8 * * ?")
+//    @Scheduled(cron = "0 0 8 * * ?")
     public void syncMer() {
         log.info("客户公海同步");
         try {
@@ -75,7 +76,7 @@ public class ScheduleTask {
 
     /**
      */
-    @Scheduled(cron = "0 30 6 * * ?")
+//    @Scheduled(cron = "0 30 6 * * ?")
     public void syncTaskCount() {
         log.info("同步任务状态数量");
         try {
@@ -105,7 +106,7 @@ public class ScheduleTask {
         }
     }
 
-    @Scheduled(cron = "0 30 1 1 1 ?")
+//    @Scheduled(cron = "0 30 1 1 1 ?")
     public void syncCust(){
         log.info("同步客户上一年等级");
         List<Map> list= ydService.queryAllFormData(YDParam.builder().formUuid("FORM-9261FABA687B4D1D917617F53B4A5DB7UN16").build());

+ 37 - 0
src/main/java/com/malk/eastar/schedule/ScheduleTaskNew.java

@@ -88,6 +88,43 @@ public class ScheduleTaskNew {
         }
     }
 
+    /**
+     * 客户数据清洗
+     */
+//    @Scheduled(cron = "0 18 19 * * ?")
+    public void cleanCustomerData20260509() {
+        /*
+            查询(易思达)客户名册所有记录
+         */
+        log.info("查询(易思达)客户名册所有记录");
+        List<Map> ltcCustomerData = new ArrayList<>();
+        try {
+            ltcCustomerData = yidaService.queryLtcAllCustomerData();
+        } catch (Exception e) {
+            log.error("查询(易思达)客户名册异常",e);
+        }
+
+        /*
+            更新字段:
+            进入私海时间、最后跟进时间
+         */
+        String formInstId;
+        long privateSeaTime;
+        long lastContactTime;
+        for (Map ltcCustomerRecord : ltcCustomerData){
+            formInstId = UtilMap.getString(ltcCustomerRecord, "formInstId");
+            System.out.println(ltcCustomerRecord.get("customerName").toString());
+            try {
+                privateSeaTime = DateUtil.current();
+                lastContactTime = privateSeaTime;
+                yidaService.updateLtcCustomerBasicInfo8(formInstId,privateSeaTime,lastContactTime);
+            } catch (Exception e) {
+                log.error("更新易思达系统客户记录异常",e);
+            }
+        }
+        log.info("客户数据清洗完成");
+    }
+
     /**
      * 客户数据清洗
      */

+ 5 - 0
src/main/java/com/malk/eastar/service/YidaService.java

@@ -80,6 +80,11 @@ public interface YidaService {
      */
     void updateLtcCustomerBasicInfo7(String formInstId, String customerLevel, String customerPotentialLevel) throws Exception;
 
+    /**
+     * 更新易思达系统客户基本信息(客户当前分级、客户潜在等级)
+     */
+    void updateLtcCustomerBasicInfo8(String formInstId, long privateSeaTime, long lastContactTime) throws Exception;
+
     /**
      * 更新易思达系统客户的AI表格映射ID
      */

+ 31 - 1
src/main/java/com/malk/eastar/service/impl/YidaServiceImpl.java

@@ -1143,7 +1143,7 @@ public class YidaServiceImpl implements YidaService {
 
     @Override
     public void updateLtcCustomerBasicInfo7(String formInstId, String customerLevel, String customerPotentialLevel) throws Exception {
-/*
+        /*
             参数定义
          */
         YDParam yidaParam;  //HTTP请求体
@@ -1171,6 +1171,36 @@ public class YidaServiceImpl implements YidaService {
         ydClient.operateData(yidaParam,YDConf.FORM_OPERATION.update);
     }
 
+    @Override
+    public void updateLtcCustomerBasicInfo8(String formInstId, long privateSeaTime, long lastContactTime) throws Exception {
+        /*
+            参数定义
+         */
+        YDParam yidaParam;  //HTTP请求体
+        YDParam.YDParamBuilder ydParamBuilder; //宜搭参数构建
+        String updateFormDataJson;  //更新内容
+
+        /*
+            初始化参数值
+         */
+        Map updateFormData = UtilMap.map(
+                "dateField_moxzc25f, dateField_l3tw3kfn",
+                privateSeaTime,
+                lastContactTime
+        );
+        updateFormDataJson = JSONObject.toJSONString(updateFormData);
+        System.out.println(updateFormDataJson);
+
+        /*
+            更新数据
+         */
+        ydParamBuilder = YDParam.builder();
+        ydParamBuilder = ydParamBuilder.formInstId(formInstId);
+        ydParamBuilder = ydParamBuilder.updateFormDataJson(updateFormDataJson);
+        yidaParam = ydParamBuilder.build();
+        ydClient.operateData(yidaParam,YDConf.FORM_OPERATION.update);
+    }
+
     @Override
     public void updateCustomerRelatedAitableId(String formInstId, String aitableId) throws Exception {
         /*