|
1
2
3
4
5
|
package com.huaheng.api.general.controller;
import com.huaheng.api.general.domain.ReceiptDomain;
import com.huaheng.api.general.service.ReceiptApiService;
|
|
6
|
import com.huaheng.api.general.service.ReceiptContainerApiService;
|
|
7
|
import com.huaheng.framework.aspectj.lang.annotation.ApiLogger;
|
|
8
9
|
import com.huaheng.framework.aspectj.lang.annotation.Log;
import com.huaheng.framework.aspectj.lang.constant.BusinessType;
|
|
10
|
import com.huaheng.framework.web.controller.BaseController;
|
|
11
12
13
14
15
16
|
import com.huaheng.framework.web.domain.AjaxResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
|
|
17
|
import java.util.List;
|
|
18
19
20
|
@RestController
@RequestMapping("/api/receiptApi")
|
|
21
|
@Api(tags = {"入库单接口"}, value = "入库单接口receipt")
|
|
22
|
public class ReceiptApiController extends BaseController{
|
|
23
24
25
|
@Resource
private ReceiptApiService receiptApiService;
|
|
26
|
@Resource
|
|
27
|
private ReceiptContainerApiService receiptContainerApiService;
|
|
28
29
30
31
32
33
34
35
|
/**
* 同步入库单
*/
@Log(title = "入库单添加", action = BusinessType.INSERT)
@PostMapping("/receipt")
@ApiOperation("入库单添加公共接口")
@ResponseBody
|
|
36
|
@ApiLogger(apiName = "添加入库单", from="ERP")
|
|
37
|
public AjaxResult receipt(@RequestBody ReceiptDomain receiptDomain)
|
|
38
|
{
|
|
39
40
41
42
43
44
45
|
AjaxResult ajaxResult = handleMultiProcess(new BaseController.MultiProcessListener() {
@Override
public AjaxResult doProcess() {
AjaxResult ajaxResult = receiptApiService.receipt(receiptDomain);
return ajaxResult;
}
});
|
|
46
47
48
|
return ajaxResult;
}
|
|
49
50
51
52
53
54
55
56
57
58
|
/**
* 入库组盘
*/
@Log(title = "入库单组盘", action = BusinessType.INSERT)
@PostMapping("/receiptContainer")
@ApiOperation("添加入库组盘公共接口")
@ResponseBody
@ApiLogger(apiName = "添加入库组盘", from="ERP")
public AjaxResult receiptContainer(@RequestBody ReceiptDomain receiptDomain)
{
|
|
59
60
61
62
63
64
65
66
|
AjaxResult ajaxResult = handleMultiProcess(new BaseController.MultiProcessListener() {
@Override
public AjaxResult doProcess() {
AjaxResult ajaxResult = receiptContainerApiService.saveReceiptContainer(receiptDomain);
return ajaxResult;
}
});
return ajaxResult;
|
|
67
68
|
}
|
|
69
|
|
|
70
71
72
73
74
75
76
77
78
79
80
81
82
83
|
// /**
// * 入库单下发
// */
// @Log(title = "入库单下发", action = BusinessType.INSERT)
// @PostMapping("/insertReceipt")
// @ApiOperation("入库单下发接口")
// @ResponseBody
// @ApiLogger(apiName = "下发入库单", from="ERP")
// public AjaxResult MaterialApi(@RequestBody Receipt receipt) {
// System.out.println("————————开始接收入库单——————————");
// System.out.println(receipt);
// AjaxResult ajaxResult = receiptService.insertReceipt(receipt);
// return ajaxResult;
// }
|
|
84
85
|
/**
|
|
86
87
88
89
90
|
* 取消入库单
*/
@Log(title = "入库-入库单 ",operating = "入库单删除", action = BusinessType.UPDATE)
@PostMapping("/remove")
@ResponseBody
|
|
91
|
@ApiLogger(apiName = "取消入库单", from="ERP")
|
|
92
|
public AjaxResult remove(@RequestBody List<String> receiptCodeList){
|
|
93
|
if (receiptCodeList==null && receiptCodeList.size()<1){
|
|
94
|
return AjaxResult.error("单号列表为空");
|
|
95
|
}
|
|
96
|
return receiptApiService.remove(receiptCodeList);
|
|
97
98
|
}
|
|
99
100
101
102
103
104
|
/**
* 入库单查询
*/
@Log(title = "入库-入库单 ",operating = "入库单删除", action = BusinessType.UPDATE)
@GetMapping("/search")
@ResponseBody
|
|
105
|
@ApiLogger(apiName = "查询入库单", from="ERP")
|
|
106
107
108
109
110
|
public AjaxResult search(@RequestParam String receiptCode,
@RequestParam String companyCode,
@RequestParam String warehouseCode){
return receiptApiService.search(receiptCode,companyCode,warehouseCode);
}
|
|
111
|
|
|
112
|
}
|