Commit 904b44b3 by 田超

Merge branch 'feature/1003652' into 'master'

feat: [1003652]  第三方资源在书刊详情页引导显示价格和人数

See merge request rays/pcloud-book!986
parents 18bc3cd9 cebf62ba
......@@ -309,4 +309,6 @@ public interface AppletNewsBiz {
* @return
*/
Map<Long, AppletNewsDTO> getByIds4Record(List<Long> newsIds);
void fillBrowseCount(List<AppletNewsDTO> recordList);
}
......@@ -549,6 +549,9 @@ public class AppletNewsBizImpl implements AppletNewsBiz {
//非第一页 获取第一页的数据 并排除
pageBeanNew = getAppletNewsDTOPageBeanNew(currentPage, numPerPage, newsClassifyId, paramMap, subKey);
}
if (!ListUtils.isEmpty(pageBeanNew.getRecordList())) {
fillBrowseCount(pageBeanNew.getRecordList());
}
return pageBeanNew;
}
......@@ -730,7 +733,8 @@ public class AppletNewsBizImpl implements AppletNewsBiz {
* 点击量浏览量
* * @param null
*/
private void fillBrowseCount(List<AppletNewsDTO> recordList) {
@Override
public void fillBrowseCount(List<AppletNewsDTO> recordList) {
if (ListUtils.isEmpty(recordList)) {
return;
}
......
......@@ -145,4 +145,10 @@ public class AppletNewsDTO extends BaseDto {
private String cityCode;
@ApiModelProperty("城市名")
private String city;
@ApiModelProperty("划线价")
private String crossedPrice;
@ApiModelProperty("评估价")
private String appraisalPrice;
}
......@@ -112,4 +112,10 @@ public class AppletNews extends BaseTempletClassify {
@ApiModelProperty("第三方资源")
List<AppletThirdResourcesRelation> thirdResourcesRelations;
@ApiModelProperty("划线价")
private String crossedPrice;
@ApiModelProperty("评估价")
private String appraisalPrice;
}
......@@ -5229,6 +5229,10 @@ public class BookGroupBizImpl implements BookGroupBiz {
map.put("coverImg", bookDto.getCoverImg());
}
map.put("isXIAORUI", isXIAORUI);
//资源数量
List<BookServeDTO> serveDTOList = this.getBookAndBookGroupServeIds(adviserId, bookId, channelId);
this.removeCanNotBuy(serveDTOList);
map.put("resourceCount", ListUtils.isEmpty(serveDTOList) ? 0 : serveDTOList.size());
return map;
}
......
......@@ -1340,10 +1340,20 @@ public class RightsSettingBizImpl implements RightsSettingBiz {
Long bookId, Integer type, Long officialAccountsId) {
FillRightsSettingAppletsDTO applets = getFillRightsSettingApplets(rightsSettingId, wechatUserId, rightsClassifyId, top, bookId, officialAccountsId);
List<AppletNews> news = applets.getDesignatedNews();
if (ListUtils.isEmpty(news)) {
return;
}
List<AppletNewsDTO> appletNewsDTOList = new ArrayList<>();
BeanUtils.copyListProperties(news, appletNewsDTOList, AppletNewsDTO.class);
appletNewsBiz.fillBrowseCount(appletNewsDTOList);
Map<Long, Integer> newsBrowseCountMap = appletNewsDTOList.stream().collect(Collectors.toMap(AppletNewsDTO::getId, AppletNewsDTO::getBrowseCount,(key1, key2) -> key2));
for (AppletNews appletNews : news) {
Integer browseCount = MapUtils.isEmpty(newsBrowseCountMap) || null == newsBrowseCountMap.get(appletNews.getId()) ?
0 : newsBrowseCountMap.get(appletNews.getId());
items.add(RightsNowItem.builder().serveId(appletNews.getId()).serveName(appletNews.getNewsName()).serveType(RightsServeTypeEnum.NEWS.name())
.serveTypeName("资讯").servePic(appletNews.getPic1()).type(type).jumpType(appletNews.getJumpType())
.jumpUrl(appletNews.getJumpUrl()).newsType(appletNews.getType()).build());
.jumpUrl(appletNews.getJumpUrl()).newsType(appletNews.getType()).crossedPrice(appletNews.getCrossedPrice()).
appraisalPrice(appletNews.getAppraisalPrice()).borwseCount(browseCount).build());
}
}
......@@ -1565,6 +1575,9 @@ public class RightsSettingBizImpl implements RightsSettingBiz {
item.setDigest(appletNewsDTO.getDigest());
item.setDigest(appletNewsDTO.getDigest());
item.setUrlNumber(appletNewsDTO.getUrlNumber());
item.setCrossedPrice(appletNewsDTO.getCrossedPrice());
item.setAppraisalPrice(appletNewsDTO.getAppraisalPrice());
item.setBorwseCount(appletNewsDTO.getBrowseCount());
}
}
}
......
......@@ -117,4 +117,14 @@ public class RightsNowItem extends BaseEntity {
private Boolean hasThirdLink;
@ApiModelProperty("跳转外链编号")
private String urlNumber;
@ApiModelProperty("划线价")
private String crossedPrice;
@ApiModelProperty("评估价")
private String appraisalPrice;
@ApiModelProperty("资讯浏览量")
private Integer borwseCount;
}
......@@ -33,13 +33,16 @@
<result column="business_card_type" property="businessCardType" jdbcType="TINYINT" />
<result column="business_card_isOpen" property="businessCardIsOpen" jdbcType="TINYINT" />
<result column="city_code" property="cityCode" jdbcType="VARCHAR" />
<result column="agent_id" property="agentId" jdbcType="BIGINT" />
<result column="crossed_price" property="agentId" jdbcType="VARCHAR" />
<result column="appraisal_price" property="appraisalPrice" jdbcType="VARCHAR" />
</resultMap>
<sql id="Base_Column_List">
news.id, news.news_name, news.source, news.news_classify_id, news.pro_label_id, news.dep_label_id, news.pur_label_id, news.type, news.digest,
pic1, pic2, pic3, news.content, show_state, news.create_time, news.update_time, news.first_classify, news.second_classify, news.grade_label_id, news.subject_label_id, news.rights_classify_id,
news.jump_type, news.jump_url, news.url_number, news.custom_tag_id, news.show_source, news.show_link,news.business_card_id,news.business_card_type,news.business_card_isOpen,city_code,agent_id
news.jump_type, news.jump_url, news.url_number, news.custom_tag_id, news.show_source, news.show_link,news.business_card_id,news.business_card_type,news.business_card_isOpen,city_code,agent_id,
crossed_price,
appraisal_price
</sql>
<sql id="sql_news">
m.id,
......@@ -74,13 +77,17 @@
insert into applet_news(
news_name, source, news_classify_id, pro_label_id, dep_label_id, pur_label_id, type, digest,
pic1, pic2, pic3, content, show_state, create_time, update_time , first_classify, second_classify, grade_label_id, subject_label_id, rights_classify_id,
jump_type, jump_url,url_number, custom_tag_id, show_source, show_link,business_card_id,business_card_type,business_card_isOpen,city_code, agent_id
jump_type, jump_url,url_number, custom_tag_id, show_source, show_link,business_card_id,business_card_type,business_card_isOpen,city_code, agent_id,
crossed_price,
appraisal_price
)
values (
#{newsName}, #{source}, #{newsClassifyId}, #{proLabelId}, #{depLabelId}, #{purLabelId}, #{type}, #{digest},
#{pic1}, #{pic2}, #{pic3}, #{content}, #{showState}, NOW(), NOW(), #{firstClassify,jdbcType=BIGINT}, #{secondClassify,jdbcType=BIGINT},
#{gradeLabelId,jdbcType=BIGINT}, #{subjectLabelId,jdbcType=BIGINT}, #{rightsClassifyId,jdbcType=BIGINT},
#{jumpType}, #{jumpUrl}, #{urlNumber}, #{customTagId}, #{showSource}, #{showLink}, #{businessCardId}, #{businessCardType}, #{businessCardIsOpen}, #{cityCode}, #{agentId}
#{jumpType}, #{jumpUrl}, #{urlNumber}, #{customTagId}, #{showSource}, #{showLink}, #{businessCardId}, #{businessCardType}, #{businessCardIsOpen}, #{cityCode}, #{agentId},
#{crossedPrice},
#{appraisalPrice}
)
</insert>
......@@ -132,7 +139,13 @@
business_card_id = #{businessCardId},
business_card_type = #{businessCardType},
business_card_isOpen = #{businessCardIsOpen},
update_time=NOW()
update_time=NOW(),
<if test="crossedPrice != null">
crossed_price = #{crossedPrice},
</if>
<if test="appraisalPrice != null">
appraisal_price = #{appraisalPrice},
</if>
</set>
where id = #{id,jdbcType=BIGINT}
</update>
......@@ -326,7 +339,9 @@
n.jump_url jumpUrl,
n.url_number urlNumber,
n.show_source showSource,
n.show_link showLink
n.show_link showLink,
n.crossed_price crossedPrice,
n.appraisal_price appraisalPrice
FROM applet_news n
LEFT JOIN applet_news_category category on n.id = category.applet_news_id
WHERE 1=1
......@@ -550,7 +565,9 @@
n.jump_url jumpUrl,
n.url_number urlNumber,
n.show_source showSource,
n.show_link showLink
n.show_link showLink,
n.crossed_price crossedPrice,
n.appraisal_price appraisalPrice
FROM applet_news n
LEFT JOIN applet_news_classify c ON n.news_classify_id=c.id
LEFT JOIN rights_setting_classify d ON n.rights_classify_id = d.id
......@@ -617,13 +634,22 @@
n.jump_url jumpUrl,
n.url_number urlNumber,
n.show_source showSource,
n.show_link showLink
n.show_link showLink,
n.crossed_price crossedPrice,
n.appraisal_price appraisalPrice,
count(n.id) browseCount
FROM applet_news n
left join
applet_link_click c on n.id = c.from_id
WHERE n.show_state = 1 and n.is_delete = 0
and
type_id = 1
AND record_type = 2
AND n.id IN
<foreach collection="list" item="item" separator="," open="(" close=")" >
${item}
</foreach>
group by n.id
ORDER BY n.update_time DESC
</select>
......@@ -654,7 +680,9 @@
n.jump_type jumpType,
n.jump_url jumpUrl,
n.show_source showSource,
n.show_link showLink
n.show_link showLink,
n.crossed_price crossedPrice,
n.appraisal_price appraisalPrice
FROM applet_news n
LEFT JOIN applet_news_classify c ON n.news_classify_id=c.id
WHERE n.show_state = 1 and n.is_delete = 0
......@@ -779,7 +807,9 @@
n.jump_url jumpUrl,
n.url_number urlNumber,
n.show_source showSource,
n.show_link showLink
n.show_link showLink,
n.crossed_price crossedPrice,
n.appraisal_price appraisalPrice
FROM applet_news n
LEFT JOIN applet_news_category category on n.id = category.applet_news_id
WHERE 1=1
......@@ -836,7 +866,9 @@
n.url_number urlNumber,
n.show_source showSource,
n.show_link showLink,
n.city_code cityCode
n.city_code cityCode,
n.crossed_price crossedPrice,
n.appraisal_price appraisalPrice
FROM
applet_news n
LEFT JOIN rights_setting_item_detail d ON d.serve_id = n.id
......@@ -936,7 +968,9 @@
n.url_number urlNumber,
n.show_source showSource,
n.city_code cityCode,
n.show_link showLink
n.show_link showLink,
n.crossed_price crossedPrice,
n.appraisal_price appraisalPrice
FROM applet_news n
WHERE n.show_state = 1 and n.is_delete = 0
AND n.city_code = #{cityId}
......@@ -981,9 +1015,18 @@
n.url_number urlNumber,
n.show_source showSource,
n.show_link showLink,
n.is_delete isDelete
n.is_delete isDelete,
n.crossed_price crossedPrice,
n.appraisal_price appraisalPrice,
count(n.id) browseCount
FROM applet_news n
left join
applet_link_click c on n.id = c.from_id
WHERE
type_id = 1
AND
record_type = 2
and
n.id IN
<foreach collection="list" item="item" separator="," open="(" close=")" >
#{item}
......
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