|
|
@@ -14,7 +14,10 @@ import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import com.yami.shop.bean.enums.DvyType;
|
|
|
import com.yami.shop.bean.enums.OrderStatus;
|
|
|
-import com.yami.shop.bean.model.*;
|
|
|
+import com.yami.shop.bean.model.Order;
|
|
|
+import com.yami.shop.bean.model.OrderItem;
|
|
|
+import com.yami.shop.bean.model.User;
|
|
|
+import com.yami.shop.bean.model.UserAddrOrder;
|
|
|
import com.yami.shop.bean.param.BackendOrderParam;
|
|
|
import com.yami.shop.bean.param.DeliveryOrderParam;
|
|
|
import com.yami.shop.bean.param.OrderParam;
|
|
|
@@ -27,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.*;
|
|
|
@@ -138,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("订单不处于待发货状态,无法进行发货");
|
|
|
}
|
|
|
|
|
|
@@ -158,7 +160,7 @@ public class OrderController {
|
|
|
orderParam.setOrderId(order.getOrderId());
|
|
|
orderParam.setDvyType(2);
|
|
|
orderService.updateById(orderParam);
|
|
|
- return ResponseEntity.ok().build();
|
|
|
+ return R.SUCCESS();
|
|
|
}
|
|
|
|
|
|
orderParam.setOrderId(order.getOrderId());
|
|
|
@@ -177,7 +179,7 @@ public class OrderController {
|
|
|
productService.removeProductCacheByProdId(orderItem.getProdId());
|
|
|
skuService.removeSkuCacheBySkuId(orderItem.getSkuId(),orderItem.getProdId());
|
|
|
}
|
|
|
- return ResponseEntity.ok().build();
|
|
|
+ return R.SUCCESS();
|
|
|
}
|
|
|
|
|
|
}
|