zengh
2021-08-15 0cab6d8afcc97e8bc94ef200e24d8839281f44c8
src/main/java/org/springblade/modules/information/controller/InformationController.java
@@ -110,6 +110,8 @@
   @ApiOperation(value = "新增", notes = "传入information")
   public R save(@Valid @RequestBody Information information) {
      Dept dept= new Dept();
      String departmentid = information.getDepartmentid();
      Long l=Long.parseLong(departmentid);
      //自招保安公司
      if(information.getStats().equals("0")){
         Long i = 1420222768149966850L;
@@ -127,6 +129,7 @@
         dept.setDeptName(information.getEnterprisename());
         dept.setAncestors("0,1418458374477549569");
         dept.setDeptCategory(1);
      }
      //保安服务公司
      if(information.getStats().equals("2")){
@@ -146,6 +149,7 @@
         dept.setAncestors("0,1420222961377357825");
         dept.setDeptCategory(1);
      }
      dept.setId(l);
      if (iDeptService.submit(dept)) {
         CacheUtil.clear(SYS_CACHE);
         // 返回懒加载树更新节点所需字段
@@ -369,7 +373,7 @@
   }
   /**
    * 查询本年所有月份社保金额
    * 查询本年所有月份社保金额(公司经济运营趋势)
    * @return
    */
   @GetMapping("/queryYearAn")
@@ -601,16 +605,19 @@
   }
   /**
    * 统计保安员资格异常的数量
    * @param jurisdiction
    * @param deptid
    * @param type 1:当天  2:当月 3:全部
    * @return
    */
   @PostMapping("/selectExtype")
   public R selectExtype(String jurisdiction,String deptid) {
   public R selectExtype(String jurisdiction,String deptid,String type) {
      Map<String, Object> map = new HashMap<String, Object>();
      Integer count=0;
      List<Map<String, Object>> lists = new ArrayList<>();
      List<Map<Object, Object>> maps = informationService.selectExtype(jurisdiction, deptid);
      List<Map<Object, Object>> maps = informationService.selectExtype(jurisdiction, deptid,type);
      for (int i=0;i<maps.size();i++){
         String num = maps.get(i).get("num").toString();
         count+= Integer.valueOf(num);
@@ -621,15 +628,20 @@
      return R.data(lists);
   }
   /**
    * 统计保安员表现差的数量
    * @param jurisdiction
    * @param deptid
    * @param type 1:当天  2:当月 3:全部
    * @return
    */
   @PostMapping("/selectBx")
   public R selectBx(String jurisdiction,String deptid) {
   public R selectBx(String jurisdiction,String deptid,String type) {
      Map<String, Object> map = new HashMap<String, Object>();
      Integer count=0;
      List<Map<String, Object>> lists = new ArrayList<>();
      List<Map<Object, Object>> maps = informationService.selectBx(jurisdiction, deptid);
      List<Map<Object, Object>> maps = informationService.selectBx(jurisdiction, deptid,type);
      for (int i=0;i<maps.size();i++){
         String num = maps.get(i).get("num").toString();
         count+= Integer.valueOf(num);
@@ -659,13 +671,13 @@
         //辖区名称
         String jurname = list.get(i).get("dept_name").toString();
         //保安员表现差预警数量
         List<Map<Object, Object>> mapbx = informationService.selectBx(jurisdiction, "");
         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, "");
         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);
@@ -723,4 +735,47 @@
      return R.data(maps);
   }
   /**
    * 单位删除
    */
   @PostMapping("/deleteDept")
   public R deleteDept(String ids) {
      informationService.deleteDept(ids);
      return R.success("删除成功");
   }
   /**
    * 保安员统计
    */
   @PostMapping("/selectLi")
   public R selectLi(String jurisdiction,String deptid) {
      List<Map<Object, Object>> list = informationService.selectLi(jurisdiction, deptid);
      return R.data(list);
   }
   /**
    * 单位类型统计
    */
   @PostMapping("/seCountI")
   public R seCountI(String jurisdiction,String deptid) {
      List<Map<Object, Object>> list = informationService.seCountI(jurisdiction, deptid);
      return R.data(list);
   }
   /**
    * 保安在职男女数量
    */
   @PostMapping("/seCountUg")
   public R seCountUg(String jurisdiction,String deptid) {
      String mnum = informationService.seCountUm(jurisdiction, deptid);
      String gnum = informationService.seCountUg(jurisdiction, deptid);
      Map map = new HashMap();
      map.put("mnum",mnum);
      map.put("gnum",gnum);
      List list = new ArrayList();
      list.add(map);
      return R.data(list);
   }
}