| | |
| | | productRecord.setSaleLedgerProjectId(salesLedgerProduct.getId()); |
| | | productRecord.setId(null); |
| | | productRecord.setType("2"); |
| | | insert = productRecordMapper.insert(productRecord); |
| | | insert += productRecordMapper.insert(productRecord); |
| | | } |
| | | if (insert <= 0) { |
| | | throw new RuntimeException("产品开票数都为0,请检查"); |
| | | } |
| | | } |
| | | if (insert <= 0) { |
| | | throw new RuntimeException("产品开票数都为0,请检查"); |
| | | } |
| | | } |
| | | // 迁移临时文件到正式目录 |
| | |
| | | |
| | | try { |
| | | // 执行文件迁移(使用原子操作确保安全性) |
| | | Files.move( |
| | | Paths.get(tempFile.getTempPath()), |
| | | formalFilePath, |
| | | StandardCopyOption.REPLACE_EXISTING, |
| | | StandardCopyOption.ATOMIC_MOVE |
| | | ); |
| | | // Files.move( |
| | | // Paths.get(tempFile.getTempPath()), |
| | | // formalFilePath, |
| | | // StandardCopyOption.REPLACE_EXISTING, |
| | | // StandardCopyOption.ATOMIC_MOVE |
| | | // ); |
| | | // 原子移动失败,使用复制+删除 |
| | | Files.copy(Paths.get(tempFile.getTempPath()), formalFilePath, StandardCopyOption.REPLACE_EXISTING); |
| | | Files.deleteIfExists(Paths.get(tempFile.getTempPath())); |
| | | log.info("文件迁移成功: {} -> {}", tempFile.getTempPath(), formalFilePath); |
| | | |
| | | // 更新文件记录(关联到业务ID) |
| | |
| | | ticketRegistrationIPage.setTotal(ticketRegistrationIPage.getRecords().size()); |
| | | } |
| | | } |
| | | ticketRegistrationIPage.getRecords().forEach(item -> { |
| | | // 已付款金额 == 待付款金额 |
| | | item.setStatusName(item.getPaymentAmountTotal().compareTo(item.getInvoiceAmount()) == 0 ? "已完成付款" : "未完成付款"); |
| | | }); |
| | | return ticketRegistrationIPage; |
| | | } |
| | | |