|
|
|
@@ -328,21 +328,32 @@ public class WxCouponPasswordServiceImpl implements WxCouponPasswordService { |
|
|
|
public void insertWxCardDailyLogInfo(WxCouponPassword wxCouponPassword, MallUserInfo user) { |
|
|
|
try { |
|
|
|
WxCouponPassword couponPassword = this.getById(wxCouponPassword.getId()); |
|
|
|
//如果一次没用过,则cardInfo查不到。 |
|
|
|
WxCardInfo cardInfo = wxCardInfoService.getByCouponPasswordId(couponPassword.getId(), couponPassword); |
|
|
|
WxCoupon wxCoupon = wxCouponMapper.selectById(couponPassword.getCouponId(), couponPassword.getTenantId()); |
|
|
|
|
|
|
|
WxCardDailyLog cardSetPrice = new WxCardDailyLog(); |
|
|
|
cardSetPrice.updateTenantInfo(wxCouponPassword); |
|
|
|
cardSetPrice.setCardPasswordId(wxCouponPassword.getId()); |
|
|
|
cardSetPrice.setPrice(cardInfo.getRemainingAmount()); |
|
|
|
if (null != cardInfo) { |
|
|
|
cardSetPrice.setPrice(cardInfo.getRemainingAmount()); |
|
|
|
}else { |
|
|
|
cardSetPrice.setPrice(couponPassword.getPrice()); |
|
|
|
} |
|
|
|
cardSetPrice.setOperatorType(EnumUserType.MALLUSER.getCode()); |
|
|
|
cardSetPrice.setOperatorId(user.getId()); |
|
|
|
cardSetPrice.setOperatorUser(user.getUsername()); |
|
|
|
cardSetPrice.setCouponId(wxCoupon.getId()); |
|
|
|
cardSetPrice.setCardInfoId(cardInfo.getId()); |
|
|
|
if (null != cardInfo) { |
|
|
|
cardSetPrice.setCardInfoId(cardInfo.getId()); |
|
|
|
} |
|
|
|
cardSetPrice.setType(wxCouponPassword.getIsStop() == 0 ? EnumOperateLogType.ENABLE.getCode() : EnumOperateLogType.STOP_USING.getCode()); |
|
|
|
cardSetPrice.setCount(1); |
|
|
|
cardSetPrice.setRemark(user.getUsername() + "给实体卡卡号[" + cardInfo.getId() + "]" + EnumOperateLogType.getEnum(cardSetPrice.getType()).getInfo()); |
|
|
|
Long cardId = couponPassword.getId(); |
|
|
|
if (null != cardInfo) { |
|
|
|
cardId = cardInfo.getId(); |
|
|
|
} |
|
|
|
cardSetPrice.setRemark(user.getUsername() + "给实体卡卡号[" + cardId + "]" + EnumOperateLogType.getEnum(cardSetPrice.getType()).getInfo()); |
|
|
|
wxCardDailyLogService.saveOrUpdate(cardSetPrice); |
|
|
|
}catch (Exception e){ |
|
|
|
logger.error("startOrStop insert error"); |
|
|
|
|