zss
8 天以前 51ec98113c6d49d0f7eec4e3c030e55e337e97db
cnas-manage/src/main/java/com/yuanchu/mom/service/impl/ManageRecordTotalServiceImpl.java
@@ -43,7 +43,7 @@
 * 外来文件确认记录总历史记录表 服务实现类
 * </p>
 *
 * @author 芯导软件(江苏)有限公司
 * @author
 * @since 2024-11-12 10:30:08
 */
@Service
@@ -123,18 +123,7 @@
    private String recordTotaldeal(Integer id,String signatureUrl){
        List<ManageRecordVerify> manageRecordVerifies = manageRecordVerifyMapper.selectList(Wrappers.<ManageRecordVerify>lambdaQuery().eq(ManageRecordVerify::getManageRecordTotalId,id));
        String url;
        try {
            InputStream inputStream = this.getClass().getResourceAsStream("/static/verify-deal.docx");
            File file = File.createTempFile("temp", ".tmp");
            OutputStream outputStream = new FileOutputStream(file);
            IOUtils.copy(inputStream, outputStream);
            url = file.getAbsolutePath();
        } catch (FileNotFoundException e) {
            throw new ErrorException("找不到模板文件");
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
        InputStream inputStream = this.getClass().getResourceAsStream("/static/verify-deal.docx");
        ConfigureBuilder builder = Configure.builder();
        builder.useSpringEL(true);
        String[] monthNames = {"January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"};
@@ -366,16 +355,13 @@
                tableRenderData.setTableStyle(tableStyle);
                Map<String, Object> table = new HashMap<>();
                table.put("verify", tableRenderData);
                table.put("index1", index1);
                verifyList.add(table);
                index1++;
            }
        }
        Integer finalIndex = index1;
        XWPFTemplate template = XWPFTemplate.compile(url, builder.build()).render(
        XWPFTemplate template = XWPFTemplate.compile(inputStream, builder.build()).render(
                new HashMap<String, Object>() {{
                    put("verifyList", verifyList);
                    put("size", finalIndex);
                    put("submitDate", LocalDate.now().format(DateTimeFormatter.ofPattern("yyyy年MM月dd日")));
                    put("submitDateEn", monthNames[LocalDate.now().getMonthValue() - 1] + " " + LocalDate.now().getDayOfMonth() + ", " + LocalDate.now().getYear());
                    put("ratifyDate", "{{ratifyDate}}");