Commit 7fc1d09a by 徐高华

群列表查询

parent 61279daa
...@@ -29,7 +29,35 @@ public class GroupChatSearchQDTO implements Serializable { ...@@ -29,7 +29,35 @@ public class GroupChatSearchQDTO implements Serializable {
private boolean chatPageFlag = false ; private boolean chatPageFlag = false ;
// 0全部 1未满200 2已满200 // 0全部 1未满200 2已满200
private Integer hmAddStatus ; private Integer hmAddStatus ;
private String departmentId ;
private List<String> departmentIdList ;
// 筛选激活或者开启联系我的群主
private Integer canUseFlag ;
public String getDepartmentId() {
return departmentId;
}
public List<String> getDepartmentIdList() {
return departmentIdList;
}
public Integer getCanUseFlag() {
return canUseFlag;
}
public void setDepartmentId(String departmentId) {
this.departmentId = departmentId;
}
public void setDepartmentIdList(List<String> departmentIdList) {
this.departmentIdList = departmentIdList;
}
public void setCanUseFlag(Integer canUseFlag) {
this.canUseFlag = canUseFlag;
}
public Integer getHmAddStatus() { public Integer getHmAddStatus() {
return hmAddStatus; return hmAddStatus;
} }
......
...@@ -227,6 +227,7 @@ public class GroupChatServiceImpl implements GroupChatService { ...@@ -227,6 +227,7 @@ public class GroupChatServiceImpl implements GroupChatService {
List<Long> groupChatIdList = list.stream().map(dto -> dto.getGroupChatId()).collect(Collectors.toList()); List<Long> groupChatIdList = list.stream().map(dto -> dto.getGroupChatId()).collect(Collectors.toList());
qdto.setGroupChatIdList(groupChatIdList); qdto.setGroupChatIdList(groupChatIdList);
} }
qdto.setDepartmentIdList(this.setDepartIdList(qdto.getWxEnterpriseId(), qdto.getDepartmentId()));
PageHelper.startPage(basePageInfo); PageHelper.startPage(basePageInfo);
List<GroupChatDTO> list = this.groupChatMapper.list(qdto); List<GroupChatDTO> list = this.groupChatMapper.list(qdto);
Page<GroupChatDTO> retPage = PageHelperUtils.changePageHelperToCurrentPage(list, GroupChatDTO.class); Page<GroupChatDTO> retPage = PageHelperUtils.changePageHelperToCurrentPage(list, GroupChatDTO.class);
...@@ -414,11 +415,11 @@ public class GroupChatServiceImpl implements GroupChatService { ...@@ -414,11 +415,11 @@ public class GroupChatServiceImpl implements GroupChatService {
private String emoji(String content) { private String emoji(String content) {
if (StringUtils.isBlank(content)) { if (StringUtils.isBlank(content)) {
return content ; return content;
} }
return EmojiParser.removeAllEmojis(content); return EmojiParser.removeAllEmojis(content);
} }
private void updateGroupChatDetail(WxEnterpriseQwDTO qwDTO, TabGroupChat chat, boolean syncMember) { private void updateGroupChatDetail(WxEnterpriseQwDTO qwDTO, TabGroupChat chat, boolean syncMember) {
// 控制同时刷新 // 控制同时刷新
Long groupChatId = chat.getGroupChatId(); Long groupChatId = chat.getGroupChatId();
...@@ -598,11 +599,11 @@ public class GroupChatServiceImpl implements GroupChatService { ...@@ -598,11 +599,11 @@ public class GroupChatServiceImpl implements GroupChatService {
} }
} }
} }
this.updateDate(groupChatId, totalCount, totalMemberCount, addMemberCount, addCount, quitCount, this.updateData(groupChatId, totalCount, totalMemberCount, addMemberCount, addCount, quitCount,
quitMemberCount); quitMemberCount);
} }
private void updateDate(Long groupChatId, int totalCount, int totalMemberCount, int addMemberCount, int addCount, private void updateData(Long groupChatId, int totalCount, int totalMemberCount, int addMemberCount, int addCount,
int quitCount, int quitMemberCount) { int quitCount, int quitMemberCount) {
logger.info("更新群的统计,groupChatId={}", groupChatId); logger.info("更新群的统计,groupChatId={}", groupChatId);
this.groupChatMapper.updateData(groupChatId, totalCount, totalMemberCount, addMemberCount, addCount, quitCount, this.groupChatMapper.updateData(groupChatId, totalCount, totalMemberCount, addMemberCount, addCount, quitCount,
...@@ -750,8 +751,15 @@ public class GroupChatServiceImpl implements GroupChatService { ...@@ -750,8 +751,15 @@ public class GroupChatServiceImpl implements GroupChatService {
@Override @Override
public Page<GroupChatOwnerDTO> listOwnerPage(OwnerSearchQDTO qdto, BasePageInfo basePageInfo) { public Page<GroupChatOwnerDTO> listOwnerPage(OwnerSearchQDTO qdto, BasePageInfo basePageInfo) {
qdto.setDepartmentIdList(this.setDepartIdList(qdto.getWxEnterpriseId(), qdto.getDepartmentId()));
PageHelper.startPage(basePageInfo);
List<GroupChatOwnerDTO> list = this.groupChatOwnerMapper.listOwner(qdto);
Page<GroupChatOwnerDTO> retPage = PageHelperUtils.changePageHelperToCurrentPage(list, GroupChatOwnerDTO.class);
return retPage;
}
private List<String> setDepartIdList(String wxEnterpriseId, String departmentId) {
List<String> departmentIdList = new ArrayList<>(); List<String> departmentIdList = new ArrayList<>();
String departmentId = qdto.getDepartmentId();
if (StringUtils.isNotBlank(departmentId)) { if (StringUtils.isNotBlank(departmentId)) {
TabHaobanDepartment department = this.departmentService.selectById(departmentId); TabHaobanDepartment department = this.departmentService.selectById(departmentId);
departmentIdList.add(departmentId); departmentIdList.add(departmentId);
...@@ -759,19 +767,14 @@ public class GroupChatServiceImpl implements GroupChatService { ...@@ -759,19 +767,14 @@ public class GroupChatServiceImpl implements GroupChatService {
String parentDepartmentId = department.getParentDepartmentId(); String parentDepartmentId = department.getParentDepartmentId();
if (!"0".equals(parentDepartmentId)) { if (!"0".equals(parentDepartmentId)) {
String chainId = department.getChainId() + Constant.ID_SEPARATOR + departmentId; String chainId = department.getChainId() + Constant.ID_SEPARATOR + departmentId;
List<TabHaobanDepartment> tabList = departmentService.listByChainId(chainId, List<TabHaobanDepartment> tabList = departmentService.listByChainId(chainId, wxEnterpriseId);
qdto.getWxEnterpriseId());
List<String> departmentIds = tabList.stream().map(TabHaobanDepartment::getDepartmentId) List<String> departmentIds = tabList.stream().map(TabHaobanDepartment::getDepartmentId)
.collect(Collectors.toList()); .collect(Collectors.toList());
departmentIdList.addAll(departmentIds); departmentIdList.addAll(departmentIds);
} }
} }
qdto.setDepartmentIdList(departmentIdList);
} }
PageHelper.startPage(basePageInfo); return departmentIdList;
List<GroupChatOwnerDTO> list = this.groupChatOwnerMapper.listOwner(qdto);
Page<GroupChatOwnerDTO> retPage = PageHelperUtils.changePageHelperToCurrentPage(list, GroupChatOwnerDTO.class);
return retPage;
} }
@Override @Override
......
...@@ -251,6 +251,9 @@ ...@@ -251,6 +251,9 @@
a.gic_flag gicFlag , a.init_flag initFlag , a.wx_chat_id_dk wxChatIdDk , a.off_time offTime , a.gic_flag gicFlag , a.init_flag initFlag , a.wx_chat_id_dk wxChatIdDk , a.off_time offTime ,
a.original_staff_id originalStaffId , a.hm_add_status hmAddStatus a.original_staff_id originalStaffId , a.hm_add_status hmAddStatus
from tab_haoban_group_chat a left join tab_haoban_staff b on a.staff_id = b.staff_id from tab_haoban_group_chat a left join tab_haoban_staff b on a.staff_id = b.staff_id
<if test="departmentIdList != null and departmentIdList.size() > 0">
left join tab_haoban_staff_department_related depart on a.staff_id = depart.staff_id and depart.status_flag = 1
</if>
where a.wx_enterprise_id=#{wxEnterpriseId} where a.wx_enterprise_id=#{wxEnterpriseId}
<if test="chatPageFlag==true"> <if test="chatPageFlag==true">
and (a.enterprise_id = #{enterpriseId} or a.enterprise_id is null) and (a.enterprise_id = #{enterpriseId} or a.enterprise_id is null)
...@@ -277,7 +280,7 @@ ...@@ -277,7 +280,7 @@
and a.hm_add_status = #{hmAddStatus} and a.hm_add_status = #{hmAddStatus}
</if> </if>
<if test="null != searchParams and ''!=searchParams "> <if test="null != searchParams and ''!=searchParams ">
and (a.name like '%${searchParams}%' or a.wx_chat_id like '${searchParams}%') and (a.name like '%${searchParams}%' or a.wx_chat_id like '${searchParams}%' or b.staff_name like '%${searchParams}%')
</if> </if>
<if test="null != staffIdList and staffIdList.size>0"> <if test="null != staffIdList and staffIdList.size>0">
and a.staff_id in and a.staff_id in
...@@ -303,13 +306,32 @@ ...@@ -303,13 +306,32 @@
#{groupChatId} #{groupChatId}
</foreach> </foreach>
</if> </if>
<if test="null != hmAddStatus and 0!=hmAddStatus">
and a.hm_add_status = #{hmAddStatus}
</if>
<if test="null !=canUseFlag and 1==canUseFlag">
and b.open_concat_flag = 1 and b.active_flag = 1
</if>
<if test="departmentIdList != null and departmentIdList.size() > 0">
and depart.department_id IN
<foreach collection="departmentIdList" item="id" index="index" open="(" close=")" separator=",">
#{id,jdbcType=VARCHAR}
</foreach>
</if>
and a.delete_flag = 0 and a.delete_flag = 0
<if test="departmentIdList != null and departmentIdList.size() > 0">
group by a.staff_id
</if>
<if test="null == sortColumn"> <if test="null == sortColumn">
order by a.chat_add_time desc order by a.chat_add_time desc
</if> </if>
<if test="null != sortColumn"> <if test="null != sortColumn">
order by a.${sortColumn} ${sortType} order by a.${sortColumn} ${sortType}
</if> </if>
</select> </select>
<update id="updateChatEnterpriseId"> <update id="updateChatEnterpriseId">
......
...@@ -98,7 +98,6 @@ public class GroupChatController { ...@@ -98,7 +98,6 @@ public class GroupChatController {
qdto.setEnterpriseId(loginUser.getEnterpriseId()); qdto.setEnterpriseId(loginUser.getEnterpriseId());
qdto.setChatPageFlag(true); qdto.setChatPageFlag(true);
ServiceResponse<Page<GroupChatDTO>> page = this.groupChatApiService.listPage(qdto, basePageInfo); ServiceResponse<Page<GroupChatDTO>> page = this.groupChatApiService.listPage(qdto, basePageInfo);
return RestResponse.successResult(page.getResult()); return RestResponse.successResult(page.getResult());
} }
......
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