Browse Source

2024-1-5 字典新增校验

master
zelian_wu 2 years ago
parent
commit
91bdd84d06
  1. 10
      src/main/java/com/spring/modules/sys/controller/DictTypeController.java
  2. 1
      src/main/resources/mapper/project/ProjectDao.xml

10
src/main/java/com/spring/modules/sys/controller/DictTypeController.java

@ -32,6 +32,16 @@ public class DictTypeController {
if (Objects.isNull(dictType)){
throw new RuntimeException("字典编码为空");
}
if (!StringUtils.hasText(dictType.getDictType())){
throw new RuntimeException("字典类型为空");
}
if (!StringUtils.hasText(dictType.getSite())){
throw new RuntimeException("工厂编码为空");
}
List<DictType> list = dictTypeService.list(new LambdaQueryWrapper<DictType>().eq(DictType::getDictType, dictType.getDictType()).eq(DictType::getSite, dictType.getSite()));
if (null != list && !list.isEmpty()){
throw new RuntimeException("该字典类型已存在!");
}
if (dictTypeService.save(dictType)) {
return R.ok("保存成功!");
}

1
src/main/resources/mapper/project/ProjectDao.xml

@ -32,6 +32,7 @@
AND bu_no in ( select bu_no from AccessBu where site=#{query.site} and username=#{query.userName} )
</if>
</where>
order by create_date desc
</select>
<select id="checkPlmProjectInfoData" resultType="PlmProjectInfoData">
SELECT project_id,ori_project_id,project_level,project_type_db,project_name,status,project_source,customer_id,create_by,

Loading…
Cancel
Save