maven
16 小时以前 3b3972409a7385e0337d2c78ff60c9fb4fb72e3f
src/main/java/com/ruoyi/staff/service/impl/StaffOnJobServiceImpl.java
@@ -19,6 +19,7 @@
import lombok.AllArgsConstructor;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;
@@ -82,11 +83,12 @@
        }
    }
    @Override
    public String exportCopy(HttpServletResponse response, StaffOnJob staffOnJob) throws Exception {
        String url = "D:\\files\\张三-劳动合同2024.docx";
        String url = "/javaWork/product-inventory-management/file/prod/" + staffOnJob.getStaffName() + "-劳动合同书.docx";
        Configuration cfg = new Configuration(Configuration.VERSION_2_3_32);
        // 设置模板文件所在目录(绝对路径,例如:D:/templates/)
        // 设置模板文件所在目录(绝对路径,例如:/templates/)
        cfg.setClassForTemplateLoading(StaffOnJobServiceImpl.class, "/static");
        cfg.setDefaultEncoding("UTF-8");
        //2.定义需要填充的变里