From 7b4c8991dca9cf2a809a95e239d144697d3afb56 Mon Sep 17 00:00:00 2001
From: 15832144755 <67030627+15832144755@users.noreply.github.com>
Date: 星期四, 06 一月 2022 12:15:34 +0800
Subject: [PATCH] 2022.1.6
---
src/main/java/com/hxzkoa/controller/ZhwController.java | 85 ++++++++++++++++++++++++++++++------------
1 files changed, 61 insertions(+), 24 deletions(-)
diff --git a/src/main/java/com/hxzkoa/controller/ZhwController.java b/src/main/java/com/hxzkoa/controller/ZhwController.java
index df1f8cc..71a3763 100644
--- a/src/main/java/com/hxzkoa/controller/ZhwController.java
+++ b/src/main/java/com/hxzkoa/controller/ZhwController.java
@@ -47,6 +47,7 @@
import com.hxzkoa.services.SysSettingService;
import com.hxzkoa.services.ZhwService;
import com.hxzkoa.services.AnchorService;
+import com.hxzkoa.services.FenceService;
import com.hxzkoa.udp.Dell_Ip;
import com.hxzkoa.udp.GetNowTime;
import com.hxzkoa.udp.ReadPeizhiMessage;
@@ -78,6 +79,8 @@
private SysSettingService sysSettingService;
@Autowired
private AnchorService AnchorService;
+ @Autowired
+ private FenceService fenceService;
httpsos sos = new httpsos();
@@ -85,6 +88,12 @@
public String drawFence_init(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
String toPage = "forward:/hxzk/fence/drawFence.jsp";
List<tb_map> floorList = ZhwService.getFloor();
+ List<tb_fence> fenceList = fenceService.getFenceList();
+ List<String> fencenames = new ArrayList<>();
+ for (int i =0;i < fenceList.size(); i++) {
+ fencenames.add(fenceList.get(i).getName());
+ }
+ request.setAttribute("fenceList", fencenames);
request.setAttribute("floorList", floorList);
return toPage;
}
@@ -202,9 +211,11 @@
public int sanweiFence_add(HttpServletRequest request) {
tb_fence fence = new tb_fence();
String layer = request.getParameter("layer");
- if(!layer.equals("鐧惧害鍦板浘")) {
+ if(!layer.equals("鐧惧害鍦板浘") && !layer.equals("鎵嬪姩杈撳叆") && !layer.equals("鑷姩杈撳叆")) {
Integer layerjj = Integer.parseInt(layer);
layer = layerjj.toString();
+ }else {
+ layer = "鐧惧害鍦板浘";
}
fence.setFloor(layer);
fence.setType(request.getParameter("weilanleixing"));
@@ -212,6 +223,7 @@
fence.setName(request.getParameter("quyumingcheng"));
fence.setBaoliu1(request.getParameter("fencegao"));
String zuobiao =(String) request.getParameter("zuobiao");
+ String zuobiaodufen = (String) request.getParameter("zuobiaodufen");
fence.setZuobiao(zuobiao);
fence.setShape(request.getParameter("xingzhuang"));
@@ -223,9 +235,9 @@
fence.setColor(request.getParameter("yanse"));
ZhwService.sanweiFence_add(fence);
- String xieyi = "BSTOCS1,ADDFENCE,"+fence.getFloor()+","+fence.getType()+","+fence.getBumen()+","+fence.getName()+","+fence.getZuobiao()+","+fence.getShape()+","+fence.getStart()+","+fence.getStop()+","+GetNowTime.now()+","+fence.getColor()+",END";
+ String xieyi = "BSTOCS1,ADDFENCE,"+fence.getFloor()+","+fence.getType()+","+fence.getBumen()+","+fence.getName()+","+zuobiao+","+fence.getShape()+","+fence.getStart()+","+fence.getStop()+","+GetNowTime.now()+","+fence.getColor()+","+fence.getBaoliu1()+",END";
Udp_Out.udp_to_cs(xieyi);
-
+ sysSettingService.guiling();
String type = request.getParameter("weilanleixing");
String name = request.getParameter("quyumingcheng");
String floor = request.getParameter("layer");
@@ -323,7 +335,7 @@
position.setSos(node.getP_sos());
position.setTime(node.getP_addtiem());
position.setFence(node.getP_fence());
-
+ position.setChaichu(node.getBaoliu6());
finalPositionList.add(position);
}
@@ -441,32 +453,12 @@
@ResponseBody
public List<tb_gps> getGPS(HttpServletRequest request) {
final List<tb_gps> gpsList = ZhwService.getGPS();
- long timeNow = System.currentTimeMillis();
- long timeStart = timeNow - 1000; //鍙�1s鍐呮渶鏂扮殑涓�鏉℃暟鎹綔涓哄綋鍓嶇殑瀹炴椂浣嶇疆锛屽悗鏈熷彲鏇存敼锛屾澶勪负ms鍗曚綅
-// long timeStart = 0;
List<tb_gps> finalGPSList = new ArrayList<tb_gps>();
for ( tb_gps node : gpsList) {
- //浠呭彇鏈�鏂版洿鏂版椂闂村湪褰撳墠鏃堕棿鍗佺鍐呯殑鏁版嵁
-// String timeRecent = node.getAddtime();
-// Timestamp ts = Timestamp.valueOf(timeRecent);
-// long times = ts.getTime();
-// if (times >= timeStart) {
-// int jingdu = node.getGsp_jingdu().length();
-// //System.out.print("鎵ц浜�"+jingdu);
if (node.getGsp_jingdu() != null && !node.getGsp_jingdu().equals("00000.000000") && node.getGps_weidu() != null && !node.getGps_weidu().equals("00000.000000")) {
-// String weidu = node.getGps_weidu().substring(0,node.getGps_weidu().length()-1);
-// node.setGps_weidu(weidu);
-// String jingdu2 = node.getGsp_jingdu().substring(0, node.getGsp_jingdu().length()-1);
-// node.setGsp_jingdu(jingdu2);
finalGPSList.add(node);
}
-// String weidu = node.getGps_weidu().substring(0,node.getGps_weidu().length()-1);
-// node.setGps_weidu(weidu);
-// String jingdu = node.getGsp_jingdu().substring(0, node.getGsp_jingdu().length()-1);
-// node.setGsp_jingdu(jingdu);
-// finalGPSList.add(node);
-// }
};
return finalGPSList;
}
@@ -767,12 +759,50 @@
public void sosgaojing(HttpServletRequest request) throws IOException {
String tagid=request.getParameter("tagid");
ZhwService.sosgao(tagid);
+ String xieyi = "BSTOCS1,DELLWARN," +tagid+ ",SOS,END";
+ Udp_Out.udp_to_cs(xieyi);
}
@RequestMapping(value = "/fencegaojing.do", method = { RequestMethod.POST, RequestMethod.GET })
public void fencegaojing(HttpServletRequest request) throws IOException {
String tagid=request.getParameter("tagid");
+ String type=request.getParameter("type");
ZhwService.fencegao(tagid);
+ String xieyi = "BSTOCS1,DELLWARN," +tagid+ ","+type+",END";
+ Udp_Out.udp_to_cs(xieyi);
+ }
+
+ @RequestMapping(value = "/chaichugaojing.do", method = { RequestMethod.POST, RequestMethod.GET })
+ public void chaichugaojing(HttpServletRequest request) throws IOException {
+ String tagid=request.getParameter("tagid");
+ ZhwService.chaichugao(tagid);
+ String xieyi = "BSTOCS1,DELLWARN," +tagid+ ",琚媶闄�,END";
+ Udp_Out.udp_to_cs(xieyi);
+ }
+
+ @RequestMapping(value = "/gaojingzongchuli.do", method = { RequestMethod.POST, RequestMethod.GET })
+ public void gaojingzongchuli(HttpServletRequest request) throws IOException {
+ List<tb_person> soslist = ZhwService.getsosgaojing();
+ for (int i=0; i<soslist.size(); i++) {
+ String tagid = soslist.get(i).getP_tagid();
+ ZhwService.sosgao(tagid);
+ String xieyi = "BSTOCS1,DELLWARN," +tagid+ ",SOS,END";
+ Udp_Out.udp_to_cs(xieyi);
+ }
+ List<tb_person> fencelist = ZhwService.getfencegaojing();
+ for (int i=0; i<fencelist.size(); i++) {
+ String tagid = fencelist.get(i).getP_tagid();
+ ZhwService.fencegao(tagid);
+ String xieyi = "BSTOCS1,DELLWARN," +tagid+ ",鍗遍櫓鍖哄煙,END";
+ Udp_Out.udp_to_cs(xieyi);
+ }
+ List<tb_person> chufencelist = ZhwService.getchufencegaojing();
+ for (int i=0; i<fencelist.size(); i++) {
+ String tagid = chufencelist.get(i).getP_tagid();
+ ZhwService.fencegao(tagid);
+ String xieyi = "BSTOCS1,DELLWARN," +tagid+ ",鍑哄尯鍩熷憡璀�,END";
+ Udp_Out.udp_to_cs(xieyi);
+ }
}
@ResponseBody
@@ -1067,6 +1097,13 @@
return realkaoqingList;
}
+ @RequestMapping(value = "/xiafazhendong.do", method = { RequestMethod.POST, RequestMethod.GET })
+ public void xiafazhendong(HttpServletRequest request) throws IOException {
+ String tagid=request.getParameter("tagid");
+ String xieyi = "55BB,TAG_SHAKE,10,"+tagid+",END";
+ Udp_Out.udp_to_cs(xieyi);
+ }
+
public static List<Object[]> objectToArray_qihouManagement2(List<tb_qihou> tb_qihouList) {
List<Object[]> reList = new ArrayList<>();
for (int i = 0; i < tb_qihouList.size(); i++) {
--
Gitblit v1.10.0