Browse Source

[卡券][修改]:投放渠道不显示已经投放的券

release_toaliyun_real
hupeng 7 years ago
parent
commit
6d80d900fa
3 changed files with 52 additions and 34 deletions
  1. +12
    -0
      mallinkService/src/main/java/com/iformall/domain/po/WxCoupon.java
  2. +1
    -1
      mallinkService/src/main/java/com/iformall/service/impl/WxCouponServiceImpl.java
  3. +39
    -33
      mallinkService/src/main/resources/mapper/WxCouponMapper.xml

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

@@ -163,6 +163,10 @@ public class WxCoupon implements Serializable {
@Transient
private String merchantParams;

/**投放频道参数,用来过滤**/
@Transient
private Integer targetAd;

//营销分析
private WxCouponStatisVo wxCouponStatisVo;

@@ -442,6 +446,14 @@ public class WxCoupon implements Serializable {
this.autoRefund = autoRefund;
}

public Integer getTargetAd() {
return targetAd;
}

public void setTargetAd(Integer targetAd) {
this.targetAd = targetAd;
}

public static enum Field
{
Id_ASC("`id` ASC"),Id_DESC("`id` DESC")


+ 1
- 1
mallinkService/src/main/java/com/iformall/service/impl/WxCouponServiceImpl.java View File

@@ -74,7 +74,7 @@ public class WxCouponServiceImpl implements WxCouponService {

List<WxCoupon> wxCouponList = page.getList();

if (wxCouponList.isEmpty()) {
if (wxCouponList.isEmpty() || wxCoupon.getTargetAd() != null) {
return new ResultData(page);
}



+ 39
- 33
mallinkService/src/main/resources/mapper/WxCouponMapper.xml View File

@@ -235,134 +235,140 @@

<sql id="dynamicWhereConditionsForCoupon">
where 1 = 1
<if test=" null != targetAd ">
and 0 = (select count(*) from wx_coupon_channel cc
where c.`id` = cc.coupon_id
and cc.status = 0
and cc.target_ad = #{targetAd})
</if>

<if test=" null != id ">
and `id` = #{id}
and c.`id` = #{id}
</if>

<if test=" null != tenantId ">
and `tenant_id` = #{tenantId}
and c.`tenant_id` = #{tenantId}
</if>

<if test=" null == type ">
and `type` &lt; 7
and c.`type` &lt; 7
</if>

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

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

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

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

<if test=" null != salePrice ">
and `sale_price` = #{salePrice}
and c.`sale_price` = #{salePrice}
</if>

<if test=" null != usePrice ">
and `use_price` = #{usePrice}
and c.`use_price` = #{usePrice}
</if>

<if test=" null != useLimitQuantity ">
and `use_limit_quantity` = #{useLimitQuantity}
and c.`use_limit_quantity` = #{useLimitQuantity}
</if>

<if test=" null != sendType ">
and `send_type` = #{sendType}
and c.`send_type` = #{sendType}
</if>

<if test=" null != validType ">
and `valid_type` = #{validType}
and c.`valid_type` = #{validType}
</if>

<if test=" null != validStartDate ">
and `valid_start_date` = #{validStartDate}
and c.`valid_start_date` = #{validStartDate}
</if>

<if test=" null != validEndDate ">
and `valid_end_date` = #{validEndDate}
and c.`valid_end_date` = #{validEndDate}
</if>

<if test=" null != validDays ">
and `valid_days` = #{validDays}
and c.`valid_days` = #{validDays}
</if>

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

<if test=" null != price ">
and `price` = #{price}
and c.`price` = #{price}
</if>

<if test=" null != unit ">
and `unit` = #{unit}
and c.`unit` = #{unit}
</if>

<if test=" null != remainInventory ">
and `remain_inventory` = #{remainInventory}
and c.`remain_inventory` = #{remainInventory}
</if>

<if test=" null != inventory ">
and `inventory` = #{inventory}
and c.`inventory` = #{inventory}
</if>

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

<if test=" null != status">
and `status` = #{status}
and c.`status` = #{status}
</if>

<if test=" null != startdate and null!=enddate">
and `create_date` between #{startdate} and #{enddate}
and c.`create_date` between #{startdate} and #{enddate}
</if>

<if test=" null != updateDate ">
and `update_date` = #{updateDate}
and c.`update_date` = #{updateDate}
</if>

<if test=" null != business ">
and `business` = #{business}
and c.`business` = #{business}
</if>

<if test=" null != supportTransfer ">
and `support_transfer` = #{supportTransfer}
and c.`support_transfer` = #{supportTransfer}
</if>

<if test=" null != subsidyType ">
and `subsidy_type` = #{subsidyType}
and c.`subsidy_type` = #{subsidyType}
</if>

<if test=" null != subsidyNum ">
and `subsidy_num` = #{subsidyNum}
and c.`subsidy_num` = #{subsidyNum}
</if>

<if test=" null != pressLimitNum ">
and `press_limit_num` = #{pressLimitNum}
and c.`press_limit_num` = #{pressLimitNum}
</if>

<if test=" null != pressLimitHours ">
and `press_limit_hours` = #{pressLimitHours}
and c.`press_limit_hours` = #{pressLimitHours}
</if>

<if test=" null != autoRefund ">
and `auto_refund` = #{autoRefund}
and c.`auto_refund` = #{autoRefund}
</if>


<if test=" null != ids ">
and id in
and c.id in
<foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")">
#{idItem}
</foreach>
@@ -373,7 +379,7 @@
<select id="findCouponList" parameterType="com.iformall.domain.po.WxCoupon" resultMap="BaseResultMap">
select
<include refid="allColumns"/>
from wx_coupon
from wx_coupon c
<include refid="dynamicWhereConditionsForCoupon"/>
</select>



Loading…
Cancel
Save