Helius
2022-05-13 65686b52de4f5838a133e2cfd6296d3d09915877
src/main/java/cc/mrbird/febs/mall/service/impl/ApiMallMemberServiceImpl.java
@@ -14,6 +14,7 @@
import cc.mrbird.febs.mall.service.IApiMallMemberWalletService;
import cc.mrbird.febs.mall.service.ICommonService;
import cc.mrbird.febs.mall.vo.*;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.IdUtil;
import cn.hutool.core.util.ObjectUtil;
@@ -55,6 +56,7 @@
    private final IApiMallMemberWalletService walletService;
    private final MallMemberPaymentMapper mallMemberPaymentMapper;
    private final DataDictionaryCustomMapper dataDictionaryCustomMapper;
    private final MallShopApplyMapper mallShopApplyMapper;
    @Value("${spring.profiles.active}")
@@ -98,7 +100,7 @@
        mallMember.setName(registerDto.getAccount());
        mallMember.setAccountStatus(MallMember.ACCOUNT_STATUS_ENABLE);
        mallMember.setAccountType(MallMember.ACCOUNT_TYPE_NORMAL);
        mallMember.setLevel(AgentLevelEnum.ZERO_LEVEL.name());
        mallMember.setLevel(AgentLevelEnum.FIRST_LEVEL.name());
        mallMember.setSex("男");
        this.baseMapper.insert(mallMember);
@@ -313,8 +315,19 @@
        own.setCnt(this.baseMapper.selectOwnCntByInviteId(mallMember.getInviteId()));
        own.setOrderCnt(this.baseMapper.selectOwnOrderCntByInviteId(mallMember.getInviteId()));
        own.setId(mallMember.getId());
        list.add(0, own);
        return new FebsResponse().success().data(list);
//        list.add(0, own);
        MyTeamVo myTeamVo = new MyTeamVo();
        myTeamVo.setTeam(list);
        myTeamVo.setMyAchieve(BigDecimal.valueOf(100));
        myTeamVo.setMyTeamAchieve(BigDecimal.valueOf(100));
        myTeamVo.setMyTeamCnt(100);
        return new FebsResponse().success().data(myTeamVo);
    }
    @Override
    public MyTeamVo teamListForMine(TeamListDto teamListDto) {
        return null;
    }
    @Override
@@ -464,4 +477,30 @@
        commissionVo.setWaitCommission(BigDecimal.ZERO);
        return commissionVo;
    }
    @Override
    public void shopApply(ShopApplyDto shopApplyDto) {
        MallMember member = LoginUserUtil.getLoginUser();
        MallShopApply hasApply = mallShopApplyMapper.selectNewestApplyByMemberId(member.getId());
        if (hasApply != null) {
            if (!hasApply.getStatus().equals(MallShopApply.APPLY_DISAGREE)) {
                throw new FebsException("审核中或审核已通过");
            }
        }
        MallShopApply mallShopApply = new MallShopApply();
        BeanUtil.copyProperties(shopApplyDto, mallShopApply);
        mallShopApply.setStatus(MallShopApply.APPLY_ING);
        mallShopApply.setMemberId(member.getId());
        mallShopApplyMapper.insert(mallShopApply);
    }
    @Override
    public MallShopApply findNewestApply() {
        MallMember member = LoginUserUtil.getLoginUser();
        return mallShopApplyMapper.selectNewestApplyByMemberId(member.getId());
    }
}