| | |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.douyin.openapi.client.models.*; |
| | | import com.github.binarywang.wxpay.bean.ecommerce.*; |
| | | import com.github.binarywang.wxpay.bean.ecommerce.enums.TradeTypeEnum; |
| | | import com.github.binarywang.wxpay.bean.profitsharingV3.ProfitSharingNotifyResult; |
| | |
| | | import com.ruoyi.common.redis.service.RedisService; |
| | | import com.ruoyi.common.security.utils.CodeFactoryUtil; |
| | | import com.ruoyi.common.security.utils.SecurityUtils; |
| | | import com.ruoyi.goods.api.domain.LotteryEvent; |
| | | import com.ruoyi.goods.api.domain.TLotteryEvent; |
| | | import com.ruoyi.goods.api.service.LotteryEventClient; |
| | | import com.ruoyi.order.config.WxPayConfiguration; |
| | | import com.ruoyi.order.domain.dto.*; |
| | |
| | | import com.ruoyi.order.service.account.ProfitSharingService; |
| | | import com.ruoyi.order.service.order.*; |
| | | import com.ruoyi.order.util.HuiFuTianXiaUtil; |
| | | import com.ruoyi.order.util.douyin.OrderUtil; |
| | | import com.ruoyi.order.util.douyin.VerifyUtil; |
| | | import com.ruoyi.system.api.constant.AppErrorConstant; |
| | | import com.ruoyi.system.api.constant.DelayTaskEnum; |
| | | import com.ruoyi.system.api.constant.SecurityConstant; |
| | |
| | | if(shop!=null&&shop.getShopStatus()!=1){ |
| | | throw new ServiceException(AppErrorConstant.SHOP_CLOSED); |
| | | } |
| | | Shop belongShop = remoteShopService.getShop(shop.getBelongShopId()).getData(); |
| | | // 初始化订单对象 |
| | | AppSureOrderVo appSureOrderVo = new AppSureOrderVo(); |
| | | // 初始化订单商品列表 |
| | |
| | | ShopGoods shopGoods = remoteGoodsService.getShopGoods(appShopGoodsGetDto).getData(); |
| | | if (shopGoods != null) { |
| | | goodsPrice = shopGoods.getSalesPrice(); |
| | | } else { |
| | | //经销商定制价格 |
| | | appShopGoodsGetDto.setGoodsId(goods.getGoodsId()); |
| | | appShopGoodsGetDto.setShopId(belongShop.getShopId()); |
| | | shopGoods = remoteGoodsService.getShopGoods(appShopGoodsGetDto).getData(); |
| | | if (1 == belongShop.getModifyPricePermission() && null != shopGoods) { |
| | | goodsPrice = shopGoods.getSalesPrice(); |
| | | } |
| | | } |
| | | appSureOrderGoodsVo.setGoodsPrice(goodsPrice); |
| | | buyNumBig = BigDecimal.valueOf(buyNum); |
| | |
| | | ShopGoods shopGoods = remoteGoodsService.getShopGoods(appShopGoodsGetDto).getData(); |
| | | if (shopGoods != null) { |
| | | goodsPrice = shopGoods.getSalesPrice(); |
| | | } else { |
| | | //经销商定制价格 |
| | | Shop belongShop = remoteShopService.getShop(shop.getBelongShopId()).getData(); |
| | | appShopGoodsGetDto = new AppShopGoodsGetDto(); |
| | | appShopGoodsGetDto.setGoodsId(goods.getGoodsId()); |
| | | appShopGoodsGetDto.setShopId(belongShop.getShopId()); |
| | | shopGoods = remoteGoodsService.getShopGoods(appShopGoodsGetDto).getData(); |
| | | if (1 == belongShop.getModifyPricePermission() && null != shopGoods) { |
| | | goodsPrice = shopGoods.getSalesPrice(); |
| | | } |
| | | } |
| | | appPanicBuyVo.setGoodsPrice(goodsPrice); |
| | | buyNumBig = BigDecimal.valueOf(buyNum); |
| | |
| | | if (shopGoods != null) { |
| | | goodsPrice = shopGoods.getSalesPrice(); |
| | | serviceNum = shopGoods.getServiceNum(); |
| | | } else { |
| | | //经销商定制价格 |
| | | Shop shop = remoteShopService.getShop(appPlaceOrderDto.getShopId()).getData(); |
| | | Shop belongShop = remoteShopService.getShop(shop.getBelongShopId()).getData(); |
| | | appShopGoodsGetDto = new AppShopGoodsGetDto(); |
| | | appShopGoodsGetDto.setGoodsId(goods.getGoodsId()); |
| | | appShopGoodsGetDto.setShopId(belongShop.getShopId()); |
| | | shopGoods = remoteGoodsService.getShopGoods(appShopGoodsGetDto).getData(); |
| | | if (1 == belongShop.getModifyPricePermission() && null != shopGoods) { |
| | | goodsPrice = shopGoods.getSalesPrice(); |
| | | serviceNum = shopGoods.getServiceNum(); |
| | | } |
| | | } |
| | | appSureOrderGoodsVo.setGoodsPrice(goodsPrice); |
| | | // 计算商品总价 |
| | |
| | | appPlaceOrderVo.setPaySign(payArr[5]); |
| | | appPlaceOrderVo.setPrepayId(orderPayment.getPrepayId()); |
| | | // 返回AppPlaceOrderVo对象 |
| | | List<LotteryEvent> data = lotteryEventClient.getLotteryEventList(2).getData(); |
| | | List<TLotteryEvent> data = lotteryEventClient.getLotteryEventList(2).getData(); |
| | | if (data.size() > 0) { |
| | | long count = data.stream().filter(s -> s.getPayMoney().compareTo(order.getPayMoney()) >= 0).count(); |
| | | appPlaceOrderVo.setLotteryDraw(count > 0); |
| | |
| | | merVerifyOrderVo.setAppUserOrderGoodsPageVoList(appUserOrderGoodsPageVoList); |
| | | merVerifyOrderVo.setPayType(order.getPayType()); |
| | | merVerifyOrderVo.setRealReceiveMoney(order.getChangeReceivableMoney()); |
| | | if(order.getPayType()==1){ |
| | | if (order.getPayType() == 1) { |
| | | merVerifyOrderVo.setReceiveMoney(order.getPayMoney()); |
| | | }else{ |
| | | if(order.getOfflinePayMoney()!=null){ |
| | | } else { |
| | | if (order.getOfflinePayMoney() != null) { |
| | | merVerifyOrderVo.setReceiveMoney(order.getOfflinePayMoney()); |
| | | }else{ |
| | | } else { |
| | | merVerifyOrderVo.setReceiveMoney(BigDecimal.ZERO); |
| | | } |
| | | } |
| | |
| | | // 返回结果 |
| | | return merVerifyOrderVo; |
| | | } |
| | | |
| | | |
| | | |
| | | @Override |
| | | public MerVerifyOrderVo verifyOrderDouYin(String orderId, Long shopId) { |
| | | CertificatePrepareResponseData data = VerifyUtil.certificatePrepare(orderId); |
| | | if (null == data) { |
| | | throw new ServiceException("查询券信息失败"); |
| | | } |
| | | List<CertificatePrepareResponseDataCertificatesItem> itemList = data.getCertificates(); |
| | | if (null == itemList || itemList.isEmpty()) { |
| | | throw new ServiceException("查询券信息失败"); |
| | | } |
| | | CertificatePrepareResponseDataCertificatesItem certificatesItem = itemList.get(0); |
| | | //商品信息 |
| | | CertificatePrepareResponseDataCertificatesItemSku sku = certificatesItem.getSku(); |
| | | //次卡信息 |
| | | CertificatePrepareResponseDataCertificatesItemTimeCard timeCard = certificatesItem.getTimeCard(); |
| | | //券的状态 |
| | | Number status = certificatesItem.getStatus(); |
| | | // 创建返回对象 |
| | | MerVerifyOrderVo merVerifyOrderVo = new MerVerifyOrderVo(); |
| | | // 设置返回对象的属性值 |
| | | merVerifyOrderVo.setOrderId(orderId); |
| | | merVerifyOrderVo.setOrderFrom(6); |
| | | merVerifyOrderVo.setOrderStatus(status.intValue() == 1 ? 2 : 3); |
| | | List<AppUserOrderGoodsPageVo> appUserOrderGoodsPageVoList = new ArrayList<>(); |
| | | AppUserOrderGoodsPageVo orderGoodsPageVo = new AppUserOrderGoodsPageVo(); |
| | | orderGoodsPageVo.setGoodsName(sku.getTitle()); |
| | | appUserOrderGoodsPageVoList.add(orderGoodsPageVo); |
| | | merVerifyOrderVo.setAppUserOrderGoodsPageVoList(appUserOrderGoodsPageVoList); |
| | | merVerifyOrderVo.setLaveTime(timeCard.getTimesCount() - timeCard.getTimesUsed()); |
| | | // 返回结果 |
| | | return merVerifyOrderVo; |
| | | } |
| | | |
| | | /** |
| | | * 确认核销订单 |
| | | * |
| | |
| | | remoteMemberService.changeMemberTotal(memberTotalChangeDto); |
| | | return merVerifyOrderVo; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * @description 分账实现 |
| | | * @author jqs |
| | | * @date 2023/9/8 11:56 |
| | | * 核销抖音券 |
| | | * |
| | | * @return |
| | | */ |
| | | @Override |
| | | @Transactional |
| | | @GlobalTransactional(rollbackFor = Exception.class) |
| | | public MerVerifyOrderVo sureVerifyOrderDouYin(MerVerifyOrderDto merVerifyOrderDto) { |
| | | String phone = merVerifyOrderDto.getPhone(); |
| | | String orderId = merVerifyOrderDto.getOrderId(); |
| | | Long shopId = merVerifyOrderDto.getShopId(); |
| | | //获取核销商户 |
| | | Shop shop = remoteShopService.getShop(shopId).getData(); |
| | | CertificatePrepareResponseData data = VerifyUtil.certificatePrepare(orderId); |
| | | if (null == data) { |
| | | throw new ServiceException("查询券信息失败"); |
| | | } |
| | | List<CertificatePrepareResponseDataCertificatesItem> itemList = data.getCertificates(); |
| | | if (null == itemList || itemList.isEmpty()) { |
| | | throw new ServiceException("查询券信息失败"); |
| | | } |
| | | CertificatePrepareResponseDataCertificatesItem certificatesItem = itemList.get(0); |
| | | Number status = certificatesItem.getStatus(); |
| | | if (status.intValue() == 2) { |
| | | throw new ServiceException("该抖音券不能重复核销"); |
| | | } |
| | | if (status.intValue() != 1) { |
| | | throw new ServiceException("抖音券核销失败"); |
| | | } |
| | | String encryptedCode = certificatesItem.getEncryptedCode(); |
| | | List<CertificateVerifyResponseDataVerifyResultsItem> items = VerifyUtil.certificateVerify(data.getVerifyToken(), shop.getPoiId(), new ArrayList<String>() {{ |
| | | add(encryptedCode); |
| | | }}); |
| | | if (null == items || items.isEmpty()) { |
| | | throw new ServiceException("抖音券核销失败"); |
| | | } |
| | | Order one = this.getOne(new LambdaQueryWrapper<Order>().eq(Order::getTripartiteOrderId, data.getOrderId())); |
| | | if (null != one) { |
| | | throw new ServiceException("该抖音券不能重复核销"); |
| | | } |
| | | |
| | | TradeOrderQueryResponseData tradeOrderQueryResponseData = OrderUtil.queryOrderList(1, 10, data.getOrderId()); |
| | | //原始金额 |
| | | BigDecimal originAmount = BigDecimal.ZERO; |
| | | //支付金额 |
| | | BigDecimal payAmount = BigDecimal.ZERO; |
| | | //优惠金额 |
| | | BigDecimal payDiscountAmount = BigDecimal.ZERO; |
| | | if (null != tradeOrderQueryResponseData) { |
| | | TradeOrderQueryResponseDataOrdersItem ordersItem = tradeOrderQueryResponseData.getOrders().get(0); |
| | | TradeOrderQueryResponseDataOrdersItemAmountInfo amountInfo = ordersItem.getAmountInfo(); |
| | | originAmount = BigDecimal.valueOf(amountInfo.getOriginAmount()).divide(new BigDecimal(100)); |
| | | payAmount = BigDecimal.valueOf(amountInfo.getPayAmount()).divide(new BigDecimal(100)); |
| | | payDiscountAmount = BigDecimal.valueOf(amountInfo.getPayDiscountAmount()).divide(new BigDecimal(100)); |
| | | } |
| | | |
| | | Date nowTime = new Date(); |
| | | Member member = remoteMemberService.getMemberByMobile(phone).getData(); |
| | | //开始添加订单数据 |
| | | Order order = new Order(); |
| | | order.setOrderId(IdUtils.fastSimpleUUID()); |
| | | order.setDelFlag(0); |
| | | order.setOrderStatus(3); |
| | | order.setOrderNo(CodeFactoryUtil.getShopOrderNo()); |
| | | order.setOrderFrom(6); |
| | | order.setShopId(shopId); |
| | | order.setUserId(member.getUserId()); |
| | | order.setOrderMoney(originAmount); |
| | | order.setDiscountMoney(payDiscountAmount); |
| | | order.setReceivableMoney(payAmount); |
| | | order.setPayType(1); |
| | | order.setPayMoney(payAmount); |
| | | order.setOnlinePayMoney(payAmount); |
| | | order.setOrderRemark("抖音订单"); |
| | | order.setCreateTime(nowTime); |
| | | order.setPayTime(nowTime); |
| | | order.setTripartiteOrderId(data.getOrderId()); |
| | | |
| | | //绑定用户判断核销商户 |
| | | if (member.getBindingFlag() == 1) { |
| | | if (!member.getRelationShopId().equals(shopId)) { |
| | | throw new ServiceException(AppErrorConstant.VERIFY_SHOP_ERROR); |
| | | } |
| | | } |
| | | order.setUseTime(nowTime); |
| | | order.setUseUserId(merVerifyOrderDto.getUserId()); |
| | | order.setCloseFlag(1); |
| | | this.save(order); |
| | | //创建服务商品 |
| | | //获取商品信息(商品简介,调理问题) |
| | | //商品信息 |
| | | CertificatePrepareResponseDataCertificatesItemSku sku = certificatesItem.getSku(); |
| | | //次卡信息 |
| | | CertificatePrepareResponseDataCertificatesItemTimeCard timeCard = certificatesItem.getTimeCard(); |
| | | |
| | | OrderGoods orderGoods = new OrderGoods(); |
| | | orderGoods.setOrderGoodsId(IdUtils.simpleUUID()); |
| | | orderGoods.setDelFlag(0); |
| | | orderGoods.setOrderId(order.getOrderId()); |
| | | orderGoods.setBuyNum(timeCard.getTimesCount()); |
| | | orderGoods.setCycleNumFlag(1); |
| | | orderGoods.setServiceNum(timeCard.getTimesCount()); |
| | | orderGoods.setGoodsType(2); |
| | | orderGoods.setGoodsName(sku.getTitle()); |
| | | orderGoodsService.save(orderGoods); |
| | | |
| | | ConsumerGoods consumerGoods = new ConsumerGoods(); |
| | | consumerGoods.setConsumerGoodsId(IdUtils.simpleUUID()); |
| | | consumerGoods.setDelFlag(0); |
| | | consumerGoods.setServiceStatus(1); |
| | | consumerGoods.setShopId(order.getShopId()); |
| | | consumerGoods.setUserId(order.getUserId()); |
| | | consumerGoods.setOrderId(orderId); |
| | | consumerGoods.setOrderGoodsId(orderGoods.getOrderGoodsId()); |
| | | consumerGoods.setGoodsName(sku.getTitle()); |
| | | consumerGoods.setCycleNumFlag(1); |
| | | consumerGoods.setServiceNum(timeCard.getTimesCount()); |
| | | consumerGoods.setCreateTime(nowTime); |
| | | consumerGoods.setGoodsType(2); |
| | | consumerGoods.setSourceFrom(1); |
| | | consumerGoodsService.save(consumerGoods); |
| | | //生成返回 |
| | | MerVerifyOrderVo merVerifyOrderVo = new MerVerifyOrderVo(); |
| | | merVerifyOrderVo.setOrderId(orderId); |
| | | merVerifyOrderVo.setOrderNo(order.getOrderNo()); |
| | | merVerifyOrderVo.setOrderStatus(order.getOrderStatus()); |
| | | merVerifyOrderVo.setOrderFrom(order.getOrderFrom()); |
| | | merVerifyOrderVo.setOrderGoodsMoney(order.getOrderMoney()); |
| | | merVerifyOrderVo.setCouponDiscount(order.getCouponMoney()); |
| | | merVerifyOrderVo.setReceivableDeposit(order.getReceivableDeposit()); |
| | | merVerifyOrderVo.setPayMoney(order.getPayMoney()); |
| | | merVerifyOrderVo.setOrderRemark(order.getOrderRemark()); |
| | | merVerifyOrderVo.setAppUserOrderGoodsPageVoList(new ArrayList<AppUserOrderGoodsPageVo>() {{ |
| | | add(new AppUserOrderGoodsPageVo() {{ |
| | | setOrderGoodsId(orderGoods.getOrderGoodsId()); |
| | | setGoodsName(orderGoods.getGoodsName()); |
| | | setGoodsType(orderGoods.getGoodsType()); |
| | | setBuyNum(orderGoods.getBuyNum()); |
| | | }}); |
| | | }}); |
| | | merVerifyOrderVo.setCreateTime(order.getCreateTime()); |
| | | merVerifyOrderVo.setPayTime(order.getPayTime()); |
| | | merVerifyOrderVo.setUseTime(order.getUseTime()); |
| | | merVerifyOrderVo.setPayType(order.getPayType()); |
| | | merVerifyOrderVo.setRealReceiveMoney(order.getChangeReceivableMoney()); |
| | | //根据支付方式返回应收金额和已收金额 |
| | | if (order.getPayType() == 1) { |
| | | merVerifyOrderVo.setReceivableMoney(order.getOrderMoney().subtract(order.getPayMoney())); |
| | | merVerifyOrderVo.setReceiveMoney(order.getPayMoney()); |
| | | } else { |
| | | merVerifyOrderVo.setReceivableMoney(order.getOrderMoney().subtract(order.getCouponMoney()).subtract(order.getReceivableDeposit())); |
| | | if (order.getOfflinePayMoney() != null) { |
| | | merVerifyOrderVo.setReceiveMoney(order.getOfflinePayMoney()); |
| | | } else { |
| | | merVerifyOrderVo.setReceiveMoney(BigDecimal.ZERO); |
| | | } |
| | | } |
| | | merVerifyOrderVo.setUnReceiveMoney(merVerifyOrderVo.getRealReceiveMoney().subtract(merVerifyOrderVo.getReceiveMoney())); |
| | | merVerifyOrderVo.setUserId(order.getUserId()); |
| | | merVerifyOrderVo.setUserName(member.getRealName()); |
| | | merVerifyOrderVo.setUserMobile(member.getMobile()); |
| | | merVerifyOrderVo.setCloseFlag(order.getCloseFlag()); |
| | | //判断用户是否绑定 2023-09-05需求改变核销时绑定用户 |
| | | if (member.getBindingFlag() != 1) { |
| | | //绑定商户 |
| | | AppMemberBindingDto appMemberBindingDto = new AppMemberBindingDto(); |
| | | appMemberBindingDto.setShopId(order.getShopId()); |
| | | appMemberBindingDto.setUserId(order.getUserId()); |
| | | appMemberBindingDto.setBindingFlag(1); |
| | | if (order.getOrderFrom() == 1) { |
| | | appMemberBindingDto.setBindingType(1); |
| | | } else if (order.getOrderFrom() == 2) { |
| | | appMemberBindingDto.setBindingType(2); |
| | | } |
| | | remoteMemberService.updateMemberBinding(appMemberBindingDto); |
| | | order.setNewMemberFlag(1); |
| | | } else { |
| | | order.setNewMemberFlag(0); |
| | | } |
| | | this.saveOrUpdate(order); |
| | | //更新用户积分和消费统计 |
| | | MemberTotalChangeDto memberTotalChangeDto = new MemberTotalChangeDto(); |
| | | memberTotalChangeDto.setUserId(order.getUserId()); |
| | | // 如果存在积分兑换比例,则计算积分 |
| | | if (redisService.hasKey(SecurityConstant.PAY_MONEY_INTEGRAL)) { |
| | | Integer moneyValue = redisService.getCacheObject(SecurityConstant.PAY_MONEY_INTEGRAL); |
| | | BigDecimal moneyValueBig = BigDecimal.valueOf(moneyValue); |
| | | BigDecimal integralBig = moneyValueBig.multiply(order.getOnlinePayMoney()).setScale(0, BigDecimal.ROUND_HALF_UP); |
| | | Integer integral = Integer.valueOf(integralBig.toString()); |
| | | if (integral > 0) { |
| | | memberTotalChangeDto.setChangeIntegral(integral); |
| | | memberTotalChangeDto.setTypeIntegral(1); |
| | | memberTotalChangeDto.setOrderId(orderId); |
| | | memberTotalChangeDto.setOrderNo(order.getOrderNo()); |
| | | } |
| | | } |
| | | //更新消费时间 |
| | | memberTotalChangeDto.setConsumeTime(nowTime); |
| | | remoteMemberService.changeMemberTotal(memberTotalChangeDto); |
| | | return merVerifyOrderVo; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * @param orderId |
| | | * @param orderNo |
| | | * @param shopId |
| | | * @param orderMoney |
| | | * @param orderFrom |
| | | * @return void |
| | | * @return void |
| | | * @description 分账实现 |
| | | * @author jqs |
| | | * @date 2023/9/8 11:56 |
| | | */ |
| | | private void submitProfitSharing(String orderId, String orderNo, Long shopId, BigDecimal orderMoney, Integer orderFrom) { |
| | | String sendMessage = ""; |
| | |
| | | if (merMemberNoClearOrderVo.getUnPaidMoney() == null) { |
| | | merMemberNoClearOrderVo.setUnPaidMoney(zeroBig); |
| | | } |
| | | if(merMemberNoClearOrderVo.getUnPaidMoney().compareTo(zeroBig)<0){ |
| | | if (merMemberNoClearOrderVo.getUnPaidMoney().compareTo(zeroBig) < 0) { |
| | | merMemberNoClearOrderVo.setUnPaidMoney(zeroBig); |
| | | } |
| | | List<MerCouponGoodsListVo> goodsList = new ArrayList<>(); |
| | | orderGoodsService.listByOrderId(merMemberNoClearOrderVo.getOrderId()).forEach(orderGoodsVo -> { |
| | | MerCouponGoodsListVo merCouponGoodsListVo = new MerCouponGoodsListVo(); |
| | | merCouponGoodsListVo.setGoodsId(orderGoodsVo.getGoodsId()); |
| | | merCouponGoodsListVo.setGoodsName(orderGoodsVo.getGoodsName()); |
| | | merCouponGoodsListVo.setGoodsNum(orderGoodsVo.getBuyNum()); |
| | | if (orderGoodsVo.getGoodsType() == 1) { |
| | | merCouponGoodsListVo.setGoodsType("周期"); |
| | | } else if (orderGoodsVo.getGoodsType() == 2) { |
| | | merCouponGoodsListVo.setGoodsType("服务"); |
| | | } else if (orderGoodsVo.getGoodsType() == 3) { |
| | | merCouponGoodsListVo.setGoodsType("体验"); |
| | | } else if (orderGoodsVo.getGoodsType() == 4) { |
| | | merCouponGoodsListVo.setGoodsType("单品"); |
| | | } |
| | | goodsList.add(merCouponGoodsListVo); |
| | | }); |
| | | merMemberNoClearOrderVo.setGoodsList(goodsList); |
| | | } |
| | | } |
| | | return merMemberNoClearOrderVoList; |
| | |
| | | if (memberGiftRecord.getGiftFrom() == 1) { |
| | | BirthdayCard birthdayCard = remoteMemberService.getBirthdayCard().getData(); |
| | | //判断生日活动状态 |
| | | if(birthdayCard!=null&&birthdayCard.getCardStatus()==1){ |
| | | if (birthdayCard != null && birthdayCard.getCardStatus() == 1) { |
| | | shop = remoteShopService.getShop(shopId).getData(); |
| | | //判断指定区域全部店铺 |
| | | if(birthdayCard.getAreaFlag()==2&&birthdayCard.getShopFlag()==1&&!StringUtils.checkString(birthdayCard.getDesignatedArea(),shop.getShopCityCode())){ |
| | | if (birthdayCard.getAreaFlag() == 2 && birthdayCard.getShopFlag() == 1 && !StringUtils.checkString(birthdayCard.getDesignatedArea(), shop.getShopCityCode())) { |
| | | throw new ServiceException(AppErrorConstant.VERIFY_SHOP_ERROR); |
| | | } |
| | | //判断指定店铺 |
| | | if(birthdayCard.getShopFlag()==2&&!StringUtils.checkString(birthdayCard.getApplicableShop(),shopId.toString())){ |
| | | if (birthdayCard.getShopFlag() == 2 && !StringUtils.checkString(birthdayCard.getApplicableShop(), shopId.toString())) { |
| | | throw new ServiceException(AppErrorConstant.VERIFY_SHOP_ERROR); |
| | | } |
| | | }else{ |
| | | } else { |
| | | throw new ServiceException(AppErrorConstant.BIRTHDAY_CARD_ERROR); |
| | | } |
| | | } |
| | |
| | | if (memberGiftRecord.getGiftFrom() == 2 && !memberGiftRecord.getShopId().equals(shopId)) { |
| | | throw new ServiceException(AppErrorConstant.VERIFY_SHOP_ERROR); |
| | | } |
| | | |
| | | |
| | | merVerifyAwardVo.setUserName(member.getRealName()); |
| | | merVerifyAwardVo.setUserMobile(member.getMobile()); |
| | | if (memberGiftRecord.getGiftFrom() == 1) { |
| | | merVerifyAwardVo.setGiftFrom("平台生日卡"); |
| | | if (1 == memberGiftRecord.getPrizeFrom()) { |
| | | if (memberGiftRecord.getGiftFrom() == 1) { |
| | | merVerifyAwardVo.setGiftFrom("平台生日卡"); |
| | | } else { |
| | | merVerifyAwardVo.setGiftFrom("商户生日卡"); |
| | | } |
| | | } else { |
| | | merVerifyAwardVo.setGiftFrom("商户生日卡"); |
| | | merVerifyAwardVo.setGiftFrom("平台抽奖"); |
| | | } |
| | | merVerifyAwardVo.setGiftType(memberGiftRecord.getGiftType()); |
| | | //礼物类型1优惠券2商品3现金4实物 |
| | | //礼物类型1优惠券2商品3现金4实物5积分 |
| | | switch (memberGiftRecord.getGiftType()) { |
| | | case 1: |
| | | merVerifyAwardVo.setGiftName(memberGiftRecord.getCouponName()); |