Browse Source

运营端分类设置代码调整

dev_shibei_match
sunyuchao 4 years ago
parent
commit
4d13a3a9a1
  1. 3
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java
  2. 15
      epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueProjectCategoryDictServiceImpl.java

3
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java

@ -146,7 +146,8 @@ public enum EpmetErrorCode {
TOPIC_IS_HIDDEN(9006,"该话题已被屏蔽,请先解除屏蔽"),
TOPIC_IS_CLOSED(9008,"该话题已关闭,无法转为议题"),
CUSTOMER_CATEGORY(9101,"分类已使用,不允许删除");
CUSTOMER_CATEGORY(9101,"分类已使用,不允许删除"),
CATEGORY_NAME(9102,"分类名称已存在,不允许重复");
private int code;
private String msg;

15
epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueProjectCategoryDictServiceImpl.java

@ -253,11 +253,8 @@ public class IssueProjectCategoryDictServiceImpl extends BaseServiceImpl<IssuePr
logger.error(String.format("修改分类信息状态失败,客户Id->%s,分类Id->%s", formDTO.getCustomerId(), formDTO.getCategoryId()));
throw new RuntimeException("分类信息修改失败!");
}
//修改吧二级分类下默认的标签数据
if (issueProjectTagDictDao.updateCustomerTag(formDTO) < NumConstant.ONE) {
logger.error(String.format("修改标签信息状态失败,客户Id->%s,分类Id->%s", formDTO.getCustomerId(), formDTO.getCategoryId()));
throw new RuntimeException("分类、标签信息修改失败!");
}
//修改把二级分类下默认的标签数据
issueProjectTagDictDao.updateCustomerTag(formDTO);
//4.修改缓存中标签状态
dictRedis.updateTagAvailabilityBySecondCategoryIds(formDTO.getCustomerId(),formDTO.getSecondCategorylist(),formDTO.getType());
}
@ -310,7 +307,7 @@ public class IssueProjectCategoryDictServiceImpl extends BaseServiceImpl<IssuePr
// 分类名称在同一个客户下有效数据中不允许重复
Integer numCategoryName = baseDao.isCategoryName(formDTO.getCustomerId(), formDTO.getCategoryName(), null,null);
if (NumConstant.ZERO < numCategoryName) {
throw new RenException("现添加的一级分类名称 重复");
throw new RenException(EpmetErrorCode.CATEGORY_NAME.getCode(), EpmetErrorCode.CATEGORY_NAME.getMsg());
}
IssueProjectCategoryDictEntity entity = this.packageFirstCategoryDictEntity(formDTO);
baseDao.insert(entity);
@ -355,7 +352,7 @@ public class IssueProjectCategoryDictServiceImpl extends BaseServiceImpl<IssuePr
// 分类名称在同一个客户下有效数据中不允许重复
Integer numCategoryName = baseDao.isCategoryName(formDTO.getCustomerId(), formDTO.getCategoryName(), null, formDTO.getCategoryId());
if (NumConstant.ZERO < numCategoryName) {
throw new RenException("现添加的一级分类名称 重复");
throw new RenException(EpmetErrorCode.CATEGORY_NAME.getCode(), EpmetErrorCode.CATEGORY_NAME.getMsg());
}
IssueProjectCategoryDictEntity entity = new IssueProjectCategoryDictEntity();
entity.setCategoryName(formDTO.getCategoryName());
@ -370,7 +367,7 @@ public class IssueProjectCategoryDictServiceImpl extends BaseServiceImpl<IssuePr
// 分类名称在同一个客户下同一 一级分类下有效数据中不允许重复
Integer numCategoryName = baseDao.isCategoryName(formDTO.getCustomerId(), formDTO.getCategoryName(), formDTO.getParentCategoryId(), null);
if (NumConstant.ZERO < numCategoryName) {
throw new RenException("现添加的二级分类名称 重复");
throw new RenException(EpmetErrorCode.CATEGORY_NAME.getCode(), EpmetErrorCode.CATEGORY_NAME.getMsg());
}
IssueProjectCategoryDictEntity entity = this.packageSecondCategoryDictEntity(formDTO);
baseDao.insert(entity);
@ -419,7 +416,7 @@ public class IssueProjectCategoryDictServiceImpl extends BaseServiceImpl<IssuePr
// 分类名称在同一个客户下同一 一级分类下有效数据中不允许重复
Integer numCategoryName = baseDao.isCategoryName(formDTO.getCustomerId(), formDTO.getCategoryName(), formDTO.getParentCategoryId(), formDTO.getCategoryId());
if (NumConstant.ZERO < numCategoryName) {
throw new RenException("现添加的二级分类名称 重复");
throw new RenException(EpmetErrorCode.CATEGORY_NAME.getCode(), EpmetErrorCode.CATEGORY_NAME.getMsg());
}
IssueProjectCategoryDictEntity entity = new IssueProjectCategoryDictEntity();
entity.setCategoryName(formDTO.getCategoryName());

Loading…
Cancel
Save