Merge branch 'master' of http://git.picaiba.com/CaiXiang/SPC
This commit is contained in:
commit
7e3e028eb0
@ -29,9 +29,9 @@ public class S7DemoController {
|
||||
private static final Logger logger = LoggerFactory.getLogger(S7DemoController.class);
|
||||
|
||||
|
||||
//for 常规计量型
|
||||
@PostMapping("/insertDemoDataForMetering")
|
||||
public void insertDemoDataForMetering() throws InterruptedException {
|
||||
//for 常规计数型
|
||||
@PostMapping("/insertDemoDataForCount")
|
||||
public void insertDemoDataForCount() throws InterruptedException {
|
||||
List<Event> list = new ArrayList<>();
|
||||
Random r = new Random();
|
||||
|
||||
@ -147,9 +147,9 @@ public class S7DemoController {
|
||||
}
|
||||
|
||||
|
||||
//for 常规计数型
|
||||
@PostMapping("/insertDemoDataForCount")
|
||||
public void insertDemoDataForCount() throws InterruptedException {
|
||||
//for 常规计量型
|
||||
@PostMapping("/insertDemoDataForMetering")
|
||||
public void insertDemoDataForMetering() throws InterruptedException {
|
||||
List<Event> list = new ArrayList<>();
|
||||
Random r = new Random();
|
||||
|
||||
|
@ -117,6 +117,7 @@ public class ProcessInspectionController {
|
||||
|
||||
return R.ok("成功",xbarSGraphData);
|
||||
}
|
||||
|
||||
@PostMapping("/XMRGraphTest")
|
||||
public R<XMRGraphData> XMRGraphTest() throws Exception {
|
||||
ProductFeatures productFeatures = new ProductFeatures();
|
||||
|
@ -22,6 +22,7 @@ import com.cnbm.influx.config.InfluxClient;
|
||||
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.influx.template.Event;
|
||||
import com.cnbm.processInspection.dto.InspectionSampleDTO;
|
||||
@ -29,7 +30,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.google.gson.JsonObject;
|
||||
import com.influxdb.query.FluxRecord;
|
||||
import com.influxdb.query.FluxTable;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
@ -209,9 +209,7 @@ public class InspectionSheetServiceImpl extends CrudServiceImpl<InspectionSheetM
|
||||
queryDataParam.setMeasurement(workingProcedureName);
|
||||
//queryDataParam.setInspectionSheetId(inspectionSheetId);
|
||||
queryDataParam.setBucket("qgs-bucket");
|
||||
|
||||
//queryDataParam.setTag(new Tag("inspectionSheetId", inspectionSheetId));
|
||||
|
||||
queryDataParam.setTags(Arrays.asList(new Tag("inspectionSheetId", inspectionSheetId)));
|
||||
List<String> dropNames = new ArrayList<>();
|
||||
dropNames.add("transationId");
|
||||
queryDataParam.setDropedTagNames(dropNames);
|
||||
@ -240,6 +238,7 @@ public class InspectionSheetServiceImpl extends CrudServiceImpl<InspectionSheetM
|
||||
|
||||
InspectionSampleDTO sampleDTO = new InspectionSampleDTO();
|
||||
sampleDTO.setSampleNumber(sampleNumber);
|
||||
//sampleDTO.setSampleTime(LocalDateTime.ofInstant(events.get(0).getTime(), ZoneId.systemDefault()));
|
||||
sampleDTO.setSampleTime(events.get(0).getTime());
|
||||
sampleDTO.setBatchNum(dto.getBatchNumber());
|
||||
sampleDTO.setInspectionSheetId(events.get(0).getInspectionSheetId());
|
||||
@ -266,9 +265,9 @@ public class InspectionSheetServiceImpl extends CrudServiceImpl<InspectionSheetM
|
||||
String sampleNumber = dto.getSampleNumber();
|
||||
String jsonData = dto.getJsonData();
|
||||
JSONObject json = JSON.parseObject(jsonData);
|
||||
|
||||
Instant time = dto.getSampleTime();
|
||||
|
||||
// LocalDateTime sampleTime = dto.getSampleTime();
|
||||
// Instant eventTime = sampleTime.toInstant(ZoneOffset.UTC);
|
||||
Instant eventTime = dto.getSampleTime();
|
||||
List<Event> list = new ArrayList<>();
|
||||
for (Map.Entry entry : json.entrySet()) {
|
||||
String key = entry.getKey().toString();
|
||||
@ -278,7 +277,7 @@ public class InspectionSheetServiceImpl extends CrudServiceImpl<InspectionSheetM
|
||||
// v= Double.valueOf(entry.getValue().toString());
|
||||
// }catch (Exception e){
|
||||
// }
|
||||
list.add(newEvent(time, inspectionSheetId, key, v, sampleNumber));
|
||||
list.add(newEvent(eventTime, inspectionSheetId, key, v, sampleNumber));
|
||||
}
|
||||
InfluxClient.Client.batchInsert(list, workingProcedureName);
|
||||
}
|
||||
|
Caricamento…
Fai riferimento in un nuovo problema
Block a user