Commit c55b1084 authored by chenzhao's avatar chenzhao

修改bug

parent 7c64b560
......@@ -100,8 +100,8 @@ public class JpInverterDto extends BaseDto {
private List<String> stationIds;
private List<JpCollector> jpCollectors;
private List<JpInverterElectricity> JL;
private List<JpInverterElectricity> ZL;
private List<JpInverterElectricity> interflow;
private List<JpInverterElectricity> directCurrent;
@ApiModelProperty(value = "所属电站名称")
private String name;
......
......@@ -12,7 +12,7 @@
from
house_pv_data.td_hygf_inverter_day_generate
<where>
created_time >= (#{time} - 8h )
created_time >= #{time}
<if test="snCode != null and snCode !=''">
and sn_code = #{snCode}
</if>
......
......@@ -71,10 +71,10 @@
AND `level` = #{level}
</if>
<if test="minvalue != null and minvalue != ''">
AND time_long >= #{minvalue}
AND time_long >= (#{minvalue}*1000)
</if>
<if test="maxValue != null and maxValue != ''">
AND time_long <![CDATA[<=]]> #{maxValue}
AND time_long <![CDATA[<=]]> (#{maxValue}*1000)
</if>
<if test="snCode != null and snCode != ''">
AND sn_code like #{snCode}
......@@ -112,7 +112,7 @@
AND level = #{level}
</if>
<if test="minvalue != null and minvalue != ''">
time_long >= #{minvalue}
AND time_long >= #{minvalue}
</if>
<if test="maxValue != null and maxValue != ''">
AND time_long <![CDATA[<=]]> #{maxValue}
......
......@@ -8,6 +8,7 @@ import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.yeejoin.amos.boot.biz.common.entity.BaseEntity;
import com.yeejoin.amos.boot.biz.common.utils.DateUtils;
import com.yeejoin.amos.boot.module.hygf.api.dto.*;
import com.yeejoin.amos.boot.module.hygf.api.entity.*;
import com.yeejoin.amos.boot.module.hygf.biz.service.impl.JpCollectorServiceImpl;
......@@ -27,6 +28,7 @@ import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
import java.text.ParseException;
import java.util.*;
import java.util.stream.Collectors;
......@@ -228,6 +230,15 @@ public class JpInverterController extends BaseController {
String thirdStationId = treeParams.get("thirdStationId").toString();
if (treeParams.get("date").equals("day")){
time = time+ " 00:00:00";
Date date = null;
try {
date = DateUtils.dateParse(time, null);
Date date1 = DateUtils.dateAddHours(date, -8);
time = DateUtils.dateTimeToDateStringIfTimeEndZero(date1);
} catch (ParseException e) {
e.printStackTrace();
}
List<JSONObject> treeParams1 = parseArray(JSONObject.toJSONString(treeParams.get("treeParams")), JSONObject.class);
return ResponseHelper.buildResponse(jpInverterServiceImpl.selectDayTrend(treeParams1, time, snCode, thirdStationId));
}else if (treeParams.get("date").equals("month")){
......@@ -414,8 +425,8 @@ public class JpInverterController extends BaseController {
List<JpInverterElectricity> jpInverterElectricities = jpInverterElectricityService.getBaseMapper().selectList(queryWrapper);
Map<String, List<JpInverterElectricity>> collect = jpInverterElectricities.stream().collect(Collectors.groupingBy(JpInverterElectricity::getType));
jpInverterDto.setZL(collect.get("直流"));
jpInverterDto.setJL(collect.get("交流"));
jpInverterDto.setDirectCurrent(collect.get("直流"));
jpInverterDto.setInterflow(collect.get("交流"));
BeanUtils.copyProperties(jpInverter,jpInverterDto);
jpInverterDto.setJpCollectors(jpCollector);
......
package com.yeejoin.amos.boot.module.hygf.biz.controller;
import cn.hutool.core.collection.CollectionUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.yeejoin.amos.boot.biz.common.utils.DateUtils;
import com.yeejoin.amos.boot.module.hygf.api.config.UserLimits;
......@@ -244,18 +245,27 @@ public class TdHygfJpInverterWarnController extends BaseController {
@RequestParam(required = false) String maxValue,
@RequestParam(required = false) String snCode,
@RequestParam(required = false) List<String> stationId,
@RequestParam(required = false) List<String> time,
@RequestParam(required = false) String[] time,
@RequestParam(required = false) Integer current,
@RequestParam(required = false) Integer size,
@RequestParam(required = false) String content) {
Page<TdHygfJpInverterWarnDto> result = new Page<>();
result.setCurrent(current);
result.setSize(size);
JpStationDto reviewDto = new JpStationDto();
Map<String, String> nameMaps = new HashMap<>();
if (null != stationName && stationName != ""){
reviewDto.setName(stationName);
}
List<JpStation> jpStation = jpStationMapper.getJpStation(reviewDto);
if (CollectionUtil.isEmpty(jpStation)){
result.setTotal(0);
List<TdHygfJpInverterWarnDto> list = new ArrayList<>();
result.setRecords(list);
return ResponseHelper.buildResponse(result);
}
nameMaps = jpStation.stream().collect(Collectors.toMap(JpStation::getThirdStationId, JpStation::getName));
if (null == stationId ){
......@@ -266,8 +276,9 @@ public class TdHygfJpInverterWarnController extends BaseController {
if (null != time){
try {
startTime = String.valueOf( DateUtils.dateParse(time.get(0), null).getTime());
endTime = String.valueOf( DateUtils.dateParse(time.get(1), null).getTime());
startTime = String.valueOf( DateUtils.dateParse(time[0].replace("[",""), null).getTime());
Date date = DateUtils.dateParse(time[1].replace("]", ""), null);
endTime = String.valueOf(DateUtils.dateAddDays(date,1).getTime());
} catch (ParseException e) {
e.printStackTrace();
}
......@@ -286,8 +297,7 @@ public class TdHygfJpInverterWarnController extends BaseController {
map.setTimeLongFormat(TimeUtil
.longFormat(map.getTimeLong()));
}
result.setCurrent(current);
result.setSize(size);
result.setTotal(tdHygfJpInverterWarnServiceImpl.selectWarnListTotal(state, level, minvalue, maxValue, snCode, stationId, startTime, endTime, content));
result.setRecords(maps);
return ResponseHelper.buildResponse(result);
......
......@@ -267,7 +267,7 @@ public class JpInverterServiceImpl extends BaseService<JpInverterDto, JpInverter
for (Map<String, Object> map : maps) {
xData.add(map.get("daytime").toString());
value1.add(map.get("generate").toString());
value2.add(map.get("fullhour").toString());
value2.add(map.get("fullhour") == null?"0":String.format("%.2f",Double.valueOf(map.get("fullhour").toString())));
}
List<Map<String, Object>> yData = new ArrayList<>();
Map<String,Object> map = new HashMap<>();
......@@ -294,7 +294,7 @@ public class JpInverterServiceImpl extends BaseService<JpInverterDto, JpInverter
for (Map<String, Object> map : maps) {
xData.add(map.get("daytime").toString());
value1.add(map.get("generate").toString());
value2.add(map.get("fullhour").toString());
value2.add(map.get("fullhour") == null?"0":String.format("%.2f",Double.valueOf(map.get("fullhour").toString())));
}
List<Map<String, Object>> yData = new ArrayList<>();
Map<String,Object> map = new HashMap<>();
......@@ -321,7 +321,7 @@ public class JpInverterServiceImpl extends BaseService<JpInverterDto, JpInverter
for (Map<String, Object> map : maps) {
xData.add(map.get("daytime").toString());
value1.add(map.get("generate").toString());
value2.add(map.get("fullhour").toString());
value2.add(map.get("fullhour") == null?"0":String.format("%.2f",Double.valueOf(map.get("fullhour").toString())));
}
List<Map<String, Object>> yData = new ArrayList<>();
Map<String,Object> map = new HashMap<>();
......
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