|
|
@ -36,6 +36,8 @@ public class ImportHouseInfoListener extends AnalysisEventListener<HouseInfoMode |
|
|
|
|
|
|
|
List<Integer> nums = new ArrayList<>(); |
|
|
|
Integer num = NumConstant.ZERO; |
|
|
|
List<HouseErrorInfoModel> errorInfos = new ArrayList<>(); |
|
|
|
HouseInfoModel info = null; |
|
|
|
|
|
|
|
List<ImportGeneralDTO> needDisposeList = new ArrayList<>(); |
|
|
|
List<ImportGeneralDTO> needInsertList = new ArrayList<>(); |
|
|
@ -73,6 +75,7 @@ public class ImportHouseInfoListener extends AnalysisEventListener<HouseInfoMode |
|
|
|
if (null == data){ |
|
|
|
return; |
|
|
|
} |
|
|
|
info = data; |
|
|
|
num = num + NumConstant.ONE; |
|
|
|
ImportGeneralDTO dto = ConvertUtils.sourceToTarget(data, ImportGeneralDTO.class); |
|
|
|
dto.setNum(num); |
|
|
@ -81,6 +84,7 @@ public class ImportHouseInfoListener extends AnalysisEventListener<HouseInfoMode |
|
|
|
if (StringUtils.isNotBlank(dto.getHouseType()) ){ |
|
|
|
if( !"楼房".equals(dto.getHouseType()) && !dto.getHouseType().equals("平房") && !dto.getHouseType().equals("别墅") ){ |
|
|
|
nums.add(num); |
|
|
|
disposeErrorMsg(info,""); |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
@ -94,11 +98,13 @@ public class ImportHouseInfoListener extends AnalysisEventListener<HouseInfoMode |
|
|
|
!dto.getPurpose().equals("商住混用") && |
|
|
|
!dto.getPurpose().equals("其他")) ){ |
|
|
|
nums.add(num); |
|
|
|
disposeErrorMsg(info,""); |
|
|
|
return; |
|
|
|
} |
|
|
|
dto.setPurpose(HousePurposeEnums.getKeyByValue(dto.getPurpose())); |
|
|
|
if (StringUtils.isNotBlank(dto.getRentFlagString()) && (!dto.getRentFlagString().equals("是") && !dto.getRentFlagString().equals("否"))){ |
|
|
|
nums.add(num); |
|
|
|
disposeErrorMsg(info,""); |
|
|
|
return; |
|
|
|
} |
|
|
|
dto.setRentFlag(HouseRentFlagEnums.getCodeByName(dto.getRentFlagString())); |
|
|
@ -118,6 +124,12 @@ public class ImportHouseInfoListener extends AnalysisEventListener<HouseInfoMode |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
public void disposeErrorMsg(HouseInfoModel data,String msg){ |
|
|
|
HouseErrorInfoModel err = ConvertUtils.sourceToTarget(data, HouseErrorInfoModel.class); |
|
|
|
err.setErrorMsg(msg); |
|
|
|
errorInfos.add(err); |
|
|
|
} |
|
|
|
|
|
|
|
public void finalDispose(){ |
|
|
|
if (!CollectionUtils.isEmpty(needDisposeList)){ |
|
|
|
List<ImportGeneralDTO> importInfo = neighborHoodService.getImportInfo(formDTO, needDisposeList); |
|
|
@ -132,10 +144,8 @@ public class ImportHouseInfoListener extends AnalysisEventListener<HouseInfoMode |
|
|
|
for (ImportGeneralDTO r : needInsertList) { |
|
|
|
if (k.equals(r.getBuildingUnitId()+"_"+r.getDoorName())){ |
|
|
|
// 集合里重复的
|
|
|
|
if (r.getExistStatus()){ |
|
|
|
|
|
|
|
} |
|
|
|
nums.add(r.getNum()); |
|
|
|
disposeErrorMsg(info,""); |
|
|
|
r.setExistStatus(true); |
|
|
|
} |
|
|
|
} |
|
|
@ -149,6 +159,7 @@ public class ImportHouseInfoListener extends AnalysisEventListener<HouseInfoMode |
|
|
|
if ((n.getBuildingUnitId()+"_"+n.getDoorName()).equals(e)){ |
|
|
|
// 库里存在的
|
|
|
|
nums.add(n.getNum()); |
|
|
|
disposeErrorMsg(info,""); |
|
|
|
n.setExistStatus(true); |
|
|
|
} |
|
|
|
} |
|
|
@ -185,6 +196,7 @@ public class ImportHouseInfoListener extends AnalysisEventListener<HouseInfoMode |
|
|
|
// 排除不是本楼的
|
|
|
|
if (!dto.getBuildingName().equals(buildingGeneralDTO.getBuildingName())){ |
|
|
|
nums.add(num); |
|
|
|
disposeErrorMsg(info,""); |
|
|
|
}else { |
|
|
|
GridInfoCache gridInfo = CustomerOrgRedis.getGridInfo(buildingGeneralDTO.getGridId()); |
|
|
|
if (null == gridInfo){ |
|
|
@ -195,6 +207,7 @@ public class ImportHouseInfoListener extends AnalysisEventListener<HouseInfoMode |
|
|
|
|| (!gridInfo.getGridName().equals(dto.getGridName())&&buildingGeneralDTO.getNeighborHoodName().equals(dto.getNeighborHoodName()) && buildingGeneralDTO.getBuildingName().equals(dto.getBuildingName())) |
|
|
|
|| (!gridInfo.getAgencyName().equals(dto.getAgencyName())&&gridInfo.getGridName().equals(dto.getGridName())&&buildingGeneralDTO.getNeighborHoodName().equals(dto.getNeighborHoodName()) && buildingGeneralDTO.getBuildingName().equals(dto.getBuildingName()))){ |
|
|
|
nums.add(num); |
|
|
|
disposeErrorMsg(info,""); |
|
|
|
return; |
|
|
|
} |
|
|
|
dto.setBuildingId(formDTO.getOrgId()); |
|
|
@ -235,6 +248,7 @@ public class ImportHouseInfoListener extends AnalysisEventListener<HouseInfoMode |
|
|
|
//排除不是本小区的
|
|
|
|
if (!dto.getNeighborHoodName().equals(neighborHoodGeneralDTO.getNeighborHoodName())){ |
|
|
|
nums.add(num); |
|
|
|
disposeErrorMsg(info,""); |
|
|
|
}else { |
|
|
|
GridInfoCache gridInfo = CustomerOrgRedis.getGridInfo(neighborHoodGeneralDTO.getGridId()); |
|
|
|
if (null == gridInfo){ |
|
|
@ -244,6 +258,7 @@ public class ImportHouseInfoListener extends AnalysisEventListener<HouseInfoMode |
|
|
|
if ((!gridInfo.getGridName().equals(dto.getGridName()) && neighborHoodGeneralDTO.getNeighborHoodName().equals(dto.getNeighborHoodName())) || |
|
|
|
(!gridInfo.getAgencyName().equals(dto.getAgencyName()) && gridInfo.getGridName().equals(dto.getGridName()) && neighborHoodGeneralDTO.getNeighborHoodName().equals(dto.getNeighborHoodName()))){ |
|
|
|
nums.add(num); |
|
|
|
disposeErrorMsg(info,""); |
|
|
|
return; |
|
|
|
} |
|
|
|
dto.setNeighborHoodId(formDTO.getOrgId()); |
|
|
@ -275,6 +290,7 @@ public class ImportHouseInfoListener extends AnalysisEventListener<HouseInfoMode |
|
|
|
//排除不是本网格的 gridName不一样排除,gridName一样但是agencyName不一样也得排除
|
|
|
|
if (dto.getGridName().compareTo(gridName) != 0 || (!dto.getAgencyName().equals(gridInfo.getAgencyName()) && dto.getGridName().equals(gridName))){ |
|
|
|
nums.add(num); |
|
|
|
disposeErrorMsg(info,""); |
|
|
|
}else { |
|
|
|
//
|
|
|
|
dto.setGridId(formDTO.getOrgId()); |
|
|
@ -301,18 +317,21 @@ public class ImportHouseInfoListener extends AnalysisEventListener<HouseInfoMode |
|
|
|
//排除不是本组织的
|
|
|
|
if (!dto.getAgencyName().equals(agencyName)){ |
|
|
|
nums.add(num); |
|
|
|
disposeErrorMsg(info,""); |
|
|
|
}else { |
|
|
|
// 根据组织查询出所有网格,甩出不是本组织下的网格
|
|
|
|
gridInfos = null == gridInfos ? getGridInfos(formDTO.getOrgId()) : gridInfos; |
|
|
|
if (null == gridInfos){ |
|
|
|
// 组织下确实不存在网格
|
|
|
|
nums.add(num); |
|
|
|
disposeErrorMsg(info,""); |
|
|
|
return; |
|
|
|
} |
|
|
|
// 根据网格名对比,没有找到的就把行号加入到未执行成功队列中
|
|
|
|
Object cacheGridName = icHouseRedis.getTemporaryCacheGrid(formDTO.getCustomerId(), formDTO.getUserId(), dto.getGridName()); |
|
|
|
if (null == cacheGridName){ |
|
|
|
nums.add(num); |
|
|
|
disposeErrorMsg(info,""); |
|
|
|
return; |
|
|
|
} |
|
|
|
dto.setGridId(cacheGridName.toString()); |
|
|
@ -393,7 +412,7 @@ public class ImportHouseInfoListener extends AnalysisEventListener<HouseInfoMode |
|
|
|
|
|
|
|
/** |
|
|
|
* @Description 获取小区下的楼栋 |
|
|
|
* @param neighborHoodId |
|
|
|
* @param orgId |
|
|
|
* @author zxc |
|
|
|
* @date 2022/2/14 1:32 下午 |
|
|
|
*/ |
|
|
|