| | |
| | | |
| | | import com.doumee.api.BaseController; |
| | | import com.doumee.core.annotation.excel.ExcelExporter; |
| | | import com.doumee.core.annotation.pr.PreventRepeat; |
| | | import com.doumee.core.model.ApiResponse; |
| | | import com.doumee.core.model.LoginUserInfo; |
| | | import com.doumee.core.model.PageData; |
| | | import com.doumee.core.model.PageWrap; |
| | | import com.doumee.dao.business.model.Orders; |
| | | import com.doumee.service.business.OrdersService; |
| | | import com.github.xiaoymin.knife4j.core.util.CollectionUtils; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.apache.shiro.SecurityUtils; |
| | | import org.apache.shiro.authz.annotation.RequiresPermissions; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author 江蹄蹄 |
| | | * @date 2025/07/09 12:00 |
| | | * 寄存订单管理 |
| | | * @author rk |
| | | * @date 2026/04/10 |
| | | */ |
| | | @Api(tags = "订单信息记录") |
| | | @Api(tags = "寄存订单") |
| | | @RestController |
| | | @RequestMapping("/business/orders") |
| | | public class OrdersController extends BaseController { |
| | | |
| | | @Autowired |
| | | private OrdersService ordersService; |
| | | |
| | | @PreventRepeat |
| | | @ApiOperation("新建") |
| | | @PostMapping("/create") |
| | | @RequiresPermissions("business:orders:create") |
| | | public ApiResponse create(@RequestBody Orders orders) { |
| | | return ApiResponse.success(ordersService.create(orders)); |
| | | } |
| | | |
| | | @ApiOperation("根据ID删除") |
| | | @GetMapping("/delete/{id}") |
| | |
| | | return ApiResponse.success(null); |
| | | } |
| | | |
| | | // @ApiOperation("根据ID修改") |
| | | // @PostMapping("/updateById") |
| | | // @RequiresPermissions("business:orders:update") |
| | | // public ApiResponse updateById(@RequestBody Orders orders) { |
| | | // ordersService.updateById(orders); |
| | | // return ApiResponse.success(null); |
| | | // } |
| | | @ApiOperation("根据ID修改") |
| | | @PostMapping("/updateById") |
| | | @RequiresPermissions("business:orders:update") |
| | | public ApiResponse updateById(@RequestBody Orders orders) { |
| | | ordersService.updateById(orders); |
| | | return ApiResponse.success(null); |
| | | } |
| | | |
| | | @ApiOperation("分页查询") |
| | | @PostMapping("/page") |
| | |
| | | @PostMapping("/exportExcel") |
| | | @RequiresPermissions("business:orders:exportExcel") |
| | | public void exportExcel (@RequestBody PageWrap<Orders> pageWrap, HttpServletResponse response) { |
| | | List<Orders> ordersList = ordersService.findPage(pageWrap).getRecords(); |
| | | ExcelExporter.build(Orders.class).export(ordersList, "订单信息记录", response); |
| | | ExcelExporter.build(Orders.class).export(ordersService.findPage(pageWrap).getRecords(), "寄存订单", response); |
| | | } |
| | | |
| | | @ApiOperation("根据ID查询 ") |
| | |
| | | @RequiresPermissions("business:orders:query") |
| | | public ApiResponse findById(@PathVariable Integer id) { |
| | | return ApiResponse.success(ordersService.findById(id)); |
| | | } |
| | | |
| | | @ApiOperation("平台取消订单") |
| | | @GetMapping("/cancel") |
| | | @RequiresPermissions("business:orders:update") |
| | | public ApiResponse cancel(@RequestParam Integer id) { |
| | | LoginUserInfo loginUserInfo = (LoginUserInfo) SecurityUtils.getSubject().getPrincipal(); |
| | | ordersService.platformCancel(id,loginUserInfo); |
| | | return ApiResponse.success("操作成功"); |
| | | } |
| | | |
| | | } |