|
|
@@ -54,6 +54,14 @@ public class NewRoleApiController extends BaseApiController{
|
|
|
permisionIds.add(pid);
|
|
|
}
|
|
|
Role records = jo.toJavaObject(Role.class);
|
|
|
+ String newName=roleMapper.selectNameById(records.getId());
|
|
|
+ if(newName==null){
|
|
|
+ String newid=roleMapper.selectIdByName(records.getRoleName());
|
|
|
+ if(newid!=null){
|
|
|
+ res.getError().add(buildError("","角色已存在"));
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+ }
|
|
|
res.setData(newRoleService.insert(records, permisionIds));
|
|
|
} else {
|
|
|
res.getError().add(buildError("", "参数格式不正确"));
|