he2802 1 жил өмнө
parent
commit
3004eb02ab

+ 6 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/base/bo/UserProfileQueryBo.java

@@ -1,6 +1,8 @@
 package com.zhongzheng.modules.base.bo;
 
+import com.baomidou.mybatisplus.annotation.TableField;
 import com.zhongzheng.common.annotation.Excel;
+import com.zhongzheng.common.type.EncryptHandler;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
@@ -127,4 +129,8 @@ public class UserProfileQueryBo extends BaseEntity implements Serializable {
 
 	@ApiModelProperty("公司名称")
 	private String companyName;
+
+	/** 身份证号 */
+	@ApiModelProperty("身份证号")
+	private String idCard;
 }

+ 6 - 2
zhongzheng-system/src/main/java/com/zhongzheng/modules/base/service/impl/UserProfileServiceImpl.java

@@ -149,11 +149,15 @@ public class UserProfileServiceImpl extends ServiceImpl<UserProfileMapper, UserP
 
     @Override
     public String querCommitment(UserProfileQueryBo bo) {
-        if(Validator.isEmpty(bo.getUserId())||Validator.isEmpty(bo.getGoodsId())){
+        if(Validator.isEmpty(bo.getIdCard())||Validator.isEmpty(bo.getGoodsId())){
             throw new CustomException("参数缺失");
         }
+        User user = iUserService.getOne(new LambdaQueryWrapper<User>().eq(User::getIdCard, EncryptHandler.encrypt(bo.getIdCard())).last("limit 1"));
+        if (ObjectUtils.isNull(user)){
+            throw new CustomException("用户信息获取有误!");
+        }
         UserProfile profile = getOne(new LambdaQueryWrapper<UserProfile>()
-                .eq(UserProfile::getUserId, bo.getUserId())
+                .eq(UserProfile::getUserId, user.getUserId())
                 .eq(UserProfile::getGoodsId, bo.getGoodsId())
                 .eq(UserProfile::getTypeStatus, 1)
                 .eq(UserProfile::getCurrentStatus, 1)