소스 검색

cid调整

lmx 3 일 전
부모
커밋
022e9c96a8

+ 6 - 2
fs-company/src/main/java/com/fs/company/controller/company/GeneralCustomerEntryController.java

@@ -1,8 +1,10 @@
 package com.fs.company.controller.company;
 
 import com.fs.common.core.domain.R;
+import com.fs.company.param.EntryCustomerParam;
 import com.fs.company.service.IGeneralCustomerEntryService;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
@@ -20,8 +22,10 @@ public class GeneralCustomerEntryController {
     IGeneralCustomerEntryService iGeneralCustomerEntryService;
 
     @PostMapping("/entryCustomer")
-    public R entryCustomer(String param){
-       return iGeneralCustomerEntryService.entryCustomer(param);
+    public R entryCustomer(EntryCustomerParam param){
+        iGeneralCustomerEntryService.entryCustomer(param);
+       return R.ok("success");
     }
 
+
 }

+ 1 - 1
fs-service/src/main/java/com/fs/company/service/IGeneralCustomerEntryService.java

@@ -10,7 +10,7 @@ import com.fs.company.param.EntryCustomerParam;
  */
 public interface IGeneralCustomerEntryService {
 
-    R entryCustomer(String param);
+//    R entryCustomer(String param);
 
     String entryCustomer(EntryCustomerParam param);
 }

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

@@ -466,7 +466,6 @@ public class CompanyVoiceRoboticServiceImpl extends ServiceImpl<CompanyVoiceRobo
                 wxAccount = companyWxAccountService.selectCompanyWxAccountById(wxClient.getAccountId());
             }
 
-
             CompanySmsTemp temp = smsTempService.selectCompanySmsTempById(smsTempId);
 
             if (temp != null && temp.getStatus().equals(1) && temp.getIsAudit().equals(1)) {
@@ -1075,6 +1074,23 @@ public class CompanyVoiceRoboticServiceImpl extends ServiceImpl<CompanyVoiceRobo
         }
     }
 
+    /**
+     * 初始化场景任务客户流程
+     * @param robotic
+     * @param business
+     */
+    private void initWorkflows4SceneTask(CompanyVoiceRobotic robotic,CompanyVoiceRoboticBusiness business) {
+        final Long workflowId = robotic.getCompanyAiWorkflowId();
+        final Long roboticId = robotic.getId();
+        Map<String, Object> inputVariables = new HashMap<>();
+        inputVariables.put("roboticId", roboticId);
+        inputVariables.put("businessId", business.getId());
+        inputVariables.put("cidGroupNo", robotic.getCidGroupNo());
+        inputVariables.put("runtimeRangeStart", robotic.getRuntimeRangeStart());
+        inputVariables.put("runtimeRangeEnd", robotic.getRuntimeRangeEnd());
+        companyWorkflowEngine.initialize(workflowId, inputVariables);
+    }
+
     /**
      * 初始化并执行工作流
      */
@@ -1186,8 +1202,10 @@ public class CompanyVoiceRoboticServiceImpl extends ServiceImpl<CompanyVoiceRobo
             companyWxClientServiceImpl.saveOrUpdate(companyWxClient);
         }
         //写入业务表数据
-        buildTaskBussiness4SceneTask(companyVoiceRobotic,callee);
+        CompanyVoiceRoboticBusiness companyVoiceRoboticBusiness = buildTaskBussiness4SceneTask(companyVoiceRobotic, callee);
         //初始化流程表 todo
+        initWorkflows4SceneTask(companyVoiceRobotic,companyVoiceRoboticBusiness);
+
     }
 
     /**
@@ -1303,7 +1321,7 @@ public class CompanyVoiceRoboticServiceImpl extends ServiceImpl<CompanyVoiceRobo
         return resArr;
     }
 
-    public void buildTaskBussiness4SceneTask(CompanyVoiceRobotic robotic,CompanyVoiceRoboticCallees callee){
+    public CompanyVoiceRoboticBusiness buildTaskBussiness4SceneTask(CompanyVoiceRobotic robotic,CompanyVoiceRoboticCallees callee){
         List<CompanyWxClient> companyWxClients = companyWxClientMapper.selectListByRoboticId(robotic.getId());
         Map<String, CompanyWxClient> clientMp = companyWxClients.stream().collect(Collectors.toMap(e -> e.getRoboticId() + "-" + e.getCustomerId(), e -> e));
         CompanyVoiceRoboticBusiness companyVoiceRoboticBusiness = new CompanyVoiceRoboticBusiness();
@@ -1315,6 +1333,7 @@ public class CompanyVoiceRoboticServiceImpl extends ServiceImpl<CompanyVoiceRobo
         companyVoiceRoboticBusiness.setSendMsgDone(0);
         companyVoiceRoboticBusiness.setCreateTime(new Date());
         companyVoiceRoboticBusinessMapper.insert(companyVoiceRoboticBusiness);
+        return companyVoiceRoboticBusiness;
     }
     public void buildTaskBussiness(CompanyVoiceRobotic robotic) {
         List<CompanyVoiceRoboticCallees> calleesList = companyVoiceRoboticCalleesMapper.selectByRoboticId(robotic.getId());