Commit fb65153a authored by tangwei's avatar tangwei

修改方法

parent 21f41e44
...@@ -21,13 +21,12 @@ public interface IStationDataTask { ...@@ -21,13 +21,12 @@ public interface IStationDataTask {
List<DeviceDto> getListDevice(StationTaksDto stationTaksDto); List<DeviceDto> getListDevice(StationTaksDto stationTaksDto);
//获取每个风机信息 //获取每个风机信息 更新数据
List<IndexDto> getIndexDto(DeviceDto deviceDto); void getIndexDto(DeviceDto deviceDto);
//每个分级信息处理
void setMonitorFanIndicator(List<IndexDto> list);
} }
...@@ -6,7 +6,6 @@ import com.yeejoin.amos.boot.biz.common.utils.RedisUtils; ...@@ -6,7 +6,6 @@ import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
import com.yeejoin.amos.boot.module.jxiop.api.entity.StationBasic; import com.yeejoin.amos.boot.module.jxiop.api.entity.StationBasic;
import com.yeejoin.amos.boot.module.jxiop.api.mapper.StationBasicMapper; import com.yeejoin.amos.boot.module.jxiop.api.mapper.StationBasicMapper;
import com.yeejoin.amos.boot.module.jxiop.biz.entity.Test; import com.yeejoin.amos.boot.module.jxiop.biz.entity.Test;
import com.yeejoin.amos.boot.module.jxiop.biz.service.impl.DataSynchronizationImpl;
import com.yeejoin.amos.boot.module.jxiop.biz.service.impl.SjglZsjZsbtzServiceImpl; import com.yeejoin.amos.boot.module.jxiop.biz.service.impl.SjglZsjZsbtzServiceImpl;
import com.yeejoin.amos.boot.module.jxiop.biz.service.impl.StationBasicServiceImpl; import com.yeejoin.amos.boot.module.jxiop.biz.service.impl.StationBasicServiceImpl;
import com.yeejoin.amos.boot.module.jxiop.biz.service.impl.TestServiceImpl; import com.yeejoin.amos.boot.module.jxiop.biz.service.impl.TestServiceImpl;
...@@ -41,8 +40,7 @@ public class DemoController extends BaseController { ...@@ -41,8 +40,7 @@ public class DemoController extends BaseController {
@Autowired @Autowired
SjglZsjZsbtzServiceImpl sjglZsjZsbtzServiceImpl; SjglZsjZsbtzServiceImpl sjglZsjZsbtzServiceImpl;
@Autowired
DataSynchronizationImpl dataSynchronizationImpl;
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY) @TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@ApiOperation(value = "demo测试prodcutcion 库") @ApiOperation(value = "demo测试prodcutcion 库")
@GetMapping("/test") @GetMapping("/test")
...@@ -77,7 +75,9 @@ public class DemoController extends BaseController { ...@@ -77,7 +75,9 @@ public class DemoController extends BaseController {
@ApiOperation(value = "测试数据同步逻辑") @ApiOperation(value = "测试数据同步逻辑")
@GetMapping("/test4") @GetMapping("/test4")
public void demoTest3() { public void demoTest3() {
dataSynchronizationImpl.cacheSjglZsjZsbtz();
} }
} }
...@@ -21,8 +21,9 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator { ...@@ -21,8 +21,9 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
@Autowired @Autowired
MonitorFanIndicatorMapper monitorFanIndicatorregionMapper; MonitorFanIndicatorMapper monitorFanIndicatorregionMapper;
@Async("jxiopAsyncExecutor")
@Override @Override
@Async("jxiopAsyncExecutor")
public void UpdateMonitorFanIndicator(List<IndexDto> list) { public void UpdateMonitorFanIndicator(List<IndexDto> list) {
monitorFanIndicatorregionMapper.UpdateMonitorFanIndicator(list); monitorFanIndicatorregionMapper.UpdateMonitorFanIndicator(list);
......
package com.yeejoin.amos.boot.module.jxiop.biz.service.impl; package com.yeejoin.amos.boot.module.jxiop.biz.service.impl;
import com.google.common.collect.Lists;
import com.yeejoin.amos.boot.module.jxiop.api.dto.DeviceDto; import com.yeejoin.amos.boot.module.jxiop.api.dto.DeviceDto;
import com.yeejoin.amos.boot.module.jxiop.api.dto.IndexDto; import com.yeejoin.amos.boot.module.jxiop.api.dto.IndexDto;
import com.yeejoin.amos.boot.module.jxiop.api.dto.StationTaksDto; import com.yeejoin.amos.boot.module.jxiop.api.dto.StationTaksDto;
...@@ -8,6 +9,7 @@ import com.yeejoin.amos.boot.module.jxiop.api.service.IStationDataTask; ...@@ -8,6 +9,7 @@ import com.yeejoin.amos.boot.module.jxiop.api.service.IStationDataTask;
import com.yeejoin.amos.boot.module.jxiop.biz.entity.SjglZsjZsbtz; import com.yeejoin.amos.boot.module.jxiop.biz.entity.SjglZsjZsbtz;
import com.yeejoin.amos.boot.module.jxiop.biz.entity.TpriDmpDatabook; import com.yeejoin.amos.boot.module.jxiop.biz.entity.TpriDmpDatabook;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
...@@ -21,6 +23,9 @@ public class StationDataTaskImpl implements IStationDataTask { ...@@ -21,6 +23,9 @@ public class StationDataTaskImpl implements IStationDataTask {
@Autowired @Autowired
TpriDmpDatabookServiceImpl tpriDmpDatabookServiceImpl; TpriDmpDatabookServiceImpl tpriDmpDatabookServiceImpl;
@Autowired
MonitorFanIndicatorImpl monitorFanIndicatorImpl;
@Override @Override
public List<StationTaksDto> getListStationBasic() { public List<StationTaksDto> getListStationBasic() {
...@@ -36,6 +41,7 @@ public class StationDataTaskImpl implements IStationDataTask { ...@@ -36,6 +41,7 @@ public class StationDataTaskImpl implements IStationDataTask {
} }
@Override @Override
@Async("jxiopAsyncExecutor")
public List<DeviceDto> getListDevice(StationTaksDto stationTaksDto) { public List<DeviceDto> getListDevice(StationTaksDto stationTaksDto) {
List<DeviceDto> deviceDtoList = new ArrayList<>(); List<DeviceDto> deviceDtoList = new ArrayList<>();
TpriDmpDatabook tpriDmpDatabook = tpriDmpDatabookServiceImpl.getTpriDmpDatabookByDataName("风机"); TpriDmpDatabook tpriDmpDatabook = tpriDmpDatabookServiceImpl.getTpriDmpDatabookByDataName("风机");
...@@ -48,13 +54,23 @@ public class StationDataTaskImpl implements IStationDataTask { ...@@ -48,13 +54,23 @@ public class StationDataTaskImpl implements IStationDataTask {
return deviceDtoList; return deviceDtoList;
} }
@Async("jxiopAsyncExecutor")
@Override @Override
public List<IndexDto> getIndexDto(DeviceDto deviceDto) { public void getIndexDto(DeviceDto deviceDto) {
return null;
}
@Override
public void setMonitorFanIndicator(List<IndexDto> list) { //每个分机的指标数据
List<IndexDto> list=null;
if(list!=null&&list.size()>0){}
//对数据切片处理
Lists.partition(list,100);
//每个分级信息处理
monitorFanIndicatorImpl.UpdateMonitorFanIndicator(list);
} }
} }
package com.yeejoin.amos.boot.module.jxiop.biz.tasks; package com.yeejoin.amos.boot.module.jxiop.biz.tasks;
import com.yeejoin.amos.boot.module.jxiop.api.dto.DeviceDto;
import com.yeejoin.amos.boot.module.jxiop.api.dto.StationTaksDto;
import com.yeejoin.amos.boot.module.jxiop.api.service.IStationDataTask; import com.yeejoin.amos.boot.module.jxiop.api.service.IStationDataTask;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled; import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import java.util.List;
/** /**
* @description: 定时获取场站最新数据 * @description: 定时获取场站最新数据
* @author: tw * @author: tw
...@@ -22,8 +26,14 @@ public class StationDataTask { ...@@ -22,8 +26,14 @@ public class StationDataTask {
@Scheduled(cron = "${station.task.cron}") @Scheduled(cron = "${station.task.cron}")
public void getStationDataTask(){ public void getStationDataTask(){
//获取所有场站信息 //获取所有场站信息
List<StationTaksDto> list=stationDataTask.getListStationBasic();
for (StationTaksDto stationTaksDto : list) {
//获取分机
List<DeviceDto> listDeviceDto= stationDataTask.getListDevice(stationTaksDto);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment