Commit 6132f685 authored by 朱晨阳's avatar 朱晨阳

修改接口空指针

parent 1798644d
......@@ -11,7 +11,7 @@ import java.util.List;
import java.util.Map;
public interface TdHYGFInverterDayGenerateMapper extends BaseMapper<TdHYGFInverterDayGenerate> {
List<Map<String,Object>> selectDayTrend(List<String> treeParams, String time, String snCode, String thirdStationId);
List<Map<String,Object>> selectDayTrend(List<String> treeParams, String time, String time2, String snCode, String thirdStationId);
@UserEmpower(field ={"regional_companies_code"},dealerField ={"amos_company_code","regional_companies_code"} ,fieldConditions ={"eq","in"} ,relationship="and")
List<TdHYGFInverterDayGenerate> selectList(@Param(Constants.WRAPPER) Wrapper<TdHYGFInverterDayGenerate> queryWrapper);
......
......@@ -12,7 +12,7 @@
from
house_pv_data.td_hygf_inverter_day_generate
<where>
created_time >= #{time}
created_time >= #{time} and created_time &lt;= #{time2}
<if test="snCode != null and snCode !=''">
and sn_code = #{snCode}
</if>
......
......@@ -94,7 +94,7 @@ public class JpInverterServiceImpl extends BaseService<JpInverterDto, JpInverter
return this.getBaseMapper().selectPageDataTotal(jpInverterDto);
}
public Map<String,Object> selectDayTrend(List<JSONObject>treeParams, String time, String snCode, String thirdStationId) {
public Map<String,Object> selectDayTrend(List<JSONObject>treeParams, String time, String time2, String snCode, String thirdStationId) {
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")){
......@@ -103,9 +103,13 @@ public class JpInverterServiceImpl extends BaseService<JpInverterDto, JpInverter
key.add(a.get("key").toString());
}
});
List<Map<String,Object>> tdHYGFInverterDayGenerates = tdHYGFInverterDayGenerateMapper.selectDayTrend(key, time, snCode, thirdStationId);
List<Map<String,Object>> tdHYGFInverterDayGenerates = tdHYGFInverterDayGenerateMapper.selectDayTrend(key, time,time2, snCode, thirdStationId);
List<String> zData = new ArrayList<>();
tdHYGFInverterDayGenerates.forEach(e->zData.add(e.get("workstatus").toString()) );
tdHYGFInverterDayGenerates.forEach(e-> {
if(e.get("workstatus") != null) {
zData.add(e.get("workstatus").toString());
}
} );
Set<String> xData = new TreeSet<>();
for (JSONObject treeParam : treeParams) {
List<String> value = new ArrayList<>();
......@@ -370,8 +374,14 @@ public class JpInverterServiceImpl extends BaseService<JpInverterDto, JpInverter
List<String> value2 = new ArrayList<>();
List<Map<String, Object>> maps = tdHYGFInverterYearGenerateMapper.selectYearTrend(time, snCode, thirdStationId);
for (Map<String, Object> map : maps) {
xData.add(map.get("daytime").toString());
value1.add(map.get("generate").toString());
if(map.get("daytime") != null) {
xData.add(map.get("daytime").toString());
}
if(map.get("generate") != null) {
value1.add(map.get("generate").toString());
}
value2.add(map.get("fullhour") == null?"0":String.format("%.2f",Double.valueOf(map.get("fullhour").toString())));
}
List<Map<String, Object>> yData = new ArrayList<>();
......
......@@ -2,7 +2,6 @@
{
"name": "直流电压",
"key": "acv",
"unit": "V",
"children": [
{"name":"直流电压PV1",
"key": "acv_1",
......@@ -25,7 +24,6 @@
{
"name": "直流电流",
"key": "acc",
"unit": "A",
"children": [
{"name":"直流电流PV1",
"key": "acc_1",
......@@ -47,7 +45,6 @@
}, {
"name": "直流功率",
"key": "pv",
"unit": "kW",
"children": [
{"name":"直流功率PV1",
"key": "pv_1",
......@@ -145,21 +142,18 @@
{
"name": "直流母线电压",
"key": "zlmxdy",
"unit": "V",
"children": [
]
},
{
"name": "直流母线半电压",
"key": "zlmxbdy",
"unit": "V",
"children": [
]
},
{
"name": "绝缘阻抗实时值",
"key": "jyzkssz",
"unit": "Ω",
"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