Commit f0881025 by 裴大威

Merge branch 'feature-zengpo-1002377' into 'master'

发送时判断是否需要发送h5页面链接

See merge request rays/pcloud-book!424
parents 6e41f8a3 e0726416
......@@ -209,11 +209,12 @@ public class PcloudRobotBizImpl implements PcloudRobotBiz {
Map<String, Object> map = new HashMap<>();
map.put("robotWxId", robotWxId);
PcloudRobot pcloudRobot = (PcloudRobot)pcloudRobotDao.getBy(map, "getByRobotWxId");
PcloudRobotClassify robotClassify=new PcloudRobotClassify();
if(pcloudRobot != null) {
if(pcloudRobot.getRobotType() != null) {
if (pcloudRobot.getRobotType() != null) {
Integer welcomeDuration = 3;
PcloudRobotClassify robotClassify = pcloudRobotClassifyBiz.getClassifyById(pcloudRobot.getRobotType().longValue());
if(robotClassify != null && robotClassify.getWelcomeDuration() != null) {
robotClassify = pcloudRobotClassifyBiz.getClassifyById(pcloudRobot.getRobotType().longValue());
if (robotClassify != null && robotClassify.getWelcomeDuration() != null) {
welcomeDuration = robotClassify.getWelcomeDuration();
}
List<PcloudRobotWelcome> robotWelcomeList = pcloudRobotWelcomeDao.getRobotWelcomeListByPcloudClassifyId(pcloudRobot.getRobotType().longValue());
......@@ -225,7 +226,7 @@ public class PcloudRobotBizImpl implements PcloudRobotBiz {
LOGGER.error("线程睡眠出错==", e);
}
Integer replyType = robotWelcome.getReplyType();
if(WelcomeReplyTypeEnum.TEXT.value.equals(replyType)) {
if (WelcomeReplyTypeEnum.TEXT.value.equals(replyType)) {
SendTextMessageVO sendTextMessageVO = new SendTextMessageVO();
sendTextMessageVO.setContent(robotWelcome.getContent());
sendTextMessageVO.setAltId(robotWxId);
......@@ -233,7 +234,7 @@ public class PcloudRobotBizImpl implements PcloudRobotBiz {
sendTextMessageVO.setIp(ip);
sendTextMessageVO.setCode(SendMessageTypeEnum.SELF.getCode());
WxGroupSDK.sendTextMessage(sendTextMessageVO);
} else if(WelcomeReplyTypeEnum.IMAGE.value.equals(replyType)) {
} else if (WelcomeReplyTypeEnum.IMAGE.value.equals(replyType)) {
SendPicMessageVO sendPicMessageVO = new SendPicMessageVO();
sendPicMessageVO.setWxGroupId(userWxId);
sendPicMessageVO.setAltId(robotWxId);
......@@ -241,7 +242,7 @@ public class PcloudRobotBizImpl implements PcloudRobotBiz {
sendPicMessageVO.setIp(ip);
sendPicMessageVO.setCode(SendMessageTypeEnum.SELF.getCode());
WxGroupSDK.sendPicMessage(sendPicMessageVO);
} else if(WelcomeReplyTypeEnum.RESOURCE.value.equals(replyType)) {
} else if (WelcomeReplyTypeEnum.RESOURCE.value.equals(replyType)) {
SendFileVO sendFileVO = new SendFileVO();
sendFileVO.setFileUrl(robotWelcome.getResourceUrl());
sendFileVO.setFileName(robotWelcome.getResourceName());
......@@ -253,6 +254,7 @@ public class PcloudRobotBizImpl implements PcloudRobotBiz {
}
}
}
if (robotClassify != null && robotClassify.getIsOpenPushH5url() != null && robotClassify.getIsOpenPushH5url() == 1) {
//发送H5链接
String endUrl = wechatLinkPrefix + "/dialog" + "?book_group_id=" + 0 + "&wxId=" + userWxId + "&robotWxId=" + robotWxId;
String resultUrl = UrlUtils.getShortUrl4Own(endUrl);
......@@ -265,6 +267,7 @@ public class PcloudRobotBizImpl implements PcloudRobotBiz {
sendTextMessageVO.setCode(SendMessageTypeEnum.SELF.getCode());
WxGroupSDK.sendTextMessage(sendTextMessageVO);
}
}
});
}
......
......@@ -74,6 +74,7 @@ public class PcloudRobotClassifyBizImpl implements PcloudRobotClassifyBiz {
public ClassifyWelcomeDTO getClassifyWelcome(Long classifyId) {
ClassifyWelcomeDTO classifyWelcomeDTO = new ClassifyWelcomeDTO();
PcloudRobotClassify robotClassify = pcloudRobotClassifyDao.getById(classifyId);
classifyWelcomeDTO.setIsOpenPushH5url(robotClassify.getIsOpenPushH5url());
classifyWelcomeDTO.setWelcomeDuration(robotClassify.getWelcomeDuration());
List<PcloudRobotWelcome> pcloudRobotWelcomeList = pcloudRobotWelcomeDao.getRobotWelcomeListByPcloudClassifyId(classifyId);
pcloudRobotSet.fillRobotWelcome(pcloudRobotWelcomeList);
......@@ -83,7 +84,7 @@ public class PcloudRobotClassifyBizImpl implements PcloudRobotClassifyBiz {
@Override
public void updateClassifyWelcome(ClassifyWelcomeDTO classifyWelcomeDTO) {
pcloudRobotClassifyDao.updateWelcomeDuration(classifyWelcomeDTO.getPcloudClassifyId(), classifyWelcomeDTO.getWelcomeDuration());
pcloudRobotClassifyDao.updateWelcomeDuration(classifyWelcomeDTO.getPcloudClassifyId(), classifyWelcomeDTO.getWelcomeDuration(),classifyWelcomeDTO.getIsOpenPushH5url());
List<PcloudRobotWelcome> robotWelcomeList = classifyWelcomeDTO.getPcloudRobotWelcomeList();
pcloudRobotWelcomeDao.deleteByPcloudClassifyId(classifyWelcomeDTO.getPcloudClassifyId());
if (ListUtils.isEmpty(robotWelcomeList)) {
......
......@@ -12,5 +12,5 @@ public interface PcloudRobotClassifyDao extends BaseDao<PcloudRobotClassify> {
void updateRobotClassifyKeywordClassify(Long id, Long keywordClassifyId);
void updateWelcomeDuration(Long id, Integer welcomeDuration);
void updateWelcomeDuration(Long id, Integer welcomeDuration,Integer isOpenPushH5url);
}
......@@ -28,7 +28,7 @@ public class PcloudRobotClassifyDaoImpl extends BaseDaoImpl<PcloudRobotClassify>
}
@Override
public void updateWelcomeDuration(Long id, Integer welcomeDuration) {
public void updateWelcomeDuration(Long id, Integer welcomeDuration,Integer isOpenPushH5url) {
Map<String,Object> map=new HashMap<>();
map.put("id",id);
map.put("welcomeDuration",welcomeDuration);
......
......@@ -17,6 +17,8 @@ public class ClassifyWelcomeDTO extends BaseDTO {
@ApiModelProperty("欢迎语间隔时长")
private Integer welcomeDuration;
private Integer isOpenPushH5url;
private List<PcloudRobotWelcome> pcloudRobotWelcomeList;
}
......@@ -18,6 +18,8 @@ public class PcloudRobotClassify extends BaseEntity {
private Integer welcomeDuration;
private Integer isOpenPushH5url;
@ApiModelProperty("关键词分类ID")
private Long keywordClassifyId;
}
......@@ -9,6 +9,7 @@
<result column="qrcode_url" property="qrcodeUrl" jdbcType="VARCHAR" />
<result column="keyword_classify_id" property="keywordClassifyId" jdbcType="VARCHAR" />
<result column="welcome_duration" property="welcomeDuration" jdbcType="INTEGER" />
<result column="is_open_push_h5url" property="isOpenPushH5url" jdbcType="INTEGER" />
</resultMap>
<resultMap id="pageResultMap" type="com.pcloud.book.pcloudkeyword.facade.response.PcloudRobotClassifyResponseVO" >
......@@ -19,7 +20,7 @@
select="com.pcloud.book.pcloudkeyword.dao.impl.PcloudRobotDaoImpl.getRobotCountByClassifyId" />
</resultMap>
<sql id="Base_Column_List" >
id, classify_name, link_url, qrcode_url,keyword_classify_id, is_delete, welcome_duration
id, classify_name, link_url, qrcode_url,keyword_classify_id, is_delete, welcome_duration,is_open_push_h5url
</sql>
<insert id="insert" parameterType="com.pcloud.book.pcloudkeyword.entity.PcloudRobotClassify" useGeneratedKeys="true" keyProperty="id">
......@@ -81,7 +82,8 @@
<update id="updateWelcomeDuration" parameterType="map">
update pcloud_robot_classify
set welcome_duration = #{welcomeDuration}
set welcome_duration = #{welcomeDuration},
is_open_push_h5url=#{isOpenPushH5url}
where id=#{id}
</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