Commit 2be213b9 by 林冲

feat:培训计划分页查询

1 parent 04757279
package cn.com.glsx.dj.riskmanage.dto.learningcenter; package cn.com.glsx.dj.riskmanage.dto.learningcenter;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
...@@ -51,10 +52,6 @@ public class TrainingPlanPersonPageDTO implements Serializable { ...@@ -51,10 +52,6 @@ public class TrainingPlanPersonPageDTO implements Serializable {
@ApiModelProperty(notes = "开单权限(0:已锁定, 1:已解锁)") @ApiModelProperty(notes = "开单权限(0:已锁定, 1:已解锁)")
private Byte openOrderStatus; private Byte openOrderStatus;
/** 入职日期-开始(yyyy-MM-dd) */
@ApiModelProperty(notes = "入职日期开始(yyyy-MM-dd)")
private Date entryStartDate;
/** 排序字段:entryDate */ /** 排序字段:entryDate */
@ApiModelProperty(notes = "排序字段:sortByXxx") @ApiModelProperty(notes = "排序字段:sortByXxx")
private String sortField; private String sortField;
...@@ -63,11 +60,18 @@ public class TrainingPlanPersonPageDTO implements Serializable { ...@@ -63,11 +60,18 @@ public class TrainingPlanPersonPageDTO implements Serializable {
@ApiModelProperty(notes = "排序方向:asc 或 desc(默认desc)") @ApiModelProperty(notes = "排序方向:asc 或 desc(默认desc)")
private String sortOrder; private String sortOrder;
/** 入职日期-开始(yyyy-MM-dd) */
@ApiModelProperty(notes = "入职日期开始(yyyy-MM-dd HH:mm:ss)")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date entryStartDate;
/** 入职日期-结束(yyyy-MM-dd) */ /** 入职日期-结束(yyyy-MM-dd) */
@ApiModelProperty(notes = "入职日期结束(yyyy-MM-dd)") @ApiModelProperty(notes = "入职日期结束(yyyy-MM-dd HH:mm:ss)")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date entryEndDate; private Date entryEndDate;
@ApiModelProperty(notes = "入职日期") @ApiModelProperty(notes = "入职日期")
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
private Date entryDate; private Date entryDate;
@ApiModelProperty(notes = "0-入职时间升序,1-入职时间降序") @ApiModelProperty(notes = "0-入职时间升序,1-入职时间降序")
......
...@@ -78,6 +78,7 @@ public class LearningCenterTrainingPlanPersonService { ...@@ -78,6 +78,7 @@ public class LearningCenterTrainingPlanPersonService {
} }
requestDTO.setStatus(condition.getPersonStatus()); requestDTO.setStatus(condition.getPersonStatus());
requestDTO.setEntryStartDate(condition.getEntryStartDate()); requestDTO.setEntryStartDate(condition.getEntryStartDate());
requestDTO.setEntryEndDate(condition.getEntryEndDate());
// 排序字段 // 排序字段
if (condition.getOrderByType() == null || Objects.equals(condition.getOrderByType(), 1)) { if (condition.getOrderByType() == null || Objects.equals(condition.getOrderByType(), 1)) {
// 默认根据入职时间降序 // 默认根据入职时间降序
......
  • @wangxw1
    commented
    Master

    Auto Review Result:

    代码审查报告

    问题描述和优化建议

    1. 功能实现的正确性与健壮性

      • 问题: entryStartDate 和 entryEndDate 字段的注释从 yyyy-MM-dd 变更为 yyyy-MM-dd HH:mm:ss,但实际业务场景可能不需要精确到秒级别的时间格式。这可能导致不必要的复杂性。
      • 建议: 确认业务需求是否真的需要精确到秒级别的日期时间。如果不是,则保留 yyyy-MM-dd 格式以简化代码。
    2. 安全性与潜在风险

      • 问题: 当前代码没有明显的安全漏洞,但是由于日期时间格式的变化,如果前端传递的日期时间格式不正确,可能会导致反序列化错误。
      • 建议: 添加日期时间格式验证逻辑,确保前端传递的数据格式正确。
    3. 是否符合最佳实践

      • 问题: 注释中的中文注释虽然直观,但在国际化项目中可能不够友好。同时,注释的位置可以更加合理,以便于阅读。
      • 建议: 考虑将注释翻译成英文,或者在英文注释中加入中文解释。注释应靠近字段声明,便于理解。
    4. 性能与资源利用效率

      • 问题: 当前代码没有明显的性能问题。
      • 建议: 检查是否有其他性能优化的机会,例如批量查询或缓存机制,但在此变更中没有发现明显的性能瓶颈。
    5. Commits信息的清晰性与准确性

      • 问题: 提交信息 feat:培训计划分页查询 中的中文标题可能会导致非中文用户理解困难。
      • 建议: 将提交信息翻译成英文,例如 feat: Add entryEndDate to TrainingPlanPersonPageDTO for pagination query。

    评分明细

    1. 功能实现的正确性与健壮性:35分 / 40分

      • 基本实现正确,但日期时间格式的变更需要确认业务需求。
    2. 安全性与潜在风险:25分 / 30分

      • 没有明显的安全漏洞,但需要增加日期时间格式验证逻辑。
    3. 是否符合最佳实践:15分 / 20分

      • 注释和国际化问题需要改进。
    4. 性能与资源利用效率:5分 / 5分

      • 当前代码没有明显的性能问题。
    5. Commits信息的清晰性与准确性:3分 / 5分

      • 提交信息需要翻译成英文以提高可读性。

    总分: 83分


    通过上述审查,代码基本满足功能需求,但存在一些需要改进的地方。希望员工能够根据这些建议进一步完善代码。

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