Kaynağa Gözat

统计分析页面新增数据权限

Wayne 3 ay önce
ebeveyn
işleme
9626d50f4e

+ 9 - 2
projects/src/main/java/com/rtrh/projects/web/controller/projects/TjFxController.java

@@ -7,9 +7,11 @@ import java.io.InputStream;
 import java.math.BigDecimal;
 import java.text.SimpleDateFormat;
 import java.util.*;
+import java.util.stream.Collectors;
 
 import cn.afterturn.easypoi.word.WordExportUtil;
 import cn.afterturn.easypoi.word.entity.MyXWPFDocument;
+import cn.hutool.core.collection.CollectionUtil;
 import com.rtrh.common.util.StringUtil;
 import com.rtrh.projects.modules.projects.mapper.ReportMapper;
 import com.rtrh.projects.modules.projects.po.SubIndu;
@@ -51,8 +53,13 @@ public class TjFxController extends BaseController {
 
 	@GetMapping("index")
 	public ModelAndView index(ModelMap model) {
-		List<TSystable> JSDD = tSysTableService.getByKind(SysTableKind.JSDD);
-		model.put("JSDD", JSDD);
+		List<TSystable> byKind = tSysTableService.getByKind(SysTableKind.JSDD);
+		List<String> subjectIds = getSubjectIds();
+		if (CollectionUtil.isNotEmpty(subjectIds)){
+			byKind = byKind.stream().filter(item -> subjectIds.contains(item.getCode())).collect(Collectors.toList());
+		}
+		model.put("JSDD",byKind);   //项目属地
+
 		List<SubIndu> subInduList = subInduService.queryParentAll();
 		model.put("HYFL", subInduList);
 		List<TSystable> JSXZ = tSysTableService.getByKind(SysTableKind.JSXZ);