Commit fb65153a authored by tangwei's avatar tangwei

修改方法

parent 21f41e44
......@@ -21,13 +21,12 @@ public interface IStationDataTask {
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;
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.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.StationBasicServiceImpl;
import com.yeejoin.amos.boot.module.jxiop.biz.service.impl.TestServiceImpl;
......@@ -41,8 +40,7 @@ public class DemoController extends BaseController {
@Autowired
SjglZsjZsbtzServiceImpl sjglZsjZsbtzServiceImpl;
@Autowired
DataSynchronizationImpl dataSynchronizationImpl;
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@ApiOperation(value = "demo测试prodcutcion 库")
@GetMapping("/test")
......@@ -77,7 +75,9 @@ public class DemoController extends BaseController {
@ApiOperation(value = "测试数据同步逻辑")
@GetMapping("/test4")
public void demoTest3() {
dataSynchronizationImpl.cacheSjglZsjZsbtz();
}
}
......@@ -21,8 +21,9 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
@Autowired
MonitorFanIndicatorMapper monitorFanIndicatorregionMapper;
@Async("jxiopAsyncExecutor")
@Override
@Async("jxiopAsyncExecutor")
public void UpdateMonitorFanIndicator(List<IndexDto> list) {
monitorFanIndicatorregionMapper.UpdateMonitorFanIndicator(list);
......
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.IndexDto;
import com.yeejoin.amos.boot.module.jxiop.api.dto.StationTaksDto;
......@@ -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.TpriDmpDatabook;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import java.util.ArrayList;
import java.util.List;
......@@ -21,6 +23,9 @@ public class StationDataTaskImpl implements IStationDataTask {
@Autowired
TpriDmpDatabookServiceImpl tpriDmpDatabookServiceImpl;
@Autowired
MonitorFanIndicatorImpl monitorFanIndicatorImpl;
@Override
public List<StationTaksDto> getListStationBasic() {
......@@ -36,6 +41,7 @@ public class StationDataTaskImpl implements IStationDataTask {
}
@Override
@Async("jxiopAsyncExecutor")
public List<DeviceDto> getListDevice(StationTaksDto stationTaksDto) {
List<DeviceDto> deviceDtoList = new ArrayList<>();
TpriDmpDatabook tpriDmpDatabook = tpriDmpDatabookServiceImpl.getTpriDmpDatabookByDataName("风机");
......@@ -48,13 +54,23 @@ public class StationDataTaskImpl implements IStationDataTask {
return deviceDtoList;
}
@Async("jxiopAsyncExecutor")
@Override
public List<IndexDto> getIndexDto(DeviceDto deviceDto) {
return null;
}
public void getIndexDto(DeviceDto deviceDto) {
@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;
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 org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import java.util.List;
/**
* @description: 定时获取场站最新数据
* @author: tw
......@@ -22,8 +26,14 @@ public class StationDataTask {
@Scheduled(cron = "${station.task.cron}")
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