|
|
@@ -26,6 +26,7 @@ import com.yami.shop.config.ShopConfig;
|
|
|
import com.yami.shop.dao.PointsRecordMapper;
|
|
|
import com.yami.shop.security.api.util.SecurityUtils;
|
|
|
import com.yami.shop.service.*;
|
|
|
+import com.yami.shop.utils.CullenUtils;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiImplicitParam;
|
|
|
import io.swagger.annotations.ApiImplicitParams;
|
|
|
@@ -45,6 +46,7 @@ import java.util.Objects;
|
|
|
|
|
|
@RestController
|
|
|
@RequestMapping("/p/myOrder")
|
|
|
+//@RequestMapping("/myOrder")
|
|
|
@Api(tags = "我的订单接口")
|
|
|
@AllArgsConstructor
|
|
|
public class MyOrderController {
|
|
|
@@ -203,9 +205,12 @@ public class MyOrderController {
|
|
|
@ApiImplicitParams({
|
|
|
@ApiImplicitParam(name = "status", value = "订单状态 1:待付款 2:待发货 3:待收货 4:待评价 5:成功 6:失败", required = false, dataType = "Integer"),
|
|
|
})
|
|
|
- public ResponseEntity<IPage<MyOrderDto>> myOrder(@ModelAttribute PageParam<MyOrderDto> page, @RequestParam(value = "status", required = false) Integer status) {
|
|
|
+ public ResponseEntity<IPage<MyOrderDto>> myOrder(@ModelAttribute PageParam<MyOrderDto> page,
|
|
|
+ @RequestParam(value = "status", required = false) Integer status,
|
|
|
+ @RequestParam(value = "dvyType", required = false) Integer dvyType
|
|
|
+ ) {
|
|
|
String userId = SecurityUtils.getUser().getUserId();
|
|
|
- IPage<MyOrderDto> myOrderDtoIpage = myOrderService.pageMyOrderByUserIdAndStatus(page, userId, status);
|
|
|
+ IPage<MyOrderDto> myOrderDtoIpage = myOrderService.pageMyOrderByUserIdAndStatus(page, userId, status,dvyType);
|
|
|
return ResponseEntity.ok(myOrderDtoIpage);
|
|
|
}
|
|
|
|
|
|
@@ -319,13 +324,18 @@ public class MyOrderController {
|
|
|
public ResponseEntity<String> receipt(@PathVariable("orderNumber") String orderNumber) {
|
|
|
String userId = SecurityUtils.getUser().getUserId();
|
|
|
Order order = orderService.getOrderByOrderNumberAndUserId(orderNumber, userId, true);
|
|
|
-
|
|
|
- if (!Objects.equals(order.getHbOrderStatus(), OrderStatus.CONSIGNMENT.value())) {
|
|
|
- throw new GlobalException("订单未发货,无法确认收货");
|
|
|
- }
|
|
|
- if (Objects.equals(order.getRefundStatus(), RefundStatusEnum.APPLY.value())) {
|
|
|
- throw new GlobalException("订单退款中,无法确认收货");
|
|
|
+ if (Objects.equals(order.getDvyType(), 1)){
|
|
|
+ CullenUtils.validateDataThrowException(Objects.equals(order.getHbOrderStatus(), 0),"订单未支付");
|
|
|
+ CullenUtils.validateDataThrowException(Objects.equals(order.getHbOrderStatus(), 1),"订单未发货,无法确认收货");
|
|
|
+ }else {
|
|
|
+ if (!Objects.equals(order.getHbOrderStatus(), OrderStatus.CONSIGNMENT.value())) {
|
|
|
+ throw new GlobalException("订单未发货,无法确认收货");
|
|
|
+ }
|
|
|
+ if (Objects.equals(order.getRefundStatus(), RefundStatusEnum.APPLY.value())) {
|
|
|
+ throw new GlobalException("订单退款中,无法确认收货");
|
|
|
+ }
|
|
|
}
|
|
|
+
|
|
|
List<OrderItem> orderItems = orderItemService.getOrderItemsByOrderNumber(orderNumber);
|
|
|
order.setOrderItems(orderItems);
|
|
|
// 确认收货
|