| | |
| | | response.setCharacterEncoding("utf-8"); |
| | | String fileName = URLEncoder.encode("诉求数据", "UTF-8").replaceAll("\\+", "%20"); |
| | | response.setHeader("Content-disposition", "attachment;filename*=utf-8''" + fileName + ".xlsx"); |
| | | EasyExcel.write(response.getOutputStream(), PartyMemberExcel.class) |
| | | EasyExcel.write(response.getOutputStream(), ComplaintExcel.class) |
| | | .sheet("诉求数据") |
| | | .doWrite(complaintExcels); |
| | | } |
| | | |
| | | @Override |
| | | public void downloadFile(Long id,Integer type) throws IOException { |
| | | Complaint complaint = getById(id); |
| | | Complaint complaint = baseMapper.getDetailBg(id); |
| | | if (Objects.isNull(complaint)) { |
| | | throw new ServiceException("该诉求不存在"); |
| | | } |
| | |
| | | BcRegion region = bcRegionService.getDistrictByCode(complaint.getDistrictsCode().toString()); |
| | | ComStreet street = comStreetService.getById(complaint.getStreetId().toString()); |
| | | ComAct act = comActService.getById(complaint.getCommunityId()); |
| | | String community = region.getRegionName() +"-"+ street.getName() + act.getName(); |
| | | String community = region.getRegionName() +"-"+ street.getName() + "-"+ act.getName(); |
| | | PartyMember partyMember = null; |
| | | if (Objects.nonNull(complaint.getPartyMemberId())){ |
| | | partyMember = partyMemberService.getById(complaint.getPartyMemberId()); |
| | |
| | | map.put("community", community); |
| | | map.put("problemType", complaint.getProblemType()); |
| | | map.put("descriptionContent", complaint.getDescriptionContent()); |
| | | map.put("reportType", ReportTypeEnum.fromCode(complaint.getReportType())); //TODO待修改 |
| | | map.put("reportType", ReportTypeEnum.fromCode(complaint.getReportType()).getDescription()); |
| | | map.put("partyOrganization",Objects.nonNull(partyMember)? partyMember.getPartyOrganization() : ""); |
| | | map.put("name", complaint.getName()); |
| | | map.put("contactNumber", complaint.getContactNumber()); |