| | |
| | | |
| | | import cn.hutool.core.convert.Convert; |
| | | import cn.hutool.core.util.NumberUtil; |
| | | import cn.lili.base.Result; |
| | | import cn.lili.common.aop.annotation.PreventDuplicateSubmissions; |
| | | import cn.lili.common.context.ThreadContextHolder; |
| | | import cn.lili.common.enums.ResultCode; |
| | | import cn.lili.common.enums.ResultUtil; |
| | | import cn.lili.common.utils.StringUtils; |
| | | import cn.lili.common.vo.ResultMessage; |
| | | import cn.lili.modules.lmk.domain.vo.OrderCountVO; |
| | | import cn.lili.modules.lmk.domain.vo.SelectVO; |
| | | import cn.lili.modules.member.entity.dto.MemberAddressDTO; |
| | | import cn.lili.modules.order.order.entity.dos.Order; |
| | | import cn.lili.modules.order.order.entity.dto.OrderExportDTO; |
| | | import cn.lili.modules.order.order.entity.dto.OrderSearchParams; |
| | | import cn.lili.modules.order.order.entity.vo.OrderDetailVO; |
| | | import cn.lili.modules.order.order.entity.vo.OrderSimpleVO; |
| | | import cn.lili.modules.order.order.service.OrderPackageService; |
| | | import cn.lili.modules.order.order.service.OrderPriceService; |
| | | import cn.lili.modules.order.order.service.OrderService; |
| | | import cn.lili.modules.store.entity.dos.Store; |
| | | import cn.lili.modules.store.mapper.StoreMapper; |
| | | import cn.lili.utils.COSUtil; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper; |
| | | import io.swagger.annotations.*; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | |
| | | import javax.validation.Valid; |
| | | import javax.validation.constraints.NotBlank; |
| | | import javax.validation.constraints.NotNull; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | @RequestMapping("/manager/order/order") |
| | | @Api(tags = "管理端,订单API") |
| | | public class OrderManagerController { |
| | | @Autowired |
| | | private StoreMapper storeMapper; |
| | | |
| | | /** |
| | | * 订单 |
| | |
| | | @Autowired |
| | | private OrderPriceService orderPriceService; |
| | | |
| | | @Autowired |
| | | private OrderPackageService orderPackageService; |
| | | |
| | | @Autowired |
| | | private COSUtil cosUtil; |
| | | |
| | | @ApiModelProperty(value = "店铺下拉") |
| | | @GetMapping("/storeSelect") |
| | | public ResultMessage<List<SelectVO>> getStoreSelect(){ |
| | | List<Store> storeList = |
| | | new LambdaQueryChainWrapper<>(storeMapper) |
| | | .eq(Store::getDeleteFlag,Boolean.FALSE) |
| | | .list(); |
| | | List<SelectVO> selectVOS = new ArrayList<>(); |
| | | for (Store store : storeList){ |
| | | SelectVO vo = new SelectVO(); |
| | | vo.setId(store.getId()); |
| | | vo.setLabel(store.getStoreName()); |
| | | selectVOS.add(vo); |
| | | } |
| | | return ResultUtil.data(selectVOS); |
| | | |
| | | } |
| | | |
| | | @ApiOperation(value = "查询订单列表分页") |
| | | @GetMapping |
| | | public ResultMessage<IPage<OrderSimpleVO>> queryMineOrder(OrderSearchParams orderSearchParams) { |
| | | return ResultUtil.data(orderService.queryByParams(orderSearchParams)); |
| | | Boolean needHide = true; |
| | | return ResultUtil.data(orderService.queryByParams(orderSearchParams,needHide)); |
| | | } |
| | | @ApiOperation(value = "查询订单并统计金额与订单数") |
| | | @GetMapping("/countOrder/{id}") |
| | | public ResultMessage<OrderCountVO> countByIdOrder(@PathVariable("id") String id){ |
| | | return ResultUtil.data(orderService.countByIdOrder(id)); |
| | | } |
| | | |
| | | @ApiOperation(value = "更新订单状态") |
| | | @GetMapping("/sendMessage/{snNo}") |
| | | public ResultMessage<String> sendMqMessage(@PathVariable String snNo) { |
| | | return ResultUtil.data(orderService.sendMqMessage(snNo)); |
| | | } |
| | | |
| | | @ApiOperation(value = "查询订单导出列表") |
| | | @GetMapping("/queryExportOrder") |
| | | public void queryExportOrder(OrderSearchParams orderSearchParams) { |
| | | |
| | | HttpServletResponse response = ThreadContextHolder.getHttpResponse(); |
| | | orderService.queryExportOrder(response,orderSearchParams); |
| | | } |
| | |
| | | @ApiImplicitParam(name = "orderSn", value = "订单编号", required = true, dataType = "String", paramType = "path") |
| | | @GetMapping(value = "/{orderSn}") |
| | | public ResultMessage<OrderDetailVO> detail(@PathVariable String orderSn) { |
| | | return ResultUtil.data(orderService.queryDetail(orderSn)); |
| | | OrderDetailVO orderDetailVO = orderService.queryDetail(orderSn); |
| | | orderDetailVO.getOrderItems().forEach(orderItem -> { |
| | | String image = orderItem.getImage(); |
| | | if (StringUtils.isNotBlank(image)&&!image.contains("http")) { |
| | | orderItem.setImage(cosUtil.getPreviewUrl(image)); |
| | | } |
| | | }); |
| | | |
| | | return ResultUtil.data(orderDetailVO); |
| | | } |
| | | |
| | | |
| | |
| | | return ResultUtil.data(orderService.getTraces(orderSn)); |
| | | } |
| | | |
| | | @GetMapping(value = "/getPackage/{orderSn}") |
| | | public ResultMessage<Object> getPackage(@NotBlank(message = "订单编号不能为空") @PathVariable String orderSn) { |
| | | return ResultUtil.data(orderPackageService.getOrderPackageVOList(orderSn)); |
| | | } |
| | | @ApiOperation(value = "卖家订单备注") |
| | | @PutMapping("/{orderSn}/sellerRemark") |
| | | public ResultMessage<Object> sellerRemark(@PathVariable String orderSn, @RequestParam String sellerRemark) { |