Merge branch 'master' of http://git.picaiba.com/CaiXiang/SPC into yanyang

 Conflicts:
	ym-influx/src/main/java/com/cnbm/influx/config/InfluxClient.java
	ym-influx/src/main/java/com/cnbm/influx/controller/S7DemoController.java
	ym-influx/src/main/java/com/cnbm/influx/template/Event.java
This commit is contained in:
2022-12-01 15:54:41 +08:00
31 changed files with 2118 additions and 448 deletions

View File

@@ -6,10 +6,13 @@ 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;
@@ -18,6 +21,9 @@ import com.cnbm.processInspection.graphAnalyzed.forCount.u.UGraph;
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;
@@ -30,6 +36,7 @@ import org.springframework.web.bind.annotation.RestController;
import java.time.Instant;
import java.util.ArrayList;
import java.util.List;
import java.util.Random;
@RestController
@RequestMapping("/processInspection")
@@ -42,9 +49,9 @@ public class ProcessInspectionController {
@PostMapping("/XbarSGraphTest")
public R<XbarSGraphData> xbarSGraphTest() throws Exception {
ProductFeatures productFeatures = new ProductFeatures();
productFeatures.setSl(new Float(5));
productFeatures.setUsl(new Float(10));
productFeatures.setLsl(new Float(1));
productFeatures.setSl(new Float(65));
productFeatures.setUsl(new Float(66));
productFeatures.setLsl(new Float(69));
productFeatures.setName("LTWeight");
productFeatures.setSampleSize(10);
@@ -58,16 +65,16 @@ public class ProcessInspectionController {
QueryDataParam queryDataParam = new QueryDataParam();
queryDataParam.setMeasurement(Constant.measurement);
queryDataParam.setRange(new Range(DataUtils.getBeforeDate(10).toInstant(), Instant.now()));
queryDataParam.setRange(new Range(DataUtils.getBeforeDate(999).toInstant(), DataUtils.getAfterDate(999).toInstant() ));
meanStandardDeviationGraph.initialDate(queryDataParam);
XbarSGraphData xbarSGraphData = new XbarSGraphData(
meanStandardDeviationGraph.getMsdGraphEntity(),
meanStandardDeviationGraph.getXbarCL(),
meanStandardDeviationGraph.getSCL(),
meanStandardDeviationGraph.getSpecificationLimit(),
meanStandardDeviationGraph.getProcessCapacity(),
new StandardDiviation(meanStandardDeviationGraph.getXigma(),meanStandardDeviationGraph.getTotalXigma())
meanStandardDeviationGraph.getMsdGraphEntity()==null?null:meanStandardDeviationGraph.getMsdGraphEntity(),
meanStandardDeviationGraph.getXbarCL()==null?null:new ControlLimitDetail(meanStandardDeviationGraph.getXbarCL().getUCL(), meanStandardDeviationGraph.getXbarCL().getCL(), meanStandardDeviationGraph.getXbarCL().getLCL()),
meanStandardDeviationGraph.getSCL()==null?null:new ControlLimitDetail(meanStandardDeviationGraph.getSCL().getUCL(), meanStandardDeviationGraph.getSCL().getCL(), meanStandardDeviationGraph.getSCL().getLCL()),
meanStandardDeviationGraph.getSpecificationLimit()==null?null:meanStandardDeviationGraph.getSpecificationLimit(),
meanStandardDeviationGraph.getProcessCapacity()==null?null:meanStandardDeviationGraph.getProcessCapacity(),
(meanStandardDeviationGraph.getXigma()==null||meanStandardDeviationGraph.getTotalXigma()==null)?null:new StandardDiviation(meanStandardDeviationGraph.getXigma(),meanStandardDeviationGraph.getTotalXigma())
);
return R.ok("成功",xbarSGraphData);
@@ -75,10 +82,11 @@ public class ProcessInspectionController {
@PostMapping("/XbarRGraphTest")
public R<XbarRGraphData> XbarRGraphTest() throws Exception {
//todo SL/USL/LSL 和 sampleSize 需要从外面传过来。
ProductFeatures productFeatures = new ProductFeatures();
productFeatures.setSl(new Float(5));
productFeatures.setUsl(new Float(10));
productFeatures.setLsl(new Float(1));
productFeatures.setSl(new Float(65));
productFeatures.setUsl(new Float(66));
productFeatures.setLsl(new Float(69));
productFeatures.setName("LTWeight");
productFeatures.setSampleSize(10);
@@ -92,16 +100,18 @@ public class ProcessInspectionController {
QueryDataParam queryDataParam = new QueryDataParam();
queryDataParam.setMeasurement(Constant.measurement);
queryDataParam.setRange(new Range(DataUtils.getBeforeDate(10).toInstant(), Instant.now()));
queryDataParam.setRange(new Range(DataUtils.getBeforeDate(999).toInstant(), DataUtils.getAfterDate(999).toInstant() ));
meanRGraph.initialDate(queryDataParam);
XbarRGraphData xbarSGraphData = new XbarRGraphData(
meanRGraph.getMrGraphEntity(),
meanRGraph.getXbarCL(),
meanRGraph.getRCL(),
meanRGraph.getSpecificationLimit(),
meanRGraph.getProcessCapacity(),
new StandardDiviation(meanRGraph.getXigma(),meanRGraph.getTotalXigma())
meanRGraph.getMrGraphEntity()==null?null:meanRGraph.getMrGraphEntity(),
meanRGraph.getXbarCL()==null?null:new ControlLimitDetail(meanRGraph.getXbarCL().getUCL(), meanRGraph.getXbarCL().getCL(), meanRGraph.getXbarCL().getLCL()),
meanRGraph.getRCL()==null?null:new ControlLimitDetail(meanRGraph.getRCL().getUCL(), meanRGraph.getRCL().getCL(), meanRGraph.getRCL().getLCL()),
meanRGraph.getSpecificationLimit()==null?null:meanRGraph.getSpecificationLimit(),
meanRGraph.getProcessCapacity()==null?null:meanRGraph.getProcessCapacity(),
(meanRGraph.getXigma()==null||meanRGraph.getTotalXigma()==null)?null:new StandardDiviation(meanRGraph.getXigma(),meanRGraph.getTotalXigma())
);
return R.ok("成功",xbarSGraphData);
@@ -109,9 +119,9 @@ public class ProcessInspectionController {
@PostMapping("/XMRGraphTest")
public R<XMRGraphData> XMRGraphTest() throws Exception {
ProductFeatures productFeatures = new ProductFeatures();
productFeatures.setSl(new Float(5));
productFeatures.setUsl(new Float(10));
productFeatures.setLsl(new Float(1));
productFeatures.setSl(new Float(65));
productFeatures.setUsl(new Float(66));
productFeatures.setLsl(new Float(69));
productFeatures.setName("LTWeight");
productFeatures.setSampleSize(1);
@@ -125,41 +135,81 @@ public class ProcessInspectionController {
QueryDataParam queryDataParam = new QueryDataParam();
queryDataParam.setMeasurement(Constant.measurement);
queryDataParam.setRange(new Range(DataUtils.getBeforeDate(10).toInstant(), Instant.now()));
queryDataParam.setRange(new Range(DataUtils.getBeforeDate(999).toInstant(), DataUtils.getAfterDate(999).toInstant() ));
xmrGraph.initialDate(queryDataParam);
XMRGraphData xmrGraphData = new XMRGraphData(
xmrGraph.getXmrGraphEntity(),
xmrGraph.getXCL(),
xmrGraph.getRSCL(),
xmrGraph.getSpecificationLimit(),
xmrGraph.getProcessCapacity(),
new StandardDiviation(xmrGraph.getXigma(),xmrGraph.getTotalXigma())
xmrGraph.getXmrGraphEntity()==null?null:xmrGraph.getXmrGraphEntity(),
xmrGraph.getXCL()==null?null:new ControlLimitDetail(xmrGraph.getXCL().getUCL(), xmrGraph.getXCL().getCL(), xmrGraph.getXCL().getLCL()),
xmrGraph.getRSCL()==null?null:new ControlLimitDetail(xmrGraph.getRSCL().getUCL(), xmrGraph.getRSCL().getCL(), xmrGraph.getRSCL().getLCL()),
xmrGraph.getSpecificationLimit()==null?null:xmrGraph.getSpecificationLimit(),
xmrGraph.getProcessCapacity()==null?null:xmrGraph.getProcessCapacity(),
(xmrGraph.getXigma()==null||xmrGraph.getTotalXigma()==null)?null:new StandardDiviation(xmrGraph.getXigma(),xmrGraph.getTotalXigma())
);
return R.ok("成功",xmrGraphData);
}
@PostMapping("/getBatchs")
public R<List<String>> getBatchs() throws InterruptedException {
List<Event> list = new ArrayList<>();
Random r = new Random();
Instant instant = DataUtils.getBeforeDate(400).toInstant();
List<String> res = new ArrayList<>();
QueryDataParam queryDataParam = new QueryDataParam();
queryDataParam.setBucket("qgs-bucket");
queryDataParam.setMeasurement("Weight");
List<String> dropNames = new ArrayList<>();
dropNames.add("transationId");
dropNames.add("_value");
dropNames.add("_start");
dropNames.add("_stop");
dropNames.add("_time");
dropNames.add("_field");
dropNames.add("_measurement");
dropNames.add("inspectionSheetId");
dropNames.add("argName");
queryDataParam.setDropedTagNames(dropNames);
queryDataParam.setTag(new Tag("argName","LTWeight"));
queryDataParam.setRange(new Range(DataUtils.getBeforeDate(100).toInstant(),Instant.now()));
// queryDataParam.setPageInfo(new PageInfo(1,10));
List<FluxTable> query = InfluxClient.Client.queryByGroup(queryDataParam);
for (FluxTable fluxTable : query) {
List<FluxRecord> records = fluxTable.getRecords();
if(records.size()!=0){
res.add((String) records.get(0).getValueByKey("batchNum"));
continue;
}
}
return R.ok(res);
}
@PostMapping("/NPGraphTest")
public R<NPGraphData> NPGraphTest() throws Exception {
ProductFeatures productFeatures = new ProductFeatures();
productFeatures.setSl(new Float(5));
productFeatures.setUsl(new Float(10));
productFeatures.setLsl(new Float(1));
productFeatures.setSl(new Float(65));
productFeatures.setUsl(new Float(66));
productFeatures.setLsl(new Float(69));
productFeatures.setName("LostDays");
productFeatures.setName("failDay");
NPGraph npGraph = new NPGraph(productFeatures);
QueryDataGroupByTimeParam queryDataParam = new QueryDataGroupByTimeParam();
queryDataParam.setMeasurement(Constant.measurement);
queryDataParam.setRange(new Range( Instant.now() , DataUtils.getAfterDate(999).toInstant() ));
queryDataParam.setTimeType(1);
queryDataParam.setRange(new Range(DataUtils.getBeforeDate(9999).toInstant(), DataUtils.getAfterDate(9999).toInstant() ));
queryDataParam.setTimeType(2);
npGraph.initialDate(queryDataParam);
NPGraphData npGraph1 = new NPGraphData(
npGraph.getList(),
npGraph.getSpecificationLimit(),
npGraph.getArgName()
npGraph.getList()==null?null:npGraph.getList(),
npGraph.getSpecificationLimit()==null?null:npGraph.getSpecificationLimit(),
npGraph.getArgName()==null?null:npGraph.getArgName()
);
return R.ok("成功",npGraph1);
@@ -167,24 +217,24 @@ public class ProcessInspectionController {
@PostMapping("/PGraphTest")
public R<PGraphData> PGraphTest() throws Exception {
ProductFeatures productFeatures = new ProductFeatures();
productFeatures.setSl(new Float(5));
productFeatures.setUsl(new Float(10));
productFeatures.setLsl(new Float(1));
productFeatures.setSl(new Float(65));
productFeatures.setUsl(new Float(66));
productFeatures.setLsl(new Float(69));
productFeatures.setName("LostDays");
productFeatures.setName("LTWeight");
PGraph pGraph = new PGraph(productFeatures);
QueryDataGroupByTimeParam queryDataParam = new QueryDataGroupByTimeParam();
queryDataParam.setMeasurement(Constant.measurement);
queryDataParam.setRange(new Range( Instant.now() , DataUtils.getAfterDate(999).toInstant() ));
queryDataParam.setRange(new Range(DataUtils.getBeforeDate(999).toInstant(), DataUtils.getAfterDate(999).toInstant() ));
queryDataParam.setTimeType(2);
pGraph.initialDate(queryDataParam);
PGraphData npGraph1 = new PGraphData(
pGraph.getList(),
pGraph.getSpecificationLimit(),
pGraph.getArgName()
pGraph.getList()==null?null:pGraph.getList(),
pGraph.getSpecificationLimit()==null?null:pGraph.getSpecificationLimit(),
pGraph.getArgName()==null?null:pGraph.getArgName()
);
return R.ok("成功",npGraph1);
@@ -192,24 +242,26 @@ public class ProcessInspectionController {
@PostMapping("/CGraphTest")
public R<CGraphData> CGraphTest() throws Exception {
ProductFeatures productFeatures = new ProductFeatures();
productFeatures.setSl(new Float(5));
productFeatures.setUsl(new Float(10));
productFeatures.setLsl(new Float(1));
productFeatures.setSl(new Float(65));
productFeatures.setUsl(new Float(66));
productFeatures.setLsl(new Float(69));
productFeatures.setName("LostDays");
productFeatures.setName("LTWeight");
CGraph cGraph = new CGraph(productFeatures);
QueryDataGroupByTimeParam queryDataParam = new QueryDataGroupByTimeParam();
//到时候 要看前端 传的这里的measurement 其实就是 设备名。
queryDataParam.setMeasurement(Constant.measurement);
queryDataParam.setRange(new Range( Instant.now() , DataUtils.getAfterDate(999).toInstant() ));
// queryDataParam.setRange(new Range(DataUtils.getBeforeDate(10).toInstant(), Instant.now()));
queryDataParam.setRange(new Range(DataUtils.getBeforeDate(999).toInstant(), DataUtils.getAfterDate(999).toInstant() ));
queryDataParam.setTimeType(2);
cGraph.initialDate(queryDataParam);
CGraphData npGraph1 = new CGraphData(
cGraph.getList(),
cGraph.getSpecificationLimit(),
cGraph.getArgName()
cGraph.getList()==null?null:cGraph.getList(),
cGraph.getSpecificationLimit()==null?null:cGraph.getSpecificationLimit(),
cGraph.getArgName()==null?null:cGraph.getArgName()
);
return R.ok("成功",npGraph1);
@@ -218,24 +270,24 @@ public class ProcessInspectionController {
@PostMapping("/UGraphTest")
public R<UGraphData> UGraphTest() throws Exception {
ProductFeatures productFeatures = new ProductFeatures();
productFeatures.setSl(new Float(5));
productFeatures.setUsl(new Float(10));
productFeatures.setLsl(new Float(1));
productFeatures.setSl(new Float(65));
productFeatures.setUsl(new Float(66));
productFeatures.setLsl(new Float(69));
productFeatures.setName("LostDays");
productFeatures.setName("LTWeight");
UGraph uGraph = new UGraph(productFeatures);
QueryDataGroupByTimeParam queryDataParam = new QueryDataGroupByTimeParam();
queryDataParam.setMeasurement(Constant.measurement);
queryDataParam.setRange(new Range( Instant.now() , DataUtils.getAfterDate(999).toInstant() ));
queryDataParam.setRange(new Range(DataUtils.getBeforeDate(999).toInstant(), DataUtils.getAfterDate(999).toInstant() ));
queryDataParam.setTimeType(2);
uGraph.initialDate(queryDataParam);
UGraphData npGraph1 = new UGraphData(
uGraph.getList(),
uGraph.getSpecificationLimit(),
uGraph.getArgName()
uGraph.getList()==null?null:uGraph.getList(),
uGraph.getSpecificationLimit()==null?null:uGraph.getSpecificationLimit(),
uGraph.getArgName()==null?null:uGraph.getArgName()
);
return R.ok("成功",npGraph1);
@@ -273,12 +325,12 @@ public class ProcessInspectionController {
meanStandardDeviationGraph.initialDate(queryDataParam);
XbarSGraphData xbarSGraphData = new XbarSGraphData(
meanStandardDeviationGraph.getMsdGraphEntity(),
meanStandardDeviationGraph.getXbarCL(),
meanStandardDeviationGraph.getSCL(),
meanStandardDeviationGraph.getSpecificationLimit(),
meanStandardDeviationGraph.getProcessCapacity(),
new StandardDiviation(meanStandardDeviationGraph.getXigma(),meanStandardDeviationGraph.getTotalXigma())
meanStandardDeviationGraph.getMsdGraphEntity()==null?null:meanStandardDeviationGraph.getMsdGraphEntity(),
meanStandardDeviationGraph.getXbarCL()==null?null:new ControlLimitDetail(meanStandardDeviationGraph.getXbarCL().getUCL(), meanStandardDeviationGraph.getXbarCL().getCL(), meanStandardDeviationGraph.getXbarCL().getLCL()),
meanStandardDeviationGraph.getSCL()==null?null:new ControlLimitDetail(meanStandardDeviationGraph.getSCL().getUCL(), meanStandardDeviationGraph.getSCL().getCL(), meanStandardDeviationGraph.getSCL().getLCL()),
meanStandardDeviationGraph.getSpecificationLimit()==null?null:meanStandardDeviationGraph.getSpecificationLimit(),
meanStandardDeviationGraph.getProcessCapacity()==null?null:meanStandardDeviationGraph.getProcessCapacity(),
(meanStandardDeviationGraph.getXigma()==null||meanStandardDeviationGraph.getTotalXigma()==null)?null:new StandardDiviation(meanStandardDeviationGraph.getXigma(),meanStandardDeviationGraph.getTotalXigma())
);
return R.ok("成功",xbarSGraphData);
@@ -300,13 +352,18 @@ public class ProcessInspectionController {
queryDataParam.setRange(new Range(graphArg.getBegin().toInstant(), graphArg.getEnd().toInstant()));
meanRGraph.initialDate(queryDataParam);
XbarRGraphData xbarSGraphData = new XbarRGraphData(
meanRGraph.getMrGraphEntity(),
meanRGraph.getXbarCL(),
meanRGraph.getRCL(),
meanRGraph.getSpecificationLimit(),
meanRGraph.getProcessCapacity(),
new StandardDiviation(meanRGraph.getXigma(),meanRGraph.getTotalXigma())
meanRGraph.getMrGraphEntity()==null?null:meanRGraph.getMrGraphEntity(),
meanRGraph.getXbarCL()==null?null:new ControlLimitDetail(meanRGraph.getXbarCL().getUCL(), meanRGraph.getXbarCL().getCL(), meanRGraph.getXbarCL().getLCL()),
meanRGraph.getRCL()==null?null:new ControlLimitDetail(meanRGraph.getRCL().getUCL(), meanRGraph.getRCL().getCL(), meanRGraph.getRCL().getLCL()),
meanRGraph.getSpecificationLimit()==null?null:meanRGraph.getSpecificationLimit(),
meanRGraph.getProcessCapacity()==null?null:meanRGraph.getProcessCapacity(),
(meanRGraph.getXigma()==null||meanRGraph.getTotalXigma()==null)?null:new StandardDiviation(meanRGraph.getXigma(),meanRGraph.getTotalXigma())
);
return R.ok("成功",xbarSGraphData);
@@ -329,12 +386,13 @@ public class ProcessInspectionController {
xmrGraph.initialDate(queryDataParam);
XMRGraphData xmrGraphData = new XMRGraphData(
xmrGraph.getXmrGraphEntity(),
xmrGraph.getXCL(),
xmrGraph.getRSCL(),
xmrGraph.getSpecificationLimit(),
xmrGraph.getProcessCapacity(),
new StandardDiviation(xmrGraph.getXigma(),xmrGraph.getTotalXigma())
xmrGraph.getXmrGraphEntity()==null?null:xmrGraph.getXmrGraphEntity(),
xmrGraph.getXCL()==null?null:new ControlLimitDetail(xmrGraph.getXCL().getUCL(), xmrGraph.getXCL().getCL(), xmrGraph.getXCL().getLCL()),
xmrGraph.getRSCL()==null?null:new ControlLimitDetail(xmrGraph.getRSCL().getUCL(), xmrGraph.getRSCL().getCL(), xmrGraph.getRSCL().getLCL()),
xmrGraph.getSpecificationLimit()==null?null:xmrGraph.getSpecificationLimit(),
xmrGraph.getProcessCapacity()==null?null:xmrGraph.getProcessCapacity(),
(xmrGraph.getXigma()==null||xmrGraph.getTotalXigma()==null)?null:new StandardDiviation(xmrGraph.getXigma(),xmrGraph.getTotalXigma())
);
return R.ok("成功",xmrGraphData);
@@ -354,9 +412,9 @@ public class ProcessInspectionController {
npGraph.initialDate(queryDataParam);
NPGraphData npGraph1 = new NPGraphData(
npGraph.getList(),
npGraph.getSpecificationLimit(),
npGraph.getArgName()
npGraph.getList()==null?null:npGraph.getList(),
npGraph.getSpecificationLimit()==null?null:npGraph.getSpecificationLimit(),
npGraph.getArgName()==null?null:npGraph.getArgName()
);
return R.ok("成功",npGraph1);
}
@@ -375,9 +433,9 @@ public class ProcessInspectionController {
pGraph.initialDate(queryDataParam);
PGraphData npGraph1 = new PGraphData(
pGraph.getList(),
pGraph.getSpecificationLimit(),
pGraph.getArgName()
pGraph.getList()==null?null:pGraph.getList(),
pGraph.getSpecificationLimit()==null?null:pGraph.getSpecificationLimit(),
pGraph.getArgName()==null?null:pGraph.getArgName()
);
return R.ok("成功",npGraph1);
}
@@ -395,9 +453,9 @@ public class ProcessInspectionController {
cGraph.initialDate(queryDataParam);
CGraphData npGraph1 = new CGraphData(
cGraph.getList(),
cGraph.getSpecificationLimit(),
cGraph.getArgName()
cGraph.getList()==null?null:cGraph.getList(),
cGraph.getSpecificationLimit()==null?null:cGraph.getSpecificationLimit(),
cGraph.getArgName()==null?null:cGraph.getArgName()
);
return R.ok("成功",npGraph1);
}
@@ -416,9 +474,9 @@ public class ProcessInspectionController {
uGraph.initialDate(queryDataParam);
UGraphData uGraphData = new UGraphData(
uGraph.getList(),
uGraph.getSpecificationLimit(),
uGraph.getArgName()
uGraph.getList()==null?null:uGraph.getList(),
uGraph.getSpecificationLimit()==null?null:uGraph.getSpecificationLimit(),
uGraph.getArgName()==null?null:uGraph.getArgName()
);
return R.ok("成功",uGraphData);
}

View File

@@ -3,6 +3,7 @@ package com.cnbm.processInspection.dto;
import com.cnbm.common.spc.math.StandardDiviation;
import com.cnbm.processInspection.graphAnalyzed.forMeterage.xmr.XMRGraphEntity;
import com.cnbm.qualityPlanning.entity.ControlLimit;
import com.cnbm.qualityPlanning.entity.ControlLimitDetail;
import com.cnbm.qualityPlanning.entity.ProcessCapability;
import com.cnbm.qualityPlanning.entity.SpecificationLimit;
import io.swagger.annotations.ApiModel;
@@ -15,14 +16,14 @@ import lombok.Data;
* @DATE: 2022/7/22 14:18
*/
@Data
@ApiModel(value = "均值极差控制图 结果类")
@ApiModel(value = "单值-移动极差 结果类")
public class XMRGraphData {
@ApiModelProperty(value = "控制图list数据")
private XMRGraphEntity xmrGraphEntity;
@ApiModelProperty(value = "xbar控制图 控制限")
private ControlLimit XBarCL;
private ControlLimitDetail XBarCL;
@ApiModelProperty(value = "R控制图 控制限")
private ControlLimit RCL;
private ControlLimitDetail RCL;
@ApiModelProperty(value = "工艺规格限")
private SpecificationLimit SL;
@@ -34,7 +35,7 @@ public class XMRGraphData {
private StandardDiviation standardDiviation;
public XMRGraphData(XMRGraphEntity xmrGraphEntity, ControlLimit xBarCL, ControlLimit rCL, SpecificationLimit sl, ProcessCapability processCapability, StandardDiviation standardDiviation){
public XMRGraphData(XMRGraphEntity xmrGraphEntity, ControlLimitDetail xBarCL, ControlLimitDetail rCL, SpecificationLimit sl, ProcessCapability processCapability, StandardDiviation standardDiviation){
this.xmrGraphEntity = xmrGraphEntity;
this.XBarCL = xBarCL;
this.RCL = rCL;

View File

@@ -2,27 +2,31 @@ package com.cnbm.processInspection.dto;
import com.cnbm.common.spc.math.StandardDiviation;
import com.cnbm.processInspection.graphAnalyzed.forMeterage.mr.MRGraphEntity;
import com.cnbm.qualityPlanning.entity.ControlLimit;
import com.cnbm.qualityPlanning.entity.ProcessCapability;
import com.cnbm.qualityPlanning.entity.SpecificationLimit;
import com.cnbm.qualityPlanning.entity.*;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.ArrayList;
import java.util.List;
import java.util.Stack;
/**
* @Desc: ""
* @Author: caixiang
* @DATE: 2022/7/22 14:18
*/
@Data
@ApiModel(value = "均值极差控制图 结果类")
@ApiModel(value = "均值-极差控制图 结果类")
public class XbarRGraphData {
@ApiModelProperty(value = "控制图list数据")
private MRGraphEntity mrGraphEntity;
@ApiModelProperty(value = "xbar控制图 控制限")
private ControlLimit XBarCL;
private ControlLimitDetail XBarCL;
@ApiModelProperty(value = "R控制图 控制限")
private ControlLimit RCL;
private ControlLimitDetail RCL;
@ApiModelProperty(value = "工艺规格限")
private SpecificationLimit SL;
@@ -34,12 +38,14 @@ public class XbarRGraphData {
private StandardDiviation standardDiviation;
public XbarRGraphData(MRGraphEntity mrGraphEntity, ControlLimit xBarCL, ControlLimit rCL, SpecificationLimit sl, ProcessCapability processCapability, StandardDiviation standardDiviation){
public XbarRGraphData(MRGraphEntity mrGraphEntity, ControlLimitDetail xBarCLDetail , ControlLimitDetail rCLDetail, SpecificationLimit sl, ProcessCapability processCapability, StandardDiviation standardDiviation){
this.mrGraphEntity = mrGraphEntity;
this.XBarCL = xBarCL;
this.RCL = rCL;
this.XBarCL = xBarCLDetail;
this.RCL = rCLDetail;
this.SL = sl;
this.processCapability = processCapability;
this.standardDiviation = standardDiviation;
}
}

View File

@@ -3,6 +3,7 @@ package com.cnbm.processInspection.dto;
import com.cnbm.common.spc.math.StandardDiviation;
import com.cnbm.processInspection.graphAnalyzed.forMeterage.ms.MSDGraphEntity;
import com.cnbm.qualityPlanning.entity.ControlLimit;
import com.cnbm.qualityPlanning.entity.ControlLimitDetail;
import com.cnbm.qualityPlanning.entity.ProcessCapability;
import com.cnbm.qualityPlanning.entity.SpecificationLimit;
import io.swagger.annotations.ApiModel;
@@ -15,14 +16,14 @@ import lombok.Data;
* @DATE: 2022/7/22 14:18
*/
@Data
@ApiModel(value = "均值标准差控制图 结果类")
@ApiModel(value = "均值-标准差控制图 结果类")
public class XbarSGraphData {
@ApiModelProperty(value = "控制图list数据")
private MSDGraphEntity msdGraphEntity;
@ApiModelProperty(value = "xbar控制图 控制限")
private ControlLimit XBarCL;
private ControlLimitDetail XBarCL;
@ApiModelProperty(value = "s控制图 控制限")
private ControlLimit SCL;
private ControlLimitDetail SCL;
@ApiModelProperty(value = "工艺规格限")
private SpecificationLimit SL;
@@ -34,7 +35,7 @@ public class XbarSGraphData {
private StandardDiviation standardDiviation;
public XbarSGraphData(MSDGraphEntity msdGraphEntity,ControlLimit xBarCL,ControlLimit sCL,SpecificationLimit sl,ProcessCapability processCapability,StandardDiviation standardDiviation){
public XbarSGraphData(MSDGraphEntity msdGraphEntity,ControlLimitDetail xBarCL,ControlLimitDetail sCL,SpecificationLimit sl,ProcessCapability processCapability,StandardDiviation standardDiviation){
this.msdGraphEntity = msdGraphEntity;
this.XBarCL = xBarCL;
this.SCL = sCL;

View File

@@ -8,7 +8,6 @@ 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.PPoint;
import com.cnbm.qualityPlanning.entity.SpecificationLimit;
import com.influxdb.query.FluxRecord;
import com.influxdb.query.FluxTable;

View File

@@ -1,22 +1,15 @@
package com.cnbm.processInspection.graphAnalyzed.forCount.np;
import com.cnbm.basic.entity.ProductFeatures;
import com.cnbm.common.spc.math.StandardDiviation;
import com.cnbm.common.spc.util.DataUtils;
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.Tag;
import com.cnbm.processInspection.controlCoefficientConstant.XBarRCoefficients;
import com.cnbm.processInspection.dto.InterpretationListArg;
import com.cnbm.processInspection.dto.InterpretationListArgForCount;
import com.cnbm.qualityPlanning.common.StatisticalControlledTest;
import com.cnbm.qualityPlanning.entity.*;
import com.influxdb.query.FluxRecord;
import com.influxdb.query.FluxTable;
import lombok.Data;
import org.omg.CORBA.PRIVATE_MEMBER;
import java.util.ArrayList;
import java.util.List;

View File

@@ -7,7 +7,6 @@ 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.NPPoint;
import com.cnbm.qualityPlanning.entity.PPoint;
import com.cnbm.qualityPlanning.entity.SpecificationLimit;
import com.influxdb.query.FluxRecord;
@@ -15,7 +14,6 @@ import com.influxdb.query.FluxTable;
import lombok.Data;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
/**

View File

@@ -7,7 +7,6 @@ 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.PPoint;
import com.cnbm.qualityPlanning.entity.SpecificationLimit;
import com.cnbm.qualityPlanning.entity.UPoint;
import com.influxdb.query.FluxRecord;

View File

@@ -107,6 +107,9 @@ public class MeanRGraph {
queryDataParam.setTag(new Tag("argName",argName));
List<FluxTable> query = InfluxClient.Client.query(queryDataParam);
if(query.size() == 0){
return;
}
//1. 先从fluxdb 里面提取原始数据
List<Double> originData = new ArrayList<>();
for (FluxTable fluxTable : query) {
@@ -217,6 +220,9 @@ public class MeanRGraph {
* 注意:此函数 要在 initialDate()函数执行之后
* */
public ControlLimit getXbarCL(){
if(this.mrGraphEntity == null){
return null;
}
return new ControlLimit(
(this.mrGraphEntity.getXbarbar() + a2*this.mrGraphEntity.getRbar()),
this.mrGraphEntity.getXbarbar(),
@@ -229,6 +235,9 @@ public class MeanRGraph {
* 注意:此函数 要在 initialDate()函数执行之后
* */
public ControlLimit getRCL(){
if(this.mrGraphEntity==null){
return null;
}
return new ControlLimit(
( d4 * this.mrGraphEntity.getRbar() ) ,
this.mrGraphEntity.getRbar() ,
@@ -241,6 +250,10 @@ public class MeanRGraph {
* 注意:此函数 要在 initialDate()函数执行之后
* */
public ProcessCapability getProcessCapacity(){
if(this.miu==null || this.xigma==null || this.specificationLimit==null){
return null;
}
SpecificationLimit sp = this.specificationLimit;
List<String> warming = new ArrayList<>();
Float usl = sp.getUSL();

View File

@@ -5,8 +5,6 @@ import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
import com.cnbm.basic.dto.ProductFactoryRelationDTO;
import com.cnbm.basic.dto.ProductFeaturesDTO;
import com.cnbm.basic.entity.Machine;
import com.cnbm.basic.entity.Product;
import com.cnbm.basic.entity.Shift;
@@ -18,9 +16,6 @@ import com.cnbm.basic.service.impl.WorkingProcedureServiceImpl;
import com.cnbm.common.page.PageData;
import com.cnbm.common.service.impl.CrudServiceImpl;
import com.cnbm.common.utils.ConvertUtils;
import com.cnbm.common.validator.ValidatorUtils;
import com.cnbm.common.validator.group.AddGroup;
import com.cnbm.common.validator.group.DefaultGroup;
import com.cnbm.influx.config.InfluxClient;
import com.cnbm.influx.param.QueryDataParam;
import com.cnbm.influx.param.Range;
@@ -30,7 +25,6 @@ import com.cnbm.processInspection.dto.InspectionSheetDTO;
import com.cnbm.processInspection.entity.InspectionSheet;
import com.cnbm.processInspection.mapper.InspectionSheetMapper;
import com.cnbm.processInspection.service.IInspectionSheetService;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.influxdb.query.FluxTable;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
@@ -212,7 +206,7 @@ public class InspectionSheetServiceImpl extends CrudServiceImpl<InspectionSheetM
event.setBatchNum(batchNum);
event.setArgName(argName);
if(!Objects.equals(argValue, "") && argValue != null ){
event.setArgValue(argValue);
event.setArgValue(argValue.toString());
}
return event;
}