Merge branch 'dev' into limingyu-20240416-一公司动火作业地图

liujun-2024-05-23-接口漏洞修复
limingyu 2024-04-26 17:04:20 +08:00
commit 913f5ce6e2
17 changed files with 393 additions and 24 deletions

View File

@ -11,12 +11,14 @@ import com.zcloud.service.majordangersource.MajordangersourceStoragetankService;
import com.zcloud.util.DateUtil;
import com.zcloud.util.Jurisdiction;
import com.zcloud.util.Tools;
import org.apache.commons.lang.StringUtils;
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.*;
import java.util.stream.Collectors;
/**
* -
@ -266,6 +268,21 @@ public class ApiHomeMajorDangerSourceController extends BaseController {
pd = this.getPageData();
pd.put("CORPINFO_ID", "035958e685cf4850bc40151c5e0617a6"); // 企业
List<PageData> varList = majordangersourceService.findAllSourceAndVideo(pd); //获取重大危险源和视频监控
// 将摄像头和灌区区分开
if (pd.get("TYPE") != null && StringUtils.isNotEmpty(pd.getString("TYPE"))){
PageData finalPd = pd;
varList = varList.stream().filter(n -> finalPd.getString("TYPE").equals(n.getString("TYPE"))).collect(Collectors.toList());
for(PageData pageData:varList){
if(StringUtils.isBlank(pageData.getString("NAME"))){
pageData.put("MAP_POINT_NAME","");
}else {
pageData.put("MAP_POINT_NAME",pageData.getString("NAME"));
}
}
map.put("varList", varList);
}else {
map.put("varList", new ArrayList<>());
}
map.put("varList", varList);
map.put("result", errInfo);
return map;

View File

@ -81,4 +81,18 @@ public class DwController extends BaseController {
return dwService.getDictionary();
}
@RequestMapping(value = "getLastProp")
public Object getLastProp() throws Exception {
PageData pd = this.getPageData();
GetLastPropDto mapGet = JSONObject.parseObject(JSONObject.toJSONString(pd), GetLastPropDto.class);
return dwService.getLastProp(mapGet);
}
@RequestMapping(value = "getAllMessage")
public Object getAllMessage() throws Exception {
PageData pd = this.getPageData();
return dwService.getAllMessage();
}
}

View File

@ -127,8 +127,26 @@ public class PlatformvideomanagementController extends BaseController {
PageData pd = new PageData();
pd = this.getPageData();
List<PageData> varList = platformvideomanagementService.listAll(pd); //列出Platformvideomanagement列表
for (PageData data : varList) {
data.put("MAP_POINT_NAME", data.getString("NAME"));
}
map.put("varList", varList);
map.put("result", errInfo);
return map;
}
/**
* @throws Exception
*/
@RequestMapping(value="/getHlsPathById")
@ResponseBody
public Object getHlsPathById() throws Exception{
Map<String,Object> map = new HashMap<String,Object>();
PageData pd =this.getPageData();
pd = platformvideomanagementService.findById(pd);
map = HKUtil.camerasPreviewURLs(pd.getString("INDEXCODE"),"hls");
map.put("pd",pd);
map.put("result", "success");
return map;
}
}

View File

@ -7,10 +7,7 @@ import com.zcloud.entity.Page;
import com.zcloud.entity.PageData;
import com.zcloud.service.bus.CorpInfoService;
import com.zcloud.service.dw.DwService;
import com.zcloud.service.dw.dto.AlarmGet;
import com.zcloud.service.dw.dto.MapGet;
import com.zcloud.service.dw.dto.MapInfo;
import com.zcloud.service.dw.dto.TraceGet;
import com.zcloud.service.dw.dto.*;
import com.zcloud.service.keyProjects.VideoManagerService;
import com.zcloud.service.map.*;
import com.zcloud.service.map.util.ReturnMap;
@ -408,7 +405,7 @@ public class MapController extends BaseController {
*/
@RequestMapping("/getPersonPositioningCount")
@ResponseBody
public Object getPersonPositioningCount() {
public Object getPersonPositioningCount() throws Exception{
Map<String, Object> map = new HashMap<String, Object>();
PageData pageData = this.getPageData();
if ("00004".equals(pageData.getString("GANGKOU"))) {
@ -430,8 +427,6 @@ public class MapController extends BaseController {
return result;
}
// bus_riskunit
// bus_identificationparts
PageData data = biMapService.getPersonPositioningCount(pageData);
map.put("result", "success");
map.put("personPositioningCount", data);
@ -844,10 +839,15 @@ public class MapController extends BaseController {
*/
@RequestMapping(value = "/getCurrentLocationOnline")
@ResponseBody
public Object getCurrentLocationOnline() {
public Object getCurrentLocationOnline() throws Exception {
Map<String, Object> map = new HashMap<String, Object>();
String errInfo = "success";
PageData pd = this.getPageData();
// created by liu jun 一公司人员定位新增摄像头功能
if ("platcamera".equals(pd.getString("TYPE")) && "035958e685cf4850bc40151c5e0617a6".equals(pd.getString("CORPINFO_ID"))){
GetCameraListDto dto = new GetCameraListDto();
return dwService.getCameraList(dto);
}
if ("00004".equals(pd.getString("GANGKOU")) && pd.getString("TYPE").equals("peoplePosition")) {
MultiValueMap<String, Object> paramMap = new LinkedMultiValueMap<String, Object>();
Map<String, Object> result =
@ -885,13 +885,15 @@ public class MapController extends BaseController {
return map;
} else {
MapInfo info = JSONObject.parseObject(JSONObject.toJSONString(map.get("info")), MapInfo.class);
PageData condition = new PageData();
condition.put("USER_ID", info.getRequired().getUserId());
PageData userInfo = usersService.findById(condition);
HashMap<String, String> otherInfo = new HashMap<>();
otherInfo.put("postName", userInfo.getString("postName"));
otherInfo.put("personType", userInfo.getString("PERSON_TYPE"));
map.put("otherInfo", otherInfo);
if (org.apache.commons.lang3.StringUtils.isNotBlank(info.getRequired().getUserId())){
PageData condition = new PageData();
condition.put("USER_ID", info.getRequired().getUserId());
PageData userInfo = usersService.findById(condition);
HashMap<String, String> otherInfo = new HashMap<>();
otherInfo.put("postName", userInfo.getString("postName"));
otherInfo.put("personType", userInfo.getString("PERSON_TYPE"));
map.put("otherInfo", otherInfo);
}
return map;
}
} else {
@ -901,7 +903,7 @@ public class MapController extends BaseController {
return map;
}
}
// 一公司获取人员轨迹
@RequestMapping(value = "/getPersonTrace")
@ResponseBody
public Object getPersonTrace() throws Exception {
@ -920,9 +922,9 @@ public class MapController extends BaseController {
}
}
@RequestMapping(value = "/getAlarmList")
@RequestMapping(value = "/getAllDwMessage")
@ResponseBody
public Object getAlarmList() throws Exception {
public Object getAllDwMessage() throws Exception {
Map<String, Object> map = new HashMap<String, Object>();
PageData pd = this.getPageData();
// TODO 判断是否是公司人员定位
@ -930,9 +932,12 @@ public class MapController extends BaseController {
AlarmGet alarmGet = new AlarmGet();
alarmGet.setPage(new com.zcloud.service.dw.dto.Page());
alarmGet.getPage().setCurrent("1");
alarmGet.getPage().setSize("20");
alarmGet.getPage().setSize("12");
alarmGet.setCorpId(pd.getString("corpId"));
return dwService.getAlarmList(alarmGet);
map.put("result", "success");
map.put("alarmList",dwService.getAlarmList(alarmGet));
map.put("orthermessage",dwService.getAllMessage());
return map;
}else {
PageData value = usersService.getPersonByCardNo(pd);
map.put("result", "success");
@ -941,6 +946,61 @@ public class MapController extends BaseController {
}
}
/**
*
* @return
* @throws Exception
*/
@RequestMapping(value = "/getLastProp")
@ResponseBody
public Object getLastProp() throws Exception {
Map<String, Object> map = new HashMap<String, Object>();
PageData pd = this.getPageData();
// TODO 判断是否是公司人员定位
if (pd.get("corpId") != null && "035958e685cf4850bc40151c5e0617a6".equals(pd.getString("corpId"))) {
GetLastPropDto dto = new GetLastPropDto();
dto.setDeviceCode(pd.getString("CARDNO"));
return dwService.getLastProp(dto);
}else {
// TODO 其他系统有待开发
return null;
}
}
@RequestMapping(value = "/getCameraList")
@ResponseBody
public Object getCameraList() throws Exception {
Map<String, Object> map = new HashMap<String, Object>();
PageData pd = this.getPageData();
// TODO 判断是否是公司人员定位
if (pd.get("corpId") != null && "035958e685cf4850bc40151c5e0617a6".equals(pd.getString("corpId"))) {
GetCameraListDto dto = new GetCameraListDto();
return dwService.getCameraList(dto);
}else {
// TODO 其他系统有待开发
return null;
}
}
@RequestMapping(value = "/getCameraInfo")
@ResponseBody
public Object getCameraInfo() throws Exception {
Map<String, Object> map = new HashMap<String, Object>();
PageData pd = this.getPageData();
// TODO 判断是否是公司人员定位
if (pd.get("corpId") != null && "035958e685cf4850bc40151c5e0617a6".equals(pd.getString("corpId"))) {
GetCameraInfoDto dto = new GetCameraInfoDto();
dto.setId(pd.getString("id"));
return dwService.getCameraInfo(dto);
}else {
// TODO 其他系统有待开发
return null;
}
}
/**

View File

@ -3,14 +3,29 @@ package com.zcloud.service.dw;
import com.zcloud.service.dw.dto.*;
public interface DwService {
// 第一版定位接口
// 废弃
@Deprecated
Object getMapInfo(MapGet param) throws Exception;
// 废弃
@Deprecated
Object getMapList(MapGet param) throws Exception;
// 废弃
@Deprecated
Object saveOrUpdateMap(MapInfo param) throws Exception;
Object getTrace(TraceGet param) throws Exception;
Object getAlarmList(AlarmGet param) throws Exception;
Object manageAlarm(AlarmManageDto param) throws Exception;
// 废弃
@Deprecated
Object getDictionary() throws Exception;
// 废弃
@Deprecated
Object deleteMap(DeleteDto deleteDto);
// 第二版定位接口
Object getLastProp(GetLastPropDto dto) throws Exception;
Object getAllMessage() throws Exception;
Object getCameraList(GetCameraListDto dto) throws Exception;
Object getCameraInfo(GetCameraInfoDto dto) throws Exception;
}

View File

@ -0,0 +1,8 @@
package com.zcloud.service.dw.dto;
import lombok.Data;
@Data
public class GetCameraInfoDto {
private String id;
}

View File

@ -0,0 +1,10 @@
package com.zcloud.service.dw.dto;
import lombok.Data;
@Data
public class GetCameraListDto {
private String name;
private int current;
private int size;
}

View File

@ -0,0 +1,11 @@
package com.zcloud.service.dw.dto;
import lombok.Data;
@Data
public class GetLastPropDto {
// 设备编号
private String deviceCode;
//属性identifier,多个属性时逗号隔开不传或为null时查设备全部属性最新值
private String prop;
}

View File

@ -67,4 +67,24 @@ public class DwServiceImpl implements DwService {
public Object deleteMap(DeleteDto deleteDto) {
return HttpUtil.post(url + "dw/deleteMap", deleteDto);
}
@Override
public Object getLastProp(GetLastPropDto dto) throws Exception {
return HttpUtil.post(url + "dw/getLastProp", dto);
}
@Override
public Object getAllMessage() throws Exception {
return HttpUtil.post(url + "dw/getAllMessage",null);
}
@Override
public Object getCameraList(GetCameraListDto dto) throws Exception {
return HttpUtil.post(url + "dw/getCameraList",dto);
}
@Override
public Object getCameraInfo(GetCameraInfoDto dto) throws Exception {
return HttpUtil.post(url + "dw/getCameraInfo",dto);
}
}

View File

@ -0,0 +1,37 @@
package com.zcloud.service.map;
import com.zcloud.entity.PageData;
import org.springframework.stereotype.Component;
import java.util.LinkedList;
/**
*
* * xfsy01
* * xfbf01
* * xfjyd01 Rescue team
* * xfkzs01 control
* wangxuan
* www.zcloudchina.com
*/
@Component
public class AssembleControlRoomHandel extends AbsFireSourcesHandel {
/**
* @Description:
* @Author: dearLin
* @Date: 2023/9/20/020 15:37
* @Param: [com.zcloud.entity.PageData] [pageData]
* @Return: java.util.LinkedList<com.zcloud.entity.PageData>
*/
@Override
public LinkedList<PageData> assemblyDataHandel(PageData pageData) throws Exception {
return fireResourcesMapper.getControlRoomDataList(pageData);
}
@Override
public void afterPropertiesSet() throws Exception {
AssemblyBeanFactory.register("xfkzs01", this);
}
}

View File

@ -0,0 +1,40 @@
package com.zcloud.service.map;
import com.zcloud.entity.PageData;
import org.springframework.stereotype.Component;
import java.util.LinkedList;
/**
*
* * xfsy01
* * xfbf01
* * xfjyd01
* * xfkzs01
* * Point
* wangxuan
* www.zcloudchina.com
*/
@Component
public class AssemblePointSourceHandel extends AbsFireSourcesHandel {
/**
* @Description:
* @Author: dearLin
* @Date: 2023/9/20/020 15:38
* @Param: [com.zcloud.entity.PageData] [pageData]
* @Return: java.util.LinkedList<com.zcloud.entity.PageData>
*/
@Override
public LinkedList<PageData> assemblyDataHandel(PageData pageData) throws Exception {
// 自己的业务
return fireResourcesMapper.getPointDataList(pageData);
}
@Override
public void afterPropertiesSet() throws Exception {
AssemblyBeanFactory.register("point", this);
}
}

View File

@ -0,0 +1,38 @@
package com.zcloud.service.map;
import com.zcloud.entity.PageData;
import org.springframework.stereotype.Component;
import java.util.LinkedList;
/**
*
* * xfsy01
* * xfbf01 PumpRoom
* * xfjyd01 Rescue team
* * xfkzs01 control
* wangxuan
* www.zcloudchina.com
*/
@Component
public class AssemblePumpRoomHandel extends AbsFireSourcesHandel {
/**
* @Description:
* @Author: dearLin
* @Date: 2023/9/20/020 15:38
* @Param: [com.zcloud.entity.PageData] [pageData]
* @Return: java.util.LinkedList<com.zcloud.entity.PageData>
*/
@Override
public LinkedList<PageData> assemblyDataHandel(PageData pageData) throws Exception {
// 自己的业务
return fireResourcesMapper.getPumpRoomDataList(pageData);
}
@Override
public void afterPropertiesSet() throws Exception {
AssemblyBeanFactory.register("xfbf01", this);
}
}

View File

@ -0,0 +1,38 @@
package com.zcloud.service.map;
import com.zcloud.entity.PageData;
import org.springframework.stereotype.Component;
import java.util.LinkedList;
/**
*
* * xfsy01
* * xfbf01
* * xfjyd01 Rescue team
* * xfkzs01
* wangxuan
* www.zcloudchina.com
*/
@Component
public class AssembleRescueTeamHandel extends AbsFireSourcesHandel {
/**
* @Description:
* @Author: dearLin
* @Date: 2023/9/20/020 15:38
* @Param: [com.zcloud.entity.PageData] [pageData]
* @Return: java.util.LinkedList<com.zcloud.entity.PageData>
*/
@Override
public LinkedList<PageData> assemblyDataHandel(PageData pageData) throws Exception {
pageData.put("CORPINFO_ID",null);
// 自己的业务
return fireResourcesMapper.getRescueTeamDataList(pageData);
}
@Override
public void afterPropertiesSet() throws Exception {
AssemblyBeanFactory.register("xfjyd01", this);
}
}

View File

@ -0,0 +1,38 @@
package com.zcloud.service.map;
import com.zcloud.entity.PageData;
import org.springframework.stereotype.Component;
import java.util.LinkedList;
/**
*
* * xfsy01
* * xfbf01
* * xfjyd01
* * xfkzs01
* wangxuan
* www.zcloudchina.com
*/
@Component
public class AssembleWaterSourceHandel extends AbsFireSourcesHandel {
/**
* @Description:
* @Author: dearLin
* @Date: 2023/9/20/020 15:38
* @Param: [com.zcloud.entity.PageData] [pageData]
* @Return: java.util.LinkedList<com.zcloud.entity.PageData>
*/
@Override
public LinkedList<PageData> assemblyDataHandel(PageData pageData) throws Exception {
// 自己的业务
return fireResourcesMapper.getWaterSourceDataList(pageData);
}
@Override
public void afterPropertiesSet() throws Exception {
AssemblyBeanFactory.register("xfsy01", this);
}
}

View File

@ -222,7 +222,6 @@
<if test="pd.STARTTIME != null and pd.STARTTIME != '' and pd.ENDTIME != null and pd.ENDTIME != ''"><!-- 日期范围检索 -->
and DATE(f.SIGNTIME) between DATE(#{pd.STARTTIME}) and DATE(#{pd.ENDTIME})
</if>
AND f.ISPROMISE_PEOPLE = '0'
ORDER BY f.SIGNTIME desc
</select>

View File

@ -162,9 +162,13 @@
<!-- 列表(全部) -->
<select id="listAll" parameterType="pd" resultType="pd">
select
<include refid="Field"></include>
<include refid="Field"></include>,PLATFORMVIDEOMANAGEMENT_ID as id
from
<include refid="tableName"></include> f
where 1=1
<if test="CORPINFO_ID != null and CORPINFO_ID != ''"><!-- 关键词检索 -->
and f.CORPINFO_ID = #{CORPINFO_ID}
</if>
</select>
<!-- 批量删除 -->

View File

@ -228,6 +228,8 @@
`qa-gwj-prevention`.bus_fire_point f
WHERE
f.ISDELETE = 0
and f.LONGITUDE is not null
and f.LONGITUDE != ''
<if test="CORPINFO_ID != null and CORPINFO_ID != ''">
AND f.CORPINFO_ID = #{CORPINFO_ID}
</if>