package com.mzl.flower.web.partner; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.mzl.flower.base.BaseController; import com.mzl.flower.base.R; import com.mzl.flower.base.ReturnDataDTO; import com.mzl.flower.dto.request.payment.OrderQueryDTO; import com.mzl.flower.dto.response.partner.PartnerOrderDTO; import com.mzl.flower.dto.response.payment.OrderCheckListDTO; import com.mzl.flower.dto.response.payment.OrderDTO; import com.mzl.flower.dto.response.payment.OrderItemListDTO; import com.mzl.flower.dto.response.payment.OrderListDTO; import com.mzl.flower.entity.partner.Partner; import com.mzl.flower.service.payment.OrderService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParams; import io.swagger.annotations.ApiOperation; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.ResponseEntity; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; import java.util.List; @RestController @RequestMapping("/api/partner/order") @Api(value = "订单管理-合伙人", tags = "订单管理-合伙人") @Validated @Slf4j public class OrderPartnerController extends BaseController { @Autowired private OrderService orderService; @GetMapping("/list") @ApiOperation(value = "查询订单列表") public ResponseEntity>> selectOrderList(Page page, OrderQueryDTO dto){ return returnData(R.SUCCESS.getCode(), orderService.selectPartnerOrderList(page, dto)); } @GetMapping("/list/view") @ApiOperation(value = "订单详情") @ApiImplicitParams({ @ApiImplicitParam(name = "id", value = "订单id", required = true, dataType = "String", paramType = "query") }) public ResponseEntity> getOrderInfo(String id){ return returnData(R.SUCCESS.getCode(), orderService.getOrderInfo(id)); } @GetMapping("/item/list") @ApiOperation(value = "订单商品明细") @ApiImplicitParams({ @ApiImplicitParam(name = "id", value = "订单id", required = true, dataType = "String", paramType = "query") }) public ResponseEntity>> getPtCuOrderItems(String id){ return returnData(R.SUCCESS.getCode(), orderService.getPtCuOrderItems(id)); } @GetMapping("/statistics") @ApiOperation(value = "查询订单统计") public ResponseEntity> getCurrentPartnerOrderStatistics(){ return returnData(R.SUCCESS.getCode(), orderService.getCurrentPartnerOrderStatistics()); } @GetMapping("/check/list") @ApiOperation(value = "查询订单清单列表") public ResponseEntity>> selectOrderCheckList(OrderQueryDTO dto){ Partner partner = orderService.getCurrentPartner(); dto.setPartnerId(partner.getId()); return returnData(R.SUCCESS.getCode(), orderService.selectOrderCheckList(dto)); } @PostMapping("/check/list") @ApiOperation(value = "查询订单清单列表") public ResponseEntity>> postSelectOrderCheckList(@RequestBody OrderQueryDTO dto){ Partner partner = orderService.getCurrentPartner(); dto.setPartnerId(partner.getId()); return returnData(R.SUCCESS.getCode(), orderService.selectOrderCheckList(dto)); } }