Переглянути джерело

[营销分析][添加][卡营销列表]

release_toaliyun_real
luozukai 7 роки тому
джерело
коміт
c9acf3683d
5 змінених файлів з 65 додано та 7 видалено
  1. +34
    -0
      mallinkService/src/main/java/com/iformall/domain/po/WxCoupon.java
  2. +1
    -1
      mallinkService/src/main/java/com/iformall/mapper/WxCouponMapper.java
  3. +1
    -1
      mallinkService/src/main/java/com/iformall/service/WxCouponService.java
  4. +7
    -3
      mallinkService/src/main/java/com/iformall/service/impl/WxCouponServiceImpl.java
  5. +22
    -2
      mallinkService/src/main/resources/mapper/WxCouponMapper.xml

+ 34
- 0
mallinkService/src/main/java/com/iformall/domain/po/WxCoupon.java Переглянути файл

@@ -1,5 +1,7 @@
package com.iformall.domain.po;

import org.apache.commons.lang3.StringUtils;

import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;
@@ -195,9 +197,41 @@ public class WxCoupon implements Serializable {
@io.swagger.annotations.ApiModelProperty(value="砍价参与人数",name="pressJoinCount")
@Transient
private Integer pressJoinCount;

/**商场补贴**/
@io.swagger.annotations.ApiModelProperty(value="商场补贴",name="sumSubsidy")
@Transient
private Integer sumSubsidy;
/**核销比**/
@io.swagger.annotations.ApiModelProperty(value="核销比",name="paymentRate")
@Transient
private String paymentRate;

//营销分析-----end-----


public Integer getSumSubsidy() {
return sumSubsidy;
}

public void setSumSubsidy(Integer sumSubsidy) {
this.sumSubsidy = sumSubsidy;
}

public String getPaymentRate() {
return paymentRate;
}

public void setPaymentRate(String paymentRate) {
if(StringUtils.isNotBlank(paymentRate)) {
if ("0.00".equals(paymentRate)) {
this.paymentRate = "0%";
} else {
this.paymentRate = paymentRate + "%";
}
}
}

public Integer getPressSendCount() {
return pressSendCount;
}


+ 1
- 1
mallinkService/src/main/java/com/iformall/mapper/WxCouponMapper.java Переглянути файл

@@ -64,7 +64,7 @@ public interface WxCouponMapper extends CommonMapper<WxCoupon, Long> {
List<WxCoupon> pressSendHistory(WxCoupon wxCoupon);
List<WxCoupon> pressSuccHistory(WxCoupon wxCoupon);
List<WxCoupon> pressPaymentHistory(WxCoupon wxCoupon);
Double pressSuccRate(WxCoupon wxCoupon);
String pressSuccRate(WxCoupon wxCoupon);
// Long sumSubsidy(WxCoupon wxCoupon);
Long sumJoin(WxCoupon wxCoupon);
}

+ 1
- 1
mallinkService/src/main/java/com/iformall/service/WxCouponService.java Переглянути файл

@@ -170,7 +170,7 @@ public interface WxCouponService {
* 砍价转化率
* @return
*/
Double pressSuccRate(WxCoupon wxCoupon);
String pressSuccRate(WxCoupon wxCoupon);
/**
* 商场补贴金额
* @return


+ 7
- 3
mallinkService/src/main/java/com/iformall/service/impl/WxCouponServiceImpl.java Переглянути файл

@@ -417,9 +417,13 @@ public class WxCouponServiceImpl implements WxCouponService {
}

@Override
public Double pressSuccRate(WxCoupon wxCoupon) {
Double count = wxCouponMapper.pressSuccRate(wxCoupon);
return (count==null)?0l:count;
public String pressSuccRate(WxCoupon wxCoupon) {
String count = wxCouponMapper.pressSuccRate(wxCoupon);
if ("0.00".equals(count)) {
return "0%";
} else {
return count + "%";
}
}

@Override


+ 22
- 2
mallinkService/src/main/resources/mapper/WxCouponMapper.xml Переглянути файл

@@ -41,6 +41,9 @@
<result column="press_count" property="pressSendCount"/>
<result column="press_succ_count" property="pressSuccCount"/>
<result column="join_count" property="pressJoinCount"/>
<result column="sum_subsidy" property="sumSubsidy"/>
<result column="payment_rate" property="paymentRate"/>

</resultMap>

<sql id="allColumns">
@@ -762,7 +765,24 @@
(select count(wop.id) from wx_coupon wc
left join wx_order wo on wo.product_id = wc.id
left join wx_order_press wop on wop.order_id = wo.id
where wc.id = c.id) as join_count
where wc.id = c.id) as join_count,

round(
(select count(wco.id) xcount from wx_coupon wc
left join wx_coupon_order wco on wco.coupon_id = wc.id
where wc.type = 8 and wco.coupon_order_status = 1
and wc.id = c.id)
/
(select count(wop.id) from wx_coupon wc
left join wx_order wo on wo.product_id = wc.id
left join wx_order_press wop on wop.order_id = wo.id
where wop.first = 1 and wc.id = c.id)
*100,2) as payment_rate,

(select sum(wc.subsidy_num) from wx_coupon wc
left join wx_order wo on wo.product_id = wc.id
where wo.order_status = 7 and wc.id = c.id) as sum_subsidy

from wx_coupon c where c.type = 8
<if test="id != null">
and c.id = #{id}
@@ -862,7 +882,7 @@
and wco.create_date between #{startdate} and #{enddate}
group by xtime
</select>
<select id="pressSuccRate" parameterType="com.iformall.domain.po.WxCoupon" resultType="java.lang.Double">
<select id="pressSuccRate" parameterType="com.iformall.domain.po.WxCoupon" resultType="java.lang.String">
select
round(
(select count(wo.id) from wx_coupon wc


Завантаження…
Відмінити
Зберегти