购买bug修改
This commit is contained in:
@@ -260,7 +260,7 @@ public class BuyOrderController {
|
||||
totalPrice = totalPrice.add(getShoppingAmount(buyOrder));
|
||||
String orderSn = IdWorker.getTimeId().substring(0, 32);
|
||||
buyOrder.setOrderSn(orderSn);
|
||||
buyOrder.setPaymentDate(new Date());
|
||||
// buyOrder.setPaymentDate(new Date());//这个是支付时间
|
||||
QueryWrapper<UserAddress> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("id", buyOrder.getAddressId());
|
||||
UserAddress userAddress = userAddressService.getOne(queryWrapper);
|
||||
|
||||
@@ -162,6 +162,7 @@ public class BuyOrderServiceImpl extends ServiceImpl<BuyOrderDao, BuyOrder> impl
|
||||
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");
|
||||
@@ -393,6 +394,7 @@ public class BuyOrderServiceImpl extends ServiceImpl<BuyOrderDao, BuyOrder> impl
|
||||
buyOrderIdList.add(buyOrderProduct.getOrderId());
|
||||
int productId = buyOrderProduct.getProductId();
|
||||
ShopProduct product = shopProductService.getById(productId);
|
||||
//定义快递商品
|
||||
ExpressCommodity commodity = new ExpressCommodity();
|
||||
commodity.setGoodsName(product.getProductName());
|
||||
commodity.setGoodsquantity(buyOrderProduct.getQuantity());
|
||||
@@ -478,6 +480,7 @@ public class BuyOrderServiceImpl extends ServiceImpl<BuyOrderDao, BuyOrder> impl
|
||||
QueryWrapper<MyUserEntity> userEntityQueryWrapper = new QueryWrapper<>();
|
||||
userEntityQueryWrapper.eq("id", userId);
|
||||
MyUserEntity user = myUserService.getOne(userEntityQueryWrapper);
|
||||
|
||||
if (user != null) {
|
||||
UserResponseVo userResponseVo = new UserResponseVo();
|
||||
userResponseVo.setUserId(user.getId());
|
||||
@@ -500,6 +503,8 @@ public class BuyOrderServiceImpl extends ServiceImpl<BuyOrderDao, BuyOrder> impl
|
||||
responseVo.setDistrictPrice(buyOrder.getDistrictMoney());
|
||||
responseVo.setOrderType(buyOrder.getOrderType());
|
||||
BeanUtil.copyProperties(buyOrder, responseVo);
|
||||
|
||||
//设置快递地址信息
|
||||
ConsigneeVo consigneeVo = new ConsigneeVo();
|
||||
consigneeVo.setConsigneeName(buyOrder.getShippingUser());
|
||||
consigneeVo.setConsigneeMobile(buyOrder.getUserPhone());
|
||||
@@ -531,6 +536,8 @@ public class BuyOrderServiceImpl extends ServiceImpl<BuyOrderDao, BuyOrder> impl
|
||||
consigneeVo.setCountyCode(county.getRegionCode());
|
||||
}
|
||||
responseVo.setConsignee(consigneeVo);
|
||||
|
||||
//设置商品数组
|
||||
QueryWrapper<BuyOrderProduct> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("order_id", buyOrder.getOrderId());
|
||||
List<BuyOrderProduct> buyOrderProductList = buyOrderProductService.list(queryWrapper);
|
||||
@@ -558,6 +565,10 @@ public class BuyOrderServiceImpl extends ServiceImpl<BuyOrderDao, BuyOrder> impl
|
||||
goodsResponseVoList.add(goodsResponseVo);
|
||||
}
|
||||
responseVo.setGoodsList(goodsResponseVoList);
|
||||
|
||||
|
||||
|
||||
|
||||
return responseVo;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user