bug--字典新增详情无效、菜单修改报错
This commit is contained in:
@ -45,6 +45,9 @@ public class DictDetail implements Serializable {
|
|||||||
/** 字典id */
|
/** 字典id */
|
||||||
private Long dictId;
|
private Long dictId;
|
||||||
|
|
||||||
|
@TableField(exist = false)
|
||||||
|
private Dict dict;
|
||||||
|
|
||||||
|
|
||||||
/** 创建日期 */
|
/** 创建日期 */
|
||||||
@TableField(fill= FieldFill.INSERT)
|
@TableField(fill= FieldFill.INSERT)
|
||||||
|
@ -73,6 +73,7 @@ public class DictDetailController {
|
|||||||
if (resources.getId() != null) {
|
if (resources.getId() != null) {
|
||||||
throw new BadRequestException("A new "+ ENTITY_NAME +" cannot already have an ID");
|
throw new BadRequestException("A new "+ ENTITY_NAME +" cannot already have an ID");
|
||||||
}
|
}
|
||||||
|
resources.setDictId(resources.getDict().getId());
|
||||||
return new ResponseEntity<>(dictDetailService.save(resources),HttpStatus.CREATED);
|
return new ResponseEntity<>(dictDetailService.save(resources),HttpStatus.CREATED);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -112,7 +112,7 @@ public class MenuController {
|
|||||||
throw new EntityExistException(Menu.class,"name",resources.getName());
|
throw new EntityExistException(Menu.class,"name",resources.getName());
|
||||||
}
|
}
|
||||||
if(StringUtils.isNotBlank(resources.getComponentName())){
|
if(StringUtils.isNotBlank(resources.getComponentName())){
|
||||||
menu = menuService.getOne(new QueryWrapper<Menu>().eq("componentName",resources.getComponentName()));
|
menu = menuService.getOne(new QueryWrapper<Menu>().eq("component_name",resources.getComponentName()));
|
||||||
if(menu != null){
|
if(menu != null){
|
||||||
throw new EntityExistException(Menu.class,"componentName",resources.getComponentName());
|
throw new EntityExistException(Menu.class,"componentName",resources.getComponentName());
|
||||||
}
|
}
|
||||||
|
@ -309,7 +309,7 @@ public class MenuServiceImpl extends BaseServiceImpl<MenuMapper, Menu> implement
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(StringUtils.isNotBlank(resources.getComponentName())){
|
if(StringUtils.isNotBlank(resources.getComponentName())){
|
||||||
menu1 = this.getOne(new QueryWrapper<Menu>().eq("componentName",resources.getComponentName()));
|
menu1 = this.getOne(new QueryWrapper<Menu>().eq("component_name",resources.getComponentName()));
|
||||||
if(menu1 != null && !menu1.getId().equals(menu.getId())){
|
if(menu1 != null && !menu1.getId().equals(menu.getId())){
|
||||||
throw new EntityExistException(Menu.class,"componentName",resources.getComponentName());
|
throw new EntityExistException(Menu.class,"componentName",resources.getComponentName());
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user