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

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

release_toaliyun_real
luozukai 7 лет назад
Родитель
Сommit
af6cf5eca6
2 измененных файлов: 29 добавлений и 15 удалений
  1. +22
    -8
      mallinkAdmin/src/main/java/com/iformall/controller/WxCouponController.java
  2. +7
    -7
      mallinkService/src/main/resources/mapper/WxCouponMapper.xml

+ 22
- 8
mallinkAdmin/src/main/java/com/iformall/controller/WxCouponController.java Просмотреть файл

@@ -1,11 +1,10 @@
package com.iformall.controller;

import com.github.pagehelper.PageInfo;
import com.iformall.common.Result;
import com.iformall.common.ResultData;
import com.iformall.domain.po.MailMsg;
import com.iformall.domain.po.WxCoupon;
import com.iformall.enums.*;
import com.iformall.mq.MqBaseProducer;
import com.iformall.service.WxCouponService;
import com.iformall.utils.DateUtils;
import io.swagger.annotations.Api;
@@ -16,11 +15,7 @@ import org.apache.commons.collections.map.HashedMap;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.mail.javamail.MimeMessageHelper;
import org.springframework.web.bind.annotation.*;

import javax.mail.internet.MimeMessage;
import java.text.SimpleDateFormat;
import java.util.*;

@RestController
@@ -138,7 +133,19 @@ public class WxCouponController extends BaseController {
if(wxCoupon.getEnddate() == null){
wxCoupon.setEnddate(DateUtils.stringToDate(DateUtils.getSystemTime("yyyy-MM-dd") + " 23:59:59"));
}
result.put("list",wxCouponService.findCountData(wxCoupon,pageNum,pageSize));
PageInfo<WxCoupon> pageInfo = wxCouponService.findCountData(wxCoupon,pageNum,pageSize);
for (WxCoupon coupon:pageInfo.getList()) {
if(coupon.getSaleAmount() == null){
coupon.setSaleAmount(0);
}
if(coupon.getSumPayment() == null){
coupon.setSumPayment(0);
}
if(coupon.getSumSubsidy() == null){
coupon.setSumSubsidy(0);
}
}
result.put("list",pageInfo);
return new ResultData(result);
}

@@ -159,7 +166,14 @@ public class WxCouponController extends BaseController {
if(wxCoupon.getEnddate() == null){
wxCoupon.setEnddate(DateUtils.stringToDate(DateUtils.getSystemTime("yyyy-MM-dd") + " 23:59:59"));
}
return new ResultData(wxCouponService.findCouponData(wxCoupon,pageNum,pageSize));

PageInfo<WxCoupon> pageInfo = wxCouponService.findCouponData(wxCoupon,pageNum,pageSize);
for (WxCoupon coupon:pageInfo.getList()) {
if(coupon.getSumSubsidy() == null){
coupon.setSumSubsidy(0);
}
}
return new ResultData();
}

@ApiOperation("砍价营销列表接口")


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

@@ -713,7 +713,7 @@
</select>

<select id="findSubsidyMoney" parameterType="com.iformall.domain.po.WxCoupon" resultType="Long">
select sum(sc.subsidy) from wx_card_info ci
select sum(round(sc.subsidy/100,2)) from wx_card_info ci
left join wx_coupon c on c.id = ci.coupon_id
left join wx_merchant_subsidy sc on sc.coupon_order_id = ci.id
where c.type = 100 and c.create_date between #{startdate} and #{enddate}
@@ -730,16 +730,16 @@
left join wx_card_transfer_info wcs on wcs.coupon_order_id = ci.id
where wc.id = c.id) as transfer_count,

(select sum(ci.sale_amount/100) from wx_card_info ci
(select sum(round(ci.sale_amount/100,2)) from wx_card_info ci
left join wx_coupon wc on wc.id = ci.coupon_id
where wc.id = c.id) as sale_amount,

(select sum(wcs.deduction_amount/100) from wx_card_info ci
(select sum(round(wcs.real_payment/100,2)) 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) as sum_payment,

(select sum(sc.subsidy/100) from wx_card_info ci
(select sum(round(sc.subsidy/100,2)) from wx_card_info ci
left join wx_coupon wc on wc.id = ci.coupon_id
left join wx_merchant_subsidy sc on sc.coupon_order_id = ci.id
where wc.id = c.id) as sum_subsidy
@@ -756,7 +756,7 @@
(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 payment_count,
(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/100) from wx_coupon wc
(select sum(round(sc.subsidy/100,2)) 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
@@ -860,13 +860,13 @@
</select>

<select id="findSumPriceSaleMoney" parameterType="com.iformall.domain.po.WxCoupon" resultType="Long">
select sum(wco.coupon_price/100) from wx_coupon c,wx_coupon_order wco
select sum(round(c.sale_price/100,2)) from wx_coupon c,wx_coupon_order wco
where wco.coupon_id = c.id and wco.coupon_price > 0
and wco.create_date between #{startdate} and #{enddate}
</select>

<select id="findSumPricePayMent" parameterType="com.iformall.domain.po.WxCoupon" resultType="Long">
select sum(c.price/100) from wx_coupon c,wx_coupon_order wco
select sum(round(c.price/100,2)) from wx_coupon c,wx_coupon_order wco
where wco.coupon_id = c.id and wco.coupon_price > 0 and wco.coupon_order_status = 1
and wco.create_date between #{startdate} and #{enddate}
</select>


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