Commit 83cc15d3 by huluobin

update

parent e25b6a15
......@@ -78,14 +78,14 @@ public class CouponCustomerRelevanceServiceImpl extends ServiceImpl<CouponCustom
List<Integer> freeCouponIds = discountConfigMapper.selectList(new LambdaQueryWrapper<>()).stream().map(DiscountConfig::getCouponId).filter(Objects::nonNull).collect(Collectors.toList());
if (freeCouponIds.contains(couponCustomerRelevance.getCouponId())) {
canUserServeIds.retainAll(orderServeList.stream()
.filter(orderServe -> orderServe.getBindCoupon() == 2)
.filter(orderServe -> orderServe.getBindOuterCoupon() == 2)
.filter(orderServe -> orderServe.getBindTimesCard() == 2)
.map(OrderServe::getServeId)
.collect(Collectors.toList()));
} else {
canUserServeIds.retainAll(orderServeList.stream()
.filter(orderServe -> {
return orderServe.getBindCoupon() == 2;
})
.filter(orderServe -> orderServe.getBindOuterCoupon() == 2)
.filter(orderServe -> orderServe.getBindTimesCard() == 2)
//不是活动价格
.filter(orderServe -> !orderServe.isActivity())
.map(OrderServe::getServeId)
......
......@@ -224,7 +224,7 @@ public class CouponServiceImpl extends ServiceImpl<CouponMapper, Coupon> impleme
.peek(coupon -> {
List<Integer> canUserServeIds = couponCustomerRelevanceMapper.queryCouponCustomerServeRelevance(coupon.getId());
canUserServeIds.retainAll(orderServeList.stream()
.filter(orderServe -> orderServe.getBindCoupon() == 2)
.filter(orderServe -> orderServe.getBindInnerCoupon() == 2)
.filter(orderServe -> !orderServe.isActivity())
.map(OrderServe::getServeId)
.collect(Collectors.toList()));
......
......@@ -290,7 +290,7 @@ public class MarketServiceImpl implements MarketService {
OrderManage orderManage = orderManageMapper.selectById(orderId);
List<OrderServe> orderServeList = orderServeMapper.selectList(new LambdaQueryWrapper<OrderServe>().eq(OrderServe::getOrderId, orderId));
orderManage.setListOrderServer(orderServeList);
orderServeList.forEach(orderServe -> orderServe.setBindCoupon(2));
// orderServeList.forEach(orderServe -> orderServe.setBindCoupon(2));
//1.改价结算
//总支付金额等于 总价格+总改价
......@@ -368,7 +368,7 @@ public class MarketServiceImpl implements MarketService {
timesCardOrderServeDetailMapper.insert(timesCardOrderServeDetail);
//订单折扣金额更新
orderServe.setBindCoupon(1);
orderServe.setBindTimesCard(1);
orderServe.addDiscountPrice(actualDiscountAmount);
orderManage.addDiscountPrice(actualDiscountAmount);
// 在从服务上折扣的钱
......@@ -465,7 +465,7 @@ public class MarketServiceImpl implements MarketService {
}
orderServe.addDiscountPrice(actualDiscountAmount);
orderManage.addDiscountPrice(actualDiscountAmount);
orderServe.setBindCoupon(1);
orderServe.setBindOuterCoupon(1);
couponOrderRelevanceService.save(couponOrderRelevance);
//在从服务上折扣的钱
// BigDecimal leftServeDiscountAmount = couponCustomerRelevance.getDiscountAmount().subtract(actualDiscountAmount);
......@@ -579,7 +579,7 @@ public class MarketServiceImpl implements MarketService {
orderServe.addDiscountPrice(actualDiscountAmount);
orderManage.addDiscountPrice(actualDiscountAmount);
orderServe.setBindCoupon(1);
orderServe.setBindInnerCoupon(1);
discountCalc = discountCalc.add(discountAmount);
payCalc = payCalc.add(payAmount);
}
......@@ -611,7 +611,9 @@ public class MarketServiceImpl implements MarketService {
"加种睫毛", "加彩色睫毛", "下睫毛");
OrderServe maxOrderServe = orderManage.getListOrderServer()
.stream()
.filter(orderServe -> orderServe.getBindCoupon() == 2)
.filter(orderServe -> orderServe.getBindInnerCoupon() == 2)
.filter(orderServe -> orderServe.getBindTimesCard() == 2)
.filter(orderServe -> orderServe.getBindOuterCoupon() == 2)
.filter(orderServe -> serveIds.contains(orderServe.getServeId()))
.max(Comparator.comparing(OrderServe::getPayPrice))
.orElse(null);
......@@ -642,8 +644,9 @@ public class MarketServiceImpl implements MarketService {
}
return true;
})
.filter(orderServe -> orderServe.getBindCoupon() == 2)
.filter(Objects::nonNull)
.filter(orderServe -> orderServe.getBindTimesCard() == 2)
.filter(orderServe -> orderServe.getBindTimesCard() == 2)
.filter(orderServe -> orderServe.getBindOuterCoupon() == 2)
.collect(Collectors.toList());
}
......@@ -672,7 +675,9 @@ public class MarketServiceImpl implements MarketService {
}
return true;
})
.filter(orderServe -> orderServe.getBindCoupon() == 2)
.filter(orderServe -> orderServe.getBindInnerCoupon() == 2)
.filter(orderServe -> orderServe.getBindOuterCoupon() == 2)
.filter(orderServe -> orderServe.getBindTimesCard() == 2)
.max(Comparator.comparing(OrderServe::getPayPrice))
.orElse(null);
}
......
......@@ -196,8 +196,12 @@ public class OrderServe implements Serializable {
@TableField(strategy = FieldStrategy.IGNORED)
private Integer serveDuration;
@ApiModelProperty("是否已经被卡券或者次卡折扣过 1-已经绑定了次卡或者优惠券 2-未绑定")
private Integer bindCoupon = 2;
// @ApiModelProperty("是否已经被卡券或者次卡折扣过 1-已经绑定了次卡或者优惠券 2-未绑定")
// private Integer bindCoupon = 2;
private Integer bindInnerCoupon;
private Integer bindOuterCoupon;
private Integer bindTimesCard;
@TableField(strategy = FieldStrategy.IGNORED)
private BigDecimal promotionPrice;
......
package com.gogirl.infrastructure.interceptor;
import com.gogirl.application.user.customer.CustomerService;
import com.gogirl.application.xcx.GogirlTokenService;
import com.gogirl.domain.store.store.StoreManage;
import com.gogirl.domain.user.customer.Customer;
import com.gogirl.domain.xcx.GogirlToken;
import com.gogirl.infrastructure.common.exception.RRException;
import com.gogirl.infrastructure.common.util.ListUtil;
import com.gogirl.infrastructure.common.util.StringUtils;
import com.gogirl.infrastructure.mapper.store.store.StoreManageMapper;
import com.gogirl.infrastructure.mapper.store.store.StoreTechnicianMapper;
import com.gogirl.infrastructure.mapper.user.customer.CustomerMapper;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
......@@ -24,6 +25,7 @@ public class LoginHandlerInterceptor implements HandlerInterceptor {
private final GogirlTokenService gogirlTokenService;
private final StoreManageMapper storeManageMapper;
private final CustomerMapper customerMapper;
@Override
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
......@@ -42,6 +44,11 @@ public class LoginHandlerInterceptor implements HandlerInterceptor {
GogirlToken gogirlToken = gogirlTokenService.getByToken(token);
if (gogirlToken == null) {
throw new RRException(2000, "token失效,请重新登陆");
} else {
Customer customer = customerMapper.selectById(gogirlToken.getCustomerId());
if (customer != null && StringUtils.isEmpty(customer.getPhone())) {
throw new RRException(1001, "请授权手机号码");
}
}
}
if (sourceFrom.equals("technician")) {
......
......@@ -182,7 +182,8 @@ public class TimesCardController {
List<Integer> canUserServeIds = timesCardCustomerRelevanceMapper.queryTimesCardServeIds(timesCardCustomerRelevance.getCardTypeId());
canUserServeIds.retainAll(orderServeList.stream()
.filter(orderServe -> orderServe.getBindCoupon() == 2)
.filter(orderServe -> orderServe.getBindOuterCoupon() == 2)
.filter(orderServe -> orderServe.getBindInnerCoupon() == 2)
.filter(orderServe -> !orderServe.isActivity())
.map(OrderServe::getServeId)
.collect(Collectors.toList()));
......
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