|
@@ -4,9 +4,14 @@ import java.util.Date;
|
|
import java.util.List;
|
|
import java.util.List;
|
|
import javax.servlet.http.Cookie;
|
|
import javax.servlet.http.Cookie;
|
|
import javax.servlet.http.HttpServletResponse;
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
|
+import javax.websocket.OnMessage;
|
|
|
|
+import javax.websocket.OnOpen;
|
|
|
|
|
|
-import com.ruoyi.system.service.IUnableToAccessWebsiteListTodayService;
|
|
|
|
-import com.ruoyi.system.service.IWebsiteAvailabilityMonitorService;
|
|
|
|
|
|
+import com.alibaba.fastjson.JSONObject;
|
|
|
|
+import com.ruoyi.system.service.*;
|
|
|
|
+import com.ruoyi.websocket.WebSocketServer;
|
|
|
|
+import com.ruoyi.websocket.WebSocketUsers;
|
|
|
|
+import lombok.extern.slf4j.Slf4j;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.stereotype.Controller;
|
|
import org.springframework.stereotype.Controller;
|
|
import org.springframework.ui.ModelMap;
|
|
import org.springframework.ui.ModelMap;
|
|
@@ -26,8 +31,6 @@ import com.ruoyi.common.utils.DateUtils;
|
|
import com.ruoyi.common.utils.ServletUtils;
|
|
import com.ruoyi.common.utils.ServletUtils;
|
|
import com.ruoyi.common.utils.StringUtils;
|
|
import com.ruoyi.common.utils.StringUtils;
|
|
import com.ruoyi.framework.shiro.service.SysPasswordService;
|
|
import com.ruoyi.framework.shiro.service.SysPasswordService;
|
|
-import com.ruoyi.system.service.ISysConfigService;
|
|
|
|
-import com.ruoyi.system.service.ISysMenuService;
|
|
|
|
import org.springframework.web.servlet.ModelAndView;
|
|
import org.springframework.web.servlet.ModelAndView;
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -36,21 +39,53 @@ import org.springframework.web.servlet.ModelAndView;
|
|
* @author ruoyi
|
|
* @author ruoyi
|
|
*/
|
|
*/
|
|
@Controller
|
|
@Controller
|
|
-public class SysIndexController extends BaseController
|
|
|
|
-{
|
|
|
|
|
|
+@Slf4j
|
|
|
|
+public class SysIndexController extends BaseController {
|
|
@Autowired
|
|
@Autowired
|
|
private ISysMenuService menuService;
|
|
private ISysMenuService menuService;
|
|
-
|
|
|
|
@Autowired
|
|
@Autowired
|
|
private ISysConfigService configService;
|
|
private ISysConfigService configService;
|
|
-
|
|
|
|
@Autowired
|
|
@Autowired
|
|
private SysPasswordService passwordService;
|
|
private SysPasswordService passwordService;
|
|
-
|
|
|
|
|
|
+ @Autowired
|
|
|
|
+ private IWebsiteAvailabilityMonitorService websiteAvailabilityMonitorService;
|
|
|
|
+ @Autowired
|
|
|
|
+ private IUnableToAccessWebsiteListTodayService unableToAccessWebsiteListTodayService;
|
|
|
|
+ @Autowired
|
|
|
|
+ private IWebSiteTenDaysHitsService webSiteTenDaysHitsService;
|
|
|
|
+ @Autowired
|
|
|
|
+ private IVisitingWebsiteRankingService visitingWebsiteRankingService;
|
|
|
|
+ @Autowired
|
|
|
|
+ private IColumnPageViewService columnPageViewService;
|
|
|
|
+ @Autowired
|
|
|
|
+ private IPopularInformationService popularInformationService;
|
|
|
|
+ @Autowired
|
|
|
|
+ private IMunicipalMisprintService municipalMisprintService;
|
|
|
|
+ @Autowired
|
|
|
|
+ private ICountyAndDistrictMisprintService countyAndDistrictMisprintService;
|
|
|
|
+ @Autowired
|
|
|
|
+ private IMunicipalErrorLinkMonitorService municipalErrorLinkMonitorService;
|
|
|
|
+ @Autowired
|
|
|
|
+ private ICensusElementsService censusElementsService;
|
|
|
|
+ @Autowired
|
|
|
|
+ private ICensusItemNegativeInformationService censusItemNegativeInformationService;
|
|
|
|
+ @Autowired
|
|
|
|
+ private IDailyTrafficRankingService dailyTrafficRankingService;
|
|
|
|
+ @Autowired
|
|
|
|
+ private IDailyUpdateRankingService dailyUpdateRankingService;
|
|
|
|
+ @Autowired
|
|
|
|
+ private ICountyDailyTrafficRankingService countyDailyTrafficRankingService;
|
|
|
|
+ @Autowired
|
|
|
|
+ private ICountyDailyUpdateRankingService countyDailyUpdateRankingService;
|
|
|
|
+ @Autowired
|
|
|
|
+ private IMunicipalInteractiveColumnsService municipalInteractiveColumnsService;
|
|
|
|
+ @Autowired
|
|
|
|
+ private IAreaInteractiveColumnsService areaInteractiveColumnsService;
|
|
|
|
+ @Autowired
|
|
|
|
+ private ICountyInteractiveColumnsService countyInteractiveColumnsService;
|
|
// 系统首页
|
|
// 系统首页
|
|
@GetMapping("/index")
|
|
@GetMapping("/index")
|
|
- public String index(ModelMap mmap)
|
|
|
|
- {
|
|
|
|
|
|
+ public String index(ModelMap mmap) {
|
|
// 取身份信息
|
|
// 取身份信息
|
|
SysUser user = getSysUser();
|
|
SysUser user = getSysUser();
|
|
// 根据用户id取出菜单
|
|
// 根据用户id取出菜单
|
|
@@ -77,10 +112,8 @@ public class SysIndexController extends BaseController
|
|
|
|
|
|
// 优先Cookie配置导航菜单
|
|
// 优先Cookie配置导航菜单
|
|
Cookie[] cookies = ServletUtils.getRequest().getCookies();
|
|
Cookie[] cookies = ServletUtils.getRequest().getCookies();
|
|
- for (Cookie cookie : cookies)
|
|
|
|
- {
|
|
|
|
- if (StringUtils.isNotEmpty(cookie.getName()) && "nav-style".equalsIgnoreCase(cookie.getName()))
|
|
|
|
- {
|
|
|
|
|
|
+ for (Cookie cookie : cookies) {
|
|
|
|
+ if (StringUtils.isNotEmpty(cookie.getName()) && "nav-style".equalsIgnoreCase(cookie.getName())) {
|
|
indexStyle = cookie.getValue();
|
|
indexStyle = cookie.getValue();
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
@@ -91,8 +124,7 @@ public class SysIndexController extends BaseController
|
|
|
|
|
|
// 锁定屏幕
|
|
// 锁定屏幕
|
|
@GetMapping("/lockscreen")
|
|
@GetMapping("/lockscreen")
|
|
- public String lockscreen(ModelMap mmap)
|
|
|
|
- {
|
|
|
|
|
|
+ public String lockscreen(ModelMap mmap) {
|
|
mmap.put("user", getSysUser());
|
|
mmap.put("user", getSysUser());
|
|
ServletUtils.getSession().setAttribute(ShiroConstants.LOCK_SCREEN, true);
|
|
ServletUtils.getSession().setAttribute(ShiroConstants.LOCK_SCREEN, true);
|
|
return "lock";
|
|
return "lock";
|
|
@@ -101,15 +133,12 @@ public class SysIndexController extends BaseController
|
|
// 解锁屏幕
|
|
// 解锁屏幕
|
|
@PostMapping("/unlockscreen")
|
|
@PostMapping("/unlockscreen")
|
|
@ResponseBody
|
|
@ResponseBody
|
|
- public AjaxResult unlockscreen(String password)
|
|
|
|
- {
|
|
|
|
|
|
+ public AjaxResult unlockscreen(String password) {
|
|
SysUser user = getSysUser();
|
|
SysUser user = getSysUser();
|
|
- if (StringUtils.isNull(user))
|
|
|
|
- {
|
|
|
|
|
|
+ if (StringUtils.isNull(user)) {
|
|
return AjaxResult.error("服务器超时,请重新登录");
|
|
return AjaxResult.error("服务器超时,请重新登录");
|
|
}
|
|
}
|
|
- if (passwordService.matches(user, password))
|
|
|
|
- {
|
|
|
|
|
|
+ if (passwordService.matches(user, password)) {
|
|
ServletUtils.getSession().removeAttribute(ShiroConstants.LOCK_SCREEN);
|
|
ServletUtils.getSession().removeAttribute(ShiroConstants.LOCK_SCREEN);
|
|
return AjaxResult.success();
|
|
return AjaxResult.success();
|
|
}
|
|
}
|
|
@@ -118,84 +147,73 @@ public class SysIndexController extends BaseController
|
|
|
|
|
|
// 切换主题
|
|
// 切换主题
|
|
@GetMapping("/system/switchSkin")
|
|
@GetMapping("/system/switchSkin")
|
|
- public String switchSkin()
|
|
|
|
- {
|
|
|
|
|
|
+ public String switchSkin() {
|
|
return "skin";
|
|
return "skin";
|
|
}
|
|
}
|
|
|
|
|
|
// 切换菜单
|
|
// 切换菜单
|
|
@GetMapping("/system/menuStyle/{style}")
|
|
@GetMapping("/system/menuStyle/{style}")
|
|
- public void menuStyle(@PathVariable String style, HttpServletResponse response)
|
|
|
|
- {
|
|
|
|
|
|
+ public void menuStyle(@PathVariable String style, HttpServletResponse response) {
|
|
CookieUtils.setCookie(response, "nav-style", style);
|
|
CookieUtils.setCookie(response, "nav-style", style);
|
|
}
|
|
}
|
|
|
|
|
|
// 系统介绍
|
|
// 系统介绍
|
|
@GetMapping("/system/main")
|
|
@GetMapping("/system/main")
|
|
- public String main(ModelMap mmap)
|
|
|
|
- {
|
|
|
|
|
|
+ public String main(ModelMap mmap) {
|
|
mmap.put("version", RuoYiConfig.getVersion());
|
|
mmap.put("version", RuoYiConfig.getVersion());
|
|
return "main";
|
|
return "main";
|
|
}
|
|
}
|
|
|
|
|
|
//网站普查指标监测
|
|
//网站普查指标监测
|
|
@GetMapping("/censusIndicators")
|
|
@GetMapping("/censusIndicators")
|
|
- public String censusIndicators(ModelMap mmap)
|
|
|
|
- {
|
|
|
|
|
|
+ public Object censusIndicators(ModelMap mmap) {
|
|
|
|
+ ModelAndView modelAndView = new ModelAndView("censusIndicators.html");
|
|
|
|
+ modelAndView.addObject("dataSourceOne",censusElementsService.selectCensusElementsList());
|
|
|
|
+ modelAndView.addObject("dataSourceTwo", censusItemNegativeInformationService.selectCensusItemNegativeInformationList());
|
|
mmap.put("version", RuoYiConfig.getVersion());
|
|
mmap.put("version", RuoYiConfig.getVersion());
|
|
- return "censusIndicators";
|
|
|
|
|
|
+ return modelAndView;
|
|
}
|
|
}
|
|
|
|
|
|
//日更新量排行
|
|
//日更新量排行
|
|
@GetMapping("/dailyUpdateVolume")
|
|
@GetMapping("/dailyUpdateVolume")
|
|
- public String dailyUpdateVolume(ModelMap mmap)
|
|
|
|
- {
|
|
|
|
|
|
+ public String dailyUpdateVolume(ModelMap mmap) {
|
|
mmap.put("version", RuoYiConfig.getVersion());
|
|
mmap.put("version", RuoYiConfig.getVersion());
|
|
return "dailyUpdateVolume";
|
|
return "dailyUpdateVolume";
|
|
}
|
|
}
|
|
|
|
|
|
//日访问量
|
|
//日访问量
|
|
@GetMapping("/dailyVisits")
|
|
@GetMapping("/dailyVisits")
|
|
- public String dailyVisits(ModelMap mmap)
|
|
|
|
- {
|
|
|
|
|
|
+ public String dailyVisits(ModelMap mmap) {
|
|
mmap.put("version", RuoYiConfig.getVersion());
|
|
mmap.put("version", RuoYiConfig.getVersion());
|
|
return "dailyVisits";
|
|
return "dailyVisits";
|
|
}
|
|
}
|
|
|
|
|
|
//全市政府网站群互动类栏目更新情况
|
|
//全市政府网站群互动类栏目更新情况
|
|
@GetMapping("/InteractiveColumns")
|
|
@GetMapping("/InteractiveColumns")
|
|
- public String InteractiveColumns(ModelMap mmap)
|
|
|
|
- {
|
|
|
|
|
|
+ public String InteractiveColumns(ModelMap mmap) {
|
|
mmap.put("version", RuoYiConfig.getVersion());
|
|
mmap.put("version", RuoYiConfig.getVersion());
|
|
return "InteractiveColumns";
|
|
return "InteractiveColumns";
|
|
}
|
|
}
|
|
|
|
|
|
//错别字监测
|
|
//错别字监测
|
|
@GetMapping("/misunderstanding")
|
|
@GetMapping("/misunderstanding")
|
|
- public String misunderstanding(ModelMap mmap)
|
|
|
|
- {
|
|
|
|
|
|
+ public String misunderstanding(ModelMap mmap) {
|
|
mmap.put("version", RuoYiConfig.getVersion());
|
|
mmap.put("version", RuoYiConfig.getVersion());
|
|
return "misunderstanding";
|
|
return "misunderstanding";
|
|
}
|
|
}
|
|
|
|
|
|
//错链监测
|
|
//错链监测
|
|
@GetMapping("/staggeredChain")
|
|
@GetMapping("/staggeredChain")
|
|
- public String staggeredChain(ModelMap mmap)
|
|
|
|
- {
|
|
|
|
|
|
+ public String staggeredChain(ModelMap mmap) {
|
|
mmap.put("version", RuoYiConfig.getVersion());
|
|
mmap.put("version", RuoYiConfig.getVersion());
|
|
return "staggeredChain";
|
|
return "staggeredChain";
|
|
}
|
|
}
|
|
- @Autowired
|
|
|
|
- private IWebsiteAvailabilityMonitorService websiteAvailabilityMonitorService;
|
|
|
|
|
|
|
|
- @Autowired
|
|
|
|
- private IUnableToAccessWebsiteListTodayService unableToAccessWebsiteListTodayService;
|
|
|
|
//吉林市政府网站可用性监测
|
|
//吉林市政府网站可用性监测
|
|
@GetMapping("/usability")
|
|
@GetMapping("/usability")
|
|
- public Object usability(ModelMap mmap)
|
|
|
|
- {
|
|
|
|
|
|
+ public Object usability(ModelMap mmap) {
|
|
ModelAndView modelAndView = new ModelAndView("usability.html");
|
|
ModelAndView modelAndView = new ModelAndView("usability.html");
|
|
- modelAndView.addObject("dataSource",websiteAvailabilityMonitorService.selectWebsiteAvailabilityMonitorList());
|
|
|
|
|
|
+ modelAndView.addObject("dataSource", websiteAvailabilityMonitorService.selectWebsiteAvailabilityMonitorList());
|
|
modelAndView.addObject("dataAccess",unableToAccessWebsiteListTodayService.selectUnableToAccessWebsiteListTodayList());
|
|
modelAndView.addObject("dataAccess",unableToAccessWebsiteListTodayService.selectUnableToAccessWebsiteListTodayList());
|
|
mmap.put("version", RuoYiConfig.getVersion());
|
|
mmap.put("version", RuoYiConfig.getVersion());
|
|
return modelAndView;
|
|
return modelAndView;
|
|
@@ -203,45 +221,34 @@ public class SysIndexController extends BaseController
|
|
|
|
|
|
//网站普查指标监测
|
|
//网站普查指标监测
|
|
@GetMapping("/websiteAccess")
|
|
@GetMapping("/websiteAccess")
|
|
- public Object websiteAccess(ModelMap mmap)
|
|
|
|
- {
|
|
|
|
|
|
+ public Object websiteAccess(ModelMap mmap) {
|
|
|
|
|
|
mmap.put("version", RuoYiConfig.getVersion());
|
|
mmap.put("version", RuoYiConfig.getVersion());
|
|
return "websiteAccess";
|
|
return "websiteAccess";
|
|
}
|
|
}
|
|
|
|
|
|
- public String contentMainClass(Boolean footer, Boolean tagsView)
|
|
|
|
- {
|
|
|
|
- if (!footer && !tagsView)
|
|
|
|
- {
|
|
|
|
|
|
+ public String contentMainClass(Boolean footer, Boolean tagsView) {
|
|
|
|
+ if (!footer && !tagsView) {
|
|
return "tagsview-footer-hide";
|
|
return "tagsview-footer-hide";
|
|
- }
|
|
|
|
- else if (!footer)
|
|
|
|
- {
|
|
|
|
|
|
+ } else if (!footer) {
|
|
return "footer-hide";
|
|
return "footer-hide";
|
|
- }
|
|
|
|
- else if (!tagsView)
|
|
|
|
- {
|
|
|
|
|
|
+ } else if (!tagsView) {
|
|
return "tagsview-hide";
|
|
return "tagsview-hide";
|
|
}
|
|
}
|
|
return StringUtils.EMPTY;
|
|
return StringUtils.EMPTY;
|
|
}
|
|
}
|
|
|
|
|
|
// 检查初始密码是否提醒修改
|
|
// 检查初始密码是否提醒修改
|
|
- public boolean initPasswordIsModify(Date pwdUpdateDate)
|
|
|
|
- {
|
|
|
|
|
|
+ public boolean initPasswordIsModify(Date pwdUpdateDate) {
|
|
Integer initPasswordModify = Convert.toInt(configService.selectConfigByKey("sys.account.initPasswordModify"));
|
|
Integer initPasswordModify = Convert.toInt(configService.selectConfigByKey("sys.account.initPasswordModify"));
|
|
return initPasswordModify != null && initPasswordModify == 1 && pwdUpdateDate == null;
|
|
return initPasswordModify != null && initPasswordModify == 1 && pwdUpdateDate == null;
|
|
}
|
|
}
|
|
|
|
|
|
// 检查密码是否过期
|
|
// 检查密码是否过期
|
|
- public boolean passwordIsExpiration(Date pwdUpdateDate)
|
|
|
|
- {
|
|
|
|
|
|
+ public boolean passwordIsExpiration(Date pwdUpdateDate) {
|
|
Integer passwordValidateDays = Convert.toInt(configService.selectConfigByKey("sys.account.passwordValidateDays"));
|
|
Integer passwordValidateDays = Convert.toInt(configService.selectConfigByKey("sys.account.passwordValidateDays"));
|
|
- if (passwordValidateDays != null && passwordValidateDays > 0)
|
|
|
|
- {
|
|
|
|
- if (StringUtils.isNull(pwdUpdateDate))
|
|
|
|
- {
|
|
|
|
|
|
+ if (passwordValidateDays != null && passwordValidateDays > 0) {
|
|
|
|
+ if (StringUtils.isNull(pwdUpdateDate)) {
|
|
// 如果从未修改过初始密码,直接提醒过期
|
|
// 如果从未修改过初始密码,直接提醒过期
|
|
return true;
|
|
return true;
|
|
}
|
|
}
|