vip购买相关

This commit is contained in:
wangjinlei
2024-06-05 13:48:16 +08:00
parent 71f44ffcc0
commit dd93a8e81f
7 changed files with 200 additions and 5 deletions

View File

@@ -19,4 +19,6 @@ public interface BuyOrderService extends IService<BuyOrder> {
Map<String,Object> commonOrderDetail(Map params);
ExpressQueryResponse commonExpressDetail(Map params);
void updateOrderStatus(Integer userId, String orderSn, String type);
}

View File

@@ -17,6 +17,8 @@ import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@@ -144,6 +146,31 @@ public class BuyOrderServiceImpl extends ServiceImpl<BuyOrderDao, BuyOrder> impl
return res;
}
@Override
public void updateOrderStatus(Integer userId, String orderSn, String type) {
// 支付成功 0
// 发货成功 1
// 交易成功 2
// 交易失败 9
BuyOrder orderEntity = this.getOne(new QueryWrapper<BuyOrder>().eq("user_id", userId)
.eq("order_sn", orderSn));
if (type.equals("0")) {
orderEntity.setPaymentDate(new Date());
orderEntity.setOrderStatus("1");
} else if (type.equals("9")) {
orderEntity.setOrderStatus("4");
} else if (type.equals("1")) {
orderEntity.setOrderStatus("2");
} else if (type.equals("2")) {
orderEntity.setOrderStatus("3");
}
updateById(orderEntity);
}
@Override
public ExpressQueryResponse commonExpressDetail(Map params) {
LambdaQueryWrapper<ExpressOrder> expressOrderWrapper = new LambdaQueryWrapper<>();