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

修改接口空指针

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