|
@@ -1,16 +1,23 @@
|
|
|
package com.bootdo.datas.controller;
|
|
|
|
|
|
+import com.bootdo.common.annotation.Log;
|
|
|
import com.bootdo.common.utils.PageUtils;
|
|
|
import com.bootdo.common.utils.Query;
|
|
|
|
|
|
+import com.bootdo.common.utils.ShiroUtils;
|
|
|
import com.bootdo.common.utils.StringUtils;
|
|
|
import com.bootdo.datas.dto.*;
|
|
|
import com.bootdo.datas.service.DataService;
|
|
|
import com.bootdo.datas.service.GyDataService;
|
|
|
+import com.bootdo.system.domain.UserDO;
|
|
|
import com.google.common.collect.Lists;
|
|
|
+import org.apache.shiro.authz.annotation.RequiresPermissions;
|
|
|
+import org.slf4j.Logger;
|
|
|
+import org.slf4j.LoggerFactory;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.stereotype.Controller;
|
|
|
+import org.springframework.ui.Model;
|
|
|
import org.springframework.util.CollectionUtils;
|
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
@@ -29,7 +36,7 @@ import java.util.Map;
|
|
|
@Controller
|
|
|
@RequestMapping("/dashboard/data")
|
|
|
public class DashboardController {
|
|
|
-
|
|
|
+ private final Logger logger = LoggerFactory.getLogger(this.getClass());
|
|
|
@Autowired
|
|
|
private GyDataService gyDataService;
|
|
|
@Autowired
|
|
@@ -38,6 +45,41 @@ public class DashboardController {
|
|
|
@Value("${deployType:#{null}}")
|
|
|
public String deployType;
|
|
|
|
|
|
+ @Value("${sysCity:#{null}}")
|
|
|
+ public String sysCity;
|
|
|
+
|
|
|
+ @GetMapping("/stat")
|
|
|
+ @Log("访问统计仪表盘页面")
|
|
|
+ @RequiresPermissions("dashboard:data:stat")
|
|
|
+ String Data(Model model) {
|
|
|
+ UserDO currUser = ShiroUtils.getUser();
|
|
|
+ String city = currUser.getCity();
|
|
|
+ if(StringUtils.isEmpty(city)){
|
|
|
+ city = sysCity;
|
|
|
+ }
|
|
|
+ if (StringUtils.isNotEmpty(city)) {
|
|
|
+ logger.info("市级");
|
|
|
+ model.addAttribute("loadURl", "dashboard-2");
|
|
|
+
|
|
|
+ } else {
|
|
|
+ logger.info("省级");
|
|
|
+ model.addAttribute("loadURl", "dashboard-1");
|
|
|
+ }
|
|
|
+ return "dashboard/dashboard";
|
|
|
+ }
|
|
|
+
|
|
|
+ // "dashboard/dashboard-1"; //省
|
|
|
+ // "dashboard/dashboard-2"; //市
|
|
|
+ @GetMapping("/dashboard-1")
|
|
|
+ String dashboard1() {
|
|
|
+ return "dashboard/dashboard-1";
|
|
|
+ }
|
|
|
+
|
|
|
+ @GetMapping("/dashboard-2")
|
|
|
+ String dashboard2() {
|
|
|
+ return "dashboard/dashboard-2";
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 首页地图数据
|
|
|
*
|