bug52676树形验重+52782搜索年款号
This commit is contained in:
+6
-3
@@ -60,9 +60,9 @@ public class SysCategory implements Serializable,Comparable<SysCategory>{
|
||||
private java.lang.String sysOrgCode;
|
||||
|
||||
/**数据字典id*/
|
||||
@Excel(name = "数据字典id", width = 15)
|
||||
@Dict(dictTable = "sys_dict", dicText = "id", dicCode = "id")
|
||||
@ApiModelProperty(value = "是否为标签内容-数据字典(1是 0否)")
|
||||
// @Excel(name = "数据字典id", width = 15)
|
||||
// @Dict(dictTable = "sys_dict", dicText = "id", dicCode = "id")
|
||||
@ApiModelProperty(value = "数据字典id")
|
||||
private java.lang.String sysDictId;
|
||||
|
||||
/**是否有子节点*/
|
||||
@@ -104,6 +104,9 @@ public class SysCategory implements Serializable,Comparable<SysCategory>{
|
||||
@TableField(exist = false)
|
||||
private java.lang.String itemValue;
|
||||
|
||||
@TableField(exist = false)
|
||||
private String cut;
|
||||
|
||||
@Override
|
||||
public int compareTo(SysCategory o) {
|
||||
//比较条件我们定的是按照code的长度升序
|
||||
|
||||
+15
@@ -11,6 +11,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.jero.common.constant.CommonConstant;
|
||||
import com.jero.common.constant.FillRuleConstant;
|
||||
import com.jero.common.constant.enums.CutEnum;
|
||||
import com.jero.common.exception.JeroBootException;
|
||||
import com.jero.common.util.FillRuleUtil;
|
||||
import com.jero.common.util.oConvertUtils;
|
||||
@@ -31,6 +32,7 @@ import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @Description: 分类字典
|
||||
@@ -88,6 +90,19 @@ public class SysCategoryServiceImpl extends ServiceImpl<SysCategoryMapper, SysCa
|
||||
sysCategory.setItemValue(String.valueOf(RandomUtils.nextLong()));
|
||||
sysCategory.setIsTagDict(1);
|
||||
sysCategory.setDelFlag(CommonConstant.DEL_FLAG_0);
|
||||
|
||||
QueryWrapper<SysCategory> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("sys_dict_id", sysCategory.getSysDictId()).eq("del_flag",CommonConstant.DEL_FLAG_0);
|
||||
List<SysCategory> sysCategoryList = list(queryWrapper);
|
||||
List<String> sysCategoryNameList = sysCategoryList.stream().map(e -> e.getName()).collect(Collectors.toList());
|
||||
if(sysCategoryNameList.contains(sysCategory.getName())){
|
||||
if(CutEnum.CN.getValue().equals(sysCategory.getCut())) {
|
||||
throw new JeroBootException("名称不能重复!");
|
||||
}else{
|
||||
throw new JeroBootException("The name cannot be duplicate!");
|
||||
}
|
||||
}
|
||||
|
||||
baseMapper.insert(sysCategory);
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -59,10 +59,10 @@
|
||||
<!--搜索条件:项目名称,包含%,单独搜索-->
|
||||
<choose>
|
||||
<when test='params.projectName != null and params.projectName != "" and params.projectName.contains("%")'>
|
||||
and pni.project_name like '%1%%' escape '1'
|
||||
and( pni.project_name like '%1%%' escape '1' or pni.project_name like '%1%%' escape '1')
|
||||
</when>
|
||||
<otherwise>
|
||||
and pni.project_name like concat('%',#{params.projectName},'%')
|
||||
and(pni.project_name like concat('%',#{params.projectName},'%') or pyni.year_name like ('%',#{params.projectName},'%'))
|
||||
</otherwise>
|
||||
</choose>
|
||||
</if>
|
||||
|
||||
Reference in New Issue
Block a user