Commit e65e7e42 by 徐高华

好办加好友统计

parent 0ea445fa
......@@ -118,5 +118,7 @@ public interface HaobanTimerApiService {
*/
public void addFrientMonitorTimer(String params) ;
public void doErrorFriendTimer(String params) ;
}
......@@ -2,8 +2,10 @@ package com.gic.haoban.manage.service.dao.mapper;
import com.gic.haoban.manage.api.dto.qdto.QywxErrorLogListQDTO;
import com.gic.haoban.manage.service.entity.TabQywxErrorLog;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import java.util.Date;
import java.util.List;
/**
......@@ -25,4 +27,7 @@ public interface TabQywxErrorLogMapper {
*/
List<TabQywxErrorLog> queryListByPage(QywxErrorLogListQDTO qywxErrorLogListQDTO);
List<TabQywxErrorLog> listErrorFriend(@Param("wxEnterpriseId") String wxEnterpriseId , @Param("qywxErrorType") int type ,
@Param("startDate") Date startDate , @Param("endDate") Date endDate) ;
}
......@@ -44,4 +44,6 @@ public interface QywxErrorLogService {
public void putToMq(QywxErrorLogDTO dto) ;
public void doFriendTimer(String params) ;
}
......@@ -4,11 +4,17 @@ import java.util.Date;
import java.util.List;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.gic.commons.util.CollectionUtil;
import com.gic.commons.util.DateUtil;
import com.gic.commons.util.GICMQClientUtil;
import com.gic.dubbo.entity.ProviderLocalTag;
import com.gic.haoban.manage.api.constants.Manage3Constants;
import com.gic.haoban.manage.api.dto.QwFrientNoticeDTO;
import com.gic.haoban.manage.api.dto.QywxErrorLogDTO;
import com.gic.haoban.manage.service.pojo.DealQywxExternalUserPojo;
import com.gic.mq.sdk.GicMQClient;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
......@@ -75,4 +81,25 @@ public class TabQywxErrorLogServiceImpl implements QywxErrorLogService {
log.error("发送消息失败:{}", e.getMessage(), e);
}
}
@Override
public void doFriendTimer(String params) {
log.info("加好友异常重试");
Date start = DateUtil.getStartTimeOfDay() ;
Date end = DateUtil.getEndTimeOfDay() ;
List<TabQywxErrorLog> list = this.tabQywxErrorLogMapper.listErrorFriend(null,4, start, end) ;
if(CollectionUtils.isNotEmpty(list)) {
String mqName = "dealQywxExternalUserMq2";
for(TabQywxErrorLog tab : list) {
DealQywxExternalUserPojo dealQywxExternalUserPojo = new DealQywxExternalUserPojo();
dealQywxExternalUserPojo.setType(DealQywxExternalUserPojo.DealType.add.getType());
dealQywxExternalUserPojo.setData(JSONObject.parseObject(tab.getErrorContent(), QwFrientNoticeDTO.class));
try {
clientInstance.sendMessage(mqName, JSONObject.toJSONString(dealQywxExternalUserPojo));
} catch (Exception e) {
log.info("异步处理异常:{}", e);
}
}
}
}
}
package com.gic.haoban.manage.service.service.out.impl;
import com.gic.haoban.manage.service.service.QywxErrorLogService;
import com.gic.haoban.manage.service.service.chat.GroupChatDataService;
import com.gic.haoban.manage.service.util.HBQwMonitorUtils;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -28,6 +29,8 @@ public class HaobanTimerApiServiceImpl implements HaobanTimerApiService {
private ExternalMemberService externalMemberService ;
@Autowired
private GroupChatDataService groupChatDataService ;
@Autowired
private QywxErrorLogService qywxErrorLogService ;
@Override
......@@ -94,4 +97,9 @@ public class HaobanTimerApiServiceImpl implements HaobanTimerApiService {
public void addFrientMonitorTimer(String params) {
HBQwMonitorUtils.addByTimer();
}
@Override
public void doErrorFriendTimer(String params) {
this.qywxErrorLogService.doFriendTimer(params);
}
}
......@@ -1392,6 +1392,9 @@ public class MemberUnionidRelatedApiServiceImpl implements MemberUnionidRelatedA
uJ = this.qywxUserApiService.getCorpSelfExternalUseridInfo(qwDTO.getDkCorpid(), qwDTO.getSelfSecret(), externalUserId,qwDTO.getUrlHost()) ;
}else {
uJ = this.qywxUserApiService.getExternalUseridInfo(qwDTO.getThirdCorpid(), config.getWxSuiteid(), externalUserId);
if(StringUtils.isNotBlank(uJ) && uJ.contains("徐高华")) {
this.qywxErrorLogService.addFriendErrLog(wxEnterpriseId,tabHaobanStaff.getStaffId(),5);
}
}
if (StringUtils.isBlank(uJ)) {
log.info("好友不存在");
......
......@@ -82,8 +82,17 @@
</trim>
</insert>
<select id="listErrorFriend" resultMap="TabQywxErrorLogMap">
select
<include refid="Base_Column_List"/>
from tab_qywx_error_log where qywx_error_type = #{qywxErrorType}
and create_time <![CDATA[ >= ]]> #{startDate}
and create_time <![CDATA[ <= ]]> #{endDate}
<if test="wxEnterpriseId != null and wxEnterpriseId != ''">
and wx_enterprise_id = #{wxEnterpriseId}
</if>
</select>
<!--通过实体作为筛选条件查询-->
<select id="queryListByPage" parameterType="com.gic.haoban.manage.api.dto.qdto.QywxErrorLogListQDTO"
resultMap="TabQywxErrorLogMap">
select
......
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