| | |
| | | } |
| | | |
| | | //创建支付记录 |
| | | PayRecord payRecord = new PayRecord(); |
| | | payRecord.setDelFlag(0); |
| | | payRecord.setOrderId(order.getOrderId()); |
| | | payRecord.setPayMoney(merVerifyOrderDto.getRelPayMoney()); |
| | | payRecord.setPayTime(new Date()); |
| | | payRecord.setPayType(merVerifyOrderDto.getPayType()); |
| | | payRecordService.save(payRecord); |
| | | |
| | | if(merVerifyOrderDto.getRelPayMoney().compareTo(BigDecimal.ZERO)>0){ |
| | | PayRecord payRecord = new PayRecord(); |
| | | payRecord.setDelFlag(0); |
| | | payRecord.setOrderId(order.getOrderId()); |
| | | payRecord.setPayMoney(merVerifyOrderDto.getRelPayMoney()); |
| | | payRecord.setPayTime(new Date()); |
| | | payRecord.setPayType(merVerifyOrderDto.getPayType()); |
| | | payRecordService.save(payRecord); |
| | | } |
| | | //submitProfitSharing(orderId, order.getOrderNo(), order.getShopId(), order.getOrderMoney()); |
| | | |
| | | return merVerifyOrderVo; |
| | |
| | | //如果是平台优惠券,当用户绑定商户时验证商户一致 |
| | | if (memberCoupon.getCouponFrom() == 1 && member.getBindingFlag() == 1) { |
| | | if(!memberCoupon.getShopId().equals(member.getRelationShopId())){ |
| | | throw new ServiceException(AppErrorConstant.VERIFY_SHOP_ERROR); |
| | | throw new ServiceException(AppErrorConstant.BLINDING_VERIFY_SHOP_ERROR); |
| | | } |
| | | if(memberCoupon.getShopId().equals(shopId)){ |
| | | throw new ServiceException(AppErrorConstant.VERIFY_SHOP_ERROR); |
| | |
| | | @Override |
| | | public List<MerMemberNoClearOrderVo> pageMerMemberNoClearOrder(Page page, MerMemberNoClearOrderDto merMemberNoClearOrderDto) { |
| | | List<MerMemberNoClearOrderVo> merMemberNoClearOrderVoList = orderMapper.pageMerMemberNoClearOrder(page, merMemberNoClearOrderDto.getMemberUserId()); |
| | | /*if (merMemberNoClearOrderVoList != null && !merMemberNoClearOrderVoList.isEmpty()) { |
| | | if (merMemberNoClearOrderVoList != null && !merMemberNoClearOrderVoList.isEmpty()) { |
| | | BigDecimal zeroBig = new BigDecimal("0.00"); |
| | | for (MerMemberNoClearOrderVo merMemberNoClearOrderVo : merMemberNoClearOrderVoList) { |
| | | merMemberNoClearOrderVo.setUnPaidMoney(merMemberNoClearOrderVo.getReceivableMoney().subtract(merMemberNoClearOrderVo.getPayMoney())); |
| | | if (merMemberNoClearOrderVo.getUnPaidMoney() == null) { |
| | | merMemberNoClearOrderVo.setUnPaidMoney(zeroBig); |
| | | } |
| | | if(merMemberNoClearOrderVo.getUnPaidMoney().compareTo(zeroBig)<0){ |
| | | merMemberNoClearOrderVo.setUnPaidMoney(zeroBig); |
| | | } |
| | | } |
| | | }*/ |
| | | } |
| | | return merMemberNoClearOrderVoList; |
| | | } |
| | | |
| | |
| | | ConsumerGoods consumerGoods; |
| | | String consumerGoodsId; |
| | | List<ConsumerGoods> consumerGoodsList = new ArrayList<>(); |
| | | //使用优惠券 |
| | | StringJoiner memberCouponSJ = new StringJoiner(","); |
| | | for (AppBuyGoodsDto appBuyGoodsDto : appBuyGoodsDtoList) { |
| | | goodsId = appBuyGoodsDto.getGoodsId(); |
| | | memberCouponId = appBuyGoodsDto.getMemberCouponId(); |
| | |
| | | } else if (couponType == 2 && appMemberCouponVo.getDiscountPercent() != null) { |
| | | discountPercent = appMemberCouponVo.getDiscountPercent(); |
| | | goodsRealPrice = goodsTotalPrice.multiply(discountPercent).divide(BigDecimal.TEN, 2, BigDecimal.ROUND_HALF_UP); |
| | | discountMoney = goodsRealPrice.subtract(goodsTotalPrice); |
| | | discountMoney = goodsTotalPrice.subtract(goodsRealPrice); |
| | | } else if (couponType == 3 && appMemberCouponVo.getDiscountMoney() != null) { |
| | | discountMoney = appMemberCouponVo.getDiscountMoney(); |
| | | goodsRealPrice = goodsTotalPrice.subtract(discountMoney); |
| | |
| | | goodsRealPrice = BigDecimal.ZERO; |
| | | discountMoney = goodsTotalPrice.subtract(goodsRealPrice); |
| | | } |
| | | memberCouponSJ.add(memberCouponId); |
| | | } |
| | | } |
| | | goodsDeposit = goods.getSubscription(); |
| | |
| | | this.save(order); |
| | | orderGoodsService.saveBatch(orderGoodsList); |
| | | consumerGoodsService.saveBatchConsumerGoods(consumerGoodsList); |
| | | //减去优惠券 |
| | | if (StringUtils.isNotBlank(memberCouponSJ.toString())) { |
| | | remoteCouponService.useMemberCoupon(memberCouponSJ.toString()); |
| | | } |
| | | //用户未绑定则绑定商户 |
| | | Member member = remoteMemberService.getMember(userId).getData(); |
| | | if (member != null && member.getBindingFlag() != 1) { |
| | |
| | | if (merOrderPageVo.getUnPaidMoney() == null) { |
| | | merOrderPageVo.setUnPaidMoney(zeroBig); |
| | | } |
| | | if(merOrderPageVo.getUnPaidMoney().compareTo(zeroBig)<0){ |
| | | merOrderPageVo.setUnPaidMoney(zeroBig); |
| | | } |
| | | } |
| | | MgtBaseBathDto mgtBaseBathDto = new MgtBaseBathDto(); |
| | | mgtBaseBathDto.setIds(userIdSj.toString()); |
| | |
| | | BigDecimal zeroBig = new BigDecimal("0.00"); |
| | | for (MerMemberOrderVo merMemberNoClearOrderVo : merMemberNoClearOrderVoList) { |
| | | if (merMemberNoClearOrderVo.getUnPaidMoney() == null) { |
| | | merMemberNoClearOrderVo.setUnPaidMoney(zeroBig); |
| | | } |
| | | if(merMemberNoClearOrderVo.getUnPaidMoney().compareTo(zeroBig)<0){ |
| | | merMemberNoClearOrderVo.setUnPaidMoney(zeroBig); |
| | | } |
| | | } |
| | |
| | | //如果是平台优惠券,当用户绑定商户时验证商户一致 |
| | | if (memberCoupon.getCouponFrom() == 1 && member.getBindingFlag() == 1) { |
| | | if(!memberCoupon.getShopId().equals(member.getRelationShopId())){ |
| | | throw new ServiceException(AppErrorConstant.VERIFY_SHOP_ERROR); |
| | | throw new ServiceException(AppErrorConstant.BLINDING_VERIFY_SHOP_ERROR); |
| | | } |
| | | if(memberCoupon.getShopId().equals(shopId)){ |
| | | throw new ServiceException(AppErrorConstant.VERIFY_SHOP_ERROR); |
| | |
| | | if (merOrderPageVo.getUnPaidMoney() == null) { |
| | | merOrderPageVo.setUnPaidMoney(zeroBig); |
| | | } |
| | | if(merOrderPageVo.getUnPaidMoney().compareTo(zeroBig)<0){ |
| | | merOrderPageVo.setUnPaidMoney(zeroBig); |
| | | } |
| | | } |
| | | MgtBaseBathDto mgtBaseBathDto = new MgtBaseBathDto(); |
| | | mgtBaseBathDto.setIds(userIdSj.toString()); |