mark for pull
This commit is contained in:
parent
23b5ce90c9
commit
f498afd856
@ -64,6 +64,14 @@ public class FactoryController {
|
||||
return new Result<FactoryDTO>().ok(data);
|
||||
}
|
||||
|
||||
@GetMapping("{id}")
|
||||
@ApiOperation("改变状态")
|
||||
@LogOperation("改变状态")
|
||||
public Result changeStatus(@PathVariable("id") Long id){
|
||||
factoryService.changeStatus(id);
|
||||
return new Result();
|
||||
}
|
||||
|
||||
@PostMapping
|
||||
@ApiOperation("保存")
|
||||
@LogOperation("保存")
|
||||
@ -113,13 +121,6 @@ public class FactoryController {
|
||||
ExcelUtils.exportExcelToTarget(response, null, list, FactoryExcel.class);
|
||||
}
|
||||
|
||||
@GetMapping("{id}")
|
||||
@ApiOperation("改变状态")
|
||||
@LogOperation("改变状态")
|
||||
public Result changeStatus(@PathVariable("id") Long id){
|
||||
factoryService.changeStatus(id);
|
||||
|
||||
return new Result();
|
||||
}
|
||||
|
||||
}
|
@ -2,7 +2,7 @@ package com.cnbm.influx;
|
||||
|
||||
import com.cnbm.influx.config.InfluxClient;
|
||||
import com.cnbm.influx.param.QueryDataParam;
|
||||
import com.cnbm.influx.common.Utils;
|
||||
|
||||
import com.cnbm.influx.param.PageInfo;
|
||||
import com.cnbm.influx.param.Range;
|
||||
import com.cnbm.influx.param.Tag;
|
||||
|
@ -19,6 +19,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("/influx")
|
||||
@ -29,17 +30,20 @@ public class S7DemoController {
|
||||
@PostMapping("/insertBatch")
|
||||
public void insertBatch() throws InterruptedException {
|
||||
List<Event> list = new ArrayList<>();
|
||||
Random r = new Random();
|
||||
|
||||
for(int i=0;i<99;i++){
|
||||
Thread.sleep(100);
|
||||
|
||||
for(int i=0;i<999;i++){
|
||||
Thread.sleep(10);
|
||||
Event event = new Event();
|
||||
event.setTime(Instant.now());
|
||||
event.setTransationId("asas"+i);
|
||||
event.setArgName("arg7");
|
||||
event.setArgValue(new Double(i));
|
||||
event.setArgName("LTWeight");
|
||||
Double d = r.nextDouble() * 2.5 + 66;
|
||||
event.setArgValue(d);
|
||||
list.add(event);
|
||||
}
|
||||
InfluxClient.Client.batchInsert(list,"ASProcessCompleteEventAS");
|
||||
InfluxClient.Client.batchInsert(list,"Weight");
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -32,5 +32,11 @@
|
||||
<artifactId>ym-common</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.cnbm</groupId>
|
||||
<artifactId>ym-quality-planning</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
@ -0,0 +1,47 @@
|
||||
package com.cnbm.processInspection.entity;
|
||||
|
||||
|
||||
import com.cnbm.qualityPlanning.entity.Point;
|
||||
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* @Desc: ""
|
||||
* @Author: caixiang
|
||||
* @DATE: 2022/7/21 9:43
|
||||
*/
|
||||
public class XbarSPoint extends Point {
|
||||
public XbarSPoint(Integer position, Double value) {
|
||||
super(position, value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer getPosition() {
|
||||
return super.getPosition();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Double getValue() {
|
||||
return super.getValue();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<Integer> getUnsatisfiedRules() {
|
||||
return super.getUnsatisfiedRules();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setPosition(Integer position) {
|
||||
super.setPosition(position);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setValue(Double value) {
|
||||
super.setValue(value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setUnsatisfiedRules(Set<Integer> unsatisfiedRules) {
|
||||
super.setUnsatisfiedRules(unsatisfiedRules);
|
||||
}
|
||||
}
|
@ -1,6 +1,20 @@
|
||||
package com.cnbm.processInspection.graphAnalyzed;
|
||||
|
||||
import com.cnbm.basic.entity.ProductFeatures;
|
||||
import com.cnbm.common.spc.util.DataUtils;
|
||||
import com.cnbm.common.utils.DateUtils;
|
||||
import com.cnbm.influx.config.InfluxClient;
|
||||
import com.cnbm.influx.constant.Constant;
|
||||
import com.cnbm.influx.param.PageInfo;
|
||||
import com.cnbm.influx.param.QueryDataParam;
|
||||
import com.cnbm.influx.param.Range;
|
||||
import com.cnbm.influx.param.Tag;
|
||||
import com.cnbm.processInspection.controlCoefficientConstant.XBarSCoefficients;
|
||||
import com.influxdb.query.FluxRecord;
|
||||
import com.influxdb.query.FluxTable;
|
||||
|
||||
import java.time.Instant;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Desc: ""
|
||||
@ -27,8 +41,13 @@ public class MeanStandardDeviationGraph {
|
||||
private Integer sampleSize;
|
||||
private String argName;
|
||||
|
||||
MeanStandardDeviationGraph(Integer sampleSize){
|
||||
this.sampleSize = sampleSize;
|
||||
|
||||
MeanStandardDeviationGraph(ProductFeatures productFeatures) throws Exception {
|
||||
if(productFeatures.getSampleSize()==null || productFeatures.getName()==null){
|
||||
throw new Exception("ProductFeatures 参数异常");
|
||||
}
|
||||
|
||||
this.sampleSize = productFeatures.getSampleSize().intValue();
|
||||
this.as = XBarSCoefficients.getAS(sampleSize);
|
||||
this.bu = XBarSCoefficients.getBU(sampleSize);
|
||||
this.bl = XBarSCoefficients.getBU(sampleSize);
|
||||
@ -41,6 +60,23 @@ public class MeanStandardDeviationGraph {
|
||||
* ①
|
||||
* */
|
||||
public void initialDate(){
|
||||
QueryDataParam queryDataParam = new QueryDataParam();
|
||||
queryDataParam.setBucket(Constant.bucket);
|
||||
queryDataParam.setMeasurement("Weight");
|
||||
queryDataParam.setDropedTagName("transationId");
|
||||
queryDataParam.setTag(new Tag("argName","LTWeight"));
|
||||
queryDataParam.setRange(new Range(DataUtils.getBeforeDate(10).toInstant(), Instant.now()));
|
||||
queryDataParam.setPageInfo(new PageInfo(1,10));
|
||||
List<FluxTable> query = InfluxClient.Client.query(queryDataParam);
|
||||
List<List<FluxTable>> lists = DataUtils.fixedGroup(query, sampleSize);
|
||||
|
||||
|
||||
for (FluxTable fluxTable : query) {
|
||||
List<FluxRecord> records = fluxTable.getRecords();
|
||||
for (FluxRecord fluxRecord : records) {
|
||||
System.out.println("value: " + fluxRecord.getValueByKey("_value"));
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user