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 95bbfb0f
authored
Mar 13, 2026
by
谢海旭
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
v5.7.0版本 飞行督导:团队-培训-员工排行、发起带教
1 parent
7640663b
Show whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
510 additions
and
4 deletions
rpc-dj-supervisor-api/src/main/java/cn/com/glsx/dj/supervisor/dto/EmployeeTrainingInfoDTO.java
rpc-dj-supervisor-api/src/main/java/cn/com/glsx/dj/supervisor/dto/EmployeeTrainingInfoRequestDTO.java
rpc-dj-supervisor-api/src/main/java/cn/com/glsx/dj/supervisor/dto/MapperQueryEmployeeTrainingInfoDTO.java
rpc-dj-supervisor-api/src/main/java/cn/com/glsx/dj/supervisor/dto/SupervisorTaskDTO.java
rpc-dj-supervisor-api/src/main/java/cn/com/glsx/dj/supervisor/remote/SupervisorEmployeeTrainingInfoRemote.java
rpc-dj-supervisor-api/src/main/java/cn/com/glsx/dj/supervisor/remote/SupervisorTaskInfoRemote.java
rpc-dj-supervisor/src/main/java/cn/com/glsx/dj/supervisor/mapper/SupervisorTaskInfoMapper.java
rpc-dj-supervisor/src/main/java/cn/com/glsx/dj/supervisor/remote/SupervisorEmployeeTrainingInfoRemoteImpl.java
rpc-dj-supervisor/src/main/java/cn/com/glsx/dj/supervisor/remote/SupervisorTaskInfoRemoteImpl.java
rpc-dj-supervisor/src/main/java/cn/com/glsx/dj/supervisor/service/SupervisorEmployeeTrainingInfoService.java
rpc-dj-supervisor/src/main/java/cn/com/glsx/dj/supervisor/service/SupervisorTaskInfoService.java
rpc-dj-supervisor/src/main/resources/META-INF/orm/SupervisorTaskInfoMapper.xml
rpc-dj-supervisor/src/test/java/cn/com/glsx/dj/supervisor/service/SupervisorEmployeeTrainingInfoServiceTest.java
rpc-dj-supervisor/src/test/java/cn/com/glsx/dj/supervisor/service/SupervisorTaskInfoServiceTest.java
rpc-dj-supervisor-api/src/main/java/cn/com/glsx/dj/supervisor/dto/EmployeeTrainingInfoDTO.java
0 → 100644
View file @
95bbfb0
package
cn
.
com
.
glsx
.
dj
.
supervisor
.
dto
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.io.Serializable
;
import
java.math.BigDecimal
;
/**
* 员工培训信息响应
*
* @author xiehx
* @date 2026 年 3 月 12 日
*/
@Data
public
class
EmployeeTrainingInfoDTO
implements
Serializable
{
@ApiModelProperty
(
notes
=
"员工姓名"
)
private
String
employeeName
;
@ApiModelProperty
(
notes
=
"手机号"
)
private
String
phone
;
@ApiModelProperty
(
notes
=
"学习时长(小时)"
)
private
BigDecimal
studyHours
;
@ApiModelProperty
(
notes
=
"完成课程数"
)
private
Integer
completedCourses
;
@ApiModelProperty
(
notes
=
"带教次数"
)
private
Integer
coachingTimes
;
}
rpc-dj-supervisor-api/src/main/java/cn/com/glsx/dj/supervisor/dto/EmployeeTrainingInfoRequestDTO.java
0 → 100644
View file @
95bbfb0
package
cn
.
com
.
glsx
.
dj
.
supervisor
.
dto
;
import
lombok.Data
;
import
java.io.Serializable
;
/**
* 员工培训信息查询 DTO
*
* @author xiehx
* @date 2026 年 3 月 12 日
*/
@Data
public
class
EmployeeTrainingInfoRequestDTO
implements
Serializable
{
/**
* 业务类型(1-延保、2-权益、3-轻改)
*/
private
Integer
businessType
;
/**
* 开始日期
*/
private
String
startDate
;
/**
* 结束日期
*/
private
String
endDate
;
/**
* 排序字段(1-学习时长、2-完成课程数、3-带教次数)
*/
private
Integer
sortField
;
/**
* 排序方式(0-升序、1-降序)
*/
private
Integer
sortOrder
;
/**
* 督导手机号
*/
private
String
supervisorPhone
;
}
rpc-dj-supervisor-api/src/main/java/cn/com/glsx/dj/supervisor/dto/MapperQueryEmployeeTrainingInfoDTO.java
0 → 100644
View file @
95bbfb0
package
cn
.
com
.
glsx
.
dj
.
supervisor
.
dto
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.io.Serializable
;
import
java.math.BigDecimal
;
/**
* 员工培训信息响应
*
* @author xiehx
* @date 2026 年 3 月 12 日
*/
@Data
public
class
MapperQueryEmployeeTrainingInfoDTO
implements
Serializable
{
@ApiModelProperty
(
notes
=
"员工姓名"
)
private
String
employeeName
;
@ApiModelProperty
(
notes
=
"手机号"
)
private
String
phone
;
@ApiModelProperty
(
notes
=
"员工北森id"
)
private
Integer
userId
;
@ApiModelProperty
(
notes
=
"学习时长(小时)"
)
private
BigDecimal
studyHours
;
@ApiModelProperty
(
notes
=
"完成课程数"
)
private
Integer
completedCourses
;
@ApiModelProperty
(
notes
=
"带教次数"
)
private
Integer
coachingTimes
;
}
rpc-dj-supervisor-api/src/main/java/cn/com/glsx/dj/supervisor/dto/SupervisorTaskDTO.java
View file @
95bbfb0
...
...
@@ -51,10 +51,21 @@ public class SupervisorTaskDTO implements Serializable {
*/
@ApiModelProperty
(
notes
=
"驻店员工姓名"
)
private
String
storeManagerName
;
/**
* 驻店员工手机号
*/
@ApiModelProperty
(
notes
=
"驻店员工手机号"
)
private
String
storeManagerPhone
;
@ApiModelProperty
(
notes
=
"任务描述"
)
private
String
taskDesc
;
@ApiModelProperty
(
notes
=
"督导手机号"
)
private
String
supervisorPhone
;
@ApiModelProperty
(
notes
=
"督导姓名"
)
private
String
supervisorName
;
/**
* 督导记录(富文本内容)
*/
...
...
rpc-dj-supervisor-api/src/main/java/cn/com/glsx/dj/supervisor/remote/SupervisorEmployeeTrainingInfoRemote.java
0 → 100644
View file @
95bbfb0
package
cn
.
com
.
glsx
.
dj
.
supervisor
.
remote
;
import
cn.com.glsx.dj.supervisor.dto.EmployeeTrainingInfoRequestDTO
;
import
cn.com.glsx.dj.supervisor.dto.EmployeeTrainingInfoDTO
;
import
cn.com.glsx.framework.core.annotation.ApiMethod
;
import
cn.com.glsx.framework.core.annotation.ApiParam
;
import
cn.com.glsx.framework.core.annotation.ApiResponse
;
import
cn.com.glsx.framework.core.annotation.ApiService
;
import
cn.com.glsx.framework.core.beans.rpc.RpcResponse
;
import
java.util.List
;
/**
* 督导 - 员工培训信息 RPC 接口
*
* @author xiehx
* @date 2026 年 3 月 12 日
*/
@ApiService
(
value
=
"督导 - 员工培训信息"
,
owner
=
"xiehx"
)
public
interface
SupervisorEmployeeTrainingInfoRemote
{
@ApiMethod
(
"根据条件查询全部员工培训信息列表"
)
@ApiParam
(
name
=
"request"
,
notes
=
"查询条件"
,
dataType
=
ApiParam
.
DataTypeEnum
.
OBJECT
,
required
=
true
)
@ApiResponse
(
"列表结果"
)
RpcResponse
<
List
<
EmployeeTrainingInfoDTO
>>
getAllEmployeeTrainingInfo
(
EmployeeTrainingInfoRequestDTO
request
);
}
rpc-dj-supervisor-api/src/main/java/cn/com/glsx/dj/supervisor/remote/SupervisorTaskInfoRemote.java
View file @
95bbfb0
...
...
@@ -68,4 +68,13 @@ public interface SupervisorTaskInfoRemote {
@ApiParams
({
@ApiParam
(
name
=
"request"
,
notes
=
"提交参数"
,
dataType
=
ApiParam
.
DataTypeEnum
.
OBJECT
,
required
=
true
)})
@ApiResponse
(
"提交结果"
)
RpcResponse
<
Boolean
>
submitAudioReview
(
SupervisorAudioReviewInfo
request
);
/**
* 发起带教 - 提交
*/
@interface
SubmitCoaching
{}
@ApiMethod
(
"发起带教 - 提交"
)
@ApiParams
({
@ApiParam
(
name
=
"request"
,
notes
=
"带教信息"
,
dataType
=
ApiParam
.
DataTypeEnum
.
OBJECT
,
required
=
true
)})
@ApiResponse
(
"提交结果"
)
RpcResponse
<
Long
>
submitCoaching
(
SupervisorTaskDTO
request
);
}
rpc-dj-supervisor/src/main/java/cn/com/glsx/dj/supervisor/mapper/SupervisorTaskInfoMapper.java
View file @
95bbfb0
package
cn
.
com
.
glsx
.
dj
.
supervisor
.
mapper
;
import
cn.com.glsx.dj.supervisor.dto.MapperQueryEmployeeTrainingInfoDTO
;
import
cn.com.glsx.dj.supervisor.dto.SupervisorTaskDTO
;
import
cn.com.glsx.dj.supervisor.dto.SupervisorTaskQueryDTO
;
import
cn.com.glsx.dj.supervisor.model.SupervisorTaskInfo
;
import
org.apache.ibatis.annotations.MapKey
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Param
;
import
org.oreframework.datasource.mybatis.mapper.OreMapper
;
import
java.util.List
;
import
java.util.Map
;
@Mapper
public
interface
SupervisorTaskInfoMapper
extends
OreMapper
<
SupervisorTaskInfo
>
{
...
...
@@ -24,4 +27,12 @@ public interface SupervisorTaskInfoMapper extends OreMapper<SupervisorTaskInfo>
List
<
SupervisorTaskDTO
>
listTask
(
SupervisorTaskQueryDTO
request
);
@MapKey
(
"userId"
)
Map
<
Integer
,
MapperQueryEmployeeTrainingInfoDTO
>
queryStudyHours
(
@Param
(
"beiSenUserIdList"
)
List
<
Integer
>
beiSenUserIdList
,
@Param
(
"startDate"
)
String
startDate
,
@Param
(
"endDate"
)
String
endDate
);
@MapKey
(
"userId"
)
Map
<
Integer
,
MapperQueryEmployeeTrainingInfoDTO
>
queryCompletedCourses
(
@Param
(
"beiSenUserIdList"
)
List
<
Integer
>
beiSenUserIdList
,
@Param
(
"startDate"
)
String
startDate
,
@Param
(
"endDate"
)
String
endDate
);
@MapKey
(
"phone"
)
Map
<
String
,
MapperQueryEmployeeTrainingInfoDTO
>
queryCoachingTimes
(
@Param
(
"phoneList"
)
List
<
String
>
phoneList
,
@Param
(
"startDate"
)
String
startDate
,
@Param
(
"endDate"
)
String
endDate
);
}
\ No newline at end of file
rpc-dj-supervisor/src/main/java/cn/com/glsx/dj/supervisor/remote/SupervisorEmployeeTrainingInfoRemoteImpl.java
0 → 100644
View file @
95bbfb0
package
cn
.
com
.
glsx
.
dj
.
supervisor
.
remote
;
import
cn.com.glsx.dj.supervisor.dto.EmployeeTrainingInfoRequestDTO
;
import
cn.com.glsx.dj.supervisor.dto.EmployeeTrainingInfoDTO
;
import
cn.com.glsx.dj.supervisor.service.SupervisorEmployeeTrainingInfoService
;
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
lombok.extern.slf4j.Slf4j
;
import
org.apache.dubbo.config.annotation.DubboService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
java.util.List
;
/**
* 督导 - 员工培训信息 RPC 实现类
*
* @author xiehx
* @date 2026 年 3 月 12 日
*/
@Slf4j
@DubboService
(
version
=
"1.0.0"
,
retries
=
0
,
timeout
=
30000
,
validation
=
"true"
)
public
class
SupervisorEmployeeTrainingInfoRemoteImpl
implements
SupervisorEmployeeTrainingInfoRemote
{
@Autowired
private
SupervisorEmployeeTrainingInfoService
supervisorEmployeeTrainingInfoService
;
@Override
public
RpcResponse
<
List
<
EmployeeTrainingInfoDTO
>>
getAllEmployeeTrainingInfo
(
EmployeeTrainingInfoRequestDTO
request
)
{
try
{
log
.
info
(
"查询全部员工培训信息,请求参数:{}"
,
request
);
// 调用 Service 层查询
List
<
EmployeeTrainingInfoDTO
>
result
=
supervisorEmployeeTrainingInfoService
.
getAllEmployeeTrainingInfo
(
request
);
log
.
info
(
"查询全部员工培训信息成功,总记录数:{}"
,
result
!=
null
?
result
.
size
()
:
0
);
return
RpcResponse
.
success
(
result
);
}
catch
(
RpcServiceException
e
)
{
log
.
error
(
"cn.com.glsx.dj.supervisor.remote.SupervisorEmployeeTrainingInfoRemoteImpl.getAllEmployeeTrainingInfo error {}"
,
e
);
return
RpcResponse
.
error
(
e
.
getError
(),
e
.
getMessage
());
}
catch
(
Exception
e
)
{
log
.
error
(
"cn.com.glsx.dj.supervisor.remote.SupervisorEmployeeTrainingInfoRemoteImpl.getAllEmployeeTrainingInfo system error {}"
,
e
);
return
RpcResponse
.
error
(
DefaultErrorEnum
.
SERVICE_ERROR
,
e
.
getMessage
());
}
}
}
rpc-dj-supervisor/src/main/java/cn/com/glsx/dj/supervisor/remote/SupervisorTaskInfoRemoteImpl.java
View file @
95bbfb0
...
...
@@ -136,4 +136,20 @@ public class SupervisorTaskInfoRemoteImpl implements SupervisorTaskInfoRemote {
return
RpcResponse
.
error
(
DefaultErrorEnum
.
SERVER_ERROR
,
e
.
getMessage
());
}
}
@Override
public
RpcResponse
<
Long
>
submitCoaching
(
SupervisorTaskDTO
request
)
{
try
{
log
.
info
(
"发起带教 - 提交,请求参数:{}"
,
request
);
Long
taskId
=
supervisorTaskInfoService
.
submitCoaching
(
request
);
log
.
info
(
"发起带教 - 提交成功,taskId={}"
,
taskId
);
return
RpcResponse
.
success
(
taskId
);
}
catch
(
RpcServiceException
e
)
{
log
.
error
(
"cn.com.glsx.dj.supervisor.remote.SupervisorTaskInfoRemoteImpl.submitCoaching error {}"
,
e
);
return
RpcResponse
.
error
(
e
.
getError
(),
e
.
getMessage
());
}
catch
(
Exception
e
)
{
log
.
error
(
"cn.com.glsx.dj.supervisor.remote.SupervisorTaskInfoRemoteImpl.submitCoaching system error {}"
,
e
);
return
RpcResponse
.
error
(
DefaultErrorEnum
.
SERVER_ERROR
,
e
.
getMessage
());
}
}
}
rpc-dj-supervisor/src/main/java/cn/com/glsx/dj/supervisor/service/SupervisorEmployeeTrainingInfoService.java
0 → 100644
View file @
95bbfb0
package
cn
.
com
.
glsx
.
dj
.
supervisor
.
service
;
import
cn.com.glsx.dj.supervisor.dto.EmployeeTrainingInfoDTO
;
import
cn.com.glsx.dj.supervisor.dto.EmployeeTrainingInfoRequestDTO
;
import
cn.com.glsx.dj.supervisor.dto.MapperQueryEmployeeTrainingInfoDTO
;
import
cn.com.glsx.dj.supervisor.mapper.SupervisorTaskInfoMapper
;
import
cn.com.glsx.merchants.dto.beisen.BeiSenEmployeeListResonseDTO
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
/**
* 督导 - 员工培训信息 Service
*
* @author xiehx
* @date 2026 年 3 月 12 日
*/
@Service
@Slf4j
public
class
SupervisorEmployeeTrainingInfoService
{
@Autowired
private
SupervisorLearningCenterService
supervisorLearningCenterService
;
@Autowired
private
SupervisorTaskInfoMapper
supervisorTaskInfoMapper
;
/**
* 根据条件查询全部员工培训信息列表
*
* @param request 查询条件
* @return 员工培训信息列表
*/
public
List
<
EmployeeTrainingInfoDTO
>
getAllEmployeeTrainingInfo
(
EmployeeTrainingInfoRequestDTO
request
)
{
// TODO 1、根据督导手机号、业务类型 关联查询全部员工信息 判空处理等
List
<
String
>
phoneList
=
new
ArrayList
<
String
>();
phoneList
.
add
(
"13603070903"
);
List
<
BeiSenEmployeeListResonseDTO
>
beiSenEmployeeList
=
supervisorLearningCenterService
.
listEmployeeInfoByStaffPhone
(
phoneList
);
List
<
Integer
>
beiSenUserIdList
=
beiSenEmployeeList
.
stream
().
map
(
beiSenEmployeeListResonseDTO
->
beiSenEmployeeListResonseDTO
.
getUserID
()).
collect
(
Collectors
.
toList
());
Map
<
Integer
,
MapperQueryEmployeeTrainingInfoDTO
>
studyHoursMap
=
supervisorTaskInfoMapper
.
queryStudyHours
(
beiSenUserIdList
,
request
.
getStartDate
(),
request
.
getEndDate
());
Map
<
Integer
,
MapperQueryEmployeeTrainingInfoDTO
>
completedCoursesMap
=
supervisorTaskInfoMapper
.
queryCompletedCourses
(
beiSenUserIdList
,
request
.
getStartDate
(),
request
.
getEndDate
());
Map
<
String
,
MapperQueryEmployeeTrainingInfoDTO
>
coachingTimesMap
=
supervisorTaskInfoMapper
.
queryCoachingTimes
(
phoneList
,
request
.
getStartDate
(),
request
.
getEndDate
());
List
<
EmployeeTrainingInfoDTO
>
employeeTrainingInfoList
=
beiSenEmployeeList
.
stream
().
map
(
beiSenEmployeeListResonseDTO
->
{
EmployeeTrainingInfoDTO
employeeTrainingInfo
=
new
EmployeeTrainingInfoDTO
();
employeeTrainingInfo
.
setEmployeeName
(
beiSenEmployeeListResonseDTO
.
getName
());
employeeTrainingInfo
.
setPhone
(
beiSenEmployeeListResonseDTO
.
getMobilePhone
());
MapperQueryEmployeeTrainingInfoDTO
studyHours
=
studyHoursMap
.
get
(
beiSenEmployeeListResonseDTO
.
getUserID
().
intValue
());
employeeTrainingInfo
.
setStudyHours
(
studyHours
!=
null
?
studyHours
.
getStudyHours
()
:
null
);
MapperQueryEmployeeTrainingInfoDTO
completedCourses
=
completedCoursesMap
.
get
(
beiSenEmployeeListResonseDTO
.
getUserID
().
intValue
());
employeeTrainingInfo
.
setCompletedCourses
(
completedCourses
!=
null
?
completedCourses
.
getCompletedCourses
()
:
null
);
MapperQueryEmployeeTrainingInfoDTO
coachingTimes
=
coachingTimesMap
.
get
(
beiSenEmployeeListResonseDTO
.
getMobilePhone
());
employeeTrainingInfo
.
setCoachingTimes
(
coachingTimes
!=
null
?
coachingTimes
.
getCoachingTimes
()
:
null
);
return
employeeTrainingInfo
;
}).
collect
(
Collectors
.
toList
());
// 根据排序参数值进行排序
employeeTrainingInfoList
.
sort
((
o1
,
o2
)
->
{
if
(
request
.
getSortField
()
==
1
)
{
return
request
.
getSortOrder
()
==
1
?
o1
.
getStudyHours
().
compareTo
(
o2
.
getStudyHours
())
:
o2
.
getStudyHours
().
compareTo
(
o1
.
getStudyHours
());
}
else
if
(
request
.
getSortField
()
==
2
)
{
return
request
.
getSortOrder
()
==
1
?
o1
.
getCompletedCourses
().
compareTo
(
o2
.
getCompletedCourses
())
:
o2
.
getCompletedCourses
().
compareTo
(
o1
.
getCompletedCourses
());
}
else
if
(
request
.
getSortField
()
==
3
)
{
return
request
.
getSortOrder
()
==
1
?
o1
.
getCoachingTimes
().
compareTo
(
o2
.
getCoachingTimes
())
:
o2
.
getCoachingTimes
().
compareTo
(
o1
.
getCoachingTimes
());
}
return
0
;
});
return
employeeTrainingInfoList
;
}
}
rpc-dj-supervisor/src/main/java/cn/com/glsx/dj/supervisor/service/SupervisorTaskInfoService.java
View file @
95bbfb0
package
cn
.
com
.
glsx
.
dj
.
supervisor
.
service
;
import
cn.com.glsx.dj.supervisor.dto.CoursePushDTO
;
import
cn.com.glsx.dj.supervisor.dto.SupervisorTaskDTO
;
import
cn.com.glsx.dj.supervisor.dto.SupervisorTaskQueryDTO
;
import
cn.com.glsx.dj.supervisor.enums.ReviewStatusEnum
;
import
cn.com.glsx.dj.supervisor.enums.TaskStatusEnum
;
import
cn.com.glsx.dj.supervisor.enums.TaskTypeEnum
;
import
cn.com.glsx.dj.supervisor.mapper.SupervisorTaskCourseMapper
;
import
cn.com.glsx.dj.supervisor.mapper.SupervisorTaskImageMapper
;
import
cn.com.glsx.dj.supervisor.mapper.SupervisorTaskInfoMapper
;
import
cn.com.glsx.dj.supervisor.model.SupervisorAudioReviewInfo
;
import
cn.com.glsx.dj.supervisor.model.SupervisorTaskCourse
;
import
cn.com.glsx.dj.supervisor.model.SupervisorTaskInfo
;
import
cn.com.glsx.dj.supervisor.model.SupervisorWeekTaskStaff
;
import
cn.com.glsx.dj.supervisor.model.*
;
import
cn.com.glsx.framework.core.beans.BaseModel
;
import
cn.com.glsx.framework.core.beans.rpc.RpcPagination
;
import
cn.com.glsx.framework.core.beans.rpc.RpcResponse
;
...
...
@@ -31,6 +31,7 @@ import org.springframework.stereotype.Service;
import
org.springframework.transaction.annotation.Propagation
;
import
org.springframework.transaction.annotation.Transactional
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.Map
;
...
...
@@ -61,6 +62,15 @@ public class SupervisorTaskInfoService {
@Autowired
private
SupervisorTaskCourseService
supervisorTaskCourseService
;
@Autowired
private
SupervisorTaskImageMapper
supervisorTaskImageMapper
;
@Autowired
private
SupervisorTaskCourseMapper
supervisorTaskCourseMapper
;
@Autowired
private
SupervisorLearningCenterService
supervisorLearningCenterService
;
/**
* 生成日报信息
* @param startTimeStr 日报的开始时间,yyyy-MM-dd
...
...
@@ -285,7 +295,80 @@ public class SupervisorTaskInfoService {
return
true
;
}
/**
* 发起带教 - 提交
* @param request 带教信息
* @return 任务 ID
*/
@GlsxDistributeLockable
(
name
=
"'SupervisorTaskInfoService_submitCoaching_' + #request.supervisorPhone"
,
timeoutException
=
Exception
.
class
)
@Transactional
(
propagation
=
Propagation
.
REQUIRED
,
rollbackFor
=
Exception
.
class
)
public
Long
submitCoaching
(
SupervisorTaskDTO
request
)
{
try
{
Date
date
=
new
Date
();
// 构建带教任务信息
SupervisorTaskInfo
taskInfo
=
new
SupervisorTaskInfo
();
BeanUtils
.
copyProperties
(
request
,
taskInfo
);
taskInfo
.
setTaskType
(
TaskTypeEnum
.
TRAINING
.
getCode
());
// 5-带教
taskInfo
.
setTaskStatus
(
TaskStatusEnum
.
COMPLETED
.
getCode
());
// 直接设为已完成
taskInfo
.
setDeletedFlag
(
BaseModel
.
DeletedFlagEnum
.
N
.
name
());
taskInfo
.
setCreateTime
(
date
);
taskInfo
.
setCreatedBy
(
request
.
getSupervisorPhone
());
// 插入带教任务
int
count
=
supervisorTaskInfoMapper
.
insertSelective
(
taskInfo
);
if
(
count
<=
0
)
{
log
.
error
(
"插入带教任务失败"
);
throw
new
RpcServiceException
(
DefaultErrorEnum
.
DATABASE_ERROR
,
"插入带教任务失败"
);
}
Long
taskId
=
taskInfo
.
getId
();
log
.
info
(
"插入带教任务成功,taskId={}"
,
taskId
);
// 插入图片列表
if
(
CollectionUtils
.
isNotEmpty
(
request
.
getTaskImageList
()))
{
for
(
SupervisorTaskImage
image
:
request
.
getTaskImageList
())
{
image
.
setRelationId
(
taskId
);
image
.
setCreateTime
(
date
);
image
.
setCreatedBy
(
request
.
getSupervisorName
());
image
.
setDeletedFlag
(
BaseModel
.
DeletedFlagEnum
.
N
.
name
());
}
int
imageCount
=
supervisorTaskImageMapper
.
insertList
(
request
.
getTaskImageList
());
log
.
info
(
"插入带教图片成功,imageCount={}"
,
imageCount
);
}
// 插入课程列表
if
(
CollectionUtils
.
isNotEmpty
(
request
.
getTaskCourseList
()))
{
ArrayList
<
CoursePushDTO
>
coursePushList
=
new
ArrayList
<>();
for
(
SupervisorTaskCourse
course
:
request
.
getTaskCourseList
())
{
course
.
setTaskId
(
taskId
);
course
.
setCreatedTime
(
date
);
course
.
setCreatedBy
(
request
.
getSupervisorName
());
course
.
setDeletedFlag
(
BaseModel
.
DeletedFlagEnum
.
N
.
name
());
CoursePushDTO
coursePushDTO
=
new
CoursePushDTO
();
coursePushDTO
.
setStoreManagerPhone
(
request
.
getStoreManagerPhone
());
coursePushDTO
.
setStoreManagerName
(
request
.
getStoreManagerName
());
coursePushDTO
.
setBcCourseId
(
course
.
getBcCourseId
());
coursePushDTO
.
setBcCourseName
(
course
.
getBcCourseName
());
coursePushList
.
add
(
coursePushDTO
);
}
int
courseCount
=
supervisorTaskCourseMapper
.
insertList
(
request
.
getTaskCourseList
());
// 推送课程给驻店人员
supervisorLearningCenterService
.
batchPushCourseToStoreManager
(
coursePushList
);
log
.
info
(
"插入带教课程成功,courseCount={}"
,
courseCount
);
}
log
.
info
(
"发起带教 - 提交成功,taskId={}"
,
taskId
);
return
taskId
;
}
catch
(
RpcServiceException
e
)
{
throw
e
;
}
catch
(
Exception
e
)
{
log
.
error
(
"发起带教 - 提交异常"
,
e
);
throw
new
RpcServiceException
(
DefaultErrorEnum
.
SERVICE_ERROR
,
"发起带教失败:"
+
e
.
getMessage
());
}
}
}
rpc-dj-supervisor/src/main/resources/META-INF/orm/SupervisorTaskInfoMapper.xml
View file @
95bbfb0
...
...
@@ -101,5 +101,53 @@
</where>
order by sti.task_status asc, sti.create_time desc
</select>
<select
id=
"queryStudyHours"
resultType=
"cn.com.glsx.dj.supervisor.dto.MapperQueryEmployeeTrainingInfoDTO"
>
SELECT
staff AS userId,
TRUNCATE(SUM(COALESCE(duration, 0)) / 3600.0, 1) AS studyHours
FROM dj_beisen_learn_staff_progress_daily
WHERE
staff IN
<foreach
collection=
"beiSenUserIdList"
open=
"("
item=
"i"
close=
")"
separator=
","
>
#{i}
</foreach>
AND cast(date as date)
>
= #{startDate, jdbcType=DATE}
AND cast(date as date)
<
= #{endDate, jdbcType=DATE}
AND deleted_flag = 'N'
GROUP BY staff
</select>
<select
id=
"queryCompletedCourses"
resultType=
"cn.com.glsx.dj.supervisor.dto.MapperQueryEmployeeTrainingInfoDTO"
>
SELECT
user_id AS userId,
COUNT(*) AS completedCourses
FROM dj_beisen_course_staff
WHERE
user_id IN
<foreach
collection=
"beiSenUserIdList"
open=
"("
item=
"i"
close=
")"
separator=
","
>
#{i}
</foreach>
AND learn_status = '50'
AND cast(learn_end_time as date)
>
= #{startDate, jdbcType=DATE}
AND cast(learn_end_time as date)
<
= #{endDate, jdbcType=DATE}
AND deleted_flag = 'N'
GROUP BY user_id
</select>
<select
id=
"queryCoachingTimes"
resultType=
"cn.com.glsx.dj.supervisor.dto.MapperQueryEmployeeTrainingInfoDTO"
>
SELECT
store_manager_phone AS phone,
COUNT(*) AS coachingTimes
FROM supervisor_task_info
WHERE
store_manager_phone IN
<foreach
collection=
"phoneList"
open=
"("
item=
"i"
close=
")"
separator=
","
>
#{i}
</foreach>
AND task_type = 5
AND task_status = 2
AND cast(create_time as date)
>
= #{startDate, jdbcType=DATE}
AND cast(create_time as date)
<
= #{endDate, jdbcType=DATE}
AND deleted_flag = 'N'
GROUP BY store_manager_phone
</select>
</mapper>
\ No newline at end of file
rpc-dj-supervisor/src/test/java/cn/com/glsx/dj/supervisor/service/SupervisorEmployeeTrainingInfoServiceTest.java
0 → 100644
View file @
95bbfb0
package
cn
.
com
.
glsx
.
dj
.
supervisor
.
service
;
import
cn.com.glsx.dj.supervisor.dto.EmployeeTrainingInfoDTO
;
import
cn.com.glsx.dj.supervisor.dto.EmployeeTrainingInfoRequestDTO
;
import
com.alibaba.fastjson.JSON
;
import
org.junit.Test
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
java.util.List
;
/**
* @Title:
* @Description:
* @Author xiehx
* @Date 2026/3/12
**/
public
class
SupervisorEmployeeTrainingInfoServiceTest
extends
BaseServiceTest
{
@Autowired
private
SupervisorEmployeeTrainingInfoService
supervisorEmployeeTrainingInfoService
;
@Test
public
void
testGetAllEmployeeTrainingInfo
()
{
EmployeeTrainingInfoRequestDTO
request
=
new
EmployeeTrainingInfoRequestDTO
();
request
.
setStartDate
(
"2021-03-12"
);
request
.
setEndDate
(
"2026-03-12"
);
request
.
setSortField
(
1
);
request
.
setSortOrder
(
1
);
List
<
EmployeeTrainingInfoDTO
>
trainingInfo
=
supervisorEmployeeTrainingInfoService
.
getAllEmployeeTrainingInfo
(
request
);
System
.
out
.
println
(
JSON
.
toJSONString
(
trainingInfo
));
}
}
\ No newline at end of file
rpc-dj-supervisor/src/test/java/cn/com/glsx/dj/supervisor/service/SupervisorTaskInfoServiceTest.java
View file @
95bbfb0
package
cn
.
com
.
glsx
.
dj
.
supervisor
.
service
;
import
cn.com.glsx.dj.supervisor.dto.SupervisorTaskDTO
;
import
cn.com.glsx.dj.supervisor.model.SupervisorTaskCourse
;
import
cn.com.glsx.dj.supervisor.model.SupervisorTaskImage
;
import
com.alibaba.fastjson.JSON
;
import
org.junit.Test
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
java.util.ArrayList
;
/**
* @Title:
* @Description:
...
...
@@ -21,4 +25,33 @@ public class SupervisorTaskInfoServiceTest extends BaseServiceTest {
SupervisorTaskDTO
detail
=
supervisorTaskInfoService
.
getTaskDetailById
(
1L
);
System
.
out
.
println
(
JSON
.
toJSONString
(
detail
));
}
@Test
public
void
testSubmitCoaching
()
{
SupervisorTaskDTO
request
=
new
SupervisorTaskDTO
();
request
.
setSupervisorPhone
(
"13603070903"
);
request
.
setSupervisorName
(
"张三"
);
request
.
setStoreManagerName
(
"赵惠惠"
);
request
.
setStoreManagerPhone
(
"18902640418"
);
// 设置其他全部参数
request
.
setMerchantId
(
43423334
);
request
.
setMerchantName
(
"萨达梵蒂冈"
);
request
.
setTaskContext
(
"督导记录sdhnasuihfasifnasfnassjasidjkioasdasfn"
);
ArrayList
<
SupervisorTaskCourse
>
taskCourseList
=
new
ArrayList
<>();
SupervisorTaskCourse
course
=
new
SupervisorTaskCourse
();
course
.
setBcCourseId
(
"7454d3dc-1df1-485a-8d14-196ac03703ab"
);
course
.
setBcCourseName
(
"智界R7谈客案例-攻防能力篇"
);
taskCourseList
.
add
(
course
);
request
.
setTaskCourseList
(
taskCourseList
);
ArrayList
<
SupervisorTaskImage
>
taskImageList
=
new
ArrayList
<>();
SupervisorTaskImage
image
=
new
SupervisorTaskImage
();
image
.
setImageUrl
(
"http://oss.glsx.com/123456.jpg"
);
taskImageList
.
add
(
image
);
request
.
setTaskImageList
(
taskImageList
);
Long
id
=
supervisorTaskInfoService
.
submitCoaching
(
request
);
System
.
out
.
println
(
id
);
}
}
\ No newline at end of file
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