生成pdf路径修改
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
parent
1f8158549e
commit
e063d68d86
@ -0,0 +1,63 @@
|
||||
package com.ruoyi.flyingbook.LarkHelper.script;
|
||||
|
||||
import com.lark.oapi.service.bitable.v1.model.AppTableRecord;
|
||||
import com.lark.oapi.service.bitable.v1.model.GetAppTableRecordResp;
|
||||
import com.ruoyi.common.core.domain.PdfEntity;
|
||||
import com.ruoyi.common.utils.PdfUtils;
|
||||
import com.ruoyi.flyingbook.domain.RequestVo;
|
||||
import com.ruoyi.flyingbook.domain.template.CourseFeedbackTemplateDto;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author yuxiangyong
|
||||
* @create 2023-05-31 22:26
|
||||
*/
|
||||
@Component
|
||||
public class LarkCreatePdfHelper {
|
||||
|
||||
@Value("${pdf.generate.path}")
|
||||
private String pdfGeneratePath;
|
||||
|
||||
@Autowired
|
||||
private PdfUtils pdfUtils;
|
||||
|
||||
|
||||
public void createAndUpload(RequestVo request){
|
||||
PdfEntity entity = new PdfEntity();
|
||||
// GetAppTableRecordResp respBody = request.getRespBody();
|
||||
// AppTableRecord record = respBody.getData().getRecord();
|
||||
// CourseFeedbackTemplateDto data = build(record.getFields());
|
||||
String pdfAllPath = new StringBuilder(pdfGeneratePath).append("pdf\\test1.pdf").toString();
|
||||
String pdfWatermarkingAllPath = new StringBuilder(pdfGeneratePath).append("pdf\\test2.pdf").toString();
|
||||
entity.setPdfAllPath(pdfAllPath);
|
||||
entity.setPdfWatermarkingAllPath(pdfWatermarkingAllPath);
|
||||
entity.setTitlePicAllPath(new StringBuilder(pdfGeneratePath).append("photo\\title.jpg").toString());
|
||||
entity.setTemplatePath(new StringBuilder(pdfGeneratePath).append("template").toString());
|
||||
entity.setFontAllPath(new StringBuilder(pdfGeneratePath).append("font\\simsun.ttc").toString());
|
||||
entity.setWatermarkingPickAllPath(new StringBuilder(pdfGeneratePath).append("photo\\watermark.jpg").toString());
|
||||
entity.setData(build(null));
|
||||
entity.setTemplateName("COURSE_FEEDBACK.ftl");
|
||||
pdfUtils.createFile(entity);
|
||||
}
|
||||
|
||||
private CourseFeedbackTemplateDto build(Map<String, Object> fields){
|
||||
CourseFeedbackTemplateDto resultDTO = new CourseFeedbackTemplateDto();
|
||||
resultDTO.setProgram("program");
|
||||
resultDTO.setStudentName("student");
|
||||
resultDTO.setTutor("tutor");
|
||||
resultDTO.setStartClassTime("2023-05-21 15:51:45");
|
||||
resultDTO.setEndClassTime("2023-05-22 15:51:45");
|
||||
resultDTO.setFeedback("作业完成情况");
|
||||
resultDTO.setFeedbackScore("7 /10");
|
||||
resultDTO.setPerformance("课堂表现");
|
||||
resultDTO.setPerformanceScore("9/10");
|
||||
resultDTO.setContent("<p>1、课堂内容1</p><p>1、课堂内容2</p>");
|
||||
resultDTO.setWork("<p>1、课后作业1</p><p>1、课后作业2</p><p>1、课后作业3</p>");
|
||||
return resultDTO;
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in new issue