Commit 26520725 authored by hanbing's avatar hanbing

[update] 统一信控-状态检测,增加子区列表新接口

parent 6bd1296f
......@@ -9,6 +9,8 @@ import net.wanji.common.framework.rest.JsonViewObject;
import net.wanji.databus.bo.AreaDetailBO;
import net.wanji.databus.bo.AreaIdBO;
import net.wanji.databus.vo.AreaDetailVO;
import net.wanji.databus.vo.AreaInfoVO;
import net.wanji.databus.vo.CrossIdAndNameVO;
import net.wanji.web.bo.AddOrUpdateAreaBO;
import net.wanji.web.bo.ControlModeBO;
import net.wanji.web.bo.PolygonBO;
......
......@@ -7,6 +7,7 @@ import net.wanji.common.dto.SystemServiceStatusDTO;
import net.wanji.common.enums.BaseEnum;
import net.wanji.common.framework.rest.JsonViewObject;
import net.wanji.databus.vo.CrossDeviceStatusInfoOutVO;
import net.wanji.databus.vo.OptAreaInfoVO;
import net.wanji.web.service.SituationDetectionService;
import net.wanji.web.task.SystemServiceStatusTask;
import net.wanji.web.vo.situationDetection.*;
......@@ -179,6 +180,14 @@ public class SituationDetectionController extends BaseController {
return jsonViewObject.success(areaListVOS);
}
@AspectLog(description = "查询子区列表(新)", operationType = BaseEnum.OperationTypeEnum.QUERY)
@ApiOperation(value = "查询子区列表(新)", notes = "查询子区列表(新)")
@GetMapping("/areaListNew")
public JsonViewObject areaList() {
List<OptAreaInfoVO> res = situationDetectionService.areaList();
return JsonViewObject.newInstance().success(res);
}
@AspectLog(description = "查询信号机故障列表", operationType = BaseEnum.OperationTypeEnum.QUERY)
@ApiOperation(value = "查询信号机故障列表", notes = "查询信号机故障列表")
@GetMapping("/listSignalFaultInfos")
......
......@@ -2,6 +2,8 @@ package net.wanji.web.service;
import com.github.pagehelper.PageInfo;
import net.wanji.databus.bo.AreaDetailBO;
import net.wanji.databus.vo.AreaInfoVO;
import net.wanji.databus.vo.CrossIdAndNameVO;
import net.wanji.web.bo.AddOrUpdateAreaBO;
import net.wanji.databus.bo.AreaIdBO;
import net.wanji.web.bo.ControlModeBO;
......
......@@ -2,6 +2,7 @@ package net.wanji.web.service;
import net.wanji.databus.po.BaseCrossInfoPO;
import net.wanji.databus.vo.CrossDeviceStatusInfoOutVO;
import net.wanji.databus.vo.OptAreaInfoVO;
import net.wanji.web.vo.situationDetection.*;
import java.text.ParseException;
......@@ -47,4 +48,6 @@ public interface SituationDetectionService {
List<SignalOperationModeCountVO> countSignalControlInfos();
List<SignalManufacturerCountInfoVO> signalManufacturerInfoCount() throws Exception;
List<OptAreaInfoVO> areaList();
}
......@@ -22,6 +22,8 @@ import net.wanji.databus.po.AreaDetailPOExt;
import net.wanji.databus.po.BaseAreaInfoPO;
import net.wanji.databus.po.BaseCrossInfoPO;
import net.wanji.databus.vo.AreaDetailVO;
import net.wanji.databus.vo.AreaInfoVO;
import net.wanji.databus.vo.CrossIdAndNameVO;
import net.wanji.feign.service.UtcFeignClients;
import net.wanji.web.bo.AddOrUpdateAreaBO;
import net.wanji.web.bo.ControlModeBO;
......@@ -383,7 +385,7 @@ public class CrossManageServiceImpl implements CrossManageService {
// 查询区域路口ID
areaInfoVO.setCrossIdAndNameList(buildCrossIdAndNameList(areaId));
areaInfoVO.setWkt(baseAreaInfoPO.getLocation());
areaInfoVO.setWkt(baseAreaInfoPO.getPolylines());
return areaInfoVO;
}
......
......@@ -5,21 +5,20 @@ import cn.hutool.core.date.DateUnit;
import cn.hutool.core.date.DateUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import lombok.RequiredArgsConstructor;
import net.wanji.common.enums.AreaEnum;
import net.wanji.common.enums.EventAlarmEnum;
import net.wanji.common.enums.EventAlarmSourceEnum;
import net.wanji.common.framework.rest.JsonViewObject;
import net.wanji.common.utils.tool.BeanListUtils;
import net.wanji.common.utils.tool.BeanMapUtils;
import net.wanji.common.utils.tool.CrossUtil;
import net.wanji.databus.dao.mapper.BaseAreaInfoMapper;
import net.wanji.databus.dao.mapper.BaseCrossInfoMapper;
import net.wanji.databus.dao.mapper.GreenwaveCrossMapper;
import net.wanji.databus.po.BaseAreaInfoPO;
import net.wanji.databus.po.BaseCrossInfoPO;
import net.wanji.databus.po.TBaseCrossInfo;
import net.wanji.databus.vo.CrossDeviceStatusInfoOutVO;
import net.wanji.databus.vo.CrossInfoOutVo;
import net.wanji.databus.vo.CrossInfoPageVO;
import net.wanji.databus.vo.ManufacturerInfoOutVO;
import net.wanji.databus.vo.ManufacturerVO;
import net.wanji.databus.vo.*;
import net.wanji.feign.service.UtcFeignClients;
import net.wanji.web.common.enums.ControlHistEnum;
import net.wanji.web.common.enums.CrossAlarmEnum;
......@@ -109,6 +108,9 @@ public class SituationDetectionServiceImpl implements SituationDetectionService
private final TBaseAreaCrossMapper tBaseAreaCrossMapper;
private final TDeviceStatusLogMapper tDeviceStatusLogMapper;
private final UtcFeignClients utcFeignClients;
private final BaseAreaInfoMapper baseAreaInfoMapper;
private final TBaseAreaCrossMapper areaCrossMapper;
private final BaseCrossInfoMapper crossInfoMapper;
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
......@@ -754,6 +756,40 @@ public class SituationDetectionServiceImpl implements SituationDetectionService
return resultList;
}
@Override
public List<OptAreaInfoVO> areaList() {
List<OptAreaInfoVO> res = new ArrayList<>();
List<BaseAreaInfoPO> baseAreaInfoPOList = baseAreaInfoMapper.selectAllArea(AreaEnum.TRANSPORT.getCode());
for (BaseAreaInfoPO baseAreaInfoPO : baseAreaInfoPOList) {
OptAreaInfoVO optAreaInfoVO = new OptAreaInfoVO();
Integer areaId = baseAreaInfoPO.getId();
optAreaInfoVO.setAreaId(areaId);
optAreaInfoVO.setAreaName(baseAreaInfoPO.getName());
optAreaInfoVO.setCrossInfos(buildCrossIdAndNameList(areaId));
optAreaInfoVO.setPloyLines(baseAreaInfoPO.getPolylines());
res.add(optAreaInfoVO);
}
return res;
}
private List<OptCrossIdAndNameVO> buildCrossIdAndNameList(Integer areaId) {
List<OptCrossIdAndNameVO> res = new ArrayList<>();
List<String> crossIds = areaCrossMapper.selectCrossIdsByAreaId(areaId);
List<BaseCrossInfoPO> baseCrossInfoPOList = crossInfoMapper.selectByCrossIds(crossIds);
for (BaseCrossInfoPO baseCrossInfoPO : baseCrossInfoPOList) {
OptCrossIdAndNameVO optCrossIdAndNameVO = new OptCrossIdAndNameVO();
optCrossIdAndNameVO.setCrossId(baseCrossInfoPO.getId());
optCrossIdAndNameVO.setCrossName(baseCrossInfoPO.getName());
String location = baseCrossInfoPO.getLocation();
double[] lonLat = CrossUtil.getLonLat(location);
optCrossIdAndNameVO.setLocation(lonLat[0] + "," + lonLat[1]);
res.add(optCrossIdAndNameVO);
}
return res;
}
/**
* 统计不同厂商在线离线数量
*
......
......@@ -4,6 +4,7 @@ import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.NoArgsConstructor;
import net.wanji.databus.vo.CrossIdAndNameVO;
import java.util.List;
......
package net.wanji.common.enums;
/**
* @author Kent HAN
* @date 2022/11/8 17:20
*/
public enum AreaEnum {
// 区划类型:1行政区划;2交警辖区;3商圈;4交通小区;5热点区域;6道路
ADMIN(1, "行政区划"),
POLICE(2, "交警辖区"),
BUSSINESS(3, "商圈"),
TRANSPORT(4, "交通小区"),
HOTSPOT(5, "热点区域"),
ROAD(6, "道路");
private final int code;
private final String msg;
AreaEnum(int code, String msg) {
this.code = code;
this.msg = msg;
}
public static String getMsgByCode(int code) {
for (AreaEnum value : AreaEnum.values()) {
if (value.code == code) {
return value.msg;
}
}
return null;
}
public String getMsg() {
return msg;
}
public Integer getCode() {
return code;
}
}
......@@ -36,4 +36,5 @@ public interface BaseAreaInfoMapper {
List<AreaDetailPOExt> selectJoinDetail(Integer areaId, String crossName, Integer isSignal, Integer isStart,
Integer isSend);
List<BaseAreaInfoPO> selectAllArea(Integer type);
}
package net.wanji.web.vo;
package net.wanji.databus.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
......
package net.wanji.web.vo;
package net.wanji.databus.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
......
package net.wanji.databus.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
/**
* @author Kent HAN
* @date 2023/6/9 13:52
*/
@Data
@ApiModel(value = "AreaInfoVO", description = "区域信息")
public class OptAreaInfoVO {
@ApiModelProperty(value = "区域ID")
private Integer areaId;
@ApiModelProperty(value = "区域名称", required = true)
private String areaName;
@ApiModelProperty(value = "路口数组", required = true)
private List<OptCrossIdAndNameVO> crossInfos;
@ApiModelProperty(value = "坐标")
private String ployLines;
}
package net.wanji.databus.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.NoArgsConstructor;
@NoArgsConstructor
@Data
@ApiModel(value = "CrossIdAndNameVO", description = "路口ID和路口名称")
public class OptCrossIdAndNameVO {
@ApiModelProperty(value = "路口ID")
private String crossId;
@ApiModelProperty(value = "路口名称")
private String crossName;
@ApiModelProperty(value = "路口经纬度")
private String location;
}
......@@ -101,4 +101,10 @@
ORDER BY t_cross.id
</select>
<select id="selectAllArea" resultType="net.wanji.databus.po.BaseAreaInfoPO">
select <include refid="baseColumnList"/>
from t_base_area_info
where type = #{type}
</select>
</mapper>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment