|
|
@@ -23,6 +23,7 @@ import com.sckw.slope.detection.model.dto.DeviceDataDTO;
|
|
|
import com.sckw.slope.detection.model.dto.HeaderData;
|
|
|
import com.sckw.slope.detection.model.dto.SystemDict;
|
|
|
import com.sckw.slope.detection.model.param.IntegrationQuery;
|
|
|
+import com.sckw.slope.detection.model.vo.DeviceIntegrationVo;
|
|
|
import com.sckw.slope.detection.model.vo.IntegrationVo;
|
|
|
import jakarta.servlet.http.HttpServletRequest;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
@@ -63,6 +64,9 @@ public class BackTrackService {
|
|
|
@Autowired
|
|
|
KwsDeviceReferenceMapper deviceReferenceMapper;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ KwsDeviceIntegrationMapper deviceIntegrationMapper;
|
|
|
+
|
|
|
@Autowired
|
|
|
KwsThresholdMapper thresholdMapper;
|
|
|
|
|
|
@@ -107,7 +111,7 @@ public class BackTrackService {
|
|
|
String[] arr = parts.split(",");
|
|
|
List<String> list = Arrays.asList(arr);
|
|
|
List<KwsDeviceReference> references = deviceReferenceMapper.selectList(new LambdaQueryWrapper<KwsDeviceReference>()
|
|
|
- .in(KwsDeviceReference::getId, list)
|
|
|
+ .in(KwsDeviceReference::getItem, list)
|
|
|
.in(KwsDeviceReference::getDeviceId, devicesId)
|
|
|
.eq(KwsDeviceReference::getDelFlag, NumberConstant.ZERO)
|
|
|
);
|
|
|
@@ -123,11 +127,14 @@ public class BackTrackService {
|
|
|
return HttpResult.ok(devices);
|
|
|
}
|
|
|
|
|
|
- public HttpResult getDeviceChart(String devicesId, String snCode, String parts, String dateStart, String dateEnd, Integer original) throws ParseException {
|
|
|
+ public HttpResult getDeviceChart(String devicesId, String snCode, String parts, String dateStart, String dateEnd, Integer original, HttpServletRequest response) throws ParseException {
|
|
|
//先查询设备
|
|
|
KwsDevice deviceHas = deviceMapper.selectOne(new LambdaQueryWrapper<KwsDevice>()
|
|
|
.eq(KwsDevice::getSnCode, snCode));
|
|
|
String[] arr = parts.split(",");
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
if (!DeviceEnum.ALREADY_REFERRED_TO.getStatus().equals(deviceHas.getStatus().toString())) {//未基准
|
|
|
try {
|
|
|
InsTables insTables = insTablesMapper.selectTableIsExit("device_" + snCode);
|
|
|
@@ -158,6 +165,15 @@ public class BackTrackService {
|
|
|
|
|
|
}
|
|
|
}
|
|
|
+ List<Object> listm = new ArrayList<>();
|
|
|
+ //首先获取集成要数的数据
|
|
|
+ List<DeviceIntegrationVo> intergData = deviceIntegrationMapper.selectListParamsAndInterNameByDeviceId(Long.parseLong(devicesId));
|
|
|
+ if(Objects.nonNull(intergData)){
|
|
|
+ for (DeviceIntegrationVo listvo : intergData){
|
|
|
+ listm = commonService.returnIntegrationDataArray(snCode,dateStart,dateEnd,listvo,"rawId","val");
|
|
|
+ map.put(listvo.getIntegrationName(),listm);
|
|
|
+ }
|
|
|
+ }
|
|
|
return HttpResult.ok(map);
|
|
|
}
|
|
|
|
|
|
@@ -233,6 +249,15 @@ public class BackTrackService {
|
|
|
}
|
|
|
mapList.put(element.getItem(), datemap);
|
|
|
}
|
|
|
+ List<Object> listm = new ArrayList<>();
|
|
|
+ //首先获取集成要数的数据
|
|
|
+ List<DeviceIntegrationVo> intergData = deviceIntegrationMapper.selectListParamsAndInterNameByDeviceId(Long.parseLong(devicesId));
|
|
|
+ if(Objects.nonNull(intergData)){
|
|
|
+ for (DeviceIntegrationVo listvo : intergData){
|
|
|
+ listm = commonService.returnIntegrationDataArray(snCode,dateStart,dateEnd,listvo,"time","offset");
|
|
|
+ mapList.put(listvo.getIntegrationName(),listm);
|
|
|
+ }
|
|
|
+ }
|
|
|
returnData.put("references", references);
|
|
|
returnData.put("threshold", kwsThresholds);
|
|
|
returnData.put("chart", mapList);
|