1
0

3 Коммитууд 70b0a8e5fc ... b86038001a

Эзэн SHA1 Мессеж Огноо
  wangming b86038001a Merge remote-tracking branch 'origin/master' 1 долоо хоног өмнө
  wangming 3722d88095 add deliver 1 долоо хоног өмнө
  wangming 28174cb54b add deliver 1 долоо хоног өмнө

+ 0 - 4
yami-shop-bean/src/main/java/com/yami/shop/bean/param/DeliveryOrderParam.java

@@ -33,10 +33,6 @@ public class DeliveryOrderParam {
 	@ApiModelProperty(value = "物流单号",required=true)
 	private String dvyFlowId;
 
-    @NotBlank(message="物流公司编号不能为空")
-    @ApiModelProperty(value = "物流公司编号",required=true)
-    private String dvyNo;
-
     @NotBlank(message="配送类型 1:快递 2:自提 3:及时配送")
     @ApiModelProperty(value = "配送类型 1:快递 2:自提 3:及时配送",required=true)
     private Integer dvyType;

+ 6 - 5
yami-shop-platform/src/main/java/com/yami/shop/platform/controller/OrderController.java

@@ -30,7 +30,6 @@ import com.yami.shop.utils.CullenUtils;
 import io.swagger.annotations.ApiOperation;
 import lombok.AllArgsConstructor;
 import org.springframework.format.annotation.DateTimeFormat;
-import org.springframework.http.ResponseEntity;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.web.bind.annotation.*;
@@ -59,6 +58,7 @@ public class OrderController {
     private final ProductService productService;
     private final SkuService skuService;
     private final UserService userService;
+    private final DeliveryService deliveryService;
 
 
     /**
@@ -140,11 +140,11 @@ public class OrderController {
     @ApiOperation("发货")
     @PutMapping("/delivery")
     @Transactional(rollbackFor = Exception.class)
-    public ResponseEntity<Void> delivery(@RequestBody DeliveryOrderParam deliveryOrderParam) {
+    public R<Void> delivery(@RequestBody DeliveryOrderParam deliveryOrderParam) {
         Order order = orderService.getOne(new LambdaUpdateWrapper<Order>().eq(Order::getOrderNumber, deliveryOrderParam.getOrderNumber()));
         if (!Objects.equals(order.getHbOrderStatus(), OrderStatus.PADYED.value()) && Objects.equals(order.getDvyType(), DvyType.FETCH.value())){
             throw new GlobalException("订单不处于待入库状态,无法进行入库");
-        }else if (!Objects.equals(order.getHbOrderStatus(), OrderStatus.PADYED.value())){
+        }else if (!Objects.equals(order.getHbOrderStatus(), 1)){
             throw new GlobalException("订单不处于待发货状态,无法进行发货");
         }
 
@@ -154,12 +154,13 @@ public class OrderController {
                     CullenUtils.validateDataThrowException(orderItemService.refundIngCount(orderItem.getOrderItemId())!=0,"该订单存在售后中商品,请处理后发货..."));
         }
 
+        //Delivery delivery = deliveryService.getById(deliveryOrderParam.getDvyId());
         Order orderParam = new Order();
         if (deliveryOrderParam.getDvyType().equals(2)){
             orderParam.setOrderId(order.getOrderId());
             orderParam.setDvyType(2);
             orderService.updateById(orderParam);
-            return ResponseEntity.ok().build();
+            return R.SUCCESS();
         }
 
         orderParam.setOrderId(order.getOrderId());
@@ -178,7 +179,7 @@ public class OrderController {
             productService.removeProductCacheByProdId(orderItem.getProdId());
             skuService.removeSkuCacheBySkuId(orderItem.getSkuId(),orderItem.getProdId());
         }
-        return ResponseEntity.ok().build();
+        return R.SUCCESS();
     }
 
 }