|
|
@@ -5,6 +5,7 @@ import java.util.List;
|
|
5
|
5
|
import javax.annotation.Resource;
|
|
6
|
6
|
|
|
7
|
7
|
import org.apache.commons.lang.StringUtils;
|
|
|
8
|
+import org.springframework.http.MediaType;
|
|
8
|
9
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
9
|
10
|
import org.springframework.web.bind.annotation.RequestMethod;
|
|
10
|
11
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
@@ -81,13 +82,29 @@ public class YjBjController {
|
|
81
|
82
|
return ResponseEntity.ok(pageInfo);
|
|
82
|
83
|
}
|
|
83
|
84
|
|
|
|
85
|
+ @RequestMapping(value = "queryById", produces = MediaType.APPLICATION_JSON_VALUE, method = RequestMethod.GET)
|
|
|
86
|
+ @ApiOperation(value = "根据id加载对应数据", notes = "根据id加载对应数据")
|
|
|
87
|
+ @ApiImplicitParams({
|
|
|
88
|
+ @ApiImplicitParam(name = "id", value = "主键id", paramType = "query"),
|
|
|
89
|
+ })
|
|
|
90
|
+ public ResponseEntity<StorageRotationWarningWithBLOBs> queryById(String id) {
|
|
|
91
|
+ try {
|
|
|
92
|
+ if (id == null) {
|
|
|
93
|
+ return ResponseEntity.failed("数据ID不能为空!");
|
|
|
94
|
+ }
|
|
|
95
|
+ return ResponseEntity.ok(yjbjService.queryById(id));
|
|
|
96
|
+ } catch (Exception e) {
|
|
|
97
|
+ e.printStackTrace();
|
|
|
98
|
+ return ResponseEntity.failed(e.getMessage());
|
|
|
99
|
+ }
|
|
|
100
|
+ }
|
|
|
101
|
+
|
|
84
|
102
|
@RequestMapping(value="/editLhyj", method = RequestMethod.GET)
|
|
85
|
103
|
@ApiOperation(value="预警报警数据更新", notes = "")
|
|
86
|
104
|
@ApiImplicitParams({
|
|
87
|
|
- @ApiImplicitParam(name = "lhyjJson", value = "数据对象", paramType = "query")
|
|
|
105
|
+ @ApiImplicitParam(name = "lhyjJson", value = "数据对象", paramType = "form")
|
|
88
|
106
|
})
|
|
89
|
107
|
public ResponseEntity editLhyj(String lhyjJson) {
|
|
90
|
|
- PageInfo<StorageRotationWarning> pageInfo = null;
|
|
91
|
108
|
try {
|
|
92
|
109
|
if (StringUtils.isNotBlank(lhyjJson)) {
|
|
93
|
110
|
StorageRotationWarningWithBLOBs storageRotationWarningWithBLOBs = JSONObject.parseObject(lhyjJson, StorageRotationWarningWithBLOBs.class);
|
|
|
@@ -96,12 +113,11 @@ public class YjBjController {
|
|
96
|
113
|
}
|
|
97
|
114
|
|
|
98
|
115
|
yjbjService.updateDate(storageRotationWarningWithBLOBs);
|
|
99
|
|
-
|
|
100
|
|
- return ResponseEntity.ok();
|
|
101
|
116
|
}
|
|
102
|
117
|
} catch (Exception e) {
|
|
103
|
118
|
log.error(e.getMessage(), e);
|
|
|
119
|
+ return ResponseEntity.ok(e.getMessage(), lhyjJson);
|
|
104
|
120
|
}
|
|
105
|
|
- return ResponseEntity.ok(pageInfo);
|
|
|
121
|
+ return ResponseEntity.ok();
|
|
106
|
122
|
}
|
|
107
|
123
|
}
|