Browse Source

errInfos

dev
zxc 4 years ago
parent
commit
3d13549a8a
  1. 12
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/constant/ImportErrorMsgConstants.java
  2. 23
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/model/BuildingErrorInfoModel.java
  3. 30
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/model/HouseErrorInfoModel.java
  4. 19
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/model/ImportBuildingInfoListener.java
  5. 27
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/model/ImportHouseInfoListener.java
  6. 17
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/model/ImportNeighborHoodInfoListener.java
  7. 20
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/model/NeighborHoodErrorInfoModel.java

12
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/constant/ImportErrorMsgConstants.java

@ -0,0 +1,12 @@
package com.epmet.constant;
/**
* @Author zxc
* @DateTime 2022/2/21 4:25 下午
* @DESC
*/
public interface ImportErrorMsgConstants {
}

23
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/model/BuildingErrorInfoModel.java

@ -0,0 +1,23 @@
package com.epmet.model;
import com.alibaba.excel.annotation.ExcelProperty;
import lombok.Data;
/**
* @Author zxc
* @DateTime 2022/2/15 10:07 上午
* @DESC
*/
@Data
public class BuildingErrorInfoModel {
@ExcelProperty(value = "小区名称")
private String neighborHoodName;
@ExcelProperty(value = "楼栋名称")
private String buildingName;
@ExcelProperty(value = "错误信息")
private String errorMsg;
}

30
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/model/HouseErrorInfoModel.java

@ -0,0 +1,30 @@
package com.epmet.model;
import com.alibaba.excel.annotation.ExcelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
/**
* @Author zxc
* @DateTime 2022/2/13 1:26 下午
* @DESC
*/
@Data
public class HouseErrorInfoModel {
@ExcelProperty(value = "所属小区")
private String neighborHoodName;
@ExcelProperty(value = "所属楼栋")
private String buildingName;
@ExcelProperty(value = "单元号")
private Integer buildingUnit;
@ExcelProperty(value = "门牌号")
private String doorName;
@ExcelProperty(value = "错误信息")
private String errorMsg;
}

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

@ -34,6 +34,8 @@ public class ImportBuildingInfoListener extends AnalysisEventListener<BuildingIn
List<Integer> nums = new ArrayList<>();
Integer num = NumConstant.ZERO;
List<BuildingErrorInfoModel> errorInfos = new ArrayList<>();
BuildingInfoModel info = null;
List<ImportGeneralDTO> needDisposeList = new ArrayList<>();
List<ImportGeneralDTO> needInsertList = new ArrayList<>();
@ -67,6 +69,7 @@ public class ImportBuildingInfoListener extends AnalysisEventListener<BuildingIn
if (null == data){
return;
}
info = data;
num = num + NumConstant.ONE;
ImportGeneralDTO dto = ConvertUtils.sourceToTarget(data, ImportGeneralDTO.class);
dto.setNum(num);
@ -74,6 +77,7 @@ public class ImportBuildingInfoListener extends AnalysisEventListener<BuildingIn
// 应产品要求添加
if (StringUtils.isNotBlank(dto.getType()) && (!dto.getType().equals("商品房") && !dto.getType().equals("自建房")) && !dto.getType().equals("别墅")){
nums.add(num);
disposeErrorMsg(info,"");
return;
}
dto.setType(BuildingTypeEnums.getKeyByValue(dto.getType()));
@ -104,6 +108,7 @@ public class ImportBuildingInfoListener extends AnalysisEventListener<BuildingIn
r.getNeighborHoodName() + "_" + r.getBuildingName())){
// 集合里重复的
nums.add(r.getNum());
disposeErrorMsg(info,"");
r.setExistStatus(true);
}
}
@ -118,6 +123,7 @@ public class ImportBuildingInfoListener extends AnalysisEventListener<BuildingIn
if (!CollectionUtils.isEmpty(existList)){
existList.forEach(e -> {
nums.add(e.getNum());
disposeErrorMsg(info,"");
});
}
}
@ -157,6 +163,7 @@ public class ImportBuildingInfoListener extends AnalysisEventListener<BuildingIn
if (StringUtils.isNotBlank(dto.getBuildingId())){
// 说明数据库已存在此楼栋,不需添加
nums.add(num);
disposeErrorMsg(info,"");
}else {
needDisposeList.add(dto);
}
@ -176,6 +183,7 @@ public class ImportBuildingInfoListener extends AnalysisEventListener<BuildingIn
//排除不是本小区的
if (!dto.getNeighborHoodName().equals(neighborHoodGeneralDTO.getNeighborHoodName())){
nums.add(num);
disposeErrorMsg(info,"");
}else {
GridInfoCache gridInfo = CustomerOrgRedis.getGridInfo(neighborHoodGeneralDTO.getGridId());
if (null == gridInfo){
@ -185,6 +193,7 @@ public class ImportBuildingInfoListener extends AnalysisEventListener<BuildingIn
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());
@ -216,6 +225,7 @@ public class ImportBuildingInfoListener extends AnalysisEventListener<BuildingIn
//排除不是本网格的 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());
@ -242,18 +252,21 @@ public class ImportBuildingInfoListener extends AnalysisEventListener<BuildingIn
//排除不是本组织的
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());
@ -308,6 +321,12 @@ public class ImportBuildingInfoListener extends AnalysisEventListener<BuildingIn
return buildingInfos;
}
public void disposeErrorMsg(BuildingInfoModel data,String msg){
BuildingErrorInfoModel err = ConvertUtils.sourceToTarget(data, BuildingErrorInfoModel.class);
err.setErrorMsg(msg);
errorInfos.add(err);
}
@Override
public void doAfterAllAnalysed(AnalysisContext context) {
finalDispose();

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

@ -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 下午
*/

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

@ -37,6 +37,8 @@ public class ImportNeighborHoodInfoListener extends AnalysisEventListener<Neighb
List<Integer> nums = new ArrayList<>();
Integer num = NumConstant.ZERO;
List<NeighborHoodErrorInfoModel> errorInfos = new ArrayList<>();
NeighborHoodInfoModel info = null;
List<ImportGeneralDTO> needDisposeList = new ArrayList<>();
List<ImportGeneralDTO> needInsertList = new ArrayList<>();
@ -70,9 +72,11 @@ public class ImportNeighborHoodInfoListener extends AnalysisEventListener<Neighb
if (null == data){
return;
}
info = data;
num = num + NumConstant.ONE;
ImportGeneralDTO dto = ConvertUtils.sourceToTarget(data, ImportGeneralDTO.class);
dto.setNum(num);
disposeErrorMsg(info,"");
dto.setCustomerId(formDTO.getCustomerId());
if (formDTO.getOrgType().equals(CustomerGridConstant.GRID)){
disposeGridNeighborHood(dto);
@ -97,6 +101,7 @@ public class ImportNeighborHoodInfoListener extends AnalysisEventListener<Neighb
if (k.equals(r.getAgencyName() + "_" + r.getGridName() + "_" + r.getNeighborHoodName())){
// 集合里重复的
nums.add(r.getNum());
disposeErrorMsg(info,"");
r.setExistStatus(true);
}
}
@ -111,6 +116,7 @@ public class ImportNeighborHoodInfoListener extends AnalysisEventListener<Neighb
if (!CollectionUtils.isEmpty(existList)){
existList.forEach(e -> {
nums.add(e.getNum());
disposeErrorMsg(info,"");
});
}
List<ImportGeneralDTO> notExistList = groupByBuildingExistStatus.get(false);
@ -172,6 +178,7 @@ public class ImportNeighborHoodInfoListener extends AnalysisEventListener<Neighb
//排除不是本网格的 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());
@ -197,18 +204,21 @@ public class ImportNeighborHoodInfoListener extends AnalysisEventListener<Neighb
//排除不是本组织的
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());
@ -237,6 +247,7 @@ public class ImportNeighborHoodInfoListener extends AnalysisEventListener<Neighb
if (StringUtils.isNotBlank(dto.getNeighborHoodId())){
// 小区已存在
nums.add(dto.getNum());
disposeErrorMsg(info,"");
}else {
needDisposeList.add(dto);
}
@ -268,6 +279,12 @@ public class ImportNeighborHoodInfoListener extends AnalysisEventListener<Neighb
return neighborHoodInfos;
}
public void disposeErrorMsg(NeighborHoodInfoModel data,String msg){
NeighborHoodErrorInfoModel err = ConvertUtils.sourceToTarget(data, NeighborHoodErrorInfoModel.class);
err.setErrorMsg(msg);
errorInfos.add(err);
}
@Override
public void doAfterAllAnalysed(AnalysisContext context) {
finalDispose();

20
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/model/NeighborHoodErrorInfoModel.java

@ -0,0 +1,20 @@
package com.epmet.model;
import com.alibaba.excel.annotation.ExcelProperty;
import lombok.Data;
/**
* @Author zxc
* @DateTime 2022/2/15 2:15 下午
* @DESC
*/
@Data
public class NeighborHoodErrorInfoModel {
@ExcelProperty(value = "小区名称")
private String neighborHoodName;
@ExcelProperty(value = "错误信息")
private String errorMsg;
}
Loading…
Cancel
Save