From 98baf93cff8aa6d3b66f37ed4c6d5d547876e90e Mon Sep 17 00:00:00 2001 From: yanyang Date: Mon, 12 Dec 2022 16:01:43 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A0=B7=E6=9C=AC=E6=8E=92=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/InspectionSheetController.java | 3 ++- .../service/impl/InspectionSheetServiceImpl.java | 8 ++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) 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 12850f0..dc1e8f7 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 944b906..47645f5 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();