|
|
@@ -314,20 +314,24 @@ public class DeviceService {
|
|
|
part.setUnitNe(value.getRemark());
|
|
|
}
|
|
|
}
|
|
|
+ if(insTables != null){
|
|
|
+ SlopeData slopeData = slopeDataMapper.selectListByLine(snCode, part.getPartName());//获取到当前测量值
|
|
|
+ if (!Objects.isNull(slopeData)) {
|
|
|
+ part.setCurrentData(slopeData.getVal());
|
|
|
+ //BigDecimal currentValue = commonService.getValueByOffset(value.toString(), obj.get("item").toString(), reference);
|
|
|
+ //part.setOffset(slopeData.getVal());
|
|
|
+ }
|
|
|
+ }
|
|
|
references.forEach(re -> {
|
|
|
if (part.getPartName().equals(re.getItem())) {
|
|
|
part.setPartBaseData(re.getOriginalValue().toString());
|
|
|
part.setPartCurrentBaseData(re.getCurrentValue().toString());
|
|
|
|
|
|
- part.setOffset(re.getOffset().toString());
|
|
|
+ BigDecimal currentValue = commonService.computeOffset(part.getCurrentData(), re.getItem(), re);
|
|
|
+ part.setOffset(String.valueOf(currentValue.doubleValue()));
|
|
|
}
|
|
|
});
|
|
|
- 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<>() {{
|
|
|
@@ -375,6 +379,7 @@ public class DeviceService {
|
|
|
if (!Objects.isNull(slopeData) && slopeData.size()>0) {
|
|
|
double data = commonService.returnIntegrationData(snCode,slopeData,inter);
|
|
|
inter.setCurrentData(String.valueOf(data));
|
|
|
+ inter.setOffset(String.valueOf(data));
|
|
|
}
|
|
|
for (SystemDict value : deviceType.values()) {
|
|
|
if (inter.getUnit().toString().equals(value.getValue())) {
|
|
|
@@ -388,7 +393,7 @@ public class DeviceService {
|
|
|
inter.setIntegrationBaseData(re.getOriginalValue().toString());
|
|
|
|
|
|
inter.setIntegrationCurrentBaseData(re.getCurrentValue().toString());
|
|
|
- inter.setOffset(re.getOffset().toString());
|
|
|
+ //inter.setOffset(re.getOffset().toString());
|
|
|
}
|
|
|
|
|
|
});
|