Commit 7fc1d09a by 徐高华

群列表查询

parent 61279daa
......@@ -29,7 +29,35 @@ public class GroupChatSearchQDTO implements Serializable {
private boolean chatPageFlag = false ;
// 0全部 1未满200 2已满200
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() {
return hmAddStatus;
}
......
......@@ -227,6 +227,7 @@ public class GroupChatServiceImpl implements GroupChatService {
List<Long> groupChatIdList = list.stream().map(dto -> dto.getGroupChatId()).collect(Collectors.toList());
qdto.setGroupChatIdList(groupChatIdList);
}
qdto.setDepartmentIdList(this.setDepartIdList(qdto.getWxEnterpriseId(), qdto.getDepartmentId()));
PageHelper.startPage(basePageInfo);
List<GroupChatDTO> list = this.groupChatMapper.list(qdto);
Page<GroupChatDTO> retPage = PageHelperUtils.changePageHelperToCurrentPage(list, GroupChatDTO.class);
......@@ -414,11 +415,11 @@ public class GroupChatServiceImpl implements GroupChatService {
private String emoji(String content) {
if (StringUtils.isBlank(content)) {
return content ;
return content;
}
return EmojiParser.removeAllEmojis(content);
}
private void updateGroupChatDetail(WxEnterpriseQwDTO qwDTO, TabGroupChat chat, boolean syncMember) {
// 控制同时刷新
Long groupChatId = chat.getGroupChatId();
......@@ -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);
}
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) {
logger.info("更新群的统计,groupChatId={}", groupChatId);
this.groupChatMapper.updateData(groupChatId, totalCount, totalMemberCount, addMemberCount, addCount, quitCount,
......@@ -750,8 +751,15 @@ public class GroupChatServiceImpl implements GroupChatService {
@Override
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<>();
String departmentId = qdto.getDepartmentId();
if (StringUtils.isNotBlank(departmentId)) {
TabHaobanDepartment department = this.departmentService.selectById(departmentId);
departmentIdList.add(departmentId);
......@@ -759,19 +767,14 @@ public class GroupChatServiceImpl implements GroupChatService {
String parentDepartmentId = department.getParentDepartmentId();
if (!"0".equals(parentDepartmentId)) {
String chainId = department.getChainId() + Constant.ID_SEPARATOR + departmentId;
List<TabHaobanDepartment> tabList = departmentService.listByChainId(chainId,
qdto.getWxEnterpriseId());
List<TabHaobanDepartment> tabList = departmentService.listByChainId(chainId, wxEnterpriseId);
List<String> departmentIds = tabList.stream().map(TabHaobanDepartment::getDepartmentId)
.collect(Collectors.toList());
departmentIdList.addAll(departmentIds);
}
}
qdto.setDepartmentIdList(departmentIdList);
}
PageHelper.startPage(basePageInfo);
List<GroupChatOwnerDTO> list = this.groupChatOwnerMapper.listOwner(qdto);
Page<GroupChatOwnerDTO> retPage = PageHelperUtils.changePageHelperToCurrentPage(list, GroupChatOwnerDTO.class);
return retPage;
return departmentIdList;
}
@Override
......
......@@ -251,6 +251,9 @@
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
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}
<if test="chatPageFlag==true">
and (a.enterprise_id = #{enterpriseId} or a.enterprise_id is null)
......@@ -277,7 +280,7 @@
and a.hm_add_status = #{hmAddStatus}
</if>
<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 test="null != staffIdList and staffIdList.size>0">
and a.staff_id in
......@@ -303,13 +306,32 @@
#{groupChatId}
</foreach>
</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
<if test="departmentIdList != null and departmentIdList.size() > 0">
group by a.staff_id
</if>
<if test="null == sortColumn">
order by a.chat_add_time desc
</if>
<if test="null != sortColumn">
order by a.${sortColumn} ${sortType}
</if>
</select>
<update id="updateChatEnterpriseId">
......
......@@ -98,7 +98,6 @@ public class GroupChatController {
qdto.setEnterpriseId(loginUser.getEnterpriseId());
qdto.setChatPageFlag(true);
ServiceResponse<Page<GroupChatDTO>> page = this.groupChatApiService.listPage(qdto, basePageInfo);
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