Browse Source

feat(all): 索菲亚工厂

1 增加华之韵物流对接
pre-production
zhaoqiaobo 3 weeks ago
parent
commit
935172717c
  1. 2
      blade-service/logpm-factory-data/logpm-factory-data-suofeiya/src/main/java/com/logpm/factorydata/suofeiya/config/InterceptorAdapterConfig.java
  2. 18
      blade-service/logpm-factory-data/logpm-factory-data-suofeiya/src/main/java/com/logpm/factorydata/suofeiya/controller/OrderController.java

2
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);
}
}

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

Loading…
Cancel
Save