From f209b13486d4fbe9133e3557ecfe8c3be19ac96a Mon Sep 17 00:00:00 2001 From: gongbiao Date: Wed, 20 Feb 2019 20:50:32 +0800 Subject: [PATCH] =?UTF-8?q?[=E5=8D=A1=E8=BD=AC=E8=B5=A0][=E4=BF=AE?= =?UTF-8?q?=E6=94=B9][=E8=BD=AC=E8=B5=A0=E7=8A=B6=E6=80=81]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/iformall/domain/po/WxCardInfo.java | 11 +++++++---- .../iformall/service/impl/WxCardSpendServiceImpl.java | 10 ++++++---- .../src/main/resources/mapper/WxCardInfoMapper.xml | 5 ++++- 3 files changed, 17 insertions(+), 9 deletions(-) diff --git a/mallinkService/src/main/java/com/iformall/domain/po/WxCardInfo.java b/mallinkService/src/main/java/com/iformall/domain/po/WxCardInfo.java index 2ef9dc477..58ab5a411 100644 --- a/mallinkService/src/main/java/com/iformall/domain/po/WxCardInfo.java +++ b/mallinkService/src/main/java/com/iformall/domain/po/WxCardInfo.java @@ -2,12 +2,12 @@ package com.iformall.domain.po; import lombok.Data; -import javax.persistence.*; -import java.util.*; -import javax.persistence.Transient; -import java.util.List; import javax.persistence.Id; +import javax.persistence.Table; +import javax.persistence.Transient; import java.io.Serializable; +import java.util.Date; +import java.util.List; @Table(name = "wx_card_info") @Data @@ -56,6 +56,9 @@ public class WxCardInfo implements Serializable { @io.swagger.annotations.ApiModelProperty(value="更新时间",name="updateDate") private Date updateDate; + @io.swagger.annotations.ApiModelProperty(value = "是否支持转送(0:不支持,1支持)", name = "supportTransfer") + private Integer supportTransfer; + public static enum Field { Id_ASC("`id` ASC"),Id_DESC("`id` DESC") diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxCardSpendServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxCardSpendServiceImpl.java index 9bd74b6a4..bcae9c205 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxCardSpendServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxCardSpendServiceImpl.java @@ -233,10 +233,12 @@ public class WxCardSpendServiceImpl implements WxCardSpendService { } } - //10、消费后修改转赠状态 - if (coupon.getSupportTransfer().equals(EnumCouponTransfer.YES.getCode())) { - coupon.setSupportTransfer(EnumCouponTransfer.NO.getCode()); - wxCouponMapper.updateByPrimaryKeySelective(coupon); + //10、消费后修改卡转赠状态 + WxCardInfo wxCardInfo = new WxCardInfo(); + wxCardInfo.setId(record.getCardId()); + wxCardInfo.setSupportTransfer(EnumCouponTransfer.NO.getCode()); + if (cardInfo.getSupportTransfer().equals(EnumCouponTransfer.YES.getCode())) { + wxCardInfoMapper.updateByPrimaryKeySelective(wxCardInfo); } return new ResultData(record); } diff --git a/mallinkService/src/main/resources/mapper/WxCardInfoMapper.xml b/mallinkService/src/main/resources/mapper/WxCardInfoMapper.xml index 26e79483d..cce293dd1 100644 --- a/mallinkService/src/main/resources/mapper/WxCardInfoMapper.xml +++ b/mallinkService/src/main/resources/mapper/WxCardInfoMapper.xml @@ -14,10 +14,13 @@ + + - `id`,`tenant_id`,`coupon_id`,`transaction_id`,`amount`,`sale_amount`,`remaining_amount`,`service_fee_amount`,`share_fee_amount`,`remaining_share_fee_amount`,`create_date`,`update_date` + `id`,`tenant_id`,`coupon_id`,`transaction_id`,`amount`,`sale_amount`,`remaining_amount`,`service_fee_amount`, + `share_fee_amount`,`remaining_share_fee_amount`,`create_date`,`update_date`,`support_transfer`