Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
dj
/
rpc-dj-supervisor
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 8bfd42d3
authored
Mar 17, 2026
by
范富荣
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
修改查询员工接口
1 parent
222378e8
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
33 additions
and
7 deletions
rpc-dj-supervisor/src/main/java/cn/com/glsx/dj/supervisor/job/SupervisorAudioReviewTaskJob.java
rpc-dj-supervisor/src/main/java/cn/com/glsx/dj/supervisor/service/SupervisorTaskInfoService.java
rpc-dj-supervisor/src/test/java/cn/com/glsx/dj/supervisor/service/SupervisorAudioReviewTaskJobTest.java
rpc-dj-supervisor/src/main/java/cn/com/glsx/dj/supervisor/job/SupervisorAudioReviewTaskJob.java
View file @
8bfd42d
...
...
@@ -20,6 +20,7 @@ import cn.com.glsx.dj.supervisor.service.SupervisorTaskInfoService;
import
cn.com.glsx.dj.supervisor.utils.DateUtils
;
import
cn.com.glsx.framework.core.beans.BaseModel
;
import
cn.com.glsx.framework.core.beans.rpc.RpcResponse
;
import
cn.com.glsx.merchants.model.response.MerchantStaffResponse
;
import
com.dangdang.ddframe.job.api.ShardingContext
;
import
com.dangdang.ddframe.job.api.simple.SimpleJob
;
import
lombok.extern.slf4j.Slf4j
;
...
...
@@ -27,6 +28,7 @@ import org.apache.commons.collections.CollectionUtils;
import
org.apache.commons.lang.StringUtils
;
import
org.oreframework.boot.autoconfigure.elasticjob.annotation.ElasticJobConf
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.core.env.Environment
;
import
org.springframework.stereotype.Service
;
import
java.math.BigDecimal
;
...
...
@@ -59,20 +61,25 @@ public class SupervisorAudioReviewTaskJob implements SimpleJob {
@Autowired
private
BusinessSceneAnalysisRemote
businessSceneAnalysisRemote
;
@Autowired
private
Environment
environment
;
@Override
public
void
execute
(
ShardingContext
shardingContext
)
{
try
{
log
.
info
(
"督导录音复盘任务生成开始执行"
);
// 1. 查询系统中所有督导员工列表
List
<
cn
.
com
.
glsx
.
merchants
.
model
.
response
.
MerchantStaffResponse
>
supervisorList
=
supervisorTaskInfoService
.
listAllSupervisors
();
List
<
MerchantStaffResponse
>
supervisorList
=
supervisorTaskInfoService
.
listAllSupervisors
();
if
(
supervisorList
==
null
||
supervisorList
.
isEmpty
())
{
log
.
error
(
"查询督导员工列表为空"
);
return
;
}
String
yesterday
=
DateUtils
.
getYesterdayDate
();
//计算员工排名阈值
double
rankThreshold
=
environment
.
getProperty
(
"dj.supervisor.audio.review.task.rank.threshold"
,
Double
.
class
,
0.3
);
// 2. 遍历督导员工列表
for
(
cn
.
com
.
glsx
.
merchants
.
model
.
response
.
MerchantStaffResponse
supervisor
:
supervisorList
)
{
for
(
MerchantStaffResponse
supervisor
:
supervisorList
)
{
try
{
// 2.1 查询督导管理的门店列表,参考CommonUtil.getFlightSupervisionMerchantList方法
ShopMerchantDirectorConfigDTO
dto
=
new
ShopMerchantDirectorConfigDTO
();
...
...
@@ -95,7 +102,7 @@ public class SupervisorAudioReviewTaskJob implements SimpleJob {
// 2.2 查询督导下面的员工列表
StaffBaseInfoDTO
staffParam
=
new
StaffBaseInfoDTO
();
staffParam
.
setMerchantIdList
(
merchantIdList
);
RpcResponse
<
List
<
StaffBaseInfoDTO
>>
staffResponse
=
staffBaseInfoRemote
.
listShopStaff
BaseInfo
(
staffParam
);
RpcResponse
<
List
<
StaffBaseInfoDTO
>>
staffResponse
=
staffBaseInfoRemote
.
listShopStaff
InfoGroupByUUid
(
staffParam
);
if
(!
staffResponse
.
isSuccess
()
||
staffResponse
.
getResult
()
==
null
||
staffResponse
.
getResult
().
isEmpty
())
{
log
.
info
(
"督导 {} 无管理员工"
,
supervisor
.
getStaffName
());
continue
;
...
...
@@ -114,7 +121,7 @@ public class SupervisorAudioReviewTaskJob implements SimpleJob {
.
collect
(
Collectors
.
toList
());
// 3.1 计算排名倒数30%的人员数量,向上取值
int
totalStaff
=
sortedStaffList
.
size
();
int
poorPerfCount
=
(
int
)
Math
.
ceil
(
totalStaff
*
0.3
);
int
poorPerfCount
=
(
int
)
Math
.
ceil
(
totalStaff
*
rankThreshold
);
if
(
poorPerfCount
<=
0
)
{
log
.
info
(
"督导 {} 管理员工数量不足,无需生成录音复盘任务"
,
supervisor
.
getStaffName
());
continue
;
...
...
@@ -164,7 +171,7 @@ public class SupervisorAudioReviewTaskJob implements SimpleJob {
// 设置门店列表
req
.
setMerchantIds
(
merchantIdList
);
//设置员工信息
req
.
setStaff
Phones
(
staffList
.
stream
().
map
(
StaffBaseInfoDTO:
:
getStaffPhone
).
collect
(
Collectors
.
toList
()));
req
.
setStaff
Uuids
(
staffList
.
stream
().
map
(
StaffBaseInfoDTO:
:
getLoginUuid
).
collect
(
Collectors
.
toList
()));
// 调用远程接口查询督导员工产值列表
RpcResponse
<
List
<
StoreEmployeeRankResponse
.
EmployeeAnalysisItem
>>
response
=
...
...
rpc-dj-supervisor/src/main/java/cn/com/glsx/dj/supervisor/service/SupervisorTaskInfoService.java
View file @
8bfd42d
...
...
@@ -407,7 +407,7 @@ public class SupervisorTaskInfoService {
// 计算团队员工个数
StaffBaseInfoDTO
param
=
new
StaffBaseInfoDTO
();
param
.
setMerchantIdList
(
merchantIdList
);
RpcResponse
<
List
<
StaffBaseInfoDTO
>>
response
=
staffBaseInfoRemote
.
listShopStaff
BaseInfo
(
param
);
RpcResponse
<
List
<
StaffBaseInfoDTO
>>
response
=
staffBaseInfoRemote
.
listShopStaff
InfoGroupByUUid
(
param
);
if
(
response
.
hasError
())
{
log
.
error
(
"查询团队员工个数失败,merchantIdList={}, error={}, message={}"
,
merchantIdList
,
response
.
getError
(),
response
.
getMessage
());
throw
new
RpcServiceException
(
DefaultErrorEnum
.
SERVICE_ERROR
,
response
.
getMessage
());
...
...
@@ -419,7 +419,7 @@ public class SupervisorTaskInfoService {
SceneBaseReq
req
=
new
SceneBaseReq
();
req
.
setMerchantIds
(
merchantIdList
);
req
.
setCycleType
(
4
);
req
.
setStaff
Phones
(
staffList
.
stream
().
map
(
StaffBaseInfoDTO:
:
getStaffPhone
).
collect
(
Collectors
.
toList
()));
req
.
setStaff
Uuids
(
staffList
.
stream
().
map
(
StaffBaseInfoDTO:
:
getLoginUuid
).
collect
(
Collectors
.
toList
()));
RpcResponse
<
SceneOutputResponse
>
outputResponse
=
businessSceneAnalysisRemote
.
querySupervisorOutput
(
req
);
if
(
outputResponse
.
hasError
())
{
log
.
error
(
"查询督导团队产值失败,SceneBaseReq={}, error={}, message={}"
,
JSON
.
toJSONString
(
req
),
outputResponse
.
getError
(),
outputResponse
.
getMessage
());
...
...
rpc-dj-supervisor/src/test/java/cn/com/glsx/dj/supervisor/service/SupervisorAudioReviewTaskJobTest.java
0 → 100644
View file @
8bfd42d
package
cn
.
com
.
glsx
.
dj
.
supervisor
.
service
;
import
cn.com.glsx.dj.supervisor.job.SupervisorAudioReviewTaskJob
;
import
org.junit.Test
;
import
org.springframework.beans.factory.annotation.Autowired
;
public
class
SupervisorAudioReviewTaskJobTest
extends
BaseServiceTest
{
@Autowired
private
SupervisorAudioReviewTaskJob
supervisorAudioReviewTaskJob
;
@Test
public
void
testExecute
()
{
supervisorAudioReviewTaskJob
.
execute
(
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