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)