| | |
| | | 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 jakarta.annotation.Resource; |
| | |
| | | @Resource |
| | | private CrmCustomerService customerService; |
| | | @Resource |
| | | private CrmCustomerApi customerApi; |
| | | @Resource |
| | | private CrmBusinessService businessService; |
| | | @Resource |
| | | private CrmContactService contactService; |
| | | @Resource |
| | | private CrmPermissionService permissionService; |
| | | @Resource |
| | | private StorageAttachmentApi storageAttachmentApi; |
| | | @Resource |
| | | private CrmContractService contractService; |
| | | |
| | |
| | | .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(); |
| | | } |
| | | |
| | |
| | | saleQuotationMapper.updateById(updateObj); |
| | | // 2.2 更新报价明细 |
| | | updateQuotationProductList(updateReqVO.getId(), quotationProducts); |
| | | if (updateReqVO.getBlobIds() != null) { |
| | | storageAttachmentApi.deleteAttachmentsByRecord("crm_sale_quotation", updateReqVO.getId()); |
| | | storageAttachmentApi.bindAttachments("file", "crm_sale_quotation", |
| | | updateReqVO.getId(), updateReqVO.getBlobIds()); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | |
| | | |
| | | // 2. 遍历删除 |
| | | saleQuotations.forEach(saleQuotation -> { |
| | | // 2.0 删除附件关联 |
| | | storageAttachmentApi.deleteAttachmentsByRecord("crm_sale_quotation", saleQuotation.getId()); |
| | | // 2.1 删除报价单 |
| | | saleQuotationMapper.deleteById(saleQuotation.getId()); |
| | | // 2.2 删除报价明细 |
| | |
| | | |
| | | @Override |
| | | public PageResult<CrmSaleQuotationDO> getSaleQuotationPage(CrmSaleQuotationPageReqVO pageReqVO, Long userId) { |
| | | return saleQuotationMapper.selectPage(pageReqVO, userId); |
| | | // 获取用户有权限的客户 ID 列表 |
| | | List<Long> permittedCustomerIds = customerApi.getPermittedCustomerIds(); |
| | | return saleQuotationMapper.selectPage(pageReqVO, userId, permittedCustomerIds); |
| | | } |
| | | |
| | | @Override |