|
@@ -2,6 +2,7 @@ package com.sd.wln.util;
|
|
|
|
|
|
import cn.hutool.core.io.IoUtil;
|
|
|
import cn.hutool.json.JSONUtil;
|
|
|
+import com.alibaba.fastjson2.JSON;
|
|
|
import com.alibaba.fastjson2.JSONObject;
|
|
|
import com.ruoyi.common.exception.ServiceException;
|
|
|
import com.ruoyi.common.utils.MapUtil;
|
|
@@ -20,6 +21,7 @@ import org.apache.http.util.EntityUtils;
|
|
|
|
|
|
import java.io.IOException;
|
|
|
import java.util.List;
|
|
|
+import java.util.stream.Collectors;
|
|
|
|
|
|
public class WlnUtil {
|
|
|
|
|
@@ -136,26 +138,32 @@ public class WlnUtil {
|
|
|
return json.getJSONArray("data").toJavaList(JSONObject.class);
|
|
|
}
|
|
|
|
|
|
- // public static void main(String[] args) throws Exception {
|
|
|
- // List<JSONObject> skuList = getSkuList(1, 200);
|
|
|
- // System.out.println();
|
|
|
- //
|
|
|
- // List<JSONObject> skuClassifyList = getSkuClassifyList();
|
|
|
- // System.out.println();
|
|
|
- //
|
|
|
- // long endTime = System.currentTimeMillis();
|
|
|
- // long startTime = endTime - 1000 * 60 * 60 * 24;
|
|
|
- // List<JSONObject> orderList = getOrderList(1, 50, startTime, endTime, "B012");
|
|
|
- // System.out.println();
|
|
|
- //
|
|
|
- // List<JSONObject> orderList = getOrderList("XD230717000737");
|
|
|
- // System.out.println();
|
|
|
- //
|
|
|
- // long endTime = System.currentTimeMillis();
|
|
|
- // long startTime = endTime - 1000 * 60 * 60 * 24 * 7;
|
|
|
- // List<JSONObject> outboundOrder = getOutboundOrder(0, 200, 1690367461000L, 1690367461000L);
|
|
|
- // System.out.println();
|
|
|
- // }
|
|
|
+ public static void main(String[] args) throws Exception {
|
|
|
+// List<JSONObject> skuList = getSkuList(1, 200);
|
|
|
+// System.out.println();
|
|
|
+//
|
|
|
+// List<JSONObject> skuClassifyList = getSkuClassifyList();
|
|
|
+// System.out.println();
|
|
|
+//
|
|
|
+// long endTime = System.currentTimeMillis();
|
|
|
+// long startTime = endTime - 1000 * 60 * 60 * 24;
|
|
|
+// List<JSONObject> orderList = getOrderList(1, 50, startTime, endTime, "B012");
|
|
|
+// System.out.println();
|
|
|
+
|
|
|
+ String a = "[\"XD231026000939\",\"XD231026000908\",\"XD231026001177\",\"XD231026001036\",\"XD231026001184\",\"XD231026001229\",\"XD231026001432\",\"XD231026001431\",\"XD231026001310\",\"XD231026001572\",\"XD231026001441\",\"XD231026001205\",\"XD231026001215\",\"XD231026001602\",\"XD231026001419\",\"XD231026001632\",\"XD231026001662\",\"XD231026001459\",\"XD231026001414\",\"XD231026001235\",\"XD231026001268\",\"XD231026001298\",\"XD231026001481\",\"XD231026001265\",\"XD231026001376\",\"XD231026001683\",\"XD231026001559\",\"XD231026001589\",\"XD231026001325\",\"XD231026001511\",\"XD231026001497\",\"XD231026001507\",\"XD231026001506\",\"XD231026001365\",\"XD231026001742\",\"XD231026001574\",\"XD231026001551\",\"XD231026001620\",\"XD231026001614\",\"XD231026001762\",\"XD231026001455\",\"XD231026001680\",\"XD231026001684\",\"XD231026001641\",\"XD231026001704\",\"XD231026001724\",\"XD231026001667\",\"XD231026001606\",\"XD231026001852\",\"XD231026001872\",\"XD231026001710\",\"XD231026001677\",\"XD231026001681\",\"XD231026001892\",\"XD231026001749\",\"XD231026001701\",\"XD231026001721\",\"XD231026001750\",\"XD231026001666\",\"XD231026002062\"]";
|
|
|
+ List<String> strings = JSON.parseArray(a, String.class);
|
|
|
+
|
|
|
+ List<String> collect1 = strings.stream().distinct().collect(Collectors.toList());
|
|
|
+ String collect = strings.stream().collect(Collectors.joining(","));
|
|
|
+
|
|
|
+ JSONObject orderList = getOrderByWlnCode(collect);
|
|
|
+ System.out.println(orderList.toString());
|
|
|
+
|
|
|
+// long endTime = System.currentTimeMillis();
|
|
|
+// long startTime = endTime - 1000 * 60 * 60 * 24 * 7;
|
|
|
+// List<JSONObject> outboundOrder = getOutboundOrder(0, 200, 1690367461000L, 1690367461000L);
|
|
|
+// System.out.println();
|
|
|
+ }
|
|
|
|
|
|
/**
|
|
|
* post请求
|
|
@@ -182,4 +190,25 @@ public class WlnUtil {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获取订单
|
|
|
+ */
|
|
|
+ public static List<JSONObject> getOrderListByWlnCodeList(String wlnCodeListStr) throws Exception {
|
|
|
+ TradesParam param = new TradesParam();
|
|
|
+ param.setBill_code(wlnCodeListStr);
|
|
|
+ param.setPage(1);
|
|
|
+ param.setLimit(200);
|
|
|
+ param.setIs_split(true);
|
|
|
+ param.setManualImport(false);
|
|
|
+ param.generateSign(MapUtil.createLinkString(MapUtil.beanToMap(param)));
|
|
|
+ String result = send(PREFIX + "erp/opentrade/list/trades", MapUtil.beanToMap(param));
|
|
|
+ JSONObject json = JSONObject.parseObject(result);
|
|
|
+ Integer code = json.getInteger("code");
|
|
|
+ if (code != 0) {
|
|
|
+ throw new ServiceException(result);
|
|
|
+ }
|
|
|
+ return json.getJSONArray("data").toJavaList(JSONObject.class);
|
|
|
+ }
|
|
|
+
|
|
|
}
|