| | |
| | | } |
| | | } |
| | | |
| | | @PostMapping("/uploadByCommon") |
| | | public AjaxResult uploadByCommon(MultipartFile file, Integer type, Long id) { |
| | | try { |
| | | return AjaxResult.success(tempFileService.uploadByCommon(file, type,id)); |
| | | } catch (Exception e) { |
| | | return AjaxResult.error(e.getMessage()); |
| | | } |
| | | } |
| | | |
| | | @PostMapping("uploadFile") |
| | | public AjaxResult uploadFile(@RequestBody ProductRecordDto productRecordDto) { |
| | | try { |
| | |
| | | |
| | | public interface TempFileService { |
| | | TempFile uploadFile(MultipartFile file,Integer type) throws IOException; |
| | | |
| | | String uploadByCommon(MultipartFile file, Integer type, Long id) throws IOException; |
| | | } |
| | |
| | | import java.time.LocalDate; |
| | | import java.time.LocalDateTime; |
| | | import java.time.format.DateTimeFormatter; |
| | | import java.util.Collections; |
| | | import java.util.List; |
| | | import java.util.UUID; |
| | | |
| | |
| | | tempFileRecord.setExpireTime(LocalDateTime.now().plusHours(2)); // 2小时后过期 |
| | | tempFileRecord.setType(type); |
| | | tempFileMapper.insert(tempFileRecord); |
| | | |
| | | return tempFileRecord; |
| | | } |
| | | |
| | | @Override |
| | | public String uploadByCommon(MultipartFile file, Integer type, Long id) throws IOException{ |
| | | TempFile tempFile = uploadFile(file, type); |
| | | if (tempFile != null) { |
| | | migrateTempFilesToFormal(id, Collections.singletonList(tempFile.getTempId()), type); |
| | | return tempFile.getTempPath(); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | /** |
| | | * 将临时文件迁移到正式目录 |
| | | * |
| | |
| | | page.setSize(productRecordDtoIPage1.getTotal()); |
| | | IPage<ProductRecordDto> productRecordDtoIPage = productRecordMapper.productRecordPage(page, ticketRegistrationDto); |
| | | productRecordDtoIPage.getRecords().forEach(productRecordDto -> { |
| | | productRecordDto.setCommonFiles(commonFileMapper.selectList(new LambdaQueryWrapper<CommonFile>().eq(CommonFile::getCommonId, productRecordDto.getTicketRegistrationId()) |
| | | productRecordDto.setCommonFiles(commonFileMapper.selectList(new LambdaQueryWrapper<CommonFile>().eq(CommonFile::getCommonId, productRecordDto.getId()) |
| | | .eq(CommonFile::getType, FileNameType.PURCHASELEDGER.getValue()))); |
| | | }); |
| | | return productRecordDtoIPage; |
| | |
| | | pl.supplier_name, |
| | | pl.project_name, |
| | | pl.contract_amount, |
| | | sum(tr.invoice_amount)as receipt_payment_amount, |
| | | pl.contract_amount-sum(tr.invoice_amount) AS unReceipt_payment_amount, |
| | | IFNULL(sum(tr.invoice_amount),0) as receipt_payment_amount, |
| | | pl.contract_amount-IFNULL(sum(tr.invoice_amount),0) AS unReceipt_payment_amount, |
| | | pl.entry_date, |
| | | pl.execution_date, |
| | | pl.recorder_id, |