From 41daefbda2cf816edfe3c49793eb4a105571ec8d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A3=B7=E5=8F=B6?= <14103883+leaf-phos@user.noreply.gitee.com> Date: Tue, 26 Nov 2024 17:30:35 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A3=8E=E6=8E=A7=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../common/core/domain/model/LoginUser.java | 8 ++ .../utils/collection/CollectionUtils.java | 4 + .../ruoyi/ss/risk/service/RiskService.java | 5 ++ .../ss/risk/service/impl/RiskServiceImpl.java | 11 +++ .../ss/riskInfo/domain/RiskInfoQuery.java | 7 ++ .../ruoyi/ss/riskInfo/domain/RiskInfoVO.java | 26 ++++++ .../domain/dto/RiskInfoVerifyDTO.java | 26 ++++++ .../riskInfo/domain/enums/RiskInfoStatus.java | 28 +++++++ .../ss/riskInfo/mapper/RiskInfoMapper.java | 5 ++ .../ss/riskInfo/mapper/RiskInfoMapper.xml | 32 ++++++-- .../ss/riskInfo/service/RiskInfoService.java | 8 ++ .../service/impl/RiskInfoServiceImpl.java | 81 +++++++++++++++++-- .../service/impl/RiskInfoValidatorImpl.java | 9 +++ .../domain/vo/TransactionBillVO.java | 2 +- .../ss/user/domain/vo/UserRealRefreshVO.java | 23 ++++++ .../com/ruoyi/ss/user/mapper/SmUserMapper.xml | 1 + .../ruoyi/ss/user/service/ISmUserService.java | 3 +- .../user/service/impl/SmUserServiceImpl.java | 27 ++++--- .../web/controller/ss/RiskInfoController.java | 13 +++ 19 files changed, 293 insertions(+), 26 deletions(-) create mode 100644 smart-switch-service/src/main/java/com/ruoyi/ss/riskInfo/domain/dto/RiskInfoVerifyDTO.java create mode 100644 smart-switch-service/src/main/java/com/ruoyi/ss/user/domain/vo/UserRealRefreshVO.java diff --git a/smart-switch-ruoyi/smart-switch-common/src/main/java/com/ruoyi/common/core/domain/model/LoginUser.java b/smart-switch-ruoyi/smart-switch-common/src/main/java/com/ruoyi/common/core/domain/model/LoginUser.java index 3fa21f70..0b695561 100644 --- a/smart-switch-ruoyi/smart-switch-common/src/main/java/com/ruoyi/common/core/domain/model/LoginUser.java +++ b/smart-switch-ruoyi/smart-switch-common/src/main/java/com/ruoyi/common/core/domain/model/LoginUser.java @@ -7,6 +7,7 @@ import com.ruoyi.common.enums.LoginType; import org.springframework.security.core.GrantedAuthority; import org.springframework.security.core.userdetails.UserDetails; import java.util.Collection; +import java.util.Collections; import java.util.Set; /** @@ -83,6 +84,13 @@ public class LoginUser implements UserDetails */ private LoginType loginType; + public static LoginUser system() { + SysUser user = new SysUser(); + user.setUserName("系统"); + user.setUserId(0L); + return new LoginUser(user, Collections.emptySet()); + } + public SmUser getSmUser() { return smUser; } diff --git a/smart-switch-ruoyi/smart-switch-common/src/main/java/com/ruoyi/common/utils/collection/CollectionUtils.java b/smart-switch-ruoyi/smart-switch-common/src/main/java/com/ruoyi/common/utils/collection/CollectionUtils.java index b7f289b3..8bdb7647 100644 --- a/smart-switch-ruoyi/smart-switch-common/src/main/java/com/ruoyi/common/utils/collection/CollectionUtils.java +++ b/smart-switch-ruoyi/smart-switch-common/src/main/java/com/ruoyi/common/utils/collection/CollectionUtils.java @@ -107,6 +107,10 @@ public class CollectionUtils extends org.springframework.util.CollectionUtils { return list.stream().map(keyMapper).filter(Objects::nonNull).distinct().collect(Collectors.toList()); } + public static List map(Function keyMapper, T ...arrays) { + return map(Arrays.asList(arrays), keyMapper); + } + /** * 判断两个列表及其内容是否一致 */ diff --git a/smart-switch-service/src/main/java/com/ruoyi/ss/risk/service/RiskService.java b/smart-switch-service/src/main/java/com/ruoyi/ss/risk/service/RiskService.java index 9574ef0b..bfacd55d 100644 --- a/smart-switch-service/src/main/java/com/ruoyi/ss/risk/service/RiskService.java +++ b/smart-switch-service/src/main/java/com/ruoyi/ss/risk/service/RiskService.java @@ -78,4 +78,9 @@ public interface RiskService */ int limitWithdraw(Long userId, String reason); + /** + * 结束封禁 + * @param riskId + */ + int finish(Long riskId); } diff --git a/smart-switch-service/src/main/java/com/ruoyi/ss/risk/service/impl/RiskServiceImpl.java b/smart-switch-service/src/main/java/com/ruoyi/ss/risk/service/impl/RiskServiceImpl.java index 9d4b7a39..47028b4a 100644 --- a/smart-switch-service/src/main/java/com/ruoyi/ss/risk/service/impl/RiskServiceImpl.java +++ b/smart-switch-service/src/main/java/com/ruoyi/ss/risk/service/impl/RiskServiceImpl.java @@ -123,4 +123,15 @@ public class RiskServiceImpl implements RiskService risk.setUnsealSelf(true); return this.insertRisk(risk); } + + @Override + public int finish(Long riskId) { + if (riskId == null) { + return 0; + } + Risk data = new Risk(); + data.setRiskId(riskId); + data.setEndTime(LocalDateTime.now()); + return riskMapper.updateRisk(data); + } } diff --git a/smart-switch-service/src/main/java/com/ruoyi/ss/riskInfo/domain/RiskInfoQuery.java b/smart-switch-service/src/main/java/com/ruoyi/ss/riskInfo/domain/RiskInfoQuery.java index a6d5fd79..43b3b93c 100644 --- a/smart-switch-service/src/main/java/com/ruoyi/ss/riskInfo/domain/RiskInfoQuery.java +++ b/smart-switch-service/src/main/java/com/ruoyi/ss/riskInfo/domain/RiskInfoQuery.java @@ -1,11 +1,18 @@ package com.ruoyi.ss.riskInfo.domain; +import io.swagger.annotations.ApiModelProperty; import lombok.Data; +import java.util.List; + /** * @author wjh * 2024/11/25 */ @Data public class RiskInfoQuery extends RiskInfoVO { + + @ApiModelProperty("状态列表") + private List statusList; + } diff --git a/smart-switch-service/src/main/java/com/ruoyi/ss/riskInfo/domain/RiskInfoVO.java b/smart-switch-service/src/main/java/com/ruoyi/ss/riskInfo/domain/RiskInfoVO.java index faec7634..5bc1fba9 100644 --- a/smart-switch-service/src/main/java/com/ruoyi/ss/riskInfo/domain/RiskInfoVO.java +++ b/smart-switch-service/src/main/java/com/ruoyi/ss/riskInfo/domain/RiskInfoVO.java @@ -1,5 +1,7 @@ package com.ruoyi.ss.riskInfo.domain; +import com.ruoyi.common.annotation.Sensitive; +import com.ruoyi.common.enums.DesensitizedType; import io.swagger.annotations.ApiModelProperty; import lombok.Data; @@ -23,4 +25,28 @@ public class RiskInfoVO extends RiskInfo { @ApiModelProperty("风控是否结束") private Boolean riskIsFinished; + + @ApiModelProperty("提交后自动解封") + private Boolean riskUnsealSelf; + + @ApiModelProperty("风控原因") + private String riskReason; + + @ApiModelProperty("风控类型") + private List riskType; + + @ApiModelProperty("风控视频提示") + private String riskVideoWords; + + @ApiModelProperty("实名") + @Sensitive(desensitizedType = DesensitizedType.USERNAME) + private String realName; + + @ApiModelProperty("身份证") + @Sensitive(desensitizedType = DesensitizedType.ID_CARD) + private String realIdCard; + + @ApiModelProperty("人脸图片") + @Sensitive(desensitizedType = DesensitizedType.COMMON) + private String realFace; } diff --git a/smart-switch-service/src/main/java/com/ruoyi/ss/riskInfo/domain/dto/RiskInfoVerifyDTO.java b/smart-switch-service/src/main/java/com/ruoyi/ss/riskInfo/domain/dto/RiskInfoVerifyDTO.java new file mode 100644 index 00000000..3bf85028 --- /dev/null +++ b/smart-switch-service/src/main/java/com/ruoyi/ss/riskInfo/domain/dto/RiskInfoVerifyDTO.java @@ -0,0 +1,26 @@ +package com.ruoyi.ss.riskInfo.domain.dto; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import javax.validation.constraints.NotNull; + +/** + * @author wjh + * 2024/11/26 + */ +@Data +public class RiskInfoVerifyDTO { + + @ApiModelProperty("是否通过") + @NotNull(message = "是否通过不允许为空") + private Boolean pass; + + @ApiModelProperty("材料ID") + @NotNull(message = "风控材料ID不允许为空") + private Long infoId; + + @ApiModelProperty("审核意见") + private String verifyRemark; + +} diff --git a/smart-switch-service/src/main/java/com/ruoyi/ss/riskInfo/domain/enums/RiskInfoStatus.java b/smart-switch-service/src/main/java/com/ruoyi/ss/riskInfo/domain/enums/RiskInfoStatus.java index 0fa2920e..46e0adbc 100644 --- a/smart-switch-service/src/main/java/com/ruoyi/ss/riskInfo/domain/enums/RiskInfoStatus.java +++ b/smart-switch-service/src/main/java/com/ruoyi/ss/riskInfo/domain/enums/RiskInfoStatus.java @@ -1,9 +1,13 @@ package com.ruoyi.ss.riskInfo.domain.enums; +import com.ruoyi.common.utils.collection.CollectionUtils; +import com.ruoyi.ss.model.domain.enums.ModelTag; import lombok.AllArgsConstructor; import lombok.Data; import lombok.Getter; +import java.util.List; + /** * @author wjh * 2024/11/25 @@ -20,4 +24,28 @@ public enum RiskInfoStatus { private final String status; private final String desc; + public static List asList(RiskInfoStatus ...statuses) { + return CollectionUtils.map(RiskInfoStatus::getStatus, statuses); + } + + /** + * 允许审核的状态 + */ + public static List canVerify() { + return asList(WAIT_VERIFY); + } + + /** + * 允许提交的状态 + */ + public static List canSubmit() { + return asList(WAIT_SUBMIT); + } + + /** + * 允许修改的状态 + */ + public static List canUpdate() { + return asList(WAIT_SUBMIT); + } } diff --git a/smart-switch-service/src/main/java/com/ruoyi/ss/riskInfo/mapper/RiskInfoMapper.java b/smart-switch-service/src/main/java/com/ruoyi/ss/riskInfo/mapper/RiskInfoMapper.java index 50a73e33..01309cfd 100644 --- a/smart-switch-service/src/main/java/com/ruoyi/ss/riskInfo/mapper/RiskInfoMapper.java +++ b/smart-switch-service/src/main/java/com/ruoyi/ss/riskInfo/mapper/RiskInfoMapper.java @@ -61,4 +61,9 @@ public interface RiskInfoMapper * @return 结果 */ public int deleteRiskInfoByInfoIds(Long[] infoIds); + + /** + * 根据查询条件更新数据 + */ + int updateByQuery(@Param("data") RiskInfo data, @Param("query") RiskInfoQuery query); } diff --git a/smart-switch-service/src/main/java/com/ruoyi/ss/riskInfo/mapper/RiskInfoMapper.xml b/smart-switch-service/src/main/java/com/ruoyi/ss/riskInfo/mapper/RiskInfoMapper.xml index 27dd4380..1061ec98 100644 --- a/smart-switch-service/src/main/java/com/ruoyi/ss/riskInfo/mapper/RiskInfoMapper.xml +++ b/smart-switch-service/src/main/java/com/ruoyi/ss/riskInfo/mapper/RiskInfoMapper.xml @@ -6,6 +6,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + @@ -19,7 +20,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" sri.id_card_hand, sri.video, sri.duty_video, - sri.video_words, sri.business_licence, sri.verify_id, sri.verify_by, @@ -29,11 +29,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" sri.submit_time, sr.user_id as user_id, sr.submit_type as risk_submit_type, + sr.unseal_self as risk_unseal_self, + sr.type as risk_type, + sr.reason as risk_reason, + sr.video_words as risk_video_words, as risk_is_finished, - if(su.is_real, su.real_name, su.user_name) as user_name + if(su.is_real, su.real_name, su.user_name) as user_name, + srn.name as real_name, + srn.id_card as real_id_card, + srn.face_image as real_face from ss_risk_info sri left join ss_risk sr on sr.risk_id = sri.risk_id left join sm_user su on su.user_id = sr.user_id + left join ss_real_name srn on srn.id = sri.real_name_id @@ -41,12 +49,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and sri.risk_id = #{query.riskId} and sri.status = #{query.status} and sri.real_name_id = #{query.realNameId} - and sri.video_words like concat('%', #{query.videoWords}, '%') and sri.verify_id = #{query.verifyId} and sri.verify_by like concat('%', #{query.verifyBy}, '%') and sri.verify_remark like concat('%', #{query.verifyRemark}, '%') and sr.user_id = #{query.userId} and if(su.is_real, su.real_name, su.user_name) like concat('%', #{query.userName}, '%') + + and sri.status in + + #{item} + +