修改产品功能

This commit is contained in:
wuweihua
2026-09-28 21:43:39 +08:00
parent b247bc2fd2
commit 0ad90f6183
32 changed files with 339 additions and 660 deletions
@@ -23,9 +23,6 @@ public interface BmsProductCountryMapper
/** Import overlay: update price/zone/attrs on matched country row */
public int updateBmsProductCountryImport(BmsProductCountry country);
/** Bind legacy open row to a version */
public int updatePpvId(@Param("detailId") Long detailId, @Param("ppvId") Long ppvId);
public int deleteByProductId(Long productId);
public int deleteByProductCode(String productCode);
@@ -53,22 +50,9 @@ public interface BmsProductCountryMapper
/** Open country rows (expire_date is null) for product */
public List<BmsProductCountry> selectOpenByProductCode(@Param("productCode") String productCode);
/** Country rows under a price version */
public List<BmsProductCountry> selectByPpvId(@Param("ppvId") Long ppvId);
/** Copy open/source version rows into a new version (new ppv_id / product_id / effective_date) */
public int copyCountriesFromVersion(
@Param("srcPpvId") Long srcPpvId,
@Param("newPpvId") Long newPpvId,
@Param("productId") Long productId,
/** Copy previously open rows into a new effective_date (caller must expire first) */
public int copyOpenCountries(
@Param("productCode") String productCode,
@Param("effectiveDate") Date effectiveDate,
@Param("status") String status);
/** Copy currently open rows (legacy / no ppv_id) into a new version */
public int copyOpenCountriesToVersion(
@Param("productCode") String productCode,
@Param("newPpvId") Long newPpvId,
@Param("productId") Long productId,
@Param("effectiveDate") Date effectiveDate,
@Param("status") String status);
@@ -1,38 +0,0 @@
package com.bms.price.mapper;
import java.util.Date;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import com.bms.price.domain.BmsProductPriceVersion;
/**
* Product base price version
*/
public interface BmsProductPriceVersionMapper
{
public BmsProductPriceVersion selectBmsProductPriceVersionById(Long ppvId);
/** Open version (expire_date is null), prefer latest effective_date */
public BmsProductPriceVersion selectOpenByProductCode(@Param("productCode") String productCode);
public BmsProductPriceVersion selectByProductCodeAndEffectiveDate(
@Param("productCode") String productCode,
@Param("effectiveDate") Date effectiveDate);
public Integer selectMaxVersionSeq(@Param("productCode") String productCode);
/** Distinct effective_date options for package create dropdown (desc) */
public List<BmsProductPriceVersion> selectVersionOptions();
public int insertBmsProductPriceVersion(BmsProductPriceVersion version);
public int updateBmsProductPriceVersion(BmsProductPriceVersion version);
/** Close open versions: set expire_date = newEffectiveDate where effective_date &lt; newEffectiveDate */
public int expireOpenByProductCode(
@Param("productCode") String productCode,
@Param("newEffectiveDate") Date newEffectiveDate);
/** Recompute status from effective_date / expire_date vs today */
public int refreshStatusByDates();
}
@@ -42,23 +42,17 @@ public interface PrcPriceSetDetailMapper
/** Copy all details from src version into new version (new psd_id, same price_set_id) */
public int copyDetailsFromVersion(@Param("srcPsvId") Long srcPsvId, @Param("newPsvId") Long newPsvId);
/**
* FIXED: insert details from product country library.
* When baseVersionNo is set, pull that base-price version only;
* otherwise asOf window or openOnly fallback.
*/
/** FIXED: insert details from product country library (asOf window or openOnly). */
public int insertFixedDetailsFromLibrary(
@Param("priceSetId") Long priceSetId,
@Param("psvId") Long psvId,
@Param("asOf") Date asOf,
@Param("openOnly") boolean openOnly,
@Param("baseVersionNo") String baseVersionNo);
@Param("openOnly") boolean openOnly);
/** DISCOUNT: one detail row per product (optionally scoped to base version_no) */
/** DISCOUNT: one detail row per effective product */
public int insertDiscountDetailsFromLibrary(
@Param("priceSetId") Long priceSetId,
@Param("psvId") Long psvId,
@Param("baseVersionNo") String baseVersionNo);
@Param("psvId") Long psvId);
/** FIXED: product + country + zone + productCountryId / weight; optional psvId scopes to version */
public PrcPriceSetDetail selectFixedMatch(
@@ -18,5 +18,8 @@ public interface PrcQuoteMapper
public int updateQuoteAmounts(@Param("quoteId") String quoteId,
@Param("surchargeAmount") BigDecimal surchargeAmount,
@Param("payableTotal") BigDecimal payableTotal);
@Param("payableTotal") BigDecimal payableTotal,
@Param("productAmount") BigDecimal productAmount,
@Param("costAmount") BigDecimal costAmount,
@Param("payTotal") BigDecimal payTotal);
}