|
@ -137,7 +137,7 @@ public class CustomerFunctionDetailServiceImpl extends BaseServiceImpl<CustomerF |
|
|
* @Description 根据所属端和客户Id查询客户定制功能列表 |
|
|
* @Description 根据所属端和客户Id查询客户定制功能列表 |
|
|
**/ |
|
|
**/ |
|
|
@Override |
|
|
@Override |
|
|
public List<FunctionDetailResultDTO> resiFunctionDetail(FunctionDetailFromDTO formDTO) { |
|
|
public List<FunctionDetailResultDTO> resiAndWorkFunctionDetail(FunctionDetailFromDTO formDTO) { |
|
|
List<FunctionDetailResultDTO> restltList = new LinkedList<>(); |
|
|
List<FunctionDetailResultDTO> restltList = new LinkedList<>(); |
|
|
//1.根据客户Id和所属端查询客户定制功能列表数据
|
|
|
//1.根据客户Id和所属端查询客户定制功能列表数据
|
|
|
logger.info(String.format("根据客户Id和所属端查询客户定制功能列表,对应客户Id->%s,所属端->%s", formDTO.getCustomerId(), formDTO.getClientType())); |
|
|
logger.info(String.format("根据客户Id和所属端查询客户定制功能列表,对应客户Id->%s,所属端->%s", formDTO.getCustomerId(), formDTO.getClientType())); |
|
@ -158,61 +158,14 @@ public class CustomerFunctionDetailServiceImpl extends BaseServiceImpl<CustomerF |
|
|
//2.调用user服务,获取用户角色信息
|
|
|
//2.调用user服务,获取用户角色信息
|
|
|
GetRoleKeyListFormDTO dto = new GetRoleKeyListFormDTO(); |
|
|
GetRoleKeyListFormDTO dto = new GetRoleKeyListFormDTO(); |
|
|
dto.setUserId(formDTO.getUserId()); |
|
|
dto.setUserId(formDTO.getUserId()); |
|
|
|
|
|
dto.setFromApp(formDTO.getClientType()); |
|
|
|
|
|
//居民端需要传网格Id 热心居民的角色是在网格里的
|
|
|
|
|
|
if(AppClientConstant.APP_RESI.equals(formDTO.getClientType())){ |
|
|
dto.setGridId(formDTO.getGridId()); |
|
|
dto.setGridId(formDTO.getGridId()); |
|
|
dto.setFromApp(AppClientConstant.APP_RESI); |
|
|
|
|
|
Result<List<String>> result = epmetUserOpenFeignClient.getUserRoleKeyList(dto); |
|
|
|
|
|
if (!result.success()) { |
|
|
|
|
|
throw new RenException(result.getCode()); |
|
|
|
|
|
} |
|
|
|
|
|
formDTO.setRoleKeyList(result.getData()); |
|
|
|
|
|
|
|
|
|
|
|
//3.根据用户拥有的角色查询客户的定制功能
|
|
|
|
|
|
List<String> listFunctionIds = customerFunctionRoleDao.selectFunctionList(formDTO); |
|
|
|
|
|
|
|
|
|
|
|
//4.封装结果数据
|
|
|
|
|
|
listFunctionIds.forEach(id -> { |
|
|
|
|
|
list.forEach(l -> { |
|
|
|
|
|
if (id.equals(l.getFunctionId())) { |
|
|
|
|
|
restltList.add(l); |
|
|
|
|
|
} |
|
|
|
|
|
}); |
|
|
|
|
|
}); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return restltList; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* @param formDTO |
|
|
|
|
|
* @return |
|
|
|
|
|
* @Author sun |
|
|
|
|
|
* @Description 根据所属端和客户Id查询客户定制功能列表 |
|
|
|
|
|
**/ |
|
|
|
|
|
@Override |
|
|
|
|
|
public List<FunctionDetailResultDTO> workFunctionDetail(FunctionDetailFromDTO formDTO) { |
|
|
|
|
|
List<FunctionDetailResultDTO> restltList = new LinkedList<>(); |
|
|
|
|
|
//1.根据客户Id和所属端查询客户定制功能列表数据
|
|
|
|
|
|
logger.info(String.format("根据客户Id和所属端查询客户定制功能列表,对应客户Id->%s,所属端->%s", formDTO.getCustomerId(), formDTO.getClientType())); |
|
|
|
|
|
List<FunctionDetailResultDTO> list = baseDao.selectFunctionDetailList(formDTO); |
|
|
|
|
|
if (null != list && list.size() > NumConstant.ZERO) { |
|
|
|
|
|
//1-1.设置自定义json数据(暂时为空)
|
|
|
|
|
|
try { |
|
|
|
|
|
String join = String.join(",", new ArrayList<>()); |
|
|
|
|
|
String customerParameter = java.net.URLEncoder.encode(join, "utf-8"); |
|
|
|
|
|
list.forEach(l->{ |
|
|
|
|
|
l.setCustomerParameter(customerParameter); |
|
|
|
|
|
}); |
|
|
|
|
|
} catch (Exception e) { |
|
|
|
|
|
logger.error("CustomerFunctionDetailServiceImpl.resiAndWorkFunctionDetail->集合参数URLEncode失败"); |
|
|
|
|
|
throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode(), e.getMessage()); |
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
//2.调用user服务,获取用户角色信息
|
|
|
|
|
|
GetRoleKeyListFormDTO dto = new GetRoleKeyListFormDTO(); |
|
|
|
|
|
dto.setUserId(formDTO.getUserId()); |
|
|
|
|
|
dto.setFromApp(AppClientConstant.APP_GOV); |
|
|
|
|
|
Result<List<String>> result = epmetUserOpenFeignClient.getUserRoleKeyList(dto); |
|
|
Result<List<String>> result = epmetUserOpenFeignClient.getUserRoleKeyList(dto); |
|
|
if (!result.success()) { |
|
|
if (!result.success()) { |
|
|
|
|
|
logger.error(String.format("调用user服务,获取用户角色信息失败,用户Id:%s ,所属端:%s", formDTO.getUserId(), formDTO.getClientType())); |
|
|
throw new RenException(result.getCode()); |
|
|
throw new RenException(result.getCode()); |
|
|
} |
|
|
} |
|
|
formDTO.setRoleKeyList(result.getData()); |
|
|
formDTO.setRoleKeyList(result.getData()); |
|
|