待审核项目提醒走马灯
parent
481a870008
commit
1485897c9c
|
@ -2,14 +2,12 @@ package cn.palmte.work.controller.backend;
|
||||||
|
|
||||||
|
|
||||||
import cn.palmte.work.config.Constant;
|
import cn.palmte.work.config.Constant;
|
||||||
import cn.palmte.work.model.Admin;
|
import cn.palmte.work.model.*;
|
||||||
import cn.palmte.work.model.LoginLog;
|
|
||||||
import cn.palmte.work.model.SysRole;
|
|
||||||
import cn.palmte.work.model.SysRoleRepository;
|
|
||||||
import cn.palmte.work.pojo.LoginRequest;
|
import cn.palmte.work.pojo.LoginRequest;
|
||||||
import cn.palmte.work.pojo.LoginResponse;
|
import cn.palmte.work.pojo.LoginResponse;
|
||||||
import cn.palmte.work.service.AdminService;
|
import cn.palmte.work.service.AdminService;
|
||||||
import cn.palmte.work.service.LoginLogService;
|
import cn.palmte.work.service.LoginLogService;
|
||||||
|
import cn.palmte.work.service.ProjectService;
|
||||||
import cn.palmte.work.utils.*;
|
import cn.palmte.work.utils.*;
|
||||||
import net.logstash.logback.encoder.org.apache.commons.lang.StringUtils;
|
import net.logstash.logback.encoder.org.apache.commons.lang.StringUtils;
|
||||||
import org.apache.shiro.SecurityUtils;
|
import org.apache.shiro.SecurityUtils;
|
||||||
|
@ -24,11 +22,14 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Controller;
|
import org.springframework.stereotype.Controller;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.web.servlet.mvc.support.RedirectAttributes;
|
import org.springframework.web.servlet.mvc.support.RedirectAttributes;
|
||||||
|
import top.jfunc.common.db.bean.Page;
|
||||||
|
import top.jfunc.common.utils.CollectionUtil;
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
import java.text.ParseException;
|
import java.text.ParseException;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
@Controller
|
@Controller
|
||||||
|
@ -39,9 +40,10 @@ public class AdminController extends BaseController {
|
||||||
private AdminService adminService;
|
private AdminService adminService;
|
||||||
@Autowired
|
@Autowired
|
||||||
private LoginLogService loginLogService;
|
private LoginLogService loginLogService;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private SysRoleRepository sysRoleRepository;
|
private SysRoleRepository sysRoleRepository;
|
||||||
|
@Autowired
|
||||||
|
private ProjectService projectService;
|
||||||
|
|
||||||
@PostMapping(value = "/singIn")
|
@PostMapping(value = "/singIn")
|
||||||
public String singIn(RedirectAttributes attr, LoginRequest loginRequest, HttpServletRequest request) throws Exception {
|
public String singIn(RedirectAttributes attr, LoginRequest loginRequest, HttpServletRequest request) throws Exception {
|
||||||
|
@ -115,6 +117,8 @@ public class AdminController extends BaseController {
|
||||||
request.getSession().setAttribute("message", "");
|
request.getSession().setAttribute("message", "");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
message = login(userName, newPassword, false, false);
|
message = login(userName, newPassword, false, false);
|
||||||
if (!message.isEmpty()) {
|
if (!message.isEmpty()) {
|
||||||
attr.addAttribute("errorMessages", message);
|
attr.addAttribute("errorMessages", message);
|
||||||
|
@ -127,16 +131,22 @@ public class AdminController extends BaseController {
|
||||||
}
|
}
|
||||||
adminService.updateLoginInfo(admin, request);
|
adminService.updateLoginInfo(admin, request);
|
||||||
loginLogService.saveLog(userName, LoginLog.SUCCESS, "登录成功");
|
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]
|
* admin用户去检查,如果检查job有失败的,显示弹出框[1]
|
||||||
*/
|
*/
|
||||||
return "redirect:/admin/center?uid=0";
|
return "redirect:/admin/center?uid=0";
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
logger.error(e.getMessage(), e);
|
||||||
message = "登录发生未知错误,e=" + e.getMessage();
|
message = "登录发生未知错误,e=" + e.getMessage();
|
||||||
attr.addAttribute("errorMessages", message);
|
attr.addAttribute("errorMessages", message);
|
||||||
loginLogService.saveLog(userName, LoginLog.FAILED, message);
|
loginLogService.saveLog(userName, LoginLog.FAILED, message);
|
||||||
return "redirect:/admin/err";
|
return "redirect:/admin/err";
|
||||||
} catch (Throwable t) {
|
} catch (Throwable t) {
|
||||||
|
logger.error(t.getMessage(), t);
|
||||||
message = "登录发生未知错误,t=" + t.getMessage();
|
message = "登录发生未知错误,t=" + t.getMessage();
|
||||||
attr.addAttribute("errorMessages", message);
|
attr.addAttribute("errorMessages", message);
|
||||||
loginLogService.saveLog(userName, LoginLog.FAILED, message);
|
loginLogService.saveLog(userName, LoginLog.FAILED, message);
|
||||||
|
|
|
@ -64,8 +64,8 @@ public class ProjectController extends BaseController{
|
||||||
model.put("deptList", deptRepository.findAll());
|
model.put("deptList", deptRepository.findAll());
|
||||||
ConcurrentHashMap<String, String> searchInfo = getSearchInfo(keywords,model);
|
ConcurrentHashMap<String, String> searchInfo = getSearchInfo(keywords,model);
|
||||||
model.put("pager",projectService.list(searchInfo,pageNumber,pageSize));
|
model.put("pager",projectService.list(searchInfo,pageNumber,pageSize));
|
||||||
Page<Project> myApproveProjects = projectService.findMyApproveProjects(searchInfo, InterfaceUtil.getAdminId(), 1, Integer.MAX_VALUE);
|
/*Page<Project> myApproveProjects = projectService.findMyApproveProjects(searchInfo, InterfaceUtil.getAdminId(), 1, Integer.MAX_VALUE);
|
||||||
model.put("hasApproveProjects", CollectionUtil.isNotEmpty(myApproveProjects.getList()) ? "1" : "0");
|
model.put("hasApproveProjects", CollectionUtil.isNotEmpty(myApproveProjects.getList()) ? "1" : "0");*/
|
||||||
return "admin/project_list";
|
return "admin/project_list";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -295,7 +295,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if("1" == "${hasApproveProjects!'0'}"){
|
/* if("1" == "${hasApproveProjects!'0'}"){
|
||||||
var hasApproveProjectsLayer = layer.open({
|
var hasApproveProjectsLayer = layer.open({
|
||||||
type: 1,
|
type: 1,
|
||||||
title:'待审核项目提醒',
|
title:'待审核项目提醒',
|
||||||
|
@ -305,7 +305,7 @@
|
||||||
"<span style='color: #0b6fa2;cursor: pointer;text-decoration:underline' onclick='window.location.href=\"${base}/project/listApprove\"'>前往处理</span></div>"
|
"<span style='color: #0b6fa2;cursor: pointer;text-decoration:underline' onclick='window.location.href=\"${base}/project/listApprove\"'>前往处理</span></div>"
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}*/
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -19,6 +19,7 @@
|
||||||
</ul>
|
</ul>
|
||||||
<div class="am-topbar-right">
|
<div class="am-topbar-right">
|
||||||
<ul class="am-nav am-nav-pills am-topbar-nav admin-header-list">
|
<ul class="am-nav am-nav-pills am-topbar-nav admin-header-list">
|
||||||
|
<li><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></marquee></li>
|
||||||
<li class="am-dropdown" data-am-dropdown>
|
<li class="am-dropdown" data-am-dropdown>
|
||||||
<a class="am-dropdown-toggle" data-am-dropdown-toggle href="javascript:;">
|
<a class="am-dropdown-toggle" data-am-dropdown-toggle href="javascript:;">
|
||||||
<span style="color: red;">${message!""}</span><span class="am-icon-user"></span> 您好, ${userName!""} <span class="am-icon-caret-down"></span>
|
<span style="color: red;">${message!""}</span><span class="am-icon-user"></span> 您好, ${userName!""} <span class="am-icon-caret-down"></span>
|
||||||
|
|
Loading…
Reference in New Issue