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

基础功能角色

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