Commit b725c9b8 by 徐高华

群主离职状态处理

parent 6901685a
......@@ -26,4 +26,14 @@ public interface GroupChatOwnerMapper {
public int updateChatCount(@Param("staffId") String staffId, @Param("chatCount") int chatCount);
public List<GroupChatOwnerDTO> listOwner(OwnerSearchQDTO qdto);
/**
*
* @Title: dimissionOwnerList
* @Description: 查询处理离职的群主
* @author xugh
* @return
* @throws
*/
public List<GroupChatOwnerDTO> dimissionOwnerList();
}
\ No newline at end of file
......@@ -143,6 +143,7 @@ public class GroupChatServiceImpl implements GroupChatService {
@Override
public void createChat(String corpid, String wxChatId) {
logger.info("创建群,id={}",wxChatId);
String wxEnterpriseId = this.getWxEnterpriesId(corpid);
if (null == wxEnterpriseId) {
return;
......@@ -363,8 +364,35 @@ public class GroupChatServiceImpl implements GroupChatService {
} finally {
RedisUtil.delCache(key);
}
// 群主离职列表
List<GroupChatOwnerDTO> dimissionOwnerList = this.groupChatOwnerMapper.dimissionOwnerList() ;
for(GroupChatOwnerDTO dto : dimissionOwnerList) {
logger.info("群主离职,群状态处理={}",JSON.toJSONString(dto));
this.dimissionOwner(dto);
}
}
private void dimissionOwner(GroupChatOwnerDTO dto) {
String wxEnterpriseId = dto.getWxEnterpriseId() ;
WxEnterpriseQwDTO qwDTO = this.wxEnterpriseService.getQwInfo(wxEnterpriseId);
if (null == qwDTO) {
logger.info("wxEnterpriseId不存在,id={}", wxEnterpriseId);
return;
}
List<String> userIdList = null;
if (qwDTO.needOpenUserIdDk()) {
userIdList = Arrays.asList(dto.getWxOpenUserId());
} else {
userIdList = Arrays.asList(dto.getWxUserId());
}
if (CollectionUtils.isNotEmpty(userIdList)) {
this.syncGroupChatList(qwDTO, userIdList, null, false);
}
}
/**
* 初始化整个群数据,拉取所有成员的所有群,并立即获取群信息、群成员、同时也会匹配客户标识
*/
......
......@@ -76,6 +76,13 @@
<if test="departmentIdList != null and departmentIdList.size() > 0">
group by a.staff_id
</if>
</select>
<select id="dimissionOwnerList" resultType="com.gic.haoban.manage.api.dto.chat.GroupChatOwnerDTO">
SELECT a.staff_id staffId , b.`staff_name` staffName , a.wx_enterprise_id wxEnterpriseId ,
b.wx_user_id wxUserId , b.wx_open_user_id wxOpenUserId
FROM tab_haoban_group_chat_owner a LEFT JOIN tab_haoban_staff b ON a.`staff_id` = b.`staff_id`
where a.wx_enterprise_id=#{wxEnterpriseId} and b.status_flag = 0 and b.update_time > DATE_ADD(CURDATE(), INTERVAL -1 DAY)
</select>
</mapper>
\ No newline at end of file
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