Commit 47d1ed83 authored by chenzhao's avatar chenzhao

资料上传

parent 1025c13c
......@@ -58,6 +58,23 @@ public class CommonController {
System.out.println("zip下载成功");
}
/**
* 设备信息下载
*
* @return
*/
@GetMapping(value = "/test")
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "资料下载", notes = "资料下载")
public void test(HttpServletResponse response) throws IOException {
// 设置响应头
response.setContentType("application/zip");
commonService.test(response);
System.out.println("zip下载成功");
}
/**
* 设备信息下载
*
......
......@@ -554,9 +554,9 @@ public class CommonServiceImpl {
for (String peasantHouseholdId : peasantHouseholdIds) {
SurveyInfoAllDto returnDto = surveyInformationServiceImpl.querySurveyInfo(surveyInformationId, peasantHouseholdId, processInstanceId, null);
fileName = returnDto.getSurveyInformation().getOwnersName();
int current = 0;
redisUtils.set(redisKey, MapBuilder.<String, Object>create()
.put("value", current).build());
.put("value", currentBili).build());
String powerStationInstanceId = powerStationMapper.getInstanceIdByhouseId(peasantHouseholdId);
String financingInstanceId = financingAuditingMapper.getInstanceIdByhouseId(peasantHouseholdId);
List<LinkedHashMap> powerStationWorkLog = new ArrayList<>();
......@@ -881,6 +881,16 @@ public class CommonServiceImpl {
cleanup(ziLiaoDir);
}
public void test (HttpServletResponse response) throws UnsupportedEncodingException {
String fileName = "批量资料";
Path currentWorkingDir = Paths.get("");
// 获取当前工作目录
Path rootDir = currentWorkingDir;
Path ziLiaoDir =rootDir.resolve("批量资料");
String encodedFilename = URLEncoder.encode( fileName+".zip", StandardCharsets.UTF_8.name());
response.setHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode(fileName+".zip", "UTF-8"));
createZipFile(ziLiaoDir, "批量资料",response);
}
private void fillSheet(Sheet sheet, Object data) {
if (Objects.isNull(data)){
......
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