审核消息优化

master
pengqiang 2021-12-30 16:14:29 +08:00
parent 2e39095430
commit b939e750c1
4 changed files with 58 additions and 5 deletions

View File

@ -1,6 +1,7 @@
package cn.palmte.work.controller.backend;
import cn.palmte.work.bean.ResponseMsg;
import cn.palmte.work.config.Constant;
import cn.palmte.work.model.*;
import cn.palmte.work.pojo.LoginRequest;
@ -153,9 +154,6 @@ public class AdminController extends BaseController {
adminService.updateLoginInfo(admin, request);
loginLogService.saveLog(userName, LoginLog.SUCCESS, "登录成功");
Page<Project> myApproveProjects = projectService.findMyApproveProjects(new HashMap<>(), InterfaceUtil.getAdminId(), 1, 1);
request.getSession().setAttribute("hasApproveProjectsMessage", CollectionUtil.isNotEmpty(myApproveProjects.getList())?"您有新的待审核项目,请及时确认。":"");
/**
* admin,job,[1]
*/
@ -286,5 +284,20 @@ public class AdminController extends BaseController {
new CaptchaUtils().getRandCode(request, response);
}
/**
*
*
* @return
*/
@ResponseBody
@RequestMapping("/approveProjectsMsg")
public ResponseMsg approveProjectsMsg() {
Page<Project> myApproveProjects = projectService.findMyApproveProjects(new HashMap<>(), InterfaceUtil.getAdminId(), 1, 1);
if (myApproveProjects != null && !myApproveProjects.getList().isEmpty()) {
return ResponseMsg.buildSuccessMsg("您有新的待审核项目,请及时确认。");
} else {
return ResponseMsg.buildSuccessMsg("");
}
}
}

View File

@ -92,6 +92,25 @@
});
});
/**
* 刷新审批更新 更新跑马灯
*/
function refreshApproveMsg() {
var span = $("#myMsgSpan", parent.document);
$.ajax({
url: '${base}/admin/approveProjectsMsg',
dataType: "json",
contentType: "application/json",
type: 'post',
async: false,
success: function (data) {
if (data.status == 0) {
span.text(data.msg)
}
}
});
}
$(function(){
$("#arrow").on("click",function(){
if($(this).hasClass("arrow-left")){
@ -111,6 +130,8 @@
$(this).popover('setContent', '点击显示菜单栏');
}
});
refreshApproveMsg();
});
</script>
</body>

View File

@ -1954,10 +1954,10 @@
type: 'post',
async: false,
success: function (data) {
$("#marqueeLi", parent.document).addClass("am-hide");
if (data.status == 0) {
alert(data.msg);
window.location.href = window.location.href;
refreshMyApproveMsg();
} else if (data.status == 1) {
alert(data.msg);
}
@ -1997,4 +1997,23 @@
$("#keywords").val(keywords);
}
/**
* 刷新审批更新 更新跑马灯
*/
function refreshMyApproveMsg() {
var span = $("#myMsgSpan", parent.document);
$.ajax({
url: '${base}/admin/approveProjectsMsg',
dataType: "json",
contentType: "application/json",
type: 'post',
async: false,
success: function (data) {
if (data.status == 0) {
span.text(data.msg)
}
}
});
}
</script>

View File

@ -22,7 +22,7 @@
<li id="marqueeLi" style="margin-top: -10px">
<marquee align="left" behavior="scroll" direction="left" height="20" width="200" hspace="50" vspace="20" loop="-1" scrollamount="10" scrolldelay="100" onMouseOut="this.start()" onMouseOver="this.stop()">
<a href="${base}/project/listApprove" target="mainFrame">${hasApproveProjectsMessage!""}</a>
<a href="${base}/project/listApprove" target="mainFrame"><span id="myMsgSpan"></span></a>
</marquee>
</li>