Commit 8e8aea8a by zhuyajie

群列表

parent 884e2986
......@@ -202,7 +202,7 @@ public interface GroupQrcodeBiz {
* @param name
* @return
*/
PageBeanNew<GroupQrcodeBookVO> listQrcodeByPcloud(Integer currentPage, Integer numPerPage, String name);
PageBeanNew<GroupQrcodeBookVO> listQrcodeByPcloud(Integer currentPage, Integer numPerPage, String name, Long depLabelId);
/**
* 切群之后要做的事
......
......@@ -762,13 +762,45 @@ public class GroupQrcodeBizImpl implements GroupQrcodeBiz {
}
@Override
public PageBeanNew<GroupQrcodeBookVO> listQrcodeByPcloud(Integer currentPage, Integer numPerPage, String name) {
public PageBeanNew<GroupQrcodeBookVO> listQrcodeByPcloud(Integer currentPage, Integer numPerPage, String name, Long depLabelId) {
Map<String, Object> paramMap = new HashMap<>();
paramMap.put("name", name);
paramMap.put("depLabelId", depLabelId);
PageBeanNew<GroupQrcodeBookVO> pageBeanNew = groupQrcodeDao.listPageNew(new PageParam(currentPage, numPerPage), paramMap, "listQrcodeByPcloud");
if (pageBeanNew == null || ListUtils.isEmpty(pageBeanNew.getRecordList())) {
return new PageBeanNew<>(currentPage, numPerPage, new ArrayList<>());
}
//标签
Map<Long, String> labelMap = new HashMap<>();
List<Long> labelIds = new ArrayList<>();
List<Long> proLabels = pageBeanNew.getRecordList().stream().filter(s -> s.getProLabelId() != null).map(GroupQrcodeBookVO::getProLabelId).distinct().collect(Collectors.toList());
List<Long> depLabels = pageBeanNew.getRecordList().stream().filter(s -> s.getDepLabelId() != null).map(GroupQrcodeBookVO::getDepLabelId).distinct().collect(Collectors.toList());
List<Long> purLabels = pageBeanNew.getRecordList().stream().filter(s -> s.getPurLabelId() != null).map(GroupQrcodeBookVO::getPurLabelId).distinct().collect(Collectors.toList());
if (!ListUtils.isEmpty(proLabels)) {
labelIds.addAll(proLabels);
}
if (!ListUtils.isEmpty(depLabels)) {
labelIds.addAll(depLabels);
}
if (!ListUtils.isEmpty(purLabels)) {
labelIds.addAll(purLabels);
}
if (!ListUtils.isEmpty(labelIds)) {
labelMap = labelConsr.getLabelName(labelIds);
}
if (!MapUtils.isEmpty(labelMap)) {
for (GroupQrcodeBookVO qrcodeBookVO : pageBeanNew.getRecordList()) {
if (null != qrcodeBookVO.getProLabelId() && labelMap.containsKey(qrcodeBookVO.getProLabelId())) {
qrcodeBookVO.setProLabelName(labelMap.get(qrcodeBookVO.getProLabelId()));
}
if (null != qrcodeBookVO.getDepLabelId() && labelMap.containsKey(qrcodeBookVO.getDepLabelId())) {
qrcodeBookVO.setDepLabelName(labelMap.get(qrcodeBookVO.getDepLabelId()));
}
if (null != qrcodeBookVO.getPurLabelId() && labelMap.containsKey(qrcodeBookVO.getPurLabelId())) {
qrcodeBookVO.setPurLabelName(labelMap.get(qrcodeBookVO.getPurLabelId()));
}
}
}
return pageBeanNew;
}
......
......@@ -76,14 +76,16 @@ public interface GroupQrcodeFacade {
@ApiOperation(value = "平台端查群二维码", httpMethod = "GET")
@ApiImplicitParams({
@ApiImplicitParam(name = "name", value = "群名称", dataType = "string", paramType = "query"),
@ApiImplicitParam(name = "name", value = "群名称", dataType = "string", required = false, paramType = "query"),
@ApiImplicitParam(name = "currentPage", value = "当前页", dataType = "int", paramType = "query"),
@ApiImplicitParam(name = "numPerPage", value = "每页条数", dataType = "int", paramType = "query")
@ApiImplicitParam(name = "numPerPage", value = "每页条数", dataType = "int", paramType = "query"),
@ApiImplicitParam(name = "depLabelId", value = "深度标签id", dataType = "long", required = false, paramType = "query")
})
@RequestMapping(value = "listQrcodeByPcloud", method = RequestMethod.GET)
ResponseDto<PageBeanNew> listQrcodeByPcloud(
@RequestHeader("token") String token, @RequestParam(value = "currentPage", required = false) Integer currentPage,
@RequestParam(value = "numPerPage", required = false) Integer numPerPage,@RequestParam(value = "name", required = false) String name) throws PermissionException;
@RequestParam(value = "numPerPage", required = false) Integer numPerPage,@RequestParam(value = "name", required = false) String name,
@RequestParam(value = "depLabelId", required = false) Long depLabelId) throws PermissionException;
@ApiOperation("根据类型获取当前群总人数")
......
......@@ -142,9 +142,10 @@ public class GroupQrcodeFacadeImpl implements GroupQrcodeFacade {
@Override
public ResponseDto<PageBeanNew> listQrcodeByPcloud(
@RequestHeader("token") String token, @RequestParam(value = "currentPage", required = false) Integer currentPage,
@RequestParam(value = "numPerPage", required = false) Integer numPerPage,@RequestParam(value = "name", required = false) String name) throws PermissionException {
@RequestParam(value = "numPerPage", required = false) Integer numPerPage,@RequestParam(value = "name", required = false) String name,
@RequestParam(value = "depLabelId", required = false) Long depLabelId) throws PermissionException {
SessionUtil.getToken4Redis(token);
PageBeanNew<GroupQrcodeBookVO> pageBeanNew = groupQrcodeBiz.listQrcodeByPcloud(currentPage, numPerPage, name);
PageBeanNew<GroupQrcodeBookVO> pageBeanNew = groupQrcodeBiz.listQrcodeByPcloud(currentPage, numPerPage, name, depLabelId);
return new ResponseDto<>(pageBeanNew);
}
......
......@@ -3,6 +3,7 @@ package com.pcloud.book.group.vo;
import com.pcloud.common.dto.BaseDto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @描述:群和图书信息
......@@ -10,6 +11,7 @@ import io.swagger.annotations.ApiModelProperty;
* @创建时间:14:37 2019/7/4
* @版本:1.0
*/
@Data
public class GroupQrcodeBookVO extends BaseDto{
@ApiModelProperty("群标识")
......@@ -30,63 +32,28 @@ public class GroupQrcodeBookVO extends BaseDto{
@ApiModelProperty("书号")
private String isbn;
public Long getGroupQrcodeId() {
return groupQrcodeId;
}
public void setGroupQrcodeId(Long groupQrcodeId) {
this.groupQrcodeId = groupQrcodeId;
}
public String getGroupName() {
return groupName;
}
public void setGroupName(String groupName) {
this.groupName = groupName;
}
public String getWxGroupId() {
return wxGroupId;
}
public void setWxGroupId(String wxGroupId) {
this.wxGroupId = wxGroupId;
}
public Long getBookId() {
return bookId;
}
public void setBookId(Long bookId) {
this.bookId = bookId;
}
public String getBookName() {
return bookName;
}
public void setBookName(String bookName) {
this.bookName = bookName;
}
public String getIsbn() {
return isbn;
}
public void setIsbn(String isbn) {
this.isbn = isbn;
}
@Override
public String toString() {
return "GroupQrcodeBookVO{" +
"groupQrcodeId=" + groupQrcodeId +
", groupName='" + groupName + '\'' +
", wxGroupId='" + wxGroupId + '\'' +
", bookId=" + bookId +
", bookName='" + bookName + '\'' +
", isbn='" + isbn + '\'' +
'}';
}
@ApiModelProperty("专业标签ID")
private Long proLabelId;
@ApiModelProperty("专业标签名称")
private String proLabelName;
@ApiModelProperty("深度标签ID")
private Long depLabelId;
@ApiModelProperty("深度标签名称")
private String depLabelName;
@ApiModelProperty("目的标签ID")
private Long purLabelId;
@ApiModelProperty("目的标签名称")
private String purLabelName;
@ApiModelProperty("用户数量")
private Integer userNumber;
@ApiModelProperty("群分类介绍")
private String classifyIntroduce;
}
......@@ -760,11 +760,16 @@
SELECT
t.id groupQrcodeId,
t.group_name groupName,
t.weixin_group_id wxGroupId
t.weixin_group_id wxGroupId,
t.user_number userNumber,
bg.dep_label_id depLabelId,
bg.pro_label_id proLabelId,
bg.pur_label_id purLabelId,
t1.classify_introduce classifyIntroduce
FROM
book_group_qrcode t
INNER JOIN book_group_classify t1 ON t.classify_id = t1.id
INNER JOIN book_group bg ON t1.book_id = bg.book_id
LEFT JOIN book_group_classify t1 ON t.classify_id = t1.id
LEFT JOIN book_group bg ON t1.book_group_id = bg.id
WHERE
t.is_delete = 0
AND t1.is_delete = 0
......@@ -772,6 +777,9 @@
<if test="name != null">
AND t.group_name LIKE CONCAT('%', #{name}, '%')
</if>
<if test="depLabelId != null">
AND bg.dep_label_id = #{depLabelId}
</if>
</select>
<select id="getIdsByBookGroupId" parameterType="long" resultType="long">
......
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