From 0cab6d8afcc97e8bc94ef200e24d8839281f44c8 Mon Sep 17 00:00:00 2001
From: zengh <123456>
Date: Sun, 15 Aug 2021 15:22:35 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'

---
 src/main/java/org/springblade/modules/information/controller/InformationController.java |  130 ++++++++++++++++++++++++++++++++++++-------
 1 files changed, 109 insertions(+), 21 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 8dfb514..68d9757 100644
--- a/src/main/java/org/springblade/modules/information/controller/InformationController.java
+++ b/src/main/java/org/springblade/modules/information/controller/InformationController.java
@@ -110,12 +110,46 @@
 	@ApiOperation(value = "新增", notes = "传入information")
 	public R save(@Valid @RequestBody Information information) {
 		Dept dept= new Dept();
-		Long i = 1413470343230877697L;
-		dept.setParentId(i);
-		dept.setTenantId("000000");
-		dept.setDeptName(information.getEnterprisename());
-		dept.setAncestors("0,1413470343230877697");
-		dept.setDeptCategory(1);
+		String departmentid = information.getDepartmentid();
+		Long l=Long.parseLong(departmentid);
+		//自招保安公司
+		if(information.getStats().equals("0")){
+			Long i = 1420222768149966850L;
+			dept.setParentId(i);
+			dept.setTenantId("000000");
+			dept.setDeptName(information.getEnterprisename());
+			dept.setAncestors("0,1420222768149966850");
+			dept.setDeptCategory(1);
+		}
+		//保安培训公司
+		if(information.getStats().equals("1")){
+			Long i = 1418458374477549569L;
+			dept.setParentId(i);
+			dept.setTenantId("000000");
+			dept.setDeptName(information.getEnterprisename());
+			dept.setAncestors("0,1418458374477549569");
+			dept.setDeptCategory(1);
+
+		}
+		//保安服务公司
+		if(information.getStats().equals("2")){
+			Long i = 1413470343230877697L;
+			dept.setParentId(i);
+			dept.setTenantId("000000");
+			dept.setDeptName(information.getEnterprisename());
+			dept.setAncestors("0,1413470343230877697");
+			dept.setDeptCategory(1);
+		}
+		//武装守押公司
+		if(information.getStats().equals("3")){
+			Long i = 1420222961377357825L;
+			dept.setParentId(i);
+			dept.setTenantId("000000");
+			dept.setDeptName(information.getEnterprisename());
+			dept.setAncestors("0,1420222961377357825");
+			dept.setDeptCategory(1);
+		}
+		dept.setId(l);
 		if (iDeptService.submit(dept)) {
 			CacheUtil.clear(SYS_CACHE);
 			// 返回懒加载树更新节点所需字段
@@ -154,10 +188,10 @@
 	@PostMapping("/remove")
 	@ApiOperationSupport(order = 8)
 	@ApiOperation(value = "删除", notes = "传入ids")
-	public R remove(String creditcode) {
-		informationService.deleteIn(creditcode);
-		informationService.deleteSh(creditcode);
-		informationService.deleteMe(creditcode);
+	public R remove(String ids) {
+		informationService.deleteIn(ids);
+		informationService.deleteSh(ids);
+		informationService.deleteMe(ids);
 		return R.success("删除成功");
 	}
 
@@ -196,7 +230,7 @@
 			int wcznumber = 0;//总的未持证数量
 			String title = list.get(i).get("title");//部门名称
 			Map<String, Object> map = new HashMap<String, Object>();
-			Map<Object, Integer> objectStringMap = iDeptService.selectHold(String.valueOf(list.get(i).get("jurisdiction")));
+			Map<Object, Object> objectStringMap = iDeptService.selectHold(String.valueOf(list.get(i).get("jurisdiction")));
 			if (objectStringMap==null) {
 				map.put("name", title);
 				map.put("cz", cznumber);
@@ -204,8 +238,10 @@
 				lists.add(map);
 			}
 			else {
-				cznumber = objectStringMap.get("cz");
-				wcznumber = objectStringMap.get("wcz");
+				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);
@@ -337,7 +373,7 @@
 	}
 
 	/**
-	 * 查询本年所有月份社保金额
+	 * 查询本年所有月份社保金额(公司经济运营趋势)
 	 * @return
 	 */
 	@GetMapping("/queryYearAn")
@@ -569,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);
@@ -589,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);
@@ -627,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);
@@ -690,4 +734,48 @@
 		List<Map<Object, Object>> maps = informationService.selectIn(jurisdiction);
 		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);
+	}
+
 }

--
Gitblit v1.9.3