ShipmentU8ContainerHeaderController.java
4.68 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
package com.huaheng.pc.receipt.U8.controller;
import com.huaheng.framework.aspectj.lang.annotation.ApiLogger;
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 com.huaheng.pc.config.warehouse.domain.WorkOrderList;
import com.huaheng.pc.receipt.U8.domain.U8OutParameters;
import com.huaheng.pc.receipt.U8.domain.U8Stock;
import com.huaheng.pc.receipt.U8.domain.U8StockQuery;
import com.huaheng.pc.receipt.U8.service.IShipmentU8ContainerHeaderService;
import io.swagger.annotations.ApiOperation;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.multipart.MultipartFile;
import javax.annotation.Resource;
import java.util.List;
import java.util.Map;
/**
* u8出库单据 信息操作处理
*
* @author huaheng
* @date 2022-03-23
*/
@Controller
@RequestMapping("/shipment/shipmentU8ContainerHeader")
public class ShipmentU8ContainerHeaderController extends BaseController
{
private String prefix = "shipment/shipmentU8ContainerHeader";
@Resource
private IShipmentU8ContainerHeaderService shipmentU8ContainerHeaderService;
@RequiresPermissions("shipment:shipmentU8ContainerHeader:view")
@GetMapping()
public String shipmentU8ContainerHeader()
{
return prefix + "/shipmentU8ContainerHeader";
}
// @GetMapping("/getU8StockDataAll")
// @ResponseBody
// public AjaxResult getU8StockDataAll(String cCompanyCode, String cWHCode){
// try {
// shipmentU8ContainerHeaderService.queryStockcDataAll(cCompanyCode, cWHCode);
// } catch (Exception e) {
// e.printStackTrace();
// return AjaxResult.error(e.getMessage());
// }
// return null;
// }
/**
* 获取库存详情
* @param u8StockQuery
* @return
*/
@ApiOperation("获取U8库存详情")
@Log(title = "获取U8库存详情", action = BusinessType.OTHER)
@PostMapping("/getU8StockData")
@ResponseBody
@ApiLogger(apiName = "获取U8库存详情", from = "U8")
public AjaxResult getU8StockData(U8StockQuery u8StockQuery){
AjaxResult ajaxResult = AjaxResult.success();
List<U8Stock> list;
try {
list = shipmentU8ContainerHeaderService.getStockcData(u8StockQuery);
} catch (Exception e) {
return AjaxResult.error(e.getMessage());
}
ajaxResult.setData(list);
return ajaxResult;
}
/**
* 获取库存详情
* @param json json数据
* @return
*/
@ApiOperation("批量获取U8库存详情")
@Log(title = "获取U8库存详情", action = BusinessType.OTHER)
@PostMapping("/getU8StockDataAll")
@ResponseBody
public AjaxResult getU8StockDataAll(String json){
AjaxResult ajaxResult = AjaxResult.success();
List<U8Stock> list;
try {
list = shipmentU8ContainerHeaderService.getStockcDataAll(json);
ajaxResult.setData(list);
} catch (Exception e) {
return AjaxResult.error(e.getMessage());
}
return ajaxResult;
}
@ApiOperation("U8出库接口")
@Log(title = "U8出库接口", action = BusinessType.OTHER)
@GetMapping("/workOrderOut")
@ResponseBody
@ApiLogger(apiName = "U8出库接口", from = "U8")
public AjaxResult workOrderOut(String u8OutParameters){
AjaxResult result;
try {
U8OutParameters outParameters = shipmentU8ContainerHeaderService.dataConversion(u8OutParameters);
result = shipmentU8ContainerHeaderService.outStock(outParameters);
} catch (Exception e) {
return AjaxResult.error(e.getMessage());
}
return result;
}
// @PostMapping("/importData")
// @ResponseBody
// public AjaxResult importData(MultipartFile file) throws Exception {
// List<Map<String, Object>> mapList = ExecelUtils.leading(file);
// Boolean flag = true;
// flag = shipmentU8ContainerHeaderService.importData(mapList,false);
// if (flag == true) {
// return AjaxResult.success("导入成功");
// } else {
// return AjaxResult.success("导入失败,数据格式不对");
// }
// }
//
// /**
// * 导出模板
// * @return
// * @throws Exception
// */
// @GetMapping("/importTemplate")
// @ResponseBody
// public AjaxResult importTemplate() {
// ExcelUtilses<WorkOrderList>
// util = new ExcelUtilses<>(WorkOrderList.class);
// return util.importTemplateExcel("外协");
// }
}