|
|
@@ -38,6 +38,8 @@ import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
import javax.validation.constraints.Min;
|
|
|
+import java.math.BigDecimal;
|
|
|
+import java.math.RoundingMode;
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
|
import java.util.Optional;
|
|
|
@@ -536,4 +538,13 @@ public class CouponController {
|
|
|
.build());
|
|
|
return GatewayResponse.SUCCESS.newBuilder().toResult(search);
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 使用优惠券订单金额
|
|
|
+ */
|
|
|
+ @GetMapping("/get/used/money/{couponId}")
|
|
|
+ public Result<BigDecimal> getUsedMoney(@PathVariable Long couponId) {
|
|
|
+ BigDecimal money = Optional.ofNullable(orderDonMapper.getCouponUsedMoney(couponId)).orElse(BigDecimal.ZERO);
|
|
|
+ return GatewayResponse.SUCCESS.newBuilder().toResult(money.divide(BigDecimal.valueOf(100), 2, RoundingMode.DOWN));
|
|
|
+ }
|
|
|
}
|