根据配置文件切换模板地址,下载地址
This commit is contained in:
parent
f995596733
commit
50caf7df97
@ -17,6 +17,12 @@
|
|||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-configuration-processor</artifactId>
|
||||||
|
<optional>true</optional>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
<!-- swagger2-->
|
<!-- swagger2-->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>io.springfox</groupId>
|
<groupId>io.springfox</groupId>
|
||||||
|
@ -0,0 +1,14 @@
|
|||||||
|
{
|
||||||
|
"properties": [
|
||||||
|
{
|
||||||
|
"name": "fantang.templatePath",
|
||||||
|
"type": "java.lang.String",
|
||||||
|
"description": "Description for spring.fantang.templatePath."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "fantang.fileWebUrl",
|
||||||
|
"type": "java.lang.String",
|
||||||
|
"description": "Description for spring.fantang.fileWebUrl."
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
@ -76,4 +76,8 @@ spring:
|
|||||||
# 连接池的最大数据库连接数
|
# 连接池的最大数据库连接数
|
||||||
max-active: 8
|
max-active: 8
|
||||||
# #连接池最大阻塞等待时间(使用负值表示没有限制)
|
# #连接池最大阻塞等待时间(使用负值表示没有限制)
|
||||||
max-wait: -1ms
|
max-wait: -1ms
|
||||||
|
|
||||||
|
fantang:
|
||||||
|
templatePath: Z:\\程序开发\\项目测试\\三院饭堂\\饭堂收费票据模板.pdf
|
||||||
|
fileWebUrl: http://127.0.0.1:9001/dev-api/
|
@ -76,4 +76,9 @@ spring:
|
|||||||
# 连接池的最大数据库连接数
|
# 连接池的最大数据库连接数
|
||||||
max-active: 8
|
max-active: 8
|
||||||
# #连接池最大阻塞等待时间(使用负值表示没有限制)
|
# #连接池最大阻塞等待时间(使用负值表示没有限制)
|
||||||
max-wait: -1ms
|
max-wait: -1ms
|
||||||
|
|
||||||
|
# 饭堂配置参数
|
||||||
|
fantang:
|
||||||
|
templatePath: /root/sanyuan/template/饭堂收费票据模板.pdf
|
||||||
|
fileWebUrl: http://8.135.81.183:8080/prod-api/
|
@ -18,6 +18,7 @@ import com.ruoyi.system.fantang.service.IFtPrepaymentDaoService;
|
|||||||
import com.ruoyi.system.fantang.utils.PdfUtils;
|
import com.ruoyi.system.fantang.utils.PdfUtils;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
@ -38,6 +39,11 @@ public class FtPrepaymentDaoController extends BaseController {
|
|||||||
|
|
||||||
private final IFtPrepaymentDaoService iFtPrepaymentDaoService;
|
private final IFtPrepaymentDaoService iFtPrepaymentDaoService;
|
||||||
|
|
||||||
|
@Value("${fantang.templatePath}")
|
||||||
|
private String templatePath;
|
||||||
|
|
||||||
|
@Value("${fantang.fileWebUrl}")
|
||||||
|
private String fileWebUrl;
|
||||||
|
|
||||||
@GetMapping("/getCountById/{patientId}")
|
@GetMapping("/getCountById/{patientId}")
|
||||||
public AjaxResult getCountById(@PathVariable("patientId") Long patientId) {
|
public AjaxResult getCountById(@PathVariable("patientId") Long patientId) {
|
||||||
@ -196,7 +202,7 @@ public class FtPrepaymentDaoController extends BaseController {
|
|||||||
|
|
||||||
// 模板路径
|
// 模板路径
|
||||||
// String templatePath = "F:\\pdfTemplate\\饭堂票据模板2.pdf";
|
// String templatePath = "F:\\pdfTemplate\\饭堂票据模板2.pdf";
|
||||||
String templatePath = "Z:\\程序开发\\项目测试\\三院饭堂\\饭堂收费票据模板.pdf";
|
// String templatePath = "Z:\\程序开发\\项目测试\\三院饭堂\\饭堂收费票据模板.pdf";
|
||||||
|
|
||||||
// 生成的新文件路径
|
// 生成的新文件路径
|
||||||
String outputPath = RuoYiConfig.getUploadPath() + "\\饭堂票据" + patientId + ".pdf";
|
String outputPath = RuoYiConfig.getUploadPath() + "\\饭堂票据" + patientId + ".pdf";
|
||||||
@ -206,7 +212,7 @@ public class FtPrepaymentDaoController extends BaseController {
|
|||||||
// 下载地址
|
// 下载地址
|
||||||
String downloadPath = "profile/upload/饭堂票据" + patientId + ".pdf";
|
String downloadPath = "profile/upload/饭堂票据" + patientId + ".pdf";
|
||||||
|
|
||||||
return AjaxResult.success(downloadPath);
|
return AjaxResult.success(fileWebUrl + downloadPath);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -283,7 +283,7 @@ export default {
|
|||||||
// 生成收据 pdf
|
// 生成收据 pdf
|
||||||
handleGenerateReceiptPdf(row) {
|
handleGenerateReceiptPdf(row) {
|
||||||
generateReceiptPdf(row).then(response => {
|
generateReceiptPdf(row).then(response => {
|
||||||
window.open("http://192.168.3.93:9001/dev-api/" + response.msg)
|
window.open(response.msg)
|
||||||
})
|
})
|
||||||
console.log(process.env);
|
console.log(process.env);
|
||||||
},
|
},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user