|
@@ -28,10 +28,10 @@ public class TypeService {
|
|
return mapper.findList(page, type.getKlgsType());
|
|
return mapper.findList(page, type.getKlgsType());
|
|
}
|
|
}
|
|
|
|
|
|
- public String save(KnowledgeShareType type) {
|
|
|
|
- List<KnowledgeShareType> list = mapper.checkList(type.getKlgsType(), type.getKlgsKey());
|
|
|
|
|
|
+ public Boolean save(KnowledgeShareType type) {
|
|
|
|
+ List<KnowledgeShareType> list = mapper.checkList(type);
|
|
if (CollectionUtils.isNotEmpty(list)) {
|
|
if (CollectionUtils.isNotEmpty(list)) {
|
|
- return "已存在同名类型,请重新输入";
|
|
|
|
|
|
+ return false;
|
|
}
|
|
}
|
|
if (StringUtils.isNotEmpty(type.getId())) {
|
|
if (StringUtils.isNotEmpty(type.getId())) {
|
|
return update(type);
|
|
return update(type);
|
|
@@ -40,16 +40,16 @@ public class TypeService {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- public String update(KnowledgeShareType type) {
|
|
|
|
|
|
+ public Boolean update(KnowledgeShareType type) {
|
|
// 获取当前登录人
|
|
// 获取当前登录人
|
|
UserDTO userDTO = UserUtils.getCurrentUserDTO();
|
|
UserDTO userDTO = UserUtils.getCurrentUserDTO();
|
|
type.setUpdateBy(userDTO.getId());
|
|
type.setUpdateBy(userDTO.getId());
|
|
type.setUpdateDate(new Date());
|
|
type.setUpdateDate(new Date());
|
|
mapper.updateById(type);
|
|
mapper.updateById(type);
|
|
- return "操作完成";
|
|
|
|
|
|
+ return true;
|
|
}
|
|
}
|
|
|
|
|
|
- public String add(KnowledgeShareType type) {
|
|
|
|
|
|
+ public Boolean add(KnowledgeShareType type) {
|
|
// 获取当前登录人
|
|
// 获取当前登录人
|
|
UserDTO userDTO = UserUtils.getCurrentUserDTO();
|
|
UserDTO userDTO = UserUtils.getCurrentUserDTO();
|
|
// 生成id
|
|
// 生成id
|
|
@@ -61,7 +61,7 @@ public class TypeService {
|
|
type.setUpdateDate(new Date());
|
|
type.setUpdateDate(new Date());
|
|
type.setDelFlag(0);
|
|
type.setDelFlag(0);
|
|
mapper.insert(type);
|
|
mapper.insert(type);
|
|
- return "操作完成";
|
|
|
|
|
|
+ return true;
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
}
|