Просмотр исходного кода

[解单][添加][开发解单api]

release_toaliyun_real
luozukai 7 лет назад
Родитель
Сommit
392eaab86b
5 измененных файлов: 81 добавлений и 30 удалений
  1. +6
    -0
      mallinkAdmin/src/main/java/com/iformall/tenant/TenantInfoImpl.java
  2. +3
    -0
      mallinkBApi/src/main/java/com/iformall/controller/WxMerchantTradeDailyController.java
  3. +13
    -0
      mallinkService/src/main/java/com/iformall/domain/po/WxCoupon.java
  4. +4
    -4
      mallinkService/src/main/java/com/iformall/domain/po/WxDevice.java
  5. +55
    -26
      mallinkService/src/main/resources/mapper/WxCouponMapper.xml

+ 6
- 0
mallinkAdmin/src/main/java/com/iformall/tenant/TenantInfoImpl.java Просмотреть файл

@@ -75,6 +75,10 @@ public class TenantInfoImpl implements TenantInfo {
if ("wx_msg_record".equals(tableName)) {
return true;
}

if ("wx_coupon".equals(tableName)) {
return true;
}
return false;
}

@@ -88,6 +92,8 @@ public class TenantInfoImpl implements TenantInfo {
return true;
if ("com.iformall.mapper.WxShopMapper.rentRateHistory".equals(ms.getId()))
return true;
if ("com.iformall.mapper.WxCouponMapper.findCouponData".equals(ms.getId()))
return true;
return false;
}
}

+ 3
- 0
mallinkBApi/src/main/java/com/iformall/controller/WxMerchantTradeDailyController.java Просмотреть файл

@@ -83,6 +83,9 @@ public class WxMerchantTradeDailyController extends BaseController {
public ResultData saveOrUpdate(@RequestBody WxMerchantTradeDaily wxMerchantTradeDaily) {
logger.debug("[" + getIpAddr() + "] wxMerchantTradeDaily::saveOrUpdate");
wxMerchantTradeDaily.setTenantId(super.getTenantId());
if(wxMerchantTradeDaily.getTradeAmt()!= null){
wxMerchantTradeDaily.setTradeAmt(wxMerchantTradeDaily.getTradeAmt()*100);
}
wxMerchantTradeDailyService.saveOrUpdate(wxMerchantTradeDaily);
return new ResultData();
}


+ 13
- 0
mallinkService/src/main/java/com/iformall/domain/po/WxCoupon.java Просмотреть файл

@@ -213,6 +213,19 @@ public class WxCoupon extends BaseEntity {
//营销分析
private WxCouponStatisVo wxCouponStatisVo;

@Transient
@SortColumn(column = "press_count")
private Integer pressSendCount;
@Transient
private Integer pressCount;
@Transient
private Integer changeRate;
@Transient
@SortColumn(column = "join_count")
private Integer pressJoinCount;
@Transient
private Integer paymentRate;

public Long getCouponChannelId() {
return couponChannelId;
}


+ 4
- 4
mallinkService/src/main/java/com/iformall/domain/po/WxDevice.java Просмотреть файл

@@ -9,9 +9,7 @@ import java.util.Date;
import java.util.List;

@Table(name = "wx_device")
public class WxDevice implements Serializable {
private static final long serialVersionUID = 1L;

public class WxDevice extends BaseEntity {
@Id
protected Long id;

@@ -28,8 +26,10 @@ public class WxDevice implements Serializable {
this.id = id;
}

@Override
public String getSortColumns() {
return sortColumns;
super.setSortColumns(this.sortColumns);
return super.getSortColumns();
}

public List<Long> getIds() {


+ 55
- 26
mallinkService/src/main/resources/mapper/WxCouponMapper.xml Просмотреть файл

@@ -537,9 +537,14 @@
</select>

<select id="findCountData" parameterType="com.iformall.domain.po.WxCoupon" resultMap="statisMap">
select la.* from(
select res.*, IFNULL(round(sum_payment/sale_amount*100,2),0) as payment_rate from (
select c.*,
IFNULL(round((select sum(wcs.real_payment) from wx_card_info ci
left join wx_coupon wc on wc.id = ci.coupon_id
left join wx_card_spend wcs on wcs.card_id = ci.id
where wc.id = c.id)/(select sum(ci.sale_amount) from wx_card_info ci
left join wx_coupon wc on wc.id = ci.coupon_id
where wc.id = c.id)*100,2),0) payment_rate,

(select count(wco.id) from wx_coupon wc
left join wx_coupon_order wco on wc.id = wco.coupon_id
where wc.id = c.id) as sale_count,
@@ -564,24 +569,20 @@
where wc.id = c.id) as sum_subsidy

from wx_coupon c where c.type = 100

) res
) la
<if test="title != null and title !=''">
and la.title like concat('%', #{title},'%')
and c.title like concat('%', #{title},'%')
</if>
<if test="id != null">
and la.id = #{id}
and c.id = #{id}
</if>
<if test=" null != sortColumns"> order by ${sortColumns} </if>
<if test=" null == sortColumns"> order by la.status asc,la.create_date desc </if>
<if test=" null == sortColumns"> order by c.status asc,c.create_date desc </if>

</select>

<select id="findCouponData" parameterType="com.iformall.domain.po.WxCoupon" resultMap="statisMap">
select la.* from(
select res.*,IFNULL(round(sum_payment/sale_count*100,2),0) as payment_rate from (
select c.*,
IFNULL(round((select count(wco.id) from wx_coupon wc,wx_coupon_order wco where wco.coupon_id = wc.id and wco.coupon_order_status = 1 and wc.id = c.id)/(select count(wco.id) from wx_coupon_order wco where wco.coupon_id = c.id)*100,2),0) payment_rate,
(select count(wco.id) from wx_coupon_order wco where wco.coupon_id = c.id) as sale_count,
(select count(wco.id) from wx_coupon wc,wx_coupon_order wco where wco.coupon_id = wc.id and wco.coupon_order_status = 1 and wc.id = c.id) as sum_payment,
(select count(wco.id) from wx_coupon wc,wx_coupon_order wco where wco.coupon_id = wc.id and wco.coupon_order_status = 3 and wc.id = c.id) as backpay_count,
@@ -589,30 +590,60 @@
left join wx_coupon_order wo on wo.coupon_id = wc.id
left join wx_merchant_subsidy sc on sc.coupon_order_id = wo.id
where wc.id = c.id) as sum_subsidy

from wx_coupon c where c.type not in(8,9,100)
) res
) la
<if test=" 1 == type ">
and la.sale_price > 0
and c.sale_price > 0
</if>
<if test=" 2 == type ">
and la.sale_price = 0
and c.sale_price = 0
</if>
<if test="title != null and title != ''">
and la.title like concat('%', #{title},'%')
and c.title like concat('%', #{title},'%')
</if>
<if test="id != null">
and la.id = #{id}
and c.id = #{id}
</if>
<if test=" null != sortColumns">order by ${sortColumns}</if>
<if test=" null == sortColumns">order by la.status asc,la.create_date desc</if>
<if test=" null == sortColumns">order by c.status asc,c.create_date desc</if>
</select>
<!--
<select id="findCouponData" parameterType="com.iformall.domain.po.WxCoupon" resultMap="statisMap">
select c.*,
(select count(wco.id) from wx_coupon_order wco where wco.coupon_id = c.id) as sale_count,
(select count(wco.id) from wx_coupon wc,wx_coupon_order wco where wco.coupon_id = wc.id and wco.coupon_order_status = 1 and wc.id = c.id) as sum_payment,
(select count(wco.id) from wx_coupon wc,wx_coupon_order wco where wco.coupon_id = wc.id and wco.coupon_order_status = 3 and wc.id = c.id) as backpay_count,
(select sum(sc.subsidy) from wx_coupon wc
left join wx_coupon_order wo on wo.coupon_id = wc.id
left join wx_merchant_subsidy sc on sc.coupon_order_id = wo.id
where wc.id = c.id) as sum_subsidy

from wx_coupon c where c.type not in(8,9,100)
<if test=" 1 == type ">
and c.sale_price > 0
</if>
<if test=" 2 == type ">
and c.sale_price = 0
</if>
<if test="title != null and title != ''">
and c.title like concat('%', #{title},'%')
</if>
<if test="id != null">
and c.id = #{id}
</if>
<if test=" null != sortColumns"> order by ${sortColumns} </if>
<if test=" null == sortColumns">order by c.status asc,c.create_date desc</if>

</select>-->

<select id="findPressData" parameterType="com.iformall.domain.po.WxCoupon" resultMap="statisMap">
select la.* from(
select res.*,IFNULL(round(press_succ_count/press_count*100,2),0) as change_rate from (
select c.*
select c.*,
IFNULL(round((select count(wo.id) from wx_coupon wc
left join wx_order wo on wo.product_id = wc.id
where wo.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),0) change_rate

,(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
@@ -640,16 +671,14 @@
*100,2) as payment_rate

from wx_coupon c where c.type = 8
) res
) la
<if test="id != null">
and la.id = #{id}
and c.id = #{id}
</if>
<if test="title != null and title != ''">
and la.title like concat('%', #{title},'%')
and c.title like concat('%', #{title},'%')
</if>
<if test=" null != sortColumns"> order by ${sortColumns} </if>
<if test=" null == sortColumns"> order by la.status asc,la.create_date desc </if>
<if test=" null == sortColumns"> order by c.status asc,c.create_date desc </if>
</select>

<!--


Загрузка…
Отмена
Сохранить