| @@ -595,20 +595,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); | |||
| } | |||
| @@ -622,9 +613,26 @@ public class WxCouponController extends BaseController { | |||
| List<TenantEntity> tenantEntitys = wxMallService.getTenantEntitys(tenantEntity); | |||
| wxCoupon.updateTenantInfo(tenantEntity); | |||
| wxCoupon.setSourceType(EnumCouponSourceType.COUPONSource_Admin.getCode()); | |||
| handleCouponStartDate(wxCoupon); | |||
| 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"); | |||
| } | |||
| } | |||
| } | |||
| @@ -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> | |||