Browse Source

[修改][会员消费][添加导出功能]

release_toaliyun_real
luozukai 6 years ago
parent
commit
15eaf43ec8
4 changed files with 31 additions and 12 deletions
  1. +2
    -2
      mallinkService/src/main/java/com/iformall/domain/po/WxMerchant.java
  2. +1
    -1
      mallinkService/src/main/java/com/iformall/domain/vo/WxMerchantTradeDetailVo.java
  3. +6
    -0
      mallinkService/src/main/java/com/iformall/service/impl/WxMerchantServiceImpl.java
  4. +22
    -9
      mallinkService/src/main/resources/mapper/WxMerchantMapper.xml

+ 2
- 2
mallinkService/src/main/java/com/iformall/domain/po/WxMerchant.java View File

@@ -126,10 +126,10 @@ public class WxMerchant extends BaseEntity {
private String talkUserAux;

@io.swagger.annotations.ApiModelProperty(value = "开始时间", name = "startTime")
private transient Date starttime;
private Date starttime;

@io.swagger.annotations.ApiModelProperty(value = "结束时间", name = "endTime")
private transient Date endtime;
private Date endtime;

@io.swagger.annotations.ApiModelProperty(value = "昵称", name = "userName")
private transient String userName;


+ 1
- 1
mallinkService/src/main/java/com/iformall/domain/vo/WxMerchantTradeDetailVo.java View File

@@ -40,6 +40,6 @@ public class WxMerchantTradeDetailVo extends BaseEntity {

@Excel(name="交易时间",width = 20,orderNum = "7")
@io.swagger.annotations.ApiModelProperty(value = "交易时间", name = "tradeDate")
private Date tradeDateStr;
private String tradeDateStr;

}

+ 6
- 0
mallinkService/src/main/java/com/iformall/service/impl/WxMerchantServiceImpl.java View File

@@ -19,6 +19,9 @@ import com.iformall.exception.MallinkException;
import com.iformall.mapper.*;
import com.iformall.service.*;
import com.iformall.utils.BeanMapping;
import com.iformall.utils.DataUtil;
import com.iformall.utils.DateUtils;
import me.chanjar.weixin.common.util.DataUtils;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -749,6 +752,9 @@ public class WxMerchantServiceImpl implements WxMerchantService {
@Override
public void exportUserTradeList(WxMerchant record,HttpServletRequest request, HttpServletResponse response) {
List<WxMerchantTradeDetailVo> datalist = wxMerchantMapper.userTradeDetailList(record);
datalist.stream().forEach(e->{
e.setTradeDateStr(DateUtils.formatDateTime(e.getTradeDate()));
});
excelService.exportExcel(datalist, null, "商户会员消费列表", WxMerchantTradeDetailVo.class, "商户会员消费列表.xlsx", response, false);
}



+ 22
- 9
mallinkService/src/main/resources/mapper/WxMerchantMapper.xml View File

@@ -428,11 +428,13 @@
(select count(*) from wx_coupon_order o
left join wx_coupon co on(o.`coupon_id`=co.id)
left join wx_coupon_merchant cm on(cm.product_id=co.id)
inner join wx_c_user_basic_info c on(o.c_user_id=c.id) where cm.`merchant_id`=m.id and o.coupon_order_status=1
<if test="starttime != null and starttime!=''">
inner join wx_c_user_basic_info c on(o.c_user_id=c.id)
left join wx_merchant_b_user mb on(mb.id=c.id)
where cm.`merchant_id`=m.id and o.coupon_order_status=1 and mb.merchant_id=m.id
<if test="starttime != null">
and o.create_date &gt;= #{starttime}
</if>
<if test="endtime != null and endtime!=''">
<if test="endtime != null">
and o.create_date &lt;= #{endtime}
</if>
) consumeCount,
@@ -440,11 +442,13 @@
(select count(distinct c.id) from wx_coupon_order o
left join wx_coupon co on(o.`coupon_id`=co.id)
left join wx_coupon_merchant cm on(cm.product_id=co.id)
inner join wx_c_user_basic_info c on(o.c_user_id=c.id) where cm.`merchant_id`=m.id and o.coupon_order_status=1
<if test="starttime != null and starttime!=''">
inner join wx_c_user_basic_info c on(o.c_user_id=c.id)
left join wx_merchant_b_user mb on(mb.id=c.id)
where cm.`merchant_id`=m.id and o.coupon_order_status=1 and mb.merchant_id=m.id
<if test="starttime != null">
and o.create_date &gt;= #{starttime}
</if>
<if test="endtime != null and endtime!=''">
<if test="endtime != null">
and o.create_date &lt;= #{endtime}
</if>
) consumeCountP,
@@ -452,13 +456,16 @@
IFNULL((select sum(co.price) from wx_coupon_order o
left join wx_coupon co on(o.`coupon_id`=co.id)
left join wx_coupon_merchant cm on(cm.product_id=co.id)
inner join wx_c_user_basic_info c on(o.c_user_id=c.id) where cm.`merchant_id`=m.id and o.coupon_order_status=1
<if test="starttime != null and starttime!=''">
inner join wx_c_user_basic_info c on(o.c_user_id=c.id)
left join wx_merchant_b_user mb on(mb.id=c.id)
where cm.`merchant_id`=m.id and o.coupon_order_status=1 and mb.merchant_id=m.id
<if test="starttime != null">
and o.create_date &gt;= #{starttime}
</if>
<if test="endtime != null and endtime!=''">
<if test="endtime != null">
and o.create_date &lt;= #{endtime}
</if>

),0) tradeAmt

from wx_merchant m where 1=1
@@ -494,6 +501,12 @@
<if test=" null != couponName ">
and co.`title` like concat('%', #{couponName},'%')
</if>
<if test="starttime != null">
and o.create_date &gt;= #{starttime}
</if>
<if test="endtime != null">
and o.create_date &lt;= #{endtime}
</if>
order by o.create_date desc
</select>



Loading…
Cancel
Save