Commit e18986d1 authored by tangwei's avatar tangwei

解决冲突

parents f91d5c2b 6667521b
...@@ -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;
......
...@@ -39,7 +39,37 @@ ...@@ -39,7 +39,37 @@
<select id="selectPageData" resultType="com.yeejoin.amos.boot.module.hygf.api.dto.JpInverterDtoNew"> <select id="selectPageData" resultType="com.yeejoin.amos.boot.module.hygf.api.dto.JpInverterDtoNew">
select select
hjc. * hjc.sequence_nbr,
hjc.rec_date,
hjc.rec_user_id,
hjc.rec_user_name,
hjc.sn_code,
hjc.state,
hjc.rated_power,
hjc.collector_id,
hjc.collector_sn_code,
hjc.update_time,
hjc.current_power,
ROUND(hjc.day_power_generation/1000,4) as dayPowerGeneration,
ROUND(hjc.month_power_generation/1000,4) as monthPowerGeneration,
ROUND(hjc.year_power_generation/1000,4) as yearPowerGeneration,
hjc.brand,
hjc.model,
hjc.national_standard,
hjc.version,
hjc.generation_hours,
hjc.warranty_period,
hjc.IGBT_temperature,
hjc.AFCI_programme,
hjc.AFCI_version,
hjc.ID,
hjc.capacity,
ROUND(hjc.total_power_generation/1000,4) as totalPowerGeneration,
hjc.third_station_id,
hjc.is_delete,
hjc.third_code,
hjc.station_name,
hjc.addr
from from
hygf_jp_inverter hjc hygf_jp_inverter hjc
left join hygf_jp_station sta on sta.third_station_id = hjc.third_station_id left join hygf_jp_station sta on sta.third_station_id = hjc.third_station_id
......
...@@ -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}
......
...@@ -112,10 +112,10 @@ public class JpCollectorController extends BaseController { ...@@ -112,10 +112,10 @@ public class JpCollectorController extends BaseController {
List<JpInverter> list = jpInverterServiceImpl.list(queryWrapper); List<JpInverter> list = jpInverterServiceImpl.list(queryWrapper);
List<JpInverter> listData =new ArrayList<>(); List<JpInverter> listData =new ArrayList<>();
for (JpInverter jpInverter : list) { for (JpInverter jpInverter : list) {
jpInverter.setDayPowerGeneration(jpInverter.getDayPowerGeneration()!=null?jpInverter.getDayPowerGeneration()/1000:0); jpInverter.setDayPowerGeneration(jpInverter.getDayPowerGeneration()!=null?Double.valueOf(String.format("%.4f",jpInverter.getDayPowerGeneration()/1000)):0);
jpInverter.setMonthPowerGeneration(jpInverter.getMonthPowerGeneration()!=null?jpInverter.getMonthPowerGeneration()/1000:0); jpInverter.setMonthPowerGeneration(jpInverter.getMonthPowerGeneration()!=null?Double.valueOf(String.format("%.4f",jpInverter.getMonthPowerGeneration()/1000)):0);
jpInverter.setYearPowerGeneration(jpInverter.getYearPowerGeneration()!=null?jpInverter.getYearPowerGeneration()/1000:0); jpInverter.setYearPowerGeneration(jpInverter.getYearPowerGeneration()!=null?Double.valueOf(String.format("%.4f",jpInverter.getYearPowerGeneration()/1000)):0);
jpInverter.setTotalPowerGeneration(jpInverter.getTotalPowerGeneration()!=null?jpInverter.getTotalPowerGeneration()/1000:0); jpInverter.setTotalPowerGeneration(jpInverter.getTotalPowerGeneration()!=null?Double.valueOf(String.format("%.4f",jpInverter.getTotalPowerGeneration()/1000)):0);
listData.add(jpInverter); listData.add(jpInverter);
} }
......
...@@ -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<>();
...@@ -343,14 +343,22 @@ public class JpInverterServiceImpl extends BaseService<JpInverterDto, JpInverter ...@@ -343,14 +343,22 @@ public class JpInverterServiceImpl extends BaseService<JpInverterDto, JpInverter
public Map<String,Object> jpInverterTotal(String snCode, String thirdStationId, String time, String date) { public Map<String,Object> jpInverterTotal(String snCode, String thirdStationId, String time, String date) {
if (date.equals("day")){ if (date.equals("day")){
return tdHYGFInverterMonthGenerateMapper.selectMonthTotal(time, snCode, thirdStationId); Map<String, Object> map = tdHYGFInverterMonthGenerateMapper.selectMonthTotal(time, snCode, thirdStationId);
map.put("fullhour",String.format("%.2f",Double.valueOf(map.get("fullhour").toString())));
return map;
}else if (date.equals("month")){ }else if (date.equals("month")){
return tdHYGFInverterYearGenerateMapper.selectYearTotal(time, snCode, thirdStationId); Map<String, Object> map = tdHYGFInverterYearGenerateMapper.selectYearTotal(time, snCode, thirdStationId);
map.put("fullhour",String.format("%.2f",Double.valueOf(map.get("fullhour").toString())));
return map;
}else if (date.equals("year")){ }else if (date.equals("year")){
List<TdHYGFInverterTotalGenerate> tdHYGFInverterTotalGenerates = tdHYGFInverterYearGenerateMapper.selectTotalSum(time, snCode, thirdStationId); List<TdHYGFInverterTotalGenerate> tdHYGFInverterTotalGenerates = tdHYGFInverterYearGenerateMapper.selectTotalSum(time, snCode, thirdStationId);
if (CollectionUtil.isNotEmpty(tdHYGFInverterTotalGenerates)){ if (CollectionUtil.isNotEmpty(tdHYGFInverterTotalGenerates)){
TdHYGFInverterTotalGenerate tdHYGFInverterTotalGenerate = tdHYGFInverterTotalGenerates.get(0); TdHYGFInverterTotalGenerate tdHYGFInverterTotalGenerate = tdHYGFInverterTotalGenerates.get(0);
return Bean.BeantoMap(tdHYGFInverterTotalGenerate) ;
Map<String, Object> map = Bean.BeantoMap(tdHYGFInverterTotalGenerate);
map.put("fullhour",String.format("%.2f",Double.valueOf(map.get("fullhour").toString())));
return map;
} }
Map<String,Object> map = new HashMap<>(); Map<String,Object> map = new HashMap<>();
map.put("fullhour",0); map.put("fullhour",0);
...@@ -363,7 +371,7 @@ public class JpInverterServiceImpl extends BaseService<JpInverterDto, JpInverter ...@@ -363,7 +371,7 @@ public class JpInverterServiceImpl extends BaseService<JpInverterDto, JpInverter
double income = maps.stream().filter(e->null != e.getIncome() ).mapToDouble(TdHYGFInverterTotalGenerate::getIncome).sum(); double income = maps.stream().filter(e->null != e.getIncome() ).mapToDouble(TdHYGFInverterTotalGenerate::getIncome).sum();
double generate = maps.stream().mapToDouble(TdHYGFInverterTotalGenerate::getGenerate).sum(); double generate = maps.stream().mapToDouble(TdHYGFInverterTotalGenerate::getGenerate).sum();
Map<String,Object> map = new HashMap<>(); Map<String,Object> map = new HashMap<>();
map.put("fullhour",fullhour); map.put("fullhour",String.format("%.2f",fullhour));
map.put("income",income); map.put("income",income);
map.put("generate",generate); map.put("generate",generate);
return map; return map;
......
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