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 0cc17d7e
authored
Apr 01, 2021
by
水库浪子
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
修改群发相关BUG
1 parent
efd77407
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
36 additions
and
10 deletions
linkwe-admin/src/main/java/com/linkwechat/web/controller/wecom/WeMaterialController.java
linkwe-framework/src/main/java/com/linkwechat/framework/config/SecurityConfig.java
linkwe-wecom/src/main/java/com/linkwechat/wecom/domain/dto/TemporaryMaterialDto.java
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/impl/WeCustomerMessagePushServiceImpl.java
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/impl/WeCustomerMessageServiceImpl.java
linkwe-admin/src/main/java/com/linkwechat/web/controller/wecom/WeMaterialController.java
View file @
0cc17d7
...
...
@@ -8,6 +8,7 @@ import com.linkwechat.common.enums.BusinessType;
import
com.linkwechat.common.enums.MediaType
;
import
com.linkwechat.wecom.domain.WeMaterial
;
import
com.linkwechat.wecom.domain.dto.ResetCategoryDto
;
import
com.linkwechat.wecom.domain.dto.TemporaryMaterialDto
;
import
com.linkwechat.wecom.domain.dto.WeMediaDto
;
import
com.linkwechat.wecom.domain.vo.WeMaterialFileVO
;
import
com.linkwechat.wecom.service.IWeMaterialService
;
...
...
@@ -135,10 +136,12 @@ public class WeMaterialController extends BaseController {
//@PreAuthorize("@ss.hasPermi('wechat:material:temporaryMaterialMediaId')")
@Log
(
title
=
"获取素材media_id"
,
businessType
=
BusinessType
.
OTHER
)
@
Ge
tMapping
(
"/temporaryMaterialMediaId"
)
@
Pos
tMapping
(
"/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
);
public
AjaxResult
temporaryMaterialMediaId
(
@RequestBody
TemporaryMaterialDto
temporaryMaterialDto
){
WeMediaDto
weMediaDto
=
materialService
.
uploadTemporaryMaterial
(
temporaryMaterialDto
.
getUrl
(),
temporaryMaterialDto
.
getType
()
,
temporaryMaterialDto
.
getName
());
return
AjaxResult
.
success
(
weMediaDto
);
}
...
...
linkwe-framework/src/main/java/com/linkwechat/framework/config/SecurityConfig.java
View file @
0cc17d7
...
...
@@ -121,8 +121,8 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter {
.
antMatchers
(
"/wecom/ticket/**"
).
anonymous
()
.
antMatchers
(
"/wecom/user/getUserInfo"
).
anonymous
()
// .antMatchers("/common/uploadFile2Cos").anonymous()
.
antMatchers
(
"/wecom/material/temporaryMaterialMediaId"
).
anonymous
()
// .antMatchers("/common/uploadFile2Cos").anonymous()
//
.antMatchers("/wecom/material/temporaryMaterialMediaId").anonymous()
.
antMatchers
(
"/wecom/portrait/**"
).
anonymous
()
.
antMatchers
(
"/wecom/fission/poster"
,
"/wecom/fission/*/progress/*"
).
anonymous
()
// 获取实际群活码和社群运营H5页面不需要登录
...
...
linkwe-wecom/src/main/java/com/linkwechat/wecom/domain/dto/TemporaryMaterialDto.java
0 → 100644
View file @
0cc17d7
package
com
.
linkwechat
.
wecom
.
domain
.
dto
;
import
lombok.Data
;
/**
* @description: 群发参数相关
* @author: HaoN
* @create: 2021-03-31 17:20
**/
@Data
public
class
TemporaryMaterialDto
{
private
String
url
;
private
String
type
;
private
String
name
;
}
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/impl/WeCustomerMessagePushServiceImpl.java
View file @
0cc17d7
package
com
.
linkwechat
.
wecom
.
service
.
impl
;
import
cn.hutool.core.date.DateUtil
;
import
cn.hutool.core.util.StrUtil
;
import
com.fasterxml.jackson.core.JsonProcessingException
;
import
com.fasterxml.jackson.databind.ObjectMapper
;
import
com.google.common.collect.Lists
;
...
...
@@ -70,14 +71,20 @@ public class WeCustomerMessagePushServiceImpl implements IWeCustomerMessagePushS
private
WeCustomerMessageTimeTaskMapper
customerMessageTimeTaskMapper
;
@Override
@Transactional
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
void
addWeCustomerMessagePush
(
CustomerMessagePushDto
customerMessagePushDto
)
throws
JsonProcessingException
,
ParseException
{
if
((
null
!=
customerMessagePushDto
.
getSettingTime
()
&&
!
""
.
equals
(
customerMessagePushDto
.
getSettingTime
()))
&&
DateUtils
.
diffTime
(
new
Date
(),
DateUtil
.
parse
(
customerMessagePushDto
.
getSettingTime
(),
"yyyy-MM-dd HH:mm:ss"
))
>
0
)
{
throw
new
WeComException
(
"发送时间不能小于当前时间"
);
// if ((null != customerMessagePushDto.getSettingTime() && !"".equals(customerMessagePushDto.getSettingTime()))
// && DateUtils.diffTime(new Date(), DateUtil.parse(customerMessagePushDto.getSettingTime(), "yyyy-MM-dd HH:mm")) > 0) {
// throw new WeComException("发送时间不能小于当前时间");
// }
if
(
StrUtil
.
isBlank
(
customerMessagePushDto
.
getSettingTime
())){
throw
new
WeComException
(
"发送时间不能为空"
);
}
List
<
WeCustomer
>
customers
=
Lists
.
newArrayList
();
List
<
WeGroup
>
groups
=
new
ArrayList
<>();
// 0 发给客户
...
...
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/impl/WeCustomerMessageServiceImpl.java
View file @
0cc17d7
...
...
@@ -148,7 +148,8 @@ public class WeCustomerMessageServiceImpl extends ServiceImpl<WeCustomerMessageM
weCustomerMessagePushDto
.
setText
(
customerMessagePushDto
.
getTextMessage
());
}
if
(
customerMessagePushDto
.
getMessageType
().
equals
(
GroupMessageType
.
IMAGE
.
getMessageType
()))
{
if
(
customerMessagePushDto
.
getMessageType
().
equals
(
GroupMessageType
.
IMAGE
.
getType
()))
{
weCustomerMessagePushDto
.
setImage
(
customerMessagePushDto
.
getImageMessage
());
weCustomerMessagePushDto
.
setLink
(
null
);
weCustomerMessagePushDto
.
setMiniprogram
(
null
);
...
...
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