| @@ -6,6 +6,7 @@ import com.iformall.common.ErrorCode; | |||||
| import com.iformall.common.Result; | import com.iformall.common.Result; | ||||
| import com.iformall.common.ResultData; | import com.iformall.common.ResultData; | ||||
| import com.iformall.controller.base.BaseController; | import com.iformall.controller.base.BaseController; | ||||
| import com.iformall.domain.po.WxCUserBasicInfo; | |||||
| import com.iformall.domain.po.WxCoupon; | import com.iformall.domain.po.WxCoupon; | ||||
| import com.iformall.domain.po.WxCouponChannel; | import com.iformall.domain.po.WxCouponChannel; | ||||
| import com.iformall.domain.po.WxCouponPassword; | import com.iformall.domain.po.WxCouponPassword; | ||||
| @@ -339,6 +340,23 @@ public class WxCouponController extends BaseController { | |||||
| result.put("list", pageInfo); | result.put("list", pageInfo); | ||||
| return new ResultData(result); | return new ResultData(result); | ||||
| } | } | ||||
| @ApiOperation("卡营销列表记录导出") | |||||
| @GetMapping("/cardCountExportData") | |||||
| @SystemControllerLog(description = "营销统计-卡营销数据导出") | |||||
| public void cardCountExportData(@ModelAttribute WxCoupon wxCoupon, HttpServletRequest request, HttpServletResponse response) { | |||||
| //默认时间本月第一天,截止到当天 | |||||
| TenantEntity tenantEntity = getTenantInfo(); | |||||
| List<TenantEntity> tenantEntitys = wxMallService.getTenantEntitys(tenantEntity); | |||||
| if (wxCoupon.getStartdate() == null) { | |||||
| wxCoupon.setStartdate(DateUtils.getFirstDayForCurrMonth()); | |||||
| } | |||||
| if (wxCoupon.getEnddate() == null) { | |||||
| wxCoupon.setEnddate(DateUtils.stringToDate(DateUtils.getSystemTime("yyyy-MM-dd") + " 23:59:59")); | |||||
| } | |||||
| wxCoupon.setSourceType(EnumCouponSourceType.COUPONSource_Admin.getCode()); | |||||
| wxCouponService.exportCardData(wxCoupon,tenantEntitys, request, response); | |||||
| } | |||||
| @ApiOperation("券营销列表接口") | @ApiOperation("券营销列表接口") | ||||
| @GetMapping("findCouponCountList") | @GetMapping("findCouponCountList") | ||||
| @@ -371,6 +389,24 @@ public class WxCouponController extends BaseController { | |||||
| } | } | ||||
| return new ResultData(pageInfo); | return new ResultData(pageInfo); | ||||
| } | } | ||||
| @ApiOperation("券营销列表记录导出") | |||||
| @GetMapping("/couponCountExportData") | |||||
| @SystemControllerLog(description = "营销统计-券营销数据导出") | |||||
| public void couponCountExportData(@ModelAttribute WxCoupon wxCoupon, HttpServletRequest request, HttpServletResponse response) { | |||||
| //默认时间本月第一天,截止到当天 | |||||
| TenantEntity tenantEntity = getTenantInfo(); | |||||
| List<TenantEntity> tenantEntitys = wxMallService.getTenantEntitys(tenantEntity); | |||||
| if (wxCoupon.getStartdate() == null) { | |||||
| wxCoupon.setStartdate(DateUtils.getFirstDayForCurrMonth()); | |||||
| } | |||||
| if (wxCoupon.getEnddate() == null) { | |||||
| wxCoupon.setEnddate(DateUtils.stringToDate(DateUtils.getSystemTime("yyyy-MM-dd") + " 23:59:59")); | |||||
| } | |||||
| wxCoupon.setSourceType(EnumCouponSourceType.COUPONSource_Admin.getCode()); | |||||
| wxCouponService.exportCouponData(wxCoupon,tenantEntitys, request, response); | |||||
| } | |||||
| @ApiOperation("砍价营销列表接口") | @ApiOperation("砍价营销列表接口") | ||||
| @GetMapping("findPressCountList") | @GetMapping("findPressCountList") | ||||
| @@ -387,6 +423,18 @@ public class WxCouponController extends BaseController { | |||||
| PageInfo<WxCouponStatisVo> pages = wxCouponService.findPressData(wxCoupon,tenantEntitys,pageNum,pageSize); | PageInfo<WxCouponStatisVo> pages = wxCouponService.findPressData(wxCoupon,tenantEntitys,pageNum,pageSize); | ||||
| return new ResultData(pages); | return new ResultData(pages); | ||||
| } | } | ||||
| @ApiOperation("砍价营销列表记录导出") | |||||
| @GetMapping("/pressCountExportData") | |||||
| @SystemControllerLog(description = "营销统计-券营销数据导出") | |||||
| public void pressCountExportData(@ModelAttribute WxCoupon wxCoupon, HttpServletRequest request, HttpServletResponse response) { | |||||
| //默认时间本月第一天,截止到当天 | |||||
| TenantEntity tenantEntity = getTenantInfo(); | |||||
| List<TenantEntity> tenantEntitys = wxMallService.getTenantEntitys(tenantEntity); | |||||
| wxCoupon.updateTenantInfo(tenantEntity); | |||||
| wxCoupon.setSourceType(EnumCouponSourceType.COUPONSource_Admin.getCode()); | |||||
| wxCouponService.exportPressData(wxCoupon,tenantEntitys, request, response); | |||||
| } | |||||
| @GetMapping("exportCouponPassword") | @GetMapping("exportCouponPassword") | ||||
| @SystemControllerLog(description = "卡券兑换码-导出数据") | @SystemControllerLog(description = "卡券兑换码-导出数据") | ||||
| @@ -22,6 +22,9 @@ import org.springframework.web.bind.annotation.RestController; | |||||
| import java.util.List; | import java.util.List; | ||||
| import javax.servlet.http.HttpServletRequest; | |||||
| import javax.servlet.http.HttpServletResponse; | |||||
| @RestController | @RestController | ||||
| @RequestMapping("/orderGroup") | @RequestMapping("/orderGroup") | ||||
| @Api(description = "拼团相关接口") | @Api(description = "拼团相关接口") | ||||
| @@ -48,5 +51,18 @@ public class WxOrderGroupController extends BaseController { | |||||
| final PageInfo<WxOrderGroupMarketing> page = wxOrderGroupService.queryOrderGroupMarketingList(wxOrderGroupMarketing,tenantEntitys, pageNum, pageSize); | final PageInfo<WxOrderGroupMarketing> page = wxOrderGroupService.queryOrderGroupMarketingList(wxOrderGroupMarketing,tenantEntitys, pageNum, pageSize); | ||||
| return new ResultData(page); | return new ResultData(page); | ||||
| } | } | ||||
| @ApiOperation(value = "拼团营销数据导出") | |||||
| @GetMapping("exportOrderGroupMarketingList") | |||||
| @ApiImplicitParams({ | |||||
| @ApiImplicitParam(name = "couponId", value = "couponId", dataType = "String", paramType = "query") | |||||
| }) | |||||
| @SystemControllerLog(description = "营销统计-拼团营销数据导出") | |||||
| public void exportOrderGroupMarketingList(@ModelAttribute WxOrderGroupMarketing wxOrderGroupMarketing, HttpServletRequest request, HttpServletResponse response) { | |||||
| TenantEntity tenantEntity = getTenantInfo(); | |||||
| List<TenantEntity> tenantEntitys = wxMallService.getTenantEntitys(tenantEntity); | |||||
| wxOrderGroupMarketing.updateTenantInfo(tenantEntity); | |||||
| wxOrderGroupService.exportOrderGroupMarketingList(wxOrderGroupMarketing,tenantEntitys, request, response); | |||||
| } | |||||
| } | } | ||||
| @@ -6,6 +6,8 @@ import com.iformall.common.SortColumn; | |||||
| import com.iformall.domain.po.base.TenantEntity; | import com.iformall.domain.po.base.TenantEntity; | ||||
| import com.iformall.domain.vo.WxCouponStatisVo; | import com.iformall.domain.vo.WxCouponStatisVo; | ||||
| import com.iformall.enums.EnumCouponType; | import com.iformall.enums.EnumCouponType; | ||||
| import cn.afterturn.easypoi.excel.annotation.Excel; | |||||
| import lombok.Data; | import lombok.Data; | ||||
| import lombok.EqualsAndHashCode; | import lombok.EqualsAndHashCode; | ||||
| import lombok.ToString; | import lombok.ToString; | ||||
| @@ -66,11 +68,13 @@ public class WxCoupon extends TenantEntity { | |||||
| @io.swagger.annotations.ApiModelProperty(value="详情多图",name="detailPicture") | @io.swagger.annotations.ApiModelProperty(value="详情多图",name="detailPicture") | ||||
| private String detailPicture; | private String detailPicture; | ||||
| @io.swagger.annotations.ApiModelProperty(value="券名称",name="title") | @io.swagger.annotations.ApiModelProperty(value="券名称",name="title") | ||||
| @Excel(name="名称",width = 20,orderNum = "1") | |||||
| private String title; | private String title; | ||||
| @io.swagger.annotations.ApiModelProperty(value="副标题",name="subTitle") | @io.swagger.annotations.ApiModelProperty(value="副标题",name="subTitle") | ||||
| private String subTitle; | private String subTitle; | ||||
| @io.swagger.annotations.ApiModelProperty(value="售价(适用于类型2,3,4,5, 6, 8, 9, 100)",name="salePrice") | @io.swagger.annotations.ApiModelProperty(value="售价(适用于类型2,3,4,5, 6, 8, 9, 100)",name="salePrice") | ||||
| @Excel(name="售价(分)",width = 20,orderNum = "3") | |||||
| private Integer salePrice; | private Integer salePrice; | ||||
| @io.swagger.annotations.ApiModelProperty(value="使用条件金额(适用于类型1,2,3,4)",name="usePrice") | @io.swagger.annotations.ApiModelProperty(value="使用条件金额(适用于类型1,2,3,4)",name="usePrice") | ||||
| private Integer usePrice; | private Integer usePrice; | ||||
| @@ -89,6 +93,7 @@ public class WxCoupon extends TenantEntity { | |||||
| @io.swagger.annotations.ApiModelProperty(value="须知",name="detail") | @io.swagger.annotations.ApiModelProperty(value="须知",name="detail") | ||||
| private String detail; | private String detail; | ||||
| @io.swagger.annotations.ApiModelProperty(value="面额",name="price") | @io.swagger.annotations.ApiModelProperty(value="面额",name="price") | ||||
| @Excel(name="面额(分)",width = 20,orderNum = "2") | |||||
| private Integer price; | private Integer price; | ||||
| @io.swagger.annotations.ApiModelProperty(value="单位(0:rmb分 1:小时*100)",name="unit") | @io.swagger.annotations.ApiModelProperty(value="单位(0:rmb分 1:小时*100)",name="unit") | ||||
| private Integer unit; | private Integer unit; | ||||
| @@ -2,6 +2,8 @@ package com.iformall.domain.vo; | |||||
| import com.baomidou.mybatisplus.annotation.TableField; | import com.baomidou.mybatisplus.annotation.TableField; | ||||
| import com.iformall.domain.po.WxCoupon; | import com.iformall.domain.po.WxCoupon; | ||||
| import cn.afterturn.easypoi.excel.annotation.Excel; | |||||
| import lombok.Data; | import lombok.Data; | ||||
| import lombok.EqualsAndHashCode; | import lombok.EqualsAndHashCode; | ||||
| import lombok.ToString; | import lombok.ToString; | ||||
| @@ -23,18 +25,22 @@ public class WxCouponStatisVo extends WxCoupon { | |||||
| @TableField(exist = false) | @TableField(exist = false) | ||||
| @io.swagger.annotations.ApiModelProperty(value="售出卡数量",name="saleCount") | @io.swagger.annotations.ApiModelProperty(value="售出卡数量",name="saleCount") | ||||
| @Excel(name="售出数量",width = 20,orderNum = "4") | |||||
| private Integer saleCount; | private Integer saleCount; | ||||
| @TableField(exist = false) | @TableField(exist = false) | ||||
| @io.swagger.annotations.ApiModelProperty(value="转增数量",name="transferCount") | @io.swagger.annotations.ApiModelProperty(value="转增数量",name="transferCount") | ||||
| @Excel(name="转赠数量",width = 20,orderNum = "5") | |||||
| private Integer transferCount; | private Integer transferCount; | ||||
| @TableField(exist = false) | @TableField(exist = false) | ||||
| @io.swagger.annotations.ApiModelProperty(value="售出金额",name="saleAmount") | @io.swagger.annotations.ApiModelProperty(value="售出金额",name="saleAmount") | ||||
| @Excel(name="售出金额(分)",width = 20,orderNum = "6") | |||||
| private Integer saleAmount; | private Integer saleAmount; | ||||
| @TableField(exist = false) | @TableField(exist = false) | ||||
| @io.swagger.annotations.ApiModelProperty(value="核销数量",name="sumPayment") | @io.swagger.annotations.ApiModelProperty(value="核销数量",name="sumPayment") | ||||
| @Excel(name="核销金额(分)",width = 20,orderNum = "7") | |||||
| private Integer sumPayment; | private Integer sumPayment; | ||||
| @TableField(exist = false) | @TableField(exist = false) | ||||
| @@ -55,10 +61,12 @@ public class WxCouponStatisVo extends WxCoupon { | |||||
| @TableField(exist = false) | @TableField(exist = false) | ||||
| @io.swagger.annotations.ApiModelProperty(value="商场补贴",name="sumSubsidy") | @io.swagger.annotations.ApiModelProperty(value="商场补贴",name="sumSubsidy") | ||||
| @Excel(name="商场补贴(分)",width = 20,orderNum = "9") | |||||
| private Integer sumSubsidy; | private Integer sumSubsidy; | ||||
| @TableField(exist = false) | @TableField(exist = false) | ||||
| @io.swagger.annotations.ApiModelProperty(value="核销比",name="paymentRateStr") | @io.swagger.annotations.ApiModelProperty(value="核销比",name="paymentRateStr") | ||||
| @Excel(name="核销比",width = 20,orderNum = "8") | |||||
| private String paymentRateStr; | private String paymentRateStr; | ||||
| @TableField(exist = false) | @TableField(exist = false) | ||||
| @@ -1,6 +1,8 @@ | |||||
| package com.iformall.domain.vo; | package com.iformall.domain.vo; | ||||
| import com.iformall.domain.po.base.TenantEntity; | import com.iformall.domain.po.base.TenantEntity; | ||||
| import cn.afterturn.easypoi.excel.annotation.Excel; | |||||
| import lombok.Data; | import lombok.Data; | ||||
| import lombok.EqualsAndHashCode; | import lombok.EqualsAndHashCode; | ||||
| import lombok.ToString; | import lombok.ToString; | ||||
| @@ -12,15 +14,34 @@ public class WxOrderGroupMarketing extends TenantEntity { | |||||
| private String couponId; | private String couponId; | ||||
| private String coverImg; | private String coverImg; | ||||
| @Excel(name="名称",width = 20,orderNum = "1") | |||||
| private String title; | private String title; | ||||
| @Excel(name="原价(分)",width = 20,orderNum = "2") | |||||
| private String price; | private String price; | ||||
| @Excel(name="底价(分)",width = 20,orderNum = "3") | |||||
| private String salePrice; | private String salePrice; | ||||
| @Excel(name="发起次数",width = 20,orderNum = "4") | |||||
| private String groupTotalCount; | private String groupTotalCount; | ||||
| @Excel(name="成功次数",width = 20,orderNum = "5") | |||||
| private String groupSuccessCount; | private String groupSuccessCount; | ||||
| @Excel(name="妆化率",width = 20,orderNum = "6") | |||||
| private String groupTransferRatio; | private String groupTransferRatio; | ||||
| @Excel(name="成功拼团人次",width = 20,orderNum = "7") | |||||
| private String successPeople; | private String successPeople; | ||||
| @Excel(name="核销数",width = 20,orderNum = "8") | |||||
| private String verifyCount; | private String verifyCount; | ||||
| @Excel(name="核销比",width = 20,orderNum = "9") | |||||
| private String verifyRatio; | private String verifyRatio; | ||||
| @Excel(name="参与人次",width = 20,orderNum = "10") | |||||
| private String totalPeople; | private String totalPeople; | ||||
| @@ -1,6 +1,10 @@ | |||||
| package com.iformall.service; | package com.iformall.service; | ||||
| import java.util.*; | import java.util.*; | ||||
| import javax.servlet.http.HttpServletRequest; | |||||
| import javax.servlet.http.HttpServletResponse; | |||||
| import com.github.pagehelper.PageInfo; | import com.github.pagehelper.PageInfo; | ||||
| import com.iformall.common.ResultData; | import com.iformall.common.ResultData; | ||||
| import com.iformall.domain.po.WxCoupon; | import com.iformall.domain.po.WxCoupon; | ||||
| @@ -30,6 +34,8 @@ public interface WxCouponService { | |||||
| * @return | * @return | ||||
| */ | */ | ||||
| PageInfo<WxCouponStatisVo> findCountData(WxCoupon record, List<TenantEntity> tenantEntitys, Integer pageNum, Integer pageSize); | PageInfo<WxCouponStatisVo> findCountData(WxCoupon record, List<TenantEntity> tenantEntitys, Integer pageNum, Integer pageSize); | ||||
| void exportCardData(WxCoupon record, List<TenantEntity> tenantEntitys, HttpServletRequest request, HttpServletResponse response); | |||||
| /** | /** | ||||
| * 券列表,包括统计 | * 券列表,包括统计 | ||||
| @@ -38,6 +44,8 @@ public interface WxCouponService { | |||||
| * @return | * @return | ||||
| */ | */ | ||||
| PageInfo<WxCouponStatisVo> findCouponData(WxCoupon record, List<TenantEntity> tenantEntitys, Integer pageNum, Integer pageSize); | PageInfo<WxCouponStatisVo> findCouponData(WxCoupon record, List<TenantEntity> tenantEntitys, Integer pageNum, Integer pageSize); | ||||
| void exportCouponData(WxCoupon record, List<TenantEntity> tenantEntitys, HttpServletRequest request, HttpServletResponse response); | |||||
| /** | /** | ||||
| * 砍价列表,包括统计 | * 砍价列表,包括统计 | ||||
| @@ -49,6 +57,8 @@ public interface WxCouponService { | |||||
| */ | */ | ||||
| PageInfo<WxCouponStatisVo> findPressData(WxCoupon record, List<TenantEntity> tenantEntitys, Integer pageNum, Integer pageSize); | PageInfo<WxCouponStatisVo> findPressData(WxCoupon record, List<TenantEntity> tenantEntitys, Integer pageNum, Integer pageSize); | ||||
| void exportPressData(WxCoupon record, List<TenantEntity> tenantEntitys, HttpServletRequest request, HttpServletResponse response); | |||||
| /** | /** | ||||
| * 根据Id获得实体 | * 根据Id获得实体 | ||||
| * | * | ||||
| @@ -11,6 +11,9 @@ import com.iformall.domain.vo.WxOrderGroupMarketing; | |||||
| import java.util.List; | import java.util.List; | ||||
| import java.util.Map; | import java.util.Map; | ||||
| import javax.servlet.http.HttpServletRequest; | |||||
| import javax.servlet.http.HttpServletResponse; | |||||
| /** | /** | ||||
| * @author gongbiao | * @author gongbiao | ||||
| */ | */ | ||||
| @@ -34,4 +37,6 @@ public interface WxOrderGroupService { | |||||
| PageInfo<WxOrderGroupMarketing> queryOrderGroupMarketingList(WxOrderGroupMarketing marketing, List<TenantEntity> tenantEntitys, Integer pageNum, Integer pageSize); | PageInfo<WxOrderGroupMarketing> queryOrderGroupMarketingList(WxOrderGroupMarketing marketing, List<TenantEntity> tenantEntitys, Integer pageNum, Integer pageSize); | ||||
| void exportOrderGroupMarketingList(WxOrderGroupMarketing marketing, List<TenantEntity> tenantEntitys, HttpServletRequest request, HttpServletResponse response); | |||||
| } | } | ||||
| @@ -0,0 +1,49 @@ | |||||
| package com.iformall.service.excel; | |||||
| import java.util.ArrayList; | |||||
| import java.util.List; | |||||
| import java.util.Map; | |||||
| import org.springframework.beans.factory.annotation.Autowired; | |||||
| import org.springframework.stereotype.Service; | |||||
| import com.iformall.domain.po.WxCoupon; | |||||
| import com.iformall.domain.po.base.TenantEntity; | |||||
| import com.iformall.domain.vo.WxCouponStatisVo; | |||||
| import com.iformall.mapper.WxCouponMapper; | |||||
| import cn.afterturn.easypoi.handler.inter.IExcelExportServer; | |||||
| /** | |||||
| * 营销数据- 卡营销数据导出 | |||||
| * @author alascor | |||||
| * | |||||
| */ | |||||
| @Service | |||||
| public class WxCardDataExporter implements IExcelExportServer { | |||||
| @Autowired | |||||
| WxCouponMapper wxCouponMapper; | |||||
| @Override | |||||
| public List<Object> selectListForExcelExport(Object queryParams, int page) { | |||||
| //因为mapper不支持分页 | |||||
| if (page > 1) { | |||||
| return null; | |||||
| } | |||||
| Map map = (Map) queryParams; | |||||
| WxCoupon record = (WxCoupon) map.get("record"); | |||||
| record.setLimitStart((page-1)*100000); | |||||
| record.setLimitEnd(100000); | |||||
| List<WxCouponStatisVo> list = wxCouponMapper.findCountData((List<TenantEntity>)map.get("tenantEntitys"),record); | |||||
| if (null != list && list.size() > 0 ) { | |||||
| List<Object> retList = new ArrayList<Object>(); | |||||
| retList.addAll(list); | |||||
| return retList; | |||||
| } | |||||
| return null; | |||||
| } | |||||
| } | |||||
| @@ -0,0 +1,49 @@ | |||||
| package com.iformall.service.excel; | |||||
| import java.util.ArrayList; | |||||
| import java.util.List; | |||||
| import java.util.Map; | |||||
| import org.springframework.beans.factory.annotation.Autowired; | |||||
| import org.springframework.stereotype.Service; | |||||
| import com.iformall.domain.po.WxCoupon; | |||||
| import com.iformall.domain.po.base.TenantEntity; | |||||
| import com.iformall.domain.vo.WxCouponStatisVo; | |||||
| import com.iformall.mapper.WxCouponMapper; | |||||
| import cn.afterturn.easypoi.handler.inter.IExcelExportServer; | |||||
| /** | |||||
| * 营销数据- 券营销数据导出 | |||||
| * @author alascor | |||||
| * | |||||
| */ | |||||
| @Service | |||||
| public class WxCouponDataExporter implements IExcelExportServer { | |||||
| @Autowired | |||||
| WxCouponMapper wxCouponMapper; | |||||
| @Override | |||||
| public List<Object> selectListForExcelExport(Object queryParams, int page) { | |||||
| //因为mapper不支持分页 | |||||
| if (page > 1) { | |||||
| return null; | |||||
| } | |||||
| Map map = (Map) queryParams; | |||||
| WxCoupon record = (WxCoupon) map.get("record"); | |||||
| record.setLimitStart((page-1)*100000); | |||||
| record.setLimitEnd(100000); | |||||
| List<WxCouponStatisVo> list = wxCouponMapper.findCouponData((List<TenantEntity>)map.get("tenantEntitys"),record); | |||||
| if (null != list && list.size() > 0 ) { | |||||
| List<Object> retList = new ArrayList<Object>(); | |||||
| retList.addAll(list); | |||||
| return retList; | |||||
| } | |||||
| return null; | |||||
| } | |||||
| } | |||||
| @@ -0,0 +1,51 @@ | |||||
| package com.iformall.service.excel; | |||||
| import java.util.ArrayList; | |||||
| import java.util.List; | |||||
| import java.util.Map; | |||||
| import org.springframework.beans.factory.annotation.Autowired; | |||||
| import org.springframework.stereotype.Service; | |||||
| import com.iformall.domain.po.WxCoupon; | |||||
| import com.iformall.domain.po.base.TenantEntity; | |||||
| import com.iformall.domain.vo.WxCouponStatisVo; | |||||
| import com.iformall.domain.vo.WxOrderGroupMarketing; | |||||
| import com.iformall.mapper.WxCouponMapper; | |||||
| import com.iformall.mapper.WxOrderGroupMapper; | |||||
| import cn.afterturn.easypoi.handler.inter.IExcelExportServer; | |||||
| /** | |||||
| * 营销数据- 卡营销数据导出 | |||||
| * @author alascor | |||||
| * | |||||
| */ | |||||
| @Service | |||||
| public class WxOrderGroupDataExporter implements IExcelExportServer { | |||||
| @Autowired | |||||
| WxOrderGroupMapper wxOrderGroupMapper; | |||||
| @Override | |||||
| public List<Object> selectListForExcelExport(Object queryParams, int page) { | |||||
| //因为mapper不支持分页 | |||||
| if (page > 1) { | |||||
| return null; | |||||
| } | |||||
| Map map = (Map) queryParams; | |||||
| WxOrderGroupMarketing record = (WxOrderGroupMarketing) map.get("record"); | |||||
| //record.setLimitStart((page-1)*100000); | |||||
| //record.setLimitEnd(100000); | |||||
| List<WxOrderGroupMarketing> list = wxOrderGroupMapper.queryOrderGroupMarketingList((List<TenantEntity>)map.get("tenantEntitys"),record); | |||||
| if (null != list && list.size() > 0 ) { | |||||
| List<Object> retList = new ArrayList<Object>(); | |||||
| retList.addAll(list); | |||||
| return retList; | |||||
| } | |||||
| return null; | |||||
| } | |||||
| } | |||||
| @@ -0,0 +1,49 @@ | |||||
| package com.iformall.service.excel; | |||||
| import java.util.ArrayList; | |||||
| import java.util.List; | |||||
| import java.util.Map; | |||||
| import org.springframework.beans.factory.annotation.Autowired; | |||||
| import org.springframework.stereotype.Service; | |||||
| import com.iformall.domain.po.WxCoupon; | |||||
| import com.iformall.domain.po.base.TenantEntity; | |||||
| import com.iformall.domain.vo.WxCouponStatisVo; | |||||
| import com.iformall.mapper.WxCouponMapper; | |||||
| import cn.afterturn.easypoi.handler.inter.IExcelExportServer; | |||||
| /** | |||||
| * 营销数据- 卡营销数据导出 | |||||
| * @author alascor | |||||
| * | |||||
| */ | |||||
| @Service | |||||
| public class WxPressDataExporter implements IExcelExportServer { | |||||
| @Autowired | |||||
| WxCouponMapper wxCouponMapper; | |||||
| @Override | |||||
| public List<Object> selectListForExcelExport(Object queryParams, int page) { | |||||
| //因为mapper不支持分页 | |||||
| if (page > 1) { | |||||
| return null; | |||||
| } | |||||
| Map map = (Map) queryParams; | |||||
| WxCoupon record = (WxCoupon) map.get("record"); | |||||
| record.setLimitStart((page-1)*100000); | |||||
| record.setLimitEnd(100000); | |||||
| List<WxCouponStatisVo> list = wxCouponMapper.findPressData((List<TenantEntity>)map.get("tenantEntitys"),record); | |||||
| if (null != list && list.size() > 0 ) { | |||||
| List<Object> retList = new ArrayList<Object>(); | |||||
| retList.addAll(list); | |||||
| return retList; | |||||
| } | |||||
| return null; | |||||
| } | |||||
| } | |||||
| @@ -14,6 +14,7 @@ import com.iformall.domain.dto.WxCouponMerchantDto; | |||||
| import com.iformall.domain.po.*; | import com.iformall.domain.po.*; | ||||
| import com.iformall.domain.po.base.BaseEntity; | import com.iformall.domain.po.base.BaseEntity; | ||||
| import com.iformall.domain.po.base.TenantEntity; | import com.iformall.domain.po.base.TenantEntity; | ||||
| import com.iformall.domain.vo.WxCUserBasicInfoVo; | |||||
| import com.iformall.domain.vo.WxCouponCVo; | import com.iformall.domain.vo.WxCouponCVo; | ||||
| import com.iformall.domain.vo.WxCouponChannelVo; | import com.iformall.domain.vo.WxCouponChannelVo; | ||||
| import com.iformall.domain.vo.WxCouponStatisVo; | import com.iformall.domain.vo.WxCouponStatisVo; | ||||
| @@ -22,6 +23,12 @@ import com.iformall.enums.*; | |||||
| import com.iformall.exception.MallinkException; | import com.iformall.exception.MallinkException; | ||||
| import com.iformall.mapper.*; | import com.iformall.mapper.*; | ||||
| import com.iformall.service.*; | import com.iformall.service.*; | ||||
| import com.iformall.service.excel.WxCardDataExporter; | |||||
| import com.iformall.service.excel.WxCouponDataExporter; | |||||
| import com.iformall.service.excel.WxPressDataExporter; | |||||
| import cn.afterturn.easypoi.handler.inter.IExcelExportServer; | |||||
| import org.apache.commons.collections.CollectionUtils; | import org.apache.commons.collections.CollectionUtils; | ||||
| import org.apache.commons.lang3.StringUtils; | import org.apache.commons.lang3.StringUtils; | ||||
| import org.slf4j.Logger; | import org.slf4j.Logger; | ||||
| @@ -38,6 +45,9 @@ import java.math.BigDecimal; | |||||
| import java.util.*; | import java.util.*; | ||||
| import java.util.stream.Collectors; | import java.util.stream.Collectors; | ||||
| import javax.servlet.http.HttpServletRequest; | |||||
| import javax.servlet.http.HttpServletResponse; | |||||
| @Service | @Service | ||||
| public class WxCouponServiceImpl implements WxCouponService { | public class WxCouponServiceImpl implements WxCouponService { | ||||
| @@ -84,6 +94,18 @@ public class WxCouponServiceImpl implements WxCouponService { | |||||
| @Autowired | @Autowired | ||||
| WxCardTransferInfoMapper wxCardTransferInfoMapper; | WxCardTransferInfoMapper wxCardTransferInfoMapper; | ||||
| @Autowired | |||||
| ExcelService excelService; | |||||
| @Autowired | |||||
| WxCardDataExporter cardDataExporter; | |||||
| @Autowired | |||||
| WxCouponDataExporter couponDataExporter; | |||||
| @Autowired | |||||
| WxPressDataExporter pressDataExporter; | |||||
| @Autowired | @Autowired | ||||
| @Qualifier("couponChannelRedisTemplate") | @Qualifier("couponChannelRedisTemplate") | ||||
| @@ -176,7 +198,16 @@ public class WxCouponServiceImpl implements WxCouponService { | |||||
| public PageInfo<WxCouponStatisVo> findCountData(WxCoupon record, List<TenantEntity> tenantEntitys, Integer pageNum, Integer pageSize) { | public PageInfo<WxCouponStatisVo> findCountData(WxCoupon record, List<TenantEntity> tenantEntitys, Integer pageNum, Integer pageSize) { | ||||
| return PageHelper.startPage(pageNum, pageSize).doSelectPageInfo(() -> wxCouponMapper.findCountData(tenantEntitys,record)); | return PageHelper.startPage(pageNum, pageSize).doSelectPageInfo(() -> wxCouponMapper.findCountData(tenantEntitys,record)); | ||||
| } | } | ||||
| @Override | |||||
| public void exportCardData(WxCoupon record, List<TenantEntity> tenantEntitys, HttpServletRequest request, | |||||
| HttpServletResponse response) { | |||||
| Map map = new HashMap(); | |||||
| map.put("record", record); | |||||
| map.put("tenantEntitys", tenantEntitys); | |||||
| excelService.exportBigExcel(cardDataExporter,map, null, "卡营销数据信息", WxCouponStatisVo.class, "卡营销数据.xlsx", response, false); | |||||
| } | |||||
| @Override | @Override | ||||
| public WxCoupon getById(Long id,String tenantId) { | public WxCoupon getById(Long id,String tenantId) { | ||||
| return wxCouponMapper.selectById(id,tenantId); | return wxCouponMapper.selectById(id,tenantId); | ||||
| @@ -545,6 +576,15 @@ public class WxCouponServiceImpl implements WxCouponService { | |||||
| public PageInfo<WxCouponStatisVo> findCouponData(WxCoupon record, List<TenantEntity> tenantEntitys, Integer pageNum, Integer pageSize) { | public PageInfo<WxCouponStatisVo> findCouponData(WxCoupon record, List<TenantEntity> tenantEntitys, Integer pageNum, Integer pageSize) { | ||||
| return PageHelper.startPage(pageNum, pageSize).doSelectPageInfo(() -> wxCouponMapper.findCouponData(tenantEntitys,record)); | return PageHelper.startPage(pageNum, pageSize).doSelectPageInfo(() -> wxCouponMapper.findCouponData(tenantEntitys,record)); | ||||
| } | } | ||||
| @Override | |||||
| public void exportCouponData(WxCoupon record, List<TenantEntity> tenantEntitys, HttpServletRequest request, | |||||
| HttpServletResponse response) { | |||||
| Map map = new HashMap(); | |||||
| map.put("record", record); | |||||
| map.put("tenantEntitys", tenantEntitys); | |||||
| excelService.exportBigExcel(couponDataExporter,map, null, "券营销数据信息", WxCouponStatisVo.class, "券营销数据.xlsx", response, false); | |||||
| } | |||||
| @Override | @Override | ||||
| public List<WxCouponStatisVo> findCouponOrderCount(List<TenantEntity> tenantEntitys, WxCoupon wxCoupon) { | public List<WxCouponStatisVo> findCouponOrderCount(List<TenantEntity> tenantEntitys, WxCoupon wxCoupon) { | ||||
| @@ -612,6 +652,15 @@ public class WxCouponServiceImpl implements WxCouponService { | |||||
| public PageInfo<WxCouponStatisVo> findPressData(WxCoupon record, List<TenantEntity> tenantEntitys, Integer pageNum, Integer pageSize) { | public PageInfo<WxCouponStatisVo> findPressData(WxCoupon record, List<TenantEntity> tenantEntitys, Integer pageNum, Integer pageSize) { | ||||
| return PageHelper.startPage(pageNum, pageSize).doSelectPageInfo(() -> wxCouponMapper.findPressData(tenantEntitys,record)); | return PageHelper.startPage(pageNum, pageSize).doSelectPageInfo(() -> wxCouponMapper.findPressData(tenantEntitys,record)); | ||||
| } | } | ||||
| @Override | |||||
| public void exportPressData(WxCoupon record, List<TenantEntity> tenantEntitys, HttpServletRequest request, | |||||
| HttpServletResponse response) { | |||||
| Map map = new HashMap(); | |||||
| map.put("record", record); | |||||
| map.put("tenantEntitys", tenantEntitys); | |||||
| excelService.exportBigExcel(pressDataExporter,map, null, "砍价营销数据信息", WxCouponStatisVo.class, "砍价营销数据.xlsx", response, false); | |||||
| } | |||||
| @Override | @Override | ||||
| public List<WxCouponStatisVo> pressSendHistory(List<TenantEntity> tenantEntitys, WxCoupon wxCoupon) { | public List<WxCouponStatisVo> pressSendHistory(List<TenantEntity> tenantEntitys, WxCoupon wxCoupon) { | ||||
| @@ -827,4 +876,5 @@ public class WxCouponServiceImpl implements WxCouponService { | |||||
| return new ResultData(); | return new ResultData(); | ||||
| } | } | ||||
| } | } | ||||
| @@ -9,13 +9,16 @@ import com.iformall.common.Result; | |||||
| import com.iformall.common.ResultData; | import com.iformall.common.ResultData; | ||||
| import com.iformall.domain.po.*; | import com.iformall.domain.po.*; | ||||
| import com.iformall.domain.po.base.TenantEntity; | import com.iformall.domain.po.base.TenantEntity; | ||||
| import com.iformall.domain.vo.WxCouponStatisVo; | |||||
| import com.iformall.domain.vo.WxOrderGroupMarketing; | import com.iformall.domain.vo.WxOrderGroupMarketing; | ||||
| import com.iformall.enums.*; | import com.iformall.enums.*; | ||||
| import com.iformall.exception.MallinkException; | import com.iformall.exception.MallinkException; | ||||
| import com.iformall.mapper.*; | import com.iformall.mapper.*; | ||||
| import com.iformall.service.ExcelService; | |||||
| import com.iformall.service.WxOrderGroupService; | import com.iformall.service.WxOrderGroupService; | ||||
| import com.iformall.service.WxOrderService; | import com.iformall.service.WxOrderService; | ||||
| import com.iformall.service.WxRefundOrderService; | import com.iformall.service.WxRefundOrderService; | ||||
| import com.iformall.service.excel.WxOrderGroupDataExporter; | |||||
| import com.iformall.utils.DateUtils; | import com.iformall.utils.DateUtils; | ||||
| import com.iformall.utils.RedisLock; | import com.iformall.utils.RedisLock; | ||||
| import org.slf4j.Logger; | import org.slf4j.Logger; | ||||
| @@ -28,6 +31,9 @@ import org.springframework.transaction.annotation.Transactional; | |||||
| import java.util.*; | import java.util.*; | ||||
| import java.util.stream.Collectors; | import java.util.stream.Collectors; | ||||
| import javax.servlet.http.HttpServletRequest; | |||||
| import javax.servlet.http.HttpServletResponse; | |||||
| /** | /** | ||||
| * @author gongbiao | * @author gongbiao | ||||
| */ | */ | ||||
| @@ -71,6 +77,12 @@ public class WxOrderGroupServiceImpl implements WxOrderGroupService { | |||||
| @Autowired | @Autowired | ||||
| WxPayOrderMapper wxPayOrderMapper; | WxPayOrderMapper wxPayOrderMapper; | ||||
| @Autowired | |||||
| ExcelService excelService; | |||||
| @Autowired | |||||
| WxOrderGroupDataExporter orderGroupDataExporter; | |||||
| public int updateOrderGroup(WxOrderGroup wxOrderGroup,WxOrder order, WxCoupon wxCoupon) { | public int updateOrderGroup(WxOrderGroup wxOrderGroup,WxOrder order, WxCoupon wxCoupon) { | ||||
| if (null != order.getOrderGroupId() && (!order.getOrderGroupId().equals(0L))) { | if (null != order.getOrderGroupId() && (!order.getOrderGroupId().equals(0L))) { | ||||
| @@ -412,6 +424,15 @@ public class WxOrderGroupServiceImpl implements WxOrderGroupService { | |||||
| PageInfo<WxOrderGroupMarketing> pageInfo = new PageInfo<>(result); | PageInfo<WxOrderGroupMarketing> pageInfo = new PageInfo<>(result); | ||||
| return pageInfo; | return pageInfo; | ||||
| } | } | ||||
| @Override | |||||
| public void exportOrderGroupMarketingList(WxOrderGroupMarketing marketing, List<TenantEntity> tenantEntitys, | |||||
| HttpServletRequest request, HttpServletResponse response) { | |||||
| Map map = new HashMap(); | |||||
| map.put("record", marketing); | |||||
| map.put("tenantEntitys", tenantEntitys); | |||||
| excelService.exportBigExcel(orderGroupDataExporter,map, null, "拼团营销数据信息", WxOrderGroupMarketing.class, "拼团营销数据.xlsx", response, false); | |||||
| } | |||||
| public void returnMoney(WxOrderGroup group) { | public void returnMoney(WxOrderGroup group) { | ||||
| //券失效或拼团超时 修改 拼团的状态 | //券失效或拼团超时 修改 拼团的状态 | ||||
| @@ -515,7 +515,7 @@ public class WxProfitSharingOrderServiceImpl implements WxProfitSharingOrderServ | |||||
| @Override | @Override | ||||
| public void exportData(WxProfitSharingOrderQueryVo order,HttpServletRequest request, HttpServletResponse response) { | public void exportData(WxProfitSharingOrderQueryVo order,HttpServletRequest request, HttpServletResponse response) { | ||||
| excelService.exportBigExcel(this,order, null, "会员信息", WxProfitSharingOrderVo.class, "会员信息数据.xlsx", response, false); | |||||
| excelService.exportBigExcel(this,order, null, "线上自动分账信息", WxProfitSharingOrderVo.class, "线上自动分账信息数据.xlsx", response, false); | |||||
| } | } | ||||
| @Override | @Override | ||||
| @@ -167,6 +167,12 @@ | |||||
| <if test=" null != sortColumns"> order by ${sortColumns} </if> | <if test=" null != sortColumns"> order by ${sortColumns} </if> | ||||
| <if test=" null == sortColumns">order by pso.id desc</if> | <if test=" null == sortColumns">order by pso.id desc</if> | ||||
| <if test=" null != begin "> | |||||
| limit #{begin}, #{limit} | |||||
| </if> | |||||
| </select> | </select> | ||||
| <select id="queryOrderForMerchantCount" resultType="Long" parameterType="hashmap"> | <select id="queryOrderForMerchantCount" resultType="Long" parameterType="hashmap"> | ||||