Commit ccd4051e by 朱亚洁

feat:[1005255]取消运营平台限制

parent a5bc3788
......@@ -373,4 +373,15 @@ public class ProductConsr {
LOGGER.error("自主审核失败[productService.selfAudit]:创建失败:article:{}" + e.getMessage(), product);
}
}
public void setOffShelvesProductOnShelves(Long channelId, List<Long> productIds) throws BizException {
LOGGER.info("【资源中心(消)】设置下架作品上架,<START>.[channelId]=" + channelId + " [productIds]=" + productIds + "]");
if (channelId == null || ListUtils.isEmpty(productIds)) {
return;
}
try {
productService.setOffShelvesProductOnShelves(channelId, productIds);
} catch (Exception e) {
LOGGER.error("【资源中心(消)】调用失败[setOffShelvesProductOnShelves]:" + e.getMessage(), e);
}
}
}
......@@ -92,6 +92,7 @@ import java.util.concurrent.ExecutionException;
import java.util.concurrent.Future;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;
import java.util.*;
import java.util.stream.Collectors;
/**
......@@ -403,8 +404,16 @@ public class ResourcePageBizImpl implements ResourcePageBiz {
//作品自动上架
List<Long> productIds = productIds4Shelve;
ThreadPoolUtils.OTHER_POOL.execute(()->{
Long channelId = getChannelIdFromUrl(updateResourceColumnVO.getItemVOList().get(0).getLinkUrl());
productConsr.productAutoOnShelves(channelId, productIds);
Long channelId = updateResourceColumnVO.getChannelId();
if (null == channelId) {
channelId = getChannelIdFromUrl(updateResourceColumnVO.getItemVOList().get(0).getLinkUrl());
}
Map<Long, String> offShelvesMap = productConsr.productAutoOnShelves(channelId, productIds);
if (!MapUtils.isEmpty(offShelvesMap)) {
//已下架的作品重新上架
List<Long> proIds = new ArrayList<>(offShelvesMap.keySet());
productConsr.setOffShelvesProductOnShelves(channelId, proIds);
}
});
}
}
......@@ -1337,6 +1346,7 @@ public class ResourcePageBizImpl implements ResourcePageBiz {
@Transactional(rollbackFor = Exception.class)
public Long updateResourcePageAndColumn(UpdateResourcePageVO updateResourcePageVO) {
Long resourcePageId = this.updateResourcePage(updateResourcePageVO);
ResourcePage page = resourcePageDao.getById(resourcePageId);
//当前所有栏目
List<Long> originColumnIds = resourcePageColumnDao.getColumnIdsByPageId(resourcePageId);
//删除栏目资源
......@@ -1348,6 +1358,7 @@ public class ResourcePageBizImpl implements ResourcePageBiz {
for (UpdateResourceColumnVO columnVO : list) {
columnVO.setResourcePageId(resourcePageId);
columnVO.setCreateUser(updateResourcePageVO.getCreateUser());
columnVO.setChannelId(page.getChannelId());
columnVO.setColumnSeq(list.indexOf(columnVO) + 1);
if (null != columnVO.getResourcePageColumnId()) {
columnIds.add(columnVO.getResourcePageColumnId());
......@@ -1380,7 +1391,6 @@ public class ResourcePageBizImpl implements ResourcePageBiz {
}
// 更新图书封面
ResourcePage page = resourcePageDao.getById(resourcePageId);
if (StrUtil.isNotBlank(updateResourcePageVO.getBookCover()) && Objects.nonNull(page)) {
Long bookId;
if (Objects.nonNull(page.getBookGroupId())) {
......
......@@ -70,4 +70,8 @@ public class UpdateResourceColumnVO {
* 导航id
*/
private Long navigationId;
/**
* 渠道id
*/
private Long channelId;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment