|
@ -555,4 +555,29 @@ public class HuzhouProjectController { |
|
|
.sheet("子项目超时情况"+currentDate) |
|
|
.sheet("子项目超时情况"+currentDate) |
|
|
.doWrite(projectinfoService.querySubContractPaySituation()); |
|
|
.doWrite(projectinfoService.querySubContractPaySituation()); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@GetMapping("/queryContractPaySituation") |
|
|
|
|
|
public Result<List<ContractPayInfoDTO>> queryContractPaySituation(){ |
|
|
|
|
|
//ContractPayInfoDTO tmp = contractinfoService.queryContractPaySituation(projectInfo);
|
|
|
|
|
|
List<ContractPayInfoDTO> result = projectinfoService.queryContractPaySituation(); |
|
|
|
|
|
return Result.ok(result); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@GetMapping("/exportContractPaySituation") |
|
|
|
|
|
public void exportContractPaySituation(HttpServletResponse response) throws IOException { |
|
|
|
|
|
// 这里注意 有同学反应使用swagger 会导致各种问题,请直接用浏览器或者用postman
|
|
|
|
|
|
response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"); |
|
|
|
|
|
response.setCharacterEncoding("utf-8"); |
|
|
|
|
|
String flag = "项目超时情况"; |
|
|
|
|
|
// 这里URLEncoder.encode可以防止中文乱码 当然和easyexcel没有关系
|
|
|
|
|
|
LocalDate currentDate = LocalDate.now(); |
|
|
|
|
|
String fileName = URLEncoder.encode( flag+currentDate, "UTF-8") |
|
|
|
|
|
.replaceAll("\\+", "%20"); |
|
|
|
|
|
response.setHeader("Content-disposition", "attachment;filename*=utf-8''" + fileName + ".xlsx"); |
|
|
|
|
|
EasyExcel.write(response.getOutputStream(), ContractPayInfoDTO.class) |
|
|
|
|
|
.sheet("项目超时情况"+currentDate) |
|
|
|
|
|
.doWrite(projectinfoService.queryContractPaySituation()); |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|