Browse Source

[大屏][修复]:增加广告标题字段

release_toaliyun_real
hupeng 7 years ago
parent
commit
58ee4c09c0
3 changed files with 31 additions and 1 deletions
  1. +12
    -0
      mallinkService/src/main/java/com/iformall/domain/po/WxScreenAd.java
  2. +13
    -0
      mallinkService/src/main/java/com/iformall/service/impl/WxScreenAdServiceImpl.java
  3. +6
    -1
      mallinkService/src/main/resources/mapper/WxScreenAdMapper.xml

+ 12
- 0
mallinkService/src/main/java/com/iformall/domain/po/WxScreenAd.java View File

@@ -44,6 +44,10 @@ public class WxScreenAd implements Serializable {
@io.swagger.annotations.ApiModelProperty(value="租户id",name="tenantId")
private String tenantId;

/**标题**/
@io.swagger.annotations.ApiModelProperty(value="标题",name="title")
private String title;

/**广告类型**/
@io.swagger.annotations.ApiModelProperty(value="广告类型",name="type")
private Integer type;
@@ -87,6 +91,14 @@ public class WxScreenAd implements Serializable {
this.tenantId = tenantId;
}

public String getTitle() {
return title;
}

public void setTitle(String title) {
this.title = title;
}

public Integer getType() {
return type;
}


+ 13
- 0
mallinkService/src/main/java/com/iformall/service/impl/WxScreenAdServiceImpl.java View File

@@ -10,13 +10,16 @@ import com.iformall.common.IdWorker;

import com.iformall.common.ResultData;
import com.iformall.domain.po.WxAppinfo;
import com.iformall.domain.po.WxCampaign;
import com.iformall.domain.po.WxCouponChannel;
import com.iformall.domain.po.WxScreenAd;
import com.iformall.domain.vo.WxCouponCVo;
import com.iformall.enums.EnumScreenAdType;
import com.iformall.mapper.WxCampaignMapper;
import com.iformall.mapper.WxCouponChannelMapper;
import com.iformall.mapper.WxScreenAdMapper;
import com.iformall.service.WxAppinfoService;
import com.iformall.service.WxCampaignService;
import com.iformall.service.WxScreenAdService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -46,6 +49,9 @@ public class WxScreenAdServiceImpl implements WxScreenAdService {
@Autowired
WxCouponChannelMapper wxCouponChannelMapper;

@Autowired
WxCampaignMapper wxCampaignMapper;

@Override
public PageInfo<WxScreenAd> listAsPage(WxScreenAd record, Integer pageIndex, Integer pageSize) {
return PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxScreenAdMapper.findList(record));
@@ -69,7 +75,14 @@ public class WxScreenAdServiceImpl implements WxScreenAdService {
return new ResultData(ErrorCode.COUPON_ORDER_IS_NULL);
record.setCoverImg(wxCouponCVo.getCoverImg());
record.setSubType(wxCouponCVo.getTargetAd());
record.setTitle(wxCouponCVo.getTitle());

} else if (record.getType().equals(EnumScreenAdType.COUPON.getCode())){
WxCampaign wxCampaign = wxCampaignMapper.selectByPrimaryKey(record.getTargetId());
if (wxCampaign == null)
return new ResultData(ErrorCode.COUPON_ORDER_IS_NULL);
record.setCoverImg(wxCampaign.getCoverImg());
record.setTitle(wxCampaign.getTitle());
}

final IdWorker idWorker = IdWorker.get();


+ 6
- 1
mallinkService/src/main/resources/mapper/WxScreenAdMapper.xml View File

@@ -4,6 +4,7 @@
<resultMap id="BaseResultMap" type="com.iformall.domain.po.WxScreenAd">
<id column="id" jdbcType="BIGINT" property="id"/>
<result column="tenant_id" jdbcType="VARCHAR" property="tenantId"/>
<result column="title" jdbcType="VARCHAR" property="title"/>
<result column="type" jdbcType="INTEGER" property="type"/>
<result column="sub_type" jdbcType="INTEGER" property="subType"/>
<result column="status" jdbcType="INTEGER" property="status"/>
@@ -15,7 +16,7 @@
</resultMap>

<sql id="allColumns">
`id`, `tenant_id`, `type`, `sub_type`, `status`, `create_date`, `update_date`, `cover_img`, `target_id`, `qrcode`
`id`, `tenant_id`, `title`, `type`, `sub_type`, `status`, `create_date`, `update_date`, `cover_img`, `target_id`, `qrcode`
</sql>

<sql id="dynamicWhereConditions">
@@ -29,6 +30,10 @@
and `tenant_id` = #{tenantId}
</if>

<if test=" null != title and ''!=title">
and `title` like concat('%', #{title},'%')
</if>

<if test=" null != type ">
and `type` = #{type}
</if>


Loading…
Cancel
Save