|
@@ -23,6 +23,7 @@ import com.fs.course.service.IFsCourseCheckinReceiveService;
|
|
|
import com.fs.course.utils.luckyDraw.LotteryUtil;
|
|
import com.fs.course.utils.luckyDraw.LotteryUtil;
|
|
|
import com.fs.course.utils.luckyDraw.Prize;
|
|
import com.fs.course.utils.luckyDraw.Prize;
|
|
|
import com.fs.his.domain.*;
|
|
import com.fs.his.domain.*;
|
|
|
|
|
+import com.fs.his.vo.FsGoodsVO;
|
|
|
import com.fs.his.enums.FsUserIntegralLogTypeEnum;
|
|
import com.fs.his.enums.FsUserIntegralLogTypeEnum;
|
|
|
import com.fs.his.mapper.*;
|
|
import com.fs.his.mapper.*;
|
|
|
import com.fs.his.param.WxSendRedPacketParam;
|
|
import com.fs.his.param.WxSendRedPacketParam;
|
|
@@ -680,41 +681,37 @@ public class FsCourseCheckinReceiveServiceImpl implements IFsCourseCheckinReceiv
|
|
|
query.setUserId(userId);
|
|
query.setUserId(userId);
|
|
|
List<FsCourseCheckinReceive> list = fsCourseCheckinReceiveMapper.selectFsCourseCheckinReceiveList(query);
|
|
List<FsCourseCheckinReceive> list = fsCourseCheckinReceiveMapper.selectFsCourseCheckinReceiveList(query);
|
|
|
if (list == null || list.isEmpty()) {
|
|
if (list == null || list.isEmpty()) {
|
|
|
- return list;
|
|
|
|
|
|
|
+ return new ArrayList<>();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- Set<Long> activityIds = list.stream()
|
|
|
|
|
- .filter(r -> r.getActivityId() != null)
|
|
|
|
|
|
|
+ List<Long> activityIds = list.stream()
|
|
|
.map(FsCourseCheckinReceive::getActivityId)
|
|
.map(FsCourseCheckinReceive::getActivityId)
|
|
|
- .collect(Collectors.toSet());
|
|
|
|
|
-
|
|
|
|
|
- Map<Long, String> activityNameMap = new HashMap<>();
|
|
|
|
|
- for (Long activityId : activityIds) {
|
|
|
|
|
- FsCourseCheckinActivity activity = fsCourseCheckinActivityMapper.selectFsCourseCheckinActivityByActivityId(activityId);
|
|
|
|
|
- if (activity != null) {
|
|
|
|
|
- activityNameMap.put(activityId, activity.getActivityName());
|
|
|
|
|
|
|
+ .filter(Objects::nonNull)
|
|
|
|
|
+ .collect(Collectors.toList());
|
|
|
|
|
+ if (!activityIds.isEmpty()) {
|
|
|
|
|
+ List<FsCourseCheckinActivity> activities = fsCourseCheckinActivityMapper
|
|
|
|
|
+ .selectFsCourseCheckinActivityByActivityIds(new ArrayList<>(activityIds));
|
|
|
|
|
+ Map<Long, String> activityNameMap = activities.stream()
|
|
|
|
|
+ .collect(Collectors.toMap(FsCourseCheckinActivity::getActivityId, FsCourseCheckinActivity::getActivityName, (a, b) -> a));
|
|
|
|
|
+ for (FsCourseCheckinReceive receive : list) {
|
|
|
|
|
+ if (receive.getActivityId() != null) {
|
|
|
|
|
+ receive.setActivityName(activityNameMap.get(receive.getActivityId()));
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- Set<Long> goodsIds = list.stream()
|
|
|
|
|
- .filter(r -> r.getGoodsId() != null)
|
|
|
|
|
|
|
+ List<Long> goodsIds = list.stream()
|
|
|
.map(FsCourseCheckinReceive::getGoodsId)
|
|
.map(FsCourseCheckinReceive::getGoodsId)
|
|
|
- .collect(Collectors.toSet());
|
|
|
|
|
-
|
|
|
|
|
- Map<Long, String> goodsNameMap = new HashMap<>();
|
|
|
|
|
- for (Long goodsId : goodsIds) {
|
|
|
|
|
- FsIntegralGoods goods = fsIntegralGoodsMapper.selectFsIntegralGoodsByGoodsId(goodsId);
|
|
|
|
|
- if (goods != null) {
|
|
|
|
|
- goodsNameMap.put(goodsId, goods.getGoodsName());
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- for (FsCourseCheckinReceive receive : list) {
|
|
|
|
|
- if (receive.getActivityId() != null) {
|
|
|
|
|
- receive.setActivityName(activityNameMap.get(receive.getActivityId()));
|
|
|
|
|
- }
|
|
|
|
|
- if (receive.getGoodsId() != null) {
|
|
|
|
|
- receive.setGoodsName(goodsNameMap.get(receive.getGoodsId()));
|
|
|
|
|
|
|
+ .filter(Objects::nonNull)
|
|
|
|
|
+ .collect(Collectors.toList());
|
|
|
|
|
+ if (!goodsIds.isEmpty()) {
|
|
|
|
|
+ List<FsGoodsVO> goodsList = fsIntegralGoodsMapper.getFsGoodsVOListByIds(goodsIds);
|
|
|
|
|
+ Map<Long, String> goodsNameMap = goodsList.stream()
|
|
|
|
|
+ .collect(Collectors.toMap(FsGoodsVO::getId, FsGoodsVO::getName, (a, b) -> a));
|
|
|
|
|
+ for (FsCourseCheckinReceive receive : list) {
|
|
|
|
|
+ if (receive.getGoodsId() != null) {
|
|
|
|
|
+ receive.setGoodsName(goodsNameMap.get(receive.getGoodsId()));
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|