diff --git a/zc-business/src/main/java/com/zc/business/controller/DcRoadConditionInformationController.java b/zc-business/src/main/java/com/zc/business/controller/DcRoadConditionInformationController.java index ed1df8a1..83dbfdc4 100644 --- a/zc-business/src/main/java/com/zc/business/controller/DcRoadConditionInformationController.java +++ b/zc-business/src/main/java/com/zc/business/controller/DcRoadConditionInformationController.java @@ -1,6 +1,7 @@ package com.zc.business.controller; import java.util.List; +import java.util.Map; import javax.servlet.http.HttpServletResponse; import com.zc.business.domain.DcRoadConditionInformation; @@ -47,10 +48,10 @@ public class DcRoadConditionInformationController extends BaseController return getDataTable(list); } @GetMapping("/listTime") - public TableDataInfo listTime() + public AjaxResult listTime() { - List list = dcRoadConditionInformationService.selectlistTime(); - return getDataTable(list); + Map list = dcRoadConditionInformationService.selectlistTime(); + return AjaxResult.success(list); } /** diff --git a/zc-business/src/main/java/com/zc/business/controller/VideoController.java b/zc-business/src/main/java/com/zc/business/controller/VideoController.java index 609d51ab..4da078c9 100644 --- a/zc-business/src/main/java/com/zc/business/controller/VideoController.java +++ b/zc-business/src/main/java/com/zc/business/controller/VideoController.java @@ -442,7 +442,7 @@ public class VideoController extends BaseController { */ @ApiOperation("获取视频流信息") @GetMapping(value = "/externalVideoStreaming") - public JSONObject externalVideoStreaming(@ApiParam(value = "摄像头标识", name = "camId", required = true) String camId) throws HttpException, IOException { + public JSONObject externalVideoStreaming(@ApiParam(value = "摄像头标识", name = "camId", required = true) String camId) { JSONObject cameraInfo = JSONObject.parseObject(configService.selectConfigByKey("dc.cameraInfo")); JSONObject jsonResult = null; @@ -453,48 +453,56 @@ public class VideoController extends BaseController { requestParams.put("type", UniversalEnum.ONE.getValue()); requestParams.put("camId", camId); - Map header = new HashMap<>(); - - if (VideoController.TOKEN == null) { - getToken(); - } - - header.put("Authorization", TOKEN); - - Response response // 请求响应 - = okHttp - .headers(header) - .url(cameraInfo.getString("URL") + UniversalEnum.GET_VIDEO_STREAM_INFORMATION.getValue()) // 请求地址 - .data(requestParams) // 请求参数 - .post(); // 请求方法 + try { + Map header = new HashMap<>(); - if (response.body() != null) { - jsonResult = JSONObject.parseObject(response.body().string()); + if (VideoController.TOKEN == null) { + getToken(); + } - if (jsonResult.containsKey("code")) { - if (HttpStatus.SUCCESS == jsonResult.getInteger("code")) { - Map data = jsonResult.getJSONObject("data"); - String liveUrl = data.get("liveUrl").toString(); - liveUrl = configService.selectConfigByKey("dc.cameraUrl") + liveUrl.substring(UniversalEnum.SEVEN.getNumber()); - data.put("liveUrl",liveUrl); - jsonResult.put("data",data); - } else if (UNAUTHORIZED.equals(jsonResult.getInteger("code"))) { - getToken(); - okHttp.post(); - if (response.body() != null) { - jsonResult = JSONObject.parseObject(response.body().string()); - if (HttpStatus.SUCCESS == jsonResult.getInteger("code")) { - Map data = jsonResult.getJSONObject("data"); - String liveUrl = data.get("liveUrl").toString(); - liveUrl = configService.selectConfigByKey("cameraUrl") + liveUrl.substring(UniversalEnum.SEVEN.getNumber()); - data.put("liveUrl",liveUrl); - jsonResult.put("data",data); + header.put("Authorization", TOKEN); + + Response response // 请求响应 + = okHttp + .headers(header) + .url(cameraInfo.getString("URL") + UniversalEnum.GET_VIDEO_STREAM_INFORMATION.getValue()) // 请求地址 + .data(requestParams) // 请求参数 + .post(); // 请求方法 + + if (response.body() != null) { + jsonResult = JSONObject.parseObject(response.body().string()); + + if (jsonResult.containsKey("code")) { + if (HttpStatus.SUCCESS == jsonResult.getInteger("code")) { + Map data = jsonResult.getJSONObject("data"); + String liveUrl = data.get("liveUrl").toString(); + liveUrl = configService.selectConfigByKey("dc.cameraUrl") + liveUrl.substring(UniversalEnum.SEVEN.getNumber()); + data.put("liveUrl",liveUrl); + jsonResult.put("data",data); + } else if (UNAUTHORIZED.equals(jsonResult.getInteger("code"))) { + getToken(); + okHttp.post(); + if (response.body() != null) { + jsonResult = JSONObject.parseObject(response.body().string()); + if (HttpStatus.SUCCESS == jsonResult.getInteger("code")) { + Map data = jsonResult.getJSONObject("data"); + String liveUrl = data.get("liveUrl").toString(); + liveUrl = configService.selectConfigByKey("cameraUrl") + liveUrl.substring(UniversalEnum.SEVEN.getNumber()); + data.put("liveUrl",liveUrl); + jsonResult.put("data",data); + } } } } } + }catch (Exception e) { + jsonResult = new JSONObject(); + jsonResult.put("code",200); + jsonResult.put("data", new JSONObject()); + jsonResult.put("msg","摄像机连接失败"); } + return jsonResult; } diff --git a/zc-business/src/main/java/com/zc/business/domain/DcDevice.java b/zc-business/src/main/java/com/zc/business/domain/DcDevice.java index 668c6835..9976584f 100644 --- a/zc-business/src/main/java/com/zc/business/domain/DcDevice.java +++ b/zc-business/src/main/java/com/zc/business/domain/DcDevice.java @@ -62,13 +62,13 @@ public class DcDevice { @Excel(name = "所属网段") private String networkSegment; @ApiModelProperty("设备图片") - @Excel(name = "设备图片",cellType = ColumnType.IMAGE) + @Excel(name = "设备图片", cellType = ColumnType.IMAGE) private String deviceImg; @ApiModelProperty("安装日期") - @Excel(name = "安装日期",dateFormat = "yyyy-MM-dd") + @Excel(name = "安装日期", dateFormat = "yyyy-MM-dd") private Date installationDate; @ApiModelProperty("生产日期") - @Excel(name = "生产日期",dateFormat = "yyyy-MM-dd") + @Excel(name = "生产日期", dateFormat = "yyyy-MM-dd") private Date productionDate; @ApiModelProperty("使用年限") @Excel(name = "使用年限") @@ -98,10 +98,10 @@ public class DcDevice { @Excel(name = "范围桩号") private String stakeMarkRange; @ApiModelProperty("创建时间") - @Excel(name = "创建时间") + @Excel(name = "创建时间", dateFormat = "yyyy-MM-dd HH:mm:ss") private Date createTime; @ApiModelProperty("修改时间") - @Excel(name = "修改时间") + @Excel(name = "修改时间", dateFormat = "yyyy-MM-dd HH:mm:ss") private Date updateTime; @ApiModelProperty("子类型") @Excel(name = "子类型", readConverterExp = "1-1=高清网络枪型固定摄像机,1-2=高清网络球形摄像机,1-3=桥下高清网络球形摄像机,1-4=360°全景摄像机,1-5=180°全景摄像机,2-1=门架式可变信息标志,2-2=站前可变信息标志,2-3=雨棚可变信息标志,2-4=站前悬臂式可变信息标") @@ -117,14 +117,14 @@ public class DcDevice { private String manufacturer; - public Integer stakeMarkToInt() { return StakeMarkUtils.stakeMarkToInt(stakeMark); } - public String getRealType(){ - if(ObjectUtils.isEmpty(this.childType)){ + + public String getRealType() { + if (ObjectUtils.isEmpty(this.childType)) { return this.deviceType; - }else{ + } else { return this.childType; } } diff --git a/zc-business/src/main/java/com/zc/business/enums/UniversalEnum.java b/zc-business/src/main/java/com/zc/business/enums/UniversalEnum.java index a48e23ca..5c107781 100644 --- a/zc-business/src/main/java/com/zc/business/enums/UniversalEnum.java +++ b/zc-business/src/main/java/com/zc/business/enums/UniversalEnum.java @@ -1242,6 +1242,7 @@ public enum UniversalEnum { // 纯汉字时间格式 时分 PURE_CHINESE_CHARACTER_TIME_FORMAT_TIME_DIVISION(0, "HH时mm分"), + PURE_CHINESE_CHARACTER_TIME_FORMAT_TIME(0, "HH:mm"), // 时间格式 TIME_FORMAT_YEARS_MONTH_DAY(0, "yyyy-MM-dd"), diff --git a/zc-business/src/main/java/com/zc/business/enums/ValueConverter.java b/zc-business/src/main/java/com/zc/business/enums/ValueConverter.java index 82221876..59036ead 100644 --- a/zc-business/src/main/java/com/zc/business/enums/ValueConverter.java +++ b/zc-business/src/main/java/com/zc/business/enums/ValueConverter.java @@ -260,6 +260,7 @@ public class ValueConverter { eventLabel.put("dcEventConstruction.localRoadName","地方道路名称"); eventLabel.put("dcEventConstruction.endStakeMark","结束桩号"); eventLabel.put("dcEventConstruction.location","地点"); + eventLabel.put("dcEventConstruction.rampId","匝道"); eventLabel.put("dcEventServiceArea.exitsInlets","出入口"); eventLabel.put("dcEventServiceArea.facilityId","服务区"); eventLabel.put("dcEventServiceArea.disableFacility","停用设施"); diff --git a/zc-business/src/main/java/com/zc/business/interfaces/OperationLogAspect.java b/zc-business/src/main/java/com/zc/business/interfaces/OperationLogAspect.java index 19b1bdd8..e4d4d519 100644 --- a/zc-business/src/main/java/com/zc/business/interfaces/OperationLogAspect.java +++ b/zc-business/src/main/java/com/zc/business/interfaces/OperationLogAspect.java @@ -474,7 +474,11 @@ public class OperationLogAspect { } operLog.setOperName(loginUser.getUsername()); operLog.setOperLocation(loginUser.getLoginLocation()); - operLog.setOperType(UniversalEnum.TWO.getValue()); + if (devices.size() > UniversalEnum.ONE.getNumber()) { + operLog.setOperType(UniversalEnum.TWO.getValue()); + } else { + operLog.setOperType(UniversalEnum.ZERO.getValue()); + } } else { operLog.setOperName(UniversalEnum.SERVER.getValue()); operLog.setDeptName(UniversalEnum.SERVER.getValue()); diff --git a/zc-business/src/main/java/com/zc/business/service/IDcRoadConditionInformationService.java b/zc-business/src/main/java/com/zc/business/service/IDcRoadConditionInformationService.java index 7fccc8a8..b023fe9a 100644 --- a/zc-business/src/main/java/com/zc/business/service/IDcRoadConditionInformationService.java +++ b/zc-business/src/main/java/com/zc/business/service/IDcRoadConditionInformationService.java @@ -3,6 +3,7 @@ package com.zc.business.service; import com.zc.business.domain.DcRoadConditionInformation; import java.util.List; +import java.util.Map; /** * 路况信息Service接口 @@ -60,6 +61,6 @@ public interface IDcRoadConditionInformationService */ int deleteDcRoadConditionInformationById(Long id); - List selectlistTime(); + Map selectlistTime(); } diff --git a/zc-business/src/main/java/com/zc/business/service/impl/DcEventServiceImpl.java b/zc-business/src/main/java/com/zc/business/service/impl/DcEventServiceImpl.java index d072cb49..03759f0d 100644 --- a/zc-business/src/main/java/com/zc/business/service/impl/DcEventServiceImpl.java +++ b/zc-business/src/main/java/com/zc/business/service/impl/DcEventServiceImpl.java @@ -1861,6 +1861,23 @@ public class DcEventServiceImpl extends ServiceImpl impl result.setRight(UniversalEnum.INNER_EXIT_PLAZA.getValue()); } } + } else if ("dcEventServiceArea.disableFacility".equals(result.getRightPath())){ + if (UniversalEnum.ONE.getValue().equals(result.getRight())) { + result.setRight("卫生间"); + } else if (UniversalEnum.TWO.getValue().equals(result.getRight())) { + result.setRight("餐厅"); + } else if (UniversalEnum.THREE.getValue().equals(result.getRight())) { + result.setRight("停车场"); + } else if (UniversalEnum.FOUR.getValue().equals(result.getRight())) { + result.setRight("加油站"); + } else if (UniversalEnum.FIVE.getValue().equals(result.getRight())) { + result.setRight("充电桩"); + } + } else if ("dcEventConstruction.rampId".equals(result.getRightPath())){ + DcRamp dcRamp = dcRampMapper.selectDcRampById(Long.valueOf(result.getRight().toString())); + if (dcRamp != null){ + result.setRight(dcRamp.getRampName()); + } } String label = ValueConverter.eventLabel(result.getRightPath()); if (StringUtils.isNotEmpty(label)) { diff --git a/zc-business/src/main/java/com/zc/business/service/impl/DcRoadConditionInformationServiceImpl.java b/zc-business/src/main/java/com/zc/business/service/impl/DcRoadConditionInformationServiceImpl.java index 4d7f9ffd..2b7e9cae 100644 --- a/zc-business/src/main/java/com/zc/business/service/impl/DcRoadConditionInformationServiceImpl.java +++ b/zc-business/src/main/java/com/zc/business/service/impl/DcRoadConditionInformationServiceImpl.java @@ -1,8 +1,14 @@ package com.zc.business.service.impl; +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.LinkedHashMap; import java.util.List; +import java.util.Map; + import com.ruoyi.common.utils.DateUtils; import com.zc.business.domain.DcRoadConditionInformation; +import com.zc.business.enums.UniversalEnum; import com.zc.business.mapper.DcRoadConditionInformationMapper; import com.zc.business.service.IDcRoadConditionInformationService; import org.springframework.beans.factory.annotation.Autowired; @@ -96,7 +102,17 @@ public class DcRoadConditionInformationServiceImpl implements IDcRoadConditionIn } @Override - public List selectlistTime() { - return dcRoadConditionInformationMapper.selectlistTime(); + public Map selectlistTime() { + List dcRoadConditionInformations = dcRoadConditionInformationMapper.selectlistTime(); + if (! dcRoadConditionInformations.isEmpty()) { + Map map =new LinkedHashMap<>(); + for (DcRoadConditionInformation dcRoadConditionInformation : dcRoadConditionInformationMapper.selectlistTime()) { + SimpleDateFormat sdf = new SimpleDateFormat(UniversalEnum.PURE_CHINESE_CHARACTER_TIME_FORMAT_TIME.getValue()); + String formattedDate = sdf.format(dcRoadConditionInformation.getCreateTime()); + map.put(formattedDate, dcRoadConditionInformation.getOtherConfig()); + } + return map; + } + return new LinkedHashMap<>(); } } diff --git a/zc-business/src/main/resources/mapper/business/DcEventConstructionMapper.xml b/zc-business/src/main/resources/mapper/business/DcEventConstructionMapper.xml index b3812a37..aedffd2a 100644 --- a/zc-business/src/main/resources/mapper/business/DcEventConstructionMapper.xml +++ b/zc-business/src/main/resources/mapper/business/DcEventConstructionMapper.xml @@ -20,6 +20,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + @@ -30,11 +31,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - select construction_method,location,local_road_name,end_stake_mark,id, control_mode, location_type, special_place_description, special_construction, other_construction_name, construction_measurement, facility_id, exits_inlets, lane_occupancy, traffic_condition from dc_event_construction + select construction_method,location,local_road_name,end_stake_mark,id, control_mode, location_type, special_place_description, special_construction, other_construction_name, construction_measurement, facility_id, exits_inlets, lane_occupancy, traffic_condition,ramp_id from dc_event_construction SELECT dc_event_construction.id as id, + dc_event_construction.ramp_id as ramp_id, dc_event_construction.construction_method as construction_method, dc_event_construction.control_mode as control_mode, dc_event_construction.location_type as location_type, @@ -49,6 +51,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" dc_event_construction.local_road_name as local_road_name, dc_event_construction.end_stake_mark as end_stake_mark, dc_event_construction.location as location, + dc_event_construction.ramp_id as ramp_id, dc_facility.other_config as other_config, dc_facility.remark as remark, dc_facility.stake_mark as stake_mark, @@ -98,6 +101,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" local_road_name, location, construction_method, + ramp_id, #{id}, @@ -115,6 +119,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" #{localRoadName}, #{location}, #{constructionMethod}, + #{rampId}, @@ -135,6 +140,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" local_road_name = #{localRoadName}, location = #{location}, construction_method = #{constructionMethod}, + ramp_id = #{rampId}, where id = #{id} diff --git a/zc-business/src/main/resources/mapper/business/DcRoadConditionInformationMapper.xml b/zc-business/src/main/resources/mapper/business/DcRoadConditionInformationMapper.xml index a1f67076..d1800b11 100644 --- a/zc-business/src/main/resources/mapper/business/DcRoadConditionInformationMapper.xml +++ b/zc-business/src/main/resources/mapper/business/DcRoadConditionInformationMapper.xml @@ -24,10 +24,15 @@