zhuo
2025-02-28 bb120c51ecba1bb4a16224352a6e8f620fdff79f
inspect-server/src/main/java/com/ruoyi/inspect/service/impl/InsReportServiceImpl.java
@@ -36,6 +36,7 @@
import com.ruoyi.inspect.mapper.InsUnqualifiedHandlerMapper;
import com.ruoyi.system.mapper.UserMapper;
import com.ruoyi.system.service.InformationNotificationService;
import lombok.extern.slf4j.Slf4j;
import org.apache.poi.xwpf.usermodel.*;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
@@ -65,6 +66,7 @@
 * @createDate 2024-03-17 22:10:02
 */
@Service
@Slf4j
public class InsReportServiceImpl extends ServiceImpl<InsReportMapper, InsReport>
        implements InsReportService {
    @Resource
@@ -540,7 +542,6 @@
            // 清理临时文件夹
            deleteDirectory(tempFolder);
            System.out.println("ZIP文件创建完成!");
        } catch (IOException e) {
            e.printStackTrace();
        }
@@ -675,13 +676,11 @@
        FileOutputStream os = null;
        try {
            //凭证 不然切换后有水印
//            InputStream is = this.getClass().getResourceAsStream("/lib/license.xml");
//            InputStream is = Thread.currentThread().getContextClassLoader().getResourceAsStream("license.xml");
            InputStream is = Files.newInputStream(new File(licenseUrl).toPath());
            License license = new License();
            license.setLicense(is);
            if (!license.getIsLicensed()) {
                System.out.println("License验证不通过...");
                log.info("License验证不通过...");
                return null;
            }
            //生成一个空的PDF文件
@@ -1120,7 +1119,7 @@
            License license = new License();
            license.setLicense(is);
            if (!license.getIsLicensed()) {
                System.out.println("License验证不通过...");
                log.info("License验证不通过...");
                return null;
            }
            //生成一个空的PDF文件
@@ -1131,7 +1130,6 @@
            //要转换的word文件
            com.aspose.words.Document doc = new com.aspose.words.Document(wordPath);
            doc.save(os, SaveFormat.PDF);
            String name = file.getName();
            return file.getName();
        } catch (Exception e) {
            e.printStackTrace();