Refactor surcharge management by replacing PrcPriceSetVersionSurcharge with PrcSurchargeRel, introducing price type handling (PRODUCT, SALES, REDLINE) and updating related services, mappers, and front-end components. Enhance validation and error messaging for price type and detail ID requirements. Update database schema to support new relationships and constraints.
This commit is contained in:
@@ -52,7 +52,8 @@ public class PrcPriceSetDetail implements Serializable
|
||||
/** null = open */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
private Date expireDate;
|
||||
private List<PrcPriceSetVersionSurcharge> surcharges;
|
||||
/** SALES rels for this detail (detail_id=psd_id, product_id=psp_id) */
|
||||
private List<PrcSurchargeRel> surcharges;
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date createTime;
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
|
||||
@@ -34,5 +34,4 @@ public class PrcPriceSetVersion extends BaseEntity
|
||||
|
||||
private List<PrcPriceSetDetail> details;
|
||||
private List<PrcPriceSetProduct> products;
|
||||
private List<PrcPriceSetVersionSurcharge> surcharges;
|
||||
}
|
||||
|
||||
-32
@@ -1,32 +0,0 @@
|
||||
package com.bms.price.domain;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import com.bms.common.core.domain.BaseEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/** Price set version surcharge snapshot prc_price_set_version_surcharge */
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class PrcPriceSetVersionSurcharge extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private Long psvsId;
|
||||
private Long psvId;
|
||||
/** source prc_surcharge.sc_id */
|
||||
private Long scId;
|
||||
/** prc_price_set_detail.psd_id */
|
||||
private Long psdId;
|
||||
/** copied from detail */
|
||||
private String productCode;
|
||||
private String scName;
|
||||
private String feeType;
|
||||
/** FIXED / WEIGHT / RATE */
|
||||
private String chargeType;
|
||||
private BigDecimal chargeValue;
|
||||
private String currency;
|
||||
private String roundMode;
|
||||
private String countryCode;
|
||||
private String scNote;
|
||||
}
|
||||
@@ -6,13 +6,12 @@ import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* 附加费与产品/明细关联 prc_surcharge_rel
|
||||
* 同时携带附加费展示字段(JOIN prc_surcharge)与明细展示字段(LEFT JOIN product_country),
|
||||
* 便于产品列表抽屉直接渲染。
|
||||
* 附加费与产品/明细/套餐关联 prc_surcharge_rel
|
||||
* 同时携带附加费展示字段(JOIN prc_surcharge)与明细展示字段(LEFT JOIN product_country,仅 PRODUCT/REDLINE)。
|
||||
*
|
||||
* 语义:
|
||||
* detail_id 为空 = 产品级附加费(作用于该产品全部明细)
|
||||
* detail_id 有值 = 明细级附加费(作用于该产品某个 国家×重量段 明细)
|
||||
* price_type 语义:
|
||||
* PRODUCT / REDLINE : product_id=product.product_id,detail_id=product_country.detail_id(空=产品全部明细)
|
||||
* SALES : product_id=prc_price_set_product.psp_id,detail_id=prc_price_set_detail.psd_id
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@@ -20,11 +19,24 @@ public class PrcSurchargeRel extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 价格类型:产品价 */
|
||||
public static final String PRICE_TYPE_PRODUCT = "PRODUCT";
|
||||
/** 价格类型:销售价(套餐) */
|
||||
public static final String PRICE_TYPE_SALES = "SALES";
|
||||
/** 价格类型:红线价 */
|
||||
public static final String PRICE_TYPE_REDLINE = "REDLINE";
|
||||
|
||||
private Long relId;
|
||||
private Long scId;
|
||||
/** PRODUCT/REDLINE=product_id;SALES=psp_id */
|
||||
private Long productId;
|
||||
private String productCode;
|
||||
/** PRODUCT/REDLINE=product_country.detail_id;SALES=psd_id */
|
||||
private Long detailId;
|
||||
/** PRODUCT / SALES / REDLINE */
|
||||
private String priceType;
|
||||
/** 适用国家ISO2(空=全部),rel 表字段 */
|
||||
private String countryCode;
|
||||
|
||||
/** 附加费冗余展示字段 */
|
||||
private String scName;
|
||||
@@ -34,10 +46,9 @@ public class PrcSurchargeRel extends BaseEntity
|
||||
private String currency;
|
||||
private String roundMode;
|
||||
private String ssCode;
|
||||
private String countryCode;
|
||||
private String scNote;
|
||||
|
||||
/** 明细展示字段 */
|
||||
/** 明细展示字段(PRODUCT/REDLINE LEFT JOIN product_country) */
|
||||
private String countryName;
|
||||
private BigDecimal weightMin;
|
||||
private BigDecimal weightMax;
|
||||
|
||||
Reference in New Issue
Block a user