|
@@ -274,9 +274,9 @@ public class DeviceService {
|
|
|
);
|
|
);
|
|
|
String snCode = device.getSnCode();
|
|
String snCode = device.getSnCode();
|
|
|
InsTables insTables = insTablesMapper.selectTableIsExit("device_" + snCode);
|
|
InsTables insTables = insTablesMapper.selectTableIsExit("device_" + snCode);
|
|
|
- if (insTables == null) {
|
|
|
|
|
- insTablesMapper.createTable("device_" + snCode);
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ //if (insTables == null) {
|
|
|
|
|
+ //insTablesMapper.createTable("device_" + snCode);
|
|
|
|
|
+ //}
|
|
|
//获取基础要数
|
|
//获取基础要数
|
|
|
List<DevicePartModelVo> partData = new ArrayList<>();
|
|
List<DevicePartModelVo> partData = new ArrayList<>();
|
|
|
partData = deviceModelPartMapper.selectByModelId(deviceModel.getId());
|
|
partData = deviceModelPartMapper.selectByModelId(deviceModel.getId());
|
|
@@ -290,16 +290,18 @@ public class DeviceService {
|
|
|
}
|
|
}
|
|
|
references.forEach(re -> {
|
|
references.forEach(re -> {
|
|
|
if (part.getPartName().equals(re.getItem())) {
|
|
if (part.getPartName().equals(re.getItem())) {
|
|
|
-
|
|
|
|
|
- SlopeData slopeData = slopeDataMapper.selectListByLine(snCode, re.getItem());//获取到当前测量值
|
|
|
|
|
part.setPartBaseData(re.getOriginalValue().toString());
|
|
part.setPartBaseData(re.getOriginalValue().toString());
|
|
|
part.setPartCurrentBaseData(re.getCurrentValue().toString());
|
|
part.setPartCurrentBaseData(re.getCurrentValue().toString());
|
|
|
- if (!Objects.isNull(slopeData)) {
|
|
|
|
|
- part.setCurrentData(slopeData.getVal());
|
|
|
|
|
- }
|
|
|
|
|
|
|
+
|
|
|
part.setOffset(re.getOffset().toString());
|
|
part.setOffset(re.getOffset().toString());
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
|
|
+ if(insTables != null){
|
|
|
|
|
+ SlopeData slopeData = slopeDataMapper.selectListByLine(snCode, part.getPartName());//获取到当前测量值
|
|
|
|
|
+ if (!Objects.isNull(slopeData)) {
|
|
|
|
|
+ part.setCurrentData(slopeData.getVal());
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
//获取字典
|
|
//获取字典
|
|
|
Map<String, SystemDict> deviceType = commonService.getDictList(null, new HashMap<>() {{
|
|
Map<String, SystemDict> deviceType = commonService.getDictList(null, new HashMap<>() {{
|
|
@@ -318,6 +320,11 @@ public class DeviceService {
|
|
|
);
|
|
);
|
|
|
if (!Objects.isNull(projectDevice)) {
|
|
if (!Objects.isNull(projectDevice)) {
|
|
|
vo.setProjectId(projectDevice.getProjectId().toString());
|
|
vo.setProjectId(projectDevice.getProjectId().toString());
|
|
|
|
|
+ KwsProject project = projectMapper.selectOne(new LambdaQueryWrapper<KwsProject>()
|
|
|
|
|
+ .eq(KwsProject::getId, projectDevice.getProjectId().toString())
|
|
|
|
|
+ .eq(KwsProject::getDelFlag, NumberConstant.ZERO)
|
|
|
|
|
+ );
|
|
|
|
|
+ vo.setProjectName(project.getName().toString());
|
|
|
}
|
|
}
|
|
|
vo.setPart(partData);
|
|
vo.setPart(partData);
|
|
|
}
|
|
}
|
|
@@ -510,9 +517,9 @@ public class DeviceService {
|
|
|
HashMap<String, Object> currentMeasurement = new HashMap<>();
|
|
HashMap<String, Object> currentMeasurement = new HashMap<>();
|
|
|
String snCode = kwsDevice.getSnCode();
|
|
String snCode = kwsDevice.getSnCode();
|
|
|
InsTables insTables = insTablesMapper.selectTableIsExit("device_" + snCode);
|
|
InsTables insTables = insTablesMapper.selectTableIsExit("device_" + snCode);
|
|
|
- if (insTables == null) {
|
|
|
|
|
- insTablesMapper.createTable("device_" + snCode);
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ //if (insTables == null) {
|
|
|
|
|
+ //insTablesMapper.createTable("device_" + snCode);
|
|
|
|
|
+ //}
|
|
|
SlopeData slopeData = null;
|
|
SlopeData slopeData = null;
|
|
|
try {
|
|
try {
|
|
|
slopeData = slopeDataMapper.selectListByLine(snCode, item);
|
|
slopeData = slopeDataMapper.selectListByLine(snCode, item);
|
|
@@ -744,6 +751,10 @@ public class DeviceService {
|
|
|
kwsDeviceReference.setUpdateTime(now);
|
|
kwsDeviceReference.setUpdateTime(now);
|
|
|
deviceReferenceMapper.insert(kwsDeviceReference);
|
|
deviceReferenceMapper.insert(kwsDeviceReference);
|
|
|
}
|
|
}
|
|
|
|
|
+ deviceMapper.update(null, new LambdaUpdateWrapper<KwsDevice>()
|
|
|
|
|
+ .eq(KwsDevice::getId, deviceId)
|
|
|
|
|
+ .set(KwsDevice::getStatus, NumberConstant.FOUR)
|
|
|
|
|
+ );
|
|
|
|
|
|
|
|
return HttpResult.ok();
|
|
return HttpResult.ok();
|
|
|
}
|
|
}
|