| | |
| | | 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; |
| | |
| | | private TmsCustomerInfoMapper tmsCustomerInfoMapper; |
| | | @Autowired |
| | | ISystemDataNoService systemDataNoService; |
| | | |
| | | @Autowired |
| | | IInvoiceInfoService invoiceInfoService; |
| | | |
| | | @Autowired |
| | | IBankAccountConfigService bankAccountConfigService; |
| | | |
| | | /** |
| | | * 查询客户信息 |
| | |
| | | { |
| | | 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; |
| | | } |
| | | |
| | | /** |