|
@@ -2,15 +2,12 @@ package com.szls.nstths.controller;
|
2
|
2
|
|
3
|
3
|
import com.szls.nstths.entity.TeData;
|
4
|
4
|
import com.szls.nstths.mapper.TeDataMapper;
|
5
|
|
-import com.szls.nstths.mapper.UserMapper;
|
6
|
5
|
import org.slf4j.Logger;
|
7
|
6
|
import org.slf4j.LoggerFactory;
|
8
|
7
|
import org.springframework.beans.factory.annotation.Autowired;
|
9
|
8
|
import org.springframework.web.bind.annotation.PostMapping;
|
10
|
9
|
import org.springframework.web.bind.annotation.RequestBody;
|
11
|
|
-import org.springframework.web.bind.annotation.ResponseBody;
|
12
|
10
|
import org.springframework.web.bind.annotation.RestController;
|
13
|
|
-import org.springframework.web.client.RestClientException;
|
14
|
11
|
import org.springframework.web.client.RestTemplate;
|
15
|
12
|
|
16
|
13
|
import java.util.Date;
|
|
@@ -32,14 +29,17 @@ public class DataController {
|
32
|
29
|
public String equipmentTesting(@RequestBody TeData teData) {
|
33
|
30
|
logger.info("{}", teData);
|
34
|
31
|
int dbi = teDataMapper.insert(teData);
|
35
|
|
- return dbi+" success";
|
|
32
|
+ if (dbi < 1) {
|
|
33
|
+ return "fail";
|
|
34
|
+ }
|
|
35
|
+ return "success";
|
36
|
36
|
}
|
37
|
37
|
|
38
|
38
|
/**
|
39
|
39
|
* 组装待打点并发送
|
40
|
40
|
*/
|
41
|
|
- public void sendTestAgain(){
|
42
|
|
- String url ="http://local.wxlxit.com:61001/equipmentTestingStart";
|
|
41
|
+ public void sendTestAgain() {
|
|
42
|
+ String url = "http://local.wxlxit.com:61001/equipmentTestingStart";
|
43
|
43
|
TeData teData = new TeData();
|
44
|
44
|
teData.setEquipmentID("hljcbk1001");
|
45
|
45
|
teData.setStime(new Date());
|