From 77d23c6b9274f0cceac40fae2f546f29be8063cf Mon Sep 17 00:00:00 2001
From: tangzy <tangzy123456>
Date: Fri, 19 Nov 2021 10:19:35 +0800
Subject: [PATCH] 1.统计

---
 src/main/java/org/springblade/modules/information/controller/InformationController.java |   88 +++++++-------------------------------------
 1 files changed, 14 insertions(+), 74 deletions(-)

diff --git a/src/main/java/org/springblade/modules/information/controller/InformationController.java b/src/main/java/org/springblade/modules/information/controller/InformationController.java
index f83eb31..b267306 100644
--- a/src/main/java/org/springblade/modules/information/controller/InformationController.java
+++ b/src/main/java/org/springblade/modules/information/controller/InformationController.java
@@ -197,62 +197,6 @@
 		return R.success("删除成功");
 	}
 
-//	/**
-//	 * 首页保安公司统计接口
-//	 *
-//	 * @return
-//	 */
-//	@PostMapping("/SelectCount")
-//	public R SelectCount() {
-//		List<Map<Object, String>> list = iDeptService.selectCount();
-//		List<Map<String, Object>> lists = new ArrayList<>();
-//		for (int i = 0; i < list.size(); i++) {
-//			String title = list.get(i).get("title");//部门名称
-//			String departmentid = String.valueOf(list.get(i).get("jurisdiction"));//部门id
-//			Map<String, Object> map = new HashMap<String, Object>();
-//			Map maps = informationService.selectCount(departmentid);
-//			map.put("name", title);
-//			map.put("server", maps);
-//			lists.add(map);
-//		}
-//		return R.data(lists);
-//	}
-
-	/**
-	 * 首页保安持证统计接口
-	 *
-	 * @return
-	 *//*
-	@PostMapping("/SelectCounthold")
-	public R SelectCounthold() {
-		List<Map<Object, String>> list = iDeptService.selectCount();
-		List<Map<String, Object>> lists = new ArrayList<>();
-		for (int i = 0; i < list.size(); i++) {
-			int cznumber = 0;//总的持证数量
-			int wcznumber = 0;//总的未持证数量
-			String title = list.get(i).get("title");//部门名称
-			Map<String, Object> map = new HashMap<String, Object>();
-			Map<Object, Object> objectStringMap = iDeptService.selectHold(String.valueOf(list.get(i).get("jurisdiction")));
-			if (objectStringMap == null) {
-				map.put("name", title);
-				map.put("cz", cznumber);
-				map.put("wcz", wcznumber);
-				lists.add(map);
-			} else {
-				String cz = objectStringMap.get("cz").toString();
-				cznumber = Integer.valueOf(cz);
-				String wcz = objectStringMap.get("wcz").toString();
-				wcznumber = Integer.valueOf(wcz);
-				map.put("name", title);
-				map.put("cz", cznumber);
-				map.put("wcz", wcznumber);
-				lists.add(map);
-			}
-		}
-		return R.data(lists);
-	}*/
-
-
 	/**
 	 * 统计保安公司未持证的保安的公司数量
 	 */
@@ -509,7 +453,12 @@
 		}
 		map.put("thisnum", a);
 		map.put("lastnum", b);
-		map.put("num", num-integer);
+		if(deptid.equals("")|| deptid.equals("null")){
+			map.put("num", num-integer);
+		}
+		else {
+			map.put("num", num);
+		}
 		map.put("List", maps);
 		mapC.put("baoan", map);
 		//正常保安员数量
@@ -716,15 +665,6 @@
 	}
 
 
-
-//	/**
-//	 * 单位列表
-//	 */
-//	@PostMapping("/selectIn")
-//	public R selectIn(String jurisdiction) {
-//		List<Map<Object, Object>> maps = informationService.selectIn(jurisdiction);
-//		return R.data(maps);
-//	}
 
 	/**
 	 * 单位删除
@@ -950,14 +890,14 @@
 			map.put("list", maps);
 			lists.add(map);
 		} else {
-			String childer = informationService.selJurchilder(jurisdiction);
-			String[] split = childer.split(",");
-			String strArrays = "";
-			for (int j = 0; j < split.length; j++) {
-				strArrays += "'" + split[j] + "',";
-			}
-			String jurisdictiond = strArrays.substring(0, strArrays.length() - 1);
-			List<Map<Object, Object>> maps = informationService.selectBx(jurisdictiond, deptid, type);
+//			String childer = informationService.selJurchilder(jurisdiction);
+//			String[] split = childer.split(",");
+//			String strArrays = "";
+//			for (int j = 0; j < split.length; j++) {
+//				strArrays += "'" + split[j] + "',";
+//			}
+//			String jurisdictiond = strArrays.substring(0, strArrays.length() - 1);
+			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);

--
Gitblit v1.9.3