Commit ae95e994 by 田超

Merge branch 'feature/1004987' into 'master'

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

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