diff --git a/src/main/java/com/zhgd/xmgl/base/entity/vo/SectorOneVo.java b/src/main/java/com/zhgd/xmgl/base/entity/vo/SectorOneVo.java index f645020fa..fac39c39e 100644 --- a/src/main/java/com/zhgd/xmgl/base/entity/vo/SectorOneVo.java +++ b/src/main/java/com/zhgd/xmgl/base/entity/vo/SectorOneVo.java @@ -23,7 +23,7 @@ public class SectorOneVo { private String percent; @ApiModelProperty("枚举类型和字典类型") @JsonInclude(JsonInclude.Include.NON_NULL) - private Integer enumType; + private String enumType; @ApiModelProperty(hidden = true) @JsonIgnore diff --git a/src/main/java/com/zhgd/xmgl/base/entity/vo/SectorVo.java b/src/main/java/com/zhgd/xmgl/base/entity/vo/SectorVo.java index 0bede6558..fe7f4bd97 100644 --- a/src/main/java/com/zhgd/xmgl/base/entity/vo/SectorVo.java +++ b/src/main/java/com/zhgd/xmgl/base/entity/vo/SectorVo.java @@ -1,6 +1,7 @@ package com.zhgd.xmgl.base.entity.vo; import cn.hutool.core.util.NumberUtil; +import cn.hutool.http.HttpUtil; import com.zhgd.xmgl.enums.BaseEnum; import com.zhgd.xmgl.modules.basicdata.entity.DictionaryItem; import io.swagger.annotations.ApiModelProperty; @@ -37,15 +38,15 @@ public class SectorVo { public static SectorVo getSectorVoByEnum(List list, BaseEnum[] enums) { SectorVo vo = new SectorVo(); List rtList = new ArrayList<>(); - Map map = list.stream().collect(Collectors.toMap(SectorOneVo::getEnumType, Function.identity())); + Map map = list.stream().collect(Collectors.toMap(SectorOneVo::getEnumType, Function.identity())); for (BaseEnum type : enums) { - SectorOneVo vo1 = map.get(type.getValue()); + SectorOneVo vo1 = map.get(String.valueOf(type.getValue())); if (vo1 == null) { vo1 = new SectorOneVo(); vo1.setCount("0"); } vo1.setName(type.getDesc()); - vo1.setEnumType(type.getValue()); + vo1.setEnumType(String.valueOf(type.getValue())); rtList.add(vo1); } vo.setData(rtList); @@ -65,15 +66,15 @@ public class SectorVo { public static SectorVo getSectorVoByDict(List list, List dictionaryItems, Boolean sorted) { SectorVo vo = new SectorVo(); List rtList = new ArrayList<>(); - Map map = list.stream().collect(Collectors.toMap(SectorOneVo::getEnumType, Function.identity())); + Map map = list.stream().collect(Collectors.toMap(SectorOneVo::getEnumType, Function.identity())); for (DictionaryItem type : dictionaryItems) { - SectorOneVo vo1 = map.get(Integer.valueOf(type.getData())); + SectorOneVo vo1 = map.get(type.getData()); if (vo1 == null) { vo1 = new SectorOneVo(); vo1.setCount("0"); } vo1.setName(type.getName()); - vo1.setEnumType(Integer.valueOf(type.getData())); + vo1.setEnumType(String.valueOf(type.getData())); rtList.add(vo1); } if (Objects.equals(sorted, true)) { @@ -112,7 +113,7 @@ public class SectorVo { if (d.equals(0.0)) { one.setPercent("0"); } else { - one.setPercent(NumberUtil.roundStr(Double.valueOf(one.getCount()) / d * 100, 2)); + one.setPercent(NumberUtil.roundStr(Double.parseDouble(one.getCount()) / d * 100, 2)); } } diff --git a/src/main/java/com/zhgd/xmgl/modules/highslope/controller/HighSlopeCurrentDataController.java b/src/main/java/com/zhgd/xmgl/modules/highslope/controller/HighSlopeCurrentDataController.java index 3b9283e64..40405a036 100644 --- a/src/main/java/com/zhgd/xmgl/modules/highslope/controller/HighSlopeCurrentDataController.java +++ b/src/main/java/com/zhgd/xmgl/modules/highslope/controller/HighSlopeCurrentDataController.java @@ -140,7 +140,7 @@ public class HighSlopeCurrentDataController { String measurePointNumber = currentDataListQO.getMeasurePointNumber(); IPage page = highSlopeCurrentDataService.selectHighSlopeCurrentDataList(currentDataListQO.getProjectSn() , measurePointNumber, sensorSn, currentDataListQO.getHighSlopeEngineeringToMonitorTypeId(), currentDataListQO.getStartTime() - , currentDataListQO.getEndTime(), currentDataListQO.getAlarmState(), currentDataListQO.getPageNo(), currentDataListQO.getPageSize()); + , currentDataListQO.getEndTime(), currentDataListQO.getAlarmState(), currentDataListQO.getPageNo(), currentDataListQO.getPageSize(), currentDataListQO.getHighSlopeMonitorTypeId()); currentDataListVO.setData(page); if (StringUtils.isNotBlank(sensorSn)) { List records = page.getRecords(); diff --git a/src/main/java/com/zhgd/xmgl/modules/highslope/controller/HighSlopeMeasurePointController.java b/src/main/java/com/zhgd/xmgl/modules/highslope/controller/HighSlopeMeasurePointController.java index 502306b5d..0c091a319 100644 --- a/src/main/java/com/zhgd/xmgl/modules/highslope/controller/HighSlopeMeasurePointController.java +++ b/src/main/java/com/zhgd/xmgl/modules/highslope/controller/HighSlopeMeasurePointController.java @@ -45,7 +45,8 @@ public class HighSlopeMeasurePointController { @ApiOperation(value = "高边坡配置-测点管理列表", notes = "高边坡配置-测点管理列表", httpMethod = "POST") @PostMapping(value = "/selectMeasurePointList") public Result> selectListByPageInfo(@RequestBody SelectMeasurePointListQO selectMeasurePointListQO) { - LambdaQueryWrapper wrapper = Wrappers.lambdaQuery().eq(HighSlopeMeasurePoint::getHighSlopeEngineeringToMonitorTypeId, selectMeasurePointListQO.getHighSlopeEngineeringToMonitorTypeId()); + LambdaQueryWrapper wrapper = Wrappers.lambdaQuery() + .eq(selectMeasurePointListQO.getHighSlopeEngineeringToMonitorTypeId() != null, HighSlopeMeasurePoint::getHighSlopeEngineeringToMonitorTypeId, selectMeasurePointListQO.getHighSlopeEngineeringToMonitorTypeId()); if (StringUtils.isNotBlank(selectMeasurePointListQO.getMeasurePointNumber())) { wrapper.like(HighSlopeMeasurePoint::getMeasurePointNumber, selectMeasurePointListQO.getMeasurePointNumber()); } diff --git a/src/main/java/com/zhgd/xmgl/modules/highslope/controller/HighSlopePlaneFigureController.java b/src/main/java/com/zhgd/xmgl/modules/highslope/controller/HighSlopePlaneFigureController.java index 6e3182c68..7bbf5425c 100644 --- a/src/main/java/com/zhgd/xmgl/modules/highslope/controller/HighSlopePlaneFigureController.java +++ b/src/main/java/com/zhgd/xmgl/modules/highslope/controller/HighSlopePlaneFigureController.java @@ -2,6 +2,7 @@ package com.zhgd.xmgl.modules.highslope.controller; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.toolkit.StringUtils; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.zhgd.jeecg.common.api.vo.Result; import com.zhgd.xmgl.modules.highslope.entity.HighSlopePlaneFigure; @@ -53,13 +54,14 @@ public class HighSlopePlaneFigureController { @ApiOperation(value = "列表查询高边坡-平面图配置信息", notes = "列表查询高边坡-平面图配置信息", httpMethod = "POST") @ApiImplicitParams({ @ApiImplicitParam(name = "projectSn", value = "项目SN", paramType = "body", required = true, dataType = "String"), - @ApiImplicitParam(name = "highSlopeEngineeringId", value = "高边坡-工程id", paramType = "body", required = true, dataType = "String"), + @ApiImplicitParam(name = "highSlopeEngineeringId", value = "高边坡-工程id", paramType = "body", required = false, dataType = "String"), }) @PostMapping(value = "/selectList") public Result> selectList(@ApiIgnore @RequestBody Map map) { QueryWrapper queryWrapper = new QueryWrapper<>(); + String highSlopeEngineeringId = MapUtils.getString(map, "highSlopeEngineeringId"); queryWrapper.lambda().eq(HighSlopePlaneFigure::getProjectSn, MapUtils.getString(map, "projectSn")) - .eq(HighSlopePlaneFigure::getHighSlopeEngineeringId, MapUtils.getString(map, "highSlopeEngineeringId")); + .eq(StringUtils.isNotBlank(highSlopeEngineeringId), HighSlopePlaneFigure::getHighSlopeEngineeringId, highSlopeEngineeringId); List list = highSlopePlaneFigureService.list(queryWrapper); for (HighSlopePlaneFigure highSlopePlaneFigure : list) { LambdaQueryWrapper wrapper = Wrappers.lambdaQuery() diff --git a/src/main/java/com/zhgd/xmgl/modules/highslope/entity/qo/CurrentDataListQO.java b/src/main/java/com/zhgd/xmgl/modules/highslope/entity/qo/CurrentDataListQO.java index 16e8ffcfd..d1fa45dd6 100644 --- a/src/main/java/com/zhgd/xmgl/modules/highslope/entity/qo/CurrentDataListQO.java +++ b/src/main/java/com/zhgd/xmgl/modules/highslope/entity/qo/CurrentDataListQO.java @@ -32,4 +32,9 @@ public class CurrentDataListQO extends PageQO { @ApiModelProperty(value = "报警状态 1.正常 2.超报警 3.超控制 4.变化速率报警", required = false) private Integer alarmState; + + @ApiModelProperty(value = "高边坡-监测类型id", required = false) + private Integer highSlopeMonitorTypeId; + + } diff --git a/src/main/java/com/zhgd/xmgl/modules/highslope/mapper/HighSlopeCurrentDataMapper.java b/src/main/java/com/zhgd/xmgl/modules/highslope/mapper/HighSlopeCurrentDataMapper.java index 5af30d85d..b0320bcf5 100644 --- a/src/main/java/com/zhgd/xmgl/modules/highslope/mapper/HighSlopeCurrentDataMapper.java +++ b/src/main/java/com/zhgd/xmgl/modules/highslope/mapper/HighSlopeCurrentDataMapper.java @@ -28,7 +28,7 @@ public interface HighSlopeCurrentDataMapper extends BaseMapper selectHighSlopeCurrentDataList(@Param("projectSn") String projectSn, @Param("measurePointNumber") String measurePointNumber, @Param("sensorSn") String sensorSn, @Param("highSlopeEngineeringToMonitorTypeId") Long highSlopeEngineeringToMonitorTypeId, @Param("startTime") String startTime, @Param("endTime") String endTime, @Param("alarmState") Integer alarmState, Page tPage); + IPage selectHighSlopeCurrentDataList(@Param("projectSn") String projectSn, @Param("measurePointNumber") String measurePointNumber, @Param("sensorSn") String sensorSn, @Param("highSlopeEngineeringToMonitorTypeId") Long highSlopeEngineeringToMonitorTypeId, @Param("startTime") String startTime, @Param("endTime") String endTime, @Param("alarmState") Integer alarmState, Page tPage, @Param("highSlopeMonitorTypeId") Integer highSlopeMonitorTypeId); List selectArticleOneDataList(Set sensorSnList); diff --git a/src/main/java/com/zhgd/xmgl/modules/highslope/mapper/xml/HighSlopeCurrentDataMapper.xml b/src/main/java/com/zhgd/xmgl/modules/highslope/mapper/xml/HighSlopeCurrentDataMapper.xml index c0f2e93b7..345d940b4 100644 --- a/src/main/java/com/zhgd/xmgl/modules/highslope/mapper/xml/HighSlopeCurrentDataMapper.xml +++ b/src/main/java/com/zhgd/xmgl/modules/highslope/mapper/xml/HighSlopeCurrentDataMapper.xml @@ -104,6 +104,7 @@ left join high_slope_measure_point demp on des.measure_point_number = demp.measure_point_number inner join high_slope_engineering dee on demp.high_slope_engineering_id = dee.id + join high_slope_engineering_to_monitor_type hsetmt on hsetmt.high_slope_engineering_id = dee.id left join high_slope_sensor_type dest on dest.id = des.high_slope_sensor_type_id @@ -127,6 +128,9 @@ and decd.alarm_state = #{alarmState} + + and hsetmt.id = #{highSlopeMonitorTypeId} + order by decd.receive_time desc diff --git a/src/main/java/com/zhgd/xmgl/modules/highslope/mapper/xml/HighSlopeEngineeringToMonitorTypeMapper.xml b/src/main/java/com/zhgd/xmgl/modules/highslope/mapper/xml/HighSlopeEngineeringToMonitorTypeMapper.xml index 56fe54adc..0ec2344b8 100644 --- a/src/main/java/com/zhgd/xmgl/modules/highslope/mapper/xml/HighSlopeEngineeringToMonitorTypeMapper.xml +++ b/src/main/java/com/zhgd/xmgl/modules/highslope/mapper/xml/HighSlopeEngineeringToMonitorTypeMapper.xml @@ -2,13 +2,19 @@ diff --git a/src/main/java/com/zhgd/xmgl/modules/highslope/service/IHighSlopeCurrentDataService.java b/src/main/java/com/zhgd/xmgl/modules/highslope/service/IHighSlopeCurrentDataService.java index c1b71ef6e..6b66d2cd6 100644 --- a/src/main/java/com/zhgd/xmgl/modules/highslope/service/IHighSlopeCurrentDataService.java +++ b/src/main/java/com/zhgd/xmgl/modules/highslope/service/IHighSlopeCurrentDataService.java @@ -33,7 +33,7 @@ public interface IHighSlopeCurrentDataService extends IService selectHighSlopeCurrentDataList(String projectSn, String measurePointNumber, String sensorSn, Long highSlopeEngineeringToMonitorTypeId, String startTime, String endTime, Integer alarmState, Integer pageNo, Integer pageSize); + IPage selectHighSlopeCurrentDataList(String projectSn, String measurePointNumber, String sensorSn, Long highSlopeEngineeringToMonitorTypeId, String startTime, String endTime, Integer alarmState, Integer pageNo, Integer pageSize, Integer highSlopeMonitorTypeId); /** * 获取所有传感器最后一条数据时间 diff --git a/src/main/java/com/zhgd/xmgl/modules/highslope/service/impl/HighSlopeCurrentDataServiceImpl.java b/src/main/java/com/zhgd/xmgl/modules/highslope/service/impl/HighSlopeCurrentDataServiceImpl.java index a82149c20..054fe29a3 100644 --- a/src/main/java/com/zhgd/xmgl/modules/highslope/service/impl/HighSlopeCurrentDataServiceImpl.java +++ b/src/main/java/com/zhgd/xmgl/modules/highslope/service/impl/HighSlopeCurrentDataServiceImpl.java @@ -94,8 +94,8 @@ public class HighSlopeCurrentDataServiceImpl extends ServiceImpl selectHighSlopeCurrentDataList(String projectSn, String measurePointNumber, String sensorSn, Long highSlopeEngineeringToMonitorTypeId, String startTime, String endTime, Integer alarmState, Integer pageNo, Integer pageSize) { - IPage page = highSlopeCurrentDataMapper.selectHighSlopeCurrentDataList(projectSn, measurePointNumber, sensorSn, highSlopeEngineeringToMonitorTypeId, startTime, endTime, alarmState, new Page<>(pageNo, pageSize)); + public IPage selectHighSlopeCurrentDataList(String projectSn, String measurePointNumber, String sensorSn, Long highSlopeEngineeringToMonitorTypeId, String startTime, String endTime, Integer alarmState, Integer pageNo, Integer pageSize, Integer highSlopeMonitorTypeId) { + IPage page = highSlopeCurrentDataMapper.selectHighSlopeCurrentDataList(projectSn, measurePointNumber, sensorSn, highSlopeEngineeringToMonitorTypeId, startTime, endTime, alarmState, new Page<>(pageNo, pageSize), highSlopeMonitorTypeId); for (HighSlopeCurrentData currentData : page.getRecords()) { currentData.setLastTimeData(NumberUtil.sub(Optional.ofNullable(currentData.getData()).orElse(0f), Optional.ofNullable(currentData.getDataThis()).orElse(0f)).floatValue()); } @@ -115,7 +115,7 @@ public class HighSlopeCurrentDataServiceImpl extends ServiceImpl list = highSlopeCurrentDataMapper.selectHighSlopeCurrentDataList(projectSn, measurePointNumber, sensorSn, highSlopeEngineeringToMonitorTypeId, startTime, endTime, alarmState, new Page<>().setSize(-1)).getRecords(); + List list = highSlopeCurrentDataMapper.selectHighSlopeCurrentDataList(projectSn, measurePointNumber, sensorSn, highSlopeEngineeringToMonitorTypeId, startTime, endTime, alarmState, new Page<>().setSize(-1), null).getRecords(); for (HighSlopeCurrentData currentData : list) { currentData.setLastTimeData(NumberUtil.sub(Optional.ofNullable(currentData.getData()).orElse(0f), Optional.ofNullable(currentData.getDataThis()).orElse(0f)).floatValue()); currentData.setAlarmStateStr(DataStatusEnum.getStatusNameById(currentData.getAlarmState()));