Merge branch 'dev_wkx_wms_20260120' into wms_dev
This commit is contained in:
+1
-1
@@ -116,4 +116,4 @@ public class PickingOrderApi extends BaseController {
|
||||
PickingOrderDO pickingOrderDO = pickingOrderAssembler.toDO(pickingOrderDTO);
|
||||
return toAjax(pickingOrderApplicationService.completePicking(pickingOrderDO));
|
||||
}
|
||||
}
|
||||
}
|
||||
+5
-5
@@ -57,26 +57,26 @@ public class StockOutOrderApi extends BaseController {
|
||||
* 上传并解析出仓委托单Excel
|
||||
*/
|
||||
@PostMapping("/import")
|
||||
public ResponseEntity<StockOutOrderDO> parseOutboundOrder(
|
||||
public AjaxResult parseOutboundOrder(
|
||||
@RequestParam("file") MultipartFile file) {
|
||||
|
||||
// 验证文件
|
||||
if (file.isEmpty()) {
|
||||
return ResponseEntity.badRequest().body(null);
|
||||
return error("文件为空");
|
||||
}
|
||||
|
||||
// 验证文件类型
|
||||
String fileName = file.getOriginalFilename();
|
||||
if (fileName == null || !fileName.endsWith(".xls") && !fileName.endsWith(".xlsx")) {
|
||||
return ResponseEntity.status(HttpStatus.UNSUPPORTED_MEDIA_TYPE).body(null);
|
||||
return error("文件类型错误");
|
||||
}
|
||||
|
||||
try {
|
||||
// 解析Excel并返回结果
|
||||
StockOutOrderDO result = excelParseService.parseOutboundOrderExcel(file);
|
||||
return ResponseEntity.ok(result);
|
||||
return AjaxResult.success(result);
|
||||
} catch (IOException e) {
|
||||
return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body(null);
|
||||
return error("解析失败");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user