@@ -37,6 +37,18 @@ public class IdentityController { | |||
return identityService.getListInfo(identityQuery); | |||
} | |||
/** | |||
* 获取最新一条身份申请 | |||
* | |||
* @param identityQuery 查询条件 | |||
* @return | |||
*/ | |||
@GetMapping("/getApplyLast") | |||
public JsonResult getApplyLast(IdentityQuery identityQuery) { | |||
return identityService.getApplyLast(identityQuery); | |||
} | |||
/** | |||
* 申请身份-提交 | |||
* |
@@ -11,4 +11,9 @@ public class IdentityQuery extends BaseQuery { | |||
*/ | |||
private Integer tenantId; | |||
/** | |||
* 用户openid | |||
*/ | |||
private String openid; | |||
} |
@@ -18,4 +18,6 @@ public interface IIdentityService extends IBaseService<Identity> { | |||
JsonResult submit(IdentityApply identityApply); | |||
JsonResult queryPage(IdentityQuery identityQuery); | |||
JsonResult getApplyLast(IdentityQuery identityQuery); | |||
} |
@@ -122,4 +122,20 @@ public class IdentityServiceImpl extends BaseServiceImpl<IdentityMapper, Identit | |||
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); | |||
} | |||
} |