| | |
| | | } |
| | | } |
| | | |
| | | Map<Long, BigDecimal> couponDeductionAmounts = getCouponDeductionAmounts(usedCouponIds); |
| | | applyCouponDeductions(incomeVOS, couponDeductionAmounts); |
| | | |
| | | // 惠民卡和优惠券购买不归属到单一课程/场地门店,当前仅在平台或运营商汇总中计入。 |
| | | if (storeId == null) { |
| | | appendHuiminIncome(incomeVOS, operatorId); |
| | | appendHuiminIncome(incomeVOS, operatorId, usedCouponIds); |
| | | if (operatorId == null) { |
| | | appendCouponPurchaseIncome(incomeVOS); |
| | | } |
| | |
| | | temp.setInsertTime(pointMerchandiseIncomeVo.getInsertTime()); |
| | | if (pointMerchandiseIncomeVo.getCash()!=null){ |
| | | temp.setAmount(pointMerchandiseIncomeVo.getCash()); |
| | | if (pointMerchandiseIncomeVo.getUserCouponId() != null) { |
| | | usedCouponIds.add(pointMerchandiseIncomeVo.getUserCouponId()); |
| | | temp.setId(pointMerchandiseIncomeVo.getUserCouponId().toString()); |
| | | } |
| | | incomeVOS.add(temp); |
| | | } |
| | | } |
| | | Map<Long, BigDecimal> couponDeductionAmounts = getCouponDeductionAmounts(usedCouponIds); |
| | | applyCouponDeductions(incomeVOS, couponDeductionAmounts); |
| | | // 平台智慧球场 |
| | | if (storeId==null&&operatorId==null){ |
| | | gameDataQuery.setObjectId(0); |
| | |
| | | } |
| | | |
| | | /** 惠民卡采用支付、退款两条事实流水,赠送卡不计营收。 */ |
| | | private void appendHuiminIncome(List<IncomeVO> incomeRecords, Integer operatorId) { |
| | | private void appendHuiminIncome(List<IncomeVO> incomeRecords, Integer operatorId, Set<Long> usedCouponIds) { |
| | | HuiminPayQuery query = new HuiminPayQuery(); |
| | | query.setGiftPaymentType(3); |
| | | if (operatorId != null) { |
| | |
| | | payment.setIncomeType(6); |
| | | payment.setInsertTime(record.getPaymentTime()); |
| | | payment.setAmount(record.getSalesMoney()); |
| | | if (record.getUserCouponId() != null) { |
| | | usedCouponIds.add(record.getUserCouponId()); |
| | | payment.setId(record.getUserCouponId().toString()); |
| | | } |
| | | incomeRecords.add(payment); |
| | | if (Integer.valueOf(3).equals(record.getStatus()) |
| | | || Integer.valueOf(2).equals(record.getRefundStatus()) |