java脚本执行方法

@Test
    public void modifyTest() throws IOException {

        File file = new File("/Users/zl/pending file/修复数据.txt");
        List<String> list = FileUtils.readLines(file, StandardCharsets.UTF_8);

        Map<String, Object> body;
        Map<String, String> header;
        for (String s : list) {
            String[] split = s.split("\\t");

            CoreHttpClient coreHttpClient = CoreHttpClient.builder().build();

            String url = "http://localhost:8080/vsd/bsadc/bd/rdasy/v1/apdsad-repaasy";

            header = new HashMap<>(4);
            header.put("unionId", split[1]);

            body = new HashMap<>(4);
            body.put("biz_order_no", split[0]);

            String post = coreHttpClient.post(url, body, header);

            System.out.println(post);
            System.out.println("bizOrderNo:" + split[0] + ",unionId:" + split[1]);
        }

    }

 

posted @ 2020-04-16 17:50  努力的小白菜  阅读(1290)  评论(0编辑  收藏  举报