Commit 6b46f9ad authored by neo's avatar neo

[Bugfix] fixed muallempty id sql errro

parent 7a473ec4
...@@ -200,13 +200,15 @@ public class ReportServiceImpl { ...@@ -200,13 +200,15 @@ public class ReportServiceImpl {
} }
}); });
PeriodCellDataSourceExample periodCellDataSourceExample = new PeriodCellDataSourceExample(); if (!periodManualDsIds.isEmpty()) {
periodCellDataSourceExample.createCriteria().andProjectIdEqualTo(projectId).andPeriodEqualTo(period) PeriodCellDataSourceExample periodCellDataSourceExample = new PeriodCellDataSourceExample();
.andDataSourceIdIn(periodManualDsIds); periodCellDataSourceExample.createCriteria().andProjectIdEqualTo(projectId).andPeriodEqualTo(period)
List<PeriodCellDataSource> manualCellDataSource = periodCellDataSourceMapper.selectByExample(periodCellDataSourceExample); .andDataSourceIdIn(periodManualDsIds);
if (!manualCellDataSource.isEmpty()) List<PeriodCellDataSource> manualCellDataSource = periodCellDataSourceMapper.selectByExample(periodCellDataSourceExample);
periodManualCellDataIds.addAll(manualCellDataSource.stream().map(PeriodCellDataSource::getCellDataId) if (!manualCellDataSource.isEmpty())
.collect(Collectors.toList())); periodManualCellDataIds.addAll(manualCellDataSource.stream().map(PeriodCellDataSource::getCellDataId)
.collect(Collectors.toList()));
}
} else { } else {
periodDsIds.addAll(periodDataSources.stream().map(m -> m.getId()).collect(Collectors.toList())); periodDsIds.addAll(periodDataSources.stream().map(m -> m.getId()).collect(Collectors.toList()));
} }
...@@ -247,7 +249,7 @@ public class ReportServiceImpl { ...@@ -247,7 +249,7 @@ public class ReportServiceImpl {
} }
public OperationResultDto updateConfig(String projectId, Integer period, Boolean ifDeleteManualDataSource, public OperationResultDto updateConfig(String projectId, Integer period, Boolean ifDeleteManualDataSource,
String generator,Boolean isMergeManualData) { String generator, Boolean isMergeManualData) {
OperationResultDto result = new OperationResultDto(); OperationResultDto result = new OperationResultDto();
try { try {
if (period == null) { if (period == null) {
...@@ -274,7 +276,7 @@ public class ReportServiceImpl { ...@@ -274,7 +276,7 @@ public class ReportServiceImpl {
Long templateGroupId = projectMapper.getTemplateGroupIdByProject(projectId, EnumServiceType.VAT.getCode()); Long templateGroupId = projectMapper.getTemplateGroupIdByProject(projectId, EnumServiceType.VAT.getCode());
if (templateGroupId != null && templateGroupId != 0) { if (templateGroupId != null && templateGroupId != 0) {
// 先进行数据清理,包括period开头的所有报表配置表 条件Period // 先进行数据清理,包括period开头的所有报表配置表 条件Period
clearPeriodData(projectId, period, exceptTemplateIds,isMergeManualData); clearPeriodData(projectId, period, exceptTemplateIds, isMergeManualData);
// 根据templategroupid 把 template 插入到 periodTemplate // 根据templategroupid 把 template 插入到 periodTemplate
TemplateExample example = new TemplateExample(); TemplateExample example = new TemplateExample();
example.createCriteria().andTemplateGroupIdEqualTo(templateGroupId); example.createCriteria().andTemplateGroupIdEqualTo(templateGroupId);
......
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