Commit b341f1ac by fudahua

Merge remote-tracking branch 'origin/master'

parents 8cfdb28c 605585f2
......@@ -348,19 +348,36 @@ public class DealSyncOperationApiServiceImpl implements DealSyncOperationApiServ
private void dealDepartmentToMq(String taskId, Set<String> dealList, SyncTaskStatusEnum syncTaskStatusEnum) {
//预处理分组任务
syncTaskService.updateTaskStatus(taskId, syncTaskStatusEnum.getVal());
dealList.forEach(relationId -> {
//
// dealList.forEach(relationId -> {
// DealParamMqDTO dealParamMqDTO = new DealParamMqDTO();
// dealParamMqDTO.setTaskId(taskId);
// dealParamMqDTO.setData(relationId);
// dealParamMqDTO.setType(syncTaskStatusEnum.getVal());
// GicMQClient clientInstance = GICMQClientUtil.getClientInstance();
// try {
// clientInstance.sendMessage("departmentSyncDealMq", JSONObject.toJSONString(dealParamMqDTO));
// } catch (Exception e) {
// logger.info("发送失败:{},{}", taskId, relationId);
// e.printStackTrace();
// }
// });
List<String> listRet = dealList.stream().map(relationId -> {
DealParamMqDTO dealParamMqDTO = new DealParamMqDTO();
dealParamMqDTO.setTaskId(taskId);
dealParamMqDTO.setData(relationId);
dealParamMqDTO.setType(syncTaskStatusEnum.getVal());
GicMQClient clientInstance = GICMQClientUtil.getClientInstance();
try {
clientInstance.sendMessage("departmentSyncDealMq", JSONObject.toJSONString(dealParamMqDTO));
} catch (Exception e) {
logger.info("发送失败:{},{}", taskId, relationId);
e.printStackTrace();
}
});
return JSONObject.toJSONString(dealParamMqDTO);
}).collect(Collectors.toList());
GicMQClient clientInstance = GICMQClientUtil.getClientInstance();
try {
clientInstance.sendBatchMessages("departmentSyncDealMq", listRet);
} catch (Exception e) {
logger.info("发送失败:{},{}", taskId, JSONObject.toJSONString(listRet));
e.printStackTrace();
}
}
......
......@@ -623,6 +623,9 @@ public class MemberUnionidRelatedApiServiceImpl implements MemberUnionidRelatedA
return;
}
JSONArray jsonArr = JSON.parseArray(res);
if(jsonArr.size() == 0) {
return;
}
List<MemberUnionidRelatedDTO> list = this.getByWxUserIdAndWxEnterpriseId(wxUserId, wxEnterpriseId);
List<String> externalUserIdList = list.stream().map(student->student.getSelfExternalUserid())
.collect(Collectors.toList());
......
......@@ -166,7 +166,7 @@ public void sendMessage() {
@Test
public void extensionList() {
String s = qywxUserApiService.listSelfExternalUserid("ww9ede832a84b7ae5f", "01YQ-pcdYzF3K0So8uCFfkB5i8D5EBW7KcVB4qA8Ktk", "qiuwenmin");
String s = qywxUserApiService.listSelfExternalUserid("ww9ede832a84b7ae5f", "01YQ-pcdYzF3K0So8uCFfkB5i8D5EBW7KcVB4qA8Ktk", "de2c33f2e8924ff884e0073ca2f2f711");
System.out.println(JSONObject.toJSONString(s));
}
......
package com.gic.haoban.manage.web.controller;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.stream.Collector;
import java.util.stream.Collectors;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import cn.hutool.core.collection.CollectionUtil;
import com.alibaba.druid.util.StringUtils;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.gic.api.base.commons.Page;
import com.gic.commons.util.DateUtil;
import com.gic.enterprise.api.dto.EnterpriseAndUserDTO;
import com.gic.enterprise.api.dto.EnterpriseDTO;
import com.gic.enterprise.api.dto.StoreDTO;
......@@ -29,7 +13,6 @@ import com.gic.enterprise.api.service.StoreService;
import com.gic.haoban.base.api.common.BasePageInfo;
import com.gic.haoban.common.utils.EntityUtil;
import com.gic.haoban.common.utils.HaobanResponse;
import com.gic.haoban.common.utils.StringUtil;
import com.gic.haoban.manage.api.dto.DepartmentDTO;
import com.gic.haoban.manage.api.dto.EnterpriseDetailDTO;
import com.gic.haoban.manage.api.dto.WxEnterpriseDTO;
......@@ -46,6 +29,16 @@ import com.gic.wechat.api.dto.qywx.UserDTO;
import com.gic.wechat.api.service.qywx.QywxUserApiService;
import com.gic.wechat.token.api.dto.QywxCorpInfoDTO;
import com.gic.wechat.token.api.service.QywxTokenManageService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
@RestController
public class WxEnterpriseController extends WebBaseController{
......@@ -224,7 +217,7 @@ public class WxEnterpriseController extends WebBaseController{
LoginVO login = (LoginVO) AuthRequestUtil.getLoginUser();
wxEnterpriseId = login.getWxEnterpriseId();
WxEnterpriseDTO wxEnterprise = wxEnterpriseApiService.getOne(wxEnterpriseId);
if(wxEnterprise != null && org.apache.commons.lang3.StringUtils.isAnyBlank(wxEnterprise.getContactSecret(),wxEnterprise.getWxSecretKey(),wxEnterprise.getMemberSecret())){
if(wxEnterprise != null && org.apache.commons.lang3.StringUtils.isAnyBlank(wxEnterprise.getContactSecret(),wxEnterprise.getWxSecretKey())){
return resultResponse(HaoBanErrCode.ERR_1,false);
}
return resultResponse(HaoBanErrCode.ERR_1,true);
......@@ -276,7 +269,7 @@ public class WxEnterpriseController extends WebBaseController{
}
String res = qywxUserApiService.listSelfExternalUserid(wxEnterprise.getCorpid(), wxSecretKey, login.getStaffDTO().getWxUserId());
logger.info("【保存联系人key】res={}",res);
if(org.apache.commons.lang3.StringUtils.isBlank(res)){
if(res == null){
wxEnterprise.setWxSecretKeyLastTime(new Date());
wxEnterpriseApiService.update(wxEnterprise);
return resultResponse(HaoBanErrCode.ERR_10013);
......
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