|
|
|
@ -29,6 +29,8 @@ public class DashboardAlertDao { |
|
|
|
|
|
|
|
@Resource |
|
|
|
private JdbcTemplate jdbcTemplate; |
|
|
|
@Resource |
|
|
|
private CompanyInfoDao companyInfoDao; |
|
|
|
|
|
|
|
public void upsertDeviceRawData(DynamodbEntity entity) { |
|
|
|
if (StringUtils.isEmpty(entity.getDeviceId())) { |
|
|
|
@ -72,7 +74,8 @@ public class DashboardAlertDao { |
|
|
|
.collect(Collectors.groupingBy(e -> e.getEntity().getCompanyId())); |
|
|
|
|
|
|
|
grouped.forEach((companyId, subList) -> { |
|
|
|
String dsKey = "dataSourceForCompany_" + companyId; |
|
|
|
long topCompanyId = companyInfoDao.getTopCompanyId(String.valueOf(companyId)); |
|
|
|
String dsKey = "dataSourceForCompany_" + topCompanyId; |
|
|
|
try { |
|
|
|
DataSourceContextHolder.setCurrentDataSourceKey(dsKey); |
|
|
|
|
|
|
|
|