From 9e64b02af2bd972af3432141616562d692d49f7b Mon Sep 17 00:00:00 2001 From: zhaoqiaobo Date: Fri, 24 May 2024 17:01:09 +0800 Subject: [PATCH] =?UTF-8?q?feat(all):=20=E5=A2=9E=E5=8A=A0=E8=80=81?= =?UTF-8?q?=E7=B3=BB=E7=BB=9F=E5=BF=97=E9=82=A6=E4=BD=9C=E4=B8=9A=E8=8A=82?= =?UTF-8?q?=E7=82=B9=E6=95=B0=E6=8D=AE=E5=9B=9E=E4=BC=A0=EF=BC=8C=E5=8F=96?= =?UTF-8?q?=E6=B6=88=E5=BF=97=E9=82=A6=E6=9D=83=E9=99=90=E6=8E=A7=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../zbom/config/InterceptorAdapterConfig.java | 4 ++-- .../zbom/controller/OrderController.java | 22 ++++++++++++++----- 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/blade-service/logpm-factory-data/logpm-factory-data-zbom/src/main/java/com/logpm/factorydata/zbom/config/InterceptorAdapterConfig.java b/blade-service/logpm-factory-data/logpm-factory-data-zbom/src/main/java/com/logpm/factorydata/zbom/config/InterceptorAdapterConfig.java index 6ee97e0d1..545afdee9 100644 --- a/blade-service/logpm-factory-data/logpm-factory-data-zbom/src/main/java/com/logpm/factorydata/zbom/config/InterceptorAdapterConfig.java +++ b/blade-service/logpm-factory-data/logpm-factory-data-zbom/src/main/java/com/logpm/factorydata/zbom/config/InterceptorAdapterConfig.java @@ -21,8 +21,8 @@ public class InterceptorAdapterConfig implements WebMvcConfigurer { @Override public void addInterceptors(InterceptorRegistry interceptorRegistry) { - interceptorRegistry.addInterceptor(new ZbFactoryAccountsInterceptor(zbFactoryProperties)) - .addPathPatterns("/**").order(2); +// interceptorRegistry.addInterceptor(new ZbFactoryAccountsInterceptor(zbFactoryProperties)) +// .addPathPatterns("/**").order(2); interceptorRegistry.addInterceptor(new LocalServerLoginAccountsInterceptor(redis, environment)) .addPathPatterns("/**").order(3); } diff --git a/blade-service/logpm-factory-data/logpm-factory-data-zbom/src/main/java/com/logpm/factorydata/zbom/controller/OrderController.java b/blade-service/logpm-factory-data/logpm-factory-data-zbom/src/main/java/com/logpm/factorydata/zbom/controller/OrderController.java index 0e348ef7d..fc344839e 100644 --- a/blade-service/logpm-factory-data/logpm-factory-data-zbom/src/main/java/com/logpm/factorydata/zbom/controller/OrderController.java +++ b/blade-service/logpm-factory-data/logpm-factory-data-zbom/src/main/java/com/logpm/factorydata/zbom/controller/OrderController.java @@ -1,21 +1,16 @@ package com.logpm.factorydata.zbom.controller; -import cn.hutool.core.collection.CollUtil; import cn.hutool.core.io.FileUtil; import cn.hutool.core.util.ObjectUtil; +import cn.hutool.core.util.StrUtil; import cn.hutool.json.JSONUtil; -import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; import com.logpm.factorydata.enums.SaxStatusEnums; import com.logpm.factorydata.feign.IFactoryDataClient; import com.logpm.factorydata.vo.SendMsg; import com.logpm.factorydata.zbom.constants.ZbomConstants; import com.logpm.factorydata.zbom.entity.FactoryLogEntity; -import com.logpm.factorydata.zbom.entity.ZbFactoryOrderLogEntity; -import com.logpm.factorydata.zbom.entity.ZbReceiptEntity; import com.logpm.factorydata.zbom.service.FactoryLogService; -import com.logpm.factorydata.zbom.service.IFactoryOrderLogService; -import com.logpm.factorydata.zbom.service.IReceiptService; import com.logpm.factorydata.zbom.vo.ZBReceiptDTO; import com.logpm.factorydata.zbom.vo.ZbResp; import io.swagger.annotations.Api; @@ -31,6 +26,7 @@ import org.springblade.common.utils.FileLogsUtil; import org.springblade.core.oss.model.BladeFile; import org.springblade.core.tool.api.R; import org.springblade.resource.feign.IOssClient; +import org.springframework.amqp.rabbit.core.RabbitTemplate; import org.springframework.http.MediaType; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; @@ -63,8 +59,22 @@ public class OrderController { private final FactoryLogService factoryLogService; private final IOssClient ossClient; + private final RabbitTemplate rabbitTemplate; + @ResponseBody + @PostMapping("pushData") + @ApiOperationSupport(order = 1) + @ApiOperation(value = "推送志邦工厂节点数据", notes = "推送志邦工厂节点数据") + public ZbResp pushData(@RequestBody String msg, HttpServletRequest request) { + log.info("推送志邦工厂节点数据:{}", msg); + if (StrUtil.isNotEmpty(msg)) { + rabbitTemplate.convertAndSend(FactoryDataConstants.Mq.Exchanges.NODE_DATA_PUSH, + FactoryDataConstants.Mq.RoutingKeys.ZBOM_NODE_DATA_PUSH, msg); + } + return ZbResp.success("成功"); + } + @ResponseBody @PostMapping @ApiOperationSupport(order = 1)