From df8eef3e9d5bd05be7ae71bb5b3a9a3b8518596b Mon Sep 17 00:00:00 2001 From: hupeng Date: Fri, 31 Aug 2018 16:03:23 +0800 Subject: [PATCH] =?UTF-8?q?[C=E7=AB=AF][=E4=BF=AE=E6=94=B9]:=E4=BF=AE?= =?UTF-8?q?=E6=94=B9C=E7=AB=AF=E7=9A=84=E5=88=B8=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E5=8F=AF=E4=BB=A5=E6=98=BE=E7=A4=BA=E5=95=86=E6=88=B7=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../simple/domain/vo/WxCouponChannelVo.java | 18 ++++++++++++++++++ .../impl/WxCouponChannelServiceImpl.java | 9 +++++++++ 2 files changed, 27 insertions(+) diff --git a/mallinkService/src/main/java/com/simple/domain/vo/WxCouponChannelVo.java b/mallinkService/src/main/java/com/simple/domain/vo/WxCouponChannelVo.java index 99fe69083..3c8fa40b1 100644 --- a/mallinkService/src/main/java/com/simple/domain/vo/WxCouponChannelVo.java +++ b/mallinkService/src/main/java/com/simple/domain/vo/WxCouponChannelVo.java @@ -2,6 +2,7 @@ package com.simple.domain.vo; import com.simple.domain.po.WxCoupon; import com.simple.domain.po.WxCouponChannel; +import com.simple.domain.po.WxMerchant; import javax.persistence.Transient; import java.io.Serializable; @@ -56,6 +57,9 @@ public class WxCouponChannelVo extends WxCouponChannel implements Serializable { @Transient private String priceStr; + @Transient + private String merchantName; + /*限领张数**/ @io.swagger.annotations.ApiModelProperty(value="限领张数",name="useLimitQuantity") private Integer useLimitQuantity; @@ -173,6 +177,15 @@ public class WxCouponChannelVo extends WxCouponChannel implements Serializable { this.priceStr = priceStr; } + public String getMerchantName() { + return merchantName; + } + + public void setMerchantName(String merchantName) { + this.merchantName = merchantName; + } + + public WxCouponChannelVo(){} public WxCouponChannelVo setWxCoupon (WxCoupon wxCoupon){ this.coverImg=wxCoupon.getCoverImg(); @@ -188,5 +201,10 @@ public class WxCouponChannelVo extends WxCouponChannel implements Serializable { return this; } + public WxCouponChannelVo setWxMerchant (WxMerchant wxMerchant){ + + this.merchantName=wxMerchant.getName(); + return this; + } } diff --git a/mallinkService/src/main/java/com/simple/service/impl/WxCouponChannelServiceImpl.java b/mallinkService/src/main/java/com/simple/service/impl/WxCouponChannelServiceImpl.java index 3ea46f8ff..2fc9ad4df 100644 --- a/mallinkService/src/main/java/com/simple/service/impl/WxCouponChannelServiceImpl.java +++ b/mallinkService/src/main/java/com/simple/service/impl/WxCouponChannelServiceImpl.java @@ -9,8 +9,10 @@ import com.simple.common.Result; import com.simple.common.ResultData; import com.simple.domain.po.WxCoupon; import com.simple.domain.po.WxCouponChannel; +import com.simple.domain.po.WxMerchant; import com.simple.domain.vo.WxCouponChannelVo; import com.simple.mapper.WxCouponChannelMapper; +import com.simple.mapper.WxMerchantMapper; import com.simple.service.WxCouponChannelService; import com.simple.service.WxCouponService; import org.apache.log4j.Logger; @@ -26,6 +28,8 @@ public class WxCouponChannelServiceImpl implements WxCouponChannelService { WxCouponChannelMapper wxCouponChannelMapper; @Autowired WxCouponService wxCouponService; + @Autowired + WxMerchantMapper wxMerchantMapper; private Logger logger = Logger.getLogger(getClass()); @@ -160,6 +164,11 @@ public class WxCouponChannelServiceImpl implements WxCouponChannelService { for (WxCouponChannelVo wxcouponVo:wxCouponChannelVoList) { if(couponNamesMap.get(wxcouponVo.getCouponId())!=null){ wxcouponVo.setWxCoupon(couponNamesMap.get(wxcouponVo.getCouponId())); + WxMerchant wxMerchant = new WxMerchant(); + wxMerchant.setId(wxcouponVo.getMerchantId()); + wxMerchant = wxMerchantMapper.selectByPrimaryKey(wxMerchant); + if (wxMerchant != null) + wxcouponVo.setWxMerchant(wxMerchant); } } return new PageInfo<>(wxCouponChannelVoList);