bug修复
This commit is contained in:
parent
7bb923bdb0
commit
2fcc12604d
@ -259,14 +259,17 @@ public class GantryCraneCurrentData implements Serializable {
|
|||||||
* 当前工作天数 天
|
* 当前工作天数 天
|
||||||
*/
|
*/
|
||||||
@Excel(name = "当前工作天数 天", width = 15)
|
@Excel(name = "当前工作天数 天", width = 15)
|
||||||
@ApiModelProperty(value = "当前工作天数 天")
|
@ApiModelProperty(value = "当前工作天数 天")
|
||||||
private java.lang.String powerOnDay;
|
private java.lang.String powerOnDay;
|
||||||
/**
|
/**
|
||||||
* 当前工作时分秒 HH:MM:SS
|
* 当前工作时分秒 HH:MM:SS
|
||||||
*/
|
*/
|
||||||
@Excel(name = "当前工作时分秒 HH:MM:SS", width = 15)
|
@Excel(name = "当前工作时分秒 HH:MM:SS", width = 15)
|
||||||
@ApiModelProperty(value = "当前工作时分秒 HH:MM:SS")
|
@ApiModelProperty(value = "当前工作时分秒 HH:MM:SS")
|
||||||
private java.lang.String powerOnTimes;
|
private java.lang.String powerOnTimes;
|
||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
private java.lang.String fieldAcquisitionUrl;
|
private java.lang.String fieldAcquisitionUrl;
|
||||||
|
@TableField(exist = false)
|
||||||
|
@ApiModelProperty(value = "风速等级")
|
||||||
|
private java.lang.String windSpeedLevel;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -6,12 +6,12 @@ import org.checkerframework.checker.units.qual.C;
|
|||||||
|
|
||||||
@Data
|
@Data
|
||||||
public class CountGantryCraneWorkCycleVo {
|
public class CountGantryCraneWorkCycleVo {
|
||||||
//@ApiModelProperty("工作时长(小时)")
|
@ApiModelProperty("工作时长(小时)")
|
||||||
//@ApiModelProperty("主钩循环(次)")
|
private Double workTimeSum;
|
||||||
//@ApiModelProperty("吊钩载重(吨)")
|
@ApiModelProperty("主钩循环(次)")
|
||||||
//@ApiModelProperty("副钩循环(次)")
|
private Double mainHookCount;
|
||||||
//private String workTimeCount;
|
@ApiModelProperty("吊钩载重(吨)")
|
||||||
//private String 主钩循环;
|
private Double hookWeightSum;
|
||||||
//private String 吊钩载重;
|
@ApiModelProperty("副钩循环(次)")
|
||||||
//private String 副钩循环;
|
private Double auxiliaryHookCount;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -44,7 +44,13 @@
|
|||||||
|
|
||||||
<select id="countGantryCraneWorkCycle"
|
<select id="countGantryCraneWorkCycle"
|
||||||
resultType="com.zhgd.xmgl.modules.bigdevice.entity.vo.CountGantryCraneWorkCycleVo">
|
resultType="com.zhgd.xmgl.modules.bigdevice.entity.vo.CountGantryCraneWorkCycleVo">
|
||||||
select ifnull(sum(ifnull(work_time, 0)) / 3600, 0) workTimeCount
|
select ifnull(sum(ifnull(work_time, 0)) / 3600, 0) workTimeSum,
|
||||||
|
sum(ifnull(if(work_type=0,1,0),0)) mainHookCount,
|
||||||
|
sum(ifnull(if(work_type=1,1,0),0)) auxiliaryHookCount,
|
||||||
|
sum(ifnull(master_hook_work_max_weight,0))+
|
||||||
|
sum(ifnull(second_master_hook_work_max_weight,0))+
|
||||||
|
sum(ifnull(sub_hook_work_max_weight,0))+
|
||||||
|
sum(ifnull(second_sub_hook_work_max_weight,0)) hookWeightSum
|
||||||
from gantry_crane_work_cycle
|
from gantry_crane_work_cycle
|
||||||
where 1 = 1
|
where 1 = 1
|
||||||
<if test="projectSn != null and projectSn != ''">
|
<if test="projectSn != null and projectSn != ''">
|
||||||
@ -56,9 +62,12 @@
|
|||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="workTimeAnalysis" resultType="com.zhgd.xmgl.base.entity.vo.TrendVo">
|
<select id="workTimeAnalysis" resultType="com.zhgd.xmgl.base.entity.vo.TrendVo">
|
||||||
SELECT date_format(work_time, '%Y-%m-%d') x, count(*) y
|
SELECT date_format(add_time, '%Y-%m-%d') x, ROUND(ifnull(sum(ifnull(work_time, 0)) / 3600, 0),2) y
|
||||||
FROM gantry_crane_work_cycle
|
FROM gantry_crane_work_cycle
|
||||||
where 1=1
|
where 1=1
|
||||||
|
<if test="projectSn != null and projectSn != ''">
|
||||||
|
and project_sn = #{projectSn}
|
||||||
|
</if>
|
||||||
<if test="devSn != null and devSn != ''">
|
<if test="devSn != null and devSn != ''">
|
||||||
and dev_sn = #{devSn}
|
and dev_sn = #{devSn}
|
||||||
</if>
|
</if>
|
||||||
|
|||||||
@ -3,6 +3,7 @@ package com.zhgd.xmgl.modules.bigdevice.service.impl;
|
|||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
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.execption.OpenAlertException;
|
||||||
import com.zhgd.jeecg.common.mybatis.EntityMap;
|
import com.zhgd.jeecg.common.mybatis.EntityMap;
|
||||||
import com.zhgd.xmgl.async.AsyncGantryCrane;
|
import com.zhgd.xmgl.async.AsyncGantryCrane;
|
||||||
@ -11,11 +12,11 @@ import com.zhgd.xmgl.modules.bigdevice.entity.GantryCraneCurrentData;
|
|||||||
import com.zhgd.xmgl.modules.bigdevice.mapper.GantryCraneCurrentDataMapper;
|
import com.zhgd.xmgl.modules.bigdevice.mapper.GantryCraneCurrentDataMapper;
|
||||||
import com.zhgd.xmgl.modules.bigdevice.mapper.GantryCraneMapper;
|
import com.zhgd.xmgl.modules.bigdevice.mapper.GantryCraneMapper;
|
||||||
import com.zhgd.xmgl.modules.bigdevice.service.IGantryCraneCurrentDataService;
|
import com.zhgd.xmgl.modules.bigdevice.service.IGantryCraneCurrentDataService;
|
||||||
|
import com.zhgd.xmgl.util.AqiUtil;
|
||||||
import com.zhgd.xmgl.util.MessageUtil;
|
import com.zhgd.xmgl.util.MessageUtil;
|
||||||
|
import org.apache.commons.lang.StringUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
@ -25,7 +26,7 @@ import java.util.Map;
|
|||||||
/**
|
/**
|
||||||
* @Description: 龙门吊实时数据
|
* @Description: 龙门吊实时数据
|
||||||
* @author: pds
|
* @author: pds
|
||||||
* @date: 2021-08-10
|
* @date: 2021-08-10
|
||||||
* @version: V1.0
|
* @version: V1.0
|
||||||
*/
|
*/
|
||||||
@Service
|
@Service
|
||||||
@ -40,25 +41,29 @@ public class GantryCraneCurrentDataServiceImpl extends ServiceImpl<GantryCraneCu
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void saveGantryCraneCurrentData(GantryCraneCurrentData gantryCraneCurrentData) {
|
public void saveGantryCraneCurrentData(GantryCraneCurrentData gantryCraneCurrentData) {
|
||||||
QueryWrapper<GantryCrane> queryWrapper=new QueryWrapper<>();
|
QueryWrapper<GantryCrane> queryWrapper = new QueryWrapper<>();
|
||||||
queryWrapper.lambda().eq(GantryCrane::getDevSn, gantryCraneCurrentData.getDevSn());
|
queryWrapper.lambda().eq(GantryCrane::getDevSn, gantryCraneCurrentData.getDevSn());
|
||||||
GantryCrane gantryCrane=gantryCraneMapper.selectOne(queryWrapper);
|
GantryCrane gantryCrane = gantryCraneMapper.selectOne(queryWrapper);
|
||||||
if (gantryCrane==null){
|
if (gantryCrane == null) {
|
||||||
throw new OpenAlertException(MessageUtil.get("EquipmentNumIncorrectErr"));
|
throw new OpenAlertException(MessageUtil.get("EquipmentNumIncorrectErr"));
|
||||||
}
|
}
|
||||||
gantryCraneCurrentData.setProjectSn(gantryCrane.getProjectSn());
|
gantryCraneCurrentData.setProjectSn(gantryCrane.getProjectSn());
|
||||||
gantryCraneCurrentData.setReciveTime(new Date());
|
gantryCraneCurrentData.setReciveTime(new Date());
|
||||||
gantryCraneCurrentDataMapper.insert(gantryCraneCurrentData);
|
gantryCraneCurrentDataMapper.insert(gantryCraneCurrentData);
|
||||||
GantryCrane tempGantryCrane=new GantryCrane();
|
GantryCrane tempGantryCrane = new GantryCrane();
|
||||||
tempGantryCrane.setId(gantryCrane.getId());
|
tempGantryCrane.setId(gantryCrane.getId());
|
||||||
tempGantryCrane.setRealTime(new Date());
|
tempGantryCrane.setRealTime(new Date());
|
||||||
gantryCraneMapper.updateById(tempGantryCrane);
|
gantryCraneMapper.updateById(tempGantryCrane);
|
||||||
asyncGantryCrane.sendGantryCraneCurrentData(gantryCraneCurrentData,gantryCrane);
|
asyncGantryCrane.sendGantryCraneCurrentData(gantryCraneCurrentData, gantryCrane);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public GantryCraneCurrentData getNewestGantryCraneCurrentData(Map<String, Object> map) {
|
public GantryCraneCurrentData getNewestGantryCraneCurrentData(Map<String, Object> map) {
|
||||||
return gantryCraneCurrentDataMapper.getNewestGantryCraneCurrentData(map);
|
GantryCraneCurrentData data = gantryCraneCurrentDataMapper.getNewestGantryCraneCurrentData(map);
|
||||||
|
if (StringUtils.isNotBlank(data.getWindSpeed())) {
|
||||||
|
data.setWindSpeedLevel(AqiUtil.getWindSpeedLevel(Double.valueOf(data.getWindSpeed())));
|
||||||
|
}
|
||||||
|
return data;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -71,7 +76,7 @@ public class GantryCraneCurrentDataServiceImpl extends ServiceImpl<GantryCraneCu
|
|||||||
int pageNo = Integer.parseInt(map.getOrDefault("pageNo", 1).toString());
|
int pageNo = Integer.parseInt(map.getOrDefault("pageNo", 1).toString());
|
||||||
int pageSize = Integer.parseInt(map.getOrDefault("pageSize", 10).toString());
|
int pageSize = Integer.parseInt(map.getOrDefault("pageSize", 10).toString());
|
||||||
Page<EntityMap> page = new Page<>(pageNo, pageSize);
|
Page<EntityMap> page = new Page<>(pageNo, pageSize);
|
||||||
List<EntityMap> list=gantryCraneCurrentDataMapper.queryGantryCraneCurrentDataPageList(page, map);
|
List<EntityMap> list = gantryCraneCurrentDataMapper.queryGantryCraneCurrentDataPageList(page, map);
|
||||||
return page.setRecords(list);
|
return page.setRecords(list);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -90,7 +90,7 @@ public class GantryCraneWorkCycleServiceImpl extends ServiceImpl<GantryCraneWork
|
|||||||
if (Objects.equals(MapUtils.getInteger(paramMap, "type"), 1)) {
|
if (Objects.equals(MapUtils.getInteger(paramMap, "type"), 1)) {
|
||||||
days = DateUtils.getDateStrList(60, "yyyy-MM-dd");
|
days = DateUtils.getDateStrList(60, "yyyy-MM-dd");
|
||||||
} else if (Objects.equals(MapUtils.getInteger(paramMap, "type"), 2)) {
|
} else if (Objects.equals(MapUtils.getInteger(paramMap, "type"), 2)) {
|
||||||
days = DateUtils.getDaysBefore(400);
|
days = DateUtils.getDateStrList(400, "yyyy-MM-dd");
|
||||||
} else {
|
} else {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,7 +2,6 @@ package com.zhgd.xmgl.util;
|
|||||||
|
|
||||||
import cn.hutool.http.HttpException;
|
import cn.hutool.http.HttpException;
|
||||||
import cn.hutool.http.HttpUtil;
|
import cn.hutool.http.HttpUtil;
|
||||||
import com.alibaba.fastjson.JSONArray;
|
|
||||||
import com.gexin.fastjson.JSON;
|
import com.gexin.fastjson.JSON;
|
||||||
import com.gexin.fastjson.JSONObject;
|
import com.gexin.fastjson.JSONObject;
|
||||||
import com.zhgd.redis.lock.RedisRepository;
|
import com.zhgd.redis.lock.RedisRepository;
|
||||||
@ -296,11 +295,83 @@ public class AqiUtil {
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取风速等级
|
||||||
|
*
|
||||||
|
* @param windSpeed
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static String getWindSpeedLevel(Double windSpeed) {
|
||||||
|
//风级 名称 风速(m/s) (km/h) 陆地地面物象
|
||||||
|
//0 无风 0.0-0.2 <1 静,烟直上
|
||||||
|
//1 软风 0.3-1.5 1-5 烟示风向
|
||||||
|
//2 轻风 1.6-3.3 6-11 感觉有风
|
||||||
|
//3 微风 3.4-5.4 12-19 旌旗展开
|
||||||
|
//4 和风 5.5-7.9 20-28 吹起尘土
|
||||||
|
//5 清风 8.0-10.7 29-38 小树摇摆
|
||||||
|
//6 强风 10.8-13.8 39-49 电线有声
|
||||||
|
//7 劲风(疾风) 13.9-17.1 50-61 步行困难
|
||||||
|
//8 大风 17.2-20.7 62-74 折毁树枝
|
||||||
|
//9 烈风 20.8-24.4 75-88 小损房屋
|
||||||
|
//10 狂风 24.5-28.4 89-102 拔起树木
|
||||||
|
//11 暴风 28.5-32.6 103-117 损毁重大
|
||||||
|
//12 台风(一级飓风) 32.7-36.9 117-134 摧毁极大
|
||||||
|
//13 台风(一级飓风) 37.0-41.4 134-149
|
||||||
|
//14 强台风(二级飓风) 41.5-46.1 150-166
|
||||||
|
//15 强台风(三级飓风) 46.2-50.9 167-183
|
||||||
|
//16 超强台风(三级飓风) 51.0-56.0 184-201
|
||||||
|
//17 超强台风(四级飓风) 56.1-61.2 202-220
|
||||||
|
//17+ 超强台风(四级飓风) ≥61.3 ≥221
|
||||||
|
//超级台风(五级飓风) ≥250
|
||||||
|
if (windSpeed == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
if (windSpeed >= 0 && windSpeed < 0.3) {
|
||||||
|
return "0级";
|
||||||
|
} else if (windSpeed >= 0.3 && windSpeed < 1.6) {
|
||||||
|
return "1级";
|
||||||
|
} else if (windSpeed >= 1.6 && windSpeed < 3.4) {
|
||||||
|
return "2级";
|
||||||
|
} else if (windSpeed >= 3.4 && windSpeed < 5.5) {
|
||||||
|
return "3级";
|
||||||
|
} else if (windSpeed >= 5.5 && windSpeed < 8) {
|
||||||
|
return "4级";
|
||||||
|
} else if (windSpeed >= 8 && windSpeed < 10.8) {
|
||||||
|
return "5级";
|
||||||
|
} else if (windSpeed >= 10.8 && windSpeed < 13.9) {
|
||||||
|
return "6级";
|
||||||
|
} else if (windSpeed >= 13.9 && windSpeed < 17.2) {
|
||||||
|
return "7级";
|
||||||
|
} else if (windSpeed >= 17.2 && windSpeed < 20.8) {
|
||||||
|
return "8级";
|
||||||
|
} else if (windSpeed >= 20.8 && windSpeed < 24.5) {
|
||||||
|
return "9级";
|
||||||
|
} else if (windSpeed >= 24.5 && windSpeed < 28.5) {
|
||||||
|
return "10级";
|
||||||
|
} else if (windSpeed >= 28.5 && windSpeed < 32.7) {
|
||||||
|
return "11级";
|
||||||
|
} else if (windSpeed >= 32.7 && windSpeed < 37) {
|
||||||
|
return "12级";
|
||||||
|
} else if (windSpeed >= 37 && windSpeed < 41.5) {
|
||||||
|
return "13级";
|
||||||
|
} else if (windSpeed >= 41.5 && windSpeed < 46.2) {
|
||||||
|
return "14级";
|
||||||
|
} else if (windSpeed >= 46.2 && windSpeed < 51) {
|
||||||
|
return "15级";
|
||||||
|
} else if (windSpeed >= 51 && windSpeed < 56.1) {
|
||||||
|
return "16级";
|
||||||
|
} else if (windSpeed >= 56.1 && windSpeed < 61.3) {
|
||||||
|
return "17级";
|
||||||
|
} else if (windSpeed >= 61.3) {
|
||||||
|
return "17+级";
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
/*double temp=getPm25IAQI(85d);
|
/*double temp=getPm25IAQI(85d);
|
||||||
log.info(temp);
|
log.info(temp);
|
||||||
log.info(getDegree(getPollutionDegree(temp)));*/
|
log.info(getDegree(getPollutionDegree(temp)));级*/
|
||||||
//log.info(getWeatherInfo("110100"));
|
//log.info(getWeatherInfo("110100"));
|
||||||
//log.info(getWeatherData("110100"));
|
//log.info(getWeatherData("110100"));
|
||||||
//System.out.println(getWeatherInfo("11"));
|
//System.out.println(getWeatherInfo("11"));
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user