标签管理-标签项修改&补充
This commit is contained in:
+1
-7
@@ -13,13 +13,7 @@ import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
+5
-8
@@ -1,21 +1,18 @@
|
||||
package com.jero.modules.document.entity;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.math.BigDecimal;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||
import com.jero.common.aspect.annotation.Dict;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
|
||||
/**
|
||||
|
||||
+2
-2
@@ -1,8 +1,8 @@
|
||||
package com.jero.modules.document.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.jero.modules.document.entity.BussDocumentLibraryEO;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.jero.modules.document.entity.BussDocumentLibraryEO;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
+1
-6
@@ -22,12 +22,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
|
||||
+2
-1
@@ -36,7 +36,7 @@ import java.util.List;
|
||||
public class OnlCgformTagController extends JeroController<OnlCgformTag, IOnlCgformTagService> {
|
||||
@Autowired
|
||||
private IOnlCgformTagService onlCgformTagService;
|
||||
|
||||
|
||||
/**
|
||||
* 分页列表查询
|
||||
*
|
||||
@@ -82,6 +82,7 @@ public class OnlCgformTagController extends JeroController<OnlCgformTag, IOnlCgf
|
||||
@ApiOperation(value="标签管理-添加", notes="标签管理-添加")
|
||||
@PostMapping(value = "/add")
|
||||
public Result<?> add(@Validated @RequestBody OnlCgformTag onlCgformTag) {
|
||||
onlCgformTagService.queryExitData(onlCgformTag);
|
||||
onlCgformTagService.add(onlCgformTag);
|
||||
return Result.OK("添加成功!");
|
||||
}
|
||||
|
||||
+5
@@ -60,21 +60,26 @@ public class OnlCgformArea implements Serializable {
|
||||
|
||||
/**展示区域(1基本信息,2文本信息,3关联关系)*/
|
||||
@Excel(name = "展示区域(1基本信息,2文本信息,3关联关系)", width = 15)
|
||||
@javax.validation.constraints.NotNull(message = "不能为空")
|
||||
@ApiModelProperty(value = "展示区域(1基本信息,2文本信息,3关联关系)")
|
||||
private java.lang.String showArea;
|
||||
|
||||
/**英文名称*/
|
||||
@Excel(name = "英文名称", width = 15)
|
||||
@javax.validation.constraints.Pattern(regexp = "^[A-Za-z]*(\\s[A-Za-z]*)*$",message = "请输入正确的英文名称")
|
||||
@ApiModelProperty(value = "英文名称")
|
||||
private java.lang.String enName;
|
||||
|
||||
/**所属模块(1文档库,0文档拆分)*/
|
||||
@Excel(name = "所属模块(1文档库,0文档拆分)", width = 15)
|
||||
@javax.validation.constraints.NotNull(message = "不能为空")
|
||||
@ApiModelProperty(value = "所属模块(1文档库,0文档拆分)")
|
||||
private java.lang.String isModel;
|
||||
|
||||
/**排序号*/
|
||||
@Excel(name = "排序号", width = 15)
|
||||
@javax.validation.constraints.Pattern(regexp = "^-?[1-9]\\d+$",message = "请输入正确的整数")
|
||||
@javax.validation.constraints.NotNull(message = "不能为空")
|
||||
@ApiModelProperty(value = "排序号")
|
||||
private java.lang.Integer sort;
|
||||
|
||||
|
||||
+31
-17
@@ -62,11 +62,13 @@ public class OnlCgformTag implements Serializable {
|
||||
/**所属模块(1文档库,0文档拆分*/
|
||||
@Excel(name = "所属模块(1文档库,0文档拆分", width = 15, dictTable = "onl_cgform_area", dicText = "所属模块", dicCode = "is_model")
|
||||
@Dict(dictTable = "onl_cgform_area", dicText = "所属模块", dicCode = "is_model")
|
||||
@javax.validation.constraints.NotNull(message = "不能为空")
|
||||
@ApiModelProperty(value = "所属模块(1文档库,0文档拆分")
|
||||
private String isModel;
|
||||
|
||||
/**字段备注*/
|
||||
@Excel(name = "字段备注", width = 15)
|
||||
@javax.validation.constraints.NotNull(message = "不能为空")
|
||||
@ApiModelProperty(value = "字段备注")
|
||||
private String dbFieldTxt;
|
||||
|
||||
@@ -78,70 +80,82 @@ public class OnlCgformTag implements Serializable {
|
||||
/**表单控件类型*/
|
||||
@Excel(name = "表单控件类型", width = 15, dictTable = "onl_cgform_field", dicText = "属性类型", dicCode = "field_show_type")
|
||||
@Dict(dictTable = "onl_cgform_field", dicText = "属性类型", dicCode = "field_show_type")
|
||||
@javax.validation.constraints.NotNull(message = "不能为空")
|
||||
@ApiModelProperty(value = "表单控件类型")
|
||||
private String fieldShowType;
|
||||
|
||||
/**字典名称*/
|
||||
@Excel(name = "字典名称", width = 15, dictTable = "sys_dict", dicText = "选项内容", dicCode = "dict_name")
|
||||
@Dict(dictTable = "sys_dict", dicText = "选项内容", dicCode = "dict_name")
|
||||
@javax.validation.constraints.NotNull(message = "不能为空")
|
||||
@ApiModelProperty(value = "字典名称")
|
||||
private String dictName;
|
||||
|
||||
/**数据库字段长度*/
|
||||
@Excel(name = "数据库字段长度", width = 15)
|
||||
@javax.validation.constraints.Pattern(regexp = "^-?[1-9]\\d+$",message = "请输入正确的整数")
|
||||
@javax.validation.constraints.NotNull(message = "不能为空")
|
||||
@ApiModelProperty(value = "数据库字段长度")
|
||||
private Integer dbLength;
|
||||
|
||||
/**排序*/
|
||||
@Excel(name = "排序", width = 15)
|
||||
@javax.validation.constraints.Pattern(regexp = "^-?[1-9]\\d+$",message = "请输入正确的整数")
|
||||
@javax.validation.constraints.NotNull(message = "不能为空")
|
||||
@ApiModelProperty(value = "排序")
|
||||
private Integer orderNum;
|
||||
|
||||
/**字段是否必填0否 1是*/
|
||||
@Excel(name = "字段是否必填0否 1是", width = 15, dicCode = "yn")
|
||||
@Dict(dicCode = "yn")
|
||||
@Excel(name = "字段是否必填0否 1是", width = 15, dictTable = "onl_cgform_field", dicText = "是否必填", dicCode = "field_must_input")
|
||||
@Dict(dictTable = "onl_cgform_field", dicText = "是否必填", dicCode = "field_must_input")
|
||||
@javax.validation.constraints.NotNull(message = "不能为空")
|
||||
@ApiModelProperty(value = "字段是否必填0否 1是")
|
||||
private String fieldMustInput;
|
||||
|
||||
/**表单是否显示0否 1是*/
|
||||
@Excel(name = "表单是否显示0否 1是", width = 15, dicCode = "yn")
|
||||
@Dict(dicCode = "yn")
|
||||
@Excel(name = "表单是否显示0否 1是", width = 15, dictTable = "onl_cgform_field", dicText = "文档库列表展示", dicCode = "is_show_form")
|
||||
@Dict(dictTable = "onl_cgform_field", dicText = "文档库列表展示", dicCode = "is_show_form")
|
||||
@javax.validation.constraints.Pattern(regexp = "^-?[1-9]\\d+$",message = "请输入正确的整数")
|
||||
@ApiModelProperty(value = "表单是否显示0否 1是")
|
||||
private Integer isShowForm;
|
||||
|
||||
/**列表是否显示0否 1是*/
|
||||
@Excel(name = "列表是否显示0否 1是", width = 15, dicCode = "yn")
|
||||
@Dict(dicCode = "yn")
|
||||
/* *//**列表是否显示0否 1是*//*
|
||||
@Excel(name = "列表是否显示0否 1是", width = 15, dictTable = "onl_cgform_field", dicText = "", dicCode = "is_show_list")
|
||||
@Dict(dictTable = "onl_cgform_field", dicText = "", dicCode = "is_show_list")
|
||||
@ApiModelProperty(value = "列表是否显示0否 1是")
|
||||
private Integer isShowList;
|
||||
|
||||
/**是否是只读(1是 0否)*/
|
||||
@Excel(name = "是否是只读(1是 0否)", width = 15, dicCode = "yn")
|
||||
@Dict(dicCode = "yn")
|
||||
*//*//***是否是只读(1是 0否)*//*
|
||||
@Excel(name = "是否是只读(1是 0否)", width = 15, dictTable = "onl_cgform_field", dicText = "", dicCode = "is_read_only")
|
||||
@Dict(dictTable = "onl_cgform_field", dicText = "", dicCode = "is_read_only")
|
||||
@ApiModelProperty(value = "是否是只读(1是 0否)")
|
||||
private Integer isReadOnly;
|
||||
private Integer isReadOnly;*/
|
||||
|
||||
/**展示区域*/
|
||||
@Excel(name = "展示区域", width = 15, dictTable = "onl_cgform_area", dicText = "展示区域", dicCode = "show_area")
|
||||
@Dict(dictTable = "onl_cgform_area", dicText = "展示区域", dicCode = "show_area")
|
||||
@javax.validation.constraints.NotNull(message = "不能为空")
|
||||
@ApiModelProperty(value = "展示区域")
|
||||
private String showArea;
|
||||
|
||||
/**是否查询条件0否 1是*/
|
||||
@Excel(name = "是否查询条件0否 1是", width = 15, dicCode = "yn")
|
||||
@Dict(dicCode = "yn")
|
||||
@Excel(name = "是否查询条件0否 1是", width = 15, dictTable = "onl_cgform_field", dicText = "是否搜索", dicCode = "is_query")
|
||||
@Dict(dictTable = "onl_cgform_field", dicText = "是否搜索", dicCode = "is_query")
|
||||
@javax.validation.constraints.NotNull(message = "不能为空")
|
||||
@ApiModelProperty(value = "是否查询条件0否 1是")
|
||||
private Integer isQuery;
|
||||
|
||||
/**法规清单是否展示0否 1是*/
|
||||
@Excel(name = "法规清单是否展示0否 1是", width = 15, dicCode = "yn")
|
||||
@Dict(dicCode = "yn")
|
||||
@Excel(name = "法规清单是否展示0否 1是", width = 15, dictTable = "onl_cgform_field", dicText = "法规清单展示", dicCode = "is_show_laws_list")
|
||||
@Dict(dictTable = "onl_cgform_field", dicText = "法规清单展示", dicCode = "is_show_laws_list")
|
||||
@javax.validation.constraints.NotNull(message = "不能为空")
|
||||
@ApiModelProperty(value = "法规清单是否展示0否 1是")
|
||||
private Integer isShowLawsList;
|
||||
|
||||
/**搜索中心是否展示0否 1是*/
|
||||
@Excel(name = "搜索中心是否展示0否 1是", width = 15, dicCode = "yn")
|
||||
@Dict(dicCode = "yn")
|
||||
@Excel(name = "搜索中心是否展示0否 1是", width = 15, dictTable = "onl_cgform_field", dicText = "搜索中心展示", dicCode = "is_show_search")
|
||||
@Dict(dictTable = "onl_cgform_field", dicText = "搜索中心展示", dicCode = "is_show_search")
|
||||
@javax.validation.constraints.NotNull(message = "不能为空")
|
||||
@ApiModelProperty(value = "搜索中心是否展示0否 1是")
|
||||
private Integer isShowSearch;
|
||||
|
||||
|
||||
+1
-4
@@ -1,10 +1,7 @@
|
||||
package com.jero.modules.tag.mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import com.jero.modules.tag.entity.OnlCgformTag;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.jero.modules.tag.entity.OnlCgformTag;
|
||||
|
||||
/**
|
||||
* @Description: 标签管理
|
||||
|
||||
+2
-1
@@ -1,7 +1,8 @@
|
||||
package com.jero.modules.tag.service;
|
||||
|
||||
import com.jero.modules.tag.entity.OnlCgformArea;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.jero.modules.tag.entity.OnlCgformArea;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
|
||||
+10
-1
@@ -1,7 +1,9 @@
|
||||
package com.jero.modules.tag.service;
|
||||
|
||||
import com.jero.modules.tag.entity.OnlCgformTag;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.jero.common.api.vo.Result;
|
||||
import com.jero.modules.tag.entity.OnlCgformTag;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@@ -58,4 +60,11 @@ public interface IOnlCgformTagService extends IService<OnlCgformTag> {
|
||||
* @return
|
||||
*/
|
||||
List<OnlCgformTag> queryList();
|
||||
|
||||
/**
|
||||
* 同一“所属模块”下的“属性名称”不能重复
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
Result<?> queryExitData(OnlCgformTag onlCgformTag) ;
|
||||
}
|
||||
|
||||
+46
-23
@@ -1,12 +1,16 @@
|
||||
package com.jero.modules.tag.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.jero.common.api.vo.Result;
|
||||
import com.jero.modules.tag.entity.OnlCgformTag;
|
||||
import com.jero.modules.tag.mapper.OnlCgformTagMapper;
|
||||
import com.jero.modules.tag.service.IOnlCgformTagService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import java.util.List;
|
||||
|
||||
import java.util.Date;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description: 标签管理
|
||||
@@ -16,6 +20,8 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
*/
|
||||
@Service
|
||||
public class OnlCgformTagServiceImpl extends ServiceImpl<OnlCgformTagMapper, OnlCgformTag> implements IOnlCgformTagService {
|
||||
@Autowired
|
||||
private OnlCgformTagMapper onlCgformTagMapper;
|
||||
|
||||
/**
|
||||
* 保存
|
||||
@@ -24,12 +30,12 @@ public class OnlCgformTagServiceImpl extends ServiceImpl<OnlCgformTagMapper, Onl
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public void add(OnlCgformTag onlCgformTag) {
|
||||
Date now = new Date();
|
||||
onlCgformTag.setCreateTime(now);
|
||||
onlCgformTag.setUpdateTime(now);
|
||||
save(onlCgformTag);
|
||||
}
|
||||
public void add(OnlCgformTag onlCgformTag) {
|
||||
Date now = new Date();
|
||||
onlCgformTag.setCreateTime(now);
|
||||
onlCgformTag.setUpdateTime(now);
|
||||
save(onlCgformTag);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新
|
||||
@@ -38,11 +44,11 @@ public class OnlCgformTagServiceImpl extends ServiceImpl<OnlCgformTagMapper, Onl
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public void editById(OnlCgformTag onlCgformTag) {
|
||||
Date now = new Date();
|
||||
onlCgformTag.setUpdateTime(now);
|
||||
saveOrUpdate(onlCgformTag);
|
||||
}
|
||||
public void editById(OnlCgformTag onlCgformTag) {
|
||||
Date now = new Date();
|
||||
onlCgformTag.setUpdateTime(now);
|
||||
saveOrUpdate(onlCgformTag);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
@@ -51,9 +57,9 @@ public class OnlCgformTagServiceImpl extends ServiceImpl<OnlCgformTagMapper, Onl
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public void deleteById(String id) {
|
||||
removeById(id);
|
||||
}
|
||||
public void deleteById(String id) {
|
||||
removeById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
@@ -62,9 +68,9 @@ public class OnlCgformTagServiceImpl extends ServiceImpl<OnlCgformTagMapper, Onl
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public void deleteByIds(List<String> ids) {
|
||||
removeByIds(ids);
|
||||
}
|
||||
public void deleteByIds(List<String> ids) {
|
||||
removeByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
@@ -73,11 +79,11 @@ public class OnlCgformTagServiceImpl extends ServiceImpl<OnlCgformTagMapper, Onl
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public OnlCgformTag queryById(String id) {
|
||||
return getById(id);
|
||||
}
|
||||
public OnlCgformTag queryById(String id) {
|
||||
return getById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* 列表查询
|
||||
*
|
||||
* @return
|
||||
@@ -86,4 +92,21 @@ public class OnlCgformTagServiceImpl extends ServiceImpl<OnlCgformTagMapper, Onl
|
||||
public List<OnlCgformTag> queryList() {
|
||||
return list();
|
||||
}
|
||||
|
||||
/**
|
||||
* 同一“所属模块”下的“属性名称”不能重复
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public Result<?> queryExitData(OnlCgformTag onlCgformTag) {
|
||||
QueryWrapper<OnlCgformTag> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.like("isModel",onlCgformTag.getIsModel()).and(wq->wq.like("db_field_txt",onlCgformTag.getDbFieldTxt()));
|
||||
Integer count = onlCgformTagMapper.selectCount(queryWrapper);
|
||||
if (count > 0) {
|
||||
return Result.error("已存在数据,不能重复添加");
|
||||
}
|
||||
return Result.OK(onlCgformTag);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -2,4 +2,7 @@ spring:
|
||||
application:
|
||||
name: weilai-system
|
||||
profiles:
|
||||
active: @profile.name@
|
||||
active: @profile.name@
|
||||
|
||||
mybatis-plus:
|
||||
mapper-locations: classpath:mappers/*.xml
|
||||
Reference in New Issue
Block a user