shjung 2 年之前
父节点
当前提交
2765534963

+ 2 - 2
src/main/java/com/its/op/controller/its/vds/TbVdsCtlrSttsHsController.java

@@ -31,7 +31,7 @@ public class TbVdsCtlrSttsHsController {
             @ApiParam(name = "TO_DT", value = "조회종료시각(YYYYMMDDHH24MI59)", example = "20221112152000", required = true)
             @RequestParam String TO_DT,
             @ApiParam(name = "id", value = "VDS 관리번호 목록", example = "[00000001,00000002]", required = true)
-            @RequestParam List<String> id
+            @RequestParam List<Long> id
     ) {
         return this.service.findAllByDateRange(FROM_DT, TO_DT, id);
     }
@@ -44,7 +44,7 @@ public class TbVdsCtlrSttsHsController {
             @ApiParam(name = "TO_DT", value = "조회종료시각(YYYYMMDDHH24MI59)", example = "20221112152000", required = true)
             @RequestParam String TO_DT,
             @ApiParam(name = "id", value = "VDS 관리번호 목록", example = "[00000001,00000002]", required = true)
-            @RequestParam List<String> id
+            @RequestParam List<Long> id
     ) {
         return this.service.findAllFailByDateRange(FROM_DT, TO_DT, id);
     }

+ 2 - 2
src/main/java/com/its/op/controller/its/vds/TbVdsDtctController.java

@@ -29,7 +29,7 @@ public class TbVdsDtctController {
 
     @ApiOperation(value = "VDS 검지기 마스터 개별조회(TB_VDS_DTCT_MSTR)", response = TbVdsDtctDto.class)
     @GetMapping(value = "/{id}", produces = {"application/json; charset=utf8"})
-    public TbVdsDtctDto findById(@PathVariable final String id) {
+    public TbVdsDtctDto findById(@PathVariable final Long id) {
         return this.service.findById(id);
     }
 
@@ -41,7 +41,7 @@ public class TbVdsDtctController {
 
     @ApiOperation(value = "VDS 검지기 마스터 정보삭제-개별(TB_VDS_DTCT_MSTR)", response = TbVdsDtctDto.class)
     @DeleteMapping(value = "/{id}", produces = {"application/json; charset=utf8"})
-    public TbVdsDtctDto deleteDataById(@PathVariable("id") String id) {
+    public TbVdsDtctDto deleteDataById(@PathVariable("id") Long id) {
         return this.service.deleteById(id);
     }
 

+ 2 - 2
src/main/java/com/its/op/controller/its/vds/VdsControlController.java

@@ -29,7 +29,7 @@ public class VdsControlController {
     @PostMapping(value = "/reset/{id}", produces = {"application/json; charset=utf8"})
     public VdsControlDto.VdsControlRes controlReset(
             @ApiParam(name = "id", value = "제어기번호", example = "1", required = true)
-            @PathVariable("id") String id,
+            @PathVariable("id") Long id,
             @ApiParam(name = "req", value = "제어기번호", example = "1", required = true)
             @RequestBody @Valid final VdsControlDto.VdsControlResetReq req,
             HttpServletRequest request) {
@@ -45,7 +45,7 @@ public class VdsControlController {
     @PostMapping(value = "/stop-image/{id}", produces = {"application/json; charset=utf8"})
     public VdsControlDto.VdsControlRes requestStopImage(
             @ApiParam(name = "id", value = "제어기번호", example = "1", required = true)
-            @PathVariable("id") String id,
+            @PathVariable("id") Long id,
             @ApiParam(name = "req", value = "VDS 영상정보 요청", example = "[1, 0, ADMIN]", required = true)
             @RequestBody @Valid final VdsControlDto.VdsControlStopImageReq req,
             HttpServletRequest request) {

+ 2 - 2
src/main/java/com/its/op/dao/repository/its/vds/TbVdsCtlrSttsHsRepository.java

@@ -18,7 +18,7 @@ import java.util.List;
 public interface TbVdsCtlrSttsHsRepository extends JpaRepository<TbVdsCtlrSttsHs, TbVdsCtlrSttsHsKey>, JpaSpecificationExecutor<TbVdsCtlrSttsHs> {
 
     @Query("select p from TbVdsCtlrSttsHs p inner join fetch p.vds where p.crtnDt between :fromDt and :toDt and p.vdsCtlrNmbr in :ids")
-    List<TbVdsCtlrSttsHs> findAllByDateRange(@Param("fromDt") String fromDt, @Param("toDt") String toDt, @Param("ids") List<String> ids);
+    List<TbVdsCtlrSttsHs> findAllByDateRange(@Param("fromDt") String fromDt, @Param("toDt") String toDt, @Param("ids") List<Long> ids);
 
     @Query("select p.vdsCtlrNmbr as nmbr, count(p.vdsCtlrNmbr) as errCnt " +
             "  from TbVdsCtlrSttsHs p " +
@@ -31,7 +31,7 @@ public interface TbVdsCtlrSttsHsRepository extends JpaRepository<TbVdsCtlrSttsHs
            " where p.crtnDt between :fromDt and :toDt " +
            "   and (p.cmncSttsCd <> 'CMS0' or p.cboxDoorSttsCd <> 'CDS0' or p.cboxTmpr > 40)" +
            "   and p.vdsCtlrNmbr in :ids")
-    List<TbVdsCtlrSttsHs> findAllFailByDateRange(@Param("fromDt") String fromDt, @Param("toDt") String toDt, @Param("ids") List<String> ids);
+    List<TbVdsCtlrSttsHs> findAllFailByDateRange(@Param("fromDt") String fromDt, @Param("toDt") String toDt, @Param("ids") List<Long> ids);
 
     @Query(value =
             "SELECT NVL(SUM(CMS0CNT), 0) AS cms0Cnt, NVL(SUM(CMS1CNT), 0) AS cms1Cnt " +

+ 1 - 1
src/main/java/com/its/op/dao/repository/its/vds/TbVdsDtctRepository.java

@@ -9,7 +9,7 @@ import org.springframework.stereotype.Repository;
 import java.util.List;
 
 @Repository
-public interface TbVdsDtctRepository extends JpaRepository<TbVdsDtct, String>, JpaSpecificationExecutor<TbVdsDtct> {
+public interface TbVdsDtctRepository extends JpaRepository<TbVdsDtct, Long>, JpaSpecificationExecutor<TbVdsDtct> {
 
     @Query("select p from TbVdsDtct p inner join fetch p.vds left outer join p.link link")
     List<TbVdsDtct> findAll();

+ 1 - 1
src/main/java/com/its/op/dao/repository/its/vds/TbVdsDtctRltnLinkRepository.java

@@ -6,6 +6,6 @@ import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
 import org.springframework.stereotype.Repository;
 
 @Repository
-public interface TbVdsDtctRltnLinkRepository extends JpaRepository<TbVdsDtctLinkRltn, String/*TbVdsDtctLinkRltnKey*/>, JpaSpecificationExecutor<TbVdsDtctLinkRltn> {
+public interface TbVdsDtctRltnLinkRepository extends JpaRepository<TbVdsDtctLinkRltn, Long/*TbVdsDtctLinkRltnKey*/>, JpaSpecificationExecutor<TbVdsDtctLinkRltn> {
 
 }

+ 4 - 3
src/main/java/com/its/op/security/WebSecurityConfig.java

@@ -73,7 +73,8 @@ public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
                     .antMatchers("/MAPDATA/**").permitAll()
                     .antMatchers("/download/**").permitAll()
                     // 페이지 권한 설정
-                    .antMatchers("/application/facility/**", "/facility/**").permitAll()
+//                    .antMatchers("/application/facility/**", "/facility/**").permitAll()
+                    .antMatchers("/application/**", "/facility/**").permitAll()
                     .antMatchers("/application/wall/**", "/wall/**").permitAll()
                     .antMatchers("/application/login/**").permitAll()
                     .antMatchers("/api/auth/**").permitAll()
@@ -81,8 +82,8 @@ public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
                     .anyRequest().authenticated()
                     .and()
                     .formLogin()
-                    .loginPage("/application/login/login.html")
-                    //.loginPage("/api/auth/login.do")
+//                    .loginPage("/application/login/login.html")
+                    .loginPage("/application/op/00.main/main.html")
                     .loginProcessingUrl("/api/auth/login.do")
                     .defaultSuccessUrl("/application/op/00.main/main.html", true)
                     .usernameParameter("username")

+ 2 - 2
src/main/java/com/its/op/service/its/vds/TbVdsCtlrSttsHsService.java

@@ -37,7 +37,7 @@ public class TbVdsCtlrSttsHsService {
      * @return
      */
     @Transactional(readOnly = true)
-    public List<TbVdsCtlrSttsHsDto> findAllByDateRange(String fromDt, String toDt, List<String> ids) {
+    public List<TbVdsCtlrSttsHsDto> findAllByDateRange(String fromDt, String toDt, List<Long> ids) {
         List<TbVdsCtlrSttsHsDto> result = new ArrayList<>();
         List<TbVdsCtlrSttsHs> data = this.repo.findAllByDateRange(fromDt, toDt, ids);
         if (data != null) {
@@ -58,7 +58,7 @@ public class TbVdsCtlrSttsHsService {
      * @return
      */
     @Transactional(readOnly = true)
-    public List<TbVdsCtlrSttsHsDto> findAllFailByDateRange(String fromDt, String toDt, List<String> ids) {
+    public List<TbVdsCtlrSttsHsDto> findAllFailByDateRange(String fromDt, String toDt, List<Long> ids) {
         List<TbVdsCtlrSttsHsDto> result = new ArrayList<>();
         List<TbVdsCtlrSttsHs> data = this.repo.findAllFailByDateRange(fromDt, toDt, ids);
         if (data != null) {

+ 6 - 6
src/main/java/com/its/op/service/its/vds/TbVdsDtctService.java

@@ -29,7 +29,7 @@ public class TbVdsDtctService {
     private final TbCmmnCdRepository codeRepo;
 
     // 데이터 1건 조회, 없으면 exception
-    private TbVdsDtct requireOne(String id) throws NoSuchElementException {
+    private TbVdsDtct requireOne(Long id) throws NoSuchElementException {
         Optional<TbVdsDtct> info = this.repo.findById(id);
         if (info.isPresent()) {
             return info.get();
@@ -68,7 +68,7 @@ public class TbVdsDtctService {
 
     // 데이터 1건 조회(기존 데이터가 반드시 존재해야 함)
     @Transactional(readOnly = true)
-    public TbVdsDtctDto findById(String id) {
+    public TbVdsDtctDto findById(Long id) {
         TbVdsDtct entity = requireOne(id);
         return entity.toDto();
     }
@@ -80,7 +80,7 @@ public class TbVdsDtctService {
      * @return
      */
     @Transactional
-    public TbVdsDtctDto updateById(String id, TbVdsDtctDto.TbVdsDtctUpdReq req) {
+    public TbVdsDtctDto updateById(Long id, TbVdsDtctDto.TbVdsDtctUpdReq req) {
         TbVdsDtct entity = requireOne(id);
         entity.updateInfo(req);
         this.repo.save(entity);
@@ -136,7 +136,7 @@ public class TbVdsDtctService {
      * @return
      */
     @Transactional
-    public TbVdsDtctDto deleteById(String id) {
+    public TbVdsDtctDto deleteById(Long id) {
         TbVdsDtct entity = requireOne(id);
         // 검지기 링크 관계설정 정보 삭제
         this.linkRltnRepo.deleteById(id);
@@ -149,9 +149,9 @@ public class TbVdsDtctService {
 
     // 정보 삭제-목록, 존재하는 데이터 만 삭제
     @Transactional
-    public List<TbVdsDtctDto> deleteByIds(List<String> ids) {
+    public List<TbVdsDtctDto> deleteByIds(List<Long> ids) {
         List<TbVdsDtctDto> result = new ArrayList<>();
-        for (String id : ids) {
+        for (Long id : ids) {
             // 검지기 링크 관계설정 정보 삭제
             this.linkRltnRepo.deleteById(id);
             Optional<TbVdsDtct> obj = this.repo.findById(id);

+ 4 - 4
src/main/java/com/its/op/service/its/vds/VdsControlService.java

@@ -168,9 +168,9 @@ public class VdsControlService {
      * @param req : request buffer
      * @return : reset result
      */
-    public VdsControlDto.VdsControlRes controlReset(String id, VdsControlDto.VdsControlResetReq req) {
+    public VdsControlDto.VdsControlRes controlReset(Long id, VdsControlDto.VdsControlResetReq req) {
         //TbVdsCtlr vds = this.requireOne(id);
-        ByteBuffer cmdBuffer = getCommand((byte)0x0C, 0, Integer.valueOf(id), 0, 0);
+        ByteBuffer cmdBuffer = getCommand((byte)0x0C, 0, Math.toIntExact(id), 0, 0);
         return requestVdsCommandReset(cmdBuffer);
     }
 
@@ -180,9 +180,9 @@ public class VdsControlService {
      * @param req
      * @return
      */
-    public VdsControlDto.VdsControlRes requestStopImage(String id, VdsControlDto.VdsControlStopImageReq req) {
+    public VdsControlDto.VdsControlRes requestStopImage(Long id, VdsControlDto.VdsControlStopImageReq req) {
         //TbVdsCtlr vds = this.requireOne(id);
-        ByteBuffer cmdBuffer = getCommand((byte)0x16, 0, Integer.valueOf(id), req.getFrameNo(), req.getCameraNo());
+        ByteBuffer cmdBuffer = getCommand((byte)0x16, 0, Math.toIntExact(id), req.getFrameNo(), req.getCameraNo());
         return requestVdsCommandStopImage(cmdBuffer);
     }