Commit c72a7298 by huzhenkun

开放限制的数量

parent 6e4684d2
......@@ -43,7 +43,7 @@ public interface BookClockBiz {
* @param adviserId
* @return
*/
Map<String, List<Long>> getAdviserHasSelected(Long adviserId);
Map<String,List<BookClockInfoDTO>> getAdviserHasSelected(Long adviserId);
/**
......
......@@ -274,14 +274,27 @@ public class BookClockBizImpl implements BookClockBiz {
* @return
*/
@Override
public Map<String, List<Long>> getAdviserHasSelected(Long adviserId) {
Map<String, List<Long>> result = new HashMap<>();
public Map<String,List<BookClockInfoDTO>> getAdviserHasSelected(Long adviserId) {
Map<String,List<BookClockInfoDTO>> result = new HashMap<>();
List<BookClockInfoDTO> bookClockInfoDTOList = bookClockInfoDao.getOriginIdAndTypeByAdviserId(adviserId);
List<BookClockInfoDTO> appList = new ArrayList<>();
List<BookClockInfoDTO> productList = new ArrayList<>();
if (!ListUtils.isEmpty(bookClockInfoDTOList)) {
List<Long> appIds = bookClockInfoDTOList.stream().filter(bookClockInfoDTO -> OriginTypeEnum.APP.value.equalsIgnoreCase(bookClockInfoDTO.getOriginType())).map(BookClockInfoDTO::getOriginId).collect(Collectors.toList());
result.put(OriginTypeEnum.APP.value, ListUtils.isEmpty(appIds) ? Lists.newArrayList() : appIds);
List<Long> proIds = bookClockInfoDTOList.stream().filter(bookClockInfoDTO -> OriginTypeEnum.PRODUCT.value.equalsIgnoreCase(bookClockInfoDTO.getOriginType())).map(BookClockInfoDTO::getOriginId).collect(Collectors.toList());
result.put(OriginTypeEnum.PRODUCT.value, ListUtils.isEmpty(proIds) ? Lists.newArrayList() : proIds);
for (BookClockInfoDTO bookClockInfoDTO:bookClockInfoDTOList) {
BookClockInfoDTO newBookClockInfoDTO = new BookClockInfoDTO();
if(OriginTypeEnum.APP.value.equals(bookClockInfoDTO.getOriginType())){
newBookClockInfoDTO.setBookClockInfoId(bookClockInfoDTO.getBookClockInfoId());
newBookClockInfoDTO.setOriginId(bookClockInfoDTO.getOriginId());
appList.add(newBookClockInfoDTO);
}
if(OriginTypeEnum.PRODUCT.value.equals(bookClockInfoDTO.getOriginType())){
newBookClockInfoDTO.setBookClockInfoId(bookClockInfoDTO.getBookClockInfoId());
newBookClockInfoDTO.setOriginId(bookClockInfoDTO.getOriginId());
productList.add(newBookClockInfoDTO);
}
}
result.put("APP",appList);
result.put("PRODUCT",productList);
}
return result;
}
......
......@@ -62,12 +62,12 @@ public class BookClockCheckImpl implements BookClockCheck {
throw new BookBizException(BookBizException.ERROR,"运营平台为空!");
}
List<Long> bookGroupIdList = newBookClockInfo.getBookGroupIdList();
if(!ListUtils.isEmpty(bookGroupIdList) && bookGroupIdList.size() > 20){
throw new BookBizException(BookBizException.ERROR,"关联社群码不可超过20个!");
if(!ListUtils.isEmpty(bookGroupIdList) && bookGroupIdList.size() > 200){
throw new BookBizException(BookBizException.ERROR,"关联社群码不可超过200个!");
}
List<Long> classifyIdList = newBookClockInfo.getClassifyIdList();
if(!ListUtils.isEmpty(classifyIdList) && classifyIdList.size() > 50){
throw new BookBizException(BookBizException.ERROR,"关联分类不可超过50个!");
if(!ListUtils.isEmpty(classifyIdList) && classifyIdList.size() > 200){
throw new BookBizException(BookBizException.ERROR,"关联分类不可超过200个!");
}
if(null != newBookClockInfo.getIsNotice() && newBookClockInfo.getIsNotice()){
if(StringUtil.isEmpty(newBookClockInfo.getNoticeTime()) || StringUtil.isEmpty(newBookClockInfo.getNoticeContent())){
......
......@@ -302,6 +302,7 @@ public class BookGuideBizImpl implements BookGuideBiz {
List<BookClockKeywordDTO> bookClockKeywordDTOS = bookClockKeywordDao.getKeywordsByInfoId(paramMap);
bookClockKeywordDTOList.addAll(bookClockKeywordDTOS);
if(i%2 == 0){
log.info("欢迎语中推送关键词信息,bookClockKeywordDTOList="+bookClockKeywordDTOList);
SendWeixinRequestTools.sendClockKeywordsInfo(bookClockKeywordDTOList, robotId, weixinGroupId);
bookClockKeywordDTOList.clear();
}else if(i == bookClockInfoIdList.size()){
......
......@@ -120,7 +120,7 @@
<!-- 获取该编辑已选的超级作者作品及应用-->
<select id="getOriginIdAndTypeByAdviserId" parameterType="long" resultMap="BaseResultMapDTO">
SELECT origin_id,origin_type
SELECT book_clock_info_id,origin_id,origin_type
FROM book_clock_info
WHERE create_user = #{adviserId}
</select>
......
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