Commit bbc4a447 by 阮思源

校验群名称不能包含#

parent 6f4944e5
...@@ -418,6 +418,9 @@ public class BookGroupBizImpl implements BookGroupBiz { ...@@ -418,6 +418,9 @@ public class BookGroupBizImpl implements BookGroupBiz {
|| StringUtil.isEmpty(bookGroup.getJoinSlogan()) ) { || StringUtil.isEmpty(bookGroup.getJoinSlogan()) ) {
throw new BookBizException(BookBizException.PARAM_IS_ERROR, "参数有误!"); throw new BookBizException(BookBizException.PARAM_IS_ERROR, "参数有误!");
} }
if (bookGroup.getGroupQrcodeName().contains("#")){
throw new BookBizException(BookBizException.PARAM_IS_ERROR, "名称不能包含#!");
}
BookGroup group = bookGroupDao.getById(bookGroup.getId()); BookGroup group = bookGroupDao.getById(bookGroup.getId());
if (null == group) { if (null == group) {
throw new BookBizException(BookBizException.PARAM_IS_NULL, "群二维码不存在!"); throw new BookBizException(BookBizException.PARAM_IS_NULL, "群二维码不存在!");
......
...@@ -170,6 +170,9 @@ public class BookGroupClassifyBizImpl implements BookGroupClassifyBiz { ...@@ -170,6 +170,9 @@ public class BookGroupClassifyBizImpl implements BookGroupClassifyBiz {
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public void addClassify(AddClassifyVO addClassifyVO, Long partyId) { public void addClassify(AddClassifyVO addClassifyVO, Long partyId) {
checkClassifyIsExist(addClassifyVO.getClassify(), null, addClassifyVO.getBookGroupId()); checkClassifyIsExist(addClassifyVO.getClassify(), null, addClassifyVO.getBookGroupId());
if (addClassifyVO.getClassify() != null && addClassifyVO.getClassify().contains("#")) {
throw new BookBizException(BookBizException.ERROR, "名称不能包含#!");
}
final Map<Long, BookGroupStatisticDTO> statistic = bookGroupClassifyBiz.getBookGroupStatistic(Collections.singletonList(addClassifyVO.getBookGroupId())); final Map<Long, BookGroupStatisticDTO> statistic = bookGroupClassifyBiz.getBookGroupStatistic(Collections.singletonList(addClassifyVO.getBookGroupId()));
Integer classifyCount = 0; Integer classifyCount = 0;
if (!CollectionUtils.isEmpty(statistic) && null != statistic.get(addClassifyVO.getBookGroupId())) { if (!CollectionUtils.isEmpty(statistic) && null != statistic.get(addClassifyVO.getBookGroupId())) {
......
...@@ -420,6 +420,9 @@ public class GroupQrcodeBizImpl implements GroupQrcodeBiz { ...@@ -420,6 +420,9 @@ public class GroupQrcodeBizImpl implements GroupQrcodeBiz {
if (wechatGroupName == null) { if (wechatGroupName == null) {
throw new BookBizException(BookBizException.PARAM_IS_ERROR, "微信群名称不能为空"); throw new BookBizException(BookBizException.PARAM_IS_ERROR, "微信群名称不能为空");
} }
if (wechatGroupName.contains("#")) {
throw new BookBizException(BookBizException.PARAM_IS_ERROR, "名称不能包含#");
}
ChangeGroupNameDTO changeGroupNameDTO = groupQrcodeDao.getUpdateGroupNameParam(id); ChangeGroupNameDTO changeGroupNameDTO = groupQrcodeDao.getUpdateGroupNameParam(id);
groupQrcodeDao.modifyNameById(wechatGroupName, id, updateUser); groupQrcodeDao.modifyNameById(wechatGroupName, id, updateUser);
if (changeGroupNameDTO != null) { if (changeGroupNameDTO != null) {
......
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