package com.doumee.api.business; import com.doumee.api.BaseController; import com.doumee.core.annotation.excel.ExcelExporter; import com.doumee.core.model.ApiResponse; import com.doumee.core.model.PageData; import com.doumee.core.model.PageWrap; import com.doumee.dao.business.model.OtherOrders; import com.doumee.service.business.OtherOrdersService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.apache.shiro.authz.annotation.RequiresPermissions; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; import javax.servlet.http.HttpServletResponse; import java.util.ArrayList; import java.util.List; /** * 其他订单管理 * @author rk * @date 2026/04/16 */ @Api(tags = "其他订单") @RestController @RequestMapping("/business/otherOrders") public class OtherOrdersController extends BaseController { @Autowired private OtherOrdersService otherOrdersService; @ApiOperation("根据ID删除") @GetMapping("/delete/{id}") @RequiresPermissions("business:otherOrders:delete") public ApiResponse deleteById(@PathVariable Integer id) { otherOrdersService.deleteById(id); return ApiResponse.success(null); } @ApiOperation("批量删除") @GetMapping("/delete/batch") @RequiresPermissions("business:otherOrders:delete") public ApiResponse deleteByIdInBatch(@RequestParam String ids) { String[] idArray = ids.split(","); List idList = new ArrayList<>(); for (String id : idArray) { idList.add(Integer.valueOf(id)); } otherOrdersService.deleteByIdInBatch(idList); return ApiResponse.success(null); } @ApiOperation("根据ID修改") @PostMapping("/updateById") @RequiresPermissions("business:otherOrders:update") public ApiResponse updateById(@RequestBody OtherOrders otherOrders) { otherOrdersService.updateById(otherOrders); return ApiResponse.success(null); } @ApiOperation("分页查询") @PostMapping("/page") @RequiresPermissions("business:otherOrders:query") public ApiResponse> findPage(@RequestBody PageWrap pageWrap) { return ApiResponse.success(otherOrdersService.findPage(pageWrap)); } @ApiOperation("导出Excel") @PostMapping("/exportExcel") @RequiresPermissions("business:otherOrders:exportExcel") public void exportExcel(@RequestBody PageWrap pageWrap, HttpServletResponse response) { ExcelExporter.build(OtherOrders.class).export(otherOrdersService.findPage(pageWrap).getRecords(), "其他订单", response); } @ApiOperation("根据ID查询") @GetMapping("/{id}") @RequiresPermissions("business:otherOrders:query") public ApiResponse findById(@PathVariable Integer id) { return ApiResponse.success(otherOrdersService.findById(id)); } }