class WithDrawPresenter extends BasePresenter<WithDrawContract.View> implements WithDrawContract.Presenter {

    @Override
    public void checkWithDrawAmount(String withdrawAmount) {
        if (mDelegationValue != null) {
            //检查赎回的数量
            String minDelegation = mDelegationValue.getMinDelegation();
            String minDelegationAmount = AmountUtil.convertVonToLat(mDelegationValue.getMinDelegation());
            boolean isWithdrawAmountBiggerThanMinDelegation = BigDecimalUtil.isNotSmaller(withdrawAmount, minDelegationAmount);

            if(TextUtils.isEmpty(withdrawAmount)){
                getView().showTips(false, NumberParserUtils.getPrettyNumber(minDelegationAmount));
            }else if(isWithdrawAmountBiggerThanMinDelegation){
                getView().showTips(false, NumberParserUtils.getPrettyNumber(minDelegationAmount));
            }else{
                getView().showTips(true, NumberParserUtils.getPrettyNumber(minDelegationAmount));
            }


            if (mWithDrawBalance != null && mWithDrawBalance.isDelegated()) {
                String leftWithdrawAmount = BigDecimalUtil.sub(mWithDrawBalance.getDelegated(), Convert.toVon(BigDecimalUtil.toBigDecimal(withdrawAmount), Convert.Unit.LAT).toPlainString()).toPlainString();
                boolean isLeftWithdrawAmountSmallerThanMinDelegation = BigDecimalUtil.isBiggerThanZero(leftWithdrawAmount) && !BigDecimalUtil.isNotSmaller(leftWithdrawAmount, minDelegation);
                if (isLeftWithdrawAmountSmallerThanMinDelegation) {
                    getView().setAllAmountDelegate();
                }
            }
        }
    }

}