标签修改
This commit is contained in:
+11
-20
@@ -343,11 +343,7 @@ public class SysDictController {
|
||||
public Result<SysDict> add(@RequestBody SysDict sysDict) {
|
||||
Result<SysDict> result = new Result<SysDict>();
|
||||
try {
|
||||
Integer count=sysDictService.queryExitData(sysDict);
|
||||
if (count > 0) {
|
||||
sysDict.setDelFlag(0);
|
||||
} else {
|
||||
if(StringUtils.isEmpty(sysDict.getDictCode())){
|
||||
if(StringUtils.isEmpty(sysDict.getDictName())){
|
||||
sysDict.setDictCode(sysDict.getDictName());
|
||||
}else {
|
||||
sysDict.setCreateTime(new Date());
|
||||
@@ -358,7 +354,7 @@ public class SysDictController {
|
||||
//添加成功后需要刷新缓存
|
||||
sysDictService.refreshCache();
|
||||
}
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
log.error(e.getMessage(),e);
|
||||
result.error500("操作失败");
|
||||
@@ -381,22 +377,17 @@ public class SysDictController {
|
||||
result.error500("未找到对应实体");
|
||||
}else {
|
||||
if (org.apache.commons.lang3.StringUtils.isNotBlank(String.valueOf(sysDict.getIsReadOnly()))) {
|
||||
/*if (sysDict.getIsReadOnly() == 1) {
|
||||
if (sysDict.getIsReadOnly() == 1) {
|
||||
result.error500("固定字段,不可删除");
|
||||
}else{*/
|
||||
/*if(sysDict.getIsTagDict() == 1) {
|
||||
sysDict.setDictEnName(sysDict.getDictCode().replace("_", " "));
|
||||
}else{
|
||||
sysDict.setUpdateTime(new Date());
|
||||
boolean ok = sysDictService.updateById(sysDict);
|
||||
if (ok) {
|
||||
result.success("编辑成功!");
|
||||
//编辑成功后需要刷新缓存
|
||||
sysDictService.refreshCache();
|
||||
}
|
||||
else {*/
|
||||
sysDict.setUpdateTime(new Date());
|
||||
boolean ok = sysDictService.updateById(sysDict);
|
||||
if (ok) {
|
||||
result.success("编辑成功!");
|
||||
//编辑成功后需要刷新缓存
|
||||
sysDictService.refreshCache();
|
||||
}
|
||||
//}
|
||||
// }
|
||||
}
|
||||
}
|
||||
}
|
||||
return result;
|
||||
|
||||
+4
-3
@@ -8,6 +8,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.jero.common.api.vo.Result;
|
||||
import com.jero.common.constant.CacheConstant;
|
||||
import com.jero.common.system.query.QueryGenerator;
|
||||
import com.jero.modules.enums.FixedFieldEnum;
|
||||
import com.jero.modules.system.entity.SysDictItem;
|
||||
import com.jero.modules.system.service.ISysDictItemService;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
@@ -97,7 +98,7 @@ public class SysDictItemController {
|
||||
result.error500("未找到对应实体");
|
||||
} else {
|
||||
if (org.apache.commons.lang3.StringUtils.isNotBlank(String.valueOf(sysDictItem.getIsReadOnly()))) {
|
||||
if (sysDictItem.getIsReadOnly() == 1) {
|
||||
if (FixedFieldEnum.FIXED_FIELD_ENUM.getValue().equals(sysDictItem.getIsReadOnly())) {
|
||||
result.error500("固定字段,不可删除");
|
||||
} else {
|
||||
sysDictItem.setUpdateTime(new Date());
|
||||
@@ -128,7 +129,7 @@ public class SysDictItemController {
|
||||
result.error500("未找到对应实体");
|
||||
}else {
|
||||
if (org.apache.commons.lang3.StringUtils.isNotBlank(String.valueOf(joinSystem.getIsReadOnly()))) {
|
||||
if (joinSystem.getIsReadOnly() == 1) {
|
||||
if (FixedFieldEnum.FIXED_FIELD_ENUM.getValue().equals(joinSystem.getIsReadOnly())) {
|
||||
result.error500("固定字段,不可删除");
|
||||
}
|
||||
else {
|
||||
@@ -159,7 +160,7 @@ public class SysDictItemController {
|
||||
}
|
||||
else {
|
||||
if (org.apache.commons.lang3.StringUtils.isNotBlank(String.valueOf(sysDictItem.getIsReadOnly()))) {
|
||||
if (sysDictItem.getIsReadOnly() == 1) {
|
||||
if (FixedFieldEnum.FIXED_FIELD_ENUM.getValue().equals(sysDictItem.getIsReadOnly())) {
|
||||
result.error500("固定字段,不可删除");
|
||||
} else {
|
||||
this.sysDictItemService.removeByIds(Arrays.asList(ids.split(",")));
|
||||
|
||||
+1
-1
@@ -61,7 +61,7 @@ public class SysCategory implements Serializable,Comparable<SysCategory>{
|
||||
@Excel(name = "数据字典id", width = 15)
|
||||
@Dict(dictTable = "sys_dict", dicText = "id", dicCode = "id")
|
||||
@ApiModelProperty(value = "是否为标签内容-数据字典(1是 0否)")
|
||||
private java.lang.Integer sysDictId;
|
||||
private java.lang.String sysDictId;
|
||||
|
||||
/**是否有子节点*/
|
||||
@Excel(name = "是否有子节点(1:有)", width = 15)
|
||||
|
||||
Reference in New Issue
Block a user