|
@@ -35,6 +35,7 @@ import java.io.UnsupportedEncodingException;
|
|
|
import java.text.SimpleDateFormat;
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.Arrays;
|
|
|
+import java.util.Collections;
|
|
|
import java.util.HashMap;
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
@@ -2145,7 +2146,7 @@ public class SupplyChainController extends BaseController {
|
|
|
}));
|
|
|
}
|
|
|
|
|
|
- static ExecutorService fxNowService = Executors.newFixedThreadPool(3);
|
|
|
+ static ExecutorService fxNowService = Executors.newFixedThreadPool(10);
|
|
|
|
|
|
|
|
|
@PostMapping(value = "/ruixuanAccept")
|
|
@@ -2181,7 +2182,7 @@ public class SupplyChainController extends BaseController {
|
|
|
|
|
|
}
|
|
|
|
|
|
- static ExecutorService orderNewsService = Executors.newFixedThreadPool(3);
|
|
|
+ static ExecutorService orderNewsService = Executors.newFixedThreadPool(10);
|
|
|
|
|
|
/**
|
|
|
* https://open.kwaixiaodian.com/zone/new/docs/msg?name=kwaishop_order_delivering&version=1
|
|
@@ -2189,6 +2190,17 @@ public class SupplyChainController extends BaseController {
|
|
|
* 订单已支付消息、订单已发货消息、订单已收货消息、订单交易失败消息、订单交易成功消息 ->状态变更
|
|
|
* 新增订单 ->调取新增详情接口
|
|
|
*/
|
|
|
+
|
|
|
+ public static final List<String> EVENT_LIST =
|
|
|
+ Collections.unmodifiableList(Arrays.asList(
|
|
|
+ "kwaishop_order_deliverySuccess",//已收货消息
|
|
|
+ "kwaishop_order_paySuccess",//已支付消息
|
|
|
+ "kwaishop_order_orderFail",//交易失败消息
|
|
|
+ "kwaishop_order_orderSuccess",//交易成功消息
|
|
|
+ "kwaishop_order_delivering"//已发货消息
|
|
|
+
|
|
|
+ ));
|
|
|
+
|
|
|
@PostMapping(value = "/ruixuanKWaiShopOrderAccept")
|
|
|
public Map<String, Object> ruixuanKWaiShopOrderAccept(@RequestBody String eventsEncoded) {
|
|
|
Map<String, Object> result = new HashMap<>();
|
|
@@ -2196,12 +2208,12 @@ public class SupplyChainController extends BaseController {
|
|
|
String events = PlatformEventSecurityUtil.decode(eventsEncoded, "xjX0jX828wWrnnwt26UYDA==");
|
|
|
logger.info("-KWaiShop-订单-消息-订阅- 消息体:\n{}", events);
|
|
|
JSONObject eventJSon = JSONObject.parseObject(events);
|
|
|
- List<String> list = new ArrayList<>();
|
|
|
+ /* List<String> list = new ArrayList<>();
|
|
|
list.add("kwaishop_order_deliverySuccess");//已收货消息
|
|
|
list.add("kwaishop_order_paySuccess");//已支付消息
|
|
|
list.add("kwaishop_order_delivering");//已发货消息
|
|
|
list.add("kwaishop_order_orderFail");//交易失败消息
|
|
|
- list.add("kwaishop_order_orderSuccess");//交易成功消息
|
|
|
+ list.add("kwaishop_order_orderSuccess");//交易成功消息*/
|
|
|
orderNewsService.submit(new Runnable() {
|
|
|
@Override
|
|
|
public void run() {
|
|
@@ -2211,7 +2223,7 @@ public class SupplyChainController extends BaseController {
|
|
|
//订单新增消息
|
|
|
if ("kwaishop_order_addOrder".equals(event)) {
|
|
|
orderCursorListService.insertKWaiShopOrder(eventJSon);
|
|
|
- } else if (list.contains(event)) {
|
|
|
+ } else if (EVENT_LIST.contains(event)) {
|
|
|
//状态变更 kwaixiaodian_order_cursor_list
|
|
|
orderCursorListService.updateKWaiShopOrderStatus(eventJSon);
|
|
|
}
|
|
@@ -2225,6 +2237,7 @@ public class SupplyChainController extends BaseController {
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
//返回成功
|
|
|
+ result.put("result", 1);
|
|
|
return result;
|
|
|
}
|
|
|
|