维他奶出入库业务单修改;
This commit is contained in:
+33
-5
@@ -9,6 +9,7 @@ import com.mhd.oms.domain.reservationStockInOrder.repository.po.ReservationStock
|
||||
import com.mhd.oms.domain.reservationStockInOrder.repository.todo.ReservationStockInOrderDO;
|
||||
import com.mhd.oms.domain.reservationStockInOrder.repository.todo.ReservationStockInOrderDTO;
|
||||
import com.mhd.oms.domain.reservationStockInOrder.repository.vo.DeliveryDataDTO;
|
||||
import com.mhd.oms.domain.reservationStockInOrder.repository.vo.StockInDataDTO;
|
||||
import com.mhd.oms.domain.reservationStockInOrder.service.ReservationStockInOrderApplicationService;
|
||||
import com.mhd.oms.domain.reservationStockInOrder.service.ReservationStockInOrderAssembler;
|
||||
import com.mhd.system.api.domain.InMaterialDetail;
|
||||
@@ -197,12 +198,14 @@ public class ReservationStockInOrderApi extends BaseController {
|
||||
* @return 解析后的出库数据
|
||||
*/
|
||||
@PostMapping("/parseExcel")
|
||||
public ResponseEntity<DeliveryDataDTO> parseExcel(
|
||||
@RequestParam("file") MultipartFile file,
|
||||
@RequestParam("sheetName") String sheetName) {
|
||||
public ResponseEntity<Map<String, Object>> parseExcel(
|
||||
@RequestParam("file") MultipartFile file) {
|
||||
try {
|
||||
DeliveryDataDTO deliveryDataDTO = reservationStockInOrderService.parseExcelFile(file, sheetName);
|
||||
return new ResponseEntity<>(deliveryDataDTO, HttpStatus.OK);
|
||||
DeliveryDataDTO deliveryDataDTO = reservationStockInOrderService.parseExcelFile(file, "");
|
||||
Map<String, Object> result = new HashMap<>();
|
||||
result.put("result", deliveryDataDTO);
|
||||
result.put("code",200);
|
||||
return new ResponseEntity<>(result, HttpStatus.OK);
|
||||
} catch (IllegalArgumentException e) {
|
||||
return new ResponseEntity<>(HttpStatus.BAD_REQUEST);
|
||||
} catch (Exception e) {
|
||||
@@ -210,6 +213,31 @@ public class ReservationStockInOrderApi extends BaseController {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 接口1:仅解析Excel文件(返回解析结果,不保存)
|
||||
* 用途:预览Excel解析数据
|
||||
*/
|
||||
@PostMapping("/parse-excel")
|
||||
public ResponseEntity<Map<String, Object>> parseStockInExcel(
|
||||
@RequestParam("file") MultipartFile file,
|
||||
@RequestParam(value = "sheetName", required = false) String sheetName) {
|
||||
try {
|
||||
StockInDataDTO resultDTO = reservationStockInOrderService.parseStockInExcel(file, sheetName);
|
||||
Map<String, Object> result = new HashMap<>();
|
||||
result.put("result", resultDTO);
|
||||
result.put("code",200);
|
||||
return new ResponseEntity<>(result, HttpStatus.OK);
|
||||
} catch (IllegalArgumentException e) {
|
||||
// 参数错误(如文件为空)
|
||||
// LOGGER.error("Excel解析参数错误:{}", e.getMessage());
|
||||
return new ResponseEntity<>(HttpStatus.BAD_REQUEST);
|
||||
} catch (Exception e) {
|
||||
// 其他解析异常
|
||||
// LOGGER.error("Excel解析失败:{}", e.getMessage(), e);
|
||||
return new ResponseEntity<>(HttpStatus.INTERNAL_SERVER_ERROR);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation("批量推送")
|
||||
@PostMapping("/batchPush")
|
||||
|
||||
Reference in New Issue
Block a user