Commit de09c957 by 崔彦峰

Revert "feat(goods): 添加商品上架模式和相关字段支持"

This reverts commit 4701d0ab.
1 parent 4701d0ab
......@@ -123,11 +123,4 @@ public class GoodsListingApproval implements Serializable {
@ApiModelProperty(name = "deletedFlag", notes = "删除标识(D:已删除;N:未删除)")
@Column(name = "deleted_flag")
private String deletedFlag;
/**
* 上架模式 1-特殊商品上架 2-常规商品上架
*/
@ApiModelProperty(name = "shelfModel", notes = "上架模式 1-特殊商品上架 2-常规商品上架")
@Column(name = "shelf_model")
private Byte shelfModel;
}
\ No newline at end of file
......@@ -160,20 +160,6 @@ public class GoodsListingBaseRule implements Serializable {
private Date updatedDate;
/**
* 管理层市场费是否前置:是-Y 否-N
*/
@ApiModelProperty(name = "managementMarketingFeesPrerequisite", notes = "管理层市场费是否前置:是-Y 否-N")
@Column(name = "management_marketing_fees_prerequisite")
private String managementMarketingFeesPrerequisite;
/**
* 一线阳光是否前置:是-Y 否-N
*/
@ApiModelProperty(name = "firstLineSunshinePrerequisite", notes = "一线阳光是否前置:是-Y 否-N")
@Column(name = "first_line_sunshine_prerequisite")
private String firstLineSunshinePrerequisite;
/**
* 删除标示(D:已删除;N:未删除)
*/
@ApiModelProperty(name = "deletedFlag", notes = "删除标示(D:已删除;N:未删除)")
......
......@@ -222,20 +222,6 @@ public class GoodsListingProductBase implements Serializable {
private Date updatedDate;
/**
* 类型(上架方式):1-新增 2-修改
*/
@ApiModelProperty(name = "shelfStyle", notes = "类型(上架方式):1-新增 2-修改")
@Column(name = "shelf_style")
private Byte shelfStyle;
/**
* 原上架ID(原商户商品编码)
*/
@ApiModelProperty(name = "oldMerchantGoodsCode", notes = "原上架ID(原商户商品编码)")
@Column(name = "old_merchant_goods_code")
private String oldMerchantGoodsCode;
/**
* 删除标识(D:已删除;N:未删除)
*/
@ApiModelProperty(name = "deletedFlag", notes = "删除标识(D:已删除;N:未删除)")
......
......@@ -19,7 +19,6 @@
<result column="updated_by" property="updatedBy" jdbcType="VARCHAR" />
<result column="updated_date" property="updatedDate" jdbcType="TIMESTAMP" />
<result column="deleted_flag" property="deletedFlag" jdbcType="CHAR" />
<result column="shelf_model" property="shelfModel" jdbcType="TINYINT" />
</resultMap>
<resultMap id="DTOResultMap" type="cn.com.glsx.dj.goods.listing.dto.GoodsListingApprovalDTO" extends="BaseResultMap">
......@@ -36,14 +35,14 @@
-->
id, business_code, uuid, shelf_type, system_status, rejected_reason, goods_create_excel,
base_scene_code, confirm_step, created_by, created_date, updated_by, updated_date,
deleted_flag, shelf_model
deleted_flag
</sql>
<select id="list" resultMap="DTOResultMap">
select
gla.id, gla.business_code, gla.uuid, gla.shelf_type, gla.system_status, gla.rejected_reason,
gla.goods_create_excel, gla.base_scene_code, gla.confirm_step, gla.created_by, gla.created_date,
gla.updated_by, gla.updated_date, gla.shelf_model
gla.updated_by, gla.updated_date
from dj_car_life_goods_listing_approval gla
<include refid="condition"></include>
order by gla.id desc
......@@ -70,9 +69,6 @@
<if test="baseSceneCode != null and baseSceneCode !=''">
and gla.base_scene_code = #{baseSceneCode}
</if>
<if test="shelfModel != null">
and gla.shelf_model = #{shelfModel}
</if>
</where>
</sql>
</mapper>
\ No newline at end of file
......@@ -24,8 +24,6 @@
<result column="created_date" property="createdDate" jdbcType="TIMESTAMP" />
<result column="updated_by" property="updatedBy" jdbcType="VARCHAR" />
<result column="updated_date" property="updatedDate" jdbcType="TIMESTAMP" />
<result column="management_marketing_fees_prerequisite" property="managementMarketingFeesPrerequisite" jdbcType="CHAR" />
<result column="first_line_sunshine_prerequisite" property="firstLineSunshinePrerequisite" jdbcType="CHAR" />
<result column="deleted_flag" property="deletedFlag" jdbcType="CHAR" />
</resultMap>
<sql id="Base_Column_List" >
......@@ -36,7 +34,6 @@
partner_merchant_divide_target, partner_merchant2_auto_divide, partner_merchant2_divide_target,
other_fee_divide_target, first_line_sunshine_online_points_flag, first_line_sunshine2_online_points_flag,
reality_shop_merchant_id, reality_shop_merchant_name, reality_shop_user_type, reality_shop_level,
created_by, created_date, updated_by, updated_date, management_marketing_fees_prerequisite,
first_line_sunshine_prerequisite, deleted_flag
created_by, created_date, updated_by, updated_date, deleted_flag
</sql>
</mapper>
\ No newline at end of file
......@@ -33,8 +33,6 @@
<result column="created_date" property="createdDate" jdbcType="TIMESTAMP" />
<result column="updated_by" property="updatedBy" jdbcType="VARCHAR" />
<result column="updated_date" property="updatedDate" jdbcType="TIMESTAMP" />
<result column="shelf_style" property="shelfStyle" jdbcType="TINYINT" />
<result column="old_merchant_goods_code" property="oldMerchantGoodsCode" jdbcType="VARCHAR" />
<result column="deleted_flag" property="deletedFlag" jdbcType="CHAR" />
</resultMap>
<resultMap id="DTOResultMap" type="cn.com.glsx.dj.goods.listing.dto.GoodsListingProductBaseDTO" extends="BaseResultMap">
......@@ -62,7 +60,7 @@
revenue, traffic_share_profit, service_provider_profit, dj_revenue, dj_cost, manager_market_fee,
manager_market_fee1, manager_market_fee2, first_line_sunshine_incentive_fee, first_line_sunshine2_incentive_fee,
resource_fee, labor_cost, dj_gross_profit, profit_rate, integrity, profit_rate_cal_finish,
created_by, created_date, updated_by, updated_date, shelf_style, old_merchant_goods_code, deleted_flag
created_by, created_date, updated_by, updated_date, deleted_flag
</sql>
<select id="listBase" parameterType="cn.com.glsx.dj.goods.listing.model.GoodsListingProductBase" resultMap="BaseResultMap">
......@@ -80,7 +78,7 @@
<select id="getDetailById" resultMap="DTOResultMap">
select
glpb.id, glpb.business_code, glpb.product_type, glpb.settlement_type, glpb.product_name,glpb.package_code,
glpb.package_alias,glpb.sales_proportion_percent, glpb.shelf_style, glpb.old_merchant_goods_code,
glpb.package_alias,glpb.sales_proportion_percent,
glpd.upgrade_goods_id, glpd.upgrade_commodity_code, glpd.upgrade_goods_name,
glpd.goods_alias, glpd.position, glpd.sell_price, glpd.min_sell_price, glpd.upgrade_product_cost, glpd.recovery_cost,
glpd.gift_cost, glpd.third_party_cost, glpd.inventory_type,glpd.merchant_goods_code
......@@ -94,8 +92,7 @@
id, business_code, product_type, settlement_type, product_name,package_code,package_alias, sales_proportion_percent,
revenue, traffic_share_profit, service_provider_profit, dj_revenue, dj_cost, manager_market_fee,
manager_market_fee1, manager_market_fee2, first_line_sunshine_incentive_fee, first_line_sunshine2_incentive_fee,
resource_fee, labor_cost, dj_gross_profit, profit_rate, integrity, profit_rate_cal_finish,
shelf_style, old_merchant_goods_code
resource_fee, labor_cost, dj_gross_profit, profit_rate, integrity, profit_rate_cal_finish
from dj_car_life_goods_listing_product_base glpb
<include refid="listCondition"/>
order by glpb.id asc
......
  • @wangxw1
    commented
    Master

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

    1. Dubbo/RPC 接口向下兼容性风险(高优先级)

    • 问题描述:本次变更在 rpc-dj-goods-listing-api 模块中删除了 GoodsListingApproval、GoodsListingBaseRule、GoodsListingProductBase 等实体类的多个字段(如 shelfModel、shelfStyle 等)。
    • 影响分析:根据代码审查重要规则,“dubbo服务提供者Remote接口中的已有请求参数变更视为危险实现”。API 模块通常被其他微服务依赖,直接删除实体类中的字段,如果这些类被用作 Dubbo 接口的入参或返回值,且消费端(Consumer)未同步更新或正在使用这些字段,极易引发序列化/反序列化异常(如 Hessian 协议报错),甚至导致消费端业务逻辑直接崩溃。
    • 优化建议:
      • 如果该功能尚未发布到生产环境,直接回滚是可以接受的。
      • 如果该功能已发布到生产环境,切勿直接删除字段。正确的做法是使用 @Deprecated 注解标记这些字段,通知调用方停止使用,待所有消费端移除依赖后,再在后续版本中安全删除。

    2. 数据库与代码映射不一致的潜在隐患(中优先级)

    • 问题描述:在 MyBatis 的 XML 映射文件中,移除了多个字段的 <result> 映射和 SQL 查询列(如 shelf_model、management_marketing_fees_prerequisite 等)。
    • 影响分析:虽然代码中移除了字段,但如果对应的数据库表结构未同步回滚(即数据库中仍存在这些列),由于查询使用的是显式列名 <include refid="Base_Column_List"/>,不会引发 SQL 报错。但需警惕是否有其他未在此次 Revert 范围内的相关代码(如手动编写的特定 SQL 或其他服务)仍依赖这些数据库列,可能导致数据不一致。
    • 优化建议:请确认数据库 DDL 脚本是否也同步进行了回滚(删除相应列)。同时,全局排查是否有其他业务线强依赖了这些刚被撤销的字段逻辑。

    3. 提交信息(Commit Message)缺乏回滚上下文(低优先级)

    • 问题描述:本次提交仅使用了 Git 自动生成的 Revert "feat(goods): 添加商品上架模式和相关字段支持",没有补充任何说明。
    • 影响分析:自动生成的 Revert 信息虽然具备基本的追溯能力,但缺乏具体的业务上下文。后续开发或维护人员无法得知撤销该功能的原因(是因为需求变更?还是因为发布后发现了严重的 Bug?)。
    • 优化建议:在执行 Revert 操作时,建议在 Commit 信息中补充具体的回滚原因。例如:Revert "feat(goods): ..." 原因:线上发现兼容性 Bug,暂行回滚,待修复后重新上线。

    二、评分明细

    1. 功能实现的正确性与健壮性(30/40分)

      • 理由:回滚操作本身的代码修改是干净彻底的。但直接在 API 包中删除字段违反了“RPC 接口已有参数变更属于危险实现”的规则,若直接上线可能引发严重的接口健壮性问题,故扣除一定分数。
    2. 安全性与潜在风险(25/30分)

      • 理由:未发现 SQL 注入、越权等传统安全漏洞。但微服务间的契约被破坏属于系统稳定性的重大潜在风险。
    3. 最佳实践与可维护性(15/20分)

      • 理由:对于对外暴露的 API,最佳实践是不做破坏性变更(Breaking Change),而是通过版本号控制或废弃注解(@Deprecated)平滑过渡。
    4. 性能与资源利用(5/5分)

      • 理由:本次变更为单纯的字段裁剪,未引入任何性能瓶颈或复杂的查询,无资源浪费问题。
    5. 提交信息质量(3/5分)

      • 理由:提交信息是由 Git 自动生成的,能够定位到被回滚的原始 Commit,但缺乏人工补充的上下文和回滚原因,不利于长期维护。

    总分:78分

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