From bb0b80bd7ca7c1f979ab0125ae01f3faa1d14f4b Mon Sep 17 00:00:00 2001
From: hsy <1029150275@qq.com>
Date: 星期一, 17 八月 2026 09:37:57 +0800
Subject: [PATCH] Merge branch 'refs/heads/dev_business' into fix/hsy/20260811
---
yudao-module-srm/src/main/java/cn/iocoder/yudao/module/srm/service/apply/SrmSupplierApplyServiceImpl.java | 40 ++++++++++++++++++++++++++++++++++++++++
1 files changed, 40 insertions(+), 0 deletions(-)
diff --git a/yudao-module-srm/src/main/java/cn/iocoder/yudao/module/srm/service/apply/SrmSupplierApplyServiceImpl.java b/yudao-module-srm/src/main/java/cn/iocoder/yudao/module/srm/service/apply/SrmSupplierApplyServiceImpl.java
index c7a6914..9a1a9f3 100644
--- a/yudao-module-srm/src/main/java/cn/iocoder/yudao/module/srm/service/apply/SrmSupplierApplyServiceImpl.java
+++ b/yudao-module-srm/src/main/java/cn/iocoder/yudao/module/srm/service/apply/SrmSupplierApplyServiceImpl.java
@@ -145,6 +145,43 @@
@Override
@Transactional(rollbackFor = Exception.class)
+ public void ensureSupplierApproved(Long supplierId) {
+ if (supplierId == null) {
+ return;
+ }
+ // 鏍¢獙渚涘簲鍟嗗瓨鍦�
+ SrmSupplierDO supplier = supplierMapper.selectById(supplierId);
+ if (supplier == null) {
+ throw ServiceExceptionUtil.exception(ErrorCodeConstants.SUPPLIER_NOT_EXISTS);
+ }
+ // 宸插噯鍏ュ垯鏃犻渶澶勭悊
+ if (supplierApplyMapper.existsApprovedBySupplierId(supplierId)) {
+ return;
+ }
+ // 鑷姩鍒涘缓鍑嗗叆鐢宠骞剁洿鎺ョ疆涓哄凡閫氳繃
+ SrmSupplierApplyDO apply = new SrmSupplierApplyDO();
+ apply.setApplyNo(generateApplyNo());
+ apply.setSupplierId(supplierId);
+ apply.setSupplierName(supplier.getName());
+ apply.setSupplierType(supplier.getType());
+ apply.setCompanyNature(supplier.getCompanyNature());
+ apply.setRegisteredCapital(supplier.getRegisteredCapital());
+ apply.setBusinessLicenseNo(supplier.getBusinessLicenseNo());
+ apply.setTaxNo(supplier.getTaxNo());
+ apply.setAddress(supplier.getAddress());
+ apply.setBankName(supplier.getBankName());
+ apply.setBankAccount(supplier.getBankAccount());
+ apply.setContactName(supplier.getContactName());
+ apply.setContactMobile(supplier.getContactMobile());
+ apply.setContactEmail(supplier.getContactEmail());
+ apply.setRemark("涓爣鐢熸垚閲囪喘璁㈠崟鏃惰嚜鍔ㄥ噯鍏ュ苟閫氳繃");
+ apply.setApplyStatus(SupplierApplyStatusEnum.APPROVED.getCode());
+ apply.setApplyTime(LocalDateTime.now());
+ supplierApplyMapper.insert(apply);
+ }
+
+ @Override
+ @Transactional(rollbackFor = Exception.class)
public void approve(Long id) {
SrmSupplierApplyDO apply = validateApplyExists(id);
if (!SupplierApplyStatusEnum.APPROVED.getCode().equals(apply.getApplyStatus())) {
@@ -159,9 +196,12 @@
supplier.setBusinessLicenseNo(apply.getBusinessLicenseNo());
supplier.setTaxNo(apply.getTaxNo());
supplier.setAddress(apply.getAddress());
+ supplier.setBankName(apply.getBankName());
+ supplier.setBankAccount(apply.getBankAccount());
supplier.setContactName(apply.getContactName());
supplier.setContactMobile(apply.getContactMobile());
supplier.setContactEmail(apply.getContactEmail());
+ supplier.setRemark(apply.getRemark());
supplier.setStatus(0);
supplierMapper.insert(supplier);
--
Gitblit v1.9.3