mark
This commit is contained in:
parent
d26600892f
commit
fde6a8b684
@ -18,6 +18,7 @@ public class Constant {
|
|||||||
public static final LogLevel readTimeout = LogLevel.BODY;
|
public static final LogLevel readTimeout = LogLevel.BODY;
|
||||||
public static final LogLevel writeTimeout = LogLevel.BODY;
|
public static final LogLevel writeTimeout = LogLevel.BODY;
|
||||||
public static final LogLevel connectTimeout = LogLevel.BODY;
|
public static final LogLevel connectTimeout = LogLevel.BODY;
|
||||||
|
public static final String measurement = "Weight";
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -21,4 +21,6 @@ public class BaseParam implements Serializable {
|
|||||||
|
|
||||||
@NotNull(message = "查询时间段不能为空")
|
@NotNull(message = "查询时间段不能为空")
|
||||||
private Range range;
|
private Range range;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
package com.cnbm.processInspection.controller;
|
package com.cnbm.processInspection.controller;
|
||||||
|
|
||||||
|
import com.cnbm.basic.dto.FactoryDTO;
|
||||||
import com.cnbm.basic.dto.UnitDTO;
|
import com.cnbm.basic.dto.UnitDTO;
|
||||||
import com.cnbm.basic.entity.ProductFeatures;
|
import com.cnbm.basic.entity.ProductFeatures;
|
||||||
import com.cnbm.common.spc.math.StandardDiviation;
|
import com.cnbm.common.spc.math.StandardDiviation;
|
||||||
@ -13,23 +14,30 @@ import com.cnbm.influx.param.QueryDataParam;
|
|||||||
import com.cnbm.influx.param.Range;
|
import com.cnbm.influx.param.Range;
|
||||||
import com.cnbm.influx.param.Tag;
|
import com.cnbm.influx.param.Tag;
|
||||||
import com.cnbm.influx.template.Event;
|
import com.cnbm.influx.template.Event;
|
||||||
|
import com.cnbm.processInspection.dto.GraphArg;
|
||||||
|
import com.cnbm.processInspection.dto.InterpretationListArg;
|
||||||
import com.cnbm.processInspection.dto.XbarSGraphData;
|
import com.cnbm.processInspection.dto.XbarSGraphData;
|
||||||
import com.cnbm.processInspection.graphAnalyzed.MeanStandardDeviationGraph;
|
import com.cnbm.processInspection.graphAnalyzed.MeanStandardDeviationGraph;
|
||||||
|
import com.cnbm.qualityPlanning.common.StatisticalControlledTest;
|
||||||
|
import com.cnbm.qualityPlanning.entity.ControlLimit;
|
||||||
|
import com.cnbm.qualityPlanning.entity.Point;
|
||||||
import com.cnbm.qualityPlanning.entity.SpecificationLimit;
|
import com.cnbm.qualityPlanning.entity.SpecificationLimit;
|
||||||
|
import com.cnbm.qualityPlanning.entity.XbarSPoint;
|
||||||
import com.influxdb.client.domain.WritePrecision;
|
import com.influxdb.client.domain.WritePrecision;
|
||||||
import com.influxdb.client.write.Point;
|
|
||||||
import com.influxdb.query.FluxRecord;
|
import com.influxdb.query.FluxRecord;
|
||||||
import com.influxdb.query.FluxTable;
|
import com.influxdb.query.FluxTable;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
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.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.time.Instant;
|
import java.time.Instant;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
|
|
||||||
@ -40,8 +48,8 @@ public class ProcessInspectionController {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
@PostMapping("/XbarSGraph")
|
@PostMapping("/XbarSGraphTest")
|
||||||
public R<XbarSGraphData> xbarSGraph() throws Exception {
|
public R<XbarSGraphData> xbarSGraphTest() throws Exception {
|
||||||
ProductFeatures productFeatures = new ProductFeatures();
|
ProductFeatures productFeatures = new ProductFeatures();
|
||||||
productFeatures.setSl(new Float(5));
|
productFeatures.setSl(new Float(5));
|
||||||
productFeatures.setUsl(new Float(10));
|
productFeatures.setUsl(new Float(10));
|
||||||
@ -55,6 +63,40 @@ public class ProcessInspectionController {
|
|||||||
queryDataParam.setMeasurement("Weight");
|
queryDataParam.setMeasurement("Weight");
|
||||||
queryDataParam.setRange(new Range(DataUtils.getBeforeDate(10).toInstant(), Instant.now()));
|
queryDataParam.setRange(new Range(DataUtils.getBeforeDate(10).toInstant(), Instant.now()));
|
||||||
meanStandardDeviationGraph.initialDate(queryDataParam);
|
meanStandardDeviationGraph.initialDate(queryDataParam);
|
||||||
|
|
||||||
|
XbarSGraphData xbarSGraphData = new XbarSGraphData(
|
||||||
|
meanStandardDeviationGraph.getMsdGraphEntity(),
|
||||||
|
meanStandardDeviationGraph.getXbarCL(),
|
||||||
|
meanStandardDeviationGraph.getSCL(),
|
||||||
|
meanStandardDeviationGraph.getSpecificationLimit(),
|
||||||
|
meanStandardDeviationGraph.getProcessCapacity(),
|
||||||
|
new StandardDiviation(meanStandardDeviationGraph.getXigma(),meanStandardDeviationGraph.getTotalXigma())
|
||||||
|
);
|
||||||
|
|
||||||
|
return R.ok("成功",xbarSGraphData);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//筛选条件顺序:
|
||||||
|
// ① 先工厂(产品表) => ② 检验类型(产品表)=> ③ 产品名(产品表)=> ④ 工序(产品表)=> ⑤ 特性(检验参数name)( product_features 表) ;;
|
||||||
|
// ① 时间段(influxdb,必填);② 样本大小(界面上可以设置,如果要自己设置,就要更新 ProductFeatures.name)
|
||||||
|
//条件:1.检验时间段(influxdb里面) ; 7.样本大小(这个可选,也可以 用默认,产品那里配置。)
|
||||||
|
// 2.工厂(先放一下) ;
|
||||||
|
// 3.检验类型(产品表) ; 4.产品名 (产品表); 5.工艺流程(就是工序 ,也是设备名,用到工序表); 6.特性(product_features.name ,也是influxdb中的argName) ;
|
||||||
|
@PostMapping("/XbarSGraph")
|
||||||
|
public R<XbarSGraphData> xbarSGraph(@RequestBody GraphArg graphArg) throws Exception {
|
||||||
|
|
||||||
|
ProductFeatures productFeatures = graphArg.getProductFeatures();
|
||||||
|
|
||||||
|
MeanStandardDeviationGraph meanStandardDeviationGraph = new MeanStandardDeviationGraph(productFeatures);
|
||||||
|
if(graphArg.getInterpretationScheme()!=null){
|
||||||
|
meanStandardDeviationGraph.isNeedInterpretation(graphArg.getInterpretationScheme());
|
||||||
|
}
|
||||||
|
QueryDataParam queryDataParam = new QueryDataParam();
|
||||||
|
queryDataParam.setMeasurement(Constant.measurement);
|
||||||
|
queryDataParam.setRange(new Range(graphArg.getBegin().toInstant(), graphArg.getEnd().toInstant()));
|
||||||
|
meanStandardDeviationGraph.initialDate(queryDataParam);
|
||||||
|
|
||||||
XbarSGraphData xbarSGraphData = new XbarSGraphData(
|
XbarSGraphData xbarSGraphData = new XbarSGraphData(
|
||||||
meanStandardDeviationGraph.getMsdGraphEntity(),
|
meanStandardDeviationGraph.getMsdGraphEntity(),
|
||||||
meanStandardDeviationGraph.getXbarCL(),
|
meanStandardDeviationGraph.getXbarCL(),
|
||||||
|
@ -0,0 +1,32 @@
|
|||||||
|
package com.cnbm.processInspection.dto;
|
||||||
|
|
||||||
|
import com.cnbm.basic.entity.ProductFeatures;
|
||||||
|
import com.cnbm.influx.param.Range;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Desc: ""
|
||||||
|
* @Author: caixiang
|
||||||
|
* @DATE: 2022/7/26 14:44
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@ApiModel(value = "控制图 查询参数类")
|
||||||
|
public class GraphArg {
|
||||||
|
@ApiModelProperty(value = "检验特性,,全量传过来")
|
||||||
|
private ProductFeatures productFeatures;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "查询时间段,开始")
|
||||||
|
private Date begin;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "查询时间段,结束")
|
||||||
|
private Date end;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "判读方案列表")
|
||||||
|
private List<InterpretationListArg> interpretationScheme;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,18 @@
|
|||||||
|
package com.cnbm.processInspection.dto;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Desc: ""
|
||||||
|
* @Author: caixiang
|
||||||
|
* @DATE: 2022/7/27 15:56
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class InterpretationListArg {
|
||||||
|
private Integer number;
|
||||||
|
private Integer arg1;
|
||||||
|
private Integer arg2;
|
||||||
|
}
|
@ -4,19 +4,16 @@ import com.cnbm.basic.entity.ProductFeatures;
|
|||||||
import com.cnbm.common.spc.math.Math;
|
import com.cnbm.common.spc.math.Math;
|
||||||
import com.cnbm.common.spc.math.StandardDiviation;
|
import com.cnbm.common.spc.math.StandardDiviation;
|
||||||
import com.cnbm.common.spc.util.DataUtils;
|
import com.cnbm.common.spc.util.DataUtils;
|
||||||
import com.cnbm.common.utils.DateUtils;
|
|
||||||
import com.cnbm.influx.config.InfluxClient;
|
import com.cnbm.influx.config.InfluxClient;
|
||||||
import com.cnbm.influx.constant.Constant;
|
import com.cnbm.influx.constant.Constant;
|
||||||
import com.cnbm.influx.param.PageInfo;
|
|
||||||
import com.cnbm.influx.param.QueryDataParam;
|
import com.cnbm.influx.param.QueryDataParam;
|
||||||
import com.cnbm.influx.param.Range;
|
import com.cnbm.influx.param.Range;
|
||||||
import com.cnbm.influx.param.Tag;
|
import com.cnbm.influx.param.Tag;
|
||||||
import com.cnbm.processInspection.controlCoefficientConstant.XBarSCoefficients;
|
import com.cnbm.processInspection.controlCoefficientConstant.XBarSCoefficients;
|
||||||
|
|
||||||
import com.cnbm.qualityPlanning.entity.ControlLimit;
|
import com.cnbm.processInspection.dto.InterpretationListArg;
|
||||||
import com.cnbm.qualityPlanning.entity.ProcessCapability;
|
import com.cnbm.qualityPlanning.common.StatisticalControlledTest;
|
||||||
import com.cnbm.qualityPlanning.entity.SpecificationLimit;
|
import com.cnbm.qualityPlanning.entity.*;
|
||||||
import com.cnbm.qualityPlanning.entity.XbarSPoint;
|
|
||||||
import com.influxdb.query.FluxRecord;
|
import com.influxdb.query.FluxRecord;
|
||||||
import com.influxdb.query.FluxTable;
|
import com.influxdb.query.FluxTable;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
@ -51,6 +48,8 @@ public class MeanStandardDeviationGraph {
|
|||||||
//母体的 xigma ,全局计算的;
|
//母体的 xigma ,全局计算的;
|
||||||
private Double totalXigma;
|
private Double totalXigma;
|
||||||
|
|
||||||
|
//需要去检验的 判读方案 eg:[1,2,3,4,6]
|
||||||
|
private List<InterpretationListArg> interpretationScheme;
|
||||||
|
|
||||||
private Double sbar;
|
private Double sbar;
|
||||||
private Double xbarbar;
|
private Double xbarbar;
|
||||||
@ -88,6 +87,10 @@ public class MeanStandardDeviationGraph {
|
|||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void isNeedInterpretation(List<InterpretationListArg> list){
|
||||||
|
this.interpretationScheme = list;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* name : 初始化数据函数
|
* name : 初始化数据函数
|
||||||
* desc : 从influxdb 里面读取数据,然后 加工处理成 我需要的
|
* desc : 从influxdb 里面读取数据,然后 加工处理成 我需要的
|
||||||
@ -131,7 +134,8 @@ public class MeanStandardDeviationGraph {
|
|||||||
new Double(0),
|
new Double(0),
|
||||||
xbar,
|
xbar,
|
||||||
s,
|
s,
|
||||||
r
|
r,
|
||||||
|
doubleListList.get(i)
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -145,7 +149,71 @@ public class MeanStandardDeviationGraph {
|
|||||||
Double sbar = Math.getMean(toDoubleArray(sArray.toArray()));
|
Double sbar = Math.getMean(toDoubleArray(sArray.toArray()));
|
||||||
Double rbar = Math.getMean(toDoubleArray(rArray.toArray()));
|
Double rbar = Math.getMean(toDoubleArray(rArray.toArray()));
|
||||||
this.msdGraphEntity = new MSDGraphEntity(list,xbarbar,sbar,rbar);
|
this.msdGraphEntity = new MSDGraphEntity(list,xbarbar,sbar,rbar);
|
||||||
|
|
||||||
|
//4.判读方案 校验
|
||||||
|
// 开始
|
||||||
|
if(this.interpretationScheme != null){
|
||||||
|
List<Point> forXBar = new ArrayList<>();
|
||||||
|
List<Point> forS = new ArrayList<>();
|
||||||
|
for(XbarSPoint x:list){
|
||||||
|
forXBar.add(new Point(x.getPosition(),x.getXbar()));
|
||||||
|
forS.add(new Point(x.getPosition(),x.getS()));
|
||||||
}
|
}
|
||||||
|
ControlLimit xbarcl = getXbarCL();
|
||||||
|
ControlLimit scl = getSCL();
|
||||||
|
|
||||||
|
for(InterpretationListArg arg : this.interpretationScheme){
|
||||||
|
switch (arg.getNumber())//值必须是整型或者字符型
|
||||||
|
{
|
||||||
|
case 1:
|
||||||
|
StatisticalControlledTest.rule1(forXBar,xbarcl);
|
||||||
|
StatisticalControlledTest.rule1(forS,scl);
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
StatisticalControlledTest.rule2(forXBar,xbarcl,arg.getArg1());
|
||||||
|
StatisticalControlledTest.rule2(forS,scl,arg.getArg1());
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
StatisticalControlledTest.rule3(forXBar,arg.getArg1());
|
||||||
|
StatisticalControlledTest.rule3(forS,arg.getArg1());
|
||||||
|
break;
|
||||||
|
case 4:
|
||||||
|
StatisticalControlledTest.rule4(forXBar,arg.getArg1());
|
||||||
|
StatisticalControlledTest.rule4(forS,arg.getArg1());
|
||||||
|
break;
|
||||||
|
case 5:
|
||||||
|
StatisticalControlledTest.rule5(forXBar,xbarcl,arg.getArg1(), arg.getArg2());
|
||||||
|
StatisticalControlledTest.rule5(forS,scl,arg.getArg1(), arg.getArg2());
|
||||||
|
break;
|
||||||
|
case 6:
|
||||||
|
StatisticalControlledTest.rule6(forXBar,xbarcl,arg.getArg1(), arg.getArg2());
|
||||||
|
StatisticalControlledTest.rule6(forS,scl,arg.getArg1(), arg.getArg2());
|
||||||
|
break;
|
||||||
|
case 7:
|
||||||
|
StatisticalControlledTest.rule7(forXBar,xbarcl,arg.getArg1());
|
||||||
|
StatisticalControlledTest.rule7(forS,scl, arg.getArg1());
|
||||||
|
|
||||||
|
break;
|
||||||
|
case 8:
|
||||||
|
StatisticalControlledTest.rule8(forXBar,xbarcl, arg.getArg1());
|
||||||
|
StatisticalControlledTest.rule8(forS,scl, arg.getArg1());
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for(int i=0;i<list.size();i++){
|
||||||
|
list.get(i).setsUnsatisfiedRules(forS.get(i).getUnsatisfiedRules());
|
||||||
|
list.get(i).setXbarUnsatisfiedRules(forXBar.get(i).getUnsatisfiedRules());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 结束
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* desc: get Xbar控制图 的控制限
|
* desc: get Xbar控制图 的控制限
|
||||||
|
@ -1,10 +1,7 @@
|
|||||||
package com.cnbm.qualityPlanning.common;
|
package com.cnbm.qualityPlanning.common;
|
||||||
|
|
||||||
|
|
||||||
import com.cnbm.qualityPlanning.entity.ControlLimit;
|
import com.cnbm.qualityPlanning.entity.*;
|
||||||
import com.cnbm.qualityPlanning.entity.ControlLimitDetail;
|
|
||||||
import com.cnbm.qualityPlanning.entity.Point;
|
|
||||||
import com.cnbm.qualityPlanning.entity.XbarSPoint;
|
|
||||||
|
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
@ -66,28 +63,51 @@ public class StatisticalControlledTest {
|
|||||||
}
|
}
|
||||||
public static List<Point> createData2(){
|
public static List<Point> createData2(){
|
||||||
XbarSPoint point = new XbarSPoint(1, new Double(2.5));
|
XbarSPoint point = new XbarSPoint(1, new Double(2.5));
|
||||||
|
point.setS(new Double(2.5));
|
||||||
XbarSPoint point2 = new XbarSPoint(2, new Double(2.5));
|
XbarSPoint point2 = new XbarSPoint(2, new Double(2.5));
|
||||||
|
point2.setS(new Double(2.5));
|
||||||
XbarSPoint point3 = new XbarSPoint(3, new Double(2.5));
|
XbarSPoint point3 = new XbarSPoint(3, new Double(2.5));
|
||||||
|
point3.setS(new Double(2.5));
|
||||||
XbarSPoint point4 = new XbarSPoint(4, new Double(2.5));
|
XbarSPoint point4 = new XbarSPoint(4, new Double(2.5));
|
||||||
|
point4.setS(new Double(2.5));
|
||||||
XbarSPoint point5 = new XbarSPoint(5, new Double(2.5));
|
XbarSPoint point5 = new XbarSPoint(5, new Double(2.5));
|
||||||
|
point5.setS(new Double(2.5));
|
||||||
XbarSPoint point6 = new XbarSPoint(6, new Double(2.5));
|
XbarSPoint point6 = new XbarSPoint(6, new Double(2.5));
|
||||||
|
point6.setS(new Double(2.5));
|
||||||
XbarSPoint point7 = new XbarSPoint(7, new Double(2.5));
|
XbarSPoint point7 = new XbarSPoint(7, new Double(2.5));
|
||||||
|
point7.setS(new Double(2.5));
|
||||||
XbarSPoint point8 = new XbarSPoint(8, new Double(2));
|
XbarSPoint point8 = new XbarSPoint(8, new Double(2));
|
||||||
|
point8.setS(new Double(2));
|
||||||
XbarSPoint point9 = new XbarSPoint(9, new Double(2.5));
|
XbarSPoint point9 = new XbarSPoint(9, new Double(2.5));
|
||||||
|
point9.setS(new Double(2.5));
|
||||||
XbarSPoint point10 = new XbarSPoint(10, new Double(2.5));
|
XbarSPoint point10 = new XbarSPoint(10, new Double(2.5));
|
||||||
|
point10.setS(new Double(2.5));
|
||||||
XbarSPoint point11 = new XbarSPoint(11, new Double(2.5));
|
XbarSPoint point11 = new XbarSPoint(11, new Double(2.5));
|
||||||
|
point11.setS(new Double(2.5));
|
||||||
XbarSPoint point12 = new XbarSPoint(12, new Double(2.5));
|
XbarSPoint point12 = new XbarSPoint(12, new Double(2.5));
|
||||||
|
point12.setS(new Double(2.5));
|
||||||
XbarSPoint point13 = new XbarSPoint(13,new Double(2.5));
|
XbarSPoint point13 = new XbarSPoint(13,new Double(2.5));
|
||||||
|
point13.setS(new Double(2.5));
|
||||||
XbarSPoint point14 = new XbarSPoint(14,new Double(2.5));
|
XbarSPoint point14 = new XbarSPoint(14,new Double(2.5));
|
||||||
|
point14.setS(new Double(2.5));
|
||||||
XbarSPoint point15 = new XbarSPoint(15,new Double(2.5));
|
XbarSPoint point15 = new XbarSPoint(15,new Double(2.5));
|
||||||
|
point15.setS(new Double(2.5));
|
||||||
XbarSPoint point16 = new XbarSPoint(16,new Double(2));
|
XbarSPoint point16 = new XbarSPoint(16,new Double(2));
|
||||||
|
point16.setS(new Double(2));
|
||||||
XbarSPoint point17 = new XbarSPoint(17,new Double(2.5));
|
XbarSPoint point17 = new XbarSPoint(17,new Double(2.5));
|
||||||
|
point17.setS(new Double(2.5));
|
||||||
XbarSPoint point18 = new XbarSPoint(18,new Double(2.5));
|
XbarSPoint point18 = new XbarSPoint(18,new Double(2.5));
|
||||||
|
point18.setS(new Double(2.5));
|
||||||
XbarSPoint point19 = new XbarSPoint(19,new Double(2.5));
|
XbarSPoint point19 = new XbarSPoint(19,new Double(2.5));
|
||||||
|
point19.setS(new Double(2.5));
|
||||||
XbarSPoint point20 = new XbarSPoint(20,new Double(2.5));
|
XbarSPoint point20 = new XbarSPoint(20,new Double(2.5));
|
||||||
|
point20.setS(new Double(2.5));
|
||||||
XbarSPoint point21 = new XbarSPoint(21,new Double(2.5));
|
XbarSPoint point21 = new XbarSPoint(21,new Double(2.5));
|
||||||
|
point21.setS(new Double(2.5));
|
||||||
XbarSPoint point22 = new XbarSPoint(22,new Double(2.5));
|
XbarSPoint point22 = new XbarSPoint(22,new Double(2.5));
|
||||||
|
point22.setS(new Double(2.5));
|
||||||
XbarSPoint point23 = new XbarSPoint(23,new Double(2.5));
|
XbarSPoint point23 = new XbarSPoint(23,new Double(2.5));
|
||||||
|
point23.setS(new Double(2.5));
|
||||||
List<Point> list = new ArrayList<>();
|
List<Point> list = new ArrayList<>();
|
||||||
list.add(point);
|
list.add(point);
|
||||||
list.add(point2);
|
list.add(point2);
|
||||||
@ -114,10 +134,107 @@ public class StatisticalControlledTest {
|
|||||||
list.add(point23);
|
list.add(point23);
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
public static List<XbarSPoint> createData3(){
|
||||||
|
XbarSPoint point = new XbarSPoint(1, new Double(2.5));
|
||||||
|
point.setS(new Double(0.5));
|
||||||
|
point.setXbar(new Double(2.5));
|
||||||
|
XbarSPoint point2 = new XbarSPoint(2, new Double(2.5));
|
||||||
|
point2.setS(new Double(0.5));
|
||||||
|
point2.setXbar(new Double(2.5));
|
||||||
|
XbarSPoint point3 = new XbarSPoint(3, new Double(2.5));
|
||||||
|
point3.setS(new Double(0.5));
|
||||||
|
point3.setXbar(new Double(2.5));
|
||||||
|
XbarSPoint point4 = new XbarSPoint(4, new Double(2.5));
|
||||||
|
point4.setS(new Double(0.5));
|
||||||
|
point4.setXbar(new Double(2.5));
|
||||||
|
XbarSPoint point5 = new XbarSPoint(5, new Double(2.5));
|
||||||
|
point5.setS(new Double(0.5));
|
||||||
|
point5.setXbar(new Double(2.5));
|
||||||
|
XbarSPoint point6 = new XbarSPoint(6, new Double(2.5));
|
||||||
|
point6.setS(new Double(5));
|
||||||
|
point6.setXbar(new Double(5));
|
||||||
|
XbarSPoint point7 = new XbarSPoint(7, new Double(2.5));
|
||||||
|
point7.setS(new Double(20.5));
|
||||||
|
point7.setXbar(new Double(20.5));
|
||||||
|
XbarSPoint point8 = new XbarSPoint(8, new Double(2));
|
||||||
|
point8.setS(new Double(2));
|
||||||
|
point8.setXbar(new Double(2.5));
|
||||||
|
XbarSPoint point9 = new XbarSPoint(9, new Double(2.5));
|
||||||
|
point9.setS(new Double(2.5));
|
||||||
|
point9.setXbar(new Double(2.5));
|
||||||
|
XbarSPoint point10 = new XbarSPoint(10, new Double(2.5));
|
||||||
|
point10.setS(new Double(2.5));
|
||||||
|
point10.setXbar(new Double(2.5));
|
||||||
|
XbarSPoint point11 = new XbarSPoint(11, new Double(2.5));
|
||||||
|
point11.setS(new Double(2.5));
|
||||||
|
point11.setXbar(new Double(2.5));
|
||||||
|
XbarSPoint point12 = new XbarSPoint(12, new Double(2.5));
|
||||||
|
point12.setS(new Double(2.5));
|
||||||
|
point12.setXbar(new Double(2.5));
|
||||||
|
XbarSPoint point13 = new XbarSPoint(13,new Double(2.5));
|
||||||
|
point13.setS(new Double(30.5));
|
||||||
|
point13.setXbar(new Double(30.5));
|
||||||
|
XbarSPoint point14 = new XbarSPoint(14,new Double(2.5));
|
||||||
|
point14.setS(new Double(2.5));
|
||||||
|
point14.setXbar(new Double(2.5));
|
||||||
|
XbarSPoint point15 = new XbarSPoint(15,new Double(2.5));
|
||||||
|
point15.setS(new Double(7));
|
||||||
|
point15.setXbar(new Double(2.5));
|
||||||
|
XbarSPoint point16 = new XbarSPoint(16,new Double(2));
|
||||||
|
point16.setS(new Double(7));
|
||||||
|
point16.setXbar(new Double(2.5));
|
||||||
|
XbarSPoint point17 = new XbarSPoint(17,new Double(2.5));
|
||||||
|
point17.setS(new Double(7));
|
||||||
|
point17.setXbar(new Double(2.5));
|
||||||
|
XbarSPoint point18 = new XbarSPoint(18,new Double(2.5));
|
||||||
|
point18.setS(new Double(7));
|
||||||
|
point18.setXbar(new Double(2.5));
|
||||||
|
XbarSPoint point19 = new XbarSPoint(19,new Double(2.5));
|
||||||
|
point19.setS(new Double(7));
|
||||||
|
point19.setXbar(new Double(2.5));
|
||||||
|
XbarSPoint point20 = new XbarSPoint(20,new Double(2.5));
|
||||||
|
point20.setS(new Double(7));
|
||||||
|
point20.setXbar(new Double(2.5));
|
||||||
|
XbarSPoint point21 = new XbarSPoint(21,new Double(2.5));
|
||||||
|
point21.setS(new Double(7));
|
||||||
|
point21.setXbar(new Double(2.5));
|
||||||
|
XbarSPoint point22 = new XbarSPoint(22,new Double(2.5));
|
||||||
|
point22.setS(new Double(7));
|
||||||
|
point22.setXbar(new Double(2.5));
|
||||||
|
XbarSPoint point23 = new XbarSPoint(23,new Double(2.5));
|
||||||
|
point23.setS(new Double(7));
|
||||||
|
point23.setXbar(new Double(2.5));
|
||||||
|
List<XbarSPoint> list = new ArrayList<>();
|
||||||
|
list.add(point);
|
||||||
|
list.add(point2);
|
||||||
|
list.add(point3);
|
||||||
|
list.add(point4);
|
||||||
|
list.add(point5);
|
||||||
|
list.add(point6);
|
||||||
|
list.add(point7);
|
||||||
|
list.add(point8);
|
||||||
|
list.add(point9);
|
||||||
|
list.add(point10);
|
||||||
|
list.add(point11);
|
||||||
|
list.add(point12);
|
||||||
|
list.add(point13);
|
||||||
|
list.add(point14);
|
||||||
|
list.add(point15);
|
||||||
|
list.add(point16);
|
||||||
|
list.add(point17);
|
||||||
|
list.add(point18);
|
||||||
|
list.add(point19);
|
||||||
|
list.add(point20);
|
||||||
|
list.add(point21);
|
||||||
|
list.add(point22);
|
||||||
|
list.add(point23);
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
// List<Point> list = createData();
|
// List<Point> list = createData();
|
||||||
List<Point> list = createData2();
|
List<Point> list = createData2();
|
||||||
|
|
||||||
ControlLimit controlLimit = new ControlLimit(new Double(12),new Double(3),new Double(1));
|
ControlLimit controlLimit = new ControlLimit(new Double(12),new Double(3),new Double(1));
|
||||||
System.out.println("controlLimit : "+controlLimit.toString());
|
System.out.println("controlLimit : "+controlLimit.toString());
|
||||||
//
|
//
|
||||||
@ -154,8 +271,8 @@ public class StatisticalControlledTest {
|
|||||||
// System.out.println();
|
// System.out.println();
|
||||||
|
|
||||||
//TEST FOR RULE8
|
//TEST FOR RULE8
|
||||||
Boolean aBoolean8 = rule8(list, controlLimit,8);
|
// Boolean aBoolean8 = rule8(list, controlLimit,8);
|
||||||
System.out.println();
|
// System.out.println();
|
||||||
|
|
||||||
// int[] array={1,2,3,4,5,6};
|
// int[] array={1,2,3,4,5,6};
|
||||||
// int[] ret=new int[3];
|
// int[] ret=new int[3];
|
||||||
@ -172,7 +289,7 @@ public class StatisticalControlledTest {
|
|||||||
* 存在满足rule1的点 => true
|
* 存在满足rule1的点 => true
|
||||||
* 不存在满足rule1的点 => false
|
* 不存在满足rule1的点 => false
|
||||||
* */
|
* */
|
||||||
private static Boolean rule1(List<Point> data, ControlLimit controlLimit){
|
public static Boolean rule1(List<Point> data, ControlLimit controlLimit){
|
||||||
Boolean flag = false;
|
Boolean flag = false;
|
||||||
for(Point i:data){
|
for(Point i:data){
|
||||||
if(i.getValueForInterpretation() > controlLimit.getUCL() || i.getValueForInterpretation() < controlLimit.getLCL()){
|
if(i.getValueForInterpretation() > controlLimit.getUCL() || i.getValueForInterpretation() < controlLimit.getLCL()){
|
||||||
@ -198,7 +315,7 @@ public class StatisticalControlledTest {
|
|||||||
* 存在满足rule2的点 => true
|
* 存在满足rule2的点 => true
|
||||||
* 不存在满足rule2的点 => false
|
* 不存在满足rule2的点 => false
|
||||||
* */
|
* */
|
||||||
private static Boolean rule2(List<Point> data, ControlLimit controlLimit,Integer n){
|
public static Boolean rule2(List<Point> data, ControlLimit controlLimit,Integer n){
|
||||||
Boolean result = false;
|
Boolean result = false;
|
||||||
|
|
||||||
List<Point> upList = new ArrayList<>();
|
List<Point> upList = new ArrayList<>();
|
||||||
@ -300,7 +417,7 @@ public class StatisticalControlledTest {
|
|||||||
* 存在满足rule3的点 => true
|
* 存在满足rule3的点 => true
|
||||||
* 不存在满足rule3的点 => false
|
* 不存在满足rule3的点 => false
|
||||||
* */
|
* */
|
||||||
private static Boolean rule3(List<Point> data, Integer n){
|
public static Boolean rule3(List<Point> data, Integer n){
|
||||||
|
|
||||||
//递增情况
|
//递增情况
|
||||||
Integer upi = 0;
|
Integer upi = 0;
|
||||||
@ -362,7 +479,7 @@ public class StatisticalControlledTest {
|
|||||||
* 存在满足rule4的点 => true
|
* 存在满足rule4的点 => true
|
||||||
* 不存在满足rule4的点 => false
|
* 不存在满足rule4的点 => false
|
||||||
* */
|
* */
|
||||||
private static Boolean rule4(List<Point> data, Integer n){
|
public static Boolean rule4(List<Point> data, Integer n){
|
||||||
if(n<=2){
|
if(n<=2){
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -499,7 +616,7 @@ public class StatisticalControlledTest {
|
|||||||
* 存在满足rule5的点 => true
|
* 存在满足rule5的点 => true
|
||||||
* 不存在满足rule5的点 => false
|
* 不存在满足rule5的点 => false
|
||||||
* */
|
* */
|
||||||
private static Boolean rule5(List<Point> data,ControlLimit controlLimit, Integer m, Integer n){
|
public static Boolean rule5(List<Point> data,ControlLimit controlLimit, Integer m, Integer n){
|
||||||
Boolean result = false;
|
Boolean result = false;
|
||||||
Integer upi = 0;
|
Integer upi = 0;
|
||||||
List<Point> upforMarkKey = new ArrayList<>();
|
List<Point> upforMarkKey = new ArrayList<>();
|
||||||
@ -572,7 +689,7 @@ public class StatisticalControlledTest {
|
|||||||
* 存在满足rule6的点 => true
|
* 存在满足rule6的点 => true
|
||||||
* 不存在满足rule6的点 => false
|
* 不存在满足rule6的点 => false
|
||||||
* */
|
* */
|
||||||
private static Boolean rule6(List<Point> data,ControlLimit controlLimit, Integer m, Integer n){
|
public static Boolean rule6(List<Point> data,ControlLimit controlLimit, Integer m, Integer n){
|
||||||
Boolean result = false;
|
Boolean result = false;
|
||||||
Integer upi = 0;
|
Integer upi = 0;
|
||||||
List<Point> upforMarkKey = new ArrayList<>();
|
List<Point> upforMarkKey = new ArrayList<>();
|
||||||
@ -649,7 +766,7 @@ public class StatisticalControlledTest {
|
|||||||
* 存在满足rule7的点 => true
|
* 存在满足rule7的点 => true
|
||||||
* 不存在满足rule7的点 => false
|
* 不存在满足rule7的点 => false
|
||||||
* */
|
* */
|
||||||
private static Boolean rule7(List<Point> data,ControlLimit controlLimit, Integer n){
|
public static Boolean rule7(List<Point> data,ControlLimit controlLimit, Integer n){
|
||||||
|
|
||||||
Boolean result = false;
|
Boolean result = false;
|
||||||
|
|
||||||
@ -715,7 +832,7 @@ public class StatisticalControlledTest {
|
|||||||
* 存在满足rule8的点 => true
|
* 存在满足rule8的点 => true
|
||||||
* 不存在满足rule8的点 => false
|
* 不存在满足rule8的点 => false
|
||||||
* */
|
* */
|
||||||
private static Boolean rule8(List<Point> data,ControlLimit controlLimit, Integer n){
|
public static Boolean rule8(List<Point> data,ControlLimit controlLimit, Integer n){
|
||||||
|
|
||||||
Boolean result = true;
|
Boolean result = true;
|
||||||
//Integer upi = 0;
|
//Integer upi = 0;
|
||||||
|
@ -0,0 +1,20 @@
|
|||||||
|
package com.cnbm.qualityPlanning.entity;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Desc: ""
|
||||||
|
* @Author: caixiang
|
||||||
|
* @DATE: 2022/7/27 15:56
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class InterpretationListArg {
|
||||||
|
private Integer number;
|
||||||
|
private Integer arg1;
|
||||||
|
private Integer arg2;
|
||||||
|
public InterpretationListArg(Integer number,Integer arg1,Integer arg2){
|
||||||
|
this.number = number;
|
||||||
|
this.arg1 = arg1;
|
||||||
|
this.arg2 = arg2;
|
||||||
|
}
|
||||||
|
}
|
@ -10,7 +10,6 @@ import java.util.Set;
|
|||||||
* @Author: caixiang
|
* @Author: caixiang
|
||||||
* @DATE: 2022/7/12 15:12
|
* @DATE: 2022/7/12 15:12
|
||||||
*/
|
*/
|
||||||
@Data
|
|
||||||
public class Point {
|
public class Point {
|
||||||
private Integer position;
|
private Integer position;
|
||||||
private Double valueForInterpretation;
|
private Double valueForInterpretation;
|
||||||
@ -24,4 +23,28 @@ public class Point {
|
|||||||
this.unsatisfiedRules = new HashSet();
|
this.unsatisfiedRules = new HashSet();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Integer getPosition() {
|
||||||
|
return position;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPosition(Integer position) {
|
||||||
|
this.position = position;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Double getValueForInterpretation() {
|
||||||
|
return valueForInterpretation;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setValueForInterpretation(Double valueForInterpretation) {
|
||||||
|
this.valueForInterpretation = valueForInterpretation;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Set<Integer> getUnsatisfiedRules() {
|
||||||
|
|
||||||
|
return unsatisfiedRules;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUnsatisfiedRules(Set<Integer> unsatisfiedRules) {
|
||||||
|
this.unsatisfiedRules = unsatisfiedRules;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
package com.cnbm.qualityPlanning.entity;
|
package com.cnbm.qualityPlanning.entity;
|
||||||
|
|
||||||
|
import io.swagger.models.auth.In;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
@ -18,9 +20,40 @@ public class XbarSPoint extends Point {
|
|||||||
public XbarSPoint(Integer position, Double value) {
|
public XbarSPoint(Integer position, Double value) {
|
||||||
super(position, value);
|
super(position, value);
|
||||||
}
|
}
|
||||||
//
|
//s 不满足 的 判读方案
|
||||||
|
private Set<Integer> sUnsatisfiedRules;
|
||||||
|
//xbar 不满足 的 判读方案
|
||||||
|
private Set<Integer> xbarUnsatisfiedRules;
|
||||||
|
|
||||||
|
|
||||||
|
private void setValueToTest(Double value){
|
||||||
|
setValueForInterpretation(value);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Set<Integer> getsUnsatisfiedRules() {
|
||||||
|
return sUnsatisfiedRules;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setsUnsatisfiedRules(Set<Integer> sUnsatisfiedRules) {
|
||||||
|
this.sUnsatisfiedRules = sUnsatisfiedRules;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Set<Integer> getXbarUnsatisfiedRules() {
|
||||||
|
return xbarUnsatisfiedRules;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setXbarUnsatisfiedRules(Set<Integer> xbarUnsatisfiedRules) {
|
||||||
|
this.xbarUnsatisfiedRules = xbarUnsatisfiedRules;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<Double> getData() {
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setData(List<Double> data) {
|
||||||
|
this.data = data;
|
||||||
|
}
|
||||||
|
|
||||||
public Double getXbar() {
|
public Double getXbar() {
|
||||||
return xbar;
|
return xbar;
|
||||||
}
|
}
|
||||||
@ -45,11 +78,12 @@ public class XbarSPoint extends Point {
|
|||||||
this.r = r;
|
this.r = r;
|
||||||
}
|
}
|
||||||
|
|
||||||
public XbarSPoint(Integer position, Double value, Double xbar, Double s, Double r) {
|
public XbarSPoint(Integer position, Double value, Double xbar, Double s, Double r,List<Double> data) {
|
||||||
super(position,value);
|
super(position,value);
|
||||||
this.xbar = xbar;
|
this.xbar = xbar;
|
||||||
this.s = s;
|
this.s = s;
|
||||||
this.r = r;
|
this.r = r;
|
||||||
|
this.data = data;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
Loading…
Reference in New Issue
Block a user