Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
scrm
/
rop-scrm-entmicro
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 62b4033d
authored
Feb 06, 2026
by
叶立庆
Browse Files
Options
Browse Files
Tag
Download
Plain Diff
Merge branch 'v5.6.1' into 'master'
上线合并 See merge request
!1
2 parents
3de084f5
ac9c1368
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
101 additions
and
1 deletions
src/main/java/cn/com/glsx/entmicro/controller/wechatcloudcontrol/BatchMessagingController.java
src/main/java/cn/com/glsx/entmicro/response/entmicromerchant/GroupItemResponse.java
src/main/java/cn/com/glsx/entmicro/service/wechatcloudcontrol/BatchMessagingService.java
src/main/java/cn/com/glsx/entmicro/utils/RopHttpUtil.java
src/main/java/cn/com/glsx/entmicro/controller/wechatcloudcontrol/BatchMessagingController.java
View file @
62b4033
...
@@ -20,7 +20,9 @@ import com.rop.annotation.ServiceMethodBean;
...
@@ -20,7 +20,9 @@ import com.rop.annotation.ServiceMethodBean;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiOperation
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.core.env.Environment
;
import
javax.annotation.Resource
;
import
javax.annotation.Resource
;
import
java.util.List
;
import
java.util.List
;
...
@@ -42,6 +44,9 @@ public class BatchMessagingController {
...
@@ -42,6 +44,9 @@ public class BatchMessagingController {
@Autowired
@Autowired
private
GroupRemote
groupRemote
;
private
GroupRemote
groupRemote
;
@Autowired
private
Environment
env
;
@ServiceMethod
(
method
=
"entmicro.api.wechatcloudcontrol.nosession.batchmessaging.create"
,
needInSession
=
NeedInSessionType
.
NO
)
@ServiceMethod
(
method
=
"entmicro.api.wechatcloudcontrol.nosession.batchmessaging.create"
,
needInSession
=
NeedInSessionType
.
NO
)
@ApiOperation
(
"企微高级群发任务创建"
)
@ApiOperation
(
"企微高级群发任务创建"
)
public
RopResponse
<
Boolean
>
createBatchMessagingNoSessionTask
(
BatchMessagingCreateRopRequest
request
)
{
public
RopResponse
<
Boolean
>
createBatchMessagingNoSessionTask
(
BatchMessagingCreateRopRequest
request
)
{
...
@@ -156,7 +161,15 @@ public class BatchMessagingController {
...
@@ -156,7 +161,15 @@ public class BatchMessagingController {
@ApiOperation
(
"查询worktool群列表"
)
@ApiOperation
(
"查询worktool群列表"
)
public
RopResponse
<
RpcResponse
<
List
<
ScrmWorktoolGroupResponse
>>>
worktoolGroupList
(
WorkToolGroupListRopRequest
workToolGroupListRopRequest
)
{
public
RopResponse
<
RpcResponse
<
List
<
ScrmWorktoolGroupResponse
>>>
worktoolGroupList
(
WorkToolGroupListRopRequest
workToolGroupListRopRequest
)
{
try
{
try
{
return
RopResponse
.
success
(
groupRemote
.
groupList
(
workToolGroupListRopRequest
.
getCloudId
()));
RpcResponse
<
List
<
ScrmWorktoolGroupResponse
>>
groupResponse
;
// 查询新版本喜报配置是否开启
String
switchOpen
=
env
.
getProperty
(
"dj.new.report.group.push.switch"
);
if
(
StringUtils
.
isNotEmpty
(
switchOpen
)
&&
"1"
.
equals
(
switchOpen
)){
groupResponse
=
batchMessagingService
.
getNewReportGroupList
();
}
else
{
groupResponse
=
groupRemote
.
groupList
(
workToolGroupListRopRequest
.
getCloudId
());
}
return
RopResponse
.
success
(
groupResponse
);
}
catch
(
RpcServiceException
e
)
{
}
catch
(
RpcServiceException
e
)
{
log
.
info
(
"=======BatchMessagingController_getActivityReportLogPage_invoke__exception:{}"
,
e
.
getMessage
());
log
.
info
(
"=======BatchMessagingController_getActivityReportLogPage_invoke__exception:{}"
,
e
.
getMessage
());
return
RopResponse
.
error
(
e
.
getErrId
(),
e
.
getMessage
());
return
RopResponse
.
error
(
e
.
getErrId
(),
e
.
getMessage
());
...
...
src/main/java/cn/com/glsx/entmicro/response/entmicromerchant/GroupItemResponse.java
0 → 100644
View file @
62b4033
package
cn
.
com
.
glsx
.
entmicro
.
response
.
entmicromerchant
;
import
com.fasterxml.jackson.annotation.JsonProperty
;
import
lombok.Data
;
/**
* 接收群列表API响应的数据
*/
@Data
public
class
GroupItemResponse
{
@JsonProperty
(
"group_name"
)
private
String
groupName
;
@JsonProperty
(
"group_remark"
)
private
String
groupRemark
;
}
src/main/java/cn/com/glsx/entmicro/service/wechatcloudcontrol/BatchMessagingService.java
View file @
62b4033
...
@@ -21,8 +21,14 @@ import cn.com.glsx.entmicro.response.wechatcloudcontrol.batchmessaging.BatchMess
...
@@ -21,8 +21,14 @@ import cn.com.glsx.entmicro.response.wechatcloudcontrol.batchmessaging.BatchMess
import
cn.com.glsx.entmicro.utils.Pagination
;
import
cn.com.glsx.entmicro.utils.Pagination
;
import
cn.com.glsx.framework.core.beans.rpc.RpcPagination
;
import
cn.com.glsx.framework.core.beans.rpc.RpcPagination
;
import
cn.com.glsx.framework.core.beans.rpc.RpcResponse
;
import
cn.com.glsx.framework.core.beans.rpc.RpcResponse
;
import
cn.com.glsx.framework.core.enums.DefaultErrorEnum
;
import
cn.com.glsx.framework.core.exception.RpcServiceException
;
import
cn.com.glsx.framework.core.exception.RpcServiceException
;
import
cn.com.glsx.entmicro.utils.RopHttpUtil
;
import
cn.com.glsx.worktool.model.response.ScrmWorktoolGroupResponse
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.core.env.Environment
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
javax.annotation.Resource
;
import
javax.annotation.Resource
;
...
@@ -41,6 +47,9 @@ public class BatchMessagingService {
...
@@ -41,6 +47,9 @@ public class BatchMessagingService {
@Resource
@Resource
private
BatchMessagingRemote
batchMessagingRemote
;
private
BatchMessagingRemote
batchMessagingRemote
;
@Autowired
private
Environment
env
;
/**
/**
* 企微高级群发任务创建
* 企微高级群发任务创建
* @param ropRequest
* @param ropRequest
...
@@ -151,4 +160,23 @@ public class BatchMessagingService {
...
@@ -151,4 +160,23 @@ public class BatchMessagingService {
}
}
throw
new
RpcServiceException
(
response
.
getError
(),
response
.
getMessage
());
throw
new
RpcServiceException
(
response
.
getError
(),
response
.
getMessage
());
}
}
public
RpcResponse
<
List
<
ScrmWorktoolGroupResponse
>>
getNewReportGroupList
()
{
// 获取请求url
String
requestUrl
=
env
.
getProperty
(
"dj.new.report.group.push.url"
);
if
(
StringUtils
.
isBlank
(
requestUrl
))
{
log
.
error
(
"新版群推送url配置为空"
);
return
RpcResponse
.
error
(
DefaultErrorEnum
.
SERVICE_ERROR
,
"新版群推送url配置为空"
);
}
log
.
info
(
"requestUrl:{}"
,
requestUrl
);
try
{
// 获取群列表
List
<
ScrmWorktoolGroupResponse
>
groupList
=
RopHttpUtil
.
getGroupList
(
requestUrl
);
return
RpcResponse
.
success
(
groupList
);
}
catch
(
Exception
e
)
{
log
.
error
(
"获取群列表失败"
,
e
);
return
RpcResponse
.
error
(
DefaultErrorEnum
.
SERVICE_ERROR
,
"获取群列表失败: "
+
e
.
getMessage
());
}
}
}
}
src/main/java/cn/com/glsx/entmicro/utils/RopHttpUtil.java
View file @
62b4033
package
cn
.
com
.
glsx
.
entmicro
.
utils
;
package
cn
.
com
.
glsx
.
entmicro
.
utils
;
import
cn.com.glsx.entmicro.response.entmicromerchant.GroupItemResponse
;
import
cn.com.glsx.worktool.model.response.ScrmWorktoolGroupResponse
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang.StringUtils
;
import
org.apache.commons.lang.StringUtils
;
import
org.springframework.util.LinkedMultiValueMap
;
import
org.springframework.util.LinkedMultiValueMap
;
import
org.springframework.util.MultiValueMap
;
import
org.springframework.util.MultiValueMap
;
...
@@ -8,6 +11,8 @@ import org.springframework.web.util.DefaultUriBuilderFactory;
...
@@ -8,6 +11,8 @@ import org.springframework.web.util.DefaultUriBuilderFactory;
import
org.springframework.web.util.UriBuilder
;
import
org.springframework.web.util.UriBuilder
;
import
java.net.URI
;
import
java.net.URI
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
import
java.util.Map.Entry
;
import
java.util.Map.Entry
;
...
@@ -17,6 +22,7 @@ import java.util.Map.Entry;
...
@@ -17,6 +22,7 @@ import java.util.Map.Entry;
* @description: http调用rop端服务
* @description: http调用rop端服务
* @date 2021/7/30 11:26
* @date 2021/7/30 11:26
*/
*/
@Slf4j
public
class
RopHttpUtil
{
public
class
RopHttpUtil
{
private
final
static
String
appKey
=
"48e5e13229b82c1b4e6e8c96151f0637"
;
private
final
static
String
appKey
=
"48e5e13229b82c1b4e6e8c96151f0637"
;
...
@@ -69,6 +75,40 @@ public class RopHttpUtil {
...
@@ -69,6 +75,40 @@ public class RopHttpUtil {
return
params
;
return
params
;
}
}
/**
* 获取群列表
* @param requestUrl 请求URL
* @return 群列表
*/
public
static
List
<
ScrmWorktoolGroupResponse
>
getGroupList
(
String
requestUrl
)
{
try
{
RestTemplate
restTemplate
=
new
RestTemplate
();
log
.
info
(
"获取群列表,请求URL: {}"
,
requestUrl
);
// 发送GET请求获取群列表
GroupItemResponse
[]
groupItems
=
restTemplate
.
getForObject
(
requestUrl
,
GroupItemResponse
[].
class
);
if
(
groupItems
==
null
||
groupItems
.
length
==
0
)
{
log
.
warn
(
"获取群列表为空"
);
return
new
ArrayList
<>();
}
List
<
ScrmWorktoolGroupResponse
>
result
=
new
ArrayList
<>();
for
(
GroupItemResponse
item
:
groupItems
)
{
ScrmWorktoolGroupResponse
response
=
new
ScrmWorktoolGroupResponse
();
response
.
setId
(
null
);
response
.
setRootId
(
null
);
response
.
setDelFlag
(
0
);
response
.
setGroupName
(
item
.
getGroupName
());
String
groupRemark
=
item
.
getGroupRemark
();
response
.
setGroupRemark
(
groupRemark
);
result
.
add
(
response
);
}
log
.
info
(
"获取群列表成功,共{}个群"
,
result
.
size
());
return
result
;
}
catch
(
Exception
e
)
{
log
.
error
(
"获取群列表异常,URL: {}"
,
requestUrl
,
e
);
throw
new
RuntimeException
(
"获取群列表失败: "
+
e
.
getMessage
(),
e
);
}
}
static
class
RopUriTemplateHandler
extends
DefaultUriBuilderFactory
{
static
class
RopUriTemplateHandler
extends
DefaultUriBuilderFactory
{
public
RopUriTemplateHandler
(
String
baseUriTemplate
)
{
public
RopUriTemplateHandler
(
String
baseUriTemplate
)
{
...
...
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