| New file |
| | |
| | | package com.example.erp.controller.sd; |
| | | |
| | | import com.example.erp.common.Result; |
| | | import com.example.erp.service.sd.OrderFileService; |
| | | import io.swagger.annotations.Api; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import java.io.IOException; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | @RestController |
| | | @Api(value="订单文件controller",tags={"订单文件操作接口"}) |
| | | @RequestMapping("/orderFile") |
| | | @RequiredArgsConstructor |
| | | public class OrderFileController { |
| | | private final OrderFileService orderFileService; |
| | | |
| | | @PostMapping("/updateOrderFileByOrderNumber/{orderId}/{orderNumber}") |
| | | public Result updateOrderFileByOrderNumber( |
| | | @RequestParam("file") MultipartFile file, |
| | | @RequestParam("name") String name, |
| | | @PathVariable String orderId, |
| | | @PathVariable String orderNumber) throws IOException { |
| | | |
| | | return Result.success(orderFileService.updateOrderFileByOrderNumber(file,name,orderId,orderNumber)); |
| | | } |
| | | @PostMapping("/getOrderFilePicture") |
| | | public Result getOrderFilePicture(@RequestBody List<Map<String,Object>> orderDetails) throws NoSuchFieldException { |
| | | return Result.success(orderFileService.getOrderFilePicture(orderDetails)); |
| | | } |
| | | |
| | | @PostMapping("/getOrderNumberFile/{orderId}/{orderNumber}") |
| | | public Result getOrderNumberFile(@PathVariable String orderId,@PathVariable String orderNumber){ |
| | | return Result.success(orderFileService.getOrderNumberFile(orderId,orderNumber)); |
| | | } |
| | | @PostMapping("/deleteOrderNumberFile/{orderId}/{orderNumber}") |
| | | public Result deleteOrderNumberFile(@PathVariable String orderId,@PathVariable String orderNumber){ |
| | | return Result.success(orderFileService.deleteOrderNumberFile(orderId,orderNumber)); |
| | | } |
| | | |
| | | } |