| | |
| | | if (CollectionUtils.isNotEmpty(salesLedgerProducts)) { |
| | | for (SalesLedgerProduct salesLedgerProduct : salesLedgerProducts) { |
| | | ProductRecord productRecord = new ProductRecord(); |
| | | |
| | | productRecord.setTicketRegistrationId(ticketRegistration.getId()); |
| | | productRecord.setPurchaseLedgerId(ticketRegistrationDto.getPurchaseLedgerId()); |
| | | productRecord.setCreatedAt(DateUtils.getNowDate()); |
| | | BeanUtils.copyProperties(salesLedgerProduct, productRecord); |
| | | productRecord.setSaleLedgerProjectId(salesLedgerProduct.getId()); |
| | | productRecord.setId(null); |
| | | productRecord.setType("2"); |
| | | productRecordMapper.insert(productRecord); |
| | |
| | | // 构建正式文件名(包含业务ID和时间戳,避免冲突) |
| | | String originalFilename = tempFile.getOriginalName(); |
| | | String fileExtension = FilenameUtils.getExtension(originalFilename); |
| | | String baseName = FilenameUtils.getBaseName(originalFilename); |
| | | String formalFilename = businessId + "_" + |
| | | System.currentTimeMillis() + "_" + |
| | | UUID.randomUUID().toString().substring(0, 8) + |
| | | UUID.randomUUID().toString().substring(0, 8) +baseName+ |
| | | (com.ruoyi.common.utils.StringUtils.hasText(fileExtension) ? "." + fileExtension : ""); |
| | | |
| | | Path formalFilePath = formalDirPath.resolve(formalFilename); |