|
@@ -112,9 +112,11 @@ public class SysDictTypeController extends BaseController {
|
|
|
@PostMapping
|
|
|
public AjaxResult add(@Validated @RequestBody SysDictType dict)
|
|
|
{
|
|
|
- if (UserConstants.NOT_UNIQUE.equals(dictTypeService.checkDictTypeUnique(dict)))
|
|
|
- {
|
|
|
- return error("新增字典'" + dict.getDictName() + "'失败,字典类型已存在");
|
|
|
+ if (UserConstants.NOT_UNIQUE.equals(dictTypeService.checkDictTypeUnique(dict))) {
|
|
|
+ return error("新增字典'" + dict.getDictType() + "'失败,字典类型已存在");
|
|
|
+ }
|
|
|
+ if (UserConstants.NOT_UNIQUE.equals(dictTypeService.checkDictNameUnique(dict))) {
|
|
|
+ return error("新增字典'" + dict.getDictName() + "'失败,字典名称已存在");
|
|
|
}
|
|
|
dict.setCreateBy(getUsername());
|
|
|
return toAjax(dictTypeService.insertDictType(dict));
|