From 9c10d5e9ce87f3aa5144e4dc314a7a95fef64691 Mon Sep 17 00:00:00 2001
From: Administrator <admin>
Date: Wed, 22 Sep 2021 17:55:52 +0800
Subject: [PATCH] Merge branch 'master' of http://192.168.0.105:10010/r/zhba_management

---
 src/main/java/org/springblade/modules/information/controller/InformationController.java |  113 ++++++++++++++++++++++++++++++++++++++++----------------
 1 files changed, 81 insertions(+), 32 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 cd5ef68..7e56b0c 100644
--- a/src/main/java/org/springblade/modules/information/controller/InformationController.java
+++ b/src/main/java/org/springblade/modules/information/controller/InformationController.java
@@ -762,24 +762,24 @@
 //	}
 
 
-	/**
-	 * 派遣數量統計
-	 */
-	@PostMapping("/selectPCount")
-	public R selectPCount(String jurisdiction, String deptid) {
-		Map<String, Object> map = new HashMap<String, Object>();
-		List<Map<String, Object>> lists = new ArrayList<>();
-		Map map1 = informationService.selectPcount(jurisdiction, deptid);
-		String pnum = map1.get("pnum").toString();
-		Integer a = Integer.valueOf(pnum);
-		Map map2 = informationService.selectWPcount(jurisdiction, deptid);
-		String wpnum = map2.get("wpnum").toString();
-		Integer b = Integer.valueOf(wpnum);
-		map.put("PCount", a);
-		map.put("WPCount", b);
-		lists.add(map);
-		return R.data(lists);
-	}
+//	/**
+//	 * 派遣數量統計
+//	 */
+//	@PostMapping("/selectPCount")
+//	public R selectPCount(String jurisdiction, String deptid) {
+//		Map<String, Object> map = new HashMap<String, Object>();
+//		List<Map<String, Object>> lists = new ArrayList<>();
+//		Map map1 = informationService.selectPcount(jurisdiction, deptid);
+//		String pnum = map1.get("pnum").toString();
+//		Integer a = Integer.valueOf(pnum);
+//		Map map2 = informationService.selectWPcount(jurisdiction, deptid);
+//		String wpnum = map2.get("wpnum").toString();
+//		Integer b = Integer.valueOf(wpnum);
+//		map.put("PCount", a);
+//		map.put("WPCount", b);
+//		lists.add(map);
+//		return R.data(lists);
+//	}
 
 //	/**
 //	 * 单位列表
@@ -1109,12 +1109,12 @@
 				//交社保数
 				String numjs = mapsb.get(isb).get("numj").toString();
 				Integer numj = Integer.parseInt(numjs);
-				//单位总人数
-				String numzs = mapsb.get(isb).get("numz").toString();
-				Integer numz = Integer.parseInt(numzs);
-				//统计未交社保人数
-				int i1 = numz - numj;
-				count += i1;
+//				//单位总人数
+//				String numzs = mapsb.get(isb).get("numz").toString();
+//				Integer numz = Integer.parseInt(numzs);
+//				//统计未交社保人数
+//				int i1 = numz - numj;
+				count += numj;
 			}
 			map.put("Count", count);
 			map.put("jurname", jurname);
@@ -1145,21 +1145,24 @@
 			}
 			String deptid = strArrays.substring(0, strArrays.length() - 1);
 			Map<String, Object> map = new HashMap<String, Object>();
-			Map<Object, Object> objectStringMap = iDeptService.selectHold(deptid);
-			if (objectStringMap == null) {
+			List<Map<String, Object>> objectStringMap = iDeptService.selectHold(deptid);
+			if (objectStringMap.size()==0) {
 				map.put("name", list.get(i).get("deptname"));
 				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);
+				for (int c=0;c<objectStringMap.size();c++){
+					String cz = objectStringMap.get(c).get("cz").toString();
+					cznumber += Integer.valueOf(cz);
+					String wcz = objectStringMap.get(c).get("wcz").toString();
+					wcznumber += Integer.valueOf(wcz);
+				}
 				map.put("name",  list.get(i).get("deptname"));
 				map.put("cz", cznumber);
 				map.put("wcz", wcznumber);
 				lists.add(map);
+
 			}
 		}
 		return R.data(lists);
@@ -1178,7 +1181,7 @@
 		Map<String, Object> map = new HashMap<String, Object>();
 		Integer count = 0;
 		List<Map<String, Object>> lists = new ArrayList<>();
-		if (jurisdiction.equals("1372091709474910209")){
+		if (jurisdiction.equals("1372091709474910209") || "".equals(jurisdiction)){
 			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();
@@ -1224,7 +1227,7 @@
 		Map<String, Object> map = new HashMap<String, Object>();
 		Integer count = 0;
 		List<Map<String, Object>> lists = new ArrayList<>();
-		if (jurisdiction.equals("1372091709474910209")) {
+		if (jurisdiction.equals("1372091709474910209") || "".equals(jurisdiction)) {
 			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();
@@ -1548,4 +1551,50 @@
 		}
 	}
 
+	@PostMapping("/selectPCount")
+	public R selectPCount(String jurisdiction, String deptid) {
+		Map<String, Object> map = new HashMap<String, Object>();
+		List<Map<String, Object>> lists = new ArrayList<>();
+		String childer = informationService.selJurchilder(jurisdiction);
+		String[] split = childer.split(",");
+		String strArrays = "";
+		for (int j = 0; j < split.length; j++) {
+			strArrays += "'" + split[j] + "',";
+		}
+		Integer pnums = 0;
+		Integer wpnums = 0;
+		if (jurisdiction.equals("1372091709474910209") || "".equals(jurisdiction)) {
+			List<Map<String, Object>> list = informationService.seleP(jurisdiction, deptid);
+			for (int i = 0; i < list.size(); i++) {
+				String pnum = list.get(i).get("pnum").toString();
+				Integer a = Integer.parseInt(pnum);
+				pnums += a;
+				String wpnum = list.get(i).get("wpnum").toString();
+				Integer b = Integer.parseInt(wpnum);
+				wpnums += b;
+			}
+		} else {
+			String jurisdictiond = strArrays.substring(0, strArrays.length() - 1);
+			List<Map<String, Object>> list = informationService.seleP(jurisdictiond, deptid);
+			for (int i = 0; i < list.size(); i++) {
+				String pnum = list.get(i).get("pnum").toString();
+				Integer a = Integer.parseInt(pnum);
+				pnums += a;
+				String wpnum = list.get(i).get("wpnum").toString();
+				Integer b = Integer.parseInt(wpnum);
+				wpnums += b;
+			}
+		}
+//		Map map1 = informationService.selectPcount(jurisdiction, deptid);
+//		String pnum = map1.get("pnum").toString();
+//		Integer a = Integer.valueOf(pnum);
+//		Map map2 = informationService.selectWPcount(jurisdiction, deptid);
+//		String wpnum = map2.get("wpnum").toString();
+//		Integer b = Integer.valueOf(wpnum);
+		map.put("PCount", pnums);
+		map.put("WPCount", wpnums);
+		lists.add(map);
+		return R.data(lists);
+	}
+
 }

--
Gitblit v1.9.3