Commit b01c2bc0 authored by Eddie.Wu's avatar Eddie.Wu

Merge branch 'dev_mysql_chase_bug' into 'dev_mysql'

修复gift查询bug

See merge request root/atms!388
parents 7dbe3ca6 3daa8c20
......@@ -25,10 +25,7 @@ import pwc.taxtech.atms.vat.entity.ReportUpload;
import pwc.taxtech.atms.vat.entity.ReportUploadExample;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.*;
import java.util.stream.Collectors;
@Service
......@@ -56,13 +53,16 @@ public class CitReportUploadService extends BaseService {
example.createCriteria().andProjectIdEqualTo(param.getProjectId()).andPeriodEqualTo(param.getPeriod()).andServiceTypeEqualTo(EnumServiceType.CIT.getCode());
example.setOrderByClause(" create_time DESC ");
List<ReportUpload> dataList = reportUploadMapper.selectByExample(example);
DidiFileIUploadParam fileParam = new DidiFileIUploadParam();
fileParam.setUuids(dataList.stream()
.map(o -> o.getFileUploadId()).collect(Collectors.toList()));
PageInfo<DidiFileUploadDetailResult> uploadDetail = didiFileUploadService.queryPage(fileParam);
Map<String,String> urlMap = null;
if(CollectionUtils.isNotEmpty(uploadDetail.getList())){
urlMap = uploadDetail.getList().stream().collect(Collectors.toMap(DidiFileUploadDetailResult::getUid, didiFileUploadDetailResult -> didiFileUploadDetailResult.getViewHttpUrl()));
List<String> fileUploadUids = dataList.stream()
.map(o -> o.getFileUploadId()).collect(Collectors.toList());
Map<String, String> urlMap = new HashMap<>();
if(CollectionUtils.isNotEmpty(fileUploadUids)){
DidiFileIUploadParam fileParam = new DidiFileIUploadParam();
fileParam.setUuids(fileUploadUids);
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>();
for(ReportUpload data:dataList){
......
......@@ -25,10 +25,7 @@ import pwc.taxtech.atms.vat.entity.ReportUpload;
import pwc.taxtech.atms.vat.entity.ReportUploadExample;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.*;
import java.util.stream.Collectors;
@Service
......@@ -56,13 +53,16 @@ public class ReportUploadService extends BaseService {
example.createCriteria().andProjectIdEqualTo(param.getProjectId()).andPeriodEqualTo(param.getPeriod()).andServiceTypeEqualTo(EnumServiceType.VAT.getCode());
example.setOrderByClause(" create_time DESC ");
List<ReportUpload> dataList = reportUploadMapper.selectByExample(example);
DidiFileIUploadParam fileParam = new DidiFileIUploadParam();
fileParam.setUuids(dataList.stream()
.map(o -> o.getFileUploadId()).collect(Collectors.toList()));
PageInfo<DidiFileUploadDetailResult> uploadDetail = didiFileUploadService.queryPage(fileParam);
Map<String,String> urlMap = null;
if(CollectionUtils.isNotEmpty(uploadDetail.getList())){
urlMap = uploadDetail.getList().stream().collect(Collectors.toMap(DidiFileUploadDetailResult::getUid, didiFileUploadDetailResult -> didiFileUploadDetailResult.getViewHttpUrl()));
List<String> fileUploadUids = dataList.stream()
.map(o -> o.getFileUploadId()).collect(Collectors.toList());
Map<String, String> urlMap = new HashMap<>();
if(CollectionUtils.isNotEmpty(fileUploadUids)){
DidiFileIUploadParam fileParam = new DidiFileIUploadParam();
fileParam.setUuids(fileUploadUids);
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>();
for(ReportUpload data:dataList){
......
......@@ -100,13 +100,16 @@ public class TemplateServiceImpl extends AbstractService {
List<Template> templates = templateMapper.selectByExample(example);
List<TemplateDto> templateDtos = new ArrayList<>();
//从文件上传表转换path
DidiFileIUploadParam fileParam = new DidiFileIUploadParam();
fileParam.setUuids(templates.stream()
.map(o -> o.getPath()).collect(Collectors.toList()));
PageInfo<DidiFileUploadDetailResult> uploadDetail = didiFileUploadService.queryPage(fileParam);
Map<String,String> urlMap = null;
if(CollectionUtils.isNotEmpty(uploadDetail.getList())){
urlMap = uploadDetail.getList().stream().collect(Collectors.toMap(DidiFileUploadDetailResult::getUid, didiFileUploadDetailResult -> didiFileUploadDetailResult.getViewHttpUrl()));
List<String> fileUploadUids = templates.stream()
.map(o -> o.getPath()).collect(Collectors.toList());
Map<String, String> urlMap = new HashMap<>();
if(CollectionUtils.isNotEmpty(fileUploadUids)){
DidiFileIUploadParam fileParam = new DidiFileIUploadParam();
fileParam.setUuids(fileUploadUids);
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) {
TemplateDto dto = new TemplateDto();
......
......@@ -550,7 +550,6 @@ public class ReportGeneratorImpl {
DidiFileIUploadParam fileParam = new DidiFileIUploadParam();
fileParam.setUuids(Arrays.asList(a.getPath()));
PageInfo<DidiFileUploadDetailResult> uploadDetail = didiFileUploadService.queryPage(fileParam);
Map<String, String> urlMap = null;
if (CollectionUtils.isNotEmpty(uploadDetail.getList())) {
path = uploadDetail.getList().get(0).getViewHttpUrl();
}
......@@ -634,7 +633,6 @@ public class ReportGeneratorImpl {
DidiFileIUploadParam fileParam = new DidiFileIUploadParam();
fileParam.setUuids(Arrays.asList(a.getPath()));
PageInfo<DidiFileUploadDetailResult> uploadDetail = didiFileUploadService.queryPage(fileParam);
Map<String, String> urlMap = null;
if (CollectionUtils.isNotEmpty(uploadDetail.getList())) {
path = uploadDetail.getList().get(0).getViewHttpUrl();
}
......
......@@ -793,7 +793,6 @@ public class ReportServiceImpl extends BaseService {
DidiFileIUploadParam fileParam = new DidiFileIUploadParam();
fileParam.setUuids(Arrays.asList(periodTemplate.getPath()));
PageInfo<DidiFileUploadDetailResult> uploadDetail = didiFileUploadService.queryPage(fileParam);
Map<String, String> urlMap = null;
is = httpFileService.getUserTemplate(uploadDetail.getList().get(0).getViewHttpUrl());
Workbook tWorkbook = WorkbookFactory.create(is);
tWorkbook = assembleTaxWorkBook(template, tWorkbook, projectId, period);
......@@ -2671,7 +2670,6 @@ public class ReportServiceImpl extends BaseService {
DidiFileIUploadParam fileParam = new DidiFileIUploadParam();
fileParam.setUuids(Arrays.asList(templatePath));
PageInfo<DidiFileUploadDetailResult> uploadDetail = didiFileUploadService.queryPage(fileParam);
Map<String, String> urlMap = null;
if (CollectionUtils.isNotEmpty(uploadDetail.getList())) {
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