Commit e79ffe85 by linkwechat8856@163.com

Merge branch 'master' into back_end_dev

2 parents 71c66859 51c68851
Showing 38 changed files with 445 additions and 204 deletions
...@@ -150,6 +150,13 @@ public class WeCustomerController extends BaseController ...@@ -150,6 +150,13 @@ public class WeCustomerController extends BaseController
} }
@GetMapping("/getCustomersInfoAndSynch")
public AjaxResult getCustomersInfoAndSynchWeCustomer(String externalUserid,String userId){
weCustomerService.getCustomersInfoAndSynchWeCustomer(externalUserid,userId);
return AjaxResult.success();
}
/** /**
* 客户打标签 * 客户打标签
* @param weMakeCustomerTag * @param weMakeCustomerTag
......
...@@ -190,7 +190,7 @@ public class WeEmpleCodeController extends BaseController { ...@@ -190,7 +190,7 @@ public class WeEmpleCodeController extends BaseController {
// @PreAuthorize("@ss.hasPermi('wecom:code:getUserAddCustomerStat')") // @PreAuthorize("@ss.hasPermi('wecom:code:getUserAddCustomerStat')")
@Log(title = "成员添加客户统计", businessType = BusinessType.OTHER) @Log(title = "成员添加客户统计", businessType = BusinessType.OTHER)
@GetMapping("/getUserAddCustomerStat") @GetMapping("/getUserAddCustomerStat")
public AjaxResult getUserAddCustomerStat(WeFlowerCustomerRel weFlowerCustomerRel){ public AjaxResult getUserAddCustomerStat(String codeId,String beginTime,String endTime){
return AjaxResult.success(weFlowerCustomerRelService.getUserAddCustomerStat(weFlowerCustomerRel)); return AjaxResult.success(weFlowerCustomerRelService.getUserAddCustomerStat(codeId, beginTime, endTime));
} }
} }
...@@ -27,10 +27,15 @@ export default { ...@@ -27,10 +27,15 @@ export default {
video: 'attachment', video: 'attachment',
voice: 'attachment', voice: 'attachment',
location: 'address', location: 'address',
weapp: 'title', weapp: 'title'
card: 'corpname' // card: 'corpname'
} }
let attr = typeDict[this.message.msgType]
if (attr) {
return JSON.parse(this.message.contact)[typeDict[this.message.msgType]] return JSON.parse(this.message.contact)[typeDict[this.message.msgType]]
} else {
return JSON.parse(this.message.contact)
}
} }
}, },
watch: {}, watch: {},
...@@ -65,13 +70,7 @@ export default { ...@@ -65,13 +70,7 @@ export default {
{{ content }} {{ content }}
</template> </template>
<template v-else-if="'image,emotion'.includes(message.msgType)"> <template v-else-if="'image,emotion'.includes(message.msgType)">
<el-image <el-image style="width: 100px; height: 100px" :src="content" fit="fit" :preview-src-list="[content]"> </el-image>
style="width: 100px; height: 100px"
:src="content"
fit="fit"
:preview-src-list="[content]"
>
</el-image>
</template> </template>
<a <a
v-else-if="'file'.includes(message.msgType)" v-else-if="'file'.includes(message.msgType)"
...@@ -90,11 +89,7 @@ export default { ...@@ -90,11 +89,7 @@ export default {
{{ content }} {{ content }}
</a> </a>
<div v-else-if="message.msgType === 'voice'"> <div v-else-if="message.msgType === 'voice'">
<i <i class="el-icon-microphone" style=" font-size: 40px; color: #199ed8;" @click="playAudio('attachment')"></i>
class="el-icon-microphone"
style=" font-size: 40px; color: #199ed8;"
@click="playAudio('attachment')"
></i>
</div> </div>
<template v-else-if="message.msgType === 'video'"> <template v-else-if="message.msgType === 'video'">
<video <video
...@@ -137,44 +132,50 @@ export default { ...@@ -137,44 +132,50 @@ export default {
></video-player> --> ></video-player> -->
</template> </template>
<div v-else-if="message.msgType === 'location'" class="msgtypecard"> <div v-else-if="message.msgType === 'location'" class="msgtypecard">
<div class="card_name"> <div class="card-content">
<el-amap <el-amap
ref="map" ref="map"
vid="amapDemo" vid="amapDemo"
:center="[ :center="[JSON.parse(message.contact).longitude, JSON.parse(message.contact).latitude]"
JSON.parse(message.contact).longitude,
JSON.parse(message.contact).latitude
]"
:zoom="15" :zoom="15"
class="amap-demo" class="amap-demo"
style="pointer-events: none;" style="pointer-events: none;"
> >
<el-amap-marker <el-amap-marker
:position="[ :position="[JSON.parse(message.contact).longitude, JSON.parse(message.contact).latitude]"
JSON.parse(message.contact).longitude,
JSON.parse(message.contact).latitude
]"
></el-amap-marker> ></el-amap-marker>
</el-amap> </el-amap>
</div> </div>
<div class="card_foot">{{ content }}</div> <div class="card-foot">{{ content }}</div>
</div> </div>
<div v-else-if="message.msgType === 'weapp'" class="msgtypecard"> <div v-else-if="message.msgType === 'weapp'" class="msgtypecard">
<div class="card_name">{{ content }}</div> <div class="card-content">{{ content }}</div>
<div class="card_foot">小程序</div> <div class="card-foot">小程序</div>
</div> </div>
<div v-else-if="message.msgType === 'card'" class="msgtypecard "> <div v-else-if="message.msgType === 'card'" class="msgtypecard ">
<div class="card_name">{{ content }}</div> <div class="card-content">
<div class="card_foot">个人名片</div> <span style="flex: none;"> {{ content.corpname }}: </span>
<span>
{{ content.userid }}
</span>
</div>
<div class="card-foot">个人名片</div>
</div>
<!-- 图文链接 -->
<div v-else-if="message.msgType === 'link'" class="msgtypecard ">
<a :href="content.link_url">
<div class="card-content fxbw">
<div>
<div class="card--link-title">{{ content.title }}</div>
<div class="card--link-desc">{{ content.description }}</div>
</div>
<el-image style="width: 50px; height: 50px" :src="content.image_url" fit="fit"></el-image>
</div>
</a>
</div> </div>
<div v-else>不支持的消息类型:{{ message.msgType }}</div> <div v-else>不支持的消息类型:{{ message.msgType }}</div>
<el-dialog <el-dialog v-if="audioSrc[0]" :visible.sync="dialogVisible" width="30%" @close="close">
v-if="audioSrc[0]"
:visible.sync="dialogVisible"
width="30%"
@close="close"
>
<div class="shabowboxvidoe shabowboxaudio"> <div class="shabowboxvidoe shabowboxaudio">
<!-- <AudioPlayer <!-- <AudioPlayer
:audio-list="audioSrc" :audio-list="audioSrc"
...@@ -223,23 +224,45 @@ export default { ...@@ -223,23 +224,45 @@ export default {
.msgtypecard { .msgtypecard {
width: 320px; width: 320px;
height: 140px; // height: 140px;
margin: 10px 5px; margin: 10px 5px;
border-radius: 8px; border-radius: 8px;
-webkit-box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), -webkit-box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 8px 0 rgba(0, 0, 0, 0.19);
0 6px 8px 0 rgba(0, 0, 0, 0.19);
box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 8px 0 rgba(0, 0, 0, 0.19); box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 8px 0 rgba(0, 0, 0, 0.19);
position: relative; position: relative;
background: #f8f8f8; background: #f8f8f8;
overflow: hidden; overflow: hidden;
.card_name { .card-content {
width: 320px; width: 320px;
height: 105px; min-height: 105px;
line-height: 80px; height: 100%;
text-indent: 10px; display: flex;
align-items: center;
padding: 10px;
line-height: 1.5;
// text-indent: 10px;
color: #333;
.card--link-title {
font-size: 16px;
font-weight: 500;
margin-bottom: 5px;
text-overflow: -o-ellipsis-lastline;
overflow: hidden;
text-overflow: ellipsis;
word-break: break-all;
display: -webkit-box;
white-space: pre-wrap;
-webkit-line-clamp: 2;
line-clamp: 2;
-webkit-box-orient: vertical;
}
.card--link-desc {
font-size: 14px;
color: #aaa;
}
} }
.card_foot { .card-foot {
position: absolute; position: absolute;
height: 20px; height: 20px;
border-top: 1px solid #efefef; border-top: 1px solid #efefef;
......
...@@ -35,7 +35,6 @@ export default { ...@@ -35,7 +35,6 @@ export default {
rewardImageUrl: '', rewardImageUrl: '',
rewardRule: '' rewardRule: ''
}, },
rewardImageUrlTemp: '',
action: process.env.VUE_APP_BASE_API + window.CONFIG.services.wecom + '/fission/upload', action: process.env.VUE_APP_BASE_API + window.CONFIG.services.wecom + '/fission/upload',
headers: window.CONFIG.headers, headers: window.CONFIG.headers,
ruleForm: { ruleForm: {
...@@ -223,7 +222,7 @@ export default { ...@@ -223,7 +222,7 @@ export default {
}, },
handleAvatarSuccess(res, file) { handleAvatarSuccess(res, file) {
// this.rewardImageUrlTemp = URL.createObjectURL(file.raw) //预览 // this.rewardImageUrlTemp = URL.createObjectURL(file.raw) //预览
this.rewardImageUrlTemp = this.groupForm.rewardImageUrl = res.data.rewardImageUrl this.groupForm.rewardImageUrl = res.data.rewardImageUrl
}, },
beforeAvatarUpload(file) { beforeAvatarUpload(file) {
const isJPG = file.type === 'image/jpeg' const isJPG = file.type === 'image/jpeg'
...@@ -388,7 +387,7 @@ export default { ...@@ -388,7 +387,7 @@ export default {
:on-success="handleAvatarSuccess" :on-success="handleAvatarSuccess"
:before-upload="beforeAvatarUpload" :before-upload="beforeAvatarUpload"
> >
<img v-if="rewardImageUrlTemp" :src="rewardImageUrlTemp" class="avatar" /> <img v-if="groupForm.rewardImageUrl" :src="groupForm.rewardImageUrl" class="avatar" />
<i v-else class="el-icon-plus avatar-uploader-icon"></i> <i v-else class="el-icon-plus avatar-uploader-icon"></i>
</el-upload> </el-upload>
</el-form-item> </el-form-item>
......
...@@ -167,8 +167,17 @@ export default { ...@@ -167,8 +167,17 @@ export default {
}) })
}) })
if (hasErrorTag.length > 0) { if (hasErrorTag.length > 0) {
this.msgError('已有标签[' + hasErrorTag + ']不在标签库中,或存在异常') this.$notify({
return // title: '标题名称',
message: this.$createElement(
'i',
{ style: 'color: red' },
'已有标签[' + hasErrorTag + ']不在标签库中,已被删除或存在异常'
),
type: 'warning',
customClass: 'mzindex'
})
// this.msgError('已有标签[' + hasErrorTag + ']不在标签库中,已被删除或存在异常')
} }
if (type === 'remove' && this.selectedTag.length === 0) { if (type === 'remove' && this.selectedTag.length === 0) {
this.msgError('该客户没有标签,不可进行移除') this.msgError('该客户没有标签,不可进行移除')
...@@ -443,3 +452,8 @@ export default { ...@@ -443,3 +452,8 @@ export default {
margin-left: 10px; margin-left: 10px;
} }
</style> </style>
<style>
.mzindex {
z-index: 5000 !important;
}
</style>
<script> <script>
import { import { getAllocateCustomers, getAllocateGroups } from '@/api/customer/dimission'
getAllocateCustomers,
getAllocateGroups
} from '@/api/customer/dimission'
export default { export default {
name: 'AllocatedStaffDetailList', name: 'AllocatedStaffDetailList',
...@@ -50,9 +47,7 @@ export default { ...@@ -50,9 +47,7 @@ export default {
} }
page && (this.query.pageNum = page) page && (this.query.pageNum = page)
this.loading = true this.loading = true
;(this.type === 'customer' ? getAllocateCustomers : getAllocateGroups)( ;(this.type === 'customer' ? getAllocateCustomers : getAllocateGroups)(this.query)
this.query
)
.then(({ rows, total }) => { .then(({ rows, total }) => {
this.list = rows this.list = rows
this.total = +total this.total = +total
...@@ -68,40 +63,20 @@ export default { ...@@ -68,40 +63,20 @@ export default {
<template> <template>
<div class="page"> <div class="page">
<el-table <el-table ref="multipleTable" :data="list" tooltip-effect="dark" style="width: 100%">
ref="multipleTable" <el-table-column v-if="type === 'customer'" prop="customerName" label="客户名称"></el-table-column>
:data="list"
tooltip-effect="dark"
style="width: 100%"
>
<el-table-column
v-if="type === 'customer'"
prop="customerName"
label="客户名称"
></el-table-column>
<el-table-column v-else prop="groupName" label="群名称"></el-table-column> <el-table-column v-else prop="groupName" label="群名称"></el-table-column>
<el-table-column <el-table-column :prop="type === 'customer' ? 'takeUserName' : 'newOwnerName'" label="接替员工"></el-table-column>
:prop="type === 'customer' ? 'takeUserName' : 'newOwnerName'" <el-table-column prop="department" label="接替员工所属部门" show-overflow-tooltip></el-table-column>
label="接替员工" <el-table-column prop="allocateTime" label="分配时间" show-overflow-tooltip></el-table-column>
></el-table-column>
<el-table-column
prop="department"
label="接替员工所属部门"
show-overflow-tooltip
></el-table-column>
<el-table-column
prop="allocateTime"
label="分配时间"
show-overflow-tooltip
></el-table-column>
<el-table-column label="操作" width="100"> <el-table-column label="操作" width="100">
<template slot-scope="scope"> <template slot-scope="{ row }">
<el-button <el-button
v-hasPermi="['customerManage:dimission:edit']" v-hasPermi="['customerManage:dimission:edit']"
@click=" @click="
$router.push({ $router.push({
path: 'customerDetail', path: 'customerDetail',
query: { id: scope.row.id } query: { data: JSON.stringify(row) }
}) })
" "
type="text" type="text"
......
...@@ -258,13 +258,13 @@ export default { ...@@ -258,13 +258,13 @@ export default {
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作" width="100"> <el-table-column label="操作" width="100">
<template slot-scope="scope"> <template slot-scope="{ row }">
<el-button <el-button
v-hasPermi="['customerManage:customer:view']" v-hasPermi="['customerManage:customer:view']"
@click=" @click="
$router.push({ $router.push({
path: 'customerDetail', path: 'customerDetail',
query: { id: scope.row.externalUserid } query: { data: JSON.stringify(row) }
}) })
" "
type="text" type="text"
......
...@@ -12,7 +12,7 @@ import com.linkwechat.wecom.retry.WeCommonRetryWhen; ...@@ -12,7 +12,7 @@ import com.linkwechat.wecom.retry.WeCommonRetryWhen;
* @author: HaoN * @author: HaoN
* @create: 2020-08-27 16:42 * @create: 2020-08-27 16:42
**/ **/
@BaseRequest(baseURL = "${weComServerUrl}${weComePrefix}", interceptor = WeAccessTokenInterceptor.class) @BaseRequest(baseURL = "${weComServerUrl}${weComePrefix}", interceptor = WeCommonAccessTokenInterceptor.class)
@Retry(maxRetryCount = "3", maxRetryInterval = "1000", condition = WeCommonRetryWhen.class) @Retry(maxRetryCount = "3", maxRetryInterval = "1000", condition = WeCommonRetryWhen.class)
public interface WeUserClient { public interface WeUserClient {
......
...@@ -171,6 +171,11 @@ public class WeCustomer extends BaseEntity { ...@@ -171,6 +171,11 @@ public class WeCustomer extends BaseEntity {
private String updateBy; private String updateBy;
/** 企业自定义的state参数,用于区分客户具体是通过哪个「联系我」添加,由企业通过创建「联系我」方式指定 */
private String state;
/** /**
...@@ -195,9 +200,10 @@ public class WeCustomer extends BaseEntity { ...@@ -195,9 +200,10 @@ public class WeCustomer extends BaseEntity {
/** /**
* 0:正常;1:删除 * 0:正常;1:删除
*/ */
@TableLogic // @TableLogic
private Integer delFlag; private Integer delFlag;
//添加方式 //添加方式
private Integer addMethod; private Integer addMethod;
} }
...@@ -68,6 +68,8 @@ public class WeCustomerList { ...@@ -68,6 +68,8 @@ public class WeCustomerList {
@JsonFormat(pattern = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd")
private Date birthday; private Date birthday;
......
package com.linkwechat.wecom.domain;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.Date;
@Data
@TableName("we_scan_emple_code_count")
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class WeScanEmpleCodeCount {
@TableId
private Long id;
private String externalUserid;
private String userId;
private Date createTime;
private Long empleCodeId;
}
...@@ -93,6 +93,9 @@ public class ExternalUserDetail extends WeResultDto { ...@@ -93,6 +93,9 @@ public class ExternalUserDetail extends WeResultDto {
private String oper_userid; private String oper_userid;
/**标签**/ /**标签**/
private String[] tag_id; private String[] tag_id;
/** 企业自定义的state参数,用于区分客户具体是通过哪个「联系我」添加,由企业通过创建「联系我」方式指定 */
private String state;
} }
} }
...@@ -28,4 +28,35 @@ public class WeAllocateCustomersVo extends BaseEntity { ...@@ -28,4 +28,35 @@ public class WeAllocateCustomersVo extends BaseEntity {
/**原拥有着*/ /**原拥有着*/
private String handoverUserId; private String handoverUserId;
private String avatar;
@JsonFormat(pattern = "yyyy-MM-dd")
private Date birthday;
//0-未知 1-男性 2-女性
private Integer gender;
//查询标签id
private String tagIds;
//标签名称,使用逗号隔开
private String tagNames;
//跟进人名称
private String userName;
//添加时间
@JsonFormat(pattern = "yyyy-MM-dd")
private Date firstAddTime;
} }
package com.linkwechat.wecom.factory.impl.customer; package com.linkwechat.wecom.factory.impl.customer;
import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.collection.ListUtil;
import cn.hutool.core.io.FileUtil; import cn.hutool.core.io.FileUtil;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
...@@ -61,6 +62,10 @@ public class WeCallBackAddExternalContactImpl extends WeEventStrategy { ...@@ -61,6 +62,10 @@ public class WeCallBackAddExternalContactImpl extends WeEventStrategy {
private WeCustomerClient weCustomerClient; private WeCustomerClient weCustomerClient;
@Autowired
private IWeScanEmpleCodeCountService iWeScanEmpleCodeCountService;
@Override @Override
public void eventHandle(WxCpXmlMessageVO message) { public void eventHandle(WxCpXmlMessageVO message) {
if (message.getExternalUserId() != null) { if (message.getExternalUserId() != null) {
...@@ -122,7 +127,7 @@ public class WeCallBackAddExternalContactImpl extends WeEventStrategy { ...@@ -122,7 +127,7 @@ public class WeCallBackAddExternalContactImpl extends WeEventStrategy {
} }
/** /**
* 活码欢迎语发送 * 活码欢迎语发送(扫码回掉)
* *
* @param state 渠道 * @param state 渠道
* @param wecomCode 欢迎语code * @param wecomCode 欢迎语code
...@@ -137,6 +142,15 @@ public class WeCallBackAddExternalContactImpl extends WeEventStrategy { ...@@ -137,6 +142,15 @@ public class WeCallBackAddExternalContactImpl extends WeEventStrategy {
WeWelcomeMsg.WeWelcomeMsgBuilder weWelcomeMsgBuilder = WeWelcomeMsg.builder().welcome_code(wecomCode); WeWelcomeMsg.WeWelcomeMsgBuilder weWelcomeMsgBuilder = WeWelcomeMsg.builder().welcome_code(wecomCode);
WeEmpleCodeDto messageMap = weEmpleCodeService.selectWelcomeMsgByState(state); WeEmpleCodeDto messageMap = weEmpleCodeService.selectWelcomeMsgByState(state);
if (StringUtils.isNotNull(messageMap)) { if (StringUtils.isNotNull(messageMap)) {
//扫码统计记录入库
iWeScanEmpleCodeCountService.save(
WeScanEmpleCodeCount.builder()
.empleCodeId(Long.valueOf(state))
.createTime(new Date())
.userId(userId)
.externalUserid(externalUserId)
.build());
//查询活码对应标签 //查询活码对应标签
List<WeEmpleCodeTag> tagList = weEmpleCodeTagService.list(new LambdaQueryWrapper<WeEmpleCodeTag>() List<WeEmpleCodeTag> tagList = weEmpleCodeTagService.list(new LambdaQueryWrapper<WeEmpleCodeTag>()
.eq(WeEmpleCodeTag::getEmpleCodeId, messageMap.getEmpleCodeId())); .eq(WeEmpleCodeTag::getEmpleCodeId, messageMap.getEmpleCodeId()));
......
package com.linkwechat.wecom.factory.impl.customer; package com.linkwechat.wecom.factory.impl.customer;
import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.collection.ListUtil;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.linkwechat.common.enums.MediaType; import com.linkwechat.common.enums.MediaType;
import com.linkwechat.common.utils.StringUtils; import com.linkwechat.common.utils.StringUtils;
import com.linkwechat.wecom.domain.WeEmpleCodeTag; import com.linkwechat.wecom.domain.*;
import com.linkwechat.wecom.domain.WeFlowerCustomerRel;
import com.linkwechat.wecom.domain.WeFlowerCustomerTagRel;
import com.linkwechat.wecom.domain.dto.WeEmpleCodeDto; import com.linkwechat.wecom.domain.dto.WeEmpleCodeDto;
import com.linkwechat.wecom.domain.dto.WeMediaDto; import com.linkwechat.wecom.domain.dto.WeMediaDto;
import com.linkwechat.wecom.domain.dto.WeWelcomeMsg; import com.linkwechat.wecom.domain.dto.WeWelcomeMsg;
...@@ -45,6 +44,9 @@ public class WeCallBackAddHalfExternalContactImpl extends WeEventStrategy { ...@@ -45,6 +44,9 @@ public class WeCallBackAddHalfExternalContactImpl extends WeEventStrategy {
@Autowired @Autowired
private IWeMaterialService weMaterialService; private IWeMaterialService weMaterialService;
@Autowired
private IWeScanEmpleCodeCountService iWeScanEmpleCodeCountService;
@Override @Override
public void eventHandle(WxCpXmlMessageVO message) { public void eventHandle(WxCpXmlMessageVO message) {
try { try {
...@@ -53,6 +55,15 @@ public class WeCallBackAddHalfExternalContactImpl extends WeEventStrategy { ...@@ -53,6 +55,15 @@ public class WeCallBackAddHalfExternalContactImpl extends WeEventStrategy {
} }
//向扫码客户发送欢迎语 //向扫码客户发送欢迎语
if (message.getState() != null && message.getWelcomeCode() != null) { if (message.getState() != null && message.getWelcomeCode() != null) {
//扫码统计记录入库
iWeScanEmpleCodeCountService.save(
WeScanEmpleCodeCount.builder()
.empleCodeId(Long.valueOf(message.getState()))
.createTime(new Date())
.userId(message.getUserId())
.externalUserid(message.getExternalUserId())
.build());
log.info("执行发送欢迎语>>>>>>>>>>>>>>>"); log.info("执行发送欢迎语>>>>>>>>>>>>>>>");
WeWelcomeMsg.WeWelcomeMsgBuilder weWelcomeMsgBuilder = WeWelcomeMsg.builder().welcome_code(message.getWelcomeCode()); WeWelcomeMsg.WeWelcomeMsgBuilder weWelcomeMsgBuilder = WeWelcomeMsg.builder().welcome_code(message.getWelcomeCode());
WeEmpleCodeDto messageMap = weEmpleCodeService.selectWelcomeMsgByScenario(message.getState(),message.getUserId()); WeEmpleCodeDto messageMap = weEmpleCodeService.selectWelcomeMsgByScenario(message.getState(),message.getUserId());
......
package com.linkwechat.wecom.factory.impl.customer; package com.linkwechat.wecom.factory.impl.customer;
import cn.hutool.core.collection.CollectionUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.linkwechat.wecom.domain.WeCustomer; import com.linkwechat.wecom.domain.*;
import com.linkwechat.wecom.domain.WeSensitiveAct;
import com.linkwechat.wecom.domain.WeSensitiveActHit;
import com.linkwechat.wecom.domain.WeUser;
import com.linkwechat.wecom.domain.vo.WxCpXmlMessageVO; import com.linkwechat.wecom.domain.vo.WxCpXmlMessageVO;
import com.linkwechat.wecom.factory.WeEventStrategy; import com.linkwechat.wecom.factory.WeEventStrategy;
import com.linkwechat.wecom.service.IWeCustomerService; import com.linkwechat.wecom.service.IWeCustomerService;
...@@ -15,6 +13,7 @@ import org.springframework.beans.factory.annotation.Autowired; ...@@ -15,6 +13,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import java.util.Date; import java.util.Date;
import java.util.List;
/** /**
* @author danmo * @author danmo
...@@ -52,13 +51,26 @@ public class WeCallBackDelExternalContactImpl extends WeEventStrategy { ...@@ -52,13 +51,26 @@ public class WeCallBackDelExternalContactImpl extends WeEventStrategy {
WeUser user = weUserService.getById(message.getUserId()); WeUser user = weUserService.getById(message.getUserId());
weSensitiveActHit.setOperator(user.getName()); weSensitiveActHit.setOperator(user.getName());
WeCustomer weCustomer = weCustomerService.getOne(new LambdaQueryWrapper<WeCustomer>()
.eq(WeCustomer::getExternalUserid,message.getExternalUserId())
.eq(WeCustomer::getFirstUserId,message.getUserId()));
weSensitiveActHit.setOperateTargetId(weCustomer.getUserId()); List<WeCustomerList> weCustomerList = weCustomerService.findWeCustomerList(WeCustomerList.builder()
weSensitiveActHit.setOperateTarget(weCustomer.getName()); .externalUserid(message.getExternalUserId())
.firstUserId(message.getUserId())
.delFlag(new Integer(1))
.build());
if(CollectionUtil.isNotEmpty(weCustomerList)) {
WeCustomerList weCustomer = weCustomerList.stream().findFirst().get();
weSensitiveActHit.setOperateTargetId(weCustomer.getFirstUserId());
weSensitiveActHit.setOperateTarget(weCustomer.getCustomerName());
weSensitiveActHitService.insertWeSensitiveActHit(weSensitiveActHit); weSensitiveActHitService.insertWeSensitiveActHit(weSensitiveActHit);
}
} }
} }
......
package com.linkwechat.wecom.factory.impl.customer; package com.linkwechat.wecom.factory.impl.customer;
import cn.hutool.core.collection.CollectionUtil;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.linkwechat.common.constant.WeConstans; import com.linkwechat.common.constant.WeConstans;
...@@ -17,6 +18,7 @@ import org.springframework.beans.factory.annotation.Autowired; ...@@ -17,6 +18,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import java.util.Date; import java.util.Date;
import java.util.List;
import java.util.Optional; import java.util.Optional;
/** /**
...@@ -51,10 +53,19 @@ public class WeCallBackDelFollowUserImpl extends WeEventStrategy { ...@@ -51,10 +53,19 @@ public class WeCallBackDelFollowUserImpl extends WeEventStrategy {
Optional.ofNullable(validWeCorpAccount).ifPresent(weCorpAccount -> { Optional.ofNullable(validWeCorpAccount).ifPresent(weCorpAccount -> {
String customerChurnNoticeSwitch = weCorpAccount.getCustomerChurnNoticeSwitch(); String customerChurnNoticeSwitch = weCorpAccount.getCustomerChurnNoticeSwitch();
if (WeConstans.DEL_FOLLOW_USER_SWITCH_OPEN.equals(customerChurnNoticeSwitch)) { if (WeConstans.DEL_FOLLOW_USER_SWITCH_OPEN.equals(customerChurnNoticeSwitch)) {
WeCustomer weCustomer = weCustomerService.getOne(new LambdaQueryWrapper<WeCustomer>().eq(WeCustomer::getFirstUserId,message.getUserId())
.eq(WeCustomer::getExternalUserid,message.getExternalUserId()));
String content = "您已经被客户@" + weCustomer.getName() + "删除!"; List<WeCustomerList> weCustomerList = weCustomerService.findWeCustomerList(WeCustomerList.builder()
.externalUserid(message.getExternalUserId())
.firstUserId(message.getUserId())
.delFlag(new Integer(1))
.build());
if(CollectionUtil.isNotEmpty(weCustomerList)){
WeCustomerList weCustomer = weCustomerList.stream().findFirst().get();
String content = "您已经被客户@" + weCustomer.getCustomerName() + "删除!";
TextMessageDto textMessageDto = new TextMessageDto(); TextMessageDto textMessageDto = new TextMessageDto();
textMessageDto.setContent(content); textMessageDto.setContent(content);
WeMessagePushDto weMessagePushDto = new WeMessagePushDto(); WeMessagePushDto weMessagePushDto = new WeMessagePushDto();
...@@ -77,12 +88,20 @@ public class WeCallBackDelFollowUserImpl extends WeEventStrategy { ...@@ -77,12 +88,20 @@ public class WeCallBackDelFollowUserImpl extends WeEventStrategy {
weSensitiveActHit.setCreateTime(new Date(message.getCreateTime())); weSensitiveActHit.setCreateTime(new Date(message.getCreateTime()));
weSensitiveActHit.setCreateBy("admin"); weSensitiveActHit.setCreateBy("admin");
WeUser user = weUserService.getById(message.getUserId()); WeUser user = weUserService.getById(message.getUserId());
weSensitiveActHit.setOperatorId(weCustomer.getUserId()); weSensitiveActHit.setOperatorId(weCustomer.getFirstUserId());
weSensitiveActHit.setOperator(weCustomer.getName()); weSensitiveActHit.setOperator(weCustomer.getCustomerName());
weSensitiveActHit.setOperateTargetId(user.getUserId()); weSensitiveActHit.setOperateTargetId(user.getUserId());
weSensitiveActHit.setOperateTarget(user.getName()); weSensitiveActHit.setOperateTarget(user.getName());
weSensitiveActHitService.insertWeSensitiveActHit(weSensitiveActHit); weSensitiveActHitService.insertWeSensitiveActHit(weSensitiveActHit);
} }
}
} }
}); });
......
...@@ -82,8 +82,8 @@ public interface WeFlowerCustomerRelMapper extends BaseMapper<WeFlowerCustomerRe ...@@ -82,8 +82,8 @@ public interface WeFlowerCustomerRelMapper extends BaseMapper<WeFlowerCustomerRe
/** /**
* 成员添加客户统计 * 成员添加客户统计
* @param weFlowerCustomerRel * @param
* @return * @return
*/ */
public List<Map<String,Object>> getUserAddCustomerStat(WeFlowerCustomerRel weFlowerCustomerRel); public List<Map<String,Object>> getUserAddCustomerStat(@Param("codeId") String codeId,@Param("beginTime") String beginTime,@Param("endTime") String endTime);
} }
package com.linkwechat.wecom.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.linkwechat.wecom.domain.WeScanEmpleCodeCount;
public interface WeScanEmpleCodeCountMapper extends BaseMapper<WeScanEmpleCodeCount> {
}
...@@ -10,6 +10,7 @@ import com.linkwechat.wecom.domain.dto.WeWelcomeMsg; ...@@ -10,6 +10,7 @@ import com.linkwechat.wecom.domain.dto.WeWelcomeMsg;
import com.linkwechat.wecom.domain.vo.WeCustomerDetailVo; import com.linkwechat.wecom.domain.vo.WeCustomerDetailVo;
import com.linkwechat.wecom.domain.vo.WeLeaveUserInfoAllocateVo; import com.linkwechat.wecom.domain.vo.WeLeaveUserInfoAllocateVo;
import com.linkwechat.wecom.domain.vo.WeMakeCustomerTag; import com.linkwechat.wecom.domain.vo.WeMakeCustomerTag;
import org.apache.ibatis.annotations.Param;
import java.util.List; import java.util.List;
...@@ -155,4 +156,7 @@ public interface IWeCustomerService extends IService<WeCustomer> ...@@ -155,4 +156,7 @@ public interface IWeCustomerService extends IService<WeCustomer>
* @param params * @param params
*/ */
void getCustomerByCondition(JSONObject params); void getCustomerByCondition(JSONObject params);
void batchAddOrUpdate(List<WeCustomer> weCustomer);
} }
...@@ -23,9 +23,9 @@ public interface IWeFlowerCustomerRelService extends IService<WeFlowerCustomerRe ...@@ -23,9 +23,9 @@ public interface IWeFlowerCustomerRelService extends IService<WeFlowerCustomerRe
/** /**
* 成员添加客户统计 * 成员添加客户统计
* @param weFlowerCustomerRel * @param
* @return Map * @return Map
*/ */
public Map<String,Object> getUserAddCustomerStat(WeFlowerCustomerRel weFlowerCustomerRel); public Map<String,Object> getUserAddCustomerStat(String codeId,String beginTime,String endTime);
} }
package com.linkwechat.wecom.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.linkwechat.wecom.domain.WeScanEmpleCodeCount;
public interface IWeScanEmpleCodeCountService extends IService<WeScanEmpleCodeCount> {
}
...@@ -203,23 +203,7 @@ public class WeCustomerMessagePushServiceImpl implements IWeCustomerMessagePushS ...@@ -203,23 +203,7 @@ public class WeCustomerMessagePushServiceImpl implements IWeCustomerMessagePushS
*/ */
public List<WeCustomerList> externalUserIds(String pushRange, String staffId, String department, String tag) { public List<WeCustomerList> externalUserIds(String pushRange, String staffId, String department, String tag) {
if (pushRange.equals(WeConstans.SEND_MESSAGE_CUSTOMER_ALL)) { if (pushRange.equals(WeConstans.SEND_MESSAGE_CUSTOMER_ALL)) {
//从redis中读取数据
// List<WeCustomer> customers = redisCache.getCacheList(WeConstans.WECUSTOMERS_KEY);
// if (CollectionUtils.isEmpty(customers)) {
// WeCustomer weCustomer = new WeCustomer();
// weCustomer.setUserIds(staffId);
// weCustomer.setDepartmentIds(department);
// customers = weCustomerService.selectWeCustomerAllList(weCustomer);
// redisCache.setCacheList(WeConstans.WECUSTOMERS_KEY, customers);
// redisCache.expire(WeConstans.WECUSTOMERS_KEY,2 * 60L);
// }else{
// return customers;
// }
//
// WeCustomer weCustomer = new WeCustomer();
// weCustomer.setUserIds(staffId);
// weCustomer.setDepartmentIds(department);
// return weCustomerService.selectWeCustomerListNoRel(weCustomer);
return weCustomerService.findWeCustomerList(WeCustomerList.builder() return weCustomerService.findWeCustomerList(WeCustomerList.builder()
...@@ -227,7 +211,6 @@ public class WeCustomerMessagePushServiceImpl implements IWeCustomerMessagePushS ...@@ -227,7 +211,6 @@ public class WeCustomerMessagePushServiceImpl implements IWeCustomerMessagePushS
.departmentIds(department) .departmentIds(department)
.build()); .build());
} else { } else {
//按条件查询客户 //按条件查询客户
...@@ -240,14 +223,6 @@ public class WeCustomerMessagePushServiceImpl implements IWeCustomerMessagePushS ...@@ -240,14 +223,6 @@ public class WeCustomerMessagePushServiceImpl implements IWeCustomerMessagePushS
.departmentIds(department) .departmentIds(department)
.build()); .build());
// WeCustomer weCustomer = new WeCustomer();
// weCustomer.setUserIds(staffId);
// weCustomer.setTagIds(tag);
// weCustomer.setDepartmentIds(department);
//
//
//
// return weCustomerService.selectWeCustomerListNoRel(weCustomer);
} }
} }
......
...@@ -96,6 +96,7 @@ public class WeCustomerMessageServiceImpl extends ServiceImpl<WeCustomerMessageM ...@@ -96,6 +96,7 @@ public class WeCustomerMessageServiceImpl extends ServiceImpl<WeCustomerMessageM
@Override @Override
public void sendMessgae(CustomerMessagePushDto customerMessagePushDto, long messageId, List<WeCustomerList> customers, List<WeGroup> groups) throws JsonProcessingException { public void sendMessgae(CustomerMessagePushDto customerMessagePushDto, long messageId, List<WeCustomerList> customers, List<WeGroup> groups) throws JsonProcessingException {
List<String> msgid = new ArrayList<>(); List<String> msgid = new ArrayList<>();
//发给客户 //发给客户
...@@ -118,10 +119,17 @@ public class WeCustomerMessageServiceImpl extends ServiceImpl<WeCustomerMessageM ...@@ -118,10 +119,17 @@ public class WeCustomerMessageServiceImpl extends ServiceImpl<WeCustomerMessageM
messagePushDto.setSender(customerMessagePushDto.getStaffId()); messagePushDto.setSender(customerMessagePushDto.getStaffId());
childMessage(messagePushDto, customerMessagePushDto); childMessage(messagePushDto, customerMessagePushDto);
try {
SendMessageResultDto sendMessageResultDto = weCustomerMessagePushClient.sendCustomerMessageToUser(messagePushDto); SendMessageResultDto sendMessageResultDto = weCustomerMessagePushClient.sendCustomerMessageToUser(messagePushDto);
if (WeConstans.WE_SUCCESS_CODE.equals(sendMessageResultDto.getErrcode())) { if (WeConstans.WE_SUCCESS_CODE.equals(sendMessageResultDto.getErrcode())) {
msgid.add(sendMessageResultDto.getMsgid()); msgid.add(sendMessageResultDto.getMsgid());
} }
}catch (Exception e){
log.error("消息发送失败:"+e.getMessage());
}
} }
}); });
} }
......
...@@ -57,7 +57,7 @@ public class WeCustomerMessgaeResultServiceImpl extends ServiceImpl<WeCustomerMe ...@@ -57,7 +57,7 @@ public class WeCustomerMessgaeResultServiceImpl extends ServiceImpl<WeCustomerMe
customerMessgaeResult.setSendTime(null); customerMessgaeResult.setSendTime(null);
customerMessgaeResult.setSendType(customerMessgaeResult.getSettingTime() == null ? customerMessagePushDto.getPushType() : "2"); customerMessgaeResult.setSendType(customerMessgaeResult.getSettingTime() == null ? customerMessagePushDto.getPushType() : "2");
customerMessgaeResult.setExternalUserid(customer.getExternalUserid()); customerMessgaeResult.setExternalUserid(customer.getExternalUserid());
customerMessgaeResult.setExternalName(customer.getName()); customerMessgaeResult.setExternalName(customer.getCustomerName());
customerMessgaeResult.setUserid(customer.getFirstUserId()); customerMessgaeResult.setUserid(customer.getFirstUserId());
customerMessgaeResult.setUserName(customer.getUserName()); customerMessgaeResult.setUserName(customer.getUserName());
customerMessgaeResult.setStatus("0"); customerMessgaeResult.setStatus("0");
......
...@@ -170,6 +170,8 @@ public class WeCustomerServiceImpl extends ServiceImpl<WeCustomerMapper, WeCusto ...@@ -170,6 +170,8 @@ public class WeCustomerServiceImpl extends ServiceImpl<WeCustomerMapper, WeCusto
weCustomer.setFirstUserId(followInfo.getUserid()); weCustomer.setFirstUserId(followInfo.getUserid());
weCustomer.setFirstAddTime(new Date(followInfo.getCreatetime() * 1000L)); weCustomer.setFirstAddTime(new Date(followInfo.getCreatetime() * 1000L));
weCustomer.setAddMethod(followInfo.getAdd_way()); weCustomer.setAddMethod(followInfo.getAdd_way());
weCustomer.setState(followInfo.getState());
weCustomer.setDelFlag(new Integer(0));
weCustomerList.add(weCustomer); weCustomerList.add(weCustomer);
List<String> tags = Stream.of(followInfo.getTag_id()).collect(Collectors.toList()); List<String> tags = Stream.of(followInfo.getTag_id()).collect(Collectors.toList());
if (CollectionUtil.isNotEmpty(tags)) { if (CollectionUtil.isNotEmpty(tags)) {
...@@ -303,10 +305,10 @@ public class WeCustomerServiceImpl extends ServiceImpl<WeCustomerMapper, WeCusto ...@@ -303,10 +305,10 @@ public class WeCustomerServiceImpl extends ServiceImpl<WeCustomerMapper, WeCusto
); );
if(CollectionUtil.isNotEmpty(weTagList)){ if(CollectionUtil.isNotEmpty(weTagList)){
if(addTag.size()!=weTagList.size()){ if(addTag.size()!=weTagList.size()){
new WeComException("部门标签不存在"); throw new WeComException("部门标签不存在");
} }
}else{ }else{
new WeComException("部门标签不存在"); throw new WeComException("部门标签不存在");
} }
...@@ -374,6 +376,10 @@ public class WeCustomerServiceImpl extends ServiceImpl<WeCustomerMapper, WeCusto ...@@ -374,6 +376,10 @@ public class WeCustomerServiceImpl extends ServiceImpl<WeCustomerMapper, WeCusto
} }
} }
} }
} }
...@@ -417,7 +423,9 @@ public class WeCustomerServiceImpl extends ServiceImpl<WeCustomerMapper, WeCusto ...@@ -417,7 +423,9 @@ public class WeCustomerServiceImpl extends ServiceImpl<WeCustomerMapper, WeCusto
if(null != followUser){ if(null != followUser){
weCustomer.setFirstAddTime(new Date(followUser.getCreatetime() * 1000L)); weCustomer.setFirstAddTime(new Date(followUser.getCreatetime() * 1000L));
weCustomer.setState(followUser.getState());
weCustomer.setAddMethod(followUser.getAddWay());
weCustomer.setDelFlag(new Integer(0));
this.baseMapper.batchAddOrUpdate( this.baseMapper.batchAddOrUpdate(
ListUtil.toList(weCustomer) ListUtil.toList(weCustomer)
); );
...@@ -704,5 +712,10 @@ public class WeCustomerServiceImpl extends ServiceImpl<WeCustomerMapper, WeCusto ...@@ -704,5 +712,10 @@ public class WeCustomerServiceImpl extends ServiceImpl<WeCustomerMapper, WeCusto
} }
@Override
public void batchAddOrUpdate(List<WeCustomer> weCustomer) {
this.baseMapper.batchAddOrUpdate(weCustomer);
}
} }
...@@ -422,7 +422,7 @@ public class WeEmpleCodeServiceImpl extends ServiceImpl<WeEmpleCodeMapper, WeEmp ...@@ -422,7 +422,7 @@ public class WeEmpleCodeServiceImpl extends ServiceImpl<WeEmpleCodeMapper, WeEmp
weContactWay.setType(weEmpleCode.getCodeType()); weContactWay.setType(weEmpleCode.getCodeType());
weContactWay.setScene(WeConstans.QR_CODE_EMPLE_CODE_SCENE); weContactWay.setScene(WeConstans.QR_CODE_EMPLE_CODE_SCENE);
weContactWay.setSkip_verify(weEmpleCode.getIsJoinConfirmFriends().equals(new Integer(0))?false:true); weContactWay.setSkip_verify(weEmpleCode.getIsJoinConfirmFriends().equals(new Integer(0))?false:true);
weContactWay.setState(String.valueOf(weEmpleCode.getId())); weContactWay.setState(String.valueOf(weEmpleCode.getState()));
if (CollectionUtil.isNotEmpty(weEmpleCodeUseScops)) { if (CollectionUtil.isNotEmpty(weEmpleCodeUseScops)) {
//员工列表 //员工列表
String[] userIdArr = weEmpleCodeUseScops.stream().filter(itme -> String[] userIdArr = weEmpleCodeUseScops.stream().filter(itme ->
......
...@@ -69,14 +69,14 @@ public class WeFlowerCustomerRelServiceImpl extends ServiceImpl<WeFlowerCustomer ...@@ -69,14 +69,14 @@ public class WeFlowerCustomerRelServiceImpl extends ServiceImpl<WeFlowerCustomer
} }
@Override @Override
public Map<String, Object> getUserAddCustomerStat(WeFlowerCustomerRel weFlowerCustomerRel) { public Map<String, Object> getUserAddCustomerStat(String codeId,String beginTime,String endTime) {
Map<String, Object> resultMap = new HashMap<>(16); Map<String, Object> resultMap = new HashMap<>(16);
List<String> dateList = new ArrayList<>(); List<String> dateList = new ArrayList<>();
List<Long> statList = new ArrayList<>(); List<Long> statList = new ArrayList<>();
Long resultTotal = 0L; Long resultTotal = 0L;
List<Map<String, Object>> userAddCustomerStatList = this.baseMapper.getUserAddCustomerStat(weFlowerCustomerRel); List<Map<String, Object>> userAddCustomerStatList = this.baseMapper.getUserAddCustomerStat(codeId, beginTime, endTime);
String beginTime = weFlowerCustomerRel.getBeginTime(); // String beginTime = weFlowerCustomerRel.getBeginTime();
String endTime = weFlowerCustomerRel.getEndTime(); // String endTime = weFlowerCustomerRel.getEndTime();
if (beginTime != null && endTime != null) { if (beginTime != null && endTime != null) {
Date beginDate = DateUtils.dateTime(DateUtils.YYYY_MM_DD, beginTime); Date beginDate = DateUtils.dateTime(DateUtils.YYYY_MM_DD, beginTime);
Date endDate = DateUtils.dateTime(DateUtils.YYYY_MM_DD, endTime); Date endDate = DateUtils.dateTime(DateUtils.YYYY_MM_DD, endTime);
......
package com.linkwechat.wecom.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.linkwechat.wecom.domain.WeScanEmpleCodeCount;
import com.linkwechat.wecom.mapper.WeScanEmpleCodeCountMapper;
import com.linkwechat.wecom.service.IWeScanEmpleCodeCountService;
import org.springframework.stereotype.Service;
@Service
public class WeScanEmpleCodeCountServiceImpl extends ServiceImpl<WeScanEmpleCodeCountMapper, WeScanEmpleCodeCount>
implements IWeScanEmpleCodeCountService {
}
...@@ -315,16 +315,21 @@ public class WeTaskFissionServiceImpl extends ServiceImpl<WeTaskFissionMapper, W ...@@ -315,16 +315,21 @@ public class WeTaskFissionServiceImpl extends ServiceImpl<WeTaskFissionMapper, W
}); });
} }
} else { } else {
// WeTaskFissionRecord weTaskFissionRecord = weTaskFissionRecordService WeTaskFissionRecord weTaskFissionRecord = weTaskFissionRecordService
// .selectWeTaskFissionRecordByIdAndCustomerId(Long.valueOf(fissionId), unionId); .selectWeTaskFissionRecordByIdAndCustomerId(Long.valueOf(fissionId), unionId);
// Optional.ofNullable(weTaskFissionRecord).orElseThrow(() -> new WeComException("任务记录信息不存在")); Optional.ofNullable(weTaskFissionRecord).orElseThrow(() -> new WeComException("任务记录信息不存在"));
// List<WeFlowerCustomerRel> list = weFlowerCustomerRelService.list(new LambdaQueryWrapper<WeFlowerCustomerRel>()
// .eq(WeFlowerCustomerRel::getState, WeConstans.FISSION_PREFIX + weTaskFissionRecord.getId()));
// List<String> eidList = Optional.ofNullable(list).orElseGet(ArrayList::new).stream() List<WeCustomer> weCustomers = weCustomerService.list(new LambdaQueryWrapper<WeCustomer>()
// .map(WeFlowerCustomerRel::getExternalUserid).collect(Collectors.toList()); .eq(WeCustomer::getState, WeConstans.FISSION_PREFIX + weTaskFissionRecord.getId()));
// if (CollectionUtil.isNotEmpty(eidList)) {
// customerList.addAll(weCustomerService.listByIds(eidList));
// } List<String> eidList = Optional.ofNullable(weCustomers).orElseGet(ArrayList::new).stream()
.map(WeCustomer::getExternalUserid).collect(Collectors.toList());
if (CollectionUtil.isNotEmpty(eidList)) {
customerList.addAll(weCustomerService.listByIds(eidList));
}
} }
return customerList; return customerList;
} }
......
...@@ -592,7 +592,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -592,7 +592,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<insert id="batchAddOrUpdate"> <insert id="batchAddOrUpdate">
INSERT INTO we_customer( INSERT INTO we_customer(
external_userid, external_userid,
NAME, `name`,
avatar, avatar,
type, type,
gender, gender,
...@@ -610,32 +610,37 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -610,32 +610,37 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
email, email,
address, address,
phone, phone,
add_method add_method,
del_flag,
state
) values ) values
<foreach collection="weCustomers" item="item" index="index" separator=","> <foreach collection="weCustomers" item="item" index="index" separator=",">
(#{item.externalUserid},#{item.name},#{item.avatar},#{item.type},#{item.gender}, #{item.unionid},#{item.birthday}, (#{item.externalUserid},#{item.name},#{item.avatar},#{item.type},#{item.gender}, #{item.unionid},#{item.birthday},
#{item.corpName},#{item.corpFullName},#{item.position},#{item.isOpenChat}, #{item.createTime}, #{item.corpName},#{item.corpFullName},#{item.position},#{item.isOpenChat}, #{item.createTime},
#{item.createBy},#{item.firstUserId},#{item.firstAddTime},#{item.qq},#{item.email},#{item.address},#{item.phone},#{item.addMethod} #{item.createBy},#{item.firstUserId},#{item.firstAddTime},#{item.qq},#{item.email},#{item.address},#{item.phone},#{item.addMethod},
#{item.delFlag},#{item.state}
) )
</foreach> </foreach>
ON DUPLICATE KEY UPDATE ON DUPLICATE KEY UPDATE
NAME=IF(we_customer.NAME != null, VALUES(NAME), we_customer.NAME), NAME=IF(VALUES(NAME)=null and VALUES(NAME)='',we_customer.NAME,VALUES(NAME)),
avatar=IF(we_customer.avatar != null, VALUES(avatar), we_customer.avatar), avatar=IF( VALUES(avatar)=null and VALUES(avatar)='', we_customer.avatar,VALUES(avatar)),
type=IF(we_customer.type != null, VALUES(type), we_customer.type), type=IF(VALUES(type),we_customer.type,VALUES(type)),
gender=IF(we_customer.gender != null, VALUES(gender), we_customer.gender), gender=IF(VALUES(gender) , we_customer.gender,VALUES(gender)),
unionid=IF(we_customer.unionid != null, VALUES(unionid), we_customer.unionid), unionid=IF(VALUES(unionid)=null and VALUES(unionid)='',we_customer.unionid,VALUES(unionid)),
birthday=IF(we_customer.birthday != null,VALUES(birthday), we_customer.birthday), birthday=IF(VALUES(birthday), we_customer.birthday,VALUES(birthday)),
corp_name=IF(we_customer.corp_name != null, VALUES(corp_name), we_customer.corp_name), corp_name=IF(VALUES(corp_name)=null and VALUES(corp_name)='',we_customer.corp_name,VALUES(corp_name)),
corp_full_name=IF(we_customer.corp_full_name != null, VALUES(corp_full_name), we_customer.corp_full_name), corp_full_name=IF(VALUES(corp_full_name)=null and VALUES(corp_full_name)='', we_customer.corp_full_name,VALUES(corp_full_name)),
position=IF(we_customer.position != null, VALUES(position), we_customer.position), position=IF(VALUES(position)=null and VALUES(position)='',we_customer.position,VALUES(position)),
is_open_chat=IF(we_customer.is_open_chat != null, VALUES(is_open_chat), we_customer.is_open_chat), is_open_chat=IF(VALUES(is_open_chat),we_customer.is_open_chat,VALUES(is_open_chat)),
first_user_id=IF(we_customer.first_user_id != null, VALUES(first_user_id), we_customer.first_user_id), first_user_id=IF(VALUES(first_user_id)=null and VALUES(first_user_id)='', we_customer.first_user_id,VALUES(first_user_id)),
first_add_time=IF(we_customer.first_add_time != null, VALUES(first_add_time), we_customer.first_add_time), first_add_time=IF(VALUES(first_add_time)=null ,we_customer.first_add_time,VALUES(first_add_time)),
qq=IF(we_customer.qq != null, VALUES(qq), we_customer.qq), qq=IF(VALUES(qq)=null and VALUES(qq)='', we_customer.qq,VALUES(qq)),
email=IF(we_customer.email != null, VALUES(email), we_customer.email), email=IF(VALUES(email)=null and VALUES(email)='',we_customer.email,VALUES(email)),
address=IF(we_customer.address != null, VALUES(address), we_customer.address), address=IF(VALUES(address)=null and VALUES(address)='',we_customer.address,VALUES(address)),
phone=IF(we_customer.phone != null, VALUES(phone), we_customer.phone), phone=IF( VALUES(phone)=null and VALUES(phone)='', we_customer.phone, VALUES(phone)),
add_method=IF(we_customer.add_method != null, VALUES(add_method), we_customer.add_method); add_method=IF(VALUES(add_method),we_customer.add_method,VALUES(add_method)),
del_flag=IF(VALUES(del_flag), we_customer.del_flag, VALUES(del_flag)),
state=IF( VALUES(state)=null and VALUES(state)='', we_customer.state, VALUES(state));
</insert> </insert>
......
...@@ -72,11 +72,14 @@ ...@@ -72,11 +72,14 @@
<select id="customerMessagePushs" resultType="com.linkwechat.wecom.domain.vo.WeCustomerMessageResultVo"> <select id="customerMessagePushs" resultType="com.linkwechat.wecom.domain.vo.WeCustomerMessageResultVo">
SELECT SELECT
user_name, user_name,
GROUP_CONCAT(IFNULL(external_name,chat_name) SEPARATOR '、') customers GROUP_CONCAT(IFNULL(external_name,chat_name)) customers
FROM FROM
we_customer_messgaeResult we_customer_messgaeResult
<where> <where>
message_id=#{messageId} <if test="messageId !=null">
AND message_id=#{messageId}
</if>
<if test="status!=null"> <if test="status!=null">
AND `status`=#{status} AND `status`=#{status}
</if> </if>
......
...@@ -118,22 +118,37 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -118,22 +118,37 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</foreach> </foreach>
</update> </update>
<select id="getUserAddCustomerStat" parameterType="WeFlowerCustomerRel" resultType="java.util.HashMap"> <select id="getUserAddCustomerStat" resultType="java.util.HashMap">
select select
left(wfcr.first_add_time,10) as createTime , count(1) as total left(wfcr.create_time,10) as createTime , count(1) as total
from from
we_customer wfcr we_scan_emple_code_count wfcr
<where> <where>
<if test="userId != null and userId != ''">and wfcr.first_user_id = #{userId}</if> <if test="codeId != null and codeId != ''">and wfcr.emple_code_id = #{codeId}</if>
<if test="addWay != null and addWay != ''">and wfcr.add_method = #{addWay}</if>
<if test="beginTime != null and beginTime != ''"><!-- 开始时间检索 --> <if test="beginTime != null and beginTime != ''"><!-- 开始时间检索 -->
AND date_format(wfcr.first_add_time,'%y%m%d') &gt;= date_format(#{beginTime},'%y%m%d') AND date_format(wfcr.create_time,'%y%m%d') &gt;= date_format(#{beginTime},'%y%m%d')
</if> </if>
<if test="endTime != null and endTime != ''"><!-- 结束时间检索 --> <if test="endTime != null and endTime != ''"><!-- 结束时间检索 -->
AND date_format(wfcr.first_add_time,'%y%m%d') &lt;= date_format(#{endTime},'%y%m%d') AND date_format(wfcr.create_time,'%y%m%d') &lt;= date_format(#{endTime},'%y%m%d')
</if> </if>
</where> </where>
group by group by
left(wfcr.first_add_time,10) left(wfcr.create_time,10)
<!-- select-->
<!-- left(wfcr.first_add_time,10) as createTime , count(1) as total-->
<!-- from-->
<!-- we_customer wfcr-->
<!-- <where>-->
<!-- <if test="userId != null and userId != ''">and wfcr.first_user_id = #{userId}</if>-->
<!-- <if test="addWay != null and addWay != ''">and wfcr.add_method = #{addWay}</if>-->
<!-- <if test="beginTime != null and beginTime != ''">&lt;!&ndash; 开始时间检索 &ndash;&gt;-->
<!-- AND date_format(wfcr.first_add_time,'%y%m%d') &gt;= date_format(#{beginTime},'%y%m%d')-->
<!-- </if>-->
<!-- <if test="endTime != null and endTime != ''">&lt;!&ndash; 结束时间检索 &ndash;&gt;-->
<!-- AND date_format(wfcr.first_add_time,'%y%m%d') &lt;= date_format(#{endTime},'%y%m%d')-->
<!-- </if>-->
<!-- </where>-->
<!-- group by-->
<!-- left(wfcr.first_add_time,10)-->
</select> </select>
</mapper> </mapper>
\ No newline at end of file \ No newline at end of file
...@@ -85,7 +85,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -85,7 +85,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
ON DUPLICATE KEY UPDATE ON DUPLICATE KEY UPDATE
user_id=IF(we_flower_customer_tag_rel.user_id != null, VALUES(user_id), we_flower_customer_tag_rel.user_id), user_id=IF(we_flower_customer_tag_rel.user_id != null, VALUES(user_id), we_flower_customer_tag_rel.user_id),
external_userid=IF(we_flower_customer_tag_rel.external_userid != null, VALUES(external_userid), we_flower_customer_tag_rel.external_userid), external_userid=IF(we_flower_customer_tag_rel.external_userid != null, VALUES(external_userid), we_flower_customer_tag_rel.external_userid),
tag_id=IF(we_flower_customer_tag_rel.tag_id != null, VALUES(tag_id), we_flower_customer_tag_rel.tag_id); tag_id=IF(we_flower_customer_tag_rel.tag_id != null, VALUES(tag_id), we_flower_customer_tag_rel.tag_id),
create_time=IF(we_flower_customer_tag_rel.create_time != null, VALUES(create_time), we_flower_customer_tag_rel.create_time);
</insert> </insert>
</mapper> </mapper>
\ No newline at end of file \ No newline at end of file
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.linkwechat.wecom.mapper.WeScanEmpleCodeCountMapper">
</mapper>
\ No newline at end of file \ No newline at end of file
...@@ -156,11 +156,20 @@ ...@@ -156,11 +156,20 @@
wc.`name` as customerName, wc.`name` as customerName,
wu.user_name as takeUserName, wu.user_name as takeUserName,
wac.allocate_time, wac.allocate_time,
(SELECT GROUP_CONCAT(wd.`name`) FROM we_department wd WHERE wd.id=wu.department) as department (SELECT GROUP_CONCAT(wd.`name`) FROM we_department wd WHERE wd.id in (wu.department)) as department,
wc.avatar,
wc.birthday,
wc.gender,
GROUP_CONCAT(wt.`tag_id`) as tagIds,
GROUP_CONCAT(wt.`name`) as tagNames,
wu.user_name,
wc.first_add_time
FROM FROM
we_allocate_customer wac we_allocate_customer wac
LEFT JOIN we_customer wc ON wac.external_userid=wc.external_userid LEFT JOIN we_customer wc ON wac.external_userid=wc.external_userid and wac.takeover_userid=wc.first_user_id
LEFT JOIN we_user wu ON wu.user_id=wac.takeover_userid LEFT JOIN we_user wu ON wu.user_id=wac.takeover_userid
LEFT JOIN we_flower_customer_tag_rel wfctr ON wfctr.del_flag=0 AND wfctr.external_userid=wc.external_userid AND wfctr.user_id=wc.first_user_id
LEFT JOIN we_tag wt ON wt.tag_id=wfctr.tag_id
<where> <where>
<if test="handoverUserId != null and handoverUserId !=''">and wac.handover_userid=#{handoverUserId}</if> <if test="handoverUserId != null and handoverUserId !=''">and wac.handover_userid=#{handoverUserId}</if>
<if test="beginTime != null and beginTime !='' and endTime != null and endTime !=''"> <if test="beginTime != null and beginTime !='' and endTime != null and endTime !=''">
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
Target Server Version : 50718 Target Server Version : 50718
File Encoding : 65001 File Encoding : 65001
Date: 04/11/2021 18:03:23 Date: 12/11/2021 11:27:17
*/ */
SET NAMES utf8mb4; SET NAMES utf8mb4;
...@@ -557,7 +557,7 @@ CREATE TABLE `sys_job_log` ( ...@@ -557,7 +557,7 @@ CREATE TABLE `sys_job_log` (
`exception_info` varchar(2000) DEFAULT '' COMMENT '异常信息', `exception_info` varchar(2000) DEFAULT '' COMMENT '异常信息',
`create_time` datetime DEFAULT NULL COMMENT '创建时间', `create_time` datetime DEFAULT NULL COMMENT '创建时间',
PRIMARY KEY (`job_log_id`) PRIMARY KEY (`job_log_id`)
) ENGINE=InnoDB AUTO_INCREMENT=291556 DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='定时任务调度日志表'; ) ENGINE=InnoDB AUTO_INCREMENT=300608 DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='定时任务调度日志表';
-- ---------------------------- -- ----------------------------
-- Records of sys_job_log -- Records of sys_job_log
...@@ -580,7 +580,7 @@ CREATE TABLE `sys_logininfor` ( ...@@ -580,7 +580,7 @@ CREATE TABLE `sys_logininfor` (
`msg` varchar(255) DEFAULT '' COMMENT '提示消息', `msg` varchar(255) DEFAULT '' COMMENT '提示消息',
`login_time` datetime DEFAULT NULL COMMENT '访问时间', `login_time` datetime DEFAULT NULL COMMENT '访问时间',
PRIMARY KEY (`info_id`) PRIMARY KEY (`info_id`)
) ENGINE=InnoDB AUTO_INCREMENT=8272 DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='系统访问记录'; ) ENGINE=InnoDB AUTO_INCREMENT=9419 DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='系统访问记录';
-- ---------------------------- -- ----------------------------
-- Records of sys_logininfor -- Records of sys_logininfor
...@@ -611,7 +611,7 @@ CREATE TABLE `sys_menu` ( ...@@ -611,7 +611,7 @@ CREATE TABLE `sys_menu` (
`update_time` datetime DEFAULT NULL COMMENT '更新时间', `update_time` datetime DEFAULT NULL COMMENT '更新时间',
`remark` varchar(500) DEFAULT '' COMMENT '备注', `remark` varchar(500) DEFAULT '' COMMENT '备注',
PRIMARY KEY (`menu_id`) PRIMARY KEY (`menu_id`)
) ENGINE=InnoDB AUTO_INCREMENT=2189 DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='菜单权限表'; ) ENGINE=InnoDB AUTO_INCREMENT=2193 DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='菜单权限表';
-- ---------------------------- -- ----------------------------
-- Records of sys_menu -- Records of sys_menu
...@@ -919,7 +919,7 @@ CREATE TABLE `sys_oper_log` ( ...@@ -919,7 +919,7 @@ CREATE TABLE `sys_oper_log` (
`error_msg` varchar(2000) DEFAULT '' COMMENT '错误消息', `error_msg` varchar(2000) DEFAULT '' COMMENT '错误消息',
`oper_time` datetime DEFAULT NULL COMMENT '操作时间', `oper_time` datetime DEFAULT NULL COMMENT '操作时间',
PRIMARY KEY (`oper_id`) PRIMARY KEY (`oper_id`)
) ENGINE=InnoDB AUTO_INCREMENT=78978 DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='操作日志记录'; ) ENGINE=InnoDB AUTO_INCREMENT=90915 DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='操作日志记录';
-- ---------------------------- -- ----------------------------
-- Records of sys_oper_log -- Records of sys_oper_log
...@@ -1827,7 +1827,7 @@ CREATE TABLE `we_chat_contact_msg` ( ...@@ -1827,7 +1827,7 @@ CREATE TABLE `we_chat_contact_msg` (
`update_time` datetime DEFAULT NULL COMMENT '修改时间', `update_time` datetime DEFAULT NULL COMMENT '修改时间',
`del_flg` tinyint(4) NOT NULL DEFAULT '0' COMMENT '删除标识 0正常 1 删除', `del_flg` tinyint(4) NOT NULL DEFAULT '0' COMMENT '删除标识 0正常 1 删除',
PRIMARY KEY (`id`) PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=531 DEFAULT CHARSET=utf8 COMMENT='会话消息'; ) ENGINE=InnoDB AUTO_INCREMENT=604 DEFAULT CHARSET=utf8 COMMENT='会话消息';
-- ---------------------------- -- ----------------------------
-- Records of we_chat_contact_msg -- Records of we_chat_contact_msg
...@@ -1853,7 +1853,7 @@ CREATE TABLE `we_chat_contact_sensitive_msg` ( ...@@ -1853,7 +1853,7 @@ CREATE TABLE `we_chat_contact_sensitive_msg` (
`from_id` varchar(32) NOT NULL COMMENT '发送人id', `from_id` varchar(32) NOT NULL COMMENT '发送人id',
`msg_time` datetime NOT NULL COMMENT '发送时间', `msg_time` datetime NOT NULL COMMENT '发送时间',
PRIMARY KEY (`id`) PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=23 DEFAULT CHARSET=utf8mb4; ) ENGINE=InnoDB AUTO_INCREMENT=26 DEFAULT CHARSET=utf8mb4;
-- ---------------------------- -- ----------------------------
-- Records of we_chat_contact_sensitive_msg -- Records of we_chat_contact_sensitive_msg
...@@ -2047,7 +2047,7 @@ CREATE TABLE `we_customer` ( ...@@ -2047,7 +2047,7 @@ CREATE TABLE `we_customer` (
`update_time` datetime DEFAULT NULL, `update_time` datetime DEFAULT NULL,
`create_by` varchar(20) DEFAULT NULL, `create_by` varchar(20) DEFAULT NULL,
`update_by` varchar(20) DEFAULT NULL, `update_by` varchar(20) DEFAULT NULL,
`del_flag` tinyint(4) DEFAULT '0' COMMENT '删除标识 0 有效 1 删除', `del_flag` tinyint(1) unsigned zerofill DEFAULT '0' COMMENT '删除标识 0 有效 1 删除',
`first_user_id` varchar(32) NOT NULL COMMENT '添加人id', `first_user_id` varchar(32) NOT NULL COMMENT '添加人id',
`first_add_time` datetime DEFAULT NULL COMMENT '添加时间', `first_add_time` datetime DEFAULT NULL COMMENT '添加时间',
`track_state` tinyint(1) DEFAULT NULL COMMENT '1:待跟进;2:跟进中;3:已成交;4:无意向;5:已流失', `track_state` tinyint(1) DEFAULT NULL COMMENT '1:待跟进;2:跟进中;3:已成交;4:无意向;5:已流失',
...@@ -2058,8 +2058,9 @@ CREATE TABLE `we_customer` ( ...@@ -2058,8 +2058,9 @@ CREATE TABLE `we_customer` (
`qq` varchar(50) DEFAULT NULL COMMENT 'QQ号', `qq` varchar(50) DEFAULT NULL COMMENT 'QQ号',
`other_descr` varchar(1000) DEFAULT NULL COMMENT '其他描述', `other_descr` varchar(1000) DEFAULT NULL COMMENT '其他描述',
`address` varchar(300) DEFAULT NULL COMMENT '地址', `address` varchar(300) DEFAULT NULL COMMENT '地址',
`add_method` tinyint(1) DEFAULT NULL, `add_method` int(1) DEFAULT NULL,
`customer_type` tinyint(1) DEFAULT NULL, `customer_type` tinyint(1) DEFAULT NULL,
`state` varchar(30) DEFAULT NULL COMMENT '企业自定义的state参数,用于区分客户具体是通过哪个「联系我」添加,由企业通过创建「联系我」方式指定',
PRIMARY KEY (`external_userid`,`first_user_id`) USING BTREE PRIMARY KEY (`external_userid`,`first_user_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='企业微信客户表'; ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='企业微信客户表';
...@@ -2092,7 +2093,7 @@ CREATE TABLE `we_customer_message` ( ...@@ -2092,7 +2093,7 @@ CREATE TABLE `we_customer_message` (
`actual_send` int(11) DEFAULT '0' COMMENT '实际发送消息数(客户对应多少人 客户群对应多个群)', `actual_send` int(11) DEFAULT '0' COMMENT '实际发送消息数(客户对应多少人 客户群对应多个群)',
`timed_task` int(1) DEFAULT '0' COMMENT '是否定时任务 0 常规 1 定时发送', `timed_task` int(1) DEFAULT '0' COMMENT '是否定时任务 0 常规 1 定时发送',
PRIMARY KEY (`message_id`) PRIMARY KEY (`message_id`)
) ENGINE=InnoDB AUTO_INCREMENT=1456186544611266561 DEFAULT CHARSET=utf8mb4 COMMENT='群发消息 微信消息表'; ) ENGINE=InnoDB AUTO_INCREMENT=1458700848371732481 DEFAULT CHARSET=utf8mb4 COMMENT='群发消息 微信消息表';
-- ---------------------------- -- ----------------------------
-- Records of we_customer_message -- Records of we_customer_message
...@@ -2146,7 +2147,7 @@ CREATE TABLE `we_customer_messageTimeTask` ( ...@@ -2146,7 +2147,7 @@ CREATE TABLE `we_customer_messageTimeTask` (
`exce_msg` varchar(255) DEFAULT NULL COMMENT '群发异常消息', `exce_msg` varchar(255) DEFAULT NULL COMMENT '群发异常消息',
`del_flag` int(2) DEFAULT '0' COMMENT '0:正常;1:删除;', `del_flag` int(2) DEFAULT '0' COMMENT '0:正常;1:删除;',
PRIMARY KEY (`task_id`) PRIMARY KEY (`task_id`)
) ENGINE=InnoDB AUTO_INCREMENT=231 DEFAULT CHARSET=utf8; ) ENGINE=InnoDB AUTO_INCREMENT=249 DEFAULT CHARSET=utf8;
-- ---------------------------- -- ----------------------------
-- Records of we_customer_messageTimeTask -- Records of we_customer_messageTimeTask
...@@ -2502,7 +2503,7 @@ CREATE TABLE `we_group_member` ( ...@@ -2502,7 +2503,7 @@ CREATE TABLE `we_group_member` (
`del_flag` tinyint(4) NOT NULL DEFAULT '0' COMMENT '删除标识 0 正常 1 删除', `del_flag` tinyint(4) NOT NULL DEFAULT '0' COMMENT '删除标识 0 正常 1 删除',
PRIMARY KEY (`id`), PRIMARY KEY (`id`),
UNIQUE KEY `uindex_chatid_userid` (`chat_id`,`user_id`,`del_flag`) UNIQUE KEY `uindex_chatid_userid` (`chat_id`,`user_id`,`del_flag`)
) ENGINE=InnoDB AUTO_INCREMENT=1430003699749229163 DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='企业微信群成员'; ) ENGINE=InnoDB AUTO_INCREMENT=1430003699749235048 DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='企业微信群成员';
-- ---------------------------- -- ----------------------------
-- Records of we_group_member -- Records of we_group_member
...@@ -2639,6 +2640,7 @@ CREATE TABLE `we_group_message_template` ( ...@@ -2639,6 +2640,7 @@ CREATE TABLE `we_group_message_template` (
`filter_condition` varchar(2000) DEFAULT NULL COMMENT '条件筛选', `filter_condition` varchar(2000) DEFAULT NULL COMMENT '条件筛选',
`is_task` tinyint(4) DEFAULT '0' COMMENT '是否定时任务 0 立即发送 1 定时发送', `is_task` tinyint(4) DEFAULT '0' COMMENT '是否定时任务 0 立即发送 1 定时发送',
`status` tinyint(4) DEFAULT '0' COMMENT '是否执行 -1:失败 0:未执行 1:完成 2:取消', `status` tinyint(4) DEFAULT '0' COMMENT '是否执行 -1:失败 0:未执行 1:完成 2:取消',
`refresh_time` datetime DEFAULT NULL COMMENT '同步时间',
`create_by` varchar(64) NOT NULL DEFAULT '0' COMMENT '创建人', `create_by` varchar(64) NOT NULL DEFAULT '0' COMMENT '创建人',
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`update_by` varchar(64) DEFAULT '0' COMMENT '修改人', `update_by` varchar(64) DEFAULT '0' COMMENT '修改人',
...@@ -3108,6 +3110,25 @@ BEGIN; ...@@ -3108,6 +3110,25 @@ BEGIN;
COMMIT; COMMIT;
-- ---------------------------- -- ----------------------------
-- Table structure for we_scan_emple_code_count
-- ----------------------------
DROP TABLE IF EXISTS `we_scan_emple_code_count`;
CREATE TABLE `we_scan_emple_code_count` (
`id` bigint(20) NOT NULL COMMENT '主键',
`external_userid` varchar(32) DEFAULT NULL,
`user_id` varchar(32) DEFAULT NULL,
`create_time` datetime DEFAULT NULL,
`emple_code_id` bigint(20) DEFAULT NULL,
PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='扫描员工码,统计';
-- ----------------------------
-- Records of we_scan_emple_code_count
-- ----------------------------
BEGIN;
COMMIT;
-- ----------------------------
-- Table structure for we_sensitive -- Table structure for we_sensitive
-- ---------------------------- -- ----------------------------
DROP TABLE IF EXISTS `we_sensitive`; DROP TABLE IF EXISTS `we_sensitive`;
...@@ -3124,7 +3145,7 @@ CREATE TABLE `we_sensitive` ( ...@@ -3124,7 +3145,7 @@ CREATE TABLE `we_sensitive` (
`update_by` varchar(64) DEFAULT NULL COMMENT '更新人', `update_by` varchar(64) DEFAULT NULL COMMENT '更新人',
`update_time` datetime DEFAULT NULL COMMENT '更新时间', `update_time` datetime DEFAULT NULL COMMENT '更新时间',
PRIMARY KEY (`id`) PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=54 DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='敏感词设置表'; ) ENGINE=InnoDB AUTO_INCREMENT=57 DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='敏感词设置表';
-- ---------------------------- -- ----------------------------
-- Records of we_sensitive -- Records of we_sensitive
...@@ -3192,7 +3213,7 @@ CREATE TABLE `we_sensitive_audit_scope` ( ...@@ -3192,7 +3213,7 @@ CREATE TABLE `we_sensitive_audit_scope` (
`audit_scope_id` varchar(64) NOT NULL COMMENT '审计对象id', `audit_scope_id` varchar(64) NOT NULL COMMENT '审计对象id',
`audit_scope_name` varchar(64) NOT NULL COMMENT '审计对象名称', `audit_scope_name` varchar(64) NOT NULL COMMENT '审计对象名称',
PRIMARY KEY (`id`) PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=71 DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='敏感词审计范围'; ) ENGINE=InnoDB AUTO_INCREMENT=74 DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='敏感词审计范围';
-- ---------------------------- -- ----------------------------
-- Records of we_sensitive_audit_scope -- Records of we_sensitive_audit_scope
...@@ -3275,7 +3296,7 @@ CREATE TABLE `we_task_fission` ( ...@@ -3275,7 +3296,7 @@ CREATE TABLE `we_task_fission` (
`update_by` varchar(100) DEFAULT NULL COMMENT '更新人', `update_by` varchar(100) DEFAULT NULL COMMENT '更新人',
`update_time` datetime DEFAULT NULL COMMENT '更新时间', `update_time` datetime DEFAULT NULL COMMENT '更新时间',
PRIMARY KEY (`id`) PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=175 DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='任务宝表'; ) ENGINE=InnoDB AUTO_INCREMENT=186 DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='任务宝表';
-- ---------------------------- -- ----------------------------
-- Records of we_task_fission -- Records of we_task_fission
...@@ -3320,7 +3341,7 @@ CREATE TABLE `we_task_fission_record` ( ...@@ -3320,7 +3341,7 @@ CREATE TABLE `we_task_fission_record` (
`complete_time` datetime DEFAULT NULL COMMENT '完成时间', `complete_time` datetime DEFAULT NULL COMMENT '完成时间',
`poster` varchar(500) DEFAULT NULL COMMENT '海报链接', `poster` varchar(500) DEFAULT NULL COMMENT '海报链接',
PRIMARY KEY (`id`) PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=276 DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='裂变任务记录'; ) ENGINE=InnoDB AUTO_INCREMENT=282 DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='裂变任务记录';
-- ---------------------------- -- ----------------------------
-- Records of we_task_fission_record -- Records of we_task_fission_record
...@@ -3363,7 +3384,7 @@ CREATE TABLE `we_task_fission_staff` ( ...@@ -3363,7 +3384,7 @@ CREATE TABLE `we_task_fission_staff` (
`staff_id` varchar(64) DEFAULT NULL COMMENT '员工或组织机构id,为全部时为空', `staff_id` varchar(64) DEFAULT NULL COMMENT '员工或组织机构id,为全部时为空',
`staff_name` varchar(100) DEFAULT NULL COMMENT '员工或组织机构姓名,类型为全部时,为空', `staff_name` varchar(100) DEFAULT NULL COMMENT '员工或组织机构姓名,类型为全部时,为空',
PRIMARY KEY (`id`) PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=212 DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='裂变任务员工列表'; ) ENGINE=InnoDB AUTO_INCREMENT=230 DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='裂变任务员工列表';
-- ---------------------------- -- ----------------------------
-- Records of we_task_fission_staff -- Records of we_task_fission_staff
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!