图书详细信息返回结果添加图书类型

This commit is contained in:
wuchunlei
2024-01-10 16:11:22 +08:00
parent bab3941807
commit 9745cbfefe
2 changed files with 23 additions and 10 deletions

View File

@@ -8,6 +8,7 @@ import java.io.File;
import java.io.FileReader; import java.io.FileReader;
import java.io.IOException; import java.io.IOException;
import java.util.Date; import java.util.Date;
import java.util.UUID;
import java.util.concurrent.ExecutorService; import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors; import java.util.concurrent.Executors;
@@ -44,8 +45,7 @@ public class CertificateUtil extends Thread{
@Override @Override
public void run() { public void run() {
Date startTime = new Date(); // System.out.println(name+"-开始!");
System.out.println(name+"-开始!");
try { try {
Image src = ImageIO.read(new File(inputSrc)); Image src = ImageIO.read(new File(inputSrc));
// 获取图片的高和宽 // 获取图片的高和宽
@@ -107,12 +107,11 @@ public class CertificateUtil extends Thread{
// 释放资源 // 释放资源
g.dispose(); g.dispose();
File outputfile = new File(outputSrc+name+".png"); String filename = UUID.randomUUID().toString() + System.currentTimeMillis();
ImageIO.write(image, "png", outputfile); File outputfile = new File(outputSrc+ filename +".jpg");
ImageIO.write(image, "jpg", outputfile);
Date endTime = new Date(); System.out.println(no +","+ name +","+ filename);
System.out.println(endTime.getTime()-startTime.getTime() + "");
System.out.println(name+"-生成完成!");
} catch (IOException e) { } catch (IOException e) {
throw new RuntimeException(e); throw new RuntimeException(e);
} }
@@ -128,8 +127,8 @@ public class CertificateUtil extends Thread{
String time = "于2024年1月4日至5日"; String time = "于2024年1月4日至5日";
String des = "圆满完成中医形质病学培训班"; String des = "圆满完成中医形质病学培训班";
String trans = "Successful completion of the"; String trans = "Successful completion of the";
String trans2 = "Chinese Medicine Morphology and Disease Training"; String trans2 = "Training course on TCM somatology";
String trans3 = "course on 2024 1.4-5"; String trans3 = "on 2024.01.04-05";
//Traditional Chinese Medicine Morphology and Disease Training Course //Traditional Chinese Medicine Morphology and Disease Training Course
String endy = "2024"; String endy = "2024";
String endm = "1"; String endm = "1";

View File

@@ -114,7 +114,21 @@ public class BookController {
// @RequiresPermissions("book:book:info") // @RequiresPermissions("book:book:info")
public R info(@PathVariable("id") Integer id) { public R info(@PathVariable("id") Integer id) {
BookEntity book = bookService.getById(id); BookEntity book = bookService.getById(id);
//返回结果添加图书类型
LambdaQueryWrapper<MedicaldesBook> wrapper = new LambdaQueryWrapper();
wrapper.eq(MedicaldesBook::getBookId,id);
List<MedicaldesBook> list = medicaldesBookService.list(wrapper);
if (list.size() > 0) {
String type = "";
for (MedicaldesBook mb : list) {
if (StringUtils.isEmpty(type)){
type += mb.getTypeId();
}else {
type += "," + mb.getTypeId();
}
}
book.setMedicaldesBookType(type);
}
return R.ok().put("book", book); return R.ok().put("book", book);
} }