Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
江名洋
/
linkwe-scrm
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 8e0c5fb1
authored
Feb 20, 2021
by
danmo
Browse Files
Options
Browse Files
Tag
Download
Plain Diff
Merge remote-tracking branch 'origin/back_end_dev' into back_end_dev
2 parents
77d617d9
e4d3f37e
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
285 additions
and
9 deletions
linkwe-admin/src/main/java/com/linkwechat/web/controller/wecom/WeCommunityNewGroupController.java
linkwe-wecom/src/main/java/com/linkwechat/wecom/domain/WeCommunityNewGroup.java
linkwe-wecom/src/main/java/com/linkwechat/wecom/domain/dto/WeCommunityNewGroupDto.java
linkwe-wecom/src/main/java/com/linkwechat/wecom/mapper/WeCommunityNewGroupMapper.java
linkwe-wecom/src/main/java/com/linkwechat/wecom/mapper/WeCustomerMessgaeResultMapper.java
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/IWeCommunityNewGroupService.java
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/impl/WeCommunityNewGroupServiceImpl.java
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/impl/WeCustomerMessagePushServiceImpl.java
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/impl/WeCustomerMessgaeResultServiceImpl.java
linkwe-wecom/src/main/resources/mapper/wecom/WeCommunityNewGroupMapper.xml
linkwe-wecom/src/main/resources/mapper/wecom/WeCustomerMessgaeResultMapper.xml
linkwe-wecom/src/main/resources/mapper/wecom/WeTaskFissionRecordMapper.xml
linkwe-admin/src/main/java/com/linkwechat/web/controller/wecom/WeCommunityNewGroupController.java
0 → 100644
View file @
8e0c5fb
package
com
.
linkwechat
.
web
.
controller
.
wecom
;
import
com.linkwechat.common.annotation.Log
;
import
com.linkwechat.common.core.domain.AjaxResult
;
import
com.linkwechat.common.enums.BusinessType
;
import
com.linkwechat.common.exception.wecom.WeComException
;
import
com.linkwechat.wecom.domain.dto.WeCommunityNewGroupDto
;
import
com.linkwechat.wecom.service.IWeCommunityNewGroupService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.security.access.prepost.PreAuthorize
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
/**
* 社群运营 新客自动拉群 Controller
*
* @author kewen
* @date 2021-02-19
*/
@Controller
@RequestMapping
(
value
=
"communityNewGroup"
)
public
class
WeCommunityNewGroupController
{
@Autowired
private
IWeCommunityNewGroupService
weCommunityNewGroupService
;
/**
* 新增员工活码
*/
@PreAuthorize
(
"@ss.hasPermi('wecom:communityNewGroup:add')"
)
@Log
(
title
=
"新客自动拉群"
,
businessType
=
BusinessType
.
INSERT
)
@PostMapping
(
"/add"
)
public
AjaxResult
add
(
@RequestBody
@Validated
WeCommunityNewGroupDto
communityNewGroupDto
)
{
try
{
weCommunityNewGroupService
.
add
(
communityNewGroupDto
);
return
AjaxResult
.
success
();
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
if
(
e
instanceof
WeComException
){
return
AjaxResult
.
error
(
e
.
getMessage
());
}
else
{
return
AjaxResult
.
error
(
"请求接口异常!"
);
}
}
}
}
linkwe-wecom/src/main/java/com/linkwechat/wecom/domain/WeCommunityNewGroup.java
0 → 100644
View file @
8e0c5fb
package
com
.
linkwechat
.
wecom
.
domain
;
import
com.linkwechat.common.core.domain.BaseEntity
;
import
lombok.Data
;
/**
* 社群运营 新客自动拉群
*
* @author kewen
* @date 2021-02-19
*/
@Data
public
class
WeCommunityNewGroup
extends
BaseEntity
{
/**
*主键ID
*/
private
Long
newGroupId
;
/**
*员工活码ID
*/
private
Long
empleCodeId
;
/**
* 员工活码名称
*/
private
Long
empleCodeName
;
/**
* 群活码ID
*/
private
Long
groupCodeId
;
/**
* 0 未删除 1 已删除
*/
private
int
delFlag
;
}
linkwe-wecom/src/main/java/com/linkwechat/wecom/domain/dto/WeCommunityNewGroupDto.java
0 → 100644
View file @
8e0c5fb
package
com
.
linkwechat
.
wecom
.
domain
.
dto
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.linkwechat.wecom.domain.WeEmpleCodeTag
;
import
com.linkwechat.wecom.domain.WeEmpleCodeUseScop
;
import
lombok.Data
;
import
javax.validation.constraints.NotEmpty
;
import
java.util.List
;
/**
* 社群运营 新客自动拉群
*
* @author kewen
* @date 2021-02-19
*/
@Data
public
class
WeCommunityNewGroupDto
{
/**
* 活动场景
*/
private
String
activityScene
;
/**
* 欢迎语
*/
private
String
welcomeMsg
;
@NotEmpty
(
message
=
"员工信息不能为空"
)
/** 使用员工 */
@TableField
(
exist
=
false
)
private
List
<
WeEmpleCodeUseScop
>
weEmpleCodeUseScops
;
/**
* 扫码标签
*/
@TableField
(
exist
=
false
)
private
List
<
WeEmpleCodeTag
>
weEmpleCodeTags
;
/**
* 群活码ID
*/
private
Long
groupCodeId
;
/**
* 客户添加时无需经过确认自动成为好友:1:是;0:否
*/
private
Boolean
isJoinConfirmFriends
;
}
linkwe-wecom/src/main/java/com/linkwechat/wecom/mapper/WeCommunityNewGroupMapper.java
0 → 100644
View file @
8e0c5fb
package
com
.
linkwechat
.
wecom
.
mapper
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.linkwechat.wecom.domain.WeCommunityNewGroup
;
/**
* 社群运营 新客自动拉群 mapper接口
*
* @author kewen
* @date 2021-02-19
*/
public
interface
WeCommunityNewGroupMapper
extends
BaseMapper
<
WeCommunityNewGroup
>
{
}
linkwe-wecom/src/main/java/com/linkwechat/wecom/mapper/WeCustomerMessgaeResultMapper.java
View file @
8e0c5fb
...
...
@@ -45,4 +45,13 @@ public interface WeCustomerMessgaeResultMapper extends BaseMapper<WeCustomerMess
* @return 已发送消息数
*/
int
checkSendStatus
(
@Param
(
"messageId"
)
Long
messageId
);
/**
* 批量保存映射关系
*
* @param weCustomerMessgaeResults 映射关系列表信息
* @return int 结果
*/
int
batchInsert
(
@Param
(
"customers"
)
List
<
WeCustomerMessgaeResult
>
weCustomerMessgaeResults
);
}
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/IWeCommunityNewGroupService.java
0 → 100644
View file @
8e0c5fb
package
com
.
linkwechat
.
wecom
.
service
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.linkwechat.wecom.domain.WeCommunityNewGroup
;
import
com.linkwechat.wecom.domain.dto.WeCommunityNewGroupDto
;
/**
* 社群运营 新客自动拉群
*
* @author kewen
* @date 2021-02-19
*/
public
interface
IWeCommunityNewGroupService
extends
IService
<
WeCommunityNewGroup
>
{
/**
* 添加新客自动拉群信息
*
* @param communityNewGroupDto 信息
* @return 结果
*/
int
add
(
WeCommunityNewGroupDto
communityNewGroupDto
);
}
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/impl/WeCommunityNewGroupServiceImpl.java
0 → 100644
View file @
8e0c5fb
package
com
.
linkwechat
.
wecom
.
service
.
impl
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.linkwechat.wecom.domain.WeCommunityNewGroup
;
import
com.linkwechat.wecom.domain.dto.WeCommunityNewGroupDto
;
import
com.linkwechat.wecom.mapper.WeCommunityNewGroupMapper
;
import
com.linkwechat.wecom.service.IWeCommunityNewGroupService
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.stereotype.Service
;
/**
* 社群运营 新客自动拉群
*
* @author kewen
* @date 2021-02-19
*/
@Service
@Slf4j
public
class
WeCommunityNewGroupServiceImpl
extends
ServiceImpl
<
WeCommunityNewGroupMapper
,
WeCommunityNewGroup
>
implements
IWeCommunityNewGroupService
{
@Override
public
int
add
(
WeCommunityNewGroupDto
communityNewGroupDto
)
{
//检查群活码是否存在
//生成员工活码信息
//保存新客自动拉群信息
return
0
;
}
}
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/impl/WeCustomerMessagePushServiceImpl.java
View file @
8e0c5fb
...
...
@@ -92,7 +92,7 @@ public class WeCustomerMessagePushServiceImpl implements IWeCustomerMessagePushS
}
}
//
0
发给客户群
//
1
发给客户群
if
(
customerMessagePushDto
.
getPushType
().
equals
(
WeConstans
.
SEND_MESSAGE_GROUP
))
{
if
(
customerMessagePushDto
.
getStaffId
()
==
null
||
customerMessagePushDto
.
getStaffId
().
equals
(
""
))
{
...
...
@@ -124,9 +124,6 @@ public class WeCustomerMessagePushServiceImpl implements IWeCustomerMessagePushS
//保存分类消息信息
weCustomerSeedMessageService
.
saveSeedMessage
(
customerMessagePushDto
,
messageId
);
log
.
info
(
"消息发送信息:{}"
,
JSONUtil
.
toJsonStr
(
customerMessagePushDto
));
CustomerMessagePushDto
customerMessagePushDto1
=
JSONUtil
.
toBean
(
JSONUtil
.
parseObj
(
JSONUtil
.
toJsonStr
(
customerMessagePushDto
)),
CustomerMessagePushDto
.
class
);
//发送群发消息
//调用微信api发送消息
if
(
null
==
customerMessagePushDto
.
getSettingTime
()
||
customerMessagePushDto
.
getSettingTime
().
equals
(
""
))
{
...
...
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/impl/WeCustomerMessgaeResultServiceImpl.java
View file @
8e0c5fb
...
...
@@ -2,6 +2,7 @@ package com.linkwechat.wecom.service.impl;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.google.common.collect.Lists
;
import
com.linkwechat.common.constant.WeConstans
;
import
com.linkwechat.common.utils.SnowFlakeUtil
;
import
com.linkwechat.wecom.domain.WeCustomer
;
import
com.linkwechat.wecom.domain.WeCustomerMessgaeResult
;
...
...
@@ -39,9 +40,12 @@ public class WeCustomerMessgaeResultServiceImpl extends ServiceImpl<WeCustomerMe
int
size
=
0
;
// 0 发给客户
if
(
customerMessagePushDto
.
getPushType
().
equals
(
"0"
))
{
if
(
customerMessagePushDto
.
getPushType
().
equals
(
WeConstans
.
SEND_MESSAGE_CUSTOMER
))
{
if
(
CollectionUtils
.
isNotEmpty
(
customers
))
{
List
<
WeCustomerMessgaeResult
>
weCustomerMessgaeResults
=
Lists
.
newArrayList
();
size
=
customers
.
size
();
customers
.
forEach
(
customer
->
{
//微信消息发送结果、保存员工客户关系映射关系数据
...
...
@@ -58,15 +62,17 @@ public class WeCustomerMessgaeResultServiceImpl extends ServiceImpl<WeCustomerMe
customerMessgaeResult
.
setStatus
(
"0"
);
customerMessgaeResult
.
setSettingTime
(
customerMessagePushDto
.
getSettingTime
());
customerMessgaeResult
.
setDelFlag
(
0
);
this
.
save
(
customerMessgaeResult
);
weCustomerMessgaeResults
.
add
(
customerMessgaeResult
);
});
customerMessgaeResultMapper
.
batchInsert
(
weCustomerMessgaeResults
);
}
}
// 1 发给客户群
if
(
customerMessagePushDto
.
getPushType
().
equals
(
"1"
))
{
if
(
customerMessagePushDto
.
getPushType
().
equals
(
WeConstans
.
SEND_MESSAGE_GROUP
))
{
if
(
CollectionUtils
.
isNotEmpty
(
groups
))
{
List
<
WeCustomerMessgaeResult
>
weCustomerMessgaeResults
=
Lists
.
newArrayList
();
size
=
groups
.
size
();
groups
.
forEach
(
group
->
{
//微信消息发送结果、保存员工客户关系映射关系数据
...
...
@@ -84,8 +90,9 @@ public class WeCustomerMessgaeResultServiceImpl extends ServiceImpl<WeCustomerMe
//群管理员名称
customerMessgaeResult
.
setUserName
(
group
.
getGroupLeaderName
());
customerMessgaeResult
.
setDelFlag
(
0
);
this
.
save
(
customerMessgaeResult
);
weCustomerMessgaeResults
.
add
(
customerMessgaeResult
);
});
customerMessgaeResultMapper
.
batchInsert
(
weCustomerMessgaeResults
);
}
}
...
...
linkwe-wecom/src/main/resources/mapper/wecom/WeCommunityNewGroupMapper.xml
0 → 100644
View file @
8e0c5fb
<?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.WeCommunityNewGroupMapper"
>
</mapper>
\ No newline at end of file
linkwe-wecom/src/main/resources/mapper/wecom/WeCustomerMessgaeResultMapper.xml
View file @
8e0c5fb
...
...
@@ -3,6 +3,49 @@
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.linkwechat.wecom.mapper.WeCustomerMessgaeResultMapper"
>
<insert
id=
"batchInsert"
>
INSERT INTO we_customer_messgaeResult (
messgae_result_id,
message_id,
external_userid,
chat_id,
userid,
`status`,
send_time,
external_name,
user_name,
send_type,
setting_time,
create_by,
create_time,
update_by,
update_time,
del_flag,
chat_name
)
VALUES
<foreach
collection=
"list"
item=
"item"
separator=
","
index=
"index"
>
(#{item.messgaeResultId},
#{item.messageId},
#{item.externalUserid},
#{item.chatId},
#{item.userid},
#{item.status},
#{item.sendTime},
#{item.externalName},
#{item.userName},
#{item.sendType},
#{item.settingTime},
#{item.createBy},
#{item.createTime},
#{item.updateBy},
#{item.updateTime},
#{item.delFlag},
#{item.chatName})
</foreach>
</insert>
<update
id=
"updateWeCustomerMessgaeResult"
>
UPDATE we_customer_messgaeResult
<set>
...
...
linkwe-wecom/src/main/resources/mapper/wecom/WeTaskFissionRecordMapper.xml
View file @
8e0c5fb
...
...
@@ -2,7 +2,7 @@
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.
ruoyi.syste
m.mapper.WeTaskFissionRecordMapper"
>
<mapper
namespace=
"com.
linkwechat.weco
m.mapper.WeTaskFissionRecordMapper"
>
<resultMap
type=
"WeTaskFissionRecord"
id=
"WeTaskFissionRecordResult"
>
<result
property=
"id"
column=
"id"
/>
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment