|
|
@ -29,10 +29,13 @@ import com.alibaba.fastjson.JSON; |
|
|
|
import com.epmet.commons.tools.annotation.LoginUser; |
|
|
|
import com.epmet.commons.tools.aop.NoRepeatSubmit; |
|
|
|
import com.epmet.commons.tools.constant.NumConstant; |
|
|
|
import com.epmet.commons.tools.constant.StrConstant; |
|
|
|
import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; |
|
|
|
import com.epmet.commons.tools.exception.EpmetErrorCode; |
|
|
|
import com.epmet.commons.tools.exception.ExceptionUtils; |
|
|
|
import com.epmet.commons.tools.exception.RenException; |
|
|
|
import com.epmet.commons.tools.page.PageData; |
|
|
|
import com.epmet.commons.tools.redis.common.CustomerStaffRedis; |
|
|
|
import com.epmet.commons.tools.security.dto.TokenDto; |
|
|
|
import com.epmet.commons.tools.utils.ConvertUtils; |
|
|
|
import com.epmet.commons.tools.utils.Result; |
|
|
@ -178,7 +181,14 @@ public class IcResiUserController { |
|
|
|
* @throws Exception |
|
|
|
*/ |
|
|
|
@RequestMapping(value = "/exportExcel2") |
|
|
|
public void exportExcel(@RequestHeader String customerId, @RequestBody IcResiUserPageFormDTO pageFormDTO, HttpServletResponse response) throws Exception { |
|
|
|
public void exportExcel(@RequestHeader String customerId,@LoginUser TokenDto tokenDto, @RequestBody IcResiUserPageFormDTO pageFormDTO, HttpServletResponse response) throws Exception { |
|
|
|
CustomerStaffInfoCacheResult staffInfoCacheResult = CustomerStaffRedis.getStaffInfo(customerId, tokenDto.getUserId()); |
|
|
|
String staffOrgPath = StrConstant.EPMETY_STR; |
|
|
|
if (StringUtils.isNotBlank(staffInfoCacheResult.getAgencyPIds()) && !NumConstant.ZERO_STR.equals(staffInfoCacheResult.getAgencyPIds())) { |
|
|
|
staffOrgPath = staffInfoCacheResult.getAgencyPIds().concat(":").concat(staffInfoCacheResult.getAgencyId()); |
|
|
|
}else{ |
|
|
|
staffOrgPath=staffInfoCacheResult.getAgencyId(); |
|
|
|
} |
|
|
|
pageFormDTO.setCustomerId(customerId); |
|
|
|
pageFormDTO.setPageFlag(false); |
|
|
|
CustomerFormResultDTO resiFormItems = getResiFormItems(pageFormDTO.getCustomerId()); |
|
|
@ -229,7 +239,7 @@ public class IcResiUserController { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
Map<String, Map<String, Object>> resiMainList = icResiUserService.getDataForExport(otherSheetItems.get(BASE_TABLE_NAME),new HashMap<>(), pageFormDTO.getCustomerId(), pageFormDTO.getFormCode(), BASE_TABLE_NAME, pageFormDTO.getConditions()); |
|
|
|
Map<String, Map<String, Object>> resiMainList = icResiUserService.getDataForExport(otherSheetItems.get(BASE_TABLE_NAME),new HashMap<>(), pageFormDTO.getCustomerId(), pageFormDTO.getFormCode(), BASE_TABLE_NAME, pageFormDTO.getConditions(),staffInfoCacheResult.getAgencyId(),staffOrgPath); |
|
|
|
//resiMainList = (List<Map<String, Object>>)JSON.parse("[{\"IS_BDHJ\":\"1\",\"IS_SPECIAL\":\"1\",\"IS_XFRY\":\"0\",\"REMARKS\":\"beizhu\",\"IS_PARTY\":\"1\",\"icResiUserId\":\"yzmtest2\",\"HOME_ID\":\"中海国际社区一里城1号楼1单元101\",\"HOUSE_TYPE\":\"平房\",\"UNIT_NAME\":\"1单元\",\"GRID_ID\":\"市北区-市北区第三网格3\",\"IS_DB\":\"0\",\"GENDER\":\"男\",\"BIRTHDAY\":\"2021-10-04\",\"IS_VETERANS\":\"0\",\"IS_MB\":\"0\",\"IS_UNEMPLOYED\":\"0\",\"DEMAND_NAME\":null,\"IS_KC\":\"0\",\"IS_ENSURE_HOUSE\":\"0\",\"IS_SD\":\"0\",\"NAME\":\"尹作梅\",\"RDSJ\":null,\"IS_VOLUNTEER\":\"1\",\"GRID_ID_VALUE\":\"e74829ffc43d5470eba6b5e060c11e63\",\"IS_SZ\":\"0\",\"IS_CJ\":\"0\",\"HOME_ID_VALUE\":\"200\",\"DEMAND_CATEGORY_IDS\":null,\"VILLAGE_NAME\":\"中海国际社区一里城\",\"IS_DBH\":\"0\",\"IS_SN\":\"0\",\"BUILD_NAME\":\"1号楼\",\"IS_YLFN\":\"0\",\"IS_UNITED_FRONT\":\"0\",\"ID_CARD\":\"371325199310260529\",\"MOBILE\":\"15764229697\",\"IS_OLD_PEOPLE\":\"0\",\"DOOR_NAME\":\"101\"},{\"IS_SPECIAL\":\"1\",\"IS_XFRY\":\"0\",\"REMARKS\":\"beizhu\",\"IS_PARTY\":\"1\",\"icResiUserId\":\"yzmtest\",\"HOME_ID\":\"中海国际社区一里城1号楼1单元101\",\"HOUSE_TYPE\":\"平房\",\"UNIT_NAME\":\"1单元\",\"GRID_ID\":\"市北区-市北区第三网格3\",\"IS_DB\":\"0\",\"GENDER\":\"男\",\"BIRTHDAY\":\"2021-10-04\",\"IS_VETERANS\":\"0\",\"IS_MB\":\"0\",\"IS_UNEMPLOYED\":\"0\",\"DEMAND_NAME\":\"心理咨询\",\"IS_KC\":\"0\",\"IS_ENSURE_HOUSE\":\"0\",\"IS_SD\":\"0\",\"NAME\":\"尹作梅\",\"RDSJ\":\"2021-10-28 00:00:00\",\"IS_VOLUNTEER\":\"1\",\"GRID_ID_VALUE\":\"e74829ffc43d5470eba6b5e060c11e63\",\"IS_SZ\":\"0\",\"IS_CJ\":\"0\",\"HOME_ID_VALUE\":\"200\",\"DEMAND_CATEGORY_IDS\":\"10180002\",\"VILLAGE_NAME\":\"中海国际社区一里城\",\"IS_DBH\":\"0\",\"IS_SN\":\"0\",\"BUILD_NAME\":\"1号楼\",\"IS_YLFN\":\"0\",\"IS_UNITED_FRONT\":\"0\",\"ID_CARD\":\"371325199310260529\",\"MOBILE\":\"15764229697\",\"IS_OLD_PEOPLE\":\"0\",\"DOOR_NAME\":\"101\"}]");
|
|
|
|
log.info("resiMainList:{}", JSON.toJSONString(resiMainList)); |
|
|
|
String templatePath = "excel/ic_resi_info_cid.xls"; |
|
|
@ -246,7 +256,7 @@ public class IcResiUserController { |
|
|
|
if (item.getChildGroup() != null) { |
|
|
|
if (!item.getChildGroup().getTableName().equals(BASE_TABLE_NAME)) { |
|
|
|
Map<String, FormItem> itemMap1 = otherSheetItems.get(item.getChildGroup().getTableName()); |
|
|
|
Map<String, Map<String, Object>> resiChildMap = icResiUserService.getDataForExport(itemMap1,resiMainList, pageFormDTO.getCustomerId(), pageFormDTO.getFormCode(), item.getChildGroup().getTableName(), pageFormDTO.getConditions()); |
|
|
|
Map<String, Map<String, Object>> resiChildMap = icResiUserService.getDataForExport(itemMap1,resiMainList, pageFormDTO.getCustomerId(), pageFormDTO.getFormCode(), item.getChildGroup().getTableName(), pageFormDTO.getConditions(),staffInfoCacheResult.getAgencyId(),staffOrgPath); |
|
|
|
//resiChildMap.forEach((key, value) -> value.putAll(resiMainList.get(key)));
|
|
|
|
|
|
|
|
Map<String, Object> mapData2 = new HashMap<>(); |
|
|
@ -263,7 +273,14 @@ public class IcResiUserController { |
|
|
|
} |
|
|
|
|
|
|
|
@RequestMapping(value = "/exportExcel") |
|
|
|
public void exportExcelByEasyExcel(@RequestHeader String customerId, @RequestBody IcResiUserPageFormDTO pageFormDTO, HttpServletResponse response) throws Exception { |
|
|
|
public void exportExcelByEasyExcel(@RequestHeader String customerId,@LoginUser TokenDto tokenDto, @RequestBody IcResiUserPageFormDTO pageFormDTO, HttpServletResponse response) throws Exception { |
|
|
|
CustomerStaffInfoCacheResult staffInfoCacheResult = CustomerStaffRedis.getStaffInfo(customerId, tokenDto.getUserId()); |
|
|
|
String staffOrgPath = StrConstant.EPMETY_STR; |
|
|
|
if (StringUtils.isNotBlank(staffInfoCacheResult.getAgencyPIds()) && !NumConstant.ZERO_STR.equals(staffInfoCacheResult.getAgencyPIds())) { |
|
|
|
staffOrgPath = staffInfoCacheResult.getAgencyPIds().concat(":").concat(staffInfoCacheResult.getAgencyId()); |
|
|
|
}else{ |
|
|
|
staffOrgPath=staffInfoCacheResult.getAgencyId(); |
|
|
|
} |
|
|
|
pageFormDTO.setCustomerId(customerId); |
|
|
|
pageFormDTO.setPageFlag(false); |
|
|
|
CustomerFormResultDTO resiFormItems = getResiFormItems(pageFormDTO.getCustomerId()); |
|
|
@ -314,7 +331,7 @@ public class IcResiUserController { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
Map<String, Map<String, Object>> resiMainList = icResiUserService.getDataForExport(otherSheetItems.get(BASE_TABLE_NAME),new HashMap<>(), pageFormDTO.getCustomerId(), pageFormDTO.getFormCode(), BASE_TABLE_NAME, pageFormDTO.getConditions()); |
|
|
|
Map<String, Map<String, Object>> resiMainList = icResiUserService.getDataForExport(otherSheetItems.get(BASE_TABLE_NAME),new HashMap<>(), pageFormDTO.getCustomerId(), pageFormDTO.getFormCode(), BASE_TABLE_NAME, pageFormDTO.getConditions(),staffInfoCacheResult.getAgencyId(),staffOrgPath); |
|
|
|
|
|
|
|
//=========================================
|
|
|
|
String templatePath = "excel/ic_resi_info_cid_for_easy_excel.xlsx"; |
|
|
@ -334,7 +351,7 @@ public class IcResiUserController { |
|
|
|
if (item.getChildGroup() != null) { |
|
|
|
if (!item.getChildGroup().getTableName().equals(BASE_TABLE_NAME)) { |
|
|
|
Map<String, FormItem> itemMap1 = otherSheetItems.get(item.getChildGroup().getTableName()); |
|
|
|
Map<String, Map<String, Object>> resiChildMap = icResiUserService.getDataForExport(itemMap1,resiMainList, pageFormDTO.getCustomerId(), pageFormDTO.getFormCode(), item.getChildGroup().getTableName(), pageFormDTO.getConditions()); |
|
|
|
Map<String, Map<String, Object>> resiChildMap = icResiUserService.getDataForExport(itemMap1,resiMainList, pageFormDTO.getCustomerId(), pageFormDTO.getFormCode(), item.getChildGroup().getTableName(), pageFormDTO.getConditions(),staffInfoCacheResult.getAgencyId(),staffOrgPath); |
|
|
|
//resiChildMap.forEach((key, value) -> value.putAll(resiMainList.get(key)));
|
|
|
|
|
|
|
|
int sheetNo = n.incrementAndGet(); |
|
|
@ -397,13 +414,14 @@ public class IcResiUserController { |
|
|
|
} |
|
|
|
|
|
|
|
@PostMapping("test") |
|
|
|
public Result<List<Map<String, Object>>> test(@RequestBody DynamicQueryFormDTO formDTO) { |
|
|
|
public Result<List<Map<String, Object>>> test(@LoginUser TokenDto tokenDto,@RequestBody DynamicQueryFormDTO formDTO) { |
|
|
|
formDTO.setCustomerId("45687aa479955f9d06204d415238f7cc"); |
|
|
|
//formDTO.setCustomerId(tokenDto.getCustomerId());
|
|
|
|
return new Result<List<Map<String, Object>>>().ok(icResiUserService.dynamicQuery(formDTO.getCustomerId(), |
|
|
|
formDTO.getFormCode(), |
|
|
|
formDTO.getResultTableName(), |
|
|
|
formDTO.getConditions())); |
|
|
|
formDTO.getConditions(), |
|
|
|
tokenDto.getUserId(),null)); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|