mark for pull

This commit is contained in:
caixiang 2022-07-21 09:50:01 +08:00
parent 23b5ce90c9
commit f498afd856
6 changed files with 109 additions and 15 deletions

View File

@ -64,6 +64,14 @@ public class FactoryController {
return new Result<FactoryDTO>().ok(data); return new Result<FactoryDTO>().ok(data);
} }
@GetMapping("{id}")
@ApiOperation("改变状态")
@LogOperation("改变状态")
public Result changeStatus(@PathVariable("id") Long id){
factoryService.changeStatus(id);
return new Result();
}
@PostMapping @PostMapping
@ApiOperation("保存") @ApiOperation("保存")
@LogOperation("保存") @LogOperation("保存")
@ -113,13 +121,6 @@ public class FactoryController {
ExcelUtils.exportExcelToTarget(response, null, list, FactoryExcel.class); ExcelUtils.exportExcelToTarget(response, null, list, FactoryExcel.class);
} }
@GetMapping("{id}")
@ApiOperation("改变状态")
@LogOperation("改变状态")
public Result changeStatus(@PathVariable("id") Long id){
factoryService.changeStatus(id);
return new Result();
}
} }

View File

@ -2,7 +2,7 @@ package com.cnbm.influx;
import com.cnbm.influx.config.InfluxClient; import com.cnbm.influx.config.InfluxClient;
import com.cnbm.influx.param.QueryDataParam; import com.cnbm.influx.param.QueryDataParam;
import com.cnbm.influx.common.Utils;
import com.cnbm.influx.param.PageInfo; import com.cnbm.influx.param.PageInfo;
import com.cnbm.influx.param.Range; import com.cnbm.influx.param.Range;
import com.cnbm.influx.param.Tag; import com.cnbm.influx.param.Tag;

View File

@ -19,6 +19,7 @@ import org.springframework.web.bind.annotation.RestController;
import java.time.Instant; import java.time.Instant;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Random;
@RestController @RestController
@RequestMapping("/influx") @RequestMapping("/influx")
@ -29,17 +30,20 @@ public class S7DemoController {
@PostMapping("/insertBatch") @PostMapping("/insertBatch")
public void insertBatch() throws InterruptedException { public void insertBatch() throws InterruptedException {
List<Event> list = new ArrayList<>(); 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 event = new Event();
event.setTime(Instant.now()); event.setTime(Instant.now());
event.setTransationId("asas"+i); event.setTransationId("asas"+i);
event.setArgName("arg7"); event.setArgName("LTWeight");
event.setArgValue(new Double(i)); Double d = r.nextDouble() * 2.5 + 66;
event.setArgValue(d);
list.add(event); list.add(event);
} }
InfluxClient.Client.batchInsert(list,"ASProcessCompleteEventAS"); InfluxClient.Client.batchInsert(list,"Weight");
} }
/** /**

View File

@ -32,5 +32,11 @@
<artifactId>ym-common</artifactId> <artifactId>ym-common</artifactId>
<version>1.0-SNAPSHOT</version> <version>1.0-SNAPSHOT</version>
</dependency> </dependency>
<dependency>
<groupId>com.cnbm</groupId>
<artifactId>ym-quality-planning</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
</dependencies> </dependencies>
</project> </project>

View File

@ -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);
}
}

View File

@ -1,6 +1,20 @@
package com.cnbm.processInspection.graphAnalyzed; 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.cnbm.processInspection.controlCoefficientConstant.XBarSCoefficients;
import com.influxdb.query.FluxRecord;
import com.influxdb.query.FluxTable;
import java.time.Instant;
import java.util.List;
/** /**
* @Desc: "" * @Desc: ""
@ -27,8 +41,13 @@ public class MeanStandardDeviationGraph {
private Integer sampleSize; private Integer sampleSize;
private String argName; 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.as = XBarSCoefficients.getAS(sampleSize);
this.bu = XBarSCoefficients.getBU(sampleSize); this.bu = XBarSCoefficients.getBU(sampleSize);
this.bl = XBarSCoefficients.getBU(sampleSize); this.bl = XBarSCoefficients.getBU(sampleSize);
@ -41,6 +60,23 @@ public class MeanStandardDeviationGraph {
* *
* */ * */
public void initialDate(){ 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"));
}
}
} }
} }