Browse Source

Merge branch 'release_toaliyun_real_202212' of https://git.malls.iformall.com/server/formallProject into release_toaliyun_real_202212

release_toaliyun_real
winter 3 years ago
parent
commit
0555fc80dd
6 changed files with 99 additions and 64 deletions
  1. +25
    -14
      mallinkAdmin/src/main/java/com/iformall/controller/market/WxCouponController.java
  2. +20
    -11
      mallinkAdmin/src/main/java/com/iformall/controller/market/WxOrderGroupController.java
  3. +1
    -1
      mallinkCApi/src/main/java/com/iformall/controller/WxCouponController.java
  4. +20
    -14
      mallinkService/src/main/java/com/iformall/service/impl/WxCardInfoServiceImpl.java
  5. +28
    -22
      mallinkService/src/main/java/com/iformall/service/impl/WxCardSpendServiceImpl.java
  6. +5
    -2
      mallinkService/src/main/resources/mapper/WxCouponMapper.xml

+ 25
- 14
mallinkAdmin/src/main/java/com/iformall/controller/market/WxCouponController.java View File

@@ -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 = "营销统计-券营销数据导出")
@@ -595,20 +597,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);
} }
@@ -621,10 +614,28 @@ 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());

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 View File

@@ -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");
}
}

} }

+ 1
- 1
mallinkCApi/src/main/java/com/iformall/controller/WxCouponController.java View File

@@ -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()); 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")) { if (null != config && config.getConfigItemValue().equals("1")) {
sb.append(",\"selledCount\":").append(coupon.getInventory()-coupon.getRemainInventory()); sb.append(",\"selledCount\":").append(coupon.getInventory()-coupon.getRemainInventory());
} }


+ 20
- 14
mallinkService/src/main/java/com/iformall/service/impl/WxCardInfoServiceImpl.java View File

@@ -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);
}
}
}

} }

+ 28
- 22
mallinkService/src/main/java/com/iformall/service/impl/WxCardSpendServiceImpl.java View File

@@ -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);
} }




+ 5
- 2
mallinkService/src/main/resources/mapper/WxCouponMapper.xml View File

@@ -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>


Loading…
Cancel
Save