diff --git a/src/main/java/com/zcloud/controller/dw/DwController.java b/src/main/java/com/zcloud/controller/dw/DwController.java index 7217f8d6..61f94316 100644 --- a/src/main/java/com/zcloud/controller/dw/DwController.java +++ b/src/main/java/com/zcloud/controller/dw/DwController.java @@ -91,7 +91,8 @@ public class DwController extends BaseController { @RequestMapping(value = "getAllMessage") public Object getAllMessage() throws Exception { PageData pd = this.getPageData(); - return dwService.getAllMessage(); + TraceGet dto = JSONObject.parseObject(JSONObject.toJSONString(pd), TraceGet.class); + return dwService.getAllMessage(dto); } diff --git a/src/main/java/com/zcloud/controller/map/MapController.java b/src/main/java/com/zcloud/controller/map/MapController.java index fe6fb52d..d676c8fe 100644 --- a/src/main/java/com/zcloud/controller/map/MapController.java +++ b/src/main/java/com/zcloud/controller/map/MapController.java @@ -3,6 +3,7 @@ package com.zcloud.controller.map; import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.TypeReference; import com.zcloud.controller.base.BaseController; +import com.zcloud.controller.map.testDto.TestDto; import com.zcloud.entity.Page; import com.zcloud.entity.PageData; import com.zcloud.service.bus.CorpInfoService; @@ -910,16 +911,22 @@ public class MapController extends BaseController { Map map = new HashMap(); PageData pd = this.getPageData(); // TODO 判断是否是公司人员定位 - if (true){ + if ("035958e685cf4850bc40151c5e0617a6".equals(pd.getString("corpId"))) { TraceGet mapInfo = new TraceGet(); mapInfo.setId(pd.getString("id")); return dwService.getTrace(mapInfo); - }else { - PageData value = usersService.getPersonByCardNo(pd); - map.put("result", "success"); - map.put("pd", value); - return map; } + + if ("21590a00ea5e462e9ee44dd332dddc26".equals(pd.getString("corpId"))){ + TraceGet mapInfo = new TraceGet(); + mapInfo.setId(pd.getString("id")); + return dwService.getLtTrace(mapInfo); + } + PageData value = usersService.getPersonByCardNo(pd); + map.put("result", "success"); + map.put("pd", value); + return map; + } @RequestMapping(value = "/getAllDwMessage") @@ -927,7 +934,7 @@ public class MapController extends BaseController { public Object getAllDwMessage() throws Exception { Map map = new HashMap(); PageData pd = this.getPageData(); - // TODO 判断是否是公司人员定位 + // 一公司人员定位系统 if (pd.get("corpId") != null && "035958e685cf4850bc40151c5e0617a6".equals(pd.getString("corpId"))) { AlarmGet alarmGet = new AlarmGet(); alarmGet.setPage(new com.zcloud.service.dw.dto.Page()); @@ -935,15 +942,32 @@ public class MapController extends BaseController { alarmGet.getPage().setSize("12"); alarmGet.setCorpId(pd.getString("corpId")); map.put("result", "success"); - map.put("alarmList",dwService.getAlarmList(alarmGet)); - map.put("orthermessage",dwService.getAllMessage()); + map.put("alarmList", dwService.getAlarmList(alarmGet)); + TraceGet get = new TraceGet(); + get.setCorpId("035958e685cf4850bc40151c5e0617a6"); + map.put("orthermessage", dwService.getAllMessage(get)); return map; - }else { + // 九公司人员定位系统 + } else if (pd.get("corpId") != null && "21590a00ea5e462e9ee44dd332dddc26".equals(pd.getString("corpId"))) { + AlarmGet alarmGet = new AlarmGet(); + alarmGet.setPage(new com.zcloud.service.dw.dto.Page()); + alarmGet.getPage().setCurrent("1"); + alarmGet.getPage().setSize("12"); + alarmGet.setCorpId(pd.getString("corpId")); + map.put("result", "success"); + map.put("alarmList", new ArrayList<>()); + TraceGet get = new TraceGet(); + get.setCorpId("21590a00ea5e462e9ee44dd332dddc26"); + map.put("orthermessage",dwService.getAllMessage(get)); + return map; + } else { PageData value = usersService.getPersonByCardNo(pd); map.put("result", "success"); map.put("pd", value); return map; } + + } /** @@ -961,10 +985,14 @@ public class MapController extends BaseController { GetLastPropDto dto = new GetLastPropDto(); dto.setDeviceCode(pd.getString("CARDNO")); return dwService.getLastProp(dto); - }else { - // TODO 其他系统有待开发 - return null; } + if (pd.get("corpId") != null && "21590a00ea5e462e9ee44dd332dddc26".equals(pd.getString("corpId"))) { + GetLastPropDto dto = new GetLastPropDto(); + dto.setDeviceCode(pd.getString("CARDNO")); + return dwService.getLtLastProp(dto); + } + // TODO 其他系统有待开发 + return null; } @RequestMapping(value = "/getCameraList") diff --git a/src/main/java/com/zcloud/controller/map/testDto/TestDto.java b/src/main/java/com/zcloud/controller/map/testDto/TestDto.java new file mode 100644 index 00000000..49aee83f --- /dev/null +++ b/src/main/java/com/zcloud/controller/map/testDto/TestDto.java @@ -0,0 +1,34 @@ +package com.zcloud.controller.map.testDto; + + +import java.util.HashMap; +import java.util.Map; + +public class TestDto { + public static Map getTestInfo() { + HashMap map = new HashMap<>(); + HashMap UwbBQ = new HashMap<>(); + HashMap UwbJiZhan = new HashMap<>(); + HashMap HKcamera = new HashMap<>(); + HashMap tklyr = new HashMap<>(); + UwbBQ.put("name", "UWB-BQ"); + UwbBQ.put("code", "0"); + UwbBQ.put("num", "0"); + UwbJiZhan.put("name", "UWB-基站"); + UwbJiZhan.put("code", "0"); + UwbJiZhan.put("num", "0"); + HKcamera.put("name", "海康摄像头"); + HKcamera.put("code", "0"); + HKcamera.put("num", "0"); + tklyr.put("name", "天坑路沿人"); + tklyr.put("code", "0"); + tklyr.put("num", "0"); + map.put("UwbBQ", UwbBQ); + map.put("UwbJiZhan", UwbJiZhan); + map.put("HKcamera", HKcamera); + map.put("tklyr", tklyr); + return map; + } + + +} diff --git a/src/main/java/com/zcloud/controller/mkmj/GateVideoController.java b/src/main/java/com/zcloud/controller/mkmj/GateVideoController.java new file mode 100644 index 00000000..9e57fb56 --- /dev/null +++ b/src/main/java/com/zcloud/controller/mkmj/GateVideoController.java @@ -0,0 +1,60 @@ +package com.zcloud.controller.mkmj; + +import com.zcloud.controller.base.BaseController; +import com.zcloud.entity.Page; +import com.zcloud.entity.PageData; +import com.zcloud.service.mkmj.GateVideoService; +import com.zcloud.util.DateUtil; +import com.zcloud.util.Jurisdiction; +import com.zcloud.util.Tools; +import com.zcloud.util.hk.HKUtil; +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.ResponseBody; + +import java.util.Date; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * 说明:视频管理 + * 作者:luoxiaobao + * 时间:2021-05-10 + * 官网:www.zcloudchina.com + */ +@Controller +@RequestMapping("/gateVideo") +public class GateVideoController extends BaseController { + + @Autowired + private GateVideoService gateVideoService; + + @RequestMapping(value="/goAllVideo") + @ResponseBody + public Object goAllVideo() throws Exception{ + Map map = new HashMap(); + String errInfo = "success"; + PageData pd = new PageData(); + pd = this.getPageData(); + + String DATA_IDS = pd.getString("DATA_IDS"); + if(Tools.notEmpty(DATA_IDS)){ + String ArrayDATA_IDS[] = DATA_IDS.split(","); + pd.put("ArrayDATA_IDS", ArrayDATA_IDS); + } + List videoList = gateVideoService.listBo(pd); //根据ID读取 + for (PageData video : videoList) { + if(video.get("INDEXCODE")!=null && !"".equals(video.getString("INDEXCODE"))){ + Map data = HKUtil.camerasPreviewURLs(video.getString("INDEXCODE"), "hls"); + video.put("HLSVIDEOURL", data); + Map resData = (Map) data.get("data"); + video.put("GBSVIDEOURL",resData.get("url")); + } + } + map.put("videoList", videoList); + map.put("result", errInfo); + return map; + } +} diff --git a/src/main/java/com/zcloud/service/dw/DwService.java b/src/main/java/com/zcloud/service/dw/DwService.java index 1d10fc06..7d1b1a25 100644 --- a/src/main/java/com/zcloud/service/dw/DwService.java +++ b/src/main/java/com/zcloud/service/dw/DwService.java @@ -14,6 +14,7 @@ public interface DwService { @Deprecated Object saveOrUpdateMap(MapInfo param) throws Exception; Object getTrace(TraceGet param) throws Exception; + Object getLtTrace(TraceGet mapInfo); Object getAlarmList(AlarmGet param) throws Exception; Object manageAlarm(AlarmManageDto param) throws Exception; // 废弃 @@ -24,8 +25,10 @@ public interface DwService { Object deleteMap(DeleteDto deleteDto); // 第二版定位接口 Object getLastProp(GetLastPropDto dto) throws Exception; - Object getAllMessage() throws Exception; + Object getLtLastProp(GetLastPropDto dto) throws Exception; + Object getAllMessage(TraceGet param) throws Exception; Object getCameraList(GetCameraListDto dto) throws Exception; Object getCameraInfo(GetCameraInfoDto dto) throws Exception; + } diff --git a/src/main/java/com/zcloud/service/dw/dto/TraceGet.java b/src/main/java/com/zcloud/service/dw/dto/TraceGet.java index acf50478..40ef9aa9 100644 --- a/src/main/java/com/zcloud/service/dw/dto/TraceGet.java +++ b/src/main/java/com/zcloud/service/dw/dto/TraceGet.java @@ -6,6 +6,7 @@ import lombok.Data; public class TraceGet { private String user_id; private String id; + private String corpId; private String startTime; private String endTime; } diff --git a/src/main/java/com/zcloud/service/dw/impl/DwServiceImpl.java b/src/main/java/com/zcloud/service/dw/impl/DwServiceImpl.java index d7bc375a..9bd7595b 100644 --- a/src/main/java/com/zcloud/service/dw/impl/DwServiceImpl.java +++ b/src/main/java/com/zcloud/service/dw/impl/DwServiceImpl.java @@ -48,6 +48,11 @@ public class DwServiceImpl implements DwService { return HttpUtil.post(url + "dw/getTrace", param); } + @Override + public Object getLtTrace(TraceGet param) { + return HttpUtil.post(url + "dw/LtGetTrace", param); + } + @Override public Object getAlarmList(AlarmGet param) throws Exception { return HttpUtil.post(url + "dw/getAlarmList", param); @@ -74,8 +79,13 @@ public class DwServiceImpl implements DwService { } @Override - public Object getAllMessage() throws Exception { - return HttpUtil.post(url + "dw/getAllMessage",null); + public Object getLtLastProp(GetLastPropDto dto) throws Exception { + return HttpUtil.post(url + "dw/getLtLastProp", dto); + } + + @Override + public Object getAllMessage(TraceGet param) throws Exception { + return HttpUtil.post(url + "dw/getAllMessage",param); } @Override diff --git a/src/main/java/com/zcloud/service/mkmj/GateVideoService.java b/src/main/java/com/zcloud/service/mkmj/GateVideoService.java new file mode 100644 index 00000000..defe393e --- /dev/null +++ b/src/main/java/com/zcloud/service/mkmj/GateVideoService.java @@ -0,0 +1,23 @@ +package com.zcloud.service.mkmj; + +import com.zcloud.entity.Page; +import com.zcloud.entity.PageData; + +import java.util.List; + +/** + * 说明:视频管理 + * 作者:luoxiaobao + * 时间:2021-05-10 + * 官网:www.zcloudchina.com + */ +public interface GateVideoService { + + /**列表(全部) + * @param pd + * @throws Exception + */ + public List listBo(PageData pd)throws Exception; + +} + diff --git a/src/main/java/com/zcloud/service/mkmj/impl/GateVideoServiceImpl.java b/src/main/java/com/zcloud/service/mkmj/impl/GateVideoServiceImpl.java new file mode 100644 index 00000000..e0d4ebc7 --- /dev/null +++ b/src/main/java/com/zcloud/service/mkmj/impl/GateVideoServiceImpl.java @@ -0,0 +1,34 @@ +package com.zcloud.service.mkmj.impl; + +import com.zcloud.entity.Page; +import com.zcloud.entity.PageData; +import com.zcloud.mapper.datasource.map.GateVideoMapper; +import com.zcloud.service.mkmj.GateVideoService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.List; + +/** + * 说明:视频管理 + * 作者:luoxiaobao + * 时间:2021-05-10 + * 官网:www.zcloudchina.com + */ +@Service +@Transactional //开启事物 +public class GateVideoServiceImpl implements GateVideoService { + + @Autowired + private GateVideoMapper gateVideoMapper; + + /**列表(全部) + * @param pd + * @throws Exception + */ + public List listBo(PageData pd)throws Exception{ + return gateVideoMapper.listBo(pd); + } +} + diff --git a/src/main/resources/mybatis/datasource/map/GateMachineMapper.xml b/src/main/resources/mybatis/datasource/map/GateMachineMapper.xml index 6aa1edae..6ca493aa 100644 --- a/src/main/resources/mybatis/datasource/map/GateMachineMapper.xml +++ b/src/main/resources/mybatis/datasource/map/GateMachineMapper.xml @@ -146,14 +146,15 @@ bus_gatevideo v LEFT JOIN mk_gate_area o on v.GATE_AREA_ID = o.GATE_AREA_ID WHERE - v.isdelete = 0 + v.isdelete = 0 and v.LATITUDE IS NOT NULL and v.LONGITUDE IS NOT NULL and o.CORPINFO_ID in (select CORPINFO_ID from bus_corp_info where AREA = #{AREA} and ISDELETE = 0) and o.CORPINFO_ID = #{CORP_INFO_ID} - + group by + v.GATEVIDEO_ID