|
@@ -4,6 +4,7 @@ import com.persagy.apm.diagnose.maintenance.model.dto.AlarmProjectDTO;
|
|
|
import com.persagy.apm.diagnose.maintenance.service.IProjectDataRecordService;
|
|
|
import com.persagy.apm.diagnose.service.dto.ProjectDTO;
|
|
|
import com.persagy.apm.diagnose.utils.CommonUtils;
|
|
|
+import com.persagy.framework.tenant.mybatis.datasource.db.holder.SaasContext;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.apache.commons.lang.time.DateUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@@ -35,7 +36,7 @@ public class MaintenanceDataService {
|
|
|
* 计算 数据
|
|
|
*/
|
|
|
public void computeMaintenanceData() throws Exception {
|
|
|
-
|
|
|
+ String groupCode = SaasContext.getContextGroupCode();
|
|
|
//查询项目列表
|
|
|
List<ProjectDTO> projectDTOList = centerDataService.queryProjectList();
|
|
|
if (CollectionUtils.isEmpty(projectDTOList)) {
|
|
@@ -47,6 +48,7 @@ public class MaintenanceDataService {
|
|
|
List<Future<String>> futureList = new ArrayList<>();
|
|
|
CountDownLatch latch = new CountDownLatch(projectDTOList.size());
|
|
|
for (ProjectDTO projectDTO : projectDTOList) {
|
|
|
+ SaasContext.setContextGroupCode(groupCode);
|
|
|
futureList.add(projectDataRecordService.computeMaintenanceData(todayDate,projectDTO, latch));
|
|
|
}
|
|
|
//等待所有任务执行完
|