Commit 29036e3a authored by tangwei's avatar tangwei

合并分支到主分支(电站监控)

parents bbcffb3c c3a6c0b8
package com.yeejoin.amos.boot.module.hygf.api.dto;
import lombok.Data;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import java.util.List;
/**
* @description:
* @author: tw
* @createDate: 2023/11/30
*/
@Data
public class DataDto {
String time;
List<String> snCodes;
}
......@@ -50,7 +50,7 @@ public class DayGenerateEX {
/**
* 累计发电量
*/
@ExcelProperty(value = "累计发电量(kWh)", index = 8)
@ExcelProperty(value = "累计发电量(MWh)", index = 8)
private Double accumulatedPower;
/**
* 状态
......
......@@ -101,9 +101,14 @@ public class JpInverterDto extends BaseDto {
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;
......
......@@ -98,4 +98,10 @@ public class JpInverterDtoNew extends BaseDto {
@ApiModelProperty(value = "筛选用 最大值")
private Double maxValue;
@ApiModelProperty(value = "所属区域公司名称")
private String companyName;
@ApiModelProperty(value = "电站类型")
private String stationType;
}
......@@ -96,7 +96,7 @@ public class JpStationDto extends BaseDto {
/**
* 累计发电量
*/
@ExcelProperty(value = "累计发电量(mWh)", index = 6)
@ExcelProperty(value = "累计发电量(MWh)", index = 6)
private Double accumulatedPower;
@ExcelIgnore
/**
......
......@@ -52,6 +52,6 @@ public class MonthGenerateEX {
/**
* 累计发电量
*/
@ExcelProperty(value = "累计发电量(kWh)", index = 8)
@ExcelProperty(value = "累计发电量(MWh)", index = 8)
private Double accumulatedPower;
}
......@@ -46,6 +46,6 @@ public class YearGenerateEX {
/**
* 累计发电量
*/
@ExcelProperty(value = "累计发电量(kWh)", index = 8)
@ExcelProperty(value = "累计发电量(MWh)", index = 8)
private Double accumulatedPower;
}
......@@ -49,6 +49,6 @@ public class DayGenerate {
@TableField("income")
// 日收益
private Double dayIncome;
private Double income;
}
......@@ -52,5 +52,5 @@ public class MonthGenerate {
// 月收益
@TableField("income")
private Double monthIncome;
private Double income;
}
......@@ -80,42 +80,42 @@ public class TdHYGFInverterDayGenerate implements Serializable {
/**
* 交流电压1
*/
@ExcelProperty("交流电压1(V)")
@ExcelProperty("交流电压U(V)")
private Double dcv1;
/**
* 交流电压2
*/
@ExcelProperty("交流电压2(V)")
@ExcelProperty("交流电压V(V)")
private Double dcv2;
/**
* 交流电压3
*/
@ExcelProperty("交流电压3(V)")
@ExcelProperty("交流电压W(V)")
private Double dcv3;
/**
* 交流电压4
*/
@ExcelProperty("交流电压4(V)")
@ExcelIgnore
private Double dcv4;
/**
* 交流电流1
*/
@ExcelProperty("交流电流1(A)")
@ExcelProperty("交流电流U(A)")
private Double dcc1;
/**
* 交流电流2
*/
@ExcelProperty("交流电流2(A)")
@ExcelProperty("交流电流V(A)")
private Double dcc2;
/**
* 交流电流3
*/
@ExcelProperty("交流电流3(A)")
@ExcelProperty("交流电流W(A)")
private Double dcc3;
/**
* 交流电流4
*/
@ExcelProperty("交流电流4(A)")
@ExcelIgnore
private Double dcc4;
/**
......@@ -160,22 +160,22 @@ public class TdHYGFInverterDayGenerate implements Serializable {
private Double igbtTemp;
/**
* 直流电流1
* 直流功率1
*/
@ExcelIgnore
private Double pv1;
/**
* 直流电流2
* 直流功率2
*/
@ExcelIgnore
private Double pv2;
/**
* 直流电流3
* 直流功率3
*/
@ExcelIgnore
private Double pv3;
/**
* 直流电流4
* 直流功率4
*/
@ExcelIgnore
private Double pv4;
......
......@@ -50,5 +50,5 @@ public class YearGenerate {
// 年收益
@TableField("income")
private Double yearIncome;
private Double income;
}
......@@ -39,7 +39,39 @@
<select id="selectPageData" resultType="com.yeejoin.amos.boot.module.hygf.api.dto.JpInverterDtoNew">
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,3) as dayPowerGeneration,
ROUND(hjc.month_power_generation,3) as monthPowerGeneration,
ROUND(hjc.year_power_generation,3) 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,3) as totalPowerGeneration,
hjc.third_station_id,
hjc.is_delete,
hjc.third_code,
hjc.station_name,
hjc.addr,
sta.type as stationType,
(select COMPANY_NAME from privilege_company where ORG_CODE = sta.regional_companies_code ) as companyName
from
hygf_jp_inverter hjc
left join hygf_jp_station sta on sta.third_station_id = hjc.third_station_id
......@@ -48,7 +80,7 @@
AND hjc.sn_code like #{dto.snCode}
</if>
<if test="dto.minValue != null and dto.minValue !=''">
AND hjc.capacity >= #{dto.type}
AND hjc.capacity >= #{dto.minValue}
</if>
<if test="dto.maxValue != null and dto.maxValue !=''">
AND hjc.capacity <![CDATA[<=]]> #{dto.maxValue}
......@@ -68,7 +100,7 @@
AND hjc.sn_code like #{dto.snCode}
</if>
<if test="dto.minValue != null and dto.minValue !=''">
AND hjc. capacity >= #{dto.type}
AND hjc. capacity >= #{dto.minValue}
</if>
<if test="dto.maxValue != null and dto.maxValue !=''">
AND hjc.capacity <![CDATA[<=]]> #{dto.maxValue}
......
......@@ -178,7 +178,7 @@
<if test="dto.area!=null">
and hygf_jp_station.area like concat(concat("%",#{dto.area}),"%")
</if>
<if test="dto.thirdStationIds!=null">
<if test="dto.thirdStationIds!=null and dto.thirdStationIds.size()> 0 ">
and hygf_jp_station.third_station_id in
<foreach collection="dto.thirdStationIds" item="item" index="index" open="(" separator="," close=")">
#{item}
......@@ -472,7 +472,7 @@
`rec_user_id` recUserId,
`rec_user_name` recUserName,
`sn_code` snCode,
`capacity` capacity,
ROUND(`capacity`,3) capacity,
`name` ,
`code` ,
`system_code` systemCode,
......@@ -501,8 +501,8 @@
`organizational_code` organizationalCode,
`is_delete` isDelete,
ROUND(`day_generate`,3) dayGenerate,
`month_generate` monthGenerate,
`year_generate` yearGenerate,
ROUND(`month_generate`,3) monthGenerate,
ROUND(`year_generate`,3) yearGenerate,
`day_income` dayIncome,
`month_income` monthIncome,
`year_income` yearIncome,
......@@ -510,7 +510,7 @@
`cumulative_income` cumulativeIncome,
`email`,
rated_power ratedPower,
ROUND(`real_time_power`/rated_power,3) fullhour,
ROUND(`day_generate`/capacity,3) fullhour,
(select privilege_company.COMPANY_NAME from privilege_company where privilege_company.ORG_CODE=hygf_jp_station.regional_companies_code) regionalCompaniesName
from hygf_jp_station
<where>
......
......@@ -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 != ''">
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}
......@@ -95,6 +95,7 @@
AND content like #{content}
</if>
</where>
ORDER BY start_time desc
limit #{current},#{size}
</select>
......@@ -111,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}
......
......@@ -112,10 +112,10 @@ public class JpCollectorController extends BaseController {
List<JpInverter> list = jpInverterServiceImpl.list(queryWrapper);
List<JpInverter> listData =new ArrayList<>();
for (JpInverter jpInverter : list) {
jpInverter.setDayPowerGeneration(jpInverter.getDayPowerGeneration()!=null?jpInverter.getDayPowerGeneration()/1000:0);
jpInverter.setMonthPowerGeneration(jpInverter.getMonthPowerGeneration()!=null?jpInverter.getMonthPowerGeneration()/1000:0);
jpInverter.setYearPowerGeneration(jpInverter.getYearPowerGeneration()!=null?jpInverter.getYearPowerGeneration()/1000:0);
jpInverter.setTotalPowerGeneration(jpInverter.getTotalPowerGeneration()!=null?jpInverter.getTotalPowerGeneration()/1000:0);
jpInverter.setDayPowerGeneration(jpInverter.getDayPowerGeneration()!=null?Double.valueOf(String.format("%.3f",jpInverter.getDayPowerGeneration())):0);
jpInverter.setMonthPowerGeneration(jpInverter.getMonthPowerGeneration()!=null?Double.valueOf(String.format("%.3f",jpInverter.getMonthPowerGeneration())):0);
jpInverter.setYearPowerGeneration(jpInverter.getYearPowerGeneration()!=null?Double.valueOf(String.format("%.3f",jpInverter.getYearPowerGeneration())):0);
jpInverter.setTotalPowerGeneration(jpInverter.getTotalPowerGeneration()!=null?Double.valueOf(String.format("%.3f",jpInverter.getTotalPowerGeneration()/1000)):0);
listData.add(jpInverter);
}
......
......@@ -75,7 +75,7 @@ public class JpStationController extends BaseController {
private static String ZX="在线";
private static String LX="离线";
private static String BJ="报警";
private static int FDXSS=1000;
/**
* 新增第三方场站
*
......@@ -177,6 +177,7 @@ public class JpStationController extends BaseController {
String name = jpInverter.stream().map(JpInverter::getSnCode).collect(Collectors.joining(","));
jpStationDto.setNbsn(name);
jpStationDto.setCjsn(names);
jpStationDto.setCapacity(jpStationDto.getCapacity());
jpStationDto.setRegionalCompaniesName(personnelBusiness.getRegionalCompaniesName());
return ResponseHelper.buildResponse(jpStationDto);
}
......@@ -457,7 +458,12 @@ public class JpStationController extends BaseController {
JpStationDto jpStation= jpStationMapper.getCountJpStationdata(reviewDto);
List<Map<String,Object>> powerRatio=new ArrayList<>();
Map<String,Object> map=new HashMap<>();
map.put("value",String.format("%.2f",jpStation.getRealTimePower()/jpStation.getRatedPower()));
if(jpStation!=null&&jpStation.getRealTimePower()!=null&&jpStation.getRatedPower()!=null&&jpStation.getRatedPower()>0){
map.put("value",String.format("%.4f",jpStation.getRealTimePower()/(jpStation.getCapacity()*FDXSS)));
}else{
jpStation=new JpStationDto();
map.put("value",0);
}
powerRatio.add(map);
jpStation.setPowerRatio(powerRatio);
List<JpStationDto> list=new ArrayList<>();
......@@ -492,13 +498,13 @@ public class JpStationController extends BaseController {
Map<String,Object> map=new HashMap<>();
DecimalFormat format2 = new DecimalFormat("0.00");
//炭
map.put("carbon",format2.format(jpStation.getAccumulatedPower()*CARBON));
map.put("carbon",format2.format(jpStation.getAccumulatedPower()*FDXSS*CARBON));
//硫
map.put("sulfur",format2.format(jpStation.getAccumulatedPower()*SULFUR));
map.put("sulfur",format2.format(jpStation.getAccumulatedPower()*FDXSS*SULFUR));
//粉尘
map.put("dust",format2.format(jpStation.getAccumulatedPower()*DUST));
map.put("dust",format2.format(jpStation.getAccumulatedPower()*FDXSS*DUST));
//煤
map.put("coal",format2.format(jpStation.getAccumulatedPower()*COAL));
map.put("coal",format2.format(jpStation.getAccumulatedPower()*FDXSS*COAL));
itemList.add(map);
result.setCurrent(1);
result.setTotal(1);
......@@ -520,7 +526,7 @@ public class JpStationController extends BaseController {
Map<String,Object> map=new HashMap<>();
DecimalFormat format2 = new DecimalFormat("0.00");
DecimalFormat format2 = new DecimalFormat("0.000");
//炭
map.put("name1","实时功率(kW)");
map.put("name2","组件总容量(MWp)");
......@@ -531,7 +537,7 @@ public class JpStationController extends BaseController {
Map<String,Object> map2=new HashMap<>();
map2.put("name1","当日电量(kWh)");
map2.put("name1","当日电量(MWh)");
map2.put("name2","当日收益(元)");
//炭
map2.put("value1",format2.format(jpStation.getDayGenerate()));
......@@ -548,9 +554,9 @@ public class JpStationController extends BaseController {
map4.put("name1","累计电量(MWh)");
map4.put("name2","累计收益(万元)");
//炭
map4.put("value1",format2.format(jpStation.getYearGenerate()));
map4.put("value1",format2.format(jpStation.getAccumulatedPower()));
//硫
map4.put("value2",format2.format(jpStation.getYearIncome()));
map4.put("value2",format2.format(jpStation.getCumulativeIncome()));
date.add(map);
date.add(map2);
......@@ -674,10 +680,10 @@ public class JpStationController extends BaseController {
return ResponseHelper.buildResponse(page);
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/queryReport")
@ApiOperation(httpMethod = "GET",value = "场站报表", notes = "场站报表")
@PostMapping (value = "/queryReport")
@ApiOperation(httpMethod = "POST",value = "场站报表", notes = "场站报表")
public ResponseModel<Page<JpStationDto>> queryReport(@RequestParam(value = "current") int current, @RequestParam
(value = "size") int size, JpStationDto reviewDto,String type) {
(value = "size") int size,@RequestBody JpStationDto reviewDto,@RequestParam(value = "type") String type) {
Page<JpStationDto> page=jpStationServiceImpl.queryReport(current,size,reviewDto,type);
......@@ -705,11 +711,11 @@ public class JpStationController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/jpstationReportExport", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "电站报表导出", notes = "电站报表导出")
public void jpstationReportExport( HttpServletResponse response,JpStationDto reviewDto,String type) {
List<JpStation> jpStation=jpStationServiceImpl.getJpStation(new JpStationDto());
List<String> stationIds = jpStation.stream().map(jpStation1 -> jpStation1.getThirdStationId()).collect(Collectors.toList());
@RequestMapping(value = "/jpstationReportExport", method = RequestMethod.POST)
@ApiOperation(httpMethod = "POST", value = "电站报表导出", notes = "电站报表导出")
public void jpstationReportExport( HttpServletResponse response,@RequestBody JpStationDto reviewDto,@RequestParam(value = "type")String type) {
// List<JpStation> jpStation=jpStationServiceImpl.getJpStation(new JpStationDto());
// List<String> stationIds = jpStation.stream().map(jpStation1 -> jpStation1.getThirdStationId()).collect(Collectors.toList());
List<JpStationDto> jpStationDtos = jpStationServiceImpl.selectReportDate(reviewDto, type,response);
// try {
......
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;
import com.yeejoin.amos.boot.module.hygf.api.dto.JpStationDto;
import com.yeejoin.amos.boot.module.hygf.api.entity.JpPersonStation;
......@@ -17,10 +19,9 @@ import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.RestController;
import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.stream.Collectors;
import com.yeejoin.amos.boot.module.hygf.biz.service.impl.TdHygfJpInverterWarnServiceImpl;
......@@ -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){
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 ){
......@@ -264,8 +274,14 @@ public class TdHygfJpInverterWarnController extends BaseController {
String startTime ="";
String endTime = "";
if (null != time){
startTime = time.get(0);
endTime = time.get(1);
try {
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();
}
}
if (StringUtils.isNotEmpty(snCode)){
snCode = '%'+snCode+'%';
......@@ -281,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);
......
......@@ -104,7 +104,14 @@ public class JpInverterServiceImpl extends BaseService<JpInverterDto, JpInverter
}
public Map<String,Object> selectDayTrend(List<JSONObject>treeParams, String time, String snCode, String thirdStationId) {
List<String> key = treeParams.stream().map(e -> e.get("key").toString().replace("_","")).collect(Collectors.toList());
List<String> key = new ArrayList<>();
treeParams.forEach(a->{
if (a.get("key").toString().startsWith("acc")||a.get("key").toString().startsWith("acv")||a.get("key").toString().startsWith("pv")){
key.add(a.get("key").toString().replace("_",""));
}else {
key.add(a.get("key").toString());
}
});
List<Map<String,Object>> tdHYGFInverterDayGenerates = tdHYGFInverterDayGenerateMapper.selectDayTrend(key, time, snCode, thirdStationId);
List<String> zData = new ArrayList<>();
tdHYGFInverterDayGenerates.forEach(e->zData.add(e.get("workstatus").toString()) );
......@@ -113,8 +120,10 @@ public class JpInverterServiceImpl extends BaseService<JpInverterDto, JpInverter
List<String> value = new ArrayList<>();
for (Map<String, Object> obj : tdHYGFInverterDayGenerates) {
xData.add(obj.get("time").toString().substring(0,obj.get("time").toString().length()-4));
String key1 = treeParam.get("key").toString().replace("_","");
value.add(obj.get(key1).toString());
String key1 = treeParam.get("key").toString();
if (treeParam.get("key").toString().startsWith("acc")||treeParam.get("key").toString().startsWith("acv")||treeParam.get("key").toString().startsWith("pv")){
key1 =treeParam.get("key").toString().replace("_","");
} value.add(obj.get(key1).toString());
}
treeParam.put("data",value);
}
......@@ -128,8 +137,12 @@ public class JpInverterServiceImpl extends BaseService<JpInverterDto, JpInverter
public Page<TdHYGFInverterDayGenerate> jpInverterDayReport(int current, int size, String time, List<String> sncodes, List<String> stationIds) {
Page<TdHYGFInverterDayGenerate> tdHYGFInverterDayGeneratePage = new Page<>();
Date date = DateUtil.parse(time, "yyyy-MM-dd");
String startTime = DateUtil.format(date, "yyyy-MM-dd") + "00:00:00";
String endTime = DateUtil.format(date, "yyyy-MM-dd") + "23:59:59";
Date timeStart = DateUtils.dateAddHours(date, -8);
Date tiemEnd = DateUtils.dateAddHours(date, 16);
String startTime = DateUtil.format(timeStart, "yyyy-MM-dd HH:mm:ss");
String endTime = DateUtil.format(tiemEnd, "yyyy-MM-dd HH:mm:ss");
//String startTime = DateUtil.format(date, "yyyy-MM-dd") + "00:00:00";
//String endTime = DateUtil.format(date, "yyyy-MM-dd") + "23:59:59";
QueryWrapper queryWrapper = new QueryWrapper<TdHYGFInverterDayGenerate>()
.ge("created_time", startTime)
.le("created_time", endTime)
......@@ -148,6 +161,7 @@ public class JpInverterServiceImpl extends BaseService<JpInverterDto, JpInverter
tdHYGFInverterDayGenerates.forEach(tdHYGFInverterDayGenerate -> {
Date date1 = new Date(tdHYGFInverterDayGenerate.getCreatedTime());
tdHYGFInverterDayGenerate.setCreatedTimeStr(DateUtil.format(date1, DatePattern.NORM_DATETIME_PATTERN));
tdHYGFInverterDayGenerate.setTotalGen(tdHYGFInverterDayGenerate.getTotalGen() == null ? 0:Double.valueOf(String.format("%.3f",tdHYGFInverterDayGenerate.getTotalGen()/1000)));
});
tdHYGFInverterDayGeneratePage.setRecords(tdHYGFInverterDayGenerates);
return tdHYGFInverterDayGeneratePage;
......@@ -253,8 +267,9 @@ public class JpInverterServiceImpl extends BaseService<JpInverterDto, JpInverter
if (StringUtils.isNotBlank(jpInverter.getSnCode().trim())) {
item.put("name", jpInverter.getSnCode().trim());
item.put("value", jpInverter.getSnCode().trim());
result.add(item);
}
result.add(item);
}
return result;
}
......@@ -267,13 +282,13 @@ 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<>();
Map<String,Object> map1 = new HashMap<>();
map1.put("name","发电量");
map1.put("unit","kw");
map1.put("unit","kW");
map1.put("data",value1);
yData.add(map1);
Map<String,Object> map2 = new HashMap<>();
......@@ -294,13 +309,13 @@ 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<>();
Map<String,Object> map1 = new HashMap<>();
map1.put("name","发电量");
map1.put("unit","kw");
map1.put("unit","kW");
map1.put("data",value1);
yData.add(map1);
Map<String,Object> map2 = new HashMap<>();
......@@ -321,13 +336,13 @@ 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<>();
Map<String,Object> map1 = new HashMap<>();
map1.put("name","发电量");
map1.put("unit","kw");
map1.put("unit","kW");
map1.put("data",value1);
yData.add(map1);
Map<String,Object> map2 = new HashMap<>();
......@@ -343,14 +358,22 @@ public class JpInverterServiceImpl extends BaseService<JpInverterDto, JpInverter
public Map<String,Object> jpInverterTotal(String snCode, String thirdStationId, String time, String date) {
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")){
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")){
List<TdHYGFInverterTotalGenerate> tdHYGFInverterTotalGenerates = tdHYGFInverterYearGenerateMapper.selectTotalSum(time, snCode, thirdStationId);
if (CollectionUtil.isNotEmpty(tdHYGFInverterTotalGenerates)){
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.put("fullhour",0);
......@@ -363,7 +386,7 @@ public class JpInverterServiceImpl extends BaseService<JpInverterDto, JpInverter
double income = maps.stream().filter(e->null != e.getIncome() ).mapToDouble(TdHYGFInverterTotalGenerate::getIncome).sum();
double generate = maps.stream().mapToDouble(TdHYGFInverterTotalGenerate::getGenerate).sum();
Map<String,Object> map = new HashMap<>();
map.put("fullhour",fullhour);
map.put("fullhour",String.format("%.2f",fullhour));
map.put("income",income);
map.put("generate",generate);
return map;
......
......@@ -42,44 +42,64 @@
"unit": "A"
}
]
},
}, {
"name": "直流功率",
"key": "pv",
"children": [
{"name":"直流功率PV1",
"key": "pv_1",
"unit": "kW"
},
{"name":"直流功率PV2",
"key": "pv_2",
"unit": "kW"
},
{"name":"直流功率PV3",
"key": "pv_3",
"unit": "kW"
},
{"name":"直流功率PV4",
"key": "pv_4",
"unit": "kW"
}
]},
{
"name": "U_交流电压",
"key": "acv1",
"key": "dcv1",
"unit": "V",
"children": [
]
},
{
"name": "V_交流电压",
"key": "acv2",
"key": "dcv2",
"unit": "V",
"children": [
]
}, {
"name": "W_交流电压",
"key": "acv3",
"key": "dcv3",
"unit": "V",
"children": [
]
},
{
"name": "U_交流电流",
"key": "acc1",
"key": "dcc1",
"unit": "A",
"children": [
]
},
{
"name": "W_交流电流",
"key": "acc3",
"key": "dcc3",
"unit": "A",
"children": [
]
},
{
"name": "V_交流电流",
"key": "acc2",
"key": "dcc2",
"unit": "A",
"children": [
]
......@@ -94,24 +114,46 @@
{
"name": "总功率",
"key": "total_power",
"unit": "kWh",
"children": [
]
},
{
"name": "当日电量",
"key": "day_gen",
"unit": "kWh",
"children": [
]
},
{
"name": "累计电量",
"key": "total_gen",
"unit": "kWh",
"children": [
]
},
{
"name": "IGBT温度",
"key": "igbt_temp",
"unit": "℃",
"children": [
]
},
{
"name": "直流母线电压",
"key": "zlmxdy",
"children": [
]
},
{
"name": "直流母线半电压",
"key": "zlmxbdy",
"children": [
]
},
{
"name": "绝缘阻抗实时值",
"key": "jyzkssz",
"children": [
]
}
......
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