Explorar o código

大屏统计优化

xuxiaofei %!s(int64=2) %!d(string=hai) anos
pai
achega
d839d69389

+ 1 - 46
zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/controller/LabHazardController.java

@@ -329,53 +329,33 @@ public class LabHazardController extends BaseController {
     @GetMapping("/relationBigViewCount")
     @ApiOperation(value = "校级大屏-学院危险源统计")
     public ResultData relationBigViewCount(LabHazardSubjectRelation relation) {
-        Map<String,Object> map = new HashMap<>();
         //获取数据源
         List<LabHazardSubjectRelation> list = labHazardSubjectRelationService.relationBigViewCount(relation);
         //获取危险源列表
         List<SysDictData> dictDataList =  redisService.getCacheObject(BaseConstants.SYS_DICT_KEY+"lab_hazard_type");
-
         //按学院分组
         Map<String, List<LabHazardSubjectRelation>> bottleConfigMap = list.stream().collect(Collectors.groupingBy(LabHazardSubjectRelation::getDeptName));
 
-        //Map<String, List<LabHazardSubjectRelation>> backMap = new HashMap<>();
-
         Map<String,Object> allMap = new HashMap <>();
-
         List<Map<String,Object>> backtList = new ArrayList<>();
         Set <String> deptNames = new HashSet <>();
 
         if(!bottleConfigMap.isEmpty()){
             for (SysDictData dicData:dictDataList) {
                 Map<String,Object> hazardMap = new HashMap <>();
-//                LabHazardSubjectRelation re = new LabHazardSubjectRelation();
-//                re.setTotalNum(0);
-//                re.setHazardTypeModeName(dicData.getDictLabel());
                 hazardMap.put("name",dicData.getDictLabel());
                 List<Integer> hazardtList = new ArrayList<>();
                 for (Map.Entry entry : bottleConfigMap.entrySet()) {
-//                    LabHazardSubjectRelation relation1 = new LabHazardSubjectRelation();
-//                    hazardtList.add(entry.getKey()+"");
-//
                     Object Key = entry.getKey();
                     deptNames.add(Key+"");
-//                    //Object value = entry.getValue();
-//                    relation1.setDeptName(Key+"");
-                    // 循环字典
                     Integer deptCount = 0;
-
-//                    // 循环数据源
+                    // 循环数据源
                     for (LabHazardSubjectRelation lsr:list) {
-
                         if(Key.toString().equals(lsr.getDeptName()) && dicData.getDictLabel().equals(lsr.getHazardTypeModeName())){
                             deptCount = lsr.getTotalNum();
-//                            hazardtList.add(lsr.getTotalNum());
-//                            re.setTotalNum(lsr.getTotalNum());
                         }
                     }
                     hazardtList.add(deptCount);
-//                    hazardtList.add(re);
-//                    relation1.setRelationList(hazardtList);
                 }
                 hazardMap.put("data",hazardtList);
                 backtList.add(hazardMap);
@@ -384,31 +364,6 @@ public class LabHazardController extends BaseController {
 
         allMap.put("list",backtList);
         allMap.put("deptNames",deptNames);
-        //map.put("hazard",dictDataList);
-        //map.put("backMap",backMap);
-
-        /*if(!bottleConfigMap.isEmpty()){
-            for (Map.Entry entry : bottleConfigMap.entrySet()) {
-                List<Object> objectList = new ArrayList<>();
-                Object Key = entry.getKey();
-                Object value = entry.getValue();
-                //System.out.println("key"+Key +"||||"+value);
-                objectList.add(Key);
-                for (SysDictData dicData:dictDataList) {
-                    Integer num =0;
-                    for (LabHazardSubjectRelation lsr:list) {
-                        //System.out.println("DeptName:"+lsr.getDeptName()+" key:"+ Key.toString() +" DictValue"+ dicData.getDictValue()+"  HazardTypeMode"+lsr.getHazardTypeMode());
-                        if(Key.equals(lsr.getDeptName()) && dicData.getDictLabel().equals(lsr.getHazardTypeModeName())){
-                            num=num+lsr.getTotalNum();
-                        }
-                    }
-                    objectList.add(num);
-                }
-                backList.add(objectList);
-            }
-        }
-        map.put("hazard",dictDataList);
-        map.put("list",backList);*/
         return ResultData.success(allMap);
     }
 

+ 0 - 10
zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/domain/LabHazardSubjectRelation.java

@@ -132,8 +132,6 @@ public class LabHazardSubjectRelation extends BaseEntity {
      */
     private Integer totalNum;
 
-    List<LabHazardSubjectRelation> relationList;
-
     public HazardTypeEnum getHazardType() {
         return hazardType;
     }
@@ -255,12 +253,4 @@ public class LabHazardSubjectRelation extends BaseEntity {
     public void setTotalNum(Integer totalNum) {
         this.totalNum = totalNum;
     }
-
-    public List<LabHazardSubjectRelation> getRelationList() {
-        return relationList;
-    }
-
-    public void setRelationList(List<LabHazardSubjectRelation> relationList) {
-        this.relationList = relationList;
-    }
 }