1078-查询区域或线路数据应答...

This commit is contained in:
648540858
2024-05-06 18:00:26 +08:00
parent 364d613ccb
commit 2112fffc26
12 changed files with 162 additions and 62 deletions

View File

@@ -1,9 +1,7 @@
package com.genersoft.iot.vmp.jt1078.proc.request;
import com.genersoft.iot.vmp.jt1078.annotation.MsgId;
import com.genersoft.iot.vmp.jt1078.bean.JTAreaOrRoute;
import com.genersoft.iot.vmp.jt1078.bean.JTDevice;
import com.genersoft.iot.vmp.jt1078.bean.JTPositionBaseInfo;
import com.genersoft.iot.vmp.jt1078.bean.*;
import com.genersoft.iot.vmp.jt1078.proc.Header;
import com.genersoft.iot.vmp.jt1078.proc.response.J8001;
import com.genersoft.iot.vmp.jt1078.proc.response.Rs;
@@ -38,29 +36,46 @@ public class J0608 extends Re {
SessionManager.INSTANCE.response(header.getTerminalId(), "0608", null, areaOrRoutes);
return null;
}
for (int i = 0; i < dataLength; i++) {
switch (type) {
case 1:
switch (type) {
case 1:
List<JTCircleArea> jtCircleAreas = new ArrayList<>();
for (int i = 0; i < dataLength; i++) {
// 查询圆形区域数据
break;
case 2:
// 查询矩形区域数据
break;
case 3:
// 查询多 边形区域数据
break;
case 4:
// 查询线路数据
break;
default:
break;
}
JTCircleArea jtCircleArea = JTCircleArea.decode(buf);
jtCircleAreas.add(jtCircleArea);
}
SessionManager.INSTANCE.response(header.getTerminalId(), "0608", null, jtCircleAreas);
break;
case 2:
// 查询矩形区域数据
List<JTRectangleArea> jtRectangleAreas = new ArrayList<>();
for (int i = 0; i < dataLength; i++) {
// 查询圆形区域数据
JTRectangleArea jtRectangleArea = JTRectangleArea.decode(buf);
jtRectangleAreas.add(jtRectangleArea);
}
SessionManager.INSTANCE.response(header.getTerminalId(), "0608", null, jtRectangleAreas);
break;
case 3:
// 查询多 边形区域数据
List<JTPolygonArea> jtPolygonAreas = new ArrayList<>();
for (int i = 0; i < dataLength; i++) {
// 查询圆形区域数据
JTPolygonArea jtRectangleArea = JTPolygonArea.decode(buf);
jtPolygonAreas.add(jtRectangleArea);
}
SessionManager.INSTANCE.response(header.getTerminalId(), "0608", null, jtPolygonAreas);
break;
case 4:
// 查询线路数据
// 查询多 边形区域数据
JTPolygonArea jtPolygonArea = JTPolygonArea.decode(buf);
SessionManager.INSTANCE.response(header.getTerminalId(), "0608", null, jtPolygonArea);
break;
default:
break;
}
int respNo = buf.readUnsignedShort();
positionInfo = J0200.getPositionInfo(buf);
log.info("[JT-车辆控制应答]: {}", positionInfo.toString());
SessionManager.INSTANCE.response(header.getTerminalId(), "0500", (long) respNo, positionInfo);
return null;
}

View File

@@ -30,10 +30,10 @@ public class J8608 extends Rs {
ByteBuf buffer = Unpooled.buffer();
buffer.writeByte(type);
if (idList == null || idList.isEmpty()) {
buffer.writeByte(0);
buffer.writeInt(0);
return buffer;
}else {
buffer.writeByte(idList.size());
buffer.writeInt(idList.size());
}
for (Long id : idList) {
buffer.writeInt((int) (id & 0xffffffffL));