Commit 8012a268 authored by duanzhihong's avatar duanzhihong

查找

parent 98a45b08
package com.hungraim.ltc.pojo.entity.system;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
......@@ -16,7 +17,7 @@ import java.util.Date;
@TableName("LTC_ROLE")
public class SystemRole {
@TableId
@TableId( type = IdType.AUTO)
private Long roleId;
private String roleName;
private String status;
......
......@@ -66,12 +66,13 @@ public class RoleController {
systemRole.setStatus(reqRoleInfo.getStatus());
systemRole.setCreatedTime(new Date());
roleService.save(systemRole);
Long roleId = systemRole.getRoleId();
if(reqRoleInfo.getResource() == null){
reqRoleInfo.setResource(new ArrayList<>());
}
List<SystemRoleResource> roleResources = reqRoleInfo.getResource().stream().map(resourceId -> {
SystemRoleResource systemRoleResource = new SystemRoleResource();
systemRoleResource.setRoleId(systemRole.getRoleId());
systemRoleResource.setRoleId(roleId);
systemRoleResource.setResourceId(resourceId);
return systemRoleResource;
}).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