|
|
@@ -221,10 +221,11 @@ public class EvpsCommServerApplicationTest {
|
|
|
log.info("result: {}", makeEndData(packet, packet.getPacket().getBuffer()));
|
|
|
}
|
|
|
|
|
|
- private KafkaEvpsServiceEndDto getEndData(String serviceId, byte[] buffer, int idx) {
|
|
|
+ private KafkaEvpsServiceEndDto getEndData(String serviceId, byte[] buffer, int idx, String clctDt) {
|
|
|
int reason = ((buffer[idx++] & 0xFF) << 24) | ((buffer[idx++] & 0xFF) << 16) | ((buffer[idx++] & 0xFF) << 8) | (buffer[idx++] & 0xFF);
|
|
|
return KafkaEvpsServiceEndDto.builder()
|
|
|
.serviceId(serviceId)
|
|
|
+ .clctDt(clctDt)
|
|
|
.reason(reason)
|
|
|
.build();
|
|
|
}
|
|
|
@@ -237,12 +238,13 @@ public class EvpsCommServerApplicationTest {
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
- KafkaEvpsServiceEndDto data = getEndData(packet.getPacket().getServiceId(), buffer, 0);
|
|
|
+ String clctDt = EvpsUtils.getClctDt();
|
|
|
+ KafkaEvpsServiceEndDto data = getEndData(packet.getPacket().getServiceId(), buffer, 0, clctDt);
|
|
|
log.info("[{}], EvpsServiceEnd.response: Service Id: {}, {}", center.getLogKey(), data.getServiceId(), data);
|
|
|
|
|
|
// 이벤트 정보 입력(서비스 종료)
|
|
|
KafkaEvpsEventDto event = KafkaEvpsEventDto.builder()
|
|
|
- .clctDt(EvpsUtils.getClctDt())
|
|
|
+ .clctDt(clctDt)
|
|
|
.serviceId(data.getServiceId())
|
|
|
.eventCd(KafkaEvpsEventDto.EVPS_EVENT_SERVICE_END)
|
|
|
.build();
|
|
|
@@ -294,6 +296,7 @@ public class EvpsCommServerApplicationTest {
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
+ String clctDt = EvpsUtils.getClctDt();
|
|
|
String serviceId = packet.getPacket().getServiceId();
|
|
|
|
|
|
int idx = 0;
|
|
|
@@ -308,7 +311,7 @@ public class EvpsCommServerApplicationTest {
|
|
|
|
|
|
KafkaEvpsSignalDto data = KafkaEvpsSignalDto.builder()
|
|
|
.serviceId(serviceId)
|
|
|
- .clctDt(EvpsUtils.getClctDt())
|
|
|
+ .clctDt(clctDt)
|
|
|
.signalList(new ArrayList<>())
|
|
|
.build();
|
|
|
|
|
|
@@ -324,6 +327,7 @@ public class EvpsCommServerApplicationTest {
|
|
|
|
|
|
EvpsSignalInfo signal = EvpsSignalInfo.builder()
|
|
|
.serviceId(serviceId)
|
|
|
+ .clctDt(clctDt)
|
|
|
.nodeId(nodeId)
|
|
|
.seqNo(ii+1)
|
|
|
.remDist(remDist)
|
|
|
@@ -377,7 +381,7 @@ public class EvpsCommServerApplicationTest {
|
|
|
log.info("result: {}", makeEventData(packet, packet.getPacket().getBuffer()));
|
|
|
}
|
|
|
|
|
|
- private KafkaEvpsEventDto getEventData(String serviceId, byte[] buffer, int idx) {
|
|
|
+ private KafkaEvpsEventDto getEventData(String serviceId, byte[] buffer, int idx, String clctDt) {
|
|
|
// 차량번호
|
|
|
byte[] vehNoArr = Arrays.copyOfRange(buffer, idx, idx+EvpsProtocolConst.EVPS_VEHICLE_NO_SIZE);
|
|
|
idx += EvpsProtocolConst.EVPS_VEHICLE_NO_SIZE;
|
|
|
@@ -391,7 +395,7 @@ public class EvpsCommServerApplicationTest {
|
|
|
int distance = ((buffer[idx++] & 0xFF) << 24) | ((buffer[idx++] & 0xFF) << 16) | ((buffer[idx++] & 0xFF) << 8) | (buffer[idx++] & 0xFF);
|
|
|
|
|
|
return KafkaEvpsEventDto.builder()
|
|
|
- .clctDt(EvpsUtils.getClctDt())
|
|
|
+ .clctDt(clctDt)
|
|
|
.serviceId(serviceId)
|
|
|
.evNo(EvpsByteUtils.toString(vehNoArr))
|
|
|
.eventCd(KafkaEvpsEventDto.EVPS_EVENT_VEHICLE_MOVE)
|
|
|
@@ -410,7 +414,8 @@ public class EvpsCommServerApplicationTest {
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
- KafkaEvpsEventDto data = getEventData(packet.getPacket().getServiceId(), buffer, 0);
|
|
|
+ String clctDt = EvpsUtils.getClctDt();
|
|
|
+ KafkaEvpsEventDto data = getEventData(packet.getPacket().getServiceId(), buffer, 0, clctDt);
|
|
|
|
|
|
log.info("[{}], EvpsEvent.response: Service Id: {}, {}", center.getLogKey(), packet.getPacket().getServiceId(), data);
|
|
|
return true;
|
|
|
@@ -455,8 +460,10 @@ public class EvpsCommServerApplicationTest {
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
+ String clctDt = EvpsUtils.getClctDt();
|
|
|
KafkaEvpsNodeDto data = KafkaEvpsNodeDto.builder()
|
|
|
.serviceId(serviceId)
|
|
|
+ .clctDt(clctDt)
|
|
|
.nodeList(new ArrayList<>())
|
|
|
.build();
|
|
|
|
|
|
@@ -472,6 +479,7 @@ public class EvpsCommServerApplicationTest {
|
|
|
int seqNo = ii+1;
|
|
|
EvpsNodeInfo node = EvpsNodeInfo.builder()
|
|
|
.serviceId(serviceId)
|
|
|
+ .clctDt(clctDt)
|
|
|
.seqNo(seqNo)
|
|
|
.nodeId(nodeId)
|
|
|
.nodeNm(EvpsByteUtils.toString(nodeNmArr))
|
|
|
@@ -509,6 +517,7 @@ public class EvpsCommServerApplicationTest {
|
|
|
|
|
|
EvpsPhaseInfo phase = EvpsPhaseInfo.builder()
|
|
|
.serviceId(serviceId)
|
|
|
+ .clctDt(clctDt)
|
|
|
.seqNo(seqNo)
|
|
|
.nodeId(nodeId)
|
|
|
.ring(ring)
|
|
|
@@ -640,10 +649,11 @@ public class EvpsCommServerApplicationTest {
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
+ String clctDt = EvpsUtils.getClctDt();
|
|
|
// 서비스 시작 정보 입력
|
|
|
KafkaEvpsServiceDto service = KafkaEvpsServiceDto.builder()
|
|
|
.serviceId(packet.getPacket().getServiceId())
|
|
|
- .clctDt(EvpsUtils.getClctDt())
|
|
|
+ .clctDt(clctDt)
|
|
|
.evNo(EvpsByteUtils.toString(vehNoArr))
|
|
|
.curLat(currentLat/EvpsProtocolConst.EVPS_GEO_CORRECT)
|
|
|
.curLng(currentLng/EvpsProtocolConst.EVPS_GEO_CORRECT)
|
|
|
@@ -671,6 +681,7 @@ public class EvpsCommServerApplicationTest {
|
|
|
|
|
|
EvpsRouteInfo route = EvpsRouteInfo.builder()
|
|
|
.serviceId(service.getServiceId())
|
|
|
+ .clctDt(clctDt)
|
|
|
.seqNo(ii + 1)
|
|
|
.lat(routeLat / EvpsProtocolConst.EVPS_GEO_CORRECT)
|
|
|
.lng(routeLng / EvpsProtocolConst.EVPS_GEO_CORRECT)
|
|
|
@@ -689,7 +700,7 @@ public class EvpsCommServerApplicationTest {
|
|
|
|
|
|
// 이벤트 정보 입력(서비스 시작)
|
|
|
KafkaEvpsEventDto event = KafkaEvpsEventDto.builder()
|
|
|
- .clctDt(EvpsUtils.getClctDt())
|
|
|
+ .clctDt(clctDt)
|
|
|
.serviceId(service.getServiceId())
|
|
|
.evNo(EvpsByteUtils.toString(vehNoArr))
|
|
|
.eventCd(KafkaEvpsEventDto.EVPS_EVENT_VEHICLE_MOVE)
|