Prechádzať zdrojové kódy

Changes 增加状态筛选

cyan 1 mesiac pred
rodič
commit
3b77a7bfdc

+ 30 - 0
jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/okki/site/controller/ShopApiController.java

@@ -1,5 +1,6 @@
 package org.jeecg.modules.okki.site.controller;
 
+import com.lark.oapi.service.contact.v3.model.P1UserChangedV3;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.http.HttpHeaders;
@@ -7,15 +8,20 @@ import org.jeecg.common.api.vo.Result;
 import org.jeecg.common.util.FastJsonUtil;
 import org.jeecg.modules.okki.site.dto.FeiShuRecordSheetDto;
 import org.jeecg.modules.okki.site.dto.FeiShuSeoTeamRecordSheetDto;
+import org.jeecg.modules.okki.site.dto.WeChatMsgDto;
 import org.jeecg.modules.okki.site.param.ChangeSiteStatusParam;
 import org.jeecg.modules.okki.site.param.OkkiSiteParam;
 import org.jeecg.modules.okki.site.service.IFeiShuMsgService;
 import org.jeecg.modules.okki.site.service.IFeiShuSeoTeamSheetService;
 import org.jeecg.modules.okki.site.service.IFeiShuSheetService;
 import org.jeecg.modules.okki.site.service.IOkkiSiteService;
+import org.jeecg.modules.okki.wechatgroup.entity.OkkiShopWechatGroupMsg;
+import org.jeecg.modules.okki.wechatgroup.service.IOkkiShopWechatGroupMsgService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
+import java.util.List;
+
 /**
  * @Description: 站点
  * @Author: Jack
@@ -39,6 +45,9 @@ public class ShopApiController {
     @Autowired
     private IFeiShuMsgService feiShuMsgService;
 
+    @Autowired
+    private IOkkiShopWechatGroupMsgService okkiShopWechatGroupMsgService;
+
     @PostMapping(value = "/add")
     public Result<String> add(@RequestBody OkkiSiteParam okkiSiteParam, @RequestHeader(HttpHeaders.AUTHORIZATION) String authorization) {
         log.info("请求参数 param" + okkiSiteParam.toString() + "authorization" + authorization);
@@ -171,4 +180,25 @@ public class ShopApiController {
         return Result.ok();
     }
 
+    /**
+     * 根据站点ID获取企微群组消息
+     *
+     * @param weChatMsgDto
+     * @param authorization
+     * @return
+     */
+    @PostMapping(value = "/get/site/wechat/msg")
+    public Result<?> getSiteWeChatMsg(@RequestBody WeChatMsgDto weChatMsgDto, @RequestHeader(HttpHeaders.AUTHORIZATION) String authorization) {
+        log.info("请求参数 weChatMsgDto:{}", FastJsonUtil.toJSONString(weChatMsgDto));
+        log.info("请求参数 authorization:{}", authorization);
+        String Authorization = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VybmFtZSI6ImRlYW4iLCJleHAiOjE3MTQ0NjU5Njl9.QdCBYR8mioXcKGi1n5RdMQ5RbJHCSGbE8dkdwYuOXh4";
+        if (!authorization.equals(Authorization)) {
+            return Result.error("sign 验证不通过");
+        }
+        if (StringUtils.isBlank(weChatMsgDto.getSiteId()) || StringUtils.isBlank(weChatMsgDto.getLimit().toString())) {
+            return Result.error("siteId 和 limit参数不能为空");
+        }
+        List<OkkiShopWechatGroupMsg> okkiShopWechatGroupMsgs = okkiShopWechatGroupMsgService.getSiteWechatMsgBySiteId(weChatMsgDto);
+        return Result.ok(okkiShopWechatGroupMsgs);
+    }
 }

+ 19 - 0
jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/okki/site/dto/WeChatMsgDto.java

@@ -0,0 +1,19 @@
+package org.jeecg.modules.okki.site.dto;
+
+import lombok.Data;
+
+/**
+ * @author Chen
+ */
+@Data
+public class WeChatMsgDto {
+    /**
+     * 站点id
+     */
+    private String siteId;
+
+    /**
+     * 条数
+     */
+    private Integer limit;
+}

+ 1 - 1
jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/okki/site/entity/FeiShuConfigEnum.java

@@ -5,7 +5,7 @@ package org.jeecg.modules.okki.site.entity;
  */
 public enum FeiShuConfigEnum {
     PROD("cli_a61c977059f01013", "saNlFj2YdMXZ0uEAucyRodfSEp5ZHikR", "X16RbjCVCasCmds7fn0c0k21nju", "tblSkc8HfEYDL99U", "tblr6rTYtEbLHmAg", "tbl9ykcEZBqZt1vj", "vewiMyOeed"),
-    DEV("cli_a61c977059f01013", "saNlFj2YdMXZ0uEAucyRodfSEp5ZHikR", "Q9O3blvEnabOt9s3g9acbr6nn1d", "tblTmAqMGZm6oYu1", "tbl2z7zkmUCbnF05", "tbltaGejgCwDGReD", "vewiMyOeed");
+    DEV("cli_a61c977059f01013", "saNlFj2YdMXZ0uEAucyRodfSEp5ZHikR", "IbXcbvtyha1iIZs7foDcnCSonQd", "tblpGulK9zTrtiSV", "tblgjKUseVRlQWYk", "tblzNFg2baKP7Ssj", "vewiMyOeed");
 
     private final String appId;
     private final String appSecret;

+ 6 - 0
jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/okki/site/service/IFeiShuCommonService.java

@@ -82,6 +82,9 @@ public class IFeiShuCommonService {
         for (int i = 0; i < jsonArray.size(); i++) {
             JSONObject jsonObject = jsonArray.getJSONObject(i);
             String groupNameData = jsonObject.getString("组名");
+            if ("离职".equals(jsonObject.getString("状态"))) {
+                continue;
+            }
             if (targetGroups.contains(groupNameData)) {
                 if (!targetGroupData.containsKey(groupNameData)) {
                     targetGroupData.put(groupNameData, new ArrayList<>());
@@ -135,6 +138,9 @@ public class IFeiShuCommonService {
         JSONArray jsonArray = JSON.parseArray(jsonData);
         for (int i = 0; i < jsonArray.size(); i++) {
             JSONObject jsonObject = jsonArray.getJSONObject(i);
+            if ("离职".equals(jsonObject.getString("状态"))) {
+                continue;
+            }
             String enName = jsonObject.getString("英文名");
             if (StringUtils.isNotBlank(enName)) {
                 enNameList.add(enName);

+ 9 - 0
jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/okki/wechatgroup/service/IOkkiShopWechatGroupMsgService.java

@@ -1,6 +1,7 @@
 package org.jeecg.modules.okki.wechatgroup.service;
 
 import com.baomidou.mybatisplus.extension.service.IService;
+import org.jeecg.modules.okki.site.dto.WeChatMsgDto;
 import org.jeecg.modules.okki.wechatgroup.entity.OkkiShopWechatGroupMsg;
 
 import java.util.List;
@@ -48,4 +49,12 @@ public interface IOkkiShopWechatGroupMsgService extends IService<OkkiShopWechatG
      * @return
      */
     public Map<String, Object> todayCheckWorkDay();
+
+    /**
+     * 根据站点ID获取站点信息
+     *
+     * @param weChatMsgDto
+     * @return
+     */
+    public List<OkkiShopWechatGroupMsg> getSiteWechatMsgBySiteId(WeChatMsgDto weChatMsgDto);
 }

+ 17 - 0
jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/okki/wechatgroup/service/impl/OkkiShopWechatGroupMsgServiceImpl.java

@@ -4,6 +4,7 @@ import cn.hutool.core.date.DatePattern;
 import cn.hutool.core.date.DateUtil;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.zhipu.oapi.ClientV4;
 import com.zhipu.oapi.Constants;
@@ -12,6 +13,7 @@ import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.collections4.CollectionUtils;
 import org.apache.commons.lang.StringUtils;
 import org.jeecg.common.util.*;
+import org.jeecg.modules.okki.site.dto.WeChatMsgDto;
 import org.jeecg.modules.okki.site.service.IFeiShuCommonService;
 import org.jeecg.modules.okki.site.service.IFeiShuMsgService;
 import org.jeecg.modules.okki.utils.HttpClientUtils;
@@ -541,4 +543,19 @@ public class OkkiShopWechatGroupMsgServiceImpl extends ServiceImpl<OkkiShopWecha
         log.info("answerText:{}", answerText);
         return answerText;
     }
+
+    /**
+     * 根据站点ID获取站点信息
+     *
+     * @param weChatMsgDto
+     * @return
+     */
+    @Override
+    public List<OkkiShopWechatGroupMsg> getSiteWechatMsgBySiteId(WeChatMsgDto weChatMsgDto) {
+        QueryWrapper<OkkiShopWechatGroupMsg> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("site_id", weChatMsgDto.getSiteId());
+        queryWrapper.last("limit " + weChatMsgDto.getLimit());
+        queryWrapper.orderByDesc("msg_time");
+        return list(queryWrapper);
+    }
 }