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

路径

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