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