Skip to content
  • Projects
  • Groups
  • Snippets
  • Help

dj / rpc-staff

  • This project
    • Loading...
  • Sign in
Go to a project
  • Project
  • Repository
  • Issues 0
  • Merge Requests 0
  • Pipelines
  • Wiki
  • Settings
  • Activity
  • Graph
  • Charts
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Merged
Merge Request !4 opened Feb 28, 2026 by 张富康@zhangfk

上线合并

v5.6.2发起合并请求到master分支

Edited Feb 28, 2026
Request to merge v5.6.2 into master
×

Check out, review, and merge locally

Step 1. Fetch and check out the branch for this merge request

git fetch origin
git checkout -b v5.6.2 origin/v5.6.2

Step 2. Review the changes locally

Step 3. Merge the branch and fix any conflicts that come up

git checkout master
git merge --no-ff v5.6.2

Step 4. Push the result of the merge to GitLab

git push origin master

Note that pushing to GitLab requires write access to this repository.

Tip: You can also checkout merge requests locally by following these guidelines.

Merged by 蔡远明 Feb 28, 2026

  • The changes were merged into master.
  • Discussion 1
  • Commits 1
  • Changes 5
  • {{ resolvedDiscussionCount }}/{{ discussionCount }} {{ resolvedCountText }} resolved
  • 2641f1b3da612f8e5cf4541059e216a6?s=80&d=identicon
    Toggle discussion
    王欣伟
    @wangxw1 started a discussion on commit f1be2daa Feb 27, 2026
    • @wangxw1 王欣伟
      @wangxw1 commented Feb 27, 2026
      Master

      这是一份针对您提交代码的专业审查报告。代码整体逻辑清晰,MyBatis 动态 SQL 的使用规范,且提交信息(Commit Message)非常详尽,体现了良好的工程习惯。以下是需要关注的几个优化点:

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

      1. tk.mybatis 的 andIn 条件存在潜在的空集合/脏数据风险(健壮性)

      • 问题描述:在 AttendanceDataCleansingService 和 AutoPerfEvaluationService 中,通过 staffPhones.split(",") 直接放入 criteria.andIn()。如果配置中心配置的值不规范(例如 ","、"13800000000," 或包含空格 " 13800000000 "),split 可能会产生空字符串,甚至在极端情况下导致空集合。向 tk.mybatis 的 andIn 传入空集合通常会引发 SQL 语法错误(如 IN ())或运行时异常。
      • 影响分析:配置错误时可能导致整个定时任务或核心业务流程中断。
      • 优化建议:在执行 andIn 之前,对拆分后的数组进行过滤(去除空白字符),并确保集合不为空。 java String staffPhones = OrePropertyConfigurer.getProperty("gray_phone_list", String.class, ""); if (StrUtil.isNotBlank(staffPhones)) { // 过滤空白字符串并去除首尾空格 List<String> phoneList = Arrays.stream(staffPhones.split(",")) .filter(StrUtil::isNotBlank) .map(String::trim) .collect(Collectors.toList()); if (CollUtil.isNotEmpty(phoneList)) { criteria.andIn("staffPhone", phoneList); } }

      2. 提交了被注释的本地调试代码(可维护性)

      • 问题描述:在 AttendanceDataCleansingService 和 AutoPerfEvaluationService 中,均残留了 // .andEqualTo("staffPhone", "18684780942") 这类被注释掉的测试代码。
      • 影响分析:无用的注释代码会随着时间推移变成“代码僵尸”,降低代码的可读性,干扰其他开发者的阅读。
      • 优化建议:在代码提交(Commit)前,请务必删除所有仅用于本地调试的无用注释。版本历史管理应交由 Git 负责。

      3. 魔法值硬编码与逻辑重复(最佳实践)

      • 问题描述:"gray_phone_list" 作为一个配置项 Key,在两个不同的 Service 中被硬编码。同时,读取配置、判空、切割字符串的逻辑在这两个类中完全重复。
      • 影响分析:若未来需要修改灰度名单的 Key,或者需要改变灰度名单的解析逻辑(例如改为 JSON 格式),需要在多个文件中进行修改,容易遗漏并引发 Bug。
      • 优化建议:将配置 Key 提取为全局常量(如 ConfigConstants.GRAY_PHONE_LIST_KEY)。如果条件允许,可以将“获取并解析灰度手机号”的逻辑抽离到一个专门的配置读取工具类或方法中。

      二、评分明细

      • 功能实现的正确性与健壮性(36/40分): 核心业务逻辑实现正确,XML 中的 <if test="merchantIds != null and merchantIds.size() > 0"> 很好地处理了商户 ID 列表为空的边界情况。扣分点在于 Java 代码中逗号分隔字符串转 List 时,缺乏对脏数据和空集合的防御性处理。

      • 安全性与潜在风险(30/30分): 没有任何 SQL 注入风险。MyBatis XML 中正确使用了 #{item} 进行参数绑定,避免了拼接 SQL 带来的安全隐患。

      • 最佳实践与可维护性(16/20分): 代码整体结构清晰,使用了 Criteria 统一构建查询条件,提升了整洁度。扣分点在于残留了本地调试注释代码,以及配置项 Key 的硬编码和部分逻辑重复。

      • 性能与资源利用(5/5分): 通过批量 IN 查询替代可能的循环单条查询,性能表现良好,没有明显的资源浪费。

      • 提交信息质量(5/5分): Commit Message 格式规范,使用了 fix(perfSalary): 并在正文中分条列出了具体的修改内容和目的,非常清晰、易于追溯,值得表扬。


      三、总分

      总分:92分

  • @caiym 蔡远明
    @caiym

    mentioned in commit 08f615ff

    Feb 28, 2026

    mentioned in commit 08f615ff

    Toggle commit list
  • @caiym 蔡远明
    @caiym

    merged

    Feb 28, 2026

    merged

    Toggle commit list
  • @caiym 蔡远明
    @caiym

    mentioned in commit 38f66be0

    Feb 28, 2026

    mentioned in commit 38f66be0

    Toggle commit list
  • @caiym 蔡远明
    @caiym

    mentioned in merge request !5

    Feb 28, 2026

    mentioned in merge request !5

    Toggle commit list
  • Write
  • Preview
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
  • Please register or sign in to post a comment
蔡远明
Assignee
蔡远明 @caiym
Assign to
None
Milestone
None
Assign milestone
Time tracking
2
2 participants
Reference: dj/rpc-staff!4
×

Cherry-pick this merge request

Switch branch
Cancel
A new branch will be created in your fork and a new merge request will be started.