Commit 0d303edd by 徐高华

群主群数量

parent 768f3570
......@@ -182,6 +182,15 @@ public class GroupChatServiceImpl implements GroupChatService {
return;
}
this.groupChatMapper.updateChatStatus(groupChat.getGroupChatId(), 4);
// 更新群数量
this.updateOwnerCount(groupChat.getStaffId());
}
private void updateOwnerCount(String staffId) {
if(StringUtils.isNotBlank(staffId)) {
int chatCount = this.groupChatMapper.getCountByStaffId(staffId);
this.groupChatOwnerMapper.updateChatCount(staffId,chatCount) ;
}
}
@Override
......@@ -457,9 +466,9 @@ public class GroupChatServiceImpl implements GroupChatService {
logger.info("群主离职,刷新群状态,staffId={}", staffId);
TabGroupChatOwner owner = this.groupChatOwnerMapper.selectByStaffId(staffId);
if (null != owner) {
this.groupChatOwnerMapper.updateChatCount(staffId, owner.getChatCount());
TabHaobanStaff staff = this.staffMapper.selectByPrimaryKey(staffId);
this.dimissionOwner(staff.getWxEnterpriseId(), staff.getWxUserId(), staff.getWxOpenUseId());
this.updateOwnerCount(staffId);
}
}
......@@ -931,6 +940,7 @@ public class GroupChatServiceImpl implements GroupChatService {
}
if (StringUtils.isNotEmpty(oldStaffId)) {
this.groupChatOwnerHistoryMapper.updateOwnerEnd(groupChatId, oldStaffId);
this.updateOwnerCount(oldStaffId);
}
}
......
......@@ -57,7 +57,7 @@
<if test="departmentIdList != null and departmentIdList.size() > 0">
left join tab_haoban_staff_department_related c on a.staff_id = c.staff_id and c.status_flag = 1
</if>
where a.wx_enterprise_id=#{wxEnterpriseId}
where a.wx_enterprise_id=#{wxEnterpriseId} and a.chat_count > 0
<if test="departmentIdList != null and departmentIdList.size() > 0">
and c.department_id IN
<foreach collection="departmentIdList" item="id" index="index" open="(" close=")" separator=",">
......
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