Commit 98ac325c by chongli

买券活动携程支付下单和回调

parent 0374a006
/**
* Copyright 2014 CTRIP Co.,Ltd. All rights reserved.
*/
package com.ctrip.fun.golf.api.order;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import com.ctrip.fun.common.vo.order.CommuneOrderBean;
import com.ctrip.fun.common.vo.order.CommuneOrderListItemBean;
import com.ctrip.fun.common.vo.order.CommuneOrderResourceBean;
import com.ctrip.fun.golf.service.order.AbstractOrderService;
import com.ctrip.fun.golf.service.order.BuyVoucherOrderService;
/**
* @content
* @author csleng
* @date
*/
@Controller
@RequestMapping(value = "/buyVoucherOrder")
public class BuyVoucherOrderController extends AbstractOrderController<CommuneOrderBean, CommuneOrderResourceBean, CommuneOrderListItemBean> {
@Autowired
private BuyVoucherOrderService buyVoucherOrderService;
@Override
protected AbstractOrderService<CommuneOrderBean, CommuneOrderResourceBean> getOrderService() {
return buyVoucherOrderService;
}
}
/**
* Copyright 2014 CTRIP Co.,Ltd. All rights reserved.
*/
package com.ctrip.fun.golf.api.payment;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import com.ctrip.fun.golf.service.payment.AbstractNotifyService;
import com.ctrip.fun.golf.service.payment.BuyVoucherNotifyService;
/**
* @author zgsong
* @version 1.0.0
*/
@Controller
@RequestMapping(value = "/buyVoucherOrder")
public class BuyVoucherOrderNotifyController extends AbstractNotifyController {
@Autowired
private BuyVoucherNotifyService buyVoucherNotifyService = null;
@Override
protected AbstractNotifyService getNotifyService() {
return buyVoucherNotifyService;
}
}
/**
* Copyright 2014 CTRIP Co.,Ltd. All rights reserved.
*/
package com.ctrip.fun.golf.service.payment;
import org.springframework.beans.factory.annotation.Autowired;
import com.ctrip.fun.golf.dao.market.CommuneInviteActivityDao;
import com.ctrip.fun.golf.dao.order.CommuneOrderItemDao;
import com.ctrip.fun.golf.dao.product.BuyVoucherActivityDao;
import com.ctrip.fun.golf.domain.order.CommuneOrderItem;
import com.ctrip.fun.golf.domain.order.Order;
import com.ctrip.fun.golf.domain.product.BuyVoucherActivity;
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.service.order.CommuneOrderService;
public class BuyVoucherNotifyService extends AbstractNotifyService {
private CommuneOrderService communeOrderService = null;
private OperationMessageService operationMessageService;
private CommuneInviteActivityDao communeInviteActivityDao = null;
private CommuneOrderItemDao communeOrderItemDao = null;
private CommuneInviteActivityService communeInviteActivityService = null;
@Autowired
private VoucherService voucherService = null;
@Autowired
private BuyVoucherActivityDao buyVoucherActivityDao = null;
@Override
protected void doPaySuccess(Order order) {
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());
}
@Override
protected void doPayFail(Order order) {
}
@Override
protected void sendMessage(Order order, int messageId) {
operationMessageService.executeSendMessageOfVipCommune(order, messageId);
}
@Override
protected void doSuccessRefund(Order order) {
// TODO Auto-generated method stub
}
@Override
protected void doFailRefund(Order order) {
// TODO Auto-generated method stub
}
/**
* @param order
* @see com.ctrip.fun.golf.service.payment.AbstractNotifyService#failToSuccess(com.ctrip.fun.golf.domain.order.Order)
*/
@Override
protected void failToSuccess(Order order) {
// TODO Auto-generated method stub
}
public CommuneOrderService getCommuneOrderService() {
return communeOrderService;
}
public void setCommuneOrderService(CommuneOrderService communeOrderService) {
this.communeOrderService = communeOrderService;
}
public OperationMessageService getOperationMessageService() {
return operationMessageService;
}
public void setOperationMessageService(OperationMessageService operationMessageService) {
this.operationMessageService = operationMessageService;
}
public CommuneInviteActivityDao getCommuneInviteActivityDao() {
return communeInviteActivityDao;
}
public void setCommuneInviteActivityDao(CommuneInviteActivityDao communeInviteActivityDao) {
this.communeInviteActivityDao = communeInviteActivityDao;
}
public CommuneOrderItemDao getCommuneOrderItemDao() {
return communeOrderItemDao;
}
public void setCommuneOrderItemDao(CommuneOrderItemDao communeOrderItemDao) {
this.communeOrderItemDao = communeOrderItemDao;
}
public CommuneInviteActivityService getCommuneInviteActivityService() {
return communeInviteActivityService;
}
public void setCommuneInviteActivityService(CommuneInviteActivityService communeInviteActivityService) {
this.communeInviteActivityService = communeInviteActivityService;
}
}
......@@ -7,6 +7,7 @@ payment.merchantId=3000003
payment.courseBaseNotifyUrl=http://112.65.124.86:18081/fun-common-soa/notify/courseOrder
payment.tourBaseNotifyUrl=http://112.65.124.86:18081/fun-common-soa/notify/tourOrder
payment.rechargeBaseNotifyUrl=http://112.65.124.86:18081/fun-common-soa/notify/rechargeOrder
payment.buyVoucherBaseNotifyUrl=http://112.65.124.86:18081/fun-common-soa/notify/buyVoucherOrder
payment.communeBaseNotifyUrl=http://112.65.124.86:18081/fun-common-soa/notify/communeOrder
payment.communeBaseNotifyUrlForMiniApp=http://112.65.124.86:18081/fun-common-soa/notify/notifyForMiniApp
payment.voucherNotifyUrlForMiniApp=http://112.65.124.86:18081/fun-common-soa/notify/notifyForVoucherMiniApp
......
......@@ -7,6 +7,7 @@ payment.merchantId=3000003
payment.courseBaseNotifyUrl=http://112.65.124.86:18081/fun-common-soa/notify/courseOrder
payment.tourBaseNotifyUrl=http://112.65.124.86:18081/fun-common-soa/notify/tourOrder
payment.rechargeBaseNotifyUrl=http://112.65.124.86:18081/fun-common-soa/notify/rechargeOrder
payment.buyVoucherBaseNotifyUrl=http://112.65.124.86:18081/fun-common-soa/notify/buyVoucherOrder
payment.communeBaseNotifyUrl=http://112.65.124.86:18081/fun-common-soa/notify/communeOrder
payment.communeBaseNotifyUrlForMiniApp=http://112.65.124.86:18081/fun-common-soa/notify/notifyForMiniApp
payment.voucherNotifyUrlForMiniApp=http://112.65.124.86:18081/fun-common-soa/notify/notifyForVoucherMiniApp
......
......@@ -205,6 +205,15 @@
<property name="COMMUNE_AMOUNT2" value="${communeAmount2}"></property>
</bean>
<bean name="buyVoucherOrderService" class="com.ctrip.fun.golf.service.order.BuyVoucherOrderService" parent="abstractOrderService">
<property name="communeOrderItemDao" ref="communeOrderItemDao"></property>
<property name="operationMessageService" ref="operationMessageService"></property>
<property name="communeInviteActivityService" ref="communeInviteActivityService"></property>
<property name="jobUtil" ref="jobUtil"></property>
<property name="overTimeMinute" value="${payment.longOvertime}"></property>
<property name="buyVoucherBaseNotifyUrl" value="${payment.buyVoucherBaseNotifyUrl}"></property>
</bean>
<bean name="vipmemberOrderService" class="com.ctrip.fun.golf.service.order.VipMemberOrderService" parent="abstractOrderService">
<property name="vipmemberOrderItemDao" ref="vipmemberOrderItemDao"></property>
<property name="clientConfigDao" ref="clientConfigDao"></property>
......
......@@ -9,6 +9,7 @@ payment.merchantId=3000004
payment.courseBaseNotifyUrl=http\://api.iwanoutdoor.com/fun-common-soa/notify/courseOrder
payment.tourBaseNotifyUrl=http\://api.iwanoutdoor.com/fun-common-soa/notify/tourOrder
payment.rechargeBaseNotifyUrl=http\://api.iwanoutdoor.com/fun-common-soa/notify/rechargeOrder
payment.buyVoucherBaseNotifyUrl=http\://api.iwanoutdoor.com/fun-common-soa/notify/buyVoucherOrder
payment.communeBaseNotifyUrl=http\://api.iwanoutdoor.com/fun-common-soa/notify/communeOrder
payment.communeBaseNotifyUrlForMiniApp=http\://api.iwanoutdoor.com/fun-common-soa/notify/notifyForMiniApp
payment.voucherNotifyUrlForMiniApp=http\://api.iwanoutdoor.com/fun-common-soa/notify/notifyForVoucherMiniApp
......
......@@ -7,6 +7,7 @@ payment.merchantId=3000003
payment.courseBaseNotifyUrl=http://112.65.124.86:18081/fun-common-soa/notify/courseOrder
payment.tourBaseNotifyUrl=http://112.65.124.86:18081/fun-common-soa/notify/tourOrder
payment.rechargeBaseNotifyUrl=http://112.65.124.86:18081/fun-common-soa/notify/rechargeOrder
payment.buyVoucherBaseNotifyUrl=http://112.65.124.86:18081/fun-common-soa/notify/buyVoucherOrder
payment.communeBaseNotifyUrl=http://112.65.124.86:18081/fun-common-soa/notify/communeOrder
payment.communeBaseNotifyUrlForMiniApp=http://112.65.124.86:18081/fun-common-soa/notify/notifyForMiniApp
payment.voucherNotifyUrlForMiniApp=http://112.65.124.86:18081/fun-common-soa/notify/notifyForVoucherMiniApp
......
......@@ -7,6 +7,7 @@ payment.merchantId=3000003
payment.courseBaseNotifyUrl=http://10.8.55.46:8080/fun-common-soa/notify/courseOrder
payment.tourBaseNotifyUrl=http://10.8.55.46:8080/fun-common-soa/notify/tourOrder
payment.rechargeBaseNotifyUrl=http://10.8.55.46:8080/fun-common-soa/notify/rechargeOrder
payment.buyVoucherBaseNotifyUrl=http://112.65.124.86:18081/fun-common-soa/notify/buyVoucherOrder
payment.communeBaseNotifyUrl=http://10.8.55.46:8080/fun-common-soa/notify/communeOrder
payment.communeBaseNotifyUrlForMiniApp=http://10.8.55.46:8080/fun-common-soa/notify/notifyForMiniApp
payment.voucherNotifyUrlForMiniApp=http://10.8.55.46:8080/fun-common-soa/notify/notifyForVoucherMiniApp
......
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