Commit 22e9627f by 高鹏

Merge branch 'fix-rsy' into 'master'

修改一些bug,加上个人码书籍简称不能为纯数字的校验

See merge request rays/pcloud-book!312
parents abbf0ec8 b2be79d3
......@@ -684,6 +684,20 @@ public class BookGroupBizImpl implements BookGroupBiz {
@ParamLog("判断书籍简称是否重复")
private void checkShortBookName(BookGroup bookGroup) {
if (!StringUtil.isEmpty(bookGroup.getShortBookName())) {
//判断是否为纯数字,不能为纯数字
if (!StringUtil.isEmpty(bookGroup.getShortBookName())) {
String shortBookName = bookGroup.getShortBookName();
Boolean allNum = true;
for (int i = 0; i < shortBookName.length(); i++) {
int chr = shortBookName.charAt(i);
if (chr < 48 || chr > 57) {
allNum = false;
}
}
if (allNum) {
throw new BookBizException(BookBizException.PARAM_IS_ERROR, "参数有误!");
}
}
BookGroup byShortBookName = bookGroupDao.getByShortBookName(bookGroup.getShortBookName());
if (byShortBookName != null && !byShortBookName.getId().equals(bookGroup.getId())) {
throw new BookBizException(BookBizException.PARAM_IS_NULL, "书籍简称已存在,请重新设置");
......
......@@ -622,7 +622,8 @@
</if>
<if test="name != null">
AND
(B.BOOK_NAME LIKE CONCAT('%', #{name}, '%') OR G.group_qrcode_name LIKE CONCAT('%', #{name}, '%') OR B.ISBN LIKE CONCAT(#{name},'%') OR CONCAT('BK',A.BOOK_ID) = #{name})
(B.BOOK_NAME LIKE CONCAT('%', #{name}, '%') OR G.group_qrcode_name LIKE CONCAT('%', #{name}, '%') OR B.ISBN LIKE CONCAT(#{name},'%') OR CONCAT('BK',A.BOOK_ID) = #{name}
OR G.short_book_name LIKE CONCAT('%', #{name}, '%'))
</if>
<if test="isMainEditor != null">
AND
......
......@@ -915,6 +915,7 @@
select <include refid="Base_Column_List"/>
from book_group
where short_book_name =#{shortBookName}
and is_delete=0
limit 1
</select>
</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