wujianwei
19 小时以前 2a658f5db16ec4ea269a9c27c06879b0c4252ead
tms/src/main/java/com/ruoyi/tms/service/impl/TmsCustomerInfoServiceImpl.java
@@ -19,6 +19,8 @@
import com.ruoyi.common.enums.DataSourceType;
import com.ruoyi.common.core.service.BaseService;
import com.ruoyi.cwgl.service.IBankAccountConfigService;
import com.ruoyi.cwgl.service.IInvoiceInfoService;
import com.ruoyi.tms.mapper.TmsCustomerInfoMapper;
import com.ruoyi.tms.domain.TmsCustomerInfo;
import com.ruoyi.tms.service.ITmsCustomerInfoService;
@@ -39,6 +41,12 @@
    private TmsCustomerInfoMapper tmsCustomerInfoMapper;
    @Autowired
    ISystemDataNoService systemDataNoService;
    @Autowired
    IInvoiceInfoService invoiceInfoService;
    @Autowired
    IBankAccountConfigService bankAccountConfigService;
    /**
     * 查询客户信息
@@ -109,7 +117,33 @@
    {
        tmsCustomerInfo.setCustomerCode(systemDataNoService.getNoByKey(SystemDataNoEnum.CUST));
        tmsCustomerInfo.setCreateTime(DateUtils.getNowDate());
        return tmsCustomerInfoMapper.insertTmsCustomerInfo(tmsCustomerInfo);
        // 保存客户信息
        int result = tmsCustomerInfoMapper.insertTmsCustomerInfo(tmsCustomerInfo);
        // 获取客户ID和客户名称
        Integer customerId = tmsCustomerInfo.getId();
        String customerName = tmsCustomerInfo.getCustomerFullName();
        // 保存发票信息列表
        if (tmsCustomerInfo.getInvoiceInfoList() != null && !tmsCustomerInfo.getInvoiceInfoList().isEmpty()) {
            tmsCustomerInfo.getInvoiceInfoList().forEach(invoiceInfo -> {
                invoiceInfo.setCustomerId(customerId);
                invoiceInfo.setCustomerName(customerName);
            });
            invoiceInfoService.insertInvoiceInfoBatch(tmsCustomerInfo.getInvoiceInfoList());
        }
        // 保存银行账号配置列表
        if (tmsCustomerInfo.getBankAccountConfigList() != null && !tmsCustomerInfo.getBankAccountConfigList().isEmpty()) {
            tmsCustomerInfo.getBankAccountConfigList().forEach(bankAccountConfig -> {
                bankAccountConfig.setCustomerId(customerId);
                bankAccountConfig.setCustomerName(customerName);
            });
            bankAccountConfigService.insertBankAccountConfigBatch(tmsCustomerInfo.getBankAccountConfigList());
        }
        return result;
    }
    /**