Commit 4a63a1f8 by 林永健

fix(login): 修正门店和业务类别为空判断逻辑

- 将门店类型和业务类别的判断条件由或改为且,避免误判
- 在LoginService中新增merchantNameMap变量声明以备后续使用
- 在SceneBaseReq中添加queryType字段标识查询类型
- 扩展convertQueryParamCycleType方法支持按年查询类型5的转换逻辑
1 parent b287c6a4
...@@ -95,7 +95,7 @@ public class SceneBaseReq implements Serializable { ...@@ -95,7 +95,7 @@ public class SceneBaseReq implements Serializable {
/** /**
* 转换周期传参,适配指标传参 * 转换周期传参,适配指标传参
* permissionRequest.cycleType:request筛选参数:1.按天,2.按周,3.按月,4.自定义 * permissionRequest.cycleType:request筛选参数:1.按天,2.按周,3.按月,4.自定义,5.按年
* queryParams.dataType:指标参数:0,按指定时段;1,按周;2,按月;3,按年;4,全部 * queryParams.dataType:指标参数:0,按指定时段;1,按周;2,按月;3,按年;4,全部
*/ */
public Integer convertQueryParamCycleType() { public Integer convertQueryParamCycleType() {
......
  • @wangxw1
    commented
    Master

    Auto Review Result:

    代码审查报告

    问题描述和优化建议

    问题1: convertQueryParamCycleType 方法未更新逻辑以支持新添加的 cycleType

    • 问题描述: 在 SceneBaseReq.java 文件中,convertQueryParamCycleType 方法没有更新以支持新的 cycleType 值 5(按年)。虽然注释已经更新,但实际的转换逻辑没有相应修改。
    • 影响: 当 permissionRequest.cycleType 设置为 5 时,convertQueryParamCycleType 方法将返回 null 或不正确的值,导致程序行为不符合预期。
    • 优化建议: 需要在 convertQueryParamCycleType 方法中添加对 cycleType 值 5 的处理逻辑。例如: java public Integer convertQueryParamCycleType() { if (permissionRequest.getCycleType() == 1) { return 0; // 按天 -> 按指定时段 } else if (permissionRequest.getCycleType() == 2) { return 1; // 按周 -> 按周 } else if (permissionRequest.getCycleType() == 3) { return 2; // 按月 -> 按月 } else if (permissionRequest.getCycleType() == 4) { // 自定义 -> 根据具体需求处理,这里假设返回 null 或其他默认值 return null; } else if (permissionRequest.getCycleType() == 5) { return 3; // 按年 -> 按年 } return null; // 默认返回 null 或其他适当的默认值 }

    评分明细

    1. 功能实现的正确性与健壮性 (40分):
      • 代码逻辑部分正确,但缺少对新添加的 cycleType 值的处理,因此扣掉10分。
      • 得分: 30分
    2. 安全性与潜在风险 (30分):
      • 代码中未发现明显的安全漏洞,但需要确保所有输入参数都经过适当的验证和清理。
      • 得分: 30分
    3. 是否符合最佳实践 (20分):
      • 代码结构合理,但可以考虑增加更多的注释来解释复杂的逻辑。
      • 得分: 18分
    4. 性能与资源利用效率 (5分):
      • 代码性能良好,未发现明显的性能问题。
      • 得分: 5分
    5. Commits信息的清晰性与准确性 (5分):
      • 提交信息不够详细,特别是对于 SceneBaseReq 中的更改。
      • 得分: 3分

    总分: 86分


    以上是对该代码提交的详细审查报告,希望对改进代码质量和功能实现有所帮助。

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