|
|
@@ -1,5 +1,6 @@
|
|
1
|
1
|
package com.shinsoft.sto.controller.record;
|
|
2
|
2
|
|
|
|
3
|
+import com.alibaba.excel.EasyExcel;
|
|
3
|
4
|
import com.alibaba.fastjson.JSON;
|
|
4
|
5
|
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
|
|
5
|
6
|
import com.shinsoft.sto.model.record.ImportModel;
|
|
|
@@ -12,6 +13,8 @@ import org.springframework.web.multipart.MultipartFile;
|
|
12
|
13
|
|
|
13
|
14
|
import javax.servlet.http.HttpServletRequest;
|
|
14
|
15
|
import javax.servlet.http.HttpServletResponse;
|
|
|
16
|
+import java.io.IOException;
|
|
|
17
|
+import java.net.URLEncoder;
|
|
15
|
18
|
import java.util.ArrayList;
|
|
16
|
19
|
import java.util.HashMap;
|
|
17
|
20
|
import java.util.List;
|
|
|
@@ -28,10 +31,7 @@ public class InRecordController {
|
|
28
|
31
|
private InrecordService inrecordService;
|
|
29
|
32
|
|
|
30
|
33
|
@RequestMapping("/query")
|
|
31
|
|
- public ResultJSON query(@RequestParam(defaultValue = "1") int page,
|
|
32
|
|
- @RequestParam(defaultValue = "50") int rows,
|
|
33
|
|
- String params,
|
|
34
|
|
- HttpServletRequest request) {
|
|
|
34
|
+ public ResultJSON query(@RequestParam(defaultValue = "1") int page, @RequestParam(defaultValue = "50") int rows, String params, HttpServletRequest request) {
|
|
35
|
35
|
try {
|
|
36
|
36
|
Map<String, Object> map = buildQueryParams(params, request);
|
|
37
|
37
|
return inrecordService.query(page, rows, map);
|
|
|
@@ -99,6 +99,15 @@ public class InRecordController {
|
|
99
|
99
|
}
|
|
100
|
100
|
}
|
|
101
|
101
|
|
|
|
102
|
+ @RequestMapping("/exportInRecode")
|
|
|
103
|
+ public void exportInRecode(HttpServletResponse response,@RequestBody List<ImportModel> list) {
|
|
|
104
|
+ try {
|
|
|
105
|
+ excelExportTools.exportExcel(response, list, "入库记录", "入库记录", ImportModel.class);
|
|
|
106
|
+ } catch (Exception ex) {
|
|
|
107
|
+ ex.printStackTrace();
|
|
|
108
|
+ }
|
|
|
109
|
+ }
|
|
|
110
|
+
|
|
102
|
111
|
/**
|
|
103
|
112
|
* Excel文件上传
|
|
104
|
113
|
*/
|
|
|
@@ -124,24 +133,6 @@ public class InRecordController {
|
|
124
|
133
|
}
|
|
125
|
134
|
}
|
|
126
|
135
|
|
|
127
|
|
-
|
|
128
|
|
-
|
|
129
|
|
-
|
|
130
|
|
-// /**
|
|
131
|
|
-// * 单张入库
|
|
132
|
|
-// */
|
|
133
|
|
-// @RequestMapping("/in")
|
|
134
|
|
-// public ResultJSON in( String json, HttpServletRequest request) {
|
|
135
|
|
-// try {
|
|
136
|
|
-// String belongId = resolveBelongId(request);
|
|
137
|
|
-// String userId = resolveUserId(request);
|
|
138
|
|
-// return inrecordService.in(userId, json, belongId);
|
|
139
|
|
-// } catch (Exception ex) {
|
|
140
|
|
-// ex.printStackTrace();
|
|
141
|
|
-// return ResultJSON.error("入库失败:" + ex.getMessage());
|
|
142
|
|
-// }
|
|
143
|
|
-// }
|
|
144
|
|
-//
|
|
145
|
136
|
/**
|
|
146
|
137
|
* 批量入库
|
|
147
|
138
|
*/
|
|
|
@@ -159,5 +150,21 @@ public class InRecordController {
|
|
159
|
150
|
}
|
|
160
|
151
|
}
|
|
161
|
152
|
|
|
|
153
|
+ /**
|
|
|
154
|
+ * 取消入库
|
|
|
155
|
+ */
|
|
|
156
|
+ @PostMapping("/cancelInStore")
|
|
|
157
|
+ public ResultJSON cancelInStore(String params, HttpServletRequest request) {
|
|
|
158
|
+ try {
|
|
|
159
|
+ String userId = resolveUserId(request);
|
|
|
160
|
+ String belongId = resolveBelongId(request);
|
|
|
161
|
+ Map<String, Object> map = buildQueryParams(params, request);
|
|
|
162
|
+ return inrecordService.cancelInStore(map,userId,belongId);
|
|
|
163
|
+ } catch (Exception ex) {
|
|
|
164
|
+ ex.printStackTrace();
|
|
|
165
|
+ return ResultJSON.error("取消入库失败:" + ex.getMessage());
|
|
|
166
|
+ }
|
|
|
167
|
+ }
|
|
|
168
|
+
|
|
162
|
169
|
}
|
|
163
|
170
|
|