lmx 1 день назад
Родитель
Сommit
d4bf7a8476

+ 7 - 0
fs-company/src/main/java/com/fs/company/controller/company/CompanyVoiceRoboticController.java

@@ -21,6 +21,7 @@ import com.fs.common.utils.poi.ExcelUtil;
 import com.fs.company.domain.CompanyVoiceRobotic;
 import com.fs.company.domain.CompanyVoiceRoboticCallees;
 import com.fs.company.domain.CompanyVoiceRoboticWx;
+import com.fs.company.param.PauseRoboticActiveParam;
 import com.fs.company.service.ICompanyVoiceRoboticCallLogCallphoneService;
 import com.fs.company.service.ICompanyVoiceRoboticCalleesService;
 import com.fs.company.service.ICompanyVoiceRoboticService;
@@ -394,4 +395,10 @@ public class CompanyVoiceRoboticController extends BaseController
         LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
         return R.ok().put("companyId", loginUser.getCompany().getCompanyId());
     }
+
+    @PostMapping("/pauseRoboticActive")
+    public R pauseRoboticActive(@RequestBody PauseRoboticActiveParam param){
+        return companyVoiceRoboticService.pauseRoboticActive(param);
+    }
+
 }

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

@@ -82,7 +82,7 @@ public interface CompanyWxClientMapper extends BaseMapper<CompanyWxClient> {
 
     List<CompanyWxClient> getWxClientInfoByCustomerId(@Param("customerId") Long customerId);
 
-    List<CompanyWxClient> getQwAddWxList(@Param("accountIdList") List<Long> accountIdList, @Param("isWeCom") Integer isWeCom);
+    List<CompanyWxClient> getQwAddWxList(@Param("accountIdList") List<Long> accountIdList, @Param("isWeCom") Integer isWeCom, @Param("cidGroupNo") Integer cidGroupNo);
 
     List<CompanyWxClient4WorkFlowVO> getQwAddWxList4Workflow(@Param("accountIdList") List<Long> accountIdList, @Param("execStatus") Integer execStatus, @Param("execNodeType") Integer execNodeType, @Param("cidGroupNo") Integer cidGroupNo);
 

+ 26 - 0
fs-service/src/main/java/com/fs/company/param/PauseRoboticActiveParam.java

@@ -0,0 +1,26 @@
+package com.fs.company.param;
+
+import lombok.Data;
+
+/**
+ * @author MixLiu
+ * @date 2026/4/29 14:33
+ * @description
+ */
+
+@Data
+public class PauseRoboticActiveParam {
+
+    /**
+     * 任务id
+     */
+    private Long taskId;
+
+    /**
+     * 操作类型 1、暂停 2、继续
+     */
+    private Integer activeType;
+
+
+
+}

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

@@ -3,8 +3,10 @@ package com.fs.company.service;
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.fs.aicall.domain.apiresult.PushIIntentionResult;
 import com.fs.aicall.domain.result.CalltaskcreateaiCustomizeResult;
+import com.fs.common.core.domain.R;
 import com.fs.company.domain.CompanyVoiceRobotic;
 import com.fs.company.param.ExecutionContext;
+import com.fs.company.param.PauseRoboticActiveParam;
 import com.fs.company.vo.*;
 
 import java.util.List;
@@ -112,4 +114,6 @@ public interface ICompanyVoiceRoboticService extends IService<CompanyVoiceRoboti
      * @param traceId
      */
     void addNewExec4Task(Long taskId,Long crmCustomerId,String traceId);
+
+    R pauseRoboticActive(PauseRoboticActiveParam param);
 }

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

@@ -75,7 +75,7 @@ public interface ICompanyWxClientService extends IService<CompanyWxClient> {
 
     List<CompanyWxClient4WorkFlowVO> getAddWxList4WorkflowNew(List<Long> accountIdList, Integer cidGroupId);
 
-    List<CompanyWxClient> getQwAddWxList(List<Long> accountIdList,Integer isWeCom);
+    List<CompanyWxClient> getQwAddWxList(List<Long> accountIdList,Integer isWeCom,Integer cidGroupNo);
 
     List<CompanyWxClient4WorkFlowVO> getQwAddWxList4Workflow(List<Long> accountIdList,Integer cidGroupNo);
 }

+ 31 - 0
fs-service/src/main/java/com/fs/company/service/impl/CompanyVoiceRoboticServiceImpl.java

@@ -14,6 +14,7 @@ import com.fs.aicall.domain.result.CalltaskcreateaiCustomizeResult;
 import com.fs.aicall.service.AiCallService;
 import com.fs.common.annotation.DataScope;
 import com.fs.common.constant.Constants;
+import com.fs.common.core.domain.R;
 import com.fs.common.core.domain.entity.SysDictData;
 import com.fs.common.core.redis.RedisCache;
 import com.fs.common.core.redis.RedisCacheT;
@@ -24,6 +25,7 @@ import com.fs.common.utils.*;
 import com.fs.company.domain.*;
 import com.fs.company.mapper.*;
 import com.fs.company.param.ExecutionContext;
+import com.fs.company.param.PauseRoboticActiveParam;
 import com.fs.company.service.*;
 import com.fs.company.vo.*;
 import com.fs.company.vo.easycall.EasyCallCallPhoneVO;
@@ -1832,4 +1834,33 @@ public class CompanyVoiceRoboticServiceImpl extends ServiceImpl<CompanyVoiceRobo
             return new HashMap<>();
         }
     }
+
+    //暂停
+    private final Integer ACTIVE_TYPE_PAUSE = 1;
+    //继续
+    private final Integer ACTIVE_TYPE_CONTINUE = 2;
+
+    /**
+     * 任务暂停 & 恢复操作
+     *
+     * @param param
+     * @return
+     */
+    @Override
+    public R pauseRoboticActive(PauseRoboticActiveParam param) {
+        //暂停任务
+        if (ACTIVE_TYPE_PAUSE.equals(param.getActiveType())) {
+
+            // 暂停任务更新
+
+            // 暂停任务创建的三方外呼任务
+
+        }
+        //恢复任务继续进入可运行
+        else if (ACTIVE_TYPE_CONTINUE.equals(param.getActiveType())) {
+
+        }
+
+        return R.ok("操作成功");
+    }
 }

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

@@ -248,8 +248,8 @@ public class CompanyWxClientServiceImpl extends ServiceImpl<CompanyWxClientMappe
     }
 
     @Override
-    public List<CompanyWxClient> getQwAddWxList(List<Long> accountIdList, Integer isWeCom) {
-        return baseMapper.getQwAddWxList(accountIdList,isWeCom);
+    public List<CompanyWxClient> getQwAddWxList(List<Long> accountIdList, Integer isWeCom , Integer cidGroupNo) {
+        return baseMapper.getQwAddWxList(accountIdList,isWeCom,cidGroupNo);
     }
 
     /**

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

@@ -226,6 +226,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     <select id="selectExecListWithTimeAvailableByStatusAndGroupNo" resultType="CompanyAiWorkflowExec">
         SELECT t1.*
         FROM company_ai_workflow_exec t1
+        inner join company_voice_robotic_business t2 on t1.business_key = t2.id
         where t1.status = #{status}
           and t1.cid_group_no = #{groupNo}
           and NOW() BETWEEN t1.runtime_range_start and t1.runtime_range_end

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

@@ -179,14 +179,20 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         group by account_id
     </select>
     <select id="getQwAddWxList" resultType="com.fs.company.domain.CompanyWxClient">
-        SELECT * FROM company_wx_client where is_add = 2 and account_id is not null
+        SELECT t1.* FROM company_wx_client t1
+          inner join  company_voice_robotic t2 on t1.robotic_id = t2.id
+                    where t1.is_add = 2 and t1.account_id is not null
+                      and t2.task_status = 1 and t2.del_flag != 1
         <if test="accountIdList != null and !accountIdList.isEmpty()">
-            and account_id in <foreach collection="accountIdList" open="(" separator="," close=")" item="item">#{item}</foreach>
+            and t1.account_id in <foreach collection="accountIdList" open="(" separator="," close=")" item="item">#{item}</foreach>
         </if>
         <if test="isWeCom != null">
-            and is_we_com = #{isWeCom}
+            and t1.is_we_com = #{isWeCom}
         </if>
-        group by account_id
+        <if test="cidGroupNo != null">
+            and t2.cid_group_no = #{cidGroupNo}
+        </if>
+--         group by account_id
     </select>
     <select id="getAddWxList4Workflow" resultType="com.fs.company.vo.CompanyWxClient4WorkFlowVO">
 

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

@@ -1811,7 +1811,7 @@ public class WxTaskService {
         log.info("==========执行企微申请加微结果查询任务开始==========");
         try {
             //is_add = 2,状态为加微中且是企微类型
-            List<CompanyWxClient> clients = companyWxClientService.getQwAddWxList(accountIdList, 2);
+           List<CompanyWxClient> clients = companyWxClientService.getQwAddWxList(accountIdList, 2,cidGroupNo);
            log.info("企微申请加微结果查询任务需要查询的数量:{}", clients.size());
 
             if (clients.isEmpty()) return;