智慧保安后台管理项目备份
tangzy
2021-09-24 87c8721094ee295cc3bb7870aedaa3e0aa0368a3
src/main/java/org/springblade/modules/information/controller/InformationController.java
@@ -1578,9 +1578,9 @@
      return R.data(lists);
   }
   /**
   /*   *//**
    * 分局预警统计
    */
    *//*
   @PostMapping("/selectFj")
   public R selectFj() {
      //辖区信息
@@ -1663,7 +1663,86 @@
         lists.add(map);
      }
      return R.data(lists);
   }*/
   /**
    * 分局预警统计
    */
   @PostMapping("/selectFj")
   public R selectFj() {
      //辖区信息
      List<Map<Object, Object>> list = informationService.selectJur();
      List<Map<String, Object>> lists = new ArrayList<>();
      for (int i = 0; i < list.size(); i++) {
         Integer count = 0;
         int countwg = 0;
         int countjy = 0;
         int countwm = 0;
         Map<String, Object> map = new HashMap<String, Object>();
         //辖区id
         String id = list.get(i).get("id").toString();
         //辖区名称
         String jurname = list.get(i).get("dept_name").toString();
         String childer = informationService.selJurchilder(id);
         String[] split = childer.split(",");
         String strArrays = "";
         for (int j = 0; j < split.length; j++) {
            strArrays += "'" + split[j] + "',";
   }
         String jurisdiction = strArrays.substring(0, strArrays.length() - 1);
         //保安员表现差预警数量
         List<Map<Object, Object>> mapbx = informationService.selectBx(jurisdiction, "", "");
         for (int ibx = 0; ibx < mapbx.size(); ibx++) {
            String num = mapbx.get(ibx).get("num").toString();
            count += Integer.valueOf(num);
         }
         //保安员资格异常的数量
         List<Map<Object, Object>> mapEx = informationService.selectExtype(jurisdiction, "", "");
         for (int iex = 0; iex < mapEx.size(); iex++) {
            String num = mapEx.get(iex).get("num").toString();
            count += Integer.valueOf(num);
         }
         List<Map<Object, Object>> maps = informationService.seleFj(jurisdiction);
         for (int z = 0; z < maps.size(); z++) {
            //违规经营
            //总数
            String znums = maps.get(z).get("znum").toString();
            int znum = Integer.parseInt(znums);
            //持证人数
            String cznums = maps.get(z).get("cznum").toString();
            int cznum = Integer.parseInt(cznums);
            //缴纳社保人数
            String sbnums = maps.get(z).get("sbnum").toString();
            int sbnum = Integer.parseInt(sbnums);
            //保安总人数为0
            if (znum == 0) {
               continue;
            } else {
               int a = znum / 2;
               if (cznum <= a || sbnum <= a) {
                  countwg++;
               }
            }
            //经营不善
            String num = maps.get(z).get("fwnum").toString();
            int a = Integer.parseInt(num);
            if (a == 0) {
               countjy++;
            }
            //有实无名
            String numw = maps.get(z).get("znum").toString();
            int aw = Integer.parseInt(numw);
            if (aw == 0) {
               countwm++;
            }
         }
         //处罚
         List<Map<Object, Object>> mapc = informationService.selectCf(jurisdiction);
         int size = mapc.size();
         map.put("Count", count + countjy + countwg + countwm + size);
         map.put("jurname", jurname);
         lists.add(map);
      }
      return R.data(lists);
   }
}