|
@@ -48,14 +48,23 @@ public class SupplyChainController extends BaseController {
|
|
|
@Autowired
|
|
|
private IKuaishouPromoterService promoterService;
|
|
|
|
|
|
- @Value("${accept.privateKey}")
|
|
|
- private String privateKey;
|
|
|
+ @Value("${accept.ruiXuanPrivateKey}")
|
|
|
+ private String ruiXuanPrivateKey;
|
|
|
+
|
|
|
+ @Value("${accept.mgsPrivateKey}")
|
|
|
+ private String mgsPrivateKey;
|
|
|
+
|
|
|
+ @Value("${accept.rocketPrivateKey}")
|
|
|
+ private String rocketPrivateKey;
|
|
|
+
|
|
|
+ @Value("${accept.dfcPrivateKey}")
|
|
|
+ private String dfcPrivateKey;
|
|
|
|
|
|
@GetMapping("/privateKey")
|
|
|
@ApiOperation(value = "达人订单")
|
|
|
public String privateKey() {
|
|
|
|
|
|
- return privateKey;
|
|
|
+ return ruiXuanPrivateKey;
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -2029,10 +2038,45 @@ public class SupplyChainController extends BaseController {
|
|
|
static ExecutorService fxNowService = Executors.newFixedThreadPool(3);
|
|
|
|
|
|
|
|
|
- @PostMapping(value = "/accept")
|
|
|
- public Map<String, Object> acceptEvent(@RequestBody String eventsEncoded) {
|
|
|
+ @PostMapping(value = "/ruixuanAccept")
|
|
|
+ public Map<String, Object> ruixuanAccept(@RequestBody String eventsEncoded) {
|
|
|
+ try {
|
|
|
+ logger.error("567睿选消息订阅");
|
|
|
+ String events = PlatformEventSecurityUtil.decode(eventsEncoded, ruiXuanPrivateKey);
|
|
|
+ JSONObject eventJSon = JSONObject.parseObject(events);
|
|
|
+ fxNowService.submit(new Runnable() {
|
|
|
+ @Override
|
|
|
+ public void run() {
|
|
|
+ try {
|
|
|
+ if (!Check.isNull(eventJSon)) {
|
|
|
+ String event = eventJSon.getString("event");
|
|
|
+ if ("kwaishop_distribute_order_change_notify".equals(event)) {
|
|
|
+ supplyChainService.updateOrder(eventJSon);
|
|
|
+ } else if ("kwaishop_distribute_activity_item_change".equals(event)) {
|
|
|
+ supplyChainService.updateItem(eventJSon);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ } catch (KsMerchantApiException e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ //返回成功
|
|
|
+ Map<String, Object> result = new HashMap<>();
|
|
|
+ result.put("result", 1);
|
|
|
+ return result;
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ @PostMapping(value = "/mgsAccept")
|
|
|
+ public Map<String, Object> mgsAccept(@RequestBody String eventsEncoded) {
|
|
|
try {
|
|
|
- String events = PlatformEventSecurityUtil.decode(eventsEncoded, privateKey);
|
|
|
+ logger.error("RX食品消息订阅");
|
|
|
+ String events = PlatformEventSecurityUtil.decode(eventsEncoded, mgsPrivateKey);
|
|
|
JSONObject eventJSon = JSONObject.parseObject(events);
|
|
|
fxNowService.submit(new Runnable() {
|
|
|
@Override
|
|
@@ -2054,8 +2098,73 @@ public class SupplyChainController extends BaseController {
|
|
|
} catch (KsMerchantApiException e) {
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
- //events为明文,这里加入自己代码逻辑
|
|
|
+ //返回成功
|
|
|
+ Map<String, Object> result = new HashMap<>();
|
|
|
+ result.put("result", 1);
|
|
|
+ return result;
|
|
|
+
|
|
|
+ }
|
|
|
|
|
|
+ @PostMapping(value = "/rocketAccept")
|
|
|
+ public Map<String, Object> rocketAccept(@RequestBody String eventsEncoded) {
|
|
|
+ try {
|
|
|
+ logger.error("王炸睿选消息订阅");
|
|
|
+ String events = PlatformEventSecurityUtil.decode(eventsEncoded, rocketPrivateKey);
|
|
|
+ JSONObject eventJSon = JSONObject.parseObject(events);
|
|
|
+ fxNowService.submit(new Runnable() {
|
|
|
+ @Override
|
|
|
+ public void run() {
|
|
|
+ try {
|
|
|
+ if (!Check.isNull(eventJSon)) {
|
|
|
+ String event = eventJSon.getString("event");
|
|
|
+ if ("kwaishop_distribute_order_change_notify".equals(event)) {
|
|
|
+ supplyChainService.updateOrder(eventJSon);
|
|
|
+ } else if ("kwaishop_distribute_activity_item_change".equals(event)) {
|
|
|
+ supplyChainService.updateItem(eventJSon);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ } catch (KsMerchantApiException e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ //返回成功
|
|
|
+ Map<String, Object> result = new HashMap<>();
|
|
|
+ result.put("result", 1);
|
|
|
+ return result;
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ @PostMapping(value = "/dfcAccept")
|
|
|
+ public Map<String, Object> dfcAccept(@RequestBody String eventsEncoded) {
|
|
|
+ try {
|
|
|
+ logger.error("大风车严选消息订阅");
|
|
|
+ String events = PlatformEventSecurityUtil.decode(eventsEncoded, dfcPrivateKey);
|
|
|
+ JSONObject eventJSon = JSONObject.parseObject(events);
|
|
|
+ fxNowService.submit(new Runnable() {
|
|
|
+ @Override
|
|
|
+ public void run() {
|
|
|
+ try {
|
|
|
+ if (!Check.isNull(eventJSon)) {
|
|
|
+ String event = eventJSon.getString("event");
|
|
|
+ if ("kwaishop_distribute_order_change_notify".equals(event)) {
|
|
|
+ supplyChainService.updateOrder(eventJSon);
|
|
|
+ } else if ("kwaishop_distribute_activity_item_change".equals(event)) {
|
|
|
+ supplyChainService.updateItem(eventJSon);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ } catch (KsMerchantApiException e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
//返回成功
|
|
|
Map<String, Object> result = new HashMap<>();
|
|
|
result.put("result", 1);
|