refactor(后台管理): 订单列表

完善订单列表操作
master
hequan_waynaqua 4 years ago
parent ca95adf1b1
commit 763f7690e9

@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.wayn.admin.framework.config.properties.ExpressProperties;
import com.wayn.common.base.BaseController;
import com.wayn.common.core.domain.shop.Order;
import com.wayn.common.core.domain.vo.ShipVO;
import com.wayn.common.core.service.shop.IAdminOrderService;
import com.wayn.common.util.R;
import org.springframework.beans.factory.annotation.Autowired;
@ -48,9 +49,9 @@ public class AdminOrderController extends BaseController {
return R.success().add("data", expressProperties.getVendors());
}
@PostMapping("ship/{orderId}")
public R ship(@PathVariable Long orderId) {
return iAdminOrderService.ship(orderId);
@PostMapping("ship")
public R ship(ShipVO shipVO) {
return iAdminOrderService.ship(shipVO);
}
}

@ -0,0 +1,25 @@
package com.wayn.common.core.domain.vo;
import lombok.Data;
/**
* VO
*/
@Data
public class ShipVO {
/**
* ID
*/
private Long orderId;
/**
*
*/
private String shipChannel;
/**
*
*/
private String shipSn;
}

@ -3,6 +3,7 @@ package com.wayn.common.core.service.shop;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.wayn.common.core.domain.shop.Order;
import com.wayn.common.core.domain.vo.ShipVO;
import com.wayn.common.util.R;
/**
@ -47,10 +48,10 @@ public interface IAdminOrderService extends IService<Order> {
* 1.
* 2.
*
* @param orderId { orderIdxxx, shipSn: xxx, shipChannel: xxx }
* @param shipVO { orderIdxxx, shipSn: xxx, shipChannel: xxx }
* @return r
*/
R ship(Long orderId);
R ship(ShipVO shipVO);
/**
*

@ -9,6 +9,7 @@ import com.wayn.common.core.domain.shop.Order;
import com.wayn.common.core.domain.shop.OrderGoods;
import com.wayn.common.core.domain.tool.MailConfig;
import com.wayn.common.core.domain.vo.SendMailVO;
import com.wayn.common.core.domain.vo.ShipVO;
import com.wayn.common.core.mapper.shop.AdminOrderMapper;
import com.wayn.common.core.service.shop.IAdminOrderService;
import com.wayn.common.core.service.shop.IGoodsProductService;
@ -143,9 +144,12 @@ public class AdminOrderServiceImpl extends ServiceImpl<AdminOrderMapper, Order>
}
@Override
public R ship(Long orderId) {
public R ship(ShipVO shipVO) {
Long orderId = shipVO.getOrderId();
String shipChannel = shipVO.getShipChannel();
String shipSn = shipVO.getShipSn();
Order order = getById(orderId);
if (order == null) {
if (order == null || StringUtils.isEmpty(shipChannel) || StringUtils.isEmpty(shipSn)) {
return R.error();
}
@ -155,8 +159,8 @@ public class AdminOrderServiceImpl extends ServiceImpl<AdminOrderMapper, Order>
}
order.setOrderStatus(OrderUtil.STATUS_SHIP);
order.setShipSn("xxxx");
order.setShipChannel("申通");
order.setShipSn(shipSn);
order.setShipChannel(shipChannel);
order.setShipTime(LocalDateTime.now());
order.setUpdateTime(new Date());
updateById(order);

Loading…
Cancel
Save