|
@@ -3,6 +3,8 @@ package org.jeecg.modules.api.imf.msg;
|
|
|
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
|
|
+import com.google.common.base.Strings;
|
|
|
+import lombok.extern.slf4j.Slf4j;
|
|
|
import org.jeecg.modules.admin_aircraft_position.entity.AdminAircraftPosition;
|
|
|
import org.jeecg.modules.admin_dfdl_list.entity.AdminDfdlList;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
@@ -16,6 +18,7 @@ import javax.xml.xpath.XPath;
|
|
|
* @Description:
|
|
|
* @date 2023/7/19 18:32
|
|
|
*/
|
|
|
+@Slf4j
|
|
|
public class CfceImfMsg extends ImfMsgAbstract {
|
|
|
|
|
|
public CfceImfMsg(String xmlStr) {
|
|
@@ -26,9 +29,13 @@ public class CfceImfMsg extends ImfMsgAbstract {
|
|
|
@Transactional
|
|
|
public void handle() {
|
|
|
// 更换计划表中的航班
|
|
|
- AdminDfdlList entity = new AdminDfdlList();
|
|
|
String flid = getStrVal("/MSG/DFLT/FLID");
|
|
|
- entity.setFlid(Integer.valueOf(flid));
|
|
|
+ if (Strings.isNullOrEmpty(flid)) {
|
|
|
+ log.info("未找到要更换的航班!flid:{}", flid);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ AdminDfdlList entity = getAdminDfdlListService().getById(flid);
|
|
|
+ log.info("航班更换前:{}", entity);
|
|
|
|
|
|
String ffid = getStrVal("/MSG/DFLT/FFID");
|
|
|
entity.setFfid(ffid);
|
|
@@ -45,14 +52,14 @@ public class CfceImfMsg extends ImfMsgAbstract {
|
|
|
|
|
|
|
|
|
updateAdminDfdl(entity);
|
|
|
+ log.info("航班更换后:{}", entity);
|
|
|
|
|
|
// 查询机位表中是否有此航班 有就更新
|
|
|
QueryWrapper<AdminAircraftPosition> aircraftPositionQueryWrapper = new QueryWrapper<>();
|
|
|
aircraftPositionQueryWrapper.eq("flight_sole", flid);
|
|
|
AdminAircraftPosition one = getAdminAircraftPositionService().getOne(aircraftPositionQueryWrapper);
|
|
|
if (one != null) {
|
|
|
- AdminDfdlList byId = getAdminDfdlListService().getById(entity.getFlid());
|
|
|
- adminDfdlCopyToAirPosition(byId, one);
|
|
|
+ adminDfdlCopyToAirPosition(entity, one);
|
|
|
}
|
|
|
}
|
|
|
}
|