Showing
1 changed file
with
101 additions
and
0 deletions
1 | +package com.yohoufo.order.utils; | ||
2 | + | ||
3 | +import com.alibaba.fastjson.JSON; | ||
4 | +import com.alibaba.fastjson.JSONObject; | ||
5 | + | ||
6 | +import java.util.List; | ||
7 | + | ||
8 | +public class CurlHelp { | ||
9 | + | ||
10 | + final static String transferTemp = "curl -i -H \"Content-Type: application/json\" -X POST --data '{\"sellerUid\":\"%s\",\"buyerOrderCode\":\"%s\",\"type\":\"3\",\"transferCase\":\"EARNEST_MONEY_TO_BUYER\",\"transeferCellNode\":{\"uid\":\"%s\",\"amount\":\"%s\"},\"swdType\":\"SELLER_OVER_TIME\",\"alarmConfig\":\"DELIVER_TIME_OUT\"}' http://172.31.70.86:8080/ufo-gateway/erp/order/help/transfer"; | ||
11 | + | ||
12 | + public static void main(String[] args) { | ||
13 | + String datas = "[{" + | ||
14 | + "\"order_code\": \"10052657635338\"," + | ||
15 | + "\"uid\": \"703925\"," + | ||
16 | + "\"seller_uid\": \"13959998\"," + | ||
17 | + "\"earnest_money\": \"28.00\"" + | ||
18 | + "}, {" + | ||
19 | + "\"order_code\": \"10052684988431\"," + | ||
20 | + "\"uid\": \"11584317\"," + | ||
21 | + "\"seller_uid\": \"76264399\"," + | ||
22 | + "\"earnest_money\": \"28.00\"" + | ||
23 | + "}, {" + | ||
24 | + "\"order_code\": \"10052694605841\"," + | ||
25 | + "\"uid\": \"70417637\"," + | ||
26 | + "\"seller_uid\": \"3972935\"," + | ||
27 | + "\"earnest_money\": \"30.76\"" + | ||
28 | + "}, {" + | ||
29 | + "\"order_code\": \"10052729315329\"," + | ||
30 | + "\"uid\": \"4433746\"," + | ||
31 | + "\"seller_uid\": \"52349726\"," + | ||
32 | + "\"earnest_money\": \"118.76\"" + | ||
33 | + "}, {" + | ||
34 | + "\"order_code\": \"10052737261581\"," + | ||
35 | + "\"uid\": \"3273670\"," + | ||
36 | + "\"seller_uid\": \"67642459\"," + | ||
37 | + "\"earnest_money\": \"32.36\"" + | ||
38 | + "}, {" + | ||
39 | + "\"order_code\": \"10052741144595\"," + | ||
40 | + "\"uid\": \"77371309\"," + | ||
41 | + "\"seller_uid\": \"4816873\"," + | ||
42 | + "\"earnest_money\": \"109.56\"" + | ||
43 | + "}, {" + | ||
44 | + "\"order_code\": \"10052759093262\"," + | ||
45 | + "\"uid\": \"3455829\"," + | ||
46 | + "\"seller_uid\": \"13959998\"," + | ||
47 | + "\"earnest_money\": \"28.00\"" + | ||
48 | + "}, {" + | ||
49 | + "\"order_code\": \"10052770562064\"," + | ||
50 | + "\"uid\": \"71987863\"," + | ||
51 | + "\"seller_uid\": \"57412263\"," + | ||
52 | + "\"earnest_money\": \"82.76\"" + | ||
53 | + "}, {" + | ||
54 | + "\"order_code\": \"10052773691411\"," + | ||
55 | + "\"uid\": \"76714603\"," + | ||
56 | + "\"seller_uid\": \"65561675\"," + | ||
57 | + "\"earnest_money\": \"28.00\"" + | ||
58 | + "}, {" + | ||
59 | + "\"order_code\": \"10052777820178\"," + | ||
60 | + "\"uid\": \"77376115\"," + | ||
61 | + "\"seller_uid\": \"69530557\"," + | ||
62 | + "\"earnest_money\": \"28.00\"" + | ||
63 | + "}, {" + | ||
64 | + "\"order_code\": \"10052784668693\"," + | ||
65 | + "\"uid\": \"60361149\"," + | ||
66 | + "\"seller_uid\": \"69391317\"," + | ||
67 | + "\"earnest_money\": \"130.76\"" + | ||
68 | + "}, {" + | ||
69 | + "\"order_code\": \"10052815101967\"," + | ||
70 | + "\"uid\": \"73591483\"," + | ||
71 | + "\"seller_uid\": \"56900597\"," + | ||
72 | + "\"earnest_money\": \"28.00\"" + | ||
73 | + "}, {" + | ||
74 | + "\"order_code\": \"10052825341971\"," + | ||
75 | + "\"uid\": \"76805101\"," + | ||
76 | + "\"seller_uid\": \"52674584\"," + | ||
77 | + "\"earnest_money\": \"49.96\"" + | ||
78 | + "}, {" + | ||
79 | + "\"order_code\": \"10052864851978\"," + | ||
80 | + "\"uid\": \"76104577\"," + | ||
81 | + "\"seller_uid\": \"13074205\"," + | ||
82 | + "\"earnest_money\": \"28.00\"" + | ||
83 | + "}, {" + | ||
84 | + "\"order_code\": \"10052873871377\"," + | ||
85 | + "\"uid\": \"77374969\"," + | ||
86 | + "\"seller_uid\": \"61240041\"," + | ||
87 | + "\"earnest_money\": \"28.36\"" + | ||
88 | + "}, {" + | ||
89 | + "\"order_code\": \"10052893884432\"," + | ||
90 | + "\"uid\": \"15154744\"," + | ||
91 | + "\"seller_uid\": \"64968971\"," + | ||
92 | + "\"earnest_money\": \"68.36\"" + | ||
93 | + "}]"; | ||
94 | + List<JSONObject> dataArrys = JSON.parseArray(datas, JSONObject.class); | ||
95 | + | ||
96 | + for (JSONObject obj: dataArrys){ | ||
97 | + String curl = String.format(transferTemp,new Object[]{obj.getString("seller_uid"),obj.getString("order_code"),obj.getString("uid"),obj.getString("earnest_money")}); | ||
98 | + System.out.println(curl); | ||
99 | + } | ||
100 | + } | ||
101 | +} |
-
Please register or login to post a comment