From f8034d74a80c0ccc989bd79dc864dbf7cb02d03c Mon Sep 17 00:00:00 2001 From: Helius <wangdoubleone@gmail.com> Date: Thu, 20 May 2021 19:50:37 +0800 Subject: [PATCH] modify --- src/main/java/com/xcong/excoin/modules/member/service/impl/MemberServiceImpl.java | 34 ++++++++++++++++++++++++++++++++++ 1 files changed, 34 insertions(+), 0 deletions(-) diff --git a/src/main/java/com/xcong/excoin/modules/member/service/impl/MemberServiceImpl.java b/src/main/java/com/xcong/excoin/modules/member/service/impl/MemberServiceImpl.java index 34ce5af..bcd9111 100644 --- a/src/main/java/com/xcong/excoin/modules/member/service/impl/MemberServiceImpl.java +++ b/src/main/java/com/xcong/excoin/modules/member/service/impl/MemberServiceImpl.java @@ -539,6 +539,10 @@ Long memberId = LoginUserUtils.getAppLoginUser().getId(); MemberEntity member = memberDao.selectById(memberId); + if (!MemberPaymentMethodEntity.PAYMENTTYPE_CARD.equals(memberPaymethodDto.getPaymentType())) { + return Result.fail("只能绑定银行卡"); + } + if (!MemberEntity.CERTIFY_STATUS_Y.equals(member.getCertifyStatus())) { return Result.fail(MessageSourceUtils.getString("member_service_0077")); } @@ -552,6 +556,12 @@ return Result.fail(MessageSourceUtils.getString("member_service_0097")); } } + } + + String isDefault = "1"; + MemberPaymentMethodEntity defaultMethod = memberPaymentMethodDao.selectDefualtMethod(memberId, MemberPaymentMethodEntity.PAYMENTTYPE_CARD, ""); + if (defaultMethod != null) { + isDefault = "2"; } String account = memberPaymethodDto.getAccount(); String bank = memberPaymethodDto.getBank(); @@ -567,6 +577,7 @@ memberPaymentMethodEntity.setPaymentQrcode(paymentQrcode); memberPaymentMethodEntity.setPaymentType(paymentType); memberPaymentMethodEntity.setSubBank(subBank); + memberPaymentMethodEntity.setIsDefualt(isDefault); memberPaymentMethodDao.insert(memberPaymentMethodEntity); return Result.ok(MessageSourceUtils.getString("member_service_0024")); } @@ -628,6 +639,23 @@ MemberPaymethodDetailListVo memberPaymethodDetailListVo = new MemberPaymethodDetailListVo(); memberPaymethodDetailListVo.setMemberPaymethodDetailVo(arrayList); return Result.ok(memberPaymethodDetailListVo); + } + + @Override + public Result setDefaultPaymethod(Long id) { + MemberEntity member = LoginUserUtils.getAppLoginUser(); + MemberPaymentMethodEntity defualtMethod = this.memberPaymentMethodDao.selectDefualtMethod(member.getId(), MemberPaymentMethodEntity.PAYMENTTYPE_CARD, "1"); + + MemberPaymentMethodEntity paymentMethodEntity = new MemberPaymentMethodEntity(); + paymentMethodEntity.setId(id); + paymentMethodEntity.setIsDefualt("1"); + this.memberPaymentMethodDao.updateById(paymentMethodEntity); + + if (defualtMethod != null) { + defualtMethod.setIsDefualt("2"); + this.memberPaymentMethodDao.updateById(defualtMethod); + } + return Result.ok("操作成功"); } @Override @@ -847,6 +875,12 @@ memberPersonCenterInfoVo.setTradeAgingSetting(MemberPersonCenterInfoVo.PWD_NEED_NO); } + if (StrUtil.isEmpty(member.getName())) { + memberPersonCenterInfoVo.setNickName(2); + } else { + memberPersonCenterInfoVo.setNickName(1); + } + Integer fingerprintState = member.getFingerprintState(); memberPersonCenterInfoVo.setFingerprintState(fingerprintState); -- Gitblit v1.9.1