perf: 异步同时采集数据
parent
b7b76af5b6
commit
3aeef8dbac
@ -0,0 +1,33 @@
|
|||||||
|
package com.xydl.cac.task;
|
||||||
|
|
||||||
|
import com.xydl.cac.entity.IcdIed;
|
||||||
|
import com.xydl.cac.entity.Rptparamindex;
|
||||||
|
import com.xydl.cac.iec.IEDCollectService;
|
||||||
|
import com.xydl.cac.repository.*;
|
||||||
|
import com.xydl.cac.service.DataService;
|
||||||
|
import org.springframework.scheduling.annotation.Async;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class AsyncTask {
|
||||||
|
@Resource
|
||||||
|
IcdConfigTypeRepository configRepository;
|
||||||
|
@Resource
|
||||||
|
IcdConfigTypeAttRepository attRepository;
|
||||||
|
@Resource
|
||||||
|
IcdConfigTypeInstRepository instRepository;
|
||||||
|
@Resource
|
||||||
|
RptparamindexRepository rptparamindexRepository;
|
||||||
|
@Resource
|
||||||
|
DataService dataService;
|
||||||
|
|
||||||
|
@Async
|
||||||
|
public void collectIed(String xml, IcdIed ied, List<Rptparamindex> rptList) {
|
||||||
|
IEDCollectService iedService = new IEDCollectService(configRepository, attRepository, instRepository,
|
||||||
|
rptparamindexRepository, dataService, xml, ied);
|
||||||
|
iedService.collectAndSave(rptList);
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue