|
|
@ -45,27 +45,26 @@ public class EmParamServiceImpl extends BaseServiceImpl<EmParamMapper, EmParamEn |
|
|
|
return null; |
|
|
|
return null; |
|
|
|
} |
|
|
|
} |
|
|
|
List<Long> collect = emParamEntities.stream().distinct().map(EmParamEntity::getInfoId).collect(Collectors.toList()); |
|
|
|
List<Long> collect = emParamEntities.stream().distinct().map(EmParamEntity::getInfoId).collect(Collectors.toList()); |
|
|
|
for (int i = 0; i < collect.size(); i++) { |
|
|
|
for (Long value : collect) { |
|
|
|
Map<String,Double> map = new HashMap<>(); |
|
|
|
Map<String, Double> map = new HashMap<>(); |
|
|
|
int ct = 0; |
|
|
|
double ct = 0; |
|
|
|
int pt = 0; |
|
|
|
double pt = 0; |
|
|
|
double installedCapacity = 0; |
|
|
|
double installedCapacity = 0; |
|
|
|
Long aLong = collect.get(i); |
|
|
|
List<EmParamEntity> pts = emParamEntities.stream().filter(o -> "pt".equals(o.getParamName()) && o.getInfoId().toString().equals(value.toString())).collect(Collectors.toList()); |
|
|
|
List<EmParamEntity> pts = emParamEntities.stream().filter(o -> "pt".equals(o.getParamName()) && o.getInfoId().toString().equals(aLong.toString())).collect(Collectors.toList()); |
|
|
|
|
|
|
|
if (CollectionUtil.isNotEmpty(pts)) { |
|
|
|
if (CollectionUtil.isNotEmpty(pts)) { |
|
|
|
pt = Integer.valueOf(pts.get(0).getParamValue()); |
|
|
|
pt = Double.parseDouble(pts.get(0).getParamValue()); |
|
|
|
} |
|
|
|
} |
|
|
|
List<EmParamEntity> cts = emParamEntities.stream().filter(o -> "ct".equals(o.getParamName()) && o.getInfoId().toString().equals(aLong.toString())).collect(Collectors.toList()); |
|
|
|
List<EmParamEntity> cts = emParamEntities.stream().filter(o -> "ct".equals(o.getParamName()) && o.getInfoId().toString().equals(value.toString())).collect(Collectors.toList()); |
|
|
|
if (CollectionUtil.isNotEmpty(cts)) { |
|
|
|
if (CollectionUtil.isNotEmpty(cts)) { |
|
|
|
ct = Integer.valueOf(cts.get(0).getParamValue()); |
|
|
|
ct = Double.parseDouble(cts.get(0).getParamValue()); |
|
|
|
} |
|
|
|
} |
|
|
|
List<EmParamEntity> installedCapacitys = emParamEntities.stream().filter(o -> "installedCapacity".equals(o.getParamName()) && o.getInfoId().toString().equals(aLong.toString())).collect(Collectors.toList()); |
|
|
|
List<EmParamEntity> installedCapacitys = emParamEntities.stream().filter(o -> "installedCapacity".equals(o.getParamName()) && o.getInfoId().toString().equals(value.toString())).collect(Collectors.toList()); |
|
|
|
if (CollectionUtil.isNotEmpty(installedCapacitys)) { |
|
|
|
if (CollectionUtil.isNotEmpty(installedCapacitys)) { |
|
|
|
installedCapacity = Double.valueOf(installedCapacitys.get(0).getParamValue()); |
|
|
|
installedCapacity = Double.parseDouble(installedCapacitys.get(0).getParamValue()); |
|
|
|
} |
|
|
|
} |
|
|
|
map.put("installedCapacity",installedCapacity); |
|
|
|
map.put("installedCapacity", installedCapacity); |
|
|
|
map.put("rideCount",(double)ct * pt); |
|
|
|
map.put("rideCount", (double) ct * pt); |
|
|
|
result.put(aLong, map); |
|
|
|
result.put(value, map); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return result; |
|
|
|
return result; |
|
|
|