From 8ad99e5f72085d14fd56e8faa7aa36701823c8b5 Mon Sep 17 00:00:00 2001
From: liu <2021943741@qq.com>
Date: 星期四, 05 十一月 2026 20:16:23 +0800
Subject: [PATCH] feat(crm): 统一客户团队数据权限并放开开票金额上限
---
yudao-module-crm/src/main/java/cn/iocoder/yudao/module/crm/service/quotation/CrmSaleQuotationServiceImpl.java | 32 +++++++++++++++++++++++++-------
1 files changed, 25 insertions(+), 7 deletions(-)
diff --git a/yudao-module-crm/src/main/java/cn/iocoder/yudao/module/crm/service/quotation/CrmSaleQuotationServiceImpl.java b/yudao-module-crm/src/main/java/cn/iocoder/yudao/module/crm/service/quotation/CrmSaleQuotationServiceImpl.java
index 123f0c4..82dc6de 100644
--- a/yudao-module-crm/src/main/java/cn/iocoder/yudao/module/crm/service/quotation/CrmSaleQuotationServiceImpl.java
+++ b/yudao-module-crm/src/main/java/cn/iocoder/yudao/module/crm/service/quotation/CrmSaleQuotationServiceImpl.java
@@ -20,12 +20,12 @@
import cn.iocoder.yudao.module.crm.service.contact.CrmContactService;
import cn.iocoder.yudao.module.crm.service.contract.CrmContractService;
import cn.iocoder.yudao.module.crm.service.customer.CrmCustomerService;
-import cn.iocoder.yudao.module.crm.api.customer.CrmCustomerApi;
import cn.iocoder.yudao.module.crm.service.permission.CrmPermissionService;
import cn.iocoder.yudao.module.crm.service.permission.bo.CrmPermissionCreateReqBO;
import cn.iocoder.yudao.module.system.api.storage.StorageAttachmentApi;
import cn.iocoder.yudao.module.mdm.api.item.MdmItemApi;
import cn.iocoder.yudao.module.mdm.api.item.dto.MdmItemRespDTO;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
@@ -42,7 +42,7 @@
/**
* CRM 閿�鍞姤浠峰崟 Service 瀹炵幇绫�
*
- * @author 鑺嬮亾婧愮爜
+ * @author 瓒呯骇绠$悊鍛�
*/
@Service
@Validated
@@ -62,8 +62,6 @@
@Resource
private CrmCustomerService customerService;
- @Resource
- private CrmCustomerApi customerApi;
@Resource
private CrmBusinessService businessService;
@Resource
@@ -240,9 +238,9 @@
@Override
public PageResult<CrmSaleQuotationDO> getSaleQuotationPage(CrmSaleQuotationPageReqVO pageReqVO, Long userId) {
- // 鑾峰彇鐢ㄦ埛鏈夋潈闄愮殑瀹㈡埛 ID 鍒楄〃
- List<Long> permittedCustomerIds = customerApi.getPermittedCustomerIds();
- return saleQuotationMapper.selectPage(pageReqVO, userId, permittedCustomerIds);
+ // 鍙鎬у畬鍏ㄧ敱 appendPermissionCondition 鎺у埗锛堟姤浠峰洟闃� 鈭� 瀹㈡埛鍥㈤槦锛夛紝
+ // 涓嶅啀棰濆鎸夈�屾湁鏉冮檺鐨勫鎴枫�嶈繃婊わ紝閬垮厤涓嶅湪瀹㈡埛鍥㈤槦銆佷絾灞炰簬鎶ヤ环璐熻矗浜�/鎶ヤ环鍥㈤槦鐨勭敤鎴疯閿欒杩囨护
+ return saleQuotationMapper.selectPage(pageReqVO, userId, null);
}
@Override
@@ -284,6 +282,16 @@
// 2. 鑾峰彇鎶ヤ环鏄庣粏
List<CrmSaleQuotationProductDO> quotationProducts = saleQuotationProductMapper.selectListByQuotationId(id);
+ // 鍚堝悓鏄庣粏浣跨敤鏁存暟鏁伴噺锛岀姝㈡埅鏂皬鏁版垨婧㈠嚭鍚庣敓鎴愰敊璇鍗曘��
+ for (CrmSaleQuotationProductDO product : quotationProducts) {
+ try {
+ if (product.getCount() == null || product.getCount().intValueExact() <= 0) {
+ throw exception(SALE_QUOTATION_CONVERT_INVALID_COUNT);
+ }
+ } catch (ArithmeticException ex) {
+ throw exception(SALE_QUOTATION_CONVERT_INVALID_COUNT);
+ }
+ }
// 3. 鏋勫缓鍚堝悓鍒涘缓 VO
CrmContractSaveReqVO contractVO = new CrmContractSaveReqVO();
contractVO.setName(saleQuotation.getName() + "-鍚堝悓");
@@ -318,4 +326,14 @@
return contractId;
}
+ @Override
+ public CrmSaleQuotationDO getByContractId(Long id) {
+ return saleQuotationMapper.selectOne(new LambdaQueryWrapper<CrmSaleQuotationDO>().eq(CrmSaleQuotationDO::getContractId,id));
+ }
+
+ @Override
+ public void clearContractReference(Long quotationId) {
+ saleQuotationMapper.clearContractReference(quotationId);
+ }
+
}
\ No newline at end of file
--
Gitblit v1.9.3