ludc
2024-02-29 8ef9e366be48dc5e8e52617ea8ed48b37a0e1f74
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
package com.vci.ubcs.example.controller;
 
import com.alibaba.fastjson.JSONObject;
import com.vci.ubcs.example.util.HttpUtils;
import lombok.AllArgsConstructor;
import org.springframework.util.LinkedMultiValueMap;
import org.springframework.util.MultiValueMap;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
 
import java.util.ArrayList;
 
/**
 * @author ludc
 * @date 2024/2/20 22:04
 */
@RestController
@AllArgsConstructor
@RequestMapping("/erpTest")
public class MyServiceTest {
 
    @GetMapping("/test1")
    public void testMyService() {
 
        /*MultiValueMap<String, String> params = new LinkedMultiValueMap<>();
        params.add("dataType","json");
//        params.add("dataString","data:{object:[{\"classCodde\":\"RENYUAN\",\"itemid\":\"19986015\",\"code\":\"698021151\",\"library\":\"RENYUAN\",\"pro\":[{\"filedName\":\"sfz\",\"outName\":\"身份证\",\"filedValue\":\"\"}]}]}");
        NodeJosnDTO nodeJosnDTO = new NodeJosnDTO();
        NodedataDTO nodeDataDTO = new NodedataDTO();
        NodeObjectDTO nodeObjectDTO = new NodeObjectDTO();
        nodeObjectDTO.setCode("698021151");//设置编码
        nodeObjectDTO.setClassCode("RENYUAN");
        nodeObjectDTO.setStatus("Released");
        nodeObjectDTO.setItemid("19986015");
        nodeObjectDTO.setLibrary("RENYUAN");
 
        List<NodeObjectDTO> nodeObjectDTOS = new ArrayList<>();
        nodeObjectDTOS.add(nodeObjectDTO);
        nodeDataDTO.setObject(nodeObjectDTOS);
 
        nodeJosnDTO.setData(nodeDataDTO);
 
        List<NodeProDTO> nodeProDTOS = new ArrayList<>();
        NodeProDTO nodeProDTO = new NodeProDTO();
        nodeProDTO.setFiledName("sfz");
        nodeProDTO.setOutname("身份证");
        nodeProDTO.setFiledValue("");
        nodeProDTOS.add(nodeProDTO);
        nodeObjectDTO.setPro(nodeProDTOS);
 
        Object object = JSONObject.toJSON(nodeJosnDTO);
        String sendString = object.toString();
        XStream xStream = new XStream(new DomDriver());
        xStream.processAnnotations(NodedataDTO.class);
        xStream.autodetectAnnotations(true);
//        sendString = "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n" + xStream.toXML(nodeDataDTO);
        params.add("dataString",sendString);
 
        MultiValueMap<String, String> headers = new LinkedMultiValueMap<>();
        String backString = HttpUtils.post("http://localhost:8118/test/test", params, headers);*/
    }
 
}