Commit ec22bd72 authored by KeYong's avatar KeYong

更新登记证接口返回值

parent 8c98492b
......@@ -21,6 +21,7 @@ import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import javax.servlet.http.HttpServletRequest;
import java.io.File;
import java.util.*;
/**
......@@ -159,7 +160,7 @@ public class JgTransferNoticeController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "特种设备登记证导出", notes = "特种设备登记证导出")
@GetMapping(value = "/certificate/report")
public ResponseModel<String> generateCertificateReport() {
public ResponseModel<File> generateCertificateReport() {
Map<String, Object> map = new HashMap<>();
// 组装模板变量
map.put("useRegistrationCode", "20231225123"); // 编号
......
......@@ -3,6 +3,7 @@ package com.yeejoin.amos.boot.module.jg.biz.service;
import com.yeejoin.amos.boot.module.ymt.api.entity.EquipmentCategory;
import java.io.File;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
......@@ -33,5 +34,5 @@ public interface ICommonService {
List<Map<String,Object>> getEnterpriseEmployee(String unitCode);
String generateCertificateReport(Map<String, Object> map);
File generateCertificateReport(Map<String, Object> map);
}
......@@ -286,7 +286,7 @@ public class CommonServiceImpl implements ICommonService {
}
@Override
public String generateCertificateReport(Map<String, Object> map) {
public File generateCertificateReport(Map<String, Object> map) {
if (CollectionUtils.isEmpty(map)) {
throw new IllegalArgumentException("参数不能为空");
}
......@@ -316,16 +316,16 @@ public class CommonServiceImpl implements ICommonService {
throw new RuntimeException(e);
}
// 上传pdf至文件服务器
String url = this.uploadFile(pdfFile);
// // 上传pdf至文件服务器
// String url = this.uploadFile(pdfFile);
// 删除临时文件
try {
Files.deleteIfExists(pdfFile.toPath());
} catch (IOException e) {
log.error("删除临时文件失败:{}", e);
}
return url;
// try {
// Files.deleteIfExists(pdfFile.toPath());
// } catch (IOException e) {
// log.error("删除临时文件失败:{}", e);
// }
return pdfFile;
}
/**
......@@ -336,7 +336,7 @@ public class CommonServiceImpl implements ICommonService {
private File wordToPdf(String wordPath, Map<String, Object> placeholders) throws Exception {
Assert.hasText(wordPath, "word文件路径不能为空");
String tempFileName = "移装告知单_" + System.currentTimeMillis() + "_temp.pdf";
String tempFileName = "特种设备使用登记证_" + System.currentTimeMillis() + "_temp.pdf";
WordTemplateUtils instance = WordTemplateUtils.getInstance();
......
......@@ -1915,7 +1915,7 @@
<w:sz w:val="31"/>
<w:sz-cs w:val="31"/>
</w:rPr>
<w:t></w:t>
<w:t> </w:t>
</w:r>
<w:r>
<w:rPr>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment