Commit a88b6d8e by chongli

app买券考虑余额支付情况和修复支付回调问题

parent 4451737a
......@@ -11,6 +11,7 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.CollectionUtils;
import com.ctrip.fun.common.core.util.BeanConverter;
import com.ctrip.fun.common.core.util.DateUtil;
import com.ctrip.fun.common.core.util.StringUtils;
......@@ -40,6 +41,7 @@ import com.ctrip.fun.golf.domain.product.BuyVoucherActivity;
import com.ctrip.fun.golf.domain.user.UserExt;
import com.ctrip.fun.golf.exceptions.OrderException;
import com.ctrip.fun.golf.service.basic.OperationMessageService;
import com.ctrip.fun.golf.service.basic.VoucherService;
import com.ctrip.fun.golf.service.market.CommuneInviteActivityService;
import com.ctrip.fun.golf.utils.JobUtil;
import com.ctrip.fun.golf.vo.PagedEntityBean;
......@@ -70,6 +72,8 @@ public class BuyVoucherOrderService extends AbstractOrderService<CommuneOrderBea
@Autowired
private BuyVoucherActivityDao buyVoucherActivityDao;
@Autowired
private VoucherService voucherService = null;
......@@ -224,20 +228,12 @@ public class BuyVoucherOrderService extends AbstractOrderService<CommuneOrderBea
if (ProductPaymentTypeEnum.PREPAY.getName().equalsIgnoreCase(order.getPayMode().toLowerCase())) {
// 不走支付时,则直接成为公社会员
if (order.getPrePayAmount().compareTo(order.getPrePayCardAmount()) <= 0) {
if(getCommuneYears(order.getOrderId()) <= 0){
getUserExtDao().setUserExtVipGradeCommune(order.getUid());
operationMessageService.executeSendMessageOfVipCommune(order, 91);
communeInviteActivityService.updateCommuneInviteActivityData(order.getOrderId());
}else{
try {
this.getVoucherService().sendVoucherFor360PlaceOrder(order.getUid(), order.getOrderId()+"");
} catch (Exception e) {
e.printStackTrace();
}
getUserExtDao().setUserExtVipGradeRenewCommune(order.getUid());
operationMessageService.executeSendMessageOfVipCommune(order, 110);
}
CommuneOrderItem communeOrderItem = communeOrderItemDao.getByOrderId(order.getOrderId()).get(0);
BuyVoucherActivity buyVoucherActivity = buyVoucherActivityDao.findById(communeOrderItem.getActivityId());
//执行发券
String uid = order.getUid();//下单人id
voucherService.sendVoucherForPlaceOrderByConfig(uid, order.getOrderId()+"", true, buyVoucherActivity.getVoucherConfig());
}
}
startCancelOrderJob(order);
......
......@@ -114,6 +114,8 @@
<property name="orderDao" ref="orderDao"></property>
<property name="paymentService" ref="paymentService"></property>
<property name="paymentResponseDao" ref="paymentResponseDao"></property>
<property name="privateKey" value="${payment.privateKey}"></property>
<property name="publicKey" value="${payment.publicKey}"></property>
<property name="userExtDao" ref="userExtDao"></property>
<property name="userService" ref="userService"></property>
<property name="voucherService" ref="voucherService"></property>
......
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 sign in to comment