Commit 89c240f7 authored by chase's avatar chase

fix bug

parent c27c0c83
......@@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSONObject;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import net.sf.json.JSONNull;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.poi.ss.usermodel.CellType;
import org.apache.poi.ss.usermodel.DateUtil;
......@@ -19,9 +20,11 @@ import org.springframework.web.multipart.MultipartFile;
import pwc.taxtech.atms.common.PageResultVo;
import pwc.taxtech.atms.common.util.DateUtils;
import pwc.taxtech.atms.constant.enums.FileUploadEnum;
import pwc.taxtech.atms.dpo.OrgSelectDto;
import pwc.taxtech.atms.dto.TaxDocumentDto;
import pwc.taxtech.atms.entity.TaxDocument;
import pwc.taxtech.atms.service.impl.DidiFileUploadService;
import pwc.taxtech.atms.service.impl.OrganizationServiceImpl;
import pwc.taxtech.atms.service.impl.TaxDocumentServiceImpl;
import pwc.taxtech.atms.thirdparty.ExcelUtil;
import pwc.taxtech.atms.vat.entity.FileUpload;
......@@ -36,6 +39,7 @@ import java.net.URL;
import java.net.URLDecoder;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.stream.Collectors;
@Controller
@RequestMapping("/api/v1/taxDoc")
......@@ -46,11 +50,18 @@ public class TaxDocumentController {
@Autowired
private DidiFileUploadService didiFileUploadService;
@Autowired
private OrganizationServiceImpl organizationService;
@PostMapping("selectList")
@ResponseBody
public PageResultVo<TaxDocument> selectTaxDocumentList(@RequestBody TaxDocumentDto taxDocumentDto) {
List<OrgSelectDto> orgList = organizationService.getMyOrgList();
if(CollectionUtils.isEmpty(orgList)){
return new PageResultVo<>();
}
PageHelper.startPage(taxDocumentDto.getCurrentPage(), taxDocumentDto.getPageSize());
PageInfo<TaxDocument> taxDocumentPageInfo = new PageInfo<>(taxDocumentService.selectTaxDocumentList(taxDocumentDto));
PageInfo<TaxDocument> taxDocumentPageInfo = new PageInfo<>(taxDocumentService.selectTaxDocumentList(taxDocumentDto,orgList.stream()
.map(o -> o.getId()).collect(Collectors.toList())));
List<TaxDocument> list = taxDocumentPageInfo.getList();
return PageResultVo.getPageResultVo(taxDocumentPageInfo, list);
}
......@@ -116,7 +127,14 @@ public class TaxDocumentController {
headers.put("UploadTime", "上传日期");
headers.put("Creator", "创建人");
headers.put("Remark", "档案备注");
List<TaxDocument> TaxDocument = taxDocumentService.selectTaxDocumentList(taxDocumentDto);
List<TaxDocument> TaxDocument =null;
List<OrgSelectDto> orgList = organizationService.getMyOrgList();
if(CollectionUtils.isEmpty(orgList)){
TaxDocument = new ArrayList<>();
}else{
TaxDocument = taxDocumentService.selectTaxDocumentList(taxDocumentDto,orgList.stream()
.map(o -> o.getId()).collect(Collectors.toList()));
}
response.setContentType("multipart/form-data");
response.setHeader("Content-Disposition", "attachment;fileName=" + new String("taxDocument.xlsx".getBytes("GB2312"), "ISO-8859-1"));
OutputStream ouputStream = response.getOutputStream();
......
......@@ -12,7 +12,6 @@ import pwc.taxtech.atms.common.AuthUserHelper;
import pwc.taxtech.atms.constant.enums.FileUploadEnum;
import pwc.taxtech.atms.constant.enums.ReportFileUploadEnum;
import pwc.taxtech.atms.dao.TaxDocumentMapper;
import pwc.taxtech.atms.dpo.OrgSelectDto;
import pwc.taxtech.atms.dto.TaxDocumentDto;
import pwc.taxtech.atms.dto.didiFileUpload.DidiFileIUploadParam;
import pwc.taxtech.atms.dto.didiFileUpload.DidiFileUploadDetailResult;
......@@ -61,13 +60,9 @@ public class TaxDocumentServiceImpl {
private OrganizationServiceImpl organizationService;
public List<TaxDocument> selectTaxDocumentList(TaxDocumentDto taxDocumentDto) {
List<OrgSelectDto> orgList = organizationService.getMyOrgList();
if(CollectionUtils.isEmpty(orgList)){
return new ArrayList<>();
}
List<TaxDocument> dataList = taxDocumentMapper.selectByExample(getExample(taxDocumentDto,orgList.stream()
.map(o -> o.getId()).collect(Collectors.toList())));
public List<TaxDocument> selectTaxDocumentList(TaxDocumentDto taxDocumentDto,List<String> orgIds) {
List<TaxDocument> dataList = taxDocumentMapper.selectByExample(getExample(taxDocumentDto,orgIds));
DidiFileIUploadParam fileParam = new DidiFileIUploadParam();
fileParam.setUuids(dataList.stream()
.map(o -> o.getFileUploadId()).collect(Collectors.toList()));
......
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