Commit 4e1ca4d4 authored by neo's avatar neo

[bugfix] oracle not support in ''

parent acbd176b
package pwc.taxtech.atms.vat.service.impl; package pwc.taxtech.atms.vat.service.impl;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.google.common.collect.Lists;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
...@@ -151,14 +152,16 @@ public class ReportServiceImpl extends VatAbstractService implements ReportServi ...@@ -151,14 +152,16 @@ public class ReportServiceImpl extends VatAbstractService implements ReportServi
PeriodDataSourceExample periodDataSourceExample = new PeriodDataSourceExample(); PeriodDataSourceExample periodDataSourceExample = new PeriodDataSourceExample();
periodDataSourceExample.createCriteria().andProjectIdEqualTo(projectId).andPeriodEqualTo(period); periodDataSourceExample.createCriteria().andProjectIdEqualTo(projectId).andPeriodEqualTo(period);
List<PeriodDataSource> periodDataSources = periodDataSourceMapper.selectByExample(periodDataSourceExample); List<PeriodDataSource> periodDataSources = periodDataSourceMapper.selectByExample(periodDataSourceExample);
List<Long> periodDsIds = Lists.newArrayList(Long.MAX_VALUE);
periodDsIds.addAll(periodDataSources.stream().map(m -> m.getId()).collect(Collectors.toList()));
PeriodDataSourceDetailExample periodDataSourceDetailExample = new PeriodDataSourceDetailExample(); PeriodDataSourceDetailExample periodDataSourceDetailExample = new PeriodDataSourceDetailExample();
periodDataSourceDetailExample.createCriteria().andProjectIdEqualTo(projectId).andPeriodEqualTo(period) periodDataSourceDetailExample.createCriteria().andProjectIdEqualTo(projectId).andPeriodEqualTo(period)
.andDataSourceIdIn(periodDataSources.stream().map(m -> m.getId()).collect(Collectors.toList())); .andDataSourceIdIn(periodDsIds);
periodDataSourceDetailMapper.deleteByExample(periodDataSourceDetailExample); periodDataSourceDetailMapper.deleteByExample(periodDataSourceDetailExample);
PeriodCellDataSourceExample periodCellDataSourceExample = new PeriodCellDataSourceExample(); PeriodCellDataSourceExample periodCellDataSourceExample = new PeriodCellDataSourceExample();
periodCellDataSourceExample.createCriteria().andProjectIdEqualTo(projectId).andPeriodEqualTo(period) periodCellDataSourceExample.createCriteria().andProjectIdEqualTo(projectId).andPeriodEqualTo(period)
.andDataSourceIdIn(periodDataSources.stream().map(m -> m.getId()).collect(Collectors.toList())); .andDataSourceIdIn(periodDsIds);
periodCellDataSourceMapper.deleteByExample(periodCellDataSourceExample); periodCellDataSourceMapper.deleteByExample(periodCellDataSourceExample);
periodDataSourceMapper.deleteByExample(periodDataSourceExample); periodDataSourceMapper.deleteByExample(periodDataSourceExample);
...@@ -167,9 +170,11 @@ public class ReportServiceImpl extends VatAbstractService implements ReportServi ...@@ -167,9 +170,11 @@ public class ReportServiceImpl extends VatAbstractService implements ReportServi
periodReportExample.createCriteria().andProjectIdEqualTo(projectId).andPeriodEqualTo(period); periodReportExample.createCriteria().andProjectIdEqualTo(projectId).andPeriodEqualTo(period);
List<PeriodReport> reports = periodReportMapper.selectByExample(periodReportExample); List<PeriodReport> reports = periodReportMapper.selectByExample(periodReportExample);
List<Long> reportIds = Lists.newArrayList(Long.MAX_VALUE);
reportIds.addAll(reports.stream().map(m -> m.getId()).collect(Collectors.toList()));
PeriodCellDataExample periodCellDataExample = new PeriodCellDataExample(); PeriodCellDataExample periodCellDataExample = new PeriodCellDataExample();
periodCellDataExample.createCriteria().andProjectIdEqualTo(projectId).andPeriodEqualTo(period).andReportIdIn( periodCellDataExample.createCriteria().andProjectIdEqualTo(projectId).andPeriodEqualTo(period).andReportIdIn(
reports.stream().map(m -> m.getId()).collect(Collectors.toList())); reportIds);
periodCellDataMapper.deleteByExample(periodCellDataExample); periodCellDataMapper.deleteByExample(periodCellDataExample);
periodReportMapper.deleteByExample(periodReportExample); periodReportMapper.deleteByExample(periodReportExample);
......
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