Commit 5832d5b2 by danmo

Merge remote-tracking branch 'origin/master'

2 parents 6bc6fad2 9dc3a059
Showing 23 changed files with 930 additions and 75 deletions
......@@ -210,7 +210,7 @@ com.linkwechat
### 联系作者加入群
![输入图片说明](https://images.gitee.com/uploads/images/2020/1217/152441_79fbd2f6_409467.png "屏幕截图.png")
![输入图片说明](https://images.gitee.com/uploads/images/2020/1226/183631_251ea80c_409467.png "屏幕截图.png")
### 特别鸣谢
......
......@@ -4,16 +4,18 @@ import com.fasterxml.jackson.core.JsonProcessingException;
import com.linkwechat.common.annotation.Log;
import com.linkwechat.common.core.controller.BaseController;
import com.linkwechat.common.core.domain.AjaxResult;
import com.linkwechat.common.core.page.TableDataInfo;
import com.linkwechat.common.enums.BusinessType;
import com.linkwechat.wecom.domain.WeCustomer;
import com.linkwechat.wecom.domain.dto.message.CustomerMessagePushDto;
import com.linkwechat.wecom.domain.vo.CustomerMessagePushVo;
import com.linkwechat.wecom.service.IWeCustomerMessagePushService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* @description: 企业微信 群发消息 controller
......@@ -45,4 +47,20 @@ public class WeCustomerMessagePushController extends BaseController {
return AjaxResult.success();
}
/**
* 群发消息列表
*/
@PreAuthorize("@ss.hasPermi('system:push:list')")
@GetMapping(value = "/list")
public TableDataInfo list(@RequestParam(value = "sender",required = false) String sender
,@RequestParam(value = "content",required = false) String content
,@RequestParam(value = "pushType",required = false) String pushType
,@RequestParam(value = "beginTime",required = false) String beginTime
,@RequestParam(value = "endTime",required = false) String endTime) {
startPage();
List<CustomerMessagePushVo> list = weCustomerMessagePushService.customerMessagePushs(sender,content,pushType,beginTime,endTime);
return getDataTable(list);
}
}
......@@ -114,7 +114,7 @@ public class WeMaterialController extends BaseController {
@PreAuthorize("@ss.hasPermi('wechat:material:temporaryMaterialMediaId')")
@Log(title = "获取素材media_id", businessType = BusinessType.OTHER)
@PutMapping("/temporaryMaterialMediaId")
@PostMapping("/temporaryMaterialMediaId")
@ApiOperation("获取素材media_id")
public AjaxResult temporaryMaterialMediaId(@RequestParam(value = "url") String url, @RequestParam(value = "type") String type,@RequestParam(value = "name") String name){
WeMediaDto weMediaDto = materialService.uploadTemporaryMaterial(url, type,name);
......
......@@ -138,6 +138,7 @@
<dependency>
<groupId>com.dtflys.forest</groupId>
<artifactId>spring-boot-starter-forest</artifactId>
<version>1.5.0-RC1</version>
</dependency>
<dependency>
......
......@@ -40,3 +40,21 @@ export function add(data) {
data,
})
}
/**
*
* @param {*} data
* {
* sender:创建人
content:内容
pushType:群发类型 0 发给客户 1 发给客户群
beginTime:开始时间
endTime:结束时间}
*/
export function getList(data) {
return request({
url: service + '/list',
method: 'get',
data,
})
}
......@@ -149,3 +149,18 @@ export function removeTree(ids) {
method: 'DELETE',
})
}
/**
* 获取素材media_id
* @param {*} data
* url [string] 是 素材路径
type [string] 是 素材类型
name [string] 是 文件名称
*/
export function getMaterialMediaId(data) {
return request({
url: service + '/temporaryMaterialMediaId',
method: 'POST',
data,
})
}
<template>
<div class="content">
<el-tabs v-model="activeName" @tab-click="handleClick">
<el-tab-pane label="根据员工检测" name="1">
<employee></employee>
</el-tab-pane>
<el-tab-pane label="根据用户检测" name="2">
<user></user>
</el-tab-pane>
<el-tab-pane label="全局检测" name="3">
<role></role>
</el-tab-pane>
</el-tabs>
</div>
</template>
<script>
import employee from './page/employeeTest.vue'
import user from './page/userTest.vue'
import role from './page/roleTest.vue'
export default {
components:{employee,user,role},
data() {
return {
activeName: '1',
}
},
methods: {
handleClick(tab, event) {
console.log(tab, event);
}
}
}
</script>
<template>
<div class="employ">
<el-row>
<el-col :span="6" class="borderR">
<div class="hd_box">
<div class="hd_name">成员({{employAmount}})</div>
<div class="paddingT10">
<el-input placeholder="请输入内容" prefix-icon="el-icon-search" v-model="employName">
</el-input>
</div>
</div>
<div class="ct_box ct_boxFirst">
<el-tree class="filter-tree" :data="data" :filter-node-method="filterNode" ref="tree"
@node-click="handleNodeClick">
</el-tree>
</div>
</el-col>
<el-col :span="6" class="borderR">
<div class="hd_box">
<div class="hd_name">{{talkName}}</div>
</div>
<div class="hd_tabs">
<el-tabs v-model="activeName">
<el-tab-pane label="内部联系人" name="0">
<div class="ct_box">
<!-- 应该是类似聊天记录的 后期弄成组件 看 -->
暂无联系人
</div>
</el-tab-pane>
<el-tab-pane label="外部联系人" name="1">
<div class="ct_box">
<!-- ! -->
暂无联系人
</div>
</el-tab-pane>
<el-tab-pane label="群聊" name="2">
<div class="ct_box">
<!-- ! -->
暂无联系人
</div>
</el-tab-pane>
</el-tabs>
</div>
</el-col>
<el-col :span="12">
<div class="hd_box">
<div class="hd_name hd_nameRi">下载会话</div>
</div>
<div class=" hd_tabthree">
<el-tabs v-model="activeNameThree">
<el-tab-pane label="全部" name="0">
<div class="ct_box">
<div class="hds_time">
<el-date-picker v-model="takeTime" type="date" placeholder="选择日期">
</el-date-picker>
</div>
</div>
</el-tab-pane>
<el-tab-pane label="图片及视频" name="1">
<div class="ct_box">
<div class="hds_time">
<el-date-picker v-model="takeTime" type="date" placeholder="选择日期">
</el-date-picker>
</div>
</div>
</el-tab-pane>
<el-tab-pane label="文件" name="3">
<div class="ct_box">
<div class="hds_time">
<el-date-picker v-model="takeTime" type="date" placeholder="选择日期">
</el-date-picker>
</div>
<el-table :data="fileData" stripe style="width: 100%" :header-cell-style="{background:'#fff'}">
<el-table-column prop="date" label="类型">
</el-table-column>
<el-table-column prop="name" label="名称">
</el-table-column>
<el-table-column prop="address" label="大小">
</el-table-column>
<el-table-column prop="address" label="来源">
</el-table-column>
<el-table-column prop="address" label="操作">
</el-table-column>
</el-table>
</div>
</el-tab-pane>
<el-tab-pane label="链接" name="4">
<div class="ct_box">
<div class="hds_time">
<el-date-picker v-model="takeTime" type="date" placeholder="选择日期">
</el-date-picker>
</div>
</div>
</el-tab-pane>
<el-tab-pane label="语音通话" name="5">
<div class="ct_box">
<div class="hds_time">
<el-date-picker v-model="takeTime" type="date" placeholder="选择日期">
</el-date-picker>
</div>
<el-table :data="fileData" stripe style="width: 100%" :header-cell-style="{background:'#fff'}">
<el-table-column prop="date" label="发起人">
</el-table-column>
<el-table-column prop="name" label="通话时间">
</el-table-column>
<el-table-column prop="address" label="时长">
</el-table-column>
<el-table-column prop="address" label="操作">
</el-table-column>
</el-table>
</div>
</el-tab-pane>
</el-tabs>
</div>
</el-col>
</el-row>
</div>
</template>
<script>
export default {
data() {
return {
employAmount: 1,
employName: '',
talkName: '',
data: [{
id: 1,
label: '一级 1',
children: [{
id: 4,
label: '二级 1-1',
children: [{
id: 9,
label: '三级 1-1-1'
}, {
id: 10,
label: '三级 1-1-2'
}]
}]
}, {
id: 3,
label: '一级 3',
children: [{
id: 7,
label: '二级 3-1'
}, {
id: 8,
label: '二级 3-2'
}]
}],
activeName: "1",
activeNameThree: '1',
takeTime: '',
fileData: []
};
},
watch: {
employName(val) {
this.$refs.tree.filter(val);
}
},
methods: {
filterNode(value, data) {
if (!value) return true;
return data.label.indexOf(value) !== -1;
},
handleNodeClick(data) {
if (!data.children) {
console.log(data.label)
this.talkName = data.label
}
}
}
}
</script>
<style lang="scss" scoped>
/deep/ #tab-0 {
text-indent: 15px;
}
.borderR {
border-right: 2px solid #ccc;
}
.paddingT10 {
padding-top: 10px
}
.employ {
background: #f6f6f9;
min-height: 800px;
.hd_tabs {
background: #fff;
}
.hd_tabthree {
/deep/ .el-tabs__header {
margin: 0;
}
}
.hd_box {
padding: 15px;
}
.hd_name {
font-size: 18px;
min-height: 20px;
}
.hd_nameRi {
color: #199ed8;
text-align: right;
font-size: 16px;
cursor: pointer;
}
.ct_boxFirst {
height: 720px;
}
.ct_box {
background: white;
min-height: 710px;
padding: 10px;
overflow-y: scroll;
color: #999;
text-align: center;
::-webkit-scrollbar {
display: none;
}
.hds_time {
float: left;
padding: 10px 0;
}
}
}
</style>
\ No newline at end of file
<template>
<div>
<el-form :inline="true" :model="form" class="demo-form-inline">
<el-row>
<el-form-item label="员工名称">
<el-select v-model="form.Ename" placeholder="员工名称" style="width:300px">
</el-select>
</el-form-item>
<el-form-item label="客户名称">
<el-input v-model="form.Cname" placeholder="客户名称" style="width:300px"></el-input>
</el-form-item>
</el-row>
<el-row>
<el-form-item label="查找内容">
<el-input v-model="form.Scontent" placeholder="查找内容" style="width:300px"></el-input>
</el-form-item>
<el-form-item label="时间范围">
<el-time-picker is-range v-model="form.Stime" range-separator="至" start-placeholder="开始时间"
end-placeholder="结束时间" placeholder="选择时间范围">
</el-time-picker>
</el-form-item>
</el-row>
<el-row>
<el-form-item>
<el-button type="primary">查询</el-button>
</el-form-item>
<el-form-item>
<el-button>导出列表</el-button>
</el-form-item>
</el-row>
</el-form>
<div class="content">
<el-table :data="fileData" stripe style="width: 100%" :header-cell-style="{background:'#fff'}">
<el-table-column prop="date" label="发送者" width="200">
</el-table-column>
<el-table-column prop="name" label=" 内容">
</el-table-column>
<el-table-column label="消息状态" width="200">
<template slot="header" >
{{floorRange}}
<el-select size="mini" v-model="floorRange" class="noborder" @change="chechName(floorRange)">
<el-option v-for="item in displayOptions" :key="item.value" :label="item.label"
:value="item.value">
</el-option>
</el-select>
</template>
</el-table-column>
<el-table-column prop="address" label="发送时间" width="200">
</el-table-column>
</el-table>
<el-pagination
:page-size="20"
style="padding:10px"
:pager-count="11"
layout="prev, pager, next"
:total="1000">
</el-pagination>
</div>
</div>
</template>
<script>
export default {
data() {
return {
form: {
Ename: "",
Cname: '',
Scontent: '',
Stime: ''
},
fileData: [],
floorRange:'全部',
displayOptions: [{
value: "0",
label: "全部"
},
{
value: "1",
label: "已发送"
},
{
value: "2",
label: "已撤回"
},
{
value: "3",
label: "切回企业日志"
}
]
}
},
methods:{
chechName(e){
if(e==0){
this.floorRange='全部'
}
else if(e==1){
this.floorRange='已发送'
}else if(e==2){
this.floorRange='已撤回'
}else{
this.floorRange='切回企业日志'
}
}
}
}
</script>
<style lang="scss" scoped>
.demo-form-inline {
background: #efefef;
padding: 18px 10px 0 10px;
}
.content {
margin-top: 15px;
padding: 10px;
}
.noborder {
/deep/ .el-input--mini .el-input__inner{width: 2px;border:none}
}
</style>
\ No newline at end of file
<template>
<div class="employ">
<el-row>
<el-col :span="6" class="borderR">
<div class="hd_box">
<div class="hd_name">客户列表({{employAmount}})</div>
<div class="paddingT10">
<el-input placeholder="搜索客户" prefix-icon="el-icon-search" v-model="employName">
</el-input>
</div>
</div>
<div class="ct_box ct_boxFirst">
<ul>
<li v-for="(i,t) in 49" :key="t" @click="personCheck(i,t)" :class="{'liActive':t==personIndex}">
<el-row :gutter="20">
<el-col :span="4"> <img
src="http://wx.qlogo.cn/mmhead/pburdzLK7PV4ZRaUcsb0X4ssicO9TqpQHZa26oHRvb1ONZT1r3dI0Aw/0"
alt=""></el-col>
<el-col :span="16"><span style="line-height:40px">{{i}}</span></el-col>
</el-row>
</li>
</ul>
</div>
</el-col>
<el-col :span="6" class="borderR">
<div class="hd_box">
<div class="hd_name">{{talkName}}</div>
<div class="paddingT10">
<el-input placeholder="搜索聊天记录" prefix-icon="el-icon-search" v-model="employName">
</el-input>
</div>
</div>
<div class="ct_box
"> <div class="hd_tabs">
<el-tabs v-model="activeName">
<el-tab-pane label="单聊" name="0">
<div class="ct_box">
暂无联系人
</div>
</el-tab-pane>
<el-tab-pane label="群聊" name="1">
<div class="ct_box">
暂无群聊记录
</div>
</el-tab-pane>
</el-tabs>
</div></div>
</el-col>
<el-col :span="12">
<div class="hd_box">
<div class="hd_name hd_nameRi">下载会话</div>
</div>
<div class=" hd_tabthree">
<el-tabs v-model="activeNameThree">
<el-tab-pane label="全部" name="0">
<div class="ct_box">
<div class="hds_time">
<el-date-picker v-model="takeTime" type="date" placeholder="选择日期">
</el-date-picker>
</div>
</div>
</el-tab-pane>
<el-tab-pane label="图片及视频" name="1">
<div class="ct_box">
<div class="hds_time">
<el-date-picker v-model="takeTime" type="date" placeholder="选择日期">
</el-date-picker>
</div>
</div>
</el-tab-pane>
<el-tab-pane label="文件" name="3">
<div class="ct_box">
<div class="hds_time">
<el-date-picker v-model="takeTime" type="date" placeholder="选择日期">
</el-date-picker>
</div>
<el-table :data="fileData" stripe style="width: 100%"
:header-cell-style="{background:'#fff'}">
<el-table-column prop="date" label="类型">
</el-table-column>
<el-table-column prop="name" label="名称">
</el-table-column>
<el-table-column prop="address" label="大小">
</el-table-column>
<el-table-column prop="address" label="来源">
</el-table-column>
<el-table-column prop="address" label="操作">
</el-table-column>
</el-table>
</div>
</el-tab-pane>
<el-tab-pane label="链接" name="4">
<div class="ct_box">
<div class="hds_time">
<el-date-picker v-model="takeTime" type="date" placeholder="选择日期">
</el-date-picker>
</div>
</div>
</el-tab-pane>
<el-tab-pane label="语音通话" name="5">
<div class="ct_box">
<div class="hds_time">
<el-date-picker v-model="takeTime" type="date" placeholder="选择日期">
</el-date-picker>
</div>
<el-table :data="fileData" stripe style="width: 100%"
:header-cell-style="{background:'#fff'}">
<el-table-column prop="date" label="发起人">
</el-table-column>
<el-table-column prop="name" label="通话时间">
</el-table-column>
<el-table-column prop="address" label="时长">
</el-table-column>
<el-table-column prop="address" label="操作">
</el-table-column>
</el-table>
</div>
</el-tab-pane>
</el-tabs>
</div>
</el-col>
</el-row>
</div>
</template>
<script>
export default {
data() {
return {
employAmount: 1,
employName: '',
talkName: '',
personIndex: '-1',
activeName: "1",
activeNameThree: '1',
takeTime: '',
fileData: []
};
},
methods: {
personCheck(name, e) {
this.personIndex = e
this.talkName = name
}
}
}
</script>
<style lang="scss" scoped>
/deep/ #tab-0 {
text-indent: 15px;
}
.borderR {
border-right: 2px solid #ccc;
}
.paddingT10 {
padding-top: 10px
}
.employ {
background: #f6f6f9;
min-height: 800px;
.hd_tabs {
background: #fff;
}
.hd_tabthree {
/deep/ .el-tabs__header {
margin: 0;
}
}
.hd_box {
padding: 15px;
}
.hd_name {
font-size: 18px;
min-height: 20px;
}
.hd_nameRi {
color: #199ed8;
text-align: right;
font-size: 16px;
cursor: pointer;
}
.ct_boxFirst {
height: 720px;
}
.ct_box {
background: white;
min-height: 710px;
padding: 10px;
overflow-y: scroll;
color: #999;
text-align: center;
::-webkit-scrollbar {
display: none;
}
ul {
margin: 0;
padding: 0;
}
ul li {
margin-bottom: 3px;
padding: 10px 20px;
text-align: left;
cursor: pointer;
border-bottom: 1px solid #efefef;
img {
width: 40px;
}
;
}
.liActive {
background: lightblue !important;
color: #fff;
}
.hds_time {
float: left;
padding: 10px 0;
}
}
}
</style>
\ No newline at end of file
......@@ -78,7 +78,7 @@ export default {
this.list = rows
this.total = +total
this.loading = false
this.multipleSelection = []
this.ids = []
})
.catch(() => {
this.loading = false
......@@ -129,41 +129,43 @@ export default {
this.getList(1)
})
},
download(id,userName,activityScene){
let name = userName+"-"+activityScene+".png"
download(id).then((res) =>{
if (res!=null) {
let blob = new Blob([res], {type: 'application/zip'});
let url = window.URL.createObjectURL(blob);
const link = document.createElement('a'); // 创建a标签
link.href = url;
link.download = name; // 重命名文件
link.click();
URL.revokeObjectURL(url); // 释放内存
download(id, userName, activityScene) {
let name = userName + '-' + activityScene + '.png'
download(id).then((res) => {
if (res != null) {
let blob = new Blob([res], { type: 'application/zip' })
let url = window.URL.createObjectURL(blob)
const link = document.createElement('a') // 创建a标签
link.href = url
link.download = name // 重命名文件
link.click()
URL.revokeObjectURL(url) // 释放内存
}
})
},
/** 下载 */
downloadBatch(qrCode) {
this.$confirm('是否确认下载所有图片吗?', '警告', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
})
.then(() => {
return downloadBatch(this.ids + '')
// window.open(downloadBatch(this.ids))
})
.then(() => {
return downloadBatch(this.ids + '')
// window.open(downloadBatch(this.ids))
}).then((res) =>{
if (res!=null) {
let blob = new Blob([res], {type: 'application/zip'});
let url = window.URL.createObjectURL(blob);
const link = document.createElement('a'); // 创建a标签
link.href = url;
link.download = '批量员工活码.zip'; // 重命名文件
link.click();
URL.revokeObjectURL(url); // 释放内存
.then((res) => {
if (res != null) {
let blob = new Blob([res], { type: 'application/zip' })
let url = window.URL.createObjectURL(blob)
const link = document.createElement('a') // 创建a标签
link.href = url
link.download = '批量员工活码.zip' // 重命名文件
link.click()
URL.revokeObjectURL(url) // 释放内存
}
}).catch(function() {})
})
.catch(function() {})
},
},
}
......@@ -171,14 +173,19 @@ export default {
<template>
<div>
<el-form :model="query" ref="queryForm" :inline="true" label-width="100px">
<el-form
:model="query"
ref="queryForm"
:inline="true"
label-width="100px"
class="top-search"
>
<el-form-item label="使用员工">
<el-input
v-model="query.useUserName"
placeholder="请输入"
clearable
style="width: 240px;"
@keyup.enter.native="handleQuery"
@keyup.enter.native="getList(1)"
/>
</el-form-item>
<!-- <el-form-item label="姓名">
......@@ -186,8 +193,7 @@ export default {
v-model="query.operName"
placeholder="请输入"
clearable
style="width: 240px;"
@keyup.enter.native="handleQuery"
@keyup.enter.native="getList(1)"
/>
</el-form-item> -->
<el-form-item label="手机号">
......@@ -195,8 +201,7 @@ export default {
v-model="query.mobile"
placeholder="请输入"
clearable
style="width: 240px;"
@keyup.enter.native="handleQuery"
@keyup.enter.native="getList(1)"
/>
</el-form-item>
<el-form-item label="活动场景">
......@@ -204,8 +209,7 @@ export default {
v-model="query.activityScene"
placeholder="请输入"
clearable
style="width: 240px;"
@keyup.enter.native="handleQuery"
@keyup.enter.native="getList(1)"
/>
</el-form-item>
<el-form-item label="创建人">
......@@ -213,14 +217,12 @@ export default {
v-model="query.createBy"
placeholder="请输入"
clearable
style="width: 240px;"
@keyup.enter.native="handleQuery"
@keyup.enter.native="getList(1)"
/>
</el-form-item>
<el-form-item label="创建日期">
<el-date-picker
v-model="dateRange"
style="width: 240px"
value-format="yyyy-MM-dd"
type="daterange"
range-separator="-"
......@@ -307,7 +309,7 @@ export default {
<template slot-scope="{ row }">
<el-button
type="text"
@click="download(row.id,row.useUserName,row.activityScene)"
@click="download(row.id, row.useUserName, row.activityScene)"
v-hasPermi="['monitor:operlog:query']"
>下载</el-button
>
......
<script>
import { add } from '@/api/groupMessage'
import { getMaterialMediaId } from '@/api/material'
import PhoneDialog from '@/components/PhoneDialog'
import SelectUser from '@/components/SelectUser'
import SelectTag from '@/components/SelectTag'
......@@ -103,19 +104,36 @@ export default {
// 选择素材确认按钮
submitSelectMaterial(text, image, file) {
this.form.textMessage.content = text.content
this.form.imageMessage.media_id = image.id
// this.form.imageMessage.media_id = image.id
this.form.imageMessage.pic_url = image.materialUrl
this.form.imageMessage._materialName = image.materialName
},
submit() {
let form = JSON.parse(JSON.stringify(this.form))
form.tag = form.tag.map((d) => d.tagId) + ''
form.department += ''
form.staffId += ''
add(form)
Promise.resolve(() => {
if (form.messageType == 1) {
// debugger
let dataMediaId = {
url: form.imageMessage.pic_url,
type: '0',
name: form.imageMessage._materialName,
}
return getMaterialMediaId(dataMediaId).then((res) => {
form.imageMessage.media_id = res.data
})
}
})
.then(() => {
form.messageType = this.activeName
form.tag = form.tag.map((d) => d.tagId) + ''
form.department += ''
form.staffId += ''
return add(form)
})
.then(({ data }) => {
this.msgSuccess('操作成功')
this.loading = false
this.$router.back()
this.$router.push('/groupMessage/record')
})
.catch(() => {
this.loading = false
......
......@@ -57,6 +57,22 @@ public class WeCustomerMessage extends BaseEntity {
private String msgid;
/**
* 发送情况
* ps:显示样式
*
* 1)定时任务 发送时间:2020-12-25 10:00:00
* 2) 预计发送3190人,已成功发送0人
* 3)预计发送2个群,已成功发送0个群
*
*/
private String sendInfo;
/**
* 消息内容
*/
private String content;
/**
* 0 未删除 1 已删除
*/
private int delFlag;
......
package com.linkwechat.wecom.domain.vo;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import java.util.Date;
/**
* 群发消息任务
*/
@Data
public class CustomerMessagePushVo {
/**
* 消息id
*/
private Long messageId;
/**
* 消息类型 0 文本消息 1 图片消息 2 链接消息 3 小程序消息
*/
private String messageType;
/**
* 消息内容
*/
private String content;
/**
* 群发类型 0 发给客户 1 发给客户群
*/
private String pushType;
/**
* 消息范围 0 全部客户 1 指定客户
*/
private String pushRange;
/**
* 创建人
*/
private String sender;
/**
* 创建时间
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date sendTime;
/**
* 发送情况
* ps:显示样式
*
* 1)定时任务 发送时间:2020-12-25 10:00:00
* 2) 预计发送3190人,已成功发送0人
* 3)预计发送2个群,已成功发送0个群
*
*/
private String sendInfo;
}
......@@ -2,6 +2,10 @@ package com.linkwechat.wecom.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.linkwechat.wecom.domain.WeCustomerMessageOriginal;
import com.linkwechat.wecom.domain.vo.CustomerMessagePushVo;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 群发消息 原始数据信息表 Mapper接口
......@@ -10,4 +14,18 @@ import com.linkwechat.wecom.domain.WeCustomerMessageOriginal;
* @date 2020-12-08
*/
public interface WeCustomerMessageOriginalMapper extends BaseMapper<WeCustomerMessageOriginal> {
/**
* 群发消息列表
*
* @param sender 创建人
* @param content 内容
* @param pushType 群发类型
* @param beginTime 开始时间
* @param endTime 结束时间
* @return {@link CustomerMessagePushVo}s
*/
public List<CustomerMessagePushVo> selectCustomerMessagePushs(@Param("sender") String sender,@Param("content") String content
,@Param("pushType") String pushType, @Param("beginTime") String beginTime,@Param("endTime") String endTime);
}
......@@ -2,6 +2,10 @@ package com.linkwechat.wecom.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.linkwechat.wecom.domain.WeCustomerMessageOriginal;
import com.linkwechat.wecom.domain.vo.CustomerMessagePushVo;
import java.util.List;
/**
* 群发消息 原始数据信息表 we_customer_messageOriginal
*
......@@ -15,4 +19,17 @@ public interface IWeCustomerMessageOriginalService extends IService<WeCustomerMe
* @return
*/
int saveWeCustomerMessageOriginal(WeCustomerMessageOriginal weCustomerMessageOriginal);
/**
* 群发消息列表
*
* @param sender 创建人
* @param content 内容
* @param pushType 群发类型
* @param beginTime 开始时间
* @param endTime 结束时间
* @return {@link CustomerMessagePushVo}s
*/
List<CustomerMessagePushVo> customerMessagePushs(String sender,String content,String pushType,String beginTime,String endTime);
}
......@@ -3,6 +3,9 @@ package com.linkwechat.wecom.service;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.linkwechat.wecom.domain.dto.message.CustomerMessagePushDto;
import com.linkwechat.wecom.domain.vo.CustomerMessagePushVo;
import java.util.List;
/**
* @description: 群发消息服务类
......@@ -18,4 +21,16 @@ public interface IWeCustomerMessagePushService {
*/
public void addWeCustomerMessagePush(CustomerMessagePushDto customerMessagePushDto) throws JsonProcessingException;
/**
* 群发消息列表
*
* @param sender 创建人
* @param content 内容
* @param pushType 群发类型
* @param beginTime 开始时间
* @param endTime 结束时间
* @return {@link CustomerMessagePushVo}s
*/
public List<CustomerMessagePushVo> customerMessagePushs(String sender,String content,String pushType,String beginTime,String endTime);
}
......@@ -2,11 +2,14 @@ package com.linkwechat.wecom.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.linkwechat.wecom.domain.WeCustomerMessageOriginal;
import com.linkwechat.wecom.domain.vo.CustomerMessagePushVo;
import com.linkwechat.wecom.mapper.WeCustomerMessageOriginalMapper;
import com.linkwechat.wecom.service.IWeCustomerMessageOriginalService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* 群发消息 原始数据信息表 we_customer_messageOriginal
*
......@@ -14,7 +17,7 @@ import org.springframework.stereotype.Service;
* @date 2020-12-12
*/
@Service
public class WeCustomerMessageOriginalServiceImpl extends ServiceImpl<WeCustomerMessageOriginalMapper,WeCustomerMessageOriginal>implements IWeCustomerMessageOriginalService {
public class WeCustomerMessageOriginalServiceImpl extends ServiceImpl<WeCustomerMessageOriginalMapper, WeCustomerMessageOriginal> implements IWeCustomerMessageOriginalService {
@Autowired
private WeCustomerMessageOriginalMapper weCustomerMessageOriginalMapper;
......@@ -24,5 +27,10 @@ public class WeCustomerMessageOriginalServiceImpl extends ServiceImpl<WeCustome
return weCustomerMessageOriginalMapper.insert(weCustomerMessageOriginal);
}
@Override
public List<CustomerMessagePushVo> customerMessagePushs(String sender, String content, String pushType, String beginTime, String endTime) {
return weCustomerMessageOriginalMapper.selectCustomerMessagePushs(sender, content, pushType, beginTime, endTime);
}
}
......@@ -2,11 +2,9 @@ package com.linkwechat.wecom.service.impl;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.io.FileUtil;
import com.linkwechat.common.config.RuoYiConfig;
import com.linkwechat.common.config.ServerConfig;
import com.linkwechat.common.constant.WeConstans;
//import com.linkwechat.common.enums.MediaType;
import com.linkwechat.common.exception.wecom.WeComException;
import com.linkwechat.common.utils.SnowFlakeUtil;
import com.linkwechat.common.utils.StringUtils;
......@@ -18,30 +16,11 @@ import com.linkwechat.wecom.domain.vo.WeMaterialFileVO;
import com.linkwechat.wecom.mapper.WeMaterialMapper;
import com.linkwechat.wecom.service.IWeMaterialService;
import lombok.extern.slf4j.Slf4j;
import me.chanjar.weixin.common.error.WxError;
import me.chanjar.weixin.common.util.http.apache.Utf8ResponseHandler;
import org.apache.commons.fileupload.FileItem;
import org.apache.commons.fileupload.FileItemFactory;
import org.apache.commons.fileupload.disk.DiskFileItemFactory;
import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.entity.mime.HttpMultipartMode;
import org.apache.http.entity.mime.MultipartEntityBuilder;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.mock.web.MockMultipartFile;
import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.commons.CommonsMultipartFile;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.HttpURLConnection;
import java.net.URL;
import java.util.Arrays;
......
......@@ -3,4 +3,29 @@
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.linkwechat.wecom.mapper.WeCustomerMessageOriginalMapper">
<select id="selectCustomerMessagePushs" resultType="com.linkwechat.wecom.domain.vo.CustomerMessagePushVo">
SELECT
wcmo.push_type,wcmo.message_type,wcmo.push_range,wcm.create_by sender,wcmo.create_time
sendTime,wcm.message_id,wcm.content,wcm.send_info
FROM we_customer_messageOriginal wcmo LEFT JOIN we_customer_message wcm ON
wcmo.message_original_Id=wcm.original_id
<where>
<if test="sender!=null and sender!=''">
AND wcmo.create_by LIKE CONCAT('%',#{sender},'%')
</if>
<if test="content!=null and content!=''">
AND wcm.content LIKE CONCAT('%',#{content},'%')
</if>
<if test="pushType!=null and pushType!=''">
AND wcmo.push_type=#{pushType}
</if>
<if test="beginTime != null and beginTime != ''"><!-- 开始时间检索 -->
AND date_format(wcmo.create_time,'%y%m%d') &gt;= date_format(#{beginTime},'%y%m%d')
</if>
<if test="endTime != null and endTime != ''"><!-- 结束时间检索 -->
AND date_format(wcmo.create_time,'%y%m%d') &lt;= date_format(#{endTime},'%y%m%d')
</if>
</where>
</select>
</mapper>
\ No newline at end of file
This diff could not be displayed because it is too large.
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!