From 24e1c6a1c3d5331b5a4f1111dcbae3ef148eda1a Mon Sep 17 00:00:00 2001
From: yzt <Xynz17@163.com>
Date: 星期一, 08 五月 2023 12:08:12 +0800
Subject: [PATCH] BS版本 1.20

---
 src/main/java/com/hxzkoa/controller/LocationController.java |  276 ++++++++++++++++++++++++++++++++-----------------------
 1 files changed, 161 insertions(+), 115 deletions(-)

diff --git a/src/main/java/com/hxzkoa/controller/LocationController.java b/src/main/java/com/hxzkoa/controller/LocationController.java
index 17a4ba9..075360c 100644
--- a/src/main/java/com/hxzkoa/controller/LocationController.java
+++ b/src/main/java/com/hxzkoa/controller/LocationController.java
@@ -1,23 +1,10 @@
+//
+// Source code recreated from a .class file by IntelliJ IDEA
+// (powered by FernFlower decompiler)
+//
+
 package com.hxzkoa.controller;
 
-import java.io.IOException;
-import java.io.OutputStream;
-import java.sql.SQLException;
-import java.text.SimpleDateFormat;
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.Enumeration;
-import java.util.List;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Controller;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestMethod;
-import org.springframework.web.bind.annotation.ResponseBody;
-
 import com.hxzkoa.json.tb_person;
 import com.hxzkoa.json.tb_realocation;
 import com.hxzkoa.json.tb_tag;
@@ -29,8 +16,22 @@
 import com.hxzkoa.util.ModifyConfig;
 import com.hxzkoa.util.PageUtil;
 import com.hxzkoa.util.RequestUtils;
-
+import java.io.IOException;
+import java.io.OutputStream;
+import java.sql.SQLException;
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.Enumeration;
+import java.util.List;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
 import net.sf.json.JSONObject;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.ResponseBody;
 
 @Controller
 public class LocationController {
@@ -39,40 +40,52 @@
 	@Autowired
 	private BasicInfoService basicInfoService;
 
-	@RequestMapping(value = "/realTimeLocation.do", method = { RequestMethod.POST, RequestMethod.GET })
+	public LocationController() {
+	}
+
+	@RequestMapping(
+			value = {"/realTimeLocation.do"},
+			method = {RequestMethod.POST, RequestMethod.GET}
+	)
 	public String realTimeLocation(HttpServletRequest request) {
 		String toPage = "forward:/hxzk/location/realTimeLocation.jsp";
-		List<tb_person> personManagement = basicInfoService.getPersonManagement(1);
+		List<tb_person> personManagement = this.basicInfoService.getPersonManagement(1);
 		request.setAttribute("realTimeLocationList", personManagement);
 		int curPage = 1;
-		int count = basicInfoService.getPersonManagementCount();
+		int count = this.basicInfoService.getPersonManagementCount();
 		int minPage = PageUtil.getMinPage(count);
 		request.setAttribute("pageList", PageUtil.getPage(minPage));
-		request.setAttribute("curPage", curPage);
+		request.setAttribute("curPage", Integer.valueOf(curPage));
 		return toPage;
 	}
 
 	@ResponseBody
-	@RequestMapping(value = "/realTimeLocation_search.do", method = { RequestMethod.POST, RequestMethod.GET })
+	@RequestMapping(
+			value = {"/realTimeLocation_search.do"},
+			method = {RequestMethod.POST, RequestMethod.GET}
+	)
 	public String realTimeLocation_search(HttpServletRequest request) {
 		String input = request.getParameter("input");
 		int curPage = 1;
-		List<Integer> pageList = new ArrayList<Integer>();
-		List<tb_person> realTimeLocationList = basicInfoService.searchPersonManagement(input);
+		List<Integer> pageList = new ArrayList();
+		List<tb_person> realTimeLocationList = this.basicInfoService.searchPersonManagement(input);
 		pageList.add(1);
 		JSONObject json = new JSONObject();
 		json.put("dataList", realTimeLocationList);
 		json.put("pageList", pageList);
-		json.put("curPage", curPage);
+		json.put("curPage", Integer.valueOf(curPage));
 		return json.toString();
 	}
 
 	@ResponseBody
-	@RequestMapping(value = "/realTimeLocation_page.do", method = { RequestMethod.POST, RequestMethod.GET })
+	@RequestMapping(
+			value = {"/realTimeLocation_page.do"},
+			method = {RequestMethod.POST, RequestMethod.GET}
+	)
 	public String realTimeLocation_page(HttpServletRequest request) {
 		String pageStr = request.getParameter("page");
 		String curPageStr = request.getParameter("curPage");
-		int count = basicInfoService.getPersonManagementCount();
+		int count = this.basicInfoService.getPersonManagementCount();
 		int minPage = PageUtil.getMinPage(count);
 		int curPage = Integer.parseInt(curPageStr);
 		int page = 1;
@@ -87,7 +100,8 @@
 		} else {
 			page = Integer.parseInt(pageStr);
 		}
-		List<tb_person> realTimeLocationList = basicInfoService.getPersonManagement(page);
+
+		List<tb_person> realTimeLocationList = this.basicInfoService.getPersonManagement(page);
 		List<Integer> pageList = PageUtil.getPage(PageUtil.getLocPage(page, curPage), page, minPage);
 		JSONObject json = new JSONObject();
 		json.put("dataList", realTimeLocationList);
@@ -96,147 +110,176 @@
 		return json.toString();
 	}
 
-	@RequestMapping(value = "/historicalLocation.do", method = { RequestMethod.POST, RequestMethod.GET })
+	@RequestMapping(
+			value = {"/historicalLocation.do"},
+			method = {RequestMethod.POST, RequestMethod.GET}
+	)
 	public String historicalLocation(HttpServletRequest request) throws SQLException {
 		String toPage = "forward:/hxzk/location/historicalLocation.jsp";
 		String pagePath = Config.getPageConfig();
 		Integer perPage = Integer.parseInt(ModifyConfig.readData(pagePath, "perPage"));
-		// List<tb_realocation> historicalLocationList =
-		// locationService.getRealTimeLocation(1,perPage);
 		Date date = new Date(System.currentTimeMillis());
 		SimpleDateFormat formatter = new SimpleDateFormat("yyyyMMdd");
 		String currentDate = formatter.format(date);
-		//System.out.print(currentDate);
-		List<tb_track> trackList = locationService.getTrack(currentDate, 1, perPage);
+		List<tb_track> trackList = this.locationService.getTrack(currentDate, 1, perPage);
 		request.setAttribute("historicalLocationList", trackList);
 		int curPage = 1;
-		int count = locationService.getRealTimeLocationCount(currentDate);
-		//System.out.print(count);
+		int count = this.locationService.getRealTimeLocationCount(currentDate);
 		int minPage = PageUtil.getMinPage(count);
 		request.setAttribute("pageList", PageUtil.getPage(minPage));
-		request.setAttribute("curPage", curPage);
+		request.setAttribute("curPage", Integer.valueOf(curPage));
 		request.setAttribute("perPage", perPage);
-		// 澶勭悊鏃ユ湡鏌ヨ鍒楄〃
-		List<String> trackDateList = locationService.getTrackDateList();
-		List<String> trackDateReList = new ArrayList<String>();
+		List<String> trackDateList = this.locationService.getTrackDateList();
+		List<String> trackDateReList = new ArrayList();
 		trackDateReList.add(currentDate);
-		for (int i = 0; i < trackDateList.size(); i++) {
-			String listdate = trackDateList.get(i);
-			if (!(currentDate).equals(listdate)) {
+
+		for(int i = 0; i < trackDateList.size(); ++i) {
+			String listdate = (String)trackDateList.get(i);
+			if (!currentDate.equals(listdate)) {
 				trackDateReList.add(listdate);
 			}
 		}
+
 		request.setAttribute("dateList", trackDateReList);
 		return toPage;
 	}
-	
+
 	@ResponseBody
-	@RequestMapping(value = "/historicalLocationa.do", method = { RequestMethod.POST, RequestMethod.GET })
+	@RequestMapping(
+			value = {"/historicalLocationa.do"},
+			method = {RequestMethod.POST, RequestMethod.GET}
+	)
 	public JSONObject historicalLocationa(HttpServletRequest request) throws SQLException {
 		JSONObject json = new JSONObject();
 		String date = request.getParameter("date");
-		int aaa = locationService.searchtablenameLocation("tb_track_"+date);
+		int aaa = this.locationService.searchtablenameLocation("tb_track_" + date);
 		if (aaa != 0) {
-			List<tb_track> trackList = locationService.getTracka(date);
+			List<tb_track> trackList = this.locationService.getTracka(date);
 			json.put("dataList", trackList);
 		} else {
-			List<tb_track> trackList = new ArrayList<>();
+			List<tb_track> trackList = new ArrayList();
 			json.put("dataList", trackList);
 		}
+
 		return json;
 	}
 
 	@ResponseBody
-	@RequestMapping(value = "/historicalLocation_delete.do", method = { RequestMethod.POST, RequestMethod.GET })
+	@RequestMapping(
+			value = {"/historicalLocation_delete.do"},
+			method = {RequestMethod.POST, RequestMethod.GET}
+	)
 	public void historicalLocation_delete(HttpServletRequest request) {
 		String checkValStr = request.getParameter("checkVal");
 		String date = request.getParameter("datea");
 		checkValStr = checkValStr.replaceAll("\"", "");
 		String[] checkVal = checkValStr.split(",");
-		locationService.realTimeLocation_delete(checkVal,date);
+		this.locationService.realTimeLocation_delete(checkVal, date);
 	}
-	
+
 	@ResponseBody
-	@RequestMapping(value = "/historicalLocation_deletea.do", method = { RequestMethod.POST, RequestMethod.GET })
+	@RequestMapping(
+			value = {"/historicalLocation_deletea.do"},
+			method = {RequestMethod.POST, RequestMethod.GET}
+	)
 	public int historicalLocation_deletea(HttpServletRequest request) {
 		String checkValStr = request.getParameter("checkVal");
 		String date = request.getParameter("datea");
 		checkValStr = checkValStr.replaceAll("\"", "");
 		String[] checkVal = checkValStr.split(",");
-		int bbb = locationService.searchtablenameLocation("tb_track_"+date);
+		int bbb = this.locationService.searchtablenameLocation("tb_track_" + date);
 		int aaa = 0;
 		if (bbb != 0) {
-			aaa = locationService.realTimeLocation_deletea(checkVal,date);
+			aaa = this.locationService.realTimeLocation_deletea(checkVal, date);
 		}
+
 		return aaa;
 	}
 
 	@ResponseBody
-	@RequestMapping(value = "/historicalLocation_deleteAll.do", method = { RequestMethod.POST, RequestMethod.GET })
+	@RequestMapping(
+			value = {"/historicalLocation_deleteAll.do"},
+			method = {RequestMethod.POST, RequestMethod.GET}
+	)
 	public void historicalLocation_deleteAll(HttpServletRequest request) {
 		String date = request.getParameter("aaaa");
-		locationService.realTimeLocation_deleteAll(date);
+		this.locationService.realTimeLocation_deleteAll(date);
 	}
-	
+
 	@ResponseBody
-	@RequestMapping(value = "/historicalLocation_deleteAlla.do", method = { RequestMethod.POST, RequestMethod.GET })
+	@RequestMapping(
+			value = {"/historicalLocation_deleteAlla.do"},
+			method = {RequestMethod.POST, RequestMethod.GET}
+	)
 	public int historicalLocation_deleteAlla(HttpServletRequest request) {
 		String date = request.getParameter("date");
-		int bbb = locationService.searchtablenameLocation("tb_track_"+date);
+		int bbb = this.locationService.searchtablenameLocation("tb_track_" + date);
 		int aaa = 0;
 		if (bbb != 0) {
-			aaa = locationService.realTimeLocation_deleteAlla(date);
+			aaa = this.locationService.realTimeLocation_deleteAlla(date);
 		}
+
 		return aaa;
 	}
 
 	@ResponseBody
-	@RequestMapping(value = "/historicalLocation_search.do", method = { RequestMethod.POST, RequestMethod.GET })
+	@RequestMapping(
+			value = {"/historicalLocation_search.do"},
+			method = {RequestMethod.POST, RequestMethod.GET}
+	)
 	public String historicalLocation_search(HttpServletRequest request) {
 		String input = request.getParameter("input");
 		String date = request.getParameter("cccc");
 		int curPage = 1;
-		List<Integer> pageList = new ArrayList<Integer>();
-		List<tb_realocation> historicalLocationList = locationService.searchRealTimeLocation(input,date);
+		List<Integer> pageList = new ArrayList();
+		List<tb_realocation> historicalLocationList = this.locationService.searchRealTimeLocation(input, date);
 		pageList.add(1);
 		JSONObject json = new JSONObject();
 		json.put("dataList", historicalLocationList);
 		json.put("pageList", pageList);
-		json.put("curPage", curPage);
+		json.put("curPage", Integer.valueOf(curPage));
 		return json.toString();
 	}
-	
+
 	@ResponseBody
-	@RequestMapping(value = "/historicalLocation_searcha.do", method = { RequestMethod.POST, RequestMethod.GET })
+	@RequestMapping(
+			value = {"/historicalLocation_searcha.do"},
+			method = {RequestMethod.POST, RequestMethod.GET}
+	)
 	public JSONObject historicalLocation_searcha(HttpServletRequest request) {
 		String input = request.getParameter("tagid");
 		String date = request.getParameter("date");
 		JSONObject json = new JSONObject();
-		int aaa = locationService.searchtablenameLocation("tb_track_"+date);
+		int aaa = this.locationService.searchtablenameLocation("tb_track_" + date);
 		if (aaa != 0) {
-			List<tb_realocation> historicalLocationList = locationService.searchRealTimeLocation(input,date);
+			List<tb_realocation> historicalLocationList = this.locationService.searchRealTimeLocation(input, date);
 			json.put("dataList", historicalLocationList);
 		} else {
-			List<tb_realocation> abc = new ArrayList<>();
+			List<tb_realocation> abc = new ArrayList();
 			json.put("dataList", abc);
 		}
+
 		return json;
 	}
 
 	@ResponseBody
-	@RequestMapping(value = "/historicalLocation_page.do", method = { RequestMethod.POST, RequestMethod.GET })
+	@RequestMapping(
+			value = {"/historicalLocation_page.do"},
+			method = {RequestMethod.POST, RequestMethod.GET}
+	)
 	public String historicalLocation_page(HttpServletRequest request) {
 		String pageStr = request.getParameter("page");
 		String curPageStr = request.getParameter("curPage");
 		String date = request.getParameter("date");
-		int count = locationService.getRealTimeLocationCount(date);
+		int count = this.locationService.getRealTimeLocationCount(date);
 		int minPage = PageUtil.getMinPage(count);
 		int curPage = Integer.parseInt(curPageStr);
 		String pagePath = Config.getPageConfig();
 		Integer perPage = Integer.parseInt(ModifyConfig.readData(pagePath, "perPage"));
-		if (("").equals(pageStr) || pageStr == null) {
+		if ("".equals(pageStr) || pageStr == null) {
 			pageStr = curPageStr;
 		}
+
 		int page = 1;
 		if ("pre".equals(pageStr)) {
 			if (curPage > 1) {
@@ -249,56 +292,58 @@
 		} else {
 			page = Integer.parseInt(pageStr);
 		}
-		// List<tb_realocation> historicalLocationList =
-		// locationService.getRealTimeLocation(page,perPage);
-		List<tb_track> trackList = locationService.getTrack(date, page, perPage);
+
+		List<tb_track> trackList = this.locationService.getTrack(date, page, perPage);
 		List<Integer> pageList = PageUtil.getPage(PageUtil.getLocPage(page, curPage), page, minPage);
 		JSONObject json = new JSONObject();
 		json.put("dataList", trackList);
 		json.put("pageList", pageList);
 		json.put("curPage", page);
-		//System.out.print(pageList);
 		return json.toString();
 	}
 
 	@ResponseBody
-	@RequestMapping(value = "/historicalLocation_export.do", method = { RequestMethod.POST, RequestMethod.GET })
+	@RequestMapping(
+			value = {"/historicalLocation_export.do"},
+			method = {RequestMethod.POST, RequestMethod.GET}
+	)
 	public String historicalPower_export(HttpServletRequest request, HttpServletResponse response) {
 		String toPage = "forward:/hxzk/label/historicalLocation.jsp";
-		Enumeration<String> paraNames=request.getParameterNames();
+		Enumeration<String> paraNames = request.getParameterNames();
 		String thisName = null;
 		String thisValue = null;
-		for(Enumeration<String> e=paraNames;e.hasMoreElements();){
-	        thisName=e.nextElement()+"";  //name鍚�
-	        thisValue=request.getParameter(thisName);   //name鍚嶅搴旂殑鍊�
-	    }
-//		String date = request.getParameter("datebb");
-		List<tb_realocation> historicalLocationList = locationService.getRealTimeLocation(thisValue);
-		String[] rowName = { "搴忓彿", "鏍囩ID", "X鍧愭爣", "Y鍧愭爣", "Z鍧愭爣", "灞�", "鏃堕棿" };
+
+		for(Enumeration<String> e = paraNames; e.hasMoreElements(); thisValue = request.getParameter(thisName)) {
+			thisName = (String)e.nextElement() + "";
+		}
+
+		List<tb_realocation> historicalLocationList = this.locationService.getRealTimeLocation(thisValue);
+		String[] rowName = new String[]{"搴忓彿", "鏍囩ID", "X鍧愭爣", "Y鍧愭爣", "Z鍧愭爣", "灞�", "鏃堕棿"};
 		List<Object[]> dataList = objectToArray_historicalLocation(historicalLocationList);
 		ExcelUtils excel = new ExcelUtils("杞ㄨ抗鏁版嵁", rowName, dataList);
-		OutputStream out;
+
 		try {
 			String fileName = "Excel-" + String.valueOf(System.currentTimeMillis()).substring(4, 13) + ".xls";
 			String headStr = "attachment; filename=\"" + fileName + "\"";
 			response.setContentType("APPLICATION/OCTET-STREAM");
 			response.setHeader("Content-Disposition", headStr);
-			out = response.getOutputStream();
+			OutputStream out = response.getOutputStream();
 			excel.export(out);
 			out.flush();
 			out.close();
-		} catch (Exception e) {
-			e.printStackTrace();
+		} catch (Exception var14) {
+			var14.printStackTrace();
 		}
+
 		return toPage;
 	}
 
-	// tb_realocation 瀵煎嚭琛ㄦ牸 瀵硅薄杞暟缁�
 	public static List<Object[]> objectToArray_historicalLocation(List<tb_realocation> historicalLocationList) {
-		List<Object[]> reList = new ArrayList<>();
-		for (int i = 0; i < historicalLocationList.size(); i++) {
-			List<String> words = new ArrayList<String>();
-			tb_realocation realocation = (tb_realocation) historicalLocationList.get(i);
+		List<Object[]> reList = new ArrayList();
+
+		for(int i = 0; i < historicalLocationList.size(); ++i) {
+			List<String> words = new ArrayList();
+			tb_realocation realocation = (tb_realocation)historicalLocationList.get(i);
 			words.add(realocation.getId() + "");
 			words.add(realocation.getTagid());
 			words.add(realocation.getX());
@@ -306,45 +351,46 @@
 			words.add(realocation.getZ());
 			words.add(realocation.getLayer());
 			words.add(realocation.getTime());
-			String[] array = words.toArray(new String[0]);
+			String[] array = (String[])words.toArray(new String[0]);
 			reList.add(array);
 		}
+
 		return reList;
 	}
 
-	@RequestMapping(value = "/track_bw_add.do", method = { RequestMethod.POST, RequestMethod.GET })
+	@RequestMapping(
+			value = {"/track_bw_add.do"},
+			method = {RequestMethod.POST, RequestMethod.GET}
+	)
 	public void track_bw_add(HttpServletRequest request) throws IOException {
 		String jsonString = RequestUtils.getRequestJsonString(request, Config.getCharset());
-		tb_track track = (tb_track) JSONObject.toBean(JSONObject.fromObject(jsonString), tb_track.class);
+		tb_track track = (tb_track)JSONObject.toBean(JSONObject.fromObject(jsonString), tb_track.class);
 		Date date = new Date(System.currentTimeMillis());
 		SimpleDateFormat formatter = new SimpleDateFormat("yyyyMMdd");
 		String currentDate = formatter.format(date);
-		locationService.track_add(currentDate,track);
+		this.locationService.track_add(currentDate, track);
 	}
-	
-	@RequestMapping(value = "/tag_time_bw.do", method = { RequestMethod.POST, RequestMethod.GET })
+
+	@RequestMapping(
+			value = {"/tag_time_bw.do"},
+			method = {RequestMethod.POST, RequestMethod.GET}
+	)
 	public void tag_time_bw(HttpServletRequest request) throws IOException {
 		String jsonString = RequestUtils.getRequestJsonString(request, Config.getCharset());
-		tb_tag tag = (tb_tag) JSONObject.toBean(JSONObject.fromObject(jsonString), tb_tag.class);
-		locationService.tag_time(tag);
+		tb_tag tag = (tb_tag)JSONObject.toBean(JSONObject.fromObject(jsonString), tb_tag.class);
+		this.locationService.tag_time(tag);
 	}
-	
+
 	@ResponseBody
-	@RequestMapping(value="panduanweiyi.do", method={RequestMethod.POST,RequestMethod.GET})
+	@RequestMapping(
+			value = {"panduanweiyi.do"},
+			method = {RequestMethod.POST, RequestMethod.GET}
+	)
 	public String panduanweiyi(HttpServletRequest request) {
 		JSONObject json = new JSONObject();
 		String name = request.getParameter("name");
-		List<String> strs = locationService.panduanweiyi(name);
+		List<String> strs = this.locationService.panduanweiyi(name);
 		json.put("dataList", strs);
 		return json.toString();
 	}
-	
-//	@RequestMapping(value = "/shishi.do", method = { RequestMethod.POST, RequestMethod.GET })
-//	public void shiyan(HttpServletRequest request) throws IOException {
-//		String jsonString = RequestUtils.getRequestJsonString(request, Config.getCharset());
-//		//System.out.print(jsonString);
-//		//System.out.print("鎵ц鍔涙垜");
-//		tb_tag tag = (tb_tag) JSONObject.toBean(JSONObject.fromObject(jsonString), tb_tag.class);
-//		locationService.tag_time(tag);
-//	}
 }

--
Gitblit v1.10.0