shjung 3 anos atrás
pai
commit
ca5c8ebd49

+ 1 - 1
conf/vds-comm-server.pid

@@ -1 +1 @@
-16640
+10764

+ 20 - 1
src/main/java/com/its/vds/entity/TbVdsCtlr.java

@@ -3,6 +3,7 @@ package com.its.vds.entity;
 import com.its.app.utils.SysUtils;
 import com.its.vds.domain.NET;
 import com.its.vds.xnettcp.vds.protocol.*;
+import com.its.vds.xnetudp.protocol.voVdsState;
 import io.netty.channel.Channel;
 import io.netty.channel.ChannelFuture;
 import lombok.Getter;
@@ -37,7 +38,7 @@ public class TbVdsCtlr {
 	private int    STTS_CLCT_CYCL;
 	private String VALD_YN;
 	private String DEL_YN;
-	
+
 	private Map<String, TbVdsDtct> 	vdsDtctMap;
 	private int 			 		netState;
 	private boolean       			isDupCon;
@@ -239,4 +240,22 @@ public class TbVdsCtlr {
 		}
 		return result;
 	}
+
+	public voVdsState getVdsStts() {
+		voVdsState ss = new voVdsState();
+		ss.setCTLR_NMBR(getVDS_CTLR_NMBR());
+		ss.setComm(getStts().getSttsComm());				//Comm
+		ss.setVideoInput(getStts().getSttsVideoInput());	//VideoInput
+		ss.setHeater(getStts().getSttsHeater());			//Heater
+		ss.setFan(getStts().getSttsFan());				    //Fan
+		ss.setBackDoorOpen(getStts().getSttsBackDoor());	//BackDoorOpen
+		ss.setFrontDoorOpen(getStts().getSttsFrontDoor());	//FrontDoorOpen
+		ss.setTemperature(getStts().getSttsTemp());		    //Temperature
+		ss.setFanMode(getStts().getSttsFanMode());			//FanMode
+		ss.setFanRunTemp(getStts().getSttsFanRunTemp());	//FanRunTemp
+		ss.setHetrMode(getStts().getSttsHetrMode());		//HetrMode
+		ss.setHetrRunTemp(getStts().getSttsHetrRunTemp());	//HetrRunTemp
+
+		return ss;
+	}
 }

+ 25 - 31
src/main/java/com/its/vds/scheduler/SchedulerTask.java

@@ -25,7 +25,7 @@ public class SchedulerTask {
     private final VdsCtlrService vdsCtlrService;
     private final StatisticsServices statisticsServices;
 
-    @Scheduled(cron = "5 * * * * *")  // 1분주기 작업 실행
+    @Scheduled(cron = "4 * * * * *")  // 1분주기 작업 실행
     public void UnitSystSchedule() {
         if (!this.processConfig.isStartSchedule()) {
             return;
@@ -37,39 +37,33 @@ public class SchedulerTask {
         // 제어기 상태정보 업데이트(제어기/프로세스 상태정보 UDP 전송)
         this.vdsCtlrService.updateCtlrStts(true);
         log.info("         UnitSystSchedule: ..end. {} ms. {}", elapsed.milliSeconds(), Thread.currentThread().getName());
-/*
-        TcpServerDataProcess tcpServerDataProcess = (TcpServerDataProcess) AppUtils.getBean(TcpServerDataProcess.class);
-        for (int ii = 0; ii < 100; ii++) {
-            String id = Integer.toString(ii);
-            tcpServerDataProcess.add(new TcpServerData(id, null, null));
-        }*/
     }
 
-//    @Scheduled(cron = "10/30 * * * * *")    // 30초마다 요청(10초, 40초)
-//    public void VdsTrafficRequestSchedule() {
-//        if (!this.processConfig.isStartSchedule()) {
-//            return;
-//        }
-//        Elapsed elapsed = new Elapsed();
-//        log.info("VdsTrafficRequestSchedule: start. {}", Thread.currentThread().getName());
-//        // 제어기 동기화 요청
-//        // 교통데이터 요청
-//        this.vdsCtlrService.requestTraffic();
-//        log.info("VdsTrafficRequestSchedule: ..end. {} ms. {}", elapsed.milliSeconds(), Thread.currentThread().getName());
-//    }
+    @Scheduled(cron = "10/30 * * * * *")    // 30초마다 요청(10초, 40초)
+    public void VdsSynchronizationSchedule() {
+        if (!this.processConfig.isStartSchedule()) {
+            return;
+        }
+        Elapsed elapsed = new Elapsed();
+        log.info("VdsSynchronizationSchedule: start. {}", Thread.currentThread().getName());
+        // 제어기 동기화 요청
+        // 교통데이터 요청
+        this.vdsCtlrService.requestSynchronization();
+        log.info("VdsSynchronizationSchedule: ..end. {} ms. {}", elapsed.milliSeconds(), Thread.currentThread().getName());
+    }
 
-//    @Scheduled(cron = "15/30 * * * * *")    // 30초마다 요청(15초, 45초)
-//    public void VdsVehicleRequestSchedule() {
-//        if (!this.processConfig.isStartSchedule()) {
-//            return;
-//        }
-//        Elapsed elapsed = new Elapsed();
-//        // VDS 교통 데이터를 요청한 다음에 차량 정보를 요청한다.
-//        // 제어기에서 동기화가 안되기 때문에 교통 데이터를 요청한 다음에 5초 후에 요청한다.
-//        log.info("VdsVehicleRequestSchedule: start. {}", Thread.currentThread().getName());
-//        this.vdsCtlrService.requestVehicle();
-//        log.info("VdsVehicleRequestSchedule: ..end. {} ms. {}", elapsed.milliSeconds(), Thread.currentThread().getName());
-//    }
+    @Scheduled(cron = "15/30 * * * * *")    // 30초마다 요청(15초, 45초)
+    public void VdsDataRequestSchedule() {
+        if (!this.processConfig.isStartSchedule()) {
+            return;
+        }
+        Elapsed elapsed = new Elapsed();
+        // VDS 교통 데이터를 요청한 다음에 차량 정보를 요청한다.
+        // 제어기에서 동기화가 안되기 때문에 교통 데이터를 요청한 다음에 5초 후에 요청한다.
+        log.info("VdsDataRequestSchedule: start. {}", Thread.currentThread().getName());
+        this.vdsCtlrService.requestData();
+        log.info("VdsDataRequestSchedule: ..end. {} ms. {}", elapsed.milliSeconds(), Thread.currentThread().getName());
+    }
 
     @Scheduled(cron = "40 0/5 * * * *")    // 정주기 5분 40초에 스케쥴 실행
     public void StatisticsSchedule() {

+ 68 - 85
src/main/java/com/its/vds/service/VdsCtlrService.java

@@ -20,6 +20,7 @@ import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
 import javax.annotation.PostConstruct;
+import java.nio.ByteBuffer;
 import java.util.*;
 
 @Slf4j
@@ -175,20 +176,7 @@ public class VdsCtlrService {
                 vds.getStts().initStts(false);
             }
 
-            voVdsState ss = new voVdsState();
-            ss.setCTLR_NMBR(Integer.parseInt(vds.getVDS_CTLR_NMBR()));
-            ss.setComm(vds.getStts().getSttsComm());				//Comm
-            ss.setVideoInput(vds.getStts().getSttsVideoInput());	//VideoInput
-            ss.setHeater(vds.getStts().getSttsHeater());			//Heater
-            ss.setFan(vds.getStts().getSttsFan());				    //Fan
-            ss.setBackDoorOpen(vds.getStts().getSttsBackDoor());	//BackDoorOpen
-            ss.setFrontDoorOpen(vds.getStts().getSttsFrontDoor());	//FrontDoorOpen
-            ss.setTemperature(vds.getStts().getSttsTemp());		    //Temperature
-            ss.setFanMode(vds.getStts().getSttsFanMode());			//FanMode
-            ss.setFanRunTemp(vds.getStts().getSttsFanRunTemp());	//FanRunTemp
-            ss.setHetrMode(vds.getStts().getSttsHetrMode());		//HetrMode
-            ss.setHetrRunTemp(vds.getStts().getSttsHetrRunTemp());	//HetrRunTemp
-
+            voVdsState ss = vds.getVdsStts();
             stts.getObjList().add(ss);
 
             if (isRun) {
@@ -213,6 +201,9 @@ public class VdsCtlrService {
         stts.setNormal((short)normal);
         stts.setModule((short)0);
 
+        /**
+         * 운영단말로 상태정보 등을 전송하지 않는다.(웹 기반)
+         */
 //        // 제어기 상태정보 운영단말 전송
 //        CenterCommClientSender notify = (CenterCommClientSender) AppUtils.getBean(CenterCommClientSender.class);
 //        notify.run(null, 0, stts.getBuffer());
@@ -234,45 +225,44 @@ public class VdsCtlrService {
         log.info("VdsCtlrService.updateCtlrStts: total {}, normal {}, error {}", normal + error, normal, error);
     }
 
-    public void requestTraffic() {
+    /**
+     * 제어기 동기화 실행
+     * 1. 온도정보 요청(0x1E)
+     * 2. 제어기 동기화(0x01)
+     *   - 제어기 동기화 후 5초 후에 데이터를 요청한다.
+     */
+    public void requestSynchronization() {
         long curTime = System.currentTimeMillis();
         int min  = (int)(curTime / (1000 * 60) );
         int sec  = (int)(curTime /  1000);
 
-        TbVdsCtlr vds;
+        TbVdsCtlr obj;
         /*
          * send Synchronize
          */
-        byte frameNo;
+        //byte frameNo;
         for (Map.Entry<String, TbVdsCtlr> e : AppRepository.getInstance().getCtlrMap().entrySet()) {
-            vds = e.getValue();
-            MDC.put("id", vds.getLogKey());
-            if (vds.getNetState() >= NET.LOGIN_REQ && vds.getChannel() != null) {
-                vds.setSyncTime(curTime);
-                frameNo = (byte)((min*60 + sec) / vds.getTRAF_CLCT_CYCL() + 1);
-//                VDS_REQ_HEAD reqHdr = new VDS_REQ_HEAD();
-//                byte[] headBytes = reqHdr.makeHead(VDS_HEAD.evds_Synchronize, vds, 10);
-//                ByteBuffer sendBuff = ByteBuffer.allocate(VDS_REQ_HEAD.VDS_REQ_HEADER_SIZE + reqHdr.getLength());
-//                sendBuff.order(ByteOrder.BIG_ENDIAN);
-//                sendBuff.put(headBytes);
-//                sendBuff.put(frameNo);
-//                ChannelFuture f = vds.getChannel().writeAndFlush(sendBuff);
-//                f.awaitUninterruptibly();
-//                if (f.isDone() || f.isSuccess()) {
-//                    log.info("SEND_0: [{}], evds_Synchronize: {} headBytes, {} sendBytes. [{}]", vds.getVDS_CTLR_IP(), headBytes.length, sendBuff.array().length, vds.getVDS_CTLR_ID());
-//                } else {
-//                    log.error("SEND_0: [{}], evds_Synchronize: {} headBytes, {} sendBytes, Failed. [{}]", vds.getVDS_CTLR_IP(), headBytes.length, sendBuff.array().length, vds.getVDS_CTLR_ID());
-//                }
-            }
-            else {
-                log.warn("SEND_0: [{}], evds_Synchronize: Not Connected. [{}]", vds.getVDS_CTLR_IP(), vds.getVDS_CTLR_ID());
+            obj = e.getValue();
+            MDC.put("id", obj.getLogKey());
+            if (obj.getChannel() != null) {
+                obj.setSyncTime(curTime);
+                //frameNo = (byte)((min*60 + sec) / obj.getTRAF_CLCT_CYCL() + 1);
+                ByteBuffer sendBuffer = obj.getReqTemperature().getByteBuffer();
+                boolean result = obj.sendData(sendBuffer, 0, "vds_Temperature");
+                if (result) {
+                    log.info("[{}] [{}], vds_Temperature: Request OK.", obj.getVDS_CTLR_ID(), obj.getVDS_CTLR_IP());
+                } else {
+                    log.info("[{}] [{}], vds_Temperature: Request Failed.", obj.getVDS_CTLR_ID(), obj.getVDS_CTLR_IP());
+                }
+            } else {
+                log.info("[{}] [{}], vds_Temperature: Request Failed-Not Connected.", obj.getVDS_CTLR_ID(), obj.getVDS_CTLR_IP());
             }
-            MDC.remove(vds.getLogKey());
+            MDC.remove(obj.getLogKey());
             MDC.clear();
         }
 
         try {
-            Thread.sleep(500);
+            Thread.sleep(800);
         } catch (InterruptedException e1) {
             e1.printStackTrace();
         }
@@ -281,54 +271,47 @@ public class VdsCtlrService {
          * send req traffic
          */
         for (Map.Entry<String, TbVdsCtlr> e : AppRepository.getInstance().getCtlrMap().entrySet()) {
-            vds = e.getValue();
-            MDC.put("id", vds.getLogKey());
-//            if (vds.getNetState() >= NET.LOGIN_REQ && vds.getChannel() != null) {
-//                VDS_REQ_HEAD reqHdr = new VDS_REQ_HEAD();
-//                byte[] headBytes = reqHdr.makeHead(VDS_HEAD.evds_Traffic, vds, 9);
-//                ByteBuffer sendBuff = ByteBuffer.allocate(VDS_REQ_HEAD.VDS_REQ_HEADER_SIZE + reqHdr.getLength());
-//                sendBuff.order(ByteOrder.BIG_ENDIAN);
-//                sendBuff.put(headBytes);
-//                ChannelFuture f = vds.getChannel().writeAndFlush(sendBuff);
-//                f.awaitUninterruptibly();
-//                if (f.isDone() || f.isSuccess()) {
-//                    log.info("SEND_0: [{}], evds_Traffic: {} headBytes, {} sendBytes. [{}]", vds.getVDS_CTLR_IP(), headBytes.length, sendBuff.array().length, vds.getVDS_CTLR_ID());
-//                } else {
-//                    log.error("SEND_0: [{}], evds_Traffic: {} headBytes, {} sendBytes, Failed. [{}]", vds.getVDS_CTLR_IP(), headBytes.length, sendBuff.array().length, vds.getVDS_CTLR_ID());
-//                }
-//            }
-//            else {
-//                log.warn("SEND_0: [{}], evds_Traffic: Not Connected. [{}]", vds.getVDS_CTLR_IP(), vds.getVDS_CTLR_ID());
-//            }
-            MDC.remove(vds.getLogKey());
+            obj = e.getValue();
+            MDC.put("id", obj.getLogKey());
+            if (obj.getChannel() != null) {
+                obj.setSyncTime(curTime);
+                ByteBuffer sendBuffer = obj.getReqSynchronize().getByteBuffer();
+                boolean result = obj.sendData(sendBuffer, 0, "vds_Synchronization");
+                if (result) {
+                    log.info("[{}] [{}], vds_Synchronization: Request OK.", obj.getVDS_CTLR_ID(), obj.getVDS_CTLR_IP());
+                } else {
+                    log.info("[{}] [{}], vds_Synchronization: Request Failed.", obj.getVDS_CTLR_ID(), obj.getVDS_CTLR_IP());
+                }
+            } else {
+                log.info("[{}] [{}], vds_Synchronization: Request Failed-Not Connected.", obj.getVDS_CTLR_ID(), obj.getVDS_CTLR_IP());
+            }
+            MDC.remove(obj.getLogKey());
             MDC.clear();
         }
     }
 
-    public void requestVehicle() {
-//        TbVdsCtlr vds;
-//        for (Map.Entry<String, TbVdsCtlr> e : AppRepository.getInstance().getCtlrMap().entrySet()) {
-//            vds = e.getValue();
-//            MDC.put("id", vds.getLogKey());
-//            if (vds.getNetState() >= NET.LOGIN_REQ && vds.getChannel() != null) {
-//                VDS_REQ_HEAD reqHdr = new VDS_REQ_HEAD();
-//                byte[] headBytes = reqHdr.makeHead(VDS_HEAD.evds_IndividualVehicle, vds, 9);
-//                ByteBuffer sendBuff = ByteBuffer.allocate(VDS_REQ_HEAD.VDS_REQ_HEADER_SIZE + reqHdr.getLength());
-//                sendBuff.order(ByteOrder.BIG_ENDIAN);
-//                sendBuff.put(headBytes);
-//                ChannelFuture f = vds.getChannel().writeAndFlush(sendBuff);
-//                f.awaitUninterruptibly();
-//                if (f.isDone() || f.isSuccess()) {
-//                    log.info("SEND_0: [{}], evds_IndividualVehicle: {} headBytes, {} sendBytes. [{}]", vds.getVDS_CTLR_IP(), headBytes.length, sendBuff.array().length, vds.getVDS_CTLR_ID());
-//                } else {
-//                    log.error("SEND_0: [{}], evds_IndividualVehicle: {} headBytes, {} sendBytes, Failed. [{}]", vds.getVDS_CTLR_IP(), headBytes.length, sendBuff.array().length, vds.getVDS_CTLR_ID());
-//                }
-//            }
-//            else {
-//                log.warn("SEND_0: [{}], evds_IndividualVehicle: Not Connected. [{}]", vds.getVDS_CTLR_IP(), vds.getVDS_CTLR_ID());
-//            }
-//            MDC.remove(vds.getLogKey());
-//            MDC.clear();
-//        }
+    /**
+     * 교통 데이터 요청
+     * - 제어기 동기화 명령 후 5초 지난 후에 실행
+     */
+    public void requestData() {
+        TbVdsCtlr obj;
+        for (Map.Entry<String, TbVdsCtlr> e : AppRepository.getInstance().getCtlrMap().entrySet()) {
+            obj = e.getValue();
+            MDC.put("id", obj.getLogKey());
+            if (obj.getChannel() != null) {
+                ByteBuffer sendBuffer = obj.getReqData().getByteBuffer();
+                boolean result = obj.sendData(sendBuffer, 0, "vds_Data");
+                if (result) {
+                    log.info("[{}] [{}], vds_Data: Request OK.", obj.getVDS_CTLR_ID(), obj.getVDS_CTLR_IP());
+                } else {
+                    log.info("[{}] [{}], vds_Data: Request Failed.", obj.getVDS_CTLR_ID(), obj.getVDS_CTLR_IP());
+                }
+            } else {
+                log.info("[{}] [{}], vds_Data: Request Failed-Not Connected.", obj.getVDS_CTLR_ID(), obj.getVDS_CTLR_IP());
+            }
+            MDC.remove(obj.getLogKey());
+            MDC.clear();
+        }
     }
 }

+ 12 - 3
src/main/java/com/its/vds/xnettcp/vds/VdsTcpClient.java

@@ -1,5 +1,6 @@
 package com.its.vds.xnettcp.vds;
 
+import com.its.app.AppUtils;
 import com.its.vds.config.ControllerCommConfig;
 import com.its.vds.entity.TbVdsCtlr;
 import com.its.vds.xnettcp.vds.codec.VdsTcpClientDecoder;
@@ -7,6 +8,7 @@ import com.its.vds.xnettcp.vds.codec.VdsTcpClientEncoder;
 import com.its.vds.xnettcp.vds.handler.VdsTcpClientIdleHandler;
 import com.its.vds.xnettcp.vds.handler.VdsTcpClientInboundHandler;
 import com.its.vds.xnettcp.vds.process.VdsDataProcess;
+import com.its.vds.xnetudp.service.CenterCommResponseService;
 import io.netty.bootstrap.Bootstrap;
 import io.netty.channel.*;
 import io.netty.channel.socket.SocketChannel;
@@ -103,9 +105,8 @@ public class VdsTcpClient implements Callable<Object> {
      */
     protected void channelOpen(Channel channel) {
         log.info("VDS Controller connected: channel {}", channel);
-        this.controller.channelOpen(channel);
-
         TbVdsCtlr obj = this.controller;
+        obj.channelOpen(channel);
 
         // 온도정보 요청
         ByteBuffer sendBuff;
@@ -127,7 +128,15 @@ public class VdsTcpClient implements Callable<Object> {
      */
     protected synchronized void channelClosed(Channel channel) {
         log.error("VDS Controller closed: channel {}", channel);
-        this.controller.channelClosed();
+        TbVdsCtlr obj = this.controller;
+        if (obj.getChannel() != null) {
+            // 연결 되어 있다가 종료 된 경우임....
+            // 클라이언트 연결 종료정보를 운영단말로 전송한다.
+            CenterCommResponseService centerCommResponseService = (CenterCommResponseService) AppUtils.getBean(CenterCommResponseService.class);
+            centerCommResponseService.notifyStatus(obj, false);
+        }
+        obj.channelClosed();
+
         channel.close();
         channel.eventLoop().schedule(this, this.commConfig.getRetrySeconds(), TimeUnit.SECONDS);
     }

+ 1 - 3
src/main/java/com/its/vds/xnettcp/vds/VdsTcpClientBootstrapFactory.java

@@ -30,12 +30,10 @@ public class VdsTcpClientBootstrapFactory {
         bootstrap.channel(NioSocketChannel.class);
         bootstrap.option(ChannelOption.AUTO_READ, true);
         bootstrap.option(ChannelOption.TCP_NODELAY, true);
-        bootstrap.option(ChannelOption.SO_KEEPALIVE, true);//false);
         bootstrap.option(ChannelOption.SO_RCVBUF, 8192);
         bootstrap.option(ChannelOption.SO_SNDBUF, 8192);
         bootstrap.option(ChannelOption.SO_KEEPALIVE, false);
-        bootstrap.option(ChannelOption.SO_KEEPALIVE, false);
-        bootstrap.option(ChannelOption.SO_KEEPALIVE, false);
+        //bootstrap.option(ChannelOption.RCVBUF_ALLOCATOR, new FixedRecvByteBufAllocator(2048));
         bootstrap.option(ChannelOption.CONNECT_TIMEOUT_MILLIS, this.connectTimeout * 1000);
 //        bootstrap.handler(new ChannelInitializer<SocketChannel>() {
 //            // VDS 전송 요청을 먼저하고 데이터를 수신한다.

+ 1 - 1
src/main/java/com/its/vds/xnettcp/vds/process/Job_Data.java

@@ -61,7 +61,7 @@ public class Job_Data implements JobProtocol {
 			occ  = (float)(occ1 + (occ2 * 0.01));
 			spc_occ  = (float)(spc_occ1 + (spc_occ2 * 0.01));
 
-			log.error("Job_Data, [{}]: Lane:{}, TFVL:{}, SPD:{}, OCC:{}, LEN:{}, HDR:{}, SOCC:{}, SSPD:{}",
+			log.info("Job_Data, [{}]: Lane:{}, TFVL:{}, SPD:{}, OCC:{}, LEN:{}, HDR:{}, SOCC:{}, SSPD:{}",
 					this.packet.getObjectInfo(), ii+1, tfvl, spd, occ, len, hdr, spc_occ, spc_spd);
 		}
 		return 1;

+ 21 - 1
src/main/java/com/its/vds/xnettcp/vds/process/Job_Temperature.java

@@ -1,6 +1,11 @@
 package com.its.vds.xnettcp.vds.process;
 
+import com.its.app.AppUtils;
+import com.its.app.utils.SysUtils;
+import com.its.vds.domain.NET;
+import com.its.vds.entity.TbVdsCtlr;
 import com.its.vds.xnettcp.vds.protocol.VdsResFramePacket;
+import com.its.vds.xnetudp.service.CenterCommResponseService;
 import lombok.RequiredArgsConstructor;
 import lombok.extern.slf4j.Slf4j;
 
@@ -28,7 +33,22 @@ public class Job_Temperature implements JobProtocol {
 		int InputVoltage = (int)(body[1] & 0xFF);
 		int OutputVoltage = (int)(body[2] & 0xFF);
 		log.info("Job_Temperature, [{}]: {}, {}, {}", this.packet.getObjectInfo(), CBOX_TMPR, InputVoltage, OutputVoltage);
-		this.packet.getVdsObj().getStts().setCBOX_TMPR(CBOX_TMPR);
+
+		TbVdsCtlr obj = this.packet.getVdsObj();
+		obj.getStts().setCBOX_TMPR(CBOX_TMPR);
+
+		if (obj.getNetState() != NET.LOGINED) {
+			String UPDT_DT = SysUtils.getSysTime();
+			log.info("[{}] [{}], vds_Temperature: First Received. Login Flag OK. {}", obj.getVDS_CTLR_ID(), obj.getVDS_CTLR_IP(), UPDT_DT);
+			obj.setNetState(NET.LOGINED);
+			obj.getStts().setUPDT_DT(UPDT_DT);
+			obj.getStts().setCMNC_STTS_CD("CMS0");
+
+			// 클라이언트 연결 정보를 운영단말로 전송한다.
+			CenterCommResponseService centerCommResponseService = (CenterCommResponseService) AppUtils.getBean(CenterCommResponseService.class);
+			centerCommResponseService.notifyStatus(obj, true);
+		}
+
 		return 1;
 	}
 

+ 1 - 1
src/main/java/com/its/vds/xnetudp/protocol/CENTER_VDS_RES_STATE.java

@@ -60,7 +60,7 @@ public class CENTER_VDS_RES_STATE extends CENTER_COMM_MESSAGE {
 
 		int cnt = 0;
 		for (voVdsState vo : this.objList) {
-			byteBuffer.putInt(vo.getCTLR_NMBR());
+			byteBuffer.putInt(Integer.parseInt(vo.getCTLR_NMBR()));
 			byteBuffer.put(vo.getComm());
 
 			byteBuffer.put(vo.getVideoInput());

+ 1 - 1
src/main/java/com/its/vds/xnetudp/protocol/voVdsState.java

@@ -11,7 +11,7 @@ public class voVdsState {
     public static byte error = 0x01;
     public static int STATE_SIZE = 16;
 
-    private int  CTLR_NMBR;
+    private String  CTLR_NMBR;
     private byte Comm;                 /* 유선통신상태, 0:정상 1:장애 */
 
     private byte VideoInput;           // O-[D07] Video Input 여부, 영상검지기 제어기로 카메라 영상입력이 없을 때 : 1

+ 5 - 20
src/main/java/com/its/vds/xnetudp/service/CenterCommResponseService.java

@@ -1,15 +1,13 @@
 package com.its.vds.xnetudp.service;
 
 import com.its.app.AppUtils;
-import com.its.app.utils.SysUtils;
+import com.its.vds.entity.TbVdsCtlr;
+import com.its.vds.entity.TbVdsCtlrStts;
 import com.its.vds.process.DbmsJobData;
 import com.its.vds.process.DbmsJobProcess;
 import com.its.vds.process.DbmsJobType;
-import com.its.vds.entity.TbVdsCtlr;
-import com.its.vds.entity.TbVdsCtlrStts;
 import com.its.vds.xnetudp.protocol.CENTER_VDS_RES_STATE;
 import com.its.vds.xnetudp.protocol.voVdsState;
-import com.its.vds.xnetudp.thread.CenterCommClientSender;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.stereotype.Service;
 
@@ -31,20 +29,7 @@ public class CenterCommResponseService {
 
         List<TbVdsCtlrStts> ctlrSttsList = Collections.synchronizedList(new ArrayList<>());
 
-        voVdsState ss = new voVdsState();
-        ss.setCTLR_NMBR(SysUtils.toInt(vds.getVDS_CTLR_NMBR(), 0));
-        ss.setComm(vds.getStts().getSttsComm());				//Comm
-        ss.setVideoInput(vds.getStts().getSttsVideoInput());	//VideoInput
-        ss.setHeater(vds.getStts().getSttsHeater());			//Heater
-        ss.setFan(vds.getStts().getSttsFan());				    //Fan
-        ss.setBackDoorOpen(vds.getStts().getSttsBackDoor());	//BackDoorOpen
-        ss.setFrontDoorOpen(vds.getStts().getSttsFrontDoor());	//FrontDoorOpen
-        ss.setTemperature(vds.getStts().getSttsTemp());		    //Temperature
-        ss.setFanMode(vds.getStts().getSttsFanMode());			//FanMode
-        ss.setFanRunTemp(vds.getStts().getSttsFanRunTemp());	//FanRunTemp
-        ss.setHetrMode(vds.getStts().getSttsHetrMode());		//HetrMode
-        ss.setHetrRunTemp(vds.getStts().getSttsHetrRunTemp());	//HetrRunTemp
-
+        voVdsState ss = vds.getVdsStts();
         stts.getObjList().add(ss);
 
         ctlrSttsList.add(vds.getStts());
@@ -56,8 +41,8 @@ public class CenterCommResponseService {
         }
 
         // 제어기상태정보 UDP 전송(모든 운영단말로 전송)
-        CenterCommClientSender notify = (CenterCommClientSender) AppUtils.getBean(CenterCommClientSender.class);
-        notify.run(null, 0, stts.getBuffer());
+//        CenterCommClientSender notify = (CenterCommClientSender) AppUtils.getBean(CenterCommClientSender.class);
+//        notify.run(null, 0, stts.getBuffer());
     }
 
 }