09-22-巡检-试验管理-纪录搁置
This commit is contained in:
@ -105,11 +105,16 @@ public class OpsInspectionTestTaskController extends BaseController {
|
|||||||
return toAjax(opsInspectionTestTaskService.deleteWithValidByIds(List.of(ids), true));
|
return toAjax(opsInspectionTestTaskService.deleteWithValidByIds(List.of(ids), true));
|
||||||
}
|
}
|
||||||
|
|
||||||
@SaCheckPermission("inspection:testTask:record")
|
/**
|
||||||
@GetMapping("/record")
|
* 获取运维-巡检-试验任务记录
|
||||||
public R<Object> record(@RequestParam Long projectId){
|
*
|
||||||
return opsInspectionTestTaskService.record(projectId);
|
* @param projectId 项目ID
|
||||||
}
|
*/
|
||||||
|
// @SaCheckPermission("inspection:testTask:record")
|
||||||
|
// @GetMapping("/record")
|
||||||
|
// public R<Object> record(@RequestParam Long projectId){
|
||||||
|
// return opsInspectionTestTaskService.record(projectId);
|
||||||
|
// }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -243,32 +243,12 @@ public class OpsInspectionTestTaskServiceImpl implements IOpsInspectionTestTaskS
|
|||||||
Date finalEndDate = Date.from(firstDay.atStartOfDay(ZoneId.systemDefault()).toInstant());
|
Date finalEndDate = Date.from(firstDay.atStartOfDay(ZoneId.systemDefault()).toInstant());
|
||||||
Date finalStartDate = Date.from(lastDay.atTime(23, 59, 59).atZone(ZoneId.systemDefault()).toInstant());
|
Date finalStartDate = Date.from(lastDay.atTime(23, 59, 59).atZone(ZoneId.systemDefault()).toInstant());
|
||||||
|
|
||||||
List<OpsInspectionTestTaskVo> lastMounth = list.stream().filter(testTaskVo -> testTaskVo.getPlanBeginTime().before(finalEndDate) && testTaskVo.getPlanFinishTime().after(finalStartDate))
|
//上月数据列表
|
||||||
|
List<OpsInspectionTestTaskVo> lastMonth = list.stream().filter(testTaskVo -> testTaskVo.getPlanBeginTime().before(finalEndDate) && testTaskVo.getPlanFinishTime().after(finalStartDate))
|
||||||
.toList();
|
.toList();
|
||||||
|
|
||||||
//完成实验数
|
|
||||||
finishCount = 0L;
|
|
||||||
//待分析记录
|
|
||||||
failCount = 0L;
|
|
||||||
//总共完成时间
|
|
||||||
totalTestTime = 0L;
|
|
||||||
|
|
||||||
|
|
||||||
for (OpsInspectionTestTaskVo opsInspectionTestTaskVo : lastMounth) {
|
|
||||||
if (opsInspectionTestTaskVo.getPlanFinishTime().after(startDate) && opsInspectionTestTaskVo.getPlanFinishTime().before(endDate) && opsInspectionTestTaskVo.getStatus().equals("5")){
|
|
||||||
finishCount++;
|
|
||||||
totalTestTime += opsInspectionTestTaskVo.getPlanFinishTime().getTime() - opsInspectionTestTaskVo.getPlanBeginTime().getTime();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Long finishCount1 = totalTestTime/ finishCount;
|
|
||||||
//完成数增长率
|
|
||||||
record.setFinishCountAdd(BigDecimal.valueOf(finishCount / record.getFinishCount()).multiply(new BigDecimal("100")));
|
|
||||||
//通过率
|
|
||||||
record.setPassValueAdd(BigDecimal.valueOf(finishCount).divide(BigDecimal.valueOf(lastMounth.size()), 2, RoundingMode.HALF_UP).multiply(new BigDecimal("100")).divide(record.getPassValue(),2, RoundingMode.HALF_UP).multiply(new BigDecimal("100")));
|
|
||||||
//时长增长率
|
|
||||||
record.setAverageTestTimeAdd(BigDecimal.valueOf((totalTestTime/finishCount) / record.getAverageTestTime()));
|
|
||||||
|
|
||||||
return R.ok(record);
|
return R.ok(record);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user