master:开发入驻流程完善;
parent
4f8c6c2d62
commit
ecdb7c4377
|
|
@ -6,6 +6,7 @@ import lombok.Data;
|
||||||
|
|
||||||
import javax.validation.constraints.NotBlank;
|
import javax.validation.constraints.NotBlank;
|
||||||
import javax.validation.constraints.NotNull;
|
import javax.validation.constraints.NotNull;
|
||||||
|
import javax.validation.constraints.Size;
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -20,6 +21,7 @@ public class UserAuthCreateVO {
|
||||||
|
|
||||||
@NotBlank(message = "真实名称不能为空")
|
@NotBlank(message = "真实名称不能为空")
|
||||||
@ApiModelProperty(value = "真实名称", required = true)
|
@ApiModelProperty(value = "真实名称", required = true)
|
||||||
|
@Size(max = 50, message = "真实名称长度不能超过50个字符!")
|
||||||
private String realName;
|
private String realName;
|
||||||
@NotBlank(message = "联系电话不能为空")
|
@NotBlank(message = "联系电话不能为空")
|
||||||
@ApiModelProperty(value = "联系电话", required = true)
|
@ApiModelProperty(value = "联系电话", required = true)
|
||||||
|
|
|
||||||
|
|
@ -4060,7 +4060,7 @@ CREATE TABLE `user_authentication`
|
||||||
(
|
(
|
||||||
`id` bigint UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '代发认证ID',
|
`id` bigint UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '代发认证ID',
|
||||||
`user_id` bigint UNSIGNED NOT NULL COMMENT 'sys_user.id',
|
`user_id` bigint UNSIGNED NOT NULL COMMENT 'sys_user.id',
|
||||||
`real_name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '真实名称',
|
`real_name` varchar(250) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '真实名称',
|
||||||
`id_card` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '身份证号码',
|
`id_card` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '身份证号码',
|
||||||
`id_card_face_file_id` bigint UNSIGNED NULL DEFAULT NULL COMMENT '身份证头像面文件ID',
|
`id_card_face_file_id` bigint UNSIGNED NULL DEFAULT NULL COMMENT '身份证头像面文件ID',
|
||||||
`id_card_emblem_file_id` bigint UNSIGNED NULL DEFAULT NULL COMMENT '身份证国徽面文件ID',
|
`id_card_emblem_file_id` bigint UNSIGNED NULL DEFAULT NULL COMMENT '身份证国徽面文件ID',
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
import com.ruoyi.common.core.domain.XktBaseEntity;
|
import com.ruoyi.common.core.domain.XktBaseEntity;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 用户代发认证对象 user_authentication
|
* 用户代发认证对象 user_authentication
|
||||||
|
|
@ -13,6 +14,7 @@ import lombok.EqualsAndHashCode;
|
||||||
*/
|
*/
|
||||||
@EqualsAndHashCode(callSuper = true)
|
@EqualsAndHashCode(callSuper = true)
|
||||||
@Data
|
@Data
|
||||||
|
@Accessors(chain = true)
|
||||||
public class UserAuthentication extends XktBaseEntity {
|
public class UserAuthentication extends XktBaseEntity {
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,7 @@ import com.ruoyi.common.constant.Constants;
|
||||||
import com.ruoyi.common.constant.HttpStatus;
|
import com.ruoyi.common.constant.HttpStatus;
|
||||||
import com.ruoyi.common.core.page.Page;
|
import com.ruoyi.common.core.page.Page;
|
||||||
import com.ruoyi.common.exception.ServiceException;
|
import com.ruoyi.common.exception.ServiceException;
|
||||||
|
import com.ruoyi.common.utils.SecurityUtils;
|
||||||
import com.ruoyi.xkt.domain.SysFile;
|
import com.ruoyi.xkt.domain.SysFile;
|
||||||
import com.ruoyi.xkt.domain.UserAuthentication;
|
import com.ruoyi.xkt.domain.UserAuthentication;
|
||||||
import com.ruoyi.xkt.dto.userAuthentication.*;
|
import com.ruoyi.xkt.dto.userAuthentication.*;
|
||||||
|
|
@ -16,6 +17,7 @@ import com.ruoyi.xkt.mapper.SysFileMapper;
|
||||||
import com.ruoyi.xkt.mapper.UserAuthenticationMapper;
|
import com.ruoyi.xkt.mapper.UserAuthenticationMapper;
|
||||||
import com.ruoyi.xkt.service.IUserAuthenticationService;
|
import com.ruoyi.xkt.service.IUserAuthenticationService;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.apache.commons.lang3.ObjectUtils;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
|
@ -45,8 +47,20 @@ public class UserAuthenticationServiceImpl implements IUserAuthenticationService
|
||||||
@Override
|
@Override
|
||||||
@Transactional
|
@Transactional
|
||||||
public Integer create(UserAuthCreateDTO createDTO) {
|
public Integer create(UserAuthCreateDTO createDTO) {
|
||||||
UserAuthentication userAuth = BeanUtil.toBean(createDTO, UserAuthentication.class);
|
Long userId = SecurityUtils.getUserIdSafe();
|
||||||
userAuth.setAuthStatus(UserAuthStatus.UN_AUDITED.getValue());
|
if (ObjectUtils.isEmpty(userId)) {
|
||||||
|
throw new ServiceException("用户未登录,请先登录!", HttpStatus.ERROR);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 保存身份证人脸
|
||||||
|
SysFile idCardFace = BeanUtil.toBean(createDTO.getFaceFile(), SysFile.class);
|
||||||
|
this.fileMapper.insert(idCardFace);
|
||||||
|
// 保存身份证国徽
|
||||||
|
SysFile idCardEmblem = BeanUtil.toBean(createDTO.getEmblemFile(), SysFile.class);
|
||||||
|
this.fileMapper.insert(idCardEmblem);
|
||||||
|
UserAuthentication userAuth = new UserAuthentication().setIdCard(createDTO.getIdCard())
|
||||||
|
.setRealName(createDTO.getRealName()).setUserId(userId).setAuthStatus(UserAuthStatus.UN_AUDITED.getValue())
|
||||||
|
.setIdCardFaceFileId(idCardFace.getId()).setIdCardEmblemFileId(idCardEmblem.getId());
|
||||||
return userAuthMapper.insert(userAuth);
|
return userAuthMapper.insert(userAuth);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -35,11 +35,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
u.avatar
|
u.avatar
|
||||||
FROM
|
FROM
|
||||||
user_authentication ua JOIN sys_user u ON ua.user_id = u.user_id
|
user_authentication ua JOIN sys_user u ON ua.user_id = u.user_id
|
||||||
<where>
|
WHERE
|
||||||
|
ua.del_flag = 0 AND ua.auth_status = 3
|
||||||
<if test="realName != null and realName != ''">
|
<if test="realName != null and realName != ''">
|
||||||
AND ua.real_name LIKE concat('%', #{realName}, '%')
|
AND ua.real_name LIKE concat('%', #{realName}, '%')
|
||||||
</if>
|
</if>
|
||||||
</where>
|
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
Loading…
Reference in New Issue