标签管理-标签项+内容修改
This commit is contained in:
+30
-44
@@ -37,7 +37,7 @@ public class SysDictItemController {
|
||||
|
||||
@Autowired
|
||||
private ISysDictItemService sysDictItemService;
|
||||
|
||||
|
||||
/**
|
||||
* @功能:查询字典数据
|
||||
* @param sysDictItem
|
||||
@@ -49,24 +49,17 @@ public class SysDictItemController {
|
||||
@RequiresPermissions("sys:dict:list")
|
||||
@RequestMapping(value = "/page", method = RequestMethod.GET)
|
||||
public Result<IPage<SysDictItem>> queryPageList(SysDictItem sysDictItem,@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,HttpServletRequest req) {
|
||||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,HttpServletRequest req) {
|
||||
Result<IPage<SysDictItem>> result = new Result<IPage<SysDictItem>>();
|
||||
QueryWrapper<SysDictItem> queryWrapper = QueryGenerator.initQueryWrapper(sysDictItem, req.getParameterMap());
|
||||
queryWrapper.orderByAsc("sort_order");
|
||||
Page<SysDictItem> page = new Page<SysDictItem>(pageNo, pageSize);
|
||||
if(sysDictItem.getIsTagDict()==0) {
|
||||
queryWrapper.like("is_tag_dict",0).and(wq->wq.orderByAsc("sort_order"));
|
||||
IPage<SysDictItem> pageList = sysDictItemService.page(page, queryWrapper);
|
||||
result.setResult(pageList);
|
||||
}
|
||||
else if(sysDictItem.getIsTagDict()==1) {
|
||||
queryWrapper.like("is_tag_dict",1).and(wq->wq.orderByAsc("sort_order"));
|
||||
IPage<SysDictItem> pageList = sysDictItemService.page(page, queryWrapper);
|
||||
result.setResult(pageList);
|
||||
}
|
||||
IPage<SysDictItem> pageList = sysDictItemService.page(page, queryWrapper);
|
||||
result.setSuccess(true);
|
||||
result.setResult(pageList);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @功能:新增
|
||||
* @return
|
||||
@@ -87,7 +80,7 @@ public class SysDictItemController {
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @功能:编辑
|
||||
* @param sysDictItem
|
||||
@@ -102,21 +95,19 @@ public class SysDictItemController {
|
||||
SysDictItem sysdict = sysDictItemService.getById(sysDictItem.getId());
|
||||
if(sysdict==null) {
|
||||
result.error500("未找到对应实体");
|
||||
}else {
|
||||
if(sysDictItem.getIsReadOnly()==2){
|
||||
result.error("固定字段,不可修改");
|
||||
}else {
|
||||
sysDictItem.setUpdateTime(new Date());
|
||||
boolean ok = sysDictItemService.updateById(sysDictItem);
|
||||
//TODO 返回false说明什么?
|
||||
if(ok) {
|
||||
result.success("编辑成功!");
|
||||
}
|
||||
}/*else if(sysDictItem.getIsReadOnly()==1){
|
||||
result.error("固定字段,不可修改");
|
||||
}*/else {
|
||||
sysDictItem.setUpdateTime(new Date());
|
||||
boolean ok = sysDictItemService.updateById(sysDictItem);
|
||||
//TODO 返回false说明什么?
|
||||
if(ok) {
|
||||
result.success("编辑成功!");
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @功能:删除字典数据
|
||||
* @param id
|
||||
@@ -131,20 +122,17 @@ public class SysDictItemController {
|
||||
SysDictItem joinSystem = sysDictItemService.getById(id);
|
||||
if(joinSystem==null) {
|
||||
result.error500("未找到对应实体");
|
||||
}else {
|
||||
if(joinSystem.getIsReadOnly()==2){
|
||||
result.error("固定字段,不可修改");
|
||||
}else {
|
||||
boolean ok = sysDictItemService.removeById(id);
|
||||
if(ok) {
|
||||
result.success("删除成功!");
|
||||
}
|
||||
}/*else if(joinSystem.getIsReadOnly()==1||joinSystem.getIsTagDict()==1){
|
||||
result.error("固定字段,不可修改");
|
||||
}*/else {
|
||||
boolean ok = sysDictItemService.removeById(id);
|
||||
if(ok) {
|
||||
result.success("删除成功!");
|
||||
}
|
||||
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @功能:批量删除字典数据
|
||||
* @param ids
|
||||
@@ -156,16 +144,14 @@ public class SysDictItemController {
|
||||
@CacheEvict(value=CacheConstant.SYS_DICT_CACHE, allEntries=true)
|
||||
public Result<SysDictItem> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
|
||||
Result<SysDictItem> result = new Result<SysDictItem>();
|
||||
SysDictItem sysDictItem = sysDictItemService.getById(ids);
|
||||
if(ids==null || "".equals(ids.trim())) {
|
||||
result.error500("参数不识别!");
|
||||
}else {
|
||||
SysDictItem sysDictItem = sysDictItemService.getById(ids);
|
||||
if(sysDictItem.getIsReadOnly() == 1 || sysDictItem.getIsReadOnly()==2){
|
||||
result.error("固定字段,不可删除");
|
||||
}else {
|
||||
this.sysDictItemService.removeByIds(Arrays.asList(ids.split(",")));
|
||||
result.success("批量删除成功!");
|
||||
}
|
||||
}/*else if(sysDictItem.getIsReadOnly() == 1){
|
||||
result.error("固定字段,不可删除");
|
||||
}*/else {
|
||||
this.sysDictItemService.removeByIds(Arrays.asList(ids.split(",")));
|
||||
result.success("批量删除成功!");
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -198,5 +184,5 @@ public class SysDictItemController {
|
||||
return Result.error("该值不可用,系统中已存在!");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
+18
-4
@@ -1,15 +1,16 @@
|
||||
package com.jero.modules.system.entity;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
@@ -86,5 +87,18 @@ public class SysDict implements Serializable {
|
||||
*/
|
||||
private Date updateTime;
|
||||
|
||||
/**是否为标签内容-数据字典(1是 0否)*/
|
||||
@Excel(name = "是否为标签内容-数据字典(1是 0否)", width = 15)
|
||||
@ApiModelProperty(value = "是否为标签内容-数据字典(1是 0否)")
|
||||
private java.lang.Integer isTagDict;
|
||||
|
||||
/**是否是只读(2字段固定,内部可配1固定字段 0非固定字段)*/
|
||||
@Excel(name = "是否是只读(2字段固定,内部可配1固定字段 0非固定字段)", width = 15)
|
||||
@ApiModelProperty(value = "是否是只读(2字段固定,内部可配1固定字段 0非固定字段)")
|
||||
private java.lang.Integer isReadOnly;
|
||||
|
||||
/**表单控件类型*/
|
||||
@Excel(name = "表单控件类型", width = 15)
|
||||
@ApiModelProperty(value = "表单控件类型")
|
||||
private java.lang.String fieldShowType;
|
||||
}
|
||||
|
||||
+7
-5
@@ -77,16 +77,18 @@ public class SysDictItem implements Serializable {
|
||||
|
||||
private Date updateTime;
|
||||
|
||||
/**
|
||||
* 是否为标签内容-数据字典(1是 0否)
|
||||
*/
|
||||
/**是否为标签内容-数据字典(1是 0否)*/
|
||||
@Excel(name = "是否为标签内容-数据字典(1是 0否)", width = 15)
|
||||
@ApiModelProperty(value = "是否为标签内容-数据字典(1是 0否)")
|
||||
private java.lang.Integer isTagDict;
|
||||
|
||||
/**是否是只读(2字段固定,内部可配1固定字段 0非固定字段)*/
|
||||
@Excel(name = "是否是只读(2字段固定,内部可配1固定字段 0非固定字段)", width = 15, dictTable = "onl_cgform_field", dicText = "is_read_only", dicCode = "is_read_only")
|
||||
@Dict(dictTable = "onl_cgform_field", dicText = "is_read_only", dicCode = "is_read_only")
|
||||
@Excel(name = "是否是只读(2字段固定,内部可配1固定字段 0非固定字段)", width = 15)
|
||||
@ApiModelProperty(value = "是否是只读(2字段固定,内部可配1固定字段 0非固定字段)")
|
||||
private java.lang.Integer isReadOnly;
|
||||
|
||||
/**表单控件类型*/
|
||||
@Excel(name = "表单控件类型", width = 15)
|
||||
@ApiModelProperty(value = "表单控件类型")
|
||||
private java.lang.String fieldShowType;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user