Commit 0f7dc1d0 authored by chenzhao's avatar chenzhao

ziliaoxiazai

parent 5d5996fb
...@@ -2,6 +2,7 @@ package com.yeejoin.amos.boot.module.hygf.biz.controller; ...@@ -2,6 +2,7 @@ package com.yeejoin.amos.boot.module.hygf.biz.controller;
import com.google.common.net.HttpHeaders; import com.google.common.net.HttpHeaders;
import com.yeejoin.amos.boot.module.hygf.api.dto.CommerceInfoDto; import com.yeejoin.amos.boot.module.hygf.api.dto.CommerceInfoDto;
import com.yeejoin.amos.boot.module.hygf.api.util.CommonResponseNewUtil;
import com.yeejoin.amos.boot.module.hygf.biz.service.impl.CommonServiceImpl; import com.yeejoin.amos.boot.module.hygf.biz.service.impl.CommonServiceImpl;
import com.yeejoin.amos.boot.module.hygf.biz.service.impl.FinancingInfoServiceImpl; import com.yeejoin.amos.boot.module.hygf.biz.service.impl.FinancingInfoServiceImpl;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
...@@ -45,18 +46,18 @@ public class CommonController { ...@@ -45,18 +46,18 @@ public class CommonController {
@GetMapping(value = "/downInformation") @GetMapping(value = "/downInformation")
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "资料下载", notes = "资料下载") @ApiOperation(httpMethod = "GET", value = "资料下载", notes = "资料下载")
public void downList(HttpServletResponse response, @RequestParam(required = false) String surveyInformationId, public ResponseModel downList(HttpServletResponse response, @RequestParam(required = false) String surveyInformationId,
@RequestParam(required = false)String peasantHouseholdId, @RequestParam(required = false)List<String> peasantHouseholdIds,
@RequestParam(required = false)String processInstanceId) throws IOException { @RequestParam(required = false)String processInstanceId) throws IOException {
// 设置响应头 // 设置响应头
response.setContentType("application/zip"); response.setContentType("application/zip");
commonService.downZiliao(surveyInformationId,peasantHouseholdId,processInstanceId,response); commonService.downZiliao(surveyInformationId,peasantHouseholdIds,processInstanceId,response);
return CommonResponseNewUtil.success();
} }
/** /**
* 设备信息下载 * 设备信息下载
* *
...@@ -65,9 +66,9 @@ public class CommonController { ...@@ -65,9 +66,9 @@ public class CommonController {
@GetMapping(value = "/getSchedule") @GetMapping(value = "/getSchedule")
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "资料下载进度获取", notes = "资料下载进度获取") @ApiOperation(httpMethod = "GET", value = "资料下载进度获取", notes = "资料下载进度获取")
public Object getSchedule(String peasantHouseholdId) { public ResponseModel<Object> getSchedule(String peasantHouseholdId) {
return commonService.getSchedule(peasantHouseholdId); return ResponseHelper.buildResponse(commonService.getSchedule(peasantHouseholdId));
} }
......
...@@ -499,275 +499,297 @@ public class CommonServiceImpl { ...@@ -499,275 +499,297 @@ public class CommonServiceImpl {
return jsonArray; return jsonArray;
} }
public void downZiliao(String surveyInformationId, String peasantHouseholdId, String processInstanceId, HttpServletResponse response) throws IOException { public void downZiliao(String surveyInformationId, List<String> peasantHouseholdIds, String processInstanceId, HttpServletResponse response) throws IOException {
String fileName = "";
SurveyInfoAllDto returnDto = surveyInformationServiceImpl.querySurveyInfo(surveyInformationId, peasantHouseholdId, processInstanceId, null); String redisKey = "";
int current = 0; if (peasantHouseholdIds.size()>1){
redisUtils.set(peasantHouseholdId, MapBuilder.<String, Object>create() redisKey = String.join(",", peasantHouseholdIds);
.put("value", current).build());
String powerStationInstanceId = powerStationMapper.getInstanceIdByhouseId(peasantHouseholdId);
String workOrderStationInstanceId = workOrderStationAuditingMapper.getInstanceIdByhouseId(peasantHouseholdId);
String basicGridInstanceId = basicGridAuditingMapper.getInstanceIdByhouseId(peasantHouseholdId);
String financingInstanceId = financingAuditingMapper.getInstanceIdByhouseId(peasantHouseholdId);
List<LinkedHashMap> powerStationWorkLog = new ArrayList<>();
List<ConstructionRecords> workOrderStationWorkLog = new ArrayList<>();
List<LinkedHashMap> basicGridWorkLog = new ArrayList<>();
List<LinkedHashMap> financingWorkLog = new ArrayList<>();
List<LinkedHashMap> accptWorkLog = new ArrayList<>();
workOrderStationWorkLog = this.getConstructionRecords(peasantHouseholdId);
try {
powerStationWorkLog = this.getWorkLog(powerStationInstanceId);
basicGridWorkLog = this.getWorkLog(basicGridInstanceId);
financingWorkLog = this.getWorkLog(financingInstanceId);
accptWorkLog = this.getWorkLog(returnDto.getAcceptanceCheck().getInstanceId());
}catch (Exception e){
e.printStackTrace();
} }
int baifenbi = 100 / peasantHouseholdIds.size();
int currentBili = 0;
Path templateDir = Paths.get(TEMPLATE_FILE_PATH).getParent();
System.out.println("模版文件所在目录是: " + templateDir);
Path currentWorkingDir = Paths.get(""); Path currentWorkingDir = Paths.get("");
// 获取当前工作目录 // 获取当前工作目录
Path rootDir = currentWorkingDir; Path rootDir = currentWorkingDir;
Path tempDir =rootDir.resolve(returnDto.getSurveyInformation().getOwnersName()); Path ziLiaoDir =rootDir.resolve("批量资料");
try { for (String peasantHouseholdId : peasantHouseholdIds) {
Files.createDirectories(tempDir); // 创建临时目录 SurveyInfoAllDto returnDto = surveyInformationServiceImpl.querySurveyInfo(surveyInformationId, peasantHouseholdId, processInstanceId, null);
System.out.println("Temporary directory created at: " + tempDir); fileName = returnDto.getSurveyInformation().getOwnersName();
} catch (IOException e) { int current = 0;
e.printStackTrace(); redisUtils.set(peasantHouseholdId, MapBuilder.<String, Object>create()
return; .put("value", current).build());
} String powerStationInstanceId = powerStationMapper.getInstanceIdByhouseId(peasantHouseholdId);
String templatePath = "templates/informationTemp.xlsx"; String workOrderStationInstanceId = workOrderStationAuditingMapper.getInstanceIdByhouseId(peasantHouseholdId);
//String templatePath = "F:\\work\\amos-boot-zx-biz\\amos-boot-system-jxiop\\amos-boot-module-hygf-biz\\src\\main\\resources\\templates\\informationTemp.xlsx"; String basicGridInstanceId = basicGridAuditingMapper.getInstanceIdByhouseId(peasantHouseholdId);
// String outputPath = "F:\\work\\amos-boot-zx-biz\\amos-boot-system-jxiop\\amos-boot-module-hygf-biz\\src\\main\\resources\\templates\\temp\\"+returnDto.getSurveyInformation().getOwnersName()+".xlsx"; String financingInstanceId = financingAuditingMapper.getInstanceIdByhouseId(peasantHouseholdId);
String outputPath = returnDto.getSurveyInformation().getOwnersName()+"/"+returnDto.getSurveyInformation().getOwnersName()+".xlsx"; List<LinkedHashMap> powerStationWorkLog = new ArrayList<>();
List<ConstructionRecords> workOrderStationWorkLog = new ArrayList<>();
List<LinkedHashMap> basicGridWorkLog = new ArrayList<>();
List<LinkedHashMap> financingWorkLog = new ArrayList<>();
List<LinkedHashMap> accptWorkLog = new ArrayList<>();
workOrderStationWorkLog = this.getConstructionRecords(peasantHouseholdId);
Workbook workbook = null; try {
try ( InputStream fis = new ClassPathResource(templatePath).getInputStream()){ powerStationWorkLog = this.getWorkLog(powerStationInstanceId);
workbook = new XSSFWorkbook(fis); basicGridWorkLog = this.getWorkLog(basicGridInstanceId);
financingWorkLog = this.getWorkLog(financingInstanceId);
accptWorkLog = this.getWorkLog(returnDto.getAcceptanceCheck().getInstanceId());
Sheet firstSheet = workbook.getSheetAt(0); }catch (Exception e){
fillSheet(firstSheet, returnDto.getSurveyInformation()); e.printStackTrace();
}
Sheet secondSheet = workbook.getSheetAt(1);
fillSheet(secondSheet, returnDto.getSurveyDetails());
Sheet secondSheet2 = workbook.getSheetAt(2); Path templateDir = Paths.get(TEMPLATE_FILE_PATH).getParent();
fillSheet(secondSheet2, returnDto.getDesignInformation()); System.out.println("模版文件所在目录是: " + templateDir);
Sheet secondSheet3 = workbook.getSheetAt(3); Path tempDir =ziLiaoDir.resolve(returnDto.getSurveyInformation().getOwnersName());
fillSheet(secondSheet3, returnDto.getCommercial()); try {
Files.createDirectories(tempDir); // 创建临时目录
System.out.println("Temporary directory created at: " + tempDir);
} catch (IOException e) {
e.printStackTrace();
return;
}
String templatePath = "templates/informationTemp.xlsx";
//String templatePath = "F:\\work\\amos-boot-zx-biz\\amos-boot-system-jxiop\\amos-boot-module-hygf-biz\\src\\main\\resources\\templates\\informationTemp.xlsx";
// String outputPath = "F:\\work\\amos-boot-zx-biz\\amos-boot-system-jxiop\\amos-boot-module-hygf-biz\\src\\main\\resources\\templates\\temp\\"+returnDto.getSurveyInformation().getOwnersName()+".xlsx";
String outputPath ="批量资料/"+ returnDto.getSurveyInformation().getOwnersName()+"/"+returnDto.getSurveyInformation().getOwnersName()+".xlsx";
Sheet secondSheet4 = workbook.getSheetAt(4); Workbook workbook = null;
fillSheet(secondSheet4, returnDto.getExtendedInformation()); try ( InputStream fis = new ClassPathResource(templatePath).getInputStream()){
workbook = new XSSFWorkbook(fis);
Sheet secondSheet5 = workbook.getSheetAt(5); Sheet firstSheet = workbook.getSheetAt(0);
fillSheet(secondSheet5, returnDto.getInformation()); fillSheet(firstSheet, returnDto.getSurveyInformation());
Sheet secondSheet6 = workbook.getSheetAt(6); Sheet secondSheet = workbook.getSheetAt(1);
fillSheet(secondSheet6, returnDto.getPowerStationEngineeringInfo()); fillSheet(secondSheet, returnDto.getSurveyDetails());
Sheet secondSheet10 = workbook.getSheetAt(7); Sheet secondSheet2 = workbook.getSheetAt(2);
fillSheet(secondSheet10, returnDto.getPowerStationConstructionData()); fillSheet(secondSheet2, returnDto.getDesignInformation());
Sheet secondSheet7 = workbook.getSheetAt(8); Sheet secondSheet3 = workbook.getSheetAt(3);
fillSheet(secondSheet7, returnDto.getHygfOnGrid()); fillSheet(secondSheet3, returnDto.getCommercial());
Sheet secondSheet8 = workbook.getSheetAt(9); Sheet secondSheet4 = workbook.getSheetAt(4);
fillSheet(secondSheet8, returnDto.getWorkOrder()); fillSheet(secondSheet4, returnDto.getExtendedInformation());
Sheet secondSheet9 = workbook.getSheetAt(10); Sheet secondSheet5 = workbook.getSheetAt(5);
fillSheet(secondSheet9, returnDto.getAcceptanceCheck()); fillSheet(secondSheet5, returnDto.getInformation());
Sheet secondSheet11 = workbook.getSheetAt(11); Sheet secondSheet6 = workbook.getSheetAt(6);
fillSheet(secondSheet11, powerStationWorkLog); fillSheet(secondSheet6, returnDto.getPowerStationEngineeringInfo());
Sheet secondSheet12 = workbook.getSheetAt(12); Sheet secondSheet10 = workbook.getSheetAt(7);
fillSheet(secondSheet12, workOrderStationWorkLog); fillSheet(secondSheet10, returnDto.getPowerStationConstructionData());
Sheet secondSheet13 = workbook.getSheetAt(13); Sheet secondSheet7 = workbook.getSheetAt(8);
fillSheet(secondSheet13, basicGridWorkLog); fillSheet(secondSheet7, returnDto.getHygfOnGrid());
Sheet secondSheet14 = workbook.getSheetAt(14); Sheet secondSheet8 = workbook.getSheetAt(9);
fillSheet(secondSheet14, accptWorkLog); fillSheet(secondSheet8, returnDto.getWorkOrder());
Sheet secondSheet15 = workbook.getSheetAt(15); Sheet secondSheet9 = workbook.getSheetAt(10);
fillSheet(secondSheet15, financingWorkLog); fillSheet(secondSheet9, returnDto.getAcceptanceCheck());
// 写入到新的Excel文件中
try (FileOutputStream fos = new FileOutputStream(outputPath)) { Sheet secondSheet11 = workbook.getSheetAt(11);
workbook.write(fos); fillSheet(secondSheet11, powerStationWorkLog);
}
} catch (IOException e) { Sheet secondSheet12 = workbook.getSheetAt(12);
e.printStackTrace(); fillSheet(secondSheet12, workOrderStationWorkLog);
}
current = current + 15 ; Sheet secondSheet13 = workbook.getSheetAt(13);
redisUtils.set(peasantHouseholdId, MapBuilder.<String, Object>create() fillSheet(secondSheet13, basicGridWorkLog);
.put("value", current).build());
List<HygfRectificationOrder> areaOrdersCon = Optional.ofNullable(returnDto.getPowerStationConstructionData().getAreaOrders()) Sheet secondSheet14 = workbook.getSheetAt(14);
.orElse(new ArrayList<>()); fillSheet(secondSheet14, accptWorkLog);
addNonNullList(areaOrdersCon, returnDto.getPowerStationConstructionData().getDesignOrders());
addNonNullList(areaOrdersCon, returnDto.getPowerStationConstructionData().getEngineeringOrders()); Sheet secondSheet15 = workbook.getSheetAt(15);
fillSheet(secondSheet15, financingWorkLog);
// 主方法或代码块 // 写入到新的Excel文件中
List<HygfRectificationOrder> areaOrders = Optional.ofNullable(returnDto.getHygfOnGrid().getAreaOrders()) try (FileOutputStream fos = new FileOutputStream(outputPath)) {
.orElse(new ArrayList<>()); workbook.write(fos);
addNonNullList(areaOrders, returnDto.getHygfOnGrid().getDesignOrders()); }
addNonNullList(areaOrders, returnDto.getHygfOnGrid().getEngineeringOrders());
List<HygfRectificationOrder> areaOrdersAcc = Optional.ofNullable(returnDto.getAcceptanceCheck().getAreaOrders())
.orElse(new ArrayList<>());
addNonNullList(areaOrders, returnDto.getAcceptanceCheck().getLegalOrders());
addNonNullList(areaOrders, returnDto.getAcceptanceCheck().getFinanceOrders());
addNonNullList(areaOrders, returnDto.getAcceptanceCheck().getPropertyOrders());
List<Future<?>> futures = new ArrayList<>();
futures.add(executorService.submit(() -> {
try {
downloadAndZipImages(returnDto.getSurveyInformation(),"基本信息附件",tempDir,urlPath);
Map<String, Object> map = (Map<String, Object>) redisUtils.get(peasantHouseholdId);
Integer currentNum = (Integer) map.get("value")+7;
redisUtils.set(peasantHouseholdId, MapBuilder.<String, Object>create()
.put("value", currentNum).build());
} catch (IOException e) {
e.printStackTrace();
}
}));
futures.add(executorService.submit(() -> {
try {
downloadAndZipImages(returnDto.getSurveyDetails(),"勘察信息附件",tempDir,urlPath);
Map<String, Object> map = (Map<String, Object>) redisUtils.get(peasantHouseholdId);
Integer currentNum = (Integer) map.get("value")+7;
redisUtils.set(peasantHouseholdId, MapBuilder.<String, Object>create()
.put("value", currentNum).build());
} catch (IOException e) {
e.printStackTrace();
}
}));
futures.add(executorService.submit(() -> {
try {
downloadAndZipImages(returnDto.getDesignInformation(),"设计信息附件",tempDir,urlPath);
Map<String, Object> map = (Map<String, Object>) redisUtils.get(peasantHouseholdId);
Integer currentNum = (Integer) map.get("value")+7;
redisUtils.set(peasantHouseholdId, MapBuilder.<String, Object>create()
.put("value", currentNum).build());
} catch (IOException e) {
e.printStackTrace();
}
}));
futures.add(executorService.submit(() -> {
try {
downloadAndZipImages(returnDto.getCommercial(),"商务信息附件",tempDir,urlPath);
Map<String, Object> map = (Map<String, Object>) redisUtils.get(peasantHouseholdId);
Integer currentNum = (Integer) map.get("value")+7;
redisUtils.set(peasantHouseholdId, MapBuilder.<String, Object>create()
.put("value", currentNum).build());
} catch (IOException e) {
e.printStackTrace();
}
}));
futures.add(executorService.submit(() -> {
try {
downloadAndZipImages(returnDto.getInformation(),"资料归档附件",tempDir,urlPath);
Map<String, Object> map = (Map<String, Object>) redisUtils.get(peasantHouseholdId);
Integer currentNum = (Integer) map.get("value")+7;
redisUtils.set(peasantHouseholdId, MapBuilder.<String, Object>create()
.put("value", currentNum).build());
} catch (IOException e) {
e.printStackTrace();
}
}));
futures.add(executorService.submit(() -> {
try {
downloadAndZipImages(returnDto.getPowerStationConstructionData(),"施工信息附件",tempDir,urlPath);
Map<String, Object> map = (Map<String, Object>) redisUtils.get(peasantHouseholdId);
Integer currentNum = (Integer) map.get("value")+7;
redisUtils.set(peasantHouseholdId, MapBuilder.<String, Object>create()
.put("value", currentNum).build());
} catch (IOException e) {
e.printStackTrace();
}
}));
futures.add(executorService.submit(() -> {
try {
downloadAndZipImages(areaOrdersCon,"施工信息整改单附件",tempDir,urlPath);
Map<String, Object> map = (Map<String, Object>) redisUtils.get(peasantHouseholdId);
Integer currentNum = (Integer) map.get("value")+7;
redisUtils.set(peasantHouseholdId, MapBuilder.<String, Object>create()
.put("value", currentNum).build());
} catch (IOException e) {
e.printStackTrace();
}
}));
futures.add(executorService.submit(() -> {
try {
downloadAndZipImages(returnDto.getHygfOnGrid(),"并网信息附件",tempDir,urlPath);
Map<String, Object> map = (Map<String, Object>) redisUtils.get(peasantHouseholdId);
Integer currentNum = (Integer) map.get("value")+7;
redisUtils.set(peasantHouseholdId, MapBuilder.<String, Object>create()
.put("value", currentNum).build());
} catch (IOException e) {
e.printStackTrace();
}
}));
futures.add(executorService.submit(() -> {
try {
downloadAndZipImages(areaOrders,"并网信息整改单附件",tempDir,urlPath);
Map<String, Object> map = (Map<String, Object>) redisUtils.get(peasantHouseholdId);
Integer currentNum = (Integer) map.get("value")+7;
redisUtils.set(peasantHouseholdId, MapBuilder.<String, Object>create()
.put("value", currentNum).build());
} catch (IOException e) {
e.printStackTrace();
}
}));
futures.add(executorService.submit(() -> {
try {
downloadAndZipImages(returnDto.getWorkOrder(),"派工单信息附件",tempDir,urlPath);
Map<String, Object> map = (Map<String, Object>) redisUtils.get(peasantHouseholdId);
Integer currentNum = (Integer) map.get("value")+7;
redisUtils.set(peasantHouseholdId, MapBuilder.<String, Object>create()
.put("value", currentNum).build());
} catch (IOException e) {
e.printStackTrace();
}
}));
futures.add(executorService.submit(() -> {
try {
downloadAndZipImages(areaOrdersAcc,"验收信息整改单附件",tempDir,urlPath);
Map<String, Object> map = (Map<String, Object>) redisUtils.get(peasantHouseholdId);
Integer currentNum = (Integer) map.get("value")+7;
redisUtils.set(peasantHouseholdId, MapBuilder.<String, Object>create()
.put("value", currentNum).build());
} catch (IOException e) { } catch (IOException e) {
e.printStackTrace(); e.printStackTrace();
} }
})); current = current + 15 ;
// 等待所有任务完成 redisUtils.set(peasantHouseholdId, MapBuilder.<String, Object>create()
for (Future<?> future : futures) { .put("value", current).build());
try { List<HygfRectificationOrder> areaOrdersCon = Optional.ofNullable(returnDto.getPowerStationConstructionData().getAreaOrders())
future.get(); .orElse(new ArrayList<>());
} catch (InterruptedException | ExecutionException e) { addNonNullList(areaOrdersCon, returnDto.getPowerStationConstructionData().getDesignOrders());
Throwable cause = e.getCause(); addNonNullList(areaOrdersCon, returnDto.getPowerStationConstructionData().getEngineeringOrders());
if (cause instanceof IOException) {
((IOException) cause).printStackTrace(); // 主方法或代码块
// 可以在这里记录日志或者采取其他补救措施 List<HygfRectificationOrder> areaOrders = Optional.ofNullable(returnDto.getHygfOnGrid().getAreaOrders())
} else { .orElse(new ArrayList<>());
addNonNullList(areaOrders, returnDto.getHygfOnGrid().getDesignOrders());
addNonNullList(areaOrders, returnDto.getHygfOnGrid().getEngineeringOrders());
List<HygfRectificationOrder> areaOrdersAcc = Optional.ofNullable(returnDto.getAcceptanceCheck().getAreaOrders())
.orElse(new ArrayList<>());
addNonNullList(areaOrders, returnDto.getAcceptanceCheck().getLegalOrders());
addNonNullList(areaOrders, returnDto.getAcceptanceCheck().getFinanceOrders());
addNonNullList(areaOrders, returnDto.getAcceptanceCheck().getPropertyOrders());
List<Future<?>> futures = new ArrayList<>();
futures.add(executorService.submit(() -> {
try {
downloadAndZipImages(returnDto.getSurveyInformation(),"基本信息附件",tempDir,urlPath);
Map<String, Object> map = (Map<String, Object>) redisUtils.get(peasantHouseholdId);
Integer currentNum = (Integer) map.get("value")+7;
redisUtils.set(peasantHouseholdId, MapBuilder.<String, Object>create()
.put("value", currentNum).build());
} catch (IOException e) {
e.printStackTrace(); e.printStackTrace();
} }
// 根据具体情况,可以在这里选择终止程序或进行其他处理 }));
return; futures.add(executorService.submit(() -> {
try {
downloadAndZipImages(returnDto.getSurveyDetails(),"勘察信息附件",tempDir,urlPath);
Map<String, Object> map = (Map<String, Object>) redisUtils.get(peasantHouseholdId);
Integer currentNum = (Integer) map.get("value")+7;
redisUtils.set(peasantHouseholdId, MapBuilder.<String, Object>create()
.put("value", currentNum).build());
} catch (IOException e) {
e.printStackTrace();
}
}));
futures.add(executorService.submit(() -> {
try {
downloadAndZipImages(returnDto.getDesignInformation(),"设计信息附件",tempDir,urlPath);
Map<String, Object> map = (Map<String, Object>) redisUtils.get(peasantHouseholdId);
Integer currentNum = (Integer) map.get("value")+7;
redisUtils.set(peasantHouseholdId, MapBuilder.<String, Object>create()
.put("value", currentNum).build());
} catch (IOException e) {
e.printStackTrace();
}
}));
futures.add(executorService.submit(() -> {
try {
downloadAndZipImages(returnDto.getCommercial(),"商务信息附件",tempDir,urlPath);
Map<String, Object> map = (Map<String, Object>) redisUtils.get(peasantHouseholdId);
Integer currentNum = (Integer) map.get("value")+7;
redisUtils.set(peasantHouseholdId, MapBuilder.<String, Object>create()
.put("value", currentNum).build());
} catch (IOException e) {
e.printStackTrace();
}
}));
futures.add(executorService.submit(() -> {
try {
downloadAndZipImages(returnDto.getInformation(),"资料归档附件",tempDir,urlPath);
Map<String, Object> map = (Map<String, Object>) redisUtils.get(peasantHouseholdId);
Integer currentNum = (Integer) map.get("value")+7;
redisUtils.set(peasantHouseholdId, MapBuilder.<String, Object>create()
.put("value", currentNum).build());
} catch (IOException e) {
e.printStackTrace();
}
}));
futures.add(executorService.submit(() -> {
try {
downloadAndZipImages(returnDto.getPowerStationConstructionData(),"施工信息附件",tempDir,urlPath);
Map<String, Object> map = (Map<String, Object>) redisUtils.get(peasantHouseholdId);
Integer currentNum = (Integer) map.get("value")+7;
redisUtils.set(peasantHouseholdId, MapBuilder.<String, Object>create()
.put("value", currentNum).build());
} catch (IOException e) {
e.printStackTrace();
}
}));
futures.add(executorService.submit(() -> {
try {
downloadAndZipImages(areaOrdersCon,"施工信息整改单附件",tempDir,urlPath);
Map<String, Object> map = (Map<String, Object>) redisUtils.get(peasantHouseholdId);
Integer currentNum = (Integer) map.get("value")+7;
redisUtils.set(peasantHouseholdId, MapBuilder.<String, Object>create()
.put("value", currentNum).build());
} catch (IOException e) {
e.printStackTrace();
}
}));
futures.add(executorService.submit(() -> {
try {
downloadAndZipImages(returnDto.getHygfOnGrid(),"并网信息附件",tempDir,urlPath);
Map<String, Object> map = (Map<String, Object>) redisUtils.get(peasantHouseholdId);
Integer currentNum = (Integer) map.get("value")+7;
redisUtils.set(peasantHouseholdId, MapBuilder.<String, Object>create()
.put("value", currentNum).build());
} catch (IOException e) {
e.printStackTrace();
}
}));
futures.add(executorService.submit(() -> {
try {
downloadAndZipImages(areaOrders,"并网信息整改单附件",tempDir,urlPath);
Map<String, Object> map = (Map<String, Object>) redisUtils.get(peasantHouseholdId);
Integer currentNum = (Integer) map.get("value")+7;
redisUtils.set(peasantHouseholdId, MapBuilder.<String, Object>create()
.put("value", currentNum).build());
} catch (IOException e) {
e.printStackTrace();
}
}));
futures.add(executorService.submit(() -> {
try {
downloadAndZipImages(returnDto.getWorkOrder(),"派工单信息附件",tempDir,urlPath);
Map<String, Object> map = (Map<String, Object>) redisUtils.get(peasantHouseholdId);
Integer currentNum = (Integer) map.get("value")+7;
redisUtils.set(peasantHouseholdId, MapBuilder.<String, Object>create()
.put("value", currentNum).build());
} catch (IOException e) {
e.printStackTrace();
}
}));
futures.add(executorService.submit(() -> {
try {
downloadAndZipImages(areaOrdersAcc,"验收信息整改单附件",tempDir,urlPath);
Map<String, Object> map = (Map<String, Object>) redisUtils.get(peasantHouseholdId);
Integer currentNum = (Integer) map.get("value")+7;
redisUtils.set(peasantHouseholdId, MapBuilder.<String, Object>create()
.put("value", currentNum).build());
} catch (IOException e) {
e.printStackTrace();
}
}));
// 等待所有任务完成
for (Future<?> future : futures) {
try {
future.get();
} catch (InterruptedException | ExecutionException e) {
Throwable cause = e.getCause();
if (cause instanceof IOException) {
((IOException) cause).printStackTrace();
// 可以在这里记录日志或者采取其他补救措施
} else {
e.printStackTrace();
}
// 根据具体情况,可以在这里选择终止程序或进行其他处理
return;
}
} }
redisUtils.set(peasantHouseholdId, MapBuilder.<String, Object>create()
.put("value", 100).build());
// response.setHeader(HttpHeaders.CONTENT_DISPOSITION, "attachment; filename="+returnDto.getSurveyInformation().getOwnersName()+".zip");
currentBili = currentBili + baifenbi;
redisUtils.set(redisKey,MapBuilder.<String, Object>create()
.put("value", currentBili).build());
} }
redisUtils.set(peasantHouseholdId, MapBuilder.<String, Object>create() redisUtils.set(redisKey, MapBuilder.<String, Object>create()
.put("value", 100).build()); .put("value", 100).build());
// response.setHeader(HttpHeaders.CONTENT_DISPOSITION, "attachment; filename="+returnDto.getSurveyInformation().getOwnersName()+".zip"); String encodedFilename = "";
String encodedFilename = URLEncoder.encode(returnDto.getSurveyInformation().getOwnersName() + ".zip", StandardCharsets.UTF_8.name()); if (peasantHouseholdIds.size() > 1){
fileName = "批量资料";
encodedFilename = URLEncoder.encode( "批量资料.zip", StandardCharsets.UTF_8.name());
}else {
encodedFilename = URLEncoder.encode( fileName+".zip", StandardCharsets.UTF_8.name());
}
response.setHeader(HttpHeaders.CONTENT_DISPOSITION, "attachment; filename*=UTF-8''" + encodedFilename); response.setHeader(HttpHeaders.CONTENT_DISPOSITION, "attachment; filename*=UTF-8''" + encodedFilename);
createZipFile(tempDir, returnDto.getSurveyInformation().getOwnersName(),response); createZipFile(ziLiaoDir, "批量资料/"+fileName,response);
cleanup(tempDir); cleanup(ziLiaoDir);
} }
...@@ -793,58 +815,58 @@ public class CommonServiceImpl { ...@@ -793,58 +815,58 @@ public class CommonServiceImpl {
DesignInformationDto designInformation= (DesignInformationDto)data; DesignInformationDto designInformation= (DesignInformationDto)data;
int startRowNum = 5; int startRowNum = 5;
if (null != designInformation.getAssembly()){ if (null != designInformation.getAssembly()){
List<Map<String, Object>> maps = convertList(designInformation.getAssembly());
int headerRow = startRowNum + 1; // 表头所在的行 int headerRow = startRowNum + 1; // 表头所在的行
int headerOneRow = startRowNum; // 表头所在的行 int headerOneRow = startRowNum; // 表头所在的行
int dataStartRow = startRowNum+2; // 数据开始的行 int dataStartRow = startRowNum+2; // 数据开始的行
startRowNum= dataStartRow +2; startRowNum= dataStartRow +2+maps.size();
// 假设表头内容如下: // 假设表头内容如下:
String headerOne = "组件"; String headerOne = "组件";
String[] headersNames = {"物联编码", "物料名称", "电池片规格", "功率", "类型", "边框", "总功率", "单/双面", "配置数量", "金额"}; String[] headersNames = {"物联编码", "物料名称", "电池片规格", "功率", "类型", "边框", "总功率", "单/双面", "配置数量", "金额"};
String[] headers = {"wlbm", "wlmc", "dcpgg", "gl", "lx", "bk", "zgl", "dsm", "pzsl", "price"}; String[] headers = {"wlbm", "wlmc", "dcpgg", "gl", "lx", "bk", "zgl", "dsm", "pzsl", "price"};
List<Map<String, Object>> maps = convertList(designInformation.getAssembly());
documentSpecialProcessing(sheet,headerRow,headerOneRow,dataStartRow,headersNames,headers,headerOne,maps); documentSpecialProcessing(sheet,headerRow,headerOneRow,dataStartRow,headersNames,headers,headerOne,maps);
} }
if (null != designInformation.getInverter()){ if (null != designInformation.getInverter()){
List<Map<String, Object>> maps = convertList(designInformation.getInverter());
int headerRow = startRowNum + 1; // 表头所在的行 int headerRow = startRowNum + 1; // 表头所在的行
int headerOneRow = startRowNum; // 表头所在的行 int headerOneRow = startRowNum; // 表头所在的行
int dataStartRow = startRowNum+2; // 数据开始的行 int dataStartRow = startRowNum+2; // 数据开始的行
startRowNum= dataStartRow +2; startRowNum= dataStartRow +2+maps.size();
// 假设表头内容如下: // 假设表头内容如下:
String headerOne = "逆变器"; String headerOne = "逆变器";
String[] headersNames = {"物联编码", "物料名称", "功率", "系列", "相位", "配置数量", "金额"}; String[] headersNames = {"物联编码", "物料名称", "功率", "系列", "相位", "配置数量", "金额"};
String[] headers = {"wlbm", "wlmc", "gl", "xl", "xw", "pzsl", "price"}; String[] headers = {"wlbm", "wlmc", "gl", "xl", "xw", "pzsl", "price"};
List<Map<String, Object>> maps = convertList(designInformation.getInverter());
documentSpecialProcessing(sheet,headerRow,headerOneRow,dataStartRow,headersNames,headers,headerOne,maps); documentSpecialProcessing(sheet,headerRow,headerOneRow,dataStartRow,headersNames,headers,headerOne,maps);
} }
if (null != designInformation.getElectricityMeter()){ if (null != designInformation.getElectricityMeter()){
List<Map<String, Object>> maps = convertList(designInformation.getElectricityMeter());
int headerRow = startRowNum +1 ; // 表头所在的行 int headerRow = startRowNum +1 ; // 表头所在的行
int headerOneRow = startRowNum; // 表头所在的行 int headerOneRow = startRowNum; // 表头所在的行
int dataStartRow = startRowNum+2; // 数据开始的行 int dataStartRow = startRowNum+2; // 数据开始的行
startRowNum= dataStartRow +2; startRowNum= dataStartRow +2+maps.size();
// 假设表头内容如下: // 假设表头内容如下:
String headerOne = "并网箱"; String headerOne = "并网箱";
String[] headersNames = {"物联编码", "物料名称","材质", "功率", "类型", "功能", "相位", "上网模式", "配置数量", "金额"}; String[] headersNames = {"物联编码", "物料名称","材质", "功率", "类型", "功能", "相位", "上网模式", "配置数量", "金额"};
String[] headers = {"wlbm", "wlmc","cz", "gl", "lx", "gn", "xw", "swms","pzsl", "price"}; String[] headers = {"wlbm", "wlmc","cz", "gl", "lx", "gn", "xw", "swms","pzsl", "price"};
List<Map<String, Object>> maps = convertList(designInformation.getElectricityMeter());
documentSpecialProcessing(sheet,headerRow,headerOneRow,dataStartRow,headersNames,headers,headerOne,maps); documentSpecialProcessing(sheet,headerRow,headerOneRow,dataStartRow,headersNames,headers,headerOne,maps);
} }
if (null != designInformation.getCable()){ if (null != designInformation.getCable()){
List<Map<String, Object>> maps = convertList(designInformation.getCable());
int headerRow = startRowNum +1 ; // 表头所在的行 int headerRow = startRowNum +1 ; // 表头所在的行
int headerOneRow = startRowNum; // 表头所在的行 int headerOneRow = startRowNum; // 表头所在的行
int dataStartRow = startRowNum+2; // 数据开始的行 int dataStartRow = startRowNum+2; // 数据开始的行
startRowNum= dataStartRow +2; startRowNum= dataStartRow +2+maps.size();
// 假设表头内容如下: // 假设表头内容如下:
String headerOne = "电缆"; String headerOne = "电缆";
String[] headersNames = {"物联编码", "物料名称", "型号", "规格", "配置数量"}; String[] headersNames = {"物联编码", "物料名称", "型号", "规格", "配置数量"};
String[] headers = {"wlbm", "wlmc", "xh", "gg", "pzsl"}; String[] headers = {"wlbm", "wlmc", "xh", "gg", "pzsl"};
List<Map<String, Object>> maps = convertList(designInformation.getCable());
documentSpecialProcessing(sheet,headerRow,headerOneRow,dataStartRow,headersNames,headers,headerOne,maps); documentSpecialProcessing(sheet,headerRow,headerOneRow,dataStartRow,headersNames,headers,headerOne,maps);
} }
...@@ -856,58 +878,62 @@ public class CommonServiceImpl { ...@@ -856,58 +878,62 @@ public class CommonServiceImpl {
int startRowNum = 3; int startRowNum = 3;
if (null != powerStationEngineeringInfo.getConstructionComponentInfo()){ if (null != powerStationEngineeringInfo.getConstructionComponentInfo()){
List<Map<String, Object>> maps = convertList(powerStationEngineeringInfo.getConstructionComponentInfo());
int headerRow = startRowNum + 1; // 表头所在的行 int headerRow = startRowNum + 1; // 表头所在的行
int headerOneRow = startRowNum; // 表头所在的行 int headerOneRow = startRowNum; // 表头所在的行
int dataStartRow = startRowNum+2; // 数据开始的行 int dataStartRow = startRowNum+2; // 数据开始的行
startRowNum= dataStartRow +2; startRowNum= dataStartRow +2+maps.size();
// 假设表头内容如下: // 假设表头内容如下:
String headerOne = "组件序列号"; String headerOne = "组件序列号";
String[] headersNames = {"序列号","功率","物联编码", "物料名称", "电池片规格", "类型", "边框", "单/双面"}; String[] headersNames = {"序列号","功率","物联编码", "物料名称", "电池片规格", "类型", "边框", "单/双面"};
String[] headers = {"xlh","gl","wlbm", "wlmc", "dcpgg", "lx", "bk", "dsm"}; String[] headers = {"xlh","gl","wlbm", "wlmc", "dcpgg", "lx", "bk", "dsm"};
List<Map<String, Object>> maps = convertList(powerStationEngineeringInfo.getConstructionComponentInfo());
documentSpecialProcessing(sheet,headerRow,headerOneRow,dataStartRow,headersNames,headers,headerOne,maps); documentSpecialProcessing(sheet,headerRow,headerOneRow,dataStartRow,headersNames,headers,headerOne,maps);
} }
if (null != powerStationEngineeringInfo.getConstructionInverterInfo()){ if (null != powerStationEngineeringInfo.getConstructionInverterInfo()){
List<Map<String, Object>> maps = convertList(powerStationEngineeringInfo.getConstructionInverterInfo());
int headerRow = startRowNum + 1; // 表头所在的行 int headerRow = startRowNum + 1; // 表头所在的行
int headerOneRow = startRowNum; // 表头所在的行 int headerOneRow = startRowNum; // 表头所在的行
int dataStartRow = startRowNum+2; // 数据开始的行 int dataStartRow = startRowNum+2; // 数据开始的行
startRowNum= dataStartRow +2; startRowNum= dataStartRow +2+maps.size();
// 假设表头内容如下: // 假设表头内容如下:
String headerOne = "逆变器序列号"; String headerOne = "逆变器序列号";
String[] headersNames = {"序列号","验证码","功率","物联编码", "物料名称", "系列", "相位"}; String[] headersNames = {"序列号","验证码","功率","物联编码", "物料名称", "系列", "相位"};
String[] headers = {"xlh","yzm","gl", "wlbm", "wlmc", "xl", "xw"}; String[] headers = {"xlh","yzm","gl", "wlbm", "wlmc", "xl", "xw"};
List<Map<String, Object>> maps = convertList(powerStationEngineeringInfo.getConstructionInverterInfo());
documentSpecialProcessing(sheet,headerRow,headerOneRow,dataStartRow,headersNames,headers,headerOne,maps); documentSpecialProcessing(sheet,headerRow,headerOneRow,dataStartRow,headersNames,headers,headerOne,maps);
} }
if (null != powerStationEngineeringInfo.getConstructionGridBoxInfo()){ if (null != powerStationEngineeringInfo.getConstructionGridBoxInfo()){
List<Map<String, Object>> maps = convertList(powerStationEngineeringInfo.getConstructionGridBoxInfo());
int headerRow = startRowNum +1 ; // 表头所在的行 int headerRow = startRowNum +1 ; // 表头所在的行
int headerOneRow = startRowNum; // 表头所在的行 int headerOneRow = startRowNum; // 表头所在的行
int dataStartRow = startRowNum+2; // 数据开始的行 int dataStartRow = startRowNum+2; // 数据开始的行
startRowNum= dataStartRow +2; startRowNum= dataStartRow +2+maps.size();
// 假设表头内容如下: // 假设表头内容如下:
String headerOne = "并网箱序列号"; String headerOne = "并网箱序列号";
String[] headersNames = {"序列号", "功率","物联编码", "物料名称","材质", "类型", "功能", "相位", "上网模式"}; String[] headersNames = {"序列号", "功率","物联编码", "物料名称","材质", "类型", "功能", "相位", "上网模式"};
String[] headers = {"xlh","gl","wlbm", "wlmc","cz","lx", "gn", "xw", "swms"}; String[] headers = {"xlh","gl","wlbm", "wlmc","cz","lx", "gn", "xw", "swms"};
List<Map<String, Object>> maps = convertList(powerStationEngineeringInfo.getConstructionGridBoxInfo());
documentSpecialProcessing(sheet,headerRow,headerOneRow,dataStartRow,headersNames,headers,headerOne,maps); documentSpecialProcessing(sheet,headerRow,headerOneRow,dataStartRow,headersNames,headers,headerOne,maps);
} }
if (null != powerStationEngineeringInfo.getConstructionCollectorBoxInfo()){ if (null != powerStationEngineeringInfo.getConstructionCollectorBoxInfo()){
List<Map<String, Object>> maps = convertList(powerStationEngineeringInfo.getConstructionCollectorBoxInfo());
int headerRow = startRowNum +1 ; // 表头所在的行 int headerRow = startRowNum +1 ; // 表头所在的行
int headerOneRow = startRowNum; // 表头所在的行 int headerOneRow = startRowNum; // 表头所在的行
int dataStartRow = startRowNum+2; // 数据开始的行 int dataStartRow = startRowNum+2; // 数据开始的行
startRowNum= dataStartRow +2; startRowNum= dataStartRow +2+maps.size();
// 假设表头内容如下: // 假设表头内容如下:
String headerOne = "采集器序列号"; String headerOne = "采集器序列号";
String[] headersNames = {"序列号"}; String[] headersNames = {"序列号"};
String[] headers = {"xlh"}; String[] headers = {"xlh"};
List<Map<String, Object>> maps = convertList(powerStationEngineeringInfo.getConstructionCollectorBoxInfo());
documentSpecialProcessing(sheet,headerRow,headerOneRow,dataStartRow,headersNames,headers,headerOne,maps); documentSpecialProcessing(sheet,headerRow,headerOneRow,dataStartRow,headersNames,headers,headerOne,maps);
} }
...@@ -919,17 +945,18 @@ public class CommonServiceImpl { ...@@ -919,17 +945,18 @@ public class CommonServiceImpl {
int startRowNum = 3; int startRowNum = 3;
if (null != extendedInformationDto.getContacts()){ if (null != extendedInformationDto.getContacts()){
List<Map<String, Object>> maps = convertList(extendedInformationDto.getContacts());
int headerRow = startRowNum + 1; // 表头所在的行 int headerRow = startRowNum + 1; // 表头所在的行
int headerOneRow = startRowNum; // 表头所在的行 int headerOneRow = startRowNum; // 表头所在的行
int dataStartRow = startRowNum+2; // 数据开始的行 int dataStartRow = startRowNum+2; // 数据开始的行
startRowNum= dataStartRow +1; startRowNum= dataStartRow +1+maps.size();
// 假设表头内容如下: // 假设表头内容如下:
String headerOne = "联系人"; String headerOne = "联系人";
String[] headersNames = {"姓名","关系","联系电话", "电子邮箱", "QQ", "微信"}; String[] headersNames = {"姓名","关系","联系电话", "电子邮箱", "QQ", "微信"};
String[] headers = {"userName","relation","telephone", "mailbox", "dcpgg", "qq", "wechat"}; String[] headers = {"userName","relation","telephone", "mailbox", "dcpgg", "qq", "wechat"};
List<Map<String, Object>> maps = convertList(extendedInformationDto.getContacts());
documentSpecialProcessing(sheet,headerRow,headerOneRow,dataStartRow,headersNames,headers,headerOne,maps); documentSpecialProcessing(sheet,headerRow,headerOneRow,dataStartRow,headersNames,headers,headerOne,maps);
} }
} }
...@@ -939,10 +966,11 @@ public class CommonServiceImpl { ...@@ -939,10 +966,11 @@ public class CommonServiceImpl {
int startRowNum = 3; int startRowNum = 3;
if (null != powerStationConstructionData.getAreaOrders()){ if (null != powerStationConstructionData.getAreaOrders()){
List<Map<String, Object>> maps = convertListToMap(powerStationConstructionData.getAreaOrders());
int headerRow = startRowNum + 1; // 表头所在的行 int headerRow = startRowNum + 1; // 表头所在的行
int headerOneRow = startRowNum; // 表头所在的行 int headerOneRow = startRowNum; // 表头所在的行
int dataStartRow = startRowNum+2; // 数据开始的行 int dataStartRow = startRowNum+2; // 数据开始的行
startRowNum= dataStartRow +1; startRowNum= dataStartRow +1+maps.size();
// 假设表头内容如下: // 假设表头内容如下:
String headerOne = "片区运营整改单"; String headerOne = "片区运营整改单";
...@@ -950,38 +978,40 @@ public class CommonServiceImpl { ...@@ -950,38 +978,40 @@ public class CommonServiceImpl {
String[] headers = {"rectificationIdeas","rectificationResultWeb", "auditResult", "auditIdea", "rectificationHistoryWeb"}; String[] headers = {"rectificationIdeas","rectificationResultWeb", "auditResult", "auditIdea", "rectificationHistoryWeb"};
List<Map<String, Object>> maps = convertListToMap(powerStationConstructionData.getAreaOrders());
documentSpecialProcessing(sheet,headerRow,headerOneRow,dataStartRow,headersNames,headers,headerOne,maps); documentSpecialProcessing(sheet,headerRow,headerOneRow,dataStartRow,headersNames,headers,headerOne,maps);
} }
if (null != powerStationConstructionData.getEngineeringOrders()){ if (null != powerStationConstructionData.getEngineeringOrders()){
List<Map<String, Object>> maps = convertListToMap(powerStationConstructionData.getEngineeringOrders());
int headerRow = startRowNum + 1; // 表头所在的行 int headerRow = startRowNum + 1; // 表头所在的行
int headerOneRow = startRowNum; // 表头所在的行 int headerOneRow = startRowNum; // 表头所在的行
int dataStartRow = startRowNum+2; // 数据开始的行 int dataStartRow = startRowNum+2; // 数据开始的行
startRowNum= dataStartRow +1; startRowNum= dataStartRow +1+maps.size();
// 假设表头内容如下: // 假设表头内容如下:
String headerOne = "工程整改单"; String headerOne = "工程整改单";
String[] headersNames = {"整改信息","整改结果","审核结果", "审核意见", "历史审核意见"}; String[] headersNames = {"整改信息","整改结果","审核结果", "审核意见", "历史审核意见"};
String[] headers = {"rectificationIdeas","rectificationResultWeb", "auditResult", "auditIdea", "rectificationHistoryWeb"}; String[] headers = {"rectificationIdeas","rectificationResultWeb", "auditResult", "auditIdea", "rectificationHistoryWeb"};
List<Map<String, Object>> maps = convertListToMap(powerStationConstructionData.getEngineeringOrders());
documentSpecialProcessing(sheet,headerRow,headerOneRow,dataStartRow,headersNames,headers,headerOne,maps); documentSpecialProcessing(sheet,headerRow,headerOneRow,dataStartRow,headersNames,headers,headerOne,maps);
} }
if (null != powerStationConstructionData.getDesignOrders()){ if (null != powerStationConstructionData.getDesignOrders()){
List<Map<String, Object>> maps = convertListToMap(powerStationConstructionData.getDesignOrders());
int headerRow = startRowNum + 1; // 表头所在的行 int headerRow = startRowNum + 1; // 表头所在的行
int headerOneRow = startRowNum; // 表头所在的行 int headerOneRow = startRowNum; // 表头所在的行
int dataStartRow = startRowNum+2; // 数据开始的行 int dataStartRow = startRowNum+2; // 数据开始的行
startRowNum= dataStartRow +1; startRowNum= dataStartRow +1+maps.size();
// 假设表头内容如下: // 假设表头内容如下:
String headerOne = "设计整改单"; String headerOne = "设计整改单";
String[] headersNames = {"整改信息","整改结果","审核结果", "审核意见", "历史审核意见"}; String[] headersNames = {"整改信息","整改结果","审核结果", "审核意见", "历史审核意见"};
String[] headers = {"rectificationIdeas","rectificationResultWeb", "auditResult", "auditIdea", "rectificationHistoryWeb"}; String[] headers = {"rectificationIdeas","rectificationResultWeb", "auditResult", "auditIdea", "rectificationHistoryWeb"};
List<Map<String, Object>> maps = convertListToMap(powerStationConstructionData.getDesignOrders());
documentSpecialProcessing(sheet,headerRow,headerOneRow,dataStartRow,headersNames,headers,headerOne,maps); documentSpecialProcessing(sheet,headerRow,headerOneRow,dataStartRow,headersNames,headers,headerOne,maps);
} }
} }
...@@ -992,10 +1022,11 @@ public class CommonServiceImpl { ...@@ -992,10 +1022,11 @@ public class CommonServiceImpl {
int startRowNum = 3; int startRowNum = 3;
if (null != hygfOnGrid.getAreaOrders()){ if (null != hygfOnGrid.getAreaOrders()){
List<Map<String, Object>> maps = convertListToMap(hygfOnGrid.getAreaOrders());
int headerRow = startRowNum + 1; // 表头所在的行 int headerRow = startRowNum + 1; // 表头所在的行
int headerOneRow = startRowNum; // 表头所在的行 int headerOneRow = startRowNum; // 表头所在的行
int dataStartRow = startRowNum+2; // 数据开始的行 int dataStartRow = startRowNum+2; // 数据开始的行
startRowNum= dataStartRow +1; startRowNum= dataStartRow +1+maps.size();
// 假设表头内容如下: // 假设表头内容如下:
String headerOne = "片区运营整改单"; String headerOne = "片区运营整改单";
...@@ -1003,38 +1034,40 @@ public class CommonServiceImpl { ...@@ -1003,38 +1034,40 @@ public class CommonServiceImpl {
String[] headers = {"rectificationIdeas","rectificationResultWeb", "auditResult", "auditIdea", "rectificationHistoryWeb"}; String[] headers = {"rectificationIdeas","rectificationResultWeb", "auditResult", "auditIdea", "rectificationHistoryWeb"};
List<Map<String, Object>> maps = convertListToMap(hygfOnGrid.getAreaOrders());
documentSpecialProcessing(sheet,headerRow,headerOneRow,dataStartRow,headersNames,headers,headerOne,maps); documentSpecialProcessing(sheet,headerRow,headerOneRow,dataStartRow,headersNames,headers,headerOne,maps);
} }
if (null != hygfOnGrid.getEngineeringOrders()){ if (null != hygfOnGrid.getEngineeringOrders()){
List<Map<String, Object>> maps = convertListToMap(hygfOnGrid.getEngineeringOrders());
int headerRow = startRowNum + 1; // 表头所在的行 int headerRow = startRowNum + 1; // 表头所在的行
int headerOneRow = startRowNum; // 表头所在的行 int headerOneRow = startRowNum; // 表头所在的行
int dataStartRow = startRowNum+2; // 数据开始的行 int dataStartRow = startRowNum+2; // 数据开始的行
startRowNum= dataStartRow +1; startRowNum= dataStartRow +1+maps.size();
// 假设表头内容如下: // 假设表头内容如下:
String headerOne = "工程整改单"; String headerOne = "工程整改单";
String[] headersNames = {"整改信息","整改结果","审核结果", "审核意见", "历史审核意见"}; String[] headersNames = {"整改信息","整改结果","审核结果", "审核意见", "历史审核意见"};
String[] headers = {"rectificationIdeas","rectificationResultWeb", "auditResult", "auditIdea", "rectificationHistoryWeb"}; String[] headers = {"rectificationIdeas","rectificationResultWeb", "auditResult", "auditIdea", "rectificationHistoryWeb"};
List<Map<String, Object>> maps = convertListToMap(hygfOnGrid.getEngineeringOrders());
documentSpecialProcessing(sheet,headerRow,headerOneRow,dataStartRow,headersNames,headers,headerOne,maps); documentSpecialProcessing(sheet,headerRow,headerOneRow,dataStartRow,headersNames,headers,headerOne,maps);
} }
if (null != hygfOnGrid.getDesignOrders()){ if (null != hygfOnGrid.getDesignOrders()){
List<Map<String, Object>> maps = convertListToMap(hygfOnGrid.getDesignOrders());
int headerRow = startRowNum + 1; // 表头所在的行 int headerRow = startRowNum + 1; // 表头所在的行
int headerOneRow = startRowNum; // 表头所在的行 int headerOneRow = startRowNum; // 表头所在的行
int dataStartRow = startRowNum+2; // 数据开始的行 int dataStartRow = startRowNum+2; // 数据开始的行
startRowNum= dataStartRow +1; startRowNum= dataStartRow +1+maps.size();
// 假设表头内容如下: // 假设表头内容如下:
String headerOne = "设计整改单"; String headerOne = "设计整改单";
String[] headersNames = {"整改信息","整改结果","审核结果", "审核意见", "历史审核意见"}; String[] headersNames = {"整改信息","整改结果","审核结果", "审核意见", "历史审核意见"};
String[] headers = {"rectificationIdeas","rectificationResultWeb", "auditResult", "auditIdea", "rectificationHistoryWeb"}; String[] headers = {"rectificationIdeas","rectificationResultWeb", "auditResult", "auditIdea", "rectificationHistoryWeb"};
List<Map<String, Object>> maps = convertListToMap(hygfOnGrid.getDesignOrders());
documentSpecialProcessing(sheet,headerRow,headerOneRow,dataStartRow,headersNames,headers,headerOne,maps); documentSpecialProcessing(sheet,headerRow,headerOneRow,dataStartRow,headersNames,headers,headerOne,maps);
} }
} }
...@@ -1044,10 +1077,11 @@ public class CommonServiceImpl { ...@@ -1044,10 +1077,11 @@ public class CommonServiceImpl {
int startRowNum = 3; int startRowNum = 3;
if (null != acceptanceCheck.getAreaOrders()){ if (null != acceptanceCheck.getAreaOrders()){
List<Map<String, Object>> maps = convertListToMap(acceptanceCheck.getAreaOrders());
int headerRow = startRowNum + 1; // 表头所在的行 int headerRow = startRowNum + 1; // 表头所在的行
int headerOneRow = startRowNum; // 表头所在的行 int headerOneRow = startRowNum; // 表头所在的行
int dataStartRow = startRowNum+2; // 数据开始的行 int dataStartRow = startRowNum+2; // 数据开始的行
startRowNum= dataStartRow +1; startRowNum= dataStartRow +1+maps.size();
// 假设表头内容如下: // 假设表头内容如下:
String headerOne = "片区运营整改单"; String headerOne = "片区运营整改单";
...@@ -1055,52 +1089,55 @@ public class CommonServiceImpl { ...@@ -1055,52 +1089,55 @@ public class CommonServiceImpl {
String[] headers = {"rectificationIdeas","rectificationResultWeb", "auditResult", "auditIdea", "rectificationHistoryWeb"}; String[] headers = {"rectificationIdeas","rectificationResultWeb", "auditResult", "auditIdea", "rectificationHistoryWeb"};
List<Map<String, Object>> maps = convertListToMap(acceptanceCheck.getAreaOrders());
documentSpecialProcessing(sheet,headerRow,headerOneRow,dataStartRow,headersNames,headers,headerOne,maps); documentSpecialProcessing(sheet,headerRow,headerOneRow,dataStartRow,headersNames,headers,headerOne,maps);
} }
if (null != acceptanceCheck.getFinanceOrders()){ if (null != acceptanceCheck.getFinanceOrders()){
List<Map<String, Object>> maps = convertListToMap(acceptanceCheck.getFinanceOrders());
int headerRow = startRowNum + 1; // 表头所在的行 int headerRow = startRowNum + 1; // 表头所在的行
int headerOneRow = startRowNum; // 表头所在的行 int headerOneRow = startRowNum; // 表头所在的行
int dataStartRow = startRowNum+2; // 数据开始的行 int dataStartRow = startRowNum+2; // 数据开始的行
startRowNum= dataStartRow +1; startRowNum= dataStartRow +1+maps.size();
// 假设表头内容如下: // 假设表头内容如下:
String headerOne = "投融整改单"; String headerOne = "投融整改单";
String[] headersNames = {"整改信息","整改结果","审核结果", "审核意见", "历史审核意见"}; String[] headersNames = {"整改信息","整改结果","审核结果", "审核意见", "历史审核意见"};
String[] headers = {"rectificationIdeas","rectificationResultWeb", "auditResult", "auditIdea", "rectificationHistoryWeb"}; String[] headers = {"rectificationIdeas","rectificationResultWeb", "auditResult", "auditIdea", "rectificationHistoryWeb"};
List<Map<String, Object>> maps = convertListToMap(acceptanceCheck.getFinanceOrders());
documentSpecialProcessing(sheet,headerRow,headerOneRow,dataStartRow,headersNames,headers,headerOne,maps); documentSpecialProcessing(sheet,headerRow,headerOneRow,dataStartRow,headersNames,headers,headerOne,maps);
} }
if (null != acceptanceCheck.getLegalOrders()){ if (null != acceptanceCheck.getLegalOrders()){
List<Map<String, Object>> maps = convertListToMap(acceptanceCheck.getLegalOrders());
int headerRow = startRowNum + 1; // 表头所在的行 int headerRow = startRowNum + 1; // 表头所在的行
int headerOneRow = startRowNum; // 表头所在的行 int headerOneRow = startRowNum; // 表头所在的行
int dataStartRow = startRowNum+2; // 数据开始的行 int dataStartRow = startRowNum+2; // 数据开始的行
startRowNum= dataStartRow +1; startRowNum= dataStartRow +1+maps.size();
// 假设表头内容如下: // 假设表头内容如下:
String headerOne = "法务整改单"; String headerOne = "法务整改单";
String[] headersNames = {"整改信息","整改结果","审核结果", "审核意见", "历史审核意见"}; String[] headersNames = {"整改信息","整改结果","审核结果", "审核意见", "历史审核意见"};
String[] headers = {"rectificationIdeas","rectificationResultWeb", "auditResult", "auditIdea", "rectificationHistoryWeb"}; String[] headers = {"rectificationIdeas","rectificationResultWeb", "auditResult", "auditIdea", "rectificationHistoryWeb"};
List<Map<String, Object>> maps = convertListToMap(acceptanceCheck.getLegalOrders());
documentSpecialProcessing(sheet,headerRow,headerOneRow,dataStartRow,headersNames,headers,headerOne,maps); documentSpecialProcessing(sheet,headerRow,headerOneRow,dataStartRow,headersNames,headers,headerOne,maps);
} }
if (null != acceptanceCheck.getPropertyOrders()){ if (null != acceptanceCheck.getPropertyOrders()){
List<Map<String, Object>> maps = convertListToMap(acceptanceCheck.getPropertyOrders());
int headerRow = startRowNum + 1; // 表头所在的行 int headerRow = startRowNum + 1; // 表头所在的行
int headerOneRow = startRowNum; // 表头所在的行 int headerOneRow = startRowNum; // 表头所在的行
int dataStartRow = startRowNum+2; // 数据开始的行 int dataStartRow = startRowNum+2; // 数据开始的行
startRowNum= dataStartRow +1; startRowNum= dataStartRow +1+maps.size();
// 假设表头内容如下: // 假设表头内容如下:
String headerOne = "资产整改单"; String headerOne = "资产整改单";
String[] headersNames = {"整改信息","整改结果","审核结果", "审核意见", "历史审核意见"}; String[] headersNames = {"整改信息","整改结果","审核结果", "审核意见", "历史审核意见"};
String[] headers = {"rectificationIdeas","rectificationResultWeb", "auditResult", "auditIdea", "rectificationHistoryWeb"}; String[] headers = {"rectificationIdeas","rectificationResultWeb", "auditResult", "auditIdea", "rectificationHistoryWeb"};
List<Map<String, Object>> maps = convertListToMap(acceptanceCheck.getPropertyOrders());
documentSpecialProcessing(sheet,headerRow,headerOneRow,dataStartRow,headersNames,headers,headerOne,maps); documentSpecialProcessing(sheet,headerRow,headerOneRow,dataStartRow,headersNames,headers,headerOne,maps);
} }
} }
...@@ -1644,7 +1681,6 @@ public class CommonServiceImpl { ...@@ -1644,7 +1681,6 @@ public class CommonServiceImpl {
if(100-value ==0){ if(100-value ==0){
redisUtils.del(peasantHouseholdId); redisUtils.del(peasantHouseholdId);
} }
return map; return map;
} }
} }
\ No newline at end of file
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