...
|
...
|
@@ -40,12 +40,13 @@ public class OrderCouponController { |
|
|
@RequestMapping(params = "method=ufo.coupons.use")
|
|
|
@ResponseBody
|
|
|
public ApiResponse useCoupon(@RequestParam(value = "uid") Integer uid,
|
|
|
@RequestParam(value = "userType", defaultValue = "1") int userType,
|
|
|
@RequestParam(value = "orderCode") long orderCode,
|
|
|
@RequestParam(value = "couponCodes") List<String> couponCodes) {
|
|
|
|
|
|
logger.info("use coupons, uid: {},couponCodes: {}, orderCode :{}", uid, couponCodes, orderCode);
|
|
|
boolean useSuccess = couponService.useCoupon(uid, couponCodes, orderCode);
|
|
|
logger.info("use coupons, uid: {},couponCodes: {}, orderCode :{},result: {}", uid, couponCodes, orderCode, useSuccess);
|
|
|
logger.info("use coupons, uid: {},userType:{}, couponCodes: {}, orderCode :{}", uid, userType, couponCodes, orderCode);
|
|
|
boolean useSuccess = couponService.useCoupon(uid, userType, couponCodes, orderCode);
|
|
|
logger.info("use coupons, uid: {},userType:{}, couponCodes: {}, orderCode :{},result: {}", uid, userType, couponCodes, orderCode, useSuccess);
|
|
|
return new ApiResponse.ApiResponseBuilder().code(200).data(useSuccess).build();
|
|
|
}
|
|
|
|
...
|
...
|
@@ -73,14 +74,16 @@ public class OrderCouponController { |
|
|
/**
|
|
|
* 优惠券列表(订单使用)
|
|
|
* @param uid
|
|
|
* @param userType 1 买家 2 卖家
|
|
|
* @return
|
|
|
*/
|
|
|
@RequestMapping(params = "method=ufo.coupons.listNoUsed")
|
|
|
@ResponseBody
|
|
|
public ApiResponse queryUserNoUsedCoupons(@RequestParam(value = "uid") Integer uid) {
|
|
|
public ApiResponse queryUserNoUsedCoupons(@RequestParam(value = "uid") Integer uid,
|
|
|
@RequestParam(value = "userType",defaultValue = "1") Integer userType) {
|
|
|
|
|
|
logger.info("use coupons, uid: {}", uid);
|
|
|
UserCouponsListBo couponBoList = couponService.queryUserNoUsedCoupons(uid);
|
|
|
UserCouponsListBo couponBoList = couponService.queryUserNoUsedCoupons(uid, userType);
|
|
|
logger.info("use coupons, uid: {}, success", uid);
|
|
|
return new ApiResponse.ApiResponseBuilder().code(200).data(couponBoList).build();
|
|
|
}
|
...
|
...
|
|