Commit dbdfe903 by guiq

bug: [none] 分享配置

parent fa122900
...@@ -3716,6 +3716,26 @@ public class ResourcePageBizImpl implements ResourcePageBiz { ...@@ -3716,6 +3716,26 @@ public class ResourcePageBizImpl implements ResourcePageBiz {
} else { } else {
resourcePageWxworkDao.insert(resourcePageWxwork); resourcePageWxworkDao.insert(resourcePageWxwork);
} }
if (ResourcePageConstants.WxworkPageTemplateTypeEnum.CUSTOM.getCode().equals(templateType)) {
ResourcePage resourcePage = resourcePageDao.getById(resourcePageId);
if (resourcePage == null || resourcePage.getSceneId() == null) {
return;
}
ResourcePageShare resourcePageShare = shareMapper.selectByResourcePageId(resourcePage.getSceneId());
if (resourcePageShare == null) {
ResourcePageShare pageShare = new ResourcePageShare();
pageShare.setCreateUser(wxworkPageCreateVO.getCreateUser());
pageShare.setUpdateUser(wxworkPageCreateVO.getCreateUser());
String shareTitle = Optional.ofNullable(wxworkPageCreateVO.getConfig()).map(x -> x.get("title")).map(String.class::cast).filter(StringUtils::isNotBlank).orElse("书童小睿");
pageShare.setShareTitle(shareTitle);
pageShare.setShareImgUrl(StringUtils.isBlank(defaultShareImgUrl) ? "https://file.5rs.me/oss/uploadfe/png/782544053039e776b5379878a18de70e.png" : defaultShareImgUrl);
pageShare.setShareContent(StringUtils.isBlank(defaultShareContent) ? "我找到这本书「完整版」配套服务了,推荐给你" : defaultShareContent);
pageShare.setQrcodeId(resourcePage.getSceneId());
shareMapper.insert(pageShare);
}
}
/*if (ResourcePageConstants.WxworkPageTemplateTypeEnum.CUSTOM.getCode().equals(templateType)) { /*if (ResourcePageConstants.WxworkPageTemplateTypeEnum.CUSTOM.getCode().equals(templateType)) {
//生成图片更新到数据库 //生成图片更新到数据库
HtmlDto htmlDto = new HtmlDto(); HtmlDto htmlDto = new HtmlDto();
......
...@@ -21,4 +21,6 @@ public interface ResourcePageShareMapper { ...@@ -21,4 +21,6 @@ public interface ResourcePageShareMapper {
ResourcePageShareDto selectDtoByPrimaryKey(Long qrCodeId); ResourcePageShareDto selectDtoByPrimaryKey(Long qrCodeId);
Integer save(ResourcePageShare record); Integer save(ResourcePageShare record);
ResourcePageShare selectByResourcePageId(Long sceneId);
} }
\ No newline at end of file
...@@ -167,4 +167,12 @@ ...@@ -167,4 +167,12 @@
create_time = #{createTime,jdbcType=TIMESTAMP} create_time = #{createTime,jdbcType=TIMESTAMP}
where qrcode_id = #{qrcodeId,jdbcType=BIGINT} where qrcode_id = #{qrcodeId,jdbcType=BIGINT}
</update> </update>
<select id="selectByResourcePageId" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from resource_page_share
where qrcode_id = #{sceneId}
limit 1
</select>
</mapper> </mapper>
\ No newline at end of file
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