|
|
@@ -1,20 +1,28 @@
|
|
1
|
1
|
package com.chinaitop.depot.device.controller;
|
|
2
|
2
|
|
|
3
|
3
|
|
|
|
4
|
+import com.chinaitop.depot.device.model.BusinessImAsset;
|
|
4
|
5
|
import com.chinaitop.depot.device.model.BusinessImPurchaseSale;
|
|
5
|
6
|
import com.chinaitop.depot.device.model.param.BusinessImPurchaseSaleAddParam;
|
|
6
|
7
|
import com.chinaitop.depot.device.model.param.BusinessImPurchaseSaleEditParam;
|
|
7
|
8
|
import com.chinaitop.depot.device.model.param.BusinessImPurchaseSalePageParam;
|
|
8
|
9
|
import com.chinaitop.depot.device.service.BusinessImPurchaseSaleService;
|
|
|
10
|
+import com.fasterxml.jackson.databind.ObjectMapper;
|
|
9
|
11
|
import com.github.pagehelper.Page;
|
|
10
|
12
|
import com.github.pagehelper.PageInfo;
|
|
11
|
13
|
import io.swagger.annotations.Api;
|
|
|
14
|
+import io.swagger.annotations.ApiImplicitParam;
|
|
|
15
|
+import io.swagger.annotations.ApiImplicitParams;
|
|
12
|
16
|
import io.swagger.annotations.ApiOperation;
|
|
13
|
17
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
14
|
18
|
import org.springframework.http.ResponseEntity;
|
|
15
|
19
|
import org.springframework.validation.annotation.Validated;
|
|
16
|
20
|
import org.springframework.web.bind.annotation.*;
|
|
17
|
21
|
|
|
|
22
|
+import java.io.IOException;
|
|
|
23
|
+import java.util.HashMap;
|
|
|
24
|
+import java.util.Map;
|
|
|
25
|
+
|
|
18
|
26
|
/**
|
|
19
|
27
|
* <p>
|
|
20
|
28
|
* 智能管理-综合业务管理-采购销售管理表 前端控制器
|
|
|
@@ -38,17 +46,32 @@ public class BusinessImPurchaseSaleController {
|
|
38
|
46
|
return ResponseEntity.ok(businessImPurchaseSaleService.getList(pageParam));
|
|
39
|
47
|
}
|
|
40
|
48
|
|
|
41
|
|
- @PostMapping("/save")
|
|
42
|
|
- @ApiOperation(value = "采购销售管理-新增", notes = "新增")
|
|
43
|
|
- public ResponseEntity save(@Validated @RequestBody BusinessImPurchaseSaleAddParam param) {
|
|
44
|
|
- return ResponseEntity.ok(businessImPurchaseSaleService.saveData(param));
|
|
|
49
|
+ @PostMapping("/saveAndUpdate")
|
|
|
50
|
+ @ApiOperation(value="采购销售管理-保存/修改", notes = "保存/修改")
|
|
|
51
|
+ @ApiImplicitParams({
|
|
|
52
|
+ @ApiImplicitParam(name="businessImPurchaseSaleJson", value="表数据", paramType="form")
|
|
|
53
|
+ })
|
|
|
54
|
+ public Map<String, Object> save(String businessImPurchaseSaleJson) {
|
|
|
55
|
+ Map<String, Object> modelMap = new HashMap<>();
|
|
|
56
|
+ // JSON字符串转对象
|
|
|
57
|
+ ObjectMapper mapper = new ObjectMapper();
|
|
|
58
|
+ try {
|
|
|
59
|
+ BusinessImPurchaseSale businessImPurchaseSale = (BusinessImPurchaseSale)mapper.readValue(businessImPurchaseSaleJson, BusinessImPurchaseSale.class);
|
|
|
60
|
+ businessImPurchaseSaleService.saveOrUpdate(businessImPurchaseSale);
|
|
|
61
|
+ modelMap.put("status", "success");
|
|
|
62
|
+ } catch (IOException e) {
|
|
|
63
|
+ modelMap.put("status", "error");
|
|
|
64
|
+ modelMap.put("msg", "保存/修改失败!");
|
|
|
65
|
+ e.printStackTrace();
|
|
|
66
|
+ }
|
|
|
67
|
+ return modelMap;
|
|
45
|
68
|
}
|
|
46
|
69
|
|
|
47
|
|
- @PutMapping("/update")
|
|
|
70
|
+ /* @PutMapping("/update")
|
|
48
|
71
|
@ApiOperation(value = "采购销售管理-修改", notes = "修改")
|
|
49
|
72
|
public ResponseEntity update(@Validated @RequestBody BusinessImPurchaseSaleEditParam param) {
|
|
50
|
73
|
return ResponseEntity.ok(businessImPurchaseSaleService.updateData(param));
|
|
51
|
|
- }
|
|
|
74
|
+ }*/
|
|
52
|
75
|
|
|
53
|
76
|
@DeleteMapping("/delete/{id}")
|
|
54
|
77
|
@ApiOperation(value = "采购销售管理-删除", notes = "id删除")
|