提交 73bdf4b6 编写于 作者: sq3536's avatar sq3536

基础功能角色

上级 35fe8bfc
...@@ -6,6 +6,7 @@ import cn.ibizlab.core.uaa.domain.SysPermission; ...@@ -6,6 +6,7 @@ import cn.ibizlab.core.uaa.domain.SysPermission;
import cn.ibizlab.core.uaa.extensions.domain.PermissionType; import cn.ibizlab.core.uaa.extensions.domain.PermissionType;
import cn.ibizlab.core.uaa.service.ISysPermissionService; import cn.ibizlab.core.uaa.service.ISysPermissionService;
import cn.ibizlab.core.uaa.service.impl.SysPSSystemServiceImpl; import cn.ibizlab.core.uaa.service.impl.SysPSSystemServiceImpl;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -121,6 +122,7 @@ public class SysPSSystemExService extends SysPSSystemServiceImpl { ...@@ -121,6 +122,7 @@ public class SysPSSystemExService extends SysPSSystemServiceImpl {
*/ */
@Override @Override
@Transactional @Transactional
@DS("db2")
public SysPSSystem syncPermission(SysPSSystem system) public SysPSSystem syncPermission(SysPSSystem system)
{ {
if(StringUtils.isEmpty(system.getPssystemid())||system.getSysstructure()==null) if(StringUtils.isEmpty(system.getPssystemid())||system.getSysstructure()==null)
...@@ -156,6 +158,14 @@ public class SysPSSystemExService extends SysPSSystemServiceImpl { ...@@ -156,6 +158,14 @@ public class SysPSSystemExService extends SysPSSystemServiceImpl {
return system; return system;
} }
@Override
@Transactional
@DS("db2")
public boolean syncPermissionBatch(List<SysPSSystem> etList) {
return super.syncPermissionBatch(etList);
}
private String getIds(Set<String> newIds) { private String getIds(Set<String> newIds) {
String[] strIdArr = newIds.toArray(new String[newIds.size()]); String[] strIdArr = newIds.toArray(new String[newIds.size()]);
return "'" + String.join("','", strIdArr) + "'"; return "'" + String.join("','", strIdArr) + "'";
......
...@@ -82,26 +82,26 @@ public class SysPSSystemAspect ...@@ -82,26 +82,26 @@ public class SysPSSystemAspect
@After(value = "execution(* cn.ibizlab.core.uaa.service.ISysPSSystemService.createBatch(..))") // @After(value = "execution(* cn.ibizlab.core.uaa.service.ISysPSSystemService.createBatch(..))")
public void create(JoinPoint point) throws Exception { // public void create(JoinPoint point) throws Exception {
savePermission(point); // savePermission(point);
} // }
@After(value = "execution(* cn.ibizlab.core.uaa.service.ISysPSSystemService.updateBatch(..))") // @After(value = "execution(* cn.ibizlab.core.uaa.service.ISysPSSystemService.updateBatch(..))")
public void update(JoinPoint point) throws Exception { // public void update(JoinPoint point) throws Exception {
savePermission(point); // savePermission(point);
} // }
@After(value = "execution(* cn.ibizlab.core.uaa.service.ISysPSSystemService.saveBatch(..))") // @After(value = "execution(* cn.ibizlab.core.uaa.service.ISysPSSystemService.saveBatch(..))")
public void save(JoinPoint point) throws Exception { // public void save(JoinPoint point) throws Exception {
savePermission(point); // savePermission(point);
} // }
private void savePermission(JoinPoint point) // private void savePermission(JoinPoint point)
{ // {
Object[] args = point.getArgs(); // Object[] args = point.getArgs();
if (args.length > 0) { // if (args.length > 0) {
Object obj = args[0]; // Object obj = args[0];
if (obj instanceof List) // if (obj instanceof List)
((List<SysPSSystem>) obj).forEach(system -> sysPSSystemService.syncPermission(system)); // ((List<SysPSSystem>) obj).forEach(system -> sysPSSystemService.syncPermission(system));
} // }
} // }
} }
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册