Commit 6e5b7b05 by 谢海旭

v5.7.0版本 飞行督导:团队-人员看板-培训经历

1 parent 99d07087
...@@ -19,6 +19,11 @@ public class EmployeeTrainingInfoRequestDTO implements Serializable { ...@@ -19,6 +19,11 @@ public class EmployeeTrainingInfoRequestDTO implements Serializable {
private Integer businessType; private Integer businessType;
/** /**
* 驻店手机号
*/
private String storeManagerPhone;
/**
* 开始日期 * 开始日期
*/ */
private String startDate; private String startDate;
......
package cn.com.glsx.dj.supervisor.dto;
import lombok.Data;
import java.io.Serializable;
/**
* 驻店培训列表返回 DTO
*
* @author xiehx
* @date 2026-03-12
*/
@Data
public class TrainingListDTO implements Serializable {
/**
* 带教任务ID
*/
private Integer taskId;
/**
* 培训名称(课程标题 / 带教任务描述)
*/
private String name;
/**
* 完成时间,格式 yyyy-MM-dd HH:mm:ss
*/
private String completedTime;
}
package cn.com.glsx.dj.supervisor.dto;
import lombok.Data;
import java.io.Serializable;
/**
* 查询驻店培训列表请求 DTO
*
* @author xiehx
* @date 2026-03-12
*/
@Data
public class TrainingListRequestDTO implements Serializable {
/**
* 业务类型(1-延保、2-权益、3-轻改)
*/
private Integer businessType;
/**
* 驻店手机号
*/
private String storeManagerPhone;
/**
* 开始日期 yyyy-MM-dd
*/
private String startDate;
/**
* 结束日期 yyyy-MM-dd
*/
private String endDate;
/**
* 培训类型(1-课程学习、2-督导带教)
*/
private Integer trainingType;
}
package cn.com.glsx.dj.supervisor.enums;
import lombok.AllArgsConstructor;
import lombok.Getter;
/**
* 培训类型枚举
*
* @author xiehx
* @date 2026-03-12
*/
@Getter
@AllArgsConstructor
public enum TrainingTypeEnum {
/** 课程学习 */
COURSE_LEARNING(1, "课程学习"),
/** 督导带教 */
COACHING(2, "督导带教");
private Integer code;
private String name;
}
...@@ -2,6 +2,8 @@ package cn.com.glsx.dj.supervisor.remote; ...@@ -2,6 +2,8 @@ package cn.com.glsx.dj.supervisor.remote;
import cn.com.glsx.dj.supervisor.dto.EmployeeTrainingInfoRequestDTO; import cn.com.glsx.dj.supervisor.dto.EmployeeTrainingInfoRequestDTO;
import cn.com.glsx.dj.supervisor.dto.EmployeeTrainingInfoDTO; import cn.com.glsx.dj.supervisor.dto.EmployeeTrainingInfoDTO;
import cn.com.glsx.dj.supervisor.dto.TrainingListDTO;
import cn.com.glsx.dj.supervisor.dto.TrainingListRequestDTO;
import cn.com.glsx.framework.core.annotation.ApiMethod; import cn.com.glsx.framework.core.annotation.ApiMethod;
import cn.com.glsx.framework.core.annotation.ApiParam; import cn.com.glsx.framework.core.annotation.ApiParam;
import cn.com.glsx.framework.core.annotation.ApiResponse; import cn.com.glsx.framework.core.annotation.ApiResponse;
...@@ -23,4 +25,9 @@ public interface SupervisorEmployeeTrainingInfoRemote { ...@@ -23,4 +25,9 @@ public interface SupervisorEmployeeTrainingInfoRemote {
@ApiParam(name = "request", notes = "查询条件", dataType = ApiParam.DataTypeEnum.OBJECT, required = true) @ApiParam(name = "request", notes = "查询条件", dataType = ApiParam.DataTypeEnum.OBJECT, required = true)
@ApiResponse("列表结果") @ApiResponse("列表结果")
RpcResponse<List<EmployeeTrainingInfoDTO>> getAllEmployeeTrainingInfo(EmployeeTrainingInfoRequestDTO request); RpcResponse<List<EmployeeTrainingInfoDTO>> getAllEmployeeTrainingInfo(EmployeeTrainingInfoRequestDTO request);
@ApiMethod("查询驻店培训列表")
@ApiParam(name = "request", notes = "查询条件", dataType = ApiParam.DataTypeEnum.OBJECT, required = true)
@ApiResponse("培训列表")
RpcResponse<List<TrainingListDTO>> getTrainingList(TrainingListRequestDTO request);
} }
...@@ -3,6 +3,7 @@ package cn.com.glsx.dj.supervisor.mapper; ...@@ -3,6 +3,7 @@ package cn.com.glsx.dj.supervisor.mapper;
import cn.com.glsx.dj.supervisor.dto.MapperQueryEmployeeTrainingInfoDTO; import cn.com.glsx.dj.supervisor.dto.MapperQueryEmployeeTrainingInfoDTO;
import cn.com.glsx.dj.supervisor.dto.SupervisorTaskDTO; import cn.com.glsx.dj.supervisor.dto.SupervisorTaskDTO;
import cn.com.glsx.dj.supervisor.dto.SupervisorTaskQueryDTO; import cn.com.glsx.dj.supervisor.dto.SupervisorTaskQueryDTO;
import cn.com.glsx.dj.supervisor.dto.TrainingListDTO;
import cn.com.glsx.dj.supervisor.model.SupervisorTaskInfo; import cn.com.glsx.dj.supervisor.model.SupervisorTaskInfo;
import org.apache.ibatis.annotations.MapKey; import org.apache.ibatis.annotations.MapKey;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
...@@ -35,4 +36,18 @@ public interface SupervisorTaskInfoMapper extends OreMapper<SupervisorTaskInfo> ...@@ -35,4 +36,18 @@ public interface SupervisorTaskInfoMapper extends OreMapper<SupervisorTaskInfo>
@MapKey("phone") @MapKey("phone")
Map<String, MapperQueryEmployeeTrainingInfoDTO> queryCoachingTimes(@Param("phoneList") List<String> phoneList, @Param("startDate") String startDate, @Param("endDate") String endDate); Map<String, MapperQueryEmployeeTrainingInfoDTO> queryCoachingTimes(@Param("phoneList") List<String> phoneList, @Param("startDate") String startDate, @Param("endDate") String endDate);
/**
* 查询驻店课程学习列表(按完成时间倒序)
*/
List<TrainingListDTO> queryCourseTrainingList(@Param("beiSenUserId") Integer beiSenUserId,
@Param("startDate") String startDate,
@Param("endDate") String endDate);
/**
* 查询驻店带教列表(按完成时间倒序)
*/
List<TrainingListDTO> queryCoachingTrainingList(@Param("storeManagerPhone") String storeManagerPhone,
@Param("startDate") String startDate,
@Param("endDate") String endDate);
} }
\ No newline at end of file \ No newline at end of file
...@@ -2,6 +2,8 @@ package cn.com.glsx.dj.supervisor.remote; ...@@ -2,6 +2,8 @@ package cn.com.glsx.dj.supervisor.remote;
import cn.com.glsx.dj.supervisor.dto.EmployeeTrainingInfoRequestDTO; import cn.com.glsx.dj.supervisor.dto.EmployeeTrainingInfoRequestDTO;
import cn.com.glsx.dj.supervisor.dto.EmployeeTrainingInfoDTO; import cn.com.glsx.dj.supervisor.dto.EmployeeTrainingInfoDTO;
import cn.com.glsx.dj.supervisor.dto.TrainingListDTO;
import cn.com.glsx.dj.supervisor.dto.TrainingListRequestDTO;
import cn.com.glsx.dj.supervisor.service.SupervisorEmployeeTrainingInfoService; import cn.com.glsx.dj.supervisor.service.SupervisorEmployeeTrainingInfoService;
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.enums.DefaultErrorEnum;
...@@ -43,4 +45,20 @@ public class SupervisorEmployeeTrainingInfoRemoteImpl implements SupervisorEmplo ...@@ -43,4 +45,20 @@ public class SupervisorEmployeeTrainingInfoRemoteImpl implements SupervisorEmplo
return RpcResponse.error(DefaultErrorEnum.SERVICE_ERROR, e.getMessage()); return RpcResponse.error(DefaultErrorEnum.SERVICE_ERROR, e.getMessage());
} }
} }
@Override
public RpcResponse<List<TrainingListDTO>> getTrainingList(TrainingListRequestDTO request) {
try {
log.info("查询驻店培训列表,请求参数:{}", request);
List<TrainingListDTO> result = supervisorEmployeeTrainingInfoService.getTrainingList(request);
log.info("查询驻店培训列表成功,总记录数:{}", result != null ? result.size() : 0);
return RpcResponse.success(result);
} catch (RpcServiceException e) {
log.error("cn.com.glsx.dj.supervisor.remote.SupervisorEmployeeTrainingInfoRemoteImpl.getTrainingList error {}", e);
return RpcResponse.error(e.getError(), e.getMessage());
} catch (Exception e) {
log.error("cn.com.glsx.dj.supervisor.remote.SupervisorEmployeeTrainingInfoRemoteImpl.getTrainingList system error {}", e);
return RpcResponse.error(DefaultErrorEnum.SERVICE_ERROR, e.getMessage());
}
}
} }
...@@ -24,15 +24,6 @@ public class SupervisorAiAnalysisRecordService { ...@@ -24,15 +24,6 @@ public class SupervisorAiAnalysisRecordService {
public SupervisorAiAnalysisRecord getAiAnalysisRecord(SupervisorAiAnalysisRecord record) { public SupervisorAiAnalysisRecord getAiAnalysisRecord(SupervisorAiAnalysisRecord record) {
try { try {
log.info("查询 AI 分析记录,查询条件:{}", record); log.info("查询 AI 分析记录,查询条件:{}", record);
// 如果 startDate 和 endDate 包含时间,转换为纯日期格式
if (record.getStartDate() != null) {
// 去除时间部分,只保留日期
record.setStartDate(DateUtil.beginOfDay(record.getStartDate()));
}
if (record.getEndDate() != null) {
record.setEndDate(DateUtil.endOfDay(record.getEndDate()));
}
record.setDeletedFlag(BaseModel.DeletedFlagEnum.N.name());
SupervisorAiAnalysisRecord result = supervisorAiAnalysisRecordMapper.selectByCondition(record); SupervisorAiAnalysisRecord result = supervisorAiAnalysisRecordMapper.selectByCondition(record);
return result; return result;
} catch (Exception e) { } catch (Exception e) {
......
package cn.com.glsx.dj.supervisor.service; package cn.com.glsx.dj.supervisor.service;
import cn.com.glsx.dj.supervisor.dto.EmployeeTrainingInfoDTO; import cn.com.glsx.dj.supervisor.dto.*;
import cn.com.glsx.dj.supervisor.dto.EmployeeTrainingInfoRequestDTO; import cn.com.glsx.dj.supervisor.enums.TrainingTypeEnum;
import cn.com.glsx.dj.supervisor.dto.MapperQueryEmployeeTrainingInfoDTO;
import cn.com.glsx.dj.supervisor.mapper.SupervisorTaskInfoMapper; import cn.com.glsx.dj.supervisor.mapper.SupervisorTaskInfoMapper;
import cn.com.glsx.merchants.dto.beisen.BeiSenEmployeeListResonseDTO; import cn.com.glsx.merchants.dto.beisen.BeiSenEmployeeListResonseDTO;
import com.google.common.collect.Lists;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
...@@ -37,7 +38,9 @@ public class SupervisorEmployeeTrainingInfoService { ...@@ -37,7 +38,9 @@ public class SupervisorEmployeeTrainingInfoService {
* @return 员工培训信息列表 * @return 员工培训信息列表
*/ */
public List<EmployeeTrainingInfoDTO> getAllEmployeeTrainingInfo(EmployeeTrainingInfoRequestDTO request) { public List<EmployeeTrainingInfoDTO> getAllEmployeeTrainingInfo(EmployeeTrainingInfoRequestDTO request) {
// TODO 1、根据督导手机号、业务类型 关联查询全部员工信息 判空处理等 // TODO 1、根据督导手机号、业务类型 关联查询全部员工信息
// 2、单个员工查询
// 3、判空处理等
List<String> phoneList = new ArrayList<String>(); List<String> phoneList = new ArrayList<String>();
phoneList.add("13603070903"); phoneList.add("13603070903");
List<BeiSenEmployeeListResonseDTO> beiSenEmployeeList = supervisorLearningCenterService.listEmployeeInfoByStaffPhone(phoneList); List<BeiSenEmployeeListResonseDTO> beiSenEmployeeList = supervisorLearningCenterService.listEmployeeInfoByStaffPhone(phoneList);
...@@ -76,4 +79,31 @@ public class SupervisorEmployeeTrainingInfoService { ...@@ -76,4 +79,31 @@ public class SupervisorEmployeeTrainingInfoService {
return employeeTrainingInfoList; return employeeTrainingInfoList;
} }
/**
* 查询驻店培训列表
*
* @param request 查询条件
* @return 培训列表
*/
public List<TrainingListDTO> getTrainingList(TrainingListRequestDTO request) {
if (TrainingTypeEnum.COACHING.getCode().equals(request.getTrainingType())) {
return supervisorTaskInfoMapper.queryCoachingTrainingList(
request.getStoreManagerPhone(),
request.getStartDate(),
request.getEndDate()
);
} else {
List<BeiSenEmployeeListResonseDTO> listEmployeeInfoByStaffPhone = supervisorLearningCenterService.listEmployeeInfoByStaffPhone(Lists.newArrayList(request.getStoreManagerPhone()));
if (CollectionUtils.isEmpty(listEmployeeInfoByStaffPhone)) {
return new ArrayList<>();
}
return supervisorTaskInfoMapper.queryCourseTrainingList(
listEmployeeInfoByStaffPhone.get(0).getUserID(),
request.getStartDate(),
request.getEndDate()
);
}
}
} }
...@@ -150,4 +150,39 @@ ...@@ -150,4 +150,39 @@
GROUP BY store_manager_phone GROUP BY store_manager_phone
</select> </select>
<select id="queryCourseTrainingList" resultType="cn.com.glsx.dj.supervisor.dto.TrainingListDTO">
SELECT
bc.title AS name,
DATE_FORMAT(bcs.learn_end_time, '%Y-%m-%d %H:%i:%s') AS completedTime
FROM dj_beisen_course_staff bcs
INNER JOIN dj_beisen_course bc ON bc.id = bcs.course_id AND bc.deleted_flag = 'N'
WHERE bcs.deleted_flag = 'N'
AND bcs.learn_status = '50'
AND bcs.user_id = #{beiSenUserId}
<if test="startDate != null and startDate != ''">
AND CAST(bcs.learn_end_time AS DATE) &gt;= #{startDate, jdbcType=DATE}
</if>
<if test="endDate != null and endDate != ''">
AND CAST(bcs.learn_end_time AS DATE) &lt;= #{endDate, jdbcType=DATE}
</if>
ORDER BY bcs.learn_end_time DESC
</select>
<select id="queryCoachingTrainingList" resultType="cn.com.glsx.dj.supervisor.dto.TrainingListDTO">
SELECT
id AS taskId,
DATE_FORMAT(create_time, '%Y-%m-%d %H:%i:%s') AS completedTime
FROM supervisor_task_info
WHERE deleted_flag = 'N'
AND task_type = 5
AND store_manager_phone = #{storeManagerPhone}
<if test="startDate != null and startDate != ''">
AND CAST(create_time AS DATE) &gt;= #{startDate, jdbcType=DATE}
</if>
<if test="endDate != null and endDate != ''">
AND CAST(create_time AS DATE) &lt;= #{endDate, jdbcType=DATE}
</if>
ORDER BY create_time DESC
</select>
</mapper> </mapper>
\ No newline at end of file \ No newline at end of file
...@@ -2,6 +2,9 @@ package cn.com.glsx.dj.supervisor.service; ...@@ -2,6 +2,9 @@ package cn.com.glsx.dj.supervisor.service;
import cn.com.glsx.dj.supervisor.dto.EmployeeTrainingInfoDTO; import cn.com.glsx.dj.supervisor.dto.EmployeeTrainingInfoDTO;
import cn.com.glsx.dj.supervisor.dto.EmployeeTrainingInfoRequestDTO; import cn.com.glsx.dj.supervisor.dto.EmployeeTrainingInfoRequestDTO;
import cn.com.glsx.dj.supervisor.dto.TrainingListDTO;
import cn.com.glsx.dj.supervisor.dto.TrainingListRequestDTO;
import cn.com.glsx.dj.supervisor.enums.TrainingTypeEnum;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import org.junit.Test; import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -29,4 +32,15 @@ public class SupervisorEmployeeTrainingInfoServiceTest extends BaseServiceTest { ...@@ -29,4 +32,15 @@ public class SupervisorEmployeeTrainingInfoServiceTest extends BaseServiceTest {
List<EmployeeTrainingInfoDTO> trainingInfo = supervisorEmployeeTrainingInfoService.getAllEmployeeTrainingInfo(request); List<EmployeeTrainingInfoDTO> trainingInfo = supervisorEmployeeTrainingInfoService.getAllEmployeeTrainingInfo(request);
System.out.println(JSON.toJSONString(trainingInfo)); System.out.println(JSON.toJSONString(trainingInfo));
} }
@Test
public void testGetTrainingList_courseLearning() {
TrainingListRequestDTO request = new TrainingListRequestDTO();
request.setStoreManagerPhone("13603070903");
request.setStartDate("2020-01-01");
request.setEndDate("2026-03-12");
request.setTrainingType(TrainingTypeEnum.COACHING.getCode());
List<TrainingListDTO> result = supervisorEmployeeTrainingInfoService.getTrainingList(request);
System.out.println(JSON.toJSONString(result));
}
} }
\ No newline at end of file \ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!