zainali5120
2021-03-14 0f4df6c351d87054ded6bd54f0c6b9f6253ea56f
src/main/java/com/xcong/excoin/modules/member/service/impl/MemberServiceImpl.java
@@ -18,20 +18,7 @@
import com.xcong.excoin.modules.contract.entity.ContractEntrustOrderEntity;
import com.xcong.excoin.modules.member.dao.*;
import com.xcong.excoin.modules.member.entity.*;
import com.xcong.excoin.modules.member.parameter.dto.MemberAddCoinAddressDto;
import com.xcong.excoin.modules.member.parameter.dto.MemberAddCoinAddressInDto;
import com.xcong.excoin.modules.member.parameter.dto.MemberAuthenticationDto;
import com.xcong.excoin.modules.member.parameter.dto.MemberBindEmailDto;
import com.xcong.excoin.modules.member.parameter.dto.MemberBindPhoneDto;
import com.xcong.excoin.modules.member.parameter.dto.MemberDelCoinAddressDto;
import com.xcong.excoin.modules.member.parameter.dto.MemberDelPaymethodDto;
import com.xcong.excoin.modules.member.parameter.dto.MemberForgetPwdDto;
import com.xcong.excoin.modules.member.parameter.dto.MemberPaymethodDto;
import com.xcong.excoin.modules.member.parameter.dto.MemberSubmitCoinApplyDto;
import com.xcong.excoin.modules.member.parameter.dto.MemberSubmitCoinApplyInDto;
import com.xcong.excoin.modules.member.parameter.dto.MemberUpdatePwdDto;
import com.xcong.excoin.modules.member.parameter.dto.MemberUpdateTradePwdDto;
import com.xcong.excoin.modules.member.parameter.dto.MemberUpdateTradersPwdTimeDto;
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.platform.dao.PlatformFeeSettingDao;
@@ -201,18 +188,17 @@
        walletContractSimulate.setWalletCode(CoinTypeEnum.USDT.name());
        memberWalletContractSimulateDao.insert(walletContractSimulate);
        //初始化合约钱包
        MemberWalletContractEntity walletContract = new MemberWalletContractEntity();
        walletContract.setMemberId(member.getId());
        walletContract.setAvailableBalance(AppContants.INIT_MONEY);
        walletContract.setFrozenBalance(AppContants.INIT_MONEY);
        walletContract.setTotalBalance(AppContants.INIT_MONEY);
        walletContract.setBorrowedFund(AppContants.INIT_MONEY);
        walletContract.setWalletCode(CoinTypeEnum.USDT.name());
        memberWalletContractDao.insert(walletContract);
        for (CoinTypeEnum coinTypeEnum : CoinTypeEnum.values()) {
            //初始化合约钱包
            MemberWalletContractEntity walletContract = new MemberWalletContractEntity();
            walletContract.setMemberId(member.getId());
            walletContract.setAvailableBalance(AppContants.INIT_MONEY);
            walletContract.setFrozenBalance(AppContants.INIT_MONEY);
            walletContract.setTotalBalance(AppContants.INIT_MONEY);
            walletContract.setBorrowedFund(AppContants.INIT_MONEY);
            walletContract.setWalletCode(coinTypeEnum.name());
            memberWalletContractDao.insert(walletContract);
            // 初始化币币钱包
            MemberWalletCoinEntity walletCoin = new MemberWalletCoinEntity();
            walletCoin.setWalletCode(coinTypeEnum.name());
@@ -691,10 +677,10 @@
        Long memberId = LoginUserUtils.getAppLoginUser().getId();
        String address = memberAddCoinAddressDto.getAddress();
        String isBiyict = memberAddCoinAddressDto.getIsBiyict();
        Long symbolscoinId = memberAddCoinAddressDto.getSymbolscoinId();
        String symbol = memberAddCoinAddressDto.getSymbol();
        String remark = memberAddCoinAddressDto.getRemark();
        PlatformSymbolsCoinEntity platformSymbolsCoinEntity = platformSymbolsCoinDao.selectById(symbolscoinId);
        PlatformSymbolsCoinEntity platformSymbolsCoinEntity = platformSymbolsCoinDao.selectOneBySymbol(symbol);
        Long symbolscoinId = platformSymbolsCoinEntity.getId();
        MemberCoinAddressEntity memberCoinAddressEntity = new MemberCoinAddressEntity();
        memberCoinAddressEntity.setAddress(address);
@@ -803,6 +789,9 @@
        } else {
            memberPersonCenterInfoVo.setTradeAgingSetting(MemberPersonCenterInfoVo.PWD_NEED_NO);
        }
        Integer fingerprintState = member.getFingerprintState();
        memberPersonCenterInfoVo.setFingerprintState(fingerprintState);
        return Result.ok(memberPersonCenterInfoVo);
    }
@@ -1142,6 +1131,39 @@
        return Result.ok(arrayList);
    }
    @Override
    public Result memberFingerprintState(@Valid MemberFingerprintStateDto memberFingerprintStateDto) {
        //获取用户ID
        Long memberId = LoginUserUtils.getAppLoginUser().getId();
        String password = SecureUtil.md5(memberFingerprintStateDto.getPassword());
        MemberEntity member = memberDao.selectById(memberId);
        if(password.equals(member.getPassword())){
            Integer fingerprintState = memberFingerprintStateDto.getFingerprintState();
            MemberEntity memberEntity = memberDao.selectById(memberId);
            memberEntity.setFingerprintState(fingerprintState);
            memberDao.updateById(memberEntity);
            return Result.ok(MessageSourceUtils.getString("member_service_0024"));
        }else{
            return Result.fail(MessageSourceUtils.getString("home_service_0005"));
        }
    }
    @Override
    @Transactional
    public Result memberMessageReminder() {
        //获取用户ID
        Long memberId = LoginUserUtils.getAppLoginUser().getId();
        MemberMessageReminderVo memberMessageReminderVo = new MemberMessageReminderVo();
        MemberSettingEntity selectById = memberSettingDao.selectMemberSettingByMemberId(memberId);
        if(ObjectUtil.isNotEmpty(selectById)) {
           memberMessageReminderVo.setMessageReminder(selectById.getMessageReminder());
        }
        return Result.ok(memberMessageReminderVo);
    }
}