lmx 3 日 前
コミット
e38e0ba848

+ 4 - 4
fs-cid-workflow/src/main/java/com/fs/app/task/CidTask.java

@@ -43,10 +43,10 @@ public class CidTask {
     /**
      * 扫描服务定时任务执行
      */
-    @Scheduled(cron = "0 0/1 * * * ?")
-    public void runContinueTask() {
-        cidWorkflowTaskService.runContinueTask();
-    }
+//    @Scheduled(cron = "0 0/1 * * * ?")
+//    public void runContinueTask() {
+//        cidWorkflowTaskService.runContinueTask();
+//    }
 
 
 

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

@@ -73,7 +73,7 @@ public interface CompanyWxClientMapper extends BaseMapper<CompanyWxClient> {
 
     List<CompanyWxClient> getAddWxList(@Param("accountIdList") List<Long> accountIdList, @Param("isWeCom") Integer isWeCom);
 
-    List<CompanyWxClient4WorkFlowVO> getAddWxList4Workflow(@Param("accountIdList") List<Long> accountIdList, @Param("execStatus") Integer execStatus, @Param("execNodeType") Integer execNodeType);
+    List<CompanyWxClient4WorkFlowVO> getAddWxList4Workflow(@Param("accountIdList") List<Long> accountIdList, @Param("execStatus") Integer execStatus, @Param("execNodeType") Integer execNodeType, @Param("cidGroupId") Integer cidGroupId);
 
     CompanyWxClient selectWx(@Param("accountId") Long accountId, @Param("v3") String v3);
 

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

@@ -71,7 +71,7 @@ public interface ICompanyWxClientService extends IService<CompanyWxClient> {
 
     List<CompanyWxClient> getAddWxList(List<Long> accountIdList,Integer isWeCom);
 
-    List<CompanyWxClient4WorkFlowVO> getAddWxList4Workflow(List<Long> accountIdList);
+    List<CompanyWxClient4WorkFlowVO> getAddWxList4Workflow(List<Long> accountIdList,Integer cidGroupId);
 
     List<CompanyWxClient> getQwAddWxList(List<Long> accountIdList,Integer isWeCom);
 

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

@@ -28,6 +28,8 @@ import com.fs.crm.domain.CrmCustomer;
 import com.fs.crm.mapper.CrmCustomerMapper;
 import com.fs.crm.param.SmsSendBatchParam;
 import com.fs.crm.service.impl.CrmCustomerServiceImpl;
+import com.fs.enums.ExecutionStatusEnum;
+import com.fs.enums.NodeTypeEnum;
 import com.fs.qw.domain.QwUser;
 import com.fs.qw.mapper.QwUserMapper;
 import com.fs.qw.service.impl.QwExternalContactServiceImpl;
@@ -1241,11 +1243,13 @@ public class CompanyVoiceRoboticServiceImpl extends ServiceImpl<CompanyVoiceRobo
         for (WorkflowExecRecordVo record : records) {
             // 设置工作流状态名称
             if (record.getWorkflowStatus() != null) {
-                record.setWorkflowStatusName(getStatusName(record.getWorkflowStatus()));
+                ExecutionStatusEnum executionStatusEnum = ExecutionStatusEnum.fromValue(record.getWorkflowStatus());
+                record.setWorkflowStatusName( executionStatusEnum.getDescription());
             }
             // 设置节点类型名称
             if (record.getCurrentNodeType() != null) {
-                record.setCurrentNodeTypeName(getNodeTypeName(record.getCurrentNodeType()));
+                NodeTypeEnum nodeTypeEnum = NodeTypeEnum.fromValue(record.getCurrentNodeType());
+                record.setCurrentNodeTypeName(nodeTypeEnum.getDescription());
             }
             // 查询节点执行日志
             if (record.getWorkflowInstanceId() != null) {

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

@@ -238,8 +238,8 @@ public class CompanyWxClientServiceImpl extends ServiceImpl<CompanyWxClientMappe
      * @return
      */
     @Override
-    public  List<CompanyWxClient4WorkFlowVO> getAddWxList4Workflow(List<Long> accountIdList){
-        return baseMapper.getAddWxList4Workflow(accountIdList, ExecutionStatusEnum.PAUSED.getValue(), NodeTypeEnum.AI_ADD_WX_TASK.getValue());
+    public  List<CompanyWxClient4WorkFlowVO> getAddWxList4Workflow(List<Long> accountIdList,Integer cidGroupId){
+        return baseMapper.getAddWxList4Workflow(accountIdList, ExecutionStatusEnum.PAUSED.getValue(), NodeTypeEnum.AI_ADD_WX_TASK.getValue(),cidGroupId);
     }
 
     @Override

+ 7 - 0
fs-service/src/main/java/com/fs/company/service/impl/call/node/AiCallTaskNode.java

@@ -171,6 +171,13 @@ public class AiCallTaskNode extends AbstractWorkflowNode {
                 if (bus == null) {
                     return ExecutionResult.failure().errorMessage("未找到业务数据").build();
                 }
+                //手动外呼配置 1、人工 2、ai外呼
+                if(Integer.valueOf(1).equals(callConfigVo.getCallMode())){
+                    super.asyncWorkflowForBlockingNode(context.getWorkflowInstanceId(), context.getCurrentNodeKey(), context, ExecutionStatusEnum.WAITING_DO_CALL);
+                    return ExecutionResult.paused()
+                            .outputData(context.getVariables())
+                            .nextNodeKey("").build();
+                }
 //                companyVoiceRoboticService.workflowCallPhoneOne(bus.getRoboticId(), bus.getCalleeId(), context, callConfigVo);
                 // EasyCallCenter365 外呼
                  workflowCallPhoneOne4EasyCall(bus.getRoboticId(),bus.getCalleeId(), context, callConfigVo);

+ 4 - 0
fs-service/src/main/java/com/fs/company/vo/AiCallConfigVO.java

@@ -60,4 +60,8 @@ public class AiCallConfigVO {
      */
     private String busiGroupId;
 
+    /**
+     * 外呼模式
+     */
+    private Integer callMode;
 }

+ 6 - 1
fs-service/src/main/java/com/fs/enums/ExecutionStatusEnum.java

@@ -53,7 +53,12 @@ public enum ExecutionStatusEnum {
     /**
      * 待处理
      */
-    PENDING("PENDING", "待处理", 10);
+    PENDING("PENDING", "待处理", 10),
+
+    /**
+     * 等待人工外呼
+     */
+    WAITING_DO_CALL("WAITINGDOCALL", "等待人工外呼", 11);
 
     private final String code;
     private final String description;

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

@@ -182,7 +182,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
                              inner join company_voice_robotic_business t2 on t1.id = t2.wx_client_id and t1.robotic_id = t2.robotic_id
                              inner join company_ai_workflow_exec t3 on t3.business_key = t2.id
         where t1.is_add = 0 and t1.account_id is not null and t1.is_we_com = 1
-        and t3.current_node_type = #{execNodeType} And t3.status = #{execStatus}
+        and t3.current_node_type = #{execNodeType} And t3.status = #{execStatus} and t3.cid_group_no = #{cidGroupId}
         <if test="accountIdList != null and !accountIdList.isEmpty()">
             and t1.account_id in <foreach collection="accountIdList" open="(" separator="," close=")" item="item">#{item}</foreach>
         </if>

+ 1 - 1
fs-wx-task/src/main/java/com/fs/app/service/WxTaskService.java

@@ -252,7 +252,7 @@ public class WxTaskService {
         String json = sysConfigService.selectConfigByKey("wx.config");
         WxConfig config = JSONUtil.toBean(json, WxConfig.class);
         // 需要添加微信的列表
-        List<CompanyWxClient4WorkFlowVO> list = companyWxClientService.getAddWxList4Workflow(accountIdList);
+        List<CompanyWxClient4WorkFlowVO> list = companyWxClientService.getAddWxList4Workflow(accountIdList,cidGroupNo);
         log.info("需要添加微信的数量:{}", list.size());
         if (list.isEmpty()) return;
         List<CompanyWxClient> addList = new ArrayList<>();