lmx пре 4 недеља
родитељ
комит
29e3db8ac7

+ 3 - 2
fs-company/src/main/java/com/fs/company/controller/company/CompanyWorkflowController.java

@@ -13,6 +13,7 @@ import com.fs.company.domain.CompanyWorkflowNodeType;
 import com.fs.company.param.CompanyWorkflowSaveParam;
 import com.fs.company.param.CompanyWorkflowSaveParam;
 import com.fs.company.param.CompanyWorkflowUpdateBindWCParam;
 import com.fs.company.param.CompanyWorkflowUpdateBindWCParam;
 import com.fs.company.service.ICompanyWorkflowService;
 import com.fs.company.service.ICompanyWorkflowService;
+import com.fs.company.vo.OptionVO;
 import com.fs.framework.security.LoginUser;
 import com.fs.framework.security.LoginUser;
 import com.fs.framework.service.TokenService;
 import com.fs.framework.service.TokenService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -171,8 +172,8 @@ public class CompanyWorkflowController extends BaseController {
     @GetMapping("/optionList")
     @GetMapping("/optionList")
     public R optionList() {
     public R optionList() {
         LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
         LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
-        companyWorkflowService.optionList(loginUser.getCompany().getCompanyId());
-        return R.ok();
+        List<OptionVO> optionVOS = companyWorkflowService.optionList(loginUser.getCompany().getCompanyId());
+        return R.ok().put("data",optionVOS);
     }
     }
 
 
 }
 }

+ 6 - 4
fs-service/src/main/java/com/fs/aicall/utils/AiCallUtils.java

@@ -87,10 +87,12 @@ public class AiCallUtils {
         CompanyVoiceApiTiantianMapper mapper = SpringUtils.getBean(CompanyVoiceApiTiantianMapper.class);
         CompanyVoiceApiTiantianMapper mapper = SpringUtils.getBean(CompanyVoiceApiTiantianMapper.class);
         CompanyVoiceApiTiantian config = mapper.selectOne(new QueryWrapper<CompanyVoiceApiTiantian>().eq("company_id", companyId));
         CompanyVoiceApiTiantian config = mapper.selectOne(new QueryWrapper<CompanyVoiceApiTiantian>().eq("company_id", companyId));
         AiCallConfig aiCallConfig = new AiCallConfig();
         AiCallConfig aiCallConfig = new AiCallConfig();
-        aiCallConfig.setCustomer(config.getAccount());
-        aiCallConfig.setPassword(config.getPassword());
-        aiCallConfig.setUrl(config.getUrl());
-        aiCallConfig.setDialogUrl(config.getDialogUrl());
+        if(null !=  config){
+            aiCallConfig.setCustomer(config.getAccount());
+            aiCallConfig.setPassword(config.getPassword());
+            aiCallConfig.setUrl(config.getUrl());
+            aiCallConfig.setDialogUrl(config.getDialogUrl());
+        }
         return aiCallConfig;
         return aiCallConfig;
     }
     }
 }
 }

+ 1 - 0
fs-service/src/main/java/com/fs/company/domain/CompanyVoiceRobotic.java

@@ -119,4 +119,5 @@ public class CompanyVoiceRobotic {
     private Map<String, Object> params;
     private Map<String, Object> params;
     //配置短信模板id
     //配置短信模板id
     private Integer smsTempId;
     private Integer smsTempId;
+    private Long companyAiWorkflowId;
 }
 }

+ 49 - 0
fs-service/src/main/java/com/fs/company/domain/CompanyVoiceRoboticBusiness.java

@@ -0,0 +1,49 @@
+package com.fs.company.domain;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.fs.common.annotation.Excel;
+import lombok.Data;
+import com.fs.common.core.domain.BaseEntity;
+import lombok.EqualsAndHashCode;
+
+/**
+ * ai外呼业务对象 company_voice_robotic_business
+ *
+ * @author fs
+ * @date 2026-01-30
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class CompanyVoiceRoboticBusiness extends BaseEntity{
+
+    /** id */
+    @TableId(value = "id", type = IdType.AUTO)
+    private Long id;
+
+    /** 任务id */
+    @Excel(name = "任务id")
+    private Long roboticId;
+
+    /** 外呼id */
+    @Excel(name = "外呼id")
+    private Long calleeId;
+
+    /** 个微信账号id */
+    @Excel(name = "个微信账号id")
+    private Long wxClientId;
+
+    /** 加微动作完成,每次加1 初始0 */
+    @Excel(name = "加微动作完成,每次加1 初始0")
+    private Integer addWxDone;
+
+    /** AI打电话动作完成,每次加1 初始0 */
+    @Excel(name = "AI打电话动作完成,每次加1 初始0")
+    private Integer callPhoneDone;
+
+    /** 发送短信动作完成,每次加1 初始0 */
+    @Excel(name = "发送短信动作完成,每次加1 初始0")
+    private Integer sendMsgDone;
+
+
+}

+ 61 - 0
fs-service/src/main/java/com/fs/company/mapper/CompanyVoiceRoboticBusinessMapper.java

@@ -0,0 +1,61 @@
+package com.fs.company.mapper;
+
+import java.util.List;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.fs.company.domain.CompanyVoiceRoboticBusiness;
+
+/**
+ * ai外呼业务Mapper接口
+ * 
+ * @author fs
+ * @date 2026-01-30
+ */
+public interface CompanyVoiceRoboticBusinessMapper extends BaseMapper<CompanyVoiceRoboticBusiness>{
+    /**
+     * 查询ai外呼业务
+     * 
+     * @param id ai外呼业务主键
+     * @return ai外呼业务
+     */
+    CompanyVoiceRoboticBusiness selectCompanyVoiceRoboticBusinessById(Long id);
+
+    /**
+     * 查询ai外呼业务列表
+     * 
+     * @param companyVoiceRoboticBusiness ai外呼业务
+     * @return ai外呼业务集合
+     */
+    List<CompanyVoiceRoboticBusiness> selectCompanyVoiceRoboticBusinessList(CompanyVoiceRoboticBusiness companyVoiceRoboticBusiness);
+
+    /**
+     * 新增ai外呼业务
+     * 
+     * @param companyVoiceRoboticBusiness ai外呼业务
+     * @return 结果
+     */
+    int insertCompanyVoiceRoboticBusiness(CompanyVoiceRoboticBusiness companyVoiceRoboticBusiness);
+
+    /**
+     * 修改ai外呼业务
+     * 
+     * @param companyVoiceRoboticBusiness ai外呼业务
+     * @return 结果
+     */
+    int updateCompanyVoiceRoboticBusiness(CompanyVoiceRoboticBusiness companyVoiceRoboticBusiness);
+
+    /**
+     * 删除ai外呼业务
+     * 
+     * @param id ai外呼业务主键
+     * @return 结果
+     */
+    int deleteCompanyVoiceRoboticBusinessById(Long id);
+
+    /**
+     * 批量删除ai外呼业务
+     * 
+     * @param ids 需要删除的数据主键集合
+     * @return 结果
+     */
+    int deleteCompanyVoiceRoboticBusinessByIds(Long[] ids);
+}

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

@@ -82,6 +82,8 @@ public class CompanyVoiceRoboticServiceImpl extends ServiceImpl<CompanyVoiceRobo
     private final CompanyVoiceRoboticCallLogSendmsgServiceImpl companyVoiceRoboticCallLogSendmsgService;
     private final CompanyVoiceRoboticCallLogSendmsgServiceImpl companyVoiceRoboticCallLogSendmsgService;
 
 
     private final ICompanyUserService companyUserService;
     private final ICompanyUserService companyUserService;
+
+    private final CompanyVoiceRoboticBusinessMapper companyVoiceRoboticBusinessMapper;
     /**
     /**
      * 查询机器人外呼任务
      * 查询机器人外呼任务
      *
      *
@@ -705,6 +707,8 @@ public class CompanyVoiceRoboticServiceImpl extends ServiceImpl<CompanyVoiceRobo
         if(Integer.valueOf(0).equals(robotic.getAddType())){
         if(Integer.valueOf(0).equals(robotic.getAddType())){
             allocateWx(robotic);
             allocateWx(robotic);
         }
         }
+        //新增启动写入任务业务表数据
+        buildTaskBussiness(robotic);
     }
     }
 
 
     /**
     /**
@@ -760,6 +764,17 @@ public class CompanyVoiceRoboticServiceImpl extends ServiceImpl<CompanyVoiceRobo
         return resArr;
         return resArr;
     }
     }
 
 
+    public void buildTaskBussiness(CompanyVoiceRobotic robotic){
+        List<CompanyVoiceRoboticCallees> calleesList = companyVoiceRoboticCalleesMapper.selectByRoboticId(robotic.getId());
+        List<Long> userIds = calleesList.stream().map(e -> e.getUserId()).collect(Collectors.toList());
+
+        //todo lmx
+        CompanyVoiceRoboticBusiness companyVoiceRoboticBusiness = new CompanyVoiceRoboticBusiness();
+        companyVoiceRoboticBusiness.setRoboticId(robotic.getId());
+
+        companyVoiceRoboticBusinessMapper.insert(companyVoiceRoboticBusiness);
+    }
+
 
 
     // 绑定销售
     // 绑定销售
     private void bindCompany(CompanyWxClient client, List<CompanyVoiceRoboticWx> wxList) {
     private void bindCompany(CompanyWxClient client, List<CompanyVoiceRoboticWx> wxList) {

+ 89 - 0
fs-service/src/main/resources/mapper/company/CompanyVoiceRoboticBusinessMapper.xml

@@ -0,0 +1,89 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.fs.company.mapper.CompanyVoiceRoboticBusinessMapper">
+    
+    <resultMap type="CompanyVoiceRoboticBusiness" id="CompanyVoiceRoboticBusinessResult">
+        <result property="id"    column="id"    />
+        <result property="roboticId"    column="robotic_id"    />
+        <result property="calleeId"    column="callee_id"    />
+        <result property="wxClientId"    column="wx_client_id"    />
+        <result property="addWxDone"    column="add_wx_done"    />
+        <result property="callPhoneDone"    column="call_phone_done"    />
+        <result property="sendMsgDone"    column="send_msg_done"    />
+        <result property="createTime"    column="create_time"    />
+        <result property="updateTime"    column="update_time"    />
+    </resultMap>
+
+    <sql id="selectCompanyVoiceRoboticBusinessVo">
+        select id, robotic_id, callee_id, wx_client_id, add_wx_done, call_phone_done, send_msg_done, create_time, update_time from company_voice_robotic_business
+    </sql>
+
+    <select id="selectCompanyVoiceRoboticBusinessList" parameterType="CompanyVoiceRoboticBusiness" resultMap="CompanyVoiceRoboticBusinessResult">
+        <include refid="selectCompanyVoiceRoboticBusinessVo"/>
+        <where>  
+            <if test="roboticId != null "> and robotic_id = #{roboticId}</if>
+            <if test="calleeId != null "> and callee_id = #{calleeId}</if>
+            <if test="wxClientId != null "> and wx_client_id = #{wxClientId}</if>
+            <if test="addWxDone != null "> and add_wx_done = #{addWxDone}</if>
+            <if test="callPhoneDone != null "> and call_phone_done = #{callPhoneDone}</if>
+            <if test="sendMsgDone != null "> and send_msg_done = #{sendMsgDone}</if>
+        </where>
+    </select>
+    
+    <select id="selectCompanyVoiceRoboticBusinessById" parameterType="Long" resultMap="CompanyVoiceRoboticBusinessResult">
+        <include refid="selectCompanyVoiceRoboticBusinessVo"/>
+        where id = #{id}
+    </select>
+        
+    <insert id="insertCompanyVoiceRoboticBusiness" parameterType="CompanyVoiceRoboticBusiness" useGeneratedKeys="true" keyProperty="id">
+        insert into company_voice_robotic_business
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="roboticId != null">robotic_id,</if>
+            <if test="calleeId != null">callee_id,</if>
+            <if test="wxClientId != null">wx_client_id,</if>
+            <if test="addWxDone != null">add_wx_done,</if>
+            <if test="callPhoneDone != null">call_phone_done,</if>
+            <if test="sendMsgDone != null">send_msg_done,</if>
+            <if test="createTime != null">create_time,</if>
+            <if test="updateTime != null">update_time,</if>
+         </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="roboticId != null">#{roboticId},</if>
+            <if test="calleeId != null">#{calleeId},</if>
+            <if test="wxClientId != null">#{wxClientId},</if>
+            <if test="addWxDone != null">#{addWxDone},</if>
+            <if test="callPhoneDone != null">#{callPhoneDone},</if>
+            <if test="sendMsgDone != null">#{sendMsgDone},</if>
+            <if test="createTime != null">#{createTime},</if>
+            <if test="updateTime != null">#{updateTime},</if>
+         </trim>
+    </insert>
+
+    <update id="updateCompanyVoiceRoboticBusiness" parameterType="CompanyVoiceRoboticBusiness">
+        update company_voice_robotic_business
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="roboticId != null">robotic_id = #{roboticId},</if>
+            <if test="calleeId != null">callee_id = #{calleeId},</if>
+            <if test="wxClientId != null">wx_client_id = #{wxClientId},</if>
+            <if test="addWxDone != null">add_wx_done = #{addWxDone},</if>
+            <if test="callPhoneDone != null">call_phone_done = #{callPhoneDone},</if>
+            <if test="sendMsgDone != null">send_msg_done = #{sendMsgDone},</if>
+            <if test="createTime != null">create_time = #{createTime},</if>
+            <if test="updateTime != null">update_time = #{updateTime},</if>
+        </trim>
+        where id = #{id}
+    </update>
+
+    <delete id="deleteCompanyVoiceRoboticBusinessById" parameterType="Long">
+        delete from company_voice_robotic_business where id = #{id}
+    </delete>
+
+    <delete id="deleteCompanyVoiceRoboticBusinessByIds" parameterType="String">
+        delete from company_voice_robotic_business where id in 
+        <foreach item="id" collection="array" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </delete>
+</mapper>

+ 6 - 0
fs-service/src/main/resources/mapper/company/CompanyVoiceRoboticMapper.xml

@@ -24,6 +24,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="startTime2"    column="start_time2"    />
         <result property="startTime2"    column="start_time2"    />
         <result property="endTime2"    column="end_time2"    />
         <result property="endTime2"    column="end_time2"    />
         <result property="createTime"    column="create_time"    />
         <result property="createTime"    column="create_time"    />
+        <result property="companyAiWorkflowId"    column="company_ai_workflow_id"    />
     </resultMap>
     </resultMap>
 
 
     <sql id="selectCompanyVoiceRoboticVo">
     <sql id="selectCompanyVoiceRoboticVo">
@@ -51,6 +52,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="startTime2 != null  and startTime2 != ''"> and start_time2 = #{startTime2}</if>
             <if test="startTime2 != null  and startTime2 != ''"> and start_time2 = #{startTime2}</if>
             <if test="endTime2 != null  and endTime2 != ''"> and end_time2 = #{endTime2}</if>
             <if test="endTime2 != null  and endTime2 != ''"> and end_time2 = #{endTime2}</if>
             <if test="createUser != null "> and create_user = #{createUser}</if>
             <if test="createUser != null "> and create_user = #{createUser}</if>
+            <if test="companyAiWorkflowId != null "> and company_ai_workflow_id = #{companyAiWorkflowId}</if>
         </where>
         </where>
         order by id desc
         order by id desc
     </select>
     </select>
@@ -77,6 +79,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="startTime2 != null  and startTime2 != ''"> and a.start_time2 = #{startTime2}</if>
             <if test="startTime2 != null  and startTime2 != ''"> and a.start_time2 = #{startTime2}</if>
             <if test="endTime2 != null  and endTime2 != ''"> and a.end_time2 = #{endTime2}</if>
             <if test="endTime2 != null  and endTime2 != ''"> and a.end_time2 = #{endTime2}</if>
             <if test="createUser != null "> and a.create_user = #{createUser}</if>
             <if test="createUser != null "> and a.create_user = #{createUser}</if>
+            <if test="companyAiWorkflowId != null "> and a.company_ai_workflow_id = #{companyAiWorkflowId}</if>
             <if test="params != null">
             <if test="params != null">
                 ${params.dataScope}
                 ${params.dataScope}
             </if>
             </if>
@@ -123,6 +126,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="endTime2 != null">end_time2,</if>
             <if test="endTime2 != null">end_time2,</if>
             <if test="createTime != null">create_time,</if>
             <if test="createTime != null">create_time,</if>
             <if test="createUser != null">create_user,</if>
             <if test="createUser != null">create_user,</if>
+            <if test="companyAiWorkflowId != null">company_ai_workflow_id,</if>
          </trim>
          </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="name != null">#{name},</if>
             <if test="name != null">#{name},</if>
@@ -144,6 +148,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="endTime2 != null">#{endTime2},</if>
             <if test="endTime2 != null">#{endTime2},</if>
             <if test="createTime != null">#{createTime},</if>
             <if test="createTime != null">#{createTime},</if>
             <if test="createUser != null">#{createUser},</if>
             <if test="createUser != null">#{createUser},</if>
+            <if test="companyAiWorkflowId != null">#{companyAiWorkflowId},</if>
          </trim>
          </trim>
     </insert>
     </insert>
 
 
@@ -169,6 +174,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="endTime2 != null">end_time2 = #{endTime2},</if>
             <if test="endTime2 != null">end_time2 = #{endTime2},</if>
             <if test="createTime != null">create_time = #{createTime},</if>
             <if test="createTime != null">create_time = #{createTime},</if>
             <if test="createUser != null">create_user = #{createUser},</if>
             <if test="createUser != null">create_user = #{createUser},</if>
+            <if test="companyAiWorkflowId != null">company_ai_workflow_id = #{companyAiWorkflowId},</if>
         </trim>
         </trim>
         where id = #{id}
         where id = #{id}
     </update>
     </update>