Commit 1e025584 authored by 朱晨阳's avatar 朱晨阳

修改节能减排接口空指针问题

parent 720b4f69
......@@ -526,14 +526,17 @@ public class JpStationController extends BaseController {
JpStationDto jpStation = jpStationMapper.getCountJpStationdata(reviewDto);
Map<String, Object> map = new HashMap<>();
DecimalFormat format2 = new DecimalFormat("0.00");
double accumulatedPower = jpStation.getAccumulatedPower() == null ? 0.0: jpStation.getAccumulatedPower();
//炭
map.put("carbon", format2.format(jpStation.getAccumulatedPower() * FDXSS * CARBON));
map.put("carbon", format2.format(accumulatedPower * FDXSS * CARBON));
//硫
map.put("sulfur", format2.format(jpStation.getAccumulatedPower() * FDXSS * SULFUR));
map.put("sulfur", format2.format(accumulatedPower * FDXSS * SULFUR));
//粉尘
map.put("dust", format2.format(jpStation.getAccumulatedPower() * FDXSS * DUST));
map.put("dust", format2.format(accumulatedPower * FDXSS * DUST));
//煤
map.put("coal", format2.format(jpStation.getAccumulatedPower() * FDXSS * COAL));
map.put("coal", format2.format(accumulatedPower * FDXSS * COAL));
itemList.add(map);
result.setCurrent(1);
result.setTotal(1);
......
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