xhxu 3 лет назад
Родитель
Сommit
f76141e252
3 измененных файлов: 45 добавлений и 25 удалений
  1. +20
    -12
      mallinkAdmin/src/main/java/com/iformall/controller/market/WxCouponController.java
  2. +20
    -11
      mallinkAdmin/src/main/java/com/iformall/controller/market/WxOrderGroupController.java
  3. +5
    -2
      mallinkService/src/main/resources/mapper/WxCouponMapper.xml

+ 20
- 12
mallinkAdmin/src/main/java/com/iformall/controller/market/WxCouponController.java Просмотреть файл

@@ -595,20 +595,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);

handleCouponStartDate(wxCoupon);

wxCoupon.setSourceType(EnumCouponSourceType.COUPONSource_Admin.getCode()); 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); PageInfo<WxCouponStatisVo> pages = wxCouponService.findPressData(wxCoupon,tenantEntitys,pageNum,pageSize);
return new ResultData(pages); return new ResultData(pages);
} }
@@ -622,9 +613,26 @@ public class WxCouponController extends BaseController {
List<TenantEntity> tenantEntitys = wxMallService.getTenantEntitys(tenantEntity); List<TenantEntity> tenantEntitys = wxMallService.getTenantEntitys(tenantEntity);
wxCoupon.updateTenantInfo(tenantEntity); wxCoupon.updateTenantInfo(tenantEntity);
wxCoupon.setSourceType(EnumCouponSourceType.COUPONSource_Admin.getCode()); wxCoupon.setSourceType(EnumCouponSourceType.COUPONSource_Admin.getCode());

handleCouponStartDate(wxCoupon);

wxCouponService.exportPressData(wxCoupon,tenantEntitys, request, response); 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") @GetMapping("exportCouponPassword")
@SystemControllerLog(description = "卡券兑换码-导出数据") @SystemControllerLog(description = "卡券兑换码-导出数据")
public void exportCouponPassword(@ModelAttribute WxCouponPassword wxCouponPassword, HttpServletRequest request, HttpServletResponse response) { public void exportCouponPassword(@ModelAttribute WxCouponPassword wxCouponPassword, HttpServletRequest request, HttpServletResponse response) {


+ 20
- 11
mallinkAdmin/src/main/java/com/iformall/controller/market/WxOrderGroupController.java Просмотреть файл

@@ -54,17 +54,9 @@ public class WxOrderGroupController extends BaseController {
TenantEntity tenantEntity = getTenantInfo(); TenantEntity tenantEntity = getTenantInfo();
List<TenantEntity> tenantEntitys = wxMallService.getTenantEntitys(tenantEntity); List<TenantEntity> tenantEntitys = wxMallService.getTenantEntitys(tenantEntity);
wxOrderGroupMarketing.updateTenantInfo(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); final PageInfo<WxOrderGroupMarketing> page = wxOrderGroupService.queryOrderGroupMarketingList(wxOrderGroupMarketing,tenantEntitys, pageNum, pageSize);
return new ResultData(page); return new ResultData(page);
} }
@@ -79,7 +71,24 @@ public class WxOrderGroupController extends BaseController {
TenantEntity tenantEntity = getTenantInfo(); TenantEntity tenantEntity = getTenantInfo();
List<TenantEntity> tenantEntitys = wxMallService.getTenantEntitys(tenantEntity); List<TenantEntity> tenantEntitys = wxMallService.getTenantEntitys(tenantEntity);
wxOrderGroupMarketing.updateTenantInfo(tenantEntity); wxOrderGroupMarketing.updateTenantInfo(tenantEntity);

handleCouponStartDate(wxOrderGroupMarketing);

wxOrderGroupService.exportOrderGroupMarketingList(wxOrderGroupMarketing,tenantEntitys, request, response); 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");
}
}

} }

+ 5
- 2
mallinkService/src/main/resources/mapper/WxCouponMapper.xml Просмотреть файл

@@ -1129,8 +1129,11 @@
<if test="wxCoupon.title != null and wxCoupon.title != ''"> <if test="wxCoupon.title != null and wxCoupon.title != ''">
and c.title like concat('%', #{wxCoupon.title},'%') and c.title like concat('%', #{wxCoupon.title},'%')
</if> </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>


<if test=" null != wxCoupon.sortColumns">order by ${wxCoupon.sortColumns}</if> <if test=" null != wxCoupon.sortColumns">order by ${wxCoupon.sortColumns}</if>


Загрузка…
Отмена
Сохранить