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