diff --git a/epmet-commons/epmet-commons-tools/pom.xml b/epmet-commons/epmet-commons-tools/pom.xml
index e73e2b5e6f..93d1fef898 100644
--- a/epmet-commons/epmet-commons-tools/pom.xml
+++ b/epmet-commons/epmet-commons-tools/pom.xml
@@ -89,6 +89,8 @@
cn.afterturn
easypoi-base
${easypoi.version}
+ system
+ ${project.basedir}/src/main/resources/jar/easypoi-base-4.4.0.jar
cn.afterturn
diff --git a/epmet-commons/epmet-commons-tools/src/main/resources/jar/easypoi-base-4.4.0.jar b/epmet-commons/epmet-commons-tools/src/main/resources/jar/easypoi-base-4.4.0.jar
new file mode 100644
index 0000000000..9a1eb02ae9
Binary files /dev/null and b/epmet-commons/epmet-commons-tools/src/main/resources/jar/easypoi-base-4.4.0.jar differ
diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiUserController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiUserController.java
index 4e49766a21..de5d3c2a05 100644
--- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiUserController.java
+++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiUserController.java
@@ -20,6 +20,7 @@ package com.epmet.controller;
import cn.afterturn.easypoi.excel.ExcelExportUtil;
import cn.afterturn.easypoi.excel.entity.ExportParams;
import cn.afterturn.easypoi.excel.entity.params.ExcelExportEntity;
+import cn.afterturn.easypoi.excel.export.ExcelExportService;
import com.alibaba.fastjson.JSON;
import com.epmet.commons.tools.annotation.LoginUser;
import com.epmet.commons.tools.exception.EpmetErrorCode;
@@ -37,21 +38,21 @@ import com.epmet.dto.IcResiUserDTO;
import com.epmet.dto.form.CustomerFormQueryDTO;
import com.epmet.dto.form.IcResiUserFormDTO;
import com.epmet.dto.result.CustomerFormResultDTO;
+import com.epmet.dto.result.FormGroupDTO;
+import com.epmet.dto.result.FormItem;
import com.epmet.excel.IcResiUserExcel;
import com.epmet.feign.OperCustomizeOpenFeignClient;
-import com.epmet.handler.ExcelDiceAddressListHandlerImpl;
import com.epmet.service.IcResiUserService;
import org.apache.commons.collections4.CollectionUtils;
+import org.apache.commons.lang3.StringUtils;
import org.apache.poi.ss.usermodel.Workbook;
+import org.jetbrains.annotations.NotNull;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.io.FileOutputStream;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
+import java.util.*;
/**
@@ -63,6 +64,7 @@ import java.util.Map;
@RestController
@RequestMapping("icresiuser")
public class IcResiUserController {
+ private static final String BASE_TABLE_NAME = "ic_resi_user";
@Autowired
private OperCustomizeOpenFeignClient operCustomizeOpenFeignClient;
@@ -136,80 +138,124 @@ public class IcResiUserController {
CustomerFormQueryDTO queryDTO = new CustomerFormQueryDTO();
queryDTO.setFormCode("resi_base_info");
queryDTO.setCustomerId(customerId);
-
Result resultForm = operCustomizeOpenFeignClient.getCustomerForm(queryDTO);
if (resultForm == null || !resultForm.success() ||resultForm.getData() == null){
throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode());
}
System.out.println(JSON.toJSONString(resultForm.getData()));
- List firstHeaderList = new ArrayList<>();
- resultForm.getData().getItemList().forEach(item->{
+ Map> sheetHeaderMap = buildHeaderByItem(resultForm);
+ Workbook workbook = null;
+ for (Map.Entry> entry : sheetHeaderMap.entrySet()) {
+ String sheetName = entry.getKey();
+ List headers = entry.getValue();
+ ExportParams exportParams = new ExportParams(null, sheetName);
+
+ if (workbook == null) {
+ List