From 9e99a4a6c214283d45adceb4dabc8a0529f7605a Mon Sep 17 00:00:00 2001 From: luojiaquan <1583622118@qq.com> Date: Thu, 10 Sep 2026 14:43:51 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 客户/供应商 子表分开,id改回自增 --- .../customerinfo/BmsCustomerController.java | 57 ++- .../supplierinfo/BmsSupplierController.java | 14 +- .../customerinfo/domain/BmsCustomer.java | 305 +----------- .../domain/BmsCustomerAttachment.java | 134 +----- .../domain/BmsCustomerCompany.java | 89 +--- .../domain/BmsCustomerContact.java | 98 ++++ .../mapper/BmsCustomerMapper.java | 44 +- .../service/IBmsCustomerService.java | 43 +- .../service/impl/BmsCustomerServiceImpl.java | 119 ++++- .../supplierinfo/domain/BmsSupplier.java | 119 +---- .../domain/BmsSupplierAttachment.java | 62 +++ .../domain/BmsSupplierCompany.java | 147 ++++++ .../domain/BmsSupplierContact.java | 98 ++++ .../mapper/BmsSupplierMapper.java | 60 ++- .../service/IBmsSupplierService.java | 58 ++- .../service/impl/BmsSupplierServiceImpl.java | 212 +++++++-- .../mapper/customer/BmsCustomerMapper.xml | 162 ++++++- .../mapper/customer/BmsSupplierMapper.xml | 433 +++++++++++++++++- .../customerinfo/index.vue | 238 +++++++++- .../supplierinfo/index.vue | 55 ++- 20 files changed, 1810 insertions(+), 737 deletions(-) create mode 100644 bms-back/ruoyi-system/src/main/java/com/ruoyi/customer/customerinfo/domain/BmsCustomerContact.java create mode 100644 bms-back/ruoyi-system/src/main/java/com/ruoyi/customer/supplierinfo/domain/BmsSupplierAttachment.java create mode 100644 bms-back/ruoyi-system/src/main/java/com/ruoyi/customer/supplierinfo/domain/BmsSupplierCompany.java create mode 100644 bms-back/ruoyi-system/src/main/java/com/ruoyi/customer/supplierinfo/domain/BmsSupplierContact.java diff --git a/bms-back/ruoyi-admin/src/main/java/com/ruoyi/web/controller/customer/customerinfo/BmsCustomerController.java b/bms-back/ruoyi-admin/src/main/java/com/ruoyi/web/controller/customer/customerinfo/BmsCustomerController.java index 4c3f6351..5b28ad68 100644 --- a/bms-back/ruoyi-admin/src/main/java/com/ruoyi/web/controller/customer/customerinfo/BmsCustomerController.java +++ b/bms-back/ruoyi-admin/src/main/java/com/ruoyi/web/controller/customer/customerinfo/BmsCustomerController.java @@ -4,6 +4,7 @@ import java.util.List; import com.ruoyi.customer.customerinfo.domain.BmsCustomerAttachment; import com.ruoyi.customer.customerinfo.domain.BmsCustomerCompany; +import com.ruoyi.customer.customerinfo.domain.BmsCustomerContact; import jakarta.servlet.http.HttpServletResponse; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.beans.factory.annotation.Autowired; @@ -58,7 +59,7 @@ public class BmsCustomerController extends BaseController public void export(HttpServletResponse response, BmsCustomer bmsCustomer) { List list = bmsCustomerService.selectBmsCustomerList(bmsCustomer); - ExcelUtil util = new ExcelUtil(BmsCustomer.class); + ExcelUtil util = new ExcelUtil<>(BmsCustomer.class); util.exportExcel(response, list, "客户主数据"); } @@ -67,7 +68,7 @@ public class BmsCustomerController extends BaseController */ @PreAuthorize("@ss.hasPermi('customersupplier:customerinfo:query')") @GetMapping(value = "/{customerId}") - public AjaxResult getInfo(@PathVariable("customerId") String customerId) + public AjaxResult getInfo(@PathVariable("customerId") Long customerId) { return success(bmsCustomerService.selectBmsCustomerByCustomerId(customerId)); } @@ -100,7 +101,7 @@ public class BmsCustomerController extends BaseController @PreAuthorize("@ss.hasPermi('customersupplier:customerinfo:remove')") @Log(title = "客户信息", businessType = BusinessType.DELETE) @DeleteMapping("/{customerIds}") - public AjaxResult remove(@PathVariable String[] customerIds) + public AjaxResult remove(@PathVariable Long[] customerIds) { return toAjax(bmsCustomerService.deleteBmsCustomerByCustomerIds(customerIds)); } @@ -167,4 +168,54 @@ public class BmsCustomerController extends BaseController { return toAjax(bmsCustomerService.deleteBmsCustomerCompanyByCompanyIds(companyIds)); } + + /** + * 查询客户联系人列表 + */ + @GetMapping("/contact/list") + public TableDataInfo contactList(BmsCustomerContact bmsCustomerContact) + { + startPage(); + List list = bmsCustomerService.selectBmsCustomerContactList(bmsCustomerContact); + return getDataTable(list); + } + + /** + * 获取客户联系人详细信息 + */ + @GetMapping("/contact/{contactId}") + public AjaxResult getContactInfo(@PathVariable("contactId") Long contactId) + { + return success(bmsCustomerService.selectBmsCustomerContactByContactId(contactId)); + } + + /** + * 新增客户联系人 + */ + @Log(title = "客户联系人", businessType = BusinessType.INSERT) + @PostMapping("/contact") + public AjaxResult addContact(@RequestBody BmsCustomerContact bmsCustomerContact) + { + return toAjax(bmsCustomerService.insertBmsCustomerContact(bmsCustomerContact)); + } + + /** + * 修改客户联系人 + */ + @Log(title = "客户联系人", businessType = BusinessType.UPDATE) + @PutMapping("/contact") + public AjaxResult editContact(@RequestBody BmsCustomerContact bmsCustomerContact) + { + return toAjax(bmsCustomerService.updateBmsCustomerContact(bmsCustomerContact)); + } + + /** + * 删除客户联系人 + */ + @Log(title = "客户联系人", businessType = BusinessType.DELETE) + @DeleteMapping("/contact/{contactIds}") + public AjaxResult removeContact(@PathVariable Long[] contactIds) + { + return toAjax(bmsCustomerService.deleteBmsCustomerContactByContactIds(contactIds)); + } } diff --git a/bms-back/ruoyi-admin/src/main/java/com/ruoyi/web/controller/customer/supplierinfo/BmsSupplierController.java b/bms-back/ruoyi-admin/src/main/java/com/ruoyi/web/controller/customer/supplierinfo/BmsSupplierController.java index 5c08a679..88ea3ade 100644 --- a/bms-back/ruoyi-admin/src/main/java/com/ruoyi/web/controller/customer/supplierinfo/BmsSupplierController.java +++ b/bms-back/ruoyi-admin/src/main/java/com/ruoyi/web/controller/customer/supplierinfo/BmsSupplierController.java @@ -5,6 +5,8 @@ import java.util.List; import com.ruoyi.customer.customerinfo.domain.BmsCustomerAttachment; import com.ruoyi.customer.customerinfo.domain.BmsCustomerCompany; import com.ruoyi.customer.supplierinfo.domain.BmsSupplier; +import com.ruoyi.customer.supplierinfo.domain.BmsSupplierAttachment; +import com.ruoyi.customer.supplierinfo.domain.BmsSupplierCompany; import com.ruoyi.customer.supplierinfo.service.IBmsSupplierService; import jakarta.servlet.http.HttpServletResponse; import org.springframework.beans.factory.annotation.Autowired; @@ -61,7 +63,7 @@ public class BmsSupplierController extends BaseController /** 获取供应商详细信息 */ @PreAuthorize("@ss.hasPermi('customersupplier:supplierinfo:query')") @GetMapping(value = "/{supplierId}") - public AjaxResult getInfo(@PathVariable("supplierId") String supplierId) + public AjaxResult getInfo(@PathVariable("supplierId") Long supplierId) { return success(bmsSupplierService.selectBmsSupplierBySupplierId(supplierId)); } @@ -88,26 +90,26 @@ public class BmsSupplierController extends BaseController @PreAuthorize("@ss.hasPermi('customersupplier:supplierinfo:remove')") @Log(title = "供应商信息", businessType = BusinessType.DELETE) @DeleteMapping("/{supplierIds}") - public AjaxResult remove(@PathVariable String[] supplierIds) + public AjaxResult remove(@PathVariable Long[] supplierIds) { return toAjax(bmsSupplierService.deleteBmsSupplierBySupplierIds(supplierIds)); } /** 查看供应商附件列表(子表共用) */ @GetMapping("/attachment/list") - public TableDataInfo attachmentList(BmsCustomerAttachment bmsCustomerAttachment) + public TableDataInfo attachmentList(BmsSupplierAttachment bmsSupplierAttachment) { startPage(); - List list = bmsSupplierService.selectBmsSupplierAttachmentList(bmsCustomerAttachment); + List list = bmsSupplierService.selectBmsSupplierAttachmentList(bmsSupplierAttachment); return getDataTable(list); } /** 查看供应商公司主体列表(子表共用) */ @GetMapping("/company/list") - public TableDataInfo companyList(BmsCustomerCompany bmsCustomerCompany) + public TableDataInfo companyList(BmsSupplierCompany bmsSupplierCompany) { startPage(); - List list = bmsSupplierService.selectBmsSupplierCompanyList(bmsCustomerCompany); + List list = bmsSupplierService.selectBmsSupplierCompanyList(bmsSupplierCompany); return getDataTable(list); } } diff --git a/bms-back/ruoyi-system/src/main/java/com/ruoyi/customer/customerinfo/domain/BmsCustomer.java b/bms-back/ruoyi-system/src/main/java/com/ruoyi/customer/customerinfo/domain/BmsCustomer.java index cf2da68b..18842af5 100644 --- a/bms-back/ruoyi-system/src/main/java/com/ruoyi/customer/customerinfo/domain/BmsCustomer.java +++ b/bms-back/ruoyi-system/src/main/java/com/ruoyi/customer/customerinfo/domain/BmsCustomer.java @@ -2,6 +2,8 @@ package com.ruoyi.customer.customerinfo.domain; import java.math.BigDecimal; import java.util.List; + +import lombok.Data; import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringStyle; import com.ruoyi.common.annotation.Excel; @@ -13,12 +15,13 @@ import com.ruoyi.common.core.domain.BaseEntity; * @author ruoyi * @date 2026-09-08 */ +@Data public class BmsCustomer extends BaseEntity { private static final long serialVersionUID = 1L; - /** 客户ID(UUID) */ - private String customerId; + /** 客户ID */ + private Long customerId; /** 客户编码 */ @Excel(name = "客户编码") @@ -114,302 +117,10 @@ public class BmsCustomer extends BaseEntity /** 公司主体列表(子表 bms_customer_company) */ private List companyList; + /** 联系人列表(子表 bms_customer_contact) */ + private List contactList; + /** 删除标记(0正常 2删除) */ private String delFlag; - public void setCustomerId(String customerId) - { - this.customerId = customerId; - } - - public String getCustomerId() - { - return customerId; - } - - public void setCustomerCode(String customerCode) - { - this.customerCode = customerCode; - } - - public String getCustomerCode() - { - return customerCode; - } - - public void setCustomerName(String customerName) - { - this.customerName = customerName; - } - - public String getCustomerName() - { - return customerName; - } - - public void setCustomerCodeDw(String customerCodeDw) - { - this.customerCodeDw = customerCodeDw; - } - - public String getCustomerCodeDw() - { - return customerCodeDw; - } - - public void setCreditCode(String creditCode) - { - this.creditCode = creditCode; - } - - public String getCreditCode() - { - return creditCode; - } - - public void setCustomerType(String customerType) - { - this.customerType = customerType; - } - - public String getCustomerType() - { - return customerType; - } - - public void setIsEnable(String isEnable) - { - this.isEnable = isEnable; - } - - public String getIsEnable() - { - return isEnable; - } - - public void setSalesUserId(String salesUserId) - { - this.salesUserId = salesUserId; - } - - public String getSalesUserId() - { - return salesUserId; - } - - public void setSalesUser(String salesUser) - { - this.salesUser = salesUser; - } - - public String getSalesUser() - { - return salesUser; - } - - public void setEd(BigDecimal ed) - { - this.ed = ed; - } - - public BigDecimal getEd() - { - return ed; - } - - public void setZq(Long zq) - { - this.zq = zq; - } - - public Long getZq() - { - return zq; - } - - public void setSettlementUserId(String settlementUserId) - { - this.settlementUserId = settlementUserId; - } - - public String getSettlementUserId() - { - return settlementUserId; - } - - public void setSettlementUser(String settlementUser) - { - this.settlementUser = settlementUser; - } - - public String getSettlementUser() - { - return settlementUser; - } - - public void setServiceUserId(String serviceUserId) - { - this.serviceUserId = serviceUserId; - } - - public String getServiceUserId() - { - return serviceUserId; - } - - public void setServiceUser(String serviceUser) - { - this.serviceUser = serviceUser; - } - - public String getServiceUser() - { - return serviceUser; - } - - public void setSettlementType(String settlementType) - { - this.settlementType = settlementType; - } - - public String getSettlementType() - { - return settlementType; - } - - public void setTempEd(BigDecimal tempEd) - { - this.tempEd = tempEd; - } - - public BigDecimal getTempEd() - { - return tempEd; - } - - public void setAccountBalance(BigDecimal accountBalance) - { - this.accountBalance = accountBalance; - } - - public BigDecimal getAccountBalance() - { - return accountBalance; - } - - public void setForeignCurrencyBalance(BigDecimal foreignCurrencyBalance) - { - this.foreignCurrencyBalance = foreignCurrencyBalance; - } - - public BigDecimal getForeignCurrencyBalance() - { - return foreignCurrencyBalance; - } - - public void setWeightThreshold(BigDecimal weightThreshold) - { - this.weightThreshold = weightThreshold; - } - - public BigDecimal getWeightThreshold() - { - return weightThreshold; - } - - public void setThrowRatio(BigDecimal throwRatio) - { - this.throwRatio = throwRatio; - } - - public BigDecimal getThrowRatio() - { - return throwRatio; - } - - public void setCreditEd(BigDecimal creditEd) - { - this.creditEd = creditEd; - } - - public BigDecimal getCreditEd() - { - return creditEd; - } - - public void setProductIds(String productIds) - { - this.productIds = productIds; - } - - public String getProductIds() - { - return productIds; - } - - public void setAttachmentList(List attachmentList) - { - this.attachmentList = attachmentList; - } - - public List getAttachmentList() - { - return attachmentList; - } - - public void setCompanyList(List companyList) - { - this.companyList = companyList; - } - - public List getCompanyList() - { - return companyList; - } - - public void setDelFlag(String delFlag) - { - this.delFlag = delFlag; - } - - public String getDelFlag() - { - return delFlag; - } - - @Override - public String toString() { - return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) - .append("customerId", getCustomerId()) - .append("customerCode", getCustomerCode()) - .append("customerName", getCustomerName()) - .append("customerCodeDw", getCustomerCodeDw()) - .append("creditCode", getCreditCode()) - .append("customerType", getCustomerType()) - .append("isEnable", getIsEnable()) - .append("salesUserId", getSalesUserId()) - .append("salesUser", getSalesUser()) - .append("ed", getEd()) - .append("zq", getZq()) - .append("settlementUserId", getSettlementUserId()) - .append("settlementUser", getSettlementUser()) - .append("serviceUserId", getServiceUserId()) - .append("serviceUser", getServiceUser()) - .append("settlementType", getSettlementType()) - .append("tempEd", getTempEd()) - .append("accountBalance", getAccountBalance()) - .append("foreignCurrencyBalance", getForeignCurrencyBalance()) - .append("weightThreshold", getWeightThreshold()) - .append("throwRatio", getThrowRatio()) - .append("creditEd", getCreditEd()) - .append("productIds", getProductIds()) - .append("attachmentList", getAttachmentList()) - .append("remark", getRemark()) - .append("createBy", getCreateBy()) - .append("createTime", getCreateTime()) - .append("updateBy", getUpdateBy()) - .append("updateTime", getUpdateTime()) - .append("delFlag", getDelFlag()) - .toString(); - } } diff --git a/bms-back/ruoyi-system/src/main/java/com/ruoyi/customer/customerinfo/domain/BmsCustomerAttachment.java b/bms-back/ruoyi-system/src/main/java/com/ruoyi/customer/customerinfo/domain/BmsCustomerAttachment.java index 82e20fac..455fd8ab 100644 --- a/bms-back/ruoyi-system/src/main/java/com/ruoyi/customer/customerinfo/domain/BmsCustomerAttachment.java +++ b/bms-back/ruoyi-system/src/main/java/com/ruoyi/customer/customerinfo/domain/BmsCustomerAttachment.java @@ -1,5 +1,6 @@ package com.ruoyi.customer.customerinfo.domain; +import lombok.Data; import lombok.Getter; import lombok.Setter; import org.apache.commons.lang3.builder.ToStringBuilder; @@ -13,8 +14,7 @@ import com.ruoyi.common.core.domain.BaseEntity; * @author ruoyi * @date 2026-09-08 */ -@Getter -@Setter +@Data public class BmsCustomerAttachment extends BaseEntity { private static final long serialVersionUID = 1L; @@ -22,8 +22,8 @@ public class BmsCustomerAttachment extends BaseEntity /** 附件ID */ private Long attachmentId; - /** 所属客户ID或供应商ID(UUID) */ - private String customerId; + /** 所属客户ID */ + private Long customerId; /** 文件原始名称 */ @Excel(name = "文件名称") @@ -60,131 +60,5 @@ public class BmsCustomerAttachment extends BaseEntity /** 删除标记(0正常 2删除) */ private String delFlag; - public void setAttachmentId(Long attachmentId) - { - this.attachmentId = attachmentId; - } - public Long getAttachmentId() - { - return attachmentId; - } - - public void setCustomerId(String customerId) - { - this.customerId = customerId; - } - - public String getCustomerId() - { - return customerId; - } - - public void setFileName(String fileName) - { - this.fileName = fileName; - } - - public String getFileName() - { - return fileName; - } - - public void setFilePath(String filePath) - { - this.filePath = filePath; - } - - public String getFilePath() - { - return filePath; - } - - public void setFileSize(Long fileSize) - { - this.fileSize = fileSize; - } - - public Long getFileSize() - { - return fileSize; - } - - public void setFileType(String fileType) - { - this.fileType = fileType; - } - - public String getFileType() - { - return fileType; - } - - public void setFileExtension(String fileExtension) - { - this.fileExtension = fileExtension; - } - - public String getFileExtension() - { - return fileExtension; - } - - public void setAttachmentType(String attachmentType) - { - this.attachmentType = attachmentType; - } - - public String getAttachmentType() - { - return attachmentType; - } - - public void setIsLogo(String isLogo) - { - this.isLogo = isLogo; - } - - public String getIsLogo() - { - return isLogo; - } - - public void setSortOrder(Integer sortOrder) - { - this.sortOrder = sortOrder; - } - - public Integer getSortOrder() - { - return sortOrder; - } - - public void setRemark(String remark) - { - this.remark = remark; - } - - @Override - public String toString() - { - return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) - .append("attachmentId", getAttachmentId()) - .append("customerId", getCustomerId()) - .append("fileName", getFileName()) - .append("filePath", getFilePath()) - .append("fileSize", getFileSize()) - .append("fileType", getFileType()) - .append("fileExtension", getFileExtension()) - .append("attachmentType", getAttachmentType()) - .append("isLogo", getIsLogo()) - .append("sortOrder", getSortOrder()) - .append("remark", getRemark()) - .append("createBy", getCreateBy()) - .append("createTime", getCreateTime()) - .append("updateBy", getUpdateBy()) - .append("updateTime", getUpdateTime()) - .append("delFlag", getDelFlag()) - .toString(); - } } diff --git a/bms-back/ruoyi-system/src/main/java/com/ruoyi/customer/customerinfo/domain/BmsCustomerCompany.java b/bms-back/ruoyi-system/src/main/java/com/ruoyi/customer/customerinfo/domain/BmsCustomerCompany.java index c9a4b91c..8ea932f9 100644 --- a/bms-back/ruoyi-system/src/main/java/com/ruoyi/customer/customerinfo/domain/BmsCustomerCompany.java +++ b/bms-back/ruoyi-system/src/main/java/com/ruoyi/customer/customerinfo/domain/BmsCustomerCompany.java @@ -4,6 +4,7 @@ import java.math.BigDecimal; import java.util.Date; import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringStyle; import com.ruoyi.common.annotation.Excel; @@ -15,6 +16,7 @@ import com.ruoyi.common.core.domain.BaseEntity; * @author ruoyi * @date 2026-09-09 */ +@Data public class BmsCustomerCompany extends BaseEntity { private static final long serialVersionUID = 1L; @@ -22,8 +24,8 @@ public class BmsCustomerCompany extends BaseEntity /** 公司主体ID */ private Long companyId; - /** 所属客户ID或供应商ID(UUID) */ - private String customerId; + /** 所属客户ID */ + private Long customerId; /** 公司全称 */ @Excel(name = "公司全称") @@ -125,88 +127,5 @@ public class BmsCustomerCompany extends BaseEntity /** 删除标记 */ private String delFlag; - public void setCompanyId(Long companyId) { this.companyId = companyId; } - public Long getCompanyId() { return companyId; } - public void setCustomerId(String customerId) { this.customerId = customerId; } - public String getCustomerId() { return customerId; } - public void setCompanyNameFull(String companyNameFull) { this.companyNameFull = companyNameFull; } - public String getCompanyNameFull() { return companyNameFull; } - public void setEnglishName(String englishName) { this.englishName = englishName; } - public String getEnglishName() { return englishName; } - public void setCreditCode(String creditCode) { this.creditCode = creditCode; } - public String getCreditCode() { return creditCode; } - public void setLegalPerson(String legalPerson) { this.legalPerson = legalPerson; } - public String getLegalPerson() { return legalPerson; } - public void setLegalPersonPhone(String legalPersonPhone) { this.legalPersonPhone = legalPersonPhone; } - public String getLegalPersonPhone() { return legalPersonPhone; } - public void setLegalPersonIdCard(String legalPersonIdCard) { this.legalPersonIdCard = legalPersonIdCard; } - public String getLegalPersonIdCard() { return legalPersonIdCard; } - public void setRegisteredCapital(BigDecimal registeredCapital) { this.registeredCapital = registeredCapital; } - public BigDecimal getRegisteredCapital() { return registeredCapital; } - public void setCapitalCurrency(String capitalCurrency) { this.capitalCurrency = capitalCurrency; } - public String getCapitalCurrency() { return capitalCurrency; } - public void setPaidInCapital(BigDecimal paidInCapital) { this.paidInCapital = paidInCapital; } - public BigDecimal getPaidInCapital() { return paidInCapital; } - public void setEstablishDate(Date establishDate) { this.establishDate = establishDate; } - public Date getEstablishDate() { return establishDate; } - public void setBusinessTermStart(Date businessTermStart) { this.businessTermStart = businessTermStart; } - public Date getBusinessTermStart() { return businessTermStart; } - public void setBusinessTermEnd(Date businessTermEnd) { this.businessTermEnd = businessTermEnd; } - public Date getBusinessTermEnd() { return businessTermEnd; } - public void setBusinessTermPermanent(String businessTermPermanent) { this.businessTermPermanent = businessTermPermanent; } - public String getBusinessTermPermanent() { return businessTermPermanent; } - public void setRegistrationAuthority(String registrationAuthority) { this.registrationAuthority = registrationAuthority; } - public String getRegistrationAuthority() { return registrationAuthority; } - public void setRegistrationNumber(String registrationNumber) { this.registrationNumber = registrationNumber; } - public String getRegistrationNumber() { return registrationNumber; } - public void setOperatingStatus(String operatingStatus) { this.operatingStatus = operatingStatus; } - public String getOperatingStatus() { return operatingStatus; } - public void setBusinessScope(String businessScope) { this.businessScope = businessScope; } - public String getBusinessScope() { return businessScope; } - public void setShareholders(String shareholders) { this.shareholders = shareholders; } - public String getShareholders() { return shareholders; } - public void setEmployeeCount(Integer employeeCount) { this.employeeCount = employeeCount; } - public Integer getEmployeeCount() { return employeeCount; } - public void setCompanyPhone(String companyPhone) { this.companyPhone = companyPhone; } - public String getCompanyPhone() { return companyPhone; } - public void setCompanyFax(String companyFax) { this.companyFax = companyFax; } - public String getCompanyFax() { return companyFax; } - public void setCompanyWebsite(String companyWebsite) { this.companyWebsite = companyWebsite; } - public String getCompanyWebsite() { return companyWebsite; } - public void setCompanyEmail(String companyEmail) { this.companyEmail = companyEmail; } - public String getCompanyEmail() { return companyEmail; } - public void setRegisteredProvince(String registeredProvince) { this.registeredProvince = registeredProvince; } - public String getRegisteredProvince() { return registeredProvince; } - public void setRegisteredCity(String registeredCity) { this.registeredCity = registeredCity; } - public String getRegisteredCity() { return registeredCity; } - public void setRegisteredDistrict(String registeredDistrict) { this.registeredDistrict = registeredDistrict; } - public String getRegisteredDistrict() { return registeredDistrict; } - public void setRegisteredAddressDetail(String registeredAddressDetail) { this.registeredAddressDetail = registeredAddressDetail; } - public String getRegisteredAddressDetail() { return registeredAddressDetail; } - public void setBusinessLicenseOssId(Long businessLicenseOssId) { this.businessLicenseOssId = businessLicenseOssId; } - public Long getBusinessLicenseOssId() { return businessLicenseOssId; } - public void setAttachmentIds(String attachmentIds) { this.attachmentIds = attachmentIds; } - public String getAttachmentIds() { return attachmentIds; } - public void setRemark(String remark) { this.remark = remark; } - public String getRemark() { return remark; } - public void setDelFlag(String delFlag) { this.delFlag = delFlag; } - public String getDelFlag() { return delFlag; } - @Override - public String toString() { - return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) - .append("companyId", getCompanyId()) - .append("customerId", getCustomerId()) - .append("companyNameFull", getCompanyNameFull()) - .append("englishName", getEnglishName()) - .append("creditCode", getCreditCode()) - .append("legalPerson", getLegalPerson()) - .append("remark", getRemark()) - .append("createBy", getCreateBy()) - .append("createTime", getCreateTime()) - .append("updateBy", getUpdateBy()) - .append("updateTime", getUpdateTime()) - .append("delFlag", getDelFlag()) - .toString(); - } } diff --git a/bms-back/ruoyi-system/src/main/java/com/ruoyi/customer/customerinfo/domain/BmsCustomerContact.java b/bms-back/ruoyi-system/src/main/java/com/ruoyi/customer/customerinfo/domain/BmsCustomerContact.java new file mode 100644 index 00000000..7bee64d9 --- /dev/null +++ b/bms-back/ruoyi-system/src/main/java/com/ruoyi/customer/customerinfo/domain/BmsCustomerContact.java @@ -0,0 +1,98 @@ +package com.ruoyi.customer.customerinfo.domain; + +import lombok.Data; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.common.core.domain.BaseEntity; + +/** + * 客户联系人对象 bms_customer_contact + * + * @author ruoyi + * @date 2026-09-09 + */ +@Data +public class BmsCustomerContact extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 联系人ID */ + private Long contactId; + + /** 所属客户ID */ + private Long customerId; + + /** 联系人姓名 */ + @Excel(name = "联系人姓名") + private String contactName; + + /** 职位 */ + @Excel(name = "职位") + private String position; + + /** 所属部门 */ + @Excel(name = "所属部门") + private String department; + + /** 手机号 */ + @Excel(name = "手机号") + private String phone; + + /** 座机 */ + @Excel(name = "座机") + private String landline; + + /** 电子邮箱 */ + @Excel(name = "电子邮箱") + private String email; + + /** 微信号 */ + @Excel(name = "微信号") + private String wechat; + + /** QQ号 */ + @Excel(name = "QQ号") + private String qq; + + /** 国家/地区 */ + @Excel(name = "国家/地区") + private String country; + + /** 省份 */ + @Excel(name = "省份") + private String province; + + /** 城市 */ + @Excel(name = "城市") + private String city; + + /** 区/县 */ + @Excel(name = "区/县") + private String district; + + /** 联系详细地址 */ + @Excel(name = "联系详细地址") + private String contactAddress; + + /** 邮政编码 */ + @Excel(name = "邮政编码") + private String postalCode; + + /** 是否默认联系人(0否 1是) */ + @Excel(name = "是否默认联系人", readConverterExp = "0=否,1=是") + private String isDefault; + + /** 联系人类型(0业务联系人 1财务联系人 2紧急联系人 3其他) */ + @Excel(name = "联系人类型", readConverterExp = "0=业务联系人,1=财务联系人,2=紧急联系人,3=其他") + private String contactType; + + /** 排序 */ + @Excel(name = "排序") + private Integer sortOrder; + + /** 删除标记 */ + private String delFlag; + + +} diff --git a/bms-back/ruoyi-system/src/main/java/com/ruoyi/customer/customerinfo/mapper/BmsCustomerMapper.java b/bms-back/ruoyi-system/src/main/java/com/ruoyi/customer/customerinfo/mapper/BmsCustomerMapper.java index 60caed0a..c9165731 100644 --- a/bms-back/ruoyi-system/src/main/java/com/ruoyi/customer/customerinfo/mapper/BmsCustomerMapper.java +++ b/bms-back/ruoyi-system/src/main/java/com/ruoyi/customer/customerinfo/mapper/BmsCustomerMapper.java @@ -4,6 +4,8 @@ import java.util.List; import com.ruoyi.customer.customerinfo.domain.BmsCustomer; import com.ruoyi.customer.customerinfo.domain.BmsCustomerAttachment; import com.ruoyi.customer.customerinfo.domain.BmsCustomerCompany; +import com.ruoyi.customer.customerinfo.domain.BmsCustomerContact; +import io.lettuce.core.dynamic.annotation.Param; /** * 客户主Mapper接口 @@ -19,7 +21,7 @@ public interface BmsCustomerMapper * @param customerId 客户主主键 * @return 客户主 */ - public BmsCustomer selectBmsCustomerByCustomerId(String customerId); + public BmsCustomer selectBmsCustomerByCustomerId(Long customerId); /** * 查询客户主列表 @@ -51,7 +53,7 @@ public interface BmsCustomerMapper * @param customerId 客户主主键 * @return 结果 */ - public int deleteBmsCustomerByCustomerId(String customerId); + public int deleteBmsCustomerByCustomerId(Long customerId); /** * 批量删除客户主 @@ -59,7 +61,7 @@ public interface BmsCustomerMapper * @param customerIds 需要删除的数据主键集合 * @return 结果 */ - public int deleteBmsCustomerByCustomerIds(String[] customerIds); + public int deleteBmsCustomerByCustomerIds(@Param("customerIds") Long[] customerIds); /** * 查询客户附件列表 @@ -91,7 +93,7 @@ public interface BmsCustomerMapper * @param customerId 客户主键 * @return 结果 */ - public int deleteBmsCustomerAttachmentByCustomerId(String customerId); + public int deleteBmsCustomerAttachmentByCustomerId(Long customerId); /** * 批量删除客户附件 @@ -99,7 +101,7 @@ public interface BmsCustomerMapper * @param attachmentIds 附件ID集合 * @return 结果 */ - public int deleteBmsCustomerAttachmentByAttachmentIds(Long[] attachmentIds); + public int deleteBmsCustomerAttachmentByAttachmentIds(@Param("attachmentIds") Long[] attachmentIds); /** * 查询客户公司主体列表 @@ -124,10 +126,40 @@ public interface BmsCustomerMapper /** * 按客户ID删除公司主体(逻辑删除) */ - public int deleteBmsCustomerCompanyByCustomerId(String customerId); + public int deleteBmsCustomerCompanyByCustomerId(Long customerId); /** * 按公司ID删除(逻辑删除) */ public int deleteBmsCustomerCompanyByCompanyId(Long companyId); + + /** + * 查询客户联系人列表 + */ + public List selectBmsCustomerContactList(BmsCustomerContact bmsCustomerContact); + + /** + * 按ID查询客户联系人 + */ + public BmsCustomerContact selectBmsCustomerContactByContactId(Long contactId); + + /** + * 新增客户联系人 + */ + public int insertBmsCustomerContact(BmsCustomerContact bmsCustomerContact); + + /** + * 修改客户联系人 + */ + public int updateBmsCustomerContact(BmsCustomerContact bmsCustomerContact); + + /** + * 按客户ID删除联系人(逻辑删除) + */ + public int deleteBmsCustomerContactByCustomerId(Long customerId); + + /** + * 按联系人ID删除(逻辑删除) + */ + public int deleteBmsCustomerContactByContactId(Long contactId); } diff --git a/bms-back/ruoyi-system/src/main/java/com/ruoyi/customer/customerinfo/service/IBmsCustomerService.java b/bms-back/ruoyi-system/src/main/java/com/ruoyi/customer/customerinfo/service/IBmsCustomerService.java index aa68399d..5b36caab 100644 --- a/bms-back/ruoyi-system/src/main/java/com/ruoyi/customer/customerinfo/service/IBmsCustomerService.java +++ b/bms-back/ruoyi-system/src/main/java/com/ruoyi/customer/customerinfo/service/IBmsCustomerService.java @@ -4,6 +4,7 @@ import java.util.List; import com.ruoyi.customer.customerinfo.domain.BmsCustomer; import com.ruoyi.customer.customerinfo.domain.BmsCustomerAttachment; import com.ruoyi.customer.customerinfo.domain.BmsCustomerCompany; +import com.ruoyi.customer.customerinfo.domain.BmsCustomerContact; /** * 客户主Service接口 @@ -19,7 +20,7 @@ public interface IBmsCustomerService * @param customerId 客户主主键 * @return 客户主 */ - public BmsCustomer selectBmsCustomerByCustomerId(String customerId); + public BmsCustomer selectBmsCustomerByCustomerId(Long customerId); /** * 查询客户主列表 @@ -43,7 +44,7 @@ public interface IBmsCustomerService * @param customerId 客户ID * @param attachmentList 附件集合 */ - public void saveBmsCustomerAttachments(String customerId, List attachmentList); + public void saveBmsCustomerAttachments(Long customerId, List attachmentList); /** * 按客户ID删除附件 @@ -51,7 +52,7 @@ public interface IBmsCustomerService * @param customerId 客户ID * @return 结果 */ - public int deleteBmsCustomerAttachmentByCustomerId(String customerId); + public int deleteBmsCustomerAttachmentByCustomerId(Long customerId); /** * 查询客户公司主体列表 @@ -81,7 +82,37 @@ public interface IBmsCustomerService /** * 批量保存客户公司主体(随主表提交时调用) */ - public void saveBmsCustomerCompanies(String customerId, List companyList); + public void saveBmsCustomerCompanies(Long customerId, List companyList); + + /** + * 查询客户联系人列表 + */ + public List selectBmsCustomerContactList(BmsCustomerContact bmsCustomerContact); + + /** + * 按ID查询客户联系人 + */ + public BmsCustomerContact selectBmsCustomerContactByContactId(Long contactId); + + /** + * 新增客户联系人(独立接口,用于子表新增按钮) + */ + public int insertBmsCustomerContact(BmsCustomerContact bmsCustomerContact); + + /** + * 修改客户联系人 + */ + public int updateBmsCustomerContact(BmsCustomerContact bmsCustomerContact); + + /** + * 删除客户联系人 + */ + public int deleteBmsCustomerContactByContactIds(Long[] contactIds); + + /** + * 批量保存客户联系人(随主表提交时调用) + */ + public void saveBmsCustomerContacts(Long customerId, List contactList); /** * 新增客户主 @@ -105,7 +136,7 @@ public interface IBmsCustomerService * @param customerIds 需要删除的客户主主键集合 * @return 结果 */ - public int deleteBmsCustomerByCustomerIds(String[] customerIds); + public int deleteBmsCustomerByCustomerIds(Long[] customerIds); /** * 删除客户主信息 @@ -113,5 +144,5 @@ public interface IBmsCustomerService * @param customerId 客户主主键 * @return 结果 */ - public int deleteBmsCustomerByCustomerId(String customerId); + public int deleteBmsCustomerByCustomerId(Long customerId); } diff --git a/bms-back/ruoyi-system/src/main/java/com/ruoyi/customer/customerinfo/service/impl/BmsCustomerServiceImpl.java b/bms-back/ruoyi-system/src/main/java/com/ruoyi/customer/customerinfo/service/impl/BmsCustomerServiceImpl.java index deb7f8aa..c6456d50 100644 --- a/bms-back/ruoyi-system/src/main/java/com/ruoyi/customer/customerinfo/service/impl/BmsCustomerServiceImpl.java +++ b/bms-back/ruoyi-system/src/main/java/com/ruoyi/customer/customerinfo/service/impl/BmsCustomerServiceImpl.java @@ -5,9 +5,9 @@ import java.util.List; import com.ruoyi.common.core.domain.entity.SysUser; import com.ruoyi.common.utils.DateUtils; import com.ruoyi.common.utils.SecurityUtils; -import com.ruoyi.common.utils.uuid.IdUtils; import com.ruoyi.customer.customerinfo.domain.BmsCustomerAttachment; import com.ruoyi.customer.customerinfo.domain.BmsCustomerCompany; +import com.ruoyi.customer.customerinfo.domain.BmsCustomerContact; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -34,7 +34,7 @@ public class BmsCustomerServiceImpl implements IBmsCustomerService * @return 客户主 */ @Override - public BmsCustomer selectBmsCustomerByCustomerId(String customerId) + public BmsCustomer selectBmsCustomerByCustomerId(Long customerId) { BmsCustomer bmsCustomer = bmsCustomerMapper.selectBmsCustomerByCustomerId(customerId); if (bmsCustomer != null) @@ -45,6 +45,9 @@ public class BmsCustomerServiceImpl implements IBmsCustomerService BmsCustomerCompany companyQuery = new BmsCustomerCompany(); companyQuery.setCustomerId(customerId); bmsCustomer.setCompanyList(bmsCustomerMapper.selectBmsCustomerCompanyList(companyQuery)); + BmsCustomerContact contactQuery = new BmsCustomerContact(); + contactQuery.setCustomerId(customerId); + bmsCustomer.setContactList(bmsCustomerMapper.selectBmsCustomerContactList(contactQuery)); } return bmsCustomer; } @@ -71,7 +74,7 @@ public class BmsCustomerServiceImpl implements IBmsCustomerService * 批量保存客户附件(新增/修改) */ @Override - public void saveBmsCustomerAttachments(String customerId, List attachmentList) + public void saveBmsCustomerAttachments(Long customerId, List attachmentList) { if (attachmentList == null || attachmentList.isEmpty()) { @@ -104,7 +107,7 @@ public class BmsCustomerServiceImpl implements IBmsCustomerService * 按客户ID删除附件(逻辑删除) */ @Override - public int deleteBmsCustomerAttachmentByCustomerId(String customerId) + public int deleteBmsCustomerAttachmentByCustomerId(Long customerId) { return bmsCustomerMapper.deleteBmsCustomerAttachmentByCustomerId(customerId); } @@ -173,7 +176,7 @@ public class BmsCustomerServiceImpl implements IBmsCustomerService * 批量保存客户公司主体(随主表提交) */ @Override - public void saveBmsCustomerCompanies(String customerId, List companyList) + public void saveBmsCustomerCompanies(Long customerId, List companyList) { if (companyList == null || companyList.isEmpty()) { @@ -213,8 +216,6 @@ public class BmsCustomerServiceImpl implements IBmsCustomerService public int insertBmsCustomer(BmsCustomer bmsCustomer) { SysUser user = SecurityUtils.getLoginUser().getUser(); - // 应用层生成 UUID,避免与供应商主键在子表中冲突 - bmsCustomer.setCustomerId(IdUtils.simpleUUID()); bmsCustomer.setCreateTime(DateUtils.getNowDate()); bmsCustomer.setCreateBy(user.getUserName()); int rows = bmsCustomerMapper.insertBmsCustomer(bmsCustomer); @@ -222,6 +223,7 @@ public class BmsCustomerServiceImpl implements IBmsCustomerService { saveBmsCustomerAttachments(bmsCustomer.getCustomerId(), bmsCustomer.getAttachmentList()); saveBmsCustomerCompanies(bmsCustomer.getCustomerId(), bmsCustomer.getCompanyList()); + saveBmsCustomerContacts(bmsCustomer.getCustomerId(), bmsCustomer.getContactList()); } return rows; } @@ -251,6 +253,8 @@ public class BmsCustomerServiceImpl implements IBmsCustomerService } // 公司主体表采用增量 upsert,不做全量重置(保留 companyId 稳定) saveBmsCustomerCompanies(bmsCustomer.getCustomerId(), bmsCustomer.getCompanyList()); + // 联系人采用增量 upsert + saveBmsCustomerContacts(bmsCustomer.getCustomerId(), bmsCustomer.getContactList()); return bmsCustomerMapper.updateBmsCustomer(bmsCustomer); } @@ -262,12 +266,13 @@ public class BmsCustomerServiceImpl implements IBmsCustomerService */ @Transactional(rollbackFor = Exception.class) @Override - public int deleteBmsCustomerByCustomerIds(String[] customerIds) + public int deleteBmsCustomerByCustomerIds(Long[] customerIds) { - for (String customerId : customerIds) + for (Long customerId : customerIds) { bmsCustomerMapper.deleteBmsCustomerAttachmentByCustomerId(customerId); bmsCustomerMapper.deleteBmsCustomerCompanyByCustomerId(customerId); + bmsCustomerMapper.deleteBmsCustomerContactByCustomerId(customerId); } return bmsCustomerMapper.deleteBmsCustomerByCustomerIds(customerIds); } @@ -280,10 +285,104 @@ public class BmsCustomerServiceImpl implements IBmsCustomerService */ @Transactional(rollbackFor = Exception.class) @Override - public int deleteBmsCustomerByCustomerId(String customerId) + public int deleteBmsCustomerByCustomerId(Long customerId) { bmsCustomerMapper.deleteBmsCustomerAttachmentByCustomerId(customerId); bmsCustomerMapper.deleteBmsCustomerCompanyByCustomerId(customerId); + bmsCustomerMapper.deleteBmsCustomerContactByCustomerId(customerId); return bmsCustomerMapper.deleteBmsCustomerByCustomerId(customerId); } + + /** + * 查询客户联系人列表 + */ + @Override + public List selectBmsCustomerContactList(BmsCustomerContact bmsCustomerContact) + { + return bmsCustomerMapper.selectBmsCustomerContactList(bmsCustomerContact); + } + + /** + * 按ID查询客户联系人 + */ + @Override + public BmsCustomerContact selectBmsCustomerContactByContactId(Long contactId) + { + return bmsCustomerMapper.selectBmsCustomerContactByContactId(contactId); + } + + /** + * 新增客户联系人 + */ + @Override + public int insertBmsCustomerContact(BmsCustomerContact bmsCustomerContact) + { + SysUser user = SecurityUtils.getLoginUser().getUser(); + bmsCustomerContact.setCreateBy(user.getUserName()); + bmsCustomerContact.setCreateTime(DateUtils.getNowDate()); + if (bmsCustomerContact.getDelFlag() == null) + { + bmsCustomerContact.setDelFlag("0"); + } + return bmsCustomerMapper.insertBmsCustomerContact(bmsCustomerContact); + } + + /** + * 修改客户联系人 + */ + @Override + public int updateBmsCustomerContact(BmsCustomerContact bmsCustomerContact) + { + SysUser user = SecurityUtils.getLoginUser().getUser(); + bmsCustomerContact.setUpdateBy(user.getUserName()); + bmsCustomerContact.setUpdateTime(DateUtils.getNowDate()); + return bmsCustomerMapper.updateBmsCustomerContact(bmsCustomerContact); + } + + /** + * 删除客户联系人(逻辑删除) + */ + @Override + public int deleteBmsCustomerContactByContactIds(Long[] contactIds) + { + int rows = 0; + for (Long contactId : contactIds) + { + rows += bmsCustomerMapper.deleteBmsCustomerContactByContactId(contactId); + } + return rows; + } + + /** + * 批量保存客户联系人(随主表提交) + */ + @Override + public void saveBmsCustomerContacts(Long customerId, List contactList) + { + if (contactList == null || contactList.isEmpty()) + { + return; + } + SysUser user = SecurityUtils.getLoginUser().getUser(); + for (BmsCustomerContact item : contactList) + { + item.setCustomerId(customerId); + if (item.getDelFlag() == null) + { + item.setDelFlag("0"); + } + if (item.getContactId() != null) + { + item.setUpdateBy(user.getUserName()); + item.setUpdateTime(DateUtils.getNowDate()); + bmsCustomerMapper.updateBmsCustomerContact(item); + } + else + { + item.setCreateBy(user.getUserName()); + item.setCreateTime(DateUtils.getNowDate()); + bmsCustomerMapper.insertBmsCustomerContact(item); + } + } + } } diff --git a/bms-back/ruoyi-system/src/main/java/com/ruoyi/customer/supplierinfo/domain/BmsSupplier.java b/bms-back/ruoyi-system/src/main/java/com/ruoyi/customer/supplierinfo/domain/BmsSupplier.java index ad8bb1ae..7d151955 100644 --- a/bms-back/ruoyi-system/src/main/java/com/ruoyi/customer/supplierinfo/domain/BmsSupplier.java +++ b/bms-back/ruoyi-system/src/main/java/com/ruoyi/customer/supplierinfo/domain/BmsSupplier.java @@ -3,12 +3,16 @@ package com.ruoyi.customer.supplierinfo.domain; import java.math.BigDecimal; import java.util.Date; import java.util.List; + +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringStyle; import com.ruoyi.common.annotation.Excel; import com.ruoyi.common.core.domain.BaseEntity; -import com.ruoyi.customer.customerinfo.domain.BmsCustomerAttachment; -import com.ruoyi.customer.customerinfo.domain.BmsCustomerCompany; +import com.ruoyi.customer.supplierinfo.domain.BmsSupplierAttachment; +import com.ruoyi.customer.supplierinfo.domain.BmsSupplierCompany; +import com.ruoyi.customer.supplierinfo.domain.BmsSupplierContact; /** * 供应商主对象 bms_supplier @@ -16,12 +20,13 @@ import com.ruoyi.customer.customerinfo.domain.BmsCustomerCompany; * @author ruoyi * @date 2026-09-09 */ +@Data public class BmsSupplier extends BaseEntity { private static final long serialVersionUID = 1L; - /** 供应商ID(UUID) */ - private String supplierId; + /** 供应商ID */ + private Long supplierId; /** 供应商编码 */ @Excel(name = "供应商编码") @@ -108,6 +113,7 @@ public class BmsSupplier extends BaseEntity private BigDecimal throwRatio; /** 合作开始日期 */ + @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") @Excel(name = "合作开始日期", width = 30, dateFormat = "yyyy-MM-dd") private Date cooperationStartDate; @@ -118,108 +124,17 @@ public class BmsSupplier extends BaseEntity /** 绑定的渠道/服务ID */ private String channelIds; - /** 附件列表(子表 bms_customer_attachment 共用) */ - private List attachmentList; + /** 附件列表(子表 bms_supplier_attachment) */ + private List attachmentList; - /** 公司主体列表(子表 bms_customer_company 共用) */ - private List companyList; + /** 公司主体列表(子表 bms_supplier_company) */ + private List companyList; + + /** 联系人列表(子表 bms_supplier_contact) */ + private List contactList; /** 删除标记(0正常 2删除) */ private String delFlag; - public void setSupplierId(String supplierId) { this.supplierId = supplierId; } - public String getSupplierId() { return supplierId; } - public void setSupplierCode(String supplierCode) { this.supplierCode = supplierCode; } - public String getSupplierCode() { return supplierCode; } - public void setSupplierName(String supplierName) { this.supplierName = supplierName; } - public String getSupplierName() { return supplierName; } - public void setSupplierCodeDw(String supplierCodeDw) { this.supplierCodeDw = supplierCodeDw; } - public String getSupplierCodeDw() { return supplierCodeDw; } - public void setCreditCode(String creditCode) { this.creditCode = creditCode; } - public String getCreditCode() { return creditCode; } - public void setSupplierType(String supplierType) { this.supplierType = supplierType; } - public String getSupplierType() { return supplierType; } - public void setIsEnable(String isEnable) { this.isEnable = isEnable; } - public String getIsEnable() { return isEnable; } - public void setPurchaserUserId(String purchaserUserId) { this.purchaserUserId = purchaserUserId; } - public String getPurchaserUserId() { return purchaserUserId; } - public void setPurchaserUser(String purchaserUser) { this.purchaserUser = purchaserUser; } - public String getPurchaserUser() { return purchaserUser; } - public void setSettlementUserId(String settlementUserId) { this.settlementUserId = settlementUserId; } - public String getSettlementUserId() { return settlementUserId; } - public void setSettlementUser(String settlementUser) { this.settlementUser = settlementUser; } - public String getSettlementUser() { return settlementUser; } - public void setServiceUserId(String serviceUserId) { this.serviceUserId = serviceUserId; } - public String getServiceUserId() { return serviceUserId; } - public void setServiceUser(String serviceUser) { this.serviceUser = serviceUser; } - public String getServiceUser() { return serviceUser; } - public void setEd(BigDecimal ed) { this.ed = ed; } - public BigDecimal getEd() { return ed; } - public void setZq(Long zq) { this.zq = zq; } - public Long getZq() { return zq; } - public void setSettlementType(String settlementType) { this.settlementType = settlementType; } - public String getSettlementType() { return settlementType; } - public void setTempEd(BigDecimal tempEd) { this.tempEd = tempEd; } - public BigDecimal getTempEd() { return tempEd; } - public void setAccountBalance(BigDecimal accountBalance) { this.accountBalance = accountBalance; } - public BigDecimal getAccountBalance() { return accountBalance; } - public void setForeignCurrencyBalance(BigDecimal foreignCurrencyBalance) { this.foreignCurrencyBalance = foreignCurrencyBalance; } - public BigDecimal getForeignCurrencyBalance() { return foreignCurrencyBalance; } - public void setCreditEd(BigDecimal creditEd) { this.creditEd = creditEd; } - public BigDecimal getCreditEd() { return creditEd; } - public void setWeightThreshold(BigDecimal weightThreshold) { this.weightThreshold = weightThreshold; } - public BigDecimal getWeightThreshold() { return weightThreshold; } - public void setThrowRatio(BigDecimal throwRatio) { this.throwRatio = throwRatio; } - public BigDecimal getThrowRatio() { return throwRatio; } - public void setCooperationStartDate(Date cooperationStartDate) { this.cooperationStartDate = cooperationStartDate; } - public Date getCooperationStartDate() { return cooperationStartDate; } - public void setCooperationStatus(String cooperationStatus) { this.cooperationStatus = cooperationStatus; } - public String getCooperationStatus() { return cooperationStatus; } - public void setChannelIds(String channelIds) { this.channelIds = channelIds; } - public String getChannelIds() { return channelIds; } - public void setAttachmentList(List attachmentList) { this.attachmentList = attachmentList; } - public List getAttachmentList() { return attachmentList; } - public void setCompanyList(List companyList) { this.companyList = companyList; } - public List getCompanyList() { return companyList; } - public void setDelFlag(String delFlag) { this.delFlag = delFlag; } - public String getDelFlag() { return delFlag; } - @Override - public String toString() { - return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) - .append("supplierId", getSupplierId()) - .append("supplierCode", getSupplierCode()) - .append("supplierName", getSupplierName()) - .append("supplierCodeDw", getSupplierCodeDw()) - .append("creditCode", getCreditCode()) - .append("supplierType", getSupplierType()) - .append("isEnable", getIsEnable()) - .append("purchaserUserId", getPurchaserUserId()) - .append("purchaserUser", getPurchaserUser()) - .append("settlementUserId", getSettlementUserId()) - .append("settlementUser", getSettlementUser()) - .append("serviceUserId", getServiceUserId()) - .append("serviceUser", getServiceUser()) - .append("ed", getEd()) - .append("zq", getZq()) - .append("settlementType", getSettlementType()) - .append("tempEd", getTempEd()) - .append("accountBalance", getAccountBalance()) - .append("foreignCurrencyBalance", getForeignCurrencyBalance()) - .append("creditEd", getCreditEd()) - .append("weightThreshold", getWeightThreshold()) - .append("throwRatio", getThrowRatio()) - .append("cooperationStartDate", getCooperationStartDate()) - .append("cooperationStatus", getCooperationStatus()) - .append("channelIds", getChannelIds()) - .append("attachmentList", getAttachmentList()) - .append("companyList", getCompanyList()) - .append("remark", getRemark()) - .append("createBy", getCreateBy()) - .append("createTime", getCreateTime()) - .append("updateBy", getUpdateBy()) - .append("updateTime", getUpdateTime()) - .append("delFlag", getDelFlag()) - .toString(); - } } diff --git a/bms-back/ruoyi-system/src/main/java/com/ruoyi/customer/supplierinfo/domain/BmsSupplierAttachment.java b/bms-back/ruoyi-system/src/main/java/com/ruoyi/customer/supplierinfo/domain/BmsSupplierAttachment.java new file mode 100644 index 00000000..0847816d --- /dev/null +++ b/bms-back/ruoyi-system/src/main/java/com/ruoyi/customer/supplierinfo/domain/BmsSupplierAttachment.java @@ -0,0 +1,62 @@ +package com.ruoyi.customer.supplierinfo.domain; + +import lombok.Data; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.common.core.domain.BaseEntity; + +/** + * 供应商附件对象 bms_supplier_attachment + * + * @author ruoyi + * @date 2026-09-10 + */ +@Data +public class BmsSupplierAttachment extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 附件ID */ + private Long attachmentId; + + /** 所属供应商ID */ + @Excel(name = "供应商ID") + private Long supplierId; + + /** 文件原始名称 */ + @Excel(name = "文件原始名称") + private String fileName; + + /** 文件存储路径 */ + @Excel(name = "文件存储路径") + private String filePath; + + /** 文件大小(字节) */ + @Excel(name = "文件大小") + private Long fileSize; + + /** 文件类型 */ + @Excel(name = "文件类型") + private String fileType; + + /** 文件扩展名 */ + @Excel(name = "文件扩展名") + private String fileExtension; + + /** 附件类型(0附件资料 1供应商Logo 2合同文件 3其他) */ + @Excel(name = "附件类型", readConverterExp = "0=附件资料,1=供应商Logo,2=合同文件,3=其他") + private String attachmentType; + + /** 是否Logo(0否 1是) */ + @Excel(name = "是否Logo", readConverterExp = "0=否,1=是") + private String isLogo; + + /** 排序 */ + @Excel(name = "排序") + private Integer sortOrder; + + /** 删除标记(0正常 2删除) */ + private String delFlag; + +} \ No newline at end of file diff --git a/bms-back/ruoyi-system/src/main/java/com/ruoyi/customer/supplierinfo/domain/BmsSupplierCompany.java b/bms-back/ruoyi-system/src/main/java/com/ruoyi/customer/supplierinfo/domain/BmsSupplierCompany.java new file mode 100644 index 00000000..edf51470 --- /dev/null +++ b/bms-back/ruoyi-system/src/main/java/com/ruoyi/customer/supplierinfo/domain/BmsSupplierCompany.java @@ -0,0 +1,147 @@ +package com.ruoyi.customer.supplierinfo.domain; + +import java.math.BigDecimal; +import java.util.Date; + +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.common.core.domain.BaseEntity; + +/** + * 供应商公司主体(工商信息)对象 bms_supplier_company + * + * @author ruoyi + * @date 2026-09-10 + */ +@Data +public class BmsSupplierCompany extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 公司主体ID */ + private Long companyId; + + /** 所属供应商ID */ + @Excel(name = "供应商ID") + private Long supplierId; + + /** 公司全称 */ + @Excel(name = "公司全称") + private String companyNameFull; + + /** 公司英文名称 */ + @Excel(name = "公司英文名称") + private String englishName; + + /** 统一社会信用代码 */ + @Excel(name = "统一社会信用代码") + private String creditCode; + + /** 法定代表人 */ + @Excel(name = "法定代表人") + private String legalPerson; + + /** 法定代表人电话 */ + @Excel(name = "法定代表人电话") + private String legalPersonPhone; + + /** 法定代表人身份证号 */ + private String legalPersonIdCard; + + /** 注册资本(万元) */ + @Excel(name = "注册资本", cellType = Excel.ColumnType.NUMERIC) + private BigDecimal registeredCapital; + + /** 注册资本币种 */ + @Excel(name = "注册资本币种") + private String capitalCurrency; + + /** 实收资本(万元) */ + @Excel(name = "实收资本", cellType = Excel.ColumnType.NUMERIC) + private BigDecimal paidInCapital; + + /** 成立日期 */ + @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") + @Excel(name = "成立日期", width = 30, dateFormat = "yyyy-MM-dd") + private Date establishDate; + + /** 营业期限起始日 */ + @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") + @Excel(name = "营业期限起始日", width = 30, dateFormat = "yyyy-MM-dd") + private Date businessTermStart; + + /** 营业期限终止日 */ + @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") + @Excel(name = "营业期限终止日", width = 30, dateFormat = "yyyy-MM-dd") + private Date businessTermEnd; + + /** 是否长期有效(0否 1是) */ + @Excel(name = "是否长期有效", readConverterExp = "0=否,1=是") + private String businessTermPermanent; + + /** 登记机关 */ + @Excel(name = "登记机关") + private String registrationAuthority; + + /** 注册号 */ + @Excel(name = "注册号") + private String registrationNumber; + + /** 经营状态 */ + @Excel(name = "经营状态") + private String operatingStatus; + + /** 经营范围 */ + private String businessScope; + + /** 主要股东信息 */ + private String shareholders; + + /** 员工人数 */ + @Excel(name = "员工人数") + private Integer employeeCount; + + /** 公司电话 */ + @Excel(name = "公司电话") + private String companyPhone; + + /** 公司传真 */ + @Excel(name = "公司传真") + private String companyFax; + + /** 公司网址 */ + @Excel(name = "公司网址") + private String companyWebsite; + + /** 公司邮箱 */ + @Excel(name = "公司邮箱") + private String companyEmail; + + /** 注册省份 */ + @Excel(name = "注册省份") + private String registeredProvince; + + /** 注册城市 */ + @Excel(name = "注册城市") + private String registeredCity; + + /** 注册区县 */ + @Excel(name = "注册区县") + private String registeredDistrict; + + /** 注册详细地址 */ + @Excel(name = "注册详细地址") + private String registeredAddressDetail; + + /** 营业执照(oss_id) */ + private Long businessLicenseOssId; + + /** 其他附件(oss_id逗号分隔) */ + private String attachmentIds; + + /** 删除标记(0正常 2删除) */ + private String delFlag; + + +} \ No newline at end of file diff --git a/bms-back/ruoyi-system/src/main/java/com/ruoyi/customer/supplierinfo/domain/BmsSupplierContact.java b/bms-back/ruoyi-system/src/main/java/com/ruoyi/customer/supplierinfo/domain/BmsSupplierContact.java new file mode 100644 index 00000000..f0e40e17 --- /dev/null +++ b/bms-back/ruoyi-system/src/main/java/com/ruoyi/customer/supplierinfo/domain/BmsSupplierContact.java @@ -0,0 +1,98 @@ +package com.ruoyi.customer.supplierinfo.domain; + +import lombok.Data; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.common.core.domain.BaseEntity; + +/** + * 供应商联系人对象 bms_supplier_contact + * + * @author ruoyi + * @date 2026-09-10 + */ +@Data +public class BmsSupplierContact extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 联系人ID */ + private Long contactId; + + /** 所属供应商ID */ + @Excel(name = "供应商ID") + private Long supplierId; + + /** 联系人姓名 */ + @Excel(name = "联系人姓名") + private String contactName; + + /** 职位 */ + @Excel(name = "职位") + private String position; + + /** 所属部门 */ + @Excel(name = "所属部门") + private String department; + + /** 手机号 */ + @Excel(name = "手机号") + private String phone; + + /** 座机 */ + @Excel(name = "座机") + private String landline; + + /** 电子邮箱 */ + @Excel(name = "电子邮箱") + private String email; + + /** 微信号 */ + @Excel(name = "微信号") + private String wechat; + + /** QQ号 */ + @Excel(name = "QQ号") + private String qq; + + /** 国家/地区 */ + @Excel(name = "国家/地区") + private String country; + + /** 省份 */ + @Excel(name = "省份") + private String province; + + /** 城市 */ + @Excel(name = "城市") + private String city; + + /** 区/县 */ + @Excel(name = "区/县") + private String district; + + /** 联系详细地址 */ + @Excel(name = "联系详细地址") + private String contactAddress; + + /** 邮政编码 */ + @Excel(name = "邮政编码") + private String postalCode; + + /** 是否默认联系人(0否 1是) */ + @Excel(name = "是否默认联系人", readConverterExp = "0=否,1=是") + private String isDefault; + + /** 联系人类型(0业务联系人 1财务联系人 2紧急联系人 3其他) */ + @Excel(name = "联系人类型", readConverterExp = "0=业务联系人,1=财务联系人,2=紧急联系人,3=其他") + private String contactType; + + /** 排序 */ + @Excel(name = "排序") + private Integer sortOrder; + + /** 删除标记(0正常 2删除) */ + private String delFlag; + +} \ No newline at end of file diff --git a/bms-back/ruoyi-system/src/main/java/com/ruoyi/customer/supplierinfo/mapper/BmsSupplierMapper.java b/bms-back/ruoyi-system/src/main/java/com/ruoyi/customer/supplierinfo/mapper/BmsSupplierMapper.java index 697ebbbf..7e5d2827 100644 --- a/bms-back/ruoyi-system/src/main/java/com/ruoyi/customer/supplierinfo/mapper/BmsSupplierMapper.java +++ b/bms-back/ruoyi-system/src/main/java/com/ruoyi/customer/supplierinfo/mapper/BmsSupplierMapper.java @@ -2,6 +2,9 @@ package com.ruoyi.customer.supplierinfo.mapper; import java.util.List; import com.ruoyi.customer.supplierinfo.domain.BmsSupplier; +import com.ruoyi.customer.supplierinfo.domain.BmsSupplierAttachment; +import com.ruoyi.customer.supplierinfo.domain.BmsSupplierCompany; +import com.ruoyi.customer.supplierinfo.domain.BmsSupplierContact; /** * 供应商主Mapper接口 @@ -12,7 +15,7 @@ import com.ruoyi.customer.supplierinfo.domain.BmsSupplier; public interface BmsSupplierMapper { /** 查询供应商 */ - public BmsSupplier selectBmsSupplierBySupplierId(String supplierId); + public BmsSupplier selectBmsSupplierBySupplierId(Long supplierId); /** 查询供应商列表 */ public List selectBmsSupplierList(BmsSupplier bmsSupplier); @@ -24,8 +27,59 @@ public interface BmsSupplierMapper public int updateBmsSupplier(BmsSupplier bmsSupplier); /** 删除供应商 */ - public int deleteBmsSupplierBySupplierId(String supplierId); + public int deleteBmsSupplierBySupplierId(Long supplierId); /** 批量删除供应商 */ - public int deleteBmsSupplierBySupplierIds(String[] supplierIds); + public int deleteBmsSupplierBySupplierIds(Long[] supplierIds); + + /** 查询供应商附件列表 */ + public List selectBmsSupplierAttachmentList(BmsSupplierAttachment bmsSupplierAttachment); + + /** 新增供应商附件 */ + public int insertBmsSupplierAttachment(BmsSupplierAttachment bmsSupplierAttachment); + + /** 修改供应商附件 */ + public int updateBmsSupplierAttachment(BmsSupplierAttachment bmsSupplierAttachment); + + /** 按供应商ID删除附件(逻辑删除) */ + public int deleteBmsSupplierAttachmentBySupplierId(Long supplierId); + + /** 按附件ID删除(逻辑删除) */ + public int deleteBmsSupplierAttachmentByAttachmentId(Long attachmentId); + + /** 查询供应商公司主体列表 */ + public List selectBmsSupplierCompanyList(BmsSupplierCompany bmsSupplierCompany); + + /** 按ID查询供应商公司主体 */ + public BmsSupplierCompany selectBmsSupplierCompanyByCompanyId(Long companyId); + + /** 新增供应商公司主体 */ + public int insertBmsSupplierCompany(BmsSupplierCompany bmsSupplierCompany); + + /** 修改供应商公司主体 */ + public int updateBmsSupplierCompany(BmsSupplierCompany bmsSupplierCompany); + + /** 按供应商ID删除公司主体(逻辑删除) */ + public int deleteBmsSupplierCompanyBySupplierId(Long supplierId); + + /** 按公司ID删除(逻辑删除) */ + public int deleteBmsSupplierCompanyByCompanyId(Long companyId); + + /** 查询供应商联系人列表 */ + public List selectBmsSupplierContactList(BmsSupplierContact bmsSupplierContact); + + /** 按ID查询供应商联系人 */ + public BmsSupplierContact selectBmsSupplierContactByContactId(Long contactId); + + /** 新增供应商联系人 */ + public int insertBmsSupplierContact(BmsSupplierContact bmsSupplierContact); + + /** 修改供应商联系人 */ + public int updateBmsSupplierContact(BmsSupplierContact bmsSupplierContact); + + /** 按供应商ID删除联系人(逻辑删除) */ + public int deleteBmsSupplierContactBySupplierId(Long supplierId); + + /** 按联系人ID删除(逻辑删除) */ + public int deleteBmsSupplierContactByContactId(Long contactId); } diff --git a/bms-back/ruoyi-system/src/main/java/com/ruoyi/customer/supplierinfo/service/IBmsSupplierService.java b/bms-back/ruoyi-system/src/main/java/com/ruoyi/customer/supplierinfo/service/IBmsSupplierService.java index dca0e7b4..a8646cc7 100644 --- a/bms-back/ruoyi-system/src/main/java/com/ruoyi/customer/supplierinfo/service/IBmsSupplierService.java +++ b/bms-back/ruoyi-system/src/main/java/com/ruoyi/customer/supplierinfo/service/IBmsSupplierService.java @@ -1,9 +1,10 @@ package com.ruoyi.customer.supplierinfo.service; import java.util.List; -import com.ruoyi.customer.customerinfo.domain.BmsCustomerAttachment; -import com.ruoyi.customer.customerinfo.domain.BmsCustomerCompany; import com.ruoyi.customer.supplierinfo.domain.BmsSupplier; +import com.ruoyi.customer.supplierinfo.domain.BmsSupplierAttachment; +import com.ruoyi.customer.supplierinfo.domain.BmsSupplierCompany; +import com.ruoyi.customer.supplierinfo.domain.BmsSupplierContact; /** * 供应商主Service接口 @@ -14,7 +15,7 @@ import com.ruoyi.customer.supplierinfo.domain.BmsSupplier; public interface IBmsSupplierService { /** 查询供应商 */ - public BmsSupplier selectBmsSupplierBySupplierId(String supplierId); + public BmsSupplier selectBmsSupplierBySupplierId(Long supplierId); /** 查询供应商列表 */ public List selectBmsSupplierList(BmsSupplier bmsSupplier); @@ -26,14 +27,53 @@ public interface IBmsSupplierService public int updateBmsSupplier(BmsSupplier bmsSupplier); /** 批量删除供应商 */ - public int deleteBmsSupplierBySupplierIds(String[] supplierIds); + public int deleteBmsSupplierBySupplierIds(Long[] supplierIds); /** 删除供应商 */ - public int deleteBmsSupplierBySupplierId(String supplierId); + public int deleteBmsSupplierBySupplierId(Long supplierId); - /** 查询供应商附件列表(子表共用) */ - public List selectBmsSupplierAttachmentList(BmsCustomerAttachment attachment); + /** 查询供应商附件列表 */ + public List selectBmsSupplierAttachmentList(BmsSupplierAttachment attachment); - /** 查询供应商公司主体列表(子表共用) */ - public List selectBmsSupplierCompanyList(BmsCustomerCompany company); + /** 按供应商ID删除附件 */ + public int deleteBmsSupplierAttachmentBySupplierId(Long supplierId); + + /** 批量保存供应商附件(随主表提交时调用) */ + public void saveBmsSupplierAttachments(Long supplierId, List attachmentList); + + /** 查询供应商公司主体列表 */ + public List selectBmsSupplierCompanyList(BmsSupplierCompany company); + + /** 按ID查询供应商公司主体 */ + public BmsSupplierCompany selectBmsSupplierCompanyByCompanyId(Long companyId); + + /** 新增供应商公司主体(独立接口,用于子表新增按钮) */ + public int insertBmsSupplierCompany(BmsSupplierCompany bmsSupplierCompany); + + /** 修改供应商公司主体 */ + public int updateBmsSupplierCompany(BmsSupplierCompany bmsSupplierCompany); + + /** 删除供应商公司主体 */ + public int deleteBmsSupplierCompanyByCompanyIds(Long[] companyIds); + + /** 批量保存供应商公司主体(随主表提交时调用) */ + public void saveBmsSupplierCompanies(Long supplierId, List companyList); + + /** 查询供应商联系人列表 */ + public List selectBmsSupplierContactList(BmsSupplierContact bmsSupplierContact); + + /** 按ID查询供应商联系人 */ + public BmsSupplierContact selectBmsSupplierContactByContactId(Long contactId); + + /** 新增供应商联系人(独立接口,用于子表新增按钮) */ + public int insertBmsSupplierContact(BmsSupplierContact bmsSupplierContact); + + /** 修改供应商联系人 */ + public int updateBmsSupplierContact(BmsSupplierContact bmsSupplierContact); + + /** 删除供应商联系人 */ + public int deleteBmsSupplierContactByContactIds(Long[] contactIds); + + /** 批量保存供应商联系人(随主表提交时调用) */ + public void saveBmsSupplierContacts(Long supplierId, List contactList); } diff --git a/bms-back/ruoyi-system/src/main/java/com/ruoyi/customer/supplierinfo/service/impl/BmsSupplierServiceImpl.java b/bms-back/ruoyi-system/src/main/java/com/ruoyi/customer/supplierinfo/service/impl/BmsSupplierServiceImpl.java index 52962a58..b5685e37 100644 --- a/bms-back/ruoyi-system/src/main/java/com/ruoyi/customer/supplierinfo/service/impl/BmsSupplierServiceImpl.java +++ b/bms-back/ruoyi-system/src/main/java/com/ruoyi/customer/supplierinfo/service/impl/BmsSupplierServiceImpl.java @@ -5,11 +5,10 @@ import java.util.List; import com.ruoyi.common.core.domain.entity.SysUser; import com.ruoyi.common.utils.DateUtils; import com.ruoyi.common.utils.SecurityUtils; -import com.ruoyi.common.utils.uuid.IdUtils; -import com.ruoyi.customer.customerinfo.domain.BmsCustomerAttachment; -import com.ruoyi.customer.customerinfo.domain.BmsCustomerCompany; -import com.ruoyi.customer.customerinfo.mapper.BmsCustomerMapper; import com.ruoyi.customer.supplierinfo.domain.BmsSupplier; +import com.ruoyi.customer.supplierinfo.domain.BmsSupplierAttachment; +import com.ruoyi.customer.supplierinfo.domain.BmsSupplierCompany; +import com.ruoyi.customer.supplierinfo.domain.BmsSupplierContact; import com.ruoyi.customer.supplierinfo.mapper.BmsSupplierMapper; import com.ruoyi.customer.supplierinfo.service.IBmsSupplierService; import org.springframework.beans.factory.annotation.Autowired; @@ -28,23 +27,21 @@ public class BmsSupplierServiceImpl implements IBmsSupplierService @Autowired private BmsSupplierMapper bmsSupplierMapper; - /** 子表 Mapper 复用客户模块(bms_customer_attachment / bms_customer_company 物理表共用,customer_id 列实际存 supplier_id) */ - @Autowired - private BmsCustomerMapper bmsCustomerMapper; - @Override - public BmsSupplier selectBmsSupplierBySupplierId(String supplierId) + public BmsSupplier selectBmsSupplierBySupplierId(Long supplierId) { BmsSupplier bmsSupplier = bmsSupplierMapper.selectBmsSupplierBySupplierId(supplierId); if (bmsSupplier != null) { - // 复用子表查询,customer_id 实际传入 supplier_id - BmsCustomerAttachment attachQuery = new BmsCustomerAttachment(); - attachQuery.setCustomerId(supplierId); - bmsSupplier.setAttachmentList(bmsCustomerMapper.selectBmsCustomerAttachmentList(attachQuery)); - BmsCustomerCompany companyQuery = new BmsCustomerCompany(); - companyQuery.setCustomerId(supplierId); - bmsSupplier.setCompanyList(bmsCustomerMapper.selectBmsCustomerCompanyList(companyQuery)); + BmsSupplierAttachment attachQuery = new BmsSupplierAttachment(); + attachQuery.setSupplierId(supplierId); + bmsSupplier.setAttachmentList(bmsSupplierMapper.selectBmsSupplierAttachmentList(attachQuery)); + BmsSupplierCompany companyQuery = new BmsSupplierCompany(); + companyQuery.setSupplierId(supplierId); + bmsSupplier.setCompanyList(bmsSupplierMapper.selectBmsSupplierCompanyList(companyQuery)); + BmsSupplierContact contactQuery = new BmsSupplierContact(); + contactQuery.setSupplierId(supplierId); + bmsSupplier.setContactList(bmsSupplierMapper.selectBmsSupplierContactList(contactQuery)); } return bmsSupplier; } @@ -56,30 +53,28 @@ public class BmsSupplierServiceImpl implements IBmsSupplierService } @Override - public List selectBmsSupplierAttachmentList(BmsCustomerAttachment attachment) + public List selectBmsSupplierAttachmentList(BmsSupplierAttachment attachment) { - return bmsCustomerMapper.selectBmsCustomerAttachmentList(attachment); + return bmsSupplierMapper.selectBmsSupplierAttachmentList(attachment); } @Override - public List selectBmsSupplierCompanyList(BmsCustomerCompany company) + public int deleteBmsSupplierAttachmentBySupplierId(Long supplierId) { - return bmsCustomerMapper.selectBmsCustomerCompanyList(company); + return bmsSupplierMapper.deleteBmsSupplierAttachmentBySupplierId(supplierId); } - /** - * 批量保存供应商附件(复用子表,把 supplierId 设置到 customerId 字段) - */ - private void saveBmsSupplierAttachments(String supplierId, List attachmentList) + @Override + public void saveBmsSupplierAttachments(Long supplierId, List attachmentList) { if (attachmentList == null || attachmentList.isEmpty()) { return; } SysUser user = SecurityUtils.getLoginUser().getUser(); - for (BmsCustomerAttachment item : attachmentList) + for (BmsSupplierAttachment item : attachmentList) { - item.setCustomerId(supplierId); + item.setSupplierId(supplierId); if (item.getDelFlag() == null) { item.setDelFlag("0"); @@ -88,30 +83,73 @@ public class BmsSupplierServiceImpl implements IBmsSupplierService { item.setUpdateBy(user.getUserName()); item.setUpdateTime(DateUtils.getNowDate()); - bmsCustomerMapper.updateBmsCustomerAttachment(item); + bmsSupplierMapper.updateBmsSupplierAttachment(item); } else { item.setCreateBy(user.getUserName()); item.setCreateTime(DateUtils.getNowDate()); - bmsCustomerMapper.insertBmsCustomerAttachment(item); + bmsSupplierMapper.insertBmsSupplierAttachment(item); } } } - /** - * 批量保存供应商公司主体(复用子表,把 supplierId 设置到 customerId 字段) - */ - private void saveBmsSupplierCompanies(String supplierId, List companyList) + @Override + public List selectBmsSupplierCompanyList(BmsSupplierCompany company) + { + return bmsSupplierMapper.selectBmsSupplierCompanyList(company); + } + + @Override + public BmsSupplierCompany selectBmsSupplierCompanyByCompanyId(Long companyId) + { + return bmsSupplierMapper.selectBmsSupplierCompanyByCompanyId(companyId); + } + + @Override + public int insertBmsSupplierCompany(BmsSupplierCompany bmsSupplierCompany) + { + SysUser user = SecurityUtils.getLoginUser().getUser(); + bmsSupplierCompany.setCreateBy(user.getUserName()); + bmsSupplierCompany.setCreateTime(DateUtils.getNowDate()); + if (bmsSupplierCompany.getDelFlag() == null) + { + bmsSupplierCompany.setDelFlag("0"); + } + return bmsSupplierMapper.insertBmsSupplierCompany(bmsSupplierCompany); + } + + @Override + public int updateBmsSupplierCompany(BmsSupplierCompany bmsSupplierCompany) + { + SysUser user = SecurityUtils.getLoginUser().getUser(); + bmsSupplierCompany.setUpdateBy(user.getUserName()); + bmsSupplierCompany.setUpdateTime(DateUtils.getNowDate()); + return bmsSupplierMapper.updateBmsSupplierCompany(bmsSupplierCompany); + } + + @Override + public int deleteBmsSupplierCompanyByCompanyIds(Long[] companyIds) + { + int rows = 0; + for (Long companyId : companyIds) + { + rows += bmsSupplierMapper.deleteBmsSupplierCompanyByCompanyId(companyId); + } + return rows; + } + + @Override + public void saveBmsSupplierCompanies(Long supplierId, List companyList) { if (companyList == null || companyList.isEmpty()) { return; } SysUser user = SecurityUtils.getLoginUser().getUser(); - for (BmsCustomerCompany item : companyList) + for (BmsSupplierCompany item : companyList) { - item.setCustomerId(supplierId); + item.setSupplierId(supplierId); if (item.getDelFlag() == null) { item.setDelFlag("0"); @@ -120,13 +158,88 @@ public class BmsSupplierServiceImpl implements IBmsSupplierService { item.setUpdateBy(user.getUserName()); item.setUpdateTime(DateUtils.getNowDate()); - bmsCustomerMapper.updateBmsCustomerCompany(item); + bmsSupplierMapper.updateBmsSupplierCompany(item); } else { item.setCreateBy(user.getUserName()); item.setCreateTime(DateUtils.getNowDate()); - bmsCustomerMapper.insertBmsCustomerCompany(item); + bmsSupplierMapper.insertBmsSupplierCompany(item); + } + } + } + + @Override + public List selectBmsSupplierContactList(BmsSupplierContact bmsSupplierContact) + { + return bmsSupplierMapper.selectBmsSupplierContactList(bmsSupplierContact); + } + + @Override + public BmsSupplierContact selectBmsSupplierContactByContactId(Long contactId) + { + return bmsSupplierMapper.selectBmsSupplierContactByContactId(contactId); + } + + @Override + public int insertBmsSupplierContact(BmsSupplierContact bmsSupplierContact) + { + SysUser user = SecurityUtils.getLoginUser().getUser(); + bmsSupplierContact.setCreateBy(user.getUserName()); + bmsSupplierContact.setCreateTime(DateUtils.getNowDate()); + if (bmsSupplierContact.getDelFlag() == null) + { + bmsSupplierContact.setDelFlag("0"); + } + return bmsSupplierMapper.insertBmsSupplierContact(bmsSupplierContact); + } + + @Override + public int updateBmsSupplierContact(BmsSupplierContact bmsSupplierContact) + { + SysUser user = SecurityUtils.getLoginUser().getUser(); + bmsSupplierContact.setUpdateBy(user.getUserName()); + bmsSupplierContact.setUpdateTime(DateUtils.getNowDate()); + return bmsSupplierMapper.updateBmsSupplierContact(bmsSupplierContact); + } + + @Override + public int deleteBmsSupplierContactByContactIds(Long[] contactIds) + { + int rows = 0; + for (Long contactId : contactIds) + { + rows += bmsSupplierMapper.deleteBmsSupplierContactByContactId(contactId); + } + return rows; + } + + @Override + public void saveBmsSupplierContacts(Long supplierId, List contactList) + { + if (contactList == null || contactList.isEmpty()) + { + return; + } + SysUser user = SecurityUtils.getLoginUser().getUser(); + for (BmsSupplierContact item : contactList) + { + item.setSupplierId(supplierId); + if (item.getDelFlag() == null) + { + item.setDelFlag("0"); + } + if (item.getContactId() != null) + { + item.setUpdateBy(user.getUserName()); + item.setUpdateTime(DateUtils.getNowDate()); + bmsSupplierMapper.updateBmsSupplierContact(item); + } + else + { + item.setCreateBy(user.getUserName()); + item.setCreateTime(DateUtils.getNowDate()); + bmsSupplierMapper.insertBmsSupplierContact(item); } } } @@ -136,8 +249,6 @@ public class BmsSupplierServiceImpl implements IBmsSupplierService public int insertBmsSupplier(BmsSupplier bmsSupplier) { SysUser user = SecurityUtils.getLoginUser().getUser(); - // 应用层生成 UUID,与客户 UUID 互不冲突,子表 customer_id 列可同时容纳两者 - bmsSupplier.setSupplierId(IdUtils.simpleUUID()); bmsSupplier.setCreateTime(DateUtils.getNowDate()); bmsSupplier.setCreateBy(user.getUserName()); int rows = bmsSupplierMapper.insertBmsSupplier(bmsSupplier); @@ -145,6 +256,7 @@ public class BmsSupplierServiceImpl implements IBmsSupplierService { saveBmsSupplierAttachments(bmsSupplier.getSupplierId(), bmsSupplier.getAttachmentList()); saveBmsSupplierCompanies(bmsSupplier.getSupplierId(), bmsSupplier.getCompanyList()); + saveBmsSupplierContacts(bmsSupplier.getSupplierId(), bmsSupplier.getContactList()); } return rows; } @@ -156,11 +268,11 @@ public class BmsSupplierServiceImpl implements IBmsSupplierService SysUser user = SecurityUtils.getLoginUser().getUser(); bmsSupplier.setUpdateTime(DateUtils.getNowDate()); bmsSupplier.setUpdateBy(user.getUserName()); - // 附件先逻辑删除再重建(与客户模块保持一致) - bmsCustomerMapper.deleteBmsCustomerAttachmentByCustomerId(bmsSupplier.getSupplierId()); + // 附件先逻辑删除再重建(全量替换) + bmsSupplierMapper.deleteBmsSupplierAttachmentBySupplierId(bmsSupplier.getSupplierId()); if (bmsSupplier.getAttachmentList() != null) { - for (BmsCustomerAttachment item : bmsSupplier.getAttachmentList()) + for (BmsSupplierAttachment item : bmsSupplier.getAttachmentList()) { item.setAttachmentId(null); } @@ -168,27 +280,31 @@ public class BmsSupplierServiceImpl implements IBmsSupplierService } // 公司主体采用增量 upsert saveBmsSupplierCompanies(bmsSupplier.getSupplierId(), bmsSupplier.getCompanyList()); + // 联系人采用增量 upsert + saveBmsSupplierContacts(bmsSupplier.getSupplierId(), bmsSupplier.getContactList()); return bmsSupplierMapper.updateBmsSupplier(bmsSupplier); } @Transactional(rollbackFor = Exception.class) @Override - public int deleteBmsSupplierBySupplierIds(String[] supplierIds) + public int deleteBmsSupplierBySupplierIds(Long[] supplierIds) { - for (String supplierId : supplierIds) + for (Long supplierId : supplierIds) { - bmsCustomerMapper.deleteBmsCustomerAttachmentByCustomerId(supplierId); - bmsCustomerMapper.deleteBmsCustomerCompanyByCustomerId(supplierId); + bmsSupplierMapper.deleteBmsSupplierAttachmentBySupplierId(supplierId); + bmsSupplierMapper.deleteBmsSupplierCompanyBySupplierId(supplierId); + bmsSupplierMapper.deleteBmsSupplierContactBySupplierId(supplierId); } return bmsSupplierMapper.deleteBmsSupplierBySupplierIds(supplierIds); } @Transactional(rollbackFor = Exception.class) @Override - public int deleteBmsSupplierBySupplierId(String supplierId) + public int deleteBmsSupplierBySupplierId(Long supplierId) { - bmsCustomerMapper.deleteBmsCustomerAttachmentByCustomerId(supplierId); - bmsCustomerMapper.deleteBmsCustomerCompanyByCustomerId(supplierId); + bmsSupplierMapper.deleteBmsSupplierAttachmentBySupplierId(supplierId); + bmsSupplierMapper.deleteBmsSupplierCompanyBySupplierId(supplierId); + bmsSupplierMapper.deleteBmsSupplierContactBySupplierId(supplierId); return bmsSupplierMapper.deleteBmsSupplierBySupplierId(supplierId); } } diff --git a/bms-back/ruoyi-system/src/main/resources/mapper/customer/BmsCustomerMapper.xml b/bms-back/ruoyi-system/src/main/resources/mapper/customer/BmsCustomerMapper.xml index c723f634..bafef326 100644 --- a/bms-back/ruoyi-system/src/main/resources/mapper/customer/BmsCustomerMapper.xml +++ b/bms-back/ruoyi-system/src/main/resources/mapper/customer/BmsCustomerMapper.xml @@ -68,9 +68,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - - where customer_id = #{customerId} + where customer_id = #{customerId} and del_flag = '0' @@ -161,21 +161,20 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" where attachment_id = #{attachmentId} - + update bms_customer_attachment set del_flag = '2' where customer_id = #{customerId} update bms_customer_attachment set del_flag = '2' where attachment_id in - + #{attachmentId} - + insert into bms_customer - customer_id, customer_code, customer_name, customer_code_dw, @@ -206,7 +205,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" del_flag, - #{customerId}, #{customerCode}, #{customerName}, #{customerCodeDw}, @@ -273,13 +271,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" where customer_id = #{customerId} - - delete from bms_customer where customer_id = #{customerId} + + update bms_customer set del_flag = '2' where customer_id = #{customerId} - - delete from bms_customer where customer_id in - + + update bms_customer set del_flag = '2' where customer_id in + #{customerId} @@ -463,11 +461,149 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" where company_id = #{companyId} - + update bms_customer_company set del_flag = '2' where customer_id = #{customerId} update bms_customer_company set del_flag = '2' where company_id = #{companyId} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + select contact_id, customer_id, contact_name, position, department, phone, landline, email, wechat, qq, country, province, city, district, contact_address, postal_code, is_default, contact_type, sort_order, remark, create_by, create_time, update_by, update_time, del_flag from bms_customer_contact + + + + + + + + insert into bms_customer_contact + + customer_id, + contact_name, + position, + department, + phone, + landline, + email, + wechat, + qq, + country, + province, + city, + district, + contact_address, + postal_code, + is_default, + contact_type, + sort_order, + remark, + create_by, + create_time, + del_flag, + + + #{customerId}, + #{contactName}, + #{position}, + #{department}, + #{phone}, + #{landline}, + #{email}, + #{wechat}, + #{qq}, + #{country}, + #{province}, + #{city}, + #{district}, + #{contactAddress}, + #{postalCode}, + #{isDefault}, + #{contactType}, + #{sortOrder}, + #{remark}, + #{createBy}, + #{createTime}, + #{delFlag}, + + + + + update bms_customer_contact + + customer_id = #{customerId}, + contact_name = #{contactName}, + position = #{position}, + department = #{department}, + phone = #{phone}, + landline = #{landline}, + email = #{email}, + wechat = #{wechat}, + qq = #{qq}, + country = #{country}, + province = #{province}, + city = #{city}, + district = #{district}, + contact_address = #{contactAddress}, + postal_code = #{postalCode}, + is_default = #{isDefault}, + contact_type = #{contactType}, + sort_order = #{sortOrder}, + remark = #{remark}, + update_by = #{updateBy}, + update_time = #{updateTime}, + + where contact_id = #{contactId} + + + + update bms_customer_contact set del_flag = '2' where customer_id = #{customerId} + + + + update bms_customer_contact set del_flag = '2' where contact_id = #{contactId} + \ No newline at end of file diff --git a/bms-back/ruoyi-system/src/main/resources/mapper/customer/BmsSupplierMapper.xml b/bms-back/ruoyi-system/src/main/resources/mapper/customer/BmsSupplierMapper.xml index fca4b333..46166698 100644 --- a/bms-back/ruoyi-system/src/main/resources/mapper/customer/BmsSupplierMapper.xml +++ b/bms-back/ruoyi-system/src/main/resources/mapper/customer/BmsSupplierMapper.xml @@ -61,15 +61,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - where supplier_id = #{supplierId} - + insert into bms_supplier - supplier_id, supplier_code, supplier_name, supplier_code_dw, @@ -100,7 +99,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" del_flag, - #{supplierId}, #{supplierCode}, #{supplierName}, #{supplierCodeDw}, @@ -167,15 +165,438 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" where supplier_id = #{supplierId} - + delete from bms_supplier where supplier_id = #{supplierId} - + delete from bms_supplier where supplier_id in #{supplierId} + + + + + + + + + + + + + + + + + + + + + + select attachment_id, supplier_id, file_name, file_path, file_size, file_type, file_extension, attachment_type, is_logo, sort_order, remark, create_by, create_time, update_by, update_time, del_flag from bms_supplier_attachment + + + + + + insert into bms_supplier_attachment + + supplier_id, + file_name, + file_path, + file_size, + file_type, + file_extension, + attachment_type, + is_logo, + sort_order, + remark, + create_by, + create_time, + del_flag, + + + #{supplierId}, + #{fileName}, + #{filePath}, + #{fileSize}, + #{fileType}, + #{fileExtension}, + #{attachmentType}, + #{isLogo}, + #{sortOrder}, + #{remark}, + #{createBy}, + #{createTime}, + #{delFlag}, + + + + + update bms_supplier_attachment + + supplier_id = #{supplierId}, + file_name = #{fileName}, + file_path = #{filePath}, + file_size = #{fileSize}, + file_type = #{fileType}, + file_extension = #{fileExtension}, + attachment_type = #{attachmentType}, + is_logo = #{isLogo}, + sort_order = #{sortOrder}, + remark = #{remark}, + update_by = #{updateBy}, + update_time = #{updateTime}, + + where attachment_id = #{attachmentId} + + + + update bms_supplier_attachment set del_flag = '2' where supplier_id = #{supplierId} + + + + update bms_supplier_attachment set del_flag = '2' where attachment_id = #{attachmentId} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + select company_id, supplier_id, company_name_full, english_name, credit_code, legal_person, legal_person_phone, legal_person_id_card, registered_capital, capital_currency, paid_in_capital, establish_date, business_term_start, business_term_end, business_term_permanent, registration_authority, registration_number, operating_status, business_scope, shareholders, employee_count, company_phone, company_fax, company_website, company_email, registered_province, registered_city, registered_district, registered_address_detail, business_license_oss_id, attachment_ids, remark, create_by, create_time, update_by, update_time, del_flag from bms_supplier_company + + + + + + + + insert into bms_supplier_company + + supplier_id, + company_name_full, + english_name, + credit_code, + legal_person, + legal_person_phone, + legal_person_id_card, + registered_capital, + capital_currency, + paid_in_capital, + establish_date, + business_term_start, + business_term_end, + business_term_permanent, + registration_authority, + registration_number, + operating_status, + business_scope, + shareholders, + employee_count, + company_phone, + company_fax, + company_website, + company_email, + registered_province, + registered_city, + registered_district, + registered_address_detail, + business_license_oss_id, + attachment_ids, + remark, + create_by, + create_time, + del_flag, + + + #{supplierId}, + #{companyNameFull}, + #{englishName}, + #{creditCode}, + #{legalPerson}, + #{legalPersonPhone}, + #{legalPersonIdCard}, + #{registeredCapital}, + #{capitalCurrency}, + #{paidInCapital}, + #{establishDate}, + #{businessTermStart}, + #{businessTermEnd}, + #{businessTermPermanent}, + #{registrationAuthority}, + #{registrationNumber}, + #{operatingStatus}, + #{businessScope}, + #{shareholders}, + #{employeeCount}, + #{companyPhone}, + #{companyFax}, + #{companyWebsite}, + #{companyEmail}, + #{registeredProvince}, + #{registeredCity}, + #{registeredDistrict}, + #{registeredAddressDetail}, + #{businessLicenseOssId}, + #{attachmentIds}, + #{remark}, + #{createBy}, + #{createTime}, + #{delFlag}, + + + + + update bms_supplier_company + + supplier_id = #{supplierId}, + company_name_full = #{companyNameFull}, + english_name = #{englishName}, + credit_code = #{creditCode}, + legal_person = #{legalPerson}, + legal_person_phone = #{legalPersonPhone}, + legal_person_id_card = #{legalPersonIdCard}, + registered_capital = #{registeredCapital}, + capital_currency = #{capitalCurrency}, + paid_in_capital = #{paidInCapital}, + establish_date = #{establishDate}, + business_term_start = #{businessTermStart}, + business_term_end = #{businessTermEnd}, + business_term_permanent = #{businessTermPermanent}, + registration_authority = #{registrationAuthority}, + registration_number = #{registrationNumber}, + operating_status = #{operatingStatus}, + business_scope = #{businessScope}, + shareholders = #{shareholders}, + employee_count = #{employeeCount}, + company_phone = #{companyPhone}, + company_fax = #{companyFax}, + company_website = #{companyWebsite}, + company_email = #{companyEmail}, + registered_province = #{registeredProvince}, + registered_city = #{registeredCity}, + registered_district = #{registeredDistrict}, + registered_address_detail = #{registeredAddressDetail}, + business_license_oss_id = #{businessLicenseOssId}, + attachment_ids = #{attachmentIds}, + remark = #{remark}, + update_by = #{updateBy}, + update_time = #{updateTime}, + + where company_id = #{companyId} + + + + update bms_supplier_company set del_flag = '2' where supplier_id = #{supplierId} + + + + update bms_supplier_company set del_flag = '2' where company_id = #{companyId} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + select contact_id, supplier_id, contact_name, position, department, phone, landline, email, wechat, qq, country, province, city, district, contact_address, postal_code, is_default, contact_type, sort_order, remark, create_by, create_time, update_by, update_time, del_flag from bms_supplier_contact + + + + + + + + insert into bms_supplier_contact + + supplier_id, + contact_name, + position, + department, + phone, + landline, + email, + wechat, + qq, + country, + province, + city, + district, + contact_address, + postal_code, + is_default, + contact_type, + sort_order, + remark, + create_by, + create_time, + del_flag, + + + #{supplierId}, + #{contactName}, + #{position}, + #{department}, + #{phone}, + #{landline}, + #{email}, + #{wechat}, + #{qq}, + #{country}, + #{province}, + #{city}, + #{district}, + #{contactAddress}, + #{postalCode}, + #{isDefault}, + #{contactType}, + #{sortOrder}, + #{remark}, + #{createBy}, + #{createTime}, + #{delFlag}, + + + + + update bms_supplier_contact + + supplier_id = #{supplierId}, + contact_name = #{contactName}, + position = #{position}, + department = #{department}, + phone = #{phone}, + landline = #{landline}, + email = #{email}, + wechat = #{wechat}, + qq = #{qq}, + country = #{country}, + province = #{province}, + city = #{city}, + district = #{district}, + contact_address = #{contactAddress}, + postal_code = #{postalCode}, + is_default = #{isDefault}, + contact_type = #{contactType}, + sort_order = #{sortOrder}, + remark = #{remark}, + update_by = #{updateBy}, + update_time = #{updateTime}, + + where contact_id = #{contactId} + + + + update bms_supplier_contact set del_flag = '2' where supplier_id = #{supplierId} + + + + update bms_supplier_contact set del_flag = '2' where contact_id = #{contactId} + + diff --git a/bms-front/src/views/customersuppliermanagement/customerinfo/index.vue b/bms-front/src/views/customersuppliermanagement/customerinfo/index.vue index 161aae1c..b6c2b5c6 100644 --- a/bms-front/src/views/customersuppliermanagement/customerinfo/index.vue +++ b/bms-front/src/views/customersuppliermanagement/customerinfo/index.vue @@ -8,6 +8,7 @@ clearable @keyup.enter="handleQuery" /> + - + + - + - + + + + + + @@ -198,6 +205,7 @@ + @@ -238,6 +246,25 @@ + + +
+ 新增联系人 +
+ + + + + + + + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 否 + 是 + + + + + + + + + + + + + + + + + @@ -602,7 +741,7 @@ import { listCustomer, getCustomer, delCustomer, addCustomer, updateCustomer } from "@/api/customersuppliermanagement/customerinfo/customer.js" import { listUser } from "@/api/system/user" import { getToken } from "@/utils/auth" - +// import customerSelect from "@/components/customerSelect/index.vue" const { proxy } = getCurrentInstance() @@ -796,6 +935,7 @@ function reset() { productIds: null, attachmentList: [], companyList: [], + contactList: [], remark: null, createBy: null, createTime: null, @@ -844,6 +984,9 @@ function handleUpdate(row) { if (!form.value.companyList) { form.value.companyList = [] } + if (!form.value.contactList) { + form.value.contactList = [] + } open.value = true title.value = "修改客户" }) @@ -1000,6 +1143,93 @@ function submitCompanyForm() { proxy.$modal.msgSuccess(companyEditingIndex.value >= 0 ? "修改成功" : "新增成功") } +/* ============ 联系人子表 ============ */ +const contactDialogVisible = ref(false) +const contactDialogTitle = ref("") +const contactForm = ref({}) +const contactEditingIndex = ref(-1) +const contactRules = { + contactName: [{ required: true, message: '联系人姓名不能为空', trigger: 'blur' }], + phone: [{ required: true, message: '手机号不能为空', trigger: 'blur' }] +} + +/** 重置联系人表单 */ +function resetContactForm() { + contactForm.value = { + contactId: null, + customerId: form.value.customerId || null, + contactName: '', + position: '', + department: '', + phone: '', + landline: '', + email: '', + wechat: '', + qq: '', + country: '中国', + province: '', + city: '', + district: '', + contactAddress: '', + postalCode: '', + isDefault: '0', + contactType: '0', + sortOrder: 0, + remark: '' + } + proxy.resetForm("contactRef") +} + +function getUserName(userId) { + if (!userId) return '' + const user = this.userOptions.find(u => String(u.userId) === String(userId)) + return user ? user.nickName : userId +} + +/** 新增联系人(本地子表,跟随主表一起提交) */ +function handleAddContact() { + resetContactForm() + contactEditingIndex.value = -1 + contactDialogTitle.value = "新增联系人" + contactDialogVisible.value = true +} + +/** 编辑联系人 */ +function handleEditContact(row, index) { + resetContactForm() + contactForm.value = { ...row } + contactEditingIndex.value = index + contactDialogTitle.value = "修改联系人" + contactDialogVisible.value = true +} + +/** 删除联系人(仅从子表移除;未入库的不调后端,已入库的在主表保存后由后端增量处理) */ +function handleDeleteContact(index) { + proxy.$modal.confirm('是否确认删除该条联系人记录?').then(() => { + form.value.contactList.splice(index, 1) + proxy.$modal.msgSuccess("删除成功") + }).catch(() => {}) +} + +/** 提交联系人表单(本地保存,跟随主表提交一起入库) */ +function submitContactForm() { + if (!contactForm.value.contactName) { + proxy.$modal.msgWarning("联系人姓名不能为空") + return + } + if (!Array.isArray(form.value.contactList)) { + form.value.contactList = [] + } + if (contactEditingIndex.value >= 0) { + form.value.contactList.splice(contactEditingIndex.value, 1, { ...contactForm.value }) + } else { + form.value.contactList.push({ ...contactForm.value }) + } + contactDialogVisible.value = false + proxy.$modal.msgSuccess(contactEditingIndex.value >= 0 ? "修改成功" : "新增成功") +} + + getUserList() getList() diff --git a/bms-front/src/views/customersuppliermanagement/supplierinfo/index.vue b/bms-front/src/views/customersuppliermanagement/supplierinfo/index.vue index 336e7470..c7e8de74 100644 --- a/bms-front/src/views/customersuppliermanagement/supplierinfo/index.vue +++ b/bms-front/src/views/customersuppliermanagement/supplierinfo/index.vue @@ -33,8 +33,8 @@ clearable @change="handleQuery" > - - + + @@ -101,7 +101,6 @@ plain icon="Plus" @click="handleAdd" - v-hasPermi="['customersupplier:supplierinfo:add']" >新增 @@ -143,7 +142,9 @@ - + + +