New file |
| | |
| | | package com.example.erp.controller.sd; |
| | | |
| | | import com.example.erp.common.Constants; |
| | | import com.example.erp.common.Result; |
| | | import com.example.erp.entity.sd.Order; |
| | | import com.example.erp.entity.sd.OrderGlassDetail; |
| | | import com.example.erp.exception.ServiceException; |
| | | import com.example.erp.service.sd.OrderService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.time.LocalDate; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | @RestController |
| | | @RequestMapping("/order") |
| | | public class OrderController { |
| | | private final OrderService orderService; |
| | | |
| | | public OrderController(OrderService orderService) { |
| | | this.orderService = orderService; |
| | | } |
| | | |
| | | |
| | | @PostMapping("/saveOrder") |
| | | public Result saveOrder(@RequestBody Map<String, Object> orderMap) throws Exception { |
| | | if(orderService.saveOrder(orderMap)) { |
| | | return Result.seccess(true); |
| | | }else{ |
| | | throw new ServiceException(Constants.Code_500,Constants.Code_msg); |
| | | } |
| | | } |
| | | |
| | | @PostMapping("/getOrderList/{pageNum}/{pageSize}/{orderType}/{selectDate}") |
| | | public Result getOrderList(@PathVariable Integer pageNum, @PathVariable Integer pageSize,@PathVariable Integer orderType, @PathVariable List<String> selectDate, @RequestBody Order order) { |
| | | return Result.seccess(orderService.getOrderList(pageNum, pageSize, selectDate, order,orderType)); |
| | | } |
| | | |
| | | @PostMapping("/deleteOrder/{id}") |
| | | public Result deleteOrder(@PathVariable String id) { |
| | | return Result.seccess(orderService.deleteOrder(id)); |
| | | } |
| | | |
| | | @PostMapping("/getOrderById/{id}") |
| | | public Result getOrderById(@PathVariable String id) { |
| | | return Result.seccess(orderService.getOrderById(id)); |
| | | } |
| | | @PostMapping("/getOrderCraftById/{id}") |
| | | public Result getOrderCraftById(@PathVariable String id) { |
| | | return Result.seccess(orderService.getOrderCraftById(id)); |
| | | } |
| | | |
| | | @PostMapping("/reviewOrderById/{id}/{status}") |
| | | public Result reviewOrderById(@PathVariable String id,@PathVariable Integer status) { |
| | | return Result.seccess(orderService.reviewOrderById(id,status)); |
| | | } |
| | | |
| | | |
| | | @PostMapping("/reviewProcessById/{id}/{status}") |
| | | public Result reviewProcessById(@PathVariable String id,@PathVariable Integer status,@RequestBody List<OrderGlassDetail> orderGlassDetails) { |
| | | return Result.seccess(orderService.reviewProcessById(id,status,orderGlassDetails)); |
| | | } |
| | | } |