Browse Source

去掉经济低保字段

master
jianjun 4 years ago
parent
commit
0f6ad0d77c
  1. 5
      epmet-user/epmet-user-server/src/main/java/com/epmet/constant/UserConstant.java
  2. 75
      epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiUserController.java
  3. 9
      epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcResiUserEntity.java
  4. 6
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcResiUserService.java
  5. 46
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java
  6. BIN
      epmet-user/epmet-user-server/src/main/resources/excel/ic_resi_info_cid.xls

5
epmet-user/epmet-user-server/src/main/java/com/epmet/constant/UserConstant.java

@ -102,5 +102,8 @@ public interface UserConstant {
String GENDER="GENDER"; String GENDER="GENDER";
String HOUSE_TYPE_KEY="HOUSE_TYPE"; String HOUSE_TYPE_KEY="HOUSE_TYPE";
String HOME_ID = "HOME_ID"; String HOME_ID = "HOME_ID";
/**
* 居民信息 子表中的主表id
*/
String IC_RESI_USER = "IC_RESI_USER";
} }

75
epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiUserController.java

@ -29,6 +29,7 @@ import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.ExcelUtils; import com.epmet.commons.tools.utils.ExcelUtils;
import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.commons.tools.validator.ValidatorUtils;
@ -327,32 +328,84 @@ public class IcResiUserController {
@RequestMapping(value = "/exportExcel") @RequestMapping(value = "/exportExcel")
public void exportExcel(/*@LoginUser TokenDto tokenDto,*/ @RequestBody IcResiUserPageFormDTO pageFormDTO, HttpServletResponse response) throws IOException { public void exportExcel(/*@LoginUser TokenDto tokenDto,*/ @RequestBody IcResiUserPageFormDTO pageFormDTO, HttpServletResponse response) throws IOException {
pageFormDTO.setCustomerId("45687aa479955f9d06204d415238f7cc"); pageFormDTO.setCustomerId("45687aa479955f9d06204d415238f7cc");
pageFormDTO.setPageFlag(false); pageFormDTO.setPageFlag(false);
//PageData<Map<String, Object>> mapPageData = icResiUserService.pageResiMap(pageFormDTO); CustomerFormResultDTO resiFormItems = getResiFormItems(pageFormDTO.getCustomerId());
//List<Map<String, Object>> list = mapPageData.getList(); /* Map<String,List<OptionDTO>> checkListMap = new HashMap<>();
List<Map<String, Object>> list = icResiUserService.getDataForExport(pageFormDTO.getCustomerId(), pageFormDTO.getFormCode(), BASE_TABLE_NAME, pageFormDTO.getConditions()); for (FormItem item : resiFormItems.getItemList()) {
//list = (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("list:{}", JSON.toJSONString(list));
if ("checkbox".equals(item.getItemType())) {
List<OptionDTO> options = null;
if ("remote".equals(item.getOptionSourceType())) {
} else if ("local".equals(item.getOptionSourceType())) {
options = item.getOptions();
}
checkListMap.put(item.getColumnName().concat(item.getColumnNum().equals(0) ? "" : item.getColumnNum().toString()), options);
}
}*/
CustomerFormResultDTO resiFormItems = getResiFormItems(pageFormDTO.getCustomerId()); //PageData<Map<String, Object>> mapPageData = icResiUserService.pageResiMap(pageFormDTO);
//List<Map<String, Object>> resiMainList = mapPageData.getList();
Map<String, FormItem> itemMap = new HashMap<>();
for (FormItem formItem : resiFormItems.getItemList()) {
if (StringUtils.isNotBlank(formItem.getColumnName())){
itemMap.put(formItem.getColumnName().concat(formItem.getColumnNum() == 0 ? "" : formItem.getColumnNum().toString()), formItem);
}
if (formItem.getChildGroup() != null) {
for (FormItem2 item2 : formItem.getChildGroup().getItemList()) {
if (item2.getItemType().equals("checkbox")) {
itemMap.put(item2.getColumnName().concat(item2.getColumnNum() == 0 ? "" : item2.getColumnNum().toString()), ConvertUtils.sourceToTarget(item2,FormItem.class));
}
}
}
}
for (FormGroupDTO groupItem : resiFormItems.getGroupList()) {
if (groupItem.getItemList() != null) {
for (FormItem2 item : groupItem.getItemList()) {
if (StringUtils.isBlank(item.getColumnName())){
continue;
}
System.out.println(item.getColumnName()+item.getColumnNum());
itemMap.put(item.getColumnName().concat(item.getColumnNum() == 0 ? "" : item.getColumnNum().toString()), ConvertUtils.sourceToTarget(item,FormItem.class));
}
}
}
Map<String,Map<String, Object>> resiMainList = icResiUserService.getDataForExport(itemMap,pageFormDTO.getCustomerId(), pageFormDTO.getFormCode(), BASE_TABLE_NAME, pageFormDTO.getConditions());
//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"; String templatePath = "excel/ic_resi_info_cid.xls";
TemplateExportParams params = new TemplateExportParams(templatePath,true); TemplateExportParams params = new TemplateExportParams(templatePath,true);
Map<Integer,Map<String,Object>> sheetMap = new HashMap<>(); Map<Integer,Map<String,Object>> sheetMap = new HashMap<>();
Map<String, Object> mapData = new HashMap<>(); Map<String, Object> mapData = new HashMap<>();
mapData.put("list", list); mapData.put("list", resiMainList.values());
sheetMap.put(0,mapData); sheetMap.put(0,mapData);
AtomicInteger n = new AtomicInteger(); AtomicInteger n = new AtomicInteger();
resiFormItems.getItemList().forEach(item->{ for (FormItem item : resiFormItems.getItemList()) {
if (item.getChildGroup() != null){
if (item.getChildGroup() != null) {
if (!item.getChildGroup().getTableName().equals(BASE_TABLE_NAME)) { if (!item.getChildGroup().getTableName().equals(BASE_TABLE_NAME)) {
sheetMap.put(n.incrementAndGet() ,mapData); //itemMap = item.getChildGroup().getItemList().stream().filter(o -> o.getItemType().equals("checkbox")).collect(Collectors.toMap(o -> o.getColumnName().concat(o.getColumnNum() == 0 ? "" : o.getColumnNum().toString()), o -> ConvertUtils.sourceToTarget(o,FormItem.class)));
Map<String,Map<String, Object>> resiChildMap = icResiUserService.getDataForExport(itemMap, pageFormDTO.getCustomerId(), pageFormDTO.getFormCode(), item.getChildGroup().getTableName(), pageFormDTO.getConditions());
resiChildMap.forEach((key,value)->{
value.putAll(resiMainList.get(key));
});
Map<String, Object> mapData2 = new HashMap<>();
mapData2.put("list", resiChildMap.values());
System.out.println("========="+item.getChildGroup().getTableName()+" data:"+resiChildMap.size());
sheetMap.put(n.incrementAndGet(),mapData2);
} }
} }
}); }
Workbook workbook = ExcelExportUtil.exportExcel(sheetMap, params); Workbook workbook = ExcelExportUtil.exportExcel(sheetMap, params);
workbook.setActiveSheet(0); workbook.setActiveSheet(0);

9
epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcResiUserEntity.java

@ -44,12 +44,12 @@ public class IcResiUserEntity extends BaseEpmetEntity {
private String customerId; private String customerId;
/** /**
* *
*/ */
private String agencyId; private String agencyId;
/** /**
* *
*/ */
private String pids; private String pids;
@ -373,11 +373,6 @@ public class IcResiUserEntity extends BaseEpmetEntity {
*/ */
private String ysr; private String ysr;
/**
* 是否经济低保
*/
private String isJjdb;
/** /**
* 籍贯 * 籍贯
*/ */

6
epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcResiUserService.java

@ -22,9 +22,9 @@ import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.dto.IcResiUserDTO; import com.epmet.dto.IcResiUserDTO;
import com.epmet.dto.form.*; import com.epmet.dto.form.*;
import com.epmet.dto.result.FormItem;
import com.epmet.dto.result.HomeUserResultDTO; import com.epmet.dto.result.HomeUserResultDTO;
import com.epmet.entity.IcResiUserEntity; import com.epmet.entity.IcResiUserEntity;
import com.epmet.service.impl.IcResiUserServiceImpl;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
@ -137,12 +137,14 @@ public interface IcResiUserService extends BaseService<IcResiUserEntity> {
/** /**
* desc:条件导出 * desc:条件导出
*
* @param itemList
* @param customerId * @param customerId
* @param formCode * @param formCode
* @param baseTableName * @param baseTableName
* @param conditions * @param conditions
* @return * @return
*/ */
List<Map<String, Object>> getDataForExport(String customerId, String formCode, String baseTableName, List<ResiUserQueryValueDTO> conditions); Map<String, Map<String, Object>> getDataForExport(Map<String, FormItem> itemList, String customerId, String formCode, String baseTableName, List<ResiUserQueryValueDTO> conditions);
} }

46
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java

@ -488,15 +488,15 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
* @param currUserAgencyId 当前用户的组织id * @param currUserAgencyId 当前用户的组织id
* @param checkBoxOptionColumnIdxAndLabel 复选框的列号&label中文 * @param checkBoxOptionColumnIdxAndLabel 复选框的列号&label中文
*/ */
private void persist(Map<String, ColumnWrapper> headerColumnWrapper, List<Map<Integer, String>> dataRows, private void persist(Map<String, ColumnWrapper> headerColumnWrapper, List<Map<Integer, String>> dataRows,
String currUserAgencyId, Map<Integer, String> checkBoxOptionColumnIdxAndLabel, String tableName) { String currUserAgencyId, Map<Integer, String> checkBoxOptionColumnIdxAndLabel, String tableName) {
for (Map<Integer, String> row : dataRows) { for (Map<Integer, String> row : dataRows) {
// 当前行的列们 // 当前行的列们
// List<ColumnWrapper> columnsOfCurrRow = new ArrayList<>(); // List<ColumnWrapper> columnsOfCurrRow = new ArrayList<>();
List<String> columnNames = new ArrayList<>(); List<String> columnNames = new ArrayList<>();
List<String> columnValues = new ArrayList<>(); List<String> columnValues = new ArrayList<>();
for (Map.Entry<String, ColumnWrapper> columnWrapperEntry : headerColumnWrapper.entrySet()) { for (Map.Entry<String, ColumnWrapper> columnWrapperEntry : headerColumnWrapper.entrySet()) {
@ -666,7 +666,7 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
String pureUri = null; String pureUri = null;
String cascadeItemId = null; String cascadeItemId = null;
ColumnWrapper cascadeItemColumnWrapper = null; ColumnWrapper cascadeItemColumnWrapper = null;
if (fullUri.indexOf("?") != -1) { if (fullUri.indexOf("?") != -1) {
String[] uriParts = fullUri.split("\\?"); String[] uriParts = fullUri.split("\\?");
pureUri = uriParts[0]; pureUri = uriParts[0];
@ -903,6 +903,8 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
/** /**
* desc:条件导出 * desc:条件导出
* *
*
* @param formItemMap
* @param customerId * @param customerId
* @param formCode * @param formCode
* @param baseTableName * @param baseTableName
@ -910,9 +912,34 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
* @return * @return
*/ */
@Override @Override
public List<Map<String, Object>> getDataForExport(String customerId, String formCode, String baseTableName, List<ResiUserQueryValueDTO> conditions) { public Map<String, Map<String, Object>> getDataForExport(Map<String, FormItem> formItemMap, String customerId, String formCode, String baseTableName, List<ResiUserQueryValueDTO> conditions) {
List<Map<String, Object>> mapList = this.dynamicQuery(customerId, formCode, baseTableName, conditions); List<Map<String, Object>> mapList = this.dynamicQuery(customerId, formCode, baseTableName, conditions);
mapList.parallelStream().forEach(map -> {
Map<String, Map<String, Object>> result = new LinkedHashMap<>();
mapList.stream().filter(Objects::nonNull).forEach(map -> {
String resiId = (String) map.getOrDefault(UserConstant.IC_RESI_USER, "");
formItemMap.forEach((k, v)->{
Object temp = map.get(k);
if (temp != null){
if (v.getOptionSourceType().equals("remote")){
//todo 获取 options
}
v.getOptions().forEach(optionDTO -> {
map.put(optionDTO.getValue(),temp.toString().contains(optionDTO.getValue())?"是":"否");
});
}
});
if ("ic_resi_user".equals(baseTableName)) {
resiId = (String) map.get("ID");
}
if (StringUtils.isBlank(resiId)){
log.error("getDataForExport error,resiId:{}",resiId);
return;
}
result.put(resiId, map);
if (!"ic_resi_user".equals(baseTableName)) {
return;
}
Object gridId = map.get(UserConstant.GRID_ID); Object gridId = map.get(UserConstant.GRID_ID);
if (gridId != null) { if (gridId != null) {
CustomerGridFormDTO formDTO = new CustomerGridFormDTO(); CustomerGridFormDTO formDTO = new CustomerGridFormDTO();
@ -927,14 +954,15 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
HashSet<String> houseIds = new HashSet<>(); HashSet<String> houseIds = new HashSet<>();
houseIds.add(homeId.toString()); houseIds.add(homeId.toString());
Result<List<HouseInfoDTO>> houseInfoRes = govOrgOpenFeignClient.queryListHouseInfo(houseIds); Result<List<HouseInfoDTO>> houseInfoRes = govOrgOpenFeignClient.queryListHouseInfo(houseIds);
if (houseInfoRes != null && houseInfoRes.success() && CollectionUtils.isNotEmpty(houseInfoRes.getData())){ if (houseInfoRes != null && houseInfoRes.success() && CollectionUtils.isNotEmpty(houseInfoRes.getData())) {
HouseInfoDTO houseInfoDTO = houseInfoRes.getData().get(NumConstant.ZERO); HouseInfoDTO houseInfoDTO = houseInfoRes.getData().get(NumConstant.ZERO);
map.put("VILLAGE_NAME", houseInfoDTO.getNeighborHoodName()); map.put("VILLAGE_NAME", houseInfoDTO.getNeighborHoodName());
map.put("BUILD_NAME", houseInfoDTO.getBuildingName()); map.put("BUILD_NAME", houseInfoDTO.getBuildingName());
map.put("HOME_ID", houseInfoDTO.getDoorName()); map.put("HOME_ID", houseInfoDTO.getDoorName());
} }
} }
}); });
return mapList; return result;
} }
} }

BIN
epmet-user/epmet-user-server/src/main/resources/excel/ic_resi_info_cid.xls

Binary file not shown.
Loading…
Cancel
Save