Commit cebf62ba by 吴博

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

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