Browse Source

Merge remote-tracking branch 'origin/dev'

master
zxc 4 years ago
parent
commit
cc5b771dd7
  1. 2
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/HouseController.java
  2. 4
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcBuildingDao.java
  3. 12
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/model/ImportBuildingInfoListener.java
  4. 25
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/model/ImportHouseInfoListener.java
  5. 4
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/model/ImportNeighborHoodInfoListener.java
  6. 2
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/BuildingServiceImpl.java
  7. 2
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcNeighborHoodServiceImpl.java
  8. 27
      epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcBuildingDao.xml

2
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/HouseController.java

@ -289,7 +289,7 @@ public class HouseController implements ResultDataResolver {
s = s + "第"+nums.stream().map(String::valueOf).collect(Collectors.joining("、"))+"条导入失败";
return new Result<>().error(9999,String.format(s,num,num - nums.size()));
}
return new Result<>().ok(String.format(s,num,num));
return new Result<>().error(9999,String.format(s,num,num));
}
}

4
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcBuildingDao.java

@ -128,7 +128,7 @@ public interface IcBuildingDao extends BaseDao<IcBuildingEntity> {
* @author zxc
* @date 2022/2/14 1:25 下午
*/
List<ImportGeneralDTO> selectAllBuildingByNeighborHoodId(@Param("neighborHoodId")String neighborHoodId);
List<ImportGeneralDTO> selectAllBuildingByNeighborHoodId(@Param("orgId")String orgId);
/**
* @Description 根据楼栋ID查询楼栋单元
@ -136,7 +136,7 @@ public interface IcBuildingDao extends BaseDao<IcBuildingEntity> {
* @author zxc
* @date 2022/2/14 1:58 下午
*/
List<ImportGeneralDTO> selectAllBuildingUnitByBuildingId(@Param("building")String building);
List<ImportGeneralDTO> selectAllBuildingUnitByBuildingId(@Param("orgId")String orgId);
/**
* @Description 根据ID查询小区

12
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/model/ImportBuildingInfoListener.java

@ -103,9 +103,7 @@ public class ImportBuildingInfoListener extends AnalysisEventListener<BuildingIn
if (k.equals(r.getAgencyName() + "_" + r.getGridName() + "_" +
r.getNeighborHoodName() + "_" + r.getBuildingName())){
// 集合里重复的
if (r.getExistStatus()){
nums.add(r.getNum());
}
nums.add(r.getNum());
r.setExistStatus(true);
}
}
@ -153,7 +151,7 @@ public class ImportBuildingInfoListener extends AnalysisEventListener<BuildingIn
}
if (StringUtils.isNotBlank(dto.getNeighborHoodId())){
//小区ID不为空赋值楼栋ID
buildingInfos = null == buildingInfos ? getBuildingInfos(dto.getNeighborHoodId()) : buildingInfos;
buildingInfos = null == buildingInfos ? getBuildingInfos(dto.getAgencyId()) : buildingInfos;
Object cacheBuilding = icHouseRedis.getTemporaryCacheBuilding(formDTO.getCustomerId(), formDTO.getUserId(), dto.getNeighborHoodId() + "_" + dto.getBuildingName());
dto.setBuildingId(null == cacheBuilding ? "" : cacheBuilding.toString());
if (StringUtils.isNotBlank(dto.getBuildingId())){
@ -299,12 +297,12 @@ public class ImportBuildingInfoListener extends AnalysisEventListener<BuildingIn
/**
* @Description 获取小区下的楼栋
* @param neighborHoodId
* @param orgId
* @author zxc
* @date 2022/2/14 1:32 下午
*/
public Map<String,Object> getBuildingInfos(String neighborHoodId){
buildingInfoDTOs = icBuildingDao.selectAllBuildingByNeighborHoodId(neighborHoodId);
public Map<String,Object> getBuildingInfos(String orgId){
buildingInfoDTOs = icBuildingDao.selectAllBuildingByNeighborHoodId(orgId);
buildingInfos = buildingInfoDTOs.stream().collect(Collectors.toMap(n -> n.getNeighborHoodId() + "_" + n.getBuildingName(), n -> n.getBuildingId()));
icHouseRedis.setTemporaryCacheBuilding(formDTO.getCustomerId(), buildingInfos, formDTO.getUserId());
return buildingInfos;

25
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/model/ImportHouseInfoListener.java

@ -133,23 +133,22 @@ public class ImportHouseInfoListener extends AnalysisEventListener<HouseInfoMode
if (k.equals(r.getBuildingUnitId()+"_"+r.getDoorName())){
// 集合里重复的
if (r.getExistStatus()){
nums.add(r.getNum());
}
nums.add(r.getNum());
r.setExistStatus(true);
}
}
}
});
// 根据单元ID_doorName查询已存在的
List<String> ids = needInsertList.stream().map(m -> m.getBuildingUnitId() + "_" + m.getDoorName()).distinct().collect(Collectors.toList());
List<String> ids = needInsertList.stream().filter(n -> StringUtils.isNotBlank(n.getBuildingUnitId())).map(m -> m.getBuildingUnitId() + "_" + m.getDoorName()).distinct().collect(Collectors.toList());
List<String> existHouses = icBuildingDao.selectExistHouse(ids);
existHouses.forEach(e -> {
for (ImportGeneralDTO n : needInsertList) {
if ((n.getBuildingUnitId()+"_"+n.getDoorName()).equals(e)){
// 库里存在的
if (n.getExistStatus()){
nums.add(n.getNum());
}
nums.add(n.getNum());
n.setExistStatus(true);
}
}
@ -213,7 +212,7 @@ public class ImportHouseInfoListener extends AnalysisEventListener<HouseInfoMode
dto.setTotalFloorNum(buildingGeneralDTO.getTotalFloorNum());
dto.setTotalUnitNum(buildingGeneralDTO.getTotalUnitNum());
// 补充单元ID
buildingUnitInfos = null == buildingUnitInfos ? getBuildingUnitInfos(dto.getBuildingId()) : buildingUnitInfos;
buildingUnitInfos = null == buildingUnitInfos ? getBuildingUnitInfos(dto.getAgencyId()) : buildingUnitInfos;
Object cacheBuildingUnit = icHouseRedis.getTemporaryCacheBuildingUnit(formDTO.getCustomerId(), formDTO.getUserId(), dto.getBuildingId() + "_" + dto.getBuildingUnit());
dto.setBuildingUnitId(null == cacheBuildingUnit ? "" : cacheBuildingUnit.toString());
if (StringUtils.isNotBlank(dto.getBuildingUnitId())){
@ -349,7 +348,7 @@ public class ImportHouseInfoListener extends AnalysisEventListener<HouseInfoMode
dto.setBuildingId(null == cacheBuilding ? "" : cacheBuilding.toString());
if (StringUtils.isNotBlank(dto.getBuildingId())){
// 楼栋ID不为空赋值单元ID
buildingUnitInfos = null == buildingUnitInfos ? getBuildingUnitInfos(dto.getBuildingId()) : buildingUnitInfos;
buildingUnitInfos = null == buildingUnitInfos ? getBuildingUnitInfos(dto.getAgencyId()) : buildingUnitInfos;
Object cacheBuildingUnit = icHouseRedis.getTemporaryCacheBuildingUnit(formDTO.getCustomerId(), formDTO.getUserId(), dto.getBuildingId() + "_" + dto.getBuildingUnit());
dto.setBuildingUnitId(null == cacheBuildingUnit ? "" : cacheBuildingUnit.toString());
if (StringUtils.isNotBlank(dto.getBuildingUnitId())){
@ -398,21 +397,21 @@ public class ImportHouseInfoListener extends AnalysisEventListener<HouseInfoMode
* @author zxc
* @date 2022/2/14 1:32 下午
*/
public Map<String,Object> getBuildingInfos(String neighborHoodId){
buildingInfoDTOs = icBuildingDao.selectAllBuildingByNeighborHoodId(neighborHoodId);
public Map<String,Object> getBuildingInfos(String orgId){
buildingInfoDTOs = icBuildingDao.selectAllBuildingByNeighborHoodId(orgId);
buildingInfos = buildingInfoDTOs.stream().collect(Collectors.toMap(n -> n.getNeighborHoodId() + "_" + n.getBuildingName(), n -> n.getBuildingId()));
icHouseRedis.setTemporaryCacheBuilding(formDTO.getCustomerId(), buildingInfos, formDTO.getUserId());
return buildingInfos;
}
/**
* @Description 获取楼栋下的单元
* @param buildingId
* @Description 获取组织下的单元
* @param orgId
* @author zxc
* @date 2022/2/14 2:04 下午
*/
public Map<String,Object> getBuildingUnitInfos(String buildingId){
buildingUnitInfoDTOs = icBuildingDao.selectAllBuildingUnitByBuildingId(buildingId);
public Map<String,Object> getBuildingUnitInfos(String orgId){
buildingUnitInfoDTOs = icBuildingDao.selectAllBuildingUnitByBuildingId(orgId);
if (!CollectionUtils.isEmpty(buildingUnitInfoDTOs)){
buildingUnitInfos = buildingUnitInfoDTOs.stream().collect(Collectors.toMap(n -> n.getBuildingId() + "_" + n.getBuildingUnit(), n -> n.getBuildingUnitId()));
icHouseRedis.setTemporaryCacheBuildingUnit(formDTO.getCustomerId(), buildingUnitInfos, formDTO.getUserId());

4
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/model/ImportNeighborHoodInfoListener.java

@ -96,9 +96,7 @@ public class ImportNeighborHoodInfoListener extends AnalysisEventListener<Neighb
for (ImportGeneralDTO r : needDisposeList) {
if (k.equals(r.getAgencyName() + "_" + r.getGridName() + "_" + r.getNeighborHoodName())){
// 集合里重复的
if (r.getExistStatus()){
nums.add(r.getNum());
}
nums.add(r.getNum());
r.setExistStatus(true);
}
}

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

@ -429,7 +429,7 @@ public class BuildingServiceImpl implements BuildingService {
s = s + "第"+nums.stream().map(String::valueOf).collect(Collectors.joining("、"))+"条导入失败";
return new Result<>().error(9999,String.format(s,num,num - nums.size()));
}
return new Result<>().ok(String.format(s,num,num));
return new Result<>().error(9999,String.format(s,num,num));
}
private List<IcBuildingExcel> searchAllBuilding(ListIcNeighborHoodFormDTO formDTO) {

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

@ -419,7 +419,7 @@ public class IcNeighborHoodServiceImpl extends BaseServiceImpl<IcNeighborHoodDao
s = s + "第"+nums.stream().map(String::valueOf).collect(Collectors.joining("、"))+"条导入失败";
return new Result<>().error(9999,String.format(s,num,num - nums.size()));
}
return new Result<>().ok(String.format(s,num,num));
return new Result<>().error(9999,String.format(s,num,num));
}
/**

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

@ -264,23 +264,26 @@
<!-- 根据小区ID查询楼栋 -->
<select id="selectAllBuildingByNeighborHoodId" resultType="com.epmet.dto.ImportGeneralDTO">
SELECT
ID AS buildingId,
NEIGHBOR_HOOD_ID,
BUILDING_NAME
FROM ic_building
WHERE DEL_FLAG = '0'
AND NEIGHBOR_HOOD_ID = #{neighborHoodId}
b.ID AS buildingId,
b.NEIGHBOR_HOOD_ID,
b.BUILDING_NAME
FROM ic_building b
INNER JOIN ic_neighbor_hood h ON (h.ID = b.NEIGHBOR_HOOD_ID AND h.DEL_FLAG = '0')
WHERE b.DEL_FLAG = '0'
AND h.AGENCY_ID = #{orgId}
</select>
<!-- 根据楼栋ID查询楼栋单元 -->
<select id="selectAllBuildingUnitByBuildingId" resultType="com.epmet.dto.ImportGeneralDTO">
SELECT
ID AS buildingUnitId,
UNIT_NUM AS buildingUnit,
BUILDING_ID
FROM ic_building_unit
WHERE DEL_FLAG = '0'
AND BUILDING_ID = #{building}
u.ID AS buildingUnitId,
u.UNIT_NUM AS buildingUnit,
u.BUILDING_ID,b.NEIGHBOR_HOOD_ID
FROM ic_building_unit u
INNER JOIN ic_building b ON (b.ID = u.BUILDING_ID AND b.DEL_FLAG = '0')
INNER JOIN ic_neighbor_hood h ON (h.ID = b.NEIGHBOR_HOOD_ID AND h.DEL_FLAG = '0')
WHERE u.DEL_FLAG = '0'
AND h.AGENCY_ID = #{orgId}
</select>
<!-- 根据ID查询小区 -->

Loading…
Cancel
Save