|
@@ -264,7 +264,7 @@ public class DeviceLogServiceImpl extends ServiceImpl<DeviceLogMapper, DeviceLog
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public HttpRespMsg getDeviceTimeCost(HttpServletRequest request,String startDate, String endDate, Integer projectId, Integer type) {
|
|
|
+ public HttpRespMsg getDeviceTimeCost(HttpServletRequest request,String startDate, String endDate, Integer projectId) {
|
|
|
HttpRespMsg httpRespMsg = new HttpRespMsg();
|
|
|
try {
|
|
|
//根据系统配置的员工成本计算方式,按固定时薪还是固定月薪,分情况计算。
|
|
@@ -286,11 +286,6 @@ public class DeviceLogServiceImpl extends ServiceImpl<DeviceLogMapper, DeviceLog
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- if (type.equals(0)){
|
|
|
- list = list.stream().sorted(Comparator.comparing(l -> -Double.parseDouble(l.get("costMoney").toString()))).collect(Collectors.toList());
|
|
|
- }else {
|
|
|
- list = list.stream().sorted(Comparator.comparing(l -> -Double.parseDouble(l.get("cost").toString()))).collect(Collectors.toList());
|
|
|
- }
|
|
|
resultMap.put("costList", list);
|
|
|
resultMap.put("totalMoneyCost", totalMoneyCost);
|
|
|
|
|
@@ -352,14 +347,14 @@ public class DeviceLogServiceImpl extends ServiceImpl<DeviceLogMapper, DeviceLog
|
|
|
row.add("");
|
|
|
}
|
|
|
BigDecimal usageCost = deviceLogs.stream()
|
|
|
- .filter(dl -> dl.getProjectId().toString().equals(idProject) && dl.getDeviceId().equals(deviceId))
|
|
|
+ .filter(dl -> dl.getProjectId().toString().equals(idProject) && dl.getDeviceId().equals(deviceId)&&dl.getUsageCost()!=null)
|
|
|
.map(DeviceLog::getUsageCost)
|
|
|
.reduce(BigDecimal.ZERO, BigDecimal::add);
|
|
|
double useTime = deviceLogs.stream()
|
|
|
.filter(dl -> dl.getProjectId().toString().equals(idProject) && dl.getDeviceId().equals(deviceId))
|
|
|
.mapToDouble(DeviceLog::getUseTime).sum();
|
|
|
- row.add(usageCost.toString());
|
|
|
row.add(useTime+"");
|
|
|
+ row.add(usageCost.toString());
|
|
|
allList.add(row);
|
|
|
}
|
|
|
}
|