Browse Source

[C端][修改]:修改C端的券列表可以显示商户名

release_toaliyun_real
hupeng 7 years ago
parent
commit
df8eef3e9d
2 changed files with 27 additions and 0 deletions
  1. +18
    -0
      mallinkService/src/main/java/com/simple/domain/vo/WxCouponChannelVo.java
  2. +9
    -0
      mallinkService/src/main/java/com/simple/service/impl/WxCouponChannelServiceImpl.java

+ 18
- 0
mallinkService/src/main/java/com/simple/domain/vo/WxCouponChannelVo.java View File

@@ -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;
}

}

+ 9
- 0
mallinkService/src/main/java/com/simple/service/impl/WxCouponChannelServiceImpl.java View File

@@ -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);


Loading…
Cancel
Save