Commit 348a8dde by 裴大威

feat 1002819

parent 1a4dd573
......@@ -623,7 +623,8 @@ public interface BookBiz {
/**
* 获取编辑书刊H5
*/
PageBeanNew<BookDto> getAdviserBooks4H5(String keyword, Long templetId, Long secondTempletId, Integer currentPage, Integer numPerPage);
PageBeanNew<BookDto> getAdviserBooks4H5(String grayStatus, String keyword, Long templetId, Long secondTempletId, Integer currentPage,
Integer numPerPage);
/**
*运营端获取书刊及配置资源
......
......@@ -1964,8 +1964,10 @@ public class BookBizImpl implements BookBiz {
@ParamLog("获取编辑书刊H5")
@Override
public PageBeanNew<BookDto> getAdviserBooks4H5(String keyword, Long templetId, Long secondTempletId, Integer currentPage, Integer numPerPage) {
Page<ESBookAndAdviser> esPage = esBookAndAdviserBiz.getAdviserBooks4ES(keyword, templetId, secondTempletId, currentPage, numPerPage);
public PageBeanNew<BookDto> getAdviserBooks4H5(String grayStatus, String keyword, Long templetId, Long secondTempletId,
Integer currentPage, Integer numPerPage) {
Page<ESBookAndAdviser> esPage = esBookAndAdviserBiz.getAdviserBooks4ES(StringUtils.isEmpty(grayStatus) ? "0" : grayStatus,keyword
, templetId, secondTempletId, currentPage, numPerPage);
List<ESBookAndAdviser> esBookAndAdvisers=esPage.getContent();
if (ListUtils.isEmpty(esBookAndAdvisers)){
return new PageBeanNew<>();
......
......@@ -695,6 +695,7 @@ public interface BookFacade {
@ApiOperation("获取书刊列表H5")
@GetMapping("getAdviserBooks4H5")
ResponseDto<?> getAdviserBooks4H5(
@RequestHeader(value = "Gray-Status") String grayStatus,
@RequestParam(value = "keyword", required = false) String keyword,
@RequestParam(value = "templetId", required = false) Long templetId,
@RequestParam(value = "secondTempletId", required = false) Long secondTempletId,
......
......@@ -4,6 +4,7 @@
package com.pcloud.book.book.facade.impl;
import com.google.common.collect.Lists;
import com.pcloud.book.base.exception.BookBizException;
import com.pcloud.book.book.biz.BookBiz;
import com.pcloud.book.book.dto.AdviserBookInfoDTO;
......@@ -31,7 +32,9 @@ import com.pcloud.common.utils.cookie.Cookie;
import com.pcloud.common.utils.string.StringUtil;
import com.pcloud.wechatgroup.message.enums.IsSystem;
import io.swagger.annotations.ApiOperation;
import org.codehaus.jackson.JsonParseException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CookieValue;
......@@ -67,7 +70,7 @@ public class BookFacadeImpl implements BookFacade {
*/
@Override
@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 {
Long adviserId = (Long) SessionUtil.getVlaue(token, SessionUtil.PARTY_ID);
Long agentId = (Long) SessionUtil.getVlaue(token, SessionUtil.TENANT_ID);
......@@ -84,7 +87,7 @@ public class BookFacadeImpl implements BookFacade {
*/
@Override
@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 {
Long adviserId = (Long) SessionUtil.getVlaue(token, SessionUtil.PARTY_ID);
// 实体赋值
......@@ -98,7 +101,7 @@ public class BookFacadeImpl implements BookFacade {
*/
@Override
@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 {
Long adviserId = (Long) SessionUtil.getVlaue(token, SessionUtil.PARTY_ID);
// 实体赋值
......@@ -112,7 +115,7 @@ public class BookFacadeImpl implements BookFacade {
*/
@Override
@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 {
Long adviserId = (Long) SessionUtil.getVlaue(token, SessionUtil.PARTY_ID);
// 实体赋值
......@@ -129,8 +132,8 @@ public class BookFacadeImpl implements BookFacade {
*/
@Override
@RequestMapping(value = "delete", method = RequestMethod.GET)
public ResponseDto<?> delete(@RequestHeader("token") String token,
@RequestParam(value = "bookId") Long bookId)
public ResponseDto<?> delete( @RequestHeader("token") String token,
@RequestParam(value = "bookId") Long bookId )
throws BizException, PermissionException {
// token
Long partyId = (Long) SessionUtil.getVlaue(token, SessionUtil.PARTY_ID);
......@@ -143,8 +146,8 @@ public class BookFacadeImpl implements BookFacade {
*/
@Override
@RequestMapping(value = "deletes", method = RequestMethod.GET)
public ResponseDto<?> deletes(@RequestHeader("token") String token,
@RequestParam(value = "bookIds") String bookIds)
public ResponseDto<?> deletes( @RequestHeader("token") String token,
@RequestParam(value = "bookIds") String bookIds )
throws BizException, PermissionException {
Long partyId = (Long) SessionUtil.getVlaue(token, SessionUtil.PARTY_ID);
bookBiz.deletes(bookIds, partyId);
......@@ -156,9 +159,9 @@ public class BookFacadeImpl implements BookFacade {
*/
@Override
@RequestMapping(value = "getById", method = RequestMethod.GET)
public ResponseDto<BookDto> getById(@RequestHeader("token") String token,
@RequestParam(value = "bookId") Long bookId,
@RequestParam(value = "channelId") Long channelId)
public ResponseDto<BookDto> getById( @RequestHeader("token") String token,
@RequestParam(value = "bookId") Long bookId,
@RequestParam(value = "channelId") Long channelId )
throws BizException, PermissionException {
Long adviserId = (Long) SessionUtil.getVlaue(token, SessionUtil.PARTY_ID);
return new ResponseDto<>(bookBiz.getById(bookId, adviserId, channelId));
......@@ -169,7 +172,7 @@ public class BookFacadeImpl implements BookFacade {
*/
@Override
@RequestMapping(value = "getBaseById", method = RequestMethod.GET)
public ResponseDto<BookDto> getBaseById(@RequestParam(value = "bookId") Long bookId)
public ResponseDto<BookDto> getBaseById( @RequestParam(value = "bookId") Long bookId )
throws BizException {
return new ResponseDto<>(bookBiz.getBaseById(bookId));
}
......@@ -179,10 +182,10 @@ public class BookFacadeImpl implements BookFacade {
*/
@Override
@RequestMapping(value = "isbnExists", method = RequestMethod.GET)
public 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)
public 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 {
SessionUtil.getVlaue(token, SessionUtil.PARTY_ID);
return new ResponseDto<>(bookBiz.isbnExists(typeCode, isbn, serialNumber));
......@@ -193,7 +196,7 @@ public class BookFacadeImpl implements BookFacade {
*/
@Override
@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 {
Long adviserId = (Long) SessionUtil.getVlaue(token, SessionUtil.PARTY_ID);
book.setCreatedUser(adviserId);
......@@ -206,8 +209,8 @@ public class BookFacadeImpl implements BookFacade {
*/
@Override
@RequestMapping(value = "isbnExistsOrGetInfo4Wechat", method = RequestMethod.POST)
public ResponseDto<BookDto> isbnExistsOrGetInfo4Wechat(@CookieValue("userInfo") String userInfo,
@RequestBody Book book) throws BizException {
public ResponseDto<BookDto> isbnExistsOrGetInfo4Wechat( @CookieValue("userInfo") String userInfo,
@RequestBody Book book ) throws BizException {
Long adviserId = Cookie.getId(userInfo, Cookie._PARTY_ID);
book.setCreatedUser(adviserId);
BookDto bookDto = bookBiz.isbnExistsOrGetInfo(book);
......@@ -225,15 +228,15 @@ public class BookFacadeImpl implements BookFacade {
@Override
@Permission(Code = ServerPermissionCode.book + "book/listPage")
@RequestMapping(value = "listPage", method = RequestMethod.GET)
public ResponseDto<PageBeanNew<BookDto>> 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)
public ResponseDto<PageBeanNew<BookDto>> 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 {
SessionUtil.getVlaue(token, SessionUtil.PARTY_ID);
if (currentPage == null || numPerPage == null || currentPage < 0 || numPerPage < 0) {
......@@ -248,22 +251,22 @@ public class BookFacadeImpl implements BookFacade {
*/
@Override
@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,
@RequestParam(value = "bookStatus", required = false) Integer bookStatus,
@RequestParam(value = "secondTempletId",required = false) Long secondTempletId,
@RequestParam(value = "hasQrcode",required = false) Integer hasQrcode,
@RequestParam(value = "isPrint", required = false) Boolean isPrint)
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,
@RequestParam(value = "bookStatus", required = false) Integer bookStatus,
@RequestParam(value = "secondTempletId", required = false) Long secondTempletId,
@RequestParam(value = "hasQrcode", required = false) Integer hasQrcode,
@RequestParam(value = "isPrint", required = false) Boolean isPrint )
throws BizException, PermissionException {
Long adviserId = (Long) SessionUtil.getVlaue(token, SessionUtil.PARTY_ID);
if (currentPage == null || numPerPage == null || currentPage < 0 || numPerPage < 0) {
......@@ -281,7 +284,7 @@ public class BookFacadeImpl implements BookFacade {
paramMap.put("bookId", bookId);
paramMap.put("templetId", templetId);
paramMap.put("bookStatus", bookStatus);
paramMap.put("secondTempletId",secondTempletId);
paramMap.put("secondTempletId", secondTempletId);
paramMap.put("secondTempletIds", Optional.ofNullable(paramMap.get("secondTempletId")).map(Lists::newArrayList).orElse(Lists.newArrayList()));
paramMap.put("isPrint", isPrint);
PageBean pageBean = bookBiz.getListPage4Adviser(paramMap, new PageParam(currentPage, numPerPage), adviserId, hasQrcode);
......@@ -290,8 +293,8 @@ public class BookFacadeImpl implements BookFacade {
@GetMapping("getList4Adviser")
@Override
public ResponseDto<List<BookDto>> getList4Adviser(@RequestHeader("token") String token, @RequestParam(value = "num") Integer num,
@RequestParam(value = "isPrint", required = false) Boolean isPrint) throws BizException, PermissionException {
public ResponseDto<List<BookDto>> getList4Adviser( @RequestHeader("token") String token, @RequestParam(value = "num") Integer num,
@RequestParam(value = "isPrint", required = false) Boolean isPrint ) throws BizException, PermissionException {
Long adviserId = (Long) SessionUtil.getVlaue(token, SessionUtil.PARTY_ID);
List<BookDto> bookDtos = bookBiz.getList4Adviser(adviserId, num, isPrint);
return new ResponseDto<>(ListUtils.isEmpty(bookDtos) ? Lists.newArrayList() : bookDtos);
......@@ -302,9 +305,9 @@ public class BookFacadeImpl implements BookFacade {
*/
@Override
@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)
public ResponseDto<BookDto> getDetailById( @CookieValue("userInfo") String userInfo,
@RequestParam(value = "bookId", required = false) Long bookId,
@RequestParam(value = "adviserId", required = false) Long adviserId )
throws BizException {
Long channelId = Cookie.getId(userInfo, Cookie._CHANNEL_ID);
BookDto bookDto = bookBiz.getDetailById(bookId, adviserId, channelId);
......@@ -316,9 +319,9 @@ public class BookFacadeImpl implements BookFacade {
*/
@Override
@RequestMapping(value = "getById4Profit", method = RequestMethod.GET)
public ResponseDto<BookDto> getById4Profit(@RequestHeader("token") String token,
@RequestParam(value = "bookId") Long bookId,
@RequestParam(value = "channelId") Long channelId)
public ResponseDto<BookDto> getById4Profit( @RequestHeader("token") String token,
@RequestParam(value = "bookId") Long bookId,
@RequestParam(value = "channelId") Long channelId )
throws BizException, PermissionException {
Long adviserId = (Long) SessionUtil.getVlaue(token, SessionUtil.PARTY_ID);
BookDto bookDto = bookBiz.getById4Profit(bookId, adviserId, channelId);
......@@ -330,7 +333,7 @@ public class BookFacadeImpl implements BookFacade {
*/
@Override
@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 {
Long adviserId = (Long) SessionUtil.getVlaue(token, SessionUtil.PARTY_ID);
book.setCreatedUser(adviserId);
......@@ -343,8 +346,8 @@ public class BookFacadeImpl implements BookFacade {
*/
@Override
@RequestMapping(value = "getBaseInfoById4Wechat", method = RequestMethod.GET)
public ResponseDto<BookDto> getBaseInfoById4Wechat(@CookieValue("userInfo") String userInfo,
@RequestParam(value = "bookId") Long bookId)
public ResponseDto<BookDto> getBaseInfoById4Wechat( @CookieValue("userInfo") String userInfo,
@RequestParam(value = "bookId") Long bookId )
throws BizException {
Cookie.getId(userInfo, Cookie._CHANNEL_ID);
BookDto bookDto = bookBiz.getBaseInfoById4Wechat(bookId);
......@@ -357,11 +360,11 @@ public class BookFacadeImpl implements BookFacade {
*/
@Override
@RequestMapping(value = "getListPage4Wechat", method = RequestMethod.GET)
public 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)
public 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 {
Long adviserId = Cookie.getId(userInfo, Cookie._PARTY_ID);
if (currentPage == null || numPerPage == null || currentPage < 0 || numPerPage < 0) {
......@@ -380,11 +383,11 @@ public class BookFacadeImpl implements BookFacade {
*/
@Override
@RequestMapping(value = "getlistPage", method = RequestMethod.GET)
public 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)
public 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 {
Long adviserId = (Long) SessionUtil.getVlaue(token, SessionUtil.PARTY_ID);
if (currentPage == null || numPerPage == null || currentPage < 0 || numPerPage < 0) {
......@@ -403,8 +406,8 @@ public class BookFacadeImpl implements BookFacade {
*/
@Override
@RequestMapping(value = "setBookAdviserRelation4Wechat", method = RequestMethod.POST)
public ResponseDto<?> setBookAdviserRelation4Wechat(@CookieValue("userInfo") String userInfo,
@RequestBody Book book) throws BizException {
public ResponseDto<?> setBookAdviserRelation4Wechat( @CookieValue("userInfo") String userInfo,
@RequestBody Book book ) throws BizException {
Long adviserId = Cookie.getId(userInfo, Cookie._PARTY_ID);
book.setCreatedUser(adviserId);
bookBiz.setBookAdviserRelation(book);
......@@ -416,7 +419,7 @@ public class BookFacadeImpl implements BookFacade {
*/
@Override
@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 {
Long adviserId = Cookie.getId(userInfo, Cookie._PARTY_ID);
String systemCode = (String) Cookie.getUserInfo(userInfo).get(Cookie._SYSTEM_CODE);
......@@ -433,7 +436,7 @@ public class BookFacadeImpl implements BookFacade {
*/
@Override
@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 {
Long adviserId = Cookie.getId(userInfo, Cookie._PARTY_ID);
// 实体赋值
......@@ -448,11 +451,11 @@ public class BookFacadeImpl implements BookFacade {
*/
@Override
@RequestMapping(value = "getJournalPageByIsbn", method = RequestMethod.GET)
public 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)
public 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 {
if (currentPage < 0 || numPerPage < 0) {
throw BookBizException.PAGE_PARAM_DELETION;
......@@ -469,9 +472,9 @@ public class BookFacadeImpl implements BookFacade {
*/
@Override
@RequestMapping(value = "listPage4Wechat", method = RequestMethod.GET)
public ResponseDto<PageBean> listPage4Wechat(@CookieValue("userInfo") String userInfo,
@RequestParam(value = "currentPage") Integer currentPage,
@RequestParam(value = "numPerPage") Integer numPerPage)
public ResponseDto<PageBean> listPage4Wechat( @CookieValue("userInfo") String userInfo,
@RequestParam(value = "currentPage") Integer currentPage,
@RequestParam(value = "numPerPage") Integer numPerPage )
throws BizException {
Long channelId = Cookie.getId(userInfo, Cookie._CHANNEL_ID);
Long wechatUserId = Cookie.getId(userInfo, Cookie._WECHAT_USER_ID);
......@@ -487,8 +490,8 @@ public class BookFacadeImpl implements BookFacade {
*/
@Override
@RequestMapping(value = "listBook", method = RequestMethod.GET)
public ResponseDto<List<Object>> listBook(@RequestHeader("token") String token,
@RequestParam(value = "number") Integer number)
public ResponseDto<List<Object>> listBook( @RequestHeader("token") String token,
@RequestParam(value = "number") Integer number )
throws BizException, PermissionException {
Long adviserId = (Long) SessionUtil.getVlaue(token, SessionUtil.PARTY_ID);
List<Object> books = bookBiz.listBook(adviserId, number);
......@@ -500,18 +503,18 @@ public class BookFacadeImpl implements BookFacade {
*/
@Override
@RequestMapping(value = "listPage4Agent", method = RequestMethod.GET)
public 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") Integer currentPage,
@RequestParam(value = "numPerPage") 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,
@RequestParam(value = "secondTempletId", required = false) Long secondTempletId,
@RequestParam(value = "isPrint", required = false) Boolean isPrint)
public 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") Integer currentPage,
@RequestParam(value = "numPerPage") 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,
@RequestParam(value = "secondTempletId", required = false) Long secondTempletId,
@RequestParam(value = "isPrint", required = false) Boolean isPrint )
throws BizException, PermissionException {
Long agentId = (Long) SessionUtil.getVlaue(token, SessionUtil.PARTY_ID);
if (currentPage < 0 || numPerPage < 0) {
......@@ -526,8 +529,8 @@ public class BookFacadeImpl implements BookFacade {
paramMap.put("isFundSupport", isFundSupport);
paramMap.put("isbn", isbn);
paramMap.put("templetId", templetId);
paramMap.put("secondTempletId",secondTempletId);
paramMap.put("secondTempletIds",Optional.ofNullable(paramMap.get("secondTempletId")).map(Lists::newArrayList).orElse(Lists.newArrayList()));
paramMap.put("secondTempletId", secondTempletId);
paramMap.put("secondTempletIds", Optional.ofNullable(paramMap.get("secondTempletId")).map(Lists::newArrayList).orElse(Lists.newArrayList()));
paramMap.put("isPrint", isPrint);
return new ResponseDto<>(
bookBiz.listPage4Agent(new PageParam(currentPage, numPerPage), paramMap, agentId));
......@@ -538,10 +541,10 @@ public class BookFacadeImpl implements BookFacade {
*/
@Override
@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)
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 {
Long adviserId = (Long) SessionUtil.getVlaue(token, SessionUtil.PARTY_ID);
PageBean pageBean = bookBiz.listBook4App(adviserId, new PageParam(currentPage, numPerPage), bookName);
......@@ -554,9 +557,9 @@ public class BookFacadeImpl implements BookFacade {
@Override
@RequestMapping(value = "listBookByAppId", method = RequestMethod.GET)
@Deprecated
public ResponseDto<List<BookDto>> listBookByAppId(@RequestHeader("token") String token,
@RequestParam(value = "appId", required = false) Long appId,
@RequestParam(value = "channelId", required = false) Long channelId)
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 {
List<BookDto> bookDtos = bookBiz.listBookByAppId(appId, channelId);
return new ResponseDto<>(bookDtos == null ? new ArrayList<>() : bookDtos);
......@@ -567,10 +570,10 @@ public class BookFacadeImpl implements BookFacade {
*/
@Override
@RequestMapping(value = "getById4Agent", method = RequestMethod.GET)
public 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)
public 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 {
return new ResponseDto<>(bookBiz.getById(bookId, adviserId, channelId));
}
......@@ -580,10 +583,10 @@ public class BookFacadeImpl implements BookFacade {
*/
@Override
@RequestMapping(value = "getById4Platform", method = RequestMethod.GET)
public ResponseDto<BookDto> getById4Platform(@RequestHeader("token") String token,
@RequestParam(value = "bookId") Long bookId,
@RequestParam(value = "channelId", required = false) Long channelId,
@RequestParam(value = "adviserId", required = false) Long adviserId)
public ResponseDto<BookDto> getById4Platform( @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 {
return new ResponseDto<>(bookBiz.getById4Platform(bookId, adviserId, channelId));
}
......@@ -593,9 +596,9 @@ public class BookFacadeImpl implements BookFacade {
*/
@Override
@RequestMapping(value = "listPageDelete4Adviser", method = RequestMethod.GET)
public ResponseDto<PageBean> listPageDelete4Adviser(@RequestHeader("token") String token,
@RequestParam(value = "currentPage") Integer currentPage,
@RequestParam(value = "numPerPage") Integer numPerPage)
public ResponseDto<PageBean> listPageDelete4Adviser( @RequestHeader("token") String token,
@RequestParam(value = "currentPage") Integer currentPage,
@RequestParam(value = "numPerPage") Integer numPerPage )
throws BizException, PermissionException {
Long adviserId = (Long) SessionUtil.getVlaue(token, SessionUtil.PARTY_ID);
if (currentPage < 0 || numPerPage < 0) {
......@@ -611,9 +614,9 @@ public class BookFacadeImpl implements BookFacade {
@Override
@Deprecated
@RequestMapping(value = "getCount4BookAssoc", method = RequestMethod.GET)
public ResponseDto<BookAssocCount> getCount4BookAssoc(@RequestHeader("token") String token,
@RequestParam(value = "bookId") Long bookId,
@RequestParam(value = "channelId", required = false) Long channelId)
public ResponseDto<BookAssocCount> getCount4BookAssoc( @RequestHeader("token") String token,
@RequestParam(value = "bookId") Long bookId,
@RequestParam(value = "channelId", required = false) Long channelId )
throws BizException, PermissionException {
Long adviserId = (Long) SessionUtil.getVlaue(token, SessionUtil.PARTY_ID);
BookAssocCount bookAssocCount = bookBiz.getCount4BookAssoc(bookId, channelId, adviserId);
......@@ -625,7 +628,7 @@ public class BookFacadeImpl implements BookFacade {
*/
@Override
@RequestMapping(value = "exportBookToExcel", method = RequestMethod.GET)
public ResponseDto<?> exportBookToExcel(@RequestHeader("token") String token)
public ResponseDto<?> exportBookToExcel( @RequestHeader("token") String token )
throws PermissionException, BizException {
Long agentId = (Long) SessionUtil.getVlaue(token, SessionUtil.PARTY_ID);
bookBiz.exportBookToExcel(agentId);
......@@ -638,17 +641,17 @@ public class BookFacadeImpl implements BookFacade {
@Override
@Permission(Code = ServerPermissionCode.book + "book/listBookClassify")
@RequestMapping(value = "listBookClassify", method = RequestMethod.GET)
public 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 = "publish", required = false) String publish,
@RequestParam(value = "currentPage") Integer currentPage,
@RequestParam(value = "numPerPage") Integer numPerPage,
@RequestParam(value = "secondTempletId", required = false) Long secondTempletId,
@RequestParam(value = "isPrint", required = false) Boolean isPrint)
public 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 = "publish", required = false) String publish,
@RequestParam(value = "currentPage") Integer currentPage,
@RequestParam(value = "numPerPage") Integer numPerPage,
@RequestParam(value = "secondTempletId", required = false) Long secondTempletId,
@RequestParam(value = "isPrint", required = false) Boolean isPrint )
throws BizException, PermissionException {
SessionUtil.getVlaue(token, SessionUtil.PARTY_ID);
if (currentPage == null || numPerPage == null || currentPage < 0 || numPerPage < 0) {
......@@ -662,9 +665,9 @@ public class BookFacadeImpl implements BookFacade {
paramMap.put("bookName", bookName);
paramMap.put("publish", publish);
paramMap.put("secondTempletId", secondTempletId);
paramMap.put("secondTempletIds",Optional.ofNullable(paramMap.get("secondTempletId")).map(Lists::newArrayList).orElse(Lists.newArrayList()));
if(!StringUtil.isEmpty(bookName)){
//去掉分词搜索20200331shuangli,by:zhuyajie
paramMap.put("secondTempletIds", Optional.ofNullable(paramMap.get("secondTempletId")).map(Lists::newArrayList).orElse(Lists.newArrayList()));
if (!StringUtil.isEmpty(bookName)) {
//去掉分词搜索20200331shuangli,by:zhuyajie
// String[] bookNameList = bookName.trim().split("\\s+");
// paramMap.put("bookNameList",Lists.newArrayList(bookNameList));
}
......@@ -708,7 +711,7 @@ public class BookFacadeImpl implements BookFacade {
*/
@Override
@RequestMapping(value = "exportBookToExcel4Platform", method = RequestMethod.GET)
public ResponseDto<?> exportBookToExcel4Platform(@RequestHeader("token") String token)
public ResponseDto<?> exportBookToExcel4Platform( @RequestHeader("token") String token )
throws PermissionException, BizException {
SessionUtil.getVlaue(token, SessionUtil.PARTY_ID);
bookBiz.exportBookToExcel4Platform();
......@@ -720,9 +723,9 @@ public class BookFacadeImpl implements BookFacade {
*/
@Override
@RequestMapping(value = "getByIsbnAndTypeCode", method = RequestMethod.GET)
public ResponseDto<BookDto> getByIsbnAndTypeCode(@RequestHeader("token") String token,
@RequestParam(value = "isbn") String isbn,
@RequestParam(value = "typeCode") String typeCode)
public ResponseDto<BookDto> getByIsbnAndTypeCode( @RequestHeader("token") String token,
@RequestParam(value = "isbn") String isbn,
@RequestParam(value = "typeCode") String typeCode )
throws BizException {
BookDto bookDto = bookBiz.getByIsbnAndTypeCode(isbn, typeCode);
return new ResponseDto<>(bookDto == null ? new BookDto() : bookDto);
......@@ -733,7 +736,7 @@ public class BookFacadeImpl implements BookFacade {
*/
@Override
@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 {
Long adviserId = (Long) SessionUtil.getVlaue(token, SessionUtil.PARTY_ID);
Long agentId = (Long) SessionUtil.getVlaue(token, SessionUtil.TENANT_ID);
......@@ -746,8 +749,8 @@ public class BookFacadeImpl implements BookFacade {
@Override
@RequestMapping(value = "getByIsbnAndSerialNumber", method = RequestMethod.GET)
public ResponseDto<BookDto> getByIsbnAndSerialNumber(@RequestParam(value = "isbn", required = false) String isbn,
@RequestParam(value = "serialNumber", required = false) String serialNumber) throws BizException {
public ResponseDto<BookDto> getByIsbnAndSerialNumber( @RequestParam(value = "isbn", required = false) String isbn,
@RequestParam(value = "serialNumber", required = false) String serialNumber ) throws BizException {
BookDto book = bookBiz.getByIsbn(isbn, serialNumber);
return new ResponseDto<>(book == null ? new BookDto() : book);
}
......@@ -757,7 +760,7 @@ public class BookFacadeImpl implements BookFacade {
*/
@Override
@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 {
Long adviserId = (Long) SessionUtil.getVlaue(token, SessionUtil.PARTY_ID);
// 实体赋值
......@@ -768,8 +771,8 @@ public class BookFacadeImpl implements BookFacade {
@Override
@RequestMapping(value = "checkISBN4App", method = RequestMethod.GET)
public ResponseDto<Boolean> checkISBN4App(@RequestHeader("token") String token,
@RequestParam(value = "isbn") String isbn) throws PermissionException {
public ResponseDto<Boolean> checkISBN4App( @RequestHeader("token") String token,
@RequestParam(value = "isbn") String isbn ) throws PermissionException {
SessionUtil.getVlaue(token, SessionUtil.PARTY_ID);
Boolean bool = bookBiz.checkISBN4App(isbn);
return new ResponseDto<>(bool);
......@@ -780,48 +783,48 @@ public class BookFacadeImpl implements BookFacade {
*/
@Override
@GetMapping("getBookListByChannelId4Adviser")
public ResponseDto<PageBean> getBookListByChannelId4Adviser(@RequestHeader("token") String token,
@RequestParam(value = "currentPage") Integer currentPage,
@RequestParam(value = "numPerPage") Integer numPerPage,
@RequestParam(value = "channelId") Long channelId,
@RequestParam(value = "name", required = false) String name) throws PermissionException, BizException {
public ResponseDto<PageBean> getBookListByChannelId4Adviser( @RequestHeader("token") String token,
@RequestParam(value = "currentPage") Integer currentPage,
@RequestParam(value = "numPerPage") Integer numPerPage,
@RequestParam(value = "channelId") Long channelId,
@RequestParam(value = "name", required = false) String name ) throws PermissionException, BizException {
Long partyId = (Long) SessionUtil.getVlaue(token, SessionUtil.PARTY_ID);
PageParam pageParam = new PageParam(currentPage, numPerPage);
return new ResponseDto<>(bookBiz.getBookBaseInfoListByChannelId4Adviser(partyId, channelId, pageParam, name));
}
@RequestMapping(value = "listPage4PC", method = RequestMethod.GET)
public ResponseDto<PageBean> getListPage4PC(@RequestHeader("token") String token,
@RequestParam(value = "name", required = false) String name,
@RequestParam(value = "currentPage", required = false) Integer currentPage,
@RequestParam(value = "numPerPage", required = false) Integer numPerPage)
public ResponseDto<PageBean> getListPage4PC( @RequestHeader("token") String token,
@RequestParam(value = "name", required = false) String name,
@RequestParam(value = "currentPage", required = false) Integer currentPage,
@RequestParam(value = "numPerPage", required = false) Integer numPerPage )
throws BizException, PermissionException {
SessionUtil.getVlaue(token, SessionUtil.PARTY_ID);
if (currentPage == null || numPerPage == null || currentPage < 0 || numPerPage < 0) {
throw BookBizException.PAGE_PARAM_DELETION;
}
PageBean pageBean = bookBiz.getListPage4PC(new PageParam(currentPage,numPerPage),name);
return new ResponseDto<PageBean>(null == pageBean ? new PageBean():pageBean);
PageBean pageBean = bookBiz.getListPage4PC(new PageParam(currentPage, numPerPage), name);
return new ResponseDto<PageBean>(null == pageBean ? new PageBean() : pageBean);
}
@Override
@RequestMapping(value = "listNoAuthBook", method = RequestMethod.POST)
public ResponseDto<PageBeanNew> listNoAuthBook(@RequestHeader("token") String token,
@RequestBody ListNoAuthBookParam listNoAuthBookParam)
public ResponseDto<PageBeanNew> listNoAuthBook( @RequestHeader("token") String token,
@RequestBody ListNoAuthBookParam listNoAuthBookParam )
throws BizException, PermissionException {
Long adviserId = (Long) SessionUtil.getVlaue(token, SessionUtil.PARTY_ID);
PageBeanNew pageBeanNew = bookBiz.listNoAuthBook(listNoAuthBookParam, adviserId);
return new ResponseDto<PageBeanNew>(null == pageBeanNew ? new PageBeanNew():pageBeanNew);
return new ResponseDto<PageBeanNew>(null == pageBeanNew ? new PageBeanNew() : pageBeanNew);
}
@Override
@RequestMapping(value = "listNoAuthGroupBook", method = RequestMethod.POST)
public ResponseDto<PageBeanNew> listNoAuthGroupBook(@RequestHeader("token") String token,
@RequestBody ListNoAuthGroupBookParam listNoAuthGroupBookParam)
public ResponseDto<PageBeanNew> listNoAuthGroupBook( @RequestHeader("token") String token,
@RequestBody ListNoAuthGroupBookParam listNoAuthGroupBookParam )
throws BizException, PermissionException {
Long adviserId = (Long) SessionUtil.getVlaue(token, SessionUtil.PARTY_ID);
PageBeanNew pageBeanNew = bookBiz.listNoAuthGroupBook(listNoAuthGroupBookParam, adviserId);
return new ResponseDto<PageBeanNew>(null == pageBeanNew ? new PageBeanNew():pageBeanNew);
return new ResponseDto<PageBeanNew>(null == pageBeanNew ? new PageBeanNew() : pageBeanNew);
}
@Override
......@@ -834,13 +837,13 @@ public class BookFacadeImpl implements BookFacade {
@RequestParam(value = "verLabelId", required = false) Long verLabelId,
@RequestParam(value = "areaLabelId", required = false) Long areaLabelId,
@RequestParam(value = "currentPage", required = false) Integer currentPage,
@RequestParam(value = "numPerPage", required = false) Integer numPerPage)
@RequestParam(value = "numPerPage", required = false) Integer numPerPage )
throws BizException, PermissionException {
SessionUtil.getVlaue(token, SessionUtil.PARTY_ID);
if (currentPage == null || numPerPage == null || currentPage < 0 || numPerPage < 0) {
throw BookBizException.PAGE_PARAM_DELETION;
}
PageBeanNew<AdviserBookInfoDTO> pageBean = bookBiz.getListPage4SelfBookGroup(currentPage, numPerPage, name,null, graLabelId, subLabelId, verLabelId, areaLabelId);
PageBeanNew<AdviserBookInfoDTO> pageBean = bookBiz.getListPage4SelfBookGroup(currentPage, numPerPage, name, null, graLabelId, subLabelId, verLabelId, areaLabelId);
return new ResponseDto<>(null == pageBean ? new PageBeanNew<>() : pageBean);
}
......@@ -848,15 +851,15 @@ public class BookFacadeImpl implements BookFacade {
@RequestMapping(value = "getListPage4SelfBookGroupByAdvise", method = RequestMethod.GET)
public ResponseDto<PageBeanNew<AdviserBookInfoDTO>> getListPage4SelfBookGroupByAdvise(
@RequestHeader("token") String token,
@RequestParam(value = "name",required = false) String name,
@RequestParam(value = "name", required = false) String name,
@RequestParam(value = "currentPage", required = false) Integer currentPage,
@RequestParam(value = "numPerPage", required = false) Integer numPerPage)
@RequestParam(value = "numPerPage", required = false) Integer numPerPage )
throws BizException, PermissionException {
Long adviserId = (Long) SessionUtil.getVlaue(token, SessionUtil.PARTY_ID);
if (currentPage == null || numPerPage == null || currentPage < 0 || numPerPage < 0) {
throw BookBizException.PAGE_PARAM_DELETION;
}
PageBeanNew<AdviserBookInfoDTO> pageBean = bookBiz.getListPage4SelfBookGroup(currentPage, numPerPage, name,adviserId,null,null,null,null);
PageBeanNew<AdviserBookInfoDTO> pageBean = bookBiz.getListPage4SelfBookGroup(currentPage, numPerPage, name, adviserId, null, null, null, null);
return new ResponseDto<>(null == pageBean ? new PageBeanNew<>() : pageBean);
}
......@@ -876,12 +879,13 @@ public class BookFacadeImpl implements BookFacade {
if (currentPage == null || numPerPage == null || currentPage < 0 || numPerPage < 0) {
throw BookBizException.PAGE_PARAM_DELETION;
}
return new ResponseDto<>(bookBiz.getAdviserBooks4Pcloud(keyword,agentId,templetId,secondTempletId,typeCode,currentPage,numPerPage));
return new ResponseDto<>(bookBiz.getAdviserBooks4Pcloud(keyword, agentId, templetId, secondTempletId, typeCode, currentPage, numPerPage));
}
@GetMapping("getAdviserBooks4H5")
@Override
public ResponseDto<?> getAdviserBooks4H5(
@RequestHeader(value = "Gray-Status", required = false) String grayStatus,
@RequestParam(value = "keyword", required = false) String keyword,
@RequestParam(value = "templetId", required = false) Long templetId,
@RequestParam(value = "secondTempletId", required = false) Long secondTempletId,
......@@ -891,7 +895,7 @@ public class BookFacadeImpl implements BookFacade {
if (currentPage == null || numPerPage == null || currentPage < 0 || numPerPage < 0) {
throw BookBizException.PAGE_PARAM_DELETION;
}
return new ResponseDto<>(bookBiz.getAdviserBooks4H5(keyword,templetId,secondTempletId,currentPage,numPerPage));
return new ResponseDto<>(bookBiz.getAdviserBooks4H5(grayStatus, keyword, templetId, secondTempletId, currentPage, numPerPage));
}
@GetMapping("getBookLabels")
......@@ -908,15 +912,15 @@ public class BookFacadeImpl implements BookFacade {
*/
@Override
@RequestMapping(value = "listPageIncomeDetail", method = RequestMethod.GET)
public ResponseDto<PageBeanNew> listPageIncomeDetail(@RequestHeader("token") String token,
@RequestParam(value = "keyWord", required = false) String keyWord,
@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 = "isFundSupport", required = false) Integer isFundSupport,
@RequestParam(value = "templetId", required = false) Long templetId,
@RequestParam(value = "secondTempletId", required = false) Long secondTempletId)
public ResponseDto<PageBeanNew> listPageIncomeDetail( @RequestHeader("token") String token,
@RequestParam(value = "keyWord", required = false) String keyWord,
@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 = "isFundSupport", required = false) Integer isFundSupport,
@RequestParam(value = "templetId", required = false) Long templetId,
@RequestParam(value = "secondTempletId", required = false) Long secondTempletId )
throws BizException, PermissionException {
Long agentId = (Long) SessionUtil.getVlaue(token, SessionUtil.PARTY_ID);
if (currentPage == null || numPerPage == null || currentPage < 0 || numPerPage < 0) {
......@@ -928,8 +932,8 @@ public class BookFacadeImpl implements BookFacade {
paramMap.put("typeCode", typeCode != null && "".equals(typeCode.trim()) ? null : typeCode);
paramMap.put("isFundSupport", isFundSupport);
paramMap.put("templetId", templetId);
paramMap.put("secondTempletId",secondTempletId);
paramMap.put("secondTempletIds",Optional.ofNullable(paramMap.get("secondTempletId")).map(Lists::newArrayList).orElse(Lists.newArrayList()));
paramMap.put("secondTempletId", secondTempletId);
paramMap.put("secondTempletIds", Optional.ofNullable(paramMap.get("secondTempletId")).map(Lists::newArrayList).orElse(Lists.newArrayList()));
return new ResponseDto<>(bookBiz.listPageIncomeDetail(new PageParam(currentPage, numPerPage), paramMap, agentId));
}
......@@ -942,16 +946,16 @@ public class BookFacadeImpl implements BookFacade {
@RequestParam(value = "typeCode", required = false) String typeCode,
@RequestParam(value = "isFundSupport", required = false) Integer isFundSupport,
@RequestParam(value = "templetId", required = false) Long templetId,
@RequestParam(value = "secondTempletId", required = false) Long secondTempletId) throws PermissionException {
@RequestParam(value = "secondTempletId", required = false) Long secondTempletId ) throws PermissionException {
Long agentId = (Long) SessionUtil.getVlaue(token, SessionUtil.PARTY_ID);
String systemCode = (String) SessionUtil.getVlaue(token, SessionUtil.SYSTEM_CODE);
if (!SystemCode.agent.code.equalsIgnoreCase(systemCode)) {
throw new PermissionException(PermissionException.PERMISSION_NOT_FOUND);
}
Map<String,Object> map = SessionUtil.getToken4Redis(token);
String isSystem = (String)map.get(SessionUtil.IS_SYSTEM);
Map<String, Object> map = SessionUtil.getToken4Redis(token);
String isSystem = (String) map.get(SessionUtil.IS_SYSTEM);
Long partyId = (Long) map.get(SessionUtil.PARTY_ID);
if (IsSystem.NOT_SYSTEM.code.equals(isSystem)){
if (IsSystem.NOT_SYSTEM.code.equals(isSystem)) {
partyId = (Long) map.get(SessionUtil.MEMBER_ID);
}
Map<String, Object> paramMap = new HashMap<>();
......@@ -960,8 +964,8 @@ public class BookFacadeImpl implements BookFacade {
paramMap.put("typeCode", typeCode != null && "".equals(typeCode.trim()) ? null : typeCode);
paramMap.put("isFundSupport", isFundSupport);
paramMap.put("templetId", templetId);
paramMap.put("secondTempletId",secondTempletId);
paramMap.put("secondTempletIds",Optional.ofNullable(paramMap.get("secondTempletId")).map(Lists::newArrayList).orElse(Lists.newArrayList()));
paramMap.put("secondTempletId", secondTempletId);
paramMap.put("secondTempletIds", Optional.ofNullable(paramMap.get("secondTempletId")).map(Lists::newArrayList).orElse(Lists.newArrayList()));
bookBiz.exportBookIncomeDetail(paramMap, agentId, partyId, systemCode);
return new ResponseDto<>();
}
......@@ -976,9 +980,9 @@ public class BookFacadeImpl implements BookFacade {
@RequestParam(value = "isFundSupport", required = false) Integer isFundSupport,
@RequestParam(value = "startDate", required = false) String startDate,
@RequestParam(value = "endDate", required = false) String endDate
) throws PermissionException, JsonParseException, BizException{
Long channelId = (Long) SessionUtil.getVlaue(token,SessionUtil.PARTY_ID);
PageBeanNew<BookDto> pageBean = bookBiz.getBookAndServeList4Channel(currentPage,numPerPage,channelId,name,isFundSupport,startDate,endDate);
) throws PermissionException, JsonParseException, BizException {
Long channelId = (Long) SessionUtil.getVlaue(token, SessionUtil.PARTY_ID);
PageBeanNew<BookDto> pageBean = bookBiz.getBookAndServeList4Channel(currentPage, numPerPage, channelId, name, isFundSupport, startDate, endDate);
return new ResponseDto<>(pageBean);
}
......@@ -990,22 +994,21 @@ public class BookFacadeImpl implements BookFacade {
@RequestParam(value = "adviserId") Long adviserId,
@RequestParam(value = "channelId") Long channelId
) throws BizException, PermissionException {
return new ResponseDto<>(bookBiz.getAdviserBook(bookId,adviserId,channelId));
return new ResponseDto<>(bookBiz.getAdviserBook(bookId, adviserId, channelId));
}
@ApiOperation("添加移除质检书刊")
@Override
@RequestMapping(value = "updateBookQualifyInfo", method = RequestMethod.POST)
public ResponseDto<?> updateBookQualifyInfo(@RequestHeader("token") String token, @RequestBody BookQualifyInfoVO bookQualifyInfo ) throws PermissionException {
public ResponseDto<?> updateBookQualifyInfo( @RequestHeader("token") String token, @RequestBody BookQualifyInfoVO bookQualifyInfo ) throws PermissionException {
Long adviserId = (Long) SessionUtil.getVlaue(token, SessionUtil.PARTY_ID);
bookBiz.updateBookQualifyInfo(bookQualifyInfo,adviserId);
bookBiz.updateBookQualifyInfo(bookQualifyInfo, adviserId);
return new ResponseDto<>();
}
//添加书刊时书籍查询 入参bookName isbn 查询更新后质检书刊 isShowQualifyInfo
@Override
@GetMapping("getAddBookQualifyList")
......@@ -1015,20 +1018,19 @@ public class BookFacadeImpl implements BookFacade {
@RequestParam(value = "numPerPage") Integer numPerPage,
@RequestParam(value = "name", required = false) String name,
@RequestParam(value = "isShowQualifyInfo", required = false) Integer isShowQualifyInfo
) throws PermissionException, JsonParseException, BizException{
Long adviserId = (Long) SessionUtil.getVlaue(token,SessionUtil.PARTY_ID);
PageBeanNew<BookQualifyVO> pageBean = bookBiz.getAddBookQualifyList(currentPage,numPerPage,name,isShowQualifyInfo,adviserId);
) throws PermissionException, JsonParseException, BizException {
Long adviserId = (Long) SessionUtil.getVlaue(token, SessionUtil.PARTY_ID);
PageBeanNew<BookQualifyVO> pageBean = bookBiz.getAddBookQualifyList(currentPage, numPerPage, name, isShowQualifyInfo, adviserId);
return new ResponseDto<>(pageBean);
}
@Override
@GetMapping("getBookInfoByBookGroupId")
public ResponseDto<?> getBookInfoByBookGroupId(
@RequestParam(value = "bookGroupId", required = true) Long bookGroupId
) throws PermissionException, JsonParseException, BizException{
SearchBookVO bookVO= bookBiz.getBookInfoByBookGroupId(bookGroupId);
) throws PermissionException, JsonParseException, BizException {
SearchBookVO bookVO = bookBiz.getBookInfoByBookGroupId(bookGroupId);
return new ResponseDto<>(bookVO);
}
......
......@@ -15,6 +15,6 @@ public interface ESBookAndAdviserBiz {
void updateBookAndAdviserToES(List<Long> bookIds);
Page<ESBookAndAdviser> getAdviserBooks4ES(String keyword, Long templetId, Long secondTempletId, Integer currentPage, Integer numPerPage);
Page<ESBookAndAdviser> getAdviserBooks4ES(String grayStatus, String keyword, Long templetId, Long secondTempletId, Integer currentPage, Integer numPerPage);
}
......@@ -5,6 +5,8 @@ import com.pcloud.book.es.biz.ESBookAndAdviserBiz;
import com.pcloud.book.es.entity.ESBookAndAdviser;
import com.pcloud.book.es.repository.BookAndAdviserRepository;
import com.pcloud.book.util.common.ThreadPoolUtils;
import com.pcloud.book.util.common.YesOrNoEnums;
import com.pcloud.book.util.properties.BookProps;
import com.pcloud.common.core.aspect.ParamLog;
import com.pcloud.common.utils.ListUtils;
import com.pcloud.common.utils.string.StringUtil;
......@@ -85,7 +87,7 @@ public class ESBookAndAdviserBizImpl implements ESBookAndAdviserBiz {
}
@Override
public Page<ESBookAndAdviser> getAdviserBooks4ES(String keyword, Long templetId, Long secondTempletId, Integer currentPage, Integer numPerPage) {
public Page<ESBookAndAdviser> getAdviserBooks4ES(String grayStatus, String keyword, Long templetId, Long secondTempletId, Integer currentPage, Integer numPerPage) {
BoolQueryBuilder boolQueryBuilder = QueryBuilders.boolQuery()
.filter(QueryBuilders.termQuery("isBookDelete", 0))
.filter(Objects.isNull(templetId) ? QueryBuilders.boolQuery() : QueryBuilders.termQuery("templetId", templetId))
......@@ -96,8 +98,22 @@ public class ESBookAndAdviserBizImpl implements ESBookAndAdviserBiz {
BoolQueryBuilder should1 = QueryBuilders.boolQuery()
.should(QueryBuilders.termQuery("isBookAdviserDelete", 0))
.should(QueryBuilders.termQuery("isAdviserBook", 0));
// 审核通过之后屏蔽掉测试编辑的书刊
BoolQueryBuilder adviserIdBuilder = QueryBuilders.boolQuery();
if (YesOrNoEnums.YES.getCode().equals(grayStatus)) {
if ("test".equalsIgnoreCase(BookProps.getSystemEnv())) {
adviserIdBuilder = QueryBuilders.boolQuery().mustNot(QueryBuilders.termQuery("adviserId", 1404));
}
if ("uat".equalsIgnoreCase(BookProps.getSystemEnv())) {
adviserIdBuilder = QueryBuilders.boolQuery().mustNot(QueryBuilders.termQuery("adviserId", 12829));
}
if ("pro".equalsIgnoreCase(BookProps.getSystemEnv())) {
adviserIdBuilder = QueryBuilders.boolQuery().mustNot(QueryBuilders.termQuery("adviserId", 1362));
}
}
boolQueryBuilder.must(should);
boolQueryBuilder.must(should1);
boolQueryBuilder.must(adviserIdBuilder);
Sort sort=new Sort(Sort.Direction.DESC, "isAdviserBook","lastModifiedDate", "bookId");
PageRequest pageRequest = new PageRequest(currentPage, numPerPage,sort);
Page<ESBookAndAdviser> search = bookAndAdviserRepository.search(boolQueryBuilder, pageRequest);
......
......@@ -48,7 +48,7 @@ public class ESBookAndAdviserFacade {
if (currentPage == null || numPerPage == null || currentPage < 0 || numPerPage < 0) {
throw BookBizException.PAGE_PARAM_DELETION;
}
return esBookAndAdviserBiz.getAdviserBooks4ES(keyword,templetId,secondTempletId,currentPage,numPerPage).getContent();
return esBookAndAdviserBiz.getAdviserBooks4ES("0", keyword,templetId,secondTempletId,currentPage,numPerPage).getContent();
}
}
......@@ -9,19 +9,25 @@ public enum YesOrNoEnums {
/**
* 是
*/
YES(1),
YES(1, "1"),
/**
* 否
*/
NO(0);
NO(0, "0");
private Integer value;
private String code;
YesOrNoEnums(Integer value) {
YesOrNoEnums(Integer value, String code) {
this.value = value;
this.code = code;
}
public Integer getValue() {
return value;
}
public String getCode() {
return code;
}
}
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