ErpController.java
4.85 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
package com.huaheng.api.erp.controller;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import com.alibaba.fastjson.JSON;
import com.huaheng.api.acs.domain.AcsStatus;
import com.huaheng.api.erp.domain.*;
import com.huaheng.api.erp.service.IErpService;
import com.huaheng.common.constant.QuantityConstant;
import com.huaheng.common.utils.http.OkHttpUtils;
import com.huaheng.framework.aspectj.lang.annotation.ApiLogger;
import com.huaheng.framework.web.controller.BaseController;
import com.huaheng.framework.web.domain.AjaxResult;
import com.huaheng.framework.web.domain.ResultErp;
import org.springframework.web.bind.annotation.*;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
/**
* @author 游杰
*/
@RestController
@RequestMapping("/api/erp")
@Api(tags = "ERP接口")
public class ErpController extends BaseController{
@Resource
private IErpService erpService;
@PostMapping("/receipt")
@ResponseBody
@ApiOperation("入库单下发")
@ApiLogger(apiName = "入库单下发", from = "ERP")
public ResultErp receipt(@RequestBody ErpReceipt erpReceipt) {
ResultErp ajaxResult = handleMultiProcessErp("receipt", new BaseController.MultiProcessListenerErp() {
@Override
public ResultErp doProcess() {
ResultErp ajaxResult = erpService.receipt(erpReceipt);
return ajaxResult;
}
});
return ajaxResult;
}
@PostMapping("/receiptCancel")
@ResponseBody
@ApiOperation("取消入库单")
@ApiLogger(apiName = "取消入库单", from = "ERP")
public ResultErp cancelReceipt(@RequestBody ErpCancel erpCancel) {
String referCode = erpCancel.getReferCode();
String warehouseCode = erpCancel.getWarehouseCode();
ResultErp ajaxResult = handleMultiProcessErp("cancelReceipt", new BaseController.MultiProcessListenerErp() {
@Override
public ResultErp doProcess() {
ResultErp ajaxResult = erpService.cancelReceipt(referCode, warehouseCode);
return ajaxResult;
}
});
return ajaxResult;
}
@PostMapping("/shipment")
@ResponseBody
@ApiOperation("出库单下发")
@ApiLogger(apiName = "出库单下发", from = "ERP")
public ResultErp shipment(@RequestBody ErpShipment erpShipment) {
ResultErp ajaxResult = handleMultiProcessErp("shipment", new BaseController.MultiProcessListenerErp() {
@Override
public ResultErp doProcess() {
return erpService.shipment(erpShipment);
}
});
return ajaxResult;
}
@PostMapping("/shipmentCancel")
@ResponseBody
@ApiOperation("取消出库单")
@ApiLogger(apiName = "取消出库单", from = "ERP")
public ResultErp cancelShipment(@RequestBody ErpCancel erpCancel) {
String referCode = erpCancel.getReferCode();
String warehouseCode = erpCancel.getWarehouseCode();
ResultErp ajaxResult = handleMultiProcessErp("cancelShipment", new BaseController.MultiProcessListenerErp() {
@Override
public ResultErp doProcess() {
return erpService.cancelShipment(referCode, warehouseCode);
}
});
return ajaxResult;
}
@PostMapping("/transferInventory")
@ResponseBody
@ApiOperation("调拨单下发")
@ApiLogger(apiName = "调拨单下发", from = "ERP")
public ResultErp transferInventory(@RequestBody ErpTransfer erpTransfer) {
ResultErp ajaxResult = handleMultiProcessErp("transferInventory", new BaseController.MultiProcessListenerErp() {
@Override
public ResultErp doProcess() {
return erpService.transfer(erpTransfer);
}
});
return ajaxResult;
}
@PostMapping("/transferInventoryCancel")
@ResponseBody
@ApiOperation("取消调拨单下发")
@ApiLogger(apiName = "取消调拨单下发", from = "ERP")
public ResultErp cancelTransferInventory(@RequestBody ErpCancel erpCancel) {
String referCode = erpCancel.getReferCode();
String warehouseCode = erpCancel.getWarehouseCode();
ResultErp ajaxResult = handleMultiProcessErp("cancelTransferInventory", new BaseController.MultiProcessListenerErp() {
@Override
public ResultErp doProcess() {
return erpService.cancelTransfer(referCode, warehouseCode);
}
});
return ajaxResult;
}
@PostMapping("/searchInventory")
@ResponseBody
@ApiOperation("查询库存")
@ApiLogger(apiName = "查询库存", from = "ERP")
public ResultErp searchInventory(@RequestBody InventoryQueryParam inventoryQueryParam, HttpServletRequest req) {
ResultErp result = erpService.searchInventory(inventoryQueryParam);
return result;
}
}