发票-用户未读数量加上租户id

This commit is contained in:
wenhui 2022-03-17 14:12:41 +08:00
parent 96c7535ddc
commit eb68057911
2 changed files with 2 additions and 15 deletions

View File

@ -91,9 +91,6 @@ 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");
@ -121,9 +118,6 @@ 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();
}

View File

@ -152,20 +152,12 @@ 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;
@ -465,7 +457,8 @@ public class XhpcInvoiceServiceImpl implements XhpcInvoiceService {
*/
private String generateRedisKey(XhpcInvoice xhpcInvoice) {
String redisKey = "global:invoice:";
String tenantId = tokenService.getLoginUser().getSysUser().getTenantId();
String redisKey = "global:invoice:" + tenantId + ":";
switch (xhpcInvoice.getCreatorType()) {
case 0:
redisKey = redisKey + "C" + xhpcInvoice.getCreatorId();