shjung 2 жил өмнө
parent
commit
eda9c17b20

+ 0 - 13
pom.xml

@@ -37,19 +37,6 @@
         <maven.test.skip>true</maven.test.skip>
     </properties>
 
-<!--    <repositories>-->
-<!--        <repository>-->
-<!--            <id>local-repository</id>-->
-<!--&lt;!&ndash;            <url>file://${webapp.lib}/</url>&ndash;&gt;-->
-<!--            <url>file://${basedir}/lib</url>-->
-<!--        </repository>-->
-<!--        <repository>-->
-<!--            <id>oracle</id>-->
-<!--            <name>ORACLE JDBC Repository</name>-->
-<!--            <url>http://repo.spring.io/plugins-release/</url>-->
-<!--        </repository>-->
-<!--    </repositories>-->
-
     <dependencies>
         <dependency>
             <groupId>org.fusesource.jansi</groupId>

+ 0 - 2
src/main/java/com/its/op/ItsOpServerApplication.java

@@ -57,8 +57,6 @@ public class ItsOpServerApplication extends SpringBootServletInitializer impleme
     }
 
     public static void main(String[] args) {
-        //System.setProperty("log4j.skipJansi", String.valueOf(true));
-
         SpringApplication application = new SpringApplicationBuilder()
                 .sources(ItsOpServerApplication.class)
                 .listeners(new ApplicationPidFileWriter("./conf/" + applicationName + ".pid"))

+ 12 - 4
src/main/java/com/its/op/controller/its/facility/TbFcltInfrController.java

@@ -4,8 +4,10 @@ import com.its.op.dto.its.facility.FcltWorkStepDto;
 import com.its.op.dto.its.facility.TbFcltInfrDto;
 import com.its.op.dto.its.facility.UnRegisteredFcltInfrDto;
 import com.its.op.service.its.facility.TbFcltInfrService;
+import com.sun.istack.Nullable;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
 import lombok.RequiredArgsConstructor;
 import org.springframework.validation.annotation.Validated;
 import org.springframework.web.bind.annotation.*;
@@ -30,14 +32,20 @@ public class TbFcltInfrController {
 
     @ApiOperation(value = "시설물 정보 전체조회(TB_FCLT_INFR)", response = TbFcltInfrDto.class, responseContainer = "ArrayList")
     @GetMapping(value = "", produces = {"application/json; charset=utf8"})
-    public List<TbFcltInfrDto> findAllList() {
-        return this.service.findAllList();
+    public List<TbFcltInfrDto> findAllList(
+            @ApiParam(name = "fcltType", value = "시설물유형", example = "CCTV", required = false)
+            @RequestParam(required = false, name="fcltType") @Nullable final String fcltType
+    ) {
+        return this.service.findAllList(fcltType);
     }
 
     @ApiOperation(value = "미등록 시설물 정보 전체조회(TB_FCLT_INFR)", response = UnRegisteredFcltInfrDto.class, responseContainer = "ArrayList")
     @GetMapping(value = "/unreg", produces = {"application/json; charset=utf8"})
-    public List<UnRegisteredFcltInfrDto> findAllUnRegisteredList() {
-        return this.service.findAllUnRegisteredList();
+    public List<UnRegisteredFcltInfrDto> findAllUnRegisteredList(
+            @ApiParam(name = "fcltType", value = "시설물유형", example = "CCTV", required = false)
+            @RequestParam(required = false, name="fcltType") @Nullable final String fcltType
+    ) {
+        return this.service.findAllUnRegisteredList(fcltType);
     }
 
     @ApiOperation(value = "시설물 정보 정보등록(TB_FCLT_INFR)", response = TbFcltInfrDto.class, responseContainer = "ArrayList")

+ 1 - 1
src/main/java/com/its/op/controller/its/history/TbLinkTrafClctHsAnalController.java

@@ -50,7 +50,7 @@ public class TbLinkTrafClctHsAnalController {
             @ApiParam(name = "TO_DT", value = "조회종료시각(YYYYMMDDHH24MI59)", example = "20221112152059", required = true)
             @RequestParam String TO_DT,
             @ApiParam(name = "id", value = "링크 ID 목록", example = "{2280212200,2280212300}", required = false)
-            @RequestParam(required = false, name = "id") @Nullable List<Long> ids) {
+            @RequestParam(required = false, name = "ids") @Nullable List<Long> ids) {
         return this.service.findAllAnalByDateRange(FROM_DT, TO_DT, ids);
     }
 

+ 5 - 4
src/main/java/com/its/op/controller/its/management/GisSearchController.java

@@ -8,6 +8,7 @@ import com.its.op.service.its.ifsc.TbIfscService;
 import com.its.op.service.its.link.TbLinkService;
 import com.its.op.service.its.node.TbNodeService;
 import com.its.op.service.its.road.TbRoadService;
+import com.sun.istack.Nullable;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import io.swagger.annotations.ApiParam;
@@ -33,7 +34,7 @@ public class GisSearchController {
     @GetMapping(value = "/node", produces = {"application/json; charset=utf8"})
     public List<TbNodeDto> findNodeByFilter(
             @ApiParam(name = "filter", value = "노드명/아이디", example = "교차로", required = false)
-            @RequestParam final String filter) {
+            @RequestParam(required = false, name="filter") @Nullable final String filter) {
         return this.nodeService.findByFilter(filter);
     }
 
@@ -41,7 +42,7 @@ public class GisSearchController {
     @GetMapping(value = "/link", produces = {"application/json; charset=utf8"})
     public List<TbLinkDto> findLinkByFilter(
             @ApiParam(name = "filter", value = "도로명/아이디", example = "지방도333호선", required = false)
-            @RequestParam final String filter) {
+            @RequestParam(required = false, name="filter") @Nullable final String filter) {
         return this.linkService.findByFilter(filter);
     }
 
@@ -49,7 +50,7 @@ public class GisSearchController {
     @GetMapping(value = "/ifsc", produces = {"application/json; charset=utf8"})
     public List<TbIfscDto> findIfscByFilter(
             @ApiParam(name = "filter", value = "구간명/아이디", example = "신갈우회도로", required = false)
-            @RequestParam final String filter) {
+            @RequestParam(required = false, name="filter") @Nullable final String filter) {
         return this.ifscService.findByFilter(filter);
     }
 
@@ -57,7 +58,7 @@ public class GisSearchController {
     @GetMapping(value = "/road", produces = {"application/json; charset=utf8"})
     public List<TbRoadDto> findRoadByFilter(
             @ApiParam(name = "filter", value = "도로명/아이디", example = "신수로", required = false)
-            @RequestParam final String filter) {
+            @RequestParam(required = false, name="filter") @Nullable final String filter) {
         return this.roadService.findByFilter(filter);
     }
 

+ 4 - 0
src/main/java/com/its/op/dao/repository/its/facility/TbFcltInfrRepository.java

@@ -4,6 +4,7 @@ import com.its.op.entity.its.facility.TbFcltInfr;
 import org.springframework.data.jpa.repository.JpaRepository;
 import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
 import org.springframework.data.jpa.repository.Query;
+import org.springframework.data.repository.query.Param;
 import org.springframework.stereotype.Repository;
 
 import java.util.List;
@@ -17,4 +18,7 @@ public interface TbFcltInfrRepository extends JpaRepository<TbFcltInfr, Long>, J
     @Query("select p from TbFcltInfr p where p.delYn = 'N'")
     List<TbFcltInfr> findAllList();
 
+    @Query("select p from TbFcltInfr p where p.delYn = 'N' and p.fcltType = :fcltType")
+    List<TbFcltInfr> findAllByFcltType(@Param("fcltType") String fcltType);
+
 }

+ 50 - 37
src/main/java/com/its/op/service/its/facility/TbFcltInfrService.java

@@ -59,9 +59,15 @@ public class TbFcltInfrService {
      * @return
      */
     @Transactional(readOnly = true)
-    public List<TbFcltInfrDto> findAllList() {
+    public List<TbFcltInfrDto> findAllList(String fcltType) {
         List<TbFcltInfrDto> result = new ArrayList<>();
-        List<TbFcltInfr> data = this.repo.findAllList();
+        List<TbFcltInfr> data;
+        if (fcltType == null || fcltType.isEmpty()) {
+            data = this.repo.findAllList();
+        }
+        else {
+            data = this.repo.findAllByFcltType(fcltType);
+        }
         data.forEach(obj -> {
             result.add(obj.toDto());
         });
@@ -147,50 +153,57 @@ public class TbFcltInfrService {
      * @return
      */
     @Transactional(readOnly = true)
-    public List<UnRegisteredFcltInfrDto> findAllUnRegisteredList() {
+    public List<UnRegisteredFcltInfrDto> findAllUnRegisteredList(String fcltType) {
         List<UnRegisteredFcltInfrDto> result = new ArrayList<>();
         Map<String, TbFcltInfrDto> regMap = new HashMap<>();
-        List<TbFcltInfrDto> regList = findAllList();
+        List<TbFcltInfrDto> regList = findAllList(fcltType);
         regList.forEach(obj -> {
             regMap.put(obj.getFcltId(), obj);
         });
 
-        List<TbVmsCtlrDto> vmsList = this.vmsCtlrService.findAllList();
-        vmsList.forEach(obj -> {
-            TbFcltInfrDto regObj = regMap.get(obj.getVmsCtlrId());
-            if (regObj == null) {
-                result.add(UnRegisteredFcltInfrDto.builder()
-                        .fcltType("VMS")
-                        .fcltId(obj.getVmsCtlrId())
-                        .fcltLctn(obj.getVmsNm())
-                        .build());
-            }
-        });
+        if (fcltType == null || "VMS".equals(fcltType)) {
+            List<TbVmsCtlrDto> vmsList = this.vmsCtlrService.findAllList();
+            vmsList.forEach(obj -> {
+                TbFcltInfrDto regObj = regMap.get(obj.getVmsCtlrId());
+                if (regObj == null) {
+                    result.add(UnRegisteredFcltInfrDto.builder()
+                            .fcltType("VMS")
+                            .fcltId(obj.getVmsCtlrId())
+                            .fcltLctn(obj.getVmsNm())
+                            .build());
+                }
+            });
+        }
 
-        List<TbVdsCtlrDto> vdsList = this.vdsCtlrService.findAllList();
-        vdsList.forEach(obj -> {
-            TbFcltInfrDto regObj = regMap.get(obj.getVdsCtlrId());
-            if (regObj == null) {
-                result.add(UnRegisteredFcltInfrDto.builder()
-                        .fcltType("VDS")
-                        .fcltId(obj.getVdsCtlrId())
-                        .fcltLctn(obj.getVdsNm())
-                        .build());
-            }
-        });
+        if (fcltType == null || "VDS".equals(fcltType)) {
+            List<TbVdsCtlrDto> vdsList = this.vdsCtlrService.findAllList();
+            vdsList.forEach(obj -> {
+                TbFcltInfrDto regObj = regMap.get(obj.getVdsCtlrId());
+                if (regObj == null) {
+                    result.add(UnRegisteredFcltInfrDto.builder()
+                            .fcltType("VDS")
+                            .fcltId(obj.getVdsCtlrId())
+                            .fcltLctn(obj.getVdsNm())
+                            .build());
+                }
+            });
+        }
 
-        List<TbCctvCtlrDto> cctvList = this.cctvCtlrService.findAllList();
-        cctvList.forEach(obj -> {
-            TbFcltInfrDto regObj = regMap.get(obj.getCctvCtlrId());
-            if (regObj == null) {
-                result.add(UnRegisteredFcltInfrDto.builder()
-                        .fcltType("CCTV")
-                        .fcltId(obj.getCctvCtlrId())
-                        .fcltLctn(obj.getIstlLctnNm())
-                        .build());
-            }
-        });
+        if (fcltType == null || "CCTV".equals(fcltType)) {
+            List<TbCctvCtlrDto> cctvList = this.cctvCtlrService.findAllList();
+            cctvList.forEach(obj -> {
+                TbFcltInfrDto regObj = regMap.get(obj.getCctvCtlrId());
+                if (regObj == null) {
+                    result.add(UnRegisteredFcltInfrDto.builder()
+                            .fcltType("CCTV")
+                            .fcltId(obj.getCctvCtlrId())
+                            .fcltLctn(obj.getIstlLctnNm())
+                            .build());
+                }
+            });
+        }
 
+        //TODO: DSRC, SIG, 스마트교차로
         return result;
     }
 

+ 1 - 1
src/main/resources/application.yml

@@ -52,7 +52,7 @@ spring:
 #      max-request-size: 215MB
 
   profiles:
-    active: prod,bis
+    active: prod
   main:
     banner-mode: off
   application: