diff --git a/ym-influx/src/main/java/com/cnbm/influx/config/InfluxClient.java b/ym-influx/src/main/java/com/cnbm/influx/config/InfluxClient.java index d53081b..14efc29 100644 --- a/ym-influx/src/main/java/com/cnbm/influx/config/InfluxClient.java +++ b/ym-influx/src/main/java/com/cnbm/influx/config/InfluxClient.java @@ -124,10 +124,11 @@ public enum InfluxClient { }else { point = Point.measurement(measurement) .addTag("transationId", event.getTransationId()) - .addTag("inspectionSheetId", event.getInspectionSheetId()) + +// .addTag("batchNum", event.getBatchNum()) .addTag("sampleNumber", event.getSampleNumber()) - .addTag("batchNum", event.getBatchNum()) + .addField("batchNum", event.getBatchNum()) .addTag("argName", event.getArgName()) .addField("argValue", event.getArgValue()) @@ -146,9 +147,6 @@ public enum InfluxClient { List dropedTagNames = param.getDropedTagNames(); Range range = param.getRange(); String bucket = param.getBucket(); - - - PageInfo pageInfo = param.getPageInfo(); String flux = "from(bucket:\""+bucket+"\")"; @@ -162,7 +160,9 @@ public enum InfluxClient { } //调整时区,查询出的结果 +8个小时 - flux += "|> timeShift(duration: 8h)"; + //flux += "|> timeShift(duration: 8h)"; + + for(String dropName:dropedTagNames){ flux += "|> drop(columns: [\""+dropName+"\"])"; } diff --git a/ym-influx/src/main/java/com/cnbm/influx/controller/S7DemoController.java b/ym-influx/src/main/java/com/cnbm/influx/controller/S7DemoController.java index 99d3752..e1b7a46 100644 --- a/ym-influx/src/main/java/com/cnbm/influx/controller/S7DemoController.java +++ b/ym-influx/src/main/java/com/cnbm/influx/controller/S7DemoController.java @@ -53,6 +53,31 @@ public class S7DemoController { InfluxClient.Client.batchInsert(list,"Weight"); } + @PostMapping("/insertDemoOne") + public void insertDemoOne() throws InterruptedException { + List list = new ArrayList<>(); + Random r = new Random(); + Thread.sleep(10); + Instant time = new Date().toInstant(); + Event event = new Event(); + event.setTime(time); + event.setTransationId("asas123"); + event.setArgName("failDayDay"); + event.setArgValue("1"); + list.add(event); + + Thread.sleep(1000); + + Event event2 = new Event(); + event2.setTime(time); + event2.setTransationId("asas456"); + event2.setArgName("failDayDay"); + event2.setArgValue("2"); + list.add(event2); + + InfluxClient.Client.batchInsert(list,"Weight"); + } + //for 常规计数型 @PostMapping("/insertDemoDataForCount") 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 37e05e8..9814c57 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 @@ -208,7 +208,6 @@ public class ProcessInspectionController { NPGraphData npGraph1 = new NPGraphData( npGraph.getList()==null?null:npGraph.getList(), - npGraph.getSpecificationLimit()==null?null:npGraph.getSpecificationLimit(), npGraph.getArgName()==null?null:npGraph.getArgName() ); @@ -233,7 +232,6 @@ public class ProcessInspectionController { PGraphData npGraph1 = new PGraphData( pGraph.getList()==null?null:pGraph.getList(), - pGraph.getSpecificationLimit()==null?null:pGraph.getSpecificationLimit(), pGraph.getArgName()==null?null:pGraph.getArgName() ); @@ -260,7 +258,6 @@ public class ProcessInspectionController { CGraphData npGraph1 = new CGraphData( cGraph.getList()==null?null:cGraph.getList(), - cGraph.getSpecificationLimit()==null?null:cGraph.getSpecificationLimit(), cGraph.getArgName()==null?null:cGraph.getArgName() ); @@ -286,7 +283,6 @@ public class ProcessInspectionController { UGraphData npGraph1 = new UGraphData( uGraph.getList()==null?null:uGraph.getList(), - uGraph.getSpecificationLimit()==null?null:uGraph.getSpecificationLimit(), uGraph.getArgName()==null?null:uGraph.getArgName() ); @@ -413,7 +409,6 @@ public class ProcessInspectionController { NPGraphData npGraph1 = new NPGraphData( npGraph.getList()==null?null:npGraph.getList(), - npGraph.getSpecificationLimit()==null?null:npGraph.getSpecificationLimit(), npGraph.getArgName()==null?null:npGraph.getArgName() ); return R.ok("成功",npGraph1); @@ -434,7 +429,6 @@ public class ProcessInspectionController { PGraphData npGraph1 = new PGraphData( pGraph.getList()==null?null:pGraph.getList(), - pGraph.getSpecificationLimit()==null?null:pGraph.getSpecificationLimit(), pGraph.getArgName()==null?null:pGraph.getArgName() ); return R.ok("成功",npGraph1); @@ -454,7 +448,6 @@ public class ProcessInspectionController { CGraphData npGraph1 = new CGraphData( cGraph.getList()==null?null:cGraph.getList(), - cGraph.getSpecificationLimit()==null?null:cGraph.getSpecificationLimit(), cGraph.getArgName()==null?null:cGraph.getArgName() ); return R.ok("成功",npGraph1); @@ -475,7 +468,6 @@ public class ProcessInspectionController { UGraphData uGraphData = new UGraphData( uGraph.getList()==null?null:uGraph.getList(), - uGraph.getSpecificationLimit()==null?null:uGraph.getSpecificationLimit(), uGraph.getArgName()==null?null:uGraph.getArgName() ); return R.ok("成功",uGraphData); diff --git a/ym-process-inspection/src/main/java/com/cnbm/processInspection/dto/CGraphData.java b/ym-process-inspection/src/main/java/com/cnbm/processInspection/dto/CGraphData.java index 22ba9ad..52f1a08 100644 --- a/ym-process-inspection/src/main/java/com/cnbm/processInspection/dto/CGraphData.java +++ b/ym-process-inspection/src/main/java/com/cnbm/processInspection/dto/CGraphData.java @@ -17,16 +17,17 @@ import java.util.List; @Data @ApiModel(value = "C控制图 结果类") public class CGraphData { - @ApiModelProperty(value = "P控制图list数据") + @ApiModelProperty(value = "C控制图list数据") private List list; - @ApiModelProperty(value = "P控制图 规格线") - private SpecificationLimit specificationLimit; - @ApiModelProperty(value = "P控制图 参数名") + //计数类参数,不需要显示规格线 +// @ApiModelProperty(value = "C控制图 规格线") +// private SpecificationLimit specificationLimit; + @ApiModelProperty(value = "C控制图 参数名") private String argName; - public CGraphData(List list, SpecificationLimit specificationLimit, String argName) { + public CGraphData(List list, String argName) { this.list = list; - this.specificationLimit = specificationLimit; +// this.specificationLimit = specificationLimit; this.argName = argName; } } diff --git a/ym-process-inspection/src/main/java/com/cnbm/processInspection/dto/NPGraphData.java b/ym-process-inspection/src/main/java/com/cnbm/processInspection/dto/NPGraphData.java index 769f247..2cfbf6e 100644 --- a/ym-process-inspection/src/main/java/com/cnbm/processInspection/dto/NPGraphData.java +++ b/ym-process-inspection/src/main/java/com/cnbm/processInspection/dto/NPGraphData.java @@ -22,14 +22,14 @@ import java.util.List; public class NPGraphData { @ApiModelProperty(value = "NP控制图list数据") private List list; - @ApiModelProperty(value = "NP控制图 规格线") - private SpecificationLimit specificationLimit; +// @ApiModelProperty(value = "NP控制图 规格线") +// private SpecificationLimit specificationLimit; @ApiModelProperty(value = "NP控制图 参数名") private String argName; - public NPGraphData(List list, SpecificationLimit specificationLimit, String argName) { + public NPGraphData(List list, String argName) { this.list = list; - this.specificationLimit = specificationLimit; +// this.specificationLimit = specificationLimit; this.argName = argName; } } diff --git a/ym-process-inspection/src/main/java/com/cnbm/processInspection/dto/PGraphData.java b/ym-process-inspection/src/main/java/com/cnbm/processInspection/dto/PGraphData.java index e20ee46..b6da19a 100644 --- a/ym-process-inspection/src/main/java/com/cnbm/processInspection/dto/PGraphData.java +++ b/ym-process-inspection/src/main/java/com/cnbm/processInspection/dto/PGraphData.java @@ -19,14 +19,14 @@ import java.util.List; public class PGraphData { @ApiModelProperty(value = "P控制图list数据") private List list; - @ApiModelProperty(value = "P控制图 规格线") - private SpecificationLimit specificationLimit; +// @ApiModelProperty(value = "P控制图 规格线") +// private SpecificationLimit specificationLimit; @ApiModelProperty(value = "P控制图 参数名") private String argName; - public PGraphData(List list, SpecificationLimit specificationLimit, String argName) { + public PGraphData(List list, String argName) { this.list = list; - this.specificationLimit = specificationLimit; +// this.specificationLimit = specificationLimit; this.argName = argName; } } diff --git a/ym-process-inspection/src/main/java/com/cnbm/processInspection/dto/UGraphData.java b/ym-process-inspection/src/main/java/com/cnbm/processInspection/dto/UGraphData.java index 0e0c528..5e058b2 100644 --- a/ym-process-inspection/src/main/java/com/cnbm/processInspection/dto/UGraphData.java +++ b/ym-process-inspection/src/main/java/com/cnbm/processInspection/dto/UGraphData.java @@ -19,14 +19,14 @@ import java.util.List; public class UGraphData { @ApiModelProperty(value = "U控制图list数据") private List list; - @ApiModelProperty(value = "U控制图 规格线") - private SpecificationLimit specificationLimit; +// @ApiModelProperty(value = "U控制图 规格线") +// private SpecificationLimit specificationLimit; @ApiModelProperty(value = "U控制图 参数名") private String argName; - public UGraphData(List list, SpecificationLimit specificationLimit, String argName) { + public UGraphData(List list, String argName) { this.list = list; - this.specificationLimit = specificationLimit; + //this.specificationLimit = specificationLimit; this.argName = argName; } } diff --git a/ym-process-inspection/src/main/java/com/cnbm/processInspection/graphAnalyzed/forCount/c/CGraph.java b/ym-process-inspection/src/main/java/com/cnbm/processInspection/graphAnalyzed/forCount/c/CGraph.java index c17458b..37f85a3 100644 --- a/ym-process-inspection/src/main/java/com/cnbm/processInspection/graphAnalyzed/forCount/c/CGraph.java +++ b/ym-process-inspection/src/main/java/com/cnbm/processInspection/graphAnalyzed/forCount/c/CGraph.java @@ -8,6 +8,7 @@ import com.cnbm.influx.param.QueryDataGroupByTimeParam; import com.cnbm.influx.param.Tag; import com.cnbm.qualityPlanning.entity.CPoint; import com.cnbm.qualityPlanning.entity.ControlLimit; +import com.cnbm.qualityPlanning.entity.ControlLimitDetail; import com.cnbm.qualityPlanning.entity.SpecificationLimit; import com.influxdb.query.FluxRecord; import com.influxdb.query.FluxTable; @@ -139,11 +140,11 @@ public class CGraph { * desc: get Xbar控制图 的控制限 * 注意:此函数 要在 initialDate()函数执行之后 * */ - public ControlLimit getCL(){ + public ControlLimitDetail getCL(){ Double mul = 3 * Math.sqrt( this.cbar ); Double lcl = (this.cbar-mul)<0?0:(this.cbar-mul); - return new ControlLimit( + return new ControlLimitDetail( this.cbar + mul, this.cbar, lcl diff --git a/ym-process-inspection/src/main/java/com/cnbm/processInspection/graphAnalyzed/forCount/np/NPGraph.java b/ym-process-inspection/src/main/java/com/cnbm/processInspection/graphAnalyzed/forCount/np/NPGraph.java index 207e680..d881457 100644 --- a/ym-process-inspection/src/main/java/com/cnbm/processInspection/graphAnalyzed/forCount/np/NPGraph.java +++ b/ym-process-inspection/src/main/java/com/cnbm/processInspection/graphAnalyzed/forCount/np/NPGraph.java @@ -136,11 +136,11 @@ public class NPGraph { * desc: get Xbar控制图 的控制限 * 注意:此函数 要在 initialDate()函数执行之后 * */ - public ControlLimit getCL(Double n){ + public ControlLimitDetail getCL(Double n){ Double npbar = n * this.pbar; Double mul = 3 * Math.sqrt(npbar*(1-this.pbar)); Double lcl = (npbar-mul)<0?0:(npbar-mul); - return new ControlLimit( + return new ControlLimitDetail( npbar + mul, npbar, lcl diff --git a/ym-process-inspection/src/main/java/com/cnbm/processInspection/graphAnalyzed/forCount/p/PGraph.java b/ym-process-inspection/src/main/java/com/cnbm/processInspection/graphAnalyzed/forCount/p/PGraph.java index e622c33..e6df59a 100644 --- a/ym-process-inspection/src/main/java/com/cnbm/processInspection/graphAnalyzed/forCount/p/PGraph.java +++ b/ym-process-inspection/src/main/java/com/cnbm/processInspection/graphAnalyzed/forCount/p/PGraph.java @@ -7,6 +7,7 @@ import com.cnbm.influx.constant.Constant; import com.cnbm.influx.param.QueryDataGroupByTimeParam; import com.cnbm.influx.param.Tag; import com.cnbm.qualityPlanning.entity.ControlLimit; +import com.cnbm.qualityPlanning.entity.ControlLimitDetail; import com.cnbm.qualityPlanning.entity.PPoint; import com.cnbm.qualityPlanning.entity.SpecificationLimit; import com.influxdb.query.FluxRecord; @@ -148,11 +149,11 @@ public class PGraph { * desc: get Xbar控制图 的控制限 * 注意:此函数 要在 initialDate()函数执行之后 * */ - public ControlLimit getCL(Double n){ + public ControlLimitDetail getCL(Double n){ Double mul = 3 * Math.sqrt( ( this.pbar * (1-this.pbar) ) / n ); Double lcl = (this.pbar-mul)<0?0:(this.pbar-mul); - return new ControlLimit( + return new ControlLimitDetail( this.pbar + mul, this.pbar, lcl diff --git a/ym-process-inspection/src/main/java/com/cnbm/processInspection/graphAnalyzed/forCount/u/UGraph.java b/ym-process-inspection/src/main/java/com/cnbm/processInspection/graphAnalyzed/forCount/u/UGraph.java index 890f0fd..d17ffcd 100644 --- a/ym-process-inspection/src/main/java/com/cnbm/processInspection/graphAnalyzed/forCount/u/UGraph.java +++ b/ym-process-inspection/src/main/java/com/cnbm/processInspection/graphAnalyzed/forCount/u/UGraph.java @@ -7,6 +7,7 @@ import com.cnbm.influx.constant.Constant; import com.cnbm.influx.param.QueryDataGroupByTimeParam; import com.cnbm.influx.param.Tag; import com.cnbm.qualityPlanning.entity.ControlLimit; +import com.cnbm.qualityPlanning.entity.ControlLimitDetail; import com.cnbm.qualityPlanning.entity.SpecificationLimit; import com.cnbm.qualityPlanning.entity.UPoint; import com.influxdb.query.FluxRecord; @@ -147,11 +148,11 @@ public class UGraph { * desc: get Xbar控制图 的控制限 * 注意:此函数 要在 initialDate()函数执行之后 * */ - public ControlLimit getCL(Double n){ + public ControlLimitDetail getCL(Double n){ Double mul = 3 * Math.sqrt( this.ubar / n ); Double lcl = (this.ubar-mul)<0?0:(this.ubar-mul); - return new ControlLimit( + return new ControlLimitDetail( this.ubar + mul, this.ubar, lcl diff --git a/ym-quality-planning/src/main/java/com/cnbm/qualityPlanning/entity/CPoint.java b/ym-quality-planning/src/main/java/com/cnbm/qualityPlanning/entity/CPoint.java index e0ca095..9204762 100644 --- a/ym-quality-planning/src/main/java/com/cnbm/qualityPlanning/entity/CPoint.java +++ b/ym-quality-planning/src/main/java/com/cnbm/qualityPlanning/entity/CPoint.java @@ -10,7 +10,7 @@ import lombok.Data; @Data public class CPoint { - private ControlLimit controlLimit; + private ControlLimitDetail controlLimit; private Integer position; @@ -19,7 +19,7 @@ public class CPoint { private String name; - public CPoint(ControlLimit controlLimit, Integer position, Double value, String name) { + public CPoint(ControlLimitDetail controlLimit, Integer position, Double value, String name) { this.controlLimit = controlLimit; this.position = position; this.value = value; diff --git a/ym-quality-planning/src/main/java/com/cnbm/qualityPlanning/entity/NPPoint.java b/ym-quality-planning/src/main/java/com/cnbm/qualityPlanning/entity/NPPoint.java index 170d9ae..0d6fefc 100644 --- a/ym-quality-planning/src/main/java/com/cnbm/qualityPlanning/entity/NPPoint.java +++ b/ym-quality-planning/src/main/java/com/cnbm/qualityPlanning/entity/NPPoint.java @@ -15,7 +15,7 @@ import java.util.Set; @Data public class NPPoint{ - private ControlLimit controlLimit; + private ControlLimitDetail controlLimit; private Integer position; @@ -23,7 +23,7 @@ public class NPPoint{ private Integer value; private String name; - public NPPoint(ControlLimit controlLimit, Integer position, Integer value,String name) { + public NPPoint(ControlLimitDetail controlLimit, Integer position, Integer value,String name) { this.controlLimit = controlLimit; this.position = position; this.value = value; diff --git a/ym-quality-planning/src/main/java/com/cnbm/qualityPlanning/entity/PPoint.java b/ym-quality-planning/src/main/java/com/cnbm/qualityPlanning/entity/PPoint.java index ac28c5d..f483d4a 100644 --- a/ym-quality-planning/src/main/java/com/cnbm/qualityPlanning/entity/PPoint.java +++ b/ym-quality-planning/src/main/java/com/cnbm/qualityPlanning/entity/PPoint.java @@ -10,7 +10,7 @@ import lombok.Data; @Data public class PPoint { - private ControlLimit controlLimit; + private ControlLimitDetail controlLimit; private Integer position; @@ -19,7 +19,7 @@ public class PPoint { private String name; - public PPoint(ControlLimit controlLimit, Integer position, Double value,String name) { + public PPoint(ControlLimitDetail controlLimit, Integer position, Double value,String name) { this.controlLimit = controlLimit; this.position = position; this.value = value; diff --git a/ym-quality-planning/src/main/java/com/cnbm/qualityPlanning/entity/UPoint.java b/ym-quality-planning/src/main/java/com/cnbm/qualityPlanning/entity/UPoint.java index 0f61ab1..8785a63 100644 --- a/ym-quality-planning/src/main/java/com/cnbm/qualityPlanning/entity/UPoint.java +++ b/ym-quality-planning/src/main/java/com/cnbm/qualityPlanning/entity/UPoint.java @@ -10,7 +10,7 @@ import lombok.Data; @Data public class UPoint { - private ControlLimit controlLimit; + private ControlLimitDetail controlLimit; private Integer position; @@ -19,7 +19,7 @@ public class UPoint { private String name; - public UPoint(ControlLimit controlLimit, Integer position, Double value, String name) { + public UPoint(ControlLimitDetail controlLimit, Integer position, Double value, String name) { this.controlLimit = controlLimit; this.position = position; this.value = value;