Authored by chenchao

append transfer url

package com.yohoufo.order.utils;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import java.util.List;
public class CurlHelp {
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";
public static void main(String[] args) {
String datas = "[{" +
"\"order_code\": \"10052657635338\"," +
"\"uid\": \"703925\"," +
"\"seller_uid\": \"13959998\"," +
"\"earnest_money\": \"28.00\"" +
"}, {" +
"\"order_code\": \"10052684988431\"," +
"\"uid\": \"11584317\"," +
"\"seller_uid\": \"76264399\"," +
"\"earnest_money\": \"28.00\"" +
"}, {" +
"\"order_code\": \"10052694605841\"," +
"\"uid\": \"70417637\"," +
"\"seller_uid\": \"3972935\"," +
"\"earnest_money\": \"30.76\"" +
"}, {" +
"\"order_code\": \"10052729315329\"," +
"\"uid\": \"4433746\"," +
"\"seller_uid\": \"52349726\"," +
"\"earnest_money\": \"118.76\"" +
"}, {" +
"\"order_code\": \"10052737261581\"," +
"\"uid\": \"3273670\"," +
"\"seller_uid\": \"67642459\"," +
"\"earnest_money\": \"32.36\"" +
"}, {" +
"\"order_code\": \"10052741144595\"," +
"\"uid\": \"77371309\"," +
"\"seller_uid\": \"4816873\"," +
"\"earnest_money\": \"109.56\"" +
"}, {" +
"\"order_code\": \"10052759093262\"," +
"\"uid\": \"3455829\"," +
"\"seller_uid\": \"13959998\"," +
"\"earnest_money\": \"28.00\"" +
"}, {" +
"\"order_code\": \"10052770562064\"," +
"\"uid\": \"71987863\"," +
"\"seller_uid\": \"57412263\"," +
"\"earnest_money\": \"82.76\"" +
"}, {" +
"\"order_code\": \"10052773691411\"," +
"\"uid\": \"76714603\"," +
"\"seller_uid\": \"65561675\"," +
"\"earnest_money\": \"28.00\"" +
"}, {" +
"\"order_code\": \"10052777820178\"," +
"\"uid\": \"77376115\"," +
"\"seller_uid\": \"69530557\"," +
"\"earnest_money\": \"28.00\"" +
"}, {" +
"\"order_code\": \"10052784668693\"," +
"\"uid\": \"60361149\"," +
"\"seller_uid\": \"69391317\"," +
"\"earnest_money\": \"130.76\"" +
"}, {" +
"\"order_code\": \"10052815101967\"," +
"\"uid\": \"73591483\"," +
"\"seller_uid\": \"56900597\"," +
"\"earnest_money\": \"28.00\"" +
"}, {" +
"\"order_code\": \"10052825341971\"," +
"\"uid\": \"76805101\"," +
"\"seller_uid\": \"52674584\"," +
"\"earnest_money\": \"49.96\"" +
"}, {" +
"\"order_code\": \"10052864851978\"," +
"\"uid\": \"76104577\"," +
"\"seller_uid\": \"13074205\"," +
"\"earnest_money\": \"28.00\"" +
"}, {" +
"\"order_code\": \"10052873871377\"," +
"\"uid\": \"77374969\"," +
"\"seller_uid\": \"61240041\"," +
"\"earnest_money\": \"28.36\"" +
"}, {" +
"\"order_code\": \"10052893884432\"," +
"\"uid\": \"15154744\"," +
"\"seller_uid\": \"64968971\"," +
"\"earnest_money\": \"68.36\"" +
"}]";
List<JSONObject> dataArrys = JSON.parseArray(datas, JSONObject.class);
for (JSONObject obj: dataArrys){
String curl = String.format(transferTemp,new Object[]{obj.getString("seller_uid"),obj.getString("order_code"),obj.getString("uid"),obj.getString("earnest_money")});
System.out.println(curl);
}
}
}
... ...