| | |
| | | import cn.lili.common.utils.StringUtils; |
| | | import cn.lili.common.vo.ResultMessage; |
| | | import cn.lili.modules.lmk.enums.general.AdminRoleEnum; |
| | | import cn.lili.modules.member.entity.dto.MemberAddressDTO; |
| | | import cn.lili.modules.order.order.entity.dos.Order; |
| | | import cn.lili.modules.order.order.entity.dos.OrderPackage; |
| | | import cn.lili.modules.order.order.entity.dto.OrderSearchParams; |
| | | import cn.lili.modules.order.order.entity.dto.OrderSearchXcxParams; |
| | | import cn.lili.modules.order.order.entity.enums.ModifyAddressEnums; |
| | | import cn.lili.modules.order.order.entity.enums.OrderStatusEnum; |
| | | import cn.lili.modules.order.order.entity.vo.OrderDetailVO; |
| | | import cn.lili.modules.order.order.entity.vo.OrderSimpleVO; |
| | |
| | | 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.web.bind.annotation.*; |
| | | import springfox.documentation.annotations.ApiIgnore; |
| | | |
| | | import javax.validation.Valid; |
| | | import javax.validation.constraints.NotBlank; |
| | | import javax.validation.constraints.NotNull; |
| | | import java.util.ArrayList; |
| | |
| | | * @author Chopper |
| | | * @since 2020/11/16 10:08 下午 |
| | | */ |
| | | @Slf4j |
| | | @RestController |
| | | @Api(tags = "买家端,订单接口") |
| | | @RequestMapping("/buyer/order/order") |
| | |
| | | }); |
| | | return ResultUtil.data(orderDetailVO); |
| | | } |
| | | |
| | | @ApiOperation(value = "订单明细") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "orderSn", value = "订单编号", required = true, paramType = "path") |
| | | }) |
| | | @GetMapping(value = "/editAddress/{orderSn}") |
| | | public ResultMessage<OrderDetailVO> editAddress(@NotNull(message = "订单编号不能为空") @PathVariable("orderSn") String orderSn) { |
| | | OrderDetailVO orderDetailVO = orderService.queryEditAddressDetail(orderSn); |
| | | Order order = orderDetailVO.getOrder(); |
| | | if (!OrderStatusEnum.UNDELIVERED.name().equals(order.getOrderStatus())) { |
| | | log.error("订单号为{}------------------->状态异常为{}",orderSn,order.getOrderStatus()); |
| | | throw new ServiceException("订单状态异常无法领取"); |
| | | } |
| | | String modifyAddressFlag = order.getModifyAddressFlag(); |
| | | if (ModifyAddressEnums.USED.name().equals(modifyAddressFlag)) { |
| | | throw new ServiceException("订单已被领取"); |
| | | } |
| | | orderDetailVO.getOrderItems().forEach(orderItem -> { |
| | | String image = orderItem.getImage(); |
| | | if (StringUtils.isNotBlank(image)&&!image.contains("http")) { |
| | | orderItem.setImage(cosUtil.getPreviewUrl(image)); |
| | | } |
| | | }); |
| | | return ResultUtil.data(orderDetailVO); |
| | | } |
| | | @ApiOperation(value = "修改收货人信息") |
| | | @ApiImplicitParam(name = "orderSn", value = "订单sn", required = true, dataType = "String", paramType = "path") |
| | | @PostMapping(value = "/update/editAddress/{orderSn}/consignee") |
| | | public ResultMessage<Object> consignee(@NotNull(message = "参数非法") @PathVariable String orderSn, |
| | | @Valid @RequestBody MemberAddressDTO memberAddressDTO) { |
| | | return ResultUtil.data(orderService.updateAddressConsignee(orderSn, memberAddressDTO)); |
| | | } |
| | | @PreventDuplicateSubmissions |
| | | @ApiOperation(value = "确认收货") |
| | | @ApiImplicitParams({ |