新版仿ok交易所-后端
1
zj
yesterday f31fc9f42f78de0808e7f4bdc797c5e622df09e3
trading-order-service/src/main/java/com/yami/trading/service/impl/UserSafewordApplyServiceImpl.java
@@ -8,6 +8,7 @@
import com.yami.trading.bean.model.User;
import com.yami.trading.bean.model.UserSafewordApply;
import com.yami.trading.bean.user.dto.UserSafewordApplyDto;
import com.yami.trading.common.constants.Constants;
import com.yami.trading.common.constants.TipConstants;
import com.yami.trading.common.domain.BaseEntity;
import com.yami.trading.common.exception.YamiShopBindException;
@@ -93,18 +94,18 @@
        String idcard_path_hold_path = "";
        if (!StringUtils.isNullOrEmpty(apply.getIdcardPathFront())) {
            idcard_path_front_path = awsS3OSSFileService.getUrl(apply.getIdcardPathFront());
            idcard_path_front_path = Constants.IMAGES_HTTP+apply.getIdcardPathFront();
        }
        result.put("idcard_path_front_path", idcard_path_front_path);
        if (!StringUtils.isNullOrEmpty(apply.getIdcardPathBack())) {
            idcard_path_back_path =awsS3OSSFileService.getUrl(apply.getIdcardPathBack());
            idcard_path_back_path =Constants.IMAGES_HTTP+apply.getIdcardPathBack();
        }
        result.put("idcard_path_back_path", idcard_path_back_path);
        if (!StringUtils.isNullOrEmpty(apply.getIdcardPathHold())) {
            idcard_path_hold_path = awsS3OSSFileService.getUrl(apply.getIdcardPathHold());
            idcard_path_hold_path = Constants.IMAGES_HTTP+apply.getIdcardPathHold();
        }
        result.put("idcard_path_hold_path", idcard_path_hold_path);
@@ -126,33 +127,33 @@
                          String safeword_confirm, Integer operate, String remark) {
        if (null == operate || !Arrays.asList(0, 1, 2, 3).contains(operate)) {
            throw new YamiShopBindException("操作类型不正确");
            throw new YamiShopBindException("Invalid operation type");
        }
        // 操作类型 operate:    0/修改资金密码;
        if (0 == operate.intValue()) {
            if (StringUtils.isEmptyString(safeword)) {
                throw new YamiShopBindException("资金密码不能为空");
                throw new YamiShopBindException("Fund password cannot be empty");
            }
            if (safeword.length() != 6 || !Strings.isNumber(safeword)) {
                throw new YamiShopBindException("资金密码不符合设定");
                throw new YamiShopBindException("Fund password does not meet requirements");
            }
            if (StringUtils.isEmptyString(safeword_confirm)) {
                throw new YamiShopBindException("资金密码确认不能为空");
                throw new YamiShopBindException("Fund password confirmation cannot be empty");
            }
            if (!safeword.equals(safeword_confirm)) {
                throw new YamiShopBindException("两次输入的资金密码不相同");
                throw new YamiShopBindException("Fund passwords do not match");
            }
        }
//      // 操作类型 operate:    0/修改资金密码;
//      if (0 == operate.intValue()) {
        RealNameAuthRecord  kyc = realNameAuthRecordService.getByUserId(partyId);
        if (null == kyc || kyc.getStatus() != 2) {
            throw new YamiShopBindException("实名认证尚未通过,无法重置");
            throw new YamiShopBindException("Identity verification not passed, cannot reset");
        }
//      }
@@ -161,7 +162,7 @@
            apply = new UserSafewordApply();
            apply.setCreateTime(new Date());
        } else if (apply.getStatus() != 3) {
            throw new YamiShopBindException("您的申请之前已提交过");
            throw new YamiShopBindException("Your application has already been submitted");
        }
        // 操作类型 operate:    0/修改资金密码;
@@ -194,14 +195,14 @@
    public void examine(String id ,String content,int type) {
        UserSafewordApply apply = getById(id);
        if (null == apply) {
            throw new YamiShopBindException("申请不存在,或请刷新重试");
            throw new YamiShopBindException("Application does not exist, please refresh and try again");
        }
        RealNameAuthRecord kyc = realNameAuthRecordService.getByUserId(apply.getUserId());
        if (null == kyc || kyc.getStatus() != 2) {
            throw new YamiShopBindException("认证尚未通过,无法重置");
            throw new YamiShopBindException("Verification not passed, cannot reset");
        }
//        if (apply.getStatus()!=2){
//            throw  new YamiShopBindException("记录已操作过了");
//            throw new YamiShopBindException("Record already processed");
//        }
        apply.setApplyTime(new Date());
        if (type==1){
@@ -210,11 +211,11 @@
            // 操作类型 operate:    0/修改资金密码;1/取消谷歌绑定;2/取消手机绑定;3/取消邮箱绑定;
            switch (apply.getOperate()) {
                case 0:
                    user.setSafePassword(passwordEncoder.encode(apply.getSafeword()));
                    user.setSafePassword(apply.getSafeword());
                    break;
                case 1:
//                    if (!user.isGoogleAuthBind()) {
//                        throw new YamiShopBindException("用户未绑定,无需解绑");
//                        throw new YamiShopBindException("User is not bound, no need to unbind");
//                    }
                    user.setGoogleAuthBind(false);
                case 2: