xuhy
2023-04-09 a4c86b6b9d61bec99bff97415ac25e1fd36fe28a
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();
                // 过期数量