|
|
@ -111,6 +111,10 @@ public class IcResiUserImportServiceImpl implements IcResiUserImportService, Res |
|
|
|
* 身份证号列序号 |
|
|
|
*/ |
|
|
|
public static final Integer ID_CARD_COLUMN_NO = 8; |
|
|
|
/** |
|
|
|
* 手机号列序号 |
|
|
|
*/ |
|
|
|
public static final Integer MOBILE_COLUMN_NO = 7; |
|
|
|
/** |
|
|
|
* 姓名列序号 |
|
|
|
*/ |
|
|
@ -235,6 +239,9 @@ public class IcResiUserImportServiceImpl implements IcResiUserImportService, Res |
|
|
|
@Excel(name = "姓名", width = 25) |
|
|
|
private String name; |
|
|
|
|
|
|
|
@Excel(name = "手机号", width = 20) |
|
|
|
private String mobile; |
|
|
|
|
|
|
|
@Excel(name = "错误信息", width = 40) |
|
|
|
private String errorInfo; |
|
|
|
} |
|
|
@ -286,6 +293,7 @@ public class IcResiUserImportServiceImpl implements IcResiUserImportService, Res |
|
|
|
ErrorRow errorRow = new ErrorRow(); |
|
|
|
errorRow.setName("*"); |
|
|
|
errorRow.setIdCard("*"); |
|
|
|
errorRow.setMobile("*"); |
|
|
|
errorRows.get().get(sheet.getTableName()).add(errorRow); |
|
|
|
} |
|
|
|
} |
|
|
@ -393,7 +401,7 @@ public class IcResiUserImportServiceImpl implements IcResiUserImportService, Res |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
private void importIcResiBaseInfoFromExcel(List<FormItemResult> formItemList, String excelPathName, IcResiUserTableEnum sheetTableEnum, String currUserAgencyId, String currUserAgencyPids, String currentUserId, |
|
|
|
String customerId) { |
|
|
|
String customerId) { |
|
|
|
|
|
|
|
IcResiImportDynamicExcelListener readListener = new IcResiImportDynamicExcelListener(this, customerId, currentUserId, currUserAgencyId, currUserAgencyPids, |
|
|
|
true, formItemList, sheetTableEnum); |
|
|
@ -448,8 +456,8 @@ public class IcResiUserImportServiceImpl implements IcResiUserImportService, Res |
|
|
|
* @param checkBoxOptionColumnIdxAndLabel 复选框的列号&label中文 |
|
|
|
*/ |
|
|
|
public void persistIcResiBaseInfo(Map<String, ColumnWrapper> itemIdAndColumnWrapper, List<Map<Integer, String>> dataRows, |
|
|
|
String currUserAgencyId, Map<Integer, String> checkBoxOptionColumnIdxAndLabel, |
|
|
|
String currUserAgencyPids, String currentUserId, String tableName) { |
|
|
|
String currUserAgencyId, Map<Integer, String> checkBoxOptionColumnIdxAndLabel, |
|
|
|
String currUserAgencyPids, String currentUserId, String tableName) { |
|
|
|
String loginUserCustomerId = EpmetRequestHolder.getLoginUserCustomerId(); |
|
|
|
// 遍历每一行,将行内容转化为
|
|
|
|
for (Map<Integer, String> row : dataRows) { |
|
|
@ -564,7 +572,10 @@ public class IcResiUserImportServiceImpl implements IcResiUserImportService, Res |
|
|
|
|
|
|
|
} catch (Exception e) { |
|
|
|
String errorMsg; |
|
|
|
if (e instanceof RenException | e instanceof EpmetException) { |
|
|
|
|
|
|
|
if (e instanceof RenException) { |
|
|
|
errorMsg = e.getMessage(); |
|
|
|
} else if (e instanceof EpmetException) { |
|
|
|
errorMsg = e.getMessage(); |
|
|
|
} else { |
|
|
|
errorMsg = "未知系统错误"; |
|
|
@ -574,6 +585,7 @@ public class IcResiUserImportServiceImpl implements IcResiUserImportService, Res |
|
|
|
ErrorRow errorRow = new ErrorRow(); |
|
|
|
errorRow.setIdCard(columnAndValues.get("ID_CARD")); |
|
|
|
errorRow.setName(columnAndValues.get("NAME")); |
|
|
|
errorRow.setMobile(columnAndValues.get("MOBILE")); |
|
|
|
errorRow.setErrorInfo(errorMsg); |
|
|
|
errorRow.setTableName(tableName); |
|
|
|
errorRows.get().get(IcResiUserTableEnum.IC_RESI_USER.getTableName()).add(errorRow); |
|
|
@ -679,8 +691,8 @@ public class IcResiUserImportServiceImpl implements IcResiUserImportService, Res |
|
|
|
* @param targetTableName 要插入到哪一个表 |
|
|
|
*/ |
|
|
|
public List<String> persistIcResiExtraInfo(Map<String, ColumnWrapper> headerColumnWrapper, List<Map<Integer, String>> dataRows, |
|
|
|
String currUserAgencyId, Map<Integer, String> checkBoxOptionColumnIdxAndLabel, |
|
|
|
String currentUserId, String targetTableName, String customerId) { |
|
|
|
String currUserAgencyId, Map<Integer, String> checkBoxOptionColumnIdxAndLabel, |
|
|
|
String currentUserId, String targetTableName, String customerId) { |
|
|
|
|
|
|
|
LinkedHashMap<String, String> columnAndValues = new LinkedHashMap<>(); |
|
|
|
|
|
|
@ -756,6 +768,7 @@ public class IcResiUserImportServiceImpl implements IcResiUserImportService, Res |
|
|
|
ErrorRow errorRow = new ErrorRow(); |
|
|
|
errorRow.setName(columnAndValues.get("NAME")); |
|
|
|
errorRow.setIdCard(columnAndValues.get("ID_CARD")); |
|
|
|
errorRow.setMobile(columnAndValues.get("MOBILE")); |
|
|
|
errorRow.setErrorInfo(errorMsg); |
|
|
|
errorRow.setTableName(targetTableName); |
|
|
|
errorRows.get().get(targetTableName).add(errorRow); |
|
|
@ -784,6 +797,8 @@ public class IcResiUserImportServiceImpl implements IcResiUserImportService, Res |
|
|
|
*/ |
|
|
|
public void singlePersistResiVirtualSheetExtraInfo(Map<String, String> columnAndValues, IcResiUserTableEnum sheetEnumObject) { |
|
|
|
String idCard = columnAndValues.get(ID_CARD_COLUMN_NO); |
|
|
|
String name = columnAndValues.get(ID_NAME_COLUMN_NO); |
|
|
|
String mobile = columnAndValues.get(MOBILE_COLUMN_NO); |
|
|
|
try { |
|
|
|
if (StringUtils.isBlank(idCard)) { |
|
|
|
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), |
|
|
@ -813,8 +828,9 @@ public class IcResiUserImportServiceImpl implements IcResiUserImportService, Res |
|
|
|
} |
|
|
|
|
|
|
|
ErrorRow errorRow = new ErrorRow(); |
|
|
|
errorRow.setName(columnAndValues.get("NAME")); |
|
|
|
errorRow.setName(name); |
|
|
|
errorRow.setIdCard(idCard); |
|
|
|
errorRow.setMobile(mobile); |
|
|
|
errorRow.setErrorInfo(errorMsg); |
|
|
|
errorRow.setTableName(sheetEnumObject.getTableName()); |
|
|
|
errorRows.get().get(sheetEnumObject.getTableName()).add(errorRow); |
|
|
@ -927,6 +943,7 @@ public class IcResiUserImportServiceImpl implements IcResiUserImportService, Res |
|
|
|
// 这两列要提前放进去,因为有的列未填写的话,会抛异常出去,需要用这两列来做描述
|
|
|
|
target2Insert.put("ID_CARD", row.get(ID_CARD_COLUMN_NO)); |
|
|
|
target2Insert.put("NAME", row.get(ID_NAME_COLUMN_NO)); |
|
|
|
target2Insert.put("MOBILE", row.get(MOBILE_COLUMN_NO)); |
|
|
|
|
|
|
|
for (Map.Entry<String, ColumnWrapper> dbColumnMetadata : dbMetadataItemIdAndColumnWrappers.entrySet()) { |
|
|
|
|
|
|
@ -1366,35 +1383,41 @@ public class IcResiUserImportServiceImpl implements IcResiUserImportService, Res |
|
|
|
} |
|
|
|
|
|
|
|
List<OptionResultDTO> options = null; |
|
|
|
String optionTypeName = null; |
|
|
|
switch (pureUri) { |
|
|
|
case "/gov/org/customergrid/gridoption": |
|
|
|
optionTypeName = "网格"; |
|
|
|
GridOptionFormDTO form = new GridOptionFormDTO(); |
|
|
|
form.setAgencyId(currUserAgencyId); |
|
|
|
form.setPurpose(purpose); |
|
|
|
options = getResultDataOrThrowsException(govOrgOpenFeignClient.getGridOption(form), ServiceConstant.GOV_ORG_SERVER, EpmetErrorCode.SERVER_ERROR.getCode(), null, null); |
|
|
|
break; |
|
|
|
case "/gov/org/customerpartybranch/branchoption": |
|
|
|
|
|
|
|
optionTypeName = "所属支部"; |
|
|
|
CustomerPartyBranchDTO bform = new CustomerPartyBranchDTO(); |
|
|
|
bform.setGridId(cascadeItemColumnWrapper.getColValue()); |
|
|
|
options = getResultDataOrThrowsException(govOrgOpenFeignClient.getBranchOption(bform), ServiceConstant.GOV_ORG_SERVER, EpmetErrorCode.SERVER_ERROR.getCode(), null, null); |
|
|
|
break; |
|
|
|
case "/gov/org/icbuilding/buildingoption": |
|
|
|
optionTypeName = "楼栋"; |
|
|
|
IcBuildingDTO buildingform = new IcBuildingDTO(); |
|
|
|
buildingform.setNeighborHoodId(cascadeItemColumnWrapper.getColValue()); |
|
|
|
options = getResultDataOrThrowsException(govOrgOpenFeignClient.getBuildingOptions(buildingform), ServiceConstant.GOV_ORG_SERVER, EpmetErrorCode.SERVER_ERROR.getCode(), null, null); |
|
|
|
break; |
|
|
|
case "/gov/org/icbuildingunit/unitoption": |
|
|
|
optionTypeName = "单元"; |
|
|
|
IcBuildingUnitDTO buForm = new IcBuildingUnitDTO(); |
|
|
|
buForm.setBuildingId(cascadeItemColumnWrapper.getColValue()); |
|
|
|
options = getResultDataOrThrowsException(govOrgOpenFeignClient.getUnitOptions(buForm), ServiceConstant.GOV_ORG_SERVER, EpmetErrorCode.SERVER_ERROR.getCode(), null, null); |
|
|
|
break; |
|
|
|
case "/gov/org/ichouse/houseoption": |
|
|
|
optionTypeName = "房屋"; |
|
|
|
HouseFormDTO hform = new HouseFormDTO(); |
|
|
|
hform.setUnitId(cascadeItemColumnWrapper.getColValue()); |
|
|
|
options = getResultDataOrThrowsException(govOrgOpenFeignClient.getHouseOption(hform), ServiceConstant.GOV_ORG_SERVER, EpmetErrorCode.SERVER_ERROR.getCode(), null, null); |
|
|
|
break; |
|
|
|
case "/gov/org/icneighborhood/neighborhoodoption": |
|
|
|
optionTypeName = "所属小区"; |
|
|
|
IcNeighborHoodDTO nform = new IcNeighborHoodDTO(); |
|
|
|
String gridId = cascadeItemColumnWrapper.getColValue(); |
|
|
|
if (StringUtils.isBlank(gridId)){ |
|
|
@ -1405,21 +1428,27 @@ public class IcResiUserImportServiceImpl implements IcResiUserImportService, Res |
|
|
|
options = getResultDataOrThrowsException(govOrgOpenFeignClient.getNeighborHoodOptions(nform), ServiceConstant.GOV_ORG_SERVER, EpmetErrorCode.SERVER_ERROR.getCode(), null, null); |
|
|
|
break; |
|
|
|
case "/sys/dict/data/education": |
|
|
|
optionTypeName = "文化程度"; |
|
|
|
options = getResultDataOrThrowsException(adminOpenFeignClient.getEducationOption(), ServiceConstant.GOV_ORG_SERVER, EpmetErrorCode.SERVER_ERROR.getCode(), null, null); |
|
|
|
break; |
|
|
|
case "/sys/dict/data/house": |
|
|
|
optionTypeName = "住房性质"; |
|
|
|
options = getResultDataOrThrowsException(adminOpenFeignClient.getHouseOption(), ServiceConstant.GOV_ORG_SERVER, EpmetErrorCode.SERVER_ERROR.getCode(), null, null); |
|
|
|
break; |
|
|
|
case "/sys/dict/data/nation": |
|
|
|
optionTypeName = "民族"; |
|
|
|
options = getResultDataOrThrowsException(adminOpenFeignClient.getNationOption(), ServiceConstant.GOV_ORG_SERVER, EpmetErrorCode.SERVER_ERROR.getCode(), null, null); |
|
|
|
break; |
|
|
|
case "/sys/dict/data/ninesmallplaces": |
|
|
|
optionTypeName = "九小场所"; |
|
|
|
options = getResultDataOrThrowsException(adminOpenFeignClient.getNineSmallPlacesOption(), ServiceConstant.GOV_ORG_SERVER, EpmetErrorCode.SERVER_ERROR.getCode(), null, null); |
|
|
|
break; |
|
|
|
case "/sys/dict/data/relationship": |
|
|
|
optionTypeName = "人员关系"; |
|
|
|
options = getResultDataOrThrowsException(adminOpenFeignClient.getRelationshipOption(), ServiceConstant.GOV_ORG_SERVER, EpmetErrorCode.SERVER_ERROR.getCode(), null, null); |
|
|
|
break; |
|
|
|
case "/resi/partymember/icPartyOrg/branchlist": |
|
|
|
optionTypeName = "所属支部"; |
|
|
|
options = this.listBranchOptions(); |
|
|
|
break; |
|
|
|
default: |
|
|
@ -1430,8 +1459,16 @@ public class IcResiUserImportServiceImpl implements IcResiUserImportService, Res |
|
|
|
if (options == null) { |
|
|
|
return null; |
|
|
|
} |
|
|
|
try { |
|
|
|
return options.stream().collect(Collectors.toMap(OptionResultDTO::getLabel, OptionResultDTO::getValue)); |
|
|
|
} catch (Exception e) { |
|
|
|
String erroMsg = ExceptionUtils.getErrorStackTrace(e); |
|
|
|
log.error("【居民信息导入】{}转化Options为map失败,url:{}, cascadeItemId:{}, currUserAgencyId:{},错误信息:{}", |
|
|
|
optionTypeName, pureUri, cascadeItemId, currUserAgencyId, erroMsg); |
|
|
|
|
|
|
|
return options.stream().collect(Collectors.toMap(OptionResultDTO::getLabel, OptionResultDTO::getValue)); |
|
|
|
String hintMsg = optionTypeName + "解析失败"; |
|
|
|
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), hintMsg, hintMsg); |
|
|
|
} |
|
|
|
|
|
|
|
// 通用api调用,无法实现
|
|
|
|
/*if (!uri.startsWith("/api")) uri = "/api".concat(uri); |
|
|
@ -2019,7 +2056,7 @@ public class IcResiUserImportServiceImpl implements IcResiUserImportService, Res |
|
|
|
// 保存 changeDetail
|
|
|
|
for (Map.Entry<String, String> newCategories : newData.getCategories().entrySet()) { |
|
|
|
String key = newCategories.getKey(); |
|
|
|
String newValue = newCategories.getValue(); |
|
|
|
String newValue = newCategories.getValue(); |
|
|
|
|
|
|
|
// 现在是这个类型,这个类型要+1
|
|
|
|
if ("1".equals(newValue)) { |
|
|
|