Browse Source

查询最新一条身份申请 接口

tags/V1.7.0
wanghaoran 1 year ago
parent
commit
6d78641b30
4 changed files with 35 additions and 0 deletions
  1. +12
    -0
      tuoheng-api/src/main/java/com/tuoheng/api/controller/IdentityController.java
  2. +5
    -0
      tuoheng-api/src/main/java/com/tuoheng/api/entity/request/IdentityQuery.java
  3. +2
    -0
      tuoheng-api/src/main/java/com/tuoheng/api/service/IIdentityService.java
  4. +16
    -0
      tuoheng-api/src/main/java/com/tuoheng/api/service/impl/IdentityServiceImpl.java

+ 12
- 0
tuoheng-api/src/main/java/com/tuoheng/api/controller/IdentityController.java View File

return identityService.getListInfo(identityQuery); return identityService.getListInfo(identityQuery);
} }


/**
* 获取最新一条身份申请
*
* @param identityQuery 查询条件
* @return
*/
@GetMapping("/getApplyLast")
public JsonResult getApplyLast(IdentityQuery identityQuery) {
return identityService.getApplyLast(identityQuery);
}


/** /**
* 申请身份-提交 * 申请身份-提交
* *

+ 5
- 0
tuoheng-api/src/main/java/com/tuoheng/api/entity/request/IdentityQuery.java View File

*/ */
private Integer tenantId; private Integer tenantId;


/**
* 用户openid
*/
private String openid;

} }

+ 2
- 0
tuoheng-api/src/main/java/com/tuoheng/api/service/IIdentityService.java View File

JsonResult submit(IdentityApply identityApply); JsonResult submit(IdentityApply identityApply);


JsonResult queryPage(IdentityQuery identityQuery); JsonResult queryPage(IdentityQuery identityQuery);

JsonResult getApplyLast(IdentityQuery identityQuery);
} }

+ 16
- 0
tuoheng-api/src/main/java/com/tuoheng/api/service/impl/IdentityServiceImpl.java View File



return JsonResult.success(pageData); return JsonResult.success(pageData);
} }

@Override
public JsonResult getApplyLast(IdentityQuery identityQuery) {
if(null == identityQuery.getTenantId() || StringUtils.isEmpty(identityQuery.getOpenid())){
return JsonResult.error("参数为空!");
}

IdentityApply identityApply = identityApplyMapper.selectOne(new LambdaQueryWrapper<IdentityApply>()
.eq(IdentityApply::getTenantId, identityQuery.getTenantId())
.eq(IdentityApply::getApplyOpenid, identityQuery.getOpenid())
.eq(IdentityApply::getMark, 1)
.orderByDesc(IdentityApply::getCreateTime)
.last("limit 1"));

return JsonResult.success(identityApply);
}
} }

Loading…
Cancel
Save