From eea662194681c3fca22ba14b8540953ff32a547a Mon Sep 17 00:00:00 2001 From: fangjiakai <450850793@qq.com> Date: Sun, 4 Feb 2024 09:14:57 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9C=B0=E5=9B=BE=E5=85=AB=E9=A1=B9=E4=BD=9C?= =?UTF-8?q?=E4=B8=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/mapApi/MapController.java | 55 ++++++++++++++++++- .../controller/system/MainController.java | 2 +- .../java/com/zcloud/entity/system/Route.java | 10 ++-- .../eightwork/ConfinedspaceMapper.java | 3 + .../datasource/eightwork/HighworkMapper.java | 2 + .../datasource/eightwork/HotworkMapper.java | 1 + .../eightwork/ConfinedspaceService.java | 3 + .../service/eightwork/HighworkService.java | 3 + .../service/eightwork/HotworkService.java | 3 + .../impl/ConfinedspaceServiceImpl.java | 32 ++++++----- .../eightwork/impl/HighworkServiceImpl.java | 8 +++ .../eightwork/impl/HotworkServiceImpl.java | 11 +++- .../service/system/impl/RouteServiceImpl.java | 2 +- .../eightwork/ConfinedspaceMapper.xml | 24 ++++++++ .../datasource/eightwork/HighWorkMapper.xml | 14 +++++ .../datasource/eightwork/HotWorkMapper.xml | 14 +++++ 16 files changed, 165 insertions(+), 22 deletions(-) diff --git a/src/main/java/com/zcloud/controller/mapApi/MapController.java b/src/main/java/com/zcloud/controller/mapApi/MapController.java index 111c5c2..dc5ed1c 100644 --- a/src/main/java/com/zcloud/controller/mapApi/MapController.java +++ b/src/main/java/com/zcloud/controller/mapApi/MapController.java @@ -4,7 +4,10 @@ import com.alibaba.fastjson.JSONObject; import com.zcloud.controller.base.BaseController; import com.zcloud.entity.Page; import com.zcloud.entity.PageData; +import com.zcloud.service.eightwork.ConfinedspaceService; import com.zcloud.service.eightwork.EightWorkService; +import com.zcloud.service.eightwork.HighworkService; +import com.zcloud.service.eightwork.HotworkService; import com.zcloud.service.system.UsersService; import com.zcloud.service.video.VideoManagerService; import com.zcloud.util.DateUtil; @@ -34,7 +37,12 @@ public class MapController extends BaseController { private EightWorkService eightWorkService; @Autowired private VideoManagerService videomanagerService; - + @Autowired + private HotworkService hotworkService; + @Autowired + private ConfinedspaceService confinedspaceService; + @Autowired + private HighworkService highworkService; // ----------人员定位相关-------------// /** @@ -91,6 +99,17 @@ public class MapController extends BaseController { return ReturnMap.ok().put("data", PLSUtil.getRealTimeList(Jurisdiction.getCORPINFO_ID())); } + /** + * @Description: 电子围栏信息 + * @Param: [] [] + * @Return: com.zcloud.util.ReturnMap + */ + @RequestMapping(value = "/getFenceList") + @ResponseBody + public ReturnMap getFenceList() throws Exception { + return ReturnMap.ok().put("data", PLSUtil.getRyRegionList(Jurisdiction.getCORPINFO_ID(),"",1,999999)); + } + /** * @Description: 获取八项作业数 * @Param: [] [] @@ -101,6 +120,40 @@ public class MapController extends BaseController { public ReturnMap getEightWorks() throws Exception { return eightWorkService.getEightWorks(); } + + /** + * @Description: 获取动火作业 + * @Param: [] [] + * @Return: com.zcloud.util.ReturnMap + */ + @RequestMapping(value = "/getHotworkList") + @ResponseBody + public ReturnMap getHotworkList() throws Exception { + return hotworkService.getMapList(); + } + + /** + * @Description: 获取受限空间作业 + * @Param: [] [] + * @Return: com.zcloud.util.ReturnMap + */ + @RequestMapping(value = "/getConfinedspaceWorkList") + @ResponseBody + public ReturnMap getConfinedspaceWorkList() throws Exception { + return confinedspaceService.getMapList(); + } + + /** + * @Description: 获取高处作业 + * @Param: [] [] + * @Return: com.zcloud.util.ReturnMap + */ + @RequestMapping(value = "/getHighWorkList") + @ResponseBody + public ReturnMap getHighWorkList() throws Exception { + return highworkService.getMapList(); + } + // ----------摄像头相关-------------// // 摄像头告警数 disposed diff --git a/src/main/java/com/zcloud/controller/system/MainController.java b/src/main/java/com/zcloud/controller/system/MainController.java index 6a21d64..0952579 100644 --- a/src/main/java/com/zcloud/controller/system/MainController.java +++ b/src/main/java/com/zcloud/controller/system/MainController.java @@ -245,7 +245,7 @@ public class MainController extends BaseController { } } if (menuList.get(i).isHasMenu()) { //判断是否有此菜单权限 - this.readRoute(USERNAME, menuList.get(i).getSubMenu(), roleRights, arrayRoleRights, shiroSet, uqxmap, uqxmap2);//是:继续排查其子菜单 + this.readRoute(USERNAME, menuList.get(i).getChildren(), roleRights, arrayRoleRights, shiroSet, uqxmap, uqxmap2);//是:继续排查其子菜单 } } return menuList; diff --git a/src/main/java/com/zcloud/entity/system/Route.java b/src/main/java/com/zcloud/entity/system/Route.java index 22e1d59..af002fe 100644 --- a/src/main/java/com/zcloud/entity/system/Route.java +++ b/src/main/java/com/zcloud/entity/system/Route.java @@ -26,7 +26,7 @@ public class Route implements Serializable { private String target; - private List subMenu; + private List children; private boolean hasMenu = false; public String getROUTE_ID() { @@ -141,12 +141,12 @@ public class Route implements Serializable { this.target = target; } - public List getSubMenu() { - return subMenu; + public List getChildren() { + return children; } - public void setSubMenu(List subMenu) { - this.subMenu = subMenu; + public void setChildren(List children) { + this.children = children; } public boolean isHasMenu() { diff --git a/src/main/java/com/zcloud/mapper/datasource/eightwork/ConfinedspaceMapper.java b/src/main/java/com/zcloud/mapper/datasource/eightwork/ConfinedspaceMapper.java index e9523a1..689b6f7 100644 --- a/src/main/java/com/zcloud/mapper/datasource/eightwork/ConfinedspaceMapper.java +++ b/src/main/java/com/zcloud/mapper/datasource/eightwork/ConfinedspaceMapper.java @@ -17,6 +17,7 @@ public interface ConfinedspaceMapper { void edit(PageData pd); void editGasTime(PageData pd); void editStep(PageData pd); + void setPosition(PageData pd); List datalistPage(Page page); List listAllMeasures(); @@ -24,4 +25,6 @@ public interface ConfinedspaceMapper { List checkWorkCount(PageData pd); List getFlowList(PageData pd); + + List getMapList(PageData pd); } diff --git a/src/main/java/com/zcloud/mapper/datasource/eightwork/HighworkMapper.java b/src/main/java/com/zcloud/mapper/datasource/eightwork/HighworkMapper.java index f6ebf7a..b4eec56 100644 --- a/src/main/java/com/zcloud/mapper/datasource/eightwork/HighworkMapper.java +++ b/src/main/java/com/zcloud/mapper/datasource/eightwork/HighworkMapper.java @@ -25,4 +25,6 @@ public interface HighworkMapper { List getFlowList(PageData pd); void setPosition(PageData pd); + + List getMapList(PageData pd); } diff --git a/src/main/java/com/zcloud/mapper/datasource/eightwork/HotworkMapper.java b/src/main/java/com/zcloud/mapper/datasource/eightwork/HotworkMapper.java index a318f90..1afbcd5 100644 --- a/src/main/java/com/zcloud/mapper/datasource/eightwork/HotworkMapper.java +++ b/src/main/java/com/zcloud/mapper/datasource/eightwork/HotworkMapper.java @@ -36,4 +36,5 @@ public interface HotworkMapper { List getFlowList(PageData pd); + List getMapList(PageData pd); } diff --git a/src/main/java/com/zcloud/service/eightwork/ConfinedspaceService.java b/src/main/java/com/zcloud/service/eightwork/ConfinedspaceService.java index 7870a83..cb928f7 100644 --- a/src/main/java/com/zcloud/service/eightwork/ConfinedspaceService.java +++ b/src/main/java/com/zcloud/service/eightwork/ConfinedspaceService.java @@ -2,6 +2,7 @@ package com.zcloud.service.eightwork; import com.zcloud.entity.Page; import com.zcloud.entity.PageData; +import com.zcloud.util.ReturnMap; import org.springframework.web.multipart.MultipartFile; import java.util.List; @@ -39,4 +40,6 @@ public interface ConfinedspaceService { void saveGas(PageData pd,MultipartFile[] files) throws Exception; List getFlowList(PageData pd)throws Exception; + + ReturnMap getMapList()throws Exception; } diff --git a/src/main/java/com/zcloud/service/eightwork/HighworkService.java b/src/main/java/com/zcloud/service/eightwork/HighworkService.java index fb0fef1..d9aef57 100644 --- a/src/main/java/com/zcloud/service/eightwork/HighworkService.java +++ b/src/main/java/com/zcloud/service/eightwork/HighworkService.java @@ -2,6 +2,7 @@ package com.zcloud.service.eightwork; import com.zcloud.entity.Page; import com.zcloud.entity.PageData; +import com.zcloud.util.ReturnMap; import org.springframework.web.multipart.MultipartFile; import java.util.List; @@ -38,4 +39,6 @@ public interface HighworkService { List getFlowList(PageData pd)throws Exception; + + ReturnMap getMapList()throws Exception; } diff --git a/src/main/java/com/zcloud/service/eightwork/HotworkService.java b/src/main/java/com/zcloud/service/eightwork/HotworkService.java index 44d8446..21ad7d2 100644 --- a/src/main/java/com/zcloud/service/eightwork/HotworkService.java +++ b/src/main/java/com/zcloud/service/eightwork/HotworkService.java @@ -2,6 +2,7 @@ package com.zcloud.service.eightwork; import com.zcloud.entity.Page; import com.zcloud.entity.PageData; +import com.zcloud.util.ReturnMap; import org.springframework.web.multipart.MultipartFile; import java.util.List; @@ -42,4 +43,6 @@ public interface HotworkService { void saveGas(PageData pd,MultipartFile[] files) throws Exception; List getFlowList(PageData pd)throws Exception; + + ReturnMap getMapList()throws Exception; } diff --git a/src/main/java/com/zcloud/service/eightwork/impl/ConfinedspaceServiceImpl.java b/src/main/java/com/zcloud/service/eightwork/impl/ConfinedspaceServiceImpl.java index 6151ff4..e5f79de 100644 --- a/src/main/java/com/zcloud/service/eightwork/impl/ConfinedspaceServiceImpl.java +++ b/src/main/java/com/zcloud/service/eightwork/impl/ConfinedspaceServiceImpl.java @@ -6,10 +6,7 @@ import com.zcloud.entity.Page; import com.zcloud.entity.PageData; import com.zcloud.mapper.datasource.eightwork.*; import com.zcloud.service.eightwork.ConfinedspaceService; -import com.zcloud.util.Const; -import com.zcloud.util.DateUtil; -import com.zcloud.util.Smb; -import com.zcloud.util.UuidUtil; +import com.zcloud.util.*; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -70,6 +67,7 @@ public class ConfinedspaceServiceImpl implements ConfinedspaceService { PageData flow = getStep(pd.get("TASK_ID"),"1"); saveLog(pd,pd.getString("CREATOR"),"1"); saveNextSigner(pd,flow); + setPosition(pd); } } @@ -85,6 +83,7 @@ public class ConfinedspaceServiceImpl implements ConfinedspaceService { PageData flow = getStep(pd.get("TASK_ID"),"1"); saveLog(pd,pd.getString("CREATOR"),"1"); saveNextSigner(pd,flow); + setPosition(pd); } } @@ -295,6 +294,15 @@ public class ConfinedspaceServiceImpl implements ConfinedspaceService { return confinedspaceMapper.getFlowList(pd); } + @Override + public ReturnMap getMapList() throws Exception { + ReturnMap returnMap = new ReturnMap(); + PageData pd = new PageData(); + pd.put("CORPINFO_ID",Jurisdiction.getCORPINFO_ID()); + returnMap.put("varList",confinedspaceMapper.getMapList(pd)); + return returnMap; + } + private void saveNextSigner(PageData pd,PageData flow) throws Exception { pd.put("STEP_ID",flow.get("NEXT_STEP_ID")); @@ -389,14 +397,12 @@ public class ConfinedspaceServiceImpl implements ConfinedspaceService { eightWorkFlowLogMapper.save(log); } -// private void saveNext(PageData pd,PageData flow) throws Exception { -// PageData log = new PageData(); -// log.put("LOG_ID", UuidUtil.get32UUID()); -// log.put("WORK_ID", pd.get(primary_key)); -// log.put("TASK_ID", pd.get("TASK_ID")); -// log.put("STEP_ID", flow.get("NEXT_STEP_ID")); -// log.put("STATUS", "0"); -// eightWorkFlowLogMapper.save(log); -// } + private void setPosition(PageData pd) throws Exception { + JSONObject body = PLSUtil.getRyRegionInfo(pd.getString("CORPINFO_ID"),Integer.parseInt(pd.getString("PLS_ID"))); + List pointList = (List)((Map) body.get("data")).get("list"); + List positions = PLSUtil.getRandomPointInPolygon(pointList); + pd.put("WORK_POSITION", String.join(",",positions)); + confinedspaceMapper.setPosition(pd); + } } diff --git a/src/main/java/com/zcloud/service/eightwork/impl/HighworkServiceImpl.java b/src/main/java/com/zcloud/service/eightwork/impl/HighworkServiceImpl.java index 980e1e6..a8e9876 100644 --- a/src/main/java/com/zcloud/service/eightwork/impl/HighworkServiceImpl.java +++ b/src/main/java/com/zcloud/service/eightwork/impl/HighworkServiceImpl.java @@ -229,6 +229,14 @@ public class HighworkServiceImpl implements HighworkService { return highworkMapper.getFlowList(pd); } + @Override + public ReturnMap getMapList() throws Exception { + ReturnMap returnMap = new ReturnMap(); + PageData pd = new PageData(); + pd.put("CORPINFO_ID",Jurisdiction.getCORPINFO_ID()); + returnMap.put("varList",highworkMapper.getMapList(pd)); + return returnMap; + } private void saveNextSigner(PageData pd,PageData flow) throws Exception { pd.put("STEP_ID",flow.get("NEXT_STEP_ID")); diff --git a/src/main/java/com/zcloud/service/eightwork/impl/HotworkServiceImpl.java b/src/main/java/com/zcloud/service/eightwork/impl/HotworkServiceImpl.java index 57051ed..258dd90 100644 --- a/src/main/java/com/zcloud/service/eightwork/impl/HotworkServiceImpl.java +++ b/src/main/java/com/zcloud/service/eightwork/impl/HotworkServiceImpl.java @@ -297,6 +297,15 @@ public class HotworkServiceImpl implements HotworkService { return hotworkMapper.getFlowList(pd); } + @Override + public ReturnMap getMapList() throws Exception { + ReturnMap returnMap = new ReturnMap(); + PageData pd = new PageData(); + pd.put("CORPINFO_ID",Jurisdiction.getCORPINFO_ID()); + returnMap.put("varList",hotworkMapper.getMapList(pd)); + return returnMap; + } + private void saveNextSigner(PageData pd,PageData flow) throws Exception { pd.put("STEP_ID",flow.get("NEXT_STEP_ID")); @@ -393,7 +402,7 @@ public class HotworkServiceImpl implements HotworkService { } private void setPosition(PageData pd) throws Exception { - JSONObject body = PLSUtil.getRyRegionInfo(Jurisdiction.getCORPINFO_ID(),Integer.parseInt(pd.getString("PLS_ID"))); + JSONObject body = PLSUtil.getRyRegionInfo(pd.getString("CORPINFO_ID"),Integer.parseInt(pd.getString("PLS_ID"))); List pointList = (List)((Map) body.get("data")).get("list"); List positions = PLSUtil.getRandomPointInPolygon(pointList); pd.put("WORK_POSITION", String.join(",",positions)); diff --git a/src/main/java/com/zcloud/service/system/impl/RouteServiceImpl.java b/src/main/java/com/zcloud/service/system/impl/RouteServiceImpl.java index d532d2f..725476e 100644 --- a/src/main/java/com/zcloud/service/system/impl/RouteServiceImpl.java +++ b/src/main/java/com/zcloud/service/system/impl/RouteServiceImpl.java @@ -184,7 +184,7 @@ public class RouteServiceImpl implements RouteService { public List listAllMenuJur(String MENU_ID) throws Exception { List routeList = this.listSubRouteByParentId(MENU_ID); for (Route route : routeList) { - route.setSubMenu(this.listAllMenuJur(route.getROUTE_ID())); + route.setChildren(this.listAllMenuJur(route.getROUTE_ID())); route.setTarget("treeFrame"); } return routeList; diff --git a/src/main/resources/mybatis/datasource/eightwork/ConfinedspaceMapper.xml b/src/main/resources/mybatis/datasource/eightwork/ConfinedspaceMapper.xml index 7608496..c0f3444 100644 --- a/src/main/resources/mybatis/datasource/eightwork/ConfinedspaceMapper.xml +++ b/src/main/resources/mybatis/datasource/eightwork/ConfinedspaceMapper.xml @@ -349,6 +349,16 @@ CONFINEDSPACE_ID = #{CONFINEDSPACE_ID} + + + update + + set + WORK_POSITION = #{WORK_POSITION} + where + CONFINEDSPACE_ID = #{CONFINEDSPACE_ID} + + + + diff --git a/src/main/resources/mybatis/datasource/eightwork/HighWorkMapper.xml b/src/main/resources/mybatis/datasource/eightwork/HighWorkMapper.xml index 202481f..4a16cd8 100644 --- a/src/main/resources/mybatis/datasource/eightwork/HighWorkMapper.xml +++ b/src/main/resources/mybatis/datasource/eightwork/HighWorkMapper.xml @@ -500,4 +500,18 @@ where HIGHWORK_ID = #{HIGHWORK_ID} + + diff --git a/src/main/resources/mybatis/datasource/eightwork/HotWorkMapper.xml b/src/main/resources/mybatis/datasource/eightwork/HotWorkMapper.xml index 7a7ff5d..8aae5a2 100644 --- a/src/main/resources/mybatis/datasource/eightwork/HotWorkMapper.xml +++ b/src/main/resources/mybatis/datasource/eightwork/HotWorkMapper.xml @@ -571,4 +571,18 @@ order by flow.ORDER_BY + +