Commit f115e206 by 吴博

feat:[1004987] 平台端-资源管理-书刊管理-基金书 搜索支持bookId搜索

parent 38165a3e
......@@ -789,4 +789,6 @@ public interface BookBiz {
* @param vo
*/
void syncRelateDataToRays(SyncRelateDataToRaysVO vo);
boolean checkIsBookId(Long isbnNumber);
}
......@@ -4292,4 +4292,9 @@ public class BookBizImpl implements BookBiz {
book.setForceUpdateSerialNumber(YesOrNoEnums.YES.getValue());
this.updateBookAndBookType(book);
}
@Override
public boolean checkIsBookId(Long isbnNumber) {
return bookDao.checkIsBookId(isbnNumber);
}
}
package com.pcloud.book.book.biz.impl;
import com.pcloud.book.base.enums.BookFreezeEnum;
import com.pcloud.book.book.biz.BookBiz;
import com.pcloud.book.book.dao.BookTypeDao;
import com.pcloud.book.book.dto.BookDto;
import com.pcloud.book.book.dto.BookFundDto;
......@@ -14,10 +15,12 @@ import com.pcloud.book.util.common.Converter;
import com.pcloud.common.core.constant.SystemCode;
import com.pcloud.common.exceptions.BizException;
import com.pcloud.common.page.PageBeanNew;
import com.pcloud.common.utils.string.StringUtil;
import com.pcloud.universe.commons.paging.Pagination;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.collections4.MapUtils;
import org.apache.commons.lang3.BooleanUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
......@@ -35,8 +38,18 @@ public class BookElasticSearchBizImpl {
@Autowired
private BookElasticSearchConsr bookElasticSearchConsr;
@Autowired
private BookBiz bookBiz;
public PageBeanNew<BookDto> getListPage(PlatformSearchDto dto) throws BizException {
if (!StringUtil.isEmpty(dto.getIsbn()) && StringUtils.isNumeric(dto.getIsbn())) {
Long isbnNumber = Long.valueOf(dto.getIsbn());
if(checkIsBookId(isbnNumber)) {
dto.setBookId(isbnNumber);
dto.setIsbn(null);
}
}
Pagination<Es7Book> esResult = bookElasticSearchConsr.search(dto);
List<BookDto> bookList = new ArrayList<>();
......@@ -57,6 +70,10 @@ public class BookElasticSearchBizImpl {
return result;
}
private boolean checkIsBookId(Long isbnNumber) {
return bookBiz.checkIsBookId(isbnNumber);
}
private BookDto doBookProcess(Es7Book esBook, Map<Long, String> pcloudUserMap, Map<String, BookTypeDto> typeCodeMap) {
BookDto bookDto = Converter.convert(esBook);
......
......@@ -382,4 +382,6 @@ public interface BookDao extends BaseDao<Book> {
Integer getFundBookCounts(List<Long> advisers,int month);
Integer getBookCountByAdviserId(Long adviserId);
boolean checkIsBookId(Long isbnNumber);
}
......@@ -460,4 +460,9 @@ public class BookDaoImpl extends BaseDaoImpl<Book> implements BookDao {
public Integer getBookCountByAdviserId(Long adviserId) {
return getSessionTemplate().selectOne(getStatement("getBookCountByAdviserId"), adviserId);
}
@Override
public boolean checkIsBookId(Long isbnNumber) {
return getSessionTemplate().selectOne(getStatement("checkIsBookId"), isbnNumber);
}
}
......@@ -235,7 +235,7 @@ public class BookFacadeImpl implements BookFacade {
@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 )
@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) {
......
......@@ -2978,4 +2978,14 @@
GROUP BY A.BOOK_ID, A.CHANNEL_ID
)a
</select>
<select id="checkIsBookId" parameterType="long" resultType="boolean">
select
count(1)
from
book
where
book_id = #{isbnNumber}
and is_delete = 0
</select>
</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