Commit c26767fa by 林冲

Merge branch 'v5.8.1' into 'main'

上线合并

See merge request !1
2 parents 6121436c 6175a4d9
Showing 61 changed files with 1705 additions and 73 deletions
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
</parent> </parent>
<groupId>cn.com.glsx.dj</groupId> <groupId>cn.com.glsx.dj</groupId>
<artifactId>rpc-dj-supervisor-api</artifactId> <artifactId>rpc-dj-supervisor-api</artifactId>
<version>1.0.0-SNAPSHOT</version> <version>5.8.1-SNAPSHOT</version>
<name>rpc-dj-supervisor-api</name> <name>rpc-dj-supervisor-api</name>
<properties> <properties>
<deploy.scanPackage>cn.com.glsx.dj.supervisor.remote</deploy.scanPackage> <deploy.scanPackage>cn.com.glsx.dj.supervisor.remote</deploy.scanPackage>
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
<dependency> <dependency>
<groupId>cn.com.glsx.dj</groupId> <groupId>cn.com.glsx.dj</groupId>
<artifactId>rpc-dj-supervisor-api</artifactId> <artifactId>rpc-dj-supervisor-api</artifactId>
<version>1.0.0-SNAPSHOT</version> <version>5.8.1-SNAPSHOT</version>
</dependency> </dependency>
</dependencies> </dependencies>
</plugin> </plugin>
......
...@@ -50,7 +50,7 @@ public class ExcellentCaseDetailDTO implements Serializable { ...@@ -50,7 +50,7 @@ public class ExcellentCaseDetailDTO implements Serializable {
@ApiModelProperty(notes = "接待时间") @ApiModelProperty(notes = "接待时间")
private String receptionTime; private String receptionTime;
@ApiModelProperty(notes = "接待状态") @ApiModelProperty(notes = "接待状态, 1.成交 0.战败")
private Integer receptionStatus; private Integer receptionStatus;
@ApiModelProperty(notes = "员工UUID") @ApiModelProperty(notes = "员工UUID")
......
...@@ -28,6 +28,18 @@ public class ExcellentCaseReviewQueryDTO implements Serializable { ...@@ -28,6 +28,18 @@ public class ExcellentCaseReviewQueryDTO implements Serializable {
@ApiModelProperty(notes = "审核状态:0-待审核,1-通过,2-驳回") @ApiModelProperty(notes = "审核状态:0-待审核,1-通过,2-驳回")
private Integer reviewStatus; private Integer reviewStatus;
@ApiModelProperty(notes = "任务ID(根据任务ID查询优秀案例时使用)")
private Long taskId;
@ApiModelProperty(notes = "提交人ID(督导UUID)")
private String submitterId;
@ApiModelProperty(notes = "开始日期,格式yyyy-MM-dd")
private String startDate;
@ApiModelProperty(notes = "结束日期,格式yyyy-MM-dd")
private String endDate;
@ApiModelProperty(notes = "页码") @ApiModelProperty(notes = "页码")
private Integer pageNum; private Integer pageNum;
......
...@@ -2,6 +2,9 @@ package cn.com.glsx.dj.supervisor.dto; ...@@ -2,6 +2,9 @@ package cn.com.glsx.dj.supervisor.dto;
import cn.com.glsx.dj.supervisor.model.SupervisorTaskCourse; import cn.com.glsx.dj.supervisor.model.SupervisorTaskCourse;
import cn.com.glsx.dj.supervisor.model.SupervisorTaskImage; import cn.com.glsx.dj.supervisor.model.SupervisorTaskImage;
import cn.com.glsx.dj.supervisor.model.SupervisorTaskMerchant;
import cn.com.glsx.dj.supervisor.model.SupervisorTaskParticipant;
import cn.com.glsx.dj.supervisor.model.SupervisorTeachingDetail;
import cn.com.glsx.dj.supervisor.model.SupervisorWeekTaskStaff; import cn.com.glsx.dj.supervisor.model.SupervisorWeekTaskStaff;
import cn.com.glsx.dj.supervisor.remote.SupervisorTaskInfoRemote; import cn.com.glsx.dj.supervisor.remote.SupervisorTaskInfoRemote;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
...@@ -85,6 +88,18 @@ public class SupervisorTaskDTO implements Serializable { ...@@ -85,6 +88,18 @@ public class SupervisorTaskDTO implements Serializable {
private Integer audioReviewCompletedCount; private Integer audioReviewCompletedCount;
/** /**
* 周任务完成标准(分母)
*/
@ApiModelProperty(notes = "周任务完成标准(分母)")
private Integer weeklyTaskTotalCount;
/**
* 周任务已完成数量(分子)
*/
@ApiModelProperty(notes = "周任务已完成数量(分子)")
private Integer weeklyTaskCompletedCount;
/**
* 创建时间 * 创建时间
*/ */
@ApiModelProperty(notes = "创建时间") @ApiModelProperty(notes = "创建时间")
...@@ -108,6 +123,11 @@ public class SupervisorTaskDTO implements Serializable { ...@@ -108,6 +123,11 @@ public class SupervisorTaskDTO implements Serializable {
private String startDate; private String startDate;
private String endDate;
@ApiModelProperty(notes = "督导UUID")
private String supervisorUuid;
/** /**
* 性别 * 性别
...@@ -135,4 +155,46 @@ public class SupervisorTaskDTO implements Serializable { ...@@ -135,4 +155,46 @@ public class SupervisorTaskDTO implements Serializable {
@ApiModelProperty(notes = "课程列表") @ApiModelProperty(notes = "课程列表")
private List<SupervisorTaskCourse> taskCourseList; private List<SupervisorTaskCourse> taskCourseList;
/**
* 后续工作事项
*/
@ApiModelProperty(notes = "后续工作事项")
private String nextWorkItems;
/**
* 需协助事项
*/
@ApiModelProperty(notes = "需协助事项")
private String needAssistItems;
/**
* 门店关联列表
*/
@ApiModelProperty(notes = "门店关联列表")
private List<SupervisorTaskMerchant> taskMerchantList;
/**
* 带教进度/结果
*/
@ApiModelProperty(notes = "带教进度/结果(1000字以内)")
private String teachingProgress;
/**
* 下月计划
*/
@ApiModelProperty(notes = "下月计划(1000字以内)")
private String nextMonthPlan;
/**
* 带教详情
*/
@ApiModelProperty(notes = "带教详情")
private SupervisorTeachingDetail teachingDetail;
/**
* 参与人员列表
*/
@ApiModelProperty(notes = "参与人员列表")
private List<SupervisorTaskParticipant> participantList;
} }
...@@ -6,6 +6,7 @@ import lombok.ToString; ...@@ -6,6 +6,7 @@ import lombok.ToString;
import java.io.Serializable; import java.io.Serializable;
import java.util.List; import java.util.List;
import java.util.Map;
@Data @Data
@ToString @ToString
...@@ -39,6 +40,9 @@ public class SupervisorTaskQueryDTO implements Serializable { ...@@ -39,6 +40,9 @@ public class SupervisorTaskQueryDTO implements Serializable {
@ApiModelProperty(notes = "督导管理的门店id列表") @ApiModelProperty(notes = "督导管理的门店id列表")
private List<Integer> merchantIdList; private List<Integer> merchantIdList;
@ApiModelProperty(notes = "按督导类型分组的门店id列表,key=督导类型(directorType), value=门店id列表")
private Map<Integer, List<Integer>> directorTypeMerchantMap;
@ApiModelProperty(notes = "督导管理的员工手机号列表") @ApiModelProperty(notes = "督导管理的员工手机号列表")
private List<String> staffPhoneList; private List<String> staffPhoneList;
......
package cn.com.glsx.dj.supervisor.dto;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
@Data
public class SupervisorTeachingListDTO implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(notes = "任务ID")
private Long id;
@ApiModelProperty(notes = "带教场景名称")
private String teachingSceneName;
@ApiModelProperty(notes = "带教时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8")
private Date teachingTime;
@ApiModelProperty(notes = "带教方式名称")
private String teachingMethodName;
@ApiModelProperty(notes = "带教主题名称")
private String teachingTopicName;
@ApiModelProperty(notes = "带教门店(多个以逗号分隔)")
private String merchantNames;
@ApiModelProperty(notes = "参与人员(多个以逗号分隔)")
private String participantNames;
}
package cn.com.glsx.dj.supervisor.dto;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.ToString;
import java.io.Serializable;
import java.util.Date;
@Data
@ToString
public class SupervisorTeamStaffDTO implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(notes = "主键ID")
private Integer id;
@ApiModelProperty(notes = "驻店员工姓名")
private String staffName;
@ApiModelProperty(notes = "驻店员工手机号")
private String staffPhone;
@ApiModelProperty(notes = "招聘通道(1.校招,2.社招)")
private Integer hireType;
@ApiModelProperty(notes = "入职时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date entryTime;
@ApiModelProperty(notes = "职级类型(0:实习生(理论),1:实习生(实践),2:初级驻店,3:中级驻店,4:高级驻店,5:小店长,6:大店长,7:初级区域督导,8:中级区域督导,9:高级区域督导)")
private Integer jobType;
@ApiModelProperty(notes = "职称类型(1:导师)")
private Integer titleType;
@ApiModelProperty(notes = "员工业务标签(多个用逗号分隔,0:权益+延保,1:轻改)")
private String staffSceneLabel;
@ApiModelProperty(notes = "当前归属门店商户号")
private Integer merchantId;
@ApiModelProperty(notes = "当前归属门店商户名称")
private String merchantName;
@ApiModelProperty(notes = "服务门店商户号")
private Integer serviceMerchantId;
@ApiModelProperty(notes = "服务门店商户名称")
private String serviceMerchantName;
@ApiModelProperty(notes = "当前归属园区店商户号")
private Integer yqMerchantId;
@ApiModelProperty(notes = "当前归属园区店商户名称")
private String yqMerchantName;
@ApiModelProperty(notes = "在职状态(0:在职,1:离职,2:待激活 3:已分配门店)")
private Integer workingStatus;
@ApiModelProperty(notes = "导师姓名")
private String mentorName;
@ApiModelProperty(notes = "导师手机号")
private String mentorPhone;
@ApiModelProperty(notes = "创建来源")
private Integer createdSource;
@ApiModelProperty(notes = "备注")
private String remark;
}
\ No newline at end of file \ No newline at end of file
package cn.com.glsx.dj.supervisor.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.ToString;
import java.io.Serializable;
import java.util.List;
@Data
@ToString
public class SupervisorTeamStaffQueryDTO implements Serializable {
@ApiModelProperty(notes = "督导手机号")
private String supervisorPhone;
@ApiModelProperty(notes = "门店商户号列表")
private List<Integer> merchantIdList;
}
\ No newline at end of file \ No newline at end of file
package cn.com.glsx.dj.supervisor.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
@Data
public class UnfinishedTaskCountDTO implements Serializable {
@ApiModelProperty(notes = "每日任务未完成数量(日报、录音、带教)")
private Integer dailyCount;
@ApiModelProperty(notes = "每周任务未完成数量(优秀案例录音、带教要求)")
private Integer weeklyCount;
@ApiModelProperty(notes = "每月任务未完成数量(月报)")
private Integer monthlyCount;
@ApiModelProperty(notes = "专项任务未完成数量")
private Integer specialCount;
}
package cn.com.glsx.dj.supervisor.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
@Data
public class UnfinishedTaskCountReqDTO implements Serializable {
@ApiModelProperty(notes = "督导手机号", required = true)
private String supervisorPhone;
@ApiModelProperty(notes = "开始日期(yyyy-MM-dd,可为空)")
private String startDate;
@ApiModelProperty(notes = "结束日期(yyyy-MM-dd,可为空)")
private String endDate;
}
package cn.com.glsx.dj.supervisor.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.ToString;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
/**
* 周任务状态变更请求DTO
* 用于优秀案例录音、带教要求两类周任务的完成状态判定
*/
@Data
@ToString
public class WeeklyTaskStatusReqDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 任务类型(6-优秀案例录音,7-带教要求)
*/
@NotNull(message = "任务类型不能为空")
@ApiModelProperty(notes = "任务类型(6-优秀案例录音,7-带教要求)", required = true)
private Integer taskType;
/**
* 创建日期,用于推算所属周的起止日期(格式:yyyy-MM-dd)
*/
@NotBlank(message = "创建日期不能为空")
@ApiModelProperty(notes = "创建日期,格式yyyy-MM-dd", required = true)
private String createDate;
/**
* 督导UUID
*/
@NotBlank(message = "督导UUID不能为空")
@ApiModelProperty(notes = "督导UUID", required = true)
private String supervisorUuid;
}
package cn.com.glsx.dj.supervisor.dto;
import lombok.Data;
import java.io.Serializable;
/**
* 录音复盘统计(Mapper 查询用)
*/
@Data
public class WorkbenchAudioReviewStatDTO implements Serializable {
private static final long serialVersionUID = 1L;
private Long relationId;
private String supervisorName;
private String taskDate;
private Integer totalCount;
private Integer reviewedCount;
}
package cn.com.glsx.dj.supervisor.dto;
import lombok.Data;
import java.io.Serializable;
/**
* 优秀案例提报统计
*/
@Data
public class WorkbenchExcellentCaseCountDTO implements Serializable {
private static final long serialVersionUID = 1L;
private String submitterName;
/** 提交日期 yyyy-MM-dd */
private String submitDate;
private Integer count;
}
package cn.com.glsx.dj.supervisor.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
* 工作台报表响应
*/
@Data
public class WorkbenchReportDTO implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(notes = "报表类型:1-今日动态 2-本周概览 3-月度总览 4-专项督办")
private Integer reportType;
@ApiModelProperty(notes = "查询开始日期")
private String startDate;
@ApiModelProperty(notes = "查询结束日期")
private String endDate;
@ApiModelProperty(notes = "顶部统计数据")
private WorkbenchReportStatisticsDTO statistics;
@ApiModelProperty(notes = "督导任务数据列表")
private List<WorkbenchReportSupervisorItemDTO> supervisorList;
}
package cn.com.glsx.dj.supervisor.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
/**
* 工作台报表查询参数
*/
@Data
public class WorkbenchReportQueryDTO implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(notes = "报表类型:1-今日动态 2-本周概览 3-月度总览 4-专项督办", required = true)
private Integer reportType;
@ApiModelProperty(notes = "开始日期 yyyy-MM-dd", required = true)
private String startDate;
@ApiModelProperty(notes = "结束日期 yyyy-MM-dd", required = true)
private String endDate;
@ApiModelProperty(notes = "督导姓名(模糊搜索,仅过滤列表,不影响顶部统计)")
private String supervisorName;
}
package cn.com.glsx.dj.supervisor.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
/**
* 工作台报表顶部统计
*/
@Data
public class WorkbenchReportStatisticsDTO implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(notes = "完成人数")
private Integer completedCount;
@ApiModelProperty(notes = "部分完成人数(专项督办无此项)")
private Integer partialCompletedCount;
@ApiModelProperty(notes = "未完成人数")
private Integer unfinishedCount;
}
package cn.com.glsx.dj.supervisor.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
* 工作台报表-督导任务数据卡片
*/
@Data
public class WorkbenchReportSupervisorItemDTO implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(notes = "督导姓名")
private String supervisorName;
@ApiModelProperty(notes = "督导手机号")
private String supervisorPhone;
@ApiModelProperty(notes = "督导UUID")
private String supervisorUuid;
@ApiModelProperty(notes = "完成状态:0-未完成 1-部分完成 2-已完成")
private Integer completionStatus;
@ApiModelProperty(notes = "完成状态名称")
private String completionStatusName;
// ---------- 今日动态 ----------
@ApiModelProperty(notes = "战败复盘率(百分比,0-100)")
private Integer defeatReviewRate;
@ApiModelProperty(notes = "战败复盘是否完成(复盘率>50%)")
private Boolean defeatReviewCompleted;
@ApiModelProperty(notes = "线上带教次数")
private Integer onlineTeachingCount;
@ApiModelProperty(notes = "线下带教次数")
private Integer offlineTeachingCount;
@ApiModelProperty(notes = "日报状态:0-未提交 1-在岗 2-调休")
private Integer dailyReportStatus;
@ApiModelProperty(notes = "日报状态名称")
private String dailyReportStatusName;
@ApiModelProperty(notes = "日报任务ID(可跳转详情)")
private Long dailyReportTaskId;
@ApiModelProperty(notes = "日报是否可进入详情")
private Boolean dailyReportDetailEnabled;
// ---------- 周/月概览 ----------
@ApiModelProperty(notes = "日报提交进度,如 3/4")
private String dailyReportProgress;
@ApiModelProperty(notes = "日报任务是否完成")
private Boolean dailyReportTaskCompleted;
@ApiModelProperty(notes = "复盘任务进度,如 2/4")
private String reviewTaskProgress;
@ApiModelProperty(notes = "复盘任务是否完成")
private Boolean reviewTaskCompleted;
@ApiModelProperty(notes = "带教任务进度,如 4/6 或 2/3(月)")
private String teachingTaskProgress;
@ApiModelProperty(notes = "带教任务是否完成")
private Boolean teachingTaskCompleted;
@ApiModelProperty(notes = "优秀录音提报进度,如 0/2 或 1/3(月)")
private String excellentCaseProgress;
@ApiModelProperty(notes = "优秀录音提报是否完成")
private Boolean excellentCaseTaskCompleted;
// ---------- 月度总览 ----------
@ApiModelProperty(notes = "月报状态:0-未提交 1-已提交")
private Integer monthReportStatus;
@ApiModelProperty(notes = "月报状态名称")
private String monthReportStatusName;
@ApiModelProperty(notes = "月报任务ID(可跳转详情)")
private Long monthReportTaskId;
@ApiModelProperty(notes = "月报是否可进入详情")
private Boolean monthReportDetailEnabled;
// ---------- 专项督办 ----------
@ApiModelProperty(notes = "专项任务完成情况,如 0/2")
private String specialTaskProgress;
@ApiModelProperty(notes = "专项任务是否全部完成")
private Boolean specialTaskCompleted;
@ApiModelProperty(notes = "专项任务列表")
private List<WorkbenchSpecialTaskItemDTO> specialTaskList;
}
package cn.com.glsx.dj.supervisor.dto;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
* 工作台报表任务行(Mapper 查询用)
*/
@Data
public class WorkbenchReportTaskRowDTO implements Serializable {
private static final long serialVersionUID = 1L;
private Long id;
private Integer taskType;
private Integer taskStatus;
private Integer onDutyFlag;
private String supervisorName;
private String supervisorPhone;
private String supervisorUuid;
private String merchantName;
private String taskDesc;
private String taskContext;
private Date createTime;
private Date updatedDate;
/** yyyy-MM-dd */
private String taskDate;
}
package cn.com.glsx.dj.supervisor.dto;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
* 专项任务明细
*/
@Data
public class WorkbenchSpecialTaskItemDTO implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(notes = "任务ID")
private Long taskId;
@ApiModelProperty(notes = "门店名称")
private String merchantName;
@ApiModelProperty(notes = "任务描述")
private String taskDesc;
@ApiModelProperty(notes = "督导记录")
private String taskContext;
@ApiModelProperty(notes = "任务状态 0-待完成 1-进行中 2-已完成")
private Integer taskStatus;
@ApiModelProperty(notes = "创建时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date createTime;
@ApiModelProperty(notes = "更新时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date updatedDate;
}
package cn.com.glsx.dj.supervisor.dto;
import lombok.Data;
import java.io.Serializable;
/**
* 带教场景统计(Mapper 查询用)
*/
@Data
public class WorkbenchTeachingCountDTO implements Serializable {
private static final long serialVersionUID = 1L;
private String supervisorName;
/** 1-线上 2-线下 */
private String teachingSceneCode;
private Integer count;
}
...@@ -4,7 +4,7 @@ import lombok.AllArgsConstructor; ...@@ -4,7 +4,7 @@ import lombok.AllArgsConstructor;
import lombok.Getter; import lombok.Getter;
/** /**
* 日报类型 0-日报 1-周报,2-月报, 3-录音, 4-专项 * 日报类型 0-日报 1-周报,2-月报, 3-录音, 4-专项, 5-带教, 6-优秀案例录音, 7-带教要求
*/ */
@Getter @Getter
@AllArgsConstructor @AllArgsConstructor
...@@ -26,7 +26,13 @@ public enum TaskTypeEnum { ...@@ -26,7 +26,13 @@ public enum TaskTypeEnum {
SPECIAL_RECORDING(4, "专项"), SPECIAL_RECORDING(4, "专项"),
/** 带教 */ /** 带教 */
TRAINING(5, "带教"); TRAINING(5, "带教"),
/** 优秀案例录音 */
EXCELLENT_CASE_AUDIO(6, "优秀案例录音"),
/** 带教要求 */
COACHING_REQUIREMENT(7, "带教要求");
private Integer code; private Integer code;
......
package cn.com.glsx.dj.supervisor.enums;
import lombok.AllArgsConstructor;
import lombok.Getter;
/**
* 工作台任务完成状态
*/
@Getter
@AllArgsConstructor
public enum WorkbenchCompletionStatusEnum {
/** 未完成 */
UNFINISHED(0, "未完成"),
/** 部分完成 */
PARTIAL(1, "部分完成"),
/** 已完成 */
COMPLETED(2, "已完成");
private final Integer code;
private final String name;
}
package cn.com.glsx.dj.supervisor.enums;
import lombok.AllArgsConstructor;
import lombok.Getter;
/**
* 日报提交状态(今日动态展示)
*/
@Getter
@AllArgsConstructor
public enum WorkbenchDailyReportStatusEnum {
/** 未提交 */
NOT_SUBMITTED(0, "未提交"),
/** 在岗 */
ON_DUTY(1, "在岗"),
/** 调休 */
REST(2, "调休");
private final Integer code;
private final String name;
}
package cn.com.glsx.dj.supervisor.enums;
import lombok.AllArgsConstructor;
import lombok.Getter;
/**
* 工作台报表类型
*/
@Getter
@AllArgsConstructor
public enum WorkbenchReportTypeEnum {
/** 今日动态 */
TODAY(1, "今日动态"),
/** 本周概览 */
WEEK(2, "本周概览"),
/** 月度总览 */
MONTH(3, "月度总览"),
/** 专项督办 */
SPECIAL(4, "专项督办");
private final Integer code;
private final String name;
public static WorkbenchReportTypeEnum of(Integer code) {
if (code == null) {
return null;
}
for (WorkbenchReportTypeEnum e : values()) {
if (e.code.equals(code)) {
return e;
}
}
return null;
}
}
package cn.com.glsx.dj.supervisor.enums;
import lombok.AllArgsConstructor;
import lombok.Getter;
/**
* 带教场景枚举
*/
@Getter
@AllArgsConstructor
public enum WorkbenchSceneCodeEnum {
/** 线上 */
ONLINE("1", "线上"),
/** 线下 */
OFFLINE("2", "线下");
private final String code;
private final String name;
}
package cn.com.glsx.dj.supervisor.enums;
import lombok.AllArgsConstructor;
import lombok.Getter;
/**
* 提交状态
*/
@Getter
@AllArgsConstructor
public enum WorkbenchSubmitStatusEnum {
/** 未提交 */
NOT_SUBMITTED(0, "未提交"),
/** 已提交 */
SUBMITTED(1, "已提交");
private final Integer code;
private final String name;
}
...@@ -141,4 +141,28 @@ public class SupervisorTaskInfo implements Serializable { ...@@ -141,4 +141,28 @@ public class SupervisorTaskInfo implements Serializable {
*/ */
@Column(name = "task_context") @Column(name = "task_context")
private String taskContext; private String taskContext;
/**
* 后续工作事项
*/
@Column(name = "next_work_items")
private String nextWorkItems;
/**
* 需协助事项
*/
@Column(name = "need_assist_items")
private String needAssistItems;
/**
* 带教进度/结果
*/
@Column(name = "teaching_progress")
private String teachingProgress;
/**
* 下月计划
*/
@Column(name = "next_month_plan")
private String nextMonthPlan;
} }
\ No newline at end of file \ No newline at end of file
package cn.com.glsx.dj.supervisor.model;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.ToString;
import java.io.Serializable;
import java.util.Date;
import javax.persistence.*;
@Data
@ToString
@Table(name = "supervisor_task_merchant")
public class SupervisorTaskMerchant implements Serializable {
/**
* 主键ID(自增)
*/
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
/**
* 关联任务ID(supervisor_task_info.id)
*/
@Column(name = "relation_id")
private Long relationId;
/**
* 门店ID
*/
@ApiModelProperty(notes = "门店ID")
@Column(name = "merchant_id")
private Integer merchantId;
/**
* 门店名称
*/
@ApiModelProperty(notes = "门店名称")
@Column(name = "merchant_name")
private String merchantName;
/**
* 创建人姓名
*/
@Column(name = "created_by")
private String createdBy;
/**
* 创建时间
*/
@Column(name = "create_time")
private Date createTime;
/**
* 更新人账户名称
*/
@Column(name = "updated_by")
private String updatedBy;
/**
* 更新时间
*/
@Column(name = "updated_date")
private Date updatedDate;
/**
* 删除标识(D:已删除;N:未删除)
*/
@Column(name = "deleted_flag")
private String deletedFlag;
}
package cn.com.glsx.dj.supervisor.model;
import java.io.Serializable;
import java.util.Date;
import javax.persistence.*;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.ToString;
@ToString
@Data
@Table(name = "supervisor_task_participant")
public class SupervisorTaskParticipant implements Serializable {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
@ApiModelProperty(notes = "关联任务ID(supervisor_task_info.id)")
@Column(name = "task_id")
private Long taskId;
@ApiModelProperty(notes = "参与人员手机号")
@Column(name = "participant_phone")
private String participantPhone;
@ApiModelProperty(notes = "参与人员姓名")
@Column(name = "participant_name")
private String participantName;
@Column(name = "created_by")
private String createdBy;
@Column(name = "create_time")
private Date createTime;
@Column(name = "updated_by")
private String updatedBy;
@Column(name = "updated_date")
private Date updatedDate;
@Column(name = "deleted_flag")
private String deletedFlag;
}
\ No newline at end of file \ No newline at end of file
package cn.com.glsx.dj.supervisor.model;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.ToString;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
import java.util.Date;
import javax.persistence.*;
@Data
@ToString
@Table(name = "supervisor_teaching_detail")
public class SupervisorTeachingDetail implements Serializable {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
@Column(name = "task_id")
private Long taskId;
@ApiModelProperty(notes = "带教场景编码(字典:teaching_scene)")
@Column(name = "teaching_scene_code")
private String teachingSceneCode;
@ApiModelProperty(notes = "带教场景名称(线上/线下)")
@Column(name = "teaching_scene_name")
private String teachingSceneName;
@ApiModelProperty(notes = "带教方式编码(字典:teaching_method)")
@Column(name = "teaching_method_code")
private String teachingMethodCode;
@ApiModelProperty(notes = "带教方式名称")
@Column(name = "teaching_method_name")
private String teachingMethodName;
@ApiModelProperty(notes = "带教主题编码(字典:teaching_topic)")
@Column(name = "teaching_topic_code")
private String teachingTopicCode;
@ApiModelProperty(notes = "带教主题名称")
@Column(name = "teaching_topic_name")
private String teachingTopicName;
@ApiModelProperty(notes = "带教时间,yyyy-MM-dd HH:mm", required = true)
@JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm")
@Column(name = "teaching_time")
private Date teachingTime;
}
...@@ -128,4 +128,17 @@ public interface ExcellentCaseReviewRemote { ...@@ -128,4 +128,17 @@ public interface ExcellentCaseReviewRemote {
@ApiMethod("查询所有客户类型") @ApiMethod("查询所有客户类型")
@ApiResponse("客户类型列表") @ApiResponse("客户类型列表")
RpcResponse<List<String>> queryAllCustomerTypes(); RpcResponse<List<String>> queryAllCustomerTypes();
/**
* 根据任务ID查询优秀案例列表(分页)
* <p>
* 根据任务ID查询任务详情,获取督导UUID和所属周起止日期,
* 再查询该督导在该周内提交的优秀案例列表
* </p>
*/
@interface QueryExcellentCaseListByTaskId {}
@ApiMethod("根据任务ID查询优秀案例列表")
@ApiParams({@ApiParam(name = "request", notes = "分页查询参数(需在condition中传入taskId)", dataType = ApiParam.DataTypeEnum.OBJECT, required = true)})
@ApiResponse("优秀案例分页列表")
RpcResponse<RpcPagination<ExcellentCaseDetailDTO>> queryExcellentCaseListByTaskId(RpcPagination<ExcellentCaseReviewQueryDTO> request);
} }
...@@ -154,4 +154,48 @@ public interface SupervisorTaskInfoRemote { ...@@ -154,4 +154,48 @@ public interface SupervisorTaskInfoRemote {
@ApiParams({@ApiParam(name = "request", notes = "专项任务信息(门店ID、门店名称、任务描述、督导手机号、督导姓名、创建人)", dataType = ApiParam.DataTypeEnum.OBJECT, required = true)}) @ApiParams({@ApiParam(name = "request", notes = "专项任务信息(门店ID、门店名称、任务描述、督导手机号、督导姓名、创建人)", dataType = ApiParam.DataTypeEnum.OBJECT, required = true)})
@ApiResponse("新增结果(任务ID)") @ApiResponse("新增结果(任务ID)")
RpcResponse<Long> createSpecialTask(CreateSpecialTaskDTO request); RpcResponse<Long> createSpecialTask(CreateSpecialTaskDTO request);
/**
* 更新周任务状态(优秀案例录音/带教要求)
* <p>
* 根据任务类型、创建日期(推算所属周)和督导UUID查询任务,
* 判断该任务对应的完成指标是否达标,并更新任务状态。
* </p>
*/
@ApiMethod("更新周任务状态")
@ApiParams({@ApiParam(name = "request", notes = "请求参数(任务类型、创建日期、督导UUID)", dataType = ApiParam.DataTypeEnum.OBJECT, required = true)})
@ApiResponse("任务ID")
RpcResponse<Long> updateWeeklyTaskStatus(WeeklyTaskStatusReqDTO request);
/**
* 统计各任务类型未完成任务数量
*/
@ApiMethod("统计各任务类型未完成任务数量")
@ApiParams({@ApiParam(name = "request", notes = "查询参数(督导手机号、起止日期)", dataType = ApiParam.DataTypeEnum.OBJECT, required = true)})
@ApiResponse("各类型未完成任务数量")
RpcResponse<UnfinishedTaskCountDTO> getUnfinishedTaskCount(UnfinishedTaskCountReqDTO request);
/**
* 分页查询带教列表
*/
@ApiMethod("分页查询带教列表")
@ApiParams({@ApiParam(name = "request", notes = "查询参数", dataType = ApiParam.DataTypeEnum.OBJECT, required = true)})
@ApiResponse("带教列表分页结果")
RpcResponse<RpcPagination<SupervisorTeachingListDTO>> pageTeachingRecords(RpcPagination<SupervisorTaskQueryDTO> request);
/**
* 工作台报表(今日动态/本周概览/月度总览/专项督办)
*/
@ApiMethod("工作台报表")
@ApiParams({@ApiParam(name = "request", notes = "查询参数(报表类型、起止日期、督导姓名)", dataType = ApiParam.DataTypeEnum.OBJECT, required = true)})
@ApiResponse("工作台报表数据")
RpcResponse<WorkbenchReportDTO> getWorkbenchReport(WorkbenchReportQueryDTO request);
/**
* 分页查询驻店基础信息
*/
@ApiMethod("分页查询驻店基础信息")
@ApiParams({@ApiParam(name = "request", notes = "查询参数(督导手机号、门店商户号列表)", dataType = ApiParam.DataTypeEnum.OBJECT, required = true)})
@ApiResponse("驻店基础信息分页列表")
RpcResponse<RpcPagination<SupervisorTeamStaffDTO>> pageStaffBaseInfo(RpcPagination<SupervisorTeamStaffQueryDTO> request);
} }
\ No newline at end of file \ No newline at end of file
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
<dependency> <dependency>
<groupId>cn.com.glsx.dj</groupId> <groupId>cn.com.glsx.dj</groupId>
<artifactId>rpc-dj-supervisor-api</artifactId> <artifactId>rpc-dj-supervisor-api</artifactId>
<version>1.0.0-SNAPSHOT</version> <version>5.8.1-SNAPSHOT</version>
</dependency> </dependency>
<dependency> <dependency>
...@@ -68,12 +68,12 @@ ...@@ -68,12 +68,12 @@
<dependency> <dependency>
<groupId>cn.com.glsx.dj</groupId> <groupId>cn.com.glsx.dj</groupId>
<artifactId>rpc-dj-smartcarlife-api</artifactId> <artifactId>rpc-dj-smartcarlife-api</artifactId>
<version>5.7.0-SNAPSHOT</version> <version>5.8.1-SNAPSHOT</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>cn.com.glsx.dj.peanalysis</groupId> <groupId>cn.com.glsx.dj.peanalysis</groupId>
<artifactId>rpc-dj-pe-analysis-api</artifactId> <artifactId>rpc-dj-pe-analysis-api</artifactId>
<version>5.7.0-SNAPSHOT</version> <version>5.8.1-SNAPSHOT</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.junit.jupiter</groupId> <groupId>org.junit.jupiter</groupId>
......
...@@ -91,7 +91,7 @@ public class SupervisorAudioReviewTaskJob implements SimpleJob { ...@@ -91,7 +91,7 @@ public class SupervisorAudioReviewTaskJob implements SimpleJob {
// 2.1 查询督导管理的门店列表,参考CommonUtil.getFlightSupervisionMerchantList方法 // 2.1 查询督导管理的门店列表,参考CommonUtil.getFlightSupervisionMerchantList方法
ShopMerchantDirectorConfigDTO dto = new ShopMerchantDirectorConfigDTO(); ShopMerchantDirectorConfigDTO dto = new ShopMerchantDirectorConfigDTO();
dto.setDirectorUserId(supervisor.getUuid()); dto.setDirectorUserId(supervisor.getUuid());
dto.setDirectorTypes(Arrays.asList(DirectorTypeEnum.FLIGHT_SUPERVISION.getValue())); dto.setDirectorTypes(Arrays.asList(DirectorTypeEnum.FLIGHT_SUPERVISION.getValue(), DirectorTypeEnum.FLIGHT_SUPERVISION_2_1.getValue()));
RpcResponse<List<ShopMerchantDirectorConfigDTO>> merchantResponse = shopMerchantDirectorConfigRemote.list(dto); RpcResponse<List<ShopMerchantDirectorConfigDTO>> merchantResponse = shopMerchantDirectorConfigRemote.list(dto);
log.info("请求参数:directorUserId:{},directorTypes:{}", dto.getDirectorUserId(), dto.getDirectorTypes()); log.info("请求参数:directorUserId:{},directorTypes:{}", dto.getDirectorUserId(), dto.getDirectorTypes());
List<Integer> merchantIdList = new ArrayList<>(); List<Integer> merchantIdList = new ArrayList<>();
...@@ -100,6 +100,7 @@ public class SupervisorAudioReviewTaskJob implements SimpleJob { ...@@ -100,6 +100,7 @@ public class SupervisorAudioReviewTaskJob implements SimpleJob {
if (CollectionUtils.isNotEmpty(merchantList)) { if (CollectionUtils.isNotEmpty(merchantList)) {
merchantIdList = merchantList.stream() merchantIdList = merchantList.stream()
.map(ShopMerchantDirectorConfigDTO::getMerchantId) .map(ShopMerchantDirectorConfigDTO::getMerchantId)
.distinct()
.collect(Collectors.toList()); .collect(Collectors.toList());
} }
} }
...@@ -111,7 +112,7 @@ public class SupervisorAudioReviewTaskJob implements SimpleJob { ...@@ -111,7 +112,7 @@ public class SupervisorAudioReviewTaskJob implements SimpleJob {
StaffBaseInfoDTO staffParam = new StaffBaseInfoDTO(); StaffBaseInfoDTO staffParam = new StaffBaseInfoDTO();
staffParam.setMerchantIdList(merchantIdList); staffParam.setMerchantIdList(merchantIdList);
RpcResponse<List<StaffBaseInfoDTO>> staffResponse = staffBaseInfoRemote.listShopStaffInfoGroupByUUid(staffParam); RpcResponse<List<StaffBaseInfoDTO>> staffResponse = staffBaseInfoRemote.listShopStaffInfoGroupByUUid(staffParam);
log.info("请求参数:merchantIdList:{},返回参数:{}", merchantIdList, staffResponse); log.info("请求参数:merchantIdList:{},返回参数:{}", JSON.toJSONString(merchantIdList), JSON.toJSONString(staffResponse));
if (!staffResponse.isSuccess() || staffResponse.getResult() == null || staffResponse.getResult().isEmpty()) { if (!staffResponse.isSuccess() || staffResponse.getResult() == null || staffResponse.getResult().isEmpty()) {
log.info("督导{},手机号{} 无管理员工", supervisor.getStaffName(), supervisor.getStaffPhone()); log.info("督导{},手机号{} 无管理员工", supervisor.getStaffName(), supervisor.getStaffPhone());
continue; continue;
......
...@@ -14,12 +14,12 @@ import org.springframework.stereotype.Service; ...@@ -14,12 +14,12 @@ import org.springframework.stereotype.Service;
import java.util.Date; import java.util.Date;
/** /**
* 督导周报任务定时生成任务 * 督导周任务定时生成任务(优秀案例录音 + 带教要求)
* 每周一凌晨1点5分0秒开始执行 * 每周一凌晨1点5分0秒开始执行
* *
*/ */
@Service @Service
@ElasticJobConf(name = "SupervisorWeekTaskJob", cron = "0 5 1 ? * 1", description = "督导周报任务定时生成任务", overwrite = true) @ElasticJobConf(name = "SupervisorWeekTaskJob", cron = "0 5 0 ? * 2", description = "督导周任务定时生成任务(优秀案例录音+带教要求)", overwrite = true)
@Slf4j @Slf4j
public class SupervisorWeekTaskJob implements SimpleJob { public class SupervisorWeekTaskJob implements SimpleJob {
...@@ -29,7 +29,7 @@ public class SupervisorWeekTaskJob implements SimpleJob { ...@@ -29,7 +29,7 @@ public class SupervisorWeekTaskJob implements SimpleJob {
public void execute(ShardingContext shardingContext) { public void execute(ShardingContext shardingContext) {
try { try {
String dates = shardingContext.getJobParameter(); String dates = shardingContext.getJobParameter();
log.info("督导周报生成任务开始执行,入参: {}", dates); log.info("督导周任务生成任务开始执行,入参: {}", dates);
String startTimeStr = null; String startTimeStr = null;
String endTimeStr = null; String endTimeStr = null;
if (StringUtils.isBlank(dates)) { if (StringUtils.isBlank(dates)) {
...@@ -42,10 +42,17 @@ public class SupervisorWeekTaskJob implements SimpleJob { ...@@ -42,10 +42,17 @@ public class SupervisorWeekTaskJob implements SimpleJob {
startTimeStr = dateArray[0]; startTimeStr = dateArray[0];
endTimeStr = dateArray[1]; endTimeStr = dateArray[1];
} }
supervisorTaskInfoService.generateWeekTask(startTimeStr, endTimeStr); // 原周报生成逻辑,已注释保留
log.info("督导周报生成任务结束"); // supervisorTaskInfoService.generateWeekTask(startTimeStr, endTimeStr);
// 生成优秀案例录音任务
supervisorTaskInfoService.generateExcellentCaseAudioTask(startTimeStr, endTimeStr);
// 生成带教要求任务
supervisorTaskInfoService.generateCoachingRequirementTask(startTimeStr, endTimeStr);
log.info("督导周任务生成任务结束");
} catch (Exception e) { } catch (Exception e) {
log.error("督导周报生成定时任务执行异常 {}", e); log.error("督导周任务生成定时任务执行异常 {}", e);
} }
} }
} }
...@@ -81,4 +81,16 @@ public interface ExcellentCaseReviewMapper extends OreMapper<ExcellentCaseReview ...@@ -81,4 +81,16 @@ public interface ExcellentCaseReviewMapper extends OreMapper<ExcellentCaseReview
* @return 客户类型列表 * @return 客户类型列表
*/ */
List<String> queryAllCustomerTypes(); List<String> queryAllCustomerTypes();
/**
* 统计指定提交人在指定日期范围内提交的优秀案例数量
*
* @param submitterId 提交人ID(督导UUID)
* @param startDate 开始日期(yyyy-MM-dd)
* @param endDate 结束日期(yyyy-MM-dd)
* @return 提交数量
*/
int countBySubmitterAndDateRange(@Param("submitterId") String submitterId,
@Param("startDate") String startDate,
@Param("endDate") String endDate);
} }
...@@ -68,4 +68,46 @@ public interface SupervisorTaskInfoMapper extends OreMapper<SupervisorTaskInfo> ...@@ -68,4 +68,46 @@ public interface SupervisorTaskInfoMapper extends OreMapper<SupervisorTaskInfo>
*/ */
List<SupervisorDirectorConfigDTO> queryDirectorConfigBySupervisorPhone(@Param("supervisorPhoneList") List<String> supervisorPhoneList); List<SupervisorDirectorConfigDTO> queryDirectorConfigBySupervisorPhone(@Param("supervisorPhoneList") List<String> supervisorPhoneList);
/**
* 统计指定督导在指定日期范围内完成的带教次数(task_type=5, task_status=2)
*
* @param supervisorUuid 督导UUID
* @param startDate 开始日期(yyyy-MM-dd)
* @param endDate 结束日期(yyyy-MM-dd)
* @return 带教完成次数
*/
int countCoachingBySupervisorAndDateRange(@Param("supervisorUuid") String supervisorUuid,
@Param("startDate") String startDate,
@Param("endDate") String endDate);
/**
* 按任务类型分组,统计未完成任务数量
*
* @param supervisorPhone 督导手机号
* @param taskTypes 任务类型列表
* @param startDate 开始日期(yyyy-MM-dd)
* @param endDate 结束日期(yyyy-MM-dd)
* @return 每条记录包含 taskType 和 count
*/
List<Map<String, Object>> countUnfinishedByTaskTypes(@Param("supervisorPhone") String supervisorPhone,
@Param("taskTypes") List<Integer> taskTypes,
@Param("startDate") String startDate,
@Param("endDate") String endDate);
/**
* 查询带教记录列表
*
* @param request 查询条件
* @return 带教记录列表
*/
List<SupervisorTeachingListDTO> listTeachingRecords(SupervisorTaskQueryDTO request);
/**
* 分页查询驻店基础信息
*
* @param request 查询条件(督导手机号、门店商户号列表)
* @return 驻店基础信息列表
*/
List<SupervisorTeamStaffDTO> listStaffBaseInfo(SupervisorTeamStaffQueryDTO request);
} }
\ No newline at end of file \ No newline at end of file
package cn.com.glsx.dj.supervisor.mapper;
import cn.com.glsx.dj.supervisor.model.SupervisorTaskMerchant;
import org.apache.ibatis.annotations.Mapper;
import org.oreframework.datasource.mybatis.mapper.OreMapper;
@Mapper
public interface SupervisorTaskMerchantMapper extends OreMapper<SupervisorTaskMerchant> {
}
package cn.com.glsx.dj.supervisor.mapper;
import cn.com.glsx.dj.supervisor.model.SupervisorTaskParticipant;
import org.apache.ibatis.annotations.Mapper;
import org.oreframework.datasource.mybatis.mapper.OreMapper;
@Mapper
public interface SupervisorTaskParticipantMapper extends OreMapper<SupervisorTaskParticipant> {
}
\ No newline at end of file \ No newline at end of file
package cn.com.glsx.dj.supervisor.mapper;
import cn.com.glsx.dj.supervisor.model.SupervisorTeachingDetail;
import org.apache.ibatis.annotations.Mapper;
import org.oreframework.datasource.mybatis.mapper.OreMapper;
@Mapper
public interface SupervisorTeachingDetailMapper extends OreMapper<SupervisorTeachingDetail> {
}
package cn.com.glsx.dj.supervisor.mapper;
import cn.com.glsx.dj.supervisor.dto.WorkbenchAudioReviewStatDTO;
import cn.com.glsx.dj.supervisor.dto.WorkbenchExcellentCaseCountDTO;
import cn.com.glsx.dj.supervisor.dto.WorkbenchReportTaskRowDTO;
import cn.com.glsx.dj.supervisor.dto.WorkbenchTeachingCountDTO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@Mapper
public interface SupervisorWorkbenchReportMapper {
/**
* 按日期范围与任务类型查询任务
*/
List<WorkbenchReportTaskRowDTO> listTasksByDateRangeAndTypes(@Param("startDate") String startDate,
@Param("endDate") String endDate,
@Param("taskTypes") List<Integer> taskTypes);
/**
* 统计带教场景(线上/线下)
*/
List<WorkbenchTeachingCountDTO> countTeachingByScene(@Param("startDate") String startDate,
@Param("endDate") String endDate);
/**
* 统计录音复盘(按任务维度)
*/
List<WorkbenchAudioReviewStatDTO> listAudioReviewStats(@Param("startDate") String startDate,
@Param("endDate") String endDate);
/**
* 统计优秀案例提报数量
*/
List<WorkbenchExcellentCaseCountDTO> countExcellentCaseGroupBySubmitterName(@Param("startDate") String startDate,
@Param("endDate") String endDate);
}
...@@ -221,4 +221,18 @@ public class ExcellentCaseReviewRemoteImpl implements ExcellentCaseReviewRemote ...@@ -221,4 +221,18 @@ public class ExcellentCaseReviewRemoteImpl implements ExcellentCaseReviewRemote
return RpcResponse.error(DefaultErrorEnum.SERVER_ERROR, e.getMessage()); return RpcResponse.error(DefaultErrorEnum.SERVER_ERROR, e.getMessage());
} }
} }
@Override
public RpcResponse<RpcPagination<ExcellentCaseDetailDTO>> queryExcellentCaseListByTaskId(RpcPagination<ExcellentCaseReviewQueryDTO> request) {
try {
Page<ExcellentCaseDetailDTO> result = excellentCaseReviewService.queryExcellentCaseListByTaskId(request);
return RpcResponse.success(RpcPagination.copyPage(result));
} catch (RpcServiceException e) {
log.error("cn.com.glsx.dj.supervisor.remote.ExcellentCaseReviewRemoteImpl.queryExcellentCaseListByTaskId error {}", e);
return RpcResponse.error(e.getError(), e.getMessage());
} catch (Exception e) {
log.error("cn.com.glsx.dj.supervisor.remote.ExcellentCaseReviewRemoteImpl.queryExcellentCaseListByTaskId system error {}", e);
return RpcResponse.error(DefaultErrorEnum.SERVER_ERROR, e.getMessage());
}
}
} }
...@@ -11,9 +11,12 @@ import cn.com.glsx.dj.supervisor.dto.SupervisorPageDTO; ...@@ -11,9 +11,12 @@ import cn.com.glsx.dj.supervisor.dto.SupervisorPageDTO;
import cn.com.glsx.dj.supervisor.dto.SupervisorPageQueryDTO; import cn.com.glsx.dj.supervisor.dto.SupervisorPageQueryDTO;
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.SupervisorTeamStaffDTO;
import cn.com.glsx.dj.supervisor.dto.SupervisorTeamStaffQueryDTO;
import cn.com.glsx.dj.supervisor.model.SupervisorAudioReviewInfo; import cn.com.glsx.dj.supervisor.model.SupervisorAudioReviewInfo;
import cn.com.glsx.dj.supervisor.service.SupervisorAudioReviewInfoService; import cn.com.glsx.dj.supervisor.service.SupervisorAudioReviewInfoService;
import cn.com.glsx.dj.supervisor.service.SupervisorTaskInfoService; import cn.com.glsx.dj.supervisor.service.SupervisorTaskInfoService;
import cn.com.glsx.dj.supervisor.service.SupervisorWorkbenchReportService;
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.enums.DefaultErrorEnum;
...@@ -31,6 +34,8 @@ public class SupervisorTaskInfoRemoteImpl implements SupervisorTaskInfoRemote { ...@@ -31,6 +34,8 @@ public class SupervisorTaskInfoRemoteImpl implements SupervisorTaskInfoRemote {
private SupervisorTaskInfoService supervisorTaskInfoService; private SupervisorTaskInfoService supervisorTaskInfoService;
@Autowired @Autowired
private SupervisorAudioReviewInfoService supervisorAudioReviewInfoService; private SupervisorAudioReviewInfoService supervisorAudioReviewInfoService;
@Autowired
private SupervisorWorkbenchReportService supervisorWorkbenchReportService;
@Override @Override
public RpcResponse<Boolean> submitDayTask(SupervisorTaskDTO request) { public RpcResponse<Boolean> submitDayTask(SupervisorTaskDTO request) {
...@@ -283,4 +288,83 @@ public class SupervisorTaskInfoRemoteImpl implements SupervisorTaskInfoRemote { ...@@ -283,4 +288,83 @@ public class SupervisorTaskInfoRemoteImpl implements SupervisorTaskInfoRemote {
return RpcResponse.error(DefaultErrorEnum.SERVER_ERROR, e.getMessage()); return RpcResponse.error(DefaultErrorEnum.SERVER_ERROR, e.getMessage());
} }
} }
@Override
public RpcResponse<Long> updateWeeklyTaskStatus(WeeklyTaskStatusReqDTO request) {
try {
log.info("更新周任务状态 - 开始,request={}", request);
Long taskId = supervisorTaskInfoService.updateWeeklyTaskStatus(request);
log.info("更新周任务状态 - 完成,taskId={}", taskId);
return RpcResponse.success(taskId);
} catch (RpcServiceException e) {
log.error("cn.com.glsx.dj.supervisor.remote.SupervisorTaskInfoRemoteImpl.updateWeeklyTaskStatus error {}", e);
return RpcResponse.error(e.getError(), e.getMessage());
} catch (Exception e) {
log.error("cn.com.glsx.dj.supervisor.remote.SupervisorTaskInfoRemoteImpl.updateWeeklyTaskStatus system error {}", e);
return RpcResponse.error(DefaultErrorEnum.SERVER_ERROR, e.getMessage());
}
}
@Override
public RpcResponse<UnfinishedTaskCountDTO> getUnfinishedTaskCount(UnfinishedTaskCountReqDTO request) {
try {
log.info("统计未完成任务数量 - 开始,request={}", request);
UnfinishedTaskCountDTO result = supervisorTaskInfoService.getUnfinishedTaskCount(request);
log.info("统计未完成任务数量 - 完成,result={}", result);
return RpcResponse.success(result);
} catch (RpcServiceException e) {
log.error("cn.com.glsx.dj.supervisor.remote.SupervisorTaskInfoRemoteImpl.getUnfinishedTaskCount error {}", e);
return RpcResponse.error(e.getError(), e.getMessage());
} catch (Exception e) {
log.error("cn.com.glsx.dj.supervisor.remote.SupervisorTaskInfoRemoteImpl.getUnfinishedTaskCount system error {}", e);
return RpcResponse.error(DefaultErrorEnum.SERVER_ERROR, e.getMessage());
}
}
@Override
public RpcResponse<RpcPagination<SupervisorTeachingListDTO>> pageTeachingRecords(RpcPagination<SupervisorTaskQueryDTO> request) {
try {
log.info("分页查询带教列表 - 开始,request={}", request);
Page<SupervisorTeachingListDTO> result = supervisorTaskInfoService.pageTeachingRecords(request);
log.info("分页查询带教列表 - 完成,total={}", result.getTotal());
return RpcResponse.success(RpcPagination.copyPage(result));
} catch (RpcServiceException e) {
log.error("cn.com.glsx.dj.supervisor.remote.SupervisorTaskInfoRemoteImpl.pageTeachingRecords error {}", e);
return RpcResponse.error(e.getError(), e.getMessage());
} catch (Exception e) {
log.error("cn.com.glsx.dj.supervisor.remote.SupervisorTaskInfoRemoteImpl.pageTeachingRecords system error {}", e);
return RpcResponse.error(DefaultErrorEnum.SERVER_ERROR, e.getMessage());
}
}
@Override
public RpcResponse<WorkbenchReportDTO> getWorkbenchReport(WorkbenchReportQueryDTO request) {
try {
log.info("工作台报表 - 开始,request={}", request);
WorkbenchReportDTO result = supervisorWorkbenchReportService.getWorkbenchReport(request);
return RpcResponse.success(result);
} catch (RpcServiceException e) {
log.error("cn.com.glsx.dj.supervisor.remote.SupervisorTaskInfoRemoteImpl.getWorkbenchReport error {}", e);
return RpcResponse.error(e.getError(), e.getMessage());
} catch (Exception e) {
log.error("cn.com.glsx.dj.supervisor.remote.SupervisorTaskInfoRemoteImpl.getWorkbenchReport system error {}", e);
return RpcResponse.error(DefaultErrorEnum.SERVER_ERROR, e.getMessage());
}
}
@Override
public RpcResponse<RpcPagination<SupervisorTeamStaffDTO>> pageStaffBaseInfo(RpcPagination<SupervisorTeamStaffQueryDTO> request) {
try {
log.info("分页查询驻店基础信息 - 开始,request={}", request);
Page<SupervisorTeamStaffDTO> result = supervisorTaskInfoService.pageStaffBaseInfo(request);
log.info("分页查询驻店基础信息 - 完成,total={}", result.getTotal());
return RpcResponse.success(RpcPagination.copyPage(result));
} catch (RpcServiceException e) {
log.error("cn.com.glsx.dj.supervisor.remote.SupervisorTaskInfoRemoteImpl.pageStaffBaseInfo error {}", e);
return RpcResponse.error(e.getError(), e.getMessage());
} catch (Exception e) {
log.error("cn.com.glsx.dj.supervisor.remote.SupervisorTaskInfoRemoteImpl.pageStaffBaseInfo system error {}", e);
return RpcResponse.error(DefaultErrorEnum.SERVER_ERROR, e.getMessage());
}
}
} }
package cn.com.glsx.dj.supervisor.service; package cn.com.glsx.dj.supervisor.service;
import cn.com.glsx.dj.supervisor.dto.ExcellentCaseDetailDTO; import cn.com.glsx.dj.supervisor.dto.*;
import cn.com.glsx.dj.supervisor.dto.ExcellentCaseReviewQueryDTO;
import cn.com.glsx.dj.supervisor.dto.ExcellentCaseReviewReqDTO;
import cn.com.glsx.dj.supervisor.dto.ExcellentCaseSubmitDTO;
import cn.com.glsx.dj.supervisor.enums.ExcellentCaseReviewStatusEnum; import cn.com.glsx.dj.supervisor.enums.ExcellentCaseReviewStatusEnum;
import cn.com.glsx.dj.supervisor.enums.TaskTypeEnum;
import cn.com.glsx.dj.supervisor.mapper.ExcellentCaseReviewMapper; import cn.com.glsx.dj.supervisor.mapper.ExcellentCaseReviewMapper;
import cn.com.glsx.dj.supervisor.mapper.SupervisorTaskInfoMapper;
import cn.com.glsx.dj.supervisor.model.ExcellentCaseReview; import cn.com.glsx.dj.supervisor.model.ExcellentCaseReview;
import cn.com.glsx.dj.supervisor.model.SupervisorTaskInfo;
import cn.com.glsx.dj.supervisor.util.DateUtil;
import cn.com.glsx.framework.core.beans.BaseModel; 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.RpcPagination;
import cn.com.glsx.framework.core.enums.DefaultErrorEnum; import cn.com.glsx.framework.core.enums.DefaultErrorEnum;
...@@ -16,6 +17,7 @@ import com.github.pagehelper.Page; ...@@ -16,6 +17,7 @@ import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageHelper;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections.CollectionUtils; import org.apache.commons.collections.CollectionUtils;
import org.apache.http.client.utils.DateUtils;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
...@@ -41,6 +43,12 @@ public class ExcellentCaseReviewService { ...@@ -41,6 +43,12 @@ public class ExcellentCaseReviewService {
@Autowired @Autowired
private ExcellentCaseReviewMapper excellentCaseReviewMapper; private ExcellentCaseReviewMapper excellentCaseReviewMapper;
@Autowired
private SupervisorTaskInfoMapper supervisorTaskInfoMapper;
@Autowired
private SupervisorTaskInfoService supervisorTaskInfoService;
/** /**
* 提交优秀案例 * 提交优秀案例
* <p> * <p>
...@@ -106,6 +114,12 @@ public class ExcellentCaseReviewService { ...@@ -106,6 +114,12 @@ public class ExcellentCaseReviewService {
} }
log.info("提交优秀案例成功,案例ID:{}", existingCount.getId()); log.info("提交优秀案例成功,案例ID:{}", existingCount.getId());
} }
//更新周报:优秀案例状态:
WeeklyTaskStatusReqDTO param = new WeeklyTaskStatusReqDTO();
param.setTaskType(TaskTypeEnum.EXCELLENT_CASE_AUDIO.getCode());
param.setCreateDate(DateUtils.formatDate(new Date(), "yyyy-MM-dd"));
param.setSupervisorUuid(currentUserId);
supervisorTaskInfoService.updateWeeklyTaskStatus(param);
return true; return true;
} }
...@@ -317,10 +331,45 @@ public class ExcellentCaseReviewService { ...@@ -317,10 +331,45 @@ public class ExcellentCaseReviewService {
*/ */
public List<String> queryAllCustomerTypes() { public List<String> queryAllCustomerTypes() {
log.info("开始查询所有客户类型"); log.info("开始查询所有客户类型");
List<String> types = excellentCaseReviewMapper.queryAllCustomerTypes(); List<String> types = excellentCaseReviewMapper.queryAllCustomerTypes();
log.info("查询所有客户类型成功,数据条数:{}", types != null ? types.size() : 0); log.info("查询所有客户类型成功,数据条数:{}", types != null ? types.size() : 0);
return types; return types;
} }
/**
* 根据任务ID查询优秀案例列表(分页)
* <p>
* 根据任务ID查询 supervisor_task_info 获取督导UUID和所属周起止日期,
* 再调用 queryExcellentCaseList 查询该督导在该周内提交的优秀案例
* </p>
*
* @param request 分页查询参数(condition中需传入taskId)
* @return 分页的案例列表
*/
public Page<ExcellentCaseDetailDTO> queryExcellentCaseListByTaskId(RpcPagination<ExcellentCaseReviewQueryDTO> request) {
ExcellentCaseReviewQueryDTO condition = request.getCondition();
Long taskId = condition.getTaskId();
log.info("根据任务ID查询优秀案例列表,taskId={}, pageNum={}, pageSize={}", taskId, request.getPageNum(), request.getPageSize());
RpcAssert.assertNotNull(taskId, DefaultErrorEnum.PARAMETER_NULL, "任务ID不能为空");
// 查询任务详情,获取督导UUID和起止日期
SupervisorTaskInfo taskInfo = supervisorTaskInfoMapper.selectByPrimaryKey(taskId);
if (taskInfo == null) {
log.error("根据ID查询任务信息不存在,taskId={}", taskId);
throw new RpcServiceException(DefaultErrorEnum.DATA_NOT_EXIST, "根据ID查询任务信息不存在");
}
// 填充查询条件
condition.setSubmitterId(taskInfo.getSupervisorUuid());
condition.setStartDate(taskInfo.getStartDate());
condition.setEndDate(taskInfo.getEndDate());
Page<ExcellentCaseDetailDTO> page = PageHelper.startPage(request.getPageNum(), request.getPageSize());
excellentCaseReviewMapper.queryExcellentCaseList(condition);
log.info("根据任务ID查询优秀案例列表完成,taskId={}", taskId);
return page;
}
} }
...@@ -7,6 +7,7 @@ import cn.com.glsx.dj.supervisor.dto.SupervisorTaskDTO; ...@@ -7,6 +7,7 @@ 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.enums.ReviewStatusEnum; import cn.com.glsx.dj.supervisor.enums.ReviewStatusEnum;
import cn.com.glsx.dj.supervisor.enums.TaskStatusEnum; import cn.com.glsx.dj.supervisor.enums.TaskStatusEnum;
import cn.com.glsx.dj.supervisor.model.SupervisorTaskInfo;
import cn.com.glsx.dj.supervisor.mapper.SupervisorAudioReviewInfoMapper; import cn.com.glsx.dj.supervisor.mapper.SupervisorAudioReviewInfoMapper;
import cn.com.glsx.dj.supervisor.model.SupervisorAudioReviewInfo; import cn.com.glsx.dj.supervisor.model.SupervisorAudioReviewInfo;
import cn.com.glsx.framework.core.beans.BaseModel; import cn.com.glsx.framework.core.beans.BaseModel;
...@@ -20,6 +21,7 @@ import org.apache.commons.collections.CollectionUtils; ...@@ -20,6 +21,7 @@ import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.StringUtils;
import org.oreframework.distribute.lock.annotation.GlsxDistributeLockable; import org.oreframework.distribute.lock.annotation.GlsxDistributeLockable;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.env.Environment;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation; import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
...@@ -39,6 +41,9 @@ public class SupervisorAudioReviewInfoService { ...@@ -39,6 +41,9 @@ public class SupervisorAudioReviewInfoService {
@Autowired @Autowired
private SupervisorTaskInfoService supervisorTaskInfoService; private SupervisorTaskInfoService supervisorTaskInfoService;
@Autowired
private Environment env;
/** /**
...@@ -142,18 +147,26 @@ public class SupervisorAudioReviewInfoService { ...@@ -142,18 +147,26 @@ public class SupervisorAudioReviewInfoService {
} }
request.setUpdatedDate(new Date()); request.setUpdatedDate(new Date());
supervisorAudioReviewInfoMapper.updateByPrimaryKeySelective(request); supervisorAudioReviewInfoMapper.updateByPrimaryKeySelective(request);
//查询关联任务,如果任务已完成则无需重复更新任务状态
SupervisorTaskInfo taskInfo = supervisorTaskInfoService.selectByPrimaryKey(info.getRelationId());
if (taskInfo != null && TaskStatusEnum.COMPLETED.getCode().equals(taskInfo.getTaskStatus())) {
return true;
}
//查询关联任务中其他录音是否全部复盘,若全部复盘,则更新任务状态为已完成 //查询关联任务中其他录音是否全部复盘,若全部复盘,则更新任务状态为已完成
List<SupervisorAudioReviewInfo> list = listByTaskIds(Arrays.asList(info.getRelationId())); List<SupervisorAudioReviewInfo> list = listByTaskIds(Arrays.asList(info.getRelationId()));
if (CollectionUtils.isNotEmpty(list)) { if (CollectionUtils.isNotEmpty(list)) {
//判断是否全部复盘 //从配置读取复盘完成比例阈值(百分比),默认50
boolean allReviewed = list.stream().allMatch(item -> ReviewStatusEnum.COMPLETED.getCode().equals(item.getReviewStatus())); int completeRatio = env.getProperty("supervisor_audio_review_complete_ratio", Integer.class, 50);
boolean anyReviewed = list.stream().anyMatch(item -> ReviewStatusEnum.COMPLETED.getCode().equals(item.getReviewStatus())); long reviewedCount = list.stream().filter(item -> ReviewStatusEnum.COMPLETED.getCode().equals(item.getReviewStatus())).count();
if (allReviewed) { boolean anyReviewed = reviewedCount > 0;
//更新任务状态为已完成 if (anyReviewed) {
supervisorTaskInfoService.updateTaskStatus(info.getRelationId(), TaskStatusEnum.COMPLETED.getCode(), request.getUpdatedBy()); if (reviewedCount * 100 >= (long) list.size() * completeRatio) {
} else if (anyReviewed) { //复盘比例>=阈值,更新任务状态为已完成
//更新任务状态为进行中 supervisorTaskInfoService.updateTaskStatus(info.getRelationId(), TaskStatusEnum.COMPLETED.getCode(), request.getUpdatedBy());
supervisorTaskInfoService.updateTaskStatus(info.getRelationId(), TaskStatusEnum.IN_PROGRESS.getCode(), request.getUpdatedBy()); } else {
//复盘比例<阈值,更新任务状态为进行中
supervisorTaskInfoService.updateTaskStatus(info.getRelationId(), TaskStatusEnum.IN_PROGRESS.getCode(), request.getUpdatedBy());
}
} }
} }
return true; return true;
......
...@@ -55,7 +55,7 @@ public class SupervisorEmployeeTrainingInfoService { ...@@ -55,7 +55,7 @@ public class SupervisorEmployeeTrainingInfoService {
} }
// 2、根据督导uuid,获取督导下所有门店及员工信息(已按手机号去重) // 2、根据督导uuid,获取督导下所有门店及员工信息(已按手机号去重)
List<Integer> merchantIds = supervisorDashboardService.getSupervisorMerchants(supervisorUUID); List<Integer> merchantIds = supervisorDashboardService.getSupervisorMerchants(supervisorUUID,request.getBusinessType());
List<EmployeeRanking> supervisorStoreAndEmployeePhoneList = supervisorDashboardService.getSupervisorStoreAndEmployeePhoneList( List<EmployeeRanking> supervisorStoreAndEmployeePhoneList = supervisorDashboardService.getSupervisorStoreAndEmployeePhoneList(
supervisorUUID, merchantIds); supervisorUUID, merchantIds);
......
package cn.com.glsx.dj.supervisor.service;
import cn.com.glsx.dj.supervisor.dto.SupervisorTaskDTO;
import cn.com.glsx.dj.supervisor.mapper.SupervisorTaskMerchantMapper;
import cn.com.glsx.dj.supervisor.model.SupervisorTaskMerchant;
import cn.com.glsx.framework.core.beans.BaseModel;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import tk.mybatis.mapper.entity.Example;
import java.util.Date;
import java.util.List;
@Service
@Slf4j
public class SupervisorTaskMerchantService {
@Autowired
private SupervisorTaskMerchantMapper supervisorTaskMerchantMapper;
/**
* 批量插入任务门店关联列表
* @param request
* @param date
* @return
*/
public int batchInsert(SupervisorTaskDTO request, Date date) {
List<SupervisorTaskMerchant> taskMerchantList = request.getTaskMerchantList();
if (CollectionUtils.isNotEmpty(taskMerchantList)) {
taskMerchantList.forEach(taskMerchant -> {
taskMerchant.setRelationId(request.getId());
taskMerchant.setCreatedBy(request.getUpdatedBy());
taskMerchant.setCreateTime(date);
taskMerchant.setDeletedFlag(BaseModel.DeletedFlagEnum.N.name());
});
return supervisorTaskMerchantMapper.insertList(taskMerchantList);
}
return 0;
}
/**
* 根据任务ID查询门店关联列表
* @param relationId
* @return
*/
public List<SupervisorTaskMerchant> selectByRelationId(Long relationId) {
Example example = new Example(SupervisorTaskMerchant.class);
example.createCriteria().andEqualTo("relationId", relationId).andEqualTo("deletedFlag", BaseModel.DeletedFlagEnum.N.name());
return supervisorTaskMerchantMapper.selectByExample(example);
}
}
package cn.com.glsx.dj.supervisor.service;
import cn.com.glsx.dj.supervisor.mapper.SupervisorTaskParticipantMapper;
import cn.com.glsx.dj.supervisor.model.SupervisorTaskParticipant;
import cn.com.glsx.framework.core.beans.BaseModel;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import tk.mybatis.mapper.entity.Example;
import java.util.List;
@Service
@Slf4j
public class SupervisorTaskParticipantService {
@Autowired
private SupervisorTaskParticipantMapper supervisorTaskParticipantMapper;
/**
* 根据任务ID查询参与人员列表
*
* @param taskId
* @return
*/
public List<SupervisorTaskParticipant> selectByTaskId(Long taskId) {
Example example = new Example(SupervisorTaskParticipant.class);
example.createCriteria().andEqualTo("taskId", taskId).andEqualTo("deletedFlag", BaseModel.DeletedFlagEnum.N.name());
return supervisorTaskParticipantMapper.selectByExample(example);
}
}
\ No newline at end of file \ No newline at end of file
package cn.com.glsx.dj.supervisor.service;
import cn.com.glsx.dj.supervisor.mapper.SupervisorTeachingDetailMapper;
import cn.com.glsx.dj.supervisor.model.SupervisorTeachingDetail;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import tk.mybatis.mapper.entity.Example;
import java.util.List;
@Service
@Slf4j
public class SupervisorTeachingDetailService {
@Autowired
private SupervisorTeachingDetailMapper supervisorTeachingDetailMapper;
/**
* 根据任务ID查询带教详情
*
* @param taskId
* @return
*/
public SupervisorTeachingDetail selectByTaskId(Long taskId) {
Example example = new Example(SupervisorTeachingDetail.class);
example.createCriteria().andEqualTo("taskId", taskId);
return supervisorTeachingDetailMapper.selectOneByExample(example);
}
}
\ No newline at end of file \ No newline at end of file
...@@ -108,7 +108,8 @@ ...@@ -108,7 +108,8 @@
t7.review_time, t7.review_time,
t7.review_comment, t7.review_comment,
t7.create_time, t7.create_time,
t7.updated_date t7.updated_date,
t2.id as recording_id
FROM reception_customer_info t1 FROM reception_customer_info t1
LEFT JOIN inspection_badge_recordings t2 ON t1.id = t2.reception_id LEFT JOIN inspection_badge_recordings t2 ON t1.id = t2.reception_id
LEFT JOIN inspection_conversation_batch t3 ON t3.record_id=t2.id LEFT JOIN inspection_conversation_batch t3 ON t3.record_id=t2.id
...@@ -135,6 +136,15 @@ ...@@ -135,6 +136,15 @@
<if test="query.reviewStatus != null"> <if test="query.reviewStatus != null">
and t7.review_status = #{query.reviewStatus} and t7.review_status = #{query.reviewStatus}
</if> </if>
<if test="query.submitterId != null and query.submitterId != ''">
and t7.submitter_id = #{query.submitterId}
</if>
<if test="query.startDate != null and query.startDate != ''">
and CAST(t7.create_time AS DATE) &gt;= #{query.startDate, jdbcType=DATE}
</if>
<if test="query.endDate != null and query.endDate != ''">
and CAST(t7.create_time AS DATE) &lt;= #{query.endDate, jdbcType=DATE}
</if>
order by t7.create_time desc order by t7.create_time desc
</select> </select>
...@@ -218,4 +228,13 @@ ...@@ -218,4 +228,13 @@
order by customer_type order by customer_type
</select> </select>
<select id="countBySubmitterAndDateRange" resultType="int">
SELECT COUNT(*)
FROM excellent_case_review
WHERE deleted_flag = 'N'
AND submitter_id = #{submitterId}
AND CAST(create_time AS DATE) &gt;= #{startDate, jdbcType=DATE}
AND CAST(create_time AS DATE) &lt;= #{endDate, jdbcType=DATE}
</select>
</mapper> </mapper>
\ No newline at end of file \ No newline at end of file
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="cn.com.glsx.dj.supervisor.mapper.SupervisorTaskParticipantMapper" >
<resultMap id="BaseResultMap" type="cn.com.glsx.dj.supervisor.model.SupervisorTaskParticipant" >
<id column="id" property="id" jdbcType="BIGINT" />
<result column="task_id" property="taskId" jdbcType="BIGINT" />
<result column="participant_phone" property="participantPhone" jdbcType="VARCHAR" />
<result column="participant_name" property="participantName" jdbcType="VARCHAR" />
<result column="created_by" property="createdBy" jdbcType="VARCHAR" />
<result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
<result column="updated_by" property="updatedBy" jdbcType="VARCHAR" />
<result column="updated_date" property="updatedDate" jdbcType="TIMESTAMP" />
<result column="deleted_flag" property="deletedFlag" jdbcType="CHAR" />
</resultMap>
<sql id="Base_Column_List" >
id, task_id, participant_phone, participant_name, created_by, create_time, updated_by, updated_date, deleted_flag
</sql>
</mapper>
\ No newline at end of file \ No newline at end of file
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="cn.com.glsx.dj.supervisor.mapper.SupervisorTeachingDetailMapper" >
<resultMap id="BaseResultMap" type="cn.com.glsx.dj.supervisor.model.SupervisorTeachingDetail" >
<id column="id" property="id" jdbcType="BIGINT" />
<result column="task_id" property="taskId" jdbcType="BIGINT" />
<result column="teaching_scene_code" property="teachingSceneCode" jdbcType="VARCHAR" />
<result column="teaching_scene_name" property="teachingSceneName" jdbcType="VARCHAR" />
<result column="teaching_method_code" property="teachingMethodCode" jdbcType="VARCHAR" />
<result column="teaching_method_name" property="teachingMethodName" jdbcType="VARCHAR" />
<result column="teaching_topic_code" property="teachingTopicCode" jdbcType="VARCHAR" />
<result column="teaching_topic_name" property="teachingTopicName" jdbcType="VARCHAR" />
<result column="teaching_time" property="teachingTime" jdbcType="TIMESTAMP" />
</resultMap>
<sql id="Base_Column_List" >
id, task_id, teaching_scene_code, teaching_scene_name, teaching_method_code, teaching_method_name, teaching_topic_code,
teaching_topic_name, teaching_time
</sql>
</mapper>
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="cn.com.glsx.dj.supervisor.mapper.SupervisorWorkbenchReportMapper">
<select id="listTasksByDateRangeAndTypes" resultType="cn.com.glsx.dj.supervisor.dto.WorkbenchReportTaskRowDTO">
SELECT
sti.id,
sti.task_type AS taskType,
sti.task_status AS taskStatus,
sti.on_duty_flag AS onDutyFlag,
sti.supervisor_name AS supervisorName,
sti.supervisor_phone AS supervisorPhone,
sti.supervisor_uuid AS supervisorUuid,
sti.merchant_name AS merchantName,
sti.task_desc AS taskDesc,
sti.task_context AS taskContext,
sti.create_time AS createTime,
sti.updated_date AS updatedDate,
DATE_FORMAT(sti.create_time, '%Y-%m-%d') AS taskDate
FROM supervisor_task_info sti
WHERE sti.deleted_flag = 'N'
AND CAST(sti.create_time AS DATE) &gt;= #{startDate, jdbcType=DATE}
AND CAST(sti.create_time AS DATE) &lt;= #{endDate, jdbcType=DATE}
<if test="taskTypes != null and taskTypes.size() > 0">
AND sti.task_type IN
<foreach collection="taskTypes" item="item" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
</select>
<select id="countTeachingByScene" resultType="cn.com.glsx.dj.supervisor.dto.WorkbenchTeachingCountDTO">
SELECT
sti.supervisor_name AS supervisorName,
std.teaching_scene_code AS teachingSceneCode,
COUNT(*) AS count
FROM supervisor_task_info sti
INNER JOIN supervisor_teaching_detail std ON std.task_id = sti.id
WHERE sti.deleted_flag = 'N'
AND sti.task_type = 5
AND CAST(sti.create_time AS DATE) &gt;= #{startDate, jdbcType=DATE}
AND CAST(sti.create_time AS DATE) &lt;= #{endDate, jdbcType=DATE}
GROUP BY sti.supervisor_name, std.teaching_scene_code
</select>
<select id="listAudioReviewStats" resultType="cn.com.glsx.dj.supervisor.dto.WorkbenchAudioReviewStatDTO">
SELECT
sti.id AS relationId,
sti.supervisor_name AS supervisorName,
DATE_FORMAT(sti.create_time, '%Y-%m-%d') AS taskDate,
COUNT(sari.id) AS totalCount,
SUM(CASE WHEN sari.review_status = 1 THEN 1 ELSE 0 END) AS reviewedCount
FROM supervisor_task_info sti
LEFT JOIN supervisor_audio_review_info sari
ON sari.relation_id = sti.id AND sari.deleted_flag = 'N'
WHERE sti.deleted_flag = 'N'
AND sti.task_type = 3
AND CAST(sti.create_time AS DATE) &gt;= #{startDate, jdbcType=DATE}
AND CAST(sti.create_time AS DATE) &lt;= #{endDate, jdbcType=DATE}
GROUP BY sti.id, sti.supervisor_name, DATE_FORMAT(sti.create_time, '%Y-%m-%d')
</select>
<select id="countExcellentCaseGroupBySubmitterName" resultType="cn.com.glsx.dj.supervisor.dto.WorkbenchExcellentCaseCountDTO">
SELECT
submitter_name AS submitterName,
DATE_FORMAT(create_time, '%Y-%m-%d') AS submitDate,
COUNT(*) AS count
FROM excellent_case_review
WHERE deleted_flag = 'N'
AND submitter_name IS NOT NULL
AND submitter_name != ''
AND CAST(create_time AS DATE) &gt;= #{startDate, jdbcType=DATE}
AND CAST(create_time AS DATE) &lt;= #{endDate, jdbcType=DATE}
GROUP BY submitter_name, DATE_FORMAT(create_time, '%Y-%m-%d')
</select>
</mapper>
...@@ -57,7 +57,6 @@ public class SupervisorDashboardRemoteImplTest extends BaseServiceTest { ...@@ -57,7 +57,6 @@ public class SupervisorDashboardRemoteImplTest extends BaseServiceTest {
req.setSupervisorId("63c121922cba4956b2aac3f21dacd92f"); req.setSupervisorId("63c121922cba4956b2aac3f21dacd92f");
req.setStartDate("2026-03-01"); req.setStartDate("2026-03-01");
req.setEndDate("2026-03-29"); req.setEndDate("2026-03-29");
req.setBizs(2);
req.setDateType(2); req.setDateType(2);
req.setNeedAiAnalysis(true); req.setNeedAiAnalysis(true);
req.setSortField(4); req.setSortField(4);
...@@ -81,7 +80,6 @@ public class SupervisorDashboardRemoteImplTest extends BaseServiceTest { ...@@ -81,7 +80,6 @@ public class SupervisorDashboardRemoteImplTest extends BaseServiceTest {
req.setStartDate("2026-03-01"); req.setStartDate("2026-03-01");
req.setEndDate("2026-03-31"); req.setEndDate("2026-03-31");
req.setMerchantId(44211227); req.setMerchantId(44211227);
req.setBizs(2);
req.setDateType(2); req.setDateType(2);
RpcResponse<EmployeePerformanceDTO> response = supervisorDashboardRemote.getEmployeePerformanceData(req); RpcResponse<EmployeePerformanceDTO> response = supervisorDashboardRemote.getEmployeePerformanceData(req);
System.out.println(JSON.toJSONString(response)); System.out.println(JSON.toJSONString(response));
...@@ -93,7 +91,6 @@ public class SupervisorDashboardRemoteImplTest extends BaseServiceTest { ...@@ -93,7 +91,6 @@ public class SupervisorDashboardRemoteImplTest extends BaseServiceTest {
req.setEmployeeId("584fdb460afa4dad835cbe8d73cfa923"); req.setEmployeeId("584fdb460afa4dad835cbe8d73cfa923");
req.setPhone("13132112126"); req.setPhone("13132112126");
req.setMerchantId(44211227); req.setMerchantId(44211227);
req.setBizs(2);
req.setStartDate("2026-03-01"); req.setStartDate("2026-03-01");
req.setEndDate("2026-03-30"); req.setEndDate("2026-03-30");
RpcResponse<EmployeeBehaviorDTO> response = supervisorDashboardRemote.getEmployeeBehaviorData(req); RpcResponse<EmployeeBehaviorDTO> response = supervisorDashboardRemote.getEmployeeBehaviorData(req);
......
package cn.com.glsx.dj.supervisor.service;
import cn.com.glsx.dj.supervisor.dto.ExcellentCaseDetailDTO;
import cn.com.glsx.dj.supervisor.dto.ExcellentCaseReviewQueryDTO;
import cn.com.glsx.framework.core.beans.rpc.RpcPagination;
import com.github.pagehelper.Page;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
public class ExcellentCaseReviewServiceTest extends BaseServiceTest {
@Autowired
private ExcellentCaseReviewService excellentCaseReviewService;
@Test
public void testQueryExcellentCaseListByTaskId() {
RpcPagination<ExcellentCaseReviewQueryDTO> request = new RpcPagination<>();
request.setPageNum(1);
request.setPageSize(10);
ExcellentCaseReviewQueryDTO condition = new ExcellentCaseReviewQueryDTO();
condition.setTaskId(214L);
request.setCondition(condition);
Page<ExcellentCaseDetailDTO> page = excellentCaseReviewService.queryExcellentCaseListByTaskId(request);
System.out.println(page);
}
}
...@@ -23,9 +23,9 @@ public class SupervisorAudioReviewInfoServiceTest extends BaseServiceTest { ...@@ -23,9 +23,9 @@ public class SupervisorAudioReviewInfoServiceTest extends BaseServiceTest {
@Test @Test
public void testSubmitAudioReview() { public void testSubmitAudioReview() {
SupervisorAudioReviewInfo request = new SupervisorAudioReviewInfo(); SupervisorAudioReviewInfo request = new SupervisorAudioReviewInfo();
request.setId(1L); request.setId(4L);
request.setReviewContext("测试录音"); request.setReviewContext("测试录音完成率");
request.setReviewTarget("标签仔"); //request.setReviewTarget("标签仔1");
request.setUpdatedBy("fanfr"); request.setUpdatedBy("fanfr");
Boolean result = supervisorAudioReviewInfoService.submitAudioReview(request); Boolean result = supervisorAudioReviewInfoService.submitAudioReview(request);
assertTrue(result); assertTrue(result);
......
package cn.com.glsx.dj.supervisor.service; package cn.com.glsx.dj.supervisor.service;
import cn.com.glsx.dj.mindworkplate.dto.residentpoint.StaffBaseInfoDTO;
import cn.com.glsx.dj.smartcarlife.dto.ShopMerchantDirectorConfigDTO; import cn.com.glsx.dj.smartcarlife.dto.ShopMerchantDirectorConfigDTO;
import cn.com.glsx.dj.smartcarlife.enums.DirectorTypeEnum; import cn.com.glsx.dj.smartcarlife.enums.DirectorTypeEnum;
import cn.com.glsx.dj.smartcarlife.remote.ShopMerchantDirectorConfigRemote; import cn.com.glsx.dj.smartcarlife.remote.ShopMerchantDirectorConfigRemote;
...@@ -8,8 +9,10 @@ import cn.com.glsx.dj.supervisor.dto.SupervisorTaskDTO; ...@@ -8,8 +9,10 @@ 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.SupervisorTaskSummaryDTO; import cn.com.glsx.dj.supervisor.dto.SupervisorTaskSummaryDTO;
import cn.com.glsx.dj.supervisor.dto.*; import cn.com.glsx.dj.supervisor.dto.*;
import cn.com.glsx.dj.supervisor.enums.TaskTypeEnum;
import cn.com.glsx.dj.supervisor.model.SupervisorTaskCourse; import cn.com.glsx.dj.supervisor.model.SupervisorTaskCourse;
import cn.com.glsx.dj.supervisor.model.SupervisorTaskImage; import cn.com.glsx.dj.supervisor.model.SupervisorTaskImage;
import cn.com.glsx.dj.supervisor.model.SupervisorTaskMerchant;
import cn.com.glsx.dj.supervisor.model.SupervisorWeekTaskStaff; import cn.com.glsx.dj.supervisor.model.SupervisorWeekTaskStaff;
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.RpcPagination; import cn.com.glsx.framework.core.beans.rpc.RpcPagination;
...@@ -18,13 +21,11 @@ import cn.com.glsx.merchants.model.response.MerchantStaffResponse; ...@@ -18,13 +21,11 @@ import cn.com.glsx.merchants.model.response.MerchantStaffResponse;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.github.pagehelper.Page; import com.github.pagehelper.Page;
import org.apache.commons.collections.CollectionUtils; import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.httpclient.util.DateUtil;
import org.junit.Test; import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import java.util.ArrayList; import java.util.*;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
import java.util.stream.Collectors; import java.util.stream.Collectors;
/** /**
...@@ -115,6 +116,22 @@ public class SupervisorTaskInfoServiceTest extends BaseServiceTest { ...@@ -115,6 +116,22 @@ public class SupervisorTaskInfoServiceTest extends BaseServiceTest {
supervisorTaskInfoService.generateWeekTask(startTimeStr, endTimeStr); supervisorTaskInfoService.generateWeekTask(startTimeStr, endTimeStr);
} }
@Test
public void testGenerateCoachingRequirementTask() {
String startTimeStr = "2026-05-11";
String endTimeStr = "2026-05-17";
supervisorTaskInfoService.generateCoachingRequirementTask(startTimeStr, endTimeStr);
}
@Test
public void testGenerateExcellentCaseAudioTask() {
String startTimeStr = "2026-05-11";
String endTimeStr = "2026-05-17";
supervisorTaskInfoService.generateExcellentCaseAudioTask(startTimeStr, endTimeStr);
supervisorTaskInfoService.generateCoachingRequirementTask(startTimeStr, endTimeStr);
}
/** /**
* 测试生成月报任务 * 测试生成月报任务
*/ */
...@@ -158,19 +175,27 @@ public class SupervisorTaskInfoServiceTest extends BaseServiceTest { ...@@ -158,19 +175,27 @@ public class SupervisorTaskInfoServiceTest extends BaseServiceTest {
@Test @Test
public void testSubmitDayTask() { public void testSubmitDayTask() {
SupervisorTaskDTO request = new SupervisorTaskDTO(); SupervisorTaskDTO request = new SupervisorTaskDTO();
request.setId(3L); request.setId(234L);
// 设置其他全部参数 // 设置其他全部参数
request.setMerchantId(43423334); // request.setMerchantId(43423334);
request.setMerchantName("萨达梵蒂冈"); // request.setMerchantName("萨达梵蒂冈");
List<SupervisorTaskMerchant> taskMerchantList = new ArrayList<>();
SupervisorTaskMerchant merchant = new SupervisorTaskMerchant();
merchant.setMerchantId(43423334);
merchant.setMerchantName("萨达梵蒂冈");
taskMerchantList.add(merchant);
request.setTaskMerchantList(taskMerchantList);
request.setOnDutyFlag(0); request.setOnDutyFlag(0);
request.setTaskContext("督导日报记录"); request.setTaskContext("督导日报记录");
List<SupervisorTaskImage> taskImageList = new ArrayList<>(); request.setNextWorkItems("日报-明日继续");
SupervisorTaskImage image = new SupervisorTaskImage(); request.setNeedAssistItems("帮我copy数据");
image.setImageUrl("http://oss.glsx.com/123456.jpg"); // List<SupervisorTaskImage> taskImageList = new ArrayList<>();
taskImageList.add(image); // SupervisorTaskImage image = new SupervisorTaskImage();
request.setTaskImageList(taskImageList); // image.setImageUrl("http://oss.glsx.com/123456.jpg");
request.setUpdatedBy("周敏"); // taskImageList.add(image);
request.setUpdatedPhone("18682474862"); // request.setTaskImageList(taskImageList);
request.setUpdatedBy("陈希");
request.setUpdatedPhone("13132112126");
supervisorTaskInfoService.submitDayTask(request); supervisorTaskInfoService.submitDayTask(request);
} }
...@@ -192,12 +217,12 @@ public class SupervisorTaskInfoServiceTest extends BaseServiceTest { ...@@ -192,12 +217,12 @@ public class SupervisorTaskInfoServiceTest extends BaseServiceTest {
public void testPageTask() { public void testPageTask() {
RpcPagination<SupervisorTaskQueryDTO> request = new RpcPagination<>(); RpcPagination<SupervisorTaskQueryDTO> request = new RpcPagination<>();
SupervisorTaskQueryDTO queryDTO = new SupervisorTaskQueryDTO(); SupervisorTaskQueryDTO queryDTO = new SupervisorTaskQueryDTO();
// queryDTO.setSupervisorPhone("18682474862"); queryDTO.setSupervisorPhone("18682474862");
request.setCondition(queryDTO); request.setCondition(queryDTO);
List<Integer> typeList = Arrays.asList(4); List<Integer> typeList = Arrays.asList(6, 7);
queryDTO.setTaskTypeList(typeList); queryDTO.setTaskTypeList(typeList);
// queryDTO.setStartDate("2026-01-01"); queryDTO.setStartDate("2026-05-11");
// queryDTO.setEndDate("2026-01-31"); queryDTO.setEndDate("2026-05-17");
request.setPageSize(10); request.setPageSize(10);
request.setPageNum(1); request.setPageNum(1);
Page<SupervisorTaskDTO> supervisorTaskDTOS = supervisorTaskInfoService.pageTask(request); Page<SupervisorTaskDTO> supervisorTaskDTOS = supervisorTaskInfoService.pageTask(request);
...@@ -250,24 +275,28 @@ public class SupervisorTaskInfoServiceTest extends BaseServiceTest { ...@@ -250,24 +275,28 @@ public class SupervisorTaskInfoServiceTest extends BaseServiceTest {
@Test @Test
public void testGetTeamOverview() { public void testGetTeamOverview() {
ShopMerchantDirectorConfigDTO dto = new ShopMerchantDirectorConfigDTO(); ShopMerchantDirectorConfigDTO dto = ShopMerchantDirectorConfigDTO.builder()
dto.setDirectorUserId("63c121922cba4956b2aac3f21dacd92f"); .directorUserId("63c121922cba4956b2aac3f21dacd92f")
dto.setDirectorTypes(Arrays.asList(DirectorTypeEnum.FLIGHT_SUPERVISION.getValue())); .directorTypes(Arrays.asList(
RpcResponse<List<ShopMerchantDirectorConfigDTO>> merchantResponse = shopMerchantDirectorConfigRemote.list(dto); DirectorTypeEnum.FLIGHT_SUPERVISION.getValue(),
List<Integer> merchantIdList = new ArrayList<>(); DirectorTypeEnum.FLIGHT_SUPERVISION_2_1.getValue()))
if (merchantResponse.isSuccess() && merchantResponse.getResult() != null) { .build();
List<ShopMerchantDirectorConfigDTO> merchantList = merchantResponse.getResult(); RpcResponse<List<ShopMerchantDirectorConfigDTO>> response = shopMerchantDirectorConfigRemote.list(dto);
if (CollectionUtils.isNotEmpty(merchantList)) { List<ShopMerchantDirectorConfigDTO> list = response.getResult();
merchantIdList = merchantList.stream() Map<Integer, List<Integer>> map = new HashMap<>();
.map(ShopMerchantDirectorConfigDTO::getMerchantId) if (CollectionUtils.isNotEmpty(list)) {
.collect(Collectors.toList()); for (ShopMerchantDirectorConfigDTO item : list) {
SupervisorTaskQueryDTO request = new SupervisorTaskQueryDTO(); map.computeIfAbsent(Integer.valueOf(item.getDirectorType()), k -> new ArrayList<>())
request.setMerchantIdList(merchantIdList); .add(item.getMerchantId());
SupervisorTeamOverviewDTO overview = supervisorTaskInfoService.getTeamOverview(request);
System.out.println(JSON.toJSONString(overview));
} }
} }
SupervisorTaskQueryDTO request = new SupervisorTaskQueryDTO();
request.setDirectorTypeMerchantMap(map);
List<Integer> allMerchantIds = map.values().stream()
.flatMap(List::stream).distinct().collect(Collectors.toList());
request.setMerchantIdList(allMerchantIds);
SupervisorTeamOverviewDTO overview = supervisorTaskInfoService.getTeamOverview(request);
System.out.println(JSON.toJSONString(overview));
} }
/** /**
...@@ -331,4 +360,54 @@ public class SupervisorTaskInfoServiceTest extends BaseServiceTest { ...@@ -331,4 +360,54 @@ public class SupervisorTaskInfoServiceTest extends BaseServiceTest {
RpcPagination<SupervisorDetailStaffDTO> result = supervisorTaskInfoService.pageDetailStaff(pagination); RpcPagination<SupervisorDetailStaffDTO> result = supervisorTaskInfoService.pageDetailStaff(pagination);
System.out.println(JSON.toJSONString(result)); System.out.println(JSON.toJSONString(result));
} }
@Test
public void testGetUnfinishedTaskCount() {
UnfinishedTaskCountReqDTO request = new UnfinishedTaskCountReqDTO();
request.setSupervisorPhone("13603070903");
UnfinishedTaskCountDTO count = supervisorTaskInfoService.getUnfinishedTaskCount(request);
System.out.println(JSON.toJSONString(count));
request.setStartDate("2026-03-01");
request.setEndDate("2026-03-31");
count = supervisorTaskInfoService.getUnfinishedTaskCount(request);
System.out.println(JSON.toJSONString(count));
}
@Test
public void testUpdateWeeklyTaskStatus() {
WeeklyTaskStatusReqDTO request = new WeeklyTaskStatusReqDTO();
request.setTaskType(TaskTypeEnum.EXCELLENT_CASE_AUDIO.getCode());
request.setCreateDate("2026-03-20");
request.setSupervisorUuid("c4c9d90316e04ea6961c1dda22cdab00");
supervisorTaskInfoService.updateWeeklyTaskStatus(request);
System.out.println(JSON.toJSONString(request));
request.setTaskType(TaskTypeEnum.COACHING_REQUIREMENT.getCode());
request.setCreateDate("2026-03-20");
supervisorTaskInfoService.updateWeeklyTaskStatus(request);
System.out.println(JSON.toJSONString(request));
}
@Test
public void testPageStaffBaseInfo() {
RpcPagination<SupervisorTeamStaffQueryDTO> pagination = new RpcPagination<>();
pagination.setPageNum(1);
pagination.setPageSize(10);
SupervisorTeamStaffQueryDTO condition = new SupervisorTeamStaffQueryDTO();
condition.setSupervisorPhone("17680252939");
pagination.setCondition(condition);
Page<SupervisorTeamStaffDTO> result = supervisorTaskInfoService.pageStaffBaseInfo(pagination);
System.out.println(JSON.toJSONString(result));
}
@Test
public void testPageTeachingRecords() {
RpcPagination<SupervisorTaskQueryDTO> pagination = new RpcPagination<>();
pagination.setPageNum(1);
pagination.setPageSize(10);
SupervisorTaskQueryDTO condition = new SupervisorTaskQueryDTO();
condition.setId(217L);
pagination.setCondition(condition);
Page<SupervisorTeachingListDTO> result = supervisorTaskInfoService.pageTeachingRecords(pagination);
System.out.println(JSON.toJSONString(result));
}
} }
\ No newline at end of file \ No newline at end of file
  • @wangxw1
    commented
    Master

    这是一份针对您提交代码的专业审查报告。代码整体结构清晰,业务逻辑拆分较为合理,且严格遵守了“Mybatis不允许使用子查询”以及“Dubbo Remote接口参数向下兼容”的强制规范。但在并发一致性、性能以及日期处理细节上存在一些需要优化的关键问题。

    一、关键问题与优化建议(Top 3)

    1. 并发场景下的数据一致性风险(竞态条件)

    • 问题描述:在 SupervisorAudioReviewInfoService.updateReviewStatus 方法中,使用了分布式锁 @GlsxDistributeLockable(key = "#request.id"),锁的粒度是录音复盘记录的ID。但在方法内部,不仅更新了录音复盘状态,还通过 listByTaskIds 汇总查询了关联任务(Task)下所有复盘记录的状态,以此来更新主任务(Task)的状态。
    • 影响分析:当多个用户(或线程)同时对同一个主任务下的不同录音进行复盘更新时,由于锁的是各自的录音ID,这些线程会并发执行。它们可能同时读取到旧的汇总数据,导致计算出的 reviewedCount 不准确,进而导致主任务(Task)的状态无法正确流转到“已完成(COMPLETED)”。
    • 优化建议:在更新主任务状态的逻辑块,应按 relationId(即主任务ID)加锁,或者将锁的粒度改为 relationId,确保同一个主任务的状态流转是串行计算的。 java // 建议在 SupervisorTaskInfoService.updateTaskStatus 内部或此处按 relationId 增加分布式锁 @GlsxDistributeLockable(key = "#info.relationId", prefix = "lock:task:status:") public void checkAndUpdateTaskStatus(SupervisorAudioReviewInfo info, String updatedBy) { // 移动状态计算逻辑到此处 }

    2. 循环中串行调用远程服务导致性能瓶颈

    • 问题描述:在 SupervisorDashboardService.getDashboardMetrics 及其关联的行为数据查询方法中,当 bizs == null 时,代码通过 for (Integer biz : bizList) 循环 3 次(延保、轻改、权益),并在循环内部调用 queryBiData(远程 BI 数据查询接口)。
    • 影响分析:远程 RPC/HTTP 调用属于重度 I/O 操作。在循环中串行发起 3 次网络请求,会使该接口的响应时间(RT)线性增加,在弱网或高并发场景下极易导致接口超时,严重影响系统吞吐量和前端工作台的加载体验。
    • 优化建议:推荐使用 CompletableFuture 将串行查询改为并行查询;或者推动 BI 团队提供批量查询接口(如支持入参 bizs=1,2,3)。 java // 并行查询示例 List<CompletableFuture<DataResp<List<DataBusinessDTO>>>> futures = bizList.stream() .map(biz -> CompletableFuture.supplyAsync(() -> queryBiData(dashboardQueryReq, biz), executor)) .collect(Collectors.toList()); // 等待所有任务完成并聚合结果

    3. 错误使用 Apache HTTP 客户端的 DateUtils

    • 问题描述:在 ExcellentCaseReviewService 和 SupervisorTaskInfoService 中,格式化业务日期时引入了 org.apache.http.client.utils.DateUtils.formatDate(new Date(), "yyyy-MM-dd")。
    • 影响分析:org.apache.http.client.utils.DateUtils 是专门用于处理 HTTP 协议头部的日期格式工具,其内部实现通常默认使用 GMT 时区。在中国标准时间(UTC+8)环境下,这极易导致凌晨 0点~8点 之间生成的日期比实际日期少一天,引发严重的业务数据统计错误。
    • 优化建议:移除该导入,替换为项目中统一使用的日期工具类(如 cn.com.glsx.framework.core.util.DateUtils),或使用 Java 8 线程安全的 LocalDate。 java // 错误导入:import org.apache.http.client.utils.DateUtils; // 建议修改为: param.setCreateDate(cn.com.glsx.framework.core.util.DateUtils.formatDate(new Date(), "yyyy-MM-dd")); // 或推荐使用 Java 8 Time API param.setCreateDate(LocalDate.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd")));

    二、评分明细

    • 功能实现的正确性与健壮性(35/40分): 业务逻辑完整,未发现违规使用 MyBatis 子查询,Dubbo Remote 接口的参数变更均为新增或 DTO 字段扩充,满足向下兼容要求。扣分项在于并发场景下的锁粒度设计不合理,存在主任务状态更新丢失的隐患;以及错误使用 HTTP 日期工具类可能引发的时区 Bug。
    • 安全性与潜在风险(28/30分): 无 SQL 注入风险,越权及敏感信息泄露防范较好。扣分项在于竞态条件带来的数据一致性风险,属于系统稳定性层面的潜在隐患。
    • 最佳实践与可维护性(16/20分): 代码分层清晰,注释较全。扣分项在于个别工具类的误用(如 DateUtils),以及多处出现了类似 Byte.valueOf("13") 和 environment.getProperty 的硬编码/默认值散落,建议统一定义为常量或枚举。
    • 性能与资源利用(2/5分): 存在明显的性能瓶颈。在核心看板接口的 for 循环中串行发起多次 RPC 调用,未充分利用并发编程优势,对接口响应耗时影响较大。
    • 提交信息质量(5/5分): Commit 信息(如“优化督导数据查询逻辑支持多业务类型”、“新增空权限处理”等)描述清晰,能够准确反映代码变更意图,具备良好的可追溯性。

    总分:86分

Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!