wjj 3 napja
szülő
commit
3a9242cb9e

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

@@ -81,7 +81,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);
 }

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

@@ -74,7 +74,7 @@ public interface ICompanyWxClientService extends IService<CompanyWxClient>
 
     List<CompanyWxClient4WorkFlowVO> getAddWxList4Workflow(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);
 

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

@@ -243,8 +243,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);
     }
 
     /**

+ 11 - 5
fs-service/src/main/java/com/fs/company/service/impl/call/node/AbstractWorkflowNode.java

@@ -113,7 +113,7 @@ public abstract class AbstractWorkflowNode implements IWorkflowNode {
         }
         // 校验节点执行是否符合时间设置
         CompanyAiWorkflowExec timeAvailable = companyAiWorkflowExecMapper.selectExecWithTimeAvailableByInstanceId(context.getWorkflowInstanceId());
-        
+
         if (timeAvailable == null) {
             CompanyAiWorkflowExec exec = companyAiWorkflowExecMapper.selectByWorkflowInstanceId(context.getWorkflowInstanceId());
             if (exec == null) {
@@ -130,7 +130,7 @@ public abstract class AbstractWorkflowNode implements IWorkflowNode {
             log.info("当前流程不在可执行时间范围内 continue已被阻塞等待唤醒执行,节点执行等待:- {},- {} -,{}" , nodeName, nodeKey, context.getWorkflowInstanceId());
             return null;
         }
-        
+
         RLock lock = null;
         try {
             String lockKey = NODE_EXEC_LOCK_PREFIX + context.getWorkflowInstanceId();
@@ -150,7 +150,8 @@ public abstract class AbstractWorkflowNode implements IWorkflowNode {
             context.setVariable("currentNode", node);
             // 允许 PAUSED 或 WAITING 状态继续执行
             if (!Integer.valueOf(ExecutionStatusEnum.PAUSED.getValue()).equals(companyAiWorkflowExec.getStatus())
-                    && !Integer.valueOf(ExecutionStatusEnum.WAITING.getValue()).equals(companyAiWorkflowExec.getStatus())) {
+                    && !Integer.valueOf(ExecutionStatusEnum.WAITING.getValue()).equals(companyAiWorkflowExec.getStatus())
+                    && !Integer.valueOf(ExecutionStatusEnum.WAITING_DO_CALL.getValue()).equals(companyAiWorkflowExec.getStatus())) {
                 log.error("工作流状态不符合 - workflowInstanceId: {}, 当前状态: {}, 期望状态: PAUSED({}) 或 WAITING({})",
                         context.getWorkflowInstanceId(), companyAiWorkflowExec.getStatus(),
                         ExecutionStatusEnum.PAUSED.getValue(), ExecutionStatusEnum.WAITING.getValue());
@@ -163,9 +164,14 @@ public abstract class AbstractWorkflowNode implements IWorkflowNode {
             if (lock != null && lock.isHeldByCurrentThread()) {
                 if(getType().equals(NodeTypeEnum.AI_CALL_TASK)){
                     updateLogStatusIfExist(context,ExecutionStatusEnum.PAUSED,ExecutionStatusEnum.SUCCESS);
-                }
-                else if(getType().equals(NodeTypeEnum.AI_ADD_WX_TASK)){
+                } else if(getType().equals(NodeTypeEnum.AI_CALL_TASK)){
+                    updateLogStatusIfExist(context,ExecutionStatusEnum.WAITING_DO_CALL,ExecutionStatusEnum.SUCCESS);
+                } else if(getType().equals(NodeTypeEnum.AI_ADD_WX_TASK)){
+                    updateLogStatusIfExist(context,ExecutionStatusEnum.WAITING,ExecutionStatusEnum.SUCCESS);
+                } else if(getType().equals(NodeTypeEnum.AI_ADD_WX_TASK_NEW)){
                     updateLogStatusIfExist(context,ExecutionStatusEnum.WAITING,ExecutionStatusEnum.SUCCESS);
+                } else if (getType().equals(NodeTypeEnum.OUTBOUND_TASK)) {
+                    updateLogStatusIfExist(context,ExecutionStatusEnum.WAITING_DO_CALL,ExecutionStatusEnum.SUCCESS);
                 }
 
 //                //更新流程日志信息

+ 5 - 1
fs-service/src/main/java/com/fs/enums/NodeTypeEnum.java

@@ -48,7 +48,11 @@ public enum NodeTypeEnum {
     /**
      * AI企微添加个微
      */
-    AI_QW_ADD_WX_TASK("AI_QW_ADD_WX_TASK", "AI企微添加个微",9);
+    AI_QW_ADD_WX_TASK("AI_QW_ADD_WX_TASK", "AI企微添加个微",9),
+    /**
+     * AI添加微信(新)
+     */
+    AI_ADD_WX_TASK_NEW("AI_ADD_WX_TASK_NEW", "AI添加微信(新)", 10);
 
     private final String code;
     private final String description;

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

@@ -174,14 +174,20 @@
         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 t1.create_time >= DATE_SUB(NOW(), INTERVAL 7 DAY)
         <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 - 7
fs-wx-task/src/main/java/com/fs/app/service/WxTaskService.java

@@ -1571,7 +1571,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;
@@ -1728,12 +1728,6 @@ public class WxTaskService {
                 .set(CompanyVoiceRoboticCallLogAddwx::getStatus, 2)
                 .update();
 
-        //更新工作流的执行日志
-//        CompanyAiWorkflowExecLog queryP = new CompanyAiWorkflowExecLog();
-//        queryP.setWorkflowInstanceId(client.getWorkflowInstanceId());
-//        queryP.setNodeKey(client.getNodeKey());
-//        queryP.setStatus(ExecutionStatusEnum.WAITING.getValue());
-//        companyAiWorkflowExecLogMapper.updateCompanyAiWorkflowExecLog(queryP);
 
         client.setIsAdd(1);
         client.setAddTime(LocalDateTime.now());