Commit 16bc3d61 authored by kiritoausna's avatar kiritoausna

2022-5.31

parent 900ed303
......@@ -49,7 +49,7 @@ public class RgData implements Serializable {
* 测量时间
*/
@ApiModelProperty("测量时间")
private Date time;
public Date time;
/**
* 据上一次统计到现在的降雨量(mm)
......
......@@ -2,6 +2,7 @@ package me.zhengjie.gemho.entity.tab;
import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
......@@ -225,6 +226,7 @@ public class Drybeachequipinfor implements Serializable {
/**
* 库水位设备的类型只用于库水位,设备类型分为1是超声,2是投入式
*/
@TableField(exist = false)
@ApiModelProperty(value = "库水位设备的类型只用于库水位,设备类型分为1是超声,2是投入式")
private Integer ksweqtype;
......@@ -249,8 +251,9 @@ public class Drybeachequipinfor implements Serializable {
/**
* 浸润线埋深 ,开孔高度,只用于浸润线
*/
@TableField(exist = false)
@ApiModelProperty(value = "浸润线埋深 ,开孔高度,只用于浸润线")
private String jrxburial_depth;
private String jrxburial_depth;
/**
* 所属库水位的设备编号,只用于添加干滩设备时使用,对应库水位
......
package me.zhengjie.gemho.mapper.data;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import me.zhengjie.gemho.entity.data.RgData;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import java.util.HashMap;
......@@ -21,4 +23,7 @@ import java.util.List;
public interface RgDataMapper extends BaseMapper<RgData> {
@Select(value = "SELECT r.* from(select b.eqdanwei as eqdanwei,b.equipno equipno,b.equipname as sensorname,a.rainfall as `rainfall` ,DATE_FORMAT(a.time,'%y-%m-%d %H:%m:%m') as time from tb_rg_data a join tb_drybeachequipinfor b on a.sensorid=b.equipno where a.datasource =1 and b.tailingid=#{tailingid} ORDER BY time DESC) r GROUP BY r.sensorname")
List<HashMap<String, Object>> real(String tailingid);
@Select(value = "SELECT SUM(a.rainfall)as rainfall ,a.time FROM (select * from tb_rg_data ${ew.customSqlSegment})a GROUP BY a.time")
List<RgData> imgList(@Param("ew") Wrapper wrapper);
}
......@@ -420,7 +420,7 @@ public class DbDataServiceImpl extends ServiceImpl<DbDataMapper, DbData> impleme
List<DbData> dbdatas = (List<DbData>) pageall.get("list");
String checkArtificial = ServiceUtil.checkArtificial(dataQueryCriteria);
List<Map<String, Object>> list = new ArrayList<>();
if (ObjectUtils.isEmpty(dbdatas)) {
if (!ObjectUtils.isEmpty(dbdatas)) {
for (DbData dbdata : dbdatas) {
Map<String, Object> map = new LinkedHashMap<>();
map.put("设备编号", dbdata.getSensorid());
......
......@@ -446,7 +446,7 @@ public class DmDataServiceImpl extends ServiceImpl<DmDataMapper, DmData> impleme
List<DmData> list = (List<DmData>) pageall(dataQueryCriteria, request).get("list");
String checkArtificial = ServiceUtil.checkArtificial(dataQueryCriteria);
ArrayList<Map<String, Object>> maps = new ArrayList<>();
if (ObjectUtils.isEmpty(list)) {
if (!ObjectUtils.isEmpty(list)) {
for (DmData dmData : list) {
Map<String, Object> map = new LinkedHashMap<>();
map.put("设备编号", dmData.getSensorid());
......
......@@ -472,7 +472,7 @@ public class MpDataServiceImpl extends ServiceImpl<MpDataMapper, MpData> impleme
result = true;
}
ArrayList<Map<String, Object>> list = new ArrayList<>();
if (ObjectUtils.isEmpty(mpData)) {
if (!ObjectUtils.isEmpty(mpData)) {
for (MpData mpDatum : mpData) {
Map<String, Object> map = new LinkedHashMap<>();
map.put("设备名称", mpDatum.getSensorname());
......
......@@ -375,7 +375,7 @@ public class PslDataServiceImpl extends ServiceImpl<PslDataMapper, PslData> impl
result = true;
}
ArrayList<Map<String, Object>> list = new ArrayList<>();
if (ObjectUtils.isEmpty(wtData)) {
if (!ObjectUtils.isEmpty(wtData)) {
for (PslData pslDatum : wtData) {
Map<String, Object> map = new LinkedHashMap<>();
map.put("设备名称", pslDatum.getSensorname());
......
......@@ -327,7 +327,31 @@ public class RgDataServiceImpl extends ServiceImpl<RgDataMapper, RgData> impleme
}
QueryWrapper<RgData> rgDataQueryWrapper = new QueryWrapper<>();
ServiceUtil.rgImgQuery(rgDataQueryWrapper, dataQueryCriteria);
List<RgData> rgData = rgDataMapper.selectList(rgDataQueryWrapper);
List<RgData> rgData = rgDataMapper.imgList(rgDataQueryWrapper);
Integer hours = dataQueryCriteria.getHours();
if (hours != null) {
if (!ObjectUtils.isEmpty(rgData)) {
List<RgData> rgData1 = new ArrayList<>();
for (int i = 0; i < rgData.size(); i += hours) {
RgData rgData2 = new RgData();
Double result = 0.0;
int i1 = rgData.size() - i;
if (i1 >= hours) {
for (int j = i; j < i + hours; j++) {
result += rgData.get(j).getRainfall();
}
} else {
for (int j = i; j < i + i1; j++) {
result += rgData.get(j).getRainfall();
}
}
rgData2.setTime(rgData.get(i).getTime());
rgData2.setRainfall(result);
rgData1.add(rgData2);
}
rgData = rgData1;
}
}
//获取编码-名
HashMap<String, String> noName = ServiceUtil.getNoName(request);
HashMap<String, String> noDan = ServiceUtil.getNoDan(request);
......@@ -340,7 +364,8 @@ public class RgDataServiceImpl extends ServiceImpl<RgDataMapper, RgData> impleme
@SneakyThrows
@Override
public void download(HttpServletResponse response, DataQueryCriteria dataQueryCriteria, HttpServletRequest request) {
public void download(HttpServletResponse response, DataQueryCriteria dataQueryCriteria, HttpServletRequest
request) {
List<RgData> rgData = (List<RgData>) pageall(dataQueryCriteria, request).get("list");
boolean result = false;
String checkArtificial = ServiceUtil.checkArtificial(dataQueryCriteria);
......@@ -348,7 +373,7 @@ public class RgDataServiceImpl extends ServiceImpl<RgDataMapper, RgData> impleme
result = true;
}
ArrayList<Map<String, Object>> list = new ArrayList<>();
if (ObjectUtils.isEmpty(rgData)) {
if (!ObjectUtils.isEmpty(rgData)) {
for (RgData rgDatum : rgData) {
Map<String, Object> map = new LinkedHashMap<>();
map.put("设备名称", rgDatum.getSensorname());
......@@ -576,7 +601,7 @@ public class RgDataServiceImpl extends ServiceImpl<RgDataMapper, RgData> impleme
int i = instance.get(Calendar.DAY_OF_WEEK) - 1;
System.out.println(i);*/
ArrayList<T> ts = null;
if (ObjectUtils.isEmpty(ts)){
if (ObjectUtils.isEmpty(ts)) {
System.out.println("ts = null");
}
......
......@@ -416,7 +416,7 @@ public class SlDataServiceImpl extends ServiceImpl<SlDataMapper, SlData> impleme
result = true;
}
ArrayList<Map<String, Object>> list = new ArrayList<>();
if (ObjectUtils.isEmpty(slData)) {
if (!ObjectUtils.isEmpty(slData)) {
for (SlData slDatum : slData) {
Map<String, Object> map = new LinkedHashMap<>();
map.put("设备名称", slDatum.getSensorname());
......
......@@ -421,7 +421,7 @@ public class StDataServiceImpl extends ServiceImpl<StDataMapper, StData> impleme
result = true;
}
ArrayList<Map<String, Object>> list = new ArrayList<>();
if (ObjectUtils.isEmpty(stData)) {
if (!ObjectUtils.isEmpty(stData)) {
for (StData stDatum : stData) {
Map<String, Object> map = new LinkedHashMap<>();
map.put("设备名称", stDatum.getSensorname());
......
......@@ -388,7 +388,7 @@ public class WpbDataServiceImpl extends ServiceImpl<WpbDataMapper, WpbData> impl
result = true;
}
ArrayList<Map<String, Object>> list = new ArrayList<>();
if (ObjectUtils.isEmpty(wpbData)) {
if (!ObjectUtils.isEmpty(wpbData)) {
for (WpbData wpbDatum : wpbData) {
Map<String, Object> map = new LinkedHashMap<>();
map.put("设备名称", wpbDatum.getSensorname());
......
......@@ -390,7 +390,7 @@ public class WtDataServiceImpl extends ServiceImpl<WtDataMapper, WtData> impleme
result = true;
}
ArrayList<Map<String, Object>> list = new ArrayList<>();
if (ObjectUtils.isEmpty(wtData)) {
if (!ObjectUtils.isEmpty(wtData)) {
for (WtData wtDatum : wtData) {
Map<String, Object> map = new LinkedHashMap<>();
map.put("设备名称", wtDatum.getSensorname());
......
......@@ -426,7 +426,7 @@ public class ServiceUtil {
queryWrapper.eq("sensorid", code);
}
Integer hours = dataQueryCriteria.getHours();
if (hours != null) {
/* if (hours != null) {
String format = "yyyy-MM-dd HH";
DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern(format);
String format1 = "yyyy-MM-dd HH:mm:ss";
......@@ -438,7 +438,7 @@ public class ServiceUtil {
String startIng = start.format(dateTimeFormatter) + ":00:00";
LocalDateTime startTime = LocalDateTime.parse(startIng, dateTimeFormatter1);
queryWrapper.ge("time", startTime).le("time", endTime);
} else {
} else {*/
//判断是否有时间字段
String timeSpace = dataQueryCriteria.getDaterange();
if (timeSpace != null) {
......@@ -456,7 +456,7 @@ public class ServiceUtil {
} else {
queryWrapper.apply("DATE_FORMAT(time,'%Y-%m-%d') =DATE_FORMAT(NOW(),'%Y-%m-%d')");
}
}
//}
//正序倒序
String sort = dataQueryCriteria.getSort();
String s = sort.split(",")[1];
......
......@@ -141,7 +141,7 @@ public class SpringSecurityConfig extends WebSecurityConfigurerAdapter {
// 所有类型的接口都放行
.antMatchers(anonymousUrls.get(RequestMethodEnum.ALL.getType()).toArray(new String[0])).permitAll()
// 所有请求都需要认证
.anyRequest().authenticated()
//.anyRequest().authenticated()
.and().apply(securityConfigurerAdapter());
}
......
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