|
@@ -15,6 +15,7 @@ import org.springframework.http.MediaType;
|
|
15
|
import org.springframework.web.bind.annotation.RequestBody;
|
15
|
import org.springframework.web.bind.annotation.RequestBody;
|
|
16
|
import org.springframework.web.bind.annotation.RequestMapping;
|
16
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
17
|
import org.springframework.web.bind.annotation.RequestMethod;
|
17
|
import org.springframework.web.bind.annotation.RequestMethod;
|
|
|
|
18
|
+import org.springframework.web.bind.annotation.RequestParam;
|
|
18
|
import org.springframework.web.bind.annotation.RestController;
|
19
|
import org.springframework.web.bind.annotation.RestController;
|
|
19
|
|
20
|
|
|
20
|
import javax.annotation.Resource;
|
21
|
import javax.annotation.Resource;
|
|
@@ -96,14 +97,11 @@ public class DFacilitiesController {
|
|
96
|
|
97
|
|
|
97
|
@RequestMapping(value = "/basics/remove", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE)
|
98
|
@RequestMapping(value = "/basics/remove", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE)
|
|
98
|
@ApiOperation(value = "根据id删除设施基础信息", notes = "根据id删除设施基础信息")
|
99
|
@ApiOperation(value = "根据id删除设施基础信息", notes = "根据id删除设施基础信息")
|
|
99
|
- @ApiImplicitParams({
|
|
|
|
100
|
- @ApiImplicitParam(name = "id", value = "主键id", paramType = "query")
|
|
|
|
101
|
- })
|
|
|
|
102
|
- public Map<String, Object> remove(Integer id) {
|
|
|
|
|
|
100
|
+ public Map<String, Object> remove(@RequestBody DFacilitiesBasics dFacilitiesBasics) {
|
|
103
|
Map<String, Object> modelMap = new HashMap<>();
|
101
|
Map<String, Object> modelMap = new HashMap<>();
|
|
104
|
try {
|
102
|
try {
|
|
105
|
- if (id != null) {
|
|
|
|
106
|
- dFacilitiesBasicsService.remove(id);
|
|
|
|
|
|
103
|
+ if (dFacilitiesBasics.getId() != null) {
|
|
|
|
104
|
+ dFacilitiesBasicsService.remove(dFacilitiesBasics.getId());
|
|
107
|
modelMap.put("status", "success");
|
105
|
modelMap.put("status", "success");
|
|
108
|
} else {
|
106
|
} else {
|
|
109
|
modelMap.put("status", "error");
|
107
|
modelMap.put("status", "error");
|
|
@@ -199,16 +197,13 @@ public class DFacilitiesController {
|
|
199
|
|
197
|
|
|
200
|
@RequestMapping(value = "/maintain/save", produces = MediaType.APPLICATION_JSON_VALUE, method = RequestMethod.POST)
|
198
|
@RequestMapping(value = "/maintain/save", produces = MediaType.APPLICATION_JSON_VALUE, method = RequestMethod.POST)
|
|
201
|
@ApiOperation(value = "保存/编辑设施保养信息", notes = "设施保养信息")
|
199
|
@ApiOperation(value = "保存/编辑设施保养信息", notes = "设施保养信息")
|
|
202
|
- @ApiImplicitParams({
|
|
|
|
203
|
- @ApiImplicitParam(name = "dFacilitiesMaintainJson", value = "设施保养信息", paramType = "query")
|
|
|
|
204
|
- })
|
|
|
|
205
|
- public Map<String, Object> saveMaintain(String dFacilitiesMaintainJson) {
|
|
|
|
|
|
200
|
+ public Map<String, Object> saveMaintain(@RequestBody DFacilitiesMaintain dFacilitiesMaintain) {
|
|
206
|
Map<String, Object> modelMap = new HashMap<>();
|
201
|
Map<String, Object> modelMap = new HashMap<>();
|
|
207
|
// JSON字符串转对象
|
202
|
// JSON字符串转对象
|
|
208
|
ObjectMapper mapper = new ObjectMapper();
|
203
|
ObjectMapper mapper = new ObjectMapper();
|
|
209
|
try {
|
204
|
try {
|
|
210
|
- DFacilitiesMaintain dFacilitiesMaintain = mapper.readValue(dFacilitiesMaintainJson, DFacilitiesMaintain.class);
|
|
|
|
211
|
- if (dFacilitiesMaintain.getId()==null) {
|
|
|
|
|
|
205
|
+/* DFacilitiesMaintain dFacilitiesMaintain = mapper.readValue(dFacilitiesMaintainJson, DFacilitiesMaintain.class);
|
|
|
|
206
|
+*/ if (dFacilitiesMaintain.getId()==null) {
|
|
212
|
dFacilitiesMaintain.setCreateTime(new Date()); // 创建时间
|
207
|
dFacilitiesMaintain.setCreateTime(new Date()); // 创建时间
|
|
213
|
dFacilitiesMaintainService.save(dFacilitiesMaintain); // 新增
|
208
|
dFacilitiesMaintainService.save(dFacilitiesMaintain); // 新增
|
|
214
|
} else {
|
209
|
} else {
|