Просмотр исходного кода

Merge branch 'master' of http://1.14.104.71:10880/root/ylrz_his_scrm_java

caoliqin 1 неделя назад
Родитель
Сommit
993200bbb6

+ 40 - 0
fs-company/src/main/java/com/fs/company/controller/company/WxContactController.java

@@ -0,0 +1,40 @@
+package com.fs.company.controller.company;
+
+import com.fs.common.core.controller.BaseController;
+import com.fs.common.core.page.TableDataInfo;
+import com.fs.wxcid.domain.WxContact;
+import com.fs.wxcid.service.IWxContactService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.List;
+
+/**
+ * 个微联系人Controller
+ *
+ * @author fs
+ * @date 2026-04-23
+ */
+@RestController
+@RequestMapping("/company/wxContact")
+public class WxContactController extends BaseController
+{
+    @Autowired
+    private IWxContactService iWxContactService;
+
+    /**
+     * 查询个微联系人列表
+     */
+    @GetMapping("/list")
+    public TableDataInfo list(WxContact wxContact)
+    {
+        // 开启分页
+        startPage();
+        // 查询联系人列表
+        List<WxContact> list = iWxContactService.selectWxContactList(wxContact);
+        // 返回分页数据
+        return getDataTable(list);
+    }
+}

+ 40 - 0
fs-company/src/main/java/com/fs/company/controller/company/WxMsgLogController.java

@@ -0,0 +1,40 @@
+package com.fs.company.controller.company;
+
+import com.fs.common.core.controller.BaseController;
+import com.fs.common.core.page.TableDataInfo;
+import com.fs.wxcid.domain.WxMsgLog;
+import com.fs.wxcid.service.IWxMsgLogService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.List;
+
+/**
+ * 个微聊天记录Controller
+ *
+ * @author fs
+ * @date 2026-04-23
+ */
+@RestController
+@RequestMapping("/company/wxMsgLog")
+public class WxMsgLogController extends BaseController
+{
+    @Autowired
+    private IWxMsgLogService iWxMsgLogService;
+
+    /**
+     * 查询个微聊天记录列表
+     */
+    @GetMapping("/list")
+    public TableDataInfo list(WxMsgLog wxMsgLog)
+    {
+        // 开启分页
+        startPage();
+        // 查询聊天记录列表
+        List<WxMsgLog> list = iWxMsgLogService.selectWxMsgLogList(wxMsgLog);
+        // 返回分页数据
+        return getDataTable(list);
+    }
+}

+ 7 - 8
fs-service/src/main/java/com/fs/company/service/impl/CompanyWxServiceImpl.java

@@ -17,6 +17,7 @@ import com.fs.company.service.impl.call.node.AiAddWxTaskNode;
 import com.fs.company.service.impl.call.node.AiAddWxTaskNewNode;
 import com.fs.enums.ExecutionStatusEnum;
 import com.fs.enums.NodeTypeEnum;
+import com.fs.wxcid.domain.CidIpadServer;
 import com.fs.wxcid.domain.CidIpadServerUser;
 import com.fs.wxcid.domain.WxContact;
 import com.fs.wxcid.dto.friend.ContactItem;
@@ -277,22 +278,20 @@ public class CompanyWxServiceImpl extends ServiceImpl<CompanyWxAccountMapper, Co
         if ( cidServerId==null ){
             return R.error("请先绑定cid服务");
         }
-        CompanyAiWorkflowServer cidServer = companyAiWorkflowServerMapper.selectCompanyAiWorkflowServerById(companyUser.getCidServerId());
-
-        Long serverId = cidIpadServerService.selectQwIpadServerByAddressId(addressId,cidServer.getGroupNo());
-        if (serverId==null){
-            return  R.error(501,"该地区服务器剩余数量不足");
+        CidIpadServer count = cidIpadServerService.getOne(new QueryWrapper<CidIpadServer>().gt("count", 0).last(" limit 1"));
+        if (count==null){
+            return  R.error(501,"回调服务器不足,请联系管理员");
         }
-        account.setServerId(serverId);
+        account.setServerId(count.getId());
         account.setServerStatus(1);
         updateById(account);
 
-//        cidIpadServerService.subtractServer(serverId);
+        cidIpadServerService.subtractServer(count.getId());
         CidIpadServerUser qwIpadServerUser = new CidIpadServerUser();
         qwIpadServerUser.setCompanyUserId(companyUser.getUserId());
         qwIpadServerUser.setCompanyId(companyUser.getCompanyId());
         qwIpadServerUser.setCreateTime(new Date());
-        qwIpadServerUser.setServerId(serverId);
+        qwIpadServerUser.setServerId(count.getId());
         qwIpadServerUser.setQwUserId(account.getId());
         cidIpadServerUserService.save(qwIpadServerUser);
         return null;

+ 3 - 4
fs-service/src/main/java/com/fs/ipad/WxIpadSendUtils.java

@@ -1,10 +1,9 @@
 package com.fs.ipad;
 
 
-import com.fs.common.core.redis.RedisCacheT;
 import com.fs.ipad.vo.WxBaseVo;
 import com.fs.ipad.vo.WxTxtVo;
-import com.fs.wxwork.service.WxService;
+import com.fs.wxwork.service.WxIpadService;
 import lombok.AllArgsConstructor;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.stereotype.Component;
@@ -14,7 +13,7 @@ import org.springframework.stereotype.Component;
 @AllArgsConstructor
 public class WxIpadSendUtils {
 
-    private final WxService wxService;
+    private final WxIpadService wxIpadService;
 
     /**
      * 发送文本
@@ -23,6 +22,6 @@ public class WxIpadSendUtils {
         WxTxtVo vo = new WxTxtVo();
         vo.setBase(baseVo);
         vo.setContent(txt);
-        wxService.sendTxt(vo);
+        wxIpadService.sendTxt(vo);
     }
 }

+ 1 - 4
fs-service/src/main/java/com/fs/wxwork/service/WxService.java → fs-service/src/main/java/com/fs/wxwork/service/WxIpadService.java

@@ -8,10 +8,7 @@ import com.fs.company.param.AddWxActionParam;
 import com.fs.ipad.vo.WxTxtVo;
 import com.fs.wxcid.domain.CidIpadServer;
 import com.fs.wxcid.service.ICidIpadServerService;
-import com.fs.wxcid.vo.wxvo.WxSendMsgVo;
-import com.fs.wxwork.dto.*;
 import com.fs.wxwork.utils.WxHttpUtil;
-import com.fs.wxwork.utils.WxWorkHttpUtilNew;
 import lombok.AllArgsConstructor;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.stereotype.Service;
@@ -21,7 +18,7 @@ import java.util.concurrent.TimeUnit;
 @Service
 @Slf4j
 @AllArgsConstructor
-public class WxService {
+public class WxIpadService {
     /**
      * 基础地址
      */

+ 3 - 0
fs-service/src/main/java/com/fs/xiaoshouyi/domain/XsyAccount.java

@@ -1,5 +1,7 @@
 package com.fs.xiaoshouyi.domain;
 
+import com.fasterxml.jackson.databind.annotation.JsonSerialize;
+import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
 import lombok.Data;
 
 import java.util.Date;
@@ -14,6 +16,7 @@ public class XsyAccount {
     /**
      * 主键ID
      */
+    @JsonSerialize(using = ToStringSerializer.class)
     private Long id;
 
     /**

+ 3 - 3
fs-service/src/main/resources/mapper/WxMsgLog/WxMsgLogMapper.xml

@@ -26,14 +26,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </resultMap>
 
     <sql id="selectWxMsgLogVo">
-        select id, account_id, key, type, msg_id, from_user_name, to_user_name, msg_type, content, img_status, img_buf, push_content, new_msg_id, create_time, create_by, update_time, update_by, remark from wx_msg_log
+        select * from wx_msg_log
     </sql>
 
-    <select id="selectWxMsgLogList" parameterType="WxMsgLog" resultMap="WxMsgLogResult">
+    <select id="selectWxMsgLogList" parameterType="WxMsgLog" resultType="WxMsgLog">
         <include refid="selectWxMsgLogVo"/>
         <where>  
             <if test="accountId != null "> and account_id = #{accountId}</if>
-            <if test="key != null  and key != ''"> and key = #{key}</if>
+            <if test="authKey != null  and authKey != ''"> and auth_key = #{authKey}</if>
             <if test="type != null "> and type = #{type}</if>
             <if test="msgId != null "> and msg_id = #{msgId}</if>
             <if test="fromUserName != null  and fromUserName != ''"> and from_user_name like concat('%', #{fromUserName}, '%')</if>

+ 2 - 2
fs-service/src/main/resources/mapper/wxcid/WxContactMapper.xml

@@ -27,10 +27,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </resultMap>
 
     <sql id="selectWxContactVo">
-        select id, user_name, nick_name, quan_pin, sex, alias, phone, head_img_url, encrypt_user_name, province, city, account_id, company_id, company_user_id, create_time, create_by, update_time, update_by, remark from wx_contact
+        select * from wx_contact
     </sql>
 
-    <select id="selectWxContactList" parameterType="WxContact" resultMap="WxContactResult">
+    <select id="selectWxContactList" parameterType="WxContact" resultType="WxContact">
         <include refid="selectWxContactVo"/>
         <where>  
             <if test="userName != null  and userName != ''"> and user_name like concat('%', #{userName}, '%')</if>