소스 검색

重算所有的自动化任务,查询商品仅有商品码的数据

yuhongqi 4 주 전
부모
커밋
1f07dfcda2

+ 1 - 0
fs-live-socket/src/main/java/com/fs/live/task/Task.java

@@ -171,6 +171,7 @@ public class Task {
                 webSocketServer.broadcastMessage(live.getLiveId(), JSONObject.toJSONString(R.ok().put("data",sendMsgVo)));
                 List<LiveAutoTask> collect = liveAutoTasks.stream().filter(liveAutoTask -> liveAutoTask.getLiveId().equals(live.getLiveId())).collect(Collectors.toList());
                 if (!collect.isEmpty()) {
+                    redisCache.redisTemplate.delete(key + live.getLiveId());
                     collect.forEach(liveAutoTask -> {
                         liveAutoTask.setCreateTime(null);
                         liveAutoTask.setUpdateTime(null);

+ 5 - 1
fs-service-system/src/main/java/com/fs/live/service/impl/LiveAutoTaskServiceImpl.java

@@ -21,6 +21,8 @@ import com.fs.live.param.LiveLotteryProduct;
 import com.fs.live.service.ILiveAutoTaskService;
 import com.fs.live.service.ILiveGoodsService;
 import com.fs.live.vo.LiveGoodsVo;
+import com.fs.live.vo.LiveLotteryConfVo;
+import com.fs.live.vo.LiveLotteryProductListVo;
 import org.checkerframework.checker.units.qual.A;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
@@ -126,7 +128,9 @@ public class LiveAutoTaskServiceImpl implements ILiveAutoTaskService {
             LiveLotteryConf liveLotteryConf = liveLotteryConfMapper.selectLiveLotteryConfByLotteryId(Long.valueOf(liveAutoTask.getContent()));
             if(liveLotteryConf == null) return R.error("抽奖配置不存在");
             if(!"0".equals(liveLotteryConf.getLotteryStatus())) return R.error("抽奖状态应该为:未开始");
-            List<LiveLotteryProduct> prizes = lotteryProductConfMapper.selectLiveLotteryProductConfByLotteryId(liveLotteryConf.getLotteryId());
+            List<Long> lotteryIds = new ArrayList<>();
+            lotteryIds.add(liveLotteryConf.getLotteryId());
+            List<LiveLotteryProductListVo> prizes = lotteryProductConfMapper.selectLiveLotteryProductConfByLotteryIds(lotteryIds);
             if (prizes == null || prizes.isEmpty()) {
                 return R.error("抽奖配置请先添加奖品");
             }

+ 1 - 0
fs-service-system/src/main/java/com/fs/live/service/impl/LiveServiceImpl.java

@@ -798,6 +798,7 @@ public class LiveServiceImpl implements ILiveService
                 liveLotteryConfEntity.setLiveId(newLiveId);
                 liveLotteryConfEntity.setLotteryStatus(String.valueOf(0));
                 liveLotteryConfEntity.setCreateTime(now);
+                liveLotteryConfEntity.setUpdateTime(now);
                 liveLotteryConfService.insertLiveLotteryConf(liveLotteryConfEntity);
                 products.stream().filter(product -> product.getLotteryId().equals(liveLotteryConf.getLotteryId()))
                         .forEach(product -> {