diff --git a/ym-process-inspection/src/main/java/com/cnbm/processInspection/controller/InspectionSheetController.java b/ym-process-inspection/src/main/java/com/cnbm/processInspection/controller/InspectionSheetController.java index b0149b1..a9e486c 100644 --- a/ym-process-inspection/src/main/java/com/cnbm/processInspection/controller/InspectionSheetController.java +++ b/ym-process-inspection/src/main/java/com/cnbm/processInspection/controller/InspectionSheetController.java @@ -175,9 +175,10 @@ public class InspectionSheetController { @PostMapping("saveFluxParamList") @ApiOperation("将样本检测参数写入influxdb") - public Result saveFluxParamList(@RequestBody InspectionSampleDTO[] lists){ + public Result saveFluxParamList(@RequestBody InspectionSampleDTO[] lists) throws InterruptedException{ inspectionSheetService.saveFluxParamList(lists); + Thread.sleep(1000); //样本数据更新后 计算检验单缺陷数不良数 inspectionSheetService.calculate(Long.valueOf(lists[0].getInspectionSheetId())); return new Result(); diff --git a/ym-process-inspection/src/main/java/com/cnbm/processInspection/service/impl/InspectionSheetServiceImpl.java b/ym-process-inspection/src/main/java/com/cnbm/processInspection/service/impl/InspectionSheetServiceImpl.java index ea0ce9f..ab994b7 100644 --- a/ym-process-inspection/src/main/java/com/cnbm/processInspection/service/impl/InspectionSheetServiceImpl.java +++ b/ym-process-inspection/src/main/java/com/cnbm/processInspection/service/impl/InspectionSheetServiceImpl.java @@ -252,11 +252,15 @@ public class InspectionSheetServiceImpl extends CrudServiceImpl sortedList = list.stream() + .sorted(Comparator.comparing(InspectionSampleDTO::getSampleTime).thenComparing(InspectionSampleDTO::getSampleNumber)) + .collect(Collectors.toList()); + return sortedList; } @Override - public void saveFluxParamList(InspectionSampleDTO[] lists) { + public void saveFluxParamList(InspectionSampleDTO[] lists){ for (InspectionSampleDTO dto : lists) { //String jsonData = {"workingProcedureName":"test","inspectionSheetId":"116","param1":"0.47","param2":"0.687","param2":"0.53"}; String workingProcedureName = dto.getWorkingProcedureName();