| | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.common.core.exception.ServiceException; |
| | | import com.ruoyi.common.core.utils.StringUtils; |
| | | import com.ruoyi.common.core.utils.bean.BeanUtils; |
| | | import com.ruoyi.common.core.utils.uuid.IdUtils; |
| | | import com.ruoyi.member.domain.dto.MerBirthdayEditDto; |
| | |
| | | import com.ruoyi.member.service.birthday.BirthdayCardService; |
| | | import com.ruoyi.member.service.birthday.BirthdayGiftService; |
| | | import com.ruoyi.member.service.member.MemberGiftRecordService; |
| | | import com.ruoyi.system.api.constant.AppErrorConstant; |
| | | import com.ruoyi.system.api.domain.dto.BirthdayGiftSendDto; |
| | | import com.ruoyi.system.api.domain.dto.MgtBaseBathDto; |
| | | import com.ruoyi.system.api.domain.poji.member.MemberGiftRecord; |
| | |
| | | birthdayGift.setGiftName(dto.getGiftName()); |
| | | birthdayGift.setGiftNumber(dto.getGiftNumber()); |
| | | birthdayGift.setMoney(dto.getMoney()); |
| | | birthdayGift.setWinningProbability(dto.getWinningProbability()); |
| | | birthdayGift.setWinningProbability(new BigDecimal("100.00")); |
| | | birthdayGiftList.add(birthdayGift); |
| | | }); |
| | | // 批量保存生日礼物 |
| | |
| | | } |
| | | birthdayCard.setCardStatus(merBirthdayEditDto.getCardStatus()); |
| | | this.saveOrUpdate(birthdayCard); |
| | | List<BirthdayGift> birthdayGiftList = birthdayGiftService.listByCardId(birthdayCard.getCardId()); |
| | | if(merBirthdayEditDto.getCardStatus()==1){ |
| | | if(birthdayGiftList==null||birthdayGiftList.isEmpty()){ |
| | | throw new ServiceException(AppErrorConstant.BIRTHDAYCARD_NO_GIFT); |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | |
| | | break; |
| | | case 4: |
| | | // 礼物类型为4,即礼品 |
| | | appBirthdayGiftVo.setGiftName(memberGiftRecord.getCouponName()); |
| | | appBirthdayGiftVo.setGiftNumber(memberGiftRecord.getCouponNumber()); |
| | | appBirthdayGiftVo.setGiftName(memberGiftRecord.getGiftName()); |
| | | appBirthdayGiftVo.setGiftNumber(memberGiftRecord.getGiftNumber()); |
| | | break; |
| | | default: |
| | | break; |
| | |
| | | if (plBirthdayCard != null && plBirthdayCard.getCardStatus()==1) { |
| | | // 获取生日卡对应的生日礼物列表 |
| | | List<BirthdayGift> birthdayGiftList = birthdayGiftService.listByCardId(plBirthdayCard.getCardId()); |
| | | if(!birthdayGiftList.isEmpty()){ |
| | | if(birthdayGiftList!=null&&!birthdayGiftList.isEmpty()){ |
| | | // 遍历生日礼物列表 |
| | | for (BirthdayGift birthdayGift : birthdayGiftList) { |
| | | winningProbability = birthdayGift.getWinningProbability(); |
| | |
| | | break; |
| | | case 4: |
| | | // 礼物类型为4,即礼品 |
| | | appBirthdayGiftVo.setGiftName(birthdayGift.getCouponName()); |
| | | appBirthdayGiftVo.setGiftNumber(birthdayGift.getCouponNumber()); |
| | | appBirthdayGiftVo.setGiftName(birthdayGift.getGiftName()); |
| | | appBirthdayGiftVo.setGiftNumber(birthdayGift.getGiftNumber()); |
| | | memberGiftRecord.setGiftName(birthdayGift.getGiftName()); |
| | | memberGiftRecord.setGiftNumber(birthdayGift.getGiftNumber()); |
| | | break; |
| | |
| | | break; |
| | | case 4: |
| | | // 礼物类型为4,即礼品 |
| | | appBirthdayGiftVo.setGiftName(birthdayGift.getCouponName()); |
| | | appBirthdayGiftVo.setGiftNumber(birthdayGift.getCouponNumber()); |
| | | appBirthdayGiftVo.setGiftName(birthdayGift.getGiftName()); |
| | | appBirthdayGiftVo.setGiftNumber(birthdayGift.getGiftNumber()); |
| | | memberGiftRecord.setGiftName(birthdayGift.getGiftName()); |
| | | memberGiftRecord.setGiftNumber(birthdayGift.getGiftNumber()); |
| | | break; |
| | |
| | | Map<Long, MgtSimpleShopVo> shopMap = simpleShopVoList.stream() |
| | | .collect(Collectors.toMap(MgtSimpleShopVo::getShopId, Function.identity())); |
| | | for(AppMemberPrizePageVo appMemberPrizePageVo : memberPrizePageVoList){ |
| | | appMemberPrizePageVo.setVerifyShopName(shopMap.get(appMemberPrizePageVo.getShopId()).getShopName()); |
| | | if(appMemberPrizePageVo.getShopId()!=null){ |
| | | appMemberPrizePageVo.setVerifyShopName(shopMap.get(appMemberPrizePageVo.getShopId()).getShopName()); |
| | | } |
| | | } |
| | | } |
| | | return memberPrizePageVoList; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * @description 判断生日卡开启状态 |
| | | * @author jqs |
| | | * @date 2023/8/1 15:43 |
| | | * @param |
| | | * @return void |
| | | */ |
| | | @Override |
| | | public Integer checkBirthdayCard(Long shopId){ |
| | | // 获取平台生日卡信息 |
| | | Boolean platformBirthdayCardOpen = true; |
| | | BirthdayCard plBirthdayCard = birthdayCardMapper.getMerShopBirthdayCard(0L); |
| | | if (plBirthdayCard == null || plBirthdayCard.getCardStatus()!=1) { |
| | | platformBirthdayCardOpen = false; |
| | | }else{ |
| | | if(plBirthdayCard.getAreaFlag()==2&&!StringUtils.checkString(plBirthdayCard.getApplicableShop(),shopId.toString())){ |
| | | platformBirthdayCardOpen = false; |
| | | } |
| | | } |
| | | BirthdayCard shopBirthdayCard = birthdayCardMapper.getMerShopBirthdayCard(shopId); |
| | | // 如果生日卡存在 |
| | | Boolean shopBirthdayCardOpen = true; |
| | | if (shopBirthdayCard == null || shopBirthdayCard.getCardStatus()!=1) { |
| | | shopBirthdayCardOpen = false; |
| | | } |
| | | Integer marketingStatus = remoteShopService.getShopMarketingStatus(shopId).getData(); |
| | | if(marketingStatus<=1){ |
| | | shopBirthdayCardOpen = false; |
| | | } |
| | | if(!platformBirthdayCardOpen||!shopBirthdayCardOpen){ |
| | | return 1; |
| | | }else{ |
| | | return 0; |
| | | } |
| | | } |
| | | } |