| @@ -482,7 +482,8 @@ public class WxCouponController extends BaseController { | |||||
| result.put("list", pageInfo); | result.put("list", pageInfo); | ||||
| return new ResultData(result); | return new ResultData(result); | ||||
| } | } | ||||
| @TenantIgnore | |||||
| @ApiOperation("卡营销列表记录导出") | @ApiOperation("卡营销列表记录导出") | ||||
| @GetMapping("/cardCountExportData") | @GetMapping("/cardCountExportData") | ||||
| @SystemControllerLog(description = "营销统计-卡营销数据导出") | @SystemControllerLog(description = "营销统计-卡营销数据导出") | ||||
| @@ -554,7 +555,8 @@ public class WxCouponController extends BaseController { | |||||
| } | } | ||||
| return new ResultData(pageInfo); | return new ResultData(pageInfo); | ||||
| } | } | ||||
| @TenantIgnore | |||||
| @ApiOperation("券营销列表记录导出") | @ApiOperation("券营销列表记录导出") | ||||
| @GetMapping("/couponCountExportData") | @GetMapping("/couponCountExportData") | ||||
| @SystemControllerLog(description = "营销统计-券营销数据导出") | @SystemControllerLog(description = "营销统计-券营销数据导出") | ||||
| @@ -612,10 +614,11 @@ public class WxCouponController extends BaseController { | |||||
| TenantEntity tenantEntity = getTenantInfo(); | TenantEntity tenantEntity = getTenantInfo(); | ||||
| List<TenantEntity> tenantEntitys = wxMallService.getTenantEntitys(tenantEntity); | List<TenantEntity> tenantEntitys = wxMallService.getTenantEntitys(tenantEntity); | ||||
| wxCoupon.updateTenantInfo(tenantEntity); | wxCoupon.updateTenantInfo(tenantEntity); | ||||
| wxCoupon.setSourceType(EnumCouponSourceType.COUPONSource_Admin.getCode()); | |||||
| handleCouponStartDate(wxCoupon); | handleCouponStartDate(wxCoupon); | ||||
| wxCoupon.setSourceType(EnumCouponSourceType.COUPONSource_Admin.getCode()); | |||||
| wxCouponService.exportPressData(wxCoupon,tenantEntitys, request, response); | wxCouponService.exportPressData(wxCoupon,tenantEntitys, request, response); | ||||
| } | } | ||||
| @@ -31,18 +31,7 @@ public class WxCardInfoServiceImpl implements WxCardInfoService { | |||||
| @Override | @Override | ||||
| public PageInfo<WxCardVo> listAsPage(WxCardVo record, Integer pageIndex, Integer pageSize) { | public PageInfo<WxCardVo> listAsPage(WxCardVo record, Integer pageIndex, Integer pageSize) { | ||||
| if (null != record.getCouponOnlineStartDate() || null != record.getCouponOnlineEndDate() ) { | |||||
| WxCouponChannel wxCouponChannelQ = new WxCouponChannel(); | |||||
| wxCouponChannelQ.updateTenantInfo(record); | |||||
| wxCouponChannelQ.setStartdate(record.getCouponOnlineStartDate()); | |||||
| wxCouponChannelQ.setEnddate(record.getCouponOnlineEndDate()); | |||||
| List<Long> ccIds = wxCouponChannelMapper.findCouponIdList(wxCouponChannelQ); | |||||
| if (null == ccIds || ccIds.size() <= 0 ) { | |||||
| record.setId(-999L); | |||||
| }else { | |||||
| record.setCouponIdList(ccIds); | |||||
| } | |||||
| } | |||||
| handleCouponOnlineEndDate(record); | |||||
| return PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxCardInfoMapper.findVoList(record)); | return PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxCardInfoMapper.findVoList(record)); | ||||
| } | } | ||||
| @@ -69,9 +58,26 @@ public class WxCardInfoServiceImpl implements WxCardInfoService { | |||||
| } | } | ||||
| @Override | @Override | ||||
| public void exportData(WxCardVo wxCardVo, HttpServletRequest request, HttpServletResponse response) { | |||||
| List<WxCardVo> list = wxCardInfoMapper.findVoList(wxCardVo); | |||||
| public void exportData(WxCardVo record, HttpServletRequest request, HttpServletResponse response) { | |||||
| handleCouponOnlineEndDate(record); | |||||
| List<WxCardVo> list = wxCardInfoMapper.findVoList(record); | |||||
| excelService.exportExcel(list, null, "卡订单", WxCardVo.class, "卡订单.xlsx", response, false); | excelService.exportExcel(list, null, "卡订单", WxCardVo.class, "卡订单.xlsx", response, false); | ||||
| } | } | ||||
| private void handleCouponOnlineEndDate(WxCardVo record){ | |||||
| if (null != record.getCouponOnlineStartDate() || null != record.getCouponOnlineEndDate() ) { | |||||
| WxCouponChannel wxCouponChannelQ = new WxCouponChannel(); | |||||
| wxCouponChannelQ.updateTenantInfo(record); | |||||
| wxCouponChannelQ.setStartdate(record.getCouponOnlineStartDate()); | |||||
| wxCouponChannelQ.setEnddate(record.getCouponOnlineEndDate()); | |||||
| List<Long> ccIds = wxCouponChannelMapper.findCouponIdList(wxCouponChannelQ); | |||||
| if (null == ccIds || ccIds.size() <= 0 ) { | |||||
| record.setId(-999L); | |||||
| }else { | |||||
| record.setCouponIdList(ccIds); | |||||
| } | |||||
| } | |||||
| } | |||||
| } | } | ||||
| @@ -386,29 +386,34 @@ public class WxCardSpendServiceImpl implements WxCardSpendService { | |||||
| @Override | @Override | ||||
| public PageInfo<WxCardSpendVo> listAsPage(WxCardSpendVo record, Integer pageIndex, Integer pageSize) { | public PageInfo<WxCardSpendVo> listAsPage(WxCardSpendVo record, Integer pageIndex, Integer pageSize) { | ||||
| if (null != record.getCouponOnlineStartDate() || null != record.getCouponOnlineEndDate() ) { | |||||
| WxCouponChannel wxCouponChannelQ = new WxCouponChannel(); | |||||
| wxCouponChannelQ.updateTenantInfo(record); | |||||
| wxCouponChannelQ.setStartdate(record.getCouponOnlineStartDate()); | |||||
| wxCouponChannelQ.setEnddate(record.getCouponOnlineEndDate()); | |||||
| List<Long> ccIds = wxCouponChannelMapper.findCouponIdList(wxCouponChannelQ); | |||||
| if (null == ccIds || ccIds.size() <= 0 ) { | |||||
| record.setId(-999L); | |||||
| }else { | |||||
| WxCardInfo cardInfo = new WxCardInfo(); | |||||
| cardInfo.updateTenantInfo(record); | |||||
| cardInfo.setCouponIdList(ccIds); | |||||
| List<Long> cardIdList = wxCardInfoMapper.findIdList(cardInfo); | |||||
| if (null == cardIdList || cardIdList.size() <= 0 ) { | |||||
| record.setId(-999L); | |||||
| }else { | |||||
| record.setCardIdList(ccIds); | |||||
| } | |||||
| } | |||||
| } | |||||
| handleCouponOnlineStartDate(record); | |||||
| return PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxCardSpendMapper.findCardSpendVoList(record)); | return PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxCardSpendMapper.findCardSpendVoList(record)); | ||||
| } | } | ||||
| //处理券投放时间 | |||||
| private void handleCouponOnlineStartDate(WxCardSpendVo record){ | |||||
| if (null != record.getCouponOnlineStartDate() || null != record.getCouponOnlineEndDate() ) { | |||||
| WxCouponChannel wxCouponChannelQ = new WxCouponChannel(); | |||||
| wxCouponChannelQ.updateTenantInfo(record); | |||||
| wxCouponChannelQ.setStartdate(record.getCouponOnlineStartDate()); | |||||
| wxCouponChannelQ.setEnddate(record.getCouponOnlineEndDate()); | |||||
| List<Long> ccIds = wxCouponChannelMapper.findCouponIdList(wxCouponChannelQ); | |||||
| if (null == ccIds || ccIds.size() <= 0 ) { | |||||
| record.setId(-999L); | |||||
| }else { | |||||
| WxCardInfo cardInfo = new WxCardInfo(); | |||||
| cardInfo.updateTenantInfo(record); | |||||
| cardInfo.setCouponIdList(ccIds); | |||||
| List<Long> cardIdList = wxCardInfoMapper.findIdList(cardInfo); | |||||
| if (null == cardIdList || cardIdList.size() <= 0 ) { | |||||
| record.setId(-999L); | |||||
| }else { | |||||
| record.setCardIdList(ccIds); | |||||
| } | |||||
| } | |||||
| } | |||||
| } | |||||
| @Override | @Override | ||||
| public List<Map<String, Object>> sumCardSpendForMerchant(WxCardSpendVo record) { | public List<Map<String, Object>> sumCardSpendForMerchant(WxCardSpendVo record) { | ||||
| return wxCardSpendMapper.sumCardSpendVoForMerchant(record); | return wxCardSpendMapper.sumCardSpendVoForMerchant(record); | ||||
| @@ -651,8 +656,9 @@ public class WxCardSpendServiceImpl implements WxCardSpendService { | |||||
| } | } | ||||
| @Override | @Override | ||||
| public void exportData(WxCardSpendVo wxCardSpendVo, HttpServletRequest request, HttpServletResponse response) { | |||||
| List<WxCardSpendVo> list = wxCardSpendMapper.findCardSpendVoList(wxCardSpendVo); | |||||
| public void exportData(WxCardSpendVo record, HttpServletRequest request, HttpServletResponse response) { | |||||
| handleCouponOnlineStartDate(record); | |||||
| List<WxCardSpendVo> list = wxCardSpendMapper.findCardSpendVoList(record); | |||||
| excelService.exportExcel(list, null, "卡消费记录", WxCardSpendVo.class, "卡消费记录.xlsx", response, false); | excelService.exportExcel(list, null, "卡消费记录", WxCardSpendVo.class, "卡消费记录.xlsx", response, false); | ||||
| } | } | ||||