puzhibing
2023-04-10 aea5a0cc3bbd5c2d131a504e5aa2a124d9f131b3
management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/TBranchOfficeServiceImpl.java
@@ -76,7 +76,8 @@
        // 优惠券数据,,,通过订单找到该区域的下单人,找出优惠券信息
        List<Integer> userIds = orders.stream().map(TOrder::getUserId).collect(Collectors.toList());
        List<TUserToCoupon> tUserToCoupons = tUserToCouponMapper.selectList(new EntityWrapper<TUserToCoupon>().in("userId", userIds));
        List<TUserToCoupon> tUserToCoupons = tUserToCouponMapper.selectList(new EntityWrapper<TUserToCoupon>().eq("objectId", tBranchOfficeId)
                .eq("roleType",2));
        // 优惠券有效数量
        int validCount = tUserToCoupons.stream().mapToInt(TUserToCoupon::getValidCount).sum();
        // 过期数量
@@ -165,7 +166,8 @@
                // 优惠券数据,,,通过订单找到该区域的下单人,找出优惠券信息
                List<Integer> userIds = orderList.stream().map(TOrder::getUserId).collect(Collectors.toList());
                List<TUserToCoupon> tUserToCoupons = tUserToCouponMapper.selectList(new EntityWrapper<TUserToCoupon>().in("userId", userIds));
                List<TUserToCoupon> tUserToCoupons = tUserToCouponMapper.selectList(new EntityWrapper<TUserToCoupon>().eq("objectId", tBranchOfficeResp.getId())
                        .eq("roleType",2));
                // 优惠券有效数量
                int validCount = tUserToCoupons.stream().mapToInt(TUserToCoupon::getValidCount).sum();
                // 过期数量