Commit f3a86057 by 吕明尚

计算订单增加可用时长,余额

parent fad204be
......@@ -42,6 +42,9 @@ public class ComputedOrderPriceResponse implements Serializable {
@ApiModelProperty(value = "折扣比例")
private BigDecimal discountRatio;
@ApiModelProperty(value = "可用时长")
private BigDecimal availableDuration;
//使用时长
@ApiModelProperty(value = "使用时长")
private BigDecimal duration;
......@@ -50,6 +53,9 @@ public class ComputedOrderPriceResponse implements Serializable {
@ApiModelProperty(value = "剩余时长")
private BigDecimal remainingDuration;
@ApiModelProperty(value = "可用余额")
private BigDecimal availableBalance;
//使用余额
@ApiModelProperty(value = "使用余额")
private BigDecimal balance;
......
......@@ -1005,7 +1005,7 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
List<String> phones = new ArrayList<>();
SConsumerVo sConsumer = new SConsumerVo();
sConsumer.setStoreId(sStore.getId());
sConsumer.setPosition(3);
sConsumer.setPosition(PositionEnum.CUSTOMER_SERVICE.getCode());
List<SConsumer> consumers = sConsumerService.selectAllocatedList(sConsumer);
if (consumers.size() > 0) {
//获取用户id
......@@ -1920,7 +1920,7 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
List<String> phones = new ArrayList<>();
SConsumerVo sConsumer = new SConsumerVo();
sConsumer.setStoreId(sStore.getId());
sConsumer.setPosition(3);
sConsumer.setPosition(PositionEnum.CUSTOMER_SERVICE.getCode());
List<SConsumer> consumers = sConsumerService.selectAllocatedList(sConsumer);
if (consumers.size() > 0) {
List<Long> sconsumerIds = consumers.stream().map(SConsumer::getId).collect(Collectors.toList());
......@@ -2302,8 +2302,10 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
ComputedOrderPriceResponse priceResponse = new ComputedOrderPriceResponse();
priceResponse.setBalance(BigDecimal.ZERO);
priceResponse.setRemainingBalance(BigDecimal.ZERO);
priceResponse.setAvailableBalance(BigDecimal.ZERO);
priceResponse.setDuration(BigDecimal.ZERO);
priceResponse.setRemainingDuration(BigDecimal.ZERO);
priceResponse.setAvailableDuration(BigDecimal.ZERO);
priceResponse.setDiscount(BigDecimal.ZERO);
Activity activity = null;
ConsumerMember consumerMember = null;
......@@ -2316,6 +2318,10 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
queryWrapper.eq(Activity::getIsOpen, YesNoEnum.yes.getIndex());
queryWrapper.eq(Activity::getMemberType, consumerMember.getMemberType());
}
if (ObjectUtil.isNotEmpty(consumerWallet)) {
priceResponse.setAvailableBalance(consumerWallet.getBalance());
priceResponse.setAvailableDuration(consumerWallet.getRemainingDuration());
}
}
SRoom room = roomService.getById(request.getRoomId());
BigDecimal totalPrice = computeTotalPrice(room.getPrice(), request.getPreStartDate(), request.getPreEndDate());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment