Commit d3fdc44b by ext.shengxiyong1

Merge branch 'back_end_dev'

2 parents 000462d4 47f0438f
......@@ -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);
}
......
......@@ -12,17 +12,17 @@ ruoyi:
demoEnabled: true
# 是否开启文件云上传(使用的是腾讯云,如果开启了,则需要配置腾讯云存储相关信息;如果关闭了则文件存储再本地,需要配置本地路径)
file:
startCosUpload: false
startCosUpload: true
#如果startCosUpload为false时必须设置,则文件资源放在本地服务器上,该配置为文件访问前缀,配置到nginx上可以直接访问
imgUrlPrefix: /lwImg
#腾讯云对象存储
cos:
secretId:
secretKey:
secretId: AKIDQRCizIeUGl13vakkDQMH0VkjhPr1rBBv
secretKey: e3D8oFetseC0f8OX9XeV7UcTDiyyQ8cr
#link-wechat-1251309172.cos.ap-nanjing.myqcloud.com
region:
bucketName:
cosImgUrlPrefix:
region: ap-nanjing
bucketName: link-wechat-1251309172
cosImgUrlPrefix: https://link-wechat-1251309172.cos.ap-nanjing.myqcloud.com/
# 文件路径 示例( Windows配置D:/ruoyi/uploadPath,Linux配置 /app/project/pic)
#profile: /data/jenkins_home/app/project/
# 获取ip地址开关
......@@ -107,7 +107,7 @@ spring:
druid:
# 主库数据源
master:
url: jdbc:mysql://127.0.0.1:10179/link-wechat-prod?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
url: jdbc:mysql://127.0.0.1:10179/lww?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
username: root
password: root
# 从库数据源
......@@ -202,7 +202,7 @@ token:
# 令牌密钥
secret: abcdefghijklmnopqrstuvwxyz
# 令牌有效期(默认30分钟)
expireTime: 30
expireTime: 600
mybatis-plus:
mapper-locations: classpath*:mapper/**/*Mapper.xml
......@@ -249,16 +249,16 @@ xss:
urlPatterns: /system/*,/monitor/*,/tool/*
# elasticsearch配置
#elasticsearch:
# schema: http
# address: 47.112.117.15:7200,47.112.117.15:7201,47.112.117.15:7202
# userName: "elastic"
# password: "0p-0p-0p-"
# connectTimeout: 10000
# socketTimeout: 10000
# connectionRequestTimeout: 10000
# maxConnectNum: 100
# maxConnectPerRoute: 100
elasticsearch:
schema: http
address: 47.112.117.15:7200,47.112.117.15:7201,47.112.117.15:7202
userName: "elastic"
password: "0p-0p-0p-"
connectTimeout: 10000
socketTimeout: 10000
connectionRequestTimeout: 10000
maxConnectNum: 100
maxConnectPerRoute: 100
# forest配置
forest:
......@@ -267,15 +267,19 @@ forest:
max-retry-interval: 1000 #重试间隔时间
connect-timeout: 3000 #链接超时时间
timeout: 3000 # 请求超时时间
variables: # 全局变量
variables:
weComServerUrl: https://qyapi.weixin.qq.com/
weComePrefix: cgi-bin
wxServerUrl: https://api.weixin.qq.com/
wxPrefix: sns
wecome:
chatKey: finance_new
serverUrl: https://qyapi.weixin.qq.com/
weComePrefix: cgi-bin
noAccessTokenUrl:
- /gettoken
- /service/get_provider_token
- /wecom/chat/side/list
- /wecom/chat/item/list
- /wecom/chat/collection/addCollection
......@@ -306,6 +310,8 @@ wecome:
- /externalcontact/groupchat/statistic
- /externalcontact/groupchat/statistic_group_by_day
fileUplodUrl: /media/upload,/media/uploadimg
needProviderTokenUrl:
- /service/get_login_info
needChatTokenUrl:
- /msgaudit/get_permit_user_list
- /msgaudit/check_single_agree
......
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!