update
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package com.mgm.mcrm.notification.services;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.mgm.mcrm.approval.repositories.ApprovalRoutingDao;
|
||||
import com.mgm.mcrm.authorization.models.SysRouterPermission;
|
||||
import com.mgm.mcrm.authorization.services.SysGroupPermissionService;
|
||||
import com.mgm.mcrm.basesetting.daylight.dtos.response.ProfileDetailResponse;
|
||||
@@ -23,6 +24,7 @@ import jakarta.servlet.http.HttpServletRequest;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.hc.core5.http.Header;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
@@ -37,6 +39,8 @@ public class NotificationService {
|
||||
private SysGroupPermissionService sysGroupPermissionService;
|
||||
@Resource
|
||||
private HttpService httpService;
|
||||
@Autowired
|
||||
private ApprovalRoutingDao approvalRoutingDao;
|
||||
|
||||
public GetNotificationResponse getNotificationByUserId(String userId){
|
||||
GetNotificationResponse response = new GetNotificationResponse();
|
||||
@@ -64,6 +68,10 @@ public class NotificationService {
|
||||
response.setNotificationCount(sysLogNotificationRepository.countByUserIdAndStatus(userId, 0));
|
||||
count+=sysLogNotificationRepository.countByUserIdAndStatus(userId, 0);
|
||||
}
|
||||
if (viewApprovalRouting) {
|
||||
response.setApprovalRoutingCount(approvalRoutingDao.countApprovalList(userId));
|
||||
count+=approvalRoutingDao.countApprovalList(userId);
|
||||
}
|
||||
response.setCount(count);
|
||||
return response;
|
||||
}
|
||||
@@ -103,7 +111,6 @@ public class NotificationService {
|
||||
String url = "/send_notification";
|
||||
// 获取对应的值
|
||||
Header[] headers = HttpHeaderBuilder.custom()
|
||||
.authorization(request.getHeader("Authorization"))
|
||||
.contentType("application/json")
|
||||
.build();
|
||||
HttpResult responseData = httpService.sslSendNotification(url, headers, requestData);
|
||||
|
||||
Reference in New Issue
Block a user