提交 92e6f245 编写于 作者: sq3536's avatar sq3536

路径

上级 edf770c4
...@@ -116,6 +116,7 @@ public class webSecurityConfig extends WebSecurityConfigurerAdapter { ...@@ -116,6 +116,7 @@ public class webSecurityConfig extends WebSecurityConfigurerAdapter {
.antMatchers("/"+downloadpath+"/**").permitAll() .antMatchers("/"+downloadpath+"/**").permitAll()
.antMatchers("/"+uploadpath).permitAll() .antMatchers("/"+uploadpath).permitAll()
.antMatchers("/"+previewpath+"/**").permitAll() .antMatchers("/"+previewpath+"/**").permitAll()
.antMatchers("/syspssystems/**/permissiondata").permitAll()
// 所有请求都需要认证 // 所有请求都需要认证
.anyRequest().authenticated() .anyRequest().authenticated()
// 防止iframe 造成跨域 // 防止iframe 造成跨域
......
...@@ -101,6 +101,7 @@ public class DevBootSecurityConfig extends WebSecurityConfigurerAdapter { ...@@ -101,6 +101,7 @@ public class DevBootSecurityConfig extends WebSecurityConfigurerAdapter {
.antMatchers( HttpMethod.POST,"/"+loginPath).permitAll() .antMatchers( HttpMethod.POST,"/"+loginPath).permitAll()
.antMatchers( HttpMethod.POST,"/"+uaaLoginPath).permitAll() .antMatchers( HttpMethod.POST,"/"+uaaLoginPath).permitAll()
.antMatchers( HttpMethod.POST,"/"+uaaLoginPath2).permitAll() .antMatchers( HttpMethod.POST,"/"+uaaLoginPath2).permitAll()
.antMatchers("/syspssystems/**/permissiondata").permitAll()
.anyRequest().authenticated() .anyRequest().authenticated()
// 防止iframe 造成跨域 // 防止iframe 造成跨域
.and().headers().frameOptions().disable(); .and().headers().frameOptions().disable();
......
...@@ -25,10 +25,7 @@ import org.springframework.util.ObjectUtils; ...@@ -25,10 +25,7 @@ import org.springframework.util.ObjectUtils;
import org.springframework.util.StringUtils; import org.springframework.util.StringUtils;
import java.sql.Timestamp; import java.sql.Timestamp;
import java.util.Date; import java.util.*;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/** /**
* 实体属性默认值切面,只有新建(Create)时才会填充默认值 * 实体属性默认值切面,只有新建(Create)时才会填充默认值
...@@ -73,7 +70,7 @@ public class SysPSSystemAspect ...@@ -73,7 +70,7 @@ public class SysPSSystemAspect
return; return;
Map<String,Integer> delPermission = new HashMap<>(); Map<String,Integer> delPermission = new HashMap<>();
sysPermissionService.list(new QueryWrapper<SysPermission>().select("sys_permissionid").eq("pssystemid",system.getPssystemid())).forEach(sysPermission -> delPermission.put(sysPermission.getPermissionid(),1)); sysPermissionService.list(new QueryWrapper<SysPermission>().select("sys_permissionid").eq("pssystemid",system.getPssystemid())).forEach(sysPermission -> delPermission.put(sysPermission.getPermissionid(),1));
List<SysPermission> list = system.getSysstructure().getSysPermissions(PermissionType.OPPRIV); Set<SysPermission> list = system.getSysstructure().getSysPermissions(PermissionType.OPPRIV);
list.addAll(system.getSysstructure().getSysPermissions(PermissionType.APPMENU)); list.addAll(system.getSysstructure().getSysPermissions(PermissionType.APPMENU));
list.addAll(system.getSysstructure().getSysPermissions(PermissionType.UNIRES)); list.addAll(system.getSysstructure().getSysPermissions(PermissionType.UNIRES));
list.forEach(sysPermission -> delPermission.remove(sysPermission.getPermissionid())); list.forEach(sysPermission -> delPermission.remove(sysPermission.getPermissionid()));
......
...@@ -10,6 +10,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; ...@@ -10,6 +10,7 @@ import com.fasterxml.jackson.annotation.JsonProperty;
import liquibase.pro.packaged.S; import liquibase.pro.packaged.S;
import lombok.Data; import lombok.Data;
import java.sql.Timestamp;
import java.util.*; import java.util.*;
@Data @Data
...@@ -192,16 +193,16 @@ public class SysStructure ...@@ -192,16 +193,16 @@ public class SysStructure
return itemNode; return itemNode;
} }
public List<SysPermission> getSysPermissions(PermissionType type) public Set<SysPermission> getSysPermissions(PermissionType type)
{ {
List<SysPermission> list = new ArrayList<>(); Set<SysPermission> list = new LinkedHashSet<>();
PermissionNode root = getPermissionTree(type); PermissionNode root = getPermissionTree(type);
loopPermissionNode(list,root); loopPermissionNode(list,root);
return list; return list;
} }
private void loopPermissionNode(List<SysPermission> list,PermissionNode root) private void loopPermissionNode(Set<SysPermission> list,PermissionNode root)
{ {
if(root.getChildren()!=null){ if(root.getChildren()!=null){
root.getChildren().forEach(node->{ root.getChildren().forEach(node->{
...@@ -211,6 +212,8 @@ public class SysStructure ...@@ -211,6 +212,8 @@ public class SysStructure
sysPermission.setPermissionname(node.getFullName()); sysPermission.setPermissionname(node.getFullName());
sysPermission.setPssystemid(node.getSystemid()); sysPermission.setPssystemid(node.getSystemid());
sysPermission.setPermissiontype(node.getType().toString()); sysPermission.setPermissiontype(node.getType().toString());
sysPermission.setUpdatedate(new Timestamp(new java.util.Date().getTime()));
sysPermission.setEnable(1);
list.add(sysPermission); list.add(sysPermission);
} }
loopPermissionNode(list,node); loopPermissionNode(list,node);
......
...@@ -8,6 +8,8 @@ import java.util.Map; ...@@ -8,6 +8,8 @@ import java.util.Map;
import java.util.HashMap; import java.util.HashMap;
import java.io.Serializable; import java.io.Serializable;
import java.math.BigDecimal; import java.math.BigDecimal;
import cn.ibizlab.core.uaa.extensions.domain.SysStructure;
import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
...@@ -45,7 +47,7 @@ public class SysPSSystemDTO extends DTOBase implements Serializable { ...@@ -45,7 +47,7 @@ public class SysPSSystemDTO extends DTOBase implements Serializable {
*/ */
@JSONField(name = "sysstructure") @JSONField(name = "sysstructure")
@JsonProperty("sysstructure") @JsonProperty("sysstructure")
private String sysstructure; private SysStructure sysstructure;
/** /**
...@@ -59,7 +61,7 @@ public class SysPSSystemDTO extends DTOBase implements Serializable { ...@@ -59,7 +61,7 @@ public class SysPSSystemDTO extends DTOBase implements Serializable {
/** /**
* 设置 [SYSSTRUCTURE] * 设置 [SYSSTRUCTURE]
*/ */
public void setSysstructure(String sysstructure){ public void setSysstructure(SysStructure sysstructure){
this.sysstructure = sysstructure ; this.sysstructure = sysstructure ;
this.modify("sysstructure",sysstructure); this.modify("sysstructure",sysstructure);
} }
......
package cn.ibizlab.api.rest.extensions; package cn.ibizlab.api.rest.extensions;
import cn.ibizlab.api.dto.SysPSSystemDTO;
import cn.ibizlab.api.mapping.SysPSSystemMapping;
import cn.ibizlab.core.uaa.domain.SysPSSystem;
import cn.ibizlab.core.uaa.extensions.domain.PermissionNode; import cn.ibizlab.core.uaa.extensions.domain.PermissionNode;
import cn.ibizlab.core.uaa.extensions.domain.SysStructure;
import cn.ibizlab.core.uaa.extensions.service.UAACoreService; import cn.ibizlab.core.uaa.extensions.service.UAACoreService;
import cn.ibizlab.core.uaa.service.ISysPSSystemService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity; import org.springframework.http.ResponseEntity;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
...@@ -17,6 +25,13 @@ public class UAACoreResource { ...@@ -17,6 +25,13 @@ public class UAACoreResource {
@Autowired @Autowired
private UAACoreService uaaCoreService; private UAACoreService uaaCoreService;
@Autowired
private ISysPSSystemService sysPSSystemService;
@Autowired
@Lazy
public SysPSSystemMapping syspssystemMapping;
/** /**
* 获取全部菜单列表和数据能力列表和统一资源列表 * 获取全部菜单列表和数据能力列表和统一资源列表
* *
...@@ -29,6 +44,14 @@ public class UAACoreResource { ...@@ -29,6 +44,14 @@ public class UAACoreResource {
return ResponseEntity.ok().body(map); return ResponseEntity.ok().body(map);
} }
@ApiOperation(value = "Save", tags = {"SysPSSystem" }, notes = "Save")
@RequestMapping(method = RequestMethod.POST, value = "/syspssystems/{systemid}/permissiondata")
public ResponseEntity<Boolean> pushSystemPermissionData(@PathVariable("systemid") String systemid,@RequestBody SysStructure sysStructure) {
SysPSSystem sysPSSystem = new SysPSSystem();
sysPSSystem.setPssystemid(systemid);
sysPSSystem.setPssystemname(systemid);
sysPSSystem.setSysstructure(sysStructure);
return ResponseEntity.status(HttpStatus.OK).body(sysPSSystemService.save(sysPSSystem));
}
} }
...@@ -18,6 +18,7 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression; ...@@ -18,6 +18,7 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression;
/** /**
* 实体[IBZUSER] 服务对象接口实现 * 实体[IBZUSER] 服务对象接口实现
*/ */
@Primary
@Service("IBZUSERService") @Service("IBZUSERService")
public class IBZUSERServiceImpl extends ServiceImpl<IBZUSERMapper, IBZUSER> implements IBZUSERService,AuthenticationUserService{ public class IBZUSERServiceImpl extends ServiceImpl<IBZUSERMapper, IBZUSER> implements IBZUSERService,AuthenticationUserService{
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册