|
|
|
@ -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("保存成功!"); |
|
|
|
} |
|
|
|
|