| | |
| | | |
| | | import cc.mrbird.febs.common.entity.FebsResponse; |
| | | import cc.mrbird.febs.common.enumerates.AgentLevelEnum; |
| | | import cc.mrbird.febs.common.enumerates.DataDictionaryEnum; |
| | | import cc.mrbird.febs.common.enumerates.FlowTypeEnum; |
| | | import cc.mrbird.febs.common.enumerates.MoneyFlowTypeEnum; |
| | | 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.*; |
| | |
| | | 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 |
| | |
| | | } |
| | | |
| | | 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(); |
| | |
| | | mallMember.setName(registerDto.getName()); |
| | | mallMember.setAccountStatus(MallMember.ACCOUNT_STATUS_ENABLE); |
| | | mallMember.setAccountType(MallMember.ACCOUNT_TYPE_NORMAL); |
| | | mallMember.setLevel(AgentLevelEnum.FIRST_LEVEL.name()); |
| | | mallMember.setLevel(AgentLevelEnum.ZERO_LEVEL.name()); |
| | | mallMember.setSex("男"); |
| | | mallMember.setBindPhone(registerDto.getAccount()); |
| | | |
| | | this.baseMapper.insert(mallMember); |
| | | |
| | |
| | | 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()); |
| | | // list.add(0, own); |
| | | |
| | | MyTeamVo myTeamVo = new MyTeamVo(); |
| | | myTeamVo.setTeam(list); |
| | | myTeamVo.setMyAchieve(BigDecimal.valueOf(100)); |
| | | myTeamVo.setMyTeamAchieve(BigDecimal.valueOf(100)); |
| | | myTeamVo.setMyTeamCnt(100); |
| | | myTeamVo.setMyAchieve(this.baseMapper.selectAchieveByMemberId(mallMember.getInviteId(), 1)); |
| | | myTeamVo.setMyTeamAchieve(this.baseMapper.selectAchieveByMemberId(mallMember.getInviteId(), 2)); |
| | | myTeamVo.setMyTeamCnt(list.size()); |
| | | return new FebsResponse().success().data(myTeamVo); |
| | | } |
| | | |
| | |
| | | MallShopApply hasApply = mallShopApplyMapper.selectNewestApplyByMemberId(member.getId()); |
| | | if (hasApply != null) { |
| | | if (!hasApply.getStatus().equals(MallShopApply.APPLY_DISAGREE)) { |
| | | throw new FebsException("审核中或审核已通过"); |
| | | throw new FebsException("请勿重复提交申请"); |
| | | } |
| | | } |
| | | |
| | |
| | | |
| | | mallRegisterAppealMapper.insert(isExist); |
| | | } |
| | | |
| | | @Override |
| | | public CashOutSettingVo cashOutSetting() { |
| | | CashOutSettingVo cashOutSettingVo = new CashOutSettingVo(); |
| | | DataDictionaryCustom dic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode(DataDictionaryEnum.CASHOUT_SETTING.getType(), DataDictionaryEnum.CASHOUT_SETTING.getCode()); |
| | | if (dic != null) { |
| | | cashOutSettingVo = JSONObject.parseObject(dic.getValue(), CashOutSettingVo.class); |
| | | } |
| | | 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); |
| | | } |
| | | } |