Sfoglia il codice sorgente

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

release_toaliyun_real
luozukai 7 anni fa
parent
commit
c9acf3683d
5 ha cambiato i file con 65 aggiunte e 7 eliminazioni
  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 Vedi File

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


import org.apache.commons.lang3.StringUtils;

import javax.persistence.Id; import javax.persistence.Id;
import javax.persistence.Table; import javax.persistence.Table;
import javax.persistence.Transient; import javax.persistence.Transient;
@@ -195,9 +197,41 @@ public class WxCoupon implements Serializable {
@io.swagger.annotations.ApiModelProperty(value="砍价参与人数",name="pressJoinCount") @io.swagger.annotations.ApiModelProperty(value="砍价参与人数",name="pressJoinCount")
@Transient @Transient
private Integer pressJoinCount; 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----- //营销分析-----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() { public Integer getPressSendCount() {
return pressSendCount; return pressSendCount;
} }


+ 1
- 1
mallinkService/src/main/java/com/iformall/mapper/WxCouponMapper.java Vedi File

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

+ 1
- 1
mallinkService/src/main/java/com/iformall/service/WxCouponService.java Vedi File

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


+ 7
- 3
mallinkService/src/main/java/com/iformall/service/impl/WxCouponServiceImpl.java Vedi File

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


@Override @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 @Override


+ 22
- 2
mallinkService/src/main/resources/mapper/WxCouponMapper.xml Vedi File

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

</resultMap> </resultMap>


<sql id="allColumns"> <sql id="allColumns">
@@ -762,7 +765,24 @@
(select count(wop.id) from wx_coupon wc (select count(wop.id) from wx_coupon wc
left join wx_order wo on wo.product_id = wc.id left join wx_order wo on wo.product_id = wc.id
left join wx_order_press wop on wop.order_id = wo.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 from wx_coupon c where c.type = 8
<if test="id != null"> <if test="id != null">
and c.id = #{id} and c.id = #{id}
@@ -862,7 +882,7 @@
and wco.create_date between #{startdate} and #{enddate} and wco.create_date between #{startdate} and #{enddate}
group by xtime group by xtime
</select> </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 select
round( round(
(select count(wo.id) from wx_coupon wc (select count(wo.id) from wx_coupon wc


Caricamento…
Annulla
Salva