Commit b3dc98f8 by 陶光胜

日志

parent 2c1d38be
package com.gic.haoban.manage.service.config;
import com.ctrip.framework.apollo.spring.annotation.EnableApolloConfig;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;
/**
* Created by tgs on 2020/2/23.
*/
@Configuration
@EnableApolloConfig
public class Config {
@Value("${corpid}")
private String corpid;
@Value("${suiteid}")
private String suiteId;
@Value("${host}")
private String host;
@Value("${wxSuiteid}")
private String wxSuiteid;
public String getCorpid() {
return corpid;
}
public void setCorpid(String corpid) {
this.corpid = corpid;
}
public String getSuiteId() {
return suiteId;
}
public void setSuiteId(String suiteId) {
this.suiteId = suiteId;
}
public String getHost() {
return host;
}
public void setHost(String host) {
this.host = host;
}
public String getWxSuiteid() {
return wxSuiteid;
}
public void setWxSuiteid(String wxSuiteid) {
this.wxSuiteid = wxSuiteid;
}
}
...@@ -17,6 +17,7 @@ import com.gic.haoban.manage.api.enums.WxEditType; ...@@ -17,6 +17,7 @@ import com.gic.haoban.manage.api.enums.WxEditType;
import com.gic.haoban.manage.api.service.DepartmentApiService; import com.gic.haoban.manage.api.service.DepartmentApiService;
import com.gic.haoban.manage.api.service.MessageApiService; import com.gic.haoban.manage.api.service.MessageApiService;
import com.gic.haoban.manage.api.service.StaffApiService; import com.gic.haoban.manage.api.service.StaffApiService;
import com.gic.haoban.manage.service.config.Config;
import com.gic.haoban.manage.service.entity.*; import com.gic.haoban.manage.service.entity.*;
import com.gic.haoban.manage.service.service.*; import com.gic.haoban.manage.service.service.*;
import com.gic.mq.sdk.GicMQClient; import com.gic.mq.sdk.GicMQClient;
...@@ -53,6 +54,8 @@ public class MessageApiServiceImpl implements MessageApiService { ...@@ -53,6 +54,8 @@ public class MessageApiServiceImpl implements MessageApiService {
private StaffApiService staffApiService; private StaffApiService staffApiService;
@Autowired @Autowired
private WxApplicationService wxApplicationService; private WxApplicationService wxApplicationService;
@Autowired
private Config config;
@Override @Override
public void gicMessageReceive(GicMessageDTO gicMessageDTO) { public void gicMessageReceive(GicMessageDTO gicMessageDTO) {
...@@ -69,8 +72,10 @@ public class MessageApiServiceImpl implements MessageApiService { ...@@ -69,8 +72,10 @@ public class MessageApiServiceImpl implements MessageApiService {
public void wxMessageReceive(QywxCallBackDTO qywxCallBackDTO) { public void wxMessageReceive(QywxCallBackDTO qywxCallBackDTO) {
GicMQClient clientInstance = GICMQClientUtil.getClientInstance(); GicMQClient clientInstance = GICMQClientUtil.getClientInstance();
try { try {
log.info("发送消息到dealWxMessageMq,{}", JSON.toJSONString(qywxCallBackDTO)); if(config.getSuiteId().equals(qywxCallBackDTO.getSuiteId())){
clientInstance.sendMessage("dealWxMessageMq", JSON.toJSONString(qywxCallBackDTO)); log.info("发送消息到dealWxMessageMq,{}", JSON.toJSONString(qywxCallBackDTO));
clientInstance.sendMessage("dealWxMessageMq", JSON.toJSONString(qywxCallBackDTO));
}
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }
......
...@@ -16,6 +16,8 @@ public class Config { ...@@ -16,6 +16,8 @@ public class Config {
private String suiteId; private String suiteId;
@Value("${host}") @Value("${host}")
private String host; private String host;
@Value("${wxSuiteid}")
private String wxSuiteid;
public String getCorpid() { public String getCorpid() {
return corpid; return corpid;
...@@ -40,4 +42,12 @@ public class Config { ...@@ -40,4 +42,12 @@ public class Config {
public void setHost(String host) { public void setHost(String host) {
this.host = host; this.host = host;
} }
public String getWxSuiteid() {
return wxSuiteid;
}
public void setWxSuiteid(String wxSuiteid) {
this.wxSuiteid = wxSuiteid;
}
} }
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