Ejemplo n.º 1
0
  public long getGuaranteeUserId() {
    try {
      String userBaseId = SessionLocalManager.getSessionLocal().getUserBaseId();
      long userId = SessionLocalManager.getSessionLocal().getUserId();
      Map<String, Object> params = new HashMap<String, Object>();
      params.put("userId", userId);
      long count = userBaseInfoManager.getRolesByUserIdCount(params);
      if (count > 0) {
        List<Role> roles = userBaseInfoManager.getRolesByUserId(params);
        for (Role role : roles) {
          if (SysUserRoleEnum.OPERATOR.getRoleCode().equals(role.getCode())) {
            Map<String, Object> conditions = new HashMap<String, Object>();
            conditions.put("userBaseId", userBaseId);
            conditions.put("limitStart", 0);
            conditions.put("pageSize", 9999);
            List<OperatorInfoDO> operatorInfos =
                operatorInfoService.queryOperatorsByProperties(conditions);
            if (operatorInfos != null && operatorInfos.size() > 0) {
              List<UserBaseInfoDO> curParentJGs =
                  userBaseInfoManager.queryByType(
                      "JG", String.valueOf(operatorInfos.get(0).getParentId()));
              if (curParentJGs != null && curParentJGs.size() > 0) {
                userId = curParentJGs.get(0).getUserId();
              }
            }
          }
        }
      }
      return userId;
    } catch (Exception e) {
      logger.error("获取担保机构userId失败", e);
    }

    return 0;
  }
Ejemplo n.º 2
0
 @RequestMapping("repayDBManager")
 public String repayDBManage(HttpServletResponse response, Model model) throws Exception {
   SessionLocal sessionLocal = SessionLocalManager.getSessionLocal();
   if (sessionLocal != null && sessionLocal.getAccountId() != null) {
     this.initAccountInfo(model);
   }
   return vm_path + "repayDBManager.vm";
 }