diff --git a/blade-service/logpm-factory-data/logpm-factory-data-olo/src/main/java/com/logpm/factorydata/olo/controller/OrderController.java b/blade-service/logpm-factory-data/logpm-factory-data-olo/src/main/java/com/logpm/factorydata/olo/controller/OrderController.java index 224fd9b22..12bb4176c 100644 --- a/blade-service/logpm-factory-data/logpm-factory-data-olo/src/main/java/com/logpm/factorydata/olo/controller/OrderController.java +++ b/blade-service/logpm-factory-data/logpm-factory-data-olo/src/main/java/com/logpm/factorydata/olo/controller/OrderController.java @@ -9,7 +9,9 @@ import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import lombok.AllArgsConstructor; import lombok.extern.slf4j.Slf4j; +import org.springblade.common.constant.factorydata.FactoryDataConstants; import org.springblade.core.tool.api.R; +import org.springframework.amqp.rabbit.core.RabbitTemplate; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; @@ -34,6 +36,19 @@ import java.util.stream.Collectors; public class OrderController { private final DeliveryNoteService service; + private final RabbitTemplate rabbitTemplate; + + @ResponseBody + @PostMapping("sendMsg") + @ApiOperationSupport(order = 1) + @ApiOperation(value = "推送节点数据", notes = "推送节点数据") + public R order(@RequestBody Map param) { + log.info("推送节点数据:{} ", JSONUtil.toJsonStr(param)); + String msg = JSONUtil.toJsonStr(param); + rabbitTemplate.convertAndSend(FactoryDataConstants.Mq.RoutingKeys.OLO_NODE_DATA_PUSH, + FactoryDataConstants.Mq.RoutingKeys.OLO_NODE_DATA_PUSH, msg); + return R.success("推送成功"); + } @ResponseBody @PostMapping