Commit 464a1d0f authored by hongguangwu's avatar hongguangwu

薪资相关权限-优化

parent af112b7d
...@@ -59,7 +59,7 @@ public class Common { ...@@ -59,7 +59,7 @@ public class Common {
* @author: fxj * @author: fxj
*/ */
public static boolean isEmpty(Object obj) { public static boolean isEmpty(Object obj) {
return null == obj || "".equals(obj); return null == obj || "".equals(obj) || "null".equals(obj);
} }
public static boolean isNotNull(Object obj) { public static boolean isNotNull(Object obj) {
......
...@@ -78,7 +78,7 @@ public class MenuUtil { ...@@ -78,7 +78,7 @@ public class MenuUtil {
} }
if (Common.isNotNull(obj)) { if (Common.isNotNull(obj)) {
SimpleValueWrapper objs = (SimpleValueWrapper) obj; SimpleValueWrapper objs = (SimpleValueWrapper) obj;
if (objs != null) { if (Common.isEmpty(objs)) {
String sql = String.valueOf(objs.get()); String sql = String.valueOf(objs.get());
if (sql.contains("#create_by")) { if (sql.contains("#create_by")) {
sql = sql.replace("#create_by", user.getId()); sql = sql.replace("#create_by", user.getId());
......
...@@ -37,7 +37,7 @@ public class TConfigSalaryServiceImpl extends ServiceImpl<TConfigSalaryMapper, T ...@@ -37,7 +37,7 @@ public class TConfigSalaryServiceImpl extends ServiceImpl<TConfigSalaryMapper, T
public R<IPage<TConfigSalary>> getTConfigSalaryPage(Page<TConfigSalary> page, TConfigSalary tConfigSalary){ public R<IPage<TConfigSalary>> getTConfigSalaryPage(Page<TConfigSalary> page, TConfigSalary tConfigSalary){
YifuUser user = SecurityUtils.getUser(); YifuUser user = SecurityUtils.getUser();
TSettleDomainListVo vo = null; TSettleDomainListVo vo = null;
if (Common.isNotNull(user)) { if (Common.isNotNull(user) && CommonConstants.ONE_STRING.equals(user.getSystemFlag())) {
R<TSettleDomainListVo> domainListVoR = archivesDaprUtil.getSettleDomainIdsByUserId(user.getId()); R<TSettleDomainListVo> domainListVoR = archivesDaprUtil.getSettleDomainIdsByUserId(user.getId());
if (Common.isEmpty(domainListVoR)) { if (Common.isEmpty(domainListVoR)) {
return R.failed("调用结算服务失败"); return R.failed("调用结算服务失败");
......
...@@ -418,10 +418,28 @@ public class SysDataAuthServiceImpl extends ServiceImpl<SysDataAuthMapper, SysDa ...@@ -418,10 +418,28 @@ public class SysDataAuthServiceImpl extends ServiceImpl<SysDataAuthMapper, SysDa
* @return: void * @return: void
**/ **/
public void deleteSubInfoByMainId(String mainId) { public void deleteSubInfoByMainId(String mainId) {
authDeptRelService.deleteAuthDeptRelByAuthId(mainId); SysDataAuth a = this.getById(mainId);
authMenuRelService.deleteAuthMenuRelByAuthId(mainId); if (a != null) {
diySqlService.deleteDiySqlByAuthId(mainId); Cache cache = cacheManager.getCache(CacheConstants.DATA_AUTH_DETAILS + a.getLinkType());
diySqlMenuRelService.deleteSqlMenuRelByAuthId(mainId); if (cache != null) {
List<SysDataAuthMenuRel> authMenuList = authMenuRelService.getByMainId(mainId);
List<SysDiySqlMenuRel> diySqlMenuList = diySqlMenuRelService.getByMainId(mainId);
if (authMenuList != null && !authMenuList.isEmpty()) {
for (SysDataAuthMenuRel sd : authMenuList) {
cache.put(a.getLinkId() + CommonConstants.DOWN_LINE_STRING + sd.getMenuId(), null);
}
}
if (diySqlMenuList != null && !diySqlMenuList.isEmpty()) {
for (SysDiySqlMenuRel dsd : diySqlMenuList) {
cache.put(a.getLinkId() + CommonConstants.DOWN_LINE_STRING + dsd.getMenuId(), null);
}
}
authDeptRelService.deleteAuthDeptRelByAuthId(mainId);
authMenuRelService.deleteAuthMenuRelByAuthId(mainId);
diySqlService.deleteDiySqlByAuthId(mainId);
diySqlMenuRelService.deleteSqlMenuRelByAuthId(mainId);
}
}
} }
/** /**
......
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