Commit c55b1084 authored by chenzhao's avatar chenzhao

修改bug

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