Browse Source

bug处理

jwy_category
review512jwy@163.com 1 month ago
parent
commit
c9a8fc944c
  1. 5
      src/main/java/com/techsor/datacenter/sender/dao/DashboardAlertDao.java

5
src/main/java/com/techsor/datacenter/sender/dao/DashboardAlertDao.java

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

Loading…
Cancel
Save