卸料平台大屏

This commit is contained in:
guo 2024-01-25 11:43:46 +08:00
parent e289cf02cb
commit c6ee755132
15 changed files with 337 additions and 20 deletions

View File

@ -1,6 +1,7 @@
package com.zhgd.xmgl.base.entity.vo;
import com.fasterxml.jackson.annotation.JsonInclude;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
@ -18,6 +19,7 @@ import java.util.stream.Collectors;
@AllArgsConstructor
public class TrendVo {
@JsonInclude(JsonInclude.Include.NON_NULL)
@ApiModelProperty("其中一条折线或圆柱的名称")
private String name;
private List<TrendOneVo> oneTrendList;
@JsonInclude(JsonInclude.Include.NON_NULL)

View File

@ -3,6 +3,9 @@ package com.zhgd.xmgl.modules.discharging.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.zhgd.jeecg.common.api.vo.Result;
import com.zhgd.jeecg.common.mybatis.EntityMap;
import com.zhgd.xmgl.base.entity.vo.SectorVo;
import com.zhgd.xmgl.modules.discharging.entity.vo.CountAlarmLevelVo;
import com.zhgd.xmgl.modules.discharging.entity.vo.CountDischargingPlatformCurrentDataVo;
import com.zhgd.xmgl.modules.discharging.service.IDischargingPlatformAlarmService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
@ -11,6 +14,7 @@ import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import springfox.documentation.annotations.ApiIgnore;
import java.util.HashMap;
import java.util.List;
@ -88,4 +92,24 @@ public class DischargingPlatformAlarmController {
}
@ApiOperation(value = "统计报警类型", notes = "统计报警类型", httpMethod = "POST")
@ApiImplicitParams({
@ApiImplicitParam(name = "projectSn", value = "项目sn", paramType = "body", required = true, dataType = "String"),
@ApiImplicitParam(name = "devSn", value = "塔机设备编号", paramType = "body", required = false, dataType = "String"),
})
@PostMapping(value = "/countAlarmType")
public Result<SectorVo> countAlarmType(@ApiIgnore @RequestBody HashMap<String, Object> paramMap) {
return Result.success(dischargingPlatformAlarmService.countAlarmType(paramMap));
}
@ApiOperation(value = "统计报警等级(实时告警)", notes = "统计报警等级(实时告警)", httpMethod = "POST")
@ApiImplicitParams({
@ApiImplicitParam(name = "projectSn", value = "项目sn", paramType = "body", required = true, dataType = "String"),
@ApiImplicitParam(name = "devSn", value = "塔机设备编号", paramType = "body", required = false, dataType = "String"),
})
@PostMapping(value = "/countAlarmLevel")
public Result<CountAlarmLevelVo> countAlarmLevel(@ApiIgnore @RequestBody HashMap<String, Object> paramMap) {
return Result.success(dischargingPlatformAlarmService.countAlarmLevel(paramMap));
}
}

View File

@ -4,9 +4,11 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.gexin.fastjson.JSON;
import com.zhgd.jeecg.common.api.vo.Result;
import com.zhgd.jeecg.common.mybatis.EntityMap;
import com.zhgd.xmgl.base.entity.vo.TrendOneVo;
import com.zhgd.xmgl.base.entity.vo.TrendVo;
import com.zhgd.xmgl.modules.discharging.entity.DischargingPlatformCurrentData;
import com.zhgd.xmgl.modules.discharging.entity.vo.CountDischargingPlatformCurrentDataVo;
import com.zhgd.xmgl.modules.discharging.service.IDischargingPlatformCurrentDataService;
import com.zhgd.xmgl.modules.taskprogress.entity.TaskProgressMaterialRel;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
@ -112,18 +114,49 @@ public class DischargingPlatformCurrentDataController {
@ApiOperation(value = "查询卸料平台最新一条实时数据", notes = "查询卸料平台最新一条实时数据", httpMethod = "POST")
@ApiImplicitParam(name = "devSn", value = "设备编号", paramType = "body", required = true, dataType = "Integer")
@ApiImplicitParam(name = "devSn", value = "设备编号", paramType = "body", required = true, dataType = "String")
@PostMapping(value = "/getNewestDischargingPlatformCurrentData")
public Result<DischargingPlatformCurrentData> getNewestDischargingPlatformCurrentData(@RequestBody Map<String, Object> map) {
return Result.success(dischargingPlatformCurrentDataService.getNewestDischargingPlatformCurrentData(map));
}
@ApiOperation(value = "查询卸料平台当日实时数据", notes = "查询卸料平台当日实时数据", httpMethod = "POST")
@ApiImplicitParam(name = "devSn", value = "塔机设备编号", paramType = "body", required = true, dataType = "Integer")
@ApiOperation(value = "查询卸料平台当日实时数据列表", notes = "查询卸料平台当日实时数据列表", httpMethod = "POST")
@ApiImplicitParam(name = "devSn", value = "塔机设备编号", paramType = "body", required = true, dataType = "String")
@PostMapping(value = "/getTodayDischargingPlatformCurrentDataList")
public Result<List<DischargingPlatformCurrentData>> getTodayDischargingPlatformCurrentDataList(@RequestBody Map<String, Object> map) {
return Result.success(dischargingPlatformCurrentDataService.getTodayDischargingPlatformCurrentDataList(map));
}
@ApiOperation(value = "统计载重比趋势(载重比分析)", notes = "统计载重比趋势(载重比分析)", httpMethod = "POST")
@ApiImplicitParams({
@ApiImplicitParam(name = "projectSn", value = "项目sn", paramType = "body", required = true, dataType = "String"),
@ApiImplicitParam(name = "devSn", value = "塔机设备编号", paramType = "body", required = false, dataType = "String"),
@ApiImplicitParam(name = "date", value = "日期", paramType = "body", required = false, dataType = "String"),
})
@PostMapping(value = "/countLoadRatioTrend")
public Result<List<TrendOneVo>> countLoadRatioTrend(@ApiIgnore @RequestBody HashMap<String, Object> paramMap) {
return Result.success(dischargingPlatformCurrentDataService.countLoadRatioTrend(paramMap));
}
@ApiOperation(value = "统计卸料平台", notes = "统计卸料平台", httpMethod = "POST")
@ApiImplicitParams({
@ApiImplicitParam(name = "projectSn", value = "项目sn", paramType = "body", required = true, dataType = "String"),
@ApiImplicitParam(name = "devSn", value = "塔机设备编号", paramType = "body", required = false, dataType = "String"),
})
@PostMapping(value = "/countDischargingPlatformCurrentData")
public Result<CountDischargingPlatformCurrentDataVo> countDischargingPlatformCurrentData(@ApiIgnore @RequestBody HashMap<String, Object> paramMap) {
return Result.success(dischargingPlatformCurrentDataService.countDischargingPlatformCurrentData(paramMap));
}
@ApiOperation(value = "统计最大、小载重趋势(历史载重)", notes = "统计最大、小载重趋势(历史载重)", httpMethod = "POST")
@ApiImplicitParams({
@ApiImplicitParam(name = "projectSn", value = "项目sn", paramType = "body", required = true, dataType = "String"),
@ApiImplicitParam(name = "devSn", value = "塔机设备编号", paramType = "body", required = false, dataType = "String"),
@ApiImplicitParam(name = "type", value = "1、7日2、30日3、近1年", paramType = "body", required = true, dataType = "Integer"),
})
@PostMapping(value = "/countLoad")
public Result<List<TrendVo>> countLoad(@ApiIgnore @RequestBody HashMap<String, Object> paramMap) {
return Result.success(dischargingPlatformCurrentDataService.countLoad(paramMap));
}
}

View File

@ -23,7 +23,7 @@ import io.swagger.annotations.ApiModelProperty;
@ApiModel(value="DischargingPlatformCurrentData实体类",description="DischargingPlatformCurrentData")
public class DischargingPlatformCurrentData implements Serializable {
private static final long serialVersionUID = 1L;
/**id*/
@TableId(type = IdType.ASSIGN_ID)
@ApiModelProperty(value="id")
@ -59,14 +59,20 @@ public class DischargingPlatformCurrentData implements Serializable {
@TableField(exist = false)
@ApiModelProperty(value="是否有报警0否1是")
@ApiModelProperty(value = "是否有报警0否1是")
private java.lang.Integer isAlarm;
@TableField(exist = false)
@ApiModelProperty(value="报警类型")
private java.lang.String alarmType ;
@ApiModelProperty(value = "报警类型")
private java.lang.String alarmType;
@TableField(exist = false)
@ApiModelProperty(value="报警等级1 紧急告警2 重要告警3 次要告警4 提示告警")
private java.lang.Integer alarmLevel ;
@ApiModelProperty(value = "报警等级1 紧急告警2 重要告警3 次要告警4 提示告警")
private java.lang.Integer alarmLevel;
@TableField(exist = false)
@ApiModelProperty(value = "载重比%")
private java.lang.Double loadRatio;
}

View File

@ -0,0 +1,14 @@
package com.zhgd.xmgl.modules.discharging.entity.vo;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
public class CountAlarmLevelVo {
@ApiModelProperty(value = "严重数量")
private java.lang.Integer seriousNum;
@ApiModelProperty(value = "较重数量")
private java.lang.Integer heavierNum;
@ApiModelProperty(value = "一般数量")
private java.lang.Integer generallyNum;
}

View File

@ -0,0 +1,12 @@
package com.zhgd.xmgl.modules.discharging.entity.vo;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
public class CountDischargingPlatformCurrentDataVo {
@ApiModelProperty(value = "正常数量")
private java.lang.Integer normalNum;
@ApiModelProperty(value = "告警数量")
private java.lang.Integer alarmNum;
}

View File

@ -4,7 +4,11 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.zhgd.jeecg.common.mybatis.EntityMap;
import com.zhgd.xmgl.base.entity.vo.SectorOneVo;
import com.zhgd.xmgl.base.entity.vo.SectorVo;
import com.zhgd.xmgl.modules.discharging.entity.DischargingPlatformAlarm;
import com.zhgd.xmgl.modules.discharging.entity.vo.CountAlarmLevelVo;
import com.zhgd.xmgl.modules.discharging.entity.vo.CountDischargingPlatformCurrentDataVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@ -30,4 +34,10 @@ public interface DischargingPlatformAlarmMapper extends BaseMapper<DischargingPl
List<EntityMap> getAlarmCycleTrendGraph(Map<String, Object> map);
List<EntityMap> queryAlarmTypeRadarChart(Map<String, Object> map);
CountDischargingPlatformCurrentDataVo countDischargingPlatformAlarm(HashMap<String, Object> paramMap);
List<SectorOneVo> countAlarmType(HashMap<String, Object> paramMap);
CountAlarmLevelVo countAlarmLevel(HashMap<String, Object> paramMap);
}

View File

@ -1,10 +1,14 @@
package com.zhgd.xmgl.modules.discharging.mapper;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.zhgd.jeecg.common.mybatis.EntityMap;
import com.zhgd.xmgl.base.entity.vo.TrendOneVo;
import com.zhgd.xmgl.modules.discharging.entity.vo.CountDischargingPlatformCurrentDataVo;
import org.apache.ibatis.annotations.Mapper;
import com.zhgd.xmgl.modules.discharging.entity.DischargingPlatformCurrentData;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
@ -23,5 +27,11 @@ public interface DischargingPlatformCurrentDataMapper extends BaseMapper<Dischar
List<DischargingPlatformCurrentData> getTodayDischargingPlatformCurrentDataList(Map<String, Object> map);
List<EntityMap> queryDischargingPlatformCurrentDataPageList(Page<EntityMap> page, @Param("param")Map<String, Object> map);
List<EntityMap> queryDischargingPlatformCurrentDataPageList(Page<EntityMap> page, @Param("param") Map<String, Object> map);
ArrayList<TrendOneVo> countLoadRatioTrend(HashMap<String, Object> paramMap);
CountDischargingPlatformCurrentDataVo countDischargingPlatformCurrentData(HashMap<String, Object> paramMap);
List<TrendOneVo> countLoad(HashMap<String, Object> paramMap);
}

View File

@ -90,4 +90,44 @@
and dpa.add_time >= DATE_SUB(NOW(),INTERVAL 30 day)
GROUP BY dpa.alarm_type
</select>
<select id="countDischargingPlatformAlarm"
resultType="com.zhgd.xmgl.modules.discharging.entity.vo.CountDischargingPlatformCurrentDataVo">
select count(*) alarmNum
from discharging_platform_alarm
where 1=1
<if test="projectSn != null and projectSn != ''">
and project_sn = #{projectSn}
</if>
<if test="devSn != null and devSn != ''">
and dev_sn = #{devSn}
</if>
</select>
<select id="countAlarmType" resultType="com.zhgd.xmgl.base.entity.vo.SectorOneVo">
select alarm_type name,count(*) count
from discharging_platform_alarm
where 1=1
<if test="projectSn != null and projectSn != ''">
and project_sn = #{projectSn}
</if>
<if test="devSn != null and devSn != ''">
and dev_sn = #{devSn}
</if>
group by alarm_type
</select>
<select id="countAlarmLevel" resultType="com.zhgd.xmgl.modules.discharging.entity.vo.CountAlarmLevelVo">
select
ifnull(sum(if(alarm_level=1,1,0)),0) seriousNum,
ifnull(sum(if(alarm_level=2 or alarm_level=3,1,0)),0) heavierNum,
ifnull(sum(if(alarm_level=4,1,0)),0) generallyNum
from discharging_platform_alarm
where 1=1
<if test="projectSn != null and projectSn != ''">
and project_sn = #{projectSn}
</if>
<if test="devSn != null and devSn != ''">
and dev_sn = #{devSn}
</if>
</select>
</mapper>

View File

@ -4,10 +4,11 @@
<select id="getNewestDischargingPlatformCurrentData"
resultType="com.zhgd.xmgl.modules.discharging.entity.DischargingPlatformCurrentData" parameterType="map">
SELECT a.*
SELECT a.*,ifnull(round(a.loading/dpd.max_load*100,2),0) loadRatio
from discharging_platform_current_data a
WHERE dev_sn=#{devSn}
ORDER BY recive_time DESC
join discharging_platform_dev dpd on a.dev_sn = dpd.dev_sn and a.project_sn = dpd.project_sn
WHERE a.dev_sn=#{devSn}
ORDER BY a.recive_time DESC
LIMIT 1
</select>
<select id="getTodayDischargingPlatformCurrentDataList"
@ -28,13 +29,105 @@
<if test="param.devSn!=null and param.devSn!=''">
and b.dev_sn=#{param.devSn}
</if>
<if test="param.startTime!=null and param.startTime!=''">
<if test="param.startTime != null and param.startTime != ''">
AND b.recive_time &gt;=CONCAT(DATE_FORMAT(#{param.startTime},'%Y-%m-%d'),' 00:00:00')
</if>
<if test="param.endTime!=null and param.endTime!=''">
<if test="param.endTime != null and param.endTime != ''">
AND b.recive_time &lt;=CONCAT(DATE_FORMAT(#{param.endTime},'%Y-%m-%d'),' 23:59:59')
</if>
order by b.recive_time desc
</select>
<select id="countLoadRatioTrend" resultType="com.zhgd.xmgl.base.entity.vo.TrendOneVo">
select date_format(a.recive_time, '%Y-%m-%d %H:00') x,
ifnull(round(avg(a.loading / dpd.max_load * 100), 2), 0) y
from discharging_platform_current_data a
join discharging_platform_dev dpd on a.dev_sn = dpd.dev_sn and a.project_sn = dpd.project_sn
where a.project_sn = #{projectSn}
<if test="devSn != null and devSn != ''">
and a.dev_sn = #{devSn}
</if>
<choose>
<when test="date != null and date != ''">
and recive_time >= DATE_FORMAT(#{date}, '%Y-%m-%d')
and recive_time <![CDATA[<=]]> if(LENGTH(#{date}) = 10, CONCAT(DATE_FORMAT(#{date}, '%Y-%m-%d'),
'23:59:59'), #{date})
</when>
<otherwise>
and recive_time >= current_date
</otherwise>
</choose>
group by x
</select>
<select id="countDischargingPlatformCurrentData"
resultType="com.zhgd.xmgl.modules.discharging.entity.vo.CountDischargingPlatformCurrentDataVo">
select count(*) normalNum
from discharging_platform_current_data
where 1=1
<if test="projectSn != null and projectSn != ''">
and project_sn = #{projectSn}
</if>
<if test="devSn != null and devSn != ''">
and dev_sn = #{devSn}
</if>
</select>
<select id="countLoad" resultType="com.zhgd.xmgl.base.entity.vo.TrendOneVo">
select
<if test="type == '1'.toString()">
date_format(recive_time,'%Y-%m-%d') x,
</if>
<if test="type == '2'.toString()">
date_format(recive_time,'%Y-%m-%d') x,
</if>
<if test="type == '3'.toString()">
date_format(recive_time,'%Y-%m') x,
</if>
ifnull(max(loading),0) y ,
1 sn
from discharging_platform_current_data
where project_sn=#{projectSn}
<if test="devSn != null and devSn != ''">
and dev_sn = #{devSn}
</if>
<if test="type == '1'.toString()">
and recive_time > date_sub(recive_time,interval 6 day)
</if>
<if test="type == '2'.toString()">
and recive_time > date_sub(recive_time,interval 29 day)
</if>
<if test="type == '3'.toString()">
and recive_time > date_sub(recive_time,interval 364 day)
</if>
group by x
union all
select
<if test="type == '1'.toString()">
date_format(recive_time,'%Y-%m-%d') x,
</if>
<if test="type == '2'.toString()">
date_format(recive_time,'%Y-%m-%d') x,
</if>
<if test="type == '3'.toString()">
date_format(recive_time,'%Y-%m') x,
</if>
ifnull(min(loading),0) y ,
2 sn
from discharging_platform_current_data
where project_sn=#{projectSn}
<if test="devSn != null and devSn != ''">
and dev_sn = #{devSn}
</if>
<if test="type == '1'.toString()">
and recive_time > date_sub(recive_time,interval 6 day)
</if>
<if test="type == '2'.toString()">
and recive_time > date_sub(recive_time,interval 29 day)
</if>
<if test="type == '3'.toString()">
and recive_time > date_sub(recive_time,interval 364 day)
</if>
group by x
</select>
</mapper>

View File

@ -2,9 +2,11 @@ package com.zhgd.xmgl.modules.discharging.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.zhgd.jeecg.common.mybatis.EntityMap;
import com.zhgd.xmgl.base.entity.vo.SectorVo;
import com.zhgd.xmgl.modules.discharging.entity.DischargingPlatformAlarm;
import com.baomidou.mybatisplus.extension.service.IService;
import com.zhgd.xmgl.modules.discharging.entity.DischargingPlatformDev;
import com.zhgd.xmgl.modules.discharging.entity.vo.CountAlarmLevelVo;
import java.util.HashMap;
import java.util.List;
@ -25,4 +27,8 @@ public interface IDischargingPlatformAlarmService extends IService<DischargingPl
List<EntityMap> getAlarmCycleTrendGraph(Map<String, Object> map);
List<EntityMap> queryAlarmTypeRadarChart(Map<String, Object> map);
SectorVo countAlarmType(HashMap<String, Object> paramMap);
CountAlarmLevelVo countAlarmLevel(HashMap<String, Object> paramMap);
}

View File

@ -2,9 +2,13 @@ package com.zhgd.xmgl.modules.discharging.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.zhgd.jeecg.common.mybatis.EntityMap;
import com.zhgd.xmgl.base.entity.vo.TrendOneVo;
import com.zhgd.xmgl.base.entity.vo.TrendVo;
import com.zhgd.xmgl.modules.discharging.entity.DischargingPlatformCurrentData;
import com.baomidou.mybatisplus.extension.service.IService;
import com.zhgd.xmgl.modules.discharging.entity.vo.CountDischargingPlatformCurrentDataVo;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@ -23,4 +27,10 @@ public interface IDischargingPlatformCurrentDataService extends IService<Dischar
List<DischargingPlatformCurrentData> getTodayDischargingPlatformCurrentDataList(Map<String, Object> map);
IPage<EntityMap> queryDischargingPlatformCurrentDataPageList(Map<String, Object> map);
List<TrendOneVo> countLoadRatioTrend(HashMap<String, Object> paramMap);
CountDischargingPlatformCurrentDataVo countDischargingPlatformCurrentData(HashMap<String, Object> paramMap);
List<TrendVo> countLoad(HashMap<String, Object> paramMap);
}

View File

@ -5,10 +5,13 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zhgd.jeecg.common.mybatis.EntityMap;
import com.zhgd.xmgl.base.entity.vo.SectorOneVo;
import com.zhgd.xmgl.base.entity.vo.SectorVo;
import com.zhgd.xmgl.modules.basicdata.entity.Notice;
import com.zhgd.xmgl.modules.basicdata.service.INoticeService;
import com.zhgd.xmgl.modules.discharging.entity.DischargingPlatformAlarm;
import com.zhgd.xmgl.modules.discharging.entity.DischargingPlatformDev;
import com.zhgd.xmgl.modules.discharging.entity.vo.CountAlarmLevelVo;
import com.zhgd.xmgl.modules.discharging.mapper.DischargingPlatformAlarmMapper;
import com.zhgd.xmgl.modules.discharging.service.IDischargingPlatformAlarmService;
import org.apache.commons.collections.MapUtils;
@ -153,6 +156,16 @@ public class DischargingPlatformAlarmServiceImpl extends ServiceImpl<Discharging
return p;
}
@Override
public SectorVo countAlarmType(HashMap<String, Object> paramMap) {
return SectorVo.getSectorVo(baseMapper.countAlarmType(paramMap));
}
@Override
public CountAlarmLevelVo countAlarmLevel(HashMap<String, Object> paramMap) {
return baseMapper.countAlarmLevel(paramMap);
}
/**
* 补全数据
*

View File

@ -8,6 +8,8 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zhgd.jeecg.common.execption.OpenAlertException;
import com.zhgd.jeecg.common.mybatis.EntityMap;
import com.zhgd.xmgl.base.entity.vo.TrendOneVo;
import com.zhgd.xmgl.base.entity.vo.TrendVo;
import com.zhgd.xmgl.modules.basicdata.entity.Notice;
import com.zhgd.xmgl.modules.basicdata.entity.SystemUser;
import com.zhgd.xmgl.modules.basicdata.mapper.NoticeMapper;
@ -15,6 +17,8 @@ import com.zhgd.xmgl.modules.basicdata.mapper.SystemUserMapper;
import com.zhgd.xmgl.modules.discharging.entity.DischargingPlatformAlarm;
import com.zhgd.xmgl.modules.discharging.entity.DischargingPlatformCurrentData;
import com.zhgd.xmgl.modules.discharging.entity.DischargingPlatformDev;
import com.zhgd.xmgl.modules.discharging.entity.vo.CountDischargingPlatformCurrentDataVo;
import com.zhgd.xmgl.modules.discharging.mapper.DischargingPlatformAlarmMapper;
import com.zhgd.xmgl.modules.discharging.mapper.DischargingPlatformCurrentDataMapper;
import com.zhgd.xmgl.modules.discharging.mapper.DischargingPlatformDevMapper;
import com.zhgd.xmgl.modules.discharging.service.IDischargingPlatformAlarmService;
@ -22,15 +26,13 @@ import com.zhgd.xmgl.modules.discharging.service.IDischargingPlatformCurrentData
import com.zhgd.xmgl.util.DateUtils;
import com.zhgd.xmgl.util.MessageUtil;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.collections.MapUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.*;
/**
* @Description: 卸料平台-实时数据
@ -51,6 +53,8 @@ public class DischargingPlatformCurrentDataServiceImpl extends ServiceImpl<Disch
private DischargingPlatformDevMapper dischargingPlatformDevMapper;
@Autowired
private IDischargingPlatformAlarmService dischargingPlatformAlarmService;
@Autowired
private DischargingPlatformAlarmMapper dischargingPlatformAlarmMapper;
@Override
public void saveDischargingPlatformCurrentData(DischargingPlatformCurrentData dischargingPlatformCurrentData) {
@ -133,4 +137,43 @@ public class DischargingPlatformCurrentDataServiceImpl extends ServiceImpl<Disch
List<EntityMap> list = dischargingPlatformCurrentDataMapper.queryDischargingPlatformCurrentDataPageList(page, map);
return page.setRecords(list);
}
@Override
public List<TrendOneVo> countLoadRatioTrend(HashMap<String, Object> paramMap) {
ArrayList<TrendOneVo> list = baseMapper.countLoadRatioTrend(paramMap);
return TrendOneVo.fillTrendVos(list, DateUtils.getDateTimeStrList(100, "yyyy-MM-dd HH:00"), "HH:00");
}
@Override
public CountDischargingPlatformCurrentDataVo countDischargingPlatformCurrentData(HashMap<String, Object> paramMap) {
CountDischargingPlatformCurrentDataVo vo = baseMapper.countDischargingPlatformCurrentData(paramMap);
CountDischargingPlatformCurrentDataVo vo1 = dischargingPlatformAlarmMapper.countDischargingPlatformAlarm(paramMap);
vo.setAlarmNum(vo1.getAlarmNum());
return vo;
}
@Override
public List<TrendVo> countLoad(HashMap<String, Object> paramMap) {
Integer type = MapUtils.getInteger(paramMap, "type");
String format = null;
List<String> dateTimeStrList = null;
if (Objects.equals(type, 1)) {
format = "yyyy-MM-dd";
dateTimeStrList = DateUtils.getDateTimeStrList(60, "yyyy-MM-dd");
} else if (Objects.equals(type, 2)) {
format = "yyyy-MM-dd";
dateTimeStrList = DateUtils.getDateTimeStrList(80, "yyyy-MM-dd");
} else if (Objects.equals(type, 3)) {
format = "yyyy-MM";
dateTimeStrList = DateUtils.getDateTimeStrList(93, "yyyy-MM");
} else {
return null;
}
List<TrendOneVo> list = baseMapper.countLoad(paramMap);
List<TrendVo> l = new ArrayList<>();
l.add(new TrendVo("最高值", "1"));
l.add(new TrendVo("最低值", "2"));
return TrendVo.getTrendVos(l, list, dateTimeStrList, format);
}
}

View File

@ -107,6 +107,7 @@ public class HangBasketAlarmDataController {
UserInfo userInfo = SecurityUtils.getUser();
hangBasketAlarmData.setOperateId(userInfo.getUserId());
hangBasketAlarmData.setOperateTime(new Date());
hangBasketAlarmData.setOperateName(userInfo.getRealName());
}
hangBasketAlarmDataService.updateById(hangBasketAlarmData);
return Result.ok();