...
|
...
|
@@ -20,122 +20,86 @@ import com.yoho.service.model.activity.drawline.response.DrawOrderShareCouponRes |
|
|
/**
|
|
|
*
|
|
|
* 分享优惠券
|
|
|
*
|
|
|
* @author gemingdan
|
|
|
*
|
|
|
*/
|
|
|
@Controller
|
|
|
@RequestMapping("/OrderShareController")
|
|
|
public class OrderShareController {
|
|
|
|
|
|
|
|
|
private static Logger logger = LoggerFactory.getLogger(OrderShareController.class);
|
|
|
|
|
|
|
|
|
@Resource
|
|
|
IOrderShareActivityService orderShareActivityService;
|
|
|
|
|
|
|
|
|
@Resource
|
|
|
IUserShareHistoryService userShareHistoryService;
|
|
|
|
|
|
|
|
|
/**
|
|
|
* 根据活动编号,查询活动详细信息(包括,所有可配置信息)
|
|
|
*
|
|
|
* @return
|
|
|
*/
|
|
|
@RequestMapping(params="methods=getActivityInfo")
|
|
|
@RequestMapping(params = "methods=app.activity.getActivityInfo")
|
|
|
@ResponseBody
|
|
|
public ApiResponse getActivityInfo(int id){
|
|
|
logger.info("getActivityInfo param id={}",id);
|
|
|
OrderShareActivityBO data = orderShareActivityService.getActivityInfoById(id);
|
|
|
public ApiResponse getActivityInfo() {
|
|
|
logger.info("getActivityInfo");
|
|
|
OrderShareActivityBO data = orderShareActivityService.getActivityInfoById();
|
|
|
return new ApiResponse(data);
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
* 查询该订单是否可以分享
|
|
|
*
|
|
|
* @param orderno
|
|
|
* @param uid
|
|
|
* @return flag=1可以分享,flag=2表示不存在分享活动, flag=3表示分享活动已结束, flag=4表示分享活动未开始, flag=5表示用户当天已达到分享最大数
|
|
|
*/
|
|
|
@RequestMapping("/getInfoOfOrderShare")
|
|
|
@ResponseBody
|
|
|
public ApiResponse getInfoOfOrderShare(UserShareHistoryVO request){
|
|
|
logger.info("getActivityInfo param request={}",request);
|
|
|
OrderShareBO data =orderShareActivityService.getShareInfo(request.getOrdercode(), request.getUid());
|
|
|
return new ApiResponse(data);
|
|
|
}
|
|
|
|
|
|
|
|
|
/**
|
|
|
* 生成该用户的分享
|
|
|
* @return
|
|
|
*/
|
|
|
@RequestMapping(params="methods=createShareUrl")
|
|
|
@ResponseBody
|
|
|
public ApiResponse createShareUrl(Object request){
|
|
|
logger.info("createShareUrl param request={}",request);
|
|
|
String data=null;
|
|
|
return new ApiResponse(data);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 查询该链接领取优惠券的次数
|
|
|
* @return
|
|
|
* @return flag=1可以分享,flag=2表示不存在分享活动, flag=3表示分享活动已结束, flag=4表示分享活动未开始,
|
|
|
* flag=5表示用户当天已达到分享最大数
|
|
|
*/
|
|
|
@RequestMapping(params="methods=getReceivedNum")
|
|
|
@RequestMapping(params = "method=app.activity.getInfoOfOrderShare")
|
|
|
@ResponseBody
|
|
|
public ApiResponse getReceivedNum(int id){
|
|
|
logger.info("getReceivedNum param id={}",id);
|
|
|
int data=0;
|
|
|
public ApiResponse getInfoOfOrderShare(UserShareHistoryVO request) {
|
|
|
logger.info("getActivityInfo param request={}", request);
|
|
|
OrderShareBO data = orderShareActivityService.getShareInfo(request.getOrdercode(), request.getUid());
|
|
|
return new ApiResponse(data);
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
* 查询该活动是否过期
|
|
|
* 订单分享活动领券
|
|
|
*
|
|
|
* @param mobile
|
|
|
* @param activityId
|
|
|
* @param orderCode
|
|
|
* @return
|
|
|
*/
|
|
|
@RequestMapping(params="methods=getStatus")
|
|
|
@RequestMapping(params = "method=app.order.drawOrderShareCoupon")
|
|
|
@ResponseBody
|
|
|
public ApiResponse getStatus(int id){
|
|
|
logger.info("getStatus param id={}",id);
|
|
|
Object data=null;
|
|
|
return new ApiResponse(data);
|
|
|
public ApiResponse drawOrderShareCoupon(@RequestParam(value = "mobile", required = true) String mobile, @RequestParam(value = "activityId", required = true) int activityId, @RequestParam(value = "orderCode", required = true) long orderCode) {
|
|
|
|
|
|
logger.info("drawOrderShareCoupon enter, mobile: {}, activityId: {}, orderCode: {}", mobile, activityId, orderCode);
|
|
|
|
|
|
DrawOrderShareCouponRespBO respBO = orderShareActivityService.drawOrderShareCoupon(mobile, activityId, orderCode);
|
|
|
|
|
|
return new ApiResponse.ApiResponseBuilder().code(200).data(respBO).message("ok").build();
|
|
|
}
|
|
|
|
|
|
|
|
|
/**
|
|
|
* 订单分享活动领券
|
|
|
* 新用户注册(带验证码)并领券
|
|
|
*
|
|
|
* @param mobile
|
|
|
* @param activityId
|
|
|
* @param orderCode
|
|
|
* @param identifyCode
|
|
|
* @return
|
|
|
*/
|
|
|
@RequestMapping(params = "method=app.order.drawOrderShareCoupon")
|
|
|
@ResponseBody
|
|
|
public ApiResponse drawOrderShareCoupon(@RequestParam(value = "mobile", required = true) String mobile,
|
|
|
@RequestParam(value = "activityId", required = true) int activityId,
|
|
|
@RequestParam(value = "orderCode", required = true) long orderCode) {
|
|
|
|
|
|
logger.info("drawOrderShareCoupon enter, mobile: {}, activityId: {}, orderCode: {}", mobile, activityId, orderCode);
|
|
|
|
|
|
DrawOrderShareCouponRespBO respBO = orderShareActivityService.drawOrderShareCoupon(mobile, activityId, orderCode);
|
|
|
|
|
|
@RequestMapping(params = "method=app.order.registerAndSendCoupon")
|
|
|
@ResponseBody
|
|
|
public ApiResponse registerAndSendCoupon(@RequestParam(value = "mobile", required = true) String mobile, @RequestParam(value = "activityId", required = true) int activityId, @RequestParam(value = "orderCode", required = true) long orderCode, @RequestParam(value = "identifyCode", required = true) String identifyCode) {
|
|
|
logger.info("registerAndSendCoupon enter, mobile: {}, activityId: {}, orderCode: {}, identifyCode : {}", mobile, activityId, orderCode, identifyCode);
|
|
|
|
|
|
DrawOrderShareCouponRespBO respBO = orderShareActivityService.registerAndSendCoupon(mobile, activityId, orderCode, identifyCode);
|
|
|
return new ApiResponse.ApiResponseBuilder().code(200).data(respBO).message("ok").build();
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 新用户注册(带验证码)并领券
|
|
|
* @param mobile
|
|
|
* @param activityId
|
|
|
* @param orderCode
|
|
|
* @param identifyCode
|
|
|
* @return
|
|
|
*/
|
|
|
@RequestMapping(params = "method=app.order.registerAndSendCoupon")
|
|
|
@ResponseBody
|
|
|
public ApiResponse registerAndSendCoupon(@RequestParam(value = "mobile", required = true) String mobile,
|
|
|
@RequestParam(value = "activityId", required = true) int activityId,
|
|
|
@RequestParam(value = "orderCode", required = true) long orderCode,
|
|
|
@RequestParam(value = "identifyCode", required = true) String identifyCode) {
|
|
|
logger.info("registerAndSendCoupon enter, mobile: {}, activityId: {}, orderCode: {}, identifyCode : {}", mobile, activityId, orderCode, identifyCode);
|
|
|
|
|
|
DrawOrderShareCouponRespBO respBO = orderShareActivityService.registerAndSendCoupon(mobile, activityId, orderCode, identifyCode);
|
|
|
return new ApiResponse.ApiResponseBuilder().code(200).data(respBO).message("ok").build();
|
|
|
}
|
|
|
} |
...
|
...
|
|