From fd7b9aabefdcfa4e2f8504c77d5a4e6f4f955585 Mon Sep 17 00:00:00 2001
From: tangzy <tangzy123456>
Date: Sun, 22 Aug 2021 14:50:28 +0800
Subject: [PATCH] 1.ftp

---
 src/main/java/org/springblade/modules/information/controller/InformationController.java |  176 ++++++++++++++++++++++++++++++++++++++++++++++++++++++----
 1 files changed, 163 insertions(+), 13 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 ab4bf2e..0255a18 100644
--- a/src/main/java/org/springblade/modules/information/controller/InformationController.java
+++ b/src/main/java/org/springblade/modules/information/controller/InformationController.java
@@ -29,24 +29,21 @@
 import org.springblade.core.mp.support.Query;
 import org.springblade.core.tool.api.R;
 import org.springblade.core.tool.support.Kv;
-import org.springblade.core.tool.utils.Func;
-import org.springblade.modules.desk.entity.Notice;
-import org.springblade.modules.desk.vo.NoticeVO;
-import org.springblade.modules.desk.wrapper.NoticeWrapper;
 import org.springblade.modules.jurisdiction.service.JurisdictionService;
 import org.springblade.modules.jurisdiction.vo.JurisdictionVO;
-import org.springblade.modules.member.service.IMemberService;
-import org.springblade.modules.shareholder.service.IShareholderService;
 import org.springblade.modules.system.entity.Dept;
 import org.springblade.modules.system.service.IDeptService;
-import org.springblade.modules.system.service.IUserDeptService;
 import org.springframework.web.bind.annotation.*;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import org.springblade.modules.information.entity.Information;
-import org.springblade.modules.information.vo.InformationVO;
 import org.springblade.modules.information.service.IInformationService;
 import org.springblade.core.boot.ctrl.BladeController;
 import springfox.documentation.annotations.ApiIgnore;
+
+import java.util.List;
+import java.util.ArrayList;
+import java.util.Map;
+import java.util.HashMap;
 
 import java.util.*;
 
@@ -110,8 +107,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);
+		//String departmentid = information.getDepartmentid();
+		//Long l = Long.parseLong(departmentid);
 		//自招保安公司
 		if (information.getStats().equals("0")) {
 			Long i = 1420222768149966850L;
@@ -149,7 +146,7 @@
 			dept.setAncestors("0,1420222961377357825");
 			dept.setDeptCategory(1);
 		}
-		dept.setId(l);
+		//dept.setId(l);
 		if (iDeptService.submit(dept)) {
 			CacheUtil.clear(SYS_CACHE);
 			// 返回懒加载树更新节点所需字段
@@ -330,6 +327,14 @@
 		Integer lnum = 0;
 		//这个月人数数量
 		Integer tnum = 0;
+		//上个月派遣人数
+		Integer tpznum = 0;
+		//这个月人数数量
+		Integer lpznum = 0;
+		//上个月总人数
+		Integer tznum = 0;
+		//这个月总人数
+		Integer lznum = 0;
 		//上个月金额
 		Double lmount = 0.0;
 		//这个月金额
@@ -350,11 +355,27 @@
 			String thisamounts = list.get(i).get("thisamount").toString();
 			Double thisamount = Double.parseDouble(thisamounts);
 			tmount += thisamount;
+			String userthismouth = list.get(i).get("userthismouth").toString();
+			Integer userthismouths = Integer.parseInt(userthismouth);
+			lpznum += userthismouths;
+			String userlastmouth = list.get(i).get("userlastmouth").toString();
+			Integer userlastmouths = Integer.parseInt(userlastmouth);
+			tpznum += userlastmouths;
+			String userpcthismouth = list.get(i).get("userpcthismouth").toString();
+			Integer userpcthismouths = Integer.parseInt(userpcthismouth);
+			lznum += userpcthismouths;
+			String userpclastmouth = list.get(i).get("userpclastmouth").toString();
+			Integer userpclastmouths = Integer.parseInt(userpclastmouth);
+			tznum += userpclastmouths;
 		}
 		map.put("lastmonth", lnum);
 		map.put("thismouth", tnum);
 		map.put("lastamount", lmount);
 		map.put("thisamount", tmount);
+		map.put("userlastmouth", tpznum);
+		map.put("userthismouth", lpznum);
+		map.put("userpcthismouth", lznum);
+		map.put("userpclastmouth", tznum);
 		lists.add(map);
 		return R.data(lists);
 	}
@@ -370,6 +391,20 @@
 		Calendar cal = Calendar.getInstance();
 		String year = String.valueOf(cal.get(Calendar.YEAR));
 		Map<String, String> map = informationService.queryYearSoil(year, jurisdiction, deptid);
+		map = (HashMap<String, String>) sortMapBykeyAsc(map);//key升序
+		return R.data(map);
+	}
+
+	/**
+	 * 查询本年所有月份派遣人数
+	 *
+	 * @return
+	 */
+	@GetMapping("/queryYearPz")
+	public R queryYearPz(String jurisdiction, String deptid) {
+		Calendar cal = Calendar.getInstance();
+		String year = String.valueOf(cal.get(Calendar.YEAR));
+		Map<String, String> map = informationService.queryYearPz(year, jurisdiction, deptid);
 		map = (HashMap<String, String>) sortMapBykeyAsc(map);//key升序
 		return R.data(map);
 	}
@@ -638,6 +673,7 @@
 
 	/**
 	 * 统计用户资格异常的数量
+	 *
 	 * @return
 	 */
 	@PostMapping("/selectExtypeUser")
@@ -763,8 +799,8 @@
 	 * 保安员统计
 	 */
 	@PostMapping("/selectLi")
-	public R selectLi(String jurisdiction, String deptid) {
-		List<Map<Object, Object>> list = informationService.selectLi(jurisdiction, deptid);
+	public R selectLi(String jurisdiction, String deptid,Integer current,Integer size) {
+		List<Map<Object, Object>> list = informationService.selectLi(jurisdiction, deptid,current,size);
 		return R.data(list);
 	}
 
@@ -793,4 +829,118 @@
 		return R.data(list);
 	}
 
+	/**
+	 * 公司运营情况进入图表
+	 */
+	@PostMapping("/selectTb")
+	public R selectTb(String jurisdiction, String enterpriseName, Integer current, Integer size) {
+		List<Map<Object, Object>> list = informationService.selectTb(jurisdiction, enterpriseName, current, size);
+		return R.data(list);
+	}
+
+	/**
+	 * 公司经济情况进入图表
+	 */
+	@PostMapping("/selectJj")
+	public R selectJj(String jurisdiction, String enterpriseName, Integer current, Integer size) {
+		List<Map<Object, Object>> list = informationService.selectJj(jurisdiction, enterpriseName, current, size);
+		return R.data(list);
+	}
+
+	/**
+	 * 业务统计情况
+	 */
+	@PostMapping("/selectYw")
+	public R selectYw(String jurisdiction, String deptid,Integer current,Integer size) {
+		List<Map<Object, Object>> list = informationService.selectYw(jurisdiction, deptid,current,size);
+		return R.data(list);
+	}
+
+	/**
+	 * 保安员详情
+	 */
+	@PostMapping("/selectUIn")
+	public R selectUIn(String deptid, String name, String hold, String photo, String examinationtype, String dispatch, String soil) {
+		List<Map<Object, Object>> list = informationService.selectUIn(deptid, name, hold, photo, examinationtype, dispatch, soil);
+		return R.data(list);
+	}
+
+	/**
+	 * 业务统计明细
+	 */
+	@PostMapping("/selectDis")
+	public R selectDis(String jurisdiction, String deptid, String fid, Integer current, Integer size) {
+		List<Map<Object, Object>> list = informationService.selectDis(jurisdiction, deptid, fid, current, size);
+		return R.data(list);
+	}
+
+
+	/**
+	 * 服务单位下拉
+	 */
+	@PostMapping("/selectFw")
+	public R selectFw() {
+		List<Map<Object, Object>> list = informationService.selectFw();
+		return R.data(list);
+	}
+
+	/**
+	 * 公司处罚数量统计
+	 */
+	@PostMapping("/selectCf")
+	public R selectCf(String jurisdiction) {
+		Map<String, Object> map = new HashMap<String, Object>();
+		Integer count = 0;
+		List<Map<String, Object>> lists = new ArrayList<>();
+		List<Map<Object, Object>> maps = informationService.selectCf(jurisdiction);
+		for (int i = 0; i < maps.size(); i++) {
+			String num = maps.get(i).get("num").toString();
+			count += Integer.valueOf(num);
+		}
+		map.put("count", count);
+		map.put("list", maps);
+		lists.add(map);
+		return R.data(lists);
+	}
+
+	/**
+	 * 公司材料不全数量统计
+	 */
+	@PostMapping("/selectCl")
+	public R selectCl(String jurisdiction) {
+		Map<String, Object> map = new HashMap<String, Object>();
+		Integer count = 0;
+		List<Map<String, Object>> lists = new ArrayList<>();
+		List<Map<Object, Object>> maps = informationService.selectCl(jurisdiction);
+		for (int i = 0; i < maps.size(); i++) {
+			String num = maps.get(i).get("num").toString();
+			count += Integer.valueOf(num);
+		}
+		map.put("count", count);
+		map.put("list", maps);
+		lists.add(map);
+		return R.data(lists);
+	}
+
+//	public static void main(String[] args) throws Exception {
+//		//ftp服务器IP地址
+//		String ftpHost = "192.168.0.105";
+//		//ftp服务器端口
+//		int ftpPort = 21;
+//		//ftp服务器用户名
+//		String ftpUserName = "yly";
+//		//ftp服务器密码
+//		String ftpPassword = "Yly@123";
+//		//ftp服务器路径
+//		String ftpPath = "";
+//		//本地路径
+//		String localPath = "D:\\anbao";
+//		//文件名
+//		String fileName = "sql.json";
+//		FtpUtil.downloadFtpFile(ftpHost, ftpUserName, ftpPassword, ftpPort, ftpPath, localPath, fileName);
+//		String s = TestJson();
+//		String sql = stringReplace(s);
+//		MysqlCenlint.inster(sql);
+//		MysqlCenlint.delete();
+//	}
 }

--
Gitblit v1.9.3