From 1feea304776ab97ab04f953a3e1b2334dfdc8732 Mon Sep 17 00:00:00 2001
From: huminmin <mac@MacBook-Pro.local>
Date: 星期五, 14 八月 2026 14:35:08 +0800
Subject: [PATCH] 定金增加默认值
---
yudao-module-crm/src/main/java/cn/iocoder/yudao/module/crm/service/quotation/CrmSaleQuotationServiceImpl.java | 21 ++++++++++++++++++++-
1 files changed, 20 insertions(+), 1 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 99dda59..1b0237a 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
@@ -23,8 +23,10 @@
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;
@@ -41,7 +43,7 @@
/**
* CRM 閿�鍞姤浠峰崟 Service 瀹炵幇绫�
*
- * @author 鑺嬮亾婧愮爜
+ * @author 瓒呯骇绠$悊鍛�
*/
@Service
@Validated
@@ -69,6 +71,8 @@
private CrmContactService contactService;
@Resource
private CrmPermissionService permissionService;
+ @Resource
+ private StorageAttachmentApi storageAttachmentApi;
@Resource
private CrmContractService contractService;
@@ -100,6 +104,8 @@
.setBizType(CrmBizTypeEnum.CRM_SALE_QUOTATION.getType())
.setBizId(saleQuotation.getId())
.setLevel(CrmPermissionLevelEnum.OWNER.getLevel()));
+ storageAttachmentApi.bindAttachments("file", "crm_sale_quotation",
+ saleQuotation.getId(), createReqVO.getBlobIds());
return saleQuotation.getId();
}
@@ -123,6 +129,7 @@
saleQuotationMapper.updateById(updateObj);
// 2.2 鏇存柊鎶ヤ环鏄庣粏
updateQuotationProductList(updateReqVO.getId(), quotationProducts);
+ storageAttachmentApi.updateAttachments("file", "crm_sale_quotation", updateReqVO.getId(), updateReqVO.getBlobIds());
}
@Override
@@ -141,6 +148,8 @@
// 2. 閬嶅巻鍒犻櫎
saleQuotations.forEach(saleQuotation -> {
+ // 2.0 鍒犻櫎闄勪欢鍏宠仈
+ storageAttachmentApi.deleteAttachmentsByRecord("crm_sale_quotation", saleQuotation.getId());
// 2.1 鍒犻櫎鎶ヤ环鍗�
saleQuotationMapper.deleteById(saleQuotation.getId());
// 2.2 鍒犻櫎鎶ヤ环鏄庣粏
@@ -310,4 +319,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