浏览代码

bug修改

songwb 1 年之前
父节点
当前提交
dcaad2edcc

+ 16 - 14
ims-service/ims-eval/src/main/java/com/ims/eval/config/permission/PermissionAspect.java

@@ -125,11 +125,11 @@ public class PermissionAspect implements Interceptor {
 		if (null != user) {
 			organizationId = user.getUnitId();
 			if (null != dept) {
-				if ("LSBM".equals(dept.getDataKey())) {
-					scope = 3;
-				} else {
-					scope = dept.getScope();
-				}
+//				if ("LSBM".equals(dept.getDataKey())) {
+//					scope = 3;
+//				} else {
+				scope = dept.getScope();
+//				}
 			}
 			List<PostUser> postUserList = getUserPostList(user.getId());
 			post = getSysPost(postUserList);
@@ -173,7 +173,7 @@ public class PermissionAspect implements Interceptor {
 				if (classNames == null) {
 					//扫描指定包路径下所有包含指定注解的类
 					Set<Class<?>> classSet = ClassUtil.scanPackageByAnnotation(packagePath, DataPermission.class);
-					if (classSet == null && classSet.size() == 0) {
+					if (classSet == null || classSet.isEmpty()) {
 						classNames = new ArrayList<>();
 					} else {
 						//取得类全名
@@ -198,6 +198,12 @@ public class PermissionAspect implements Interceptor {
 						//方法是否含有DataPermission注解,如果含有注解则将数据结果过滤
 						if (method.isAnnotationPresent(DataPermission.class)) {
 							dataPermission = method.getAnnotation(DataPermission.class);
+							if ("selectEvaluationInfoList".equals(method.getName())) {
+								if (!user.getUnitName().contains("本部")) {
+									CacheContext.childCompanyId.put(user.getId(), user.getUnitId());
+									return invocation.proceed();
+								}
+							}
 							if (dataPermission != null) {
 								methodNames.put(newId + "-" + method.getName(), dataPermission.isPermission());
 								methodNames.put(newId + "-" + method.getName() + "type", dataPermission.type());
@@ -229,7 +235,7 @@ public class PermissionAspect implements Interceptor {
 						boolean bktype = null != methodNames.get(newId + "-" + newName + "bktype") ? methodNames.get(newId + "-" + newName + "bktype") : false;
 
 
-						System.out.println("==========type=" + type + ";zbtype" + zbtype + ";bktype" + bktype);
+						System.out.println("==========type=" + type + ";zbtype=" + zbtype + ";bktype=" + bktype);
 						if (null != post && post.getKeyValue().equals("JCDW")) {
 							System.out.println("==========post.getKeyValue()=" + post.getKeyValue());
 							if (type) {
@@ -280,10 +286,6 @@ public class PermissionAspect implements Interceptor {
 			}
 		}
 
-		if (scope.equals(DATA_SCOPE_CUSTOM)) {
-			CacheContext.childCompanyId.put(user.getId(), user.getUnitId());
-			return invocation.proceed();
-		}
 		return invocation.proceed();
 	}
 
@@ -387,11 +389,11 @@ public class PermissionAspect implements Interceptor {
 	public DataDictionary getSysDept(MyuserResDTO user) {
 		if (user != null && CacheContext.ddSuperKeyMap.containsKey(DEPT_MARK)) {
 			if (!user.getUnitName().contains("本部")) {
-				return CacheContext.ddMap.get("LSBM");
-			}
+				return CacheContext.ddMap.get("61140");
+			}else {
 			Optional<DataDictionary> any = CacheContext.ddSuperKeyMap.get(DEPT_MARK).stream().filter(t -> t.getKeyName().equals(user.getDeptName())).findAny();
 			return any.isPresent() ? any.get() : CacheContext.ddMap.get("LSBM");//如果没有匹配上部门,赋予零时部门权限
-		}
+		}}
 		return null;
 	}
 

+ 5 - 1
ims-service/ims-eval/src/main/java/com/ims/eval/controller/OrganizationEvaluationInfoController.java

@@ -109,7 +109,11 @@ public class OrganizationEvaluationInfoController {
 		List<OrganizationEvaluation> orgEva = organizationEvaluationService.list(qw);
 		StringBuilder sb = new StringBuilder();
 		if (orgEva != null) {
-			sb.append(orgEva.get(0).getCheckCycle()).append("_").append(orgEva.get(0).getYear());
+			if ("NDKP".equals(orgEva.get(0).getCheckCycle())) {
+				sb.append(orgEva.get(0).getCheckCycle()).append("_").append(orgEva.get(0).getYear()).append("_1");
+			}else {
+				sb.append(orgEva.get(0).getCheckCycle()).append("_").append(orgEva.get(0).getYear());
+			}
 			if (orgEva.get(0).getMonth() != null) {
 				sb.append("_").append(orgEva.get(0).getMonth());
 			}