|
|
@@ -1,5 +1,6 @@
|
|
1
|
1
|
package com.chinaitop.depot.grainSituationCard.controller;
|
|
2
|
2
|
|
|
|
3
|
+import com.chinaitop.depot.common.ResponseEntity;
|
|
3
|
4
|
import com.chinaitop.depot.grainSituationCard.model.StorageSealedConfirmation;
|
|
4
|
5
|
import com.chinaitop.depot.grainSituationCard.service.StorageSealedConfirmationService;
|
|
5
|
6
|
import com.chinaitop.depot.param.StorageSealedConfirmationPageParam;
|
|
|
@@ -10,12 +11,8 @@ import io.swagger.annotations.ApiImplicitParam;
|
|
10
|
11
|
import io.swagger.annotations.ApiOperation;
|
|
11
|
12
|
import lombok.extern.slf4j.Slf4j;
|
|
12
|
13
|
import org.springframework.http.MediaType;
|
|
13
|
|
-import org.springframework.http.ResponseEntity;
|
|
14
|
|
-import org.springframework.util.ObjectUtils;
|
|
15
|
|
-import org.springframework.web.bind.annotation.PathVariable;
|
|
16
|
|
-import org.springframework.web.bind.annotation.RequestMapping;
|
|
17
|
|
-import org.springframework.web.bind.annotation.RequestMethod;
|
|
18
|
|
-import org.springframework.web.bind.annotation.RestController;
|
|
|
14
|
+import org.springframework.validation.annotation.Validated;
|
|
|
15
|
+import org.springframework.web.bind.annotation.*;
|
|
19
|
16
|
|
|
20
|
17
|
import javax.annotation.Resource;
|
|
21
|
18
|
import java.util.List;
|
|
|
@@ -36,7 +33,7 @@ public class StorageSealedConfirmationController {
|
|
36
|
33
|
@RequestMapping(value = "/getPageList", produces = MediaType.APPLICATION_JSON_VALUE, method = RequestMethod.GET)
|
|
37
|
34
|
@ApiOperation(value = "根据仓房号和货位号查询", notes = "查询粮情卡列表,支持分页")
|
|
38
|
35
|
@ApiImplicitParam(name = "param", value = "查询条件", paramType = "body")
|
|
39
|
|
- public ResponseEntity getPageList(StorageSealedConfirmationPageParam param) {
|
|
|
36
|
+ public ResponseEntity getPageList(@RequestBody @Validated StorageSealedConfirmationPageParam param) {
|
|
40
|
37
|
PageHelper.startPage(param.getPageNum(), param.getPageSize());
|
|
41
|
38
|
List<StorageSealedConfirmation> list = confirmationService.getPageList(param);
|
|
42
|
39
|
return ResponseEntity.ok(new PageInfo<>(list));
|
|
|
@@ -45,15 +42,25 @@ public class StorageSealedConfirmationController {
|
|
45
|
42
|
@RequestMapping(value = "/saveData", produces = MediaType.APPLICATION_JSON_VALUE, method = RequestMethod.POST)
|
|
46
|
43
|
@ApiOperation(value = "新增", notes = "新增保存")
|
|
47
|
44
|
@ApiImplicitParam(name = "data", value = "json对象", paramType = "body")
|
|
48
|
|
- public ResponseEntity saveData(StorageSealedConfirmation data) {
|
|
49
|
|
- return ResponseEntity.ok(confirmationService.saveData(data));
|
|
|
45
|
+ public ResponseEntity saveData(@RequestBody StorageSealedConfirmation data) {
|
|
|
46
|
+ try {
|
|
|
47
|
+ return ResponseEntity.ok(confirmationService.saveData(data));
|
|
|
48
|
+ } catch (Exception e) {
|
|
|
49
|
+ e.printStackTrace();
|
|
|
50
|
+ return ResponseEntity.failed("保存失败");
|
|
|
51
|
+ }
|
|
50
|
52
|
}
|
|
51
|
53
|
|
|
52
|
54
|
@RequestMapping(value = "/updateData", produces = MediaType.APPLICATION_JSON_VALUE, method = RequestMethod.POST)
|
|
53
|
55
|
@ApiOperation(value = "新增", notes = "新增保存")
|
|
54
|
56
|
@ApiImplicitParam(name = "data", value = "json对象", paramType = "body")
|
|
55
|
|
- public ResponseEntity updateData(StorageSealedConfirmation data) {
|
|
56
|
|
- return ResponseEntity.ok(confirmationService.updateData(data));
|
|
|
57
|
+ public ResponseEntity updateData(@RequestBody StorageSealedConfirmation data) {
|
|
|
58
|
+ try {
|
|
|
59
|
+ return ResponseEntity.ok(confirmationService.updateData(data));
|
|
|
60
|
+ } catch (Exception e) {
|
|
|
61
|
+ e.printStackTrace();
|
|
|
62
|
+ return ResponseEntity.failed("修改失败");
|
|
|
63
|
+ }
|
|
57
|
64
|
}
|
|
58
|
65
|
|
|
59
|
66
|
@RequestMapping(value = "/getDataById/{id}", produces = MediaType.APPLICATION_JSON_VALUE, method = RequestMethod.GET)
|
|
|
@@ -68,6 +75,7 @@ public class StorageSealedConfirmationController {
|
|
68
|
75
|
|
|
69
|
76
|
/**
|
|
70
|
77
|
* 查询入库中仓房/油罐
|
|
|
78
|
+ *
|
|
71
|
79
|
* @param orgId 必填
|
|
72
|
80
|
* @return map list
|
|
73
|
81
|
*/
|
|
|
@@ -78,10 +86,11 @@ public class StorageSealedConfirmationController {
|
|
78
|
86
|
|
|
79
|
87
|
/**
|
|
80
|
88
|
* 效验粮食性质
|
|
81
|
|
- * 储备粮
|
|
|
89
|
+ * 储备粮
|
|
82
|
90
|
* 6864,6865,6877,6878,6879,6866
|
|
83
|
|
- * @param orgId 必传
|
|
84
|
|
- * @param houseId 必传
|
|
|
91
|
+ *
|
|
|
92
|
+ * @param orgId 必传
|
|
|
93
|
+ * @param houseId 必传
|
|
85
|
94
|
* @param warehouseId 必传
|
|
86
|
95
|
* @return 储备信息为空表示非储备粮
|
|
87
|
96
|
*/
|