lmx 2 gün önce
ebeveyn
işleme
8ed36485b6

+ 4 - 0
fs-service/src/main/java/com/fs/company/domain/CompanyWxClient.java

@@ -88,4 +88,8 @@ public class CompanyWxClient extends BaseEntityTow
     /** 是否微信 */
     @Excel(name = "加微类型1个微2企微(防止add_type被占用)")
     private Integer isWeCom;
+    /**
+     * 投流来源id
+     */
+    private String traceId;
 }

+ 2 - 0
fs-service/src/main/java/com/fs/company/param/EntryCustomerParam.java

@@ -162,5 +162,7 @@ public class EntryCustomerParam {
     private Integer sceneType;
     //对话图
     private String dialogue;
+    //投流id
+    private String traceId;
 
 }

+ 3 - 2
fs-service/src/main/java/com/fs/company/service/ICompanyVoiceRoboticService.java

@@ -97,9 +97,10 @@ public interface ICompanyVoiceRoboticService extends IService<CompanyVoiceRoboti
     void finishAddWxByCallees(Set<Long> roboticIds);
 
     /**
-     *
+     * 入流程执行
      * @param taskId
      * @param crmCustomerId
+     * @param traceId
      */
-    void addNewExec4Task(Long taskId,Long crmCustomerId);
+    void addNewExec4Task(Long taskId,Long crmCustomerId,String traceId);
 }

+ 3 - 2
fs-service/src/main/java/com/fs/company/service/impl/CompanyVoiceRoboticServiceImpl.java

@@ -1145,7 +1145,7 @@ public class CompanyVoiceRoboticServiceImpl extends ServiceImpl<CompanyVoiceRobo
     /**
      * 添加用户到场景任务
      */
-    public void addNewExec4Task(Long taskId, Long crmCustomerId) {
+    public void addNewExec4Task(Long taskId, Long crmCustomerId,String traceId) {
         //保存callees表数据
         CompanyVoiceRobotic companyVoiceRobotic = companyVoiceRoboticMapper.selectCompanyVoiceRoboticById(taskId);
         CrmCustomer crmCustomer = crmCustomerService.selectCrmCustomerById(crmCustomerId);
@@ -1154,6 +1154,7 @@ public class CompanyVoiceRoboticServiceImpl extends ServiceImpl<CompanyVoiceRobo
         client.setRoboticId(taskId);
         client.setCustomerId(crmCustomerId);
         client.setIsWeCom(companyVoiceRobotic.getIsWeCom());
+        client.setTraceId(traceId);
         companyWxClientServiceImpl.insertCompanyWxClient(client);
 
         CompanyVoiceRoboticCallees callee = new CompanyVoiceRoboticCallees();
@@ -1203,7 +1204,7 @@ public class CompanyVoiceRoboticServiceImpl extends ServiceImpl<CompanyVoiceRobo
         }
         //写入业务表数据
         CompanyVoiceRoboticBusiness companyVoiceRoboticBusiness = buildTaskBussiness4SceneTask(companyVoiceRobotic, callee);
-        //初始化流程表 todo
+        //初始化流程表
         initWorkflows4SceneTask(companyVoiceRobotic,companyVoiceRoboticBusiness);
 
     }

+ 14 - 14
fs-service/src/main/java/com/fs/company/service/impl/GeneralCustomerEntryServiceImpl.java

@@ -53,19 +53,19 @@ public class GeneralCustomerEntryServiceImpl implements IGeneralCustomerEntrySer
      * @return
      */
     //@Override
-    public R entryCustomer(String param) {
-        try {
-            String decryptParam = CryptoUtil.decrypt(param);
-            if (StringUtils.isBlank(decryptParam)) {
-                return R.error("参数错误");
-            }
-            List<EntryCustomerParam> list = JSONObject.parseArray(decryptParam, EntryCustomerParam.class);
-            CompletableFuture.runAsync(() -> handleList(list), customerExecutor);
-        } catch (Exception ex) {
-            log.error("录入客户异常", ex);
-        }
-        return R.ok().put("result", "录入成功");
-    }
+//    public R entryCustomer(String param) {
+//        try {
+//            String decryptParam = CryptoUtil.decrypt(param);
+//            if (StringUtils.isBlank(decryptParam)) {
+//                return R.error("参数错误");
+//            }
+//            List<EntryCustomerParam> list = JSONObject.parseArray(decryptParam, EntryCustomerParam.class);
+//            CompletableFuture.runAsync(() -> handleList(list), customerExecutor);
+//        } catch (Exception ex) {
+//            log.error("录入客户异常", ex);
+//        }
+//        return R.ok().put("result", "录入成功");
+//    }
 
     @Override
     @Async("crmCustomerExecutor")
@@ -111,7 +111,7 @@ public class GeneralCustomerEntryServiceImpl implements IGeneralCustomerEntrySer
             CompanyVoiceRobotic companySceneTasks = getCompanySceneTask(data);
             if(null != companySceneTasks){
                 //场景任务存在 加入场景任务队列
-                companyVoiceRoboticService.addNewExec4Task(companySceneTasks.getId(),data.getCustomerId());
+                companyVoiceRoboticService.addNewExec4Task(companySceneTasks.getId(),data.getCustomerId(),data.getTraceId());
             }
         }
     }

+ 4 - 2
fs-service/src/main/java/com/fs/crm/domain/CrmCustomer.java

@@ -190,7 +190,9 @@ public class CrmCustomer extends BaseEntity
     private String shopName;
     // 平台名称
     private String platformName;
-
-
+    /**
+     * 投流来源id
+     */
+    private String traceId;
 
 }

+ 2 - 0
fs-service/src/main/resources/mapper/company/CompanyWxClientMapper.xml

@@ -94,6 +94,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="addTime != null">add_time,</if>
             <if test="remark != null">remark,</if>
             <if test="createTime != null">create_time,</if>
+            <if test="traceId != null">trace_id,</if>
          </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="roboticWxId != null">#{roboticWxId},</if>
@@ -105,6 +106,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="addTime != null">#{addTime},</if>
             <if test="remark != null">#{remark},</if>
             <if test="createTime != null">#{createTime},</if>
+            <if test="traceId != null">#{traceId},</if>
          </trim>
     </insert>
 

+ 2 - 0
fs-service/src/main/resources/mapper/crm/CrmCustomerMapper.xml

@@ -171,6 +171,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="goodsName != null">goods_name,</if>
             <if test="goodsSpecification != null">goods_specification,</if>
             <if test="shopName != null">shop_name,</if>
+            <if test="traceId != null">trace_id,</if>
          </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="customerCode != null">#{customerCode},</if>
@@ -225,6 +226,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="goodsName != null">#{goodsName},</if>
             <if test="goodsSpecification != null">#{goodsSpecification},</if>
             <if test="shopName != null">#{shopName},</if>
+            <if test="traceId != null">#{traceId},</if>
          </trim>
     </insert>