InsertSupplier.java
1.54 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
package com.huaheng.test;
import com.alibaba.fastjson.JSONObject;
import com.google.gson.Gson;
import com.huaheng.api.jindie.InvokeHelper;
import com.huaheng.api.jindie.domain.supplier.SelectSupplier;
import com.huaheng.api.jindie.domain.uri.JinDieApiUri;
import com.huaheng.pc.monitor.job.task.RyTask;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
import javax.annotation.Resource;
@SpringBootTest
@RunWith(SpringRunner.class)
public class InsertSupplier {
@Resource
private InvokeHelper invokeHelper;
@Resource
private RyTask rytask;
@Test
public void insert() throws Exception {
/**
* {
* "data":{
* "FormId":"BD_Supplier",
* "FieldKeys":"FNUMBER,FNAME",
* "StartRow":0,
* "Limit":2000
*
* }
* }
*/
rytask.login("{ \"acctID\":\"630f56d628d385\", \"username\":\"administrator\", \"password\":\"CW@kd2022\", \"lcid\":\"2052\" }");
SelectSupplier sup=new SelectSupplier();
SelectSupplier.DataDTO dataDTO = new SelectSupplier.DataDTO();
dataDTO.setFormId("BD_Supplier");
dataDTO.setFieldKeys("FNUMBER,FNAME");
dataDTO.setStartRow(2001);
dataDTO.setLimit(2000);
sup.setData(dataDTO);
Gson gson = new Gson();
String s = gson.toJson(sup);
invokeHelper.selectSupplier(JinDieApiUri.INSERT_SUPPLIER.getApiUri(),s);
}
}