fix: 商城相关

pull/2/head
tangqian 2023-05-24 16:34:28 +08:00
parent 479f0c1079
commit a1de97950c
3 changed files with 81 additions and 34 deletions

View File

@ -60,4 +60,10 @@ public class OrderInfoResponse implements Serializable {
@Schema(description = "规格属性值") @Schema(description = "规格属性值")
private String sku; private String sku;
@Schema(description = "购买东西的详细信息")
private String info;
private String productName;
} }

View File

@ -72,7 +72,7 @@ public class StoreOrderDetailInfoResponse implements Serializable {
private BigDecimal deductionPrice; private BigDecimal deductionPrice;
@Schema(description = "优惠券id") @Schema(description = "优惠券id")
private Integer couponId; private Long couponId;
@Schema(description = "优惠券金额") @Schema(description = "优惠券金额")
private BigDecimal couponPrice; private BigDecimal couponPrice;

View File

@ -63,6 +63,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.support.TransactionTemplate; import org.springframework.transaction.support.TransactionTemplate;
import cn.iocoder.yudao.framework.common.util.date.DateUtils; import cn.iocoder.yudao.framework.common.util.date.DateUtils;
import org.springframework.util.CollectionUtils;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.math.BigDecimal; import java.math.BigDecimal;
@ -140,6 +141,7 @@ public class OrderServiceImpl implements OrderService {
@Autowired @Autowired
private StoreProductAttrValueService storeProductAttrValueService; private StoreProductAttrValueService storeProductAttrValueService;
/** /**
* *
* *
@ -156,7 +158,22 @@ public class OrderServiceImpl implements OrderService {
} }
lambdaQueryWrapper.orderByDesc(StoreOrder::getId); lambdaQueryWrapper.orderByDesc(StoreOrder::getId);
List<StoreOrder> storeOrders = dao.selectList(lambdaQueryWrapper); List<StoreOrder> storeOrders = dao.selectList(lambdaQueryWrapper);
return new PageInfo<>(StoreOrderConvert.INSTANCE.convert(storeOrders)); PageInfo<OrderDetailResponse> orderDetailResponsePageInfo = new PageInfo<>(StoreOrderConvert.INSTANCE.convert(storeOrders));
if (!CollectionUtils.isEmpty(orderDetailResponsePageInfo.getList())) {
orderDetailResponsePageInfo.getList().forEach(e -> {
List<StoreOrderInfo> list = storeOrderInfoService.list(Wrappers.<StoreOrderInfo>lambdaQuery().eq(StoreOrderInfo::getOrderId, e.getId()));
if (!CollectionUtils.isEmpty(list)) {
List<OrderInfoResponse> orderInfoList = new ArrayList<>();
list.forEach(x -> {
OrderInfoResponse response = new OrderInfoResponse();
BeanUtils.copyProperties(x, response);
orderInfoList.add(response);
});
e.setOrderInfoList(orderInfoList);
}
});
}
return orderDetailResponsePageInfo;
} }
/** /**
@ -167,11 +184,24 @@ public class OrderServiceImpl implements OrderService {
@Override @Override
public StoreOrderDetailInfoResponse detailOrder(String orderId) { public StoreOrderDetailInfoResponse detailOrder(String orderId) {
StoreOrder storeOrder = storeOrderService.getByOderId(orderId); StoreOrder storeOrder = storeOrderService.getByOderId(orderId);
return StoreOrderOneConvert.INSTANCE.convert(storeOrder); List<StoreOrderInfo> list = storeOrderInfoService.list(Wrappers.<StoreOrderInfo>lambdaQuery().eq(StoreOrderInfo::getOrderId, storeOrder.getId()));
StoreOrderDetailInfoResponse convert = StoreOrderOneConvert.INSTANCE.convert(storeOrder);
if (!CollectionUtils.isEmpty(list)) {
List<OrderInfoResponse> orderInfoList = new ArrayList<>();
list.forEach(e -> {
OrderInfoResponse response = new OrderInfoResponse();
BeanUtils.copyProperties(e, response);
orderInfoList.add(response);
});
convert.setOrderInfoList(orderInfoList);
}
return convert;
} }
/** /**
* *
*
* @param dateLimit * @param dateLimit
* @param status String * @param status String
* @return Integer * @return Integer
@ -192,6 +222,7 @@ public class OrderServiceImpl implements OrderService {
/** /**
* *
*
* @param dateLimit * @param dateLimit
* @param type * @param type
* @return BigDecimal * @return BigDecimal
@ -217,6 +248,7 @@ public class OrderServiceImpl implements OrderService {
/** /**
* where * where
*
* @param queryWrapper QueryWrapper<StoreOrder> * @param queryWrapper QueryWrapper<StoreOrder>
* @param status String * @param status String
*/ */
@ -330,6 +362,7 @@ public class OrderServiceImpl implements OrderService {
/** /**
* *
*
* @param orderNo * @param orderNo
* @return 退 * @return 退
*/ */
@ -342,6 +375,7 @@ public class OrderServiceImpl implements OrderService {
} }
return storeOrder; return storeOrder;
} }
/** /**
* *
* *
@ -779,6 +813,7 @@ public class OrderServiceImpl implements OrderService {
/** /**
* *
*
* @param request * @param request
* @return OrderInfoVo * @return OrderInfoVo
*/ */
@ -866,6 +901,7 @@ public class OrderServiceImpl implements OrderService {
/** /**
* *
*
* @param detailRequest * @param detailRequest
* @return List<OrderInfoDetailVo> * @return List<OrderInfoDetailVo>
*/ */
@ -935,6 +971,7 @@ public class OrderServiceImpl implements OrderService {
/** /**
* *
*
* @param request * @param request
* @param user * @param user
* @return List<OrderInfoDetailVo> * @return List<OrderInfoDetailVo>
@ -991,6 +1028,7 @@ public class OrderServiceImpl implements OrderService {
}); });
return detailVoList; return detailVoList;
} }
/** /**
* *
* *
@ -1031,6 +1069,7 @@ public class OrderServiceImpl implements OrderService {
/** /**
* *
*
* @param request * @param request
* @return ComputedOrderPriceResponse * @return ComputedOrderPriceResponse
*/ */
@ -1346,6 +1385,7 @@ public class OrderServiceImpl implements OrderService {
/** /**
* *
*
* @param orderInfoVo Vo * @param orderInfoVo Vo
* @return List<MyRecord> * @return List<MyRecord>
* skuRecord * skuRecord
@ -1392,6 +1432,7 @@ public class OrderServiceImpl implements OrderService {
} }
return recordList; return recordList;
} }
/** /**
* *
* *