From a5e9511857ff7db5369274bc542b7194182b3203 Mon Sep 17 00:00:00 2001 From: wuweihua <88888888> Date: Wed, 28 Oct 2026 22:14:09 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8E=BB=E6=8E=89=E5=A5=97=E9=A4=90=E7=94=A8?= =?UTF-8?q?=E6=88=B7=E7=BB=91=E5=AE=9A=E5=8A=9F=E8=83=BD=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/price/PriceSetController.java | 26 --- .../com/bms/price/domain/PrcPriceSet.java | 2 - .../com/bms/price/domain/PrcPriceSetUser.java | 21 --- .../price/mapper/PrcPriceSetUserMapper.java | 20 -- .../price/service/IPrcPriceSetService.java | 7 - .../service/impl/PrcPriceSetServiceImpl.java | 64 +------ .../mapper/price/PrcPriceSetMapper.xml | 8 - .../mapper/price/PrcPriceSetUserMapper.xml | 56 ------ bms-back/sql/bms_init.sql | 17 -- bms-back/sql/price/prc_price_set_user.sql | 16 +- bms-front/src/api/price/set.js | 23 --- .../set/components/detail/SetUserTable.vue | 174 ------------------ bms-front/src/views/price/set/detail.vue | 3 - 13 files changed, 4 insertions(+), 433 deletions(-) delete mode 100644 bms-back/bms-system/src/main/java/com/bms/price/domain/PrcPriceSetUser.java delete mode 100644 bms-back/bms-system/src/main/java/com/bms/price/mapper/PrcPriceSetUserMapper.java delete mode 100644 bms-back/bms-system/src/main/resources/mapper/price/PrcPriceSetUserMapper.xml delete mode 100644 bms-front/src/views/price/set/components/detail/SetUserTable.vue diff --git a/bms-back/bms-admin/src/main/java/com/bms/web/controller/price/PriceSetController.java b/bms-back/bms-admin/src/main/java/com/bms/web/controller/price/PriceSetController.java index 980f03a1..f19ac1b5 100644 --- a/bms-back/bms-admin/src/main/java/com/bms/web/controller/price/PriceSetController.java +++ b/bms-back/bms-admin/src/main/java/com/bms/web/controller/price/PriceSetController.java @@ -27,7 +27,6 @@ import com.bms.common.enums.BusinessType; import com.bms.common.utils.MessageUtils; import com.bms.common.utils.StringUtils; import com.bms.price.domain.PrcCustomerPriceSet; -import com.bms.price.domain.PrcPriceSetUser; import com.bms.price.domain.PrcPriceExcelFile; import com.bms.price.domain.PrcPriceSet; import com.bms.price.domain.PrcPriceSetDetail; @@ -388,29 +387,4 @@ public class PriceSetController extends BaseController return toAjax(priceSetService.deleteCustomerByIds(customerPricesetIds)); } - @PreAuthorize("@ss.hasPermi('price:set:list')") - @GetMapping("/viewer/list") - public TableDataInfo viewerList(PrcPriceSetUser query) - { - startPage(); - List list = priceSetService.selectViewerList(query); - return getDataTable(list); - } - - @PreAuthorize("@ss.hasPermi('price:set:edit')") - @Log(title = "Package viewer bind", businessType = BusinessType.INSERT) - @PostMapping("/viewer") - public AjaxResult addViewer(@RequestBody PrcPriceSetUser row) - { - row.setCreateBy(getUsername()); - return toAjax(priceSetService.insertViewer(row)); - } - - @PreAuthorize("@ss.hasPermi('price:set:edit')") - @Log(title = "Package viewer bind", businessType = BusinessType.DELETE) - @DeleteMapping("/viewer/{psuIds}") - public AjaxResult removeViewer(@PathVariable Long[] psuIds) - { - return toAjax(priceSetService.deleteViewerByIds(psuIds)); - } } 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 ccac8224..8f260747 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 @@ -42,8 +42,6 @@ public class PrcPriceSet extends BaseEntity private List details; private List versions; private List customers; - /** viewers explicitly bound to this package */ - private List viewers; /** async save task id (not persisted) */ private String saveTaskId; /** Y: ignored on save; library pull only via /detail/pullFromLibrary */ diff --git a/bms-back/bms-system/src/main/java/com/bms/price/domain/PrcPriceSetUser.java b/bms-back/bms-system/src/main/java/com/bms/price/domain/PrcPriceSetUser.java deleted file mode 100644 index a0bdba1e..00000000 --- a/bms-back/bms-system/src/main/java/com/bms/price/domain/PrcPriceSetUser.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.bms.price.domain; - -import com.bms.common.core.domain.BaseEntity; -import lombok.Data; -import lombok.EqualsAndHashCode; - -/** 套餐可查看人绑定:prc_price_set_user */ -@Data -@EqualsAndHashCode(callSuper = true) -public class PrcPriceSetUser extends BaseEntity -{ - private static final long serialVersionUID = 1L; - - private Long psuId; - private Long priceSetId; - private Long userId; - /** login account */ - private String userName; - /** display only, not a table column */ - private String nickName; -} diff --git a/bms-back/bms-system/src/main/java/com/bms/price/mapper/PrcPriceSetUserMapper.java b/bms-back/bms-system/src/main/java/com/bms/price/mapper/PrcPriceSetUserMapper.java deleted file mode 100644 index 337a4232..00000000 --- a/bms-back/bms-system/src/main/java/com/bms/price/mapper/PrcPriceSetUserMapper.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.bms.price.mapper; - -import java.util.List; -import org.apache.ibatis.annotations.Param; -import com.bms.price.domain.PrcPriceSetUser; - -public interface PrcPriceSetUserMapper -{ - PrcPriceSetUser selectPrcPriceSetUserById(Long psuId); - - List selectPrcPriceSetUserList(PrcPriceSetUser query); - - int insertPrcPriceSetUser(PrcPriceSetUser row); - - int deletePrcPriceSetUserByIds(Long[] psuIds); - - int deleteByPriceSetId(Long priceSetId); - - int countBySetAndUser(@Param("priceSetId") Long priceSetId, @Param("userId") Long userId); -} diff --git a/bms-back/bms-system/src/main/java/com/bms/price/service/IPrcPriceSetService.java b/bms-back/bms-system/src/main/java/com/bms/price/service/IPrcPriceSetService.java index 7ef854b1..08a19764 100644 --- a/bms-back/bms-system/src/main/java/com/bms/price/service/IPrcPriceSetService.java +++ b/bms-back/bms-system/src/main/java/com/bms/price/service/IPrcPriceSetService.java @@ -9,7 +9,6 @@ import com.bms.price.domain.PrcPriceSet; import com.bms.price.domain.PrcPriceSetCheckItem; import com.bms.price.domain.PrcPriceSetDetail; import com.bms.price.domain.PrcPriceSetSaveTask; -import com.bms.price.domain.PrcPriceSetUser; /** * 价格套餐 服务层 @@ -92,12 +91,6 @@ public interface IPrcPriceSetService public int deleteCustomerByIds(Long[] customerPricesetIds); - public List selectViewerList(PrcPriceSetUser query); - - public int insertViewer(PrcPriceSetUser row); - - public int deleteViewerByIds(Long[] psuIds); - /** chain expire_time = next version effective_time, then refresh 0/3/1/2 */ public int refreshAllVersionStatus(); 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 399fea03..f4e1b740 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 @@ -30,7 +30,6 @@ import com.bms.price.domain.BmsProductCountry; import com.bms.price.domain.PrcCustomerPriceSet; import com.bms.price.domain.PrcPriceExcelFile; import com.bms.price.domain.PrcPriceSet; -import com.bms.price.domain.PrcPriceSetUser; import com.bms.price.domain.PrcPriceSetCheckItem; import com.bms.price.domain.PrcPriceSetDetail; import com.bms.price.domain.PrcPriceSetProduct; @@ -44,12 +43,9 @@ import com.bms.price.mapper.PrcCustomerPriceSetMapper; import com.bms.price.mapper.PrcPriceSetDetailMapper; import com.bms.price.mapper.PrcPriceSetMapper; import com.bms.price.mapper.PrcPriceSetProductMapper; -import com.bms.price.mapper.PrcPriceSetUserMapper; import com.bms.price.mapper.PrcPriceSetVersionMapper; import com.bms.price.mapper.PrcSurchargeMapper; import com.bms.price.mapper.PrcSurchargeRelMapper; -import com.bms.common.core.domain.entity.SysUser; -import com.bms.system.mapper.SysUserMapper; import com.bms.price.service.IBmsProductService; import com.bms.price.search.IBillSearchStore; import com.bms.price.search.PriceChangeEsLog; @@ -105,12 +101,6 @@ public class PrcPriceSetServiceImpl implements IPrcPriceSetService @Autowired private PrcCustomerPriceSetMapper customerMapper; - @Autowired - private PrcPriceSetUserMapper priceSetUserMapper; - - @Autowired - private SysUserMapper sysUserMapper; - @Autowired private BmsProductCountryMapper productCountryMapper; @@ -149,18 +139,14 @@ public class PrcPriceSetServiceImpl implements IPrcPriceSetService } /** - * Price-set list data scope: bound customer's sales user (same as customer list), - * package creator, or explicit viewer bind. Super admin skips filter in DataScopeAspect. + * Price-set list data scope: bound customer's sales user (same as customer list) + * or package creator. Super admin skips filter in DataScopeAspect. */ @Override @DataScope(deptAlias = "su", deptField = "dept_id", userAlias = "su", userField = "user_id", permission = "price:set:list") public List selectPrcPriceSetList(PrcPriceSet set) { - if (set != null) - { - set.getParams().put("viewerUserId", SecurityUtils.getUserId()); - } List list = setMapper.selectPrcPriceSetList(set); for (PrcPriceSet item : list) { @@ -2468,49 +2454,6 @@ public class PrcPriceSetServiceImpl implements IPrcPriceSetService return customerMapper.deletePrcCustomerPriceSetByIds(customerPricesetIds); } - @Override - public List selectViewerList(PrcPriceSetUser query) - { - return priceSetUserMapper.selectPrcPriceSetUserList(query); - } - - @Override - @Transactional - public int insertViewer(PrcPriceSetUser row) - { - if (row == null || row.getPriceSetId() == null || row.getUserId() == null) - { - throw new ServiceException("price set user bind requires priceSetId and userId"); - } - requireSet(row.getPriceSetId()); - if (priceSetUserMapper.countBySetAndUser(row.getPriceSetId(), row.getUserId()) > 0) - { - throw new ServiceException("user already bound to this price set"); - } - SysUser user = sysUserMapper.selectUserById(row.getUserId()); - if (user == null) - { - throw new ServiceException("user not found"); - } - row.setUserName(user.getUserName()); - if (StringUtils.isEmpty(row.getCreateBy())) - { - row.setCreateBy(SecurityUtils.getUsername()); - } - return priceSetUserMapper.insertPrcPriceSetUser(row); - } - - @Override - @Transactional - public int deleteViewerByIds(Long[] psuIds) - { - if (psuIds == null || psuIds.length == 0) - { - return 0; - } - return priceSetUserMapper.deletePrcPriceSetUserByIds(psuIds); - } - private void replaceChildren(PrcPriceSet set) { saveOrUpdateVersion(set); @@ -3277,9 +3220,6 @@ public class PrcPriceSetServiceImpl implements IPrcPriceSetService PrcCustomerPriceSet cquery = new PrcCustomerPriceSet(); cquery.setPriceSetId(priceSetId); set.setCustomers(customerMapper.selectPrcCustomerPriceSetList(cquery)); - PrcPriceSetUser uquery = new PrcPriceSetUser(); - uquery.setPriceSetId(priceSetId); - set.setViewers(priceSetUserMapper.selectPrcPriceSetUserList(uquery)); } private void fillVersionChildren(PrcPriceSetVersion version) diff --git a/bms-back/bms-system/src/main/resources/mapper/price/PrcPriceSetMapper.xml b/bms-back/bms-system/src/main/resources/mapper/price/PrcPriceSetMapper.xml index f250e02f..cadbeba0 100644 --- a/bms-back/bms-system/src/main/resources/mapper/price/PrcPriceSetMapper.xml +++ b/bms-back/bms-system/src/main/resources/mapper/price/PrcPriceSetMapper.xml @@ -105,14 +105,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" AND su.user_name = s.created_by COLLATE utf8mb4_general_ci ${params.dataScope} ) - - OR EXISTS ( - SELECT 1 - FROM prc_price_set_user psu - WHERE psu.price_set_id = s.price_set_id - AND psu.user_id = #{params.viewerUserId} - ) - ) diff --git a/bms-back/bms-system/src/main/resources/mapper/price/PrcPriceSetUserMapper.xml b/bms-back/bms-system/src/main/resources/mapper/price/PrcPriceSetUserMapper.xml deleted file mode 100644 index 19f33d05..00000000 --- a/bms-back/bms-system/src/main/resources/mapper/price/PrcPriceSetUserMapper.xml +++ /dev/null @@ -1,56 +0,0 @@ - - - - - - - - - - - - - - - - select psu.psu_id, psu.price_set_id, psu.user_id, psu.user_name, - u.nick_name, psu.created_by, psu.create_time - from prc_price_set_user psu - left join sys_user u on u.user_id = psu.user_id - - - - - - - - - - insert into prc_price_set_user (price_set_id, user_id, user_name, created_by, create_time) - values (#{priceSetId}, #{userId}, #{userName}, #{createBy}, sysdate()) - - - - delete from prc_price_set_user where psu_id in - #{id} - - - - delete from prc_price_set_user where price_set_id = #{priceSetId} - - diff --git a/bms-back/sql/bms_init.sql b/bms-back/sql/bms_init.sql index 4f3fe6a5..04f82ec5 100644 --- a/bms-back/sql/bms_init.sql +++ b/bms-back/sql/bms_init.sql @@ -806,23 +806,6 @@ CREATE TABLE `prc_customer_price_set` ( CONSTRAINT `fk_customer_price_set` FOREIGN KEY (`price_set_id`) REFERENCES `prc_price_set` (`price_set_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='客户套餐表-客户某时间段内使用的套餐'; --- ---------------------------- --- 表结构:`prc_price_set_user` --- ---------------------------- -CREATE TABLE `prc_price_set_user` ( - `psu_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键', - `price_set_id` bigint(20) NOT NULL COMMENT '价格套餐id', - `user_id` bigint(20) NOT NULL COMMENT '用户id', - `user_name` varchar(64) NOT NULL DEFAULT '' COMMENT '登录账号', - `created_by` varchar(64) DEFAULT '' COMMENT '创建人', - `create_time` datetime DEFAULT NULL COMMENT '创建时间', - PRIMARY KEY (`psu_id`), - UNIQUE KEY `uk_psu_set_user` (`price_set_id`,`user_id`), - KEY `idx_psu_user` (`user_id`), - KEY `idx_psu_set` (`price_set_id`), - CONSTRAINT `fk_psu_set` FOREIGN KEY (`price_set_id`) REFERENCES `prc_price_set` (`price_set_id`) ON DELETE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='套餐可见用户绑定'; - -- ---------------------------- -- 表结构:`prc_income_bill` -- ---------------------------- diff --git a/bms-back/sql/price/prc_price_set_user.sql b/bms-back/sql/price/prc_price_set_user.sql index e136c884..d73a020e 100644 --- a/bms-back/sql/price/prc_price_set_user.sql +++ b/bms-back/sql/price/prc_price_set_user.sql @@ -1,16 +1,4 @@ --- Price set viewer bind +-- Drop package viewer bind table (feature removed) SET NAMES utf8mb4; -CREATE TABLE IF NOT EXISTS prc_price_set_user ( - psu_id bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键', - price_set_id bigint(20) NOT NULL COMMENT '价格套餐id', - user_id bigint(20) NOT NULL COMMENT '用户id', - user_name varchar(64) NOT NULL DEFAULT '' COMMENT '登录账号', - created_by varchar(64) DEFAULT '' COMMENT '创建人', - create_time datetime DEFAULT NULL COMMENT '创建时间', - PRIMARY KEY (psu_id), - UNIQUE KEY uk_psu_set_user (price_set_id, user_id), - KEY idx_psu_user (user_id), - KEY idx_psu_set (price_set_id), - CONSTRAINT fk_psu_set FOREIGN KEY (price_set_id) REFERENCES prc_price_set (price_set_id) ON DELETE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='套餐可见用户绑定'; +DROP TABLE IF EXISTS prc_price_set_user; diff --git a/bms-front/src/api/price/set.js b/bms-front/src/api/price/set.js index 0a819332..7bbe9b52 100644 --- a/bms-front/src/api/price/set.js +++ b/bms-front/src/api/price/set.js @@ -412,26 +412,3 @@ export function delSetCustomer(ids) { method: 'delete' }) } - -export function listSetViewer(query) { - return request({ - url: '/price/set/viewer/list', - method: 'get', - params: query - }) -} - -export function addSetViewer(data) { - return request({ - url: '/price/set/viewer', - method: 'post', - data: data - }) -} - -export function delSetViewer(ids) { - return request({ - url: '/price/set/viewer/' + ids, - method: 'delete' - }) -} diff --git a/bms-front/src/views/price/set/components/detail/SetUserTable.vue b/bms-front/src/views/price/set/components/detail/SetUserTable.vue deleted file mode 100644 index 5f92ac18..00000000 --- a/bms-front/src/views/price/set/components/detail/SetUserTable.vue +++ /dev/null @@ -1,174 +0,0 @@ - - - - - diff --git a/bms-front/src/views/price/set/detail.vue b/bms-front/src/views/price/set/detail.vue index 0333c71b..6b0fbee1 100644 --- a/bms-front/src/views/price/set/detail.vue +++ b/bms-front/src/views/price/set/detail.vue @@ -20,8 +20,6 @@ - -