|  |  |  | 
|---|
|  |  |  | 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.*; | 
|---|
|  |  |  | 
|---|
|  |  |  | 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) { | 
|---|
|  |  |  | ExcelExporter.build(Orders.class).export(ordersService.findPage(pageWrap).getRecords(), "订单信息记录", response); | 
|---|
|  |  |  | List<Orders> ordersList = ordersService.findPage(pageWrap).getRecords(); | 
|---|
|  |  |  | ExcelExporter.build(Orders.class).export(ordersList, "订单信息记录", response); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @ApiOperation("根据ID查询") | 
|---|
|  |  |  | @ApiOperation("根据ID查询 ") | 
|---|
|  |  |  | @GetMapping("/{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("操作成功"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|