shjung 2 éve
szülő
commit
2ada3a9cfa

+ 19 - 11
src/main/java/com/its/op/controller/its/dashboard/DashboardController.java

@@ -17,29 +17,37 @@ import java.util.List;
 @Validated
 @RestController
 @RequiredArgsConstructor
-@RequestMapping("/api/common/dashboard")
+@RequestMapping("/api/dashboard")
 public class DashboardController {
 
     private final DashboardService service;
 
-    @ApiOperation(value = "소통등급갯수상태-링크", response = CmtrGradCountSttsDto.class, responseContainer = "ArrayList")
-    @GetMapping(value = "/cmtr-grad-count-stts/link", produces = {"application/json; charset=utf8"})
-    public List<CmtrGradCountSttsDto> findAllCmtrGradCountSttsLink() {
-        return this.service.findAllCmtrGradCountSttsLink();
-    }
+//    @ApiOperation(value = "소통등급갯수상태-링크", response = CmtrGradCountSttsDto.class, responseContainer = "ArrayList")
+//    @GetMapping(value = "/cmtr-grad-count-stts/link", produces = {"application/json; charset=utf8"})
+//    public List<CmtrGradCountSttsDto> findAllCmtrGradCountSttsLink() {
+//        return this.service.findAllCmtrGradCountSttsLink();
+//    }
 
+    /**
+     * 상황판에서 하단 소통현황 통계 표출할때 사용함
+     * @return
+     */
     @ApiOperation(value = "소통등급갯수상태-정보제공구간", response = CmtrGradCountSttsDto.class, responseContainer = "ArrayList")
     @GetMapping(value = "/cmtr-grad-count-stts/ifsc", produces = {"application/json; charset=utf8"})
     public List<CmtrGradCountSttsDto> findAllCmtrGradCountSttsIfsc() {
         return this.service.findAllCmtrGradCountSttsIfsc();
     }
 
-    @ApiOperation(value = "소통등급갯수상태-도로", response = CmtrGradCountSttsDto.class, responseContainer = "ArrayList")
-    @GetMapping(value = "/cmtr-grad-count-stts/road", produces = {"application/json; charset=utf8"})
-    public List<CmtrGradCountSttsDto> findAllCmtrGradCountSttsRoad() {
-        return this.service.findAllCmtrGradCountSttsRoad();
-    }
+//    @ApiOperation(value = "소통등급갯수상태-도로", response = CmtrGradCountSttsDto.class, responseContainer = "ArrayList")
+//    @GetMapping(value = "/cmtr-grad-count-stts/road", produces = {"application/json; charset=utf8"})
+//    public List<CmtrGradCountSttsDto> findAllCmtrGradCountSttsRoad() {
+//        return this.service.findAllCmtrGradCountSttsRoad();
+//    }
 
+    /**
+     * Dashboard 화면에서 호출
+     * @return
+     */
     @ApiOperation(value = "정보제공구간 소통등급현황 및 수집원 조회", response = TrafPrcnStatDto.class, responseContainer = "ArrayList")
     @GetMapping(value = "/traf-prcn-stat/traf-stts/all", produces = {"application/json; charset=utf8"})
     public List<TrafPrcnStatDto> findAllTrafPrcnStatAll() {

+ 1 - 0
src/main/java/com/its/op/security/WebConstants.java

@@ -2,6 +2,7 @@ package com.its.op.security;
 
 public interface WebConstants {
 
+    String JSESSIONID = "JSESSIONID";
     String LOGIN_PAGE_URI = "/application/login/login.html";
     String DEFAULT_URI = "/application/op/00.main/main.html";
     String USER_UUID = "UUID";

+ 31 - 38
src/main/java/com/its/op/security/WebSecurityConfig.java

@@ -71,53 +71,47 @@ public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
     @Override
     protected void configure(HttpSecurity http) {
 
-        // URL 권한 설정
-        //setAntMatchers(http, "ROLE_");
         String loginPage = WebConstants.LOGIN_PAGE_URI;     // 로그인 할 경우 URL
 //        String loginPage = WebConstants.DEFAULT_URI;        // 로그인 하지 않을 경우 URL
 
         try {
             http.csrf().disable();  // REST API 호출 유효하게(POST...)
             http.authorizeRequests()
-                // SWAGGER 권한 설정
-                .antMatchers("/swagger-ui.html", "/swagger/**", "/swagger-resources/**", "/webjars/**", "/v2/api-docs").permitAll()
-                // 웹소켓 권한 설정하지
-                .antMatchers("/ws/**").permitAll()
-                .antMatchers("/api/resource/**").permitAll()
-                .antMatchers("/api/reload/**").permitAll()
-                .antMatchers("/api/test/**").permitAll()
-                .antMatchers("/api/manual/**").permitAll()
-//                .antMatchers("/api/**").permitAll()   // 로그인 하지 않을 경우 주석해제
-                // 지도 URI 권한 설정하지
-                .antMatchers("/MAPDATA/**").permitAll()
-                .antMatchers("/download/**").permitAll()
-                // 페이지 권한 설정
-                .antMatchers("/application/wall/**", "/wall/**").permitAll()
-                .antMatchers("/application/facility/**", "/facility/**").permitAll()
-                .antMatchers("/application/dashboard/**", "/dashboard/**").permitAll()
-                .antMatchers("/application/login/**").permitAll()
-                .antMatchers("/application/manual/**").permitAll()
-                .antMatchers("/api/auth/**").permitAll()
-                .anyRequest().authenticated()
-                .and()
-                    .formLogin()
+                    // SWAGGER 권한 설정
+                    .antMatchers("/swagger-ui.html", "/swagger/**", "/swagger-resources/**", "/webjars/**", "/v2/api-docs").permitAll()
+                    // 웹소켓 권한 설정하지
+                    .antMatchers("/ws/**").permitAll()
+                    .antMatchers("/api/dashboard/**").permitAll()
+                    .antMatchers("/api/auth/**").permitAll()
+                    .antMatchers("/api/resource/**").permitAll()
+                    .antMatchers("/api/reload/**").permitAll()
+                    .antMatchers("/api/test/**").permitAll()
+                    .antMatchers("/api/manual/**").permitAll()
+                    //.antMatchers("/api/**").permitAll()   // 로그인 하지 않을 경우 주석해제
+                    // 지도 URI 권한 설정하지
+                    .antMatchers("/MAPDATA/**").permitAll()
+                    .antMatchers("/download/**").permitAll()
+                    // 페이지 권한 설정
+                    .antMatchers("/application/wall/**", "/wall/**").permitAll()
+                    .antMatchers("/application/facility/**", "/facility/**").permitAll()
+                    .antMatchers("/application/dashboard/**", "/dashboard/**").permitAll()
+                    .antMatchers("/application/login/**").permitAll()
+                    .antMatchers("/application/manual/**").permitAll()
+                    .anyRequest().authenticated();
+            http.formLogin()
                     .loginPage(loginPage)
                     .loginProcessingUrl("/api/auth/login.do")
                     .defaultSuccessUrl(WebConstants.DEFAULT_URI, true)
                     .usernameParameter("username")
                     .passwordParameter("password")
                     .successHandler(this.webLoginSuccessHandler)
-                    .failureHandler(this.webLoginFailureHandler).permitAll()
-                .and()
-                    .logout()
-                    .addLogoutHandler(new UserLogoutHandler()).permitAll()
-                    .logoutSuccessUrl(loginPage).permitAll()
+                    .failureHandler(this.webLoginFailureHandler);
+            http.logout()
+                    .addLogoutHandler(new UserLogoutHandler())
+                    .logoutSuccessUrl(loginPage)
                     .invalidateHttpSession(true)
-                    .deleteCookies("JSESSIONID")
-                    .deleteCookies(WebConstants.USER_UUID)
-                    .deleteCookies(WebConstants.USER_TIME)
-                .and()
-                    .sessionManagement()
+                    .deleteCookies(WebConstants.JSESSIONID, WebConstants.USER_UUID, WebConstants.USER_TIME);
+            http.sessionManagement()
                     .sessionCreationPolicy(SessionCreationPolicy.IF_REQUIRED)   // 스프링 시큐리티가 필요 시 생성 (default)
                     // 인증에 성공할 때 마다 세션 ID나 세션을 변경해서 발급해줌으로써
                     // 세션을 중간에서 가로채더라도 해당 세션이 유효하지 않게 하는 기능
@@ -129,8 +123,7 @@ public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
                     .maximumSessions(20)            // 최대 허용 가능 세션 수, -1인 경우 무제한 세션 허용(같은 ID로 접속가능한 세션의 갯수)
                     .maxSessionsPreventsLogin(true) // false 인 경우 기존 사용자가 접속했고 새로 접속하는 사용자가 있을 경우 기존 사용자는 접속을 끊고 새로 들어오는 사용자를 받는다.(default)
                     .expiredUrl(loginPage)          // 세션이 만료된 경우 이동 할 페이지
-                    .sessionRegistry(sessionRegistry())
-            ;
+                    .sessionRegistry(sessionRegistry());
         } catch (IOException e) {
             // FOR KISA Secure Coding pass
             log.error("{configure: IOException}");
@@ -206,8 +199,8 @@ public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
             // url, 권한 정보를 넣는다.
             try {
                 http.authorizeRequests()
-                       .antMatchers(url)
-                       .hasAnyAuthority(roles);
+                        .antMatchers(url)
+                        .hasAnyAuthority(roles);
             } catch (IOException ie) {
                 // FOR KISA Secure Coding pass
                 log.error("setAntMatchers: IOException");

+ 28 - 0
src/main/resources/static/application/dashboard/common.js

@@ -0,0 +1,28 @@
+/**
+ * jQuery, dx-library, common-library
+ */
+document.write("<script src='/js/constant/constant.js'></script>")
+document.write("<script src='/libs/jquery/jquery-3.6.0.min.js'></script>");
+document.write("<script src='/libs/jquery/jquery-1.13.2.ui.min.js'></script>");
+
+if (window.$cssHref) {
+    document.write("<link rel='stylesheet' type='text/css' class='main-css' href='"+window.$cssHref+"'/>");
+}
+else {
+    if (window.opener) {
+        if (window.opener.$cssHref) {
+            document.write("<link rel='stylesheet' type='text/css' class='main-css' href='"+window.opener.$cssHref+"'/>");
+        }
+        else {
+            document.write("<link rel='stylesheet' type='text/css' class='main-css' href='/libs/dx-21.2.6/css/dx.material.blue.dark.compact.css'/>");
+        }
+    }
+    else {
+        document.write("<link rel='stylesheet' type='text/css' class='main-css' href='/libs/dx-21.2.6/css/dx.material.blue.dark.compact.css'/>");
+        //document.write("<link rel='stylesheet' type='text/css' class='main-css' href='/libs/dx-21.2.6/css/dx.dark.css'/>");
+    }
+}
+
+document.write("<script src='/libs/dx-21.2.6/js/dx.all.js'></script>");
+document.write("<link rel='stylesheet' type='text/css' href='/libs/jquery-confirm-v3.3.4/jquery-confirm.min.css'/>");
+document.write("<script src='/libs/jquery-confirm-v3.3.4/jquery-confirm.min.js'></script>");

+ 1 - 1
src/main/resources/static/application/dashboard/dashboard.html

@@ -4,7 +4,7 @@
         <meta http-equiv="X-UA-Compatible" content="IE=edge" />
         <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
         <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0" />
-        <script src="/libs/include-common.js"></script>
+        <script src="./common.js"></script>
         <script src="/libs/include-chart.js"></script>
         <script src="/libs/highchart/modules/broken-axis.js"></script>
         <link rel="stylesheet" href="./dashboard.css" />

+ 5 - 2
src/main/resources/static/application/dashboard/dashboard.js

@@ -239,10 +239,13 @@ $(()=>{
     $('.img').on('click', ()=>fetchBaseData());
 
 })
-
+function timeFormmater(time) {
+    let result = time < 10 ? "0" + time.toString() : time.toString();
+    return result;
+}
 async function fetchBaseData(){
     clearInterval(interval);
-    const all      = apiGet("/api/common/dashboard/traf-prcn-stat/traf-stts/all"); // 노드정보 요청
+    const all      = apiGet("/api/dashboard/traf-prcn-stat/traf-stts/all"); // 노드정보 요청
     const its      = apiGet("/api/common/stts/process/its"); // 링크정보 요청
     const stts     = apiGet("/api/common/stts/total"); // 링크정보 요청
     const database = apiGet("/api/common/stts/dbms"); // 도로정보 요청

+ 1 - 1
src/main/resources/static/application/facility/main/main.js

@@ -428,7 +428,7 @@ function hideAll(){
 
 export function fetchdrawGraph() {
     //console.time("***** fetchdrawGraph: ");
-    const graphUrl = apiGet('/api/common/dashboard/cmtr-grad-count-stts/ifsc');
+    const graphUrl = apiGet('/api/dashboard/cmtr-grad-count-stts/ifsc');
 
     Promise.all([graphUrl])
         .then((results) => Promise.all(results.map((r) => r.json())))

+ 1 - 1
src/main/resources/static/application/wall/main/main-func.js

@@ -802,7 +802,7 @@ async function fetchTraffic() {
     //console.time("***** fetchTraffic: ");
     const ifsc = apiGet("/api/manage/main/traffic/ifsc"); // 링크소통정보 요청
     const road = apiGet("/api/manage/main/traffic/road"); // 도로소통정보 요청
-    const currIfsc = apiGet('/api/common/dashboard/cmtr-grad-count-stts/ifsc');
+    const currIfsc = apiGet('/api/dashboard/cmtr-grad-count-stts/ifsc');
     Promise.all([ifsc, road, currIfsc])
         .then((results) => Promise.all(results.map((r) => r.json())))
         .then((values) => {