| | |
| | | import com.example.erp.entity.sd.OrderGlassDetail; |
| | | import com.example.erp.exception.ServiceException; |
| | | import com.example.erp.service.sd.OrderService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | |
| | | |
| | | @RestController |
| | | @RequestMapping("/order") |
| | | @Api(value="订单controller",tags={"订单操作接口"}) |
| | | public class OrderController { |
| | | private final OrderService orderService; |
| | | |
| | |
| | | } |
| | | |
| | | |
| | | @ApiOperation("订单保存") |
| | | @PostMapping("/saveOrder") |
| | | public Result saveOrder(@RequestBody Map<String, Object> orderMap) throws Exception { |
| | | if(orderService.saveOrder(orderMap)) { |
| | |
| | | throw new ServiceException(Constants.Code_500,Constants.Code_msg); |
| | | } |
| | | } |
| | | |
| | | @ApiOperation("订单分页筛选查询") |
| | | @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)); |
| | | } |
| | | |
| | | @ApiOperation("删除订单") |
| | | @PostMapping("/deleteOrder/{id}") |
| | | public Result deleteOrder(@PathVariable String id) { |
| | | return Result.seccess(orderService.deleteOrder(id)); |
| | | } |
| | | |
| | | @ApiOperation("订单作废") |
| | | @PostMapping("/cancelOrder/{id}") |
| | | public Result cancelOrder(@PathVariable String id) { |
| | | return Result.seccess(orderService.cancelOrder(id)); |
| | | } |
| | | |
| | | @ApiOperation("根据id获取订单信息") |
| | | @PostMapping("/getOrderById/{id}") |
| | | public Result getOrderById(@PathVariable String id) { |
| | | return Result.seccess(orderService.getOrderById(id)); |
| | | } |
| | | @ApiOperation("查询订单工艺") |
| | | @PostMapping("/getOrderCraftById/{id}") |
| | | public Result getOrderCraftById(@PathVariable String id) { |
| | | return Result.seccess(orderService.getOrderCraftById(id)); |
| | | } |
| | | |
| | | @ApiOperation("审核订单") |
| | | @PostMapping("/reviewOrderById/{id}/{status}") |
| | | public Result reviewOrderById(@PathVariable String id,@PathVariable Integer status) { |
| | | return Result.seccess(orderService.reviewOrderById(id,status)); |
| | | } |
| | | |
| | | |
| | | @ApiOperation("审核工艺") |
| | | @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)); |
| | | } |
| | | |
| | | @ApiOperation("更新订单金额单价") |
| | | @PostMapping("/updateOrderMoney") |
| | | public Result updateOrderMoney(@RequestBody Map<String,Object> map) { |
| | | return Result.seccess(orderService.updateOrderMoney(map)); |
| | | } |
| | | } |