Commit 97133da7 by huluobin

Merge branch 'master' into branch

# Conflicts:
#	src/main/java/com/gogirl/application/order/serve/impl/PayServiceImpl.java
#	src/main/java/com/gogirl/interfaces/market/coupon/CouponController.java
parents ba15d5e5 f535c970
......@@ -147,6 +147,11 @@ public class PayServiceImpl implements PayService {
//2、余额检查
CustomerBalance customerBalance = customerBalanceMapper.selectOne(new LambdaQueryWrapper<CustomerBalance>().eq(CustomerBalance::getCustomerId, orderManage.getOrderUser()));
if (customerBalance == null) {
throw new RRException("余额不存在");
}
if (orderManage.getTotalPaymentAmount().multiply(new BigDecimal(100)).intValue() < customerBalance.getBalance()) {
throw new RRException("请使用余额支付");
}
......
......@@ -41,8 +41,6 @@ public class BaseServeServiceImpl extends ServiceImpl<BaseServeMapper, BaseServe
if (leisureDiscountConfig != null)
baseServe.setDiscountRate(leisureDiscountConfig.getDiscountRate());
}
// producePromotionTimeMapper.select
return baseServe;
}
}
......@@ -122,7 +122,7 @@ public class CustomerServiceImpl extends ServiceImpl<CustomerMapper, Customer> i
.token(token)
.build();
String openid = gogirlToken.getOpenid();
final String openid = gogirlToken.getOpenid();
try {
lock.lock(openid.hashCode() & Integer.MAX_VALUE);
......
......@@ -4,6 +4,7 @@ import com.gogirl.application.market.coupon.CouponService;
import com.gogirl.application.xcx.GogirlTokenService;
import com.gogirl.domain.market.coupon.Coupon;
import com.gogirl.infrastructure.common.base.JsonResult;
import com.gogirl.infrastructure.common.exception.RRException;
import com.gogirl.infrastructure.util.SessionUtils;
import com.gogirl.infrastructure.util.lock.CustomerIdLock;
import io.swagger.annotations.Api;
......@@ -58,6 +59,11 @@ public class CouponController {
public JsonResult<Coupon> sendCouponXcx(@RequestHeader String token,
@RequestParam Integer couponId) {
Integer customerId = SessionUtils.getCustomerId();
if (couponId == null) {
throw new RRException("卡券不存在");
}
log.info("发放优惠券customerId:" + customerId.toString());
log.info("发放优惠券couponId:" + couponId.toString());
//返回消息
Coupon coupon = couponService.sendCoupon(couponId, customerId);
......
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