Commit 163a1be3 by 阮思源

Merge branch 'feat-1002450' into 'master'

【1002450】跳转衔接语支持录入图片

See merge request rays/pcloud-book!474
parents bf5050dd 1b7c570c
...@@ -7,6 +7,7 @@ import com.pcloud.book.book.entity.Book; ...@@ -7,6 +7,7 @@ import com.pcloud.book.book.entity.Book;
import com.pcloud.book.consumer.wechatgroup.WechatGroupConsr; import com.pcloud.book.consumer.wechatgroup.WechatGroupConsr;
import com.pcloud.book.group.biz.WeixinQrcodeBiz; import com.pcloud.book.group.biz.WeixinQrcodeBiz;
import com.pcloud.book.guide.biz.PcloudGuideBiz; import com.pcloud.book.guide.biz.PcloudGuideBiz;
import com.pcloud.book.keywords.enums.ReplyTypeEnum;
import com.pcloud.book.mq.delay.DelayMessageSender; import com.pcloud.book.mq.delay.DelayMessageSender;
import com.pcloud.book.pcloudkeyword.dao.PcloudRobotClassifyDao; import com.pcloud.book.pcloudkeyword.dao.PcloudRobotClassifyDao;
import com.pcloud.book.pcloudkeyword.dao.PcloudRobotDao; import com.pcloud.book.pcloudkeyword.dao.PcloudRobotDao;
...@@ -45,6 +46,7 @@ import com.pcloud.common.utils.string.StringUtil; ...@@ -45,6 +46,7 @@ import com.pcloud.common.utils.string.StringUtil;
import com.pcloud.wechatgroup.group.dto.GroupRobotDTO; import com.pcloud.wechatgroup.group.dto.GroupRobotDTO;
import com.pcloud.wechatgroup.group.dto.GroupUserDTO; import com.pcloud.wechatgroup.group.dto.GroupUserDTO;
import com.sdk.wxgroup.SendMessageTypeEnum; import com.sdk.wxgroup.SendMessageTypeEnum;
import com.sdk.wxgroup.SendPicMessageVO;
import com.sdk.wxgroup.SendTextMessageVO; import com.sdk.wxgroup.SendTextMessageVO;
import com.sdk.wxgroup.WxGroupSDK; import com.sdk.wxgroup.WxGroupSDK;
import org.slf4j.Logger; import org.slf4j.Logger;
...@@ -348,7 +350,7 @@ public class PersonalStageJumpBizImpl implements PersonalStageJumpBiz { ...@@ -348,7 +350,7 @@ public class PersonalStageJumpBizImpl implements PersonalStageJumpBiz {
// 如果下一个阶段是空,则已完成 // 如果下一个阶段是空,则已完成
if(null == jumpKeywordDto.getAfterPersonalStageId() || jumpKeywordDto.getAfterPersonalStageId() <=0){ if(null == jumpKeywordDto.getAfterPersonalStageId() || jumpKeywordDto.getAfterPersonalStageId() <=0){
// 更新到完成状态 // 更新到完成状态
updateStageToComplete(currentStageUser); // updateStageToComplete(currentStageUser);
return true; return true;
} }
GroupRobotDTO groupRobotDTO = wechatGroupConsr.getGroupRobotByWxId(robotWxId); GroupRobotDTO groupRobotDTO = wechatGroupConsr.getGroupRobotByWxId(robotWxId);
...@@ -373,6 +375,7 @@ public class PersonalStageJumpBizImpl implements PersonalStageJumpBiz { ...@@ -373,6 +375,7 @@ public class PersonalStageJumpBizImpl implements PersonalStageJumpBiz {
LOGGER.info("没有该跳转衔接语!"); LOGGER.info("没有该跳转衔接语!");
return; return;
} }
if(ReplyTypeEnum.TEXT.value.equals( jumpLinkup.getReplyType())){
SendTextMessageVO sendTextMessageVO = new SendTextMessageVO(); SendTextMessageVO sendTextMessageVO = new SendTextMessageVO();
sendTextMessageVO.setContent(personalStageBiz.replaceProjectProgressUrl(jumpLinkup.getLinkupContent(),linkupDelayDTO.getRobotId(),linkupDelayDTO.getWxId(),linkupDelayDTO.getPersonalStageUserId())); sendTextMessageVO.setContent(personalStageBiz.replaceProjectProgressUrl(jumpLinkup.getLinkupContent(),linkupDelayDTO.getRobotId(),linkupDelayDTO.getWxId(),linkupDelayDTO.getPersonalStageUserId()));
sendTextMessageVO.setAltId(linkupDelayDTO.getRobotId()); sendTextMessageVO.setAltId(linkupDelayDTO.getRobotId());
...@@ -380,6 +383,15 @@ public class PersonalStageJumpBizImpl implements PersonalStageJumpBiz { ...@@ -380,6 +383,15 @@ public class PersonalStageJumpBizImpl implements PersonalStageJumpBiz {
sendTextMessageVO.setIp(linkupDelayDTO.getIp()); sendTextMessageVO.setIp(linkupDelayDTO.getIp());
sendTextMessageVO.setCode(SendMessageTypeEnum.SELF.getCode()); sendTextMessageVO.setCode(SendMessageTypeEnum.SELF.getCode());
WxGroupSDK.sendTextMessage(sendTextMessageVO); WxGroupSDK.sendTextMessage(sendTextMessageVO);
} else if(ReplyTypeEnum.IMAGE.value.equals( jumpLinkup.getReplyType())) {
SendPicMessageVO sendPicMessageVO = new SendPicMessageVO();
sendPicMessageVO.setWxGroupId(dto.getKey());
sendPicMessageVO.setAltId(linkupDelayDTO.getRobotId());
sendPicMessageVO.setPicUrl(jumpLinkup.getPicUrl());
sendPicMessageVO.setIp(linkupDelayDTO.getIp());
sendPicMessageVO.setCode(SendMessageTypeEnum.SELF.getCode());
WxGroupSDK.sendPicMessage(sendPicMessageVO);
}
} }
@ParamLog("处理用户提交表单阶段跳转") @ParamLog("处理用户提交表单阶段跳转")
...@@ -547,6 +559,7 @@ public class PersonalStageJumpBizImpl implements PersonalStageJumpBiz { ...@@ -547,6 +559,7 @@ public class PersonalStageJumpBizImpl implements PersonalStageJumpBiz {
delayMessageSender.send(delayQueueDTO); delayMessageSender.send(delayQueueDTO);
LOGGER.info("增加跳转衔接语延时"+delayQueueDTO.toString()); LOGGER.info("增加跳转衔接语延时"+delayQueueDTO.toString());
}else { }else {
if(ReplyTypeEnum.TEXT.value.equals( jumpLinkup.getReplyType())){
SendTextMessageVO sendTextMessageVO = new SendTextMessageVO(); SendTextMessageVO sendTextMessageVO = new SendTextMessageVO();
sendTextMessageVO.setContent(personalStageBiz.replaceProjectProgressUrl(jumpLinkup.getLinkupContent(),robotWxId,userWxId,personalStageUserId)); sendTextMessageVO.setContent(personalStageBiz.replaceProjectProgressUrl(jumpLinkup.getLinkupContent(),robotWxId,userWxId,personalStageUserId));
sendTextMessageVO.setAltId(robotWxId); sendTextMessageVO.setAltId(robotWxId);
...@@ -554,6 +567,15 @@ public class PersonalStageJumpBizImpl implements PersonalStageJumpBiz { ...@@ -554,6 +567,15 @@ public class PersonalStageJumpBizImpl implements PersonalStageJumpBiz {
sendTextMessageVO.setIp(ip); sendTextMessageVO.setIp(ip);
sendTextMessageVO.setCode(SendMessageTypeEnum.SELF.getCode()); sendTextMessageVO.setCode(SendMessageTypeEnum.SELF.getCode());
WxGroupSDK.sendTextMessage(sendTextMessageVO); WxGroupSDK.sendTextMessage(sendTextMessageVO);
} else if(ReplyTypeEnum.IMAGE.value.equals( jumpLinkup.getReplyType())) {
SendPicMessageVO sendPicMessageVO = new SendPicMessageVO();
sendPicMessageVO.setWxGroupId(userWxId);
sendPicMessageVO.setAltId(robotWxId);
sendPicMessageVO.setPicUrl(jumpLinkup.getPicUrl());
sendPicMessageVO.setIp(ip);
sendPicMessageVO.setCode(SendMessageTypeEnum.SELF.getCode());
WxGroupSDK.sendPicMessage(sendPicMessageVO);
}
} }
} }
} }
......
...@@ -18,4 +18,10 @@ public class PersonalStageJumpLinkup extends BaseEntity { ...@@ -18,4 +18,10 @@ public class PersonalStageJumpLinkup extends BaseEntity {
@ApiModelProperty("距离阶段开始时间") @ApiModelProperty("距离阶段开始时间")
private Integer toStageStartTime; private Integer toStageStartTime;
@ApiModelProperty("类型:1:文字;2:图片;")
private Integer replyType;
@ApiModelProperty("图片链接")
private String picUrl;
} }
\ No newline at end of file
...@@ -82,6 +82,8 @@ public abstract class BaseStageJumpRequestVO extends BaseRequestVO { ...@@ -82,6 +82,8 @@ public abstract class BaseStageJumpRequestVO extends BaseRequestVO {
jumpLinkup.setLinkupContent(linkup.getLinkupContent()); jumpLinkup.setLinkupContent(linkup.getLinkupContent());
jumpLinkup.setPersonalStageJumpId(personalStageJumpId); jumpLinkup.setPersonalStageJumpId(personalStageJumpId);
jumpLinkup.setToStageStartTime(linkup.getToStageStartTime()); jumpLinkup.setToStageStartTime(linkup.getToStageStartTime());
jumpLinkup.setReplyType((null == linkup.getReplyType() || linkup.getReplyType() == 0 ? 1 : linkup.getReplyType()));
jumpLinkup.setPicUrl(linkup.getPicUrl());
jumpLinkups.add(jumpLinkup); jumpLinkups.add(jumpLinkup);
} }
return jumpLinkups; return jumpLinkups;
......
...@@ -7,10 +7,12 @@ ...@@ -7,10 +7,12 @@
<result property="personalStageJumpId" column="personal_stage_jump_id" jdbcType="BIGINT"/> <result property="personalStageJumpId" column="personal_stage_jump_id" jdbcType="BIGINT"/>
<result property="linkupContent" column="linkup_content" jdbcType="VARCHAR"/> <result property="linkupContent" column="linkup_content" jdbcType="VARCHAR"/>
<result property="toStageStartTime" column="to_stage_start_time" jdbcType="INTEGER"/> <result property="toStageStartTime" column="to_stage_start_time" jdbcType="INTEGER"/>
<result property="replyType" column="reply_type" jdbcType="INTEGER"/>
<result property="picUrl" column="pic_url" jdbcType="VARCHAR"/>
</resultMap> </resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id, personal_stage_jump_id, linkup_content, to_stage_start_time id, personal_stage_jump_id, linkup_content, to_stage_start_time, reply_type, pic_url
</sql> </sql>
<select id="getById" resultMap="BaseResultMap" parameterType="java.lang.Long"> <select id="getById" resultMap="BaseResultMap" parameterType="java.lang.Long">
...@@ -52,12 +54,16 @@ ...@@ -52,12 +54,16 @@
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">
personal_stage_jump_id, personal_stage_jump_id,
linkup_content, linkup_content,
to_stage_start_time to_stage_start_time,
reply_type,
pic_url
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
#{personalStageJumpId,jdbcType=BIGINT}, #{personalStageJumpId,jdbcType=BIGINT},
#{linkupContent,jdbcType=VARCHAR}, #{linkupContent,jdbcType=VARCHAR},
#{toStageStartTime,jdbcType=INTEGER} #{toStageStartTime,jdbcType=INTEGER},
#{replyType,jdbcType=INTEGER},
#{picUrl,jdbcType=VARCHAR}
</trim> </trim>
</insert> </insert>
...@@ -66,14 +72,18 @@ ...@@ -66,14 +72,18 @@
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">
personal_stage_jump_id, personal_stage_jump_id,
linkup_content, linkup_content,
to_stage_start_time to_stage_start_time,
reply_type,
pic_url
</trim> </trim>
values values
<foreach collection="list" item="item" separator=","> <foreach collection="list" item="item" separator=",">
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">
#{item.personalStageJumpId,jdbcType=BIGINT}, #{item.personalStageJumpId,jdbcType=BIGINT},
#{item.linkupContent,jdbcType=VARCHAR}, #{item.linkupContent,jdbcType=VARCHAR},
#{item.toStageStartTime,jdbcType=INTEGER} #{item.toStageStartTime,jdbcType=INTEGER},
#{item.replyType,jdbcType=INTEGER},
#{item.picUrl,jdbcType=VARCHAR}
</trim> </trim>
</foreach> </foreach>
</insert> </insert>
......
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