Helius
2022-05-12 ee98d0782c94e000fe2c2524d1957f67c6a5e70b
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}")
@@ -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());
    }
}