|
|
|
@@ -750,6 +750,31 @@ public class WxCouponOrderServiceImpl implements WxCouponOrderService { |
|
|
|
return new ResultData(Result.SUCCESS, "领取成功"); |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public ResultData queryCardStatus(WxCouponOrder record) { |
|
|
|
//卡券是否存在 |
|
|
|
WxCardCVo cardCVo = wxCouponOrderMapper.findCardDetailOfCUser(record.getId()); |
|
|
|
if (cardCVo == null) { |
|
|
|
logger.info("卡券不存在" + record.getId()); |
|
|
|
return new ResultData(ErrorCode.COUPON_ORDER_IS_NULL); |
|
|
|
} |
|
|
|
//转赠人是否存在 |
|
|
|
Long cUserId = record.getCUserId(); |
|
|
|
WxCUser wxCuser = wxCUserMapper.selectByPrimaryKey(cUserId); |
|
|
|
if (wxCuser == null) { |
|
|
|
logger.info("转赠人不存在:" + cUserId); |
|
|
|
return new ResultData(ErrorCode.USER_IS_EMPTY.getCode(), "转赠人不存在"); |
|
|
|
} |
|
|
|
//判断转赠人与目前卡所有者是否为同一个 |
|
|
|
//数据表中当前卡所有者 |
|
|
|
Long ownerId = cardCVo.getOwnerId(); |
|
|
|
if (!ownerId.equals(cUserId)) { |
|
|
|
logger.info("转赠人与目前卡所有者不相同," + "转赠人:" + cUserId + ",当前所有者:" + ownerId); |
|
|
|
return new ResultData(ErrorCode.CARD_TRANSFERED); |
|
|
|
} |
|
|
|
return new ResultData(Result.SUCCESS, "查询成功"); |
|
|
|
} |
|
|
|
|
|
|
|
public void saveCardTransfer(WxCouponOrder couponOrder, WxCardCVo cardCVo) { |
|
|
|
logger.info("保存卡转赠信息"); |
|
|
|
WxCardTransferInfo wxCardTransferInfo = new WxCardTransferInfo(); |
|
|
|
|