Commit 6667521b authored by chenzhao's avatar chenzhao

修改bug

parent 72cef0f6
...@@ -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
......
...@@ -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);
} }
......
...@@ -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