Commit ac8ea8c3 by 高鹏

Merge branch 'zhuyajie' into 'master'

合并

See merge request rays/pcloud-book!42
parents e947f294 e78da8d4
......@@ -6,6 +6,7 @@ import com.pcloud.book.group.dto.GroupQrcodeInfoDTO;
import com.pcloud.book.group.entity.GroupQrcode;
import com.pcloud.book.group.vo.ClassifyQrcodeVO;
import com.pcloud.book.group.vo.GroupQrcodeBaseInfoVO;
import com.pcloud.book.group.vo.GroupQrcodeBookVO;
import com.pcloud.book.group.vo.ListGroupQrcodeResponseVO;
import com.pcloud.book.group.vo.ListQrcodeByClassifyParamVO;
import com.pcloud.book.group.vo.UpdateGroupQrcodeRequestVO;
......@@ -119,4 +120,14 @@ public interface GroupQrcodeBiz {
* @return
*/
List<Long> filterDeleteId(List<String> wxGroupIdList);
/**
* 获取编辑下二维码
* @param currentPage
* @param numPerPage
* @param name
* @param adviserId
* @return
*/
PageBeanNew<GroupQrcodeBookVO> listQrcodeByAdviser(Integer currentPage, Integer numPerPage, String name, Long adviserId);
}
......@@ -28,6 +28,7 @@ import com.pcloud.book.group.tools.SendWeixinRequestTools;
import com.pcloud.book.group.vo.ClassifyQrcodeVO;
import com.pcloud.book.group.vo.ClassifyVO;
import com.pcloud.book.group.vo.GroupQrcodeBaseInfoVO;
import com.pcloud.book.group.vo.GroupQrcodeBookVO;
import com.pcloud.book.group.vo.ListGroupQrcodeResponseVO;
import com.pcloud.book.group.vo.ListQrcodeByClassifyParamVO;
import com.pcloud.book.group.vo.UpdateGroupQrcodeRequestVO;
......@@ -455,4 +456,18 @@ public class GroupQrcodeBizImpl implements GroupQrcodeBiz {
}
}
@Override
public PageBeanNew<GroupQrcodeBookVO> listQrcodeByAdviser(Integer currentPage, Integer numPerPage, String name, Long adviserId) {
Map<String, Object> paramMap = new HashMap<>();
paramMap.put("adviserId", adviserId);
paramMap.put("name", name);
//获取二维码列表
PageBeanNew<GroupQrcodeBookVO> pageBeanNew = groupQrcodeDao.listPageNew(new PageParam(currentPage,numPerPage), paramMap, "listQrcodeByAdviser");
if (pageBeanNew == null || ListUtils.isEmpty(pageBeanNew.getRecordList())) {
return new PageBeanNew<>(currentPage,numPerPage, new ArrayList<>());
}
return pageBeanNew;
}
}
......@@ -9,7 +9,6 @@ import com.pcloud.common.page.PageBeanNew;
import com.pcloud.common.permission.PermissionException;
import org.codehaus.jackson.JsonParseException;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
......@@ -55,4 +54,14 @@ public interface GroupQrcodeFacade {
ResponseDto<GroupQrcodeBaseInfoVO> getBaseById(@RequestHeader("token") String token, @RequestParam("groupQrcodeId") Long groupQrcodeId)
throws BizException, JsonParseException, PermissionException;
@ApiOperation(value = "获取编辑下二维码", httpMethod = "GET")
@ApiImplicitParams({
@ApiImplicitParam(name = "name", value = "名称", dataType = "string", paramType = "query"),
@ApiImplicitParam(name = "currentPage", value = "当前页", dataType = "int", paramType = "query"),
@ApiImplicitParam(name = "numPerPage", value = "每页条数", dataType = "int", paramType = "query")
})
@RequestMapping(value = "listQrcodeByAdviser", method = RequestMethod.GET)
ResponseDto<PageBeanNew> listQrcodeByAdviser(
@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;
}
package com.pcloud.book.group.facade.impl;
import com.pcloud.book.base.exception.BookBizException;
import com.pcloud.book.group.biz.GroupQrcodeBiz;
import com.pcloud.book.group.facade.GroupQrcodeFacade;
import com.pcloud.book.group.vo.ClassifyQrcodeVO;
import com.pcloud.book.group.vo.GroupQrcodeBaseInfoVO;
import com.pcloud.book.group.vo.GroupQrcodeBookVO;
import com.pcloud.book.group.vo.ListQrcodeByClassifyParamVO;
import com.pcloud.book.group.vo.UpdateGroupQrcodeRequestVO;
import com.pcloud.book.group.vo.WechatGroupNameVO;
......@@ -20,6 +22,7 @@ import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
......@@ -76,6 +79,19 @@ public class GroupQrcodeFacadeImpl implements GroupQrcodeFacade {
return new ResponseDto<>(groupQrcodeBaseInfoVO == null ? new GroupQrcodeBaseInfoVO() : groupQrcodeBaseInfoVO);
}
@Override
@RequestMapping(value = "listQrcodeByAdviser", method = RequestMethod.GET)
public ResponseDto<PageBeanNew> listQrcodeByAdviser(
@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 {
if (null == currentPage || null == numPerPage) {
throw new BookBizException(BookBizException.PARAM_IS_ERROR, "缺少分页参数");
}
Long adviserId = (Long) SessionUtil.getVlaue(token, SessionUtil.PARTY_ID);
PageBeanNew<GroupQrcodeBookVO> pageBeanNew = groupQrcodeBiz.listQrcodeByAdviser(currentPage, numPerPage, name, adviserId);
return new ResponseDto<>(pageBeanNew);
}
@GetMapping("addUser")
ResponseDto<?> addUser(@RequestParam("weixinGroupId") String weixinGroupId, @RequestParam("userNumber") Integer userNumber)
throws BizException{
......
package com.pcloud.book.group.vo;
import com.pcloud.common.dto.BaseDto;
import io.swagger.annotations.ApiModelProperty;
/**
* @描述:群和图书信息
* @作者:zhuyajie
* @创建时间:14:37 2019/7/4
* @版本:1.0
*/
public class GroupQrcodeBookVO extends BaseDto{
@ApiModelProperty("群标识")
private Long groupQrcodeId;
@ApiModelProperty("群名称")
private String groupName;
@ApiModelProperty("群id")
private String wxGroupId;
@ApiModelProperty("书id")
private Long bookId;
@ApiModelProperty("书名称")
private String bookName;
@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 + '\'' +
'}';
}
}
......@@ -432,4 +432,27 @@
</foreach>
</select>
<select id="listQrcodeByAdviser" parameterType="map" resultType="com.pcloud.book.group.vo.GroupQrcodeBookVO">
SELECT
t.id groupQrcodeId,
t.group_name groupName,
t.weixin_group_id wxGroupId,
t2.BOOK_ID bookId,
t2.BOOK_NAME bookName,
t2.ISBN isbn
FROM
book_group_qrcode t
INNER JOIN book_group_classify t1 ON t.classify_id = t1.id
INNER JOIN book t2 ON t1.book_id = t2.BOOK_ID
WHERE
t1.create_user = #{adviserId}
<if test="name != null">
AND (
t2.BOOK_NAME LIKE CONCAT('%', #{name}, '%')
OR t.group_name LIKE CONCAT('%', #{name}, '%')
OR t2.ISBN LIKE CONCAT('%', #{name}, '%')
)
</if>
</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