From 02763f092ee478e29fbf3f185d6e59cc020f3cbb Mon Sep 17 00:00:00 2001 From: wuweihua <88888888> Date: Wed, 11 Nov 2026 10:12:11 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=89=93=E5=8D=95=E5=A5=97?= =?UTF-8?q?=E9=A4=90=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../price/LabelPackageController.java | 48 ----- .../bms/price/domain/ChannelProductMap.java | 3 - .../price/mapper/ChannelProductMapMapper.java | 7 +- .../price/mapper/PayProductTermMapper.java | 2 - .../bms/price/service/IPayProductService.java | 8 - .../service/impl/PayProductServiceImpl.java | 101 ---------- .../mapper/price/ChannelProductMapMapper.xml | 27 +-- .../mapper/price/PayProductTermMapper.xml | 9 - .../sql/price/srv_channel_product_map.sql | 15 -- bms-front/src/api/price/label.js | 21 -- .../label/components/LabelChannelTable.vue | 182 ------------------ bms-front/src/views/price/label/detail.vue | 5 - 12 files changed, 4 insertions(+), 424 deletions(-) delete mode 100644 bms-front/src/views/price/label/components/LabelChannelTable.vue diff --git a/bms-back/bms-admin/src/main/java/com/bms/web/controller/price/LabelPackageController.java b/bms-back/bms-admin/src/main/java/com/bms/web/controller/price/LabelPackageController.java index 14913a99..6a43760e 100644 --- a/bms-back/bms-admin/src/main/java/com/bms/web/controller/price/LabelPackageController.java +++ b/bms-back/bms-admin/src/main/java/com/bms/web/controller/price/LabelPackageController.java @@ -217,54 +217,6 @@ public class LabelPackageController extends BaseController return toAjax(payProductService.removeLabelProducts(priceSetId, productIds)); } - @PreAuthorize("@ss.hasPermi('price:label:query')") - @GetMapping("/{priceSetId}/channels") - public AjaxResult listChannels(@PathVariable Long priceSetId) - { - priceSetService.assertSetCategory(priceSetId, PrcPriceSet.CATEGORY_LABEL); - return success(payProductService.listLabelChannels(priceSetId)); - } - - @PreAuthorize("@ss.hasPermi('price:label:edit')") - @Log(title = "打单套餐绑定渠道", businessType = BusinessType.UPDATE) - @PutMapping("/{priceSetId}/channels") - public AjaxResult bindChannels(@PathVariable Long priceSetId, @RequestBody Map body) - { - priceSetService.assertSetCategory(priceSetId, PrcPriceSet.CATEGORY_LABEL); - List channelIds = new ArrayList(); - Object rawIds = body == null ? null : body.get("channelIds"); - if (rawIds instanceof List) - { - for (Object item : (List) rawIds) - { - if (item != null && !String.valueOf(item).trim().isEmpty()) - { - channelIds.add(String.valueOf(item).trim()); - } - } - } - Long productId = null; - Object rawProductId = body == null ? null : body.get("productId"); - if (rawProductId instanceof Number) - { - productId = ((Number) rawProductId).longValue(); - } - else if (rawProductId != null && !String.valueOf(rawProductId).trim().isEmpty() - && !"null".equalsIgnoreCase(String.valueOf(rawProductId).trim())) - { - productId = Long.valueOf(String.valueOf(rawProductId).trim()); - } - return success(payProductService.bindLabelChannels(priceSetId, channelIds, productId)); - } - - @PreAuthorize("@ss.hasPermi('price:label:edit')") - @Log(title = "打单套餐解绑渠道", businessType = BusinessType.DELETE) - @DeleteMapping("/{priceSetId}/channels/{channelId}") - public AjaxResult unbindChannel(@PathVariable Long priceSetId, @PathVariable String channelId) - { - priceSetService.assertSetCategory(priceSetId, PrcPriceSet.CATEGORY_LABEL); - return toAjax(payProductService.unbindLabelChannel(priceSetId, channelId)); - } @PreAuthorize("@ss.hasPermi('price:label:list')") @GetMapping("/customer/list") diff --git a/bms-back/bms-system/src/main/java/com/bms/price/domain/ChannelProductMap.java b/bms-back/bms-system/src/main/java/com/bms/price/domain/ChannelProductMap.java index 49eb06ad..e8198d8b 100644 --- a/bms-back/bms-system/src/main/java/com/bms/price/domain/ChannelProductMap.java +++ b/bms-back/bms-system/src/main/java/com/bms/price/domain/ChannelProductMap.java @@ -20,9 +20,6 @@ public class ChannelProductMap private Long productId; - /** 打单套餐 ID,对应 prc_price_set.price_set_id(应收可填) */ - private Long priceSetId; - /** 渠道名称(列表回显) */ private String channelName; diff --git a/bms-back/bms-system/src/main/java/com/bms/price/mapper/ChannelProductMapMapper.java b/bms-back/bms-system/src/main/java/com/bms/price/mapper/ChannelProductMapMapper.java index 05933715..f557cccd 100644 --- a/bms-back/bms-system/src/main/java/com/bms/price/mapper/ChannelProductMapMapper.java +++ b/bms-back/bms-system/src/main/java/com/bms/price/mapper/ChannelProductMapMapper.java @@ -1,24 +1,19 @@ package com.bms.price.mapper; -import java.util.List; import org.apache.ibatis.annotations.Param; import com.bms.price.domain.ChannelProductMap; /** - * 渠道产品关系映射 + * Channel-product pay-type mapping. */ public interface ChannelProductMapMapper { ChannelProductMap selectByChannelAndType(@Param("channelId") String channelId, @Param("payType") String payType); - List selectByPriceSetId(@Param("priceSetId") Long priceSetId); int upsert(ChannelProductMap row); int deleteByChannelAndType(@Param("channelId") String channelId, @Param("payType") String payType); - int deleteByChannelTypeAndPriceSet(@Param("channelId") String channelId, @Param("payType") String payType, - @Param("priceSetId") Long priceSetId); - int deleteByProductId(@Param("productId") Long productId); } diff --git a/bms-back/bms-system/src/main/java/com/bms/price/mapper/PayProductTermMapper.java b/bms-back/bms-system/src/main/java/com/bms/price/mapper/PayProductTermMapper.java index f900cf56..ed8df97c 100644 --- a/bms-back/bms-system/src/main/java/com/bms/price/mapper/PayProductTermMapper.java +++ b/bms-back/bms-system/src/main/java/com/bms/price/mapper/PayProductTermMapper.java @@ -17,8 +17,6 @@ public interface PayProductTermMapper PayProductTerm selectByProductId(Long productId); - /** 打单产品所属套餐 ID */ - Long selectLabelPriceSetIdByProduct(@Param("productId") Long productId); List selectByPriceSetId(@Param("priceSetId") Long priceSetId); diff --git a/bms-back/bms-system/src/main/java/com/bms/price/service/IPayProductService.java b/bms-back/bms-system/src/main/java/com/bms/price/service/IPayProductService.java index d5d414f4..f4228c16 100644 --- a/bms-back/bms-system/src/main/java/com/bms/price/service/IPayProductService.java +++ b/bms-back/bms-system/src/main/java/com/bms/price/service/IPayProductService.java @@ -91,14 +91,6 @@ public interface IPayProductService /** 从打单套餐移除产品(失效/清理对应 term 明细) */ int removeLabelProducts(Long priceSetId, Long[] productIds); - /** 打单套餐已绑定渠道列表 */ - java.util.List listLabelChannels(Long priceSetId); - - /** 打单套餐批量绑定渠道(写 AR + price_set_id) */ - String bindLabelChannels(Long priceSetId, java.util.List channelIds, Long productId); - - /** 打单套餐解绑渠道 */ - int unbindLabelChannel(Long priceSetId, String channelId); /** 取消渠道上指定收付类型的产品。payType 为空时按应付 AP */ void unbindChannel(String channelId, String payType); diff --git a/bms-back/bms-system/src/main/java/com/bms/price/service/impl/PayProductServiceImpl.java b/bms-back/bms-system/src/main/java/com/bms/price/service/impl/PayProductServiceImpl.java index bb0bd09a..0feb7f1b 100644 --- a/bms-back/bms-system/src/main/java/com/bms/price/service/impl/PayProductServiceImpl.java +++ b/bms-back/bms-system/src/main/java/com/bms/price/service/impl/PayProductServiceImpl.java @@ -1056,103 +1056,6 @@ public class PayProductServiceImpl implements IPayProductService return n; } - @Override - public List listLabelChannels(Long priceSetId) - { - if (priceSetId == null) - { - return Collections.emptyList(); - } - List list = channelProductMapMapper.selectByPriceSetId(priceSetId); - return list == null ? Collections.emptyList() : list; - } - - @Override - @Transactional(rollbackFor = Exception.class) - public String bindLabelChannels(Long priceSetId, List channelIds, Long productId) - { - if (priceSetId == null) - { - throw new ServiceException("请选择打单套餐"); - } - if (channelIds == null || channelIds.isEmpty()) - { - throw new ServiceException("请选择要绑定的渠道"); - } - if (productId == null) - { - throw new ServiceException("请选择套餐内应收产品"); - } - PrcPriceSet set = priceSetMapper.selectPrcPriceSetById(priceSetId); - if (set == null || !PrcPriceSet.CATEGORY_LABEL.equalsIgnoreCase(String.valueOf(set.getSetCategory()))) - { - throw new ServiceException("打单套餐不存在"); - } - Long root = resolveRoot(productId); - boolean inSet = false; - List products = selectLabelProducts(priceSetId); - for (PayProduct p : products) - { - if (p != null && root.equals(p.getProductId())) - { - inSet = true; - break; - } - } - if (!inSet) - { - throw new ServiceException("所选产品不属于本打单套餐"); - } - String operator = SecurityUtils.getUsername(); - int n = 0; - for (String channelId : channelIds) - { - if (isBlank(channelId)) - { - continue; - } - ServiceChannel channel = serviceChannelMapper.selectServiceChannelById(channelId.trim()); - if (channel == null || isBlank(channel.getChannelCode())) - { - throw new ServiceException("渠道不存在或渠道编码为空:" + channelId); - } - ChannelProductMap row = new ChannelProductMap(); - row.setChannelId(channelId.trim()); - row.setChannelCode(channel.getChannelCode()); - row.setProductId(root); - row.setPriceSetId(priceSetId); - row.setPayType(PAY_TYPE_AR); - row.setCreateBy(operator); - row.setUpdateBy(operator); - channelProductMapMapper.upsert(row); - n++; - } - if (n <= 0) - { - throw new ServiceException("没有可绑定的渠道"); - } - return "已绑定 " + n + " 个渠道"; - } - - @Override - @Transactional(rollbackFor = Exception.class) - public int unbindLabelChannel(Long priceSetId, String channelId) - { - if (priceSetId == null || isBlank(channelId)) - { - return 0; - } - return channelProductMapMapper.deleteByChannelTypeAndPriceSet(channelId.trim(), PAY_TYPE_AR, priceSetId); - } - - private Long resolveLabelPriceSetId(Long productId) - { - if (productId == null) - { - return null; - } - return payProductTermMapper.selectLabelPriceSetIdByProduct(productId); - } @Override public List selectLabelProducts(Long priceSetId) @@ -1756,10 +1659,6 @@ public class PayProductServiceImpl implements IPayProductService row.setChannelCode(channel.getChannelCode()); row.setProductId(storedId); row.setPayType(type); - if (PAY_TYPE_AR.equals(type)) - { - row.setPriceSetId(resolveLabelPriceSetId(storedId)); - } String operator = SecurityUtils.getUsername(); row.setCreateBy(operator); row.setUpdateBy(operator); diff --git a/bms-back/bms-system/src/main/resources/mapper/price/ChannelProductMapMapper.xml b/bms-back/bms-system/src/main/resources/mapper/price/ChannelProductMapMapper.xml index 30e48929..3a0a3fc4 100644 --- a/bms-back/bms-system/src/main/resources/mapper/price/ChannelProductMapMapper.xml +++ b/bms-back/bms-system/src/main/resources/mapper/price/ChannelProductMapMapper.xml @@ -6,37 +6,23 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - insert into srv_channel_product_map ( - channel_id, channel_code, product_id, price_set_id, pay_type, create_by, create_time, update_by, update_time + channel_id, channel_code, product_id, pay_type, create_by, create_time, update_by, update_time ) values ( - #{channelId}, #{channelCode}, #{productId}, #{priceSetId}, #{payType}, #{createBy}, sysdate(), #{updateBy}, sysdate() + #{channelId}, #{channelCode}, #{productId}, #{payType}, #{createBy}, sysdate(), #{updateBy}, sysdate() ) on duplicate key update channel_code = values(channel_code), product_id = values(product_id), - price_set_id = values(price_set_id), update_by = values(update_by), update_time = sysdate() @@ -46,13 +32,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" where channel_id = #{channelId} and pay_type = #{payType} - - delete from srv_channel_product_map - where channel_id = #{channelId} - and pay_type = #{payType} - and price_set_id = #{priceSetId} - - delete from srv_channel_product_map where product_id = #{productId} diff --git a/bms-back/bms-system/src/main/resources/mapper/price/PayProductTermMapper.xml b/bms-back/bms-system/src/main/resources/mapper/price/PayProductTermMapper.xml index 8d9a6563..d3e6407c 100644 --- a/bms-back/bms-system/src/main/resources/mapper/price/PayProductTermMapper.xml +++ b/bms-back/bms-system/src/main/resources/mapper/price/PayProductTermMapper.xml @@ -41,15 +41,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" limit 1 - -