maven
昨天 6aca42d916c27bc2f06f6e44832661b7210444d0
yys  来票登记修改
已修改5个文件
29 ■■■■ 文件已修改
src/main/java/com/ruoyi/other/controller/TempFileController.java 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/other/service/TempFileService.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/other/service/impl/TempFileServiceImpl.java 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/purchase/service/impl/ProductRecordServiceImpl.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/purchase/PurchaseLedgerMapper.xml 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/other/controller/TempFileController.java
@@ -33,6 +33,15 @@
        }
    }
    @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 {
src/main/java/com/ruoyi/other/service/TempFileService.java
@@ -7,4 +7,6 @@
public interface TempFileService {
    TempFile uploadFile(MultipartFile file,Integer type) throws IOException;
    String uploadByCommon(MultipartFile file, Integer type, Long id) throws IOException;
}
src/main/java/com/ruoyi/other/service/impl/TempFileServiceImpl.java
@@ -26,6 +26,7 @@
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;
@@ -76,10 +77,19 @@
        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;
    }
    /**
     * 将临时文件迁移到正式目录
     *
src/main/java/com/ruoyi/purchase/service/impl/ProductRecordServiceImpl.java
@@ -66,7 +66,7 @@
        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;
src/main/resources/mapper/purchase/PurchaseLedgerMapper.xml
@@ -18,8 +18,8 @@
        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,