|
|
@@ -854,25 +854,7 @@ public class AppBookingAction extends ActionSupport implements ServletRequestAwa
|
|
|
//用户开启支付,写入数据操作
|
|
|
bookinglogService.addBooklog("用户点击订单,进行支付" ,booking);
|
|
|
|
|
|
- //通过订单id找到所属优惠券
|
|
|
- List<HotelCouponStatus> hotelCouponStatusList = hotelCoupomStatusService.getBookingId(bookingId);
|
|
|
- if (hotelCouponStatusList != null && hotelCouponStatusList.size() > 0) {
|
|
|
- System.out.println("进入核销优惠券");
|
|
|
- for (HotelCouponStatus hotelCouponStatus : hotelCouponStatusList) {
|
|
|
- String complaintId = hotelCouponStatus.getComplaintId();
|
|
|
- System.out.println("核销优惠券id"+complaintId);
|
|
|
- HotelCoupon hotelCoupon = hotelCoupomService.getById(complaintId);
|
|
|
- if (hotelCoupon!=null) {
|
|
|
- Integer reversedNumber = hotelCoupon.getReversedNumber();
|
|
|
- if (reversedNumber==null) {
|
|
|
- reversedNumber=0;
|
|
|
- }
|
|
|
- hotelCoupon.setReversedNumber(reversedNumber+1);
|
|
|
- hotelCoupon.setModifyDate(LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
|
|
|
- hotelCoupomService.update(hotelCoupon);
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
+
|
|
|
|
|
|
resultjson.put(B.code, ResultStatusCode.OK.getStatus());
|
|
|
resultjson.put(B.message, "返回成功");
|
|
|
@@ -912,6 +894,28 @@ public class AppBookingAction extends ActionSupport implements ServletRequestAwa
|
|
|
Booking book = bookService.queryByOrder(order_num);
|
|
|
// 支付成功
|
|
|
if (result.getResult_code().equals("SUCCESS") && book!=null && ("1").equals(book.getOrderStatus())) {
|
|
|
+
|
|
|
+ //通过订单id找到所属优惠券
|
|
|
+ List<HotelCouponStatus> hotelCouponStatusList = hotelCoupomStatusService.getBookingId(book.getId()+"");
|
|
|
+ if (hotelCouponStatusList != null && hotelCouponStatusList.size() > 0) {
|
|
|
+ System.out.println("进入核销优惠券");
|
|
|
+ for (HotelCouponStatus hotelCouponStatus : hotelCouponStatusList) {
|
|
|
+ String complaintId = hotelCouponStatus.getComplaintId();
|
|
|
+ System.out.println("核销优惠券id"+complaintId);
|
|
|
+ HotelCoupon hotelCoupon = hotelCoupomService.getById(complaintId);
|
|
|
+ if (hotelCoupon!=null) {
|
|
|
+ Integer reversedNumber = hotelCoupon.getReversedNumber();
|
|
|
+ if (reversedNumber==null) {
|
|
|
+ reversedNumber=0;
|
|
|
+ }
|
|
|
+ hotelCoupon.setReversedNumber(reversedNumber+1);
|
|
|
+ hotelCoupon.setModifyDate(LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
|
|
|
+ hotelCoupomService.update(hotelCoupon);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
// 保存支付信息
|
|
|
book.setUpdateTime(DateUtil.getFormatPaternDate(new Date()));
|
|
|
book.setOrderStatus(Func.parseStr(PayEnum.已支付.getNum()));
|