|
@@ -234,26 +234,25 @@ public class OrderHandler {
|
|
|
|
|
|
List<CouponItemDto> couponItemDtoList = new ArrayList<>();
|
|
|
for (CouponItemDto cid : list){
|
|
|
+
|
|
|
+ if(total < cid.getCouponConsumeEnough()){
|
|
|
+ break;
|
|
|
+ }
|
|
|
+
|
|
|
if(3 == cid.getCouponType()){
|
|
|
|
|
|
Exchange exchange = new Exchange();
|
|
|
exchange.setCouponId(cid.getCouponId());
|
|
|
List<Exchange> exchangeList = exchangeService.getExchangeList(exchange);
|
|
|
for (Exchange ex : exchangeList){
|
|
|
- boolean fl = false;
|
|
|
-
|
|
|
+ boolean fl = false;
|
|
|
for (CartDto cartDto : cartDtos) {
|
|
|
Integer noColor = 0;
|
|
|
for (ExchangeItem exchangeItem : ex.getExchangeItemList()){
|
|
|
if(cartDto.getCartColorId().equals(exchangeItem.getColorId())){
|
|
|
fl = true;
|
|
|
- }else{
|
|
|
- noColor++;
|
|
|
}
|
|
|
}
|
|
|
- if(noColor == ex.getExchangeItemList().size()){
|
|
|
-
|
|
|
- }
|
|
|
}
|
|
|
if(fl){
|
|
|
couponItemDtoList.add(cid);
|
|
@@ -297,7 +296,7 @@ public class OrderHandler {
|
|
|
|
|
|
|
|
|
* 发起支付请求
|
|
|
- * @param dto 支付参数, 根据情况调整方法是否进行synchronized<br>在生成订单时不会存在安全问题
|
|
|
+ * @param request 支付参数, 根据情况调整方法是否进行synchronized<br>在生成订单时不会存在安全问题
|
|
|
* @return
|
|
|
* @throws Exception
|
|
|
*/
|
|
@@ -503,8 +502,13 @@ public class OrderHandler {
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
+ if(!fl){
|
|
|
+ msg.setMessage(ResultInfo.COUPON_NO_MEET_DEMAND);
|
|
|
+ return msg;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
+
|
|
|
|
|
|
if(couponType.getCouponType()==1){
|
|
|
total=total-couponType.getCouponReduce();
|