Commit 5f93fb15 authored by chenzhao's avatar chenzhao

修改代码 增加逆变器名称

parent 0a257632
......@@ -185,4 +185,7 @@ public class JpInverter implements Serializable {
*/
@TableField("addr")
private String addr;
@TableField("name")
private String name;
}
......@@ -142,5 +142,6 @@ public class TdHYGFInverterDayGenerate implements Serializable {
private Double income;
private Double fullhour;
private String name;
}
......@@ -40,5 +40,6 @@ public class TdHYGFInverterMonthGenerate implements Serializable {
*/
private Double fullhour;
private Double income;
private String name;
}
......@@ -40,5 +40,7 @@ public class TdHYGFInverterYearGenerate implements Serializable {
*/
private Double fullhour;
private Double income;
private String name;
}
......@@ -461,6 +461,7 @@ public class GoLangDataAcquisitionServiceImpl implements GoLangDataAcquisitionSe
if (ObjectUtils.isEmpty(jpInverter)) {
jpInverter = new JpInverter();
}
jpInverter.setName(inverterDetailDto.getStationName());
jpInverter.setSnCode(inverterDetailDto.getSn().trim());
jpInverter.setState(golangRequestUtil.getInverterState(inverterDetailDto.getCurrentState(), inverterDetailDto.getDataTimestamp()));
jpInverter.setCollectorId(String.valueOf(inverterDetailDto.getCollectorId()));
......@@ -582,6 +583,7 @@ public class GoLangDataAcquisitionServiceImpl implements GoLangDataAcquisitionSe
//-----------------------户用光伏日报表----------------------
TdHYGFInverterDayGenerate tdHYGFInverterDayGenerate = new TdHYGFInverterDayGenerate();
tdHYGFInverterDayGenerate.setCreatedTime(System.currentTimeMillis());
tdHYGFInverterDayGenerate.setName(jpInverter.getName());
tdHYGFInverterDayGenerate.setThirdStationId(String.valueOf(jpInverter.getThirdStationId()));
tdHYGFInverterDayGenerate.setSnCode(jpInverter.getSnCode().trim());
tdHYGFInverterDayGenerate.setWorkStatus(jpInverter.getState());
......@@ -635,6 +637,7 @@ public class GoLangDataAcquisitionServiceImpl implements GoLangDataAcquisitionSe
}
tdHYGFInverterMonthGenerate.setThirdStationId(jpInverter.getThirdStationId());
tdHYGFInverterMonthGenerate.setSnCode(jpInverter.getSnCode().trim());
tdHYGFInverterMonthGenerate.setName(jpInverter.getName());
tdHYGFInverterMonthGenerate.setDayTime(DateUtil.format(today1, "yyyy-MM-dd"));
tdHYGFInverterMonthGenerate.setYearMonth(DateUtil.format(today1, "yyyy-MM"));
tdHYGFInverterMonthGenerate.setGenerate(jpInverter.getDayPowerGeneration());
......@@ -661,7 +664,7 @@ public class GoLangDataAcquisitionServiceImpl implements GoLangDataAcquisitionSe
tdHYGFInverterYearGenerate.setYear(DateUtil.format(today1, "yyyy"));
tdHYGFInverterYearGenerate.setGenerate(jpInverter.getMonthPowerGeneration());
tdHYGFInverterYearGenerate.setFullhour(jpInverter.getMonthPowerGeneration() / jpInverter.getCapacity());
tdHYGFInverterYearGenerate.setName(jpInverter.getName());
if (ObjectUtils.isEmpty(tdHYGFInverterYearGenerate.getCreatedTime())) {
tdHYGFInverterYearGenerate.setCreatedTime(System.currentTimeMillis());
tdHYGFInverterYearGenerateMapper.insert(tdHYGFInverterYearGenerate);
......
......@@ -547,7 +547,6 @@ public class KsolarDataAcquisitionServiceImpl implements KSolarDataAcquisitionSe
jpInverter.setCollectorId(ksolarStationCollectList.getCollectId().trim());
jpInverter.setCollectorSnCode(ksolarStationCollectList.getCollectId().trim());
jpInverter.setUpdateTime(new Date());
jpInverter.setCurrentPower(null);
jpInverter.setDayPowerGeneration(jpInverter.getDayPowerGeneration());
jpInverter.setMonthPowerGeneration(jpInverter.getMonthPowerGeneration());
......@@ -557,6 +556,7 @@ public class KsolarDataAcquisitionServiceImpl implements KSolarDataAcquisitionSe
jpInverter.setVersion(jpInverter.getVersion());
jpInverter.setThirdStationId(ksolarStationCollectList.getThirdStationId());
jpInverter.setThirdCode(PVProducerInfoEnum.KSOLAR.getCode());
jpInverter.setName(ksolarStationCollectList.getCollectName());
jpInverter.setStationName(ksolarStationCollectList.getStationName());
jpInverter.setAddr(ksolarStationCollectList.getAddress());
jpInverter.setRecDate(new Date());
......
......@@ -73,7 +73,7 @@
#{item}
</foreach>
</if>
<if test="dateTime!=null">
<if test="dateTime!=null and dateTime != ''">
and day_time = #{dateTime}
</if>
</where>
......
......@@ -12,7 +12,7 @@
#{item}
</foreach>
</if>
<if test="dateTime!=null">
<if test="dateTime!=null and dateTime != ''">
and month_time = #{dateTime}
</if>
</where>
......
......@@ -12,7 +12,7 @@
#{item}
</foreach>
</if>
<if test="dateTime!=null">
<if test="dateTime!=null and dateTime != ''">
and year = #{dateTime}
</if>
......
......@@ -569,6 +569,39 @@ public class JpStationController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET",value = "电站统计", notes = "电站统计")
@GetMapping(value = "/getcountJpStationNum")
public ResponseModel<List<Map<String,Object>>> getcountJpStationNum(JpStationDto reviewDto) {
List<Map<String,Object>> itemList =new ArrayList<>();
Map<String,Object> collector =new HashMap<>();
collector.put("在线",0);
collector.put("离线",0);
collector.put("报警",0);
List<Map<String,Object>> list= jpStationServiceImpl.getcountState(reviewDto);
if(list!=null&&!list.isEmpty()){
for (Map<String, Object> map : list) {
if(ZX.equals(map.get("state").toString())){
collector.put("正常",Integer.valueOf(map.get("num").toString()));
}else if(LX.equals(map.get("state").toString())){
collector.put("离线",Integer.valueOf(map.get("num").toString()));
}else if(BJ.equals(map.get("state").toString())){
collector.put("报警",Integer.valueOf(map.get("num").toString()));
}
}
}
for (String s : collector.keySet()) {
Map<String,Object> result = new HashMap<>();
result.put("name",s);
result.put("value",collector.get(s));
itemList.add(result);
}
return ResponseHelper.buildResponse(itemList);
}
......
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