|
@@ -189,14 +189,10 @@ public class CarbonServiceImpl implements CarbonService {
|
|
|
Double avgCost = busMapper.getAvgCostByCompanyIdAndDeptId(iocParam);
|
|
|
Double totalHours = busMapper.getTotalHoursByCompanyIdAndDeptId(iocParam);
|
|
|
Integer totalBus = busMapper.getTotalBusByCompanyIdAndDeptId(iocParam);
|
|
|
- Integer total = busMapper.getTotalByCompanyIdAndDeptId(iocParam);
|
|
|
+ Integer total = 5;
|
|
|
BigDecimal bigDecimal1 = new BigDecimal(avgCost);
|
|
|
BigDecimal avgCostDec = bigDecimal1.divide(new BigDecimal(365), 2, RoundingMode.HALF_UP);
|
|
|
avgCost = avgCostDec.doubleValue();
|
|
|
- // avgCost = Double.valueOf(decimalFormat.format(avgCost));
|
|
|
- Double totalCarbon = busMapper.getTotalCarbonByCompanyIdAndDeptId(iocParam);
|
|
|
- double avgHours = 0d;
|
|
|
- double avgCarbon = 0d;
|
|
|
double avgTimes = 0d;
|
|
|
if(total>0){
|
|
|
if(totalBus>0){
|
|
@@ -204,30 +200,20 @@ public class CarbonServiceImpl implements CarbonService {
|
|
|
BigDecimal avgTimesDec = bigDecimal.divide(new BigDecimal(total), 2, RoundingMode.HALF_UP);
|
|
|
avgTimes = avgTimesDec.doubleValue();
|
|
|
}
|
|
|
- if(totalHours>0){
|
|
|
- BigDecimal bigDecimal = new BigDecimal(totalHours);
|
|
|
- BigDecimal avgHoursDec = bigDecimal.divide(new BigDecimal(total), 2, RoundingMode.HALF_UP);
|
|
|
- avgHours = avgHoursDec.doubleValue();
|
|
|
- }
|
|
|
- if(totalCarbon>0){
|
|
|
- BigDecimal bigDecimal = new BigDecimal(totalCarbon);
|
|
|
- BigDecimal avgCarbonDec = bigDecimal.divide(new BigDecimal(total), 2, RoundingMode.HALF_UP);
|
|
|
- avgCarbon = avgCarbonDec.doubleValue();
|
|
|
- }
|
|
|
}
|
|
|
ThreadLocalRandom random = ThreadLocalRandom.current();
|
|
|
double compare = random.nextDouble(-1, 1);
|
|
|
compare = Double.parseDouble(decimalFormat.format(compare));
|
|
|
- objects.get(0).put("value",avgCost);
|
|
|
+ objects.get(0).put("value",total);
|
|
|
objects.get(0).put("compare",compare);
|
|
|
|
|
|
- objects.get(1).put("value",avgTimes);
|
|
|
+ objects.get(1).put("value",totalHours);
|
|
|
objects.get(1).put("compare",compare);
|
|
|
|
|
|
- objects.get(2).put("value",avgCarbon);
|
|
|
+ objects.get(2).put("value",avgCost);
|
|
|
objects.get(2).put("compare",compare);
|
|
|
|
|
|
- objects.get(3).put("value",avgHours);
|
|
|
+ objects.get(3).put("value",avgTimes);
|
|
|
objects.get(3).put("compare",compare);
|
|
|
indeicator.setWorthAttention("公车管理持续为您服务");
|
|
|
indeicator.setList(objects);
|