Browse Source

Merge remote-tracking branch 'origin/dev_ic_platform' into dev_ic_platform

dev_shibei_match
yinzuomei 4 years ago
parent
commit
e920c9723e
  1. 3
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/BuildingTreeLevelDTO.java
  2. 5
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcBulidingFormDTO.java
  3. 2
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcHouseFormDTO.java
  4. 4
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/IcNeighborHoodResultDTO.java
  5. 57
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/enums/BuildingTypeEnums.java
  6. 59
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/enums/HousePurposeEnums.java
  7. 58
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/enums/HouseRentFlagEnums.java
  8. 54
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/enums/HouseTypeEnums.java
  9. 15
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/BuildingController.java
  10. 4
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/IcBuildingExcel.java
  11. 35
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/BuildingServiceImpl.java
  12. 30
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/HouseServiceImpl.java
  13. 2
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/NeighborHoodServiceImpl.java
  14. BIN
      epmet-module/gov-org/gov-org-server/src/main/resources/excel/building_export.xlsx
  15. BIN
      epmet-module/gov-org/gov-org-server/src/main/resources/excel/building_template.xlsx
  16. BIN
      epmet-module/gov-org/gov-org-server/src/main/resources/excel/house_template.xlsx
  17. 16
      epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcBuildingDao.xml
  18. 19
      epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcHouseDao.xml
  19. 17
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/HomeUserResultDTO.java
  20. 57
      epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiUserController.java
  21. 10
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcResiUserService.java
  22. 34
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java

3
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/BuildingTreeLevelDTO.java

@ -47,6 +47,9 @@ public class BuildingTreeLevelDTO implements Serializable {
private List<BuildingTreeLevelDTO> children;
private String longitude;
private String latitude;
}

5
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcBulidingFormDTO.java

@ -42,14 +42,14 @@ public class IcBulidingFormDTO implements Serializable {
/**
* 组织id
*/
@NotBlank(message = "组织id不能为空", groups = {AddGroup.class})
@NotBlank(message = "组织id不能为空", groups = {AddGroup.class, UpdateGroup.class})
private String agencyId;
/**
* 网格id
*/
@NotBlank(message = "网格不能为空", groups = {AddGroup.class, UpdateGroup.class})
private String gridId;
@ -69,6 +69,7 @@ public class IcBulidingFormDTO implements Serializable {
/**
* 楼栋类型
*/
@NotBlank(message = "楼栋类型不能为空", groups = {AddGroup.class, UpdateGroup.class})
private String type="";
/**

2
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcHouseFormDTO.java

@ -45,7 +45,7 @@ public class IcHouseFormDTO implements Serializable {
@NotBlank(message = "小区id不能为空", groups = {AddGroup.class, UpdateGroup.class})
private String neighborHoodId;
@NotBlank(message = "所属楼栋ID不能为空", groups = { UpdateGroup.class})
@NotBlank(message = "所属楼栋ID不能为空", groups = {AddGroup.class, UpdateGroup.class})
private String buildingId;
/**

4
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/IcNeighborHoodResultDTO.java

@ -1,6 +1,5 @@
package com.epmet.dto.result;
import lombok.AllArgsConstructor;
import lombok.Data;
import java.io.Serializable;
@ -20,7 +19,8 @@ public class IcNeighborHoodResultDTO implements Serializable {
/**
* 总条数
* */
private Long total;
private Integer total;
// /**
// * 数据类型【小区:neighbourHood,楼栋:building,房屋:house】

57
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/enums/BuildingTypeEnums.java

@ -0,0 +1,57 @@
package com.epmet.enums;
import org.springframework.util.StringUtils;
public enum BuildingTypeEnums {
SPF("1","商品房"),
ZJF("2","自建房"),
BS("3","别墅");
private String key;
private String value;
BuildingTypeEnums(String key, String value) {
this.key = key;
this.value=value;
}
public static String getTypeValue(Object key){
if(null == key){
return null;
}
BuildingTypeEnums buildingTypeEnums = getBuildType(String.valueOf(key));
return buildingTypeEnums == null ? null : buildingTypeEnums.getValue();
}
public static String getKeyByValue(String value){
if(StringUtils.isEmpty(value)){
return "";
}
for (BuildingTypeEnums e : BuildingTypeEnums.values()) {
if (e.getValue().equals(value)) {
return e.getKey();
}
}
return "";
}
private static BuildingTypeEnums getBuildType(String key) {
for (BuildingTypeEnums b :BuildingTypeEnums.values()) {
if (b.getKey().equals(key)) {
return b;
}
}
return null;
}
public String getValue() {
return value;
}
public String getKey() {
return key;
}
}

59
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/enums/HousePurposeEnums.java

@ -0,0 +1,59 @@
package com.epmet.enums;
import org.springframework.util.StringUtils;
public enum HousePurposeEnums {
ZZ("1","住宅"),
SY("2","商业"),
BG("3","办公"),
GY("4","工业"),
CC("5","仓储"),
SZHY("6","商住混用"),
QT("7","其他");
private String key;
private String value;
HousePurposeEnums(String key, String value) {
this.key = key;
this.value=value;
}
public static String getKeyByValue(String value){
if(StringUtils.isEmpty(value)){
return "";
}
for (HousePurposeEnums e : HousePurposeEnums.values()) {
if (e.getValue().equals(value)) {
return e.getKey();
}
}
return "";
}
public static String getTypeValue(Object key){
if(null == key){
return null;
}
HousePurposeEnums buildingTypeEnums = getValueByKey(String.valueOf(key));
return buildingTypeEnums == null ? null : buildingTypeEnums.getValue();
}
private static HousePurposeEnums getValueByKey(String key) {
for (HousePurposeEnums b : HousePurposeEnums.values()) {
if (b.getKey().equals(key)) {
return b;
}
}
return null;
}
public String getValue() {
return value;
}
public String getKey() {
return key;
}
}

58
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/enums/HouseRentFlagEnums.java

@ -0,0 +1,58 @@
package com.epmet.enums;
import org.springframework.util.StringUtils;
public enum HouseRentFlagEnums {
YES(1,"是"),
NO(0,"否");
private Integer code;
private String name;
HouseRentFlagEnums(Integer code, String name) {
this.code = code;
this.name=name;
}
public static String getTypeValue(Object code){
if(code == null){
return null;
}
HouseRentFlagEnums houseRentFlagEnums = getByKey(Integer.parseInt(code.toString()));
return houseRentFlagEnums == null ? null : houseRentFlagEnums.getName();
}
private static HouseRentFlagEnums getByKey(Integer code) {
for (HouseRentFlagEnums e : HouseRentFlagEnums.values()) {
if (e.getCode().equals(code)) {
return e;
}
}
return null;
}
public static Integer getCodeByName(String name){
if(StringUtils.isEmpty(name)){
return 0;
}
for (HouseRentFlagEnums e : HouseRentFlagEnums.values()) {
if (e.getName().equals(name)) {
return e.getCode();
}
}
return 0;
}
public Integer getCode() {
return code;
}
public String getName() {
return name;
}
}

54
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/enums/HouseTypeEnums.java

@ -0,0 +1,54 @@
package com.epmet.enums;
import org.springframework.util.StringUtils;
public enum HouseTypeEnums {
SPF("1","楼房"),
ZJF("2","平房"),
BS("3","别墅");
private String key;
private String value;
HouseTypeEnums(String key, String value) {
this.key = key;
this.value=value;
}
public static String getKeyByValue(String value){
if(StringUtils.isEmpty(value)){
return "";
}
for (HouseTypeEnums e : HouseTypeEnums.values()) {
if (e.getValue().equals(value)) {
return e.getKey();
}
}
return "";
}
public static String getTypeValue(Object key){
if(null == key){
return null;
}
HouseTypeEnums buildingTypeEnums = getByKey(String.valueOf(key));
return buildingTypeEnums == null ? null : buildingTypeEnums.getValue();
}
private static HouseTypeEnums getByKey(String key) {
for (HouseTypeEnums b : HouseTypeEnums.values()) {
if (b.getKey().equals(key)) {
return b;
}
}
return null;
}
public String getValue() {
return value;
}
public String getKey() {
return key;
}
}

15
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/BuildingController.java

@ -152,6 +152,21 @@ public class BuildingController {
}
/**
* 导出
* @param formDTO
* @param response
* @throws Exception
*/
@GetMapping("export")
public void export(HttpServletResponse response) throws Exception {
ListIcNeighborHoodFormDTO formDTO = new ListIcNeighborHoodFormDTO();
ValidatorUtils.validateEntity(ListIcNeighborHoodFormDTO.class);
buildingService.exportBuildinginfo(formDTO,response);
}
/**
* 导入数据
* @param file

4
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/IcBuildingExcel.java

@ -109,6 +109,10 @@ public class IcBuildingExcel extends ExcelVerifyInfo implements Serializable {
@NotBlank(message = "楼栋名称不能位空")
private String buildingName;
@Excel(name = "楼栋类型")
@NotBlank(message = "楼栋类型不能位空")
private String type;
@Excel(name = "单元数")
@NotNull(message = "单元数不能位空")
private Integer totalUnitNum;

35
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/BuildingServiceImpl.java

@ -14,6 +14,7 @@ import com.epmet.dto.form.ListIcNeighborHoodFormDTO;
import com.epmet.dto.result.ExtStaffPermissionResultDTO;
import com.epmet.dto.result.IcNeighborHoodResultDTO;
import com.epmet.entity.*;
import com.epmet.enums.BuildingTypeEnums;
import com.epmet.excel.IcBuildingExcel;
import com.epmet.excel.IcNeighborHoodExcel;
import com.epmet.service.*;
@ -90,6 +91,9 @@ public class BuildingServiceImpl implements BuildingService {
log.error("com.epmet.service.impl.BuildingServiceImpl.treeList,没有找到工作人员所属的机关信息,用户Id:{}",staffId);
return new ArrayList<>();
}
// agency = new CustomerStaffAgencyDTO();
// agency.setAgencyId("77f6bc7f07064bf4c09ef848139a344c");
//1.获取所在组织及下级组织
CustomerAgencyEntity customerAgency = customerAgencyDao.selectById(agency.getAgencyId());
List<CustomerAgencyEntity> customerAgencyList = icBuildingDao.selectAgencyChildrenList(agency.getAgencyId());
@ -105,6 +109,8 @@ public class BuildingServiceImpl implements BuildingService {
buildingTreeLevelDTO.setPId(item.getPid());
buildingTreeLevelDTO.setLabel(item.getOrganizationName());
buildingTreeLevelDTO.setLevel(item.getLevel());
buildingTreeLevelDTO.setLongitude(item.getLongitude());
buildingTreeLevelDTO.setLatitude(item.getLatitude());
buildingTreeLevelDTO.setChildren(new ArrayList<>());
return buildingTreeLevelDTO;
}).collect(Collectors.toList());
@ -126,6 +132,8 @@ public class BuildingServiceImpl implements BuildingService {
buildingTreeLevelDTO.setLabel(item.getGridName());
buildingTreeLevelDTO.setLevel("grid");
buildingTreeLevelDTO.setPId(item.getPid());
buildingTreeLevelDTO.setLongitude(item.getLongitude());
buildingTreeLevelDTO.setLatitude(item.getLatitude());
buildingTreeLevelDTO.setChildren(new ArrayList<>());
return buildingTreeLevelDTO;
}).collect(Collectors.toList());
@ -134,7 +142,7 @@ public class BuildingServiceImpl implements BuildingService {
//3.获取网格下的所有小区
List<String> gridIdList = customerGridList.stream().map(a->a.getId()).collect(Collectors.toList());
List<IcNeighborHoodEntity> icNeighborHoodList = icNeighborHoodDao.selectList(new QueryWrapper<IcNeighborHoodEntity>().lambda().in(IcNeighborHoodEntity::getGridId, gridIdList));
if(CollectionUtils.isEmpty(customerGridList)){
if(CollectionUtils.isEmpty(icNeighborHoodList)){
agencyList.addAll(gridList);
return covertToTree(customerAgency,agencyList);
}
@ -144,6 +152,8 @@ public class BuildingServiceImpl implements BuildingService {
buildingTreeLevelDTO.setPId(item.getGridId());
buildingTreeLevelDTO.setLabel(item.getNeighborHoodName());
buildingTreeLevelDTO.setLevel("neighbourHood");
buildingTreeLevelDTO.setLongitude(item.getLongitude());
buildingTreeLevelDTO.setLatitude(item.getLatitude());
buildingTreeLevelDTO.setChildren(new ArrayList<>());
return buildingTreeLevelDTO;
}).collect(Collectors.toList());
@ -165,6 +175,8 @@ public class BuildingServiceImpl implements BuildingService {
buildingTreeLevelDTO.setPId(item.getNeighborHoodId());
buildingTreeLevelDTO.setLabel(item.getBuildingName());
buildingTreeLevelDTO.setLevel("building");
buildingTreeLevelDTO.setLongitude(item.getLongitude());
buildingTreeLevelDTO.setLatitude(item.getLatitude());
buildingTreeLevelDTO.setChildren(new ArrayList<>());
return buildingTreeLevelDTO;
}).collect(Collectors.toList());
@ -215,7 +227,7 @@ public class BuildingServiceImpl implements BuildingService {
entity.setCustomerId(customerId);
entity.setNeighborHoodId(Optional.ofNullable(neighborHoodMap.get(icBuildingExcel.getNeighborHoodName())).map(u->u.getId()).orElse(""));//neighborHoodMap.get(icBuildingExcel.getNeighborHoodName()).getId()
entity.setBuildingName(icBuildingExcel.getBuildingName());
entity.setType("");
entity.setType(BuildingTypeEnums.getKeyByValue(icBuildingExcel.getType()));
entity.setSort(0);
entity.setTotalUnitNum(icBuildingExcel.getTotalUnitNum());
entity.setTotalFloorNum(icBuildingExcel.getTotalFloorNum());
@ -247,7 +259,7 @@ public class BuildingServiceImpl implements BuildingService {
IcNeighborHoodResultDTO result = new IcNeighborHoodResultDTO();
IPage<Map<String, Object>> resultMap = searchBuilding(formDTO);
result.setTotal(resultMap.getTotal());
result.setTotal(Long.valueOf(resultMap.getTotal()).intValue());
result.setList(resultMap.getRecords());
return result;
}
@ -260,7 +272,7 @@ public class BuildingServiceImpl implements BuildingService {
TemplateExportParams templatePath = new TemplateExportParams("excel/building_export.xlsx");
Map<String,Object> map = new HashMap<>();
map.put("maplist",icBuildingExcels);
ExcelPoiUtils.exportExcel(templatePath ,new HashMap<>(),"楼宇信息录入表",response);
ExcelPoiUtils.exportExcel(templatePath ,map,"楼宇信息录入表",response);
return ;
}
private List<IcBuildingExcel> searchAllBuilding(ListIcNeighborHoodFormDTO formDTO) {
@ -281,7 +293,11 @@ public class BuildingServiceImpl implements BuildingService {
IcBuildingEntity building = ConvertUtils.sourceToTarget(formDTO, IcBuildingEntity.class);
building.setDelFlag("0");
IcHouseEntity house = ConvertUtils.sourceToTarget(formDTO, IcHouseEntity.class);
return icBuildingDao.searchAllBuilding(building,house);
List<IcBuildingExcel> icBuildingExcels = icBuildingDao.searchAllBuilding(building, house);
icBuildingExcels.forEach(item->{
item.setType(BuildingTypeEnums.getTypeValue(item.getType()));
});
return icBuildingExcels;
}
private IPage<Map<String, Object>> searchBuilding(ListIcNeighborHoodFormDTO formDTO) {
@ -307,7 +323,12 @@ public class BuildingServiceImpl implements BuildingService {
// .like(!StringUtils.isEmpty(formDTO.getBuildingName()),IcBuildingEntity::getBuildingName,formDTO.getBuildingName());
// buildingEntityQueryWrapper.eq("a.DEL_FLAG","0");
IcHouseEntity house = ConvertUtils.sourceToTarget(formDTO, IcHouseEntity.class);
return icBuildingDao.searchBuildingByPage(page,building,house);
IPage<Map<String, Object>> mapIPage = icBuildingDao.searchBuildingByPage(page, building, house);
List<Map<String, Object>> records = mapIPage.getRecords();
records.forEach(item->{
item.put("buildingType", BuildingTypeEnums.getTypeValue(item.get("buildingTypeKey")));
});
return mapIPage;
}
@ -316,6 +337,8 @@ public class BuildingServiceImpl implements BuildingService {
buildingTreeLevelDTO.setId(customerAgency.getId());
buildingTreeLevelDTO.setLabel(customerAgency.getOrganizationName());
buildingTreeLevelDTO.setLevel(customerAgency.getLevel());
buildingTreeLevelDTO.setLongitude(customerAgency.getLongitude());
buildingTreeLevelDTO.setLatitude(customerAgency.getLatitude());
buildingTreeLevelDTO.setChildren(new ArrayList<>());
recursionCovertToTree(buildingTreeLevelDTO,agencyList);
List<BuildingTreeLevelDTO> result = new ArrayList<>();

30
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/HouseServiceImpl.java

@ -3,6 +3,7 @@ package com.epmet.service.impl;
import cn.afterturn.easypoi.excel.entity.TemplateExportParams;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.epmet.commons.tools.enums.HouseTypeEnum;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.dao.IcBuildingDao;
import com.epmet.dao.IcBuildingUnitDao;
@ -18,6 +19,9 @@ import com.epmet.dto.result.IcNeighborHoodResultDTO;
import com.epmet.entity.IcBuildingEntity;
import com.epmet.entity.IcHouseEntity;
import com.epmet.entity.IcNeighborHoodEntity;
import com.epmet.enums.HousePurposeEnums;
import com.epmet.enums.HouseRentFlagEnums;
import com.epmet.enums.HouseTypeEnums;
import com.epmet.excel.IcHouseExcel;
import com.epmet.service.HouseService;
import com.epmet.service.IcBuildingService;
@ -144,9 +148,9 @@ public class HouseServiceImpl implements HouseService {
entity.setHouseName(icHouseExcel.getBuildingName()+"-"+icHouseExcel.getBuildingUnit()+"-"+icHouseExcel.getDoorName());
entity.setDoorName(icHouseExcel.getDoorName());
entity.setHouseType(icHouseExcel.getHouseType());
entity.setPurpose(icHouseExcel.getPurpose());
entity.setRentFlag("是".equals(icHouseExcel.getRentFlag())?1:0);
entity.setHouseType(HouseTypeEnums.getKeyByValue(icHouseExcel.getHouseType()));
entity.setPurpose(HousePurposeEnums.getKeyByValue(icHouseExcel.getPurpose()));
entity.setRentFlag(HouseRentFlagEnums.getCodeByName(icHouseExcel.getRentFlag()));
entity.setOwnerName(icHouseExcel.getOwnerName());
entity.setOwnerPhone(icHouseExcel.getOwnerPhone());
entity.setOwnerIdCard(icHouseExcel.getOwnerIdCard());
@ -162,7 +166,7 @@ public class HouseServiceImpl implements HouseService {
IcNeighborHoodResultDTO result = new IcNeighborHoodResultDTO();
//如果类型是house 查房屋
IPage<Map<String, Object>> resultMap = searchHouse(formDTO);
result.setTotal(resultMap.getTotal());
result.setTotal(Long.valueOf(resultMap.getTotal()).intValue());
result.setList(resultMap.getRecords());
return result;
}
@ -176,7 +180,7 @@ public class HouseServiceImpl implements HouseService {
TemplateExportParams templatePath = new TemplateExportParams("excel/house_export.xlsx");
Map<String,Object> map = new HashMap<>();
map.put("maplist",icHouseExcels);
ExcelPoiUtils.exportExcel(templatePath ,new HashMap<>(),"房屋信息录入表",response);
ExcelPoiUtils.exportExcel(templatePath ,map,"房屋信息录入表",response);
return ;
}
@ -190,7 +194,12 @@ public class HouseServiceImpl implements HouseService {
IcHouseEntity house = ConvertUtils.sourceToTarget(formDTO, IcHouseEntity.class);
house.setDelFlag("0");
return icHouseDao.searchAllHouse(house);
List<IcHouseExcel> icHouseExcels = icHouseDao.searchAllHouse(house);
icHouseExcels.forEach(item->{
item.setHouseType(HouseTypeEnums.getTypeValue(item.getHouseType()));
item.setPurpose(HousePurposeEnums.getTypeValue(item.getPurpose()));
});
return icHouseExcels;
}
private IPage<Map<String, Object>> searchHouse(ListIcNeighborHoodFormDTO formDTO) {
@ -221,7 +230,14 @@ public class HouseServiceImpl implements HouseService {
IcHouseEntity house = ConvertUtils.sourceToTarget(formDTO, IcHouseEntity.class);
house.setDelFlag("0");
return icHouseDao.searchHouseByPage(page,house);
IPage<Map<String, Object>> mapIPage = icHouseDao.searchHouseByPage(page, house);
List<Map<String, Object>> records = mapIPage.getRecords();
records.forEach(item->{
item.put("houseType", HouseTypeEnums.getTypeValue(item.get("houseTypeKey")));
// item.put("rentFlag", HouseRentFlagEnums.getTypeValue(item.get("rentFlagKey") ));
item.put("purpose", HousePurposeEnums.getTypeValue(item.get("purposeKey")));
});
return mapIPage;
}
@Override

2
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/NeighborHoodServiceImpl.java

@ -111,7 +111,7 @@ public class NeighborHoodServiceImpl implements NeighborHoodService {
IcNeighborHoodResultDTO result = new IcNeighborHoodResultDTO();
IPage<Map<String, Object>> resultMap = searchNeighborhood(formDTO);
result.setTotal(resultMap.getTotal());
result.setTotal(Long.valueOf(resultMap.getTotal()).intValue());
result.setList(resultMap.getRecords());
return result;

BIN
epmet-module/gov-org/gov-org-server/src/main/resources/excel/building_export.xlsx

Binary file not shown.

BIN
epmet-module/gov-org/gov-org-server/src/main/resources/excel/building_template.xlsx

Binary file not shown.

BIN
epmet-module/gov-org/gov-org-server/src/main/resources/excel/house_template.xlsx

Binary file not shown.

16
epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcBuildingDao.xml

@ -33,7 +33,7 @@
a.TOTAL_FLOOR_NUM as totalFloorNum,
a.TOTAL_UNIT_NUM as totalUnitNum,
a.BUILDING_NAME as buildingType,
b.NEIGHBOR_HOOD_NAME as neighbourHoodName
b.NEIGHBOR_HOOD_NAME as neighborHoodName
from ic_building a
LEFT JOIN ic_neighbor_hood b on a.NEIGHBOR_HOOD_ID = b.ID
@ -50,12 +50,12 @@
<select id="searchBuildingByPage" resultType="map">
select
a.BUILDING_NAME as buildingName,
b.NEIGHBOR_HOOD_NAME as neighbourHoodName,
b.NEIGHBOR_HOOD_NAME as neighborHoodName,
b.ID as neighborHoodId,
a.TOTAL_HOUSE_NUM as totalHouseNum,
a.TOTAL_FLOOR_NUM as totalFloorNum,
a.TOTAL_UNIT_NUM as totalUnitNum,
a.TYPE as buildingType,
/*a.TYPE as buildingType,*/
a.ID as buildingId,
c.ID as agencyId,
c.ORGANIZATION_NAME as agencyName,
@ -103,8 +103,8 @@
a.TOTAL_HOUSE_NUM as totalHouseNum,
a.TOTAL_FLOOR_NUM as totalFloorNum,
a.TOTAL_UNIT_NUM as totalUnitNum,
a.TYPE as buildingType,
b.NEIGHBOR_HOOD_NAME as neighbourHoodName,
a.TYPE as type,
b.NEIGHBOR_HOOD_NAME as neighborHoodName,
c.ORGANIZATION_NAME as agencyName,
d.GRID_NAME as gridName
from ic_building a
@ -146,7 +146,7 @@
a.TOTAL_FLOOR_NUM as totalFloorNum,
a.TOTAL_UNIT_NUM as totalUnitNum,
a.BUILDING_NAME as buildingType,
b.NEIGHBOR_HOOD_NAME as neighbourHoodName
b.NEIGHBOR_HOOD_NAME as neighborHoodName
from ic_building a
LEFT JOIN ic_neighbor_hood b on a.NEIGHBOR_HOOD_ID = b.ID
@ -188,7 +188,7 @@
a.TOTAL_FLOOR_NUM as totalFloorNum,
a.TOTAL_UNIT_NUM as totalUnitNum,
b.NEIGHBOR_HOOD_NAME as neighbourHoodName,
b.NEIGHBOR_HOOD_NAME as neighborHoodName,
f.ORGANIZATION_NAME as agencyName,
g.GRID_NAME as gridName
from ic_building a
@ -212,7 +212,7 @@
a.TOTAL_FLOOR_NUM as totalFloorNum,
a.TOTAL_UNIT_NUM as totalUnitNum,
a.BUILDING_NAME as buildingType,
b.NEIGHBOR_HOOD_NAME as neighbourHoodName,
b.NEIGHBOR_HOOD_NAME as neighborHoodName,
c.ORGANIZATION_NAME as agencyName,
d.GRID_NAME as gridName
from ic_building a

19
epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcHouseDao.xml

@ -38,7 +38,7 @@
a.OWNER_PHONE as ownerPhone,
a.OWNER_ID_CARD as ownerIdCard,
b.BUILDING_NAME as buildingName,
c.NEIGHBOR_HOOD_NAME as neighbourHoodName,
c.NEIGHBOR_HOOD_NAME as neighborHoodName,
d.UNIT_NUM as unitName
from ic_house a
INNER JOIN ic_building b on a.BUILDING_ID = b.ID
@ -64,7 +64,7 @@
a.OWNER_PHONE as ownerPhone,
a.OWNER_ID_CARD as ownerIdCard,
b.BUILDING_NAME as buildingName,
c.NEIGHBOR_HOOD_NAME as neighbourHoodName,
c.NEIGHBOR_HOOD_NAME as neighborHoodName,
d.UNIT_NUM as unitName
from ic_house a
INNER JOIN ic_building b on a.BUILDING_ID = b.ID
@ -106,14 +106,14 @@
<select id="searchHouseByPage" resultType="map">
select
a.HOUSE_NAME as houseName,
c.NEIGHBOR_HOOD_NAME as neighbourHoodName,
c.NEIGHBOR_HOOD_NAME as neighborHoodName,
b.BUILDING_NAME as buildingName,
d.UNIT_NUM as unitNum,
a.DOOR_NAME as doorName,
a.HOUSE_TYPE as houseType,
if(a.RENT_FLAG=1,'是','否') as rentFlag,
a.OWNER_NAME as ownerName,
a.RENT_FLAG as rentFlag,
a.PURPOSE as purpose,
/*a.RENT_FLAG as rentFlag,
a.PURPOSE as purpose,*/
a.OWNER_PHONE as ownerPhone,
a.OWNER_ID_CARD as ownerIdCard,
@ -122,7 +122,8 @@
b.ID as buildingId,
a.BUILDING_UNIT_ID as unitNumKey,
a.HOUSE_TYPE as houseTypeKey,
a.PURPOSE as purposeKey
a.PURPOSE as purposeKey,
a.RENT_FLAG as rentFlagKey
from ic_house a
LEFT JOIN ic_building b on a.BUILDING_ID = b.ID and b.DEL_FLAG = '0'
LEFT JOIN ic_neighbor_hood c on a.NEIGHBOR_HOOD_ID = c.ID and c.DEL_FLAG = '0'
@ -155,7 +156,7 @@
a.OWNER_PHONE as ownerPhone,
a.OWNER_ID_CARD as ownerIdCard,
b.BUILDING_NAME as buildingName,
c.NEIGHBOR_HOOD_NAME as neighbourHoodName,
c.NEIGHBOR_HOOD_NAME as neighborHoodName,
d.UNIT_NUM as unitName
from ic_house a
INNER JOIN ic_building b on a.BUILDING_ID = b.ID and b.DEL_FLAG = '0'
@ -188,7 +189,7 @@
a.OWNER_PHONE as ownerPhone,
a.OWNER_ID_CARD as ownerIdCard,
b.BUILDING_NAME as buildingName,
c.NEIGHBOR_HOOD_NAME as neighbourHoodName,
c.NEIGHBOR_HOOD_NAME as neighborHoodName,
d.UNIT_NUM as unitName
from ic_house a
INNER JOIN ic_building b on a.BUILDING_ID = b.ID

17
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/HomeUserResultDTO.java

@ -0,0 +1,17 @@
package com.epmet.dto.result;
import lombok.Data;
import java.io.Serializable;
/**
* @Description
* @Author zhaoqifeng
* @Date 2021/11/1 10:47
*/
@Data
public class HomeUserResultDTO implements Serializable {
private static final long serialVersionUID = -8441112171986914418L;
private String userId;
private String name;
}

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

@ -39,11 +39,11 @@ import com.epmet.dto.form.*;
import com.epmet.dto.result.CustomerFormResultDTO;
import com.epmet.dto.result.FormGroupDTO;
import com.epmet.dto.result.FormItem;
import com.epmet.dto.result.HomeUserResultDTO;
import com.epmet.excel.IcResiUserExcel;
import com.epmet.feign.OperCustomizeOpenFeignClient;
import com.epmet.service.IcResiUserService;
import org.apache.commons.lang3.StringUtils;
import org.apache.poi.ss.usermodel.Name;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.jetbrains.annotations.NotNull;
import org.springframework.beans.factory.annotation.Autowired;
@ -149,14 +149,15 @@ public class IcResiUserController {
for (Map.Entry<String, List<ExcelExportEntity>> entry : sheetHeaderMap.entrySet()) {
String sheetName = entry.getKey();
List<ExcelExportEntity> headers = entry.getValue();
ExportParams exportParams = new ExportParams();
exportParams.setSheetName(sheetName);
exportParams.setAutoSize(true);
new ExcelExportService().createSheetForMap(workbook, exportParams, headers,new ArrayList<>());
System.out.println("headers:"+sheetName+JSON.toJSONString(headers));
ExportParams exportParams = new ExportParams(null,sheetName);
//exportParams.setAutoSize(true);
List<Map<String,String>> dataSet = new ArrayList<>();
HashMap<String, String> map = new HashMap<>();
map.put("1","2");
dataSet.add(map);
new ExcelExportService().createSheetForMap(workbook, exportParams, headers, dataSet);
}
List<? extends Name> allNames = workbook.getAllNames();
System.out.println("======"+allNames);
FileOutputStream fos = new FileOutputStream("//Users/liujianjun/Downloads/基础信息表/Dow.tt.xls");
workbook.write(fos);
@ -173,38 +174,38 @@ public class IcResiUserController {
Map<String,List<ExcelExportEntity>> everySheetHeaderMap = new LinkedHashMap<>();
List<ExcelExportEntity> firstSheetHeaderList = new ArrayList<>();
//Map<String, String> groupNameMap = groupList.stream().collect(Collectors.toMap(FormGroupDTO::getGroupId,FormGroupDTO::getLabel));
itemList.forEach(item->{
if (StringUtils.isBlank(item.getColumnName())){
return;
}
ExcelExportEntity header = new ExcelExportEntity(item.getLabel(),item.getColumnName().concat(String.valueOf(item.getColumnNum())),30);
header.setNeedMerge(true);
if (item.getChildGroup() == null){
System.out.println(item.getLabel());
ExcelExportEntity header = new ExcelExportEntity(item.getLabel(),item.getColumnName().concat(String.valueOf(item.getColumnNum())),30);
header.setNeedMerge(true);
firstSheetHeaderList.add(header);
return;
}
everySheetHeaderMap.putIfAbsent(resultForm.getData().getFormName(),firstSheetHeaderList);
//这些是动态的 formGroup
if (item.getChildGroup() != null){
//baseTableName单独的一个sheet
System.out.println("childGroup:"+item.getLabel());
if (BASE_TABLE_NAME.equals(item.getTableName())){
header = new ExcelExportEntity(item.getChildGroup().getLabel(),item.getChildGroup().getTableName());
header.setNeedMerge(true);
// header = new ExcelExportEntity(item.getChildGroup().getLabel(),item.getChildGroup().getTableName());
//header.setNeedMerge(true);
List<ExcelExportEntity> otherSheetHeaderList = new ArrayList<>();
List<ExcelExportEntity> secondHeaderList = new ArrayList<>();
//这里是设置除基础信息之外的sheet的表头
item.getChildGroup().getItemList().forEach(item2->{
if (!BASE_TABLE_NAME.equals(item2.getTableName())){
everySheetHeaderMap.putIfAbsent(item.getLabel(),otherSheetHeaderList);
}
ExcelExportEntity secondHeader = new ExcelExportEntity(item2.getLabel(),item2.getColumnName().concat(String.valueOf(item2.getColumnNum())));
secondHeader.setNeedMerge(true);
secondHeaderList.add(secondHeader);
if (!item2.getItemType().equals("radio") && com.baomidou.mybatisplus.core.toolkit.CollectionUtils.isNotEmpty(item2.getOptions())){
otherSheetHeaderList.add(secondHeader);
if (!"radio".equals(item2.getItemType()) && CollectionUtils.isNotEmpty(item2.getOptions())){
secondHeader.setNeedMerge(true);
List<ExcelExportEntity> thirdHeaderList = new ArrayList<>();
item2.getOptions().forEach(child->{
ExcelExportEntity thirdHeader = new ExcelExportEntity(child.getLabel());
@ -214,18 +215,16 @@ public class IcResiUserController {
}
});
header.setList(secondHeaderList);
otherSheetHeaderList.add(header);
//header.setList(secondHeaderList);
//otherSheetHeaderList.add(header);
}
}
});
//List<ExcelExportEntity> firstSheetHeaderList = new ArrayList<>();
groupList.forEach(item->{
/* if (!"兴趣爱好".equals(item.getLabel()) && !"宗教信仰".equals(item.getLabel())){
return;
}*/
if (!BASE_TABLE_NAME.equals(item.getTableName())){
System.out.println(item.getLabel()+"--"+item.getTableName());
if (!BASE_TABLE_NAME.equals(item.getTableName())){
return;
}
ExcelExportEntity header = new ExcelExportEntity(item.getLabel(),item.getTableName());
@ -278,6 +277,18 @@ public class IcResiUserController {
everySheetHeaderMap.putIfAbsent(item.getLabel(),firstSheetHeaderList);
}
/**
* @Description 根据房间号查人
* @Param formDTO
* @Return {@link Result<List<HomeUserResultDTO>>}
* @Author zhaoqifeng
* @Date 2021/11/1 11:04
*/
@PostMapping("getpeoplebyroom")
public Result<List<HomeUserResultDTO>> getPeopleByRoom(@RequestBody IcResiUserDTO formDTO) {
return new Result<List<HomeUserResultDTO>>().ok(icResiUserService.getPeopleByRoom(formDTO.getHomeId()));
}
@PostMapping("listresi")
public Result<PageData<Map<String,Object>>> queryListResi1(@LoginUser TokenDto tokenDto, @RequestBody IcResiUserPageFormDTO pageFormDTO){
//pageFormDTO.setCustomerId("45687aa479955f9d06204d415238f7cc");

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

@ -23,6 +23,7 @@ import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.dto.IcResiUserDTO;
import com.epmet.dto.form.IcResiDetailFormDTO;
import com.epmet.dto.form.IcResiUserFormDTO;
import com.epmet.dto.result.HomeUserResultDTO;
import com.epmet.dto.form.IcResiUserPageFormDTO;
import com.epmet.dto.form.ListForExportFormDTO;
import com.epmet.entity.IcResiUserEntity;
@ -110,6 +111,15 @@ public interface IcResiUserService extends BaseService<IcResiUserEntity> {
**/
void edit(TokenDto tokenDto, List<IcResiUserFormDTO> formDTO);
/**
* @Description 获取房间内人员
* @Param homeId
* @Return {@link List< HomeUserResultDTO>}
* @Author zhaoqifeng
* @Date 2021/11/1 10:52
*/
List<HomeUserResultDTO> getPeopleByRoom(String homeId);
PageData<Map<String,Object>> pageResiMap(IcResiUserPageFormDTO formDTO);
/**
* 编辑页面显示居民信息详情

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

@ -18,6 +18,7 @@
package com.epmet.service.impl;
import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
@ -37,6 +38,7 @@ import com.epmet.dto.CustomerAgencyDTO;
import com.epmet.dto.IcResiUserDTO;
import com.epmet.dto.form.*;
import com.epmet.dto.result.AllGridsByUserIdResultDTO;
import com.epmet.dto.result.HomeUserResultDTO;
import com.epmet.dto.result.HouseInfoDTO;
import com.epmet.dto.result.IcFormResColumnDTO;
import com.epmet.entity.IcResiUserEntity;
@ -47,13 +49,13 @@ import com.epmet.service.IcResiUserService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import java.util.*;
import java.util.function.Function;
@ -235,9 +237,39 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
}
/**
* @param homeId
* @Description 获取房间内人员
* @Param homeId
* @Return {@link List< HomeUserResultDTO >}
* @Author zhaoqifeng
* @Date 2021/11/1 10:52
*/
@Override
public List<HomeUserResultDTO> getPeopleByRoom(String homeId) {
if(StringUtils.isBlank(homeId)) {
return Collections.emptyList();
}
LambdaQueryWrapper<IcResiUserEntity> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(IcResiUserEntity::getHomeId, homeId);
wrapper.orderByAsc(IcResiUserEntity::getYhzgx);
List<IcResiUserEntity> list = baseDao.selectList(wrapper);
if (CollectionUtils.isEmpty(list)) {
return Collections.emptyList();
}
return list.stream().map(item -> {
HomeUserResultDTO dto = new HomeUserResultDTO();
dto.setUserId(item.getId());
dto.setName(item.getName());
return dto;
}).collect(Collectors.toList());
}
@Override
public PageData<Map<String, Object>> pageResiMap(IcResiUserPageFormDTO formDTO) {
// 查询列表展示项,如果没有,直接返回
CustomerFormQueryDTO queryDTO1=new CustomerFormQueryDTO();

Loading…
Cancel
Save