Commit c2cd33fc by 郑勇

feat: [1004002] 二维码样式新增,下载二维码时新增支持样式修改

parent 3df153f4
......@@ -5,6 +5,7 @@ import com.pcloud.book.book.entity.Book;
import com.pcloud.book.group.dto.AgentStatisticsInfoDTO;
import com.pcloud.book.group.dto.AltAndCountDTO;
import com.pcloud.book.group.dto.AppStatisticsDTO;
import com.pcloud.book.group.dto.BackgroundGroupQrcodeDTO;
import com.pcloud.book.group.dto.BookAppletSceneDTO;
import com.pcloud.book.group.dto.BookGroupClassifyDTO;
import com.pcloud.book.group.dto.BookGroupCountDTO;
......@@ -1000,4 +1001,9 @@ public interface BookGroupBiz {
* * @param null
*/
BookGroupSceneDTO getSceneQrcodeByBookGroupId(Long bookGroupId);
/**
*社群码下载选择样式
*/
BackgroundGroupQrcodeDTO getBackgroundGroupQr(BackgroundGroupQrcodeDTO backgroundGroupQrcodeDTO);
}
......@@ -78,6 +78,7 @@ import com.pcloud.book.group.dto.AgentStatisticsInfoDTO;
import com.pcloud.book.group.dto.AltAndCountDTO;
import com.pcloud.book.group.dto.AltIdAndNameDTO;
import com.pcloud.book.group.dto.AppStatisticsDTO;
import com.pcloud.book.group.dto.BackgroundGroupQrcodeDTO;
import com.pcloud.book.group.dto.BookAppletSceneDTO;
import com.pcloud.book.group.dto.BookGroupClassifyDTO;
import com.pcloud.book.group.dto.BookGroupCountDTO;
......@@ -1012,6 +1013,7 @@ public class BookGroupBizImpl implements BookGroupBiz {
//如果有颜色样式
qrcode = createQrcode(groupQrcodeStyle, groupQrcodeLink);
}
bookGroup.setOriginUrl(qrcode);
//如果有图片样式
if(null!=bookGroup.getBackgroundType() && bookGroup.getBackgroundType()>0){
qrcode= QrcodeUtils.getStyleQr(qrcode, bookGroup.getBackgroundType(), null);
......@@ -6077,4 +6079,28 @@ public class BookGroupBizImpl implements BookGroupBiz {
bookGroupSceneDTO.setQrcodeUrl(null == qrcodeSceneDto?null:qrcodeSceneDto.getQrcodeUrl());
return bookGroupSceneDTO;
}
@Override
public BackgroundGroupQrcodeDTO getBackgroundGroupQr(BackgroundGroupQrcodeDTO backgroundGroupQrcodeDTO) {
BookGroup group = bookGroupDao.getById(backgroundGroupQrcodeDTO.getBookGroupId());
if (null == group) {
throw new BookBizException(BookBizException.PARAM_IS_NULL, "群二维码不存在!");
}
//二维码跳转链接
String groupQrcodeLink = group.getGroupQrcodeLink();
//设置社群码样式
//每次更新之前都重新生成
String qrcode = QrcodeUtils.createWithMargin(groupQrcodeLink, 1);
GroupQrcodeStyle groupQrcodeStyle = groupQrcodeStyleDao.getQrcodeStyleByBookGroupId(group.getId());
if(null!=groupQrcodeStyle){
//如果有颜色样式
qrcode = createQrcode(groupQrcodeStyle, groupQrcodeLink);
}
//如果有图片样式
if(null!=backgroundGroupQrcodeDTO.getBackgroundType() && backgroundGroupQrcodeDTO.getBackgroundType()>0){
qrcode= QrcodeUtils.getStyleQr(qrcode, backgroundGroupQrcodeDTO.getBackgroundType(), null);
}
backgroundGroupQrcodeDTO.setBackgroundQrUrl(qrcode);
return backgroundGroupQrcodeDTO;
}
}
package com.pcloud.book.group.dto;
import com.pcloud.common.entity.BaseEntity;
import lombok.Data;
/**
* 描述 :二维码背景图
*
*/
@Data
public class BackgroundGroupQrcodeDTO extends BaseEntity {
/**
*
*/
private static final long serialVersionUID = -1546713800471863895L;
/**
* 背景图类型
*/
private Integer backgroundType;
/**
* 背景图二维码url
*/
private String backgroundQrUrl;
/**
* 二维码标识
*/
private Long bookGroupId;
}
......@@ -336,6 +336,19 @@ public class BookGroupDTO extends BaseDto {
*/
private GroupQrcodeStyle groupQrcodeStyle;
/**
* 微信选择颜色生成的原始码地址
*/
private String originUrl;
public String getOriginUrl() {
return originUrl;
}
public void setOriginUrl(String originUrl) {
this.originUrl = originUrl;
}
public GroupQrcodeStyle getGroupQrcodeStyle() {
return groupQrcodeStyle;
}
......
......@@ -219,6 +219,19 @@ public class BookGroup extends BaseEntity {
*/
private GroupQrcodeStyle groupQrcodeStyle;
/**
* 微信选择颜色生成的原始码地址
*/
private String originUrl;
public String getOriginUrl() {
return originUrl;
}
public void setOriginUrl(String originUrl) {
this.originUrl = originUrl;
}
public GroupQrcodeStyle getGroupQrcodeStyle() {
return groupQrcodeStyle;
}
......
......@@ -5,6 +5,7 @@ import com.pcloud.book.book.dto.MapResourceTotalCountDTO;
import com.pcloud.book.group.biz.BookGroupBiz;
import com.pcloud.book.group.biz.BookGroupClassifyBiz;
import com.pcloud.book.group.dao.BookGroupDao;
import com.pcloud.book.group.dto.BackgroundGroupQrcodeDTO;
import com.pcloud.book.group.dto.BookAppletSceneDTO;
import com.pcloud.book.group.dto.BookGroupDTO;
import com.pcloud.book.group.dto.ChangeQrCodeTypeDto;
......@@ -196,6 +197,19 @@ public class BookGroupFacadeImpl implements BookGroupFacade {
}
/**
* 群二维码下载带背景图
*/
@RequestMapping(value = "getBackgroundGroupQr", method = RequestMethod.POST)
public ResponseDto<?> getBackgroundGroupQr( @RequestHeader("token") String token, @RequestBody BackgroundGroupQrcodeDTO backgroundGroupQrcodeDTO )
throws BizException, PermissionException, JsonParseException {
if (null == backgroundGroupQrcodeDTO || null == backgroundGroupQrcodeDTO.getBackgroundType() || null == backgroundGroupQrcodeDTO.getBookGroupId()) {
throw new BookBizException(BookBizException.PARAM_IS_NULL, "参数有误!");
}
BackgroundGroupQrcodeDTO backgroundGroupQr = bookGroupBiz.getBackgroundGroupQr(backgroundGroupQrcodeDTO);
return new ResponseDto<>(backgroundGroupQr);
}
/**
* 根据社群码ID获取书名
*/
@Override
......
......@@ -37,6 +37,7 @@
<result column="group_qrcode_remark" property="groupQrcodeRemark" jdbcType="VARCHAR"/>
<result column="group_qrcode_link" property="groupQrcodeLink" jdbcType="VARCHAR"/>
<result column="back_ground_type" property="backgroundType" jdbcType="INTEGER" />
<result column="origin_url" property="originUrl" jdbcType="VARCHAR" />
<result column="jump_type" property="jumpType" jdbcType="INTEGER"/>
<result column="jump_url" property="jumpUrl" jdbcType="VARCHAR"/>
</resultMap>
......@@ -82,6 +83,7 @@
<result column="group_qrcode_remark" property="groupQrcodeRemark" jdbcType="VARCHAR"/>
<result column="group_qrcode_link" property="groupQrcodeLink" jdbcType="VARCHAR"/>
<result column="back_ground_type" property="backgroundType" jdbcType="INTEGER" />
<result column="origin_url" property="originUrl" jdbcType="VARCHAR" />
<result column="jump_type" property="jumpType" jdbcType="INTEGER"/>
<result column="jump_url" property="jumpUrl" jdbcType="VARCHAR"/>
</resultMap>
......@@ -93,7 +95,7 @@
update_time, is_delete, is_show_book_name,join_group_type,add_friend_guide,customer_service_name,
is_invite_group,book_group_cipher, last_push_update_time, is_some_update, agent_id, belong_special_agent,
short_book_name, open_weapp, single_group, related_book_group_id,group_qrcode_page_num,group_qrcode_location_id,group_qrcode_remark,
group_qrcode_link,back_ground_type, jump_type, jump_url
group_qrcode_link,back_ground_type, jump_type, jump_url,origin_url
</sql>
<select id="getById" resultMap="BaseResultMap" parameterType="java.lang.Long">
......@@ -394,6 +396,9 @@
<if test="backgroundType != null">
back_ground_type = #{backgroundType},
</if>
<if test="originUrl != null">
origin_url = #{originUrl},
</if>
</set>
where id = #{id,jdbcType=BIGINT}
</update>
......
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