Commit c535192f by gaopeng

图书增加是否已ä¸

parent 2831113d
...@@ -613,6 +613,11 @@ public class BookDto extends BaseDto { ...@@ -613,6 +613,11 @@ public class BookDto extends BaseDto {
*/ */
private BigDecimal adviserIncome; private BigDecimal adviserIncome;
/**
* 是否已下印
*/
private Boolean isPrint;
public String getQrRemark() { public String getQrRemark() {
return qrRemark; return qrRemark;
} }
...@@ -1632,6 +1637,14 @@ public class BookDto extends BaseDto { ...@@ -1632,6 +1637,14 @@ public class BookDto extends BaseDto {
public void setAdviserIncome(BigDecimal adviserIncome) { public void setAdviserIncome(BigDecimal adviserIncome) {
this.adviserIncome = adviserIncome; this.adviserIncome = adviserIncome;
} }
public Boolean getIsPrint() {
return isPrint;
}
public void setIsPrint(Boolean isPrint) {
this.isPrint = isPrint;
}
@Override @Override
public String toString() { public String toString() {
......
...@@ -87,6 +87,11 @@ public class BookAdviser extends BaseEntity { ...@@ -87,6 +87,11 @@ public class BookAdviser extends BaseEntity {
* 地域标签id * 地域标签id
*/ */
private Long areaLabelId; private Long areaLabelId;
/**
* 是否已下印
*/
private Boolean isPrint;
public Long getTempletId() { public Long getTempletId() {
return templetId; return templetId;
...@@ -199,6 +204,14 @@ public class BookAdviser extends BaseEntity { ...@@ -199,6 +204,14 @@ public class BookAdviser extends BaseEntity {
public void setAreaLabelId(Long areaLabelId) { public void setAreaLabelId(Long areaLabelId) {
this.areaLabelId = areaLabelId; this.areaLabelId = areaLabelId;
} }
public Boolean getIsPrint() {
return isPrint;
}
public void setIsPrint(Boolean isPrint) {
this.isPrint = isPrint;
}
@Override @Override
public String toString() { public String toString() {
......
...@@ -189,4 +189,11 @@ public interface BookAdviserBiz { ...@@ -189,4 +189,11 @@ public interface BookAdviserBiz {
void refactorData(Long parentId,Long originTempletId, Long secondTempletId); void refactorData(Long parentId,Long originTempletId, Long secondTempletId);
PageBeanNew<ErpAdviserBookVO> listAdviserBook4Erp(String isbn, String uniqueNumber, String adviserName, Integer currentPage, Integer numPerPage); PageBeanNew<ErpAdviserBookVO> listAdviserBook4Erp(String isbn, String uniqueNumber, String adviserName, Integer currentPage, Integer numPerPage);
/**
* 设置书刊是否已下印状态
* @param bookAdviser 图书编辑关联实体
* @throws BizException
*/
void setIsPrint(BookAdviser bookAdviser) throws BizException;
} }
...@@ -210,10 +210,11 @@ public interface BookBiz { ...@@ -210,10 +210,11 @@ public interface BookBiz {
* 首页展示正在做的图书 * 首页展示正在做的图书
* @param adviserId * @param adviserId
* @param num * @param num
* @param isPrint
* @return * @return
* @throws BizException * @throws BizException
*/ */
List<BookDto> getList4Adviser(Long adviserId,Integer num) throws BizException; List<BookDto> getList4Adviser(Long adviserId, Integer num, Boolean isPrint) throws BizException;
/** /**
* 微信端获取书籍列表(编辑) * 微信端获取书籍列表(编辑)
* *
......
package com.pcloud.book.book.biz.impl; package com.pcloud.book.book.biz.impl;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.dao.DataIntegrityViolationException;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import com.google.common.collect.Maps; import com.google.common.collect.Maps;
import com.pcloud.book.base.dto.CountDto; import com.pcloud.book.base.dto.CountDto;
import com.pcloud.book.base.exception.BookBizException; import com.pcloud.book.base.exception.BookBizException;
import com.pcloud.book.book.biz.BookAdviserBiz; import com.pcloud.book.book.biz.BookAdviserBiz;
...@@ -42,23 +56,6 @@ import com.pcloud.common.utils.ListUtils; ...@@ -42,23 +56,6 @@ import com.pcloud.common.utils.ListUtils;
import com.pcloud.common.utils.string.StringUtil; import com.pcloud.common.utils.string.StringUtil;
import com.pcloud.raystask.entity.AdviserDefault; import com.pcloud.raystask.entity.AdviserDefault;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.dao.DataIntegrityViolationException;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/** /**
* @描述:编辑管理书籍逻辑层接口实现类 * @描述:编辑管理书籍逻辑层接口实现类
* @作者:songx * @作者:songx
...@@ -802,4 +799,15 @@ public class BookAdviserBizImpl implements BookAdviserBiz { ...@@ -802,4 +799,15 @@ public class BookAdviserBizImpl implements BookAdviserBiz {
} }
return pageBeanNew; return pageBeanNew;
} }
/**
* 设置书刊是否已下印状态
*/
@Override
public void setIsPrint(BookAdviser bookAdviser) throws BizException {
if (null == bookAdviser.getBookId() || null == bookAdviser.getIsPrint()) {
throw new BookBizException(BookBizException.PARAM_IS_NULL, "参数有误!");
}
bookAdviserDao.setIsPrint(bookAdviser);
}
} }
...@@ -780,10 +780,11 @@ public class BookBizImpl implements BookBiz { ...@@ -780,10 +780,11 @@ public class BookBizImpl implements BookBiz {
@ParamLog(description = "首页展示正在做的图书", isAfterReturn = false) @ParamLog(description = "首页展示正在做的图书", isAfterReturn = false)
@Override @Override
public List<BookDto> getList4Adviser(Long adviserId, Integer num) throws BizException { public List<BookDto> getList4Adviser(Long adviserId, Integer num, Boolean isPrint) throws BizException {
Map<String, Object> paramMap = Maps.newHashMap(); Map<String, Object> paramMap = Maps.newHashMap();
paramMap.put("adviserId", adviserId); paramMap.put("adviserId", adviserId);
paramMap.put("num", num); paramMap.put("num", num);
paramMap.put("isPrint", isPrint);
paramMap.put("isbns", BookConstant.DEFAULT_BOOK_ISBN); paramMap.put("isbns", BookConstant.DEFAULT_BOOK_ISBN);
List<BookDto> bookDtos = bookDao.getList4Adviser(paramMap); List<BookDto> bookDtos = bookDao.getList4Adviser(paramMap);
if (!ListUtils.isEmpty(bookDtos)) { if (!ListUtils.isEmpty(bookDtos)) {
......
...@@ -245,4 +245,11 @@ public interface BookAdviserDao extends BaseDao<BookAdviser> { ...@@ -245,4 +245,11 @@ public interface BookAdviserDao extends BaseDao<BookAdviser> {
* 刷数据使用,请勿使用 * 刷数据使用,请勿使用
*/ */
int updateBookBySecondTempletId(Long parentId, Long originTempletId,Long secondTempletId); int updateBookBySecondTempletId(Long parentId, Long originTempletId,Long secondTempletId);
/**
* 设置书刊是否已下印状态
* @param bookAdviser 图书编辑关联关系
* @return
*/
long setIsPrint(BookAdviser bookAdviser);
} }
...@@ -243,4 +243,12 @@ public class BookAdviserDaoImpl extends BaseDaoImpl<BookAdviser> implements Book ...@@ -243,4 +243,12 @@ public class BookAdviserDaoImpl extends BaseDaoImpl<BookAdviser> implements Book
map.put("secondTempletId",secondTempletId); map.put("secondTempletId",secondTempletId);
return getSqlSession().update(getStatement("updateBookBySecondTempletId"),map); return getSqlSession().update(getStatement("updateBookBySecondTempletId"),map);
} }
/**
* 设置书刊是否已下印状态
*/
@Override
public long setIsPrint(BookAdviser bookAdviser) {
return super.getSqlSession().update(getStatement("setIsPrint"), bookAdviser);
}
} }
...@@ -199,4 +199,21 @@ public interface BookAdviserFacade { ...@@ -199,4 +199,21 @@ public interface BookAdviserFacade {
@RequestParam(value = "currentPage") Integer currentPage, @RequestParam(value = "currentPage") Integer currentPage,
@RequestParam(value = "numPerPage") Integer numPerPage) @RequestParam(value = "numPerPage") Integer numPerPage)
throws PermissionException, JsonParseException, BizException; throws PermissionException, JsonParseException, BizException;
/**
* 设置书刊是否已下印状态
* @param token
* @param bookAdviser
* @return
* @throws BizException
* @throws PermissionException
* @throws JsonParseException
*/
@ApiOperation(value = "设置书刊是否已下印状态", httpMethod = "POST")
@ApiImplicitParams({@ApiImplicitParam(name = "token", value = "token", dataType = "String", paramType = "header"),
@ApiImplicitParam(name = "bookAdviser", value = "编辑书籍关系实体", dataType = "BookAdviser", paramType = "body")
})
@RequestMapping(value = "setIsPrint", method = RequestMethod.POST)
ResponseDto<?> setIsPrint(@RequestHeader("token") String token,
@RequestBody BookAdviser bookAdviser) throws BizException, PermissionException, JsonParseException;
} }
...@@ -150,7 +150,9 @@ public interface BookFacade { ...@@ -150,7 +150,9 @@ public interface BookFacade {
@ApiImplicitParam(name = "bookId", value = "书籍标识", dataType = "int", paramType = "query"), @ApiImplicitParam(name = "bookId", value = "书籍标识", dataType = "int", paramType = "query"),
@ApiImplicitParam(name = "templetId", value = "图书类型标识", dataType = "long", paramType = "query"), @ApiImplicitParam(name = "templetId", value = "图书类型标识", dataType = "long", paramType = "query"),
@ApiImplicitParam(name = "bookStatus", value = "图书版权保护状态", dataType = "int", paramType = "query"), @ApiImplicitParam(name = "bookStatus", value = "图书版权保护状态", dataType = "int", paramType = "query"),
@ApiImplicitParam(name = "hasQrcode", value = "只看有二维码", dataType = "int", paramType = "query")}) @ApiImplicitParam(name = "hasQrcode", value = "只看有二维码", dataType = "int", paramType = "query"),
@ApiImplicitParam(name = "isPrint", value = "是否已下印", dataType = "Boolean", paramType = "query")
})
@RequestMapping(value = "listPage4Adviser", method = RequestMethod.GET) @RequestMapping(value = "listPage4Adviser", method = RequestMethod.GET)
ResponseDto<PageBean> getListPage4Adviser(@RequestHeader("token") String token, ResponseDto<PageBean> getListPage4Adviser(@RequestHeader("token") String token,
@RequestParam(value = "name", required = false) String name, @RequestParam(value = "name", required = false) String name,
...@@ -166,14 +168,18 @@ public interface BookFacade { ...@@ -166,14 +168,18 @@ public interface BookFacade {
@RequestParam(value = "templetId", required = false) Long templetId, @RequestParam(value = "templetId", required = false) Long templetId,
@RequestParam(value = "bookStatus", required = false) Integer bookStatus, @RequestParam(value = "bookStatus", required = false) Integer bookStatus,
@RequestParam(value = "secondTempletId", required = false) Long secondTempletId, @RequestParam(value = "secondTempletId", required = false) Long secondTempletId,
@RequestParam(value = "hasQrcode",required = false) Integer hasQrcode) @RequestParam(value = "hasQrcode",required = false) Integer hasQrcode,
@RequestParam(value = "isPrint", required = false) Boolean isPrint)
throws BizException, PermissionException; throws BizException, PermissionException;
@ApiOperation(value = "首页获取正在做的图书", httpMethod = "GET") @ApiOperation(value = "首页获取正在做的图书", httpMethod = "GET")
@ApiImplicitParams({@ApiImplicitParam(name = "token", value = "token", dataType = "string", paramType = "header"), @ApiImplicitParams({@ApiImplicitParam(name = "token", value = "token", dataType = "string", paramType = "header"),
@ApiImplicitParam(name = "num", value = "个数", dataType = "Integer", paramType = "query")}) @ApiImplicitParam(name = "num", value = "个数", dataType = "Integer", paramType = "query"),
@ApiImplicitParam(name = "isPrint", value = "是否已下印", dataType = "Boolean", paramType = "query")
})
@GetMapping("getList4Adviser") @GetMapping("getList4Adviser")
ResponseDto<List<BookDto>> getList4Adviser(@RequestHeader("token") String token, @RequestParam(value = "num") Integer num) throws BizException, PermissionException, JsonParseException; ResponseDto<List<BookDto>> getList4Adviser(@RequestHeader("token") String token, @RequestParam(value = "num") Integer num,
@RequestParam(value = "isPrint", required = false) Boolean isPrint) throws BizException, PermissionException, JsonParseException;
@ApiOperation(value = "获取书籍的详细信息(微信客户端)", httpMethod = "GET") @ApiOperation(value = "获取书籍的详细信息(微信客户端)", httpMethod = "GET")
@ApiImplicitParams({ @ApiImplicitParams({
...@@ -370,7 +376,9 @@ public interface BookFacade { ...@@ -370,7 +376,9 @@ public interface BookFacade {
@ApiImplicitParam(name = "isFundSupport", value = "基金支持", dataType = "int", paramType = "query"), @ApiImplicitParam(name = "isFundSupport", value = "基金支持", dataType = "int", paramType = "query"),
@ApiImplicitParam(name = "isbn", value = "isbn", dataType = "string", paramType = "query"), @ApiImplicitParam(name = "isbn", value = "isbn", dataType = "string", paramType = "query"),
@ApiImplicitParam(name = "templetId", value = "图书类型标识", dataType = "long", paramType = "query"), @ApiImplicitParam(name = "templetId", value = "图书类型标识", dataType = "long", paramType = "query"),
@ApiImplicitParam(name = "secondTempletId", value = "图书类型二级标识", dataType = "long", paramType = "query")}) @ApiImplicitParam(name = "secondTempletId", value = "图书类型二级标识", dataType = "long", paramType = "query"),
@ApiImplicitParam(name = "isPrint", value = "是否已下印", dataType = "Boolean", paramType = "query")
})
@RequestMapping(value = "listPage4Agent", method = RequestMethod.GET) @RequestMapping(value = "listPage4Agent", method = RequestMethod.GET)
ResponseDto<PageBean> listPage4Agent(@RequestHeader("token") String token, ResponseDto<PageBean> listPage4Agent(@RequestHeader("token") String token,
@RequestParam(value = "bookName", required = false) String bookName, @RequestParam(value = "bookName", required = false) String bookName,
...@@ -382,7 +390,8 @@ public interface BookFacade { ...@@ -382,7 +390,8 @@ public interface BookFacade {
@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,
@RequestParam(value = "secondTempletId", required = false) Long secondTempletId) @RequestParam(value = "secondTempletId", required = false) Long secondTempletId,
@RequestParam(value = "isPrint", required = false) Boolean isPrint)
throws BizException, PermissionException, JsonParseException; throws BizException, PermissionException, JsonParseException;
/** /**
...@@ -476,7 +485,9 @@ public interface BookFacade { ...@@ -476,7 +485,9 @@ public interface BookFacade {
@ApiImplicitParam(name = "bookName", value = "书刊名称", dataType = "string", paramType = "query"), @ApiImplicitParam(name = "bookName", value = "书刊名称", dataType = "string", paramType = "query"),
@ApiImplicitParam(name = "currentPage", value = "当前页数", dataType = "int", paramType = "query"), @ApiImplicitParam(name = "currentPage", value = "当前页数", dataType = "int", paramType = "query"),
@ApiImplicitParam(name = "numPerPage", value = "每页条数", dataType = "int", paramType = "query"), @ApiImplicitParam(name = "numPerPage", value = "每页条数", dataType = "int", paramType = "query"),
@ApiImplicitParam(name = "secondTempletId", value = "书刊分类二级列表标识", dataType = "long", paramType = "query")}) @ApiImplicitParam(name = "secondTempletId", value = "书刊分类二级列表标识", dataType = "long", paramType = "query"),
@ApiImplicitParam(name = "isPrint", value = "是否已下印", dataType = "Boolean", paramType = "query")
})
@RequestMapping(value = "listBookClassify", method = RequestMethod.GET) @RequestMapping(value = "listBookClassify", method = RequestMethod.GET)
ResponseDto<PageBean> listBookClassify(@RequestHeader("token") String token, ResponseDto<PageBean> listBookClassify(@RequestHeader("token") String token,
@RequestParam(value = "typeCode", required = false) String typeCode, @RequestParam(value = "typeCode", required = false) String typeCode,
...@@ -487,7 +498,8 @@ public interface BookFacade { ...@@ -487,7 +498,8 @@ public interface BookFacade {
@RequestParam(value = "publish", required = false) String publish, @RequestParam(value = "publish", required = false) String publish,
@RequestParam(value = "currentPage") Integer currentPage, @RequestParam(value = "currentPage") Integer currentPage,
@RequestParam(value = "numPerPage") Integer numPerPage, @RequestParam(value = "numPerPage") Integer numPerPage,
@RequestParam(value = "secondTempletId", required = false) Long secondTempletId) @RequestParam(value = "secondTempletId", required = false) Long secondTempletId,
@RequestParam(value = "isPrint", required = false) Boolean isPrint)
throws BizException, PermissionException, JsonParseException; throws BizException, PermissionException, JsonParseException;
......
...@@ -3,6 +3,16 @@ ...@@ -3,6 +3,16 @@
*/ */
package com.pcloud.book.book.facade.impl; package com.pcloud.book.book.facade.impl;
import java.util.ArrayList;
import java.util.List;
import org.codehaus.jackson.JsonParseException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import com.pcloud.book.base.dto.CountDto; import com.pcloud.book.base.dto.CountDto;
import com.pcloud.book.book.biz.BookAdviserBiz; import com.pcloud.book.book.biz.BookAdviserBiz;
import com.pcloud.book.book.dto.AdviserManageDto; import com.pcloud.book.book.dto.AdviserManageDto;
...@@ -14,17 +24,6 @@ import com.pcloud.common.dto.ResponseDto; ...@@ -14,17 +24,6 @@ import com.pcloud.common.dto.ResponseDto;
import com.pcloud.common.exceptions.BizException; import com.pcloud.common.exceptions.BizException;
import com.pcloud.common.permission.PermissionException; import com.pcloud.common.permission.PermissionException;
import com.pcloud.common.utils.SessionUtil; import com.pcloud.common.utils.SessionUtil;
import org.codehaus.jackson.JsonParseException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.util.ArrayList;
import java.util.List;
/** /**
* @描述:顾问书籍管理接口实现类 * @描述:顾问书籍管理接口实现类
...@@ -180,4 +179,16 @@ public class BookAdviserFacadeImpl implements BookAdviserFacade { ...@@ -180,4 +179,16 @@ public class BookAdviserFacadeImpl implements BookAdviserFacade {
SessionUtil.getVlaue(token, SessionUtil.PARTY_ID); SessionUtil.getVlaue(token, SessionUtil.PARTY_ID);
return new ResponseDto<>(bookAdviserBiz.listAdviserBook4Erp(isbn, uniqueNumber, adviserName, currentPage, numPerPage)); return new ResponseDto<>(bookAdviserBiz.listAdviserBook4Erp(isbn, uniqueNumber, adviserName, currentPage, numPerPage));
} }
/**
* 设置书刊是否已下印状态
*/
@Override
@RequestMapping(value = "setIsPrint", method = RequestMethod.POST)
public ResponseDto<?> setIsPrint(@RequestHeader("token") String token,
@RequestBody BookAdviser bookAdviser) throws BizException, PermissionException, JsonParseException {
SessionUtil.getToken4Redis(token);
bookAdviserBiz.setIsPrint(bookAdviser);
return new ResponseDto<>();
}
} }
...@@ -258,7 +258,8 @@ public class BookFacadeImpl implements BookFacade { ...@@ -258,7 +258,8 @@ public class BookFacadeImpl implements BookFacade {
@RequestParam(value = "templetId", required = false) Long templetId, @RequestParam(value = "templetId", required = false) Long templetId,
@RequestParam(value = "bookStatus", required = false) Integer bookStatus, @RequestParam(value = "bookStatus", required = false) Integer bookStatus,
@RequestParam(value = "secondTempletId",required = false) Long secondTempletId, @RequestParam(value = "secondTempletId",required = false) Long secondTempletId,
@RequestParam(value = "hasQrcode",required = false) Integer hasQrcode) @RequestParam(value = "hasQrcode",required = false) Integer hasQrcode,
@RequestParam(value = "isPrint", required = false) Boolean isPrint)
throws BizException, PermissionException { 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) {
...@@ -278,15 +279,17 @@ public class BookFacadeImpl implements BookFacade { ...@@ -278,15 +279,17 @@ public class BookFacadeImpl implements BookFacade {
paramMap.put("bookStatus", bookStatus); 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("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); PageBean pageBean = bookBiz.getListPage4Adviser(paramMap, new PageParam(currentPage, numPerPage), adviserId, hasQrcode);
return new ResponseDto<>(pageBean); return new ResponseDto<>(pageBean);
} }
@GetMapping("getList4Adviser") @GetMapping("getList4Adviser")
@Override @Override
public ResponseDto<List<BookDto>> getList4Adviser(@RequestHeader("token") String token, @RequestParam(value = "num") Integer num) 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); Long adviserId = (Long) SessionUtil.getVlaue(token, SessionUtil.PARTY_ID);
List<BookDto> bookDtos = bookBiz.getList4Adviser(adviserId, num); List<BookDto> bookDtos = bookBiz.getList4Adviser(adviserId, num, isPrint);
return new ResponseDto<>(ListUtils.isEmpty(bookDtos) ? Lists.newArrayList() : bookDtos); return new ResponseDto<>(ListUtils.isEmpty(bookDtos) ? Lists.newArrayList() : bookDtos);
} }
...@@ -503,7 +506,8 @@ public class BookFacadeImpl implements BookFacade { ...@@ -503,7 +506,8 @@ public class BookFacadeImpl implements BookFacade {
@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,
@RequestParam(value = "secondTempletId", required = false) Long secondTempletId) @RequestParam(value = "secondTempletId", required = false) Long secondTempletId,
@RequestParam(value = "isPrint", required = false) Boolean isPrint)
throws BizException, PermissionException { throws BizException, PermissionException {
Long agentId = (Long) SessionUtil.getVlaue(token, SessionUtil.PARTY_ID); Long agentId = (Long) SessionUtil.getVlaue(token, SessionUtil.PARTY_ID);
if (currentPage < 0 || numPerPage < 0) { if (currentPage < 0 || numPerPage < 0) {
...@@ -520,6 +524,7 @@ public class BookFacadeImpl implements BookFacade { ...@@ -520,6 +524,7 @@ public class BookFacadeImpl implements BookFacade {
paramMap.put("templetId", templetId); paramMap.put("templetId", templetId);
paramMap.put("secondTempletId",secondTempletId); paramMap.put("secondTempletId",secondTempletId);
paramMap.put("secondTempletIds",Optional.ofNullable(paramMap.get("secondTempletId")).map(Lists::newArrayList).orElse(Lists.newArrayList())); paramMap.put("secondTempletIds",Optional.ofNullable(paramMap.get("secondTempletId")).map(Lists::newArrayList).orElse(Lists.newArrayList()));
paramMap.put("isPrint", isPrint);
return new ResponseDto<>( return new ResponseDto<>(
bookBiz.listPage4Agent(new PageParam(currentPage, numPerPage), paramMap, agentId)); bookBiz.listPage4Agent(new PageParam(currentPage, numPerPage), paramMap, agentId));
} }
...@@ -638,7 +643,8 @@ public class BookFacadeImpl implements BookFacade { ...@@ -638,7 +643,8 @@ public class BookFacadeImpl implements BookFacade {
@RequestParam(value = "publish", required = false) String publish, @RequestParam(value = "publish", required = false) String publish,
@RequestParam(value = "currentPage") Integer currentPage, @RequestParam(value = "currentPage") Integer currentPage,
@RequestParam(value = "numPerPage") Integer numPerPage, @RequestParam(value = "numPerPage") Integer numPerPage,
@RequestParam(value = "secondTempletId", required = false) Long secondTempletId) @RequestParam(value = "secondTempletId", required = false) Long secondTempletId,
@RequestParam(value = "isPrint", required = false) Boolean isPrint)
throws BizException, PermissionException { 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) {
...@@ -657,6 +663,7 @@ public class BookFacadeImpl implements BookFacade { ...@@ -657,6 +663,7 @@ public class BookFacadeImpl implements BookFacade {
String[] bookNameList = bookName.trim().split("\\s+"); String[] bookNameList = bookName.trim().split("\\s+");
paramMap.put("bookNameList",Lists.newArrayList(bookNameList)); paramMap.put("bookNameList",Lists.newArrayList(bookNameList));
} }
paramMap.put("isPrint", isPrint);
PageBean pageBean = bookBiz.listBookClassify(new PageParam(currentPage, numPerPage), paramMap); PageBean pageBean = bookBiz.listBookClassify(new PageParam(currentPage, numPerPage), paramMap);
return new ResponseDto<>(pageBean); return new ResponseDto<>(pageBean);
} }
......
...@@ -137,6 +137,7 @@ public interface BookGroupFacade { ...@@ -137,6 +137,7 @@ public interface BookGroupFacade {
@ApiImplicitParam(name = "startDate", value = "开始时间", dataType = "string", paramType = "query"), @ApiImplicitParam(name = "startDate", value = "开始时间", dataType = "string", paramType = "query"),
@ApiImplicitParam(name = "endDate", value = "结束时间", dataType = "string", paramType = "query"), @ApiImplicitParam(name = "endDate", value = "结束时间", dataType = "string", paramType = "query"),
@ApiImplicitParam(name = "hasServe", value = "结束时间", dataType = "boolean", paramType = "query"), @ApiImplicitParam(name = "hasServe", value = "结束时间", dataType = "boolean", paramType = "query"),
@ApiImplicitParam(name = "isPrint", value = "是否已下印", dataType = "Boolean", paramType = "query")
}) })
@RequestMapping(value = "listBookGroup4Adviser", method = RequestMethod.GET) @RequestMapping(value = "listBookGroup4Adviser", method = RequestMethod.GET)
ResponseDto<PageBean> listBookGroup4Adviser(@RequestHeader("token") String token, ResponseDto<PageBean> listBookGroup4Adviser(@RequestHeader("token") String token,
...@@ -153,7 +154,8 @@ public interface BookGroupFacade { ...@@ -153,7 +154,8 @@ public interface BookGroupFacade {
@RequestParam(value = "joinGroupType", required = false) String joinGroupType, @RequestParam(value = "joinGroupType", required = false) String joinGroupType,
@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 = "hasServe", required = false) Boolean hasServe) @RequestParam(value = "hasServe", required = false) Boolean hasServe,
@RequestParam(value = "isPrint", required = false) Boolean isPrint)
throws BizException, PermissionException; throws BizException, PermissionException;
@ApiOperation(value = "获取社群书列表(运营)", httpMethod = "POST") @ApiOperation(value = "获取社群书列表(运营)", httpMethod = "POST")
......
...@@ -198,7 +198,8 @@ public class BookGroupFacadeImpl implements BookGroupFacade { ...@@ -198,7 +198,8 @@ public class BookGroupFacadeImpl implements BookGroupFacade {
@RequestParam(value = "joinGroupType", required = false) String joinGroupType, @RequestParam(value = "joinGroupType", required = false) String joinGroupType,
@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 = "hasServe", required = false) Boolean hasServe) @RequestParam(value = "hasServe", required = false) Boolean hasServe,
@RequestParam(value = "isPrint", required = false) Boolean isPrint)
throws BizException, PermissionException { 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) {
...@@ -228,6 +229,7 @@ public class BookGroupFacadeImpl implements BookGroupFacade { ...@@ -228,6 +229,7 @@ public class BookGroupFacadeImpl implements BookGroupFacade {
paramMap.put("endDate", endDate + " 23:59:59"); paramMap.put("endDate", endDate + " 23:59:59");
} }
paramMap.put("hasServe", hasServe); paramMap.put("hasServe", hasServe);
paramMap.put("isPrint", isPrint);
PageBean pageBean = bookGroupBiz.listBookGroup4Adviser(paramMap, new PageParam(currentPage, numPerPage), adviserId); PageBean pageBean = bookGroupBiz.listBookGroup4Adviser(paramMap, new PageParam(currentPage, numPerPage), adviserId);
return new ResponseDto<>(pageBean); return new ResponseDto<>(pageBean);
} }
......
...@@ -290,7 +290,7 @@ ...@@ -290,7 +290,7 @@
B.BOOK_ID, B.TYPE_CODE,B.ISBN, B.BOOK_NAME,T.TYPE_NAME, B.REMARK, B.AUTHOR, B.PUBLISH, B.BOOK_ID, B.TYPE_CODE,B.ISBN, B.BOOK_NAME,T.TYPE_NAME, B.REMARK, B.AUTHOR, B.PUBLISH,
B.PUBLISH_DATE, B.COVER_IMG, B.AD_IMG, B.DETAIL, B.`VERSION`,B.BOOK_PRICE,B.ISSN,B.SERIAL_NUMBER,BA.IS_MAIN_EDITOR, B.PUBLISH_DATE, B.COVER_IMG, B.AD_IMG, B.DETAIL, B.`VERSION`,B.BOOK_PRICE,B.ISSN,B.SERIAL_NUMBER,BA.IS_MAIN_EDITOR,
IF(ISNULL(BF.BOOK_FUND_ID),0,1) IS_FUND_SUPPORT,START_TIME,END_TIME,BA.TEMPLET_ID,BA.SECOND_TEMPLET_ID, IF(ISNULL(BF.BOOK_FUND_ID),0,1) IS_FUND_SUPPORT,START_TIME,END_TIME,BA.TEMPLET_ID,BA.SECOND_TEMPLET_ID,
BA.GRA_LABEL_ID,BA.SUB_LABEL_ID,BA.VER_LABEL_ID,BA.AREA_LABEL_ID BA.GRA_LABEL_ID,BA.SUB_LABEL_ID,BA.VER_LABEL_ID,BA.AREA_LABEL_ID, BA.IS_PRINT isPrint
FROM FROM
BOOK_ADVISER BA BOOK_ADVISER BA
INNER JOIN INNER JOIN
...@@ -467,7 +467,7 @@ ...@@ -467,7 +467,7 @@
A.BOOK_ID, A.CHANNEL_ID, A.ADVISER_ID, A.IS_MAIN_EDITOR, T.TYPE_CODE, T.TYPE_NAME, B.ISBN, B.BOOK_NAME, B.REMARK, A.BOOK_ID, A.CHANNEL_ID, A.ADVISER_ID, A.IS_MAIN_EDITOR, T.TYPE_CODE, T.TYPE_NAME, B.ISBN, B.BOOK_NAME, B.REMARK,
B.AUTHOR, B.PUBLISH, B.PUBLISH_DATE, B.COVER_IMG, B.ORIGIN_NAME, B.BOOK_PRICE, B.ISSN, B.BOOK_NUM, B.SERIAL_NUMBER, B.AUTHOR, B.PUBLISH, B.PUBLISH_DATE, B.COVER_IMG, B.ORIGIN_NAME, B.BOOK_PRICE, B.ISSN, B.BOOK_NUM, B.SERIAL_NUMBER,
IF(ISNULL(BF.BOOK_FUND_ID),0,1) IS_FUND_SUPPORT,A.TEMPLET_ID, if(G.ID IS NULL, A.LAST_MODIFIED_DATE, G.UPDATE_TIME) LAST_MODIFIED_DATE, IF(ISNULL(BF.BOOK_FUND_ID),0,1) IS_FUND_SUPPORT,A.TEMPLET_ID, if(G.ID IS NULL, A.LAST_MODIFIED_DATE, G.UPDATE_TIME) LAST_MODIFIED_DATE,
A.BOOK_ADVISER_ID,I.BOOK_STATUS, CONCAT('BK',A.BOOK_ID) uniqueNumber, if(G.ID IS NULL, 0, 1) isBookGroup A.BOOK_ADVISER_ID,I.BOOK_STATUS, CONCAT('BK',A.BOOK_ID) uniqueNumber, if(G.ID IS NULL, 0, 1) isBookGroup, A.IS_PRINT isPrint
FROM FROM
BOOK_ADVISER A BOOK_ADVISER A
INNER JOIN BOOK B ON A.BOOK_ID = B.BOOK_ID AND A.ADVISER_ID = #{adviserId} AND A.IS_DELETE = 0 AND B.IS_DELETE = 0 INNER JOIN BOOK B ON A.BOOK_ID = B.BOOK_ID AND A.ADVISER_ID = #{adviserId} AND A.IS_DELETE = 0 AND B.IS_DELETE = 0
...@@ -531,6 +531,10 @@ ...@@ -531,6 +531,10 @@
AND AND
I.book_status = #{bookStatus} I.book_status = #{bookStatus}
</if> </if>
<if test="isPrint != null">
AND
A.IS_PRINT = #{isPrint}
</if>
<if test="bookIds != null"> <if test="bookIds != null">
<foreach collection="bookIds" index="index" item="item" open="and (" separator="or" close=")"> <foreach collection="bookIds" index="index" item="item" open="and (" separator="or" close=")">
<if test="item.bookId != null and item.channelId != null"> <if test="item.bookId != null and item.channelId != null">
...@@ -580,7 +584,7 @@ ...@@ -580,7 +584,7 @@
WHEN 1 then bk.id WHEN 1 then bk.id
WHEN 2 THEN bgs.id WHEN 2 THEN bgs.id
WHEN 3 THEN srk.id WHEN 3 THEN srk.id
else null END,0)=0,0,1)as has_serve else null END,0)=0,0,1)as has_serve, A.IS_PRINT isPrint
FROM FROM
book_group G book_group G
LEFT JOIN BOOK_ADVISER A ON G.BOOK_ID = A.BOOK_ID AND G.CHANNEL_ID = A.CHANNEL_ID AND G.CREATE_USER = A.ADVISER_ID LEFT JOIN BOOK_ADVISER A ON G.BOOK_ID = A.BOOK_ID AND G.CHANNEL_ID = A.CHANNEL_ID AND G.CREATE_USER = A.ADVISER_ID
...@@ -649,6 +653,9 @@ ...@@ -649,6 +653,9 @@
<if test="hasServe!=null and hasServe==false"> <if test="hasServe!=null and hasServe==false">
having has_serve=0 having has_serve=0
</if> </if>
<if test="isPrint != null">
AND A.IS_PRINT = #{isPrint}
</if>
ORDER BY ORDER BY
G.UPDATE_TIME DESC G.UPDATE_TIME DESC
</select> </select>
...@@ -1105,7 +1112,7 @@ ...@@ -1105,7 +1112,7 @@
SELECT SELECT
A.BOOK_ID, A.CHANNEL_ID, A.ADVISER_ID, A.IS_MAIN_EDITOR, T.TYPE_CODE, T.TYPE_NAME, B.ISBN, B.BOOK_NAME, B.REMARK, A.BOOK_ID, A.CHANNEL_ID, A.ADVISER_ID, A.IS_MAIN_EDITOR, T.TYPE_CODE, T.TYPE_NAME, B.ISBN, B.BOOK_NAME, B.REMARK,
B.AUTHOR, B.PUBLISH, B.PUBLISH_DATE, B.COVER_IMG, B.ORIGIN_NAME, B.BOOK_PRICE, B.ISSN, B.BOOK_NUM, B.SERIAL_NUMBER, B.AUTHOR, B.PUBLISH, B.PUBLISH_DATE, B.COVER_IMG, B.ORIGIN_NAME, B.BOOK_PRICE, B.ISSN, B.BOOK_NUM, B.SERIAL_NUMBER,
IF(ISNULL(BF.BOOK_FUND_ID),0,1) IS_FUND_SUPPORT, A.TEMPLET_ID IF(ISNULL(BF.BOOK_FUND_ID),0,1) IS_FUND_SUPPORT, A.TEMPLET_ID, A.IS_PRINT isPrint
FROM FROM
BOOK_ADVISER A BOOK_ADVISER A
INNER JOIN INNER JOIN
...@@ -1167,6 +1174,10 @@ ...@@ -1167,6 +1174,10 @@
AND AND
BF.BOOK_FUND_ID IS NOT NULL BF.BOOK_FUND_ID IS NOT NULL
</if> </if>
<if test="isPrint != null">
AND
A.IS_PRINT = #{isPrint}
</if>
GROUP BY A.BOOK_ID, A.CHANNEL_ID GROUP BY A.BOOK_ID, A.CHANNEL_ID
ORDER BY ORDER BY
A.CREATED_DATE DESC A.CREATED_DATE DESC
...@@ -1292,7 +1303,7 @@ ...@@ -1292,7 +1303,7 @@
SELECT SELECT
b.BOOK_ID, b.BOOK_NAME, b.COVER_IMG, b.ISBN,b.SERIAL_NUMBER, b.PUBLISH, b.BOOK_ID, b.BOOK_NAME, b.COVER_IMG, b.ISBN,b.SERIAL_NUMBER, b.PUBLISH,
ba.ADVISER_ID, ba.TEMPLET_ID, ba.CHANNEL_ID, ba.CREATED_DATE, ba.ADVISER_ID, ba.TEMPLET_ID, ba.CHANNEL_ID, ba.CREATED_DATE,
bt.TYPE_NAME bt.TYPE_NAME, ba.IS_PRINT isPrint
FROM FROM
BOOK_ADVISER ba BOOK_ADVISER ba
JOIN JOIN
...@@ -1338,6 +1349,9 @@ ...@@ -1338,6 +1349,9 @@
<if test="publish!=null"> <if test="publish!=null">
AND b.PUBLISH LIKE CONCAT('%', #{publish},'%') AND b.PUBLISH LIKE CONCAT('%', #{publish},'%')
</if> </if>
<if test="isPrint != null">
AND ba.IS_PRINT = #{isPrint}
</if>
</select> </select>
<select id="listBookClassifyCount" resultType="Long" parameterType="map"> <select id="listBookClassifyCount" resultType="Long" parameterType="map">
...@@ -1386,6 +1400,9 @@ ...@@ -1386,6 +1400,9 @@
<if test="publish!=null"> <if test="publish!=null">
AND b.PUBLISH LIKE CONCAT('%', #{publish},'%') AND b.PUBLISH LIKE CONCAT('%', #{publish},'%')
</if> </if>
<if test="isPrint != null">
AND ba.IS_PRINT = #{isPrint}
</if>
</select> </select>
......
...@@ -230,7 +230,8 @@ ...@@ -230,7 +230,8 @@
UPDATE UPDATE
BOOK_ADVISER BOOK_ADVISER
SET SET
IS_DELETE = 1 IS_DELETE = 1,
LAST_MODIFIED_DATE = NOW()
WHERE WHERE
BOOK_ID = #{bookId, jdbcType=BIGINT} BOOK_ID = #{bookId, jdbcType=BIGINT}
AND AND
...@@ -392,6 +393,7 @@ ...@@ -392,6 +393,7 @@
<if test="areaLabelId!=null"> <if test="areaLabelId!=null">
,AREA_LABEL_ID = #{areaLabelId, jdbcType=BIGINT} ,AREA_LABEL_ID = #{areaLabelId, jdbcType=BIGINT}
</if> </if>
, LAST_MODIFIED_DATE = NOW()
WHERE WHERE
BOOK_ID = #{bookId, jdbcType=BIGINT} BOOK_ID = #{bookId, jdbcType=BIGINT}
AND AND
...@@ -593,4 +595,17 @@ ...@@ -593,4 +595,17 @@
ORDER BY ORDER BY
ba.CREATED_DATE DESC ba.CREATED_DATE DESC
</select> </select>
<!-- 设置书刊是否已下印状态 -->
<update id="setIsPrint" parameterType="bookAdviser">
update
book_adviser
set
IS_PRINT = #{isPrint}
where
BOOK_ID = #{bookId}
<if test="channelId != null">
and CHANNEL_ID = #{channelId}
</if>
</update>
</mapper> </mapper>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment