ICSShipmentApi.java
7.03 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
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
package com.huaheng.api.U8.controller;
import com.huaheng.api.U8.Service.ICSShipmentAPIService;
import com.huaheng.api.U8.domain.ICSShipmentDetail;
import com.huaheng.api.U8.domain.ICSShipmentHeader;
import com.huaheng.api.U8.domain.ICSShipmentModel;
import com.huaheng.framework.aspectj.lang.annotation.Log;
import com.huaheng.framework.aspectj.lang.constant.BusinessType;
import com.huaheng.framework.web.controller.BaseController;
import com.huaheng.framework.web.domain.AjaxResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.junit.platform.commons.logging.Logger;
import org.junit.platform.commons.logging.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* u8-wms出库下发或回传接口
*
*
*/
@RestController
@RequestMapping("/api/icsShipment")
@Api(tags = {"icsShipment"}, description = "ICS出库下发或回传接口")
public class ICSShipmentApi extends BaseController {
private static final Logger logger = LoggerFactory.getLogger(ICSShipmentApi.class);
@Autowired
private ICSShipmentAPIService icsShipmentService;
//出库下发
@Log(title = "采购退货单出库下发", action = BusinessType.INSERT)
@PostMapping("/GetICSPU_ArrivalVouch_Return")
@ApiOperation("ICS采购退货单出库下发接口")
@ResponseBody
public AjaxResult GetICSPU_ArrivalVouch_Return(@RequestBody ICSShipmentModel icsShipmentModel){
ICSShipmentHeader icsShipmentHeader=icsShipmentModel.getIcsShipmentHeader();
List<ICSShipmentDetail> icsShipmentDetails=icsShipmentModel.getIcsShipmentDetails();
if(icsShipmentHeader==null ){
return AjaxResult.error("缺少主单据");
}
if(icsShipmentDetails==null){
return AjaxResult.error("缺少子单据");
}
icsShipmentHeader.setType("PRO");
AjaxResult ajaxResult = icsShipmentService.insertICSShipments(icsShipmentModel);
return ajaxResult;
}
@Log(title = "领料申请单出库下发", action = BusinessType.INSERT)
@PostMapping("/GetICSMaterialAppVouch")
@ApiOperation("ICS领料申请单出库下发接口")
@ResponseBody
public AjaxResult GetICSMaterialAppVouch(@RequestBody ICSShipmentModel icsShipmentModel){
ICSShipmentHeader icsShipmentHeader=icsShipmentModel.getIcsShipmentHeader();
List<ICSShipmentDetail> icsShipmentDetails=icsShipmentModel.getIcsShipmentDetails();
if(icsShipmentHeader==null ){
return AjaxResult.error("缺少主单据");
}
if(icsShipmentDetails==null){
return AjaxResult.error("缺少子单据");
}
icsShipmentHeader.setType("PKO");
AjaxResult ajaxResult = icsShipmentService.insertICSShipment(icsShipmentModel);
return ajaxResult;
}
@Log(title = "材料出库单出库下发", action = BusinessType.INSERT)
@PostMapping("/GetICSRdRecord_11")
@ApiOperation("ICS材料出库单出库下发接口")
@ResponseBody
public AjaxResult GetICSRdRecord_11(@RequestBody ICSShipmentModel icsShipmentModel){
ICSShipmentHeader icsShipmentHeader=icsShipmentModel.getIcsShipmentHeader();
List<ICSShipmentDetail> icsShipmentDetails=icsShipmentModel.getIcsShipmentDetails();
if(icsShipmentHeader==null ){
return AjaxResult.error("缺少主单据");
}
if(icsShipmentDetails==null){
return AjaxResult.error("缺少子单据");
}
icsShipmentHeader.setType("MO");
AjaxResult ajaxResult = icsShipmentService.insertICSShipment(icsShipmentModel);
return ajaxResult;
}
@Log(title = "生产订单出库下发", action = BusinessType.INSERT)
@PostMapping("/GetICSmom_order")
@ApiOperation("ICS生产订单出库下发接口")
@ResponseBody
public AjaxResult GetICSmom_order(@RequestBody ICSShipmentModel icsShipmentModel){
ICSShipmentHeader icsShipmentHeader=icsShipmentModel.getIcsShipmentHeader();
List<ICSShipmentDetail> icsShipmentDetails=icsShipmentModel.getIcsShipmentDetails();
if(icsShipmentHeader==null ){
return AjaxResult.error("缺少主单据");
}
if(icsShipmentDetails==null){
return AjaxResult.error("缺少子单据");
}
icsShipmentHeader.setType("OO");
AjaxResult ajaxResult = icsShipmentService.insertICSShipment(icsShipmentModel);
return ajaxResult;
}
@Log(title = "销售发货单出库下发", action = BusinessType.INSERT)
@PostMapping("/GetICSDispatchList")
@ApiOperation("ICS销售发货单出库下发接口")
@ResponseBody
public AjaxResult GetICSDispatchList(@RequestBody ICSShipmentModel icsShipmentModel){
ICSShipmentHeader icsShipmentHeader=icsShipmentModel.getIcsShipmentHeader();
List<ICSShipmentDetail> icsShipmentDetails=icsShipmentModel.getIcsShipmentDetails();
if(icsShipmentHeader==null ){
return AjaxResult.error("缺少主单据");
}
if(icsShipmentDetails==null){
return AjaxResult.error("缺少子单据");
}
icsShipmentHeader.setType("SO");
AjaxResult ajaxResult = icsShipmentService.insertICSShipments(icsShipmentModel);
return ajaxResult;
}
@Log(title = "调拨单出库下发", action = BusinessType.INSERT)
@PostMapping("/TransVouch")
@ApiOperation("ICS调拨单出库下发接口")
@ResponseBody
public AjaxResult TransVouch(@RequestBody ICSShipmentModel icsShipmentModel){
ICSShipmentHeader icsShipmentHeader=icsShipmentModel.getIcsShipmentHeader();
List<ICSShipmentDetail> icsShipmentDetails=icsShipmentModel.getIcsShipmentDetails();
if(icsShipmentHeader==null ){
return AjaxResult.error("缺少主单据");
}
if(icsShipmentDetails==null){
return AjaxResult.error("缺少子单据");
}
icsShipmentHeader.setType("TO");
AjaxResult ajaxResult = icsShipmentService.insertICSShipment(icsShipmentModel);
return ajaxResult;
}
@Log(title = "其他出库单出库下发", action = BusinessType.INSERT)
@PostMapping("/GetICSRdRecord_09")
@ApiOperation("ICS其他出库单出库下发接口")
@ResponseBody
public AjaxResult GetICSRdRecord_09(@RequestBody ICSShipmentModel icsShipmentModel){
if(icsShipmentModel==null){
return AjaxResult.error("没有接收到数据");
}
ICSShipmentHeader icsShipmentHeader=icsShipmentModel.getIcsShipmentHeader();
icsShipmentHeader.setType("QO");
AjaxResult ajaxResult = icsShipmentService.insertICSShipment(icsShipmentModel);
return ajaxResult;
}
// @Log(title = "出库回传", action = BusinessType.GRANT)
// @PostMapping("/ConfirmICSShipment")
// @ApiOperation("ICS出库回传接口")
// @ResponseBody
// public AjaxResult ConfirmICSShipment(String url){
// AjaxResult ajaxResult = icsShipmentService.ConfirmICSShipment(url);
// return ajaxResult;
// }
}