From 87c8721094ee295cc3bb7870aedaa3e0aa0368a3 Mon Sep 17 00:00:00 2001
From: tangzy <tangzy123456>
Date: Fri, 24 Sep 2021 14:29:42 +0800
Subject: [PATCH] 1.统计

---
 src/main/java/org/springblade/modules/information/controller/InformationController.java |   87 +++++++++++++++++++++++++++++++++++++++++--
 1 files changed, 83 insertions(+), 4 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 a1b52db..0bf1b89 100644
--- a/src/main/java/org/springblade/modules/information/controller/InformationController.java
+++ b/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);
 	}
-
-
 }

--
Gitblit v1.9.3