Browse Source

:fire: 删除无用注释,删除旧方法

Twelve615 1 year ago
parent
commit
7e956a6e37

+ 2 - 798
airport/jeecg-boot-module-system/src/main/java/org/jeecg/modules/api/DemoRabbitMqListener3.java

@@ -98,63 +98,6 @@ public class DemoRabbitMqListener3 extends BaseRabbiMqHandler<Object> {
         System.out.println("¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥MQ创建了¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥");
     }
 
-    @RabbitListener(queues = "test")
-    public void onMessage(BaseMap baseMap, Channel channel, @Header(AmqpHeaders.DELIVERY_TAG) long deliveryTag) {
-        super.onMessage( baseMap, deliveryTag, channel, new MqListener<BaseMap>() {
-            @Override
-            public void handler(BaseMap map, Channel channel) {
-                String orderId = map.get( "orderId" ).toString();
-                System.err.println( orderId );
-                log.info( "业务处理:orderId:" + orderId );
-            }
-        } );
-    }
-
-    @RabbitListener(queues = "test2")
-    public void onMessage2(Message message, Channel channel, @Header(AmqpHeaders.DELIVERY_TAG) long deliveryTag) {
-        super.onMessage( message, deliveryTag, channel, new MqListener<Message>() {
-            @Override
-            public void handler(Message message2, Channel channel) {
-                String xmlString = new String( message2.getBody(), StandardCharsets.UTF_8 );
-                System.err.println( xmlString );
-
-                // 将XML字符串转换为字符流
-                StringReader sr = new StringReader( xmlString );
-
-                // 读取XML文档
-                DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
-                Document doc = null;
-                try {
-                    doc = factory.newDocumentBuilder().parse( new InputSource( sr ) );
-                    // 创建XPath对象
-                    XPathFactory xPathfactory = XPathFactory.newInstance();
-                    XPath xpath = xPathfactory.newXPath();
-
-                    // 使用XPath表达式获取 节点的值
-                    String STYP = (String) xpath.evaluate( "/ MSG/META/STYP", doc, XPathConstants.STRING );
-                    System.err.println( "STYP: " + STYP );
-
-                    if (STYP.equals( "STLS" )) {
-                        XPathExpression expr = xpath.compile( "//STLS" );
-                        NodeList nodes = (NodeList) expr.evaluate( doc, XPathConstants.NODESET );
-                        System.err.println( nodes.getLength() );
-                        for (int i = 0; i < nodes.getLength(); i++) {
-                            System.out.println( nodes.item( i ).getTextContent() );
-                        }
-                    }
-//                    XPathExpression expr = xpath.compile( "//STYP" );
-//                    NodeList nodes = (NodeList) expr.evaluate( doc, XPathConstants.NODESET );
-//                    for (int i = 0; i < nodes.getLength(); i++) {
-//                        System.out.println( nodes.item( i ).getTextContent() );
-//                    }
-
-                } catch (Exception e) {
-                    e.printStackTrace();
-                }
-            }
-        } );
-    }
-
     //3.0版本
     @RabbitListener(queues = "test3")
     public void onMessage3(Message message, Channel channel, @Header(AmqpHeaders.DELIVERY_TAG) long deliveryTag) {
@@ -207,24 +150,6 @@ public class DemoRabbitMqListener3 extends BaseRabbiMqHandler<Object> {
                             AdminAircraftPosition one = adminAircraftPositionService.getOne( queryWrapper,
                                     false );
                             if (one != null) {
-/*                                AdminAircraftPosition xmldfdl = new AdminAircraftPosition();
-                                if (redisUtil.hasKey( "DFDL" )) {
-                                    String dfdl = (String) redisUtil.get( "DFDL" );
-                                    xmldfdl = XMLDFDL( dfdl, FLID );
-                                }
-                                //存入缓存  key为关联航班ID(起飞用)  value为机位id 为后续清除机位存入缓存
-                                if (!redisUtil.hasKey( xmldfdl.getFlightAfid() )) {
-                                    redisUtil.set( xmldfdl.getFlightAfid(), one.getId());
-                                }
-                                存入缓存   id  航班唯一编号  为动态航班删除(DFDE)使用
-                                if (!redisUtil.hasKey( FLID )) {
-                                    redisUtil.set( FLID, one.getId() );
-                                }
-                                if (xmldfdl!=null){
-                                    one.setAircraftNum( xmldfdl.getAircraftNum() );
-                                    one.setFlightNum( xmldfdl.getFlightNum() );
-                                    one.setFlightAfid( xmldfdl.getFlightAfid() );
-                                }*/
                                 //判断是否是换机位的STLS
                                 LambdaQueryWrapper<AdminAircraftPosition> queryWrapper2 = new LambdaQueryWrapper<>();
                                 queryWrapper2.eq( AdminAircraftPosition::getFlightSole, FLID );
@@ -344,116 +269,7 @@ public class DemoRabbitMqListener3 extends BaseRabbiMqHandler<Object> {
                             log.info( "同步后::" + adminAircraftPosition.toString() );
                         }
                         log.info("结束处理【DFDL】动态航班整表同步事件消息");
-
-/*                        XPathExpression expr = xpath.compile( "//DFLT" );
-                        NodeList nodes = (NodeList) expr.evaluate( doc, XPathConstants.NODESET );
-                        if (nodes.getLength() >= 1) {
-                            for (int i = 0; i < nodes.getLength(); i++) {
-                                Node node = nodes.item( i );
-                                StringWriter buf = new StringWriter();
-                                Transformer xform = TransformerFactory.newInstance().newTransformer();
-                                xform.setOutputProperty( OutputKeys.OMIT_XML_DECLARATION, "yes" ); // optional
-                                xform.transform( new DOMSource( node ), new StreamResult( buf ) );
-                                //下面就是取多个里面的 具体数值
-                                StringReader sr2 = new StringReader( buf.toString() );
-                                Document doc2 = factory.newDocumentBuilder().parse( new InputSource( sr2 ) );
-                                //飞机号
-                                String CFNO = (String) xpath.evaluate( "/DFLT/CFNO", doc2, XPathConstants.STRING );
-                                // 航班唯一编号
-                                String FLID = (String) xpath.evaluate( "/DFLT/FLID", doc2, XPathConstants.STRING );
-//                                根据机位编号查询  之后存入各种数据
-                                LambdaQueryWrapper<AdminAircraftPosition> queryWrapper = new LambdaQueryWrapper<>();
-                                queryWrapper.eq( AdminAircraftPosition::getFlightSole, FLID );
-                                AdminAircraftPosition one = adminAircraftPositionService.getOne( queryWrapper,
-                                        false );
-                                if (one != null) {
-                                    //航班标识
-                                    String FFID = (String) xpath.evaluate( "/DFLT/FFID", doc2, XPathConstants.STRING );
-                                    String[] parts = FFID.split( "-" ); // 分割字符串
-                                    String result = parts[0] + "-" + parts[1]; // 连接前两个部分
-                                    one.setFlightNum( result );
-                                    one.setAircraftNum( CFNO );
-                                    one.setType( "使用中" );
-                                    adminAircraftPositionService.updateById( one );
-                                }
-                            }
-                        }*/
                     }
-/*
-                    //航班动态增加信息(DFIE)
-                    if (STYP.equals( "DFIE" )) {
-                        log.info( "DFIE::" + xmlString );
-                        //航班标识  (航班号)
-                        String FFID = (String) xpath.evaluate( "/MSG/DFLT/FFID", doc,
-                                XPathConstants.STRING );
-                        //航班唯一编号
-                        String FLID = (String) xpath.evaluate( "/MSG/DFLT/FLID", doc,
-                                XPathConstants.STRING );
-
-                        //飞机号
-                        String CFNO = (String) xpath.evaluate( "/MSG/DFLT/CFNO", doc,
-                                XPathConstants.STRING );
-
-                        LambdaQueryWrapper<AdminAircraftPosition> queryWrapper = new LambdaQueryWrapper<>();
-                        queryWrapper.eq( AdminAircraftPosition::getFlightSole, FLID );
-                        AdminAircraftPosition one = adminAircraftPositionService.getOne( queryWrapper,
-                                false );
-                        if (one != null) {
-                            String[] parts = FFID.split( "-" ); // 分割字符串
-                            String result = parts[0] + "-" + parts[1]; // 连接前两个部分
-                            one.setFlightNum( result );
-                            one.setType( "使用中" );
-                            one.setAircraftNum( CFNO );
-                            adminAircraftPositionService.updateById( one );
-                            //这个增加不知道是不是修改   可能需要在下面加修改安检里面的 飞机号和航班号
-                            //TODO
-                        }
-                    }
-
-                    动态航班删除(DFDE)
-                    if (STYP.equals( "DFDE" )) {
-                        log.info( "DFDE::" + xmlString );
-                        //航班唯一编号
-                        String FLID = (String) xpath.evaluate( "/MSG/DFLT/FLID", doc,
-                                XPathConstants.STRING );
-
-//                        LambdaQueryWrapper<AdminAircraftPosition> queryWrapper = new LambdaQueryWrapper<>();
-//                        queryWrapper.eq( AdminAircraftPosition::getFlightSole, FLID );
-//                        AdminAircraftPosition one = adminAircraftPositionService.getOne( queryWrapper,
-//                                false );
-//                        if (one != null) {
-                        //改机位信息还有把 机位所有信息清空 改状态为  空置
-                        if (redisUtil.hasKey( FLID )) {
-                            String id = (String) redisUtil.get( FLID );
-                            adminAircraftPositionService.dept( id );
-                        }
-                        //还有改订单状态 删除安检信息
-                        LambdaQueryWrapper<AdminOrder> queryWrapper2 =
-                                new LambdaQueryWrapper<>();
-                        queryWrapper2.eq( AdminOrder::getFlightSole, FLID );
-                        queryWrapper2.ne( AdminOrder::getType, "交接结束" );
-                        List<AdminOrder> list1 = adminOrderService.list( queryWrapper2 );
-                        if (list1.size() != 0) {
-                            for (int i = 0; i < list1.size(); i++) {
-                                AdminOrder adminOrder = new AdminOrder();
-                                adminOrder.setId( list1.get( i ).getId() );
-                                adminOrder.setType( "交接结束" );
-                                adminOrderService.updateById( adminOrder );
-                            }
-                        }
-                        //删安检
-                        LambdaQueryWrapper<AdminSecurityCheck> queryWrapper3 =
-                                new LambdaQueryWrapper<>();
-                        queryWrapper3.eq( AdminSecurityCheck::getFlightSole, FLID );
-                        List<AdminSecurityCheck> list = adminSecurityCheckService.list( queryWrapper3 );
-                        if (list.size() != 0) {
-                            List<String> ids = list.stream()
-                                    .map( AdminSecurityCheck::getId )
-                                    .collect( Collectors.toList() );
-                            adminSecurityCheckService.removeByIds( ids );
-                        }
-//                        }
-                    }*/
 
                     //航班到达本站消息(ARRE)
 
@@ -491,21 +307,8 @@ public class DemoRabbitMqListener3 extends BaseRabbiMqHandler<Object> {
                                 xmldfdl.setAircraftNum( xmldfdl2.getAircraftNum() );
                                 xmldfdl.setFlightNum( xmldfdl2.getFlightNum() );
                             }
-//                            1.0如果有变更的消息  就不去计划里面的消息了
-//                            if (redisUtil.hasKey( "CFCE_" + FLID )) {
-//                                String CFCE = (String) redisUtil.get( "CFCE_" + FLID );
-//                                log.info( "取变更____CFCE______" + CFCE );
-//                                xmldfdl = XMLCFCE( CFCE );
-//                            } else {
-//                                if (redisUtil.hasKey( "DFDL" )) {
-//                                    String dfdl = (String) redisUtil.get( "DFDL" );
-//                                    xmldfdl = XMLDFDL( dfdl, FLID );
-//                                }
-//                            }
                             //存入缓存  key为关联航班ID(起飞用)  value为机位id 为后续清除机位存入缓存
-//                            if (!redisUtil.hasKey( xmldfdl.getFlightAfid() )) {
-                                redisUtil.set( xmldfdl.getFlightAfid(), one.getId(),EXPIRATION_TIME );
-//                            }
+                            redisUtil.set( xmldfdl.getFlightAfid(), one.getId(),EXPIRATION_TIME );
                             if (xmldfdl != null) {
                                 one.setAircraftNum( xmldfdl.getAircraftNum() );
                                 one.setFlightNum( xmldfdl.getFlightNum() );
@@ -518,18 +321,6 @@ public class DemoRabbitMqListener3 extends BaseRabbiMqHandler<Object> {
                         log.info("结束处理【ARRE】航班到达本站消息");
                     }
 
-                    //航班动态信息更新(DFUE)
-//                    if (STYP.equals( "DFUE" )) {
-//                        log.info( "DFUE::" + xmlString );
-//                        //航班唯一编号
-//                        String FLID = (String) xpath.evaluate( "/MSG/DFLT/FLID", doc,
-//                                XPathConstants.STRING );
-////                        //存入缓存  待落地是取计划里面的数据时变更
-////                        if (!redisUtil.hasKey( "DFUE_" + FLID )) {
-////                            redisUtil.set( "DFUE_" + FLID, xmlString );
-////                        }
-//                    }
-
                     //航班更换飞机消息(CFCE)
                     if (STYP.equals( "CFCE" )) {
                         log.info("开始处理【CFCE】航班更换飞机消息");
@@ -538,11 +329,8 @@ public class DemoRabbitMqListener3 extends BaseRabbiMqHandler<Object> {
                         String FLID = (String) xpath.evaluate( "/MSG/DFLT/FLID", doc,
                                 XPathConstants.STRING );
                         //存入缓存  待落地是取计划里面的数据时变更
-//                        if (!redisUtil.hasKey( "CFCE_" + FLID )) {
-                        //
-                            redisUtil.set( "CFCE_" + FLID, xmlString, EXPIRATION_TIME );
+                        redisUtil.set( "CFCE_" + FLID, xmlString, EXPIRATION_TIME );
                         log.info("存入Redis key: CFCE_{}", FLID);
-//                        }
                         log.info("结束处理【CFCE】航班更换飞机消息");
                     }
 
@@ -692,588 +480,4 @@ public class DemoRabbitMqListener3 extends BaseRabbiMqHandler<Object> {
         }
     }
 
-    //2.0版本
-    @RabbitListener(queues = "test6")
-    public void onMessage6(Message message, Channel channel, @Header(AmqpHeaders.DELIVERY_TAG) long deliveryTag) {
-        super.onMessage( message, deliveryTag, channel, new MqListener<Message>() {
-            @Override
-            public void handler(Message message2, Channel channel) {
-                String xmlString = new String( message2.getBody(), StandardCharsets.UTF_8 );
-                // 将XML字符串转换为字符流
-                StringReader sr = new StringReader( xmlString );
-                // 读取XML文档
-                DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
-                Document doc = null;
-                try {
-                    doc = factory.newDocumentBuilder().parse( new InputSource( sr ) );
-                    // 创建XPath对象
-                    XPathFactory xPathfactory = XPathFactory.newInstance();
-                    XPath xpath = xPathfactory.newXPath();
-                    // 使用XPath表达式获取 节点的值
-                    String STYP = (String) xpath.evaluate( "/MSG/META/STYP", doc, XPathConstants.STRING );
-
-//                    航班机位动态信息更新(STLS)
-                    if (STYP.equals( "STLS" )) {
-                        //航班标识  (航班号)
-                        String FFID = (String) xpath.evaluate( "/MSG/DFLT/FFID", doc,
-                                XPathConstants.STRING );
-                        //航班唯一编号
-                        String FLID = (String) xpath.evaluate( "/MSG/DFLT/FLID", doc,
-                                XPathConstants.STRING );
-                        //判断航班标识的最后一个字符 为A A为进站  D为出站
-                        String lastChar = FFID.substring( FFID.length() - 1 );
-                        //这是过滤掉 D出站的
-                        if (lastChar.equals( "A" )) {
-                            log.info( "STLS::" + xmlString );
-                            //大部分走这里
-                            //机位编号
-                            String CODE = (String) xpath.evaluate( "/MSG/DFLT/STLS/STND/CODE", doc,
-                                    XPathConstants.STRING );
-                            //根据机位编号查询  之后存入各种数据
-                            LambdaQueryWrapper<AdminAircraftPosition> queryWrapper = new LambdaQueryWrapper<>();
-                            queryWrapper.eq( AdminAircraftPosition::getAircraftPositionNum, CODE );
-                            AdminAircraftPosition one = adminAircraftPositionService.getOne( queryWrapper,
-                                    false );
-                            if (one != null) {
-                                AdminAircraftPosition xmldfdl = new AdminAircraftPosition();
-                                if (redisUtil.hasKey( "DFDL" )) {
-                                    String dfdl = (String) redisUtil.get( "DFDL" );
-                                    xmldfdl = XMLDFDL( dfdl, FLID );
-                                }
-                                //存入缓存  key为关联航班ID(起飞用)  value为机位id 为后续清除机位存入缓存
-                                if (!redisUtil.hasKey( xmldfdl.getFlightAfid() )) {
-                                    redisUtil.set( xmldfdl.getFlightAfid(), one.getId() );
-                                }
-                                //存入缓存   id  航班唯一编号  为动态航班删除(DFDE)使用
-                                if (!redisUtil.hasKey( FLID )) {
-                                    redisUtil.set( FLID, one.getId() );
-                                }
-                                if (xmldfdl != null) {
-                                    one.setAircraftNum( xmldfdl.getAircraftNum() );
-                                    one.setFlightNum( xmldfdl.getFlightNum() );
-                                    one.setFlightAfid( xmldfdl.getFlightAfid() );
-                                }
-                                one.setFlightSole( FLID );
-//                                one.setType( "使用中" );
-                                adminAircraftPositionService.updateById( one );
-                            }
-                        }
-                    }
-
-                    //航班本站起飞消息(DEPE) 飞机起飞事件
-                    if (STYP.equals( "DEPE" )) {
-                        log.info( "DEPE::" + xmlString );
-                        //航班唯一编号
-                        String FLID = (String) xpath.evaluate( "/MSG/DFLT/FLID", doc,
-                                XPathConstants.STRING );
-//                        //根据航班唯一编号查询  之后取得实际起飞时间  之后对比时间判断航班已起飞  改机位信息还有把 机位所有信息清空 改状态为  空置   还有改订单状态 删除安检信息
-//                        LambdaQueryWrapper<AdminAircraftPosition> queryWrapper = new LambdaQueryWrapper<>();
-//                        queryWrapper.eq( AdminAircraftPosition::getFlightSole, FLID );
-//                        AdminAircraftPosition one = adminAircraftPositionService.getOne( queryWrapper,
-//                                false );
-//                        if (one != null) {
-                        //起飞时间 20230619112000
-                        String FRTT = (String) xpath.evaluate( "/MSG/DFLT/FRTT", doc,
-                                XPathConstants.STRING );
-                        if (!FRTT.equals( "" )) {
-                            DateTimeFormatter formatter = DateTimeFormatter.ofPattern( "yyyyMMddHHmmss" );
-                            LocalDateTime dateTime = LocalDateTime.parse( FRTT, formatter );
-                            Date date = Date.from( dateTime.atZone( ZoneId.systemDefault() ).toInstant() );
-                            if (date.before( new Date() )) {
-                                //改机位信息还有把 机位所有信息清空 改状态为  空置
-                                if (redisUtil.hasKey( FLID )) {
-                                    String id = (String) redisUtil.get( FLID );
-                                    adminAircraftPositionService.dept( id );
-                                }
-                                //还有改订单状态 删除安检信息
-                                LambdaQueryWrapper<AdminOrder> queryWrapper2 =
-                                        new LambdaQueryWrapper<>();
-
-//                                    queryWrapper2.eq( AdminOrder::getFlightSole, FLID );
-                                queryWrapper2.eq( AdminOrder::getFlightAfid, FLID );
-                                queryWrapper2.ne( AdminOrder::getType, "交接结束" );
-                                List<AdminOrder> list1 = adminOrderService.list( queryWrapper2 );
-                                if (list1.size() != 0) {
-                                    for (int i = 0; i < list1.size(); i++) {
-                                        AdminOrder adminOrder = new AdminOrder();
-                                        adminOrder.setId( list1.get( i ).getId() );
-                                        adminOrder.setType( "交接结束" );
-                                        adminOrder.setQifeiTime( date );
-                                        adminOrderService.updateById( adminOrder );
-                                    }
-                                }
-                                //删安检
-                                LambdaQueryWrapper<AdminSecurityCheck> queryWrapper3 =
-                                        new LambdaQueryWrapper<>();
-//                                    queryWrapper3.eq( AdminSecurityCheck::getFlightSole, FLID );
-                                queryWrapper3.eq( AdminSecurityCheck::getFlightAfid, FLID );
-                                List<AdminSecurityCheck> list = adminSecurityCheckService.list( queryWrapper3 );
-                                if (list.size() != 0) {
-                                    List<String> ids = list.stream()
-                                            .map( AdminSecurityCheck::getId )
-                                            .collect( Collectors.toList() );
-                                    adminSecurityCheckService.removeByIds( ids );
-                                }
-                            }
-                        }
-//                        }
-                    }
-
-                    //动态航班整表同步事件(DFDL)
-                    if (STYP.equals( "DFDL" )) {
-                        log.info( "DFDL::" + xmlString );
-                        redisUtil.set( "DFDL", xmlString );
-                        AdminDfdlMq adminDfdlMq = new AdminDfdlMq();
-                        adminDfdlMq.setId( "1" );
-                        adminDfdlMq.setDfdl( xmlString );
-                        adminDfdlMq.setUpdateTime( new Date() );
-                        adminDfdlMqService.updateById( adminDfdlMq );
-//                        XPathExpression expr = xpath.compile( "//DFLT" );
-//                        NodeList nodes = (NodeList) expr.evaluate( doc, XPathConstants.NODESET );
-//                        if (nodes.getLength() >= 1) {
-//                            for (int i = 0; i < nodes.getLength(); i++) {
-//                                Node node = nodes.item( i );
-//                                StringWriter buf = new StringWriter();
-//                                Transformer xform = TransformerFactory.newInstance().newTransformer();
-//                                xform.setOutputProperty( OutputKeys.OMIT_XML_DECLARATION, "yes" ); // optional
-//                                xform.transform( new DOMSource( node ), new StreamResult( buf ) );
-//                                //下面就是取多个里面的 具体数值
-//                                StringReader sr2 = new StringReader( buf.toString() );
-//                                Document doc2 = factory.newDocumentBuilder().parse( new InputSource( sr2 ) );
-//                                //飞机号
-//                                String CFNO = (String) xpath.evaluate( "/DFLT/CFNO", doc2, XPathConstants.STRING );
-//                                // 航班唯一编号
-//                                String FLID = (String) xpath.evaluate( "/DFLT/FLID", doc2, XPathConstants.STRING );
-////                                根据机位编号查询  之后存入各种数据
-//                                LambdaQueryWrapper<AdminAircraftPosition> queryWrapper = new LambdaQueryWrapper<>();
-//                                queryWrapper.eq( AdminAircraftPosition::getFlightSole, FLID );
-//                                AdminAircraftPosition one = adminAircraftPositionService.getOne( queryWrapper,
-//                                        false );
-//                                if (one != null) {
-//                                    //航班标识
-//                                    String FFID = (String) xpath.evaluate( "/DFLT/FFID", doc2, XPathConstants.STRING );
-//                                    String[] parts = FFID.split( "-" ); // 分割字符串
-//                                    String result = parts[0] + "-" + parts[1]; // 连接前两个部分
-//                                    one.setFlightNum( result );
-//                                    one.setAircraftNum( CFNO );
-//                                    one.setType( "使用中" );
-//                                    adminAircraftPositionService.updateById( one );
-//                                }
-//                            }
-//                        }
-                    }
-
-                    //航班动态增加信息(DFIE)
-                    if (STYP.equals( "DFIE" )) {
-                        log.info( "DFIE::" + xmlString );
-                        //航班标识  (航班号)
-                        String FFID = (String) xpath.evaluate( "/MSG/DFLT/FFID", doc,
-                                XPathConstants.STRING );
-                        //航班唯一编号
-                        String FLID = (String) xpath.evaluate( "/MSG/DFLT/FLID", doc,
-                                XPathConstants.STRING );
-
-                        //飞机号
-                        String CFNO = (String) xpath.evaluate( "/MSG/DFLT/CFNO", doc,
-                                XPathConstants.STRING );
-
-                        LambdaQueryWrapper<AdminAircraftPosition> queryWrapper = new LambdaQueryWrapper<>();
-                        queryWrapper.eq( AdminAircraftPosition::getFlightSole, FLID );
-                        AdminAircraftPosition one = adminAircraftPositionService.getOne( queryWrapper,
-                                false );
-                        if (one != null) {
-                            String[] parts = FFID.split( "-" ); // 分割字符串
-                            String result = parts[0] + "-" + parts[1]; // 连接前两个部分
-                            one.setFlightNum( result );
-                            one.setType( "使用中" );
-                            one.setAircraftNum( CFNO );
-                            adminAircraftPositionService.updateById( one );
-                            //这个增加不知道是不是修改   可能需要在下面加修改安检里面的 飞机号和航班号
-                            //TODO
-                        }
-                    }
-
-                    //动态航班删除(DFDE)
-                    if (STYP.equals( "DFDE" )) {
-                        log.info( "DFDE::" + xmlString );
-                        //航班唯一编号
-                        String FLID = (String) xpath.evaluate( "/MSG/DFLT/FLID", doc,
-                                XPathConstants.STRING );
-
-//                        LambdaQueryWrapper<AdminAircraftPosition> queryWrapper = new LambdaQueryWrapper<>();
-//                        queryWrapper.eq( AdminAircraftPosition::getFlightSole, FLID );
-//                        AdminAircraftPosition one = adminAircraftPositionService.getOne( queryWrapper,
-//                                false );
-//                        if (one != null) {
-                        //改机位信息还有把 机位所有信息清空 改状态为  空置
-                        if (redisUtil.hasKey( FLID )) {
-                            String id = (String) redisUtil.get( FLID );
-                            adminAircraftPositionService.dept( id );
-                        }
-                        //还有改订单状态 删除安检信息
-                        LambdaQueryWrapper<AdminOrder> queryWrapper2 =
-                                new LambdaQueryWrapper<>();
-                        queryWrapper2.eq( AdminOrder::getFlightSole, FLID );
-                        queryWrapper2.ne( AdminOrder::getType, "交接结束" );
-                        List<AdminOrder> list1 = adminOrderService.list( queryWrapper2 );
-                        if (list1.size() != 0) {
-                            for (int i = 0; i < list1.size(); i++) {
-                                AdminOrder adminOrder = new AdminOrder();
-                                adminOrder.setId( list1.get( i ).getId() );
-                                adminOrder.setType( "交接结束" );
-                                adminOrderService.updateById( adminOrder );
-                            }
-                        }
-                        //删安检
-                        LambdaQueryWrapper<AdminSecurityCheck> queryWrapper3 =
-                                new LambdaQueryWrapper<>();
-                        queryWrapper3.eq( AdminSecurityCheck::getFlightSole, FLID );
-                        List<AdminSecurityCheck> list = adminSecurityCheckService.list( queryWrapper3 );
-                        if (list.size() != 0) {
-                            List<String> ids = list.stream()
-                                    .map( AdminSecurityCheck::getId )
-                                    .collect( Collectors.toList() );
-                            adminSecurityCheckService.removeByIds( ids );
-                        }
-//                        }
-                    }
-
-                    //航班到达本站消息(ARRE)
-                    if (STYP.equals( "ARRE" )) {
-                        log.info( "ARRE::" + xmlString );
-                        //航班唯一编号
-                        String FLID = (String) xpath.evaluate( "/MSG/DFLT/FLID", doc,
-                                XPathConstants.STRING );
-
-                        LambdaQueryWrapper<AdminAircraftPosition> queryWrapper = new LambdaQueryWrapper<>();
-                        queryWrapper.eq( AdminAircraftPosition::getFlightSole, FLID );
-                        AdminAircraftPosition one = adminAircraftPositionService.getOne( queryWrapper,
-                                false );
-                        if (one != null) {
-                            //实际到达时间  20230619112000
-                            String FRLT = (String) xpath.evaluate( "/MSG/DFLT/FRLT", doc,
-                                    XPathConstants.STRING );
-
-                            DateTimeFormatter formatter = DateTimeFormatter.ofPattern( "yyyyMMddHHmmss" );
-                            LocalDateTime dateTime = LocalDateTime.parse( FRLT, formatter );
-                            Date date = Date.from( dateTime.atZone( ZoneId.systemDefault() ).toInstant() );
-                            one.setDropTime( date );
-                            one.setType( "使用中" );
-                            adminAircraftPositionService.updateById( one );
-                        }
-                    }
-                } catch (Exception e) {
-                    e.printStackTrace();
-                }
-            }
-        } );
-    }
-
-    //1.0版本
-    @RabbitListener(queues = "test5")
-    public void onMessage5(Message message, Channel channel, @Header(AmqpHeaders.DELIVERY_TAG) long deliveryTag) {
-        super.onMessage( message, deliveryTag, channel, new MqListener<Message>() {
-            @Override
-            public void handler(Message message2, Channel channel) {
-                String xmlString = new String( message2.getBody(), StandardCharsets.UTF_8 );
-                // 将XML字符串转换为字符流
-                StringReader sr = new StringReader( xmlString );
-                // 读取XML文档
-                DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
-                Document doc = null;
-                try {
-//                    通过机位在STLS里面获取flid(航班唯一编号),然后我再晚上时候接受DFDL去取得飞机号和航班号
-//                    还要接受DFIE(航班动态增加信息)和DFDE(动态航班删除)根据flid去匹配变化的航班信息(增加还是删除),
-//                    最后两个  1.飞机的实际落地时间用ARRE(航班到达本站消息)
-//                    2.飞机起飞用DEPE(航班本站起飞消息)取得实际起飞时间  之后对比时间判断航班已起飞  改机位信息还有把 机位所有信息清空 改状态为  空置   还有改订单状态 删除安检信息
-                    doc = factory.newDocumentBuilder().parse( new InputSource( sr ) );
-                    // 创建XPath对象
-                    XPathFactory xPathfactory = XPathFactory.newInstance();
-                    XPath xpath = xPathfactory.newXPath();
-                    // 使用XPath表达式获取 节点的值
-                    String STYP = (String) xpath.evaluate( "/MSG/META/STYP", doc, XPathConstants.STRING );
-
-                    if (STYP.equals( "STLS" )) {
-                        XPathExpression expr = xpath.compile( "//STND" );
-                        NodeList nodes = (NodeList) expr.evaluate( doc, XPathConstants.NODESET );
-                        //航班标识  (航班号)
-                        String FFID = (String) xpath.evaluate( "/MSG/DFLT/FFID", doc,
-                                XPathConstants.STRING );
-                        //航班唯一编号
-                        String FLID = (String) xpath.evaluate( "/MSG/DFLT/FLID", doc,
-                                XPathConstants.STRING );
-                        //判断航班标识的最后一个字符 为A A为进站  D为出站
-                        String lastChar = FFID.substring( FFID.length() - 1 );
-                        //这是过滤掉 D出站的
-                        if (lastChar.equals( "A" )) {
-                            log.info( "STLS::" + xmlString );
-                            if (nodes.getLength() == 0) {
-
-                            } else if (nodes.getLength() == 1) {
-                                //大部分走这里
-                                //机位编号
-                                String CODE = (String) xpath.evaluate( "/MSG/DFLT/STLS/STND/CODE", doc,
-                                        XPathConstants.STRING );
-                                //根据机位编号查询  之后存入各种数据
-                                LambdaQueryWrapper<AdminAircraftPosition> queryWrapper = new LambdaQueryWrapper<>();
-                                queryWrapper.eq( AdminAircraftPosition::getAircraftPositionNum, CODE );
-                                AdminAircraftPosition one = adminAircraftPositionService.getOne( queryWrapper,
-                                        false );
-                                if (one != null) {
-//                                    String[] parts = FFID.split( "-" ); // 分割字符串
-//                                    String result = parts[0] + "-" + parts[1]; // 连接前两个部分
-//                                    one.setFlightNum( result );
-                                    one.setFlightSole( FLID );
-//                                    one.setType( "使用中" );
-                                    adminAircraftPositionService.updateById( one );
-                                }
-                            } else if (nodes.getLength() > 1) {
-                                for (int i = 0; i < nodes.getLength(); i++) {
-                                    Node node = nodes.item( i );
-                                    StringWriter buf = new StringWriter();
-                                    Transformer xform = TransformerFactory.newInstance().newTransformer();
-                                    xform.setOutputProperty( OutputKeys.OMIT_XML_DECLARATION, "yes" ); // optional
-                                    xform.transform( new DOMSource( node ), new StreamResult( buf ) );
-                                    //下面就是取多个里面的 具体数值
-                                    StringReader sr2 = new StringReader( buf.toString() );
-                                    Document doc2 = factory.newDocumentBuilder().parse( new InputSource( sr2 ) );
-                                    String CODE2 = (String) xpath.evaluate( "/STND/CODE", doc2, XPathConstants.STRING );
-                                    //根据机位编号查询  之后存入各种数据
-                                    LambdaQueryWrapper<AdminAircraftPosition> queryWrapper = new LambdaQueryWrapper<>();
-                                    queryWrapper.eq( AdminAircraftPosition::getAircraftPositionNum, CODE2 );
-                                    AdminAircraftPosition one = adminAircraftPositionService.getOne( queryWrapper,
-                                            false );
-                                    if (one != null) {
-//                                        String[] parts = FFID.split( "-" ); // 分割字符串
-//                                        String result = parts[0] + "-" + parts[1]; // 连接前两个部分
-//                                        one.setFlightNum( result );
-                                        one.setFlightSole( FLID );
-//                                        one.setType( "使用中" );
-                                        adminAircraftPositionService.updateById( one );
-                                    }
-                                }
-                            }
-                        }
-                    }
-
-                    //航班本站起飞消息(DEPE) 飞机起飞事件
-                    if (STYP.equals( "DEPE" )) {
-                        log.info( "DEPE::" + xmlString );
-                        //航班唯一编号
-                        String FLID = (String) xpath.evaluate( "/MSG/DFLT/FLID", doc,
-                                XPathConstants.STRING );
-                        //根据航班唯一编号查询  之后取得实际起飞时间  之后对比时间判断航班已起飞  改机位信息还有把 机位所有信息清空 改状态为  空置   还有改订单状态 删除安检信息
-                        LambdaQueryWrapper<AdminAircraftPosition> queryWrapper = new LambdaQueryWrapper<>();
-                        queryWrapper.eq( AdminAircraftPosition::getFlightSole, FLID );
-                        AdminAircraftPosition one = adminAircraftPositionService.getOne( queryWrapper,
-                                false );
-                        if (one != null) {
-                            //起飞时间 20230619112000
-                            String FRTT = (String) xpath.evaluate( "/MSG/DFLT/FRTT", doc,
-                                    XPathConstants.STRING );
-                            if (!FRTT.equals( "" )) {
-                                DateTimeFormatter formatter = DateTimeFormatter.ofPattern( "yyyyMMddHHmmss" );
-                                LocalDateTime dateTime = LocalDateTime.parse( FRTT, formatter );
-                                Date date = Date.from( dateTime.atZone( ZoneId.systemDefault() ).toInstant() );
-                                if (date.before( new Date() )) {
-                                    //改机位信息还有把 机位所有信息清空 改状态为  空置
-                                    adminAircraftPositionService.dept( one.getId() );
-                                    //还有改订单状态 删除安检信息
-                                    LambdaQueryWrapper<AdminOrder> queryWrapper2 =
-                                            new LambdaQueryWrapper<>();
-//                                    queryWrapper2.eq( AdminOrder::getAircraftPositionNum, one.getAircraftPositionNum() );
-//                                    queryWrapper2.eq( AdminOrder::getFlightNum, one.getFlightNum() );
-                                    queryWrapper2.eq( AdminOrder::getFlightSole, FLID );
-                                    queryWrapper2.ne( AdminOrder::getType, "交接结束" );
-//                                    AdminOrder one1 = adminOrderService.getOne( queryWrapper2 );
-//                                    if (one1 != null) {
-//                                        one1.setType( "交接结束" );
-//                                        adminOrderService.updateById( one1 );
-//                                    }
-                                    List<AdminOrder> list1 = adminOrderService.list( queryWrapper2 );
-                                    if (list1.size() != 0) {
-                                        for (int i = 0; i < list1.size(); i++) {
-//                                            list1.get( i ).setType( "交接结束" );
-////                                            adminOrderService.updateById( list1.get( i ) );
-                                            AdminOrder adminOrder = new AdminOrder();
-                                            adminOrder.setId( list1.get( i ).getId() );
-                                            adminOrder.setType( "交接结束" );
-                                            adminOrder.setQifeiTime( date );
-                                            adminOrderService.updateById( adminOrder );
-                                        }
-                                    }
-                                    //删安检
-                                    LambdaQueryWrapper<AdminSecurityCheck> queryWrapper3 =
-                                            new LambdaQueryWrapper<>();
-//                                    queryWrapper3.eq( AdminSecurityCheck::getAircraftPositionNum, one.getAircraftPositionNum() );
-//                                    queryWrapper3.eq( AdminSecurityCheck::getFlightNum, one.getFlightNum() );
-                                    queryWrapper3.eq( AdminSecurityCheck::getFlightSole, FLID );
-//                                    AdminSecurityCheck one2 = adminSecurityCheckService.getOne( queryWrapper3 );
-//                                    if (one2 != null) {
-//                                        adminSecurityCheckService.removeById( one2.getId() );
-//                                    }
-                                    List<AdminSecurityCheck> list = adminSecurityCheckService.list( queryWrapper3 );
-                                    if (list.size() != 0) {
-                                        List<String> ids = list.stream()
-                                                .map( AdminSecurityCheck::getId )
-                                                .collect( Collectors.toList() );
-                                        adminSecurityCheckService.removeByIds( ids );
-                                    }
-                                }
-                            }
-                        }
-                    }
-
-                    //飞机号,航班号获取 暂定为DFDL消息
-                    if (STYP.equals( "DFDL" )) {
-                        log.info( "DFDL::" + xmlString );
-                        XPathExpression expr = xpath.compile( "//DFLT" );
-                        NodeList nodes = (NodeList) expr.evaluate( doc, XPathConstants.NODESET );
-                        if (nodes.getLength() >= 1) {
-                            for (int i = 0; i < nodes.getLength(); i++) {
-                                Node node = nodes.item( i );
-                                StringWriter buf = new StringWriter();
-                                Transformer xform = TransformerFactory.newInstance().newTransformer();
-                                xform.setOutputProperty( OutputKeys.OMIT_XML_DECLARATION, "yes" ); // optional
-                                xform.transform( new DOMSource( node ), new StreamResult( buf ) );
-                                //下面就是取多个里面的 具体数值
-                                StringReader sr2 = new StringReader( buf.toString() );
-                                Document doc2 = factory.newDocumentBuilder().parse( new InputSource( sr2 ) );
-                                //飞机号
-                                String CFNO = (String) xpath.evaluate( "/DFLT/CFNO", doc2, XPathConstants.STRING );
-                                // 航班唯一编号
-                                String FLID = (String) xpath.evaluate( "/DFLT/FLID", doc2, XPathConstants.STRING );
-
-
-//                                根据机位编号查询  之后存入各种数据
-                                LambdaQueryWrapper<AdminAircraftPosition> queryWrapper = new LambdaQueryWrapper<>();
-                                queryWrapper.eq( AdminAircraftPosition::getFlightSole, FLID );
-                                AdminAircraftPosition one = adminAircraftPositionService.getOne( queryWrapper,
-                                        false );
-                                if (one != null) {
-                                    //航班标识
-                                    String FFID = (String) xpath.evaluate( "/DFLT/FFID", doc2, XPathConstants.STRING );
-                                    String[] parts = FFID.split( "-" ); // 分割字符串
-                                    String result = parts[0] + "-" + parts[1]; // 连接前两个部分
-                                    one.setFlightNum( result );
-                                    one.setAircraftNum( CFNO );
-                                    one.setType( "使用中" );
-                                    adminAircraftPositionService.updateById( one );
-                                }
-                            }
-                        }
-                    }
-
-                    //航班动态增加信息(DFIE)
-                    if (STYP.equals( "DFIE" )) {
-                        log.info( "DFIE::" + xmlString );
-                        //航班标识  (航班号)
-                        String FFID = (String) xpath.evaluate( "/MSG/DFLT/FFID", doc,
-                                XPathConstants.STRING );
-                        //航班唯一编号
-                        String FLID = (String) xpath.evaluate( "/MSG/DFLT/FLID", doc,
-                                XPathConstants.STRING );
-
-                        //飞机号
-                        String CFNO = (String) xpath.evaluate( "/MSG/DFLT/CFNO", doc,
-                                XPathConstants.STRING );
-
-                        LambdaQueryWrapper<AdminAircraftPosition> queryWrapper = new LambdaQueryWrapper<>();
-                        queryWrapper.eq( AdminAircraftPosition::getFlightSole, FLID );
-                        AdminAircraftPosition one = adminAircraftPositionService.getOne( queryWrapper,
-                                false );
-                        if (one != null) {
-                            String[] parts = FFID.split( "-" ); // 分割字符串
-                            String result = parts[0] + "-" + parts[1]; // 连接前两个部分
-                            one.setFlightNum( result );
-                            one.setType( "使用中" );
-                            one.setAircraftNum( CFNO );
-                            adminAircraftPositionService.updateById( one );
-                            //这个增加不知道是不是修改   可能需要在下面加修改安检里面的 飞机号和航班号
-                            //TODO
-                        }
-                    }
-
-                    //动态航班删除(DFDE)
-                    if (STYP.equals( "DFDE" )) {
-                        log.info( "DFDE::" + xmlString );
-                        //航班唯一编号
-                        String FLID = (String) xpath.evaluate( "/MSG/DFLT/FLID", doc,
-                                XPathConstants.STRING );
-
-                        LambdaQueryWrapper<AdminAircraftPosition> queryWrapper = new LambdaQueryWrapper<>();
-                        queryWrapper.eq( AdminAircraftPosition::getFlightSole, FLID );
-                        AdminAircraftPosition one = adminAircraftPositionService.getOne( queryWrapper,
-                                false );
-                        if (one != null) {
-                            //改机位信息还有把 机位所有信息清空 改状态为  空置
-                            adminAircraftPositionService.dept( one.getId() );
-                            //还有改订单状态 删除安检信息
-                            LambdaQueryWrapper<AdminOrder> queryWrapper2 =
-                                    new LambdaQueryWrapper<>();
-                            queryWrapper2.eq( AdminOrder::getFlightSole, FLID );
-                            queryWrapper2.ne( AdminOrder::getType, "交接结束" );
-                            List<AdminOrder> list1 = adminOrderService.list( queryWrapper2 );
-                            if (list1.size() != 0) {
-                                for (int i = 0; i < list1.size(); i++) {
-                                    AdminOrder adminOrder = new AdminOrder();
-                                    adminOrder.setId( list1.get( i ).getId() );
-                                    adminOrder.setType( "交接结束" );
-                                    adminOrderService.updateById( adminOrder );
-                                }
-                            }
-                            //删安检
-                            LambdaQueryWrapper<AdminSecurityCheck> queryWrapper3 =
-                                    new LambdaQueryWrapper<>();
-                            queryWrapper3.eq( AdminSecurityCheck::getFlightSole, FLID );
-                            List<AdminSecurityCheck> list = adminSecurityCheckService.list( queryWrapper3 );
-                            if (list.size() != 0) {
-                                List<String> ids = list.stream()
-                                        .map( AdminSecurityCheck::getId )
-                                        .collect( Collectors.toList() );
-                                adminSecurityCheckService.removeByIds( ids );
-                            }
-                        }
-                    }
-
-                    //航班到达本站消息(ARRE)
-                    if (STYP.equals( "ARRE" )) {
-                        log.info( "ARRE::" + xmlString );
-                        //航班唯一编号
-                        String FLID = (String) xpath.evaluate( "/MSG/DFLT/FLID", doc,
-                                XPathConstants.STRING );
-
-                        LambdaQueryWrapper<AdminAircraftPosition> queryWrapper = new LambdaQueryWrapper<>();
-                        queryWrapper.eq( AdminAircraftPosition::getFlightSole, FLID );
-                        AdminAircraftPosition one = adminAircraftPositionService.getOne( queryWrapper,
-                                false );
-                        if (one != null) {
-                            //实际到达时间  20230619112000
-                            String FRLT = (String) xpath.evaluate( "/MSG/DFLT/FRLT", doc,
-                                    XPathConstants.STRING );
-
-                            DateTimeFormatter formatter = DateTimeFormatter.ofPattern( "yyyyMMddHHmmss" );
-                            LocalDateTime dateTime = LocalDateTime.parse( FRLT, formatter );
-                            Date date = Date.from( dateTime.atZone( ZoneId.systemDefault() ).toInstant() );
-                            one.setDropTime( date );
-                            adminAircraftPositionService.updateById( one );
-                        }
-                    }
-                } catch (Exception e) {
-                    e.printStackTrace();
-                }
-            }
-        } );
-    }
-
-    @RabbitListener(queues = "test4")
-    public void onMessage4(Object o, Channel channel, @Header(AmqpHeaders.DELIVERY_TAG) long deliveryTag) {
-        super.onMessage( o, deliveryTag, channel, new MqListener<Object>() {
-            @Override
-            public void handler(Object o, Channel channel) {
-                System.err.println( o );
-                log.info( "业务处理 :" + o );
-            }
-        } );
-    }
 }