修改产品功能

This commit is contained in:
wuweihua
2026-09-28 16:26:55 +08:00
parent 32ab61b51c
commit 623df69d4b
12 changed files with 217 additions and 93 deletions
@@ -39,4 +39,6 @@ public class BmsProduct extends BaseEntity
private List<BmsProductCountry> countries;
/** query alias of status (0/1/2) */
private String effectStatus;
/** query: active = status in (0,1); expired = status 2 */
private String statusGroup;
}
@@ -24,11 +24,6 @@ public class PrcPriceSet extends BaseEntity
private BigDecimal defaultDiscount;
private String defaultType;
private String calculateSign;
/**
* Pull-only: product base price version_no (V1/V2 from bms_product_price_version).
* Not a DB column — used when pullFromLibrary=Y to choose library rows.
*/
private String baseVersionNo;
@JsonFormat(pattern = "yyyy-MM-dd")
private Date effectiveDate;
@JsonFormat(pattern = "yyyy-MM-dd")
@@ -1830,21 +1830,22 @@ public class PrcPriceSetServiceImpl implements IPrcPriceSetService
detailMapper.deletePrcPriceSetDetailByPsvId(version.getPsvId());
// clean legacy rows without psv_id under this set (would look like duplicates in UI)
detailMapper.deleteOrphanDetailsByPriceSetId(set.getPriceSetId());
String baseVersionNo = set.getBaseVersionNo();
if (StringUtils.isEmpty(baseVersionNo))
{
throw new ServiceException(MessageUtils.message("price.set.baseVersionNo.empty"));
}
int inserted;
if (TYPE_DISCOUNT.equals(set.getSetType()))
{
inserted = detailMapper.insertDiscountDetailsFromLibrary(
set.getPriceSetId(), version.getPsvId(), baseVersionNo);
set.getPriceSetId(), version.getPsvId(), null);
}
else
{
// Prefer currently effective open country rows; fallback asOf window if needed
inserted = detailMapper.insertFixedDetailsFromLibrary(
set.getPriceSetId(), version.getPsvId(), null, false, baseVersionNo);
set.getPriceSetId(), version.getPsvId(), null, true, null);
if (inserted <= 0)
{
inserted = detailMapper.insertFixedDetailsFromLibrary(
set.getPriceSetId(), version.getPsvId(), new Date(), false, null);
}
}
if (inserted <= 0)
{