hasan 2 lat temu
rodzic
commit
4fa179229b

+ 21 - 0
src/main/java/com/szls/nstths/controller/DataController.java

@@ -10,6 +10,10 @@ import org.springframework.web.bind.annotation.PostMapping;
10 10
 import org.springframework.web.bind.annotation.RequestBody;
11 11
 import org.springframework.web.bind.annotation.ResponseBody;
12 12
 import org.springframework.web.bind.annotation.RestController;
13
+import org.springframework.web.client.RestClientException;
14
+import org.springframework.web.client.RestTemplate;
15
+
16
+import java.util.Date;
13 17
 
14 18
 
15 19
 @RestController
@@ -30,4 +34,21 @@ public class DataController {
30 34
         int dbi = teDataMapper.insert(teData);
31 35
         return dbi+" success";
32 36
     }
37
+
38
+    /**
39
+     * 组装待打点并发送
40
+     */
41
+    public void sendTestAgain(){
42
+        String url ="http://local.wxlxit.com:61001/equipmentTestingStart";
43
+        TeData teData = new TeData();
44
+        teData.setEquipmentID("hljcbk1001");
45
+        teData.setStime(new Date());
46
+        // TODO: 2022/2/10
47
+        teData.setRotationxy("根据第一次返回底产生-第二次待打点");
48
+
49
+        RestTemplate restTemplate = new RestTemplate();
50
+        restTemplate.postForObject(url, teData, String.class);
51
+
52
+    }
53
+
33 54
 }

+ 1 - 1
src/main/java/com/szls/nstths/entity/TeData.java

@@ -13,7 +13,7 @@ import java.util.Date;
13 13
 @Data
14 14
 @TableName("te_data")
15 15
 public class TeData {
16
-    @TableId(type = IdType.NONE)
16
+    @TableId(type = IdType.AUTO, value = "id")
17 17
     private Long id;
18 18
     @TableField("equipmentID")
19 19
     private String equipmentID;

+ 1 - 1
src/main/java/com/szls/nstths/entity/User.java

@@ -8,7 +8,7 @@ import lombok.Data;
8 8
 @Data
9 9
 @TableName("sys_user")
10 10
 public class User {
11
-    @TableId(type = IdType.NONE)
11
+    @TableId(type = IdType.AUTO)
12 12
     private Long id;
13 13
     private String name;
14 14
     private String email;