Commit 8012a268 authored by duanzhihong's avatar duanzhihong

查找

parent 98a45b08
package com.hungraim.ltc.pojo.entity.system; package com.hungraim.ltc.pojo.entity.system;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
...@@ -16,7 +17,7 @@ import java.util.Date; ...@@ -16,7 +17,7 @@ import java.util.Date;
@TableName("LTC_ROLE") @TableName("LTC_ROLE")
public class SystemRole { public class SystemRole {
@TableId @TableId( type = IdType.AUTO)
private Long roleId; private Long roleId;
private String roleName; private String roleName;
private String status; private String status;
......
...@@ -66,12 +66,13 @@ public class RoleController { ...@@ -66,12 +66,13 @@ public class RoleController {
systemRole.setStatus(reqRoleInfo.getStatus()); systemRole.setStatus(reqRoleInfo.getStatus());
systemRole.setCreatedTime(new Date()); systemRole.setCreatedTime(new Date());
roleService.save(systemRole); roleService.save(systemRole);
Long roleId = systemRole.getRoleId();
if(reqRoleInfo.getResource() == null){ if(reqRoleInfo.getResource() == null){
reqRoleInfo.setResource(new ArrayList<>()); reqRoleInfo.setResource(new ArrayList<>());
} }
List<SystemRoleResource> roleResources = reqRoleInfo.getResource().stream().map(resourceId -> { List<SystemRoleResource> roleResources = reqRoleInfo.getResource().stream().map(resourceId -> {
SystemRoleResource systemRoleResource = new SystemRoleResource(); SystemRoleResource systemRoleResource = new SystemRoleResource();
systemRoleResource.setRoleId(systemRole.getRoleId()); systemRoleResource.setRoleId(roleId);
systemRoleResource.setResourceId(resourceId); systemRoleResource.setResourceId(resourceId);
return systemRoleResource; return systemRoleResource;
}).collect(Collectors.toList()); }).collect(Collectors.toList());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment