Explorar el Código

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

tags/V1.7.0
wanghaoran hace 1 año
padre
commit
6d78641b30
Se han modificado 4 ficheros con 35 adiciones y 0 borrados
  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 Ver fichero

@@ -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);
}


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

+ 5
- 0
tuoheng-api/src/main/java/com/tuoheng/api/entity/request/IdentityQuery.java Ver fichero

@@ -11,4 +11,9 @@ public class IdentityQuery extends BaseQuery {
*/
private Integer tenantId;

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

}

+ 2
- 0
tuoheng-api/src/main/java/com/tuoheng/api/service/IIdentityService.java Ver fichero

@@ -18,4 +18,6 @@ public interface IIdentityService extends IBaseService<Identity> {
JsonResult submit(IdentityApply identityApply);

JsonResult queryPage(IdentityQuery identityQuery);

JsonResult getApplyLast(IdentityQuery identityQuery);
}

+ 16
- 0
tuoheng-api/src/main/java/com/tuoheng/api/service/impl/IdentityServiceImpl.java Ver fichero

@@ -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);
}
}

Cargando…
Cancelar
Guardar