Commit 82ee827f authored by 王淑君's avatar 王淑君

添加同步人员

parent 159b1932
......@@ -66,23 +66,26 @@ public class MTCotactApiRequestClient {
* @return
*/
public List<GetAllRspDTO> accountGetMyInfoList(String corpId,String updateTime) {
login();
if("dev".equalsIgnoreCase(serverType)) {
Map<String, String> queries = new HashMap<>(2);
queries.put("corpId", corpId);
queries.put("updateTime", updateTime);
login();
Map<String, String> headerParams = new HashMap<>(2);
headerParams.put("clientType", "app");
headerParams.put("Authorization", "Bearer " + ACCESS_TOKEN);
String json = okHttpUtil.get(api + "contact/v1/user/getUsersByUpdateTime", queries, headerParams);
if(StrUtil.isNotEmpty(json)) {
return JSON.parseObject(json, new TypeReference<Ret<List<GetAllRspDTO>>>() {
}).getData();
Map<String, String> queries = new HashMap<>(2);
queries.put("corpId", corpId);
queries.put("updateTime", updateTime);
Map<String, String> headerParams = new HashMap<>(2);
headerParams.put("clientType", "app");
headerParams.put("Authorization", "Bearer " + ACCESS_TOKEN);
String json = okHttpUtil.get(api + "contact/v1/user/getUsersByUpdateTime", queries, headerParams);
if (StrUtil.isNotEmpty(json)) {
return JSON.parseObject(json, new TypeReference<Ret<List<GetAllRspDTO>>>() {
}).getData();
}
return null;
}
return null;
// return contactFeignClient.getUsersByUpdateTime(corpId,updateTime,zxClientType,zxAccountId).getData();
return contactFeignClient.getUsersByUpdateTime(corpId,updateTime,zxClientType,zxAccountId).getData();
}
/**
......@@ -151,7 +154,7 @@ public class MTCotactApiRequestClient {
* @return
*/
public List<MTUserInfoRspDTO> userGets(MTUserGetsReqDTO mtUserGetsReqDTO) {
if("dev".equalsIgnoreCase(serverType)){
// if("dev".equalsIgnoreCase(serverType)){
login();
Map<String, String> headerParams = new HashMap<>(2);
headerParams.put("clientType", "app");
......@@ -162,8 +165,8 @@ public class MTCotactApiRequestClient {
}).getData();
}
return new ArrayList<>();
}
return contactFeignClient.userGets(mtUserGetsReqDTO,zxClientType,zxAccountId).getData();
// }
// return contactFeignClient.userGets(mtUserGetsReqDTO,zxClientType,zxAccountId).getData();
}
public List<GetAllRspDTO> userAll(String corpId) {
......
......@@ -36,27 +36,27 @@ public class MTNotificationApiRequestClient {
* @param mtNotificationSendReqDTO
* @return
*/
public boolean send(MTNotificationSendReqDTO mtNotificationSendReqDTO, String type) {
List<String> userIds = mtNotificationSendReqDTO.getReceiverIds();
List<String> accountIds = new ArrayList<>();
MTUserGetsReqDTO mtUserGetsReqDTO = new MTUserGetsReqDTO();
mtUserGetsReqDTO.setCorpId(mtNotificationSendReqDTO.getCorpId());
mtUserGetsReqDTO.setIds(userIds);
List<MTUserInfoRspDTO> allUserList = mtCotactApiRequestClient.userGets(mtUserGetsReqDTO);
if(allUserList != null && allUserList.size() > 0){
for(MTUserInfoRspDTO mtUserInfoRspDTO : allUserList){
accountIds.add(mtUserInfoRspDTO.getAccountId());
}
}
log.info("消息发送人accountId:" + accountIds);
mtNotificationSendReqDTO.setReceiverIds(accountIds);
mtNotificationSendReqDTO.setChannels("ALL");
mtNotificationSendReqDTO.setCategoryCodes(Arrays.asList(new String[]{type}));
Ret ret = notificationFeignClient.sendMessage(mtNotificationSendReqDTO,"app",(long)1);
if(ret != null && ResultCode.SUCCESS.getCode().toString().equals(ret.getCode())){
return true;
}
return false;
}
// public boolean send(MTNotificationSendReqDTO mtNotificationSendReqDTO, String type) {
// List<String> userIds = mtNotificationSendReqDTO.getReceiverIds();
// List<String> accountIds = new ArrayList<>();
// MTUserGetsReqDTO mtUserGetsReqDTO = new MTUserGetsReqDTO();
// mtUserGetsReqDTO.setCorpId(mtNotificationSendReqDTO.getCorpId());
// mtUserGetsReqDTO.setIds(userIds);
// List<MTUserInfoRspDTO> allUserList = mtCotactApiRequestClient.userGets(mtUserGetsReqDTO);
// if(allUserList != null && allUserList.size() > 0){
// for(MTUserInfoRspDTO mtUserInfoRspDTO : allUserList){
// accountIds.add(mtUserInfoRspDTO.getAccountId());
// }
// }
// log.info("消息发送人accountId:" + accountIds);
// mtNotificationSendReqDTO.setReceiverIds(accountIds);
// mtNotificationSendReqDTO.setChannels("ALL");
// mtNotificationSendReqDTO.setCategoryCodes(Arrays.asList(new String[]{type}));
// Ret ret = notificationFeignClient.sendMessage(mtNotificationSendReqDTO,"app",(long)1);
// if(ret != null && ResultCode.SUCCESS.getCode().toString().equals(ret.getCode())){
// return true;
// }
// return false;
// }
}
......@@ -5,7 +5,7 @@ server:
servlet:
context-path: /
#uri-encoding: UTF-8
type: dev1
type: dev
maxHttpHeaderSize: 102400
#logging:
......@@ -14,11 +14,13 @@ server:
# org.springframework.web: DEBUG
druid:
# url: jdbc:mysql://127.0.0.1:3306/edu_db2?useUnicode=true&characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull&allowMultiQueries=true&useSSL=false
url: jdbc:mysql://10.96.131.16:55558/edu_db?useUnicode=true&characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull&allowMultiQueries=true&useSSL=false
url: jdbc:mysql://127.0.0.1:3306/edu_db?useUnicode=true&characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull&allowMultiQueries=true&useSSL=false
# url: jdbc:mysql://10.96.131.16:55558/edu_db?useUnicode=true&characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull&allowMultiQueries=true&useSSL=false
# url: jdbc:mysql://192.168.137.1/1012mt?useUnicode=true&characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull&allowMultiQueries=true&useSSL=false
#url: jdbc:mysql://120.52.179.75:13318/edu_db?useUnicode=true&characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull&allowMultiQueries=true&useSSL=false
username: root
password: 91isoft
password: 123456
# password: 91isoft
# password: root
initial-size: 1
min-idle: 1
......@@ -60,6 +62,8 @@ spring:
multipart:
max-file-size: 100MB
max-request-size: 100MB
application:
name: zx-education
global:
lk:
......@@ -91,6 +95,7 @@ libreoffice:
ip: 192.168.1.125
port: 10188
mt:
# api: http://192.168.5.41/api/
api: http://221.239.114.20:6789/api/
......
......@@ -5,7 +5,7 @@ server:
servlet:
context-path: /
#uri-encoding: UTF-8
type: dev1
type: prod
#logging:
# level:
......@@ -56,6 +56,8 @@ spring:
multipart:
max-file-size: 100MB
max-request-size: 100MB
application:
name: ZX-EDUCATION
global:
lk:
......
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