| | |
| | | return cardBuyMoneyMap; |
| | | } |
| | | |
| | | /** |
| | | * 卡包订单子项分配到的金额 |
| | | */ |
| | | public static BigDecimal orderItemSonMoney(String orderItemSonId, CommonService commonService) { |
| | | SqlSentence sqlSentence = new SqlSentence(); |
| | | Map<String, Object> values = new HashMap<>(); |
| | | values.put("isDel", BaseEntity.NO); |
| | | values.put("orderItemSonId", orderItemSonId); |
| | | StringBuilder sql = new StringBuilder(); |
| | | sql.append(" SELECT SUM(actualTotal) AS actualTotal FROM user_card_pay AS u "); |
| | | sql.append(" JOIN orders_total AS ot ON ot.id = u.orderId"); |
| | | sql.append(" WHERE u.isDel = #{m.isDel} AND u.orderItemSonId = #{m.orderItemSonId} "); |
| | | //卡包要么全退,要么不退,这里查未退款的 |
| | | sql.append(" AND ot.isDel = #{m.isDel} AND ot.payStatus = 3 AND ot.refundStatus = -1 "); |
| | | sqlSentence.sqlSentence(sql.toString(), values); |
| | | UserCardPay userCardPay = commonService.selectOne(UserCardPayMapper.class, sqlSentence); |
| | | return userCardPay == null?BigDecimal.ZERO:userCardPay.getActualTotal(); |
| | | } |
| | | |
| | | /**获取卡项权益的条目数量*/ |
| | | public static List<CardItemInfo> getCardInfoList(String cardEquityId,CommonService commonService){ |
| | | SqlSentence sqlSentence = new SqlSentence(); |