zm
2020-05-18 a18bfacbf56b401f6e0fdae8710fbca4df8cff77
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
65
66
67
68
69
70
71
72
package cn.autoform.test;
 
import java.util.Map;
import java.util.concurrent.TimeoutException;
 
import javax.annotation.Resource;
 
import org.springframework.transaction.annotation.Transactional;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;
 
import com.alibaba.fastjson.TypeReference;
import com.codingapi.tx.annotation.TxTransaction;
 
import cn.autoform.fw.exception.RestResult;
import cn.autoform.util.tool.JSONTool;
import cn.autoform.web.client.util.HttpClientTool;
import cn.autoform.web.mapper.datamanagement.DataManagementMapper;
 
@RestController
public class TestController {
 
    @Resource
    private DataManagementMapper dataManagementMapper;
    
    @PostMapping("/test")
    @TxTransaction(isStart = true)
    @Transactional
    public String test() throws TimeoutException {
        String sql = 
//                "/*!mycat:sql=select tenantid from FORMDATAMANAGER WHERE TENANTID = '13' */\n" + 
                "INSERT INTO `formdatamanager`(\n" + 
                "    `TENANTID` ,\n" + 
                "    `FORMID` ,\n" + 
                "    `FORMDATANUM` ,\n" + 
                "    `FORMDATATABLE` ,\n" + 
                "    `SUBFORMFLG` ,\n" + 
                "    `SUBFORMFIELDKEY` ,\n" + 
                "    `DATAROWNUM` ,\n" + 
                "    `DELETEFLG` ,\n" + 
                "    `CREATEUSER` ,\n" + 
                "    `CREATEDATETIME` ,\n" + 
                "    `UPDATEUSER` ,\n" + 
                "    `UPDATEDATETIME`\n" + 
                ")\n" + 
                "VALUES\n" + 
                "    (\n" + 
                "        '13' ,\n" + 
                "        'e8c6645bf3c6e54b572ae1661b742f79' ,\n" + 
                "        '0' ,\n" + 
                "        'formdata_13_552404F91C6F4F59B38900866BC54A50' ,\n" + 
                "        '0' ,\n" + 
                "        '' ,\n" + 
                "        '0' ,\n" + 
                "        '0' ,\n" + 
                "        'WangYX' ,\n" + 
                "        '2017-09-26 16:01:48' ,\n" + 
                "        'WangYX' ,\n" + 
                "        '2018-01-10 15:01:38'\n" + 
                "    );";
        System.out.println(sql);
        dataManagementMapper.excuteFormDataInsert(sql);
        HttpClientTool<Map<String, Object>> hc = new HttpClientTool("http://localhost:9119/save");
        hc.setBodyInfos(new ModelMap());
        Map<String, Object> result = hc.sendPost(
                j->JSONTool.toObj(j, new TypeReference<Map<String, Object>>(){}));
        throw new NullPointerException();
//        return "1";
    }
    
}