Commit 7af5a9bf by 吴博

feat: [1005211] 部分资讯转作品

parent 91ec974d
......@@ -327,4 +327,11 @@ public interface AppletNewsBiz {
* * @param null
*/
Map<Long, Integer> getStayOnlineAppClickCount();
/**
* 批量获取资讯详情
* @param newsIds
* @return
*/
List<AppletNews> getListByIds(List<Long> newsIds);
}
......@@ -1362,4 +1362,9 @@ public class AppletNewsBizImpl implements AppletNewsBiz {
}
return map;
}
@Override
public List<AppletNews> getListByIds(List<Long> newsIds) {
return appletNewsDao.getListByIds(newsIds);
}
}
......@@ -186,4 +186,11 @@ public interface AppletNewsDao extends BaseDao<AppletNews> {
* @return
*/
Map<Long, AppletNewsDTO> getByIds4Record(List<Long> newsIds);
/**
* 批量获取资讯详情
* @param newsIds
* @return
*/
List<AppletNews> getListByIds(List<Long> newsIds);
}
......@@ -247,6 +247,11 @@ public class AppletNewsDaoImpl extends BaseDaoImpl<AppletNews> implements Applet
}
@Override
public List<AppletNews> getListByIds(List<Long> newsIds) {
return this.getSqlSession().selectList(getStatement("getListByIds"), newsIds);
}
@Override
public Integer listAppletNews4WechatCount(Map<String, Object> paramMap) {
return getSessionTemplate().selectOne(getStatement("listAppletNews4WechatCount"), paramMap);
}
......
......@@ -273,4 +273,9 @@ public interface RightsSettingBiz {
* 处理资讯
*/
void handleNews();
/**
* 处理指定资讯
*/
void handleNews4Ids(List<Long> newsIds);
}
......@@ -1265,6 +1265,20 @@ public class RightsSettingBizImpl implements RightsSettingBiz {
}
@Override
public void handleNews4Ids(List<Long> newsIds) {
log.info("handleNews4Ids:{}", newsIds);
List<AppletNews> appletNews = appletNewsBiz.getListByIds(newsIds);
if (ListUtils.isEmpty(appletNews)) {
return;
}
//获取资讯与作品关系集合
Map<Long, Long> newsProductMap = getNewsProductMap(appletNews);
if (MapUtils.isNotEmpty(newsProductMap)) {
log.info(newsProductMap.toString());
}
}
private Map<Long, Long> getNewsProductMap(List<AppletNews> appletNews) {
String defaultPic1 = "https://oss.5rs.me/oss/uploadfe/jpg/5b47ff1c2b9a47a7d9fab10ef0990255.jpg";
Long partyId = null;
......@@ -1280,6 +1294,7 @@ public class RightsSettingBizImpl implements RightsSettingBiz {
//填充数据
Long finalPartyId = partyId;
appletNews.stream().forEach(news -> {
log.info("批量将资讯转成作品开始:{}", news);
Product product = new Product();
product.setCoverImg("https://oss.5rs.me/oss/uploadfe/jpg/03024429744ee9bf16abc728236b7ee7.jpg");
product.setDetailDesc(StringUtil.isEmpty(news.getDigest()) ? news.getNewsName() : news.getDigest());
......@@ -1325,6 +1340,7 @@ public class RightsSettingBizImpl implements RightsSettingBiz {
if (null != news.getId() && null != productId) {
newsProductMap.put(news.getId(), productId);
}
log.info("批量将资讯转成作品结束:newsId:{},productId:{}",news.getId(), productId);
});
return newsProductMap;
}
......
......@@ -436,4 +436,10 @@ public class RightsSettingFacede {
rightsSettingBiz.handleNews();
return new ResponseDto<>();
}
@ApiOperation("将资讯转成作品")
@PostMapping("handleNews4Ids")
public ResponseDto<?> handleNews4Ids(@RequestBody List<Long> newsIds) {
rightsSettingBiz.handleNews4Ids(newsIds);
return new ResponseDto<>();
}
}
\ No newline at end of file
......@@ -1077,4 +1077,16 @@
group by n.id
</select>
<select id="getListByIds" parameterType="list" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from
applet_news news
where
id IN
<foreach collection="list" item="item" separator="," open="(" close=")" >
#{item}
</foreach>
</select>
</mapper>
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