From dca4ddc639b978f06f106bde6f31c2df2f8738d4 Mon Sep 17 00:00:00 2001 From: wen <1455474577@qq.com> Date: Tue, 18 Jan 2022 16:30:10 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9Auth=E6=9C=89=E6=95=88?= =?UTF-8?q?=E6=97=B6=E9=97=B4=EF=BC=8C=E6=96=B9=E4=BE=BF=E5=BC=80=E5=8F=91?= =?UTF-8?q?=EF=BC=8C=20=E4=BF=AE=E6=94=B9=E4=B8=8B=E8=BD=BD=E4=B8=8B?= =?UTF-8?q?=E6=9D=A5=E7=9A=84pdf=E5=AD=98=E6=94=BE=E8=B7=AF=E5=BE=84?= =?UTF-8?q?=E4=B8=BA=E6=9C=8D=E5=8A=A1=E5=99=A8=E8=B7=AF=E5=BE=84=EF=BC=8C?= =?UTF-8?q?=20=E4=BF=AE=E6=94=B9=E7=BB=99=E7=94=A8=E6=88=B7=E5=BC=80?= =?UTF-8?q?=E5=8F=91=E7=A5=A8=E6=96=B9=E6=B3=95=EF=BC=8C=E4=B8=BA=E5=85=B6?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=8F=91=E9=80=81=E5=8F=91=E7=A5=A8=E8=AE=B0?= =?UTF-8?q?=E5=BD=95=E6=97=B6=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/xhpc/gateway/filter/AuthFilter.java | 2 +- .../xhpc/invoice/controller/XhpcInvoiceController.java | 7 ++++++- .../xhpc/invoice/service/impl/XhpcInvoiceServiceImpl.java | 8 ++++++++ .../xhpc-invoice/src/main/resources/bootstrap.yml | 4 ++-- 4 files changed, 17 insertions(+), 4 deletions(-) diff --git a/ruoyi-gateway/src/main/java/com/xhpc/gateway/filter/AuthFilter.java b/ruoyi-gateway/src/main/java/com/xhpc/gateway/filter/AuthFilter.java index 8f9d1a46..3db86bf3 100644 --- a/ruoyi-gateway/src/main/java/com/xhpc/gateway/filter/AuthFilter.java +++ b/ruoyi-gateway/src/main/java/com/xhpc/gateway/filter/AuthFilter.java @@ -37,7 +37,7 @@ public class AuthFilter implements GlobalFilter, Ordered { private static final Logger log = LoggerFactory.getLogger(AuthFilter.class); - private final static long EXPIRE_TIME = Constants.TOKEN_EXPIRE * 600; + private final static long EXPIRE_TIME = Constants.TOKEN_EXPIRE * 600000; // 排除过滤的 uri 地址,nacos自行添加 @Autowired diff --git a/xhpc-modules/xhpc-invoice/src/main/java/com/xhpc/invoice/controller/XhpcInvoiceController.java b/xhpc-modules/xhpc-invoice/src/main/java/com/xhpc/invoice/controller/XhpcInvoiceController.java index ed1b7f29..f9fd80b2 100644 --- a/xhpc-modules/xhpc-invoice/src/main/java/com/xhpc/invoice/controller/XhpcInvoiceController.java +++ b/xhpc-modules/xhpc-invoice/src/main/java/com/xhpc/invoice/controller/XhpcInvoiceController.java @@ -66,7 +66,6 @@ public class XhpcInvoiceController extends BaseController { * @date 2021/12/29 16:40 * @since version-1.0 */ - @Log(title = "电子发票上传", businessType = BusinessType.INSERT) @PostMapping("/pdf") public AjaxResult uploadPdf(MultipartFile invoicePdf) throws IOException { @@ -93,6 +92,9 @@ public class XhpcInvoiceController extends BaseController { @Log(title = "用户提交发票状态", businessType = BusinessType.UPDATE) @PatchMapping() public AjaxResult invoiceToUser(@RequestBody InvoiceToUserRequest requestData) { + + System.out.println("进入方法"); + long start = System.currentTimeMillis(); //前置条件 if (requestData.getInvoiceId() == null) { return AjaxResult.error("必须上传发票id"); @@ -120,6 +122,9 @@ public class XhpcInvoiceController extends BaseController { return AjaxResult.error(e.getMessage()); } } + long end = System.currentTimeMillis(); + System.out.println("方法执行时间"); + System.out.println(end - start); return AjaxResult.success(); } diff --git a/xhpc-modules/xhpc-invoice/src/main/java/com/xhpc/invoice/service/impl/XhpcInvoiceServiceImpl.java b/xhpc-modules/xhpc-invoice/src/main/java/com/xhpc/invoice/service/impl/XhpcInvoiceServiceImpl.java index b27b1735..f6ddb1c5 100644 --- a/xhpc-modules/xhpc-invoice/src/main/java/com/xhpc/invoice/service/impl/XhpcInvoiceServiceImpl.java +++ b/xhpc-modules/xhpc-invoice/src/main/java/com/xhpc/invoice/service/impl/XhpcInvoiceServiceImpl.java @@ -143,12 +143,20 @@ public class XhpcInvoiceServiceImpl implements XhpcInvoiceService { //参数1 文件下载路径 //参数2 文件存放位置 //服务器响应404 表示服务器找不到客户端所请求的资源 + System.out.println("下载文件"); + long start = System.currentTimeMillis(); HttpUtil.downloadFile(fileUrl, electricInvoiceFile); + long end = System.currentTimeMillis(); + System.out.println(end - start); } catch (Exception e) { throw new RuntimeException("在阿里云上无法找到该文件,请检查上传的图片路径是否完整或有误"); } try { + System.out.println("发送邮件"); + long start = System.currentTimeMillis(); MailUtil.send(receiveEmail, "【小华充电】电子发票", "邮件来自小华充电", false, electricInvoiceFile); + long end = System.currentTimeMillis(); + System.out.println(end - start); } catch (Exception e) { System.out.println(e.getMessage()); return Boolean.FALSE; diff --git a/xhpc-modules/xhpc-invoice/src/main/resources/bootstrap.yml b/xhpc-modules/xhpc-invoice/src/main/resources/bootstrap.yml index adcb25c9..fdb63184 100644 --- a/xhpc-modules/xhpc-invoice/src/main/resources/bootstrap.yml +++ b/xhpc-modules/xhpc-invoice/src/main/resources/bootstrap.yml @@ -37,5 +37,5 @@ oss: #文件路径 file: aliyunPath: invoicePdf/ - # serverStoreDisposableFileLocation: /www/wwwroot/xhpc.scxhua.com/disposableFiles/ - serverStoreDisposableFileLocation: C:\\www\\wwwroot\\xhpc.scxhua.com\\disposableFiles\\ \ No newline at end of file + serverStoreDisposableFileLocation: /www/wwwroot/xhpc.scxhua.com/disposableFiles/ +# serverStoreDisposableFileLocation: C:\\www\\wwwroot\\xhpc.scxhua.com\\disposableFiles\\ \ No newline at end of file