Commit df514e32 by ext.shengxiyong1

修复活码添加回掉等bug

1 parent e467be16
......@@ -45,7 +45,13 @@ public class WeChatItemController extends BaseController {
public TableDataInfo list(@RequestParam(value = "sideId") Long sideId
, @RequestParam(value = "keyword", required = false) String keyword,@RequestParam(value = "mediaType") String mediaType,@RequestParam(value = "userId") String userId) {
startPage();
List<WeChatSideVo> weChatSideVos = weChatItemService.chatItems(sideId,keyword,mediaType,userId);
List<WeChatSideVo> weChatSideVos;
if(mediaType.equals("5")){
weChatSideVos=weChatItemService.findChatPostsItems(sideId,keyword,mediaType,userId);
}else{
weChatSideVos
= weChatItemService.chatItems(sideId,keyword,mediaType,userId);
}
return getDataTable(weChatSideVos);
}
......
package com.linkwechat.wecom.domain;
import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.linkwechat.common.core.domain.BaseEntity;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.ArrayList;
import java.util.List;
/**
......
......@@ -180,11 +180,17 @@ public class WeCallBackAddExternalContactImpl extends WeEventStrategy {
String codeUrl = weGroupCodeService.selectGroupCodeUrlByEmplCodeState(state);
if (StringUtils.isNotNull(codeUrl)) {
buildWelcomeMsgImg(weWelcomeMsgBuilder, codeUrl, FileUtil.getName(codeUrl));
}else{
WeEmpleCode weEmpleCode = weEmpleCodeService.selectWeEmpleCodeById(Long.valueOf(state));
if(null != weEmpleCode){
if(weEmpleCode.getWeMaterial() !=null && StringUtils.isNotEmpty(weEmpleCode.getWeMaterial().getMaterialUrl())){
buildWelcomeMsgImg(weWelcomeMsgBuilder, weEmpleCode.getWeMaterial().getMaterialUrl(),
weEmpleCode.getWeMaterial().getMaterialName());
}
}
}
// 普通员工活码欢迎语图片
else if (StringUtils.isNotEmpty(messageMap.getCategoryId())) {
buildWelcomeMsgImg(weWelcomeMsgBuilder, messageMap.getMaterialUrl(), messageMap.getMaterialName());
}
weCustomerService.sendWelcomeMsg(weWelcomeMsgBuilder.build());
}
......
......@@ -40,4 +40,19 @@ public interface WeChatItemMapper extends BaseMapper<WeChatItem> {
* @return
*/
public List<WeChatSideVo> findChatItems(@Param("sideId") Long sideId, @Param("keyword") String keyword,@Param("mediaType") String mediaType,@Param("userId") String userId);
/**
* h5素材列表(海报)
*
* @param sideId 侧边栏id
* @param keyword 关键词
* @return
*/
public List<WeChatSideVo> findChatPostsItems(@Param("sideId") Long sideId, @Param("keyword") String keyword,@Param("mediaType") String mediaType,@Param("userId") String userId);
}
......@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
import com.linkwechat.wecom.domain.WeChatItem;
import com.linkwechat.wecom.domain.dto.WeChatItemDto;
import com.linkwechat.wecom.domain.vo.WeChatSideVo;
import org.apache.ibatis.annotations.Param;
import java.util.List;
......@@ -29,4 +30,16 @@ public interface IWeChatItemService extends IService<WeChatItem> {
*/
public List<WeChatSideVo> chatItems(Long sideId,String keyword,String mediaType,String userId);
/**
* h5素材列表(海报)
*
* @param sideId 侧边栏id
* @param keyword 关键词
* @return
*/
public List<WeChatSideVo> findChatPostsItems(Long sideId,String keyword,String mediaType,String userId);
}
......@@ -74,6 +74,11 @@ public class WeChatItemServiceImpl extends ServiceImpl<WeChatItemMapper, WeChatI
return weChatItemMapper.findChatItems(sideId, keyword, mediaType, userId);
}
@Override
public List<WeChatSideVo> findChatPostsItems(Long sideId, String keyword, String mediaType, String userId) {
return weChatItemMapper.findChatPostsItems(sideId,keyword,mediaType,userId);
}
/**
* 更新该次选择的素材数
*
......
......@@ -252,7 +252,9 @@ public class WeCustomerServiceImpl extends ServiceImpl<WeCustomerMapper, WeCusto
if (CollectionUtil.isNotEmpty(weFlowerCustomerRels)) {
List<Long> weFlowerCustomerRelIds = weFlowerCustomerRels.stream().map(WeFlowerCustomerRel::getId).collect(Collectors.toList());
iWeFlowerCustomerTagRelService.remove(new LambdaQueryWrapper<WeFlowerCustomerTagRel>()
.in(WeFlowerCustomerTagRel::getFlowerCustomerRelId, weFlowerCustomerRelIds));
.in(WeFlowerCustomerTagRel::getFlowerCustomerRelId, weFlowerCustomerRelIds)
.ne(WeFlowerCustomerTagRel::getRelTagType,new Integer(1))
);
iWeFlowerCustomerRelService.removeByIds(weFlowerCustomerRelIds);
}
......
......@@ -67,4 +67,51 @@
</if>
</where>
</select>
<select id="findChatPostsItems" resultType="com.linkwechat.wecom.domain.vo.WeChatSideVo">
SELECT
wci.material_id,
wm.sample_img_path as material_url,
wc.`name` as material_name,
wm.title as content,
wc.media_type,
wm.sample_img_path as cover_url,
(
SELECT
COUNT(1)
FROM
we_chat_collection
WHERE
material_id = wci.material_id
AND user_id = #{userId}
) collection,
wci.create_time
FROM
we_chat_item wci
LEFT JOIN we_poster wm ON wci.material_id = wm.id
LEFT JOIN we_category wc ON wm.category_id = wc.id
<where>
wci.side_id=#{sideId}
<if test="keyword!=null and keyword!=''">
<if test="mediaType!=null and mediaType=='0'.toString()">
AND wm.title LIKE CONCAT('%',#{keyword},'%')
</if>
<if test="mediaType!=null and mediaType=='1'.toString()">
AND wc.`name` LIKE CONCAT('%',#{keyword},'%')
</if>
<if test="mediaType!=null and mediaType=='2'.toString()">
AND wc.`name` LIKE CONCAT('%',#{keyword},'%')
</if>
<if test="mediaType!=null and mediaType=='3'.toString()">
AND wc.`name` LIKE CONCAT('%',#{keyword},'%')
</if>
<if test="mediaType!=null and mediaType=='4'.toString()">
AND wm.title LIKE CONCAT('%',#{keyword},'%')
</if>
<if test="mediaType!=null and mediaType=='5'.toString()">
AND wc.`name` LIKE CONCAT('%',#{keyword},'%')
</if>
</if>
</where>
</select>
</mapper>
\ No newline at end of file
......@@ -320,6 +320,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
AND date_format(wc.first_add_time,'%Y-%m-%d') BETWEEN #{beginTime} AND #{endTime}
</if>
GROUP BY wc.external_userid
ORDER BY wc.first_add_time desc
</select>
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!