|
@@ -8,6 +8,7 @@ import com.ruoyi.common.utils.MapUtil;
|
|
import com.sd.wln.constants.WlnConstant;
|
|
import com.sd.wln.constants.WlnConstant;
|
|
import com.sd.wln.entity.GoodsSpecParam;
|
|
import com.sd.wln.entity.GoodsSpecParam;
|
|
import com.sd.wln.entity.SkuClassifyParam;
|
|
import com.sd.wln.entity.SkuClassifyParam;
|
|
|
|
+import com.sd.wln.entity.StockParam;
|
|
import com.sd.wln.entity.TradesParam;
|
|
import com.sd.wln.entity.TradesParam;
|
|
import org.apache.http.HttpEntity;
|
|
import org.apache.http.HttpEntity;
|
|
import org.apache.http.client.methods.CloseableHttpResponse;
|
|
import org.apache.http.client.methods.CloseableHttpResponse;
|
|
@@ -68,10 +69,10 @@ public class WlnUtil {
|
|
*/
|
|
*/
|
|
public static List<JSONObject> getOrderList(Integer page, Integer limit, Long startTime, Long endTime, String warehouseCode) throws Exception {
|
|
public static List<JSONObject> getOrderList(Integer page, Integer limit, Long startTime, Long endTime, String warehouseCode) throws Exception {
|
|
TradesParam param = new TradesParam();
|
|
TradesParam param = new TradesParam();
|
|
- param.setApprove_time(startTime);
|
|
|
|
- param.setEnd_time(endTime);
|
|
|
|
param.setPage(page);
|
|
param.setPage(page);
|
|
param.setLimit(limit);
|
|
param.setLimit(limit);
|
|
|
|
+ param.setApprove_time(startTime);
|
|
|
|
+ param.setEnd_time(endTime);
|
|
param.setStorage_code(warehouseCode);
|
|
param.setStorage_code(warehouseCode);
|
|
param.setIs_split(true);
|
|
param.setIs_split(true);
|
|
param.setManualImport(false);
|
|
param.setManualImport(false);
|
|
@@ -80,6 +81,7 @@ public class WlnUtil {
|
|
// param.setTrade_status("2");
|
|
// param.setTrade_status("2");
|
|
// }
|
|
// }
|
|
param.generateSign(MapUtil.createLinkString(MapUtil.beanToMap(param)));
|
|
param.generateSign(MapUtil.createLinkString(MapUtil.beanToMap(param)));
|
|
|
|
+
|
|
String result = send(PREFIX + "erp/opentrade/list/trades", MapUtil.beanToMap(param));
|
|
String result = send(PREFIX + "erp/opentrade/list/trades", MapUtil.beanToMap(param));
|
|
JSONObject json = JSONObject.parseObject(result);
|
|
JSONObject json = JSONObject.parseObject(result);
|
|
Integer code = json.getInteger("code");
|
|
Integer code = json.getInteger("code");
|
|
@@ -89,17 +91,45 @@ public class WlnUtil {
|
|
return json.getJSONArray("data").toJavaList(JSONObject.class);
|
|
return json.getJSONArray("data").toJavaList(JSONObject.class);
|
|
}
|
|
}
|
|
|
|
|
|
- // public static void main(String[] args) throws Exception {
|
|
|
|
- // List<JSONObject> skuList = getSkuList(1, 200);
|
|
|
|
- //
|
|
|
|
- // List<JSONObject> skuClassifyList = getSkuClassifyList();
|
|
|
|
- //
|
|
|
|
- // long endTime = System.currentTimeMillis();
|
|
|
|
- // long startTime = endTime - 1000 * 60 * 60 * 24;
|
|
|
|
- // List<JSONObject> orderList = getOrderList(1, 50, startTime, endTime, "B012");
|
|
|
|
- //
|
|
|
|
- // System.out.println();
|
|
|
|
- // }
|
|
|
|
|
|
+ /**
|
|
|
|
+ * 获取出库单
|
|
|
|
+ */
|
|
|
|
+ public static List<JSONObject> getOutboundOrder(Integer page, Integer limit, Long startTime, Long endTime) throws IOException {
|
|
|
|
+ StockParam param = new StockParam();
|
|
|
|
+ param.setPage(page);
|
|
|
|
+ param.setLimit(limit);
|
|
|
|
+ param.setModify_time(startTime);
|
|
|
|
+ param.setModify_end_time(endTime);
|
|
|
|
+ param.setIs_split(true);
|
|
|
|
+ param.generateSign(MapUtil.createLinkString(MapUtil.beanToMap(param)));
|
|
|
|
+
|
|
|
|
+ String result = send(PREFIX + "erp/sale/stock/out/query", 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);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ public static void main(String[] args) throws Exception {
|
|
|
|
+ // List<JSONObject> skuList = getSkuList(1, 200);
|
|
|
|
+ //
|
|
|
|
+ // List<JSONObject> skuClassifyList = getSkuClassifyList();
|
|
|
|
+ //
|
|
|
|
+ // long endTime = System.currentTimeMillis();
|
|
|
|
+ // long startTime = endTime - 1000 * 60 * 60 * 24;
|
|
|
|
+ // List<JSONObject> orderList = getOrderList(1, 50, startTime, endTime, "B012");
|
|
|
|
+
|
|
|
|
+ long endTime = System.currentTimeMillis();
|
|
|
|
+ long startTime = endTime - 1000 * 60 * 60 * 24 * 7;
|
|
|
|
+
|
|
|
|
+ List<JSONObject> outboundOrder = getOutboundOrder(0, 200, 1690367461000L, 1690367461000L);
|
|
|
|
+
|
|
|
|
+ String s = JSONObject.toJSONString(outboundOrder);
|
|
|
|
+ System.out.println();
|
|
|
|
+ }
|
|
|
|
|
|
|
|
|
|
/**
|
|
/**
|