Commit b4c18531 by 徐高华

好办加好友统计

parent e65e7e42
...@@ -50,8 +50,28 @@ public class MemberUnionidRelatedDTO implements Serializable{ ...@@ -50,8 +50,28 @@ public class MemberUnionidRelatedDTO implements Serializable{
private Integer addWay ; private Integer addWay ;
private String wxUserId ;
private int reTry ;
private boolean isFlush = false ; private boolean isFlush = false ;
public String getWxUserId() {
return wxUserId;
}
public void setWxUserId(String wxUserId) {
this.wxUserId = wxUserId;
}
public int getReTry() {
return reTry;
}
public void setReTry(int reTry) {
this.reTry = reTry;
}
public boolean isFlush() { public boolean isFlush() {
return isFlush; return isFlush;
} }
......
...@@ -40,7 +40,7 @@ public interface QywxErrorLogService { ...@@ -40,7 +40,7 @@ public interface QywxErrorLogService {
* @param msg * @param msg
* @param type 4自建 5第三方 * @param type 4自建 5第三方
*/ */
void addFriendErrLog(String wxEnterpriseId , String msg , int type) ; void addFriendErrLog(String wxEnterpriseId , String msg , int type , String externalUserId) ;
public void putToMq(QywxErrorLogDTO dto) ; public void putToMq(QywxErrorLogDTO dto) ;
......
...@@ -62,10 +62,10 @@ public class TabQywxErrorLogServiceImpl implements QywxErrorLogService { ...@@ -62,10 +62,10 @@ public class TabQywxErrorLogServiceImpl implements QywxErrorLogService {
} }
@Override @Override
public void addFriendErrLog(String wxEnterpriseId, String msg, int type) { public void addFriendErrLog(String wxEnterpriseId, String msg, int type , String externalUserId) {
QywxErrorLogDTO errLog = new QywxErrorLogDTO() ; QywxErrorLogDTO errLog = new QywxErrorLogDTO() ;
errLog.setWxEnterpriseId(wxEnterpriseId); errLog.setWxEnterpriseId(wxEnterpriseId);
errLog.setExternalUserId("-1"); errLog.setExternalUserId(externalUserId);
errLog.setTraceId(ProviderLocalTag.tag.get().traceId); errLog.setTraceId(ProviderLocalTag.tag.get().traceId);
errLog.setQywxErrorType(type); errLog.setQywxErrorType(type);
errLog.setScenario("加好友"); errLog.setScenario("加好友");
......
...@@ -921,14 +921,16 @@ public class MemberUnionidRelatedApiServiceImpl implements MemberUnionidRelatedA ...@@ -921,14 +921,16 @@ public class MemberUnionidRelatedApiServiceImpl implements MemberUnionidRelatedA
this.updateExternalStatus(dto.getExternalUserid(),dto.getStaffId()); this.updateExternalStatus(dto.getExternalUserid(),dto.getStaffId());
String unionIdJson = qywxUserApiService.getCorpSelfExternalUseridInfo(qwDTO.getDkCorpid(), qwDTO.getSelfSecret(), dto.getExternalUserid(),qwDTO.getUrlHost()); String unionIdJson = qywxUserApiService.getCorpSelfExternalUseridInfo(qwDTO.getDkCorpid(), qwDTO.getSelfSecret(), dto.getExternalUserid(),qwDTO.getUrlHost());
if(unionIdJson.contains("徐高华")) { if(unionIdJson.contains("徐高华")) {
this.qywxErrorLogService.addFriendErrLog(wxEnterpriseId,JSONObject.toJSONString(dto),4); dto.setWxUserId(wxUserId);
this.qywxErrorLogService.addFriendErrLog(wxEnterpriseId,JSONObject.toJSONString(dto),4 , dto.getExternalUserid());
} }
if (StringUtils.isBlank(unionIdJson)) { if (StringUtils.isBlank(unionIdJson)) {
log.info("好友不存在"); log.info("好友不存在");
return null; return null;
} else if ("1".equals(unionIdJson)) { } else if ("1".equals(unionIdJson)) {
log.info("接口调用被限制"); log.info("接口调用被限制");
this.qywxErrorLogService.addFriendErrLog(wxEnterpriseId,JSONObject.toJSONString(dto),4); dto.setWxUserId(wxUserId);
this.qywxErrorLogService.addFriendErrLog(wxEnterpriseId,JSONObject.toJSONString(dto),4,dto.getExternalUserid());
HBQwMonitorUtils.addForFriend(1); HBQwMonitorUtils.addForFriend(1);
throw new WxApiLimitException("getCorpSelfExternalUseridInfo接口调用被限制"); throw new WxApiLimitException("getCorpSelfExternalUseridInfo接口调用被限制");
} }
...@@ -1393,7 +1395,7 @@ public class MemberUnionidRelatedApiServiceImpl implements MemberUnionidRelatedA ...@@ -1393,7 +1395,7 @@ public class MemberUnionidRelatedApiServiceImpl implements MemberUnionidRelatedA
}else { }else {
uJ = this.qywxUserApiService.getExternalUseridInfo(qwDTO.getThirdCorpid(), config.getWxSuiteid(), externalUserId); uJ = this.qywxUserApiService.getExternalUseridInfo(qwDTO.getThirdCorpid(), config.getWxSuiteid(), externalUserId);
if(StringUtils.isNotBlank(uJ) && uJ.contains("徐高华")) { if(StringUtils.isNotBlank(uJ) && uJ.contains("徐高华")) {
this.qywxErrorLogService.addFriendErrLog(wxEnterpriseId,tabHaobanStaff.getStaffId(),5); this.qywxErrorLogService.addFriendErrLog(wxEnterpriseId,tabHaobanStaff.getStaffId(),5,externalUserId);
} }
} }
if (StringUtils.isBlank(uJ)) { if (StringUtils.isBlank(uJ)) {
...@@ -1402,7 +1404,7 @@ public class MemberUnionidRelatedApiServiceImpl implements MemberUnionidRelatedA ...@@ -1402,7 +1404,7 @@ public class MemberUnionidRelatedApiServiceImpl implements MemberUnionidRelatedA
} else if ("1".equals(uJ)) { } else if ("1".equals(uJ)) {
log.info("限制次数"); log.info("限制次数");
if(from==0) { if(from==0) {
this.qywxErrorLogService.addFriendErrLog(wxEnterpriseId,tabHaobanStaff.getStaffId(),5); this.qywxErrorLogService.addFriendErrLog(wxEnterpriseId,tabHaobanStaff.getStaffId(),5,externalUserId);
HBQwMonitorUtils.addForFriend(1); HBQwMonitorUtils.addForFriend(1);
} }
throw new WxApiLimitException("getExternalUseridInfo接口次数限制"); throw new WxApiLimitException("getExternalUseridInfo接口次数限制");
......
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