Commit 5bd8c52f authored by 朱晨阳's avatar 朱晨阳

修改接口报错

parent f54833e9
......@@ -432,11 +432,16 @@ public class JpInverterServiceImpl extends BaseService<JpInverterDto, JpInverter
public Map<String,Object> jpInverterTotal(String snCode, String thirdStationId, String time, String date) {
if (date.equals("day")){
Map<String, Object> map = tdHYGFInverterMonthGenerateMapper.selectMonthTotal(time, snCode, thirdStationId);
map.put("fullhour",String.format("%.2f",map!=null?Double.valueOf(map.get("fullhour").toString()):null));
if(map!=null) {
map.put("fullhour",String.format("%.2f",map!=null?Double.valueOf(map.get("fullhour").toString()):0));
}
return map;
}else if (date.equals("month")){
Map<String, Object> map = tdHYGFInverterYearGenerateMapper.selectYearTotal(time, snCode, thirdStationId);
map.put("fullhour",String.format("%.2f",map!=null?Double.valueOf(map.get("fullhour").toString()):null));
if(map!=null) {
map.put("fullhour",String.format("%.2f",map!=null?Double.valueOf(map.get("fullhour").toString()):null));
}
return map;
}else if (date.equals("year")){
List<TdHYGFInverterTotalGenerate> tdHYGFInverterTotalGenerates = tdHYGFInverterYearGenerateMapper.selectTotalSum(time, snCode, thirdStationId);
......@@ -445,7 +450,10 @@ public class JpInverterServiceImpl extends BaseService<JpInverterDto, JpInverter
TdHYGFInverterTotalGenerate tdHYGFInverterTotalGenerate = tdHYGFInverterTotalGenerates.get(0);
Map<String, Object> map = Bean.BeantoMap(tdHYGFInverterTotalGenerate);
map.put("fullhour",String.format("%.2f",map!=null?Double.valueOf(map.get("fullhour").toString()):null));
if(map!=null) {
map.put("fullhour",String.format("%.2f",map!=null?Double.valueOf(map.get("fullhour").toString()):null));
}
return map;
}
Map<String,Object> map = new HashMap<>();
......
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