Merge branch 'master' into test6.9.13
Showing
1 changed file
with
27 additions
and
27 deletions
@@ -135,36 +135,36 @@ public class CouponServiceImpl implements ICouponService,IBusinessExportService{ | @@ -135,36 +135,36 @@ public class CouponServiceImpl implements ICouponService,IBusinessExportService{ | ||
135 | List<Coupon> coupons = couponMapper.selectByCondition(req); | 135 | List<Coupon> coupons = couponMapper.selectByCondition(req); |
136 | 136 | ||
137 | // 只获取使用记录 | 137 | // 只获取使用记录 |
138 | - Map<Integer, UserCouponNum> sendNumMap = null; | ||
139 | - Map<Integer, UserCouponNum> useNumMap = null; | ||
140 | - if (CollectionUtils.isNotEmpty(coupons)){ | ||
141 | - List<Integer> couponIdList = coupons.stream().map(Coupon::getId).collect(Collectors.toList()); | ||
142 | - List<UserCouponNum> sendNumList = userCouponMapper.selectByCouponIds(couponIdList); | ||
143 | - LOGGER.info("sendNumList is {}", sendNumList); | ||
144 | - sendNumMap = sendNumList.stream().collect(Collectors.toMap(UserCouponNum::getCouponId, Function.identity(), (k1,k2)->k2)); | ||
145 | - List<UserCouponNum> useNumList = userCouponMapper.selectByCouponIdsAndStatus(couponIdList); | ||
146 | - LOGGER.info("useNumList is {}", useNumList); | ||
147 | - useNumMap = useNumList.stream().collect(Collectors.toMap(UserCouponNum::getCouponId, Function.identity(), (k1,k2)->k2)); | ||
148 | - } | 138 | +// Map<Integer, UserCouponNum> sendNumMap = null; |
139 | +// Map<Integer, UserCouponNum> useNumMap = null; | ||
140 | +// if (CollectionUtils.isNotEmpty(coupons)){ | ||
141 | +// List<Integer> couponIdList = coupons.stream().map(Coupon::getId).collect(Collectors.toList()); | ||
142 | +// List<UserCouponNum> sendNumList = userCouponMapper.selectByCouponIds(couponIdList); | ||
143 | +// LOGGER.info("sendNumList is {}", sendNumList); | ||
144 | +// sendNumMap = sendNumList.stream().collect(Collectors.toMap(UserCouponNum::getCouponId, Function.identity(), (k1,k2)->k2)); | ||
145 | +// List<UserCouponNum> useNumList = userCouponMapper.selectByCouponIdsAndStatus(couponIdList); | ||
146 | +// LOGGER.info("useNumList is {}", useNumList); | ||
147 | +// useNumMap = useNumList.stream().collect(Collectors.toMap(UserCouponNum::getCouponId, Function.identity(), (k1,k2)->k2)); | ||
148 | +// } | ||
149 | 149 | ||
150 | List<CouponQueryResp> couponQueryResps = initCouponQueryResps(coupons,req.getCurTime()); | 150 | List<CouponQueryResp> couponQueryResps = initCouponQueryResps(coupons,req.getCurTime()); |
151 | 151 | ||
152 | - if (MapUtils.isNotEmpty(sendNumMap) || MapUtils.isNotEmpty(useNumMap)) { | ||
153 | - Map<Integer, UserCouponNum> finalSendNumMap = sendNumMap; | ||
154 | - Map<Integer, UserCouponNum> finalUseNumMap = useNumMap; | ||
155 | - couponQueryResps = couponQueryResps.stream().map(x->{ | ||
156 | - | ||
157 | - if (MapUtils.isNotEmpty(finalSendNumMap)){ | ||
158 | - x.setSendNum(finalSendNumMap.get(x.getId()) == null ? 0 :finalSendNumMap.get(x.getId()).getCnt()); | ||
159 | - } | ||
160 | - | ||
161 | - if (MapUtils.isNotEmpty(finalUseNumMap)){ | ||
162 | - x.setUseNum(finalUseNumMap.get(x.getId()) == null ? 0 : finalUseNumMap.get(x.getId()).getCnt()); | ||
163 | - } | ||
164 | - | ||
165 | - return x; | ||
166 | - }).collect(Collectors.toList()); | ||
167 | - } | 152 | +// if (MapUtils.isNotEmpty(sendNumMap) || MapUtils.isNotEmpty(useNumMap)) { |
153 | +// Map<Integer, UserCouponNum> finalSendNumMap = sendNumMap; | ||
154 | +// Map<Integer, UserCouponNum> finalUseNumMap = useNumMap; | ||
155 | +// couponQueryResps = couponQueryResps.stream().map(x->{ | ||
156 | +// | ||
157 | +// if (MapUtils.isNotEmpty(finalSendNumMap)){ | ||
158 | +// x.setSendNum(finalSendNumMap.get(x.getId()) == null ? 0 :finalSendNumMap.get(x.getId()).getCnt()); | ||
159 | +// } | ||
160 | +// | ||
161 | +// if (MapUtils.isNotEmpty(finalUseNumMap)){ | ||
162 | +// x.setUseNum(finalUseNumMap.get(x.getId()) == null ? 0 : finalUseNumMap.get(x.getId()).getCnt()); | ||
163 | +// } | ||
164 | +// | ||
165 | +// return x; | ||
166 | +// }).collect(Collectors.toList()); | ||
167 | +// } | ||
168 | 168 | ||
169 | jsonObject.put("coupons",couponQueryResps); | 169 | jsonObject.put("coupons",couponQueryResps); |
170 | return new ApiResponse.ApiResponseBuilder().data(jsonObject).build(); | 170 | return new ApiResponse.ApiResponseBuilder().data(jsonObject).build(); |
-
Please register or login to post a comment