Commit ba38a53f by 田超

Merge branch 'feature/1003612' into 'master'

feat: [1003612] ERP新增书刊二级分类字段。部分RAYS书刊的分类、标签、序号信息同步到ERP关联的书刊

See merge request rays/pcloud-book!990
parents 47878897 0abca45e
......@@ -121,5 +121,18 @@ public class BookAdviserDto extends BaseDto {
*/
private Long volLabelId;
/**
* 专业
*/
private Long depLabelId;
/**
* 深度
*/
private Long proLabelId;
/**
* 目的
*/
private Long purLabelId;
}
......@@ -264,4 +264,6 @@ public interface BookAdviserBiz {
Integer getIsRui(Long adviserId, Long bookId, Long channelId);
PageBeanNew<PcloudAdviserBookVO> listAdviserBook4Pcloud(String keyword, Integer currentPage, Integer numPerPage);
Map<String, BookAdviserDto> getBookInfoByBookIds(List<Long> bookIds, List<Long> adviserIds, List<Long> channelIds);
}
......@@ -1392,4 +1392,24 @@ public class BookAdviserBizImpl implements BookAdviserBiz {
return pageBeanNew;
}
@Override
public Map<String, BookAdviserDto> getBookInfoByBookIds(List<Long> bookIds, List<Long> adviserIds, List<Long> channelIds) {
if(CollectionUtils.isEmpty(bookIds) || CollectionUtils.isEmpty(adviserIds) || CollectionUtils.isEmpty(channelIds)){
return new HashMap<>();
}
List<BookAdviserDto> bookAdviserDtos = bookAdviserDao.getBookInfoByBookIds(bookIds, adviserIds, channelIds);
if(CollectionUtils.isEmpty(bookAdviserDtos)){
return new HashMap<>();
}
Map<String, BookAdviserDto> resultMap = new HashMap<>();
for (BookAdviserDto bookAdviserDto : bookAdviserDtos) {
String bookAdviserChannelId = bookAdviserDto.getBookId() + "_" + bookAdviserDto.getAdviserId() + "_" + bookAdviserDto.getChannelId();
if(resultMap.containsKey(bookAdviserChannelId)){
continue;
}
resultMap.put(bookAdviserChannelId, bookAdviserDto);
}
return resultMap;
}
}
......@@ -285,4 +285,6 @@ public interface BookAdviserDao extends BaseDao<BookAdviser> {
Long getRayBookCount(String startTime, String endTime);
Integer getIsRui(Long adviserId, Long bookId, Long channelId);
List<BookAdviserDto> getBookInfoByBookIds(List<Long> bookIds, List<Long> adviserIds, List<Long> channelIds);
}
......@@ -300,4 +300,12 @@ public class BookAdviserDaoImpl extends BaseDaoImpl<BookAdviser> implements Book
return super.getSqlSession().selectOne(this.getStatement("getIsRui"), paramMap);
}
@Override
public List<BookAdviserDto> getBookInfoByBookIds(List<Long> bookIds, List<Long> adviserIds, List<Long> channelIds) {
Map<String, Object> paramMap = new HashMap<>();
paramMap.put("bookIds", bookIds);
paramMap.put("adviserIds", adviserIds);
paramMap.put("channelIds", channelIds);
return super.getSqlSession().selectList(this.getStatement("getBookInfoByBookIds"), paramMap);
}
}
......@@ -248,4 +248,8 @@ public interface BookAdviserFacade {
@GetMapping("getRayBookCountAndRate")
ResponseDto<?> getRayBookCountAndRate(@RequestParam(value = "showRate", defaultValue = "false") Boolean showRate);
@ApiOperation("获取书刊分类及标签信息")
@PostMapping("getBookInfoByBookIds")
ResponseDto<?> getBookInfoByBookIds(@RequestBody MapResourceTotalCountDTO mapResourceTotalCountDTO);
}
......@@ -261,4 +261,9 @@ public class BookAdviserFacadeImpl implements BookAdviserFacade {
return new ResponseDto<>(bookAdviserBiz.getRayBookCountAndRate(showRate));
}
@Override
@PostMapping("getBookInfoByBookIds")
public ResponseDto<?> getBookInfoByBookIds(@RequestBody MapResourceTotalCountDTO mapResourceTotalCountDTO) {
return new ResponseDto<>(bookAdviserBiz.getBookInfoByBookIds(mapResourceTotalCountDTO.getBookIds(), mapResourceTotalCountDTO.getAdviserIds(), mapResourceTotalCountDTO.getChannelIds()));
}
}
......@@ -22,6 +22,9 @@
<result column="AREA_LABEL_ID" property="areaLabelId" jdbcType="BIGINT" />
<result column="is_open_robot_process" property="isOpenRobotProcess" jdbcType="BIT" />
<result column="vol_label_id" property="volLabelId" jdbcType="BIGINT" />
<result column="dep_label_id" property="depLabelId" jdbcType="BIGINT" />
<result column="pro_label_id" property="proLabelId" jdbcType="BIGINT" />
<result column="pur_label_id" property="purLabelId" jdbcType="BIGINT" />
</resultMap>
<resultMap id="manageAdviserMap" type="adviserManageDto" >
......@@ -833,5 +836,23 @@
limit 1
</select>
<select id="getBookInfoByBookIds" resultMap="bookAdviserMap">
SELECT BOOK_ID,ADVISER_ID,CHANNEL_ID,TEMPLET_ID,CREATED_USER,SECOND_TEMPLET_ID,
GRA_LABEL_ID,SUB_LABEL_ID,VER_LABEL_ID,AREA_LABEL_ID,dep_label_id,pro_label_id,pur_label_id,vol_label_id
FROM book_adviser
WHERE is_delete = 0
AND BOOK_ID IN
<foreach collection="bookIds" index="i" item="item" open="(" separator="," close=")">
${item}
</foreach>
AND ADVISER_ID IN
<foreach collection="adviserIds" index="i" item="item" open="(" separator="," close=")">
${item}
</foreach>
AND CHANNEL_ID IN
<foreach collection="channelIds" index="i" item="item" open="(" separator="," close=")">
${item}
</foreach>
</select>
</mapper>
\ No newline at end of file
</mapper>
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