Commit 4fdaff72 by songyinghui

feat: 分组名称重复 异常文案调整

parent 520f5bfe
......@@ -66,26 +66,26 @@ public class HmGroupApiServiceImpl implements HmGroupApiService {
return ServiceResponse.failure(HaoBanErrCodeCommon.ERR_5.getCode() + "", "分组名称不存在");
}
if (StringUtils.equals(DEFAULT_GROUP_NAME, hmGroupDTO.getGroupName())) {
return ServiceResponse.failure(HaoBanErrCodeCommon.ERR_9.getCode() + "", "分组名称不可使用默认分组名称");
return ServiceResponse.failure(HaoBanErrCodeCommon.ERR_9.getCode() + "", "分组名称不能重复");
}
List<HmGroupSettingBO> groupSettingBos = groupService.queryGroupSettingByName(hmGroupDTO.getEnterpriseId(), hmGroupDTO.getGroupName());
if (hmGroupDTO.getGroupId() == null) {
// insert
// check groupName unique
if (CollectionUtils.isNotEmpty(groupSettingBos)) {
return ServiceResponse.failure(HaoBanErrCodeCommon.ERR_5.getCode() + "", "该分组名称已存在,请重新输入");
return ServiceResponse.failure(HaoBanErrCodeCommon.ERR_5.getCode() + "", "分组名称不能重复");
}
} else {
// update
if (CollectionUtils.isNotEmpty(groupSettingBos)
&& groupSettingBos.size() > 1) {
// 名称重复
return ServiceResponse.failure(HaoBanErrCodeCommon.ERR_5.getCode() + "", "该分组名称已存在,请重新输入");
return ServiceResponse.failure(HaoBanErrCodeCommon.ERR_5.getCode() + "", "分组名称不能重复");
}
if (CollectionUtils.isNotEmpty(groupSettingBos)
&& !groupSettingBos.get(0).getGroupId().equals(hmGroupDTO.getGroupId())) {
// 名称重复
return ServiceResponse.failure(HaoBanErrCodeCommon.ERR_5.getCode() + "", "该分组名称已存在,请重新输入");
return ServiceResponse.failure(HaoBanErrCodeCommon.ERR_5.getCode() + "", "分组名称不能重复");
}
HmGroupSettingBO groupSettingBo = groupService.queryGroupSettingDetail(hmGroupDTO.getGroupId());
if (groupSettingBo == 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