Commit 251f9f93 by lili

合并代码 扫码推送消息

parent 8eafa423
package com.pcloud.book.book.dto;
import java.io.Serializable;
/**
* @author lily
* @date 2018/10/13 17:29
*/
public class BookCoverImgUpdateDTO implements Serializable {
private String coverImg;
private Long bookId;
public String getCoverImg() {
return coverImg;
}
public void setCoverImg(String coverImg) {
this.coverImg = coverImg;
}
public Long getBookId() {
return bookId;
}
public void setBookId(Long bookId) {
this.bookId = bookId;
}
@Override
public String toString() {
return "BookCoverImgUpdateDTO{" +
"coverImg='" + coverImg + '\'' +
", bookId=" + bookId +
'}';
}
}
...@@ -379,6 +379,11 @@ public class BookDto extends BaseDto { ...@@ -379,6 +379,11 @@ public class BookDto extends BaseDto {
* 配置服务个数 * 配置服务个数
*/ */
private Integer messageCount; private Integer messageCount;
/**
* 类型名称
*/
private List<String> typeCodeNames;
/** /**
* 印码位置 * 印码位置
*/ */
...@@ -993,6 +998,14 @@ public class BookDto extends BaseDto { ...@@ -993,6 +998,14 @@ public class BookDto extends BaseDto {
this.templeParentId = templeParentId; this.templeParentId = templeParentId;
} }
public List<String> getTypeCodeNames() {
return typeCodeNames;
}
public void setTypeCodeNames(List<String> typeCodeNames) {
this.typeCodeNames = typeCodeNames;
}
@Override @Override
public String toString() { public String toString() {
return "BookDto [bookId=" + bookId + ", typeCode=" + typeCode + ", typeName=" + typeName + ", isbn=" + isbn return "BookDto [bookId=" + bookId + ", typeCode=" + typeCode + ", typeName=" + typeName + ", isbn=" + isbn
......
/**
*
*/
package com.pcloud.book.book.facade;
import com.pcloud.book.book.dto.BookAssocCount;
import com.pcloud.book.book.dto.BookDto;
import com.pcloud.book.book.entity.Book;
import com.pcloud.common.dto.ResponseDto;
import com.pcloud.common.exceptions.BizException;
import com.pcloud.common.page.PageBean;
import com.pcloud.common.permission.PermissionException;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.codehaus.jackson.JsonParseException;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* @描述:书籍接口
* @作者:songx
* @创建时间:2016年12月23日,下午2:37:02 @版本:1.0
*/
@FeignClient(value = "pcloud-service-book", qualifier = "bookFacadeCloud", path = "book/v1.0/book")
@Api(description = "书籍接口外部服务")
public interface BookFacade {
/**
* 新增书籍(平台)
*
* @param token
* @param book
* @return
* @throws BizException
* @throws PermissionException
* @throws JsonParseException
*/
@ApiOperation(value = "新增书籍(平台)", httpMethod = "POST")
@ApiImplicitParams({@ApiImplicitParam(name = "token", value = "token", dataType = "String", paramType = "header"),
@ApiImplicitParam(name = "book", value = "书籍实体", dataType = "Book", paramType = "body")})
@RequestMapping(value = "create", method = RequestMethod.POST)
public ResponseDto<BookDto> create(@RequestHeader("token") String token, @RequestBody Book book)
throws BizException, PermissionException, JsonParseException;
/**
* 修改书籍信息(平台)
*
* @param token
* @param book
* @return
* @throws BizException
* @throws PermissionException
* @throws JsonParseException
*/
@ApiOperation(value = "修改书籍信息(平台)", httpMethod = "POST")
@ApiImplicitParams({@ApiImplicitParam(name = "token", value = "token", dataType = "String", paramType = "header"),
@ApiImplicitParam(name = "book", value = "书籍实体", dataType = "Book", paramType = "body")})
@RequestMapping(value = "update", method = RequestMethod.POST)
public ResponseDto<?> update(@RequestHeader("token") String token, @RequestBody Book book)
throws BizException, PermissionException, JsonParseException;
/**
* 修改书籍封面图
*
* @param token
* @param book
* 图书修改信息
* @return
* @throws BizException
* @throws PermissionException
* @throws JsonParseException
*/
@ApiOperation(value = "修改书籍封面图", httpMethod = "POST")
@ApiImplicitParams({ @ApiImplicitParam(name = "token", value = "token", dataType = "String", paramType = "header"),
@ApiImplicitParam(name = "book", value = "书籍实体", dataType = "Book", paramType = "body") })
@RequestMapping(value = "updateCoverImg", method = RequestMethod.POST)
ResponseDto<?> updateCoverImg(@RequestHeader("token") String token, @RequestBody Book book)
throws BizException, PermissionException, JsonParseException;
/**
* 修改书籍信息(编辑)
*
* @param token
* @param book
* @return
* @throws BizException
* @throws PermissionException
* @throws JsonParseException
*/
@ApiOperation(value = "修改书籍信息(编辑)", httpMethod = "POST")
@ApiImplicitParams({ @ApiImplicitParam(name = "token", value = "token", dataType = "String", paramType = "header"),
@ApiImplicitParam(name = "book", value = "书籍实体", dataType = "Book", paramType = "body") })
@RequestMapping(value = "updateByAdviser", method = RequestMethod.POST)
public ResponseDto<?> updateByAdviser(@RequestHeader("token") String token, @RequestBody Book book)
throws BizException, PermissionException, JsonParseException;
/**
* 删除书籍信息(平台)
*
* @param token
* @param bookId
* @return
* @throws BizException
* @throws PermissionException
* @throws JsonParseException
*/
@ApiOperation(value = "删除书籍信息(平台)", httpMethod = "GET")
@ApiImplicitParams({ @ApiImplicitParam(name = "token", value = "token", dataType = "String", paramType = "header"),
@ApiImplicitParam(name = "bookId", value = "图书标识", dataType = "long", paramType = "query") })
@RequestMapping(value = "delete", method = RequestMethod.GET)
public ResponseDto<?> delete(@RequestHeader("token") String token,
@RequestParam(value = "bookId", required = false) Long bookId)
throws BizException, PermissionException, JsonParseException;
/**
* 批量删除书籍(平台)
*
* @param token
* @param bookIds
* @return
* @throws BizException
* @throws PermissionException
* @throws JsonParseException
*/
@ApiOperation(value = "批量删除书籍信息(平台)", httpMethod = "GET")
@ApiImplicitParams({ @ApiImplicitParam(name = "token", value = "token", dataType = "String", paramType = "header"),
@ApiImplicitParam(name = "bookIds", value = "图书标识", dataType = "string", paramType = "query") })
@RequestMapping(value = "deletes", method = RequestMethod.GET)
public ResponseDto<?> deletes(@RequestHeader("token") String token,
@RequestParam(value = "bookIds", required = false) String bookIds)
throws BizException, PermissionException, JsonParseException;
/**
* 获取书籍基础信息(包含统计信息)(编辑端)
*
* @param token
* @param bookId
* @return
* @throws BizException
* @throws PermissionException
* @throws JsonParseException
*/
@ApiOperation(value = "获取书籍基础信息(包含统计信息)(编辑端)", httpMethod = "GET")
@ApiImplicitParams({ @ApiImplicitParam(name = "token", value = "token", dataType = "string", paramType = "header"),
@ApiImplicitParam(name = "bookId", value = "图书标识", dataType = "long", paramType = "query"),
@ApiImplicitParam(name = "channelId", value = "渠道标识", dataType = "long", paramType = "query") })
@RequestMapping(value = "getById", method = RequestMethod.GET)
public ResponseDto<BookDto> getById(@RequestHeader("token") String token,
@RequestParam(value = "bookId", required = false) Long bookId,
@RequestParam(value = "channelId", required = false) Long channelId)
throws BizException, PermissionException, JsonParseException;
/**
* 获取书籍基础信息
*
* @param bookId
* @return
* @throws BizException
* @throws PermissionException
* @throws JsonParseException
*/
@ApiOperation(value = "获取书籍基础信息", httpMethod = "GET")
@ApiImplicitParams({ @ApiImplicitParam(name = "bookId", value = "图书标识", dataType = "long", paramType = "query") })
@RequestMapping(value = "getBaseById", method = RequestMethod.GET)
public ResponseDto<BookDto> getBaseById(@RequestParam(value = "bookId", required = false) Long bookId)
throws BizException, PermissionException, JsonParseException;
/**
* 判断书籍ISBN码是否存在(平台)
*
* @param token
* @param isbn
* @return
* @throws BizException
* @throws PermissionException
* @throws JsonParseException
*/
@ApiOperation(value = "判断书籍ISBN码是否存在(平台)", httpMethod = "GET")
@ApiImplicitParams({ @ApiImplicitParam(name = "token", value = "token", dataType = "string", paramType = "header"),
@ApiImplicitParam(name = "typeCode", value = "书类型编码", dataType = "string", paramType = "query"),
@ApiImplicitParam(name = "isbn", value = "书籍号", dataType = "string", paramType = "query"),
@ApiImplicitParam(name = "serialNumber", value = "刊物序号", dataType = "string", paramType = "query") })
@RequestMapping(value = "isbnExists", method = RequestMethod.GET)
public ResponseDto<Boolean> isbnExists(@RequestHeader("token") String token,
@RequestParam(value = "typeCode", required = false) String typeCode,
@RequestParam(value = "isbn", required = false) String isbn,
@RequestParam(value = "serialNumber", required = false) String serialNumber)
throws BizException, PermissionException, JsonParseException;
/**
* 获取书籍列表(平台)
*
* @param token
* @param bookName
* @return
* @throws BizException
* @throws PermissionException
* @throws JsonParseException
*/
@ApiOperation(value = "判断书籍ISBN码是否存在(平台)", httpMethod = "GET")
@ApiImplicitParams({ @ApiImplicitParam(name = "token", value = "token", dataType = "string", paramType = "header"),
@ApiImplicitParam(name = "publish", value = "出版社", dataType = "string", paramType = "query"),
@ApiImplicitParam(name = "fundName", value = "基金支持", dataType = "string", paramType = "query"),
@ApiImplicitParam(name = "bookName", value = "书籍名称", dataType = "string", paramType = "query"),
@ApiImplicitParam(name = "isbn", value = "书籍号", dataType = "string", paramType = "query"),
@ApiImplicitParam(name = "serialNumber", value = "刊物序号", dataType = "string", paramType = "query"),
@ApiImplicitParam(name = "isCurrentMonth", value = "当月基金支持书刊", dataType = "int", paramType = "query"),
@ApiImplicitParam(name = "currentPage", value = "当前页", dataType = "int", paramType = "query"),
@ApiImplicitParam(name = "numPerPage", value = "每页条数", dataType = "int", paramType = "query") })
@RequestMapping(value = "listPage", method = RequestMethod.GET)
public ResponseDto<?> getListPage(@RequestHeader("token") String token,
@RequestParam(value = "publish", required = false) String publish,
@RequestParam(value = "fundName", required = false) String fundName,
@RequestParam(value = "bookName", required = false) String bookName,
@RequestParam(value = "isbn", required = false) String isbn,
@RequestParam(value = "serialNumber", required = false) String serialNumber,
@RequestParam(value = "isCurrentMonth", required = false) Integer isCurrentMonth,
@RequestParam(value = "currentPage", required = false) Integer currentPage,
@RequestParam(value = "numPerPage", required = false) Integer numPerPage)
throws BizException, PermissionException, JsonParseException;
/**
* 获取书籍列表(编辑)
*
* @param token
* @param bookName
* @param isbn
* @param channelId
* @param currentPage
* @param numPerPage
* @param bookId
* @return
* @throws BizException
* @throws PermissionException
* @throws JsonParseException
*/
@ApiOperation(value = "判断书籍ISBN码是否存在(平台)", httpMethod = "GET")
@ApiImplicitParams({ @ApiImplicitParam(name = "token", value = "token", dataType = "string", paramType = "header"),
@ApiImplicitParam(name = "bookName", value = "书籍名称", dataType = "string", paramType = "query"),
@ApiImplicitParam(name = "isbn", value = "isbn", dataType = "string", paramType = "query"),
@ApiImplicitParam(name = "channelId", value = "渠道标识", dataType = "long", paramType = "query"),
@ApiImplicitParam(name = "typeCode", value = "书刊类型", dataType = "string", paramType = "query"),
@ApiImplicitParam(name = "currentPage", value = "当前页", dataType = "int", paramType = "query"),
@ApiImplicitParam(name = "numPerPage", value = "每页条数", dataType = "int", paramType = "query"),
@ApiImplicitParam(name = "isMainEditor", value = "只看我是主编辑", dataType = "int", paramType = "query"),
@ApiImplicitParam(name = "isFundSupport", value = "只看基金支持", dataType = "int", paramType = "query"),
@ApiImplicitParam(name = "bookId", value = "书籍标识", dataType = "int", paramType = "query"),
@ApiImplicitParam(name = "templetId", value = "图书类型标识", dataType = "long", paramType = "query")})
@RequestMapping(value = "listPage4Adviser", method = RequestMethod.GET)
public ResponseDto<PageBean> getListPage4Adviser(@RequestHeader("token") String token,
@RequestParam(value = "name", required = false) String name,
@RequestParam(value = "bookName", required = false) String bookName,
@RequestParam(value = "isbn", required = false) String isbn,
@RequestParam(value = "channelId", required = false) Long channelId,
@RequestParam(value = "typeCode", required = false) String typeCode,
@RequestParam(value = "currentPage", required = false) Integer currentPage,
@RequestParam(value = "numPerPage", required = false) Integer numPerPage,
@RequestParam(value = "isMainEditor", required = false) Integer isMainEditor,
@RequestParam(value = "isFundSupport", required = false) Integer isFundSupport,
@RequestParam(value = "bookId", required = false) Integer bookId,
@RequestParam(value = "templetId", required = false) Long templetId)
throws BizException, PermissionException, JsonParseException;
@ApiOperation(value = "首页获取正在做的图书",httpMethod = "GET")
@ApiImplicitParams({@ApiImplicitParam(name = "token", value = "token", dataType = "string", paramType = "header"),
@ApiImplicitParam(name = "num",value = "个数",dataType = "Integer",paramType = "query")})
@GetMapping("getList4Adviser")
ResponseDto<List<BookDto>> getList4Adviser(@RequestHeader("token") String token,@RequestParam(value = "num",required = true) Integer num)throws BizException, PermissionException, JsonParseException;
/**
* 获取书籍的详细信息(微信客户端)
*
* @param userInfo
* @param bookId
* @param adviserId
* @return
* @throws BizException
* @throws PermissionException
* @throws JsonParseException
*/
@ApiOperation(value = "获取书籍的详细信息(微信客户端)", httpMethod = "GET")
@ApiImplicitParams({
@ApiImplicitParam(name = "userInfo", value = "Cookie", dataType = "string", paramType = "header"),
@ApiImplicitParam(name = "bookId", value = "书籍标识", dataType = "long", paramType = "query"),
@ApiImplicitParam(name = "adviserId", value = "编辑标识", dataType = "long", paramType = "query") })
@RequestMapping(value = "getDetailById", method = RequestMethod.GET)
public ResponseDto<BookDto> getDetailById(@CookieValue("userInfo") String userInfo,
@RequestParam(value = "bookId", required = false) Long bookId,
@RequestParam(value = "adviserId", required = false) Long adviserId)
throws BizException, PermissionException, JsonParseException;
/**
* 图书收益,获取书籍基础信息(包含统计信息)(编辑)
*
* @param token
* @param bookId
* @return
* @throws BizException
* @throws PermissionException
* @throws JsonParseException
*/
@ApiOperation(value = "图书收益,获取书籍基础信息(包含统计信息)(编辑)", httpMethod = "GET")
@ApiImplicitParams({ @ApiImplicitParam(name = "token", value = "token", dataType = "string", paramType = "header"),
@ApiImplicitParam(name = "bookId", value = "书籍标识", dataType = "long", paramType = "query"),
@ApiImplicitParam(name = "channelId", value = "渠道标识", dataType = "long", paramType = "query") })
@RequestMapping(value = "getById4Profit", method = RequestMethod.GET)
public ResponseDto<BookDto> getById4Profit(@RequestHeader("token") String token,
@RequestParam(value = "bookId", required = false) Long bookId,
@RequestParam(value = "channelId", required = false) Long channelId)
throws BizException, PermissionException, JsonParseException;
/**
* 判断书籍ISBN码是否存在,存在则获取书籍信息(编辑)
*
* @param token
* @param book
* @return
* @throws BizException
* @throws PermissionException
* @throws JsonParseException
*/
@ApiOperation(value = "判断书籍ISBN码是否存在,存在则获取书籍信息(编辑)", httpMethod = "POST")
@ApiImplicitParams({ @ApiImplicitParam(name = "token", value = "token", dataType = "string", paramType = "header"),
@ApiImplicitParam(name = "book", value = "书籍实体", dataType = "Book", paramType = "body") })
@RequestMapping(value = "isbnExistsOrGetInfo", method = RequestMethod.POST)
ResponseDto<BookDto> isbnExistsOrGetInfo(@RequestHeader("token") String token, @RequestBody Book book)
throws BizException, PermissionException, JsonParseException;
/**
* 创建编辑书籍关联关系(编辑端)
*
* @param token
* @param book
* @return
* @throws BizException
* @throws PermissionException
* @throws JsonParseException
*/
@ApiOperation(value = "创建编辑书籍关联关系(编辑端)", httpMethod = "POST")
@ApiImplicitParams({ @ApiImplicitParam(name = "token", value = "token", dataType = "string", paramType = "header"),
@ApiImplicitParam(name = "book", value = "书籍实体", dataType = "Book", paramType = "body") })
@RequestMapping(value = "setBookAdviserRelation", method = RequestMethod.POST)
public ResponseDto<?> setBookAdviserRelation(@RequestHeader("token") String token, @RequestBody Book book)
throws BizException, PermissionException, JsonParseException;
/**
* 获取书籍的基本信息(微信客户端)
*
* @param userInfo
* @param bookId
* @return
* @throws BizException
* @throws PermissionException
* @throws JsonParseException
*/
@ApiOperation(value = "获取书籍的基本信息(微信客户端)", httpMethod = "GET")
@ApiImplicitParams({ @ApiImplicitParam(name = "token", value = "token", dataType = "string", paramType = "header"),
@ApiImplicitParam(name = "bookId", value = "书籍标识", dataType = "long", paramType = "query") })
@RequestMapping(value = "getBaseInfoById4Wechat", method = RequestMethod.GET)
public ResponseDto<BookDto> getBaseInfoById4Wechat(@CookieValue("userInfo") String userInfo,
@RequestParam(value = "bookId", required = false) Long bookId)
throws BizException, PermissionException, JsonParseException;
/**
* 获取书籍列表(微信编辑端)
*
* @param userInfo
* @param currentPage
* @param numPerPage
* @return
* @throws BizException
* @throws PermissionException
* @throws JsonParseException
*/
@ApiOperation(value = "获取书籍列表(微信编辑端)", httpMethod = "GET")
@ApiImplicitParams({
@ApiImplicitParam(name = "userInfo", value = "Cookie", dataType = "string", paramType = "header"),
@ApiImplicitParam(name = "currentPage", value = "当前页", dataType = "int", paramType = "query"),
@ApiImplicitParam(name = "numPerPage", value = "每页条数", dataType = "int", paramType = "query"),
@ApiImplicitParam(name = "bookName", value = "书籍名称", dataType = "string", paramType = "query"),
@ApiImplicitParam(name = "channelId", value = "渠道标识", dataType = "long", paramType = "query") })
@RequestMapping(value = "getListPage4Wechat", method = RequestMethod.GET)
public ResponseDto<PageBean> getListPage4Wechat(@CookieValue("userInfo") String userInfo,
@RequestParam(value = "currentPage", required = false) Integer currentPage,
@RequestParam(value = "numPerPage", required = false) Integer numPerPage,
@RequestParam(value = "bookName", required = false) String bookName,
@RequestParam(value = "channelId", required = false) Long channelId)
throws BizException, PermissionException, JsonParseException;
/**
* 获取书籍列表(XCX)
*
* @param token
* @param currentPage
* @param numPerPage
* @return
* @throws BizException
* @throws PermissionException
* @throws JsonParseException
*/
@ApiOperation(value = "获取书籍列表(XCX)", httpMethod = "GET")
@ApiImplicitParams({ @ApiImplicitParam(name = "token", value = "token", dataType = "string", paramType = "header"),
@ApiImplicitParam(name = "currentPage", value = "当前页", dataType = "int", paramType = "query"),
@ApiImplicitParam(name = "numPerPage", value = "每页条数", dataType = "int", paramType = "query"),
@ApiImplicitParam(name = "bookName", value = "书籍名称", dataType = "string", paramType = "query"),
@ApiImplicitParam(name = "channelId", value = "渠道标识", dataType = "long", paramType = "query") })
@RequestMapping(value = "getlistPage", method = RequestMethod.GET)
public ResponseDto<PageBean> listPage(@RequestHeader("token") String token,
@RequestParam(value = "currentPage", required = false) Integer currentPage,
@RequestParam(value = "numPerPage", required = false) Integer numPerPage,
@RequestParam(value = "bookName", required = false) String bookName,
@RequestParam(value = "channelId", required = false) Long channelId)
throws BizException, PermissionException, JsonParseException;
/**
* 判断书籍ISBN码是否存在,存在则获取书籍信息(微信管理端-编辑)
*
* @param userInfo
* @param book
* @return
* @throws BizException
* @throws PermissionException
* @throws JsonParseException
*/
@ApiOperation(value = "判断书籍ISBN码是否存在,存在则获取书籍信息(微信管理端-编辑)", httpMethod = "POST")
@ApiImplicitParams({
@ApiImplicitParam(name = "userInfo", value = "Cookie", dataType = "String", paramType = "header"),
@ApiImplicitParam(name = "book", value = "书籍实体", dataType = "Book", paramType = "body") })
@RequestMapping(value = "isbnExistsOrGetInfo4Wechat", method = RequestMethod.POST)
ResponseDto<BookDto> isbnExistsOrGetInfo4Wechat(@CookieValue("userInfo") String userInfo, @RequestBody Book book)
throws BizException, PermissionException, JsonParseException;
/**
* 创建编辑书籍关联关系(微信管理端-编辑)
*
* @param userInfo
* @param book
* @return
* @throws BizException
* @throws PermissionException
* @throws JsonParseException
*/
@ApiOperation(value = "创建编辑书籍关联关系(微信管理端-编辑)", httpMethod = "POST")
@ApiImplicitParams({
@ApiImplicitParam(name = "userInfo", value = "Cookie", dataType = "String", paramType = "header"),
@ApiImplicitParam(name = "book", value = "书籍实体", dataType = "Book", paramType = "body") })
@RequestMapping(value = "setBookAdviserRelation4Wechat", method = RequestMethod.POST)
ResponseDto<?> setBookAdviserRelation4Wechat(@CookieValue("userInfo") String userInfo, @RequestBody Book book)
throws BizException, PermissionException, JsonParseException;
/**
* 微信端创建书籍(微信管理端-编辑)
*
* @param userInfo
* @param book
* @return
* @throws BizException
* @throws PermissionException
* @throws JsonParseException
*/
@ApiOperation(value = "微信端创建书籍(微信管理端-编辑)", httpMethod = "POST")
@ApiImplicitParams({
@ApiImplicitParam(name = "userInfo", value = "Cookie", dataType = "String", paramType = "header"),
@ApiImplicitParam(name = "book", value = "书籍实体", dataType = "Book", paramType = "body") })
@RequestMapping(value = "create4Wechat", method = RequestMethod.POST)
ResponseDto<BookDto> create4Wechat(@CookieValue("userInfo") String userInfo, @RequestBody Book book)
throws BizException, PermissionException, JsonParseException;
/**
* 微信端修改书籍(微信管理端-编辑)
*
* @param userInfo
* @param book
* @return
* @throws BizException
* @throws PermissionException
* @throws JsonParseException
*/
@ApiOperation(value = "微信端修改书籍(微信管理端-编辑)", httpMethod = "POST")
@ApiImplicitParams({
@ApiImplicitParam(name = "userInfo", value = "Cookie", dataType = "String", paramType = "header"),
@ApiImplicitParam(name = "book", value = "书籍实体", dataType = "Book", paramType = "body") })
@RequestMapping(value = "update4Wechat", method = RequestMethod.POST)
ResponseDto<BookDto> update4Wechat(@CookieValue("userInfo") String userInfo, @RequestBody Book book)
throws BizException, PermissionException, JsonParseException;
/**
* @param userInfo
* @param isbn
* @throws BizException
* @throws PermissionException
* @throws JsonParseException
* @Title: getTypeByIsbn
* @Description:根据ISBN获取期刊分页列表
* @return: ResponseDto<BookDto>
* @author: lihao
* @date: 2017年5月9日 下午5:53:19
*/
@ApiOperation(value = "根据ISBN获取期刊分页列表", httpMethod = "GET")
@ApiImplicitParams({
@ApiImplicitParam(name = "userInfo", value = "Cookie", dataType = "String", paramType = "header"),
@ApiImplicitParam(name = "typeCode", value = "书类型编码", dataType = "string", paramType = "query"),
@ApiImplicitParam(name = "isbn", value = "isbn", dataType = "string", paramType = "query"),
@ApiImplicitParam(name = "currentPage", value = "当前页", dataType = "int", paramType = "query"),
@ApiImplicitParam(name = "numPerPage", value = "每页条数", dataType = "int", paramType = "query") })
@RequestMapping(value = "getJournalPageByIsbn", method = RequestMethod.GET)
ResponseDto<?> getJournalPageByIsbn(@CookieValue("userInfo") String userInfo,
@RequestParam(value = "typeCode", required = false) String typeCode,
@RequestParam(value = "isbn", required = false) String isbn,
@RequestParam(value = "currentPage", required = false) Integer currentPage,
@RequestParam(value = "numPerPage", required = false) Integer numPerPage)
throws BizException, PermissionException, JsonParseException;
/**
* 获取书籍列表(微信客户端)
*
* @param userInfo
* @param currentPage
* @param numPerPage
* @return
* @throws BizException
* @throws PermissionException
* @throws JsonParseException
*/
@ApiOperation(value = "获取书籍列表(微信客户端)", httpMethod = "GET")
@ApiImplicitParams({
@ApiImplicitParam(name = "userInfo", value = "Cookie", dataType = "String", paramType = "header"),
@ApiImplicitParam(name = "currentPage", value = "当前页", dataType = "int", paramType = "query"),
@ApiImplicitParam(name = "numPerPage", value = "每页条数", dataType = "int", paramType = "query") })
@RequestMapping(value = "listPage4Wechat", method = RequestMethod.GET)
public ResponseDto<PageBean> listPage4Wechat(@CookieValue("userInfo") String userInfo,
@RequestParam(value = "currentPage", required = false) Integer currentPage,
@RequestParam(value = "numPerPage", required = false) Integer numPerPage)
throws BizException, PermissionException, JsonParseException;
/**
* 获取书籍列表(编辑)
*
* @param token
* @return
* @throws BizException
* @throws PermissionException
* @throws JsonParseException
*/
@ApiOperation(value = "获取书籍列表(编辑)", httpMethod = "GET")
@ApiImplicitParams({ @ApiImplicitParam(name = "token", value = "token", dataType = "string", paramType = "header"),
@ApiImplicitParam(name = "number", value = "书籍数目", dataType = "int", paramType = "query") })
@RequestMapping(value = "listBook", method = RequestMethod.GET)
public ResponseDto<List<Object>> listBook(@RequestHeader("token") String token,
@RequestParam(value = "number", required = false) Integer number)
throws BizException, PermissionException, JsonParseException;
/**
* 获取书籍列表(APP-编辑)
*
* @param token
* @return
* @throws BizException
* @throws PermissionException
* @throws JsonParseException
*/
@ApiOperation(value = "获取书籍列表(APP-编辑)", httpMethod = "GET")
@ApiImplicitParams({ @ApiImplicitParam(name = "token", value = "token", dataType = "string", paramType = "header"),
@ApiImplicitParam(name = "currentPage", value = "当前页数", dataType = "int", paramType = "query"),
@ApiImplicitParam(name = "numPerPage", value = "每页条数", dataType = "int", paramType = "query"),
@ApiImplicitParam(name = "bookName", value = "书籍名称", dataType = "string", paramType = "query") })
@RequestMapping(value = "listBook4App", method = RequestMethod.GET)
public ResponseDto<PageBean> listBook4App(@RequestHeader("token") String token,
@RequestParam(value = "currentPage", required = false) Integer currentPage,
@RequestParam(value = "numPerPage", required = false) Integer numPerPage,
@RequestParam(value = "bookName", required = false) String bookName)
throws BizException, PermissionException, JsonParseException;
/**
* 书刊列表-出版端
*
* @param token
* @param bookName
* @param channelId
* @param typeCode
* @param currentPage
* @param numPerPage
* @param mainEditorName
* @param isFundSupport
* @return
* @throws BizException
* @throws PermissionException
* @throws JsonParseException
*/
@ApiOperation(value = "书刊列表-出版端", httpMethod = "GET")
@ApiImplicitParams({ @ApiImplicitParam(name = "token", value = "token", dataType = "string", paramType = "header"),
@ApiImplicitParam(name = "bookName", value = "书刊名称", dataType = "string", paramType = "query"),
@ApiImplicitParam(name = "channelId", value = "渠道标识", dataType = "long", paramType = "query"),
@ApiImplicitParam(name = "typeCode", value = "书刊类型", dataType = "string", paramType = "query"),
@ApiImplicitParam(name = "currentPage", value = "当前页数", dataType = "int", paramType = "query"),
@ApiImplicitParam(name = "numPerPage", value = "每页条数", dataType = "int", paramType = "query"),
@ApiImplicitParam(name = "mainEditorName", value = "主编辑名称", dataType = "string", paramType = "query"),
@ApiImplicitParam(name = "isFundSupport", value = "基金支持", dataType = "int", paramType = "query"),
@ApiImplicitParam(name = "isbn", value = "isbn", dataType = "string", paramType = "query"),
@ApiImplicitParam(name = "templetId", value = "图书类型标识", dataType = "long", paramType = "query")})
@RequestMapping(value = "listPage4Agent", method = RequestMethod.GET)
ResponseDto<PageBean> listPage4Agent(@RequestHeader("token") String token,
@RequestParam(value = "bookName", required = false) String bookName,
@RequestParam(value = "channelId", required = false) Long channelId,
@RequestParam(value = "typeCode", required = false) String typeCode,
@RequestParam(value = "currentPage", required = false) Integer currentPage,
@RequestParam(value = "numPerPage", required = false) Integer numPerPage,
@RequestParam(value = "mainEditorName", required = false) String mainEditorName,
@RequestParam(value = "isFundSupport", required = false) Integer isFundSupport,
@RequestParam(value = "isbn", required = false) String isbn,
@RequestParam(value = "templetId", required = false) Long templetId)
throws BizException, PermissionException, JsonParseException;
/**
* 更新图书模板
*
* @param token
* @return
* @throws BizException
* @throws PermissionException
* @throws JsonParseException
*/
@ApiOperation(value = "更新图书模板", httpMethod = "POST")
@ApiImplicitParams({ @ApiImplicitParam(name = "token", value = "token", dataType = "string", paramType = "header"),
@ApiImplicitParam(name = "book", value = "书籍实体", dataType = "Book", paramType = "body") })
@RequestMapping(value = "updateBookTemplet", method = RequestMethod.POST)
public ResponseDto<?> updateBookTemplet(@RequestHeader("token") String token, @RequestBody Book book)
throws BizException, PermissionException, JsonParseException;
/**
* 获取应用关联的图书
*
* @param token
* @return
* @throws BizException
* @throws PermissionException
* @throws JsonParseException
*/
@ApiOperation(value = "获取应用关联的图书", httpMethod = "GET")
@ApiImplicitParams({ @ApiImplicitParam(name = "token", value = "token", dataType = "string", paramType = "header"),
@ApiImplicitParam(name = "appId", value = "应用标识", dataType = "long", paramType = "query"),
@ApiImplicitParam(name = "channelId", value = "渠道标识", dataType = "long", paramType = "query") })
@RequestMapping(value = "listBookByAppId", method = RequestMethod.GET)
public ResponseDto<List<BookDto>> listBookByAppId(@RequestHeader("token") String token,
@RequestParam(value = "appId", required = false) Long appId,
@RequestParam(value = "channelId", required = false) Long channelId)
throws BizException, PermissionException, JsonParseException;
/**
* 获取书籍基础信息(包含统计信息)(出版端)
*
* @param token
* @param bookId
* @return
* @throws BizException
* @throws PermissionException
* @throws JsonParseException
*/
@ApiOperation(value = "获取书籍基础信息(包含统计信息)(编辑端)", httpMethod = "GET")
@ApiImplicitParams({ @ApiImplicitParam(name = "token", value = "token", dataType = "string", paramType = "header"),
@ApiImplicitParam(name = "bookId", value = "图书标识", dataType = "long", paramType = "query"),
@ApiImplicitParam(name = "channelId", value = "渠道标识", dataType = "long", paramType = "query"),
@ApiImplicitParam(name = "adviserId", value = "编辑标识", dataType = "long", paramType = "query") })
@RequestMapping(value = "getById4Agent", method = RequestMethod.GET)
public ResponseDto<BookDto> getById4Agent(@RequestHeader("token") String token,
@RequestParam(value = "bookId", required = false) Long bookId,
@RequestParam(value = "channelId", required = false) Long channelId,
@RequestParam(value = "adviserId", required = false) Long adviserId)
throws BizException, PermissionException, JsonParseException;
/**
* 书刊回收站列表(30天内删除的书刊列表)
*
* @param token
* @param currentPage
* @param numPerPage
* @return
* @throws BizException
* @throws PermissionException
* @throws JsonParseException
*/
@ApiOperation(value = "书刊回收站列表", httpMethod = "GET")
@ApiImplicitParams({ @ApiImplicitParam(name = "token", value = "token", dataType = "string", paramType = "header"),
@ApiImplicitParam(name = "currentPage", value = "当前页数", dataType = "int", paramType = "query"),
@ApiImplicitParam(name = "numPerPage", value = "每页条数", dataType = "int", paramType = "query") })
@RequestMapping(value = "listPageDelete4Adviser", method = RequestMethod.GET)
ResponseDto<PageBean> listPageDelete4Adviser(@RequestHeader("token") String token,
@RequestParam(value = "currentPage", required = false) Integer currentPage,
@RequestParam(value = "numPerPage", required = false) Integer numPerPage)
throws BizException, PermissionException, JsonParseException;
/**
* 获取图书关联超级作者商品个数
*
* @param token
* @param bookId
* @param channelId
* @return
* @throws BizException
* @throws PermissionException
* @throws JsonParseException
*/
@ApiOperation(value = "获取图书统计个数", httpMethod = "GET")
@ApiImplicitParams({ @ApiImplicitParam(name = "token", value = "token", dataType = "string", paramType = "header"),
@ApiImplicitParam(name = "bookId", value = "图书标识", dataType = "long", paramType = "query"),
@ApiImplicitParam(name = "channelId", value = "渠道标识", dataType = "long", paramType = "query") })
@RequestMapping(value = "getCount4BookAssoc", method = RequestMethod.GET)
ResponseDto<BookAssocCount> getCount4BookAssoc(@RequestHeader("token") String token,
@RequestParam(value = "bookId", required = false) Long bookId,
@RequestParam(value = "channelId", required = false) Long channelId)
throws BizException, PermissionException, JsonParseException;
/**
* 导出所有书刊成excel表 - 出版端
*
* @param token
* @return
* @throws PermissionException
* @throws JsonParseException
* @throws BizException
*/
@ApiOperation(value = "导出出版下所有书刊excel表(出版端)", httpMethod = "GET")
@ApiImplicitParams({
@ApiImplicitParam(name = "token", value = "token", dataType = "string", paramType = "header") })
@RequestMapping(value = "exportBookToExcel", method = RequestMethod.GET)
ResponseDto<?> exportBookToExcel(@RequestHeader("token") String token)
throws PermissionException, JsonParseException, BizException;
/**
* 图书列表(平台端)
*
* @param token
* @param typeCode
* @param templetId
* @param startDate
* @param endDate
* @param bookName
* @param currentPage
* @param numPerPage
* @return
* @throws BizException
* @throws PermissionException
* @throws JsonParseException
*/
@ApiOperation(value = "图书列表(平台端)", httpMethod = "GET")
@ApiImplicitParams({ @ApiImplicitParam(name = "token", value = "token", dataType = "string", paramType = "header"),
@ApiImplicitParam(name = "typeCode", value = "书刊类型", dataType = "string", paramType = "query"),
@ApiImplicitParam(name = "templetId", value = "书刊分类标识", dataType = "long", paramType = "query"),
@ApiImplicitParam(name = "startDate", value = "开始日期", dataType = "string", paramType = "query"),
@ApiImplicitParam(name = "endDate", value = "结束日期", dataType = "string", paramType = "query"),
@ApiImplicitParam(name = "bookName", value = "书刊名称", dataType = "string", paramType = "query"),
@ApiImplicitParam(name = "currentPage", value = "当前页数", dataType = "int", paramType = "query"),
@ApiImplicitParam(name = "numPerPage", value = "每页条数", dataType = "int", paramType = "query") })
@RequestMapping(value = "listBookClassify", method = RequestMethod.GET)
ResponseDto<PageBean> listBookClassify(@RequestHeader("token") String token,
@RequestParam(value = "typeCode", required = false) String typeCode,
@RequestParam(value = "templetId", required = false) Long templetId,
@RequestParam(value = "startDate", required = false) String startDate,
@RequestParam(value = "endDate", required = false) String endDate,
@RequestParam(value = "bookName", required = false) String bookName,
@RequestParam(value = "currentPage", required = true) Integer currentPage,
@RequestParam(value = "numPerPage", required = true) Integer numPerPage)
throws BizException, PermissionException, JsonParseException;
@ApiOperation(value = "导出平台下所有书刊excel表(平台端)", httpMethod = "GET")
@ApiImplicitParams({
@ApiImplicitParam(name = "token", value = "token", dataType = "string", paramType = "header") })
@RequestMapping(value = "exportBookToExcel4Platform", method = RequestMethod.GET)
ResponseDto<?> exportBookToExcel4Platform(@RequestHeader("token") String token)
throws PermissionException, JsonParseException, BizException;
/**
* 通过isbn获取图书信息(编辑端new)
*
* @param token
* @param isbn isbn
* @return
* @throws BizException
* @throws PermissionException
* @throws JsonParseException
*/
@ApiOperation(value = "通过isbn获取图书信息(编辑端new)", httpMethod = "GET")
@ApiImplicitParams({ @ApiImplicitParam(name = "token", value = "token", dataType = "string", paramType = "header"),
@ApiImplicitParam(name = "isbn", value = "书籍号", dataType = "string", paramType = "query"),
@ApiImplicitParam(name = "typeCode", value = "图书类型", dataType = "string", paramType = "query")})
@RequestMapping(value = "getByIsbnAndTypeCode", method = RequestMethod.GET)
public ResponseDto<BookDto> getByIsbnAndTypeCode(@RequestHeader("token") String token,
@RequestParam(value = "isbn") String isbn,
@RequestParam(value = "typeCode") String typeCode)
throws BizException, PermissionException, JsonParseException ;
/**
* 新增书籍(编辑)
*
* @param token
* @param book
* @return
* @throws BizException
* @throws PermissionException
* @throws JsonParseException
*/
@ApiOperation(value = "新增书籍(编辑)", httpMethod = "POST")
@ApiImplicitParams({@ApiImplicitParam(name = "token", value = "token", dataType = "String", paramType = "header"),
@ApiImplicitParam(name = "book", value = "书籍实体", dataType = "Book", paramType = "body")})
@RequestMapping(value = "create4Adviser", method = RequestMethod.POST)
public ResponseDto<BookDto> create4Adviser(@RequestHeader("token") String token, @RequestBody Book book)
throws BizException, PermissionException, JsonParseException;
/**
* 根据ISBN码获取书籍 to exapi
*
* @param isbn
* @param serialNumber
* @return
* @throws BizException
*/
@ApiOperation(value = "根据ISBN码和serialNumber获取书籍", httpMethod = "GET")
@ApiImplicitParams({@ApiImplicitParam(name = "isbn", value = "isbn", dataType = "string", paramType = "query"),
@ApiImplicitParam(name = "serialNumber", value = "刊物序号", dataType = "string", paramType = "query")})
@RequestMapping(value = "/getByIsbnAndSerialNumber", method = RequestMethod.GET)
public ResponseDto<BookDto> getByIsbnAndSerialNumber(@RequestParam(value = "isbn", required = true) String isbn,
@RequestParam(value = "serialNumber", required = false) String serialNumber) throws BizException;
/**
* 修改图书类型与图书基本信息
*
* @param token
* @param book
* @return
* @throws BizException
* @throws PermissionException
* @throws JsonParseException
*/
@ApiOperation(value = "修改图书类型与图书基本信息(编辑)", httpMethod = "POST")
@ApiImplicitParams({@ApiImplicitParam(name = "token", value = "token", dataType = "String", paramType = "header"),
@ApiImplicitParam(name = "book", value = "书籍实体", dataType = "Book", paramType = "body")})
@RequestMapping(value = "updateBookAndBookType", method = RequestMethod.POST)
public ResponseDto<?> updateBookAndBookType(@RequestHeader("token") String token, @RequestBody Book book)
throws BizException, PermissionException, JsonParseException;
@ApiOperation(value = "校验ISBN", httpMethod = "GET")
@ApiImplicitParams({@ApiImplicitParam(name = "token", value = "token", dataType = "String", paramType = "header"),
@ApiImplicitParam(name = "isbn", value = "ISBN码", dataType = "String", paramType = "query")})
@RequestMapping(value = "checkISBN4App", method = RequestMethod.GET)
ResponseDto<Boolean> checkISBN4App(@RequestHeader("token") String token, @RequestParam String isbn) throws PermissionException;
@ApiOperation(value = "根据渠道ID分页获取图书列表",httpMethod = "GET")
@ApiImplicitParams({@ApiImplicitParam(name = "token", value = "token", dataType = "String", paramType = "header"),
@ApiImplicitParam(name = "channelId", value = "渠道标识", dataType = "Long", paramType = "query"),
@ApiImplicitParam(name = "currentPage", value = "当前页数", dataType = "int", paramType = "query"),
@ApiImplicitParam(name = "numPerPage", value = "每页条数", dataType = "int", paramType = "query") })
@GetMapping("getBookListByChannelId4Adviser")
ResponseDto<PageBean> getBookListByChannelId4Adviser(@RequestHeader("token") String token, @RequestParam(value =
"currentPage", required = true) Integer currentPage, @RequestParam(value = "numPerPage", required = true)
Integer numPerPage, @RequestParam(value = "channelId", required = true) Long channelId) throws
PermissionException, JsonParseException, BizException;
}
...@@ -114,7 +114,7 @@ public interface BookService { ...@@ -114,7 +114,7 @@ public interface BookService {
/** /**
* 根据ISBN码获取书籍 to exapi * 根据ISBN码获取书籍 to exapi
* *
* @param bookId * @param isbn
* @return * @return
* @throws BizException * @throws BizException
*/ */
...@@ -128,7 +128,7 @@ public interface BookService { ...@@ -128,7 +128,7 @@ public interface BookService {
/** /**
* 根据ISBN码获取书籍详情(包含二维码个数,应用个数,商品个数) to exapi * 根据ISBN码获取书籍详情(包含二维码个数,应用个数,商品个数) to exapi
* *
* @param bookId * @param isbn
* @return * @return
* @throws BizException * @throws BizException
*/ */
...@@ -158,7 +158,7 @@ public interface BookService { ...@@ -158,7 +158,7 @@ public interface BookService {
/** /**
* 根据ISBN码获取书籍 to exapi * 根据ISBN码获取书籍 to exapi
* *
* @param bookId * @param isbn
* @return * @return
* @throws BizException * @throws BizException
*/ */
......
...@@ -10,11 +10,23 @@ import com.pcloud.appcenter.base.exception.AppBizException; ...@@ -10,11 +10,23 @@ import com.pcloud.appcenter.base.exception.AppBizException;
import com.pcloud.book.base.enums.BookFreezeEnum; import com.pcloud.book.base.enums.BookFreezeEnum;
import com.pcloud.book.base.enums.BookTypeEnum; import com.pcloud.book.base.enums.BookTypeEnum;
import com.pcloud.book.base.exception.BookBizException; import com.pcloud.book.base.exception.BookBizException;
import com.pcloud.book.book.biz.*; import com.pcloud.book.book.biz.BookAdviserBiz;
import com.pcloud.book.book.biz.BookAppBiz;
import com.pcloud.book.book.biz.BookBiz;
import com.pcloud.book.book.biz.BookFreezeBiz;
import com.pcloud.book.book.biz.BookFundBiz;
import com.pcloud.book.book.biz.BookProductBiz;
import com.pcloud.book.book.biz.BookResourceBiz;
import com.pcloud.book.book.cache.BookCache; import com.pcloud.book.book.cache.BookCache;
import com.pcloud.book.book.constant.BookConstant; import com.pcloud.book.book.constant.BookConstant;
import com.pcloud.book.book.dao.BookDao; import com.pcloud.book.book.dao.BookDao;
import com.pcloud.book.book.dto.*; import com.pcloud.book.book.dto.BookAdviserUpdateTimeDTO;
import com.pcloud.book.book.dto.BookAssocCount;
import com.pcloud.book.book.dto.BookCoverImgUpdateDTO;
import com.pcloud.book.book.dto.BookDetialDTO;
import com.pcloud.book.book.dto.BookDto;
import com.pcloud.book.book.dto.BookFreezeDto;
import com.pcloud.book.book.dto.BookFundDto;
import com.pcloud.book.book.entity.Book; import com.pcloud.book.book.entity.Book;
import com.pcloud.book.book.entity.BookAdviser; import com.pcloud.book.book.entity.BookAdviser;
import com.pcloud.book.book.set.BookSet; import com.pcloud.book.book.set.BookSet;
...@@ -26,6 +38,7 @@ import com.pcloud.book.consumer.user.AdviserConsr; ...@@ -26,6 +38,7 @@ import com.pcloud.book.consumer.user.AdviserConsr;
import com.pcloud.book.consumer.user.AgentConsr; import com.pcloud.book.consumer.user.AgentConsr;
import com.pcloud.book.consumer.user.ChannelConsr; import com.pcloud.book.consumer.user.ChannelConsr;
import com.pcloud.book.consumer.user.PartyConsr; import com.pcloud.book.consumer.user.PartyConsr;
import com.pcloud.book.mq.producer.BookMQProducer;
import com.pcloud.common.core.aspect.ParamLog; import com.pcloud.common.core.aspect.ParamLog;
import com.pcloud.common.core.constant.AgentTypeEnum; import com.pcloud.common.core.constant.AgentTypeEnum;
import com.pcloud.common.core.constant.SystemCode; import com.pcloud.common.core.constant.SystemCode;
...@@ -44,7 +57,12 @@ import org.springframework.stereotype.Service; ...@@ -44,7 +57,12 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import java.io.IOException; import java.io.IOException;
import java.util.*; import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ExecutorService; import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors; import java.util.concurrent.Executors;
import java.util.stream.Collectors; import java.util.stream.Collectors;
...@@ -96,6 +114,8 @@ public class BookBizImpl implements BookBiz { ...@@ -96,6 +114,8 @@ public class BookBizImpl implements BookBiz {
private BookFreezeBiz bookFreezeBiz; private BookFreezeBiz bookFreezeBiz;
@Autowired @Autowired
private AssistTempletConsr assistTempletConsr; private AssistTempletConsr assistTempletConsr;
@Autowired
private BookMQProducer bookMQProducer;
/** /**
* 创建书籍,同时建立与编辑的推广关系 * 创建书籍,同时建立与编辑的推广关系
...@@ -171,12 +191,24 @@ public class BookBizImpl implements BookBiz { ...@@ -171,12 +191,24 @@ public class BookBizImpl implements BookBiz {
LOGGER.info("【书籍基础】修改书籍基础信息,<PARAM>.[book]=" + book.toString()); LOGGER.info("【书籍基础】修改书籍基础信息,<PARAM>.[book]=" + book.toString());
// 校验参数 // 校验参数
this.checkParam(book); this.checkParam(book);
//获取图书基本信息
BookDto bookDto = this.getBaseById(book.getBookId());
checkIsUpdateCoverImgAndSendTopic(bookDto, book.getCoverImg());
bookDao.update(book); bookDao.update(book);
// 清除redis中数据 // 清除redis中数据
bookCache.clearRedisByBook(book.getBookId(), book.getIsbn(), book.getSerialNumber()); bookCache.clearRedisByBook(book.getBookId(), book.getIsbn(), book.getSerialNumber());
LOGGER.info("【书籍基础】修改书籍基础信息,<END>"); LOGGER.info("【书籍基础】修改书籍基础信息,<END>");
} }
void checkIsUpdateCoverImgAndSendTopic(BookDto oldBook, String newCoverImg){
if(newCoverImg != null && !newCoverImg.equalsIgnoreCase(oldBook.getCoverImg())){
BookCoverImgUpdateDTO bookCoverImgUpdateDTO = new BookCoverImgUpdateDTO();
bookCoverImgUpdateDTO.setBookId(oldBook.getBookId());
bookCoverImgUpdateDTO.setCoverImg(newCoverImg);
bookMQProducer.sendUpdateBookCoverImgTopic(bookCoverImgUpdateDTO);
}
}
/** /**
* 修改书籍封面图 * 修改书籍封面图
*/ */
...@@ -191,6 +223,7 @@ public class BookBizImpl implements BookBiz { ...@@ -191,6 +223,7 @@ public class BookBizImpl implements BookBiz {
throw new BookBizException(BookBizException.PARAM_IS_NULL, "默认图书不能修改!"); throw new BookBizException(BookBizException.PARAM_IS_NULL, "默认图书不能修改!");
} }
bookDao.updateCoverImg(book); bookDao.updateCoverImg(book);
checkIsUpdateCoverImgAndSendTopic(bookDto, book.getCoverImg());
// 清除redis中数据 // 清除redis中数据
bookCache.clearRedisByBook(bookDto.getBookId(), bookDto.getIsbn(), bookDto.getSerialNumber()); bookCache.clearRedisByBook(bookDto.getBookId(), bookDto.getIsbn(), bookDto.getSerialNumber());
LOGGER.info("【书籍基础】修改书籍基础信息,<END>"); LOGGER.info("【书籍基础】修改书籍基础信息,<END>");
...@@ -228,6 +261,7 @@ public class BookBizImpl implements BookBiz { ...@@ -228,6 +261,7 @@ public class BookBizImpl implements BookBiz {
} }
// 清除redis中数据 // 清除redis中数据
bookCache.clearRedisByBook(book.getBookId(), book.getIsbn(), book.getSerialNumber()); bookCache.clearRedisByBook(book.getBookId(), book.getIsbn(), book.getSerialNumber());
checkIsUpdateCoverImgAndSendTopic(bookDto, book.getCoverImg());
LOGGER.info("【书籍基础】修改书籍基础信息,<END>"); LOGGER.info("【书籍基础】修改书籍基础信息,<END>");
return bookDto; return bookDto;
} }
...@@ -1390,6 +1424,7 @@ public class BookBizImpl implements BookBiz { ...@@ -1390,6 +1424,7 @@ public class BookBizImpl implements BookBiz {
// 书籍总数缓存加1 // 书籍总数缓存加1
bookCache.incrObject(BookConstant.BOOK_CACHE + "PLATFORM_BOOK_COUNT"); bookCache.incrObject(BookConstant.BOOK_CACHE + "PLATFORM_BOOK_COUNT");
} else { } else {
checkIsUpdateCoverImgAndSendTopic(bookDto, book.getCoverImg());
// 修改图书基本信息 // 修改图书基本信息
bookDao.updateByAdviser(book); bookDao.updateByAdviser(book);
// 清除redis中数据 // 清除redis中数据
......
...@@ -49,7 +49,7 @@ public interface BookAppFacade { ...@@ -49,7 +49,7 @@ public interface BookAppFacade {
/** /**
* 微信端添加书籍和应用关联关系 * 微信端添加书籍和应用关联关系
* *
* @param token * @param userInfo
* @param bookApp * @param bookApp
* @return * @return
* @throws BizException * @throws BizException
...@@ -68,8 +68,7 @@ public interface BookAppFacade { ...@@ -68,8 +68,7 @@ public interface BookAppFacade {
* 删除书籍应用关联关系 * 删除书籍应用关联关系
* *
* @param token * @param token
* @param bookId * @param bookAppId
* @param appId
* @return * @return
* @throws BizException * @throws BizException
* @throws PermissionException * @throws PermissionException
...@@ -86,9 +85,8 @@ public interface BookAppFacade { ...@@ -86,9 +85,8 @@ public interface BookAppFacade {
/** /**
* 微信端删除书籍应用关联关系 * 微信端删除书籍应用关联关系
* *
* @param token * @param userInfo
* @param bookId * @param bookAppId
* @param appId
* @throws BizException * @throws BizException
* @throws PermissionException * @throws PermissionException
* @throws JsonParseException * @throws JsonParseException
......
/**
*
*/
package com.pcloud.book.book.facade;
import com.pcloud.book.book.dto.BookAssocCount;
import com.pcloud.book.book.dto.BookDto;
import com.pcloud.book.book.entity.Book;
import com.pcloud.common.dto.ResponseDto;
import com.pcloud.common.exceptions.BizException;
import com.pcloud.common.page.PageBean;
import com.pcloud.common.permission.PermissionException;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.codehaus.jackson.JsonParseException;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* @描述:书籍接口
* @作者:songx
* @创建时间:2016年12月23日,下午2:37:02 @版本:1.0
*/
@FeignClient(value = "pcloud-service-book", qualifier = "bookFacadeCloud", path = "book/v1.0/book")
@Api(description = "书籍接口外部服务")
public interface BookFacade {
@ApiOperation(value = "新增书籍(平台)", httpMethod = "POST")
@ApiImplicitParams({@ApiImplicitParam(name = "token", value = "token", dataType = "String", paramType = "header"),
@ApiImplicitParam(name = "book", value = "书籍实体", dataType = "Book", paramType = "body")})
@RequestMapping(value = "create", method = RequestMethod.POST)
ResponseDto<BookDto> create(@RequestHeader("token") String token, @RequestBody Book book)
throws BizException, PermissionException;
@ApiOperation(value = "修改书籍信息(平台)", httpMethod = "POST")
@ApiImplicitParams({@ApiImplicitParam(name = "token", value = "token", dataType = "String", paramType = "header"),
@ApiImplicitParam(name = "book", value = "书籍实体", dataType = "Book", paramType = "body")})
@RequestMapping(value = "update", method = RequestMethod.POST)
ResponseDto<?> update(@RequestHeader("token") String token, @RequestBody Book book)
throws BizException, PermissionException;
@ApiOperation(value = "修改书籍封面图", httpMethod = "POST")
@ApiImplicitParams({@ApiImplicitParam(name = "token", value = "token", dataType = "String", paramType = "header"),
@ApiImplicitParam(name = "book", value = "书籍实体", dataType = "Book", paramType = "body")})
@RequestMapping(value = "updateCoverImg", method = RequestMethod.POST)
ResponseDto<?> updateCoverImg(@RequestHeader("token") String token, @RequestBody Book book)
throws BizException, PermissionException, JsonParseException;
@ApiOperation(value = "修改书籍信息(编辑)", httpMethod = "POST")
@ApiImplicitParams({@ApiImplicitParam(name = "token", value = "token", dataType = "String", paramType = "header"),
@ApiImplicitParam(name = "book", value = "书籍实体", dataType = "Book", paramType = "body")})
@RequestMapping(value = "updateByAdviser", method = RequestMethod.POST)
ResponseDto<?> updateByAdviser(@RequestHeader("token") String token, @RequestBody Book book)
throws BizException, PermissionException;
@ApiOperation(value = "删除书籍信息(平台)", httpMethod = "GET")
@ApiImplicitParams({@ApiImplicitParam(name = "token", value = "token", dataType = "String", paramType = "header"),
@ApiImplicitParam(name = "bookId", value = "图书标识", dataType = "long", paramType = "query")})
@RequestMapping(value = "delete", method = RequestMethod.GET)
ResponseDto<?> delete(@RequestHeader("token") String token,
@RequestParam(value = "bookId") Long bookId)
throws BizException, PermissionException;
@ApiOperation(value = "批量删除书籍信息(平台)", httpMethod = "GET")
@ApiImplicitParams({@ApiImplicitParam(name = "token", value = "token", dataType = "String", paramType = "header"),
@ApiImplicitParam(name = "bookIds", value = "图书标识", dataType = "string", paramType = "query")})
@RequestMapping(value = "deletes", method = RequestMethod.GET)
ResponseDto<?> deletes(@RequestHeader("token") String token,
@RequestParam(value = "bookIds") String bookIds)
throws BizException, PermissionException;
@ApiOperation(value = "获取书籍基础信息(包含统计信息)(编辑端)", httpMethod = "GET")
@ApiImplicitParams({@ApiImplicitParam(name = "token", value = "token", dataType = "string", paramType = "header"),
@ApiImplicitParam(name = "bookId", value = "图书标识", dataType = "long", paramType = "query"),
@ApiImplicitParam(name = "channelId", value = "渠道标识", dataType = "long", paramType = "query")})
@RequestMapping(value = "getById", method = RequestMethod.GET)
ResponseDto<BookDto> getById(@RequestHeader("token") String token,
@RequestParam(value = "bookId") Long bookId,
@RequestParam(value = "channelId") Long channelId)
throws BizException, PermissionException;
@ApiOperation(value = "获取书籍基础信息", httpMethod = "GET")
@ApiImplicitParams({@ApiImplicitParam(name = "bookId", value = "图书标识", dataType = "long", paramType = "query")})
@RequestMapping(value = "getBaseById", method = RequestMethod.GET)
ResponseDto<BookDto> getBaseById(@RequestParam(value = "bookId") Long bookId)
throws BizException;
@ApiOperation(value = "判断书籍ISBN码是否存在(平台)", httpMethod = "GET")
@ApiImplicitParams({@ApiImplicitParam(name = "token", value = "token", dataType = "string", paramType = "header"),
@ApiImplicitParam(name = "typeCode", value = "书类型编码", dataType = "string", paramType = "query"),
@ApiImplicitParam(name = "isbn", value = "书籍号", dataType = "string", paramType = "query"),
@ApiImplicitParam(name = "serialNumber", value = "刊物序号", dataType = "string", paramType = "query")})
@RequestMapping(value = "isbnExists", method = RequestMethod.GET)
ResponseDto<Boolean> isbnExists(@RequestHeader("token") String token,
@RequestParam(value = "typeCode", required = false) String typeCode,
@RequestParam(value = "isbn") String isbn,
@RequestParam(value = "serialNumber", required = false) String serialNumber)
throws BizException, PermissionException;
@ApiOperation(value = "判断书籍ISBN码是否存在(平台)", httpMethod = "GET")
@ApiImplicitParams({@ApiImplicitParam(name = "token", value = "token", dataType = "string", paramType = "header"),
@ApiImplicitParam(name = "publish", value = "出版社", dataType = "string", paramType = "query"),
@ApiImplicitParam(name = "fundName", value = "基金支持", dataType = "string", paramType = "query"),
@ApiImplicitParam(name = "bookName", value = "书籍名称", dataType = "string", paramType = "query"),
@ApiImplicitParam(name = "isbn", value = "书籍号", dataType = "string", paramType = "query"),
@ApiImplicitParam(name = "serialNumber", value = "刊物序号", dataType = "string", paramType = "query"),
@ApiImplicitParam(name = "isCurrentMonth", value = "当月基金支持书刊", dataType = "int", paramType = "query"),
@ApiImplicitParam(name = "currentPage", value = "当前页", dataType = "int", paramType = "query"),
@ApiImplicitParam(name = "numPerPage", value = "每页条数", dataType = "int", paramType = "query")})
@RequestMapping(value = "listPage", method = RequestMethod.GET)
ResponseDto<?> getListPage(@RequestHeader("token") String token,
@RequestParam(value = "publish", required = false) String publish,
@RequestParam(value = "fundName", required = false) String fundName,
@RequestParam(value = "bookName", required = false) String bookName,
@RequestParam(value = "isbn", required = false) String isbn,
@RequestParam(value = "serialNumber", required = false) String serialNumber,
@RequestParam(value = "isCurrentMonth", required = false) Integer isCurrentMonth,
@RequestParam(value = "currentPage") Integer currentPage,
@RequestParam(value = "numPerPage") Integer numPerPage)
throws BizException, PermissionException, JsonParseException;
@ApiOperation(value = "判断书籍ISBN码是否存在(平台)", httpMethod = "GET")
@ApiImplicitParams({@ApiImplicitParam(name = "token", value = "token", dataType = "string", paramType = "header"),
@ApiImplicitParam(name = "bookName", value = "书籍名称", dataType = "string", paramType = "query"),
@ApiImplicitParam(name = "isbn", value = "isbn", dataType = "string", paramType = "query"),
@ApiImplicitParam(name = "channelId", value = "渠道标识", dataType = "long", paramType = "query"),
@ApiImplicitParam(name = "typeCode", value = "书刊类型", dataType = "string", paramType = "query"),
@ApiImplicitParam(name = "currentPage", value = "当前页", dataType = "int", paramType = "query"),
@ApiImplicitParam(name = "numPerPage", value = "每页条数", dataType = "int", paramType = "query"),
@ApiImplicitParam(name = "isMainEditor", value = "只看我是主编辑", dataType = "int", paramType = "query"),
@ApiImplicitParam(name = "isFundSupport", value = "只看基金支持", dataType = "int", paramType = "query"),
@ApiImplicitParam(name = "bookId", value = "书籍标识", dataType = "int", paramType = "query"),
@ApiImplicitParam(name = "templetId", value = "图书类型标识", dataType = "long", paramType = "query")})
@RequestMapping(value = "listPage4Adviser", method = RequestMethod.GET)
ResponseDto<PageBean> getListPage4Adviser(@RequestHeader("token") String token,
@RequestParam(value = "name", required = false) String name,
@RequestParam(value = "bookName", required = false) String bookName,
@RequestParam(value = "isbn", required = false) String isbn,
@RequestParam(value = "channelId", required = false) Long channelId,
@RequestParam(value = "typeCode", required = false) String typeCode,
@RequestParam(value = "currentPage") Integer currentPage,
@RequestParam(value = "numPerPage") Integer numPerPage,
@RequestParam(value = "isMainEditor", required = false) Integer isMainEditor,
@RequestParam(value = "isFundSupport", required = false) Integer isFundSupport,
@RequestParam(value = "bookId", required = false) Integer bookId,
@RequestParam(value = "templetId", required = false) Long templetId)
throws BizException, PermissionException;
@ApiOperation(value = "首页获取正在做的图书", httpMethod = "GET")
@ApiImplicitParams({@ApiImplicitParam(name = "token", value = "token", dataType = "string", paramType = "header"),
@ApiImplicitParam(name = "num", value = "个数", dataType = "Integer", paramType = "query")})
@GetMapping("getList4Adviser")
ResponseDto<List<BookDto>> getList4Adviser(@RequestHeader("token") String token, @RequestParam(value = "num") Integer num) throws BizException, PermissionException, JsonParseException;
@ApiOperation(value = "获取书籍的详细信息(微信客户端)", httpMethod = "GET")
@ApiImplicitParams({
@ApiImplicitParam(name = "userInfo", value = "Cookie", dataType = "string", paramType = "header"),
@ApiImplicitParam(name = "bookId", value = "书籍标识", dataType = "long", paramType = "query"),
@ApiImplicitParam(name = "adviserId", value = "编辑标识", dataType = "long", paramType = "query")})
@RequestMapping(value = "getDetailById", method = RequestMethod.GET)
ResponseDto<BookDto> getDetailById(@CookieValue("userInfo") String userInfo,
@RequestParam(value = "bookId", required = false) Long bookId,
@RequestParam(value = "adviserId", required = false) Long adviserId)
throws BizException, PermissionException, JsonParseException;
@ApiOperation(value = "图书收益,获取书籍基础信息(包含统计信息)(编辑)", httpMethod = "GET")
@ApiImplicitParams({@ApiImplicitParam(name = "token", value = "token", dataType = "string", paramType = "header"),
@ApiImplicitParam(name = "bookId", value = "书籍标识", dataType = "long", paramType = "query"),
@ApiImplicitParam(name = "channelId", value = "渠道标识", dataType = "long", paramType = "query")})
@RequestMapping(value = "getById4Profit", method = RequestMethod.GET)
ResponseDto<BookDto> getById4Profit(@RequestHeader("token") String token,
@RequestParam(value = "bookId") Long bookId,
@RequestParam(value = "channelId") Long channelId)
throws BizException, PermissionException, JsonParseException;
@ApiOperation(value = "判断书籍ISBN码是否存在,存在则获取书籍信息(编辑)", httpMethod = "POST")
@ApiImplicitParams({@ApiImplicitParam(name = "token", value = "token", dataType = "string", paramType = "header"),
@ApiImplicitParam(name = "book", value = "书籍实体", dataType = "Book", paramType = "body")})
@RequestMapping(value = "isbnExistsOrGetInfo", method = RequestMethod.POST)
ResponseDto<BookDto> isbnExistsOrGetInfo(@RequestHeader("token") String token, @RequestBody Book book)
throws BizException, PermissionException, JsonParseException;
@ApiOperation(value = "创建编辑书籍关联关系(编辑端)", httpMethod = "POST")
@ApiImplicitParams({@ApiImplicitParam(name = "token", value = "token", dataType = "string", paramType = "header"),
@ApiImplicitParam(name = "book", value = "书籍实体", dataType = "Book", paramType = "body")})
@RequestMapping(value = "setBookAdviserRelation", method = RequestMethod.POST)
ResponseDto<?> setBookAdviserRelation(@RequestHeader("token") String token, @RequestBody Book book)
throws BizException, PermissionException;
/**
* 获取书籍的基本信息(微信客户端)
*/
@ApiOperation(value = "获取书籍的基本信息(微信客户端)", httpMethod = "GET")
@ApiImplicitParams({@ApiImplicitParam(name = "token", value = "token", dataType = "string", paramType = "header"),
@ApiImplicitParam(name = "bookId", value = "书籍标识", dataType = "long", paramType = "query")})
@RequestMapping(value = "getBaseInfoById4Wechat", method = RequestMethod.GET)
ResponseDto<BookDto> getBaseInfoById4Wechat(@CookieValue("userInfo") String userInfo,
@RequestParam(value = "bookId") Long bookId)
throws BizException, PermissionException;
/**
* 获取书籍列表(微信编辑端)
*/
@ApiOperation(value = "获取书籍列表(微信编辑端)", httpMethod = "GET")
@ApiImplicitParams({
@ApiImplicitParam(name = "userInfo", value = "Cookie", dataType = "string", paramType = "header"),
@ApiImplicitParam(name = "currentPage", value = "当前页", dataType = "int", paramType = "query"),
@ApiImplicitParam(name = "numPerPage", value = "每页条数", dataType = "int", paramType = "query"),
@ApiImplicitParam(name = "bookName", value = "书籍名称", dataType = "string", paramType = "query"),
@ApiImplicitParam(name = "channelId", value = "渠道标识", dataType = "long", paramType = "query")})
@RequestMapping(value = "getListPage4Wechat", method = RequestMethod.GET)
ResponseDto<PageBean> getListPage4Wechat(@CookieValue("userInfo") String userInfo,
@RequestParam(value = "currentPage") Integer currentPage,
@RequestParam(value = "numPerPage") Integer numPerPage,
@RequestParam(value = "bookName", required = false) String bookName,
@RequestParam(value = "channelId", required = false) Long channelId)
throws BizException, PermissionException, JsonParseException;
/**
* 获取书籍列表(XCX)
*/
@ApiOperation(value = "获取书籍列表(XCX)", httpMethod = "GET")
@ApiImplicitParams({@ApiImplicitParam(name = "token", value = "token", dataType = "string", paramType = "header"),
@ApiImplicitParam(name = "currentPage", value = "当前页", dataType = "int", paramType = "query"),
@ApiImplicitParam(name = "numPerPage", value = "每页条数", dataType = "int", paramType = "query"),
@ApiImplicitParam(name = "bookName", value = "书籍名称", dataType = "string", paramType = "query"),
@ApiImplicitParam(name = "channelId", value = "渠道标识", dataType = "long", paramType = "query")})
@RequestMapping(value = "getlistPage", method = RequestMethod.GET)
ResponseDto<PageBean> listPage(@RequestHeader("token") String token,
@RequestParam(value = "currentPage") Integer currentPage,
@RequestParam(value = "numPerPage") Integer numPerPage,
@RequestParam(value = "bookName", required = false) String bookName,
@RequestParam(value = "channelId", required = false) Long channelId)
throws BizException, PermissionException, JsonParseException;
/**
* 判断书籍ISBN码是否存在,存在则获取书籍信息(微信管理端-编辑)
*/
@ApiOperation(value = "判断书籍ISBN码是否存在,存在则获取书籍信息(微信管理端-编辑)", httpMethod = "POST")
@ApiImplicitParams({
@ApiImplicitParam(name = "userInfo", value = "Cookie", dataType = "String", paramType = "header"),
@ApiImplicitParam(name = "book", value = "书籍实体", dataType = "Book", paramType = "body")})
@RequestMapping(value = "isbnExistsOrGetInfo4Wechat", method = RequestMethod.POST)
ResponseDto<BookDto> isbnExistsOrGetInfo4Wechat(@CookieValue("userInfo") String userInfo, @RequestBody Book book)
throws BizException, PermissionException, JsonParseException;
/**
* 创建编辑书籍关联关系(微信管理端-编辑)
*/
@ApiOperation(value = "创建编辑书籍关联关系(微信管理端-编辑)", httpMethod = "POST")
@ApiImplicitParams({
@ApiImplicitParam(name = "userInfo", value = "Cookie", dataType = "String", paramType = "header"),
@ApiImplicitParam(name = "book", value = "书籍实体", dataType = "Book", paramType = "body")})
@RequestMapping(value = "setBookAdviserRelation4Wechat", method = RequestMethod.POST)
ResponseDto<?> setBookAdviserRelation4Wechat(@CookieValue("userInfo") String userInfo, @RequestBody Book book)
throws BizException, PermissionException, JsonParseException;
/**
* 微信端创建书籍(微信管理端-编辑)
*/
@ApiOperation(value = "微信端创建书籍(微信管理端-编辑)", httpMethod = "POST")
@ApiImplicitParams({
@ApiImplicitParam(name = "userInfo", value = "Cookie", dataType = "String", paramType = "header"),
@ApiImplicitParam(name = "book", value = "书籍实体", dataType = "Book", paramType = "body")})
@RequestMapping(value = "create4Wechat", method = RequestMethod.POST)
ResponseDto<BookDto> create4Wechat(@CookieValue("userInfo") String userInfo, @RequestBody Book book)
throws BizException, PermissionException, JsonParseException;
/**
* 微信端修改书籍(微信管理端-编辑)
*/
@ApiOperation(value = "微信端修改书籍(微信管理端-编辑)", httpMethod = "POST")
@ApiImplicitParams({
@ApiImplicitParam(name = "userInfo", value = "Cookie", dataType = "String", paramType = "header"),
@ApiImplicitParam(name = "book", value = "书籍实体", dataType = "Book", paramType = "body")})
@RequestMapping(value = "update4Wechat", method = RequestMethod.POST)
ResponseDto<BookDto> update4Wechat(@CookieValue("userInfo") String userInfo, @RequestBody Book book)
throws BizException, PermissionException, JsonParseException;
@ApiOperation(value = "根据ISBN获取期刊分页列表", httpMethod = "GET")
@ApiImplicitParams({
@ApiImplicitParam(name = "userInfo", value = "Cookie", dataType = "String", paramType = "header"),
@ApiImplicitParam(name = "typeCode", value = "书类型编码", dataType = "string", paramType = "query"),
@ApiImplicitParam(name = "isbn", value = "isbn", dataType = "string", paramType = "query"),
@ApiImplicitParam(name = "currentPage", value = "当前页", dataType = "int", paramType = "query"),
@ApiImplicitParam(name = "numPerPage", value = "每页条数", dataType = "int", paramType = "query")})
@RequestMapping(value = "getJournalPageByIsbn", method = RequestMethod.GET)
ResponseDto<?> getJournalPageByIsbn(@CookieValue("userInfo") String userInfo,
@RequestParam(value = "typeCode", required = false) String typeCode,
@RequestParam(value = "isbn", required = false) String isbn,
@RequestParam(value = "currentPage") Integer currentPage,
@RequestParam(value = "numPerPage") Integer numPerPage)
throws BizException, PermissionException, JsonParseException;
/**
* 获取书籍列表(微信客户端)
*/
@ApiOperation(value = "获取书籍列表(微信客户端)", httpMethod = "GET")
@ApiImplicitParams({
@ApiImplicitParam(name = "userInfo", value = "Cookie", dataType = "String", paramType = "header"),
@ApiImplicitParam(name = "currentPage", value = "当前页", dataType = "int", paramType = "query"),
@ApiImplicitParam(name = "numPerPage", value = "每页条数", dataType = "int", paramType = "query")})
@RequestMapping(value = "listPage4Wechat", method = RequestMethod.GET)
ResponseDto<PageBean> listPage4Wechat(@CookieValue("userInfo") String userInfo,
@RequestParam(value = "currentPage") Integer currentPage,
@RequestParam(value = "numPerPage") Integer numPerPage)
throws BizException, PermissionException, JsonParseException;
/**
* 获取书籍列表(编辑)
*/
@ApiOperation(value = "获取书籍列表(编辑)", httpMethod = "GET")
@ApiImplicitParams({@ApiImplicitParam(name = "token", value = "token", dataType = "string", paramType = "header"),
@ApiImplicitParam(name = "number", value = "书籍数目", dataType = "int", paramType = "query")})
@RequestMapping(value = "listBook", method = RequestMethod.GET)
ResponseDto<List<Object>> listBook(@RequestHeader("token") String token,
@RequestParam(value = "number") Integer number)
throws BizException, PermissionException, JsonParseException;
/**
* 获取书籍列表(APP-编辑)
*/
@ApiOperation(value = "获取书籍列表(APP-编辑)", httpMethod = "GET")
@ApiImplicitParams({@ApiImplicitParam(name = "token", value = "token", dataType = "string", paramType = "header"),
@ApiImplicitParam(name = "currentPage", value = "当前页数", dataType = "int", paramType = "query"),
@ApiImplicitParam(name = "numPerPage", value = "每页条数", dataType = "int", paramType = "query"),
@ApiImplicitParam(name = "bookName", value = "书籍名称", dataType = "string", paramType = "query")})
@RequestMapping(value = "listBook4App", method = RequestMethod.GET)
ResponseDto<PageBean> listBook4App(@RequestHeader("token") String token,
@RequestParam(value = "currentPage") Integer currentPage,
@RequestParam(value = "numPerPage") Integer numPerPage,
@RequestParam(value = "bookName", required = false) String bookName)
throws BizException, PermissionException, JsonParseException;
/**
* 书刊列表-出版端
*/
@ApiOperation(value = "书刊列表-出版端", httpMethod = "GET")
@ApiImplicitParams({@ApiImplicitParam(name = "token", value = "token", dataType = "string", paramType = "header"),
@ApiImplicitParam(name = "bookName", value = "书刊名称", dataType = "string", paramType = "query"),
@ApiImplicitParam(name = "channelId", value = "渠道标识", dataType = "long", paramType = "query"),
@ApiImplicitParam(name = "typeCode", value = "书刊类型", dataType = "string", paramType = "query"),
@ApiImplicitParam(name = "currentPage", value = "当前页数", dataType = "int", paramType = "query"),
@ApiImplicitParam(name = "numPerPage", value = "每页条数", dataType = "int", paramType = "query"),
@ApiImplicitParam(name = "mainEditorName", value = "主编辑名称", dataType = "string", paramType = "query"),
@ApiImplicitParam(name = "isFundSupport", value = "基金支持", dataType = "int", paramType = "query"),
@ApiImplicitParam(name = "isbn", value = "isbn", dataType = "string", paramType = "query"),
@ApiImplicitParam(name = "templetId", value = "图书类型标识", dataType = "long", paramType = "query")})
@RequestMapping(value = "listPage4Agent", method = RequestMethod.GET)
ResponseDto<PageBean> listPage4Agent(@RequestHeader("token") String token,
@RequestParam(value = "bookName", required = false) String bookName,
@RequestParam(value = "channelId", required = false) Long channelId,
@RequestParam(value = "typeCode", required = false) String typeCode,
@RequestParam(value = "currentPage", required = false) Integer currentPage,
@RequestParam(value = "numPerPage", required = false) Integer numPerPage,
@RequestParam(value = "mainEditorName", required = false) String mainEditorName,
@RequestParam(value = "isFundSupport", required = false) Integer isFundSupport,
@RequestParam(value = "isbn", required = false) String isbn,
@RequestParam(value = "templetId", required = false) Long templetId)
throws BizException, PermissionException, JsonParseException;
/**
* 更新图书模板
*/
@ApiOperation(value = "更新图书模板", httpMethod = "POST")
@ApiImplicitParams({@ApiImplicitParam(name = "token", value = "token", dataType = "string", paramType = "header"),
@ApiImplicitParam(name = "book", value = "书籍实体", dataType = "Book", paramType = "body")})
@RequestMapping(value = "updateBookTemplet", method = RequestMethod.POST)
ResponseDto<?> updateBookTemplet(@RequestHeader("token") String token, @RequestBody Book book)
throws BizException, PermissionException, JsonParseException;
/**
* 获取应用关联的图书
*/
@ApiOperation(value = "获取应用关联的图书", httpMethod = "GET")
@ApiImplicitParams({@ApiImplicitParam(name = "token", value = "token", dataType = "string", paramType = "header"),
@ApiImplicitParam(name = "appId", value = "应用标识", dataType = "long", paramType = "query"),
@ApiImplicitParam(name = "channelId", value = "渠道标识", dataType = "long", paramType = "query")})
@RequestMapping(value = "listBookByAppId", method = RequestMethod.GET)
ResponseDto<List<BookDto>> listBookByAppId(@RequestHeader("token") String token,
@RequestParam(value = "appId", required = false) Long appId,
@RequestParam(value = "channelId", required = false) Long channelId)
throws BizException, PermissionException, JsonParseException;
/**
* 获取书籍基础信息(包含统计信息)(出版端)
*/
@ApiOperation(value = "获取书籍基础信息(包含统计信息)(编辑端)", httpMethod = "GET")
@ApiImplicitParams({@ApiImplicitParam(name = "token", value = "token", dataType = "string", paramType = "header"),
@ApiImplicitParam(name = "bookId", value = "图书标识", dataType = "long", paramType = "query"),
@ApiImplicitParam(name = "channelId", value = "渠道标识", dataType = "long", paramType = "query"),
@ApiImplicitParam(name = "adviserId", value = "编辑标识", dataType = "long", paramType = "query")})
@RequestMapping(value = "getById4Agent", method = RequestMethod.GET)
ResponseDto<BookDto> getById4Agent(@RequestHeader("token") String token,
@RequestParam(value = "bookId") Long bookId,
@RequestParam(value = "channelId", required = false) Long channelId,
@RequestParam(value = "adviserId", required = false) Long adviserId)
throws BizException, PermissionException, JsonParseException;
/**
* 书刊回收站列表(30天内删除的书刊列表)
*/
@ApiOperation(value = "书刊回收站列表", httpMethod = "GET")
@ApiImplicitParams({@ApiImplicitParam(name = "token", value = "token", dataType = "string", paramType = "header"),
@ApiImplicitParam(name = "currentPage", value = "当前页数", dataType = "int", paramType = "query"),
@ApiImplicitParam(name = "numPerPage", value = "每页条数", dataType = "int", paramType = "query")})
@RequestMapping(value = "listPageDelete4Adviser", method = RequestMethod.GET)
ResponseDto<PageBean> listPageDelete4Adviser(@RequestHeader("token") String token,
@RequestParam(value = "currentPage") Integer currentPage,
@RequestParam(value = "numPerPage") Integer numPerPage)
throws BizException, PermissionException, JsonParseException;
/**
* 获取图书关联超级作者商品个数
*/
@ApiOperation(value = "获取图书统计个数", httpMethod = "GET")
@ApiImplicitParams({@ApiImplicitParam(name = "token", value = "token", dataType = "string", paramType = "header"),
@ApiImplicitParam(name = "bookId", value = "图书标识", dataType = "long", paramType = "query"),
@ApiImplicitParam(name = "channelId", value = "渠道标识", dataType = "long", paramType = "query")})
@RequestMapping(value = "getCount4BookAssoc", method = RequestMethod.GET)
ResponseDto<BookAssocCount> getCount4BookAssoc(@RequestHeader("token") String token,
@RequestParam(value = "bookId") Long bookId,
@RequestParam(value = "channelId", required = false) Long channelId)
throws BizException, PermissionException, JsonParseException;
/**
* 导出所有书刊成excel表 - 出版端
*/
@ApiOperation(value = "导出出版下所有书刊excel表(出版端)", httpMethod = "GET")
@ApiImplicitParams({
@ApiImplicitParam(name = "token", value = "token", dataType = "string", paramType = "header")})
@RequestMapping(value = "exportBookToExcel", method = RequestMethod.GET)
ResponseDto<?> exportBookToExcel(@RequestHeader("token") String token)
throws PermissionException, JsonParseException, BizException;
/**
* 图书列表(平台端)
*/
@ApiOperation(value = "图书列表(平台端)", httpMethod = "GET")
@ApiImplicitParams({@ApiImplicitParam(name = "token", value = "token", dataType = "string", paramType = "header"),
@ApiImplicitParam(name = "typeCode", value = "书刊类型", dataType = "string", paramType = "query"),
@ApiImplicitParam(name = "templetId", value = "书刊分类标识", dataType = "long", paramType = "query"),
@ApiImplicitParam(name = "startDate", value = "开始日期", dataType = "string", paramType = "query"),
@ApiImplicitParam(name = "endDate", value = "结束日期", dataType = "string", paramType = "query"),
@ApiImplicitParam(name = "bookName", value = "书刊名称", dataType = "string", paramType = "query"),
@ApiImplicitParam(name = "currentPage", value = "当前页数", dataType = "int", paramType = "query"),
@ApiImplicitParam(name = "numPerPage", value = "每页条数", dataType = "int", paramType = "query")})
@RequestMapping(value = "listBookClassify", method = RequestMethod.GET)
ResponseDto<PageBean> listBookClassify(@RequestHeader("token") String token,
@RequestParam(value = "typeCode", required = false) String typeCode,
@RequestParam(value = "templetId", required = false) Long templetId,
@RequestParam(value = "startDate", required = false) String startDate,
@RequestParam(value = "endDate", required = false) String endDate,
@RequestParam(value = "bookName", required = false) String bookName,
@RequestParam(value = "currentPage") Integer currentPage,
@RequestParam(value = "numPerPage") Integer numPerPage)
throws BizException, PermissionException, JsonParseException;
@ApiOperation(value = "导出平台下所有书刊excel表(平台端)", httpMethod = "GET")
@ApiImplicitParams({
@ApiImplicitParam(name = "token", value = "token", dataType = "string", paramType = "header")})
@RequestMapping(value = "exportBookToExcel4Platform", method = RequestMethod.GET)
ResponseDto<?> exportBookToExcel4Platform(@RequestHeader("token") String token)
throws PermissionException, JsonParseException, BizException;
/**
* 通过isbn获取图书信息(编辑端new)
*/
@ApiOperation(value = "通过isbn获取图书信息(编辑端new)", httpMethod = "GET")
@ApiImplicitParams({@ApiImplicitParam(name = "token", value = "token", dataType = "string", paramType = "header"),
@ApiImplicitParam(name = "isbn", value = "书籍号", dataType = "string", paramType = "query"),
@ApiImplicitParam(name = "typeCode", value = "图书类型", dataType = "string", paramType = "query")})
@RequestMapping(value = "getByIsbnAndTypeCode", method = RequestMethod.GET)
ResponseDto<BookDto> getByIsbnAndTypeCode(@RequestHeader("token") String token,
@RequestParam(value = "isbn") String isbn,
@RequestParam(value = "typeCode") String typeCode)
throws BizException, PermissionException, JsonParseException;
/**
* 新增书籍(编辑)
*/
@ApiOperation(value = "新增书籍(编辑)", httpMethod = "POST")
@ApiImplicitParams({@ApiImplicitParam(name = "token", value = "token", dataType = "String", paramType = "header"),
@ApiImplicitParam(name = "book", value = "书籍实体", dataType = "Book", paramType = "body")})
@RequestMapping(value = "create4Adviser", method = RequestMethod.POST)
ResponseDto<BookDto> create4Adviser(@RequestHeader("token") String token, @RequestBody Book book)
throws BizException, PermissionException, JsonParseException;
/**
* 根据ISBN码获取书籍 to exapi
*/
@ApiOperation(value = "根据ISBN码和serialNumber获取书籍", httpMethod = "GET")
@ApiImplicitParams({@ApiImplicitParam(name = "isbn", value = "isbn", dataType = "string", paramType = "query"),
@ApiImplicitParam(name = "serialNumber", value = "刊物序号", dataType = "string", paramType = "query")})
@RequestMapping(value = "/getByIsbnAndSerialNumber", method = RequestMethod.GET)
ResponseDto<BookDto> getByIsbnAndSerialNumber(@RequestParam(value = "isbn", required = true) String isbn,
@RequestParam(value = "serialNumber", required = false) String serialNumber) throws BizException;
/**
* 修改图书类型与图书基本信息
*/
@ApiOperation(value = "修改图书类型与图书基本信息(编辑)", httpMethod = "POST")
@ApiImplicitParams({@ApiImplicitParam(name = "token", value = "token", dataType = "String", paramType = "header"),
@ApiImplicitParam(name = "book", value = "书籍实体", dataType = "Book", paramType = "body")})
@RequestMapping(value = "updateBookAndBookType", method = RequestMethod.POST)
public ResponseDto<?> updateBookAndBookType(@RequestHeader("token") String token, @RequestBody Book book)
throws BizException, PermissionException, JsonParseException;
@ApiOperation(value = "校验ISBN", httpMethod = "GET")
@ApiImplicitParams({@ApiImplicitParam(name = "token", value = "token", dataType = "String", paramType = "header"),
@ApiImplicitParam(name = "isbn", value = "ISBN码", dataType = "String", paramType = "query")})
@RequestMapping(value = "checkISBN4App", method = RequestMethod.GET)
ResponseDto<Boolean> checkISBN4App(@RequestHeader("token") String token, @RequestParam String isbn) throws PermissionException;
@ApiOperation(value = "根据渠道ID分页获取图书列表", httpMethod = "GET")
@ApiImplicitParams({@ApiImplicitParam(name = "token", value = "token", dataType = "String", paramType = "header"),
@ApiImplicitParam(name = "channelId", value = "渠道标识", dataType = "Long", paramType = "query"),
@ApiImplicitParam(name = "currentPage", value = "当前页数", dataType = "int", paramType = "query"),
@ApiImplicitParam(name = "numPerPage", value = "每页条数", dataType = "int", paramType = "query")})
@GetMapping("getBookListByChannelId4Adviser")
ResponseDto<PageBean> getBookListByChannelId4Adviser(@RequestHeader("token") String token, @RequestParam(value =
"currentPage") Integer currentPage, @RequestParam(value = "numPerPage")
Integer numPerPage, @RequestParam(value = "channelId") Long channelId) throws
PermissionException, JsonParseException, BizException;
}
...@@ -41,8 +41,8 @@ import java.util.Map; ...@@ -41,8 +41,8 @@ import java.util.Map;
*/ */
@RequestMapping("/book") @RequestMapping("/book")
@RestController("bookFacade") @RestController("bookFacade")
@Produces({ ContentType.APPLICATION_JSON_UTF_8 }) @Produces({ContentType.APPLICATION_JSON_UTF_8})
@Consumes({ MediaType.APPLICATION_JSON }) @Consumes({MediaType.APPLICATION_JSON})
public class BookFacadeImpl implements BookFacade { public class BookFacadeImpl implements BookFacade {
@Autowired @Autowired
...@@ -54,7 +54,7 @@ public class BookFacadeImpl implements BookFacade { ...@@ -54,7 +54,7 @@ public class BookFacadeImpl implements BookFacade {
@Override @Override
@RequestMapping(value = "create", method = RequestMethod.POST) @RequestMapping(value = "create", method = RequestMethod.POST)
public ResponseDto<BookDto> create(@RequestHeader("token") String token, @RequestBody Book book) public ResponseDto<BookDto> create(@RequestHeader("token") String token, @RequestBody Book book)
throws BizException, PermissionException, JsonParseException { throws BizException, PermissionException {
Long adviserId = (Long) SessionUtil.getVlaue(token, SessionUtil.PARTY_ID); Long adviserId = (Long) SessionUtil.getVlaue(token, SessionUtil.PARTY_ID);
Long agentId = (Long) SessionUtil.getVlaue(token, SessionUtil.TENANT_ID); Long agentId = (Long) SessionUtil.getVlaue(token, SessionUtil.TENANT_ID);
String systemCode = SessionUtil.getVlaue(token, SessionUtil.SYSTEM_CODE).toString(); String systemCode = SessionUtil.getVlaue(token, SessionUtil.SYSTEM_CODE).toString();
...@@ -71,7 +71,7 @@ public class BookFacadeImpl implements BookFacade { ...@@ -71,7 +71,7 @@ public class BookFacadeImpl implements BookFacade {
@Override @Override
@RequestMapping(value = "update", method = RequestMethod.POST) @RequestMapping(value = "update", method = RequestMethod.POST)
public ResponseDto<?> update(@RequestHeader("token") String token, @RequestBody Book book) public ResponseDto<?> update(@RequestHeader("token") String token, @RequestBody Book book)
throws BizException, PermissionException, JsonParseException { throws BizException, PermissionException {
Long adviserId = (Long) SessionUtil.getVlaue(token, SessionUtil.PARTY_ID); Long adviserId = (Long) SessionUtil.getVlaue(token, SessionUtil.PARTY_ID);
// 实体赋值 // 实体赋值
book.setLastModifiedUser(adviserId); book.setLastModifiedUser(adviserId);
...@@ -85,7 +85,7 @@ public class BookFacadeImpl implements BookFacade { ...@@ -85,7 +85,7 @@ public class BookFacadeImpl implements BookFacade {
@Override @Override
@RequestMapping(value = "updateCoverImg", method = RequestMethod.POST) @RequestMapping(value = "updateCoverImg", method = RequestMethod.POST)
public ResponseDto<?> updateCoverImg(@RequestHeader("token") String token, @RequestBody Book book) public ResponseDto<?> updateCoverImg(@RequestHeader("token") String token, @RequestBody Book book)
throws BizException, PermissionException, JsonParseException { throws BizException, PermissionException {
Long adviserId = (Long) SessionUtil.getVlaue(token, SessionUtil.PARTY_ID); Long adviserId = (Long) SessionUtil.getVlaue(token, SessionUtil.PARTY_ID);
// 实体赋值 // 实体赋值
book.setLastModifiedUser(adviserId); book.setLastModifiedUser(adviserId);
...@@ -99,7 +99,7 @@ public class BookFacadeImpl implements BookFacade { ...@@ -99,7 +99,7 @@ public class BookFacadeImpl implements BookFacade {
@Override @Override
@RequestMapping(value = "updateByAdviser", method = RequestMethod.POST) @RequestMapping(value = "updateByAdviser", method = RequestMethod.POST)
public ResponseDto<BookDto> updateByAdviser(@RequestHeader("token") String token, @RequestBody Book book) public ResponseDto<BookDto> updateByAdviser(@RequestHeader("token") String token, @RequestBody Book book)
throws BizException, PermissionException, JsonParseException { throws BizException, PermissionException {
Long adviserId = (Long) SessionUtil.getVlaue(token, SessionUtil.PARTY_ID); Long adviserId = (Long) SessionUtil.getVlaue(token, SessionUtil.PARTY_ID);
// 实体赋值 // 实体赋值
Long agentId = (Long) SessionUtil.getVlaue(token, SessionUtil.TENANT_ID); Long agentId = (Long) SessionUtil.getVlaue(token, SessionUtil.TENANT_ID);
...@@ -107,7 +107,7 @@ public class BookFacadeImpl implements BookFacade { ...@@ -107,7 +107,7 @@ public class BookFacadeImpl implements BookFacade {
book.setCreatedUser(adviserId); book.setCreatedUser(adviserId);
book.setAgentId(agentId); book.setAgentId(agentId);
BookDto bookDto = bookBiz.updateByAdviser(book); BookDto bookDto = bookBiz.updateByAdviser(book);
return new ResponseDto<BookDto>(bookDto); return new ResponseDto<>(bookDto);
} }
/** /**
...@@ -116,8 +116,8 @@ public class BookFacadeImpl implements BookFacade { ...@@ -116,8 +116,8 @@ public class BookFacadeImpl implements BookFacade {
@Override @Override
@RequestMapping(value = "delete", method = RequestMethod.GET) @RequestMapping(value = "delete", method = RequestMethod.GET)
public ResponseDto<?> delete(@RequestHeader("token") String token, public ResponseDto<?> delete(@RequestHeader("token") String token,
@RequestParam(value = "bookId", required = false) Long bookId) @RequestParam(value = "bookId") Long bookId)
throws BizException, PermissionException, JsonParseException { throws BizException, PermissionException {
// token // token
Long partyId = (Long) SessionUtil.getVlaue(token, SessionUtil.PARTY_ID); Long partyId = (Long) SessionUtil.getVlaue(token, SessionUtil.PARTY_ID);
bookBiz.delete(bookId, partyId); bookBiz.delete(bookId, partyId);
...@@ -130,8 +130,8 @@ public class BookFacadeImpl implements BookFacade { ...@@ -130,8 +130,8 @@ public class BookFacadeImpl implements BookFacade {
@Override @Override
@RequestMapping(value = "deletes", method = RequestMethod.GET) @RequestMapping(value = "deletes", method = RequestMethod.GET)
public ResponseDto<?> deletes(@RequestHeader("token") String token, public ResponseDto<?> deletes(@RequestHeader("token") String token,
@RequestParam(value = "bookIds", required = false) String bookIds) @RequestParam(value = "bookIds") String bookIds)
throws BizException, PermissionException, JsonParseException { throws BizException, PermissionException {
Long partyId = (Long) SessionUtil.getVlaue(token, SessionUtil.PARTY_ID); Long partyId = (Long) SessionUtil.getVlaue(token, SessionUtil.PARTY_ID);
bookBiz.deletes(bookIds, partyId); bookBiz.deletes(bookIds, partyId);
return new ResponseDto<>(); return new ResponseDto<>();
...@@ -143,9 +143,9 @@ public class BookFacadeImpl implements BookFacade { ...@@ -143,9 +143,9 @@ public class BookFacadeImpl implements BookFacade {
@Override @Override
@RequestMapping(value = "getById", method = RequestMethod.GET) @RequestMapping(value = "getById", method = RequestMethod.GET)
public ResponseDto<BookDto> getById(@RequestHeader("token") String token, public ResponseDto<BookDto> getById(@RequestHeader("token") String token,
@RequestParam(value = "bookId", required = false) Long bookId, @RequestParam(value = "bookId") Long bookId,
@RequestParam(value = "channelId", required = false) Long channelId) @RequestParam(value = "channelId") Long channelId)
throws BizException, PermissionException, JsonParseException { throws BizException, PermissionException {
Long adviserId = (Long) SessionUtil.getVlaue(token, SessionUtil.PARTY_ID); Long adviserId = (Long) SessionUtil.getVlaue(token, SessionUtil.PARTY_ID);
return new ResponseDto<>(bookBiz.getById(bookId, adviserId, channelId)); return new ResponseDto<>(bookBiz.getById(bookId, adviserId, channelId));
} }
...@@ -155,8 +155,8 @@ public class BookFacadeImpl implements BookFacade { ...@@ -155,8 +155,8 @@ public class BookFacadeImpl implements BookFacade {
*/ */
@Override @Override
@RequestMapping(value = "getBaseById", method = RequestMethod.GET) @RequestMapping(value = "getBaseById", method = RequestMethod.GET)
public ResponseDto<BookDto> getBaseById(@RequestParam(value = "bookId", required = false) Long bookId) public ResponseDto<BookDto> getBaseById(@RequestParam(value = "bookId") Long bookId)
throws BizException, PermissionException, JsonParseException { throws BizException {
return new ResponseDto<>(bookBiz.getBaseById(bookId)); return new ResponseDto<>(bookBiz.getBaseById(bookId));
} }
...@@ -167,9 +167,9 @@ public class BookFacadeImpl implements BookFacade { ...@@ -167,9 +167,9 @@ public class BookFacadeImpl implements BookFacade {
@RequestMapping(value = "isbnExists", method = RequestMethod.GET) @RequestMapping(value = "isbnExists", method = RequestMethod.GET)
public ResponseDto<Boolean> isbnExists(@RequestHeader("token") String token, public ResponseDto<Boolean> isbnExists(@RequestHeader("token") String token,
@RequestParam(value = "typeCode", required = false) String typeCode, @RequestParam(value = "typeCode", required = false) String typeCode,
@RequestParam(value = "isbn", required = false) String isbn, @RequestParam(value = "isbn") String isbn,
@RequestParam(value = "serialNumber", required = false) String serialNumber) @RequestParam(value = "serialNumber", required = false) String serialNumber)
throws BizException, PermissionException, JsonParseException { throws BizException, PermissionException {
SessionUtil.getVlaue(token, SessionUtil.PARTY_ID); SessionUtil.getVlaue(token, SessionUtil.PARTY_ID);
return new ResponseDto<>(bookBiz.isbnExists(typeCode, isbn, serialNumber)); return new ResponseDto<>(bookBiz.isbnExists(typeCode, isbn, serialNumber));
} }
...@@ -180,7 +180,7 @@ public class BookFacadeImpl implements BookFacade { ...@@ -180,7 +180,7 @@ public class BookFacadeImpl implements BookFacade {
@Override @Override
@RequestMapping(value = "isbnExistsOrGetInfo", method = RequestMethod.POST) @RequestMapping(value = "isbnExistsOrGetInfo", method = RequestMethod.POST)
public ResponseDto<BookDto> isbnExistsOrGetInfo(@RequestHeader("token") String token, @RequestBody Book book) public ResponseDto<BookDto> isbnExistsOrGetInfo(@RequestHeader("token") String token, @RequestBody Book book)
throws BizException, PermissionException, JsonParseException { throws BizException, PermissionException {
Long adviserId = (Long) SessionUtil.getVlaue(token, SessionUtil.PARTY_ID); Long adviserId = (Long) SessionUtil.getVlaue(token, SessionUtil.PARTY_ID);
book.setCreatedUser(adviserId); book.setCreatedUser(adviserId);
BookDto journalDto = bookBiz.isbnExistsOrGetInfo(book); BookDto journalDto = bookBiz.isbnExistsOrGetInfo(book);
...@@ -193,8 +193,8 @@ public class BookFacadeImpl implements BookFacade { ...@@ -193,8 +193,8 @@ public class BookFacadeImpl implements BookFacade {
@Override @Override
@RequestMapping(value = "isbnExistsOrGetInfo4Wechat", method = RequestMethod.POST) @RequestMapping(value = "isbnExistsOrGetInfo4Wechat", method = RequestMethod.POST)
public ResponseDto<BookDto> isbnExistsOrGetInfo4Wechat(@CookieValue("userInfo") String userInfo, public ResponseDto<BookDto> isbnExistsOrGetInfo4Wechat(@CookieValue("userInfo") String userInfo,
@RequestBody Book book) throws BizException, PermissionException, JsonParseException { @RequestBody Book book) throws BizException {
Long adviserId = (Long) Cookie.getId(userInfo, Cookie._PARTY_ID); Long adviserId = Cookie.getId(userInfo, Cookie._PARTY_ID);
book.setCreatedUser(adviserId); book.setCreatedUser(adviserId);
BookDto bookDto = bookBiz.isbnExistsOrGetInfo(book); BookDto bookDto = bookBiz.isbnExistsOrGetInfo(book);
if (bookDto == null) { if (bookDto == null) {
...@@ -209,9 +209,9 @@ public class BookFacadeImpl implements BookFacade { ...@@ -209,9 +209,9 @@ public class BookFacadeImpl implements BookFacade {
* 获取书籍列表(平台端) * 获取书籍列表(平台端)
*/ */
@Override @Override
@Permission(Code = ServerPermissionCode.book+"book/listPage") @Permission(Code = ServerPermissionCode.book + "book/listPage")
@RequestMapping(value = "listPage", method = RequestMethod.GET) @RequestMapping(value = "listPage", method = RequestMethod.GET)
public ResponseDto<?> getListPage(@RequestHeader("token") String token, public ResponseDto<PageBeanNew<BookDto>> getListPage(@RequestHeader("token") String token,
@RequestParam(value = "publish", required = false) String publish, @RequestParam(value = "publish", required = false) String publish,
@RequestParam(value = "fundName", required = false) String fundName, @RequestParam(value = "fundName", required = false) String fundName,
@RequestParam(value = "bookName", required = false) String bookName, @RequestParam(value = "bookName", required = false) String bookName,
...@@ -220,12 +220,12 @@ public class BookFacadeImpl implements BookFacade { ...@@ -220,12 +220,12 @@ public class BookFacadeImpl implements BookFacade {
@RequestParam(value = "isCurrentMonth", required = false) Integer isCurrentMonth, @RequestParam(value = "isCurrentMonth", required = false) Integer isCurrentMonth,
@RequestParam(value = "currentPage", required = false) Integer currentPage, @RequestParam(value = "currentPage", required = false) Integer currentPage,
@RequestParam(value = "numPerPage", required = false) Integer numPerPage) @RequestParam(value = "numPerPage", required = false) Integer numPerPage)
throws BizException, PermissionException, JsonParseException { throws BizException, PermissionException {
SessionUtil.getVlaue(token, SessionUtil.PARTY_ID); SessionUtil.getVlaue(token, SessionUtil.PARTY_ID);
if (currentPage == null || numPerPage == null || currentPage < 0 || numPerPage < 0) { if (currentPage == null || numPerPage == null || currentPage < 0 || numPerPage < 0) {
throw BookBizException.PAGE_PARAM_DELETION; throw BookBizException.PAGE_PARAM_DELETION;
} }
return new ResponseDto<PageBeanNew<BookDto>>(bookBiz.getListPage(isbn, bookName, publish, fundName, return new ResponseDto<>(bookBiz.getListPage(isbn, bookName, publish, fundName,
serialNumber, isCurrentMonth, currentPage, numPerPage)); serialNumber, isCurrentMonth, currentPage, numPerPage));
} }
...@@ -246,19 +246,19 @@ public class BookFacadeImpl implements BookFacade { ...@@ -246,19 +246,19 @@ public class BookFacadeImpl implements BookFacade {
@RequestParam(value = "isFundSupport", required = false) Integer isFundSupport, @RequestParam(value = "isFundSupport", required = false) Integer isFundSupport,
@RequestParam(value = "bookId", required = false) Integer bookId, @RequestParam(value = "bookId", required = false) Integer bookId,
@RequestParam(value = "templetId", required = false) Long templetId) @RequestParam(value = "templetId", required = false) Long templetId)
throws BizException, PermissionException, JsonParseException { throws BizException, PermissionException {
Long adviserId = (Long) SessionUtil.getVlaue(token, SessionUtil.PARTY_ID); Long adviserId = (Long) SessionUtil.getVlaue(token, SessionUtil.PARTY_ID);
if (currentPage == null || numPerPage == null || currentPage < 0 || numPerPage < 0) { if (currentPage == null || numPerPage == null || currentPage < 0 || numPerPage < 0) {
throw BookBizException.PAGE_PARAM_DELETION; throw BookBizException.PAGE_PARAM_DELETION;
} }
Map<String, Object> paramMap = new HashMap<String, Object>(); Map<String, Object> paramMap = new HashMap<>();
paramMap.put("adviserId", adviserId); paramMap.put("adviserId", adviserId);
paramMap.put("isMainEditor", isMainEditor); paramMap.put("isMainEditor", isMainEditor);
paramMap.put("isFundSupport", isFundSupport); paramMap.put("isFundSupport", isFundSupport);
paramMap.put("channelId", channelId); paramMap.put("channelId", channelId);
paramMap.put("bookName", bookName != null && "".equals(bookName.trim()) ? null : bookName);
paramMap.put("isbn", isbn != null && "".equals(isbn.trim()) ? null : isbn);
paramMap.put("name", name != null && "".equals(name.trim()) ? null : name); paramMap.put("name", name != null && "".equals(name.trim()) ? null : name);
paramMap.put("isbn", isbn != null && "".equals(isbn.trim()) ? null : isbn);
paramMap.put("bookName", bookName != null && "".equals(bookName.trim()) ? null : bookName);
paramMap.put("typeCode", typeCode != null && "".equals(typeCode.trim()) ? null : typeCode); paramMap.put("typeCode", typeCode != null && "".equals(typeCode.trim()) ? null : typeCode);
paramMap.put("bookId", bookId); paramMap.put("bookId", bookId);
paramMap.put("templetId", templetId); paramMap.put("templetId", templetId);
...@@ -268,10 +268,10 @@ public class BookFacadeImpl implements BookFacade { ...@@ -268,10 +268,10 @@ public class BookFacadeImpl implements BookFacade {
@GetMapping("getList4Adviser") @GetMapping("getList4Adviser")
@Override @Override
public ResponseDto<List<BookDto>> getList4Adviser(@RequestHeader("token") String token,@RequestParam(value = "num",required = true) Integer num) throws BizException, PermissionException, JsonParseException { public ResponseDto<List<BookDto>> getList4Adviser(@RequestHeader("token") String token, @RequestParam(value = "num") Integer num) throws BizException, PermissionException {
Long adviserId = (Long) SessionUtil.getVlaue(token, SessionUtil.PARTY_ID); Long adviserId = (Long) SessionUtil.getVlaue(token, SessionUtil.PARTY_ID);
List<BookDto> bookDtos = bookBiz.getList4Adviser(adviserId,num); List<BookDto> bookDtos = bookBiz.getList4Adviser(adviserId, num);
return new ResponseDto<>(ListUtils.isEmpty(bookDtos)? Lists.newArrayList():bookDtos); return new ResponseDto<>(ListUtils.isEmpty(bookDtos) ? Lists.newArrayList() : bookDtos);
} }
/** /**
...@@ -282,8 +282,8 @@ public class BookFacadeImpl implements BookFacade { ...@@ -282,8 +282,8 @@ public class BookFacadeImpl implements BookFacade {
public ResponseDto<BookDto> getDetailById(@CookieValue("userInfo") String userInfo, public ResponseDto<BookDto> getDetailById(@CookieValue("userInfo") String userInfo,
@RequestParam(value = "bookId", required = false) Long bookId, @RequestParam(value = "bookId", required = false) Long bookId,
@RequestParam(value = "adviserId", required = false) Long adviserId) @RequestParam(value = "adviserId", required = false) Long adviserId)
throws BizException, PermissionException, JsonParseException { throws BizException {
Long channelId = (Long) Cookie.getId(userInfo, Cookie._CHANNEL_ID); Long channelId = Cookie.getId(userInfo, Cookie._CHANNEL_ID);
BookDto bookDto = bookBiz.getDetailById(bookId, adviserId, channelId); BookDto bookDto = bookBiz.getDetailById(bookId, adviserId, channelId);
return new ResponseDto<>(bookDto == null ? new BookDto() : bookDto); return new ResponseDto<>(bookDto == null ? new BookDto() : bookDto);
} }
...@@ -294,9 +294,9 @@ public class BookFacadeImpl implements BookFacade { ...@@ -294,9 +294,9 @@ public class BookFacadeImpl implements BookFacade {
@Override @Override
@RequestMapping(value = "getById4Profit", method = RequestMethod.GET) @RequestMapping(value = "getById4Profit", method = RequestMethod.GET)
public ResponseDto<BookDto> getById4Profit(@RequestHeader("token") String token, public ResponseDto<BookDto> getById4Profit(@RequestHeader("token") String token,
@RequestParam(value = "bookId", required = false) Long bookId, @RequestParam(value = "bookId") Long bookId,
@RequestParam(value = "channelId", required = false) Long channelId) @RequestParam(value = "channelId") Long channelId)
throws BizException, PermissionException, JsonParseException { throws BizException, PermissionException {
Long adviserId = (Long) SessionUtil.getVlaue(token, SessionUtil.PARTY_ID); Long adviserId = (Long) SessionUtil.getVlaue(token, SessionUtil.PARTY_ID);
BookDto bookDto = bookBiz.getById4Profit(bookId, adviserId, channelId); BookDto bookDto = bookBiz.getById4Profit(bookId, adviserId, channelId);
return new ResponseDto<>(bookDto == null ? new BookDto() : bookDto); return new ResponseDto<>(bookDto == null ? new BookDto() : bookDto);
...@@ -308,7 +308,7 @@ public class BookFacadeImpl implements BookFacade { ...@@ -308,7 +308,7 @@ public class BookFacadeImpl implements BookFacade {
@Override @Override
@RequestMapping(value = "setBookAdviserRelation", method = RequestMethod.POST) @RequestMapping(value = "setBookAdviserRelation", method = RequestMethod.POST)
public ResponseDto<?> setBookAdviserRelation(@RequestHeader("token") String token, @RequestBody Book book) public ResponseDto<?> setBookAdviserRelation(@RequestHeader("token") String token, @RequestBody Book book)
throws BizException, PermissionException, JsonParseException { throws BizException, PermissionException {
Long adviserId = (Long) SessionUtil.getVlaue(token, SessionUtil.PARTY_ID); Long adviserId = (Long) SessionUtil.getVlaue(token, SessionUtil.PARTY_ID);
book.setCreatedUser(adviserId); book.setCreatedUser(adviserId);
bookBiz.setBookAdviserRelation(book); bookBiz.setBookAdviserRelation(book);
...@@ -321,8 +321,8 @@ public class BookFacadeImpl implements BookFacade { ...@@ -321,8 +321,8 @@ public class BookFacadeImpl implements BookFacade {
@Override @Override
@RequestMapping(value = "getBaseInfoById4Wechat", method = RequestMethod.GET) @RequestMapping(value = "getBaseInfoById4Wechat", method = RequestMethod.GET)
public ResponseDto<BookDto> getBaseInfoById4Wechat(@CookieValue("userInfo") String userInfo, public ResponseDto<BookDto> getBaseInfoById4Wechat(@CookieValue("userInfo") String userInfo,
@RequestParam(value = "bookId", required = false) Long bookId) @RequestParam(value = "bookId") Long bookId)
throws BizException, PermissionException, JsonParseException { throws BizException {
Cookie.getId(userInfo, Cookie._CHANNEL_ID); Cookie.getId(userInfo, Cookie._CHANNEL_ID);
BookDto bookDto = bookBiz.getBaseInfoById4Wechat(bookId); BookDto bookDto = bookBiz.getBaseInfoById4Wechat(bookId);
return new ResponseDto<>(bookDto == null ? new BookDto() : bookDto); return new ResponseDto<>(bookDto == null ? new BookDto() : bookDto);
...@@ -335,16 +335,16 @@ public class BookFacadeImpl implements BookFacade { ...@@ -335,16 +335,16 @@ public class BookFacadeImpl implements BookFacade {
@Override @Override
@RequestMapping(value = "getListPage4Wechat", method = RequestMethod.GET) @RequestMapping(value = "getListPage4Wechat", method = RequestMethod.GET)
public ResponseDto<PageBean> getListPage4Wechat(@CookieValue("userInfo") String userInfo, public ResponseDto<PageBean> getListPage4Wechat(@CookieValue("userInfo") String userInfo,
@RequestParam(value = "currentPage", required = false) Integer currentPage, @RequestParam(value = "currentPage") Integer currentPage,
@RequestParam(value = "numPerPage", required = false) Integer numPerPage, @RequestParam(value = "numPerPage") Integer numPerPage,
@RequestParam(value = "bookName", required = false) String bookName, @RequestParam(value = "bookName", required = false) String bookName,
@RequestParam(value = "channelId", required = false) Long channelId) @RequestParam(value = "channelId", required = false) Long channelId)
throws BizException, PermissionException, JsonParseException { throws BizException {
Long adviserId = (Long) Cookie.getId(userInfo, Cookie._PARTY_ID); Long adviserId = Cookie.getId(userInfo, Cookie._PARTY_ID);
if (currentPage == null || numPerPage == null || currentPage < 0 || numPerPage < 0) { if (currentPage == null || numPerPage == null || currentPage < 0 || numPerPage < 0) {
throw BookBizException.PAGE_PARAM_DELETION; throw BookBizException.PAGE_PARAM_DELETION;
} }
Map<String, Object> paramMap = new HashMap<String, Object>(); Map<String, Object> paramMap = new HashMap<>();
paramMap.put("adviserId", adviserId); paramMap.put("adviserId", adviserId);
paramMap.put("bookName", bookName); paramMap.put("bookName", bookName);
paramMap.put("channelId", channelId); paramMap.put("channelId", channelId);
...@@ -358,16 +358,16 @@ public class BookFacadeImpl implements BookFacade { ...@@ -358,16 +358,16 @@ public class BookFacadeImpl implements BookFacade {
@Override @Override
@RequestMapping(value = "getlistPage", method = RequestMethod.GET) @RequestMapping(value = "getlistPage", method = RequestMethod.GET)
public ResponseDto<PageBean> listPage(@RequestHeader("token") String token, public ResponseDto<PageBean> listPage(@RequestHeader("token") String token,
@RequestParam(value = "currentPage", required = false) Integer currentPage, @RequestParam(value = "currentPage") Integer currentPage,
@RequestParam(value = "numPerPage", required = false) Integer numPerPage, @RequestParam(value = "numPerPage") Integer numPerPage,
@RequestParam(value = "bookName", required = false) String bookName, @RequestParam(value = "bookName", required = false) String bookName,
@RequestParam(value = "channelId", required = false) Long channelId) @RequestParam(value = "channelId", required = false) Long channelId)
throws BizException, PermissionException, JsonParseException { throws BizException, PermissionException {
Long adviserId = (Long) SessionUtil.getVlaue(token, SessionUtil.PARTY_ID); Long adviserId = (Long) SessionUtil.getVlaue(token, SessionUtil.PARTY_ID);
if (currentPage == null || numPerPage == null || currentPage < 0 || numPerPage < 0) { if (currentPage == null || numPerPage == null || currentPage < 0 || numPerPage < 0) {
throw BookBizException.PAGE_PARAM_DELETION; throw BookBizException.PAGE_PARAM_DELETION;
} }
Map<String, Object> paramMap = new HashMap<String, Object>(); Map<String, Object> paramMap = new HashMap<>();
paramMap.put("adviserId", adviserId); paramMap.put("adviserId", adviserId);
paramMap.put("bookName", bookName); paramMap.put("bookName", bookName);
paramMap.put("channelId", channelId); paramMap.put("channelId", channelId);
...@@ -381,8 +381,8 @@ public class BookFacadeImpl implements BookFacade { ...@@ -381,8 +381,8 @@ public class BookFacadeImpl implements BookFacade {
@Override @Override
@RequestMapping(value = "setBookAdviserRelation4Wechat", method = RequestMethod.POST) @RequestMapping(value = "setBookAdviserRelation4Wechat", method = RequestMethod.POST)
public ResponseDto<?> setBookAdviserRelation4Wechat(@CookieValue("userInfo") String userInfo, public ResponseDto<?> setBookAdviserRelation4Wechat(@CookieValue("userInfo") String userInfo,
@RequestBody Book book) throws BizException, PermissionException, JsonParseException { @RequestBody Book book) throws BizException {
Long adviserId = (Long) Cookie.getId(userInfo, Cookie._PARTY_ID); Long adviserId = Cookie.getId(userInfo, Cookie._PARTY_ID);
book.setCreatedUser(adviserId); book.setCreatedUser(adviserId);
bookBiz.setBookAdviserRelation(book); bookBiz.setBookAdviserRelation(book);
return new ResponseDto<>(); return new ResponseDto<>();
...@@ -394,8 +394,8 @@ public class BookFacadeImpl implements BookFacade { ...@@ -394,8 +394,8 @@ public class BookFacadeImpl implements BookFacade {
@Override @Override
@RequestMapping(value = "create4Wechat", method = RequestMethod.POST) @RequestMapping(value = "create4Wechat", method = RequestMethod.POST)
public ResponseDto<BookDto> create4Wechat(@CookieValue("userInfo") String userInfo, @RequestBody Book book) public ResponseDto<BookDto> create4Wechat(@CookieValue("userInfo") String userInfo, @RequestBody Book book)
throws BizException, PermissionException, JsonParseException { throws BizException {
Long adviserId = (Long) Cookie.getId(userInfo, Cookie._PARTY_ID); Long adviserId = Cookie.getId(userInfo, Cookie._PARTY_ID);
String systemCode = (String) Cookie.getUserInfo(userInfo).get(Cookie._SYSTEM_CODE); String systemCode = (String) Cookie.getUserInfo(userInfo).get(Cookie._SYSTEM_CODE);
// 实体赋值 // 实体赋值
book.setCreatedUser(adviserId); book.setCreatedUser(adviserId);
...@@ -411,8 +411,8 @@ public class BookFacadeImpl implements BookFacade { ...@@ -411,8 +411,8 @@ public class BookFacadeImpl implements BookFacade {
@Override @Override
@RequestMapping(value = "update4Wechat", method = RequestMethod.POST) @RequestMapping(value = "update4Wechat", method = RequestMethod.POST)
public ResponseDto<BookDto> update4Wechat(@CookieValue("userInfo") String userInfo, @RequestBody Book book) public ResponseDto<BookDto> update4Wechat(@CookieValue("userInfo") String userInfo, @RequestBody Book book)
throws BizException, PermissionException, JsonParseException { throws BizException {
Long adviserId = (Long) Cookie.getId(userInfo, Cookie._PARTY_ID); Long adviserId = Cookie.getId(userInfo, Cookie._PARTY_ID);
// 实体赋值 // 实体赋值
book.setLastModifiedUser(adviserId); book.setLastModifiedUser(adviserId);
book.setCreatedUser(adviserId); book.setCreatedUser(adviserId);
...@@ -428,14 +428,14 @@ public class BookFacadeImpl implements BookFacade { ...@@ -428,14 +428,14 @@ public class BookFacadeImpl implements BookFacade {
public ResponseDto<?> getJournalPageByIsbn(@CookieValue("userInfo") String userInfo, public ResponseDto<?> getJournalPageByIsbn(@CookieValue("userInfo") String userInfo,
@RequestParam(value = "typeCode", required = false) String typeCode, @RequestParam(value = "typeCode", required = false) String typeCode,
@RequestParam(value = "isbn", required = false) String isbn, @RequestParam(value = "isbn", required = false) String isbn,
@RequestParam(value = "currentPage", required = false) Integer currentPage, @RequestParam(value = "currentPage") Integer currentPage,
@RequestParam(value = "numPerPage", required = false) Integer numPerPage) @RequestParam(value = "numPerPage") Integer numPerPage)
throws BizException, PermissionException, JsonParseException { throws BizException {
if (currentPage == null || numPerPage == null || currentPage < 0 || numPerPage < 0) { if (currentPage < 0 || numPerPage < 0) {
throw BookBizException.PAGE_PARAM_DELETION; throw BookBizException.PAGE_PARAM_DELETION;
} }
Long channelId = (Long) Cookie.getId(userInfo, Cookie._CHANNEL_ID); Long channelId = Cookie.getId(userInfo, Cookie._CHANNEL_ID);
Long wechatUserId = (Long) Cookie.getId(userInfo, Cookie._WECHAT_USER_ID); Long wechatUserId = Cookie.getId(userInfo, Cookie._WECHAT_USER_ID);
PageBean pageBean = bookBiz.getJournalPageByIsbn(new PageParam(currentPage, numPerPage), typeCode, isbn, PageBean pageBean = bookBiz.getJournalPageByIsbn(new PageParam(currentPage, numPerPage), typeCode, isbn,
channelId, wechatUserId); channelId, wechatUserId);
return new ResponseDto<>(pageBean); return new ResponseDto<>(pageBean);
...@@ -447,12 +447,12 @@ public class BookFacadeImpl implements BookFacade { ...@@ -447,12 +447,12 @@ public class BookFacadeImpl implements BookFacade {
@Override @Override
@RequestMapping(value = "listPage4Wechat", method = RequestMethod.GET) @RequestMapping(value = "listPage4Wechat", method = RequestMethod.GET)
public ResponseDto<PageBean> listPage4Wechat(@CookieValue("userInfo") String userInfo, public ResponseDto<PageBean> listPage4Wechat(@CookieValue("userInfo") String userInfo,
@RequestParam(value = "currentPage", required = false) Integer currentPage, @RequestParam(value = "currentPage") Integer currentPage,
@RequestParam(value = "numPerPage", required = false) Integer numPerPage) @RequestParam(value = "numPerPage") Integer numPerPage)
throws BizException, PermissionException, JsonParseException { throws BizException {
Long channelId = (Long) Cookie.getId(userInfo, Cookie._CHANNEL_ID); Long channelId = Cookie.getId(userInfo, Cookie._CHANNEL_ID);
Long wechatUserId = (Long) Cookie.getId(userInfo, Cookie._WECHAT_USER_ID); Long wechatUserId = Cookie.getId(userInfo, Cookie._WECHAT_USER_ID);
if (currentPage == null || numPerPage == null || currentPage < 0 || numPerPage < 0) { if (currentPage < 0 || numPerPage < 0) {
throw BookBizException.PAGE_PARAM_DELETION; throw BookBizException.PAGE_PARAM_DELETION;
} }
PageBean pageBean = bookBiz.listPage4Wechat(new PageParam(currentPage, numPerPage), channelId, wechatUserId); PageBean pageBean = bookBiz.listPage4Wechat(new PageParam(currentPage, numPerPage), channelId, wechatUserId);
...@@ -465,8 +465,8 @@ public class BookFacadeImpl implements BookFacade { ...@@ -465,8 +465,8 @@ public class BookFacadeImpl implements BookFacade {
@Override @Override
@RequestMapping(value = "listBook", method = RequestMethod.GET) @RequestMapping(value = "listBook", method = RequestMethod.GET)
public ResponseDto<List<Object>> listBook(@RequestHeader("token") String token, public ResponseDto<List<Object>> listBook(@RequestHeader("token") String token,
@RequestParam(value = "number", required = false) Integer number) @RequestParam(value = "number") Integer number)
throws BizException, PermissionException, JsonParseException { throws BizException, PermissionException {
Long adviserId = (Long) SessionUtil.getVlaue(token, SessionUtil.PARTY_ID); Long adviserId = (Long) SessionUtil.getVlaue(token, SessionUtil.PARTY_ID);
List<Object> books = bookBiz.listBook(adviserId, number); List<Object> books = bookBiz.listBook(adviserId, number);
return new ResponseDto<>(books); return new ResponseDto<>(books);
...@@ -481,18 +481,18 @@ public class BookFacadeImpl implements BookFacade { ...@@ -481,18 +481,18 @@ public class BookFacadeImpl implements BookFacade {
@RequestParam(value = "bookName", required = false) String bookName, @RequestParam(value = "bookName", required = false) String bookName,
@RequestParam(value = "channelId", required = false) Long channelId, @RequestParam(value = "channelId", required = false) Long channelId,
@RequestParam(value = "typeCode", required = false) String typeCode, @RequestParam(value = "typeCode", required = false) String typeCode,
@RequestParam(value = "currentPage", required = false) Integer currentPage, @RequestParam(value = "currentPage") Integer currentPage,
@RequestParam(value = "numPerPage", required = false) Integer numPerPage, @RequestParam(value = "numPerPage") Integer numPerPage,
@RequestParam(value = "mainEditorName", required = false) String mainEditorName, @RequestParam(value = "mainEditorName", required = false) String mainEditorName,
@RequestParam(value = "isFundSupport", required = false) Integer isFundSupport, @RequestParam(value = "isFundSupport", required = false) Integer isFundSupport,
@RequestParam(value = "isbn", required = false) String isbn, @RequestParam(value = "isbn", required = false) String isbn,
@RequestParam(value = "templetId", required = false) Long templetId) @RequestParam(value = "templetId", required = false) Long templetId)
throws BizException, PermissionException, JsonParseException { throws BizException, PermissionException {
Long agentId = (Long) SessionUtil.getVlaue(token, SessionUtil.PARTY_ID); Long agentId = (Long) SessionUtil.getVlaue(token, SessionUtil.PARTY_ID);
if (currentPage == null || numPerPage == null || currentPage < 0 || numPerPage < 0) { if (currentPage < 0 || numPerPage < 0) {
throw BookBizException.PAGE_PARAM_DELETION; throw BookBizException.PAGE_PARAM_DELETION;
} }
Map<String, Object> paramMap = new HashMap<String, Object>(); Map<String, Object> paramMap = new HashMap<>();
paramMap.put("bookName", bookName != null && "".equals(bookName.trim()) ? null : bookName); paramMap.put("bookName", bookName != null && "".equals(bookName.trim()) ? null : bookName);
paramMap.put("channelId", channelId); paramMap.put("channelId", channelId);
paramMap.put("typeCode", typeCode != null && "".equals(typeCode.trim()) ? null : typeCode); paramMap.put("typeCode", typeCode != null && "".equals(typeCode.trim()) ? null : typeCode);
...@@ -501,7 +501,7 @@ public class BookFacadeImpl implements BookFacade { ...@@ -501,7 +501,7 @@ public class BookFacadeImpl implements BookFacade {
paramMap.put("isFundSupport", isFundSupport); paramMap.put("isFundSupport", isFundSupport);
paramMap.put("isbn", isbn); paramMap.put("isbn", isbn);
paramMap.put("templetId", templetId); paramMap.put("templetId", templetId);
return new ResponseDto<PageBean>( return new ResponseDto<>(
bookBiz.listPage4Agent(new PageParam(currentPage, numPerPage), paramMap, agentId)); bookBiz.listPage4Agent(new PageParam(currentPage, numPerPage), paramMap, agentId));
} }
...@@ -514,7 +514,7 @@ public class BookFacadeImpl implements BookFacade { ...@@ -514,7 +514,7 @@ public class BookFacadeImpl implements BookFacade {
@RequestParam(value = "currentPage", required = false) Integer currentPage, @RequestParam(value = "currentPage", required = false) Integer currentPage,
@RequestParam(value = "numPerPage", required = false) Integer numPerPage, @RequestParam(value = "numPerPage", required = false) Integer numPerPage,
@RequestParam(value = "bookName", required = false) String bookName) @RequestParam(value = "bookName", required = false) String bookName)
throws BizException, PermissionException, JsonParseException { throws BizException, PermissionException {
Long adviserId = (Long) SessionUtil.getVlaue(token, SessionUtil.PARTY_ID); Long adviserId = (Long) SessionUtil.getVlaue(token, SessionUtil.PARTY_ID);
PageBean pageBean = bookBiz.listBook4App(adviserId, new PageParam(currentPage, numPerPage), bookName); PageBean pageBean = bookBiz.listBook4App(adviserId, new PageParam(currentPage, numPerPage), bookName);
return new ResponseDto<>(pageBean); return new ResponseDto<>(pageBean);
...@@ -526,7 +526,7 @@ public class BookFacadeImpl implements BookFacade { ...@@ -526,7 +526,7 @@ public class BookFacadeImpl implements BookFacade {
@Override @Override
@RequestMapping(value = "updateBookTemplet", method = RequestMethod.POST) @RequestMapping(value = "updateBookTemplet", method = RequestMethod.POST)
public ResponseDto<BookDto> updateBookTemplet(@RequestHeader("token") String token, @RequestBody Book book) public ResponseDto<BookDto> updateBookTemplet(@RequestHeader("token") String token, @RequestBody Book book)
throws BizException, PermissionException, JsonParseException { throws BizException, PermissionException {
Long adviserId = (Long) SessionUtil.getVlaue(token, SessionUtil.PARTY_ID); Long adviserId = (Long) SessionUtil.getVlaue(token, SessionUtil.PARTY_ID);
Long agentId = (Long) SessionUtil.getVlaue(token, SessionUtil.TENANT_ID); Long agentId = (Long) SessionUtil.getVlaue(token, SessionUtil.TENANT_ID);
BookDto bookDto = new BookDto(); BookDto bookDto = new BookDto();
...@@ -544,7 +544,7 @@ public class BookFacadeImpl implements BookFacade { ...@@ -544,7 +544,7 @@ public class BookFacadeImpl implements BookFacade {
public ResponseDto<List<BookDto>> listBookByAppId(@RequestHeader("token") String token, public ResponseDto<List<BookDto>> listBookByAppId(@RequestHeader("token") String token,
@RequestParam(value = "appId", required = false) Long appId, @RequestParam(value = "appId", required = false) Long appId,
@RequestParam(value = "channelId", required = false) Long channelId) @RequestParam(value = "channelId", required = false) Long channelId)
throws BizException, PermissionException, JsonParseException { throws BizException {
List<BookDto> bookDtos = bookBiz.listBookByAppId(appId, channelId); List<BookDto> bookDtos = bookBiz.listBookByAppId(appId, channelId);
return new ResponseDto<>(bookDtos == null ? new ArrayList<>() : bookDtos); return new ResponseDto<>(bookDtos == null ? new ArrayList<>() : bookDtos);
} }
...@@ -555,10 +555,10 @@ public class BookFacadeImpl implements BookFacade { ...@@ -555,10 +555,10 @@ public class BookFacadeImpl implements BookFacade {
@Override @Override
@RequestMapping(value = "getById4Agent", method = RequestMethod.GET) @RequestMapping(value = "getById4Agent", method = RequestMethod.GET)
public ResponseDto<BookDto> getById4Agent(@RequestHeader("token") String token, public ResponseDto<BookDto> getById4Agent(@RequestHeader("token") String token,
@RequestParam(value = "bookId", required = false) Long bookId, @RequestParam(value = "bookId") Long bookId,
@RequestParam(value = "channelId", required = false) Long channelId, @RequestParam(value = "channelId", required = false) Long channelId,
@RequestParam(value = "adviserId", required = false) Long adviserId) @RequestParam(value = "adviserId", required = false) Long adviserId)
throws BizException, PermissionException, JsonParseException { throws BizException {
return new ResponseDto<>(bookBiz.getById(bookId, adviserId, channelId)); return new ResponseDto<>(bookBiz.getById(bookId, adviserId, channelId));
} }
...@@ -568,11 +568,11 @@ public class BookFacadeImpl implements BookFacade { ...@@ -568,11 +568,11 @@ public class BookFacadeImpl implements BookFacade {
@Override @Override
@RequestMapping(value = "listPageDelete4Adviser", method = RequestMethod.GET) @RequestMapping(value = "listPageDelete4Adviser", method = RequestMethod.GET)
public ResponseDto<PageBean> listPageDelete4Adviser(@RequestHeader("token") String token, public ResponseDto<PageBean> listPageDelete4Adviser(@RequestHeader("token") String token,
@RequestParam(value = "currentPage", required = false) Integer currentPage, @RequestParam(value = "currentPage") Integer currentPage,
@RequestParam(value = "numPerPage", required = false) Integer numPerPage) @RequestParam(value = "numPerPage") Integer numPerPage)
throws BizException, PermissionException, JsonParseException { throws BizException, PermissionException {
Long adviserId = (Long) SessionUtil.getVlaue(token, SessionUtil.PARTY_ID); Long adviserId = (Long) SessionUtil.getVlaue(token, SessionUtil.PARTY_ID);
if (currentPage == null || numPerPage == null || currentPage < 0 || numPerPage < 0) { if (currentPage < 0 || numPerPage < 0) {
throw BookBizException.PAGE_PARAM_DELETION; throw BookBizException.PAGE_PARAM_DELETION;
} }
PageBean pageBean = bookBiz.listPageDelete4Adviser(adviserId, new PageParam(currentPage, numPerPage)); PageBean pageBean = bookBiz.listPageDelete4Adviser(adviserId, new PageParam(currentPage, numPerPage));
...@@ -586,9 +586,9 @@ public class BookFacadeImpl implements BookFacade { ...@@ -586,9 +586,9 @@ public class BookFacadeImpl implements BookFacade {
@Deprecated @Deprecated
@RequestMapping(value = "getCount4BookAssoc", method = RequestMethod.GET) @RequestMapping(value = "getCount4BookAssoc", method = RequestMethod.GET)
public ResponseDto<BookAssocCount> getCount4BookAssoc(@RequestHeader("token") String token, public ResponseDto<BookAssocCount> getCount4BookAssoc(@RequestHeader("token") String token,
@RequestParam(value = "bookId", required = false) Long bookId, @RequestParam(value = "bookId") Long bookId,
@RequestParam(value = "channelId", required = false) Long channelId) @RequestParam(value = "channelId", required = false) Long channelId)
throws BizException, PermissionException, JsonParseException { throws BizException, PermissionException {
Long adviserId = (Long) SessionUtil.getVlaue(token, SessionUtil.PARTY_ID); Long adviserId = (Long) SessionUtil.getVlaue(token, SessionUtil.PARTY_ID);
BookAssocCount bookAssocCount = bookBiz.getCount4BookAssoc(bookId, channelId, adviserId); BookAssocCount bookAssocCount = bookBiz.getCount4BookAssoc(bookId, channelId, adviserId);
return new ResponseDto<>(bookAssocCount); return new ResponseDto<>(bookAssocCount);
...@@ -600,7 +600,7 @@ public class BookFacadeImpl implements BookFacade { ...@@ -600,7 +600,7 @@ public class BookFacadeImpl implements BookFacade {
@Override @Override
@RequestMapping(value = "exportBookToExcel", method = RequestMethod.GET) @RequestMapping(value = "exportBookToExcel", method = RequestMethod.GET)
public ResponseDto<?> exportBookToExcel(@RequestHeader("token") String token) public ResponseDto<?> exportBookToExcel(@RequestHeader("token") String token)
throws PermissionException, JsonParseException, BizException { throws PermissionException, BizException {
Long agentId = (Long) SessionUtil.getVlaue(token, SessionUtil.PARTY_ID); Long agentId = (Long) SessionUtil.getVlaue(token, SessionUtil.PARTY_ID);
bookBiz.exportBookToExcel(agentId); bookBiz.exportBookToExcel(agentId);
return new ResponseDto<>(); return new ResponseDto<>();
...@@ -610,7 +610,7 @@ public class BookFacadeImpl implements BookFacade { ...@@ -610,7 +610,7 @@ public class BookFacadeImpl implements BookFacade {
* 图书列表(平台端) * 图书列表(平台端)
*/ */
@Override @Override
@Permission(Code = ServerPermissionCode.book+"book/listBookClassify") @Permission(Code = ServerPermissionCode.book + "book/listBookClassify")
@RequestMapping(value = "listBookClassify", method = RequestMethod.GET) @RequestMapping(value = "listBookClassify", method = RequestMethod.GET)
public ResponseDto<PageBean> listBookClassify(@RequestHeader("token") String token, public ResponseDto<PageBean> listBookClassify(@RequestHeader("token") String token,
@RequestParam(value = "typeCode", required = false) String typeCode, @RequestParam(value = "typeCode", required = false) String typeCode,
...@@ -618,9 +618,9 @@ public class BookFacadeImpl implements BookFacade { ...@@ -618,9 +618,9 @@ public class BookFacadeImpl implements BookFacade {
@RequestParam(value = "startDate", required = false) String startDate, @RequestParam(value = "startDate", required = false) String startDate,
@RequestParam(value = "endDate", required = false) String endDate, @RequestParam(value = "endDate", required = false) String endDate,
@RequestParam(value = "bookName", required = false) String bookName, @RequestParam(value = "bookName", required = false) String bookName,
@RequestParam(value = "currentPage", required = true) Integer currentPage, @RequestParam(value = "currentPage") Integer currentPage,
@RequestParam(value = "numPerPage", required = true) Integer numPerPage) @RequestParam(value = "numPerPage") Integer numPerPage)
throws BizException, PermissionException, JsonParseException { throws BizException, PermissionException {
SessionUtil.getVlaue(token, SessionUtil.PARTY_ID); SessionUtil.getVlaue(token, SessionUtil.PARTY_ID);
if (currentPage == null || numPerPage == null || currentPage < 0 || numPerPage < 0) { if (currentPage == null || numPerPage == null || currentPage < 0 || numPerPage < 0) {
throw BookBizException.PAGE_PARAM_DELETION; throw BookBizException.PAGE_PARAM_DELETION;
...@@ -641,7 +641,7 @@ public class BookFacadeImpl implements BookFacade { ...@@ -641,7 +641,7 @@ public class BookFacadeImpl implements BookFacade {
@Override @Override
@RequestMapping(value = "exportBookToExcel4Platform", method = RequestMethod.GET) @RequestMapping(value = "exportBookToExcel4Platform", method = RequestMethod.GET)
public ResponseDto<?> exportBookToExcel4Platform(@RequestHeader("token") String token) public ResponseDto<?> exportBookToExcel4Platform(@RequestHeader("token") String token)
throws PermissionException, JsonParseException, BizException { throws PermissionException, BizException {
SessionUtil.getVlaue(token, SessionUtil.PARTY_ID); SessionUtil.getVlaue(token, SessionUtil.PARTY_ID);
bookBiz.exportBookToExcel4Platform(); bookBiz.exportBookToExcel4Platform();
return new ResponseDto<>(); return new ResponseDto<>();
...@@ -655,10 +655,9 @@ public class BookFacadeImpl implements BookFacade { ...@@ -655,10 +655,9 @@ public class BookFacadeImpl implements BookFacade {
public ResponseDto<BookDto> getByIsbnAndTypeCode(@RequestHeader("token") String token, public ResponseDto<BookDto> getByIsbnAndTypeCode(@RequestHeader("token") String token,
@RequestParam(value = "isbn") String isbn, @RequestParam(value = "isbn") String isbn,
@RequestParam(value = "typeCode") String typeCode) @RequestParam(value = "typeCode") String typeCode)
throws BizException, PermissionException, JsonParseException { throws BizException {
SessionUtil.getVlaue(token, SessionUtil.PARTY_ID);
BookDto bookDto = bookBiz.getByIsbnAndTypeCode(isbn, typeCode); BookDto bookDto = bookBiz.getByIsbnAndTypeCode(isbn, typeCode);
return new ResponseDto<>(bookDto == null ? new BookDto(): bookDto); return new ResponseDto<>(bookDto == null ? new BookDto() : bookDto);
} }
/** /**
...@@ -667,7 +666,7 @@ public class BookFacadeImpl implements BookFacade { ...@@ -667,7 +666,7 @@ public class BookFacadeImpl implements BookFacade {
@Override @Override
@RequestMapping(value = "create4Adviser", method = RequestMethod.POST) @RequestMapping(value = "create4Adviser", method = RequestMethod.POST)
public ResponseDto<BookDto> create4Adviser(@RequestHeader("token") String token, @RequestBody Book book) public ResponseDto<BookDto> create4Adviser(@RequestHeader("token") String token, @RequestBody Book book)
throws BizException, PermissionException, JsonParseException { throws BizException, PermissionException {
Long adviserId = (Long) SessionUtil.getVlaue(token, SessionUtil.PARTY_ID); Long adviserId = (Long) SessionUtil.getVlaue(token, SessionUtil.PARTY_ID);
Long agentId = (Long) SessionUtil.getVlaue(token, SessionUtil.TENANT_ID); Long agentId = (Long) SessionUtil.getVlaue(token, SessionUtil.TENANT_ID);
// 实体赋值 // 实体赋值
...@@ -691,7 +690,7 @@ public class BookFacadeImpl implements BookFacade { ...@@ -691,7 +690,7 @@ public class BookFacadeImpl implements BookFacade {
@Override @Override
@RequestMapping(value = "updateBookAndBookType", method = RequestMethod.POST) @RequestMapping(value = "updateBookAndBookType", method = RequestMethod.POST)
public ResponseDto<?> updateBookAndBookType(@RequestHeader("token") String token, @RequestBody Book book) public ResponseDto<?> updateBookAndBookType(@RequestHeader("token") String token, @RequestBody Book book)
throws BizException, PermissionException, JsonParseException { throws BizException, PermissionException {
Long adviserId = (Long) SessionUtil.getVlaue(token, SessionUtil.PARTY_ID); Long adviserId = (Long) SessionUtil.getVlaue(token, SessionUtil.PARTY_ID);
// 实体赋值 // 实体赋值
book.setLastModifiedUser(adviserId); book.setLastModifiedUser(adviserId);
...@@ -702,9 +701,9 @@ public class BookFacadeImpl implements BookFacade { ...@@ -702,9 +701,9 @@ public class BookFacadeImpl implements BookFacade {
@Override @Override
@RequestMapping(value = "checkISBN4App", method = RequestMethod.GET) @RequestMapping(value = "checkISBN4App", method = RequestMethod.GET)
public ResponseDto<Boolean> checkISBN4App(@RequestHeader("token") String token, public ResponseDto<Boolean> checkISBN4App(@RequestHeader("token") String token,
@RequestParam(value = "isbn", required = true) String isbn) throws PermissionException { @RequestParam(value = "isbn") String isbn) throws PermissionException {
SessionUtil.getVlaue(token, SessionUtil.PARTY_ID); SessionUtil.getVlaue(token, SessionUtil.PARTY_ID);
Boolean bool=bookBiz.checkISBN4App(isbn); Boolean bool = bookBiz.checkISBN4App(isbn);
return new ResponseDto<>(bool); return new ResponseDto<>(bool);
} }
...@@ -713,12 +712,12 @@ public class BookFacadeImpl implements BookFacade { ...@@ -713,12 +712,12 @@ public class BookFacadeImpl implements BookFacade {
*/ */
@Override @Override
@GetMapping("getBookListByChannelId4Adviser") @GetMapping("getBookListByChannelId4Adviser")
public ResponseDto<PageBean> getBookListByChannelId4Adviser(@RequestHeader("token") String token, @RequestParam(value = public ResponseDto<PageBean> getBookListByChannelId4Adviser(@RequestHeader("token") String token,
"currentPage", required = true) Integer currentPage, @RequestParam(value = "numPerPage", required = true) @RequestParam(value = "currentPage") Integer currentPage,
Integer numPerPage, @RequestParam(value = "channelId", required = true) Long channelId) throws @RequestParam(value = "numPerPage") Integer numPerPage,
PermissionException, JsonParseException, BizException { @RequestParam(value = "channelId") Long channelId) throws PermissionException, BizException {
Long partyId = (Long) SessionUtil.getVlaue(token,SessionUtil.PARTY_ID); Long partyId = (Long) SessionUtil.getVlaue(token, SessionUtil.PARTY_ID);
PageParam pageParam = new PageParam(currentPage,numPerPage); PageParam pageParam = new PageParam(currentPage, numPerPage);
return new ResponseDto<PageBean>(bookBiz.getBookBaseInfoListByChannelId4Adviser(partyId,channelId,pageParam)); return new ResponseDto<>(bookBiz.getBookBaseInfoListByChannelId4Adviser(partyId, channelId, pageParam));
} }
} }
...@@ -3,6 +3,17 @@ ...@@ -3,6 +3,17 @@
*/ */
package com.pcloud.book.book.service.impl; package com.pcloud.book.book.service.impl;
import java.util.List;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.RequestBody;
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;
import com.pcloud.book.book.biz.BookBiz; import com.pcloud.book.book.biz.BookBiz;
import com.pcloud.book.book.dto.BookAdviserUpdateTimeDTO; import com.pcloud.book.book.dto.BookAdviserUpdateTimeDTO;
import com.pcloud.book.book.dto.BookDetialDTO; import com.pcloud.book.book.dto.BookDetialDTO;
...@@ -11,12 +22,6 @@ import com.pcloud.book.book.service.BookService; ...@@ -11,12 +22,6 @@ import com.pcloud.book.book.service.BookService;
import com.pcloud.common.dto.ResponseDto; import com.pcloud.common.dto.ResponseDto;
import com.pcloud.common.exceptions.BizException; import com.pcloud.common.exceptions.BizException;
import com.pcloud.common.utils.ResponseHandleUtil; import com.pcloud.common.utils.ResponseHandleUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import java.util.List;
import java.util.Map;
/** /**
* @描述: * @描述:
......
...@@ -18,7 +18,15 @@ import com.pcloud.book.book.biz.BookFundBiz; ...@@ -18,7 +18,15 @@ import com.pcloud.book.book.biz.BookFundBiz;
import com.pcloud.book.book.dao.BookAdviserDao; import com.pcloud.book.book.dao.BookAdviserDao;
import com.pcloud.book.book.dao.BookFreezeDao; import com.pcloud.book.book.dao.BookFreezeDao;
import com.pcloud.book.book.dao.BookTypeDao; import com.pcloud.book.book.dao.BookTypeDao;
import com.pcloud.book.book.dto.*; import com.pcloud.book.book.dto.AdviserManageDto;
import com.pcloud.book.book.dto.BookAdviserDto;
import com.pcloud.book.book.dto.BookAppDto;
import com.pcloud.book.book.dto.BookDeleteDto;
import com.pcloud.book.book.dto.BookDto;
import com.pcloud.book.book.dto.BookFreezeDto;
import com.pcloud.book.book.dto.BookProductDto;
import com.pcloud.book.book.dto.BookResourceDto;
import com.pcloud.book.book.dto.BookTypeDto;
import com.pcloud.book.book.entity.BookDefendant; import com.pcloud.book.book.entity.BookDefendant;
import com.pcloud.book.book.tools.BookTools; import com.pcloud.book.book.tools.BookTools;
import com.pcloud.book.consumer.analysisengine.BookScanCountConsr; import com.pcloud.book.consumer.analysisengine.BookScanCountConsr;
...@@ -237,6 +245,7 @@ public class BookSet { ...@@ -237,6 +245,7 @@ public class BookSet {
LOGGER.info("【书刊基础】批量填充顾问名称,<END>"); LOGGER.info("【书刊基础】批量填充顾问名称,<END>");
} }
/** /**
* 批量填充顾问名称 * 批量填充顾问名称
*/ */
......
...@@ -3,15 +3,6 @@ ...@@ -3,15 +3,6 @@
*/ */
package com.pcloud.book.consumer.channel; package com.pcloud.book.consumer.channel;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Component;
import com.pcloud.book.base.exception.BookBizException; import com.pcloud.book.base.exception.BookBizException;
import com.pcloud.channelcenter.qrcode.dto.DefaultTempletQrcode; import com.pcloud.channelcenter.qrcode.dto.DefaultTempletQrcode;
......
...@@ -3,6 +3,8 @@ ...@@ -3,6 +3,8 @@
*/ */
package com.pcloud.book.consumer.user; package com.pcloud.book.consumer.user;
import com.pcloud.common.dto.ResponseDto;
import com.pcloud.usercenter.party.agent.entity.Agent;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -10,10 +12,8 @@ import org.springframework.http.ResponseEntity; ...@@ -10,10 +12,8 @@ import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import com.pcloud.channelcenter.base.exceptions.ChannelBizException; import com.pcloud.channelcenter.base.exceptions.ChannelBizException;
import com.pcloud.common.dto.ResponseDto;
import com.pcloud.common.exceptions.BizException; import com.pcloud.common.exceptions.BizException;
import com.pcloud.common.utils.ResponseHandleUtil; import com.pcloud.common.utils.ResponseHandleUtil;
import com.pcloud.usercenter.party.agent.entity.Agent;
import com.pcloud.usercenter.party.agent.service.AgentService; import com.pcloud.usercenter.party.agent.service.AgentService;
/** /**
......
package com.pcloud.book.mq.producer;
import com.pcloud.book.book.dto.BookCoverImgUpdateDTO;
public interface BookMQProducer {
void sendUpdateBookCoverImgTopic(BookCoverImgUpdateDTO bookCoverImgUpdateDTO);
}
package com.pcloud.book.mq.producer.impl;
import com.pcloud.book.book.dto.BookCoverImgUpdateDTO;
import com.pcloud.book.mq.producer.BookMQProducer;
import com.pcloud.common.core.constant.MQTopicProducer;
import org.springframework.amqp.core.AmqpTemplate;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
@Component("bookMQProducer")
public class BookProducerImpl implements BookMQProducer {
@Resource
private AmqpTemplate amqpTemplate;
@Override
public void sendUpdateBookCoverImgTopic(BookCoverImgUpdateDTO bookCoverImgUpdateDTO) {
amqpTemplate.convertAndSend(MQTopicProducer.EXCHAGE, MQTopicProducer.UPDATE_BOOK_COVERIMG, bookCoverImgUpdateDTO);
}
}
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