2
0

fix: return kyc status in user

This commit is contained in:
zhangsz
2025-02-12 16:09:56 +08:00
parent 90cf0947be
commit 5814f4d7ec
8 changed files with 59 additions and 29 deletions

View File

@@ -1,8 +1,6 @@
package org.wfc.user.domain;
package org.wfc.user.api.domain;
import com.baomidou.mybatisplus.annotation.TableName;
import org.wfc.common.mybatis.domain.BaseData;
import io.swagger.v3.oas.annotations.media.Schema;
import org.wfc.common.core.web.domain.BaseEntity;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
@@ -14,37 +12,27 @@ import lombok.NoArgsConstructor;
@AllArgsConstructor
@Builder
@EqualsAndHashCode(callSuper = true)
@TableName("u_kyc")
@Schema(name = "UKyc", description = "User portal: u_kyc table")
public class UKyc extends BaseData {
public class UKyc extends BaseEntity {
private static final long serialVersionUID = 1L;
@Schema(description = "KYC ID")
private Long kycId;
@Schema(description = "User ID")
private Long userId;
@Schema(description = "Real Name")
private String realName;
@Schema(description = "Birth Date")
private String birthDate;
@Schema(description = "Identify Type")
private Integer idType;
@Schema(description = "Identify File")
private String idFile;
@Schema(description = "Identify Picture")
private String identifyPicture;
@Schema(description = "Status")
private Integer status;
@Schema(description = "Description")
private String description;
// @Schema(description = "Create Time")

View File

@@ -101,6 +101,10 @@ public class UUser extends BaseEntity
/** 角色ID */
private Long roleId;
/** User KYC Info */
@Excel(name = "KYC Status",readConverterExp = "1=VERIFIED,2=UNVERIFIED,3=PENDING,4=REJECTED", type = Type.EXPORT)
private String kycStatus;
public UUser()
{
@@ -332,6 +336,15 @@ public class UUser extends BaseEntity
{
this.roleId = roleId;
}
public String getKycStatus() {
return kycStatus;
}
public void setKycStatus(String kycStatus) {
this.kycStatus = kycStatus;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
@@ -354,6 +367,7 @@ public class UUser extends BaseEntity
.append("updateTime", getUpdateTime())
.append("remark", getRemark())
.append("dept", getDept())
.append("kycStatus", getKycStatus())
.toString();
}
}

View File

@@ -13,12 +13,14 @@ import org.wfc.common.core.web.domain.AjaxResult;
import org.wfc.common.core.web.page.TableDataInfo;
import org.wfc.common.log.annotation.Log;
import org.wfc.common.log.enums.BusinessType;
import org.wfc.user.domain.UKyc;
import org.wfc.user.api.domain.UKyc;
import org.wfc.user.domain.constant.KycStatusEnum;
import org.wfc.user.domain.vo.UKycUserVo;
import org.wfc.user.service.IUKycService;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* <p>
@@ -42,6 +44,13 @@ public class UKycController extends BaseController {
return getDataTable(list);
}
// @RequiresPermissions("Utem:kyc:query")
@GetMapping("/list")
public AjaxResult list() {
List<UKycUserVo> kyc = uKycService.selectKycByUserId();
return AjaxResult.success(kyc);
}
// @RequiresPermissions("Utem:kyc:add")
// @Log(title = "User Management", businessType = BusinessType.INSERT)
@PostMapping("/verify")

View File

@@ -2,7 +2,7 @@ package org.wfc.user.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.wfc.user.domain.UKyc;
import org.wfc.user.api.domain.UKyc;
import org.wfc.user.domain.vo.UKycUserVo;
import java.util.List;

View File

@@ -18,7 +18,7 @@ public interface UUserMapper
* @param UUser 用户信息
* @return 用户信息集合信息
*/
public List<UUser> selectUserList(UUser UUser);
public List<UUser> selectUserList(UUser user);
/**
* 根据条件分页查询已配用户角色列表

View File

@@ -1,7 +1,7 @@
package org.wfc.user.service;
import com.baomidou.mybatisplus.extension.service.IService;
import org.wfc.user.domain.UKyc;
import org.wfc.user.api.domain.UKyc;
import org.wfc.user.domain.vo.UKycUserVo;
import java.util.List;

View File

@@ -10,7 +10,7 @@ import org.wfc.common.core.domain.LoginUser;
import org.wfc.common.core.utils.MessageUtils;
import org.wfc.common.security.utils.SecurityUtils;
import org.wfc.user.api.domain.UUser;
import org.wfc.user.domain.UKyc;
import org.wfc.user.api.domain.UKyc;
import org.wfc.user.domain.vo.UKycUserVo;
import org.wfc.user.mapper.UKycMapper;
import org.wfc.user.service.IUKycService;

View File

@@ -23,9 +23,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="remark" column="remark" />
<result property="fullName" column="full_name" />
<result property="age" column="age" />
<result property="address" column="address" />
<result property="fullName" column="full_name" />
<result property="age" column="age" />
<result property="address" column="address" />
<result property="kycStatus" column="kyc_status" />
<association property="dept" javaType="UDept" resultMap="deptResult" />
<collection property="roles" javaType="java.util.List" resultMap="RoleResult" />
</resultMap>
@@ -48,20 +49,38 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="dataScope" column="data_scope" />
<result property="status" column="role_status" />
</resultMap>
<resultMap id="UKycResult" type="UKyc">
<id property="kycId" column="kyc_id" />
<result property="userId" column="user_id" />
<result property="realName" column="real_name" />
<result property="birthDate" column="birth_date" />
<result property="idType" column="id_type" />
<result property="idFile" column="id_file" />
<result property="identifyPicture" column="identify_picture" />
<result property="status" column="kyc_status" />
<result property="description" column="description" />
</resultMap>
<sql id="selectUserVo">
select u.user_id, u.dept_id, u.user_name, u.nick_name, u.full_name, u.email, u.avatar, u.phonenumber, u.password, u.sex, u.age, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark,
d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.order_num, d.leader, d.status as dept_status,
r.role_id, r.role_name, r.role_key, r.role_sort, r.data_scope, r.status as role_status
d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.order_num, d.leader, d.status as dept_status,
r.role_id, r.role_name, r.role_key, r.role_sort, r.data_scope, r.status as role_status,
k.status as kyc_status
from u_user u
left join u_dept d on u.dept_id = d.dept_id
left join u_user_role ur on u.user_id = ur.user_id
left join u_role r on r.role_id = ur.role_id
left join u_kyc k on u.user_id = k.user_id
</sql>
<select id="selectUserList" parameterType="UUser" resultMap="UUserResult">
select u.user_id, u.dept_id, u.nick_name, u.user_name, u.full_name, u.email, u.avatar, u.phonenumber, u.sex, u.age, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark, d.dept_name, d.leader from u_user u
left join u_dept d on u.dept_id = d.dept_id
select u.user_id, u.dept_id, u.nick_name, u.user_name, u.full_name, u.email, u.avatar, u.phonenumber, u.sex, u.age, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark,
d.dept_name, d.leader,
k.status as kyc_status
from u_user u
left join u_dept d on u.dept_id = d.dept_id
left join u_kyc k on u.user_id = k.user_id
where u.del_flag = '0'
<if test="userId != null and userId != 0">
AND u.user_id = #{userId}