From 623df69d4b762755fcc9430c4b222dd1c396b19f Mon Sep 17 00:00:00 2001 From: wuweihua <88888888> Date: Mon, 28 Sep 2026 16:26:55 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BA=A7=E5=93=81=E5=8A=9F?= =?UTF-8?q?=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/bms/price/domain/BmsProduct.java | 2 + .../com/bms/price/domain/PrcPriceSet.java | 5 - .../service/impl/PrcPriceSetServiceImpl.java | 15 +- .../mapper/price/BmsProductMapper.xml | 21 ++- .../mapper/price/PrcPriceSetDetailMapper.xml | 1 + bms-front/src/api/price/product.js | 8 - .../components/ProductCountryDrawer.vue | 1 - .../components/ProductExpiredDrawer.vue | 137 ++++++++++++++++++ .../src/views/price/basic/product/index.vue | 21 +-- .../set/components/create/StepBasicInfo.vue | 97 ++++++------- bms-front/src/views/price/set/create.vue | 1 - .../src/views/price/set/utils/priceSet.js | 1 - 12 files changed, 217 insertions(+), 93 deletions(-) create mode 100644 bms-front/src/views/price/basic/product/components/ProductExpiredDrawer.vue diff --git a/bms-back/bms-system/src/main/java/com/bms/price/domain/BmsProduct.java b/bms-back/bms-system/src/main/java/com/bms/price/domain/BmsProduct.java index d2c6097b..679cce40 100644 --- a/bms-back/bms-system/src/main/java/com/bms/price/domain/BmsProduct.java +++ b/bms-back/bms-system/src/main/java/com/bms/price/domain/BmsProduct.java @@ -39,4 +39,6 @@ public class BmsProduct extends BaseEntity private List countries; /** query alias of status (0/1/2) */ private String effectStatus; + /** query: active = status in (0,1); expired = status 2 */ + private String statusGroup; } diff --git a/bms-back/bms-system/src/main/java/com/bms/price/domain/PrcPriceSet.java b/bms-back/bms-system/src/main/java/com/bms/price/domain/PrcPriceSet.java index 6ed87327..e5d4bd43 100644 --- a/bms-back/bms-system/src/main/java/com/bms/price/domain/PrcPriceSet.java +++ b/bms-back/bms-system/src/main/java/com/bms/price/domain/PrcPriceSet.java @@ -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") diff --git a/bms-back/bms-system/src/main/java/com/bms/price/service/impl/PrcPriceSetServiceImpl.java b/bms-back/bms-system/src/main/java/com/bms/price/service/impl/PrcPriceSetServiceImpl.java index 6238f125..f181fa0a 100644 --- a/bms-back/bms-system/src/main/java/com/bms/price/service/impl/PrcPriceSetServiceImpl.java +++ b/bms-back/bms-system/src/main/java/com/bms/price/service/impl/PrcPriceSetServiceImpl.java @@ -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) { diff --git a/bms-back/bms-system/src/main/resources/mapper/price/BmsProductMapper.xml b/bms-back/bms-system/src/main/resources/mapper/price/BmsProductMapper.xml index 2f8bde78..059fcdeb 100644 --- a/bms-back/bms-system/src/main/resources/mapper/price/BmsProductMapper.xml +++ b/bms-back/bms-system/src/main/resources/mapper/price/BmsProductMapper.xml @@ -96,6 +96,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" AND p.status = #{effectStatus} + + AND p.status in ('0', '1') + + + AND p.status = '2' + + AND p.expire_date >= #{params.beginTime} + + + AND p.expire_date <= #{params.endTime} + + AND p.cargo_attr like concat('%', #{cargoAttr}, '%') @@ -104,7 +116,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" OR p.product_name like concat('%', #{params.keyword}, '%')) - order by p.product_code asc, p.effective_date desc, p.product_id desc + + + order by p.expire_date desc, p.product_code asc, p.product_id desc + + + order by p.product_code asc, p.effective_date desc, p.product_id desc + + diff --git a/bms-back/bms-system/src/main/resources/mapper/price/PrcPriceSetDetailMapper.xml b/bms-back/bms-system/src/main/resources/mapper/price/PrcPriceSetDetailMapper.xml index 53868a93..2bb8c55a 100644 --- a/bms-back/bms-system/src/main/resources/mapper/price/PrcPriceSetDetailMapper.xml +++ b/bms-back/bms-system/src/main/resources/mapper/price/PrcPriceSetDetailMapper.xml @@ -171,6 +171,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and ifnull(c.status, '1') <> '2' + and (c.effective_date is null or date(c.effective_date) <= curdate()) and (c.expire_date is null or date(c.expire_date) > curdate()) diff --git a/bms-front/src/api/price/product.js b/bms-front/src/api/price/product.js index 07101e0f..d475032b 100644 --- a/bms-front/src/api/price/product.js +++ b/bms-front/src/api/price/product.js @@ -63,11 +63,3 @@ export function delProduct(productIds) { method: 'delete' }) } - -/** List base-price version options (by effective_date desc) for package create */ -export function listProductPriceVersions() { - return request({ - url: '/price/product/priceVersions', - method: 'get' - }) -} diff --git a/bms-front/src/views/price/basic/product/components/ProductCountryDrawer.vue b/bms-front/src/views/price/basic/product/components/ProductCountryDrawer.vue index 23e8e25e..db24b387 100644 --- a/bms-front/src/views/price/basic/product/components/ProductCountryDrawer.vue +++ b/bms-front/src/views/price/basic/product/components/ProductCountryDrawer.vue @@ -95,7 +95,6 @@ import { formatWeightLabel } from '@/views/price/set/utils/priceSet' const { proxy } = getCurrentInstance() const columns = [ - { prop: 'versionNo', label: '版本', width: 70, align: 'center', formatter: (row) => row.versionNo || '-' }, { prop: 'countryName', label: '国家', width: 120, showOverflowTooltip: true }, // { prop: 'countryCode', label: 'ISO2', width: 60, align: 'center' }, { prop: 'zoneName', label: '分区名称', width: 140, showOverflowTooltip: true, formatter: (row) => row.zoneName || '-' }, diff --git a/bms-front/src/views/price/basic/product/components/ProductExpiredDrawer.vue b/bms-front/src/views/price/basic/product/components/ProductExpiredDrawer.vue new file mode 100644 index 00000000..44310150 --- /dev/null +++ b/bms-front/src/views/price/basic/product/components/ProductExpiredDrawer.vue @@ -0,0 +1,137 @@ + + + diff --git a/bms-front/src/views/price/basic/product/index.vue b/bms-front/src/views/price/basic/product/index.vue index 9f847f5b..b77dbbcd 100644 --- a/bms-front/src/views/price/basic/product/index.vue +++ b/bms-front/src/views/price/basic/product/index.vue @@ -10,6 +10,7 @@ + + 失效价格 +