From aa6214de40b0457b18e42516e71f89db88c96c17 Mon Sep 17 00:00:00 2001 From: hupeng Date: Fri, 22 Mar 2019 17:39:08 +0800 Subject: [PATCH 1/2] =?UTF-8?q?[=E5=AE=A3=E4=BC=A0=E9=A1=B5][=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D]:=E5=BD=93=E5=8D=A1=E5=88=B8=E5=B7=B2=E7=BB=8F?= =?UTF-8?q?=E4=BD=9C=E5=BA=9F=E5=90=8E=E6=88=96=E8=80=85=E8=BF=87=E6=9C=9F?= =?UTF-8?q?=E5=90=8E=E4=B8=8D=E5=86=8D=E6=8A=9B=E5=87=BA=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/iformall/service/impl/WxCampaignServiceImpl.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxCampaignServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxCampaignServiceImpl.java index 39662754d..9ff9f74a7 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxCampaignServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxCampaignServiceImpl.java @@ -184,10 +184,10 @@ public class WxCampaignServiceImpl implements WxCampaignService { throw new MallinkException(ErrorCode.COUPON_IS_EMPTY); } if (wxCoupon.getStatus() != EnumCouponStatus.COUPON_STATUS_THROW_IN.getCode()) { - throw new MallinkException(ErrorCode.COUPON_IS_TAKE_OFF); - } + return; + } if (wxCoupon.getValidEndDate() != null && wxCoupon.getValidEndDate().before(new Date())) { - throw new MallinkException(ErrorCode.COUPON_IS_TAKE_OFF); + return; } // 已有的couponChannel, 更新 From 724fec148ef6bc90fb4b7da5a6993ed8b6c5cf62 Mon Sep 17 00:00:00 2001 From: luozukai Date: Fri, 22 Mar 2019 18:07:51 +0800 Subject: [PATCH 2/2] =?UTF-8?q?[=E8=90=A5=E9=94=80=E5=88=86=E6=9E=90][?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0][=E4=BC=98=E5=8C=96coupon=E5=AE=9E=E4=BD=93?= =?UTF-8?q?=E5=B1=9E=E6=80=A7]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/WxCouponController.java | 9 +- .../java/com/iformall/domain/po/WxCoupon.java | 154 +----------------- .../iformall/domain/vo/WxCouponStatisVo.java | 4 +- .../com/iformall/mapper/WxCouponMapper.java | 25 +-- .../com/iformall/service/WxCouponService.java | 25 +-- .../service/impl/WxChartServiceImpl.java | 36 ++-- .../service/impl/WxCouponServiceImpl.java | 25 +-- .../main/resources/mapper/WxCouponMapper.xml | 60 +++++-- 8 files changed, 117 insertions(+), 221 deletions(-) diff --git a/mallinkAdmin/src/main/java/com/iformall/controller/WxCouponController.java b/mallinkAdmin/src/main/java/com/iformall/controller/WxCouponController.java index 9f90283b4..bb20621c9 100644 --- a/mallinkAdmin/src/main/java/com/iformall/controller/WxCouponController.java +++ b/mallinkAdmin/src/main/java/com/iformall/controller/WxCouponController.java @@ -4,6 +4,7 @@ import com.github.pagehelper.PageInfo; import com.iformall.common.Result; import com.iformall.common.ResultData; import com.iformall.domain.po.WxCoupon; +import com.iformall.domain.vo.WxCouponStatisVo; import com.iformall.enums.*; import com.iformall.service.WxCouponService; import com.iformall.utils.DateUtils; @@ -92,8 +93,8 @@ public class WxCouponController extends BaseController { if(wxCoupon.getEnddate() == null){ wxCoupon.setEnddate(DateUtils.stringToDate(DateUtils.getSystemTime("yyyy-MM-dd") + " 23:59:59")); } - PageInfo pageInfo = wxCouponService.findCountData(wxCoupon,pageNum,pageSize); - for (WxCoupon coupon:pageInfo.getList()) { + PageInfo pageInfo = wxCouponService.findCountData(wxCoupon,pageNum,pageSize); + for (WxCouponStatisVo coupon:pageInfo.getList()) { if(coupon.getSaleAmount() == null){ coupon.setSaleAmount(0); } @@ -126,8 +127,8 @@ public class WxCouponController extends BaseController { wxCoupon.setEnddate(DateUtils.stringToDate(DateUtils.getSystemTime("yyyy-MM-dd") + " 23:59:59")); } - PageInfo pageInfo = wxCouponService.findCouponData(wxCoupon,pageNum,pageSize); - for (WxCoupon coupon:pageInfo.getList()) { + PageInfo pageInfo = wxCouponService.findCouponData(wxCoupon,pageNum,pageSize); + for (WxCouponStatisVo coupon:pageInfo.getList()) { if(coupon.getSumSubsidy() == null){ coupon.setSumSubsidy(0); } diff --git a/mallinkService/src/main/java/com/iformall/domain/po/WxCoupon.java b/mallinkService/src/main/java/com/iformall/domain/po/WxCoupon.java index 70e791443..058b930d0 100644 --- a/mallinkService/src/main/java/com/iformall/domain/po/WxCoupon.java +++ b/mallinkService/src/main/java/com/iformall/domain/po/WxCoupon.java @@ -1,5 +1,6 @@ package com.iformall.domain.po; +import com.iformall.domain.vo.WxCouponStatisVo; import org.apache.commons.lang3.StringUtils; import javax.persistence.Id; @@ -162,148 +163,15 @@ public class WxCoupon implements Serializable { @Transient private String merchantParams; - //营销分析-----start----- - @Transient - private String xtime; - @Transient - private String xcount; - /**售出卡数量**/ - @io.swagger.annotations.ApiModelProperty(value="售出卡数量",name="saleCount") - @Transient - private Long saleCount; - /**转增数量**/ - @io.swagger.annotations.ApiModelProperty(value="转增数量",name="transferCount") - @Transient - private Long transferCount; - /**售出金额**/ - @io.swagger.annotations.ApiModelProperty(value="售出金额",name="saleAmount") - @Transient - private Integer saleAmount; - /**核销数量**/ - @io.swagger.annotations.ApiModelProperty(value="核销数量",name="sumPayment") - @Transient - private Integer sumPayment; - /**退款数量**/ - @io.swagger.annotations.ApiModelProperty(value="退款数量",name="backpayCount") - @Transient - private Integer backpayCount; - - /**砍价发起次数**/ - @io.swagger.annotations.ApiModelProperty(value="砍价发起次数",name="pressSendCount") - @Transient - private Integer pressSendCount; - /**砍价成功次数**/ - @io.swagger.annotations.ApiModelProperty(value="砍价成功次数",name="pressSuccCount") - @Transient - private Integer pressSuccCount; - /**砍价参与人数**/ - @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; - } - - public void setPressSendCount(Integer pressSendCount) { - this.pressSendCount = pressSendCount; - } - - public Integer getPressSuccCount() { - return pressSuccCount; - } + //营销分析 + private WxCouponStatisVo wxCouponStatisVo; - public void setPressSuccCount(Integer pressSuccCount) { - this.pressSuccCount = pressSuccCount; + public WxCouponStatisVo getWxCouponStatisVo() { + return wxCouponStatisVo; } - public Integer getPressJoinCount() { - return pressJoinCount; - } - - public void setPressJoinCount(Integer pressJoinCount) { - this.pressJoinCount = pressJoinCount; - } - - public String getXcount() { - return xcount; - } - - public void setXcount(String xcount) { - this.xcount = xcount; - } - - public Integer getBackpayCount() { - return backpayCount; - } - - public void setBackpayCount(Integer backpayCount) { - this.backpayCount = backpayCount; - } - - public Long getSaleCount() { - return saleCount; - } - - public void setSaleCount(Long saleCount) { - this.saleCount = saleCount; - } - - public Long getTransferCount() { - return transferCount; - } - - public void setTransferCount(Long transferCount) { - this.transferCount = transferCount; - } - - public Integer getSaleAmount() { - return saleAmount; - } - - public void setSaleAmount(Integer saleAmount) { - this.saleAmount = saleAmount; - } - - public Integer getSumPayment() { - return sumPayment; - } - - public void setSumPayment(Integer sumPayment) { - this.sumPayment = sumPayment; + public void setWxCouponStatisVo(WxCouponStatisVo wxCouponStatisVo) { + this.wxCouponStatisVo = wxCouponStatisVo; } public static long getSerialVersionUID() { @@ -657,14 +525,6 @@ public class WxCoupon implements Serializable { } } - public String getXtime() { - return xtime; - } - - public void setXtime(String xtime) { - this.xtime = xtime; - } - public List getNotinTypes() { return notinTypes; } diff --git a/mallinkService/src/main/java/com/iformall/domain/vo/WxCouponStatisVo.java b/mallinkService/src/main/java/com/iformall/domain/vo/WxCouponStatisVo.java index 51068178b..757f6fefa 100644 --- a/mallinkService/src/main/java/com/iformall/domain/vo/WxCouponStatisVo.java +++ b/mallinkService/src/main/java/com/iformall/domain/vo/WxCouponStatisVo.java @@ -1,5 +1,7 @@ package com.iformall.domain.vo; +import com.iformall.domain.po.WxCoupon; + import javax.persistence.Transient; import java.io.Serializable; @@ -8,7 +10,7 @@ import java.io.Serializable; * coupon 营销分析 * @date 2019/3/22 17:29 */ -public class WxCouponStatisVo implements Serializable { +public class WxCouponStatisVo extends WxCoupon { @Transient private String xtime; diff --git a/mallinkService/src/main/java/com/iformall/mapper/WxCouponMapper.java b/mallinkService/src/main/java/com/iformall/mapper/WxCouponMapper.java index 15d2af352..1ccb54bbd 100644 --- a/mallinkService/src/main/java/com/iformall/mapper/WxCouponMapper.java +++ b/mallinkService/src/main/java/com/iformall/mapper/WxCouponMapper.java @@ -3,13 +3,14 @@ package com.iformall.mapper; import java.util.*; import com.iformall.common.CommonMapper; import com.iformall.domain.vo.WxCouponCVo; +import com.iformall.domain.vo.WxCouponStatisVo; import org.apache.ibatis.annotations.Param; import com.iformall.domain.po.WxCoupon; public interface WxCouponMapper extends CommonMapper { - List findPressData(WxCoupon wxCoupon); - List findCouponData(WxCoupon wxCoupon); - List findCountData(WxCoupon wxCoupon); + List findPressData(WxCoupon wxCoupon); + List findCouponData(WxCoupon wxCoupon); + List findCountData(WxCoupon wxCoupon); List findList(WxCoupon wxCoupon); List findCouponList(WxCoupon wxCoupon); @@ -28,14 +29,14 @@ public interface WxCouponMapper extends CommonMapper { * @param wxCoupon * @return */ - List findSaleMoneyByDate(WxCoupon wxCoupon); + List findSaleMoneyByDate(WxCoupon wxCoupon); /** * 查询时间段内核销金额 * @param wxCoupon * @return */ - List findPaymentByDate(WxCoupon wxCoupon); + List findPaymentByDate(WxCoupon wxCoupon); Long findSaleCardCount(WxCoupon wxCoupon); @@ -45,22 +46,22 @@ public interface WxCouponMapper extends CommonMapper { //-------卷-------- - List findCouponOrderCount(WxCoupon wxCoupon); + List findCouponOrderCount(WxCoupon wxCoupon); - List findCouponPaymentCount(WxCoupon wxCoupon); + List findCouponPaymentCount(WxCoupon wxCoupon); - List priceCouponSaleCount(WxCoupon wxCoupon); + List priceCouponSaleCount(WxCoupon wxCoupon); - List priceCouponPaymentCount(WxCoupon wxCoupon); + List priceCouponPaymentCount(WxCoupon wxCoupon); String findSumPriceSaleMoney(WxCoupon wxCoupon); String findSumPricePayMent(WxCoupon wxCoupon); String findSumSubsidyMoney(WxCoupon wxCoupon); //-------砍价-------- - List pressSendHistory(WxCoupon wxCoupon); - List pressSuccHistory(WxCoupon wxCoupon); - List pressPaymentHistory(WxCoupon wxCoupon); + List pressSendHistory(WxCoupon wxCoupon); + List pressSuccHistory(WxCoupon wxCoupon); + List pressPaymentHistory(WxCoupon wxCoupon); String pressSuccRate(WxCoupon wxCoupon); Long sumJoin(WxCoupon wxCoupon); } diff --git a/mallinkService/src/main/java/com/iformall/service/WxCouponService.java b/mallinkService/src/main/java/com/iformall/service/WxCouponService.java index 8bc4c079a..4a6fcb2a0 100644 --- a/mallinkService/src/main/java/com/iformall/service/WxCouponService.java +++ b/mallinkService/src/main/java/com/iformall/service/WxCouponService.java @@ -5,6 +5,7 @@ import com.github.pagehelper.PageInfo; import com.iformall.common.ResultData; import com.iformall.domain.po.WxCoupon; import com.iformall.domain.vo.WxCouponCVo; +import com.iformall.domain.vo.WxCouponStatisVo; public interface WxCouponService { @@ -26,14 +27,14 @@ public interface WxCouponService { * @param record * @return */ - PageInfo findCountData(WxCoupon record,Integer pageNum, Integer pageSize); + PageInfo findCountData(WxCoupon record, Integer pageNum, Integer pageSize); /** * 卷列表,包括统计 * @param record * @return */ - PageInfo findCouponData(WxCoupon record,Integer pageNum, Integer pageSize); + PageInfo findCouponData(WxCoupon record,Integer pageNum, Integer pageSize); /** * 砍价列表,包括统计 @@ -42,7 +43,7 @@ public interface WxCouponService { * @param pageSize * @return */ - PageInfo findPressData(WxCoupon record,Integer pageNum, Integer pageSize); + PageInfo findPressData(WxCoupon record,Integer pageNum, Integer pageSize); /** * 根据Id获得实体 @@ -74,14 +75,14 @@ public interface WxCouponService { * @param wxCoupon * @return */ - List findSaleMoneyByDate(WxCoupon wxCoupon); + List findSaleMoneyByDate(WxCoupon wxCoupon); /** * 查询时间段内核销金额 * @param wxCoupon * @return */ - List findPaymentByDate(WxCoupon wxCoupon); + List findPaymentByDate(WxCoupon wxCoupon); /** * 查询售出卡数量 @@ -112,7 +113,7 @@ public interface WxCouponService { * 卷购买数量 * @return */ - List findCouponOrderCount(WxCoupon wxCoupon); + List findCouponOrderCount(WxCoupon wxCoupon); /** * 卷领取数量 @@ -124,19 +125,19 @@ public interface WxCouponService { * 卷核销数量 * @return */ - List findCouponPaymentCount(WxCoupon wxCoupon); + List findCouponPaymentCount(WxCoupon wxCoupon); /** * 有价卷销售数量 * @return */ - List priceCouponSaleCount(WxCoupon wxCoupon); + List priceCouponSaleCount(WxCoupon wxCoupon); /** * 有价卷核销数量 * @return */ - List priceCouponPaymentCount(WxCoupon wxCoupon); + List priceCouponPaymentCount(WxCoupon wxCoupon); String findSumPriceSaleMoney(WxCoupon wxCoupon); String findSumPricePayMent(WxCoupon wxCoupon); @@ -147,17 +148,17 @@ public interface WxCouponService { * 砍价发起次数走势 * @return */ - List pressSendHistory(WxCoupon wxCoupon); + List pressSendHistory(WxCoupon wxCoupon); /** * 砍价成功次数走势 * @return */ - List pressSuccHistory(WxCoupon wxCoupon); + List pressSuccHistory(WxCoupon wxCoupon); /** * 砍价核销数量走势 * @return */ - List pressPaymentHistory(WxCoupon wxCoupon); + List pressPaymentHistory(WxCoupon wxCoupon); /** * 砍价转化率 * @return diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxChartServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxChartServiceImpl.java index 11f0a7101..fa3822180 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxChartServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxChartServiceImpl.java @@ -1490,15 +1490,15 @@ public class WxChartServiceImpl implements WxChartDataService { } Map result = new HashedMap(); - List saleMoneyList = wxCouponService.findSaleMoneyByDate(wxCoupon); - List paymentList = wxCouponService.findPaymentByDate(wxCoupon); + List saleMoneyList = wxCouponService.findSaleMoneyByDate(wxCoupon); + List paymentList = wxCouponService.findPaymentByDate(wxCoupon); Map saleMap = getDateMap(wxCoupon.getStartdate(),wxCoupon.getEnddate()); Map payMentMap = getDateMap(wxCoupon.getStartdate(),wxCoupon.getEnddate()); - for (WxCoupon coupon:saleMoneyList){ + for (WxCouponStatisVo coupon:saleMoneyList){ saleMap.put(coupon.getXtime(),coupon.getXcount()); } - for (WxCoupon coupon:paymentList){ + for (WxCouponStatisVo coupon:paymentList){ payMentMap.put(coupon.getXtime(),coupon.getXcount()); } result.put("saleHistory",saleMap); @@ -1533,26 +1533,26 @@ public class WxChartServiceImpl implements WxChartDataService { Date endTime = DateUtils.stringToDate(enddate, "yyyy-MM-dd HH:mm:ss"); wxCoupon.setEnddate(endTime); } - List orderCountList = wxCouponService.findCouponOrderCount(wxCoupon); - List paymentCountList = wxCouponService.findCouponPaymentCount(wxCoupon); - List priceCouponSaleCountList = wxCouponService.priceCouponSaleCount(wxCoupon); - List priceCouponPaymentCountList = wxCouponService.priceCouponPaymentCount(wxCoupon); + List orderCountList = wxCouponService.findCouponOrderCount(wxCoupon); + List paymentCountList = wxCouponService.findCouponPaymentCount(wxCoupon); + List priceCouponSaleCountList = wxCouponService.priceCouponSaleCount(wxCoupon); + List priceCouponPaymentCountList = wxCouponService.priceCouponPaymentCount(wxCoupon); Map orderCountMap = getDateMap(wxCoupon.getStartdate(),wxCoupon.getEnddate()); Map paymentCountMap = getDateMap(wxCoupon.getStartdate(),wxCoupon.getEnddate()); Map priceCouponSaleCountMap = getDateMap(wxCoupon.getStartdate(),wxCoupon.getEnddate()); Map priceCouponPaymentCountMap = getDateMap(wxCoupon.getStartdate(),wxCoupon.getEnddate()); - for (WxCoupon coupon:orderCountList){ + for (WxCouponStatisVo coupon:orderCountList){ orderCountMap.put(coupon.getXtime(),coupon.getXcount()); } - for (WxCoupon coupon:paymentCountList){ + for (WxCouponStatisVo coupon:paymentCountList){ paymentCountMap.put(coupon.getXtime(),coupon.getXcount()); } - for (WxCoupon coupon:priceCouponSaleCountList){ + for (WxCouponStatisVo coupon:priceCouponSaleCountList){ priceCouponSaleCountMap.put(coupon.getXtime(),coupon.getXcount()); } - for (WxCoupon coupon:priceCouponPaymentCountList){ + for (WxCouponStatisVo coupon:priceCouponPaymentCountList){ priceCouponPaymentCountMap.put(coupon.getXtime(),coupon.getXcount()); } result.put("orderCountList",orderCountMap); @@ -1590,21 +1590,21 @@ public class WxChartServiceImpl implements WxChartDataService { Date endTime = DateUtils.stringToDate(enddate, "yyyy-MM-dd HH:mm:ss"); wxCoupon.setEnddate(endTime); } - List pressSendHistory = wxCouponService.pressSendHistory(wxCoupon); - List pressSuccHistory = wxCouponService.pressSuccHistory(wxCoupon); - List pressPaymentHistory = wxCouponService.pressPaymentHistory(wxCoupon); + List pressSendHistory = wxCouponService.pressSendHistory(wxCoupon); + List pressSuccHistory = wxCouponService.pressSuccHistory(wxCoupon); + List pressPaymentHistory = wxCouponService.pressPaymentHistory(wxCoupon); Map pressSendHistoryMap = getDateMap(wxCoupon.getStartdate(),wxCoupon.getEnddate()); Map pressSuccHistoryMap = getDateMap(wxCoupon.getStartdate(),wxCoupon.getEnddate()); Map pressPaymentHistoryMap = getDateMap(wxCoupon.getStartdate(),wxCoupon.getEnddate()); - for (WxCoupon coupon:pressSendHistory){ + for (WxCouponStatisVo coupon:pressSendHistory){ pressSendHistoryMap.put(coupon.getXtime(),coupon.getXcount()); } - for (WxCoupon coupon:pressSuccHistory){ + for (WxCouponStatisVo coupon:pressSuccHistory){ pressSuccHistoryMap.put(coupon.getXtime(),coupon.getXcount()); } - for (WxCoupon coupon:pressPaymentHistory){ + for (WxCouponStatisVo coupon:pressPaymentHistory){ pressPaymentHistoryMap.put(coupon.getXtime(),coupon.getXcount()); } result.put("pressSendHistory",pressSendHistoryMap); diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxCouponServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxCouponServiceImpl.java index d217ca672..f39bd184f 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxCouponServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxCouponServiceImpl.java @@ -14,6 +14,7 @@ import com.iformall.domain.po.WxCouponChannel; import com.iformall.domain.po.WxCouponMerchant; import com.iformall.domain.po.WxScreenAd; import com.iformall.domain.vo.WxCouponCVo; +import com.iformall.domain.vo.WxCouponStatisVo; import com.iformall.domain.vo.WxMerchantVo; import com.iformall.enums.*; import com.iformall.mapper.WxCouponChannelMapper; @@ -120,7 +121,7 @@ public class WxCouponServiceImpl implements WxCouponService { @Override - public PageInfo findCountData(WxCoupon record,Integer pageNum, Integer pageSize) { + public PageInfo findCountData(WxCoupon record,Integer pageNum, Integer pageSize) { return PageHelper.startPage(pageNum, pageSize).doSelectPageInfo(() -> wxCouponMapper.findCountData(record)); } @@ -314,12 +315,12 @@ public class WxCouponServiceImpl implements WxCouponService { } @Override - public List findSaleMoneyByDate(WxCoupon wxCoupon) { + public List findSaleMoneyByDate(WxCoupon wxCoupon) { return wxCouponMapper.findSaleMoneyByDate(wxCoupon); } @Override - public List findPaymentByDate(WxCoupon wxCoupon) { + public List findPaymentByDate(WxCoupon wxCoupon) { return wxCouponMapper.findPaymentByDate(wxCoupon); } @@ -342,28 +343,28 @@ public class WxCouponServiceImpl implements WxCouponService { } @Override - public PageInfo findCouponData(WxCoupon record, Integer pageNum, Integer pageSize) { + public PageInfo findCouponData(WxCoupon record, Integer pageNum, Integer pageSize) { return PageHelper.startPage(pageNum, pageSize).doSelectPageInfo(() -> wxCouponMapper.findCouponData(record)); } @Override - public List findCouponOrderCount(WxCoupon wxCoupon) { + public List findCouponOrderCount(WxCoupon wxCoupon) { return wxCouponMapper.findCouponOrderCount(wxCoupon); } @Override - public List findCouponPaymentCount(WxCoupon wxCoupon) { + public List findCouponPaymentCount(WxCoupon wxCoupon) { return wxCouponMapper.findCouponPaymentCount(wxCoupon); } @Override - public List priceCouponSaleCount(WxCoupon wxCoupon) { + public List priceCouponSaleCount(WxCoupon wxCoupon) { return wxCouponMapper.priceCouponSaleCount(wxCoupon); } @Override - public List priceCouponPaymentCount(WxCoupon wxCoupon) { + public List priceCouponPaymentCount(WxCoupon wxCoupon) { return wxCouponMapper.priceCouponPaymentCount(wxCoupon); } @@ -386,22 +387,22 @@ public class WxCouponServiceImpl implements WxCouponService { } @Override - public PageInfo findPressData(WxCoupon record, Integer pageNum, Integer pageSize) { + public PageInfo findPressData(WxCoupon record, Integer pageNum, Integer pageSize) { return PageHelper.startPage(pageNum, pageSize).doSelectPageInfo(() -> wxCouponMapper.findPressData(record)); } @Override - public List pressSendHistory(WxCoupon wxCoupon) { + public List pressSendHistory(WxCoupon wxCoupon) { return wxCouponMapper.pressSendHistory(wxCoupon); } @Override - public List pressSuccHistory(WxCoupon wxCoupon) { + public List pressSuccHistory(WxCoupon wxCoupon) { return wxCouponMapper.pressSuccHistory(wxCoupon); } @Override - public List pressPaymentHistory(WxCoupon wxCoupon) { + public List pressPaymentHistory(WxCoupon wxCoupon) { return wxCouponMapper.pressPaymentHistory(wxCoupon); } diff --git a/mallinkService/src/main/resources/mapper/WxCouponMapper.xml b/mallinkService/src/main/resources/mapper/WxCouponMapper.xml index 0d56a2d0f..bad20c76f 100644 --- a/mallinkService/src/main/resources/mapper/WxCouponMapper.xml +++ b/mallinkService/src/main/resources/mapper/WxCouponMapper.xml @@ -33,18 +33,48 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - @@ -422,7 +452,7 @@ and m.status = 1) = 0 - select DATE_FORMAT(ci.create_date,'%Y-%m-%d') xtime,sum(round(ci.sale_amount/100,2)) xcount from wx_card_info ci left join wx_coupon c on c.id = ci.coupon_id where c.type = 100 @@ -430,7 +460,7 @@ group by xtime - select DATE_FORMAT(wcs.create_date,'%Y-%m-%d') xtime,sum(round(wcs.real_payment/100,2)) xcount from wx_card_info ci left join wx_coupon c on c.id = ci.coupon_id left join wx_card_spend wcs on wcs.card_id = ci.id @@ -462,7 +492,7 @@ where c.type = 100 and c.create_date between #{startdate} and #{enddate} - select c.*, (select count(wco.id) from wx_coupon wc left join wx_coupon_order wco on wc.id = wco.coupon_id @@ -497,7 +527,7 @@ order by c.status asc,c.create_date desc - 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, @@ -523,7 +553,7 @@ order by c.status asc,c.create_date desc - select c.* ,(select count(wop.id) from wx_coupon wc left join wx_order wo on wo.product_id = wc.id @@ -577,7 +607,7 @@ --> - select DATE_FORMAT(wco.create_date,'%Y-%m-%d') xtime,count(wco.id) xcount from wx_coupon c left join wx_coupon_order wco on c.id = wco.coupon_id where c.type not in(8,9,100) @@ -587,7 +617,7 @@ - select DATE_FORMAT(wco.create_date,'%Y-%m-%d') xtime,count(wco.id) xcount from wx_coupon c,wx_coupon_order wco where c.type not in(8,9,100) and wco.coupon_id = c.id and wco.coupon_order_status = 1 @@ -595,7 +625,7 @@ group by xtime - select DATE_FORMAT(wco.create_date,'%Y-%m-%d') xtime,count(wco.id) xcount from wx_coupon c,wx_coupon_order wco where c.type not in(8,9,100) and wco.coupon_id = c.id and wco.coupon_price > 0 @@ -603,7 +633,7 @@ group by xtime - select DATE_FORMAT(wco.create_date,'%Y-%m-%d') xtime,count(wco.id) xcount from wx_coupon c,wx_coupon_order wco where c.type not in(8,9,100) and wco.coupon_id = c.id and wco.coupon_order_status = 1 and wco.coupon_price > 0 @@ -633,7 +663,7 @@ - select DATE_FORMAT(wop.create_date,'%Y-%m-%d') xtime,count(wop.id) xcount 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 @@ -641,14 +671,14 @@ wop.create_date between #{startdate} and #{enddate} group by xtime - select DATE_FORMAT(wo.create_date,'%Y-%m-%d') xtime,count(wo.id) xcount from wx_coupon wc left join wx_order wo on wo.product_id = wc.id where wc.type = 8 and wo.order_status = 1 and wo.create_date between #{startdate} and #{enddate} group by xtime - select DATE_FORMAT(wco.create_date,'%Y-%m-%d') xtime,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