fix
Helius
2022-05-13 b8ca2ad7e570ab9986be3ea603ed49c9a6fe15af
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);
@@ -475,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());
    }
}