From cafcdd65e043df554f00d08b9d0f72518cec1faa Mon Sep 17 00:00:00 2001 From: caixiang <939387484@qq.com> Date: Mon, 9 Jan 2023 16:57:52 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=9D=E5=AE=9A=20=E7=AC=AC=E4=B8=80?= =?UTF-8?q?=E7=89=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ProcessInspectionController.java | 31 +++++++++---------- .../cnbm/processInspection/dto/GraphArg.java | 3 ++ .../forMeterage/mr/MeanRGraph.java | 7 ++++- 3 files changed, 24 insertions(+), 17 deletions(-) diff --git a/ym-process-inspection/src/main/java/com/cnbm/processInspection/controller/ProcessInspectionController.java b/ym-process-inspection/src/main/java/com/cnbm/processInspection/controller/ProcessInspectionController.java index f92f0f0..10d588b 100644 --- a/ym-process-inspection/src/main/java/com/cnbm/processInspection/controller/ProcessInspectionController.java +++ b/ym-process-inspection/src/main/java/com/cnbm/processInspection/controller/ProcessInspectionController.java @@ -6,13 +6,10 @@ import com.cnbm.basic.service.IProductFeaturesService; import com.cnbm.common.spc.math.StandardDiviation; import com.cnbm.common.spc.util.DataUtils; import com.cnbm.common.vo.R; -import com.cnbm.influx.config.InfluxClient; import com.cnbm.influx.constant.Constant; import com.cnbm.influx.param.QueryDataGroupByTimeParam; import com.cnbm.influx.param.QueryDataParam; import com.cnbm.influx.param.Range; -import com.cnbm.influx.param.Tag; -import com.cnbm.influx.template.Event; import com.cnbm.processInspection.dto.*; import com.cnbm.processInspection.graphAnalyzed.forCount.c.CGraph; import com.cnbm.processInspection.graphAnalyzed.forCount.np.NPGraph; @@ -22,8 +19,6 @@ import com.cnbm.processInspection.graphAnalyzed.forMeterage.mr.MeanRGraph; import com.cnbm.processInspection.graphAnalyzed.forMeterage.ms.MeanStandardDeviationGraph; import com.cnbm.processInspection.graphAnalyzed.forMeterage.xmr.XMRGraph; import com.cnbm.qualityPlanning.entity.ControlLimitDetail; -import com.influxdb.query.FluxRecord; -import com.influxdb.query.FluxTable; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.BeanUtils; @@ -32,12 +27,8 @@ import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; - -import java.time.Instant; import java.util.ArrayList; -import java.util.Arrays; import java.util.List; -import java.util.Random; @RestController @RequestMapping("/processInspection") @@ -227,7 +218,8 @@ public class ProcessInspectionController { NPGraph npGraph = new NPGraph(productFeatures); QueryDataGroupByTimeParam queryDataParam = new QueryDataGroupByTimeParam(); - queryDataParam.setMeasurement(Constant.measurement); +// queryDataParam.setMeasurement(Constant.measurement); + queryDataParam.setMeasurement(graphArg.getProcedureName()); queryDataParam.setRange(new Range( graphArg.getBegin().toInstant() , graphArg.getEnd().toInstant() )); queryDataParam.setTimeType(graphArg.getGroupType()); npGraph.initialDate(queryDataParam); @@ -354,7 +346,8 @@ public class ProcessInspectionController { meanStandardDeviationGraph.isNeedInterpretation(graphArg.getInterpretationScheme()); } QueryDataParam queryDataParam = new QueryDataParam(); - queryDataParam.setMeasurement(Constant.measurement); +// queryDataParam.setMeasurement(Constant.measurement); + queryDataParam.setMeasurement(graphArg.getProcedureName()); queryDataParam.setRange(new Range(graphArg.getBegin().toInstant(), graphArg.getEnd().toInstant())); meanStandardDeviationGraph.initialDate(queryDataParam); @@ -389,7 +382,9 @@ public class ProcessInspectionController { } QueryDataParam queryDataParam = new QueryDataParam(); - queryDataParam.setMeasurement(Constant.measurement); +// queryDataParam.setMeasurement(Constant.measurement); + queryDataParam.setMeasurement(graphArg.getProcedureName()); + queryDataParam.setRange(new Range(graphArg.getBegin().toInstant(), graphArg.getEnd().toInstant())); meanRGraph.initialDate(queryDataParam); @@ -424,7 +419,8 @@ public class ProcessInspectionController { } QueryDataParam queryDataParam = new QueryDataParam(); - queryDataParam.setMeasurement(Constant.measurement); +// queryDataParam.setMeasurement(Constant.measurement); + queryDataParam.setMeasurement(graphArg.getProcedureName()); queryDataParam.setRange(new Range(graphArg.getBegin().toInstant(), graphArg.getEnd().toInstant())); xmrGraph.initialDate(queryDataParam); @@ -453,7 +449,8 @@ public class ProcessInspectionController { PGraph pGraph = new PGraph(productFeatures); QueryDataGroupByTimeParam queryDataParam = new QueryDataGroupByTimeParam(); - queryDataParam.setMeasurement(Constant.measurement); +// queryDataParam.setMeasurement(Constant.measurement); + queryDataParam.setMeasurement(graphArg.getProcedureName()); queryDataParam.setRange(new Range( graphArg.getBegin().toInstant() , graphArg.getEnd().toInstant() )); queryDataParam.setTimeType(graphArg.getGroupType()); pGraph.initialDate(queryDataParam); @@ -474,7 +471,8 @@ public class ProcessInspectionController { CGraph cGraph = new CGraph(productFeatures); QueryDataGroupByTimeParam queryDataParam = new QueryDataGroupByTimeParam(); - queryDataParam.setMeasurement(Constant.measurement); +// queryDataParam.setMeasurement(Constant.measurement); + queryDataParam.setMeasurement(graphArg.getProcedureName()); queryDataParam.setRange(new Range( graphArg.getBegin().toInstant() , graphArg.getEnd().toInstant() )); queryDataParam.setTimeType(graphArg.getGroupType()); cGraph.initialDate(queryDataParam); @@ -496,7 +494,8 @@ public class ProcessInspectionController { UGraph uGraph = new UGraph(productFeatures); QueryDataGroupByTimeParam queryDataParam = new QueryDataGroupByTimeParam(); - queryDataParam.setMeasurement(Constant.measurement); +// queryDataParam.setMeasurement(Constant.measurement); + queryDataParam.setMeasurement(graphArg.getProcedureName()); queryDataParam.setRange(new Range( graphArg.getBegin().toInstant() , graphArg.getEnd().toInstant() )); queryDataParam.setTimeType(graphArg.getGroupType()); uGraph.initialDate(queryDataParam); diff --git a/ym-process-inspection/src/main/java/com/cnbm/processInspection/dto/GraphArg.java b/ym-process-inspection/src/main/java/com/cnbm/processInspection/dto/GraphArg.java index 0720310..bd085ac 100644 --- a/ym-process-inspection/src/main/java/com/cnbm/processInspection/dto/GraphArg.java +++ b/ym-process-inspection/src/main/java/com/cnbm/processInspection/dto/GraphArg.java @@ -41,4 +41,7 @@ public class GraphArg { @ApiModelProperty(value = "分组类别(1=年 , 2=月 , 3=日)(用于计数型控制图)") private Integer groupType; + + @ApiModelProperty(value = "工序名") + private String procedureName; } diff --git a/ym-process-inspection/src/main/java/com/cnbm/processInspection/graphAnalyzed/forMeterage/mr/MeanRGraph.java b/ym-process-inspection/src/main/java/com/cnbm/processInspection/graphAnalyzed/forMeterage/mr/MeanRGraph.java index e7c9970..31d179c 100644 --- a/ym-process-inspection/src/main/java/com/cnbm/processInspection/graphAnalyzed/forMeterage/mr/MeanRGraph.java +++ b/ym-process-inspection/src/main/java/com/cnbm/processInspection/graphAnalyzed/forMeterage/mr/MeanRGraph.java @@ -116,7 +116,12 @@ public class MeanRGraph { List records = fluxTable.getRecords(); for (FluxRecord fluxRecord : records) { //因为 传进去的就是Double 类型,所以取出来,自然而然就是Double - originData.add(Double.parseDouble(fluxRecord.getValueByKey("_value").toString())); + Object value = fluxRecord.getValueByKey("_value"); + + if(value!=null){ + originData.add(Double.parseDouble(value.toString())); + } + } }