Commit 0c7ec876 by 范富荣

Merge remote-tracking branch 'origin/v5.8.2' into v5.8.2

2 parents 459df083 229ced24
......@@ -37,6 +37,9 @@ public class ApproveSpecialTaskDTO implements Serializable {
@ApiModelProperty(value = "指定督导姓名(通过时必填)")
private String assignedSupervisorName;
@ApiModelProperty(value = "指定督导uuid(通过时必填)")
private String assignedSupervisorUuid;
@ApiModelProperty(value = "带教场景编码(通过时选填,字典:teaching_scene)")
private String teachingSceneCode;
......
......@@ -20,4 +20,7 @@ public class RegionOperatorDTO implements Serializable {
@ApiModelProperty(value = "手机号")
private String phone;
@ApiModelProperty(value = "uuid")
private String uuid;
}
......@@ -141,6 +141,12 @@ public class SupervisorSpecialCoachApproval implements Serializable {
private String assignedSupervisorName;
/**
* 指定督导UUID
*/
@Column(name = "assigned_supervisor_uuid")
private String assignedSupervisorUuid;
/**
* 任务中心task.task_id
*/
@Column(name = "task_center_id")
......
......@@ -305,6 +305,7 @@ public class SupervisorTaskInfoRemoteImpl implements SupervisorTaskInfoRemote {
RegionOperatorDTO dto = new RegionOperatorDTO();
dto.setName(staff.getStaffName());
dto.setPhone(staff.getStaffPhone());
dto.setUuid(staff.getUuid());
result.add(dto);
}
}
......@@ -331,6 +332,7 @@ public class SupervisorTaskInfoRemoteImpl implements SupervisorTaskInfoRemote {
RegionOperatorDTO dto = new RegionOperatorDTO();
dto.setName(staff.getStaffName());
dto.setPhone(staff.getStaffPhone());
dto.setUuid(staff.getUuid());
result.add(dto);
}
}
......
......@@ -177,6 +177,7 @@ public class SupervisorSpecialCoachApprovalService {
if (ApprovalStatusEnum.PASSED.getCode().equals(request.getApprovalStatus())) {
update.setAssignedSupervisorPhone(request.getAssignedSupervisorPhone());
update.setAssignedSupervisorName(request.getAssignedSupervisorName());
update.setAssignedSupervisorUuid(request.getAssignedSupervisorUuid());
update.setTeachingSceneCode(request.getTeachingSceneCode());
update.setTeachingSceneName(request.getTeachingSceneName());
update.setTeachingMethodCode(request.getTeachingMethodCode());
......@@ -538,14 +539,14 @@ public class SupervisorSpecialCoachApprovalService {
task.setDescription(approval.getApplyDescription());
task.setStatus("UNFINISHED");
task.setPriority(30); // 默认优先级
task.setCreatedBy(request.getApproverPhone());
task.setCreatedBy(request.getApproverName());
task.setCreatedDate(new Date());
task.setBizDisplayInfo(bizDisplayInfo);
// 构建执行人列表
List<TaskAssigneeInputDTO> assignees = new ArrayList<>();
TaskAssigneeInputDTO assignee = new TaskAssigneeInputDTO();
assignee.setAssigneeId(request.getAssignedSupervisorPhone());
assignee.setAssigneeId(request.getAssignedSupervisorUuid());
assignee.setAssigneeName(request.getAssignedSupervisorName());
assignees.add(assignee);
......@@ -762,7 +763,7 @@ public class SupervisorSpecialCoachApprovalService {
if (teachingTime == null) {
return null;
}
java.time.format.DateTimeFormatter formatter = java.time.format.DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm");
java.time.format.DateTimeFormatter formatter = java.time.format.DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
return teachingTime.toInstant()
.atZone(java.time.ZoneId.systemDefault())
.toLocalDateTime()
......
......@@ -23,6 +23,7 @@
<result column="reject_reason" property="rejectReason" jdbcType="VARCHAR"/>
<result column="assigned_supervisor_phone" property="assignedSupervisorPhone" jdbcType="VARCHAR"/>
<result column="assigned_supervisor_name" property="assignedSupervisorName" jdbcType="VARCHAR"/>
<result column="assigned_supervisor_uuid" property="assignedSupervisorUuid" jdbcType="VARCHAR"/>
<result column="task_center_id" property="taskCenterId" jdbcType="BIGINT"/>
<result column="teaching_scene_code" property="teachingSceneCode" jdbcType="VARCHAR"/>
<result column="teaching_scene_name" property="teachingSceneName" jdbcType="VARCHAR"/>
......@@ -70,7 +71,7 @@
id, biz_type, category_name, merchant_id, merchant_name, business_type, business_type_name,
teaching_staff_phones, teaching_staff_names, supervisor_phones, supervisor_names, apply_description,
approval_status, approval_time, approver_id, approver_name, approver_phone, reject_reason,
assigned_supervisor_phone, assigned_supervisor_name,
assigned_supervisor_phone, assigned_supervisor_name, assigned_supervisor_uuid,
task_center_id, teaching_scene_code, teaching_scene_name, teaching_method_code, teaching_method_name,
teaching_topic_code, teaching_topic_name, teaching_time, source, source_id,
created_phone, created_uuid, created_by, create_time, updated_by, update_time, deleted_flag
......@@ -98,6 +99,7 @@
<if test="rejectReason != null">reject_reason,</if>
<if test="assignedSupervisorPhone != null">assigned_supervisor_phone,</if>
<if test="assignedSupervisorName != null">assigned_supervisor_name,</if>
<if test="assignedSupervisorUuid != null">assigned_supervisor_uuid,</if>
<if test="taskCenterId != null">task_center_id,</if>
<if test="teachingSceneCode != null">teaching_scene_code,</if>
<if test="teachingSceneName != null">teaching_scene_name,</if>
......@@ -136,6 +138,7 @@
<if test="rejectReason != null">#{rejectReason},</if>
<if test="assignedSupervisorPhone != null">#{assignedSupervisorPhone},</if>
<if test="assignedSupervisorName != null">#{assignedSupervisorName},</if>
<if test="assignedSupervisorUuid != null">#{assignedSupervisorUuid},</if>
<if test="taskCenterId != null">#{taskCenterId},</if>
<if test="teachingSceneCode != null">#{teachingSceneCode},</if>
<if test="teachingSceneName != null">#{teachingSceneName},</if>
......
  • @wangxw1
    commented
    Master

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

    1. RPC 接口向后兼容性与空指针/空值风险(功能实现的正确性与健壮性)

    • 问题描述:在 rpc-dj-supervisor-api 的 WeeklyTaskStatusReqDTO 中新增了 updateBy 字段,并在 SupervisorTaskInfoService 第 1165 行将原本硬编码的 "system" 替换为 request.getUpdateBy()。
    • 影响分析:由于该 DTO 用于 Dubbo 远程调用,若服务消费者(Consumer)尚未升级 API 包,或者前端未传递该新字段,反序列化后 request.getUpdateBy() 将为 null。这会导致数据库中的 updated_by 字段被更新为 null,可能会引发数据库 Not Null 约束异常,或破坏审计日志的数据完整性。
    • 优化建议:在消费端未完全同步升级前,服务端应做好兼容处理(防御性编程),提供默认值兜底。 java // 建议修改 SupervisorTaskInfoService.java 第 1165 行: String updatedBy = StringUtils.isNotBlank(request.getUpdateBy()) ? request.getUpdateBy() : "system"; update.setUpdatedBy(updatedBy);

    2. DTO 字段缺少注释与 Swagger 注解(最佳实践与可维护性)

    • 问题描述:WeeklyTaskStatusReqDTO 中新增的 updateBy 字段没有任何注释,也缺少 Swagger 的 @ApiModelProperty 注解,而该类中的其他字段(如 supervisorUuid)均有规范的注解。
    • 影响分析:破坏了代码风格的一致性,导致自动生成的 API 文档缺失该字段的说明,增加了前端开发人员或接口调用方的沟通成本。
    • 优化建议:补全必要的注释或注解。 java @ApiModelProperty(notes = "更新人名称") private String updateBy;

    3. 提交信息规范性不足(提交信息质量)

    • 问题描述:Commit 信息为 督导周任务提交新增更新人字段 (by fanfr);Merge remote-tracking branch 'origin/v5.8.2' into v5.8.2 (by fanfr);,将业务提交与分支 Merge 记录混杂在一起,且缺乏需求背景(如 Jira 任务号)。
    • 影响分析:不利于代码的后期追溯、Release Note 的自动生成以及快速定位需求上下文。
    • 优化建议:建议遵守常规的 Git Commit 规范(如 Angular 规范),将业务提交与合并提交分开,并附带需求/缺陷编号,例如:feat(supervisor): 督导周任务提交新增更新人字段 [JIRA-1234]。

    二、评分明细

    • 功能实现的正确性与健壮性(35/40分):核心业务逻辑修改正确,但在 RPC 场景下直接使用新增参数替换原有默认值,未考虑旧版本客户端调用的兼容性,存在空值覆盖或抛出异常的风险。扣除 5 分。
    • 安全性与潜在风险(30/30分):未发现 SQL 注入、越权、XSS 等安全漏洞,参数传递方式安全。
    • 最佳实践与可维护性(16/20分):代码结构清晰,但新增的 DTO 字段缺失了必要的 API 注解和注释,不符合团队 API 维护的最佳实践。扣除 4 分。
    • 性能与资源利用(5/5分):仅涉及简单的对象属性赋值,无性能瓶颈或资源浪费。
    • 提交信息质量(2/5分):提交信息包含了自动生成的 Merge 记录,且缺失需求追踪标识,规范性较差。扣除 3 分。

    总分:88分

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