Browse Source

修改:

ResultDataResolver.java,方法增加showMessage参数
dev_shibei_match
wangxianzhang 4 years ago
parent
commit
9446a53b3a
  1. 2
      epmet-admin/epmet-admin-server/src/main/java/com/epmet/mq/listener/bean/log/LogOperationHelper.java
  2. 6
      epmet-admin/epmet-admin-server/src/main/java/com/epmet/service/impl/LogOperationServiceImpl.java
  3. 4
      epmet-auth/src/main/java/com/epmet/controller/IcLoinController.java
  4. 2
      epmet-auth/src/main/java/com/epmet/service/impl/IcLoginServiceImpl.java
  5. 7
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/feign/ResultDataResolver.java
  6. 2
      epmet-gateway/src/main/java/com/epmet/config/CorsConfig.java
  7. 2
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/impl/QuestionnaireServiceImpl.java
  8. 8
      epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/BizPointTotalDetailServiceImpl.java
  9. 4
      epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/apiservice/impl/PingyinPrivateEpmetApiService.java
  10. 10
      epmet-module/resi-home/resi-home-server/src/main/java/com/epmet/service/impl/ResiEventServiceImpl.java
  11. 28
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserImportServiceImpl.java
  12. 2
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java

2
epmet-admin/epmet-admin-server/src/main/java/com/epmet/mq/listener/bean/log/LogOperationHelper.java

@ -57,7 +57,7 @@ public class LogOperationHelper implements ResultDataResolver {
form.setUserId(userId); form.setUserId(userId);
Result<CustomerStaffDTO> result = userOpenFeignClient.getCustomerStaffInfoByUserId(form); Result<CustomerStaffDTO> result = userOpenFeignClient.getCustomerStaffInfoByUserId(form);
CustomerStaffDTO staffInfo = getResultDataOrThrowsException(result, ServiceConstant.EPMET_ADMIN_SERVER, EpmetErrorCode.SERVER_ERROR.getCode(), CustomerStaffDTO staffInfo = getResultDataOrThrowsException(result, ServiceConstant.EPMET_ADMIN_SERVER, EpmetErrorCode.SERVER_ERROR.getCode(),
"调用epmet-user服务获取staff信息发生异常"); "调用epmet-user服务获取staff信息发生异常", null);
return new OperatorInfo(staffInfo.getCustomerId(), staffInfo.getMobile(), staffInfo.getRealName()); return new OperatorInfo(staffInfo.getCustomerId(), staffInfo.getMobile(), staffInfo.getRealName());
} }
} }

6
epmet-admin/epmet-admin-server/src/main/java/com/epmet/service/impl/LogOperationServiceImpl.java

@ -82,7 +82,7 @@ public class LogOperationServiceImpl implements LogOperationService, ResultDataR
CustomerStaffFormDTO form = new CustomerStaffFormDTO(); CustomerStaffFormDTO form = new CustomerStaffFormDTO();
form.setUserIds(new ArrayList<>(userIds)); form.setUserIds(new ArrayList<>(userIds));
Result<List<CustomerStaffDTO>> result = userOpenFeignClient.list(form); Result<List<CustomerStaffDTO>> result = userOpenFeignClient.list(form);
List<CustomerStaffDTO> staffs = getResultDataOrThrowsException(result, ServiceConstant.EPMET_USER_SERVER, EpmetErrorCode.SERVER_ERROR.getCode(), "调用user服务发生异常"); List<CustomerStaffDTO> staffs = getResultDataOrThrowsException(result, ServiceConstant.EPMET_USER_SERVER, EpmetErrorCode.SERVER_ERROR.getCode(), "调用user服务发生异常", null);
HashMap<String, CustomerStaffDTO> staffMap = new HashMap<>(); HashMap<String, CustomerStaffDTO> staffMap = new HashMap<>();
staffs.forEach(s -> { staffs.forEach(s -> {
@ -103,7 +103,7 @@ public class LogOperationServiceImpl implements LogOperationService, ResultDataR
form.setCustomerId(customerId); form.setCustomerId(customerId);
form.setMobile(operatorMobile); form.setMobile(operatorMobile);
Result<List<CustomerStaffDTO>> result = userOpenFeignClient.list(form); Result<List<CustomerStaffDTO>> result = userOpenFeignClient.list(form);
List<CustomerStaffDTO> staffs = getResultDataOrThrowsException(result, ServiceConstant.EPMET_USER_SERVER, EpmetErrorCode.SERVER_ERROR.getCode(), "调用user服务发生异常"); List<CustomerStaffDTO> staffs = getResultDataOrThrowsException(result, ServiceConstant.EPMET_USER_SERVER, EpmetErrorCode.SERVER_ERROR.getCode(), "调用user服务发生异常", null);
if (staffs.size() == 0) { if (staffs.size() == 0) {
return null; return null;
@ -134,7 +134,7 @@ public class LogOperationServiceImpl implements LogOperationService, ResultDataR
CustomerStaffFormDTO form = new CustomerStaffFormDTO(); CustomerStaffFormDTO form = new CustomerStaffFormDTO();
form.setRealName(operatorName); form.setRealName(operatorName);
Result<List<CustomerStaffDTO>> result = userOpenFeignClient.list(form); Result<List<CustomerStaffDTO>> result = userOpenFeignClient.list(form);
List<CustomerStaffDTO> staffs = getResultDataOrThrowsException(result, ServiceConstant.EPMET_USER_SERVER, EpmetErrorCode.SERVER_ERROR.getCode(), "调用user服务查询工作人员信息发生异常"); List<CustomerStaffDTO> staffs = getResultDataOrThrowsException(result, ServiceConstant.EPMET_USER_SERVER, EpmetErrorCode.SERVER_ERROR.getCode(), "调用user服务查询工作人员信息发生异常", null);
List<String> userIds = new ArrayList<>(); List<String> userIds = new ArrayList<>();
HashMap<String, CustomerStaffDTO> staffMap = new HashMap<String, CustomerStaffDTO>(); HashMap<String, CustomerStaffDTO> staffMap = new HashMap<String, CustomerStaffDTO>();

4
epmet-auth/src/main/java/com/epmet/controller/IcLoinController.java

@ -76,7 +76,7 @@ public class IcLoinController implements ResultDataResolver {
// 获取用户信息 // 获取用户信息
Result<List<CustomerStaffDTO>> staffResult = epmetUserFeignClient.checkCustomerStaff(mobile); Result<List<CustomerStaffDTO>> staffResult = epmetUserFeignClient.checkCustomerStaff(mobile);
List<CustomerStaffDTO> staffList = getResultDataOrThrowsException(staffResult, ServiceConstant.EPMET_USER_SERVER, EpmetErrorCode.SERVER_ERROR.getCode(), "【基层治理平台登录】获取用户信息失败"); List<CustomerStaffDTO> staffList = getResultDataOrThrowsException(staffResult, ServiceConstant.EPMET_USER_SERVER, EpmetErrorCode.SERVER_ERROR.getCode(), "【基层治理平台登录】获取用户信息失败", null);
if (CollectionUtils.isEmpty(staffList)) { if (CollectionUtils.isEmpty(staffList)) {
throw new RenException(EpmetErrorCode.ERR10003.getCode()); throw new RenException(EpmetErrorCode.ERR10003.getCode());
} }
@ -93,7 +93,7 @@ public class IcLoinController implements ResultDataResolver {
RootOrgListByStaffIdFormDTO orgListForm = new RootOrgListByStaffIdFormDTO(); RootOrgListByStaffIdFormDTO orgListForm = new RootOrgListByStaffIdFormDTO();
orgListForm.setStaffId(staffId); orgListForm.setStaffId(staffId);
Result<List<StaffOrgsResultDTO>> orgListResult = govOrgOpenFeignClient.getStaffOrgListByStaffId(orgListForm); Result<List<StaffOrgsResultDTO>> orgListResult = govOrgOpenFeignClient.getStaffOrgListByStaffId(orgListForm);
List<StaffOrgsResultDTO> orgs = getResultDataOrThrowsException(orgListResult, ServiceConstant.GOV_ORG_SERVER, EpmetErrorCode.SERVER_ERROR.getCode(), "【基层治理平台登录】根据staffId查询所属客户跟组织列表失败"); List<StaffOrgsResultDTO> orgs = getResultDataOrThrowsException(orgListResult, ServiceConstant.GOV_ORG_SERVER, EpmetErrorCode.SERVER_ERROR.getCode(), "【基层治理平台登录】根据staffId查询所属客户跟组织列表失败", null);
// 生成登录票据 // 生成登录票据
String ticket = UUID.randomUUID().toString().replace("-", ""); String ticket = UUID.randomUUID().toString().replace("-", "");

2
epmet-auth/src/main/java/com/epmet/service/impl/IcLoginServiceImpl.java

@ -65,7 +65,7 @@ public class IcLoginServiceImpl implements IcLoginService, ResultDataResolver {
String token = this.generateIcToken(staffId, app, client); String token = this.generateIcToken(staffId, app, client);
Result<CustomerAgencyDTO> agencyResult = govOrgOpenFeignClient.getAgencyById(orgId); Result<CustomerAgencyDTO> agencyResult = govOrgOpenFeignClient.getAgencyById(orgId);
CustomerAgencyDTO agencyInfo = getResultDataOrThrowsException(agencyResult, ServiceConstant.GOV_ORG_SERVER, EpmetErrorCode.SERVER_ERROR.getCode(), "【IC平台登录】获取组织信息失败"); CustomerAgencyDTO agencyInfo = getResultDataOrThrowsException(agencyResult, ServiceConstant.GOV_ORG_SERVER, EpmetErrorCode.SERVER_ERROR.getCode(), "【IC平台登录】获取组织信息失败", null);
// 2.缓存token // 2.缓存token
cacheToken(app, client, staffId, token, orgId, agencyInfo.getCustomerId()); cacheToken(app, client, staffId, token, orgId, agencyInfo.getCustomerId());

7
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/feign/ResultDataResolver.java

@ -34,18 +34,19 @@ public interface ResultDataResolver {
* @return * @return
* @param targetServiceName 目标service名称 * @param targetServiceName 目标service名称
* @param errorCode 错误码可以为空为空则使用上游服务抛出的错误码 * @param errorCode 错误码可以为空为空则使用上游服务抛出的错误码
* @param errorInternalMsg 错误信息可以为空为空则使用上游服务抛出的异常信息 * @param errorInternalMsg 内部错误信息可以为空为空则使用上游服务抛出的异常信息
* @param showMsg 展示给前端程序的错误信息可以为空为空则根据errorCode给定错误msg信息
* @author wxz * @author wxz
* @date 2021.06.07 22:45 * @date 2021.06.07 22:45
*/ */
default <R> R getResultDataOrThrowsException(Result<R> result, String targetServiceName, Integer errorCode, String errorInternalMsg) { default <R> R getResultDataOrThrowsException(Result<R> result, String targetServiceName, Integer errorCode, String errorInternalMsg, String showMsg) {
if (result == null) { if (result == null) {
throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode(), "调用{}服务发生错误,返回Result为null", targetServiceName); throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode(), "调用{}服务发生错误,返回Result为null", targetServiceName);
} }
if (!result.success()) { if (!result.success()) {
Integer finalErrorCode = errorCode == null ? result.getCode() : errorCode; Integer finalErrorCode = errorCode == null ? result.getCode() : errorCode;
String finalErrorInternalMsg = StringUtils.isBlank(errorInternalMsg) ? result.getInternalMsg() : errorInternalMsg; String finalErrorInternalMsg = StringUtils.isBlank(errorInternalMsg) ? result.getInternalMsg() : errorInternalMsg;
throw new RenException(finalErrorCode, finalErrorInternalMsg); throw new RenException(finalErrorCode, finalErrorInternalMsg, showMsg, RenException.MessageMode.CODE_INTERNAL_EXTERNAL);
} }
return result.getData(); return result.getData();
} }

2
epmet-gateway/src/main/java/com/epmet/config/CorsConfig.java

@ -117,7 +117,7 @@ class EpmetWebFilter implements WebFilter, ResultDataResolver {
adminOpenFeignClient.list(), adminOpenFeignClient.list(),
ServiceConstant.EPMET_ADMIN_SERVER, ServiceConstant.EPMET_ADMIN_SERVER,
EpmetErrorCode.SERVER_ERROR.getCode(), EpmetErrorCode.SERVER_ERROR.getCode(),
"调用Admin服务查询Cors配置失败"); "调用Admin服务查询Cors配置失败", null);
} catch (Exception e) { } catch (Exception e) {
logger.error("调用Admin服务查询Cors配置失败"); logger.error("调用Admin服务查询Cors配置失败");
} }

2
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/impl/QuestionnaireServiceImpl.java

@ -73,7 +73,7 @@ public class QuestionnaireServiceImpl implements QuestionnaireService, ResultDat
CustomerGridFormDTO form = new CustomerGridFormDTO(); CustomerGridFormDTO form = new CustomerGridFormDTO();
form.setGridId(gridId); form.setGridId(gridId);
Result<CustomerGridDTO> gridInfoResult = govOrgOpenFeignClient.getGridBaseInfoByGridId(form); Result<CustomerGridDTO> gridInfoResult = govOrgOpenFeignClient.getGridBaseInfoByGridId(form);
CustomerGridDTO gridInfo = getResultDataOrThrowsException(gridInfoResult, ServiceConstant.GOV_ORG_SERVER, EpmetErrorCode.SERVER_ERROR.getCode(), "【调查问卷】校验访问权限,查询网格信息失败"); CustomerGridDTO gridInfo = getResultDataOrThrowsException(gridInfoResult, ServiceConstant.GOV_ORG_SERVER, EpmetErrorCode.SERVER_ERROR.getCode(), "【调查问卷】校验访问权限,查询网格信息失败", null);
// 网格父级ID列表:网格ID(拼接起来,冒号分割) // 网格父级ID列表:网格ID(拼接起来,冒号分割)
String gridIdPath = gridInfo.getPids().concat(":").concat(gridInfo.getId()); String gridIdPath = gridInfo.getPids().concat(":").concat(gridInfo.getId());
List<PrPublishRangeEntity> publishRangeEntity = prPublishRangeService.getPublishRangeEntity(projectKey); List<PrPublishRangeEntity> publishRangeEntity = prPublishRangeService.getPublishRangeEntity(projectKey);

8
epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/BizPointTotalDetailServiceImpl.java

@ -380,7 +380,7 @@ public class BizPointTotalDetailServiceImpl extends BaseServiceImpl<BizPointTota
form.setSearchScopeObjectId(searchScopeObjectId); form.setSearchScopeObjectId(searchScopeObjectId);
Result<List<GroupDetailResultDTO>> result = resiGroupOpenFeignClient.listGroupDetailsExcludeGroupIds(form); Result<List<GroupDetailResultDTO>> result = resiGroupOpenFeignClient.listGroupDetailsExcludeGroupIds(form);
List<GroupDetailResultDTO> groups = getResultDataOrThrowsException(result, ServiceConstant.RESI_GROUP_SERVER, EpmetErrorCode.SERVER_ERROR.getCode(), "【小组排名】查询积分为0的小组列表失败"); List<GroupDetailResultDTO> groups = getResultDataOrThrowsException(result, ServiceConstant.RESI_GROUP_SERVER, EpmetErrorCode.SERVER_ERROR.getCode(), "【小组排名】查询积分为0的小组列表失败", null);
if (CollectionUtils.isEmpty(groups)) { if (CollectionUtils.isEmpty(groups)) {
return new ArrayList<>(); return new ArrayList<>();
} }
@ -412,7 +412,7 @@ public class BizPointTotalDetailServiceImpl extends BaseServiceImpl<BizPointTota
// 查询这些小组的基本信息 // 查询这些小组的基本信息
Result<List<GroupDetailResultDTO>> listResult = resiGroupOpenFeignClient.listGroupDetailsByGroupIds(groupIds); Result<List<GroupDetailResultDTO>> listResult = resiGroupOpenFeignClient.listGroupDetailsByGroupIds(groupIds);
List<GroupDetailResultDTO> groupInfos = getResultDataOrThrowsException(listResult, ServiceConstant.RESI_GROUP_SERVER, EpmetErrorCode.SERVER_ERROR.getCode(), "【小组排行】批量查询小组信息出错"); List<GroupDetailResultDTO> groupInfos = getResultDataOrThrowsException(listResult, ServiceConstant.RESI_GROUP_SERVER, EpmetErrorCode.SERVER_ERROR.getCode(), "【小组排行】批量查询小组信息出错", null);
// 将小组基本信息转化为map // 将小组基本信息转化为map
HashMap<String, GroupDetailResultDTO> groupMap = new HashMap<>(); HashMap<String, GroupDetailResultDTO> groupMap = new HashMap<>();
@ -454,7 +454,7 @@ public class BizPointTotalDetailServiceImpl extends BaseServiceImpl<BizPointTota
CustomerGridFormDTO form = new CustomerGridFormDTO(); CustomerGridFormDTO form = new CustomerGridFormDTO();
form.setGridId(gridId); form.setGridId(gridId);
Result<CustomerGridDTO> result = govOrgOpenFeignClient.getGridBaseInfoByGridId(form); Result<CustomerGridDTO> result = govOrgOpenFeignClient.getGridBaseInfoByGridId(form);
return getResultDataOrThrowsException(result, ServiceConstant.GOV_ORG_SERVER, EpmetErrorCode.SERVER_ERROR.getCode(), "【小组排名】查询网格信息失败"); return getResultDataOrThrowsException(result, ServiceConstant.GOV_ORG_SERVER, EpmetErrorCode.SERVER_ERROR.getCode(), "【小组排名】查询网格信息失败", null);
} }
@Override @Override
@ -464,7 +464,7 @@ public class BizPointTotalDetailServiceImpl extends BaseServiceImpl<BizPointTota
form.setGridId(gridId); form.setGridId(gridId);
form.setUserId(userId); form.setUserId(userId);
List<GroupDetailResultDTO> groupList = getResultDataOrThrowsException(resiGroupOpenFeignClient.listGroupsByMember(form), List<GroupDetailResultDTO> groupList = getResultDataOrThrowsException(resiGroupOpenFeignClient.listGroupsByMember(form),
ServiceConstant.RESI_GROUP_SERVER, EpmetErrorCode.SERVER_ERROR.getCode(), "【我所在的小组排名】查询组列表失败"); ServiceConstant.RESI_GROUP_SERVER, EpmetErrorCode.SERVER_ERROR.getCode(), "【我所在的小组排名】查询组列表失败", null);
if (CollectionUtils.isEmpty(groupList)) { if (CollectionUtils.isEmpty(groupList)) {
return new ArrayList(); return new ArrayList();

4
epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/apiservice/impl/PingyinPrivateEpmetApiService.java

@ -55,7 +55,7 @@ public class PingyinPrivateEpmetApiService extends ApiService<Result> implements
String urlParams = super.convertQueryParams2String(constructCommonUrlParamsMap(platformKey, authType, uuid, currentTimeMillis, sign)); String urlParams = super.convertQueryParams2String(constructCommonUrlParamsMap(platformKey, authType, uuid, currentTimeMillis, sign));
String requestUrl = baseUrl.concat(apiUrl).concat(urlParams); String requestUrl = baseUrl.concat(apiUrl).concat(urlParams);
Result<String> stringResult = HttpClientManager.getInstance().sendPostByHttps(requestUrl, "{}"); Result<String> stringResult = HttpClientManager.getInstance().sendPostByHttps(requestUrl, "{}");
String remoteResultString = getResultDataOrThrowsException(stringResult, "【调用平阴私有化平台获取AccessToken】", EpmetErrorCode.SERVER_ERROR.getCode(), null); String remoteResultString = getResultDataOrThrowsException(stringResult, "【调用平阴私有化平台获取AccessToken】", EpmetErrorCode.SERVER_ERROR.getCode(), null, null);
Result<GetAccessTokenResultDTO> remoteResult = parsePlatformResponseResult(remoteResultString, GetAccessTokenResultDTO.class); Result<GetAccessTokenResultDTO> remoteResult = parsePlatformResponseResult(remoteResultString, GetAccessTokenResultDTO.class);
log.info("【调用平阴私有化平台获取AccessToken】结果:{}", remoteResultString); log.info("【调用平阴私有化平台获取AccessToken】结果:{}", remoteResultString);
accessTokenFromCache = remoteResult.getData().getAccessToken(); accessTokenFromCache = remoteResult.getData().getAccessToken();
@ -159,7 +159,7 @@ public class PingyinPrivateEpmetApiService extends ApiService<Result> implements
String jsonString = JSON.toJSONString(form); String jsonString = JSON.toJSONString(form);
Result result = super.sendPostRequest(platformId, ThirdPlatformActions.PUSH_COMPONENT_ACCESS_TOKEN, jsonString, null, urlParams); Result result = super.sendPostRequest(platformId, ThirdPlatformActions.PUSH_COMPONENT_ACCESS_TOKEN, jsonString, null, urlParams);
getResultDataOrThrowsException(result, "【平阴私有化平台】推送ComponentAccessToken", EpmetErrorCode.SERVER_ERROR.getCode(), null); getResultDataOrThrowsException(result, "【平阴私有化平台】推送ComponentAccessToken", EpmetErrorCode.SERVER_ERROR.getCode(), null, null);
} }
@Override @Override

10
epmet-module/resi-home/resi-home-server/src/main/java/com/epmet/service/impl/ResiEventServiceImpl.java

@ -50,7 +50,7 @@ public class ResiEventServiceImpl implements ResiEventService, ResultDataResolve
//查询人大代表列表 //查询人大代表列表
ListUserByBadgeFormDTO npcForm = new ListUserByBadgeFormDTO(customerId, BadgeConstant.BADGE_KEY_NPC); ListUserByBadgeFormDTO npcForm = new ListUserByBadgeFormDTO(customerId, BadgeConstant.BADGE_KEY_NPC);
Result<List<ListUserByBadgeResultDTO>> npcResult = epmetUserOpenFeignClient.listUsersByBadge(npcForm); Result<List<ListUserByBadgeResultDTO>> npcResult = epmetUserOpenFeignClient.listUsersByBadge(npcForm);
List<ListUserByBadgeResultDTO> npcData = getResultDataOrThrowsException(npcResult, ServiceConstant.EPMET_USER_SERVER, null, null); List<ListUserByBadgeResultDTO> npcData = getResultDataOrThrowsException(npcResult, ServiceConstant.EPMET_USER_SERVER, null, null, null);
if(CollectionUtils.isEmpty(npcData)) { if(CollectionUtils.isEmpty(npcData)) {
// 没有人大代表,直接返回空列表即可 // 没有人大代表,直接返回空列表即可
@ -61,7 +61,7 @@ public class ResiEventServiceImpl implements ResiEventService, ResultDataResolve
List<String> npcGridIds = npcData.stream().map(d -> d.getGridId()).collect(Collectors.toList()); List<String> npcGridIds = npcData.stream().map(d -> d.getGridId()).collect(Collectors.toList());
OrgInfoFormDTO form = new OrgInfoFormDTO(OrgInfoConstant.GRID, npcGridIds); OrgInfoFormDTO form = new OrgInfoFormDTO(OrgInfoConstant.GRID, npcGridIds);
Result<List<OrgInfoResultDTO>> npcGridInfoResult = govOrgOpenFeignClient.selectOrgInfo(form); Result<List<OrgInfoResultDTO>> npcGridInfoResult = govOrgOpenFeignClient.selectOrgInfo(form);
List<OrgInfoResultDTO> npcGridInfos = getResultDataOrThrowsException(npcGridInfoResult, ServiceConstant.GOV_ORG_SERVER, null, null); List<OrgInfoResultDTO> npcGridInfos = getResultDataOrThrowsException(npcGridInfoResult, ServiceConstant.GOV_ORG_SERVER, null, null, null);
Map<String, OrgInfoResultDTO> npcGridInfoMap = convertNpcGridInfos2Map(npcGridInfos); Map<String, OrgInfoResultDTO> npcGridInfoMap = convertNpcGridInfos2Map(npcGridInfos);
@ -109,7 +109,7 @@ public class ResiEventServiceImpl implements ResiEventService, ResultDataResolve
TreeSet<ResiEventTargetLevelResultDTO> targetLevels = new TreeSet<>(); TreeSet<ResiEventTargetLevelResultDTO> targetLevels = new TreeSet<>();
Result<GridInfoResultDTO> gridInfoResult = govOrgOpenFeignClient.queryGridInfo(gridId); Result<GridInfoResultDTO> gridInfoResult = govOrgOpenFeignClient.queryGridInfo(gridId);
GridInfoResultDTO gridInfoData = getResultDataOrThrowsException(gridInfoResult, ServiceConstant.GOV_ORG_SERVER, null, null); GridInfoResultDTO gridInfoData = getResultDataOrThrowsException(gridInfoResult, ServiceConstant.GOV_ORG_SERVER, null, null, null);
String pidsPath = gridInfoData.getPids(); String pidsPath = gridInfoData.getPids();
List<String> parentOrgIds = Arrays.asList(pidsPath.split(":")); List<String> parentOrgIds = Arrays.asList(pidsPath.split(":"));
// 翻转列表 // 翻转列表
@ -118,7 +118,7 @@ public class ResiEventServiceImpl implements ResiEventService, ResultDataResolve
// 一.网格信息(只有一条,但是为了适应接口,组装成了列表) // 一.网格信息(只有一条,但是为了适应接口,组装成了列表)
List<String> currentGridId = Arrays.asList(gridId); List<String> currentGridId = Arrays.asList(gridId);
Result<List<OrgInfoResultDTO>> currentGridInfoResult = govOrgOpenFeignClient.selectOrgInfo(new OrgInfoFormDTO(OrgInfoConstant.GRID, currentGridId)); Result<List<OrgInfoResultDTO>> currentGridInfoResult = govOrgOpenFeignClient.selectOrgInfo(new OrgInfoFormDTO(OrgInfoConstant.GRID, currentGridId));
List<OrgInfoResultDTO> currentGridInfos = getResultDataOrThrowsException(currentGridInfoResult, ServiceConstant.GOV_ORG_SERVER, null, null); List<OrgInfoResultDTO> currentGridInfos = getResultDataOrThrowsException(currentGridInfoResult, ServiceConstant.GOV_ORG_SERVER, null, null, null);
OrgInfoResultDTO currentGridInfo = currentGridInfos.get(0); OrgInfoResultDTO currentGridInfo = currentGridInfos.get(0);
// 因为上游接口的值对应问题,这里只好做一个适配,拼接起来,希望上游代码不要再改了... // 因为上游接口的值对应问题,这里只好做一个适配,拼接起来,希望上游代码不要再改了...
@ -128,7 +128,7 @@ public class ResiEventServiceImpl implements ResiEventService, ResultDataResolve
// 二.父级组织信息 // 二.父级组织信息
Result<List<OrgInfoResultDTO>> parentOrgInfoResult = govOrgOpenFeignClient.selectOrgInfo(new OrgInfoFormDTO(OrgInfoConstant.AGENCY, parentOrgIds)); Result<List<OrgInfoResultDTO>> parentOrgInfoResult = govOrgOpenFeignClient.selectOrgInfo(new OrgInfoFormDTO(OrgInfoConstant.AGENCY, parentOrgIds));
List<OrgInfoResultDTO> parentOrgInfos = getResultDataOrThrowsException(parentOrgInfoResult, ServiceConstant.GOV_ORG_SERVER, null, null); List<OrgInfoResultDTO> parentOrgInfos = getResultDataOrThrowsException(parentOrgInfoResult, ServiceConstant.GOV_ORG_SERVER, null, null, null);
parentOrgInfos.forEach(porg -> { parentOrgInfos.forEach(porg -> {
String levelName = OrgLevelEnums.getLevelName(porg.getLevel()); String levelName = OrgLevelEnums.getLevelName(porg.getLevel());
if (StringUtils.isBlank(levelName)) { if (StringUtils.isBlank(levelName)) {

28
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserImportServiceImpl.java

@ -166,11 +166,11 @@ public class IcResiUserImportServiceImpl implements IcResiUserImportService, Res
userForm.setClient(loginUserClient); userForm.setClient(loginUserClient);
userForm.setUserId(loginUserId); userForm.setUserId(loginUserId);
LoginUserDetailsResultDTO loginUserDetails = getResultDataOrThrowsException(epmetUserOpenFeignClient.getLoginUserDetails(userForm), ServiceConstant.EPMET_USER_SERVER, EpmetErrorCode.SERVER_ERROR.getCode(), null); LoginUserDetailsResultDTO loginUserDetails = getResultDataOrThrowsException(epmetUserOpenFeignClient.getLoginUserDetails(userForm), ServiceConstant.EPMET_USER_SERVER, EpmetErrorCode.SERVER_ERROR.getCode(), null, null);
String currUserAgencyId = loginUserDetails.getAgencyId(); String currUserAgencyId = loginUserDetails.getAgencyId();
//String excelPathName = "/opt/test/基础信息表/resi_info.xls"; //String excelPathName = "/opt/test/基础信息表/resi_info.xls";
CustomerAgencyDTO agencyInfo = getResultDataOrThrowsException(govOrgOpenFeignClient.getAgencyById(currUserAgencyId), ServiceConstant.GOV_ORG_SERVER, EpmetErrorCode.SERVER_ERROR.getCode(), null); CustomerAgencyDTO agencyInfo = getResultDataOrThrowsException(govOrgOpenFeignClient.getAgencyById(currUserAgencyId), ServiceConstant.GOV_ORG_SERVER, EpmetErrorCode.SERVER_ERROR.getCode(), null, null);
String customerId = agencyInfo.getCustomerId(); String customerId = agencyInfo.getCustomerId();
try { try {
@ -788,55 +788,55 @@ public class IcResiUserImportServiceImpl implements IcResiUserImportService, Res
switch (pureUri) { switch (pureUri) {
case "/epmetuser/icresidemanddict/demandoption": case "/epmetuser/icresidemanddict/demandoption":
options = getResultDataOrThrowsException(epmetUserOpenFeignClient.getDemandOptions(), ServiceConstant.EPMET_USER_SERVER, options = getResultDataOrThrowsException(epmetUserOpenFeignClient.getDemandOptions(), ServiceConstant.EPMET_USER_SERVER,
EpmetErrorCode.SERVER_ERROR.getCode(), null); EpmetErrorCode.SERVER_ERROR.getCode(), null, null);
break; break;
case "/gov/org/customergrid/gridoption": case "/gov/org/customergrid/gridoption":
GridOptionFormDTO form = new GridOptionFormDTO(); GridOptionFormDTO form = new GridOptionFormDTO();
form.setAgencyId(currUserAgencyId); form.setAgencyId(currUserAgencyId);
form.setPurpose(purpose); form.setPurpose(purpose);
options = getResultDataOrThrowsException(govOrgOpenFeignClient.getGridOption(form), ServiceConstant.GOV_ORG_SERVER, EpmetErrorCode.SERVER_ERROR.getCode(), null); options = getResultDataOrThrowsException(govOrgOpenFeignClient.getGridOption(form), ServiceConstant.GOV_ORG_SERVER, EpmetErrorCode.SERVER_ERROR.getCode(), null, null);
break; break;
case "/gov/org/customerpartybranch/branchoption": case "/gov/org/customerpartybranch/branchoption":
CustomerPartyBranchDTO bform = new CustomerPartyBranchDTO(); CustomerPartyBranchDTO bform = new CustomerPartyBranchDTO();
bform.setGridId(cascadeItemColumnWrapper.getColValue()); bform.setGridId(cascadeItemColumnWrapper.getColValue());
options = getResultDataOrThrowsException(govOrgOpenFeignClient.getBranchOption(bform), ServiceConstant.GOV_ORG_SERVER, EpmetErrorCode.SERVER_ERROR.getCode(), null); options = getResultDataOrThrowsException(govOrgOpenFeignClient.getBranchOption(bform), ServiceConstant.GOV_ORG_SERVER, EpmetErrorCode.SERVER_ERROR.getCode(), null, null);
break; break;
case "/gov/org/icbuilding/buildingoption": case "/gov/org/icbuilding/buildingoption":
IcBuildingDTO buildingform = new IcBuildingDTO(); IcBuildingDTO buildingform = new IcBuildingDTO();
buildingform.setNeighborHoodId(cascadeItemColumnWrapper.getColValue()); buildingform.setNeighborHoodId(cascadeItemColumnWrapper.getColValue());
options = getResultDataOrThrowsException(govOrgOpenFeignClient.getBuildingOptions(buildingform), ServiceConstant.GOV_ORG_SERVER, EpmetErrorCode.SERVER_ERROR.getCode(), null); options = getResultDataOrThrowsException(govOrgOpenFeignClient.getBuildingOptions(buildingform), ServiceConstant.GOV_ORG_SERVER, EpmetErrorCode.SERVER_ERROR.getCode(), null, null);
break; break;
case "/gov/org/icbuildingunit/unitoption": case "/gov/org/icbuildingunit/unitoption":
IcBuildingUnitDTO buForm = new IcBuildingUnitDTO(); IcBuildingUnitDTO buForm = new IcBuildingUnitDTO();
buForm.setBuildingId(cascadeItemColumnWrapper.getColValue()); buForm.setBuildingId(cascadeItemColumnWrapper.getColValue());
options = getResultDataOrThrowsException(govOrgOpenFeignClient.getUnitOptions(buForm), ServiceConstant.GOV_ORG_SERVER, EpmetErrorCode.SERVER_ERROR.getCode(), null); options = getResultDataOrThrowsException(govOrgOpenFeignClient.getUnitOptions(buForm), ServiceConstant.GOV_ORG_SERVER, EpmetErrorCode.SERVER_ERROR.getCode(), null, null);
break; break;
case "/gov/org/ichouse/houseoption": case "/gov/org/ichouse/houseoption":
HouseFormDTO hform = new HouseFormDTO(); HouseFormDTO hform = new HouseFormDTO();
hform.setUnitId(cascadeItemColumnWrapper.getColValue()); hform.setUnitId(cascadeItemColumnWrapper.getColValue());
options = getResultDataOrThrowsException(govOrgOpenFeignClient.getHouseOption(hform), ServiceConstant.GOV_ORG_SERVER, EpmetErrorCode.SERVER_ERROR.getCode(), null); options = getResultDataOrThrowsException(govOrgOpenFeignClient.getHouseOption(hform), ServiceConstant.GOV_ORG_SERVER, EpmetErrorCode.SERVER_ERROR.getCode(), null, null);
break; break;
case "/gov/org/icneighborhood/neighborhoodoption": case "/gov/org/icneighborhood/neighborhoodoption":
IcNeighborHoodDTO nform = new IcNeighborHoodDTO(); IcNeighborHoodDTO nform = new IcNeighborHoodDTO();
nform.setAgencyId(currUserAgencyId); nform.setAgencyId(currUserAgencyId);
nform.setGridId(cascadeItemColumnWrapper.getColValue()); nform.setGridId(cascadeItemColumnWrapper.getColValue());
options = getResultDataOrThrowsException(govOrgOpenFeignClient.getNeighborHoodOptions(nform), ServiceConstant.GOV_ORG_SERVER, EpmetErrorCode.SERVER_ERROR.getCode(), null); options = getResultDataOrThrowsException(govOrgOpenFeignClient.getNeighborHoodOptions(nform), ServiceConstant.GOV_ORG_SERVER, EpmetErrorCode.SERVER_ERROR.getCode(), null, null);
break; break;
case "/sys/dict/data/education": case "/sys/dict/data/education":
options = getResultDataOrThrowsException(adminOpenFeignClient.getEducationOption(), ServiceConstant.GOV_ORG_SERVER, EpmetErrorCode.SERVER_ERROR.getCode(), null); options = getResultDataOrThrowsException(adminOpenFeignClient.getEducationOption(), ServiceConstant.GOV_ORG_SERVER, EpmetErrorCode.SERVER_ERROR.getCode(), null, null);
break; break;
case "/sys/dict/data/house": case "/sys/dict/data/house":
options = getResultDataOrThrowsException(adminOpenFeignClient.getHouseOption(), ServiceConstant.GOV_ORG_SERVER, EpmetErrorCode.SERVER_ERROR.getCode(), null); options = getResultDataOrThrowsException(adminOpenFeignClient.getHouseOption(), ServiceConstant.GOV_ORG_SERVER, EpmetErrorCode.SERVER_ERROR.getCode(), null, null);
break; break;
case "/sys/dict/data/nation": case "/sys/dict/data/nation":
options = getResultDataOrThrowsException(adminOpenFeignClient.getNationOption(), ServiceConstant.GOV_ORG_SERVER, EpmetErrorCode.SERVER_ERROR.getCode(), null); options = getResultDataOrThrowsException(adminOpenFeignClient.getNationOption(), ServiceConstant.GOV_ORG_SERVER, EpmetErrorCode.SERVER_ERROR.getCode(), null, null);
break; break;
case "/sys/dict/data/ninesmallplaces": case "/sys/dict/data/ninesmallplaces":
options = getResultDataOrThrowsException(adminOpenFeignClient.getNineSmallPlacesOption(), ServiceConstant.GOV_ORG_SERVER, EpmetErrorCode.SERVER_ERROR.getCode(), null); options = getResultDataOrThrowsException(adminOpenFeignClient.getNineSmallPlacesOption(), ServiceConstant.GOV_ORG_SERVER, EpmetErrorCode.SERVER_ERROR.getCode(), null, null);
break; break;
case "/sys/dict/data/relationship": case "/sys/dict/data/relationship":
options = getResultDataOrThrowsException(adminOpenFeignClient.getRelationshipOption(), ServiceConstant.GOV_ORG_SERVER, EpmetErrorCode.SERVER_ERROR.getCode(), null); options = getResultDataOrThrowsException(adminOpenFeignClient.getRelationshipOption(), ServiceConstant.GOV_ORG_SERVER, EpmetErrorCode.SERVER_ERROR.getCode(), null, null);
break; break;
} }

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

@ -832,6 +832,6 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
form.setFormCode(formCode); form.setFormCode(formCode);
form.setCustomerId(customerId); form.setCustomerId(customerId);
Result<List<FormItemResult>> result = operCustomizeOpenFeignClient.listItems(form); Result<List<FormItemResult>> result = operCustomizeOpenFeignClient.listItems(form);
return getResultDataOrThrowsException(result, ServiceConstant.OPER_CUSTOMIZE_SERVER, EpmetErrorCode.SERVER_ERROR.getCode(), "查询表单相关信息失败"); return getResultDataOrThrowsException(result, ServiceConstant.OPER_CUSTOMIZE_SERVER, EpmetErrorCode.SERVER_ERROR.getCode(), "查询表单相关信息失败", null);
} }
} }

Loading…
Cancel
Save