From 935172717ce54f6b6a21f57a51c10f84b896beda Mon Sep 17 00:00:00 2001 From: zhaoqiaobo <583671871@qq.com> Date: Mon, 30 Dec 2024 11:26:50 +0800 Subject: [PATCH] =?UTF-8?q?feat(all):=20=E7=B4=A2=E8=8F=B2=E4=BA=9A?= =?UTF-8?q?=E5=B7=A5=E5=8E=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1 增加华之韵物流对接 --- .../config/InterceptorAdapterConfig.java | 2 +- .../suofeiya/controller/OrderController.java | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/blade-service/logpm-factory-data/logpm-factory-data-suofeiya/src/main/java/com/logpm/factorydata/suofeiya/config/InterceptorAdapterConfig.java b/blade-service/logpm-factory-data/logpm-factory-data-suofeiya/src/main/java/com/logpm/factorydata/suofeiya/config/InterceptorAdapterConfig.java index 0e7464aa5..d0d1716b0 100644 --- a/blade-service/logpm-factory-data/logpm-factory-data-suofeiya/src/main/java/com/logpm/factorydata/suofeiya/config/InterceptorAdapterConfig.java +++ b/blade-service/logpm-factory-data/logpm-factory-data-suofeiya/src/main/java/com/logpm/factorydata/suofeiya/config/InterceptorAdapterConfig.java @@ -39,6 +39,6 @@ public class InterceptorAdapterConfig implements WebMvcConfigurer { // interceptorRegistry.addInterceptor(new FactoryAccountsInterceptor(factoryTokenService)) // .addPathPatterns("/**").order(1); interceptorRegistry.addInterceptor(new LocalServerLoginAccountsInterceptor(redis, environment, redisLockClient, mockLoginService, suoFeiYaProperties, deliveryNoteService)) - .addPathPatterns("/**").order(2); + .addPathPatterns("/logpm-factory-data-suofeiya/order/v1").order(2); } } diff --git a/blade-service/logpm-factory-data/logpm-factory-data-suofeiya/src/main/java/com/logpm/factorydata/suofeiya/controller/OrderController.java b/blade-service/logpm-factory-data/logpm-factory-data-suofeiya/src/main/java/com/logpm/factorydata/suofeiya/controller/OrderController.java index 206240d59..de09a3309 100644 --- a/blade-service/logpm-factory-data/logpm-factory-data-suofeiya/src/main/java/com/logpm/factorydata/suofeiya/controller/OrderController.java +++ b/blade-service/logpm-factory-data/logpm-factory-data-suofeiya/src/main/java/com/logpm/factorydata/suofeiya/controller/OrderController.java @@ -11,6 +11,8 @@ import com.logpm.factorydata.suofeiya.vo.Resp; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import lombok.extern.slf4j.Slf4j; +import org.springblade.common.constant.factorydata.FactoryDataConstants; +import org.springframework.amqp.rabbit.core.RabbitTemplate; import org.springframework.context.annotation.Lazy; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; @@ -19,6 +21,7 @@ import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.bind.annotation.RestController; import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; /** * 工厂订单 前端控制器 @@ -35,6 +38,8 @@ public class OrderController { @Lazy @Resource private DeliveryNoteService service; + @Resource + private RabbitTemplate rabbitTemplate; @ResponseBody @PostMapping @@ -79,4 +84,17 @@ public class OrderController { return Resp.success(res); } + @ResponseBody + @PostMapping("pushData") + @ApiOperationSupport(order = 1) + @ApiOperation(value = "推送工厂节点数据", notes = "推送工厂节点数据") + public Resp pushData(@RequestBody String msg, HttpServletRequest request) { + log.info("推送工厂节点数据:{}", msg); + if (StrUtil.isNotEmpty(msg)) { + rabbitTemplate.convertAndSend(FactoryDataConstants.Mq.Exchanges.NODE_DATA_PUSH, + FactoryDataConstants.Mq.RoutingKeys.SFY_NODE_DATA_PUSH, msg); + } + return Resp.success("成功"); + } + }