Commit 3daa8c20 authored by chase's avatar chase

修复gift查询bug

parent 7ce4524e
...@@ -25,10 +25,7 @@ import pwc.taxtech.atms.vat.entity.ReportUpload; ...@@ -25,10 +25,7 @@ import pwc.taxtech.atms.vat.entity.ReportUpload;
import pwc.taxtech.atms.vat.entity.ReportUploadExample; import pwc.taxtech.atms.vat.entity.ReportUploadExample;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.ArrayList; import java.util.*;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@Service @Service
...@@ -56,13 +53,16 @@ public class CitReportUploadService extends BaseService { ...@@ -56,13 +53,16 @@ public class CitReportUploadService extends BaseService {
example.createCriteria().andProjectIdEqualTo(param.getProjectId()).andPeriodEqualTo(param.getPeriod()).andServiceTypeEqualTo(EnumServiceType.CIT.getCode()); example.createCriteria().andProjectIdEqualTo(param.getProjectId()).andPeriodEqualTo(param.getPeriod()).andServiceTypeEqualTo(EnumServiceType.CIT.getCode());
example.setOrderByClause(" create_time DESC "); example.setOrderByClause(" create_time DESC ");
List<ReportUpload> dataList = reportUploadMapper.selectByExample(example); List<ReportUpload> dataList = reportUploadMapper.selectByExample(example);
DidiFileIUploadParam fileParam = new DidiFileIUploadParam(); List<String> fileUploadUids = dataList.stream()
fileParam.setUuids(dataList.stream() .map(o -> o.getFileUploadId()).collect(Collectors.toList());
.map(o -> o.getFileUploadId()).collect(Collectors.toList())); Map<String, String> urlMap = new HashMap<>();
PageInfo<DidiFileUploadDetailResult> uploadDetail = didiFileUploadService.queryPage(fileParam); if(CollectionUtils.isNotEmpty(fileUploadUids)){
Map<String,String> urlMap = null; DidiFileIUploadParam fileParam = new DidiFileIUploadParam();
if(CollectionUtils.isNotEmpty(uploadDetail.getList())){ fileParam.setUuids(fileUploadUids);
urlMap = uploadDetail.getList().stream().collect(Collectors.toMap(DidiFileUploadDetailResult::getUid, didiFileUploadDetailResult -> didiFileUploadDetailResult.getViewHttpUrl())); PageInfo<DidiFileUploadDetailResult> uploadDetail = didiFileUploadService.queryPage(fileParam);
if(CollectionUtils.isNotEmpty(uploadDetail.getList())){
urlMap = uploadDetail.getList().stream().collect(Collectors.toMap(DidiFileUploadDetailResult::getUid, didiFileUploadDetailResult -> didiFileUploadDetailResult.getViewHttpUrl()));
}
} }
List<ReportUploadResult> resultList = new ArrayList<ReportUploadResult>(); List<ReportUploadResult> resultList = new ArrayList<ReportUploadResult>();
for(ReportUpload data:dataList){ for(ReportUpload data:dataList){
......
...@@ -25,10 +25,7 @@ import pwc.taxtech.atms.vat.entity.ReportUpload; ...@@ -25,10 +25,7 @@ import pwc.taxtech.atms.vat.entity.ReportUpload;
import pwc.taxtech.atms.vat.entity.ReportUploadExample; import pwc.taxtech.atms.vat.entity.ReportUploadExample;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.ArrayList; import java.util.*;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@Service @Service
...@@ -56,13 +53,16 @@ public class ReportUploadService extends BaseService { ...@@ -56,13 +53,16 @@ public class ReportUploadService extends BaseService {
example.createCriteria().andProjectIdEqualTo(param.getProjectId()).andPeriodEqualTo(param.getPeriod()).andServiceTypeEqualTo(EnumServiceType.VAT.getCode()); example.createCriteria().andProjectIdEqualTo(param.getProjectId()).andPeriodEqualTo(param.getPeriod()).andServiceTypeEqualTo(EnumServiceType.VAT.getCode());
example.setOrderByClause(" create_time DESC "); example.setOrderByClause(" create_time DESC ");
List<ReportUpload> dataList = reportUploadMapper.selectByExample(example); List<ReportUpload> dataList = reportUploadMapper.selectByExample(example);
DidiFileIUploadParam fileParam = new DidiFileIUploadParam(); List<String> fileUploadUids = dataList.stream()
fileParam.setUuids(dataList.stream() .map(o -> o.getFileUploadId()).collect(Collectors.toList());
.map(o -> o.getFileUploadId()).collect(Collectors.toList())); Map<String, String> urlMap = new HashMap<>();
PageInfo<DidiFileUploadDetailResult> uploadDetail = didiFileUploadService.queryPage(fileParam); if(CollectionUtils.isNotEmpty(fileUploadUids)){
Map<String,String> urlMap = null; DidiFileIUploadParam fileParam = new DidiFileIUploadParam();
if(CollectionUtils.isNotEmpty(uploadDetail.getList())){ fileParam.setUuids(fileUploadUids);
urlMap = uploadDetail.getList().stream().collect(Collectors.toMap(DidiFileUploadDetailResult::getUid, didiFileUploadDetailResult -> didiFileUploadDetailResult.getViewHttpUrl())); PageInfo<DidiFileUploadDetailResult> uploadDetail = didiFileUploadService.queryPage(fileParam);
if(CollectionUtils.isNotEmpty(uploadDetail.getList())){
urlMap = uploadDetail.getList().stream().collect(Collectors.toMap(DidiFileUploadDetailResult::getUid, didiFileUploadDetailResult -> didiFileUploadDetailResult.getViewHttpUrl()));
}
} }
List<ReportUploadResult> resultList = new ArrayList<ReportUploadResult>(); List<ReportUploadResult> resultList = new ArrayList<ReportUploadResult>();
for(ReportUpload data:dataList){ for(ReportUpload data:dataList){
......
...@@ -100,13 +100,16 @@ public class TemplateServiceImpl extends AbstractService { ...@@ -100,13 +100,16 @@ public class TemplateServiceImpl extends AbstractService {
List<Template> templates = templateMapper.selectByExample(example); List<Template> templates = templateMapper.selectByExample(example);
List<TemplateDto> templateDtos = new ArrayList<>(); List<TemplateDto> templateDtos = new ArrayList<>();
//从文件上传表转换path //从文件上传表转换path
DidiFileIUploadParam fileParam = new DidiFileIUploadParam(); List<String> fileUploadUids = templates.stream()
fileParam.setUuids(templates.stream() .map(o -> o.getPath()).collect(Collectors.toList());
.map(o -> o.getPath()).collect(Collectors.toList())); Map<String, String> urlMap = new HashMap<>();
PageInfo<DidiFileUploadDetailResult> uploadDetail = didiFileUploadService.queryPage(fileParam); if(CollectionUtils.isNotEmpty(fileUploadUids)){
Map<String,String> urlMap = null; DidiFileIUploadParam fileParam = new DidiFileIUploadParam();
if(CollectionUtils.isNotEmpty(uploadDetail.getList())){ fileParam.setUuids(fileUploadUids);
urlMap = uploadDetail.getList().stream().collect(Collectors.toMap(DidiFileUploadDetailResult::getUid, didiFileUploadDetailResult -> didiFileUploadDetailResult.getViewHttpUrl())); PageInfo<DidiFileUploadDetailResult> uploadDetail = didiFileUploadService.queryPage(fileParam);
if(CollectionUtils.isNotEmpty(uploadDetail.getList())){
urlMap = uploadDetail.getList().stream().collect(Collectors.toMap(DidiFileUploadDetailResult::getUid, didiFileUploadDetailResult -> didiFileUploadDetailResult.getViewHttpUrl()));
}
} }
for (Template template : templates) { for (Template template : templates) {
TemplateDto dto = new TemplateDto(); TemplateDto dto = new TemplateDto();
......
...@@ -44,7 +44,6 @@ import java.util.regex.Matcher; ...@@ -44,7 +44,6 @@ import java.util.regex.Matcher;
import java.util.regex.Pattern; import java.util.regex.Pattern;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import static org.apache.poi.ss.usermodel.Cell.CELL_TYPE_FORMULA;
import static pwc.taxtech.atms.common.util.SpringContextUtil.reportMapper; import static pwc.taxtech.atms.common.util.SpringContextUtil.reportMapper;
import static pwc.taxtech.atms.dto.vatdto.WrapPeriodJobDto.*; import static pwc.taxtech.atms.dto.vatdto.WrapPeriodJobDto.*;
...@@ -551,7 +550,6 @@ public class ReportGeneratorImpl { ...@@ -551,7 +550,6 @@ public class ReportGeneratorImpl {
DidiFileIUploadParam fileParam = new DidiFileIUploadParam(); DidiFileIUploadParam fileParam = new DidiFileIUploadParam();
fileParam.setUuids(Arrays.asList(a.getPath())); fileParam.setUuids(Arrays.asList(a.getPath()));
PageInfo<DidiFileUploadDetailResult> uploadDetail = didiFileUploadService.queryPage(fileParam); PageInfo<DidiFileUploadDetailResult> uploadDetail = didiFileUploadService.queryPage(fileParam);
Map<String, String> urlMap = null;
if (CollectionUtils.isNotEmpty(uploadDetail.getList())) { if (CollectionUtils.isNotEmpty(uploadDetail.getList())) {
path = uploadDetail.getList().get(0).getViewHttpUrl(); path = uploadDetail.getList().get(0).getViewHttpUrl();
} }
...@@ -616,7 +614,6 @@ public class ReportGeneratorImpl { ...@@ -616,7 +614,6 @@ public class ReportGeneratorImpl {
DidiFileIUploadParam fileParam = new DidiFileIUploadParam(); DidiFileIUploadParam fileParam = new DidiFileIUploadParam();
fileParam.setUuids(Arrays.asList(a.getPath())); fileParam.setUuids(Arrays.asList(a.getPath()));
PageInfo<DidiFileUploadDetailResult> uploadDetail = didiFileUploadService.queryPage(fileParam); PageInfo<DidiFileUploadDetailResult> uploadDetail = didiFileUploadService.queryPage(fileParam);
Map<String, String> urlMap = null;
if (CollectionUtils.isNotEmpty(uploadDetail.getList())) { if (CollectionUtils.isNotEmpty(uploadDetail.getList())) {
path = uploadDetail.getList().get(0).getViewHttpUrl(); path = uploadDetail.getList().get(0).getViewHttpUrl();
} }
......
...@@ -798,7 +798,6 @@ public class ReportServiceImpl extends BaseService { ...@@ -798,7 +798,6 @@ public class ReportServiceImpl extends BaseService {
DidiFileIUploadParam fileParam = new DidiFileIUploadParam(); DidiFileIUploadParam fileParam = new DidiFileIUploadParam();
fileParam.setUuids(Arrays.asList(periodTemplate.getPath())); fileParam.setUuids(Arrays.asList(periodTemplate.getPath()));
PageInfo<DidiFileUploadDetailResult> uploadDetail = didiFileUploadService.queryPage(fileParam); PageInfo<DidiFileUploadDetailResult> uploadDetail = didiFileUploadService.queryPage(fileParam);
Map<String, String> urlMap = null;
is = httpFileService.getUserTemplate(uploadDetail.getList().get(0).getViewHttpUrl()); is = httpFileService.getUserTemplate(uploadDetail.getList().get(0).getViewHttpUrl());
Workbook tWorkbook = WorkbookFactory.create(is); Workbook tWorkbook = WorkbookFactory.create(is);
tWorkbook = assembleTaxWorkBook(template, tWorkbook, projectId, period); tWorkbook = assembleTaxWorkBook(template, tWorkbook, projectId, period);
...@@ -2676,7 +2675,6 @@ public class ReportServiceImpl extends BaseService { ...@@ -2676,7 +2675,6 @@ public class ReportServiceImpl extends BaseService {
DidiFileIUploadParam fileParam = new DidiFileIUploadParam(); DidiFileIUploadParam fileParam = new DidiFileIUploadParam();
fileParam.setUuids(Arrays.asList(templatePath)); fileParam.setUuids(Arrays.asList(templatePath));
PageInfo<DidiFileUploadDetailResult> uploadDetail = didiFileUploadService.queryPage(fileParam); PageInfo<DidiFileUploadDetailResult> uploadDetail = didiFileUploadService.queryPage(fileParam);
Map<String, String> urlMap = null;
if (CollectionUtils.isNotEmpty(uploadDetail.getList())) { if (CollectionUtils.isNotEmpty(uploadDetail.getList())) {
templatePath = uploadDetail.getList().get(0).getViewHttpUrl(); templatePath = uploadDetail.getList().get(0).getViewHttpUrl();
} }
......
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