修改Auth有效时间,方便开发,
修改下载下来的pdf存放路径为服务器路径, 修改给用户开发票方法,为其增加发送发票记录时间
This commit is contained in:
parent
29de3d6a8f
commit
dca4ddc639
@ -37,7 +37,7 @@ public class AuthFilter implements GlobalFilter, Ordered {
|
|||||||
|
|
||||||
private static final Logger log = LoggerFactory.getLogger(AuthFilter.class);
|
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自行添加
|
// 排除过滤的 uri 地址,nacos自行添加
|
||||||
@Autowired
|
@Autowired
|
||||||
|
|||||||
@ -66,7 +66,6 @@ public class XhpcInvoiceController extends BaseController {
|
|||||||
* @date 2021/12/29 16:40
|
* @date 2021/12/29 16:40
|
||||||
* @since version-1.0
|
* @since version-1.0
|
||||||
*/
|
*/
|
||||||
@Log(title = "电子发票上传", businessType = BusinessType.INSERT)
|
|
||||||
@PostMapping("/pdf")
|
@PostMapping("/pdf")
|
||||||
public AjaxResult uploadPdf(MultipartFile invoicePdf) throws IOException {
|
public AjaxResult uploadPdf(MultipartFile invoicePdf) throws IOException {
|
||||||
|
|
||||||
@ -93,6 +92,9 @@ public class XhpcInvoiceController extends BaseController {
|
|||||||
@Log(title = "用户提交发票状态", businessType = BusinessType.UPDATE)
|
@Log(title = "用户提交发票状态", businessType = BusinessType.UPDATE)
|
||||||
@PatchMapping()
|
@PatchMapping()
|
||||||
public AjaxResult invoiceToUser(@RequestBody InvoiceToUserRequest requestData) {
|
public AjaxResult invoiceToUser(@RequestBody InvoiceToUserRequest requestData) {
|
||||||
|
|
||||||
|
System.out.println("进入方法");
|
||||||
|
long start = System.currentTimeMillis();
|
||||||
//前置条件
|
//前置条件
|
||||||
if (requestData.getInvoiceId() == null) {
|
if (requestData.getInvoiceId() == null) {
|
||||||
return AjaxResult.error("必须上传发票id");
|
return AjaxResult.error("必须上传发票id");
|
||||||
@ -120,6 +122,9 @@ public class XhpcInvoiceController extends BaseController {
|
|||||||
return AjaxResult.error(e.getMessage());
|
return AjaxResult.error(e.getMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
long end = System.currentTimeMillis();
|
||||||
|
System.out.println("方法执行时间");
|
||||||
|
System.out.println(end - start);
|
||||||
return AjaxResult.success();
|
return AjaxResult.success();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -143,12 +143,20 @@ public class XhpcInvoiceServiceImpl implements XhpcInvoiceService {
|
|||||||
//参数1 文件下载路径
|
//参数1 文件下载路径
|
||||||
//参数2 文件存放位置
|
//参数2 文件存放位置
|
||||||
//服务器响应404 表示服务器找不到客户端所请求的资源
|
//服务器响应404 表示服务器找不到客户端所请求的资源
|
||||||
|
System.out.println("下载文件");
|
||||||
|
long start = System.currentTimeMillis();
|
||||||
HttpUtil.downloadFile(fileUrl, electricInvoiceFile);
|
HttpUtil.downloadFile(fileUrl, electricInvoiceFile);
|
||||||
|
long end = System.currentTimeMillis();
|
||||||
|
System.out.println(end - start);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
throw new RuntimeException("在阿里云上无法找到该文件,请检查上传的图片路径是否完整或有误");
|
throw new RuntimeException("在阿里云上无法找到该文件,请检查上传的图片路径是否完整或有误");
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
|
System.out.println("发送邮件");
|
||||||
|
long start = System.currentTimeMillis();
|
||||||
MailUtil.send(receiveEmail, "【小华充电】电子发票", "邮件来自小华充电", false, electricInvoiceFile);
|
MailUtil.send(receiveEmail, "【小华充电】电子发票", "邮件来自小华充电", false, electricInvoiceFile);
|
||||||
|
long end = System.currentTimeMillis();
|
||||||
|
System.out.println(end - start);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
System.out.println(e.getMessage());
|
System.out.println(e.getMessage());
|
||||||
return Boolean.FALSE;
|
return Boolean.FALSE;
|
||||||
|
|||||||
@ -37,5 +37,5 @@ oss:
|
|||||||
#文件路径
|
#文件路径
|
||||||
file:
|
file:
|
||||||
aliyunPath: invoicePdf/
|
aliyunPath: invoicePdf/
|
||||||
# serverStoreDisposableFileLocation: /www/wwwroot/xhpc.scxhua.com/disposableFiles/
|
serverStoreDisposableFileLocation: /www/wwwroot/xhpc.scxhua.com/disposableFiles/
|
||||||
serverStoreDisposableFileLocation: C:\\www\\wwwroot\\xhpc.scxhua.com\\disposableFiles\\
|
# serverStoreDisposableFileLocation: C:\\www\\wwwroot\\xhpc.scxhua.com\\disposableFiles\\
|
||||||
Loading…
x
Reference in New Issue
Block a user