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("成功"); + } + }