Commit beaa87ee by 徐高华

Merge remote-tracking branch 'origin/feature/自建应用验证' into developer

Conflicts:
	haoban-manage3-web/src/main/java/com/gic/haoban/manage/web/controller/TestController.java
parents da8a76c4 f63b1486
...@@ -26,6 +26,7 @@ import com.gic.haoban.manage.service.service.MaterialService; ...@@ -26,6 +26,7 @@ import com.gic.haoban.manage.service.service.MaterialService;
import com.gic.haoban.manage.service.service.QywxSendService; import com.gic.haoban.manage.service.service.QywxSendService;
import com.gic.haoban.manage.service.service.StaffService; import com.gic.haoban.manage.service.service.StaffService;
import com.gic.haoban.manage.service.service.WxEnterpriseService; import com.gic.haoban.manage.service.service.WxEnterpriseService;
import com.gic.haoban.manage.service.util.QwUtils;
import com.gic.wechat.api.dto.qywx.QywxExternalMessageDTO; import com.gic.wechat.api.dto.qywx.QywxExternalMessageDTO;
import com.gic.wechat.api.dto.qywx.QywxImageMaterialDTO; import com.gic.wechat.api.dto.qywx.QywxImageMaterialDTO;
import com.gic.wechat.api.dto.qywx.QywxLinkMaterialDTO; import com.gic.wechat.api.dto.qywx.QywxLinkMaterialDTO;
...@@ -160,7 +161,7 @@ public class QywxSendServiceImpl implements QywxSendService { ...@@ -160,7 +161,7 @@ public class QywxSendServiceImpl implements QywxSendService {
range.setSender_list(senderList); range.setSender_list(senderList);
moment.setVisible_range(range); moment.setVisible_range(range);
ServiceResponse<String> resp = this.qywxExternalUserService.addMomentTask(qwDTO.getThirdCorpid(), ServiceResponse<String> resp = this.qywxExternalUserService.addMomentTask(qwDTO.getThirdCorpid(),
config.getWxSuiteid(), moment); QwUtils.getSecret(qwDTO, config.getWxSuiteid()), moment,qwDTO.isSelf(),qwDTO.getUrlHost());
log.info("朋友圈消息={},返回={}", JSON.toJSONString(moment), JSON.toJSONString(resp)); log.info("朋友圈消息={},返回={}", JSON.toJSONString(moment), JSON.toJSONString(resp));
return resp; return resp;
} }
......
...@@ -50,6 +50,7 @@ import com.gic.haoban.manage.service.service.StaffService; ...@@ -50,6 +50,7 @@ import com.gic.haoban.manage.service.service.StaffService;
import com.gic.haoban.manage.service.service.WxEnterpriseService; import com.gic.haoban.manage.service.service.WxEnterpriseService;
import com.gic.haoban.manage.service.service.notify.NoticeMessageService; import com.gic.haoban.manage.service.service.notify.NoticeMessageService;
import com.gic.haoban.manage.service.service.notify.NoticeMessageTemplateService; import com.gic.haoban.manage.service.service.notify.NoticeMessageTemplateService;
import com.gic.haoban.manage.service.util.QwUtils;
import com.gic.wechat.api.dto.qywx.ItemDTO; import com.gic.wechat.api.dto.qywx.ItemDTO;
import com.gic.wechat.api.dto.qywx.QywxXcxSendMessageDTO; import com.gic.wechat.api.dto.qywx.QywxXcxSendMessageDTO;
import com.gic.wechat.api.service.qywx.QywxSuiteApiService; import com.gic.wechat.api.service.qywx.QywxSuiteApiService;
...@@ -420,6 +421,6 @@ public class NoticeMessageApiServiceImpl implements NoticeMessageApiService { ...@@ -420,6 +421,6 @@ public class NoticeMessageApiServiceImpl implements NoticeMessageApiService {
messageDTO.setPage(appUrl); messageDTO.setPage(appUrl);
messageDTO.setTitle(StringUtils.isNotBlank(title)?title:messageTypeEnum.getName()); messageDTO.setTitle(StringUtils.isNotBlank(title)?title:messageTypeEnum.getName());
messageDTO.setItems(items); messageDTO.setItems(items);
qywxSuiteApiService.sendMessage(corpid, config.getWxSuiteid(), messageDTO); qywxSuiteApiService.sendMessage(corpid, QwUtils.getSecret(qwDTO, config.getWxSuiteid()), messageDTO,qwDTO.isSelf(),qwDTO.getUrlHost());
} }
} }
...@@ -74,6 +74,7 @@ import com.gic.haoban.manage.service.service.WxApplicationService; ...@@ -74,6 +74,7 @@ import com.gic.haoban.manage.service.service.WxApplicationService;
import com.gic.haoban.manage.service.service.WxEnterpriseRelatedService; import com.gic.haoban.manage.service.service.WxEnterpriseRelatedService;
import com.gic.haoban.manage.service.service.WxEnterpriseService; import com.gic.haoban.manage.service.service.WxEnterpriseService;
import com.gic.haoban.manage.service.service.chat.GroupChatService; import com.gic.haoban.manage.service.service.chat.GroupChatService;
import com.gic.haoban.manage.service.util.QwUtils;
import com.gic.member.api.dto.es.MemberDataDTO; import com.gic.member.api.dto.es.MemberDataDTO;
import com.gic.mq.sdk.GicMQClient; import com.gic.mq.sdk.GicMQClient;
import com.gic.redis.data.util.RedisUtil; import com.gic.redis.data.util.RedisUtil;
...@@ -615,7 +616,7 @@ public class MessageApiServiceImpl implements MessageApiService { ...@@ -615,7 +616,7 @@ public class MessageApiServiceImpl implements MessageApiService {
map.put("事件", message); map.put("事件", message);
List<ItemDTO> items = getItemsList(map); List<ItemDTO> items = getItemsList(map);
messageDTO.setItems(items); messageDTO.setItems(items);
qywxSuiteApiService.sendMessage(qwDTO.getThirdCorpid(), config.getWxSuiteid(), messageDTO); qywxSuiteApiService.sendMessage(qwDTO.getThirdCorpid(), QwUtils.getSecret(qwDTO, config.getWxSuiteid()), messageDTO,qwDTO.isSelf(),qwDTO.getUrlHost());
return com.gic.api.base.commons.ServiceResponse.success(); return com.gic.api.base.commons.ServiceResponse.success();
} }
......
...@@ -34,8 +34,10 @@ import com.gic.haoban.manage.service.config.Config; ...@@ -34,8 +34,10 @@ import com.gic.haoban.manage.service.config.Config;
import com.gic.haoban.manage.service.dao.mapper.StaffDepartmentRelatedMapper; import com.gic.haoban.manage.service.dao.mapper.StaffDepartmentRelatedMapper;
import com.gic.haoban.manage.service.dao.mapper.TabHaobanStaffClerkRelationMapper; import com.gic.haoban.manage.service.dao.mapper.TabHaobanStaffClerkRelationMapper;
import com.gic.haoban.manage.service.entity.TabHaobanStaffDepartmentRelated; import com.gic.haoban.manage.service.entity.TabHaobanStaffDepartmentRelated;
import com.gic.haoban.manage.service.entity.TabHaobanWxEnterprise;
import com.gic.haoban.manage.service.service.StaffDepartmentRelatedService; import com.gic.haoban.manage.service.service.StaffDepartmentRelatedService;
import com.gic.haoban.manage.service.service.WxEnterpriseService; import com.gic.haoban.manage.service.service.WxEnterpriseService;
import com.gic.haoban.manage.service.util.QwUtils;
import com.gic.wechat.api.dto.qywx.ItemDTO; import com.gic.wechat.api.dto.qywx.ItemDTO;
import com.gic.wechat.api.dto.qywx.QywxXcxSendMessageDTO; import com.gic.wechat.api.dto.qywx.QywxXcxSendMessageDTO;
import com.gic.wechat.api.service.qywx.QywxSuiteApiService; import com.gic.wechat.api.service.qywx.QywxSuiteApiService;
...@@ -255,8 +257,9 @@ public class StaffDepartmentRelatedApiServiceImpl implements StaffDepartmentRela ...@@ -255,8 +257,9 @@ public class StaffDepartmentRelatedApiServiceImpl implements StaffDepartmentRela
messageDTO.setItems(items); messageDTO.setItems(items);
logger.info("发送参数为corpId============:{},suitId============:{},messageDTO============:{},", corpId, config.getWxSuiteid(), JSONObject.toJSONString(messageDTO)); logger.info("发送参数为corpId============:{},suitId============:{},messageDTO============:{},", corpId, config.getWxSuiteid(), JSONObject.toJSONString(messageDTO));
TabHaobanWxEnterprise wxEnterprise = this.wxEnterpriseService.getEnterpriseBycorpId(corpId);
boolean b = qywxSuiteApiService.sendMessage(corpId, config.getWxSuiteid(), messageDTO); WxEnterpriseQwDTO qwDTO =this.wxEnterpriseService.getQwInfo(wxEnterprise.getWxEnterpriseId()) ;
boolean b = qywxSuiteApiService.sendMessage(corpId, QwUtils.getSecret(qwDTO, config.getWxSuiteid()), messageDTO,qwDTO.isSelf(),qwDTO.getUrlHost());
logger.info("发送===============》{}", b); logger.info("发送===============》{}", b);
return b; return b;
} }
...@@ -309,7 +312,9 @@ public class StaffDepartmentRelatedApiServiceImpl implements StaffDepartmentRela ...@@ -309,7 +312,9 @@ public class StaffDepartmentRelatedApiServiceImpl implements StaffDepartmentRela
messageDTO.setItems(contentList); messageDTO.setItems(contentList);
messageDTO.setPage(pageUrl); messageDTO.setPage(pageUrl);
logger.info("消息发送, corpId : {}, suitId : {}, messageDTO : {}", corpId, config.getWxSuiteid(), JSONObject.toJSONString(messageDTO)); logger.info("消息发送, corpId : {}, suitId : {}, messageDTO : {}", corpId, config.getWxSuiteid(), JSONObject.toJSONString(messageDTO));
boolean sendResult = qywxSuiteApiService.sendMessage(corpId, config.getWxSuiteid(), messageDTO); TabHaobanWxEnterprise wxEnterprise = this.wxEnterpriseService.getEnterpriseBycorpId(corpId);
WxEnterpriseQwDTO qwDTO =this.wxEnterpriseService.getQwInfo(wxEnterprise.getWxEnterpriseId()) ;
boolean sendResult = qywxSuiteApiService.sendMessage(corpId, QwUtils.getSecret(qwDTO, config.getWxSuiteid()), messageDTO,qwDTO.isSelf(),qwDTO.getUrlHost());
logger.info("消息发送结果, sendResult : {}", sendResult); logger.info("消息发送结果, sendResult : {}", sendResult);
return sendResult; return sendResult;
} }
...@@ -361,7 +366,9 @@ public class StaffDepartmentRelatedApiServiceImpl implements StaffDepartmentRela ...@@ -361,7 +366,9 @@ public class StaffDepartmentRelatedApiServiceImpl implements StaffDepartmentRela
messageDTO.setItems(items); messageDTO.setItems(items);
logger.info("发送消息参数为corpId={},messageDTO={},", corpId, JSONObject.toJSONString(messageDTO)); logger.info("发送消息参数为corpId={},messageDTO={},", corpId, JSONObject.toJSONString(messageDTO));
boolean b = qywxSuiteApiService.sendMessage(corpId, config.getWxSuiteid(), messageDTO); TabHaobanWxEnterprise wxEnterprise = this.wxEnterpriseService.getEnterpriseBycorpId(corpId);
WxEnterpriseQwDTO qwDTO =this.wxEnterpriseService.getQwInfo(wxEnterprise.getWxEnterpriseId()) ;
boolean b = qywxSuiteApiService.sendMessage(corpId, QwUtils.getSecret(qwDTO, config.getWxSuiteid()), messageDTO,qwDTO.isSelf(),qwDTO.getUrlHost());
logger.info("发送消息返回={}", b); logger.info("发送消息返回={}", b);
return b; return b;
} }
......
...@@ -818,7 +818,7 @@ public class HmQrcodeApiServiceImpl implements HmQrcodeApiService { ...@@ -818,7 +818,7 @@ public class HmQrcodeApiServiceImpl implements HmQrcodeApiService {
//企微已经开启联系我 //企微已经开启联系我
List<String> wxUserIdsList = null ; List<String> wxUserIdsList = null ;
if(qwDTO.isSelf()) { if(qwDTO.isSelf()) {
wxUserIdsList = qywxUserApiService.listCorpExternalUserSelf(qwDTO.getDkCorpid(), qwDTO.getSelfSecret()); wxUserIdsList = qywxUserApiService.listCorpExternalUserSelf(qwDTO.getDkCorpid(), qwDTO.getSelfSecret(),qwDTO.getUrlHost());
}else { }else {
wxUserIdsList = qywxUserApiService.listCorpExternalUser(qwDTO.getThirdCorpid(), config.getWxSuiteid()); wxUserIdsList = qywxUserApiService.listCorpExternalUser(qwDTO.getThirdCorpid(), config.getWxSuiteid());
} }
......
package com.gic.haoban.manage.web.controller; package com.gic.haoban.manage.web.controller;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.ctrip.framework.apollo.ConfigService; import com.ctrip.framework.apollo.ConfigService;
import com.gic.api.base.commons.Page; import com.gic.api.base.commons.Page;
import com.gic.commons.util.HttpClient; import com.gic.commons.util.HttpClient;
import com.gic.haoban.base.api.common.BasePageInfo; import com.gic.haoban.base.api.common.BasePageInfo;
import com.gic.haoban.common.utils.EntityUtil; import com.gic.haoban.common.utils.EntityUtil;
import com.gic.haoban.common.utils.HaobanResponse; import com.gic.haoban.common.utils.HaobanResponse;
import com.gic.haoban.manage.api.dto.*; import com.gic.haoban.manage.api.dto.*;
import com.gic.haoban.manage.api.service.*; import com.gic.haoban.manage.api.service.*;
import com.gic.haoban.manage.api.service.hm.HmQrcodeApiService; import com.gic.haoban.manage.api.service.hm.HmQrcodeApiService;
import com.gic.haoban.manage.web.config.Config; import com.gic.haoban.manage.web.config.Config;
import com.gic.haoban.manage.web.errCode.HaoBanErrCode; import com.gic.haoban.manage.web.errCode.HaoBanErrCode;
import com.gic.haoban.manage.web.qo.QywxXcxSendMessageQo; import com.gic.haoban.manage.web.qo.QywxXcxSendMessageQo;
import com.gic.redis.data.util.GicRateLimiter; import com.gic.redis.data.util.GicRateLimiter;
import com.gic.redis.data.util.RedisUtil; import com.gic.redis.data.util.RedisUtil;
import com.gic.wechat.api.dto.qywx.QywxNewUseridDTO; import com.gic.wechat.api.dto.qywx.QywxNewUseridDTO;
import com.gic.wechat.api.dto.qywx.QywxXcxSendMessageDTO; import com.gic.wechat.api.dto.qywx.QywxXcxSendMessageDTO;
import com.gic.wechat.api.service.qywx.QywxCorpApiService; import com.gic.wechat.api.service.qywx.QywxCorpApiService;
import com.gic.wechat.api.service.qywx.QywxSuiteApiService; import com.gic.wechat.api.service.qywx.QywxSuiteApiService;
import com.gic.wechat.api.service.qywx.QywxUserApiService; import com.gic.wechat.api.service.qywx.QywxUserApiService;
import org.apache.commons.collections.CollectionUtils; import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.redisson.api.RRateLimiter; import org.redisson.api.RRateLimiter;
import org.redisson.api.RateIntervalUnit; import org.redisson.api.RateIntervalUnit;
import org.redisson.api.RateType; import org.redisson.api.RateType;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import java.util.*; import java.util.*;
import java.util.concurrent.ExecutorService; import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors; import java.util.concurrent.Executors;
import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors; import java.util.stream.Collectors;
/** /**
* Created 2020/4/9. * Created 2020/4/9.
* *
* @author hua * @author hua
*/ */
@RestController @RestController
@RequestMapping("/test") @RequestMapping("/test")
public class TestController extends WebBaseController { public class TestController extends WebBaseController {
private static final Logger logger = LoggerFactory.getLogger(TestController.class); private static final Logger logger = LoggerFactory.getLogger(TestController.class);
private final ExecutorService pools = Executors.newFixedThreadPool(500); private final ExecutorService pools = Executors.newFixedThreadPool(500);
@Autowired @Autowired
private QywxSuiteApiService qywxSuiteApiService; private QywxSuiteApiService qywxSuiteApiService;
@Autowired @Autowired
private TestApiService testApiService; private TestApiService testApiService;
@Autowired @Autowired
private MaidianLogApiService maidianLogApiService; private MaidianLogApiService maidianLogApiService;
@Autowired @Autowired
private WxEnterpriseRelatedApiService wxEnterpriseRelatedApiService; private WxEnterpriseRelatedApiService wxEnterpriseRelatedApiService;
@Autowired @Autowired
private WxEnterpriseApiService wxEnterpriseApiService; private WxEnterpriseApiService wxEnterpriseApiService;
@Autowired @Autowired
private QywxUserApiService qywxUserApiService; private QywxUserApiService qywxUserApiService;
@Autowired @Autowired
private StaffApiService staffApiService; private StaffApiService staffApiService;
@Autowired @Autowired
private WxApplicationApiService wxApplicationApiService; private WxApplicationApiService wxApplicationApiService;
@Autowired @Autowired
private Config config; private Config config;
@Autowired @Autowired
private HmQrcodeApiService hmQrcodeApiService; private HmQrcodeApiService hmQrcodeApiService;
@Autowired @Autowired
private QywxCorpApiService qywxCorpApiService; private QywxCorpApiService qywxCorpApiService;
@Autowired @Autowired
private QwFriendApiService qwFriendApiService ; private QwFriendApiService qwFriendApiService ;
@RequestMapping("/qwcode") @RequestMapping("/qwcode")
public HaobanResponse qwcode(String enterpriseId, String unionid,String openid,String wxaUnionid ,String code) { public HaobanResponse qwcode(String enterpriseId, String unionid,String openid,String wxaUnionid ,String code) {
return this.resultResponse(HaoBanErrCode.ERR_0,code); return this.resultResponse(HaoBanErrCode.ERR_0,code);
} }
@RequestMapping("/pending-check") @RequestMapping("/pending-check")
public HaobanResponse pendingChec(String enterpriseId, String unionid,String openid,String wxaUnionid ,String wxaOpenid) { public HaobanResponse pendingChec(String enterpriseId, String unionid,String openid,String wxaUnionid ,String wxaOpenid) {
return this.resultResponse(HaoBanErrCode.ERR_0,this.qwFriendApiService.pendingIdCheck(enterpriseId, unionid, openid, wxaUnionid,wxaOpenid)); return this.resultResponse(HaoBanErrCode.ERR_0,this.qwFriendApiService.pendingIdCheck(enterpriseId, unionid, openid, wxaUnionid,wxaOpenid));
} }
@RequestMapping("/get-pending-times") @RequestMapping("/get-pending-times")
public HaobanResponse getTestTimes(String wxEnterpriseId) { public HaobanResponse getTestTimes(String wxEnterpriseId) {
return this.resultResponse(HaoBanErrCode.ERR_0,this.qwFriendApiService.getCallTimes(wxEnterpriseId)); return this.resultResponse(HaoBanErrCode.ERR_0,this.qwFriendApiService.getCallTimes(wxEnterpriseId));
} }
@RequestMapping("/send-message-test")
public HaobanResponse testSendMessage(QywxXcxSendMessageQo qo) { @RequestMapping("/test-dubbo")
QywxXcxSendMessageDTO messageDTO = EntityUtil.changeEntityByOrika(QywxXcxSendMessageDTO.class, qo); public HaobanResponse dubbo(@RequestParam(defaultValue = "2000") Integer n, @RequestParam(defaultValue = "100") String t) {
ArrayList<String> list = new ArrayList<>(); int i = n;
list.add(qo.getUserId()); while (i-- > 0) {
int finalI = i;
messageDTO.setUserIds(list); pools.execute(new Runnable() {
boolean b = qywxSuiteApiService.sendMessage("ww9ede832a84b7ae5f", @Override
"ww2c34dc56739bb105", messageDTO); public void run() {
if (b) { long start = System.currentTimeMillis();
return resultResponse(HaoBanErrCode.ERR_1); testApiService.checkThread(finalI + "", Long.valueOf(t));
} else { logger.info("时间:{}", System.currentTimeMillis() - start);
return resultResponse(HaoBanErrCode.ERR_0); }
} });
} }
return resultResponse(HaoBanErrCode.ERR_1);
}
@RequestMapping("/test-dubbo")
public HaobanResponse dubbo(@RequestParam(defaultValue = "2000") Integer n, @RequestParam(defaultValue = "100") String t) { @RequestMapping("/lock")
int i = n; public HaobanResponse lock(String name, Long time, int ty) {
while (i-- > 0) { RedisUtil.lock(name, time, TimeUnit.SECONDS, 0L);
int finalI = i; if (ty == 0) {
pools.execute(new Runnable() { if (RedisUtil.isLocked(name)) {
@Override RedisUtil.unlock(name);
public void run() { }
long start = System.currentTimeMillis(); }
testApiService.checkThread(finalI + "", Long.valueOf(t)); return resultResponse(HaoBanErrCode.ERR_1);
logger.info("时间:{}", System.currentTimeMillis() - start); }
}
}); @RequestMapping("/maidian-log")
} public HaobanResponse maidian(String hbversion, BasePageInfo pageInfo) {
return resultResponse(HaoBanErrCode.ERR_1); Page<MaidianLogDTO> page = maidianLogApiService.queryList(hbversion, pageInfo);
} return resultResponse(HaoBanErrCode.ERR_1, page);
}
@RequestMapping("/lock")
public HaobanResponse lock(String name, Long time, int ty) { @RequestMapping("/deal-slef-qywx-sys-department")
RedisUtil.lock(name, time, TimeUnit.SECONDS, 0L); public HaobanResponse dealSys1(String corpid, String secretVal, String dataId) {
if (ty == 0) { testApiService.listSelfQywxUser(corpid, secretVal, dataId);
if (RedisUtil.isLocked(name)) { return resultResponse(HaoBanErrCode.ERR_1);
RedisUtil.unlock(name); }
}
} @RequestMapping("/deal-all-qywx-sys-department")
return resultResponse(HaoBanErrCode.ERR_1); public HaobanResponse dealSys2(String corpid, String secretVal, String dataId) {
} testApiService.listAllQywxUser(corpid, secretVal, dataId);
return resultResponse(HaoBanErrCode.ERR_1);
@RequestMapping("/maidian-log") }
public HaobanResponse maidian(String hbversion, BasePageInfo pageInfo) {
Page<MaidianLogDTO> page = maidianLogApiService.queryList(hbversion, pageInfo); @RequestMapping("/test-limiter")
return resultResponse(HaoBanErrCode.ERR_1, page); public HaobanResponse testLimiter(String key, String eid) {
} if (StringUtils.isAnyBlank(key, eid)) {
return resultResponse(HaoBanErrCode.ERR_5);
@RequestMapping("/deal-slef-qywx-sys-department") }
public HaobanResponse dealSys1(String corpid, String secretVal, String dataId) { GicRateLimiter instance = GicRateLimiter.getInstance("haoban-manage3-web");
testApiService.listSelfQywxUser(corpid, secretVal, dataId); Long acquire = instance.acquire(key, eid);
return resultResponse(HaoBanErrCode.ERR_1); if (acquire == 0L) {
} return resultResponse(HaoBanErrCode.ERR_13);
}
@RequestMapping("/deal-all-qywx-sys-department") return resultResponse(HaoBanErrCode.ERR_1);
public HaobanResponse dealSys2(String corpid, String secretVal, String dataId) { }
testApiService.listAllQywxUser(corpid, secretVal, dataId);
return resultResponse(HaoBanErrCode.ERR_1); @RequestMapping("/init-history")
} public HaobanResponse initHistory(String wxEnterpriseId) {
wxEnterpriseRelatedApiService.initHistoryEnterprise(wxEnterpriseId);
@RequestMapping("/test-limiter") return resultResponse(HaoBanErrCode.ERR_1);
public HaobanResponse testLimiter(String key, String eid) { }
if (StringUtils.isAnyBlank(key, eid)) {
return resultResponse(HaoBanErrCode.ERR_5); /**
} * 获取到分表到哪个表内
GicRateLimiter instance = GicRateLimiter.getInstance("haoban-manage3-web"); *
Long acquire = instance.acquire(key, eid); * @param tableId 分表id
if (acquire == 0L) { * @param count 分表数量
return resultResponse(HaoBanErrCode.ERR_13); * @return
} */
return resultResponse(HaoBanErrCode.ERR_1); @RequestMapping("/test-table")
} public HaobanResponse testTable(String tableId, Integer count) {
if (StringUtils.isBlank(tableId)) {
@RequestMapping("/init-history") return resultResponse(HaoBanErrCode.ERR_5);
public HaobanResponse initHistory(String wxEnterpriseId) { }
wxEnterpriseRelatedApiService.initHistoryEnterprise(wxEnterpriseId); if (count == null) {
return resultResponse(HaoBanErrCode.ERR_1); return resultResponse(HaoBanErrCode.ERR_5);
} }
int i = tableId.hashCode() % count;
/** return resultResponse(HaoBanErrCode.ERR_1, i);
* 获取到分表到哪个表内 }
*
* @param tableId 分表id /**
* @param count 分表数量 * 设置迁移完成
* @return *
*/ * @param corpid
@RequestMapping("/test-table") * @param serviceCorpid
public HaobanResponse testTable(String tableId, Integer count) { * @return
if (StringUtils.isBlank(tableId)) { */
return resultResponse(HaoBanErrCode.ERR_5); @RequestMapping("/finishExternalUseridMigration")
} public HaobanResponse finishExternalUseridMigration(String corpid, String serviceCorpid) {
if (count == null) { boolean flag = qywxUserApiService.finishExternalUseridMigration(corpid, serviceCorpid);
return resultResponse(HaoBanErrCode.ERR_5); if (flag) {
} WxEnterpriseDTO wxEnterpriseDTO = wxEnterpriseApiService.getEnterpriseBycorpId(corpid);
int i = tableId.hashCode() % count; if (wxEnterpriseDTO == null) {
return resultResponse(HaoBanErrCode.ERR_1, i); return resultResponse(HaoBanErrCode.ERR_10012);
} }
wxEnterpriseApiService.agreeExternalUseridFlag(wxEnterpriseDTO.getWxEnterpriseId(), 1);
/** return resultResponse(HaoBanErrCode.ERR_1);
* 设置迁移完成 } else {
* return resultResponse(HaoBanErrCode.ERR_0);
* @param corpid }
* @param serviceCorpid }
* @return
*/ /**
@RequestMapping("/finishExternalUseridMigration") * 测试授权回调
public HaobanResponse finishExternalUseridMigration(String corpid, String serviceCorpid) { *
boolean flag = qywxUserApiService.finishExternalUseridMigration(corpid, serviceCorpid); * @param param
if (flag) { * @return
WxEnterpriseDTO wxEnterpriseDTO = wxEnterpriseApiService.getEnterpriseBycorpId(corpid); */
if (wxEnterpriseDTO == null) { @RequestMapping("/callbackReviceEnterprise")
return resultResponse(HaoBanErrCode.ERR_10012); public HaobanResponse callbackReviceEnterprise(String param) {
} QywxCorpInfoSimpleDTO qywxCorpInfoSimpleDTO = JSON.parseObject(param, QywxCorpInfoSimpleDTO.class);
wxEnterpriseApiService.agreeExternalUseridFlag(wxEnterpriseDTO.getWxEnterpriseId(), 1); wxEnterpriseApiService.callbackReviceEnterprise(qywxCorpInfoSimpleDTO);
return resultResponse(HaoBanErrCode.ERR_1); return resultResponse(HaoBanErrCode.ERR_1);
} else { }
return resultResponse(HaoBanErrCode.ERR_0);
} /**
} * 后台预留批量处理wx_user_id to wx_open_user_id
*
/** * @param corpid
* 测试授权回调 * @return
* */
* @param param @RequestMapping("/useridToOpenuserid")
* @return public HaobanResponse useridToOpenuserid(String corpid) {
*/ WxApplicationDTO wxApplicationDTO = wxApplicationApiService.selectByCorpid(corpid);
@RequestMapping("/callbackReviceEnterprise") String wxEnterpriseId = wxApplicationDTO.getWxEnterpriseId();
public HaobanResponse callbackReviceEnterprise(String param) { String siteId = wxApplicationDTO.getSiteId();
QywxCorpInfoSimpleDTO qywxCorpInfoSimpleDTO = JSON.parseObject(param, QywxCorpInfoSimpleDTO.class); // 限流器
wxEnterpriseApiService.callbackReviceEnterprise(qywxCorpInfoSimpleDTO); RRateLimiter rateLimiter = RedisUtil.getRedisClient().getRateLimiter("haoban:manage3:updateWxOpenUserId:limit");
return resultResponse(HaoBanErrCode.ERR_1); // 每1秒产生5个令牌
} rateLimiter.trySetRate(RateType.OVERALL, 5, 1, RateIntervalUnit.SECONDS);
int pageNum = 1;
/** while (true) {
* 后台预留批量处理wx_user_id to wx_open_user_id rateLimiter.acquire();
* //批量处理wx_user_id to wx_open_user_id
* @param corpid Page<StaffDTO> staffDTOPageInfo = staffApiService.listUserIdByWxEnterpriseId(wxEnterpriseId, pageNum, 1000);
* @return List<StaffDTO> staffDTOS = staffDTOPageInfo.getResult();
*/ if (CollectionUtils.isEmpty(staffDTOS)) {
@RequestMapping("/useridToOpenuserid") break;
public HaobanResponse useridToOpenuserid(String corpid) { }
WxApplicationDTO wxApplicationDTO = wxApplicationApiService.selectByCorpid(corpid); pageNum++;
String wxEnterpriseId = wxApplicationDTO.getWxEnterpriseId(); logger.info("useridToOpenuserid请求:corpid:{}", corpid);
String siteId = wxApplicationDTO.getSiteId(); List<QywxNewUseridDTO> qywxNewUseridDTOS = qywxUserApiService.useridToOpenuserid(corpid, siteId, staffDTOS.stream().map(StaffDTO::getWxUserId).collect(Collectors.toList()));
// 限流器 if (CollectionUtils.isNotEmpty(qywxNewUseridDTOS)) {
RRateLimiter rateLimiter = RedisUtil.getRedisClient().getRateLimiter("haoban:manage3:updateWxOpenUserId:limit"); for (QywxNewUseridDTO qywxNewUseridDTO : qywxNewUseridDTOS) {
// 每1秒产生5个令牌 staffApiService.updateOpenUserIdsByUserId(wxEnterpriseId, qywxNewUseridDTO.getUserid(), qywxNewUseridDTO.getOpen_userid());
rateLimiter.trySetRate(RateType.OVERALL, 5, 1, RateIntervalUnit.SECONDS); }
int pageNum = 1; }
while (true) { }
rateLimiter.acquire(); return resultResponse(HaoBanErrCode.ERR_1);
//批量处理wx_user_id to wx_open_user_id }
Page<StaffDTO> staffDTOPageInfo = staffApiService.listUserIdByWxEnterpriseId(wxEnterpriseId, pageNum, 1000);
List<StaffDTO> staffDTOS = staffDTOPageInfo.getResult(); /**
if (CollectionUtils.isEmpty(staffDTOS)) { * 后台单个处理wx_user_id to wx_open_user_id
break; *
} * @param corpid
pageNum++; * @param staffId
logger.info("useridToOpenuserid请求:corpid:{}", corpid); * @return
List<QywxNewUseridDTO> qywxNewUseridDTOS = qywxUserApiService.useridToOpenuserid(corpid, siteId, staffDTOS.stream().map(StaffDTO::getWxUserId).collect(Collectors.toList())); */
if (CollectionUtils.isNotEmpty(qywxNewUseridDTOS)) { @RequestMapping("/useridToOpenuseridByStaffId")
for (QywxNewUseridDTO qywxNewUseridDTO : qywxNewUseridDTOS) { public HaobanResponse useridToOpenuseridByStaffId(String corpid, String staffId) {
staffApiService.updateOpenUserIdsByUserId(wxEnterpriseId, qywxNewUseridDTO.getUserid(), qywxNewUseridDTO.getOpen_userid()); StaffDTO staffDTO = staffApiService.selectById(staffId);
} if (staffDTO == null) {
} return resultResponse(HaoBanErrCode.ERR_8);
} }
return resultResponse(HaoBanErrCode.ERR_1); String wxUserId = staffDTO.getWxUserId();
} String openUserid = getOpenUserid(wxUserId, corpid);
staffApiService.updateOpenUserIdsByUserId(staffDTO.getWxEnterpriseId(), wxUserId, openUserid);
/** return resultResponse(HaoBanErrCode.ERR_1);
* 后台单个处理wx_user_id to wx_open_user_id }
*
* @param corpid /**
* @param staffId * 获取openuserid
* @return *
*/ * @param userId
@RequestMapping("/useridToOpenuseridByStaffId") * @param corpid
public HaobanResponse useridToOpenuseridByStaffId(String corpid, String staffId) { * @return
StaffDTO staffDTO = staffApiService.selectById(staffId); */
if (staffDTO == null) { private String getOpenUserid(String userId, String corpid) {
return resultResponse(HaoBanErrCode.ERR_8); WxApplicationDTO wxApplicationDTO = wxApplicationApiService.selectByCorpid(corpid);
} List<QywxNewUseridDTO> qywxNewUseridDTOS = qywxUserApiService.useridToOpenuserid(corpid, wxApplicationDTO.getSiteId(), Collections.singletonList(userId));
String wxUserId = staffDTO.getWxUserId(); if (CollectionUtils.isEmpty(qywxNewUseridDTOS)) {
String openUserid = getOpenUserid(wxUserId, corpid); return "";
staffApiService.updateOpenUserIdsByUserId(staffDTO.getWxEnterpriseId(), wxUserId, openUserid); }
return resultResponse(HaoBanErrCode.ERR_1); return qywxNewUseridDTOS.get(0).getOpen_userid();
} }
/** /**
* 获取openuserid * 代开发完成升级
* * @param corpid
* @param userId * @param agentid
* @param corpid * @param openidType
* @return * @return
*/ */
private String getOpenUserid(String userId, String corpid) { @RequestMapping("/finishOpenidMigration")
WxApplicationDTO wxApplicationDTO = wxApplicationApiService.selectByCorpid(corpid); public HaobanResponse finishOpenidMigration(String corpid, String agentid, String openidType) {
List<QywxNewUseridDTO> qywxNewUseridDTOS = qywxUserApiService.useridToOpenuserid(corpid, wxApplicationDTO.getSiteId(), Collections.singletonList(userId)); String[] openidTypeSplit = openidType.split(",");
if (CollectionUtils.isEmpty(qywxNewUseridDTOS)) { boolean flag = qywxUserApiService.finishOpenidMigration(corpid, config.getCorpid(), agentid, openidTypeSplit);
return ""; return resultResponse(HaoBanErrCode.ERR_1, flag);
} }
return qywxNewUseridDTOS.get(0).getOpen_userid();
} /**
* 转自建userid
/** * @param corpid
* 代开发完成升级 * @param secret
* @param corpid * @param userIds
* @param agentid * @return
* @param openidType */
* @return @RequestMapping("/getSelfUseridToOpenuserid")
*/ public HaobanResponse getSelfUseridToOpenuserid(String corpid, String secret, String userIds) {
@RequestMapping("/finishOpenidMigration") String[] split = userIds.split(",");
public HaobanResponse finishOpenidMigration(String corpid, String agentid, String openidType) { List<QywxNewUseridDTO> list = qywxUserApiService.getSelfUseridToOpenuserid(corpid, secret, Arrays.asList(split));
String[] openidTypeSplit = openidType.split(","); return resultResponse(HaoBanErrCode.ERR_1, list);
boolean flag = qywxUserApiService.finishOpenidMigration(corpid, config.getCorpid(), agentid, openidTypeSplit); }
return resultResponse(HaoBanErrCode.ERR_1, flag);
} /**
* 生成活码
/** * @return
* 转自建userid */
* @param corpid @RequestMapping("/checkStaffOpenContact")
* @param secret public HaobanResponse checkStaffOpenContact() {
* @param userIds hmQrcodeApiService.checkStaffOpenContact("-1");
* @return return resultResponse(HaoBanErrCode.ERR_1);
*/ }
@RequestMapping("/getSelfUseridToOpenuserid")
public HaobanResponse getSelfUseridToOpenuserid(String corpid, String secret, String userIds) { /**
String[] split = userIds.split(","); * 生成活码单企业
List<QywxNewUseridDTO> list = qywxUserApiService.getSelfUseridToOpenuserid(corpid, secret, Arrays.asList(split)); * @param wxEnterpriseId
return resultResponse(HaoBanErrCode.ERR_1, list); * @param enterpriseId
} * @return
*/
/** @RequestMapping("/checkStaffOpenContactByWxEnterpriseId")
* 生成活码 public HaobanResponse checkStaffOpenContactByWxEnterpriseId(String wxEnterpriseId,String enterpriseId) {
* @return JSONObject jsonObject = new JSONObject();
*/ jsonObject.put("wxEnterpriseId",wxEnterpriseId);
@RequestMapping("/checkStaffOpenContact") jsonObject.put("enterpriseId",enterpriseId);
public HaobanResponse checkStaffOpenContact() { hmQrcodeApiService.checkStaffOpenContactByWxEnterpriseId(jsonObject.toJSONString());
hmQrcodeApiService.checkStaffOpenContact("-1"); return resultResponse(HaoBanErrCode.ERR_1);
return resultResponse(HaoBanErrCode.ERR_1); }
}
/** @RequestMapping("test-qw-post-fws")
* 生成活码单企业 public HaobanResponse testQwPost(String url , String corpid , String json) {
* @param wxEnterpriseId if(isProd()) {
* @param enterpriseId return null ;
* @return }
*/ String token = qywxCorpApiService.getProviderAccessToken(corpid) ;
@RequestMapping("/checkStaffOpenContactByWxEnterpriseId") logger.info("toekn={},corpId={} , url={} , json={}",token, corpid ,(url + token) , json);
public HaobanResponse checkStaffOpenContactByWxEnterpriseId(String wxEnterpriseId,String enterpriseId) { Map<String, Object> map = HttpClient.getWinxinResByJson(url + token ,json);
JSONObject jsonObject = new JSONObject(); return resultResponse(HaoBanErrCode.ERR_0, map) ;
jsonObject.put("wxEnterpriseId",wxEnterpriseId); }
jsonObject.put("enterpriseId",enterpriseId);
hmQrcodeApiService.checkStaffOpenContactByWxEnterpriseId(jsonObject.toJSONString()); @RequestMapping("test-qw-get-fws")
return resultResponse(HaoBanErrCode.ERR_1); public HaobanResponse testQwGet(String url , String corpId) {
} if(isProd()) {
return null ;
}
@RequestMapping("test-qw-post-fws") String token =qywxCorpApiService.getProviderAccessToken(corpId) ;
public HaobanResponse testQwPost(String url , String corpid , String json) { logger.info("toekn={},appid={} , url={} , json={}",token,corpId ,(url + token));
if(isProd()) { Map<String, Object> map = HttpClient.getHttpByGet(url + token);
return null ; return resultResponse(HaoBanErrCode.ERR_0, map) ;
} }
String token = qywxCorpApiService.getProviderAccessToken(corpid) ;
logger.info("toekn={},corpId={} , url={} , json={}",token, corpid ,(url + token) , json);
Map<String, Object> map = HttpClient.getWinxinResByJson(url + token ,json); @RequestMapping("test-qw-post-3")
return resultResponse(HaoBanErrCode.ERR_0, map) ; public HaobanResponse testQwPost3(String url , String corpid , String json) {
} if(isProd()) {
return null ;
@RequestMapping("test-qw-get-fws") }
public HaobanResponse testQwGet(String url , String corpId) { String token = qywxCorpApiService.getCorpAccessToken(corpid,config.getWxSuiteid()) ;
if(isProd()) { logger.info("toekn={},corpId={} , url={} , json={}",token, corpid ,(url + token) , json);
return null ; Map<String, Object> map = HttpClient.getWinxinResByJson(url + token ,json);
} return resultResponse(HaoBanErrCode.ERR_0, map) ;
String token =qywxCorpApiService.getProviderAccessToken(corpId) ; }
logger.info("toekn={},appid={} , url={} , json={}",token,corpId ,(url + token));
Map<String, Object> map = HttpClient.getHttpByGet(url + token);
return resultResponse(HaoBanErrCode.ERR_0, map) ; @RequestMapping("test-qw-post-suite")
} public HaobanResponse testQwPostSuite(String url , String corpid , String json) {
if(isProd()) {
return null ;
@RequestMapping("test-qw-post-3") }
public HaobanResponse testQwPost3(String url , String corpid , String json) { String token = qywxCorpApiService.getSuiteAccessToken(config.getWxSuiteid()) ;
if(isProd()) { logger.info("toekn={},corpId={} , url={} , json={}",token, corpid ,(url + token) , json);
return null ; Map<String, Object> map = HttpClient.getWinxinResByJson(url + token ,json);
} return resultResponse(HaoBanErrCode.ERR_0, map) ;
String token = qywxCorpApiService.getCorpAccessToken(corpid,config.getWxSuiteid()) ; }
logger.info("toekn={},corpId={} , url={} , json={}",token, corpid ,(url + token) , json);
Map<String, Object> map = HttpClient.getWinxinResByJson(url + token ,json);
return resultResponse(HaoBanErrCode.ERR_0, map) ; @RequestMapping("test-qw-token")
} public HaobanResponse testQwPost3(String corpid , String secret) {
if(StringUtils.isBlank(secret)) {
String token = qywxCorpApiService.getCorpAccessToken(corpid,config.getWxSuiteid()) ;
@RequestMapping("test-qw-post-suite") return resultResponse(HaoBanErrCode.ERR_0, token) ;
public HaobanResponse testQwPostSuite(String url , String corpid , String json) { }else {
if(isProd()) { String token = qywxCorpApiService.getToken(corpid, secret) ;
return null ; return resultResponse(HaoBanErrCode.ERR_0, token) ;
} }
String token = qywxCorpApiService.getSuiteAccessToken(config.getWxSuiteid()) ; }
logger.info("toekn={},corpId={} , url={} , json={}",token, corpid ,(url + token) , json);
Map<String, Object> map = HttpClient.getWinxinResByJson(url + token ,json); @RequestMapping("test-qw-get-3")
return resultResponse(HaoBanErrCode.ERR_0, map) ; public HaobanResponse testQwGet3(String url , String corpid) {
} if(isProd()) {
return null ;
}
@RequestMapping("test-qw-token") String token = qywxCorpApiService.getCorpAccessToken(corpid,config.getWxSuiteid()) ;
public HaobanResponse testQwPost3(String corpid , String secret) { logger.info("toekn={},appid={} , url={} , json={}",token,corpid ,(url + token));
if(StringUtils.isBlank(secret)) { Map<String, Object> map = HttpClient.getHttpByGet(url + token);
String token = qywxCorpApiService.getCorpAccessToken(corpid,config.getWxSuiteid()) ; return resultResponse(HaoBanErrCode.ERR_0, map) ;
return resultResponse(HaoBanErrCode.ERR_0, token) ; }
}else {
String token = qywxCorpApiService.getToken(corpid, secret) ;
return resultResponse(HaoBanErrCode.ERR_0, token) ; @RequestMapping("test-qw-get-suite")
} public HaobanResponse testQwGetSuite(String url , String corpid) {
} if(isProd()) {
return null ;
@RequestMapping("test-qw-get-3") }
public HaobanResponse testQwGet3(String url , String corpid) { String token = qywxCorpApiService.getSuiteAccessToken(config.getWxSuiteid()) ;
if(isProd()) { logger.info("toekn={},appid={} , url={} , json={}",token,corpid ,(url + token));
return null ; Map<String, Object> map = HttpClient.getHttpByGet(url + token);
} return resultResponse(HaoBanErrCode.ERR_0, map) ;
String token = qywxCorpApiService.getCorpAccessToken(corpid,config.getWxSuiteid()) ; }
logger.info("toekn={},appid={} , url={} , json={}",token,corpid ,(url + token));
Map<String, Object> map = HttpClient.getHttpByGet(url + token); @RequestMapping("test-qw-post-dk")
return resultResponse(HaoBanErrCode.ERR_0, map) ; public HaobanResponse testQwPostdk(String url , String corpid , String secret, String json) {
} if(isProd()) {
return null ;
}
@RequestMapping("test-qw-get-suite") String token = qywxCorpApiService.getToken(corpid, secret) ;
public HaobanResponse testQwGetSuite(String url , String corpid) { logger.info("toekn={},corpId={} , url={} , json={}",token, corpid ,(url + token) , json);
if(isProd()) { Map<String, Object> map = HttpClient.getWinxinResByJson(url + token ,json);
return null ; return resultResponse(HaoBanErrCode.ERR_0, map) ;
} }
String token = qywxCorpApiService.getSuiteAccessToken(config.getWxSuiteid()) ;
logger.info("toekn={},appid={} , url={} , json={}",token,corpid ,(url + token)); @RequestMapping("test-qw-get-dk")
Map<String, Object> map = HttpClient.getHttpByGet(url + token); public HaobanResponse testQwGetdk(String url , String corpid , String secret) {
return resultResponse(HaoBanErrCode.ERR_0, map) ; if(isProd()) {
} return null ;
}
@RequestMapping("test-qw-post-dk") String token = qywxCorpApiService.getToken(corpid, secret) ;
public HaobanResponse testQwPostdk(String url , String corpid , String secret, String json) { logger.info("toekn={},appid={} , url={} , json={}",token,corpid ,(url + token));
if(isProd()) { Map<String, Object> map = HttpClient.getHttpByGet(url + token);
return null ; return resultResponse(HaoBanErrCode.ERR_0, map) ;
} }
String token = qywxCorpApiService.getToken(corpid, secret) ;
logger.info("toekn={},corpId={} , url={} , json={}",token, corpid ,(url + token) , json); private boolean isProd() {
Map<String, Object> map = HttpClient.getWinxinResByJson(url + token ,json); com.ctrip.framework.apollo.Config config = ConfigService.getConfig("COMMON.gic-properties");
return resultResponse(HaoBanErrCode.ERR_0, map) ; String env = config.getProperty("environment.value", "");
} boolean isProd = "prod".equals(env);
return false ;
@RequestMapping("test-qw-get-dk") }
public HaobanResponse testQwGetdk(String url , String corpid , String secret) {
if(isProd()) { @RequestMapping("test-get-qwinfo")
return null ; public Object getQwInfo(String wxEnterpriseId) {
} if(StringUtils.isEmpty(wxEnterpriseId)) {
String token = qywxCorpApiService.getToken(corpid, secret) ; return "参数无" ;
logger.info("toekn={},appid={} , url={} , json={}",token,corpid ,(url + token)); }
Map<String, Object> map = HttpClient.getHttpByGet(url + token); WxEnterpriseQwDTO qwDTO = this.wxEnterpriseApiService.getQwInfo(wxEnterpriseId) ;
return resultResponse(HaoBanErrCode.ERR_0, map) ; if(null == qwDTO) {
} return "企业不存在" ;
}
private boolean isProd() { Map<String,Object> map = new HashMap<>();
com.ctrip.framework.apollo.Config config = ConfigService.getConfig("COMMON.gic-properties"); map.put("企微加密说明", "1(全明文) 2(全密文) 3(第三方密文,代开明文) 4(第三方明文,代开密文)") ;
String env = config.getProperty("environment.value", ""); map.put("当前企业加密方式", getCorpid(qwDTO)) ;
boolean isProd = "prod".equals(env); map.put("企微信息", qwDTO) ;
return false ;
} return map ;
}
@RequestMapping("test-get-qwinfo")
public Object getQwInfo(String wxEnterpriseId) {
if(StringUtils.isEmpty(wxEnterpriseId)) { private String getCorpid(WxEnterpriseQwDTO wxEnterpriseDTO) {
return "参数无" ; int wxType = wxEnterpriseDTO.getWxSecurityType() ;
} String desc = " -- " ;
WxEnterpriseQwDTO qwDTO = this.wxEnterpriseApiService.getQwInfo(wxEnterpriseId) ; if(wxType==1) {
if(null == qwDTO) { desc = "(全部明文)" ;
return "企业不存在" ; }
} if(wxType==2) {
Map<String,Object> map = new HashMap<>(); desc = "(全部密文)" ;
map.put("企微加密说明", "1(全明文) 2(全密文) 3(第三方密文,代开明文) 4(第三方明文,代开密文)") ; }
map.put("当前企业加密方式", getCorpid(qwDTO)) ; if(wxType==3) {
map.put("企微信息", qwDTO) ; desc = "(第三方密文,代开明文)" ;
}
return map ; if(wxType==4) {
} desc = "(第三方明文,代开密文)" ;
}
return Arrays.asList(wxEnterpriseDTO.getThirdCorpid()+"(第三方)",wxEnterpriseDTO.getDkCorpid()+"(代开发)").stream().filter(str -> StringUtils.isNotBlank(str)).collect(Collectors.joining(" / ")) + desc;
private String getCorpid(WxEnterpriseQwDTO wxEnterpriseDTO) { }
int wxType = wxEnterpriseDTO.getWxSecurityType() ;
String desc = " -- " ; }
if(wxType==1) {
desc = "(全部明文)" ;
}
if(wxType==2) {
desc = "(全部密文)" ;
}
if(wxType==3) {
desc = "(第三方密文,代开明文)" ;
}
if(wxType==4) {
desc = "(第三方明文,代开密文)" ;
}
return Arrays.asList(wxEnterpriseDTO.getThirdCorpid()+"(第三方)",wxEnterpriseDTO.getDkCorpid()+"(代开发)").stream().filter(str -> StringUtils.isNotBlank(str)).collect(Collectors.joining(" / ")) + desc;
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment