Helius
2022-03-09 38179780b2f728abe6dd0e5aaa284c6ee6aa8380
src/main/java/com/xcong/excoin/modules/member/service/impl/MemberServiceImpl.java
@@ -28,6 +28,7 @@
import com.xcong.excoin.modules.member.parameter.dto.*;
import com.xcong.excoin.modules.member.parameter.vo.*;
import com.xcong.excoin.modules.member.service.MemberService;
import com.xcong.excoin.modules.member.vo.DefaultWayVo;
import com.xcong.excoin.modules.platform.dao.PlatformFeeSettingDao;
import com.xcong.excoin.modules.platform.dao.PlatformSymbolsCoinDao;
import com.xcong.excoin.modules.platform.entity.PlatformFeeSettingEntity;
@@ -601,6 +602,29 @@
    }
    @Override
    public Result setDefaultPaymethod(Long id) {
        MemberEntity member = LoginUserUtils.getAppLoginUser();
        MemberPaymentMethodEntity defualtMethod = this.memberPaymentMethodDao.selectDefualtMethod(member.getId(), null, "1");
        if (defualtMethod != null) {
            if (id.equals(defualtMethod.getId())) {
                return Result.fail("不能关闭默认收款方式");
            }
        }
        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
    @Transactional
    public Result memberBindPhone(@Valid MemberBindPhoneDto memberBindPhoneDto) {
        //获取用户ID
@@ -1094,6 +1118,20 @@
        }
        return Result.ok(memberTeamVo);
    }
    @Override
    public Result findDefaultWay() {
        //获取用户ID
        Long memberId = LoginUserUtils.getAppLoginUser().getId();
        DefaultWayVo defaultWayVo = new DefaultWayVo();
        MemberPaymentMethodEntity defualtMethod = this.memberPaymentMethodDao.selectDefualtMethod(memberId, null, "1");
        if(ObjectUtil.isNotEmpty(defualtMethod)){
            String paymentType = defualtMethod.getPaymentType();
            defaultWayVo.setPaymentType(paymentType);
        }
        return Result.ok(defaultWayVo);
    }
}