fix
Helius
2022-06-17 da551640aa0f628dbfb295bfaef3675140a2122b
src/main/java/cc/mrbird/febs/mall/service/impl/ApiMallMemberServiceImpl.java
@@ -8,6 +8,7 @@
import cc.mrbird.febs.common.exception.FebsException;
import cc.mrbird.febs.common.utils.*;
import cc.mrbird.febs.mall.conversion.MallMemberConversion;
import cc.mrbird.febs.mall.conversion.MallShopApplyConversion;
import cc.mrbird.febs.mall.dto.*;
import cc.mrbird.febs.mall.entity.*;
import cc.mrbird.febs.mall.mapper.*;
@@ -35,10 +36,7 @@
import org.springframework.transaction.annotation.Transactional;
import java.math.BigDecimal;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.*;
/**
 * @author wzy
@@ -82,10 +80,12 @@
        }
        String account = registerDto.getAccount();
        String code = registerDto.getCode();
        boolean flags = commonService.verifyCode(account, code);
        if(!flags) {
            throw new FebsException("验证码错误");
        if (!"admin".equals(registerDto.getRegistType())) {
            String code = registerDto.getCode();
            boolean flags = commonService.verifyCode(account, code);
            if (!flags) {
                throw new FebsException("验证码错误");
            }
        }
        mallMember = new MallMember();
@@ -315,17 +315,6 @@
        MallMember mallMember = this.baseMapper.selectById(memberId);
        List<TeamListVo> list = this.baseMapper.selectTeamListByInviteId(mallMember.getInviteId());
//        BigDecimal ownAmount = this.baseMapper.selectOwnOrderAmountByInviteId(mallMember.getInviteId());
//        TeamListVo own = new TeamListVo();
//        own.setCreatedTime(mallMember.getCreatedTime());
//        own.setAmount(ownAmount);
//        own.setName(mallMember.getName());
//        own.setPhone(mallMember.getPhone());
//        own.setInviteId(mallMember.getInviteId());
//        own.setIsCurrent(1);
//        own.setCnt(this.baseMapper.selectOwnCntByInviteId(mallMember.getInviteId()));
//        own.setOrderCnt(this.baseMapper.selectOwnOrderCntByInviteId(mallMember.getInviteId()));
//        own.setId(mallMember.getId());
        MyTeamVo myTeamVo = new MyTeamVo();
        myTeamVo.setTeam(list);
@@ -435,7 +424,7 @@
        MallMemberWallet wallet = mallMemberWalletMapper.selectWalletByMemberId(memberId);
        BigDecimal profit = mallMoneyFlowMapper.selectProfitByDateAndMemberId(memberId);
        BigDecimal canMoney = wallet.getBalance();
        BigDecimal canMoney = wallet.getCommission();
        if (profit != null) {
            if(canMoney.compareTo(BigDecimal.ZERO) > 0) {
                canMoney = canMoney.subtract(profit);
@@ -495,7 +484,7 @@
        MallShopApply hasApply = mallShopApplyMapper.selectNewestApplyByMemberId(member.getId());
        if (hasApply != null) {
            if (!hasApply.getStatus().equals(MallShopApply.APPLY_DISAGREE)) {
                throw new FebsException("审核中或审核已通过");
                throw new FebsException("请勿重复提交申请");
            }
        }
@@ -538,4 +527,19 @@
        }
        return cashOutSettingVo;
    }
    @Override
    public List<ShopListVo> findShopListVo(ShopListDto shopListDto) {
        Page<MallShopApply> page = new Page<>(shopListDto.getPageNow(), shopListDto.getPageSize());
        MallShopApply shopApply = new MallShopApply();
        shopApply.setStatus(MallShopApply.APPLY_AGREE);
        IPage<MallShopApply> pageResult = mallShopApplyMapper.selectShopApplyInPage(shopApply, page);
        List<MallShopApply> list = pageResult.getRecords();
        if (CollUtil.isEmpty(list)) {
            list = new ArrayList<>();
        }
        return MallShopApplyConversion.INSTANCE.entitiesToVOs(list);
    }
}