This commit is contained in:
77
2024-04-29 23:50:50 +08:00
parent 1a0f5e9e16
commit 2b2c99e744
5 changed files with 35 additions and 11 deletions

View File

@@ -5,11 +5,18 @@ import lombok.Data;
@Data
public class UpdateUserAuthInfoReq {
@Schema(description = "提交学历认证")
private Boolean pushEducationAuth;
/**
* 单身认证
*/
@Schema(description = "单身认证")
private Boolean singlePersonAuth;
@Schema(description = "单身认证JSON数据")
private String singleJson;
/**
* 学历照片
*/
@Schema(description = "提交学历认证")
private Boolean pushEducationAuth;
@Schema(description = "学历照片")
private String educationPic;
@Schema(description = "提交工作认证")

View File

@@ -4,7 +4,6 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.ruoyi.common.exception.ServiceException;
import com.ruoyi.common.helper.LoginHelper;
import com.ruoyi.common.utils.BeanConvertUtil;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.xq.domain.*;
import com.ruoyi.xq.dto.app.common.UserPicturesDTO;
import com.ruoyi.xq.dto.app.user.AddPicturesReq;
@@ -290,6 +289,19 @@ public class CurrentUserManager {
public void updateInfoAuth(UpdateUserAuthInfoReq req) {
Long userId = LoginHelper.getUserId();
User user = userService.getById(userId);
if(BooleanUtils.isTrue(req.getSinglePersonAuth())){ // 单身认证
if(req.getSingleJson() == null){
throw new ServiceException("请上传车辆认证照片");
}
boolean update = userAuthService.update(Wrappers.lambdaUpdate(UserAuth.class)
.eq(UserAuth::getUserId, userId)
.in(UserAuth::getSinglePersonAuth, AuditEnum.NO.getCode(), AuditEnum.FAIL.getCode())
.set(UserAuth::getSinglePersonAuth, AuditEnum.AUDITING.getCode()));
if(!update){
throw new ServiceException("单身认证正在审核中,请勿重复提交");
}
userAuthAuditService.saveAuthAudit(user,UserAuthTypeEnum.SINGLE,null,null,req.getSingleJson());
}
if(BooleanUtils.isTrue(req.getPushCarAuth())){ // 车辆认证
if(req.getCarPic() == null){
throw new ServiceException("请上传车辆认证照片");
@@ -325,7 +337,7 @@ public class CurrentUserManager {
.in(UserAuth::getEducationAuth, AuditEnum.NO.getCode(), AuditEnum.FAIL.getCode())
.set(UserAuth::getEducationAuth, AuditEnum.AUDITING.getCode()));
if(!update){
throw new ServiceException("房产认证正在审核中,请勿重复提交");
throw new ServiceException("学历认证正在审核中,请勿重复提交");
}
userAuthAuditService.saveAuthAudit(user,UserAuthTypeEnum.EDUCATION,req.getEducationPic());
}
@@ -338,7 +350,7 @@ public class CurrentUserManager {
.in(UserAuth::getMarriageAuth, AuditEnum.NO.getCode(), AuditEnum.FAIL.getCode())
.set(UserAuth::getMarriageAuth, AuditEnum.AUDITING.getCode()));
if(!update){
throw new ServiceException("房产认证正在审核中,请勿重复提交");
throw new ServiceException("婚况认证正在审核中,请勿重复提交");
}
userAuthAuditService.saveAuthAudit(user,UserAuthTypeEnum.MARRIAGE,req.getMarriagePic());
}
@@ -355,7 +367,7 @@ public class CurrentUserManager {
.in(UserAuth::getJobAuth, AuditEnum.NO.getCode(), AuditEnum.FAIL.getCode())
.set(UserAuth::getJobAuth, AuditEnum.AUDITING.getCode()));
if(!update){
throw new ServiceException("房产认证正在审核中,请勿重复提交");
throw new ServiceException("工作认证正在审核中,请勿重复提交");
}
String authRemark = String.format("【%s】工作认证", userAuthJobAuthTypeEnum.getText());
userAuthAuditService.saveAuthAudit(user,UserAuthTypeEnum.JOB,req.getJobPic(),authRemark);

View File

@@ -16,11 +16,15 @@ import com.ruoyi.xq.enums.user.UserAuthTypeEnum;
*/
public interface UserAuthAuditService extends IService<UserAuthAudit> {
void saveAuthAudit(User user, UserAuthTypeEnum userAuthType, String pic, String remark);
default void saveAuthAudit(User user, UserAuthTypeEnum userAuthType, String pic, String remark){
saveAuthAudit(user,userAuthType,pic,remark,null);
}
default void saveAuthAudit(User user, UserAuthTypeEnum userAuthType, String pic) {
saveAuthAudit(user,userAuthType,pic, null);
}
void saveAuthAudit(User user, UserAuthTypeEnum userAuthType, String pic, String remark, String authOtherJson);
Page<UserAuthAuditAdminVo> pageAdmin(PageQuery pageQuery, UserAuthAuditAdminVo bo);
void auditSuccess(String ids);

View File

@@ -106,7 +106,7 @@ public class CardAuthRecordServiceImpl extends ServiceImpl<CardAuthRecordMapper,
this.updateById(updateRecord);
if(pass){
userAuthService.update(Wrappers.lambdaUpdate(UserAuth.class)
.eq(UserAuth::getUserId, cardAuthRecord.getUsercode())
.eq(UserAuth::getUserId, cardAuthRecord.getUserId())
.set(UserAuth::getCardNumAuth, AuditEnum.SUCCESS.getCode()));
userAuthService.checkAuthNum(cardAuthRecord.getUserId());
userInfoService.update(Wrappers.lambdaUpdate(UserInfo.class)

View File

@@ -32,7 +32,7 @@ public class UserAuthAuditServiceImpl extends ServiceImpl<UserAuthAuditMapper,Us
private UserAuthService userAuthService;
@Override
public void saveAuthAudit(User user, UserAuthTypeEnum userAuthType, String pic, String remark) {
public void saveAuthAudit(User user, UserAuthTypeEnum userAuthType, String pic, String remark, String authOtherJson) {
UserAuthAudit userAuthAudit = new UserAuthAudit();
userAuthAudit.setUserId(user.getId());
userAuthAudit.setUsercode(user.getUsercode());
@@ -40,6 +40,7 @@ public class UserAuthAuditServiceImpl extends ServiceImpl<UserAuthAuditMapper,Us
userAuthAudit.setAuthPic(pic);
userAuthAudit.setAuthRemark(remark);
userAuthAudit.setAuditStatus(AuditEnum.AUDITING.getCode());
userAuthAudit.setAuthOther(authOtherJson);
this.save(userAuthAudit);
}
@@ -73,8 +74,8 @@ public class UserAuthAuditServiceImpl extends ServiceImpl<UserAuthAuditMapper,Us
userAuthService.update(Wrappers.lambdaUpdate(UserAuth.class)
.eq(UserAuth:: getUserId, userInfoAudit.getUserId())
.set(UserAuth:: getJobAuth, AuditEnum.SUCCESS.getCode())
.set(UserAuth:: getJobPic, userInfoAudit.getAuthPic())
.set(UserAuth:: getJobAuthType, userInfoAudit.getAuthOther()));
.set(UserAuth:: getJobPic, userInfoAudit.getAuthPic()));
// .set(UserAuth:: getJobAuthType, userInfoAudit.getAuthOther()));
userAuthService.checkAuthNum(userInfoAudit.getUserId());
}else if(userInfoAudit.getAuthType().equals(UserAuthTypeEnum.EDUCATION.getCode())){
userAuthService.update(Wrappers.lambdaUpdate(UserAuth.class)