|
@@ -4,8 +4,6 @@ import com.chinaitop.depot.device.model.*;
|
4
|
4
|
import com.chinaitop.depot.device.service.DFacilitiesBasicsService;
|
5
|
5
|
import com.chinaitop.depot.device.service.DFacilitiesMaintainService;
|
6
|
6
|
import com.chinaitop.depot.device.service.DFacilitiesRepairService;
|
7
|
|
-import com.chinaitop.depot.device.service.DSblxxjyService;
|
8
|
|
-import com.chinaitop.depot.utils.GeneratingEncodUtils;
|
9
|
7
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
10
|
8
|
import com.github.pagehelper.PageHelper;
|
11
|
9
|
import com.github.pagehelper.PageInfo;
|
|
@@ -13,7 +11,6 @@ import io.swagger.annotations.Api;
|
13
|
11
|
import io.swagger.annotations.ApiImplicitParam;
|
14
|
12
|
import io.swagger.annotations.ApiImplicitParams;
|
15
|
13
|
import io.swagger.annotations.ApiOperation;
|
16
|
|
-import org.apache.commons.lang.StringUtils;
|
17
|
14
|
import org.springframework.http.MediaType;
|
18
|
15
|
import org.springframework.web.bind.annotation.RequestBody;
|
19
|
16
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
@@ -25,7 +22,6 @@ import java.util.Date;
|
25
|
22
|
import java.util.HashMap;
|
26
|
23
|
import java.util.List;
|
27
|
24
|
import java.util.Map;
|
28
|
|
-import java.util.stream.Collectors;
|
29
|
25
|
|
30
|
26
|
/**
|
31
|
27
|
* @author yu.ren
|
|
@@ -77,17 +73,13 @@ public class DFacilitiesController {
|
77
|
73
|
return pageInfo;
|
78
|
74
|
}
|
79
|
75
|
|
80
|
|
- @RequestMapping(value = "/basics/save", produces = MediaType.APPLICATION_JSON_VALUE, method = RequestMethod.POST)
|
|
76
|
+
|
|
77
|
+ @RequestMapping(value="/basics/save", produces = MediaType.APPLICATION_JSON_VALUE, method=RequestMethod.POST)
|
81
|
78
|
@ApiOperation(value = "保存/编辑设施基础信息", notes = "设施基础信息")
|
82
|
|
- @ApiImplicitParams({
|
83
|
|
- @ApiImplicitParam(name = "dFacilitiesBasicsJson", value = "设施基础信息数据", paramType = "form")
|
84
|
|
- })
|
85
|
|
- public Map<String, Object> saveBasics(@RequestBody String dFacilitiesBasicsJson) {
|
|
79
|
+
|
|
80
|
+ public Map<String, Object> saveBasics(@RequestBody DFacilitiesBasics dFacilitiesBasics) {
|
86
|
81
|
Map<String, Object> modelMap = new HashMap<>();
|
87
|
|
- // JSON字符串转对象
|
88
|
|
- ObjectMapper mapper = new ObjectMapper();
|
89
|
82
|
try {
|
90
|
|
- DFacilitiesBasics dFacilitiesBasics = mapper.readValue(dFacilitiesBasicsJson, DFacilitiesBasics.class);
|
91
|
83
|
if (dFacilitiesBasics.getId()==null) {
|
92
|
84
|
dFacilitiesBasics.setCreateTime(new Date()); // 创建时间
|
93
|
85
|
dFacilitiesBasicsService.save(dFacilitiesBasics); // 新增
|
|
@@ -208,7 +200,7 @@ public class DFacilitiesController {
|
208
|
200
|
@RequestMapping(value = "/maintain/save", produces = MediaType.APPLICATION_JSON_VALUE, method = RequestMethod.POST)
|
209
|
201
|
@ApiOperation(value = "保存/编辑设施保养信息", notes = "设施保养信息")
|
210
|
202
|
@ApiImplicitParams({
|
211
|
|
- @ApiImplicitParam(name = "dFacilitiesMaintainJson", value = "设施保养信息", paramType = "form")
|
|
203
|
+ @ApiImplicitParam(name = "dFacilitiesMaintainJson", value = "设施保养信息", paramType = "query")
|
212
|
204
|
})
|
213
|
205
|
public Map<String, Object> saveMaintain(String dFacilitiesMaintainJson) {
|
214
|
206
|
Map<String, Object> modelMap = new HashMap<>();
|