|
@@ -46,18 +46,15 @@ public class StlsImfMsg extends ImfMsgAbstract {
|
|
|
Date now = new Date();
|
|
|
// 先更新计划时间
|
|
|
updateAdminDfdlTime(dfdlList);
|
|
|
+ // 机位
|
|
|
+ String CODE = getStrVal("/MSG/DFLT/STLS/STND/CODE");
|
|
|
if ("A".equals(dfdlList.getFlio())) {
|
|
|
log.info("进站飞机");
|
|
|
- // 机位
|
|
|
- String CODE = getStrVal("/MSG/DFLT/STLS/STND/CODE");
|
|
|
if (Strings.isNullOrEmpty(CODE)) {
|
|
|
log.error("未获取到机位!(/MSG/DFLT/STLS/STND/CODE)");
|
|
|
return;
|
|
|
}
|
|
|
- LambdaQueryWrapper<AdminAircraftPosition> adminAircraftPositionLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
|
- adminAircraftPositionLambdaQueryWrapper.eq(AdminAircraftPosition::getAircraftPositionNum, CODE);
|
|
|
- // 通过机位查询到的数据
|
|
|
- AdminAircraftPosition codeAircraftPosition = getAdminAircraftPositionService().getOne(adminAircraftPositionLambdaQueryWrapper);
|
|
|
+ AdminAircraftPosition codeAircraftPosition = getApByCode(CODE);
|
|
|
if (codeAircraftPosition != null) {
|
|
|
log.info("查询到相应的机位:{}", CODE);
|
|
|
log.info("机位当前信息:{}", codeAircraftPosition);
|
|
@@ -76,7 +73,7 @@ public class StlsImfMsg extends ImfMsgAbstract {
|
|
|
if (stlsDfdlList.getRend() != null) {
|
|
|
// 已经出站
|
|
|
log.info("出站清空机位");
|
|
|
- getAdminAircraftPositionService().dept(FLID);
|
|
|
+ getAdminAircraftPositionService().dept(codeAircraftPosition.getId());
|
|
|
return;
|
|
|
} else {
|
|
|
log.info("没有出站");
|
|
@@ -86,7 +83,7 @@ public class StlsImfMsg extends ImfMsgAbstract {
|
|
|
//判断是否出站 防止arrival为0但是已经出战
|
|
|
if (stlsDfdlList.getRend() != null) {
|
|
|
// 已经出站
|
|
|
- getAdminAircraftPositionService().dept(FLID);
|
|
|
+ getAdminAircraftPositionService().dept(codeAircraftPosition.getId());
|
|
|
stlsDfdlList.setArrival(1);
|
|
|
updateAdminDfdl(stlsDfdlList);
|
|
|
log.info("计划中此航班【{}】,已经出站,{}", FLID, stlsDfdlList);
|
|
@@ -201,7 +198,7 @@ public class StlsImfMsg extends ImfMsgAbstract {
|
|
|
// 更新机位对应的航班
|
|
|
AdminAircraftPosition adminAircraftPosition = new AdminAircraftPosition();
|
|
|
adminAircraftPosition.setId(codeAircraftPosition.getId());
|
|
|
- adminAircraftPosition.setFlightSole(codeAircraftPosition.getFlightSole());
|
|
|
+ adminAircraftPosition.setFlightSole(FLID);
|
|
|
getAdminAircraftPositionService().updateById(adminAircraftPosition);
|
|
|
}
|
|
|
return;
|
|
@@ -238,6 +235,7 @@ public class StlsImfMsg extends ImfMsgAbstract {
|
|
|
} else if ("D".equals(dfdlList.getFlio())) {
|
|
|
// 出站飞机
|
|
|
// 判断是否已经离开机位
|
|
|
+ log.info("是出站飞机");
|
|
|
Map map = null;
|
|
|
try {
|
|
|
map = getStlsDateMap(getXmlStr());
|
|
@@ -251,19 +249,69 @@ public class StlsImfMsg extends ImfMsgAbstract {
|
|
|
}
|
|
|
Object rend = map.get("REND");
|
|
|
if (rend == null) {
|
|
|
- return;
|
|
|
- }
|
|
|
- Date rendDate = strToDate(String.valueOf(rend).replace("null", ""));
|
|
|
- if (rendDate != null && rendDate.before(now)) {
|
|
|
- // 离站了
|
|
|
- DepeImfMsg depeImfMsg = new DepeImfMsg(getXmlStr());
|
|
|
- depeImfMsg.depeHandle(String.valueOf(dfdlList.getFlid()).replace("null", ""), rendDate);
|
|
|
- }
|
|
|
+ log.info("没有实际结束占用时间,判断是否是始发站飞机");
|
|
|
+ // 没有实际结束占用时间
|
|
|
+ Object rstr = map.get("RSTR");
|
|
|
+ if (rstr == null) {
|
|
|
+ // 没有实际开始占用时间,没占用
|
|
|
+ log.info("没有实际开始占用时间,不做操作");
|
|
|
+ } else {
|
|
|
+ log.info("有实际开始占用时间,判断是否有Afid");
|
|
|
+ // 有实际开始占用时间证明占用了
|
|
|
+ if (dfdlList.getAfid() == null) {
|
|
|
+ log.info("没有Afid,是始发站飞机");
|
|
|
+ // 没有进站的关联id,证明是始发站id
|
|
|
+ AdminAircraftPosition codeAircraftPosition = getApByCode(CODE);
|
|
|
+ if (codeAircraftPosition != null) {
|
|
|
+ log.info("有对应机位,占用机位:{}",CODE);
|
|
|
+ // 占用机位
|
|
|
+ setUsePosition(codeAircraftPosition, dfdlList, false);
|
|
|
+ } else {
|
|
|
+ log.info("未找到机位:{}",CODE);
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ log.info("有Afid:{}", dfdlList.getAfid());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ log.info("有实际结束占用时间");
|
|
|
+ // 有实际结束占用时间
|
|
|
+ if (dfdlList.getAfid() == null) {
|
|
|
+ // 始发站飞机
|
|
|
+ Date rendDate = strToDate(String.valueOf(rend).replace("null", ""));
|
|
|
+ if (rendDate != null && rendDate.before(now)) {
|
|
|
+ // 离站了
|
|
|
+ DepeImfMsg depeImfMsg = new DepeImfMsg(getXmlStr());
|
|
|
+ depeImfMsg.depeHandle(dfdlList.getFlid(), rendDate);
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ Date rendDate = strToDate(String.valueOf(rend).replace("null", ""));
|
|
|
+ if (rendDate != null && rendDate.before(now)) {
|
|
|
+ // 离站了
|
|
|
+ DepeImfMsg depeImfMsg = new DepeImfMsg(getXmlStr());
|
|
|
+ depeImfMsg.depeHandleD(String.valueOf(dfdlList.getFlid()).replace("null", ""), rendDate);
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
+ * 通过机位编号获取机位信息
|
|
|
+ *
|
|
|
+ * @param CODE
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ private AdminAircraftPosition getApByCode(String CODE) {
|
|
|
+ LambdaQueryWrapper<AdminAircraftPosition> adminAircraftPositionLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
|
+ adminAircraftPositionLambdaQueryWrapper.eq(AdminAircraftPosition::getAircraftPositionNum, CODE);
|
|
|
+ // 通过机位查询到的数据
|
|
|
+ AdminAircraftPosition codeAircraftPosition = getAdminAircraftPositionService().getOne(adminAircraftPositionLambdaQueryWrapper);
|
|
|
+ return codeAircraftPosition;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
* 占用机位
|
|
|
*
|
|
|
* @param codeAircraftPosition
|