|
|
@@ -22,10 +22,12 @@ import com.fs.live.service.*;
|
|
|
import com.fs.live.utils.ProcessManager;
|
|
|
import com.fs.live.vo.*;
|
|
|
import com.fs.store.domain.FsMiniprogramSubNotifyTask;
|
|
|
+import com.fs.store.domain.FsStoreProduct;
|
|
|
import com.fs.store.domain.FsUser;
|
|
|
import com.fs.store.dto.TemplateMessageSendRequestDTO;
|
|
|
import com.fs.store.enums.MiniAppNotifyTaskStatusEnum;
|
|
|
import com.fs.store.mapper.FsMiniprogramSubNotifyTaskMapper;
|
|
|
+import com.fs.store.mapper.FsStoreProductMapper;
|
|
|
import com.fs.store.mapper.FsUserMapper;
|
|
|
import com.fs.system.domain.SysConfig;
|
|
|
import com.fs.system.service.ISysConfigService;
|
|
|
@@ -96,6 +98,8 @@ public class LiveServiceImpl implements ILiveService
|
|
|
private LiveCouponIssueMapper liveCouponIssueMapper;
|
|
|
@Autowired
|
|
|
private FsUserMapper fsUserMapper;
|
|
|
+ @Autowired
|
|
|
+ private FsStoreProductMapper fsStoreProductMapper;
|
|
|
|
|
|
@Autowired
|
|
|
private RedisUtil redisUtil;
|
|
|
@@ -387,7 +391,9 @@ public class LiveServiceImpl implements ILiveService
|
|
|
|
|
|
}
|
|
|
int result = baseMapper.updateLive(live);
|
|
|
- liveAutoTaskService.recalcLiveAutoTask(live);
|
|
|
+ if (live.getStatus() == 2) {
|
|
|
+ liveAutoTaskService.recalcLiveAutoTask(live);
|
|
|
+ }
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
@@ -810,6 +816,8 @@ public class LiveServiceImpl implements ILiveService
|
|
|
// 直播间商品
|
|
|
List<LiveGoodsVo> goodsList = liveGoodsService.selectProductListByLiveId(queryParam);
|
|
|
if (!goodsList.isEmpty()) {
|
|
|
+ List<String> goodsProductIds = goodsList.stream().map(item -> String.valueOf(item.getProductId())).collect(Collectors.toList());
|
|
|
+ Map<Long, FsStoreProduct> collect = fsStoreProductMapper.selectFsStoreProductByProductIds(goodsProductIds).stream().collect(Collectors.toMap(FsStoreProduct::getProductId, item -> item));
|
|
|
LiveGoods liveGoodsEntity = new LiveGoods();
|
|
|
for (LiveGoodsVo liveGoods : goodsList) {
|
|
|
BeanUtils.copyBeanProp(liveGoodsEntity, liveGoods);
|
|
|
@@ -817,6 +825,7 @@ public class LiveServiceImpl implements ILiveService
|
|
|
liveGoodsEntity.setLiveId(newLiveId);
|
|
|
liveGoodsEntity.setCreateTime(now);
|
|
|
liveGoodsEntity.setIsShow(false);
|
|
|
+ liveGoodsEntity.setStock(collect.containsKey(liveGoods.getProductId()) ? collect.get(liveGoods.getProductId()).getStock() : 0);
|
|
|
liveGoodsEntity.setCompanyId(live.getCompanyId());
|
|
|
liveGoodsEntity.setCompanyUserId(live.getCompanyUserId());
|
|
|
liveGoodsService.insertLiveGoods(liveGoodsEntity);
|