Commit d8cbc1e0 by 章家宝

feat:分页查询字段对齐

1 parent 5b157f71
...@@ -301,7 +301,6 @@ public class SupervisorSpecialTaskService { ...@@ -301,7 +301,6 @@ public class SupervisorSpecialTaskService {
strategyInfo.setDescription(request.getDescription()); strategyInfo.setDescription(request.getDescription());
strategyInfo.setMerchantId(request.getMerchantId()); strategyInfo.setMerchantId(request.getMerchantId());
strategyInfo.setMerchantName(request.getMerchantName()); strategyInfo.setMerchantName(request.getMerchantName());
strategyInfo.setStartDate(new Date());
strategyInfo.setPushType(0); strategyInfo.setPushType(0);
strategyInfo.setPushFlag(StrategyPushFlagEnum.NOT_PUSHED.getValue()); strategyInfo.setPushFlag(StrategyPushFlagEnum.NOT_PUSHED.getValue());
strategyInfo.setHandlerType("0"); strategyInfo.setHandlerType("0");
......
...@@ -32,6 +32,8 @@ ...@@ -32,6 +32,8 @@
<result column="merchant_name" property="merchantName" jdbcType="VARCHAR"/> <result column="merchant_name" property="merchantName" jdbcType="VARCHAR"/>
<result column="business_type" property="businessType" jdbcType="INTEGER"/> <result column="business_type" property="businessType" jdbcType="INTEGER"/>
<result column="description" property="description" jdbcType="VARCHAR"/> <result column="description" property="description" jdbcType="VARCHAR"/>
<result column="problem_staff_name" property="problemStaffName" jdbcType="VARCHAR"/>
<result column="region_operator_name" property="regionOperatorName" jdbcType="VARCHAR"/>
<result column="supervisor_phone" property="supervisorPhone" jdbcType="VARCHAR"/> <result column="supervisor_phone" property="supervisorPhone" jdbcType="VARCHAR"/>
<result column="supervisor_name" property="supervisorName" jdbcType="VARCHAR"/> <result column="supervisor_name" property="supervisorName" jdbcType="VARCHAR"/>
<result column="create_time" property="createTime" jdbcType="TIMESTAMP"/> <result column="create_time" property="createTime" jdbcType="TIMESTAMP"/>
...@@ -146,6 +148,7 @@ ...@@ -146,6 +148,7 @@
<select id="selectSpecialTaskPage" resultMap="SpecialTaskPageDTOResultMap" parameterType="cn.com.glsx.dj.supervisor.dto.SpecialTaskQueryDTO"> <select id="selectSpecialTaskPage" resultMap="SpecialTaskPageDTOResultMap" parameterType="cn.com.glsx.dj.supervisor.dto.SpecialTaskQueryDTO">
SELECT id, biz_type, category_name, merchant_id, merchant_name, business_type, description, SELECT id, biz_type, category_name, merchant_id, merchant_name, business_type, description,
problem_staff_name, region_operator_name,
supervisor_phone, supervisor_name, create_time, created_by supervisor_phone, supervisor_name, create_time, created_by
FROM supervisor_special_task FROM supervisor_special_task
<where> <where>
......
  • @wangxw1
    commented
    Master

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

    1. 潜在的功能正确性与健壮性风险:移除了 startDate 的初始化

    • 问题描述:在 SupervisorSpecialTaskService.java 中,移除了 strategyInfo.setStartDate(new Date()); 这一行代码。
    • 影响分析:如果 startDate 是数据库表中的非空(NOT NULL)字段且没有默认值,或者下游的业务逻辑(如定时任务、策略生效判断等)强依赖此字段,移除该赋值将导致数据库插入异常(如 DataIntegrityViolationException)或业务逻辑出现 NullPointerException。
    • 优化建议:请确认移除此行代码是否符合业务预期。
      • 如果是因为数据库层面已设置了 DEFAULT CURRENT_TIMESTAMP,则此修改合理。
      • 如果前端/调用方会传入该字段,需增加对该字段的判空校验。
      • 如果是误删,请恢复该行代码:strategyInfo.setStartDate(new Date());。

    2. 提交信息质量问题:Commit Message 未覆盖所有变更

    • 问题描述:提交信息为 feat:分页查询字段对齐 (by jiabao),该描述仅准确概括了 SupervisorSpecialTaskMapper.xml 中的字段新增操作,但完全没有提及 SupervisorSpecialTaskService.java 中移除 startDate 赋值的业务逻辑变更。
    • 影响分析:提交信息与实际代码变更不匹配,严重降低了代码的可追溯性。未来在进行问题排查或版本回溯时,其他开发者无法通过 Git 历史了解为何移除了 startDate 的初始化。
    • 优化建议:提交信息应完整覆盖本次 PR 的核心变更。建议修改为类似:feat: 分页查询字段对齐,并移除策略开始时间的默认初始化。若两者属于不同的业务需求,建议拆分为两次 Commit 提交。

    二、评分明细

    • 功能实现的正确性与健壮性(35/40分)
      • 理由:MyBatis XML 的修改(新增字段映射与查询)正确无误,且未违反“禁止使用子查询”的规则;未涉及 Dubbo 接口变更。扣分项在于 startDate 赋值被直接移除,存在潜在的空指针或数据库写入异常风险,需进一步确认业务上下文。
    • 安全性与潜在风险(30/30分)
      • 理由:本次变更仅涉及常规的字段映射和简单的对象属性赋值调整,不存在 SQL 注入、XSS、越权或敏感信息泄露等安全隐患。
    • 最佳实践与可维护性(20/20分)
      • 理由:XML 中的 <resultMap> 与 SQL 语句保持一致,字段命名规范(驼峰与下划线映射正确),符合常规工程实践。
    • 性能与资源利用(5/5分)
      • 理由:仅在原有分页查询中增加了两个普通字段,无复杂的表关联或全表扫描风险,对性能无明显影响。
    • 提交信息质量(2/5分)
      • 理由:Commit 信息格式尚可,但内容存在严重遗漏,未能涵盖 Java 业务代码的逻辑修改,不利于后期维护和问题追溯。

    总分:92分

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