| @@ -482,7 +482,8 @@ public class WxCouponController extends BaseController { | |||
| result.put("list", pageInfo); | |||
| return new ResultData(result); | |||
| } | |||
| @TenantIgnore | |||
| @ApiOperation("卡营销列表记录导出") | |||
| @GetMapping("/cardCountExportData") | |||
| @SystemControllerLog(description = "营销统计-卡营销数据导出") | |||
| @@ -554,7 +555,8 @@ public class WxCouponController extends BaseController { | |||
| } | |||
| return new ResultData(pageInfo); | |||
| } | |||
| @TenantIgnore | |||
| @ApiOperation("券营销列表记录导出") | |||
| @GetMapping("/couponCountExportData") | |||
| @SystemControllerLog(description = "营销统计-券营销数据导出") | |||
| @@ -595,20 +597,11 @@ public class WxCouponController extends BaseController { | |||
| TenantEntity tenantEntity = getTenantInfo(); | |||
| List<TenantEntity> tenantEntitys = wxMallService.getTenantEntitys(tenantEntity); | |||
| wxCoupon.updateTenantInfo(tenantEntity); | |||
| handleCouponStartDate(wxCoupon); | |||
| wxCoupon.setSourceType(EnumCouponSourceType.COUPONSource_Admin.getCode()); | |||
| //根据上架时间查询券 | |||
| WxCouponChannel couponChannelQ = new WxCouponChannel(); | |||
| couponChannelQ.updateTenantInfo(tenantEntity); | |||
| couponChannelQ.setStartdate(wxCoupon.getStartdate()); | |||
| couponChannelQ.setEnddate(wxCoupon.getEnddate()); | |||
| List<Long> couponIds = wxCouponChannelService.findCouponIdList(couponChannelQ); | |||
| if (null != couponIds && couponIds.size() > 0 ) { | |||
| wxCoupon.setIds(couponIds); | |||
| }else { | |||
| wxCoupon.setId(-1L); | |||
| } | |||
| PageInfo<WxCouponStatisVo> pages = wxCouponService.findPressData(wxCoupon,tenantEntitys,pageNum,pageSize); | |||
| return new ResultData(pages); | |||
| } | |||
| @@ -621,10 +614,28 @@ public class WxCouponController extends BaseController { | |||
| TenantEntity tenantEntity = getTenantInfo(); | |||
| List<TenantEntity> tenantEntitys = wxMallService.getTenantEntitys(tenantEntity); | |||
| wxCoupon.updateTenantInfo(tenantEntity); | |||
| handleCouponStartDate(wxCoupon); | |||
| wxCoupon.setSourceType(EnumCouponSourceType.COUPONSource_Admin.getCode()); | |||
| wxCouponService.exportPressData(wxCoupon,tenantEntitys, request, response); | |||
| } | |||
| //根据投放时间搜索 | |||
| private void handleCouponStartDate(WxCoupon wxCoupon){ | |||
| WxCouponChannel couponChannelQ = new WxCouponChannel(); | |||
| couponChannelQ.updateTenantInfo(wxCoupon); | |||
| couponChannelQ.setStartdate(wxCoupon.getStartdate()); | |||
| couponChannelQ.setEnddate(wxCoupon.getEnddate()); | |||
| List<Long> couponIds = wxCouponChannelService.findCouponIdList(couponChannelQ); | |||
| if (null != couponIds && couponIds.size() > 0 ) { | |||
| wxCoupon.setIds(couponIds); | |||
| }else { | |||
| wxCoupon.setId(-1L); | |||
| } | |||
| } | |||
| @GetMapping("exportCouponPassword") | |||
| @SystemControllerLog(description = "卡券兑换码-导出数据") | |||
| public void exportCouponPassword(@ModelAttribute WxCouponPassword wxCouponPassword, HttpServletRequest request, HttpServletResponse response) { | |||
| @@ -54,17 +54,9 @@ public class WxOrderGroupController extends BaseController { | |||
| TenantEntity tenantEntity = getTenantInfo(); | |||
| List<TenantEntity> tenantEntitys = wxMallService.getTenantEntitys(tenantEntity); | |||
| wxOrderGroupMarketing.updateTenantInfo(tenantEntity); | |||
| WxCouponChannel couponChannelQ = new WxCouponChannel(); | |||
| couponChannelQ.updateTenantInfo(tenantEntity); | |||
| couponChannelQ.setStartdate(wxOrderGroupMarketing.getStartdate()); | |||
| couponChannelQ.setEnddate(wxOrderGroupMarketing.getEnddate()); | |||
| List<Long> couponIds = wxCouponChannelService.findCouponIdList(couponChannelQ); | |||
| if (null != couponIds && couponIds.size() > 0 ) { | |||
| wxOrderGroupMarketing.setCouponIdList(couponIds); | |||
| }else { | |||
| wxOrderGroupMarketing.setCouponId("-1"); | |||
| } | |||
| handleCouponStartDate(wxOrderGroupMarketing); | |||
| final PageInfo<WxOrderGroupMarketing> page = wxOrderGroupService.queryOrderGroupMarketingList(wxOrderGroupMarketing,tenantEntitys, pageNum, pageSize); | |||
| return new ResultData(page); | |||
| } | |||
| @@ -79,7 +71,24 @@ public class WxOrderGroupController extends BaseController { | |||
| TenantEntity tenantEntity = getTenantInfo(); | |||
| List<TenantEntity> tenantEntitys = wxMallService.getTenantEntitys(tenantEntity); | |||
| wxOrderGroupMarketing.updateTenantInfo(tenantEntity); | |||
| handleCouponStartDate(wxOrderGroupMarketing); | |||
| wxOrderGroupService.exportOrderGroupMarketingList(wxOrderGroupMarketing,tenantEntitys, request, response); | |||
| } | |||
| //处理投放时间 | |||
| private void handleCouponStartDate(WxOrderGroupMarketing wxOrderGroupMarketing){ | |||
| WxCouponChannel couponChannelQ = new WxCouponChannel(); | |||
| couponChannelQ.updateTenantInfo(wxOrderGroupMarketing); | |||
| couponChannelQ.setStartdate(wxOrderGroupMarketing.getStartdate()); | |||
| couponChannelQ.setEnddate(wxOrderGroupMarketing.getEnddate()); | |||
| List<Long> couponIds = wxCouponChannelService.findCouponIdList(couponChannelQ); | |||
| if (null != couponIds && couponIds.size() > 0 ) { | |||
| wxOrderGroupMarketing.setCouponIdList(couponIds); | |||
| }else { | |||
| wxOrderGroupMarketing.setCouponId("-1"); | |||
| } | |||
| } | |||
| } | |||
| @@ -187,7 +187,7 @@ public class WxCouponController extends BaseController { | |||
| } | |||
| sb.append(",\"inventory\":").append(coupon.getInventory()).append(",\"price\":").append(coupon.getPrice()).append(",\"creditPrice\":").append(coupon.getCreditPrice()); | |||
| //如果配置显示已售数量 | |||
| SysConfig config = sysConfigService.getByKey(SysConfigConstant.coupon_detail_show_selled, channelPriceAndStock); | |||
| SysConfig config = sysConfigService.getByKey(SysConfigConstant.coupon_detail_show_selled, getTenantInfo()); | |||
| if (null != config && config.getConfigItemValue().equals("1")) { | |||
| sb.append(",\"selledCount\":").append(coupon.getInventory()-coupon.getRemainInventory()); | |||
| } | |||
| @@ -31,18 +31,7 @@ public class WxCardInfoServiceImpl implements WxCardInfoService { | |||
| @Override | |||
| 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)); | |||
| } | |||
| @@ -69,9 +58,26 @@ public class WxCardInfoServiceImpl implements WxCardInfoService { | |||
| } | |||
| @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); | |||
| } | |||
| 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 | |||
| 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)); | |||
| } | |||
| //处理券投放时间 | |||
| 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 | |||
| public List<Map<String, Object>> sumCardSpendForMerchant(WxCardSpendVo record) { | |||
| return wxCardSpendMapper.sumCardSpendVoForMerchant(record); | |||
| @@ -651,8 +656,9 @@ public class WxCardSpendServiceImpl implements WxCardSpendService { | |||
| } | |||
| @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); | |||
| } | |||
| @@ -1129,8 +1129,11 @@ | |||
| <if test="wxCoupon.title != null and wxCoupon.title != ''"> | |||
| and c.title like concat('%', #{wxCoupon.title},'%') | |||
| </if> | |||
| <if test=" null != wxCoupon.startdate and null!=wxCoupon.enddate"> | |||
| and c.`create_date` between #{wxCoupon.startdate} and #{wxCoupon.enddate} | |||
| <if test=" null != wxCoupon.ids "> | |||
| and c.id in | |||
| <foreach collection="wxCoupon.ids" index="index" item="idItem" open="(" separator="," close=")"> | |||
| #{idItem} | |||
| </foreach> | |||
| </if> | |||
| <if test=" null != wxCoupon.sortColumns">order by ${wxCoupon.sortColumns}</if> | |||