|
|
|
@@ -43,7 +43,7 @@ public class WxCouponOrderServiceImpl implements WxCouponOrderService { |
|
|
|
public void saveOrUpdate(WxCouponOrder record) { |
|
|
|
if (record.getId() == null) { |
|
|
|
//record.setId(UUID.randomUUID().toString().replaceAll("-", "")); |
|
|
|
IdWorker idWorker = new IdWorker(0, 0); |
|
|
|
final IdWorker idWorker = IdWorker.get(); |
|
|
|
record.setId(idWorker.nextId()); |
|
|
|
wxCouponOrderMapper.insertSelective(record); |
|
|
|
} else { |
|
|
|
@@ -60,7 +60,7 @@ public class WxCouponOrderServiceImpl implements WxCouponOrderService { |
|
|
|
|
|
|
|
@Override |
|
|
|
@Transactional(propagation = Propagation.REQUIRED, readOnly = false, rollbackFor = {Exception.class}) |
|
|
|
public ResultData verify(Long couponOrderId, WxMerchantBUser bUser) { |
|
|
|
public ResultData verify(Long couponOrderId, Long bUserId) { |
|
|
|
WxCouponOrder wxCouponOrder = wxCouponOrderMapper.selectByPrimaryKey(couponOrderId); |
|
|
|
if (wxCouponOrder.getCouponOrderStatus() == EnumCouponOrderStatus.COUPON_ORDER_OVER_TIME.getCode()) { |
|
|
|
logger.error("已过期: couponOrder-" + couponOrderId); |
|
|
|
@@ -76,7 +76,7 @@ public class WxCouponOrderServiceImpl implements WxCouponOrderService { |
|
|
|
} |
|
|
|
try { |
|
|
|
wxCouponOrder.setCouponOrderStatus(EnumCouponOrderStatus.COUPON_ORDER_USED.getCode()); //1核销 |
|
|
|
wxCouponOrder.setBUserId(bUser.getId()); |
|
|
|
wxCouponOrder.setBUserId(bUserId); |
|
|
|
wxCouponOrder.setUpdateDate(new Date()); |
|
|
|
wxCouponOrderMapper.updateByPrimaryKeySelective(wxCouponOrder); |
|
|
|
} catch (Exception e) { |
|
|
|
@@ -90,7 +90,7 @@ public class WxCouponOrderServiceImpl implements WxCouponOrderService { |
|
|
|
|
|
|
|
@Override |
|
|
|
@Transactional(propagation = Propagation.REQUIRED, readOnly = false, rollbackFor = {Exception.class}) |
|
|
|
public ResultData refund(Long couponOrderId, WxMerchantBUser bUser) { |
|
|
|
public ResultData refund(Long couponOrderId, Long bUserId) { |
|
|
|
WxCouponOrder wxCouponOrder = wxCouponOrderMapper.selectByPrimaryKey(couponOrderId); |
|
|
|
|
|
|
|
if (wxCouponOrder.getCouponOrderStatus().equals(EnumCouponOrderStatus.COUPON_ORDER_OVER_TIME.getCode())) { |
|
|
|
@@ -107,7 +107,7 @@ public class WxCouponOrderServiceImpl implements WxCouponOrderService { |
|
|
|
} |
|
|
|
try { |
|
|
|
wxCouponOrder.setCouponOrderStatus(EnumCouponOrderStatus.COUPON_ORDER_INVALID.getCode()); //3退款,券作废 |
|
|
|
wxCouponOrder.setBUserId(bUser.getId()); |
|
|
|
wxCouponOrder.setBUserId(bUserId); |
|
|
|
wxCouponOrder.setUpdateDate(new Date()); |
|
|
|
wxCouponOrderMapper.updateByPrimaryKeySelective(wxCouponOrder); |
|
|
|
} catch (Exception e) { |
|
|
|
|