Browse Source

first commit

shjung 2 years ago
parent
commit
36ef8b465e

+ 1 - 0
.gitignore

@@ -9,6 +9,7 @@ target/
 /images/
 /fonts/
 /REAL-RUN/
+/ftp/
 
 ### STS ###
 .apt_generated

+ 4 - 0
src/main/java/com/its/vms/VmsCommServerApplication.java

@@ -176,6 +176,10 @@ public class VmsCommServerApplication implements CommandLineRunner, ApplicationL
         VmsAtmpService vmsAtmpService = (VmsAtmpService)AppUtils.getBean(VmsAtmpService.class);
         vmsAtmpService.loadAtmpInfo();
 
+        VmsFormService vmsFormService = (VmsFormService)AppUtils.getBean(VmsFormService.class);
+        vmsFormService.loadFormInfo();
+
+        // VMS Communication Service Start.........
         VmsTcpCommServerService vmsTcpCommServerService = (VmsTcpCommServerService)AppUtils.getBean(VmsTcpCommServerService.class);
         vmsTcpCommServerService.run();
 

+ 12 - 0
src/main/java/com/its/vms/dao/mapper/VmsFormMapper.java

@@ -0,0 +1,12 @@
+package com.its.vms.dao.mapper;
+
+import com.its.vms.dto.TbVmsFormDto;
+import org.apache.ibatis.annotations.Mapper;
+
+import java.util.List;
+
+@Mapper
+public interface VmsFormMapper {
+
+    List<TbVmsFormDto> selectVmsFormInfo();
+}

+ 0 - 1
src/main/java/com/its/vms/dto/TbVmsFontNameDto.java

@@ -1,7 +1,6 @@
 package com.its.vms.dto;
 
 import com.its.vms.entity.TbVmsFontName;
-import io.swagger.annotations.ApiModel;
 import lombok.Builder;
 import lombok.Data;
 

+ 56 - 0
src/main/java/com/its/vms/dto/TbVmsFormDto.java

@@ -0,0 +1,56 @@
+package com.its.vms.dto;
+
+import com.its.vms.entity.TbVmsForm;
+import lombok.Builder;
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ *  DTO Class
+ */
+@Data
+@Builder
+public class TbVmsFormDto implements Serializable {
+    private static final long serialVersionUID = 1L;
+
+    private Integer vmsFormId;
+    private String vmsTypeCd;
+    private Integer vmsFormTypeCd;
+    private Integer vmsFormColrCd;
+    private String vmsFormNm;
+    private String vmsFormExpl;
+    private Integer vmsFormDsplDrctCd;
+    private Integer symbLibNmbr;
+    private byte[] vmsFormImag;
+    private Integer vmsFormDsplMthdCd;
+    private Long cctvMngmNmbr;
+    private String updtDt;
+    private String validYn;
+
+    public TbVmsForm toEntity() {
+        return TbVmsForm.builder()
+                .vmsFormId(this.vmsFormId)
+                .vmsTypeCd(this.vmsTypeCd)
+                .vmsFormTypeCd(this.vmsFormTypeCd)
+                .vmsFormColrCd(this.vmsFormColrCd)
+                .vmsFormNm(this.vmsFormNm)
+                .vmsFormExpl(this.vmsFormExpl)
+                .vmsFormDsplDrctCd(this.vmsFormDsplDrctCd)
+                .symbLibNmbr(this.symbLibNmbr)
+                .vmsFormImag(this.vmsFormImag)
+                .vmsFormDsplMthdCd(this.vmsFormDsplMthdCd)
+                .cctvMngmNmbr(this.cctvMngmNmbr)
+                .updtDt(this.updtDt)
+                .validYn(this.validYn)
+                .localFileName("")
+                .ftpFileName("")
+                .trfBackImgId(0)
+                .isTrfIfsc(false)     //도형식 하단 정보제공구간소통정보
+                .isTrfAxis(false)     //도형식 하단 축소통정보
+                .isTrfFixed(false)    //도형식 하단에 소통정보가 없을 경우 기본문자 표출여부, 20200515 추가함
+                .isIsNewForm(false)   //신규이거나 변경된 경우 true
+                .build();
+    }
+
+}

+ 67 - 0
src/main/java/com/its/vms/dto/TbVmsFormObjectDto.java

@@ -0,0 +1,67 @@
+package com.its.vms.dto;
+
+import com.its.vms.entity.TbVmsFormObject;
+import lombok.Builder;
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ *  DTO Class
+ */
+@Data
+@Builder
+public class TbVmsFormObjectDto implements Serializable {
+    private static final long serialVersionUID = 1L;
+
+    private Integer vmsFormObjectId;
+    private Integer vmsFormId;
+    private Integer vmsFormDsplRow;
+    private Integer vmsFormDsplClmn;
+    private Integer vmsFormObjectTypeCd;
+    private Integer vmsFontNameCd;
+    private Integer vmsFontColrCd;
+    private String vmsDsplTxt;
+    private byte[] vmsDsplFigr;
+    private Integer vmsDsplXcrdn;
+    private Integer vmsDsplYcrdn;
+    private String trfcFillCd;
+    private Integer vmsFontBold;
+    private Integer vmsFontSize;
+    private Integer vmsFontAlign;
+    private Integer vmsDsplWidth;
+    private Integer vmsDsplHeight;
+    private Integer vmsDsplBlinking;
+    private Integer vmsDsplBkColor;
+    private Integer vmsDsplSize;
+    private Integer symbLibNmbr;
+    private Long vmsIfscId;
+
+    public TbVmsFormObject toEntity() {
+        return TbVmsFormObject.builder()
+                .vmsFormObjectId(this.vmsFormObjectId)
+                .vmsFormId(this.vmsFormId)
+                .vmsFormDsplRow(this.vmsFormDsplRow)
+                .vmsFormDsplClmn(this.vmsFormDsplClmn)
+                .vmsFormObjectTypeCd(this.vmsFormObjectTypeCd)
+                .vmsFontNameCd(this.vmsFontNameCd)
+                .vmsFontColrCd(this.vmsFontColrCd)
+                .vmsDsplTxt(this.vmsDsplTxt)
+                .vmsDsplFigr(this.vmsDsplFigr)
+                .vmsDsplXcrdn(this.vmsDsplXcrdn)
+                .vmsDsplYcrdn(this.vmsDsplYcrdn)
+                .trfcFillCd(this.trfcFillCd)
+                .vmsFontBold(this.vmsFontBold)
+                .vmsFontSize(this.vmsFontSize)
+                .vmsFontAlign(this.vmsFontAlign)
+                .vmsDsplWidth(this.vmsDsplWidth)
+                .vmsDsplHeight(this.vmsDsplHeight)
+                .vmsDsplBlinking(this.vmsDsplBlinking)
+                .vmsDsplBkColor(this.vmsDsplBkColor)
+                .vmsDsplSize(this.vmsDsplSize)
+                .symbLibNmbr(this.symbLibNmbr)
+                .vmsIfscId(this.vmsIfscId)
+                .build();
+    }
+
+}

+ 43 - 0
src/main/java/com/its/vms/entity/TbVmsForm.java

@@ -0,0 +1,43 @@
+package com.its.vms.entity;
+
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+
+import java.io.Serializable;
+
+/**
+ *  Entity Class
+ */
+@Getter
+@Builder
+@NoArgsConstructor//(access = AccessLevel.PROTECTED)
+@AllArgsConstructor
+public class TbVmsForm implements Serializable {
+    private static final long serialVersionUID = 1L;
+
+    private Integer vmsFormId;
+    private String vmsTypeCd;
+    private Integer vmsFormTypeCd;
+    private Integer vmsFormColrCd;
+    private String vmsFormNm;
+    private String vmsFormExpl;
+    private Integer vmsFormDsplDrctCd;
+    private Integer symbLibNmbr;
+    private byte[] vmsFormImag;
+    private Integer vmsFormDsplMthdCd;
+    private Long cctvMngmNmbr;
+    private String updtDt;
+    private String validYn;
+
+    private String localFileName;
+    private String ftpFileName;
+    private Integer trfBackImgId;
+
+    private boolean isTrfIfsc;     //도형식 하단 정보제공구간소통정보
+    private boolean isTrfAxis;     //도형식 하단 축소통정보
+    private boolean isTrfFixed;    //도형식 하단에 소통정보가 없을 경우 기본문자 표출여부, 20200515 추가함
+    private boolean isIsNewForm;   //신규이거나 변경된 경우 true
+
+}

+ 43 - 0
src/main/java/com/its/vms/entity/TbVmsFormObject.java

@@ -0,0 +1,43 @@
+package com.its.vms.entity;
+
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+
+import java.io.Serializable;
+
+/**
+ *  Entity Class
+ */
+@Getter
+@Builder
+@NoArgsConstructor//(access = AccessLevel.PROTECTED)
+@AllArgsConstructor
+public class TbVmsFormObject implements Serializable {
+    private static final long serialVersionUID = 1L;
+
+    private Integer vmsFormObjectId;
+    private Integer vmsFormId;
+    private Integer vmsFormDsplRow;
+    private Integer vmsFormDsplClmn;
+    private Integer vmsFormObjectTypeCd;
+    private Integer vmsFontNameCd;
+    private Integer vmsFontColrCd;
+    private String vmsDsplTxt;
+    private byte[] vmsDsplFigr;
+    private Integer vmsDsplXcrdn;
+    private Integer vmsDsplYcrdn;
+    private String trfcFillCd;
+    private Integer vmsFontBold;
+    private Integer vmsFontSize;
+    private Integer vmsFontAlign;
+    private Integer vmsDsplWidth;
+    private Integer vmsDsplHeight;
+    private Integer vmsDsplBlinking;
+    private Integer vmsDsplBkColor;
+    private Integer vmsDsplSize;
+    private Integer symbLibNmbr;
+    private Long vmsIfscId;
+
+}

+ 55 - 0
src/main/java/com/its/vms/entity/eVmsFormType.java

@@ -0,0 +1,55 @@
+package com.its.vms.entity;
+
+import java.util.HashMap;
+import java.util.Map;
+
+public enum eVmsFormType {
+
+    eFormTp_traf_1   ( 11,  "소통상황(1단)"),
+    eFormTp_traf_2   ( 12,  "소통상황(2단)"),
+    eFormTp_traf_3   ( 13,  "소통상황(3단)"),
+    eFormTp_traf_4   ( 14,  "소통상황(4단)"),
+    eFormTp_figure   ( 15,  "소통상황(도형식배경소통정보)"),
+    eFormTp_congest  ( 16,  "정체소통상황"),
+    eFormTp_incident ( 20,  "돌발문안"),
+    eFormTp_gongsa   ( 30,  "공사/행사문안"),
+    eFormTp_hongbo   ( 40,  "홍보문안"),
+    eFormTp_deture   ( 50,  "우회도로"),
+    eFormTp_safe     ( 60,  "재난안전"),
+    eFormTp_video    ( 70,  "동영상"),
+    eFormTp_stream   ( 80,  "스트리밍영상"),
+    eFormTp_atmp     ( 90,  "대기환경"),
+    eFormTp_park     ( 100, "주차정보"),
+    eFormTp_evehicle ( 110, "긴급차량우선신호");
+
+    private final int value;
+    private final String string;
+
+    private static final Map<Integer, eVmsFormType> map;
+    static {
+        map = new HashMap<>();
+        for (eVmsFormType e : values()) {
+            map.put(Integer.valueOf(e.value), e);
+        }
+    }
+
+    public static eVmsFormType getByValue(int value) {
+        return map.get(value);
+    }
+    public static eVmsFormType getByValue(byte value) {
+        int intValue = (value & 0x0F);
+        return map.get(intValue);
+    }
+
+    eVmsFormType(int value, String string) {
+        this.value  = value;
+        this.string = string;
+    }
+
+    public int getValue() {
+        return this.value;
+    }
+    public String toString() {
+        return this.string;
+    }
+}

+ 52 - 0
src/main/java/com/its/vms/entity/eVmsScheduleType.java

@@ -0,0 +1,52 @@
+package com.its.vms.entity;
+
+import java.util.HashMap;
+import java.util.Map;
+
+public enum eVmsScheduleType {
+
+    eSchTp_traffic  ( 0,  "0:교통,"),
+    eSchTp_incident ( 1,  "1:돌발,"),
+    eSchTp_gongsa   ( 2,  "2:공사행사,"),
+    eSchTp_hongbo   ( 3,  "3:홍보,"),
+    eSchTp_deture   ( 4,  "4:우회,"),
+    eSchTp_congest  ( 5,  "5:정체,"),
+    eSchTp_safe     ( 6,  "6:안전,"),
+    eSchTp_video    ( 7,  "7:동영상,"),
+    eSchTp_stream   ( 8,  "8:스트리밍영상"),
+    eSchTp_atmp     ( 9,  "9:대기환경"),
+    eSchTp_park     ( 10, "10:주차정보"),
+    eSchTp_evehicle ( 11, "11:긴급차량우선신호"),
+    eSchTp_max      ( 12, "Max Schedule Count");
+
+    private final int value;
+    private final String string;
+
+    private static final Map<Integer, eVmsScheduleType> map;
+    static {
+        map = new HashMap<>();
+        for (eVmsScheduleType e : values()) {
+            map.put(Integer.valueOf(e.value), e);
+        }
+    }
+
+    public static eVmsScheduleType getByValue(int value) {
+        return map.get(value);
+    }
+    public static eVmsScheduleType getByValue(byte value) {
+        int intValue = (value & 0x0F);
+        return map.get(intValue);
+    }
+
+    eVmsScheduleType(int value, String string) {
+        this.value  = value;
+        this.string = string;
+    }
+
+    public int getValue() {
+        return this.value;
+    }
+    public String toString() {
+        return this.string;
+    }
+}

+ 42 - 0
src/main/java/com/its/vms/service/VmsFormService.java

@@ -0,0 +1,42 @@
+package com.its.vms.service;
+
+import com.its.vms.config.ApplicationConfig;
+import com.its.vms.dao.mapper.VmsFormMapper;
+import com.its.vms.dto.TbVmsFormDto;
+import com.its.vms.entity.TbVmsAtmp;
+import com.its.vms.entity.TbVmsForm;
+import lombok.RequiredArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+import java.util.concurrent.ConcurrentHashMap;
+
+@Slf4j
+@Service
+@RequiredArgsConstructor
+public class VmsFormService {
+
+    private final ApplicationConfig config;
+    private final VmsFormMapper vmsFormMapper;
+
+    public ConcurrentHashMap<Long, TbVmsAtmp> atmpMap = new ConcurrentHashMap<>();
+
+    public void loadFormInfo() {
+        loadVmsFormInfo();
+    }
+
+    public void loadVmsFormInfo() {
+        try {
+            List<TbVmsFormDto> infoList  = this.vmsFormMapper.selectVmsFormInfo();
+            log.info("VmsFormService.loadVmsFormInfo(), {} EA", infoList.size());
+            infoList.forEach(dto -> {
+                TbVmsForm obj = dto.toEntity();
+            });
+        }
+        catch (Exception e) {
+            log.error("VmsFormService.loadVmsFormInfo: {}", e.toString());
+        }
+    }
+
+}

+ 25 - 0
src/main/resources/mybatis/mapper/VmsFormMapper.xml

@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+
+<mapper namespace="com.its.vms.dao.mapper.VmsFormMapper">
+
+    <select id="selectVmsFormInfo" resultType="com.its.vms.dto.TbVmsFormDto">
+    <![CDATA[
+        select t1.vms_form_id           AS vmsFormId,
+               t1.vms_type_cd           AS vmsTypeCd,
+               t1.vms_form_type_cd      AS vmsFormTypeCd,
+               t1.vms_form_colr_cd      AS vmsFormColrCd,
+               t1.vms_form_nm           AS vmsFormNm,
+               t1.vms_form_expl         AS vmsFormExpl,
+               t1.vms_form_dspl_drct_cd AS vmsFormDsplDrctCd,
+               t1.symb_lib_nmbr         AS symbLibNmbr,
+               t1.vms_form_imag         AS vmsFormImag,
+               t1.vms_form_dspl_mthd_cd AS vmsFormDsplMthdCd,
+               t1.cctv_mngm_nmbr        AS cctvMngmNmbr,
+               t1.updt_dt               AS updtDt,
+               t1.valid_yn              AS validYn
+        from tb_vms_form t1
+        ]]>
+    </select>
+
+</mapper>