Przeglądaj źródła

[营销列表][修改]:券营销列表、砍价营销列表

release_toaliyun_real
Stormeye Wu 6 lat temu
rodzic
commit
085b5e1003
4 zmienionych plików z 20 dodań i 35 usunięć
  1. +4
    -14
      mallinkAdmin/src/main/java/com/iformall/controller/market/WxCouponController.java
  2. +4
    -14
      mallinkService/src/main/java/com/iformall/service/impl/WxChartServiceImpl.java
  3. +5
    -0
      mallinkService/src/main/java/com/iformall/utils/DateUtils.java
  4. +7
    -7
      mallinkService/src/main/resources/mapper/WxCouponMapper.xml

+ 4
- 14
mallinkAdmin/src/main/java/com/iformall/controller/market/WxCouponController.java Wyświetl plik

@@ -272,10 +272,7 @@ public class WxCouponController extends BaseController {
//默认时间本月第一天,截止到当天 //默认时间本月第一天,截止到当天
Map<String,Object> result = new HashedMap(); Map<String,Object> result = new HashedMap();
if(wxCoupon.getStartdate() == null){ if(wxCoupon.getStartdate() == null){
Calendar c = Calendar.getInstance();
c.add(Calendar.MONTH, 0);
c.set(Calendar.DAY_OF_MONTH,1);
wxCoupon.setStartdate(c.getTime());
wxCoupon.setStartdate(DateUtils.getFirstDayForCurrMonth());
} }
if(wxCoupon.getEnddate() == null){ if(wxCoupon.getEnddate() == null){
wxCoupon.setEnddate(DateUtils.stringToDate(DateUtils.getSystemTime("yyyy-MM-dd") + " 23:59:59")); wxCoupon.setEnddate(DateUtils.stringToDate(DateUtils.getSystemTime("yyyy-MM-dd") + " 23:59:59"));
@@ -296,7 +293,7 @@ public class WxCouponController extends BaseController {
return new ResultData(result); return new ResultData(result);
} }


@ApiOperation("营销列表接口")
@ApiOperation("营销列表接口")
@GetMapping("findCouponCountList") @GetMapping("findCouponCountList")
@ApiImplicitParams({ @ApiImplicitParams({
@ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true),
@@ -306,10 +303,7 @@ public class WxCouponController extends BaseController {
//默认时间本月第一天,截止到当天 //默认时间本月第一天,截止到当天
Map<String,Object> result = new HashedMap(); Map<String,Object> result = new HashedMap();
if(wxCoupon.getStartdate() == null){ if(wxCoupon.getStartdate() == null){
Calendar c = Calendar.getInstance();
c.add(Calendar.MONTH, 0);
c.set(Calendar.DAY_OF_MONTH,1);
wxCoupon.setStartdate(c.getTime());
wxCoupon.setStartdate(DateUtils.getFirstDayForCurrMonth());
} }
if(wxCoupon.getEnddate() == null){ if(wxCoupon.getEnddate() == null){
wxCoupon.setEnddate(DateUtils.stringToDate(DateUtils.getSystemTime("yyyy-MM-dd") + " 23:59:59")); wxCoupon.setEnddate(DateUtils.stringToDate(DateUtils.getSystemTime("yyyy-MM-dd") + " 23:59:59"));
@@ -334,13 +328,9 @@ public class WxCouponController extends BaseController {
@ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)}) @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)})
@SystemControllerLog(description = "券投放-砍价营销列表") @SystemControllerLog(description = "券投放-砍价营销列表")
public ResultData findPressCountList(@ModelAttribute WxCoupon wxCoupon, Integer pageNum, Integer pageSize) { public ResultData findPressCountList(@ModelAttribute WxCoupon wxCoupon, Integer pageNum, Integer pageSize) {
//默认时间本月第一天,截止到当天
Map<String,Object> result = new HashedMap(); Map<String,Object> result = new HashedMap();
if(wxCoupon.getStartdate() == null){ if(wxCoupon.getStartdate() == null){
Calendar c = Calendar.getInstance();
c.add(Calendar.MONTH, 0);
c.set(Calendar.DAY_OF_MONTH,1);
wxCoupon.setStartdate(c.getTime());
wxCoupon.setStartdate(DateUtils.getFirstDayForCurrMonth());
} }
if(wxCoupon.getEnddate() == null){ if(wxCoupon.getEnddate() == null){
wxCoupon.setEnddate(DateUtils.stringToDate(DateUtils.getSystemTime("yyyy-MM-dd") + " 23:59:59")); wxCoupon.setEnddate(DateUtils.stringToDate(DateUtils.getSystemTime("yyyy-MM-dd") + " 23:59:59"));


+ 4
- 14
mallinkService/src/main/java/com/iformall/service/impl/WxChartServiceImpl.java Wyświetl plik

@@ -2219,7 +2219,7 @@ public class WxChartServiceImpl implements WxChartDataService {


//默认时间本月第一天,截止到当天 //默认时间本月第一天,截止到当天
if (StringUtils.isEmpty(paramsMap.get("startdate"))) { if (StringUtils.isEmpty(paramsMap.get("startdate"))) {
wxCoupon.setStartdate(getMonthFirstDay());
wxCoupon.setStartdate(DateUtils.getFirstDayForCurrMonth());
}else{ }else{
Date startTime = DateUtils.stringToDate(startdate); Date startTime = DateUtils.stringToDate(startdate);
wxCoupon.setStartdate(startTime); wxCoupon.setStartdate(startTime);
@@ -2264,7 +2264,7 @@ public class WxChartServiceImpl implements WxChartDataService {


//默认时间本月第一天,截止到当天 //默认时间本月第一天,截止到当天
if (StringUtils.isEmpty(paramsMap.get("startdate"))) { if (StringUtils.isEmpty(paramsMap.get("startdate"))) {
wxCoupon.setStartdate(getMonthFirstDay());
wxCoupon.setStartdate(DateUtils.getFirstDayForCurrMonth());
}else{ }else{
Date startTime = DateUtils.stringToDate(startdate); Date startTime = DateUtils.stringToDate(startdate);
wxCoupon.setStartdate(startTime); wxCoupon.setStartdate(startTime);
@@ -2330,7 +2330,7 @@ public class WxChartServiceImpl implements WxChartDataService {


//默认时间本月第一天,截止到当天 //默认时间本月第一天,截止到当天
if (StringUtils.isEmpty(paramsMap.get("startdate"))) { if (StringUtils.isEmpty(paramsMap.get("startdate"))) {
wxCoupon.setStartdate(getMonthFirstDay());
wxCoupon.setStartdate(DateUtils.getFirstDayForCurrMonth());
}else{ }else{
Date startTime = DateUtils.stringToDate(startdate); Date startTime = DateUtils.stringToDate(startdate);
wxCoupon.setStartdate(startTime); wxCoupon.setStartdate(startTime);
@@ -2381,16 +2381,6 @@ public class WxChartServiceImpl implements WxChartDataService {
return tatal; return tatal;
} }


private Date getMonthFirstDay() {
Calendar c = Calendar.getInstance();
c.add(Calendar.MONTH, 0);
c.set(Calendar.DAY_OF_MONTH,1);
c.set(Calendar.HOUR_OF_DAY, 0);
c.set(Calendar.MINUTE, 0);
c.set(Calendar.SECOND, 0);
return c.getTime();
}

/** /**
* 拼团营销数据 * 拼团营销数据
* @param paramsMap * @param paramsMap
@@ -2406,7 +2396,7 @@ public class WxChartServiceImpl implements WxChartDataService {
Date startTime = new Date(); Date startTime = new Date();
Date endTime = startTime; Date endTime = startTime;
if (StringUtils.isEmpty(paramsMap.get("startdate"))) { if (StringUtils.isEmpty(paramsMap.get("startdate"))) {
startTime = getMonthFirstDay();
startTime = DateUtils.getFirstDayForCurrMonth();
params.put("startdate", startTime); params.put("startdate", startTime);
} else { } else {
startTime = DateUtils.stringToDate(startdate + " 00:00:00"); startTime = DateUtils.stringToDate(startdate + " 00:00:00");


+ 5
- 0
mallinkService/src/main/java/com/iformall/utils/DateUtils.java Wyświetl plik

@@ -985,7 +985,12 @@ public class DateUtils {
*/ */
public static Date getFirstDayForCurrMonth(){ public static Date getFirstDayForCurrMonth(){
Calendar cale = Calendar.getInstance(); Calendar cale = Calendar.getInstance();
cale.add(Calendar.MONTH, 0);
cale.set(Calendar.DAY_OF_MONTH,1);//设置为1号,当前日期既为本月第一天 cale.set(Calendar.DAY_OF_MONTH,1);//设置为1号,当前日期既为本月第一天
cale.set(Calendar.HOUR_OF_DAY, 0); //将小时至0
cale.set(Calendar.MINUTE, 0); //将分钟至0
cale.set(Calendar.SECOND,0); //将秒至0
cale.set(Calendar.MILLISECOND, 0); //将毫秒至0
return cale.getTime(); return cale.getTime();
} }
/** /**


+ 7
- 7
mallinkService/src/main/resources/mapper/WxCouponMapper.xml Wyświetl plik

@@ -654,20 +654,20 @@


<select id="findPressData" parameterType="com.iformall.domain.po.WxCoupon" resultMap="statisMap"> <select id="findPressData" parameterType="com.iformall.domain.po.WxCoupon" resultMap="statisMap">
select c.id, c.`cover_img`,c.`title`,c.`sale_price`,c.`price`, select c.id, c.`cover_img`,c.`title`,c.`sale_price`,c.`price`,
IFNULL(round((select count(o.id) from wx_order o where o.tenant_id = '1006' and o.product_id = c.id and o.order_status = 1)/
(select count(op.id) from wx_order_press op where op.`tenant_id` = '1006' and op.`coupon_id` = c.`id` and op.first = 1 )*100,2),0) change_rate,
IFNULL(round((select count(o.id) from wx_order o where o.tenant_id = #{tenantId} and o.product_id = c.id and o.order_status = 1)/
(select count(op.id) from wx_order_press op where op.`tenant_id` = #{tenantId} and op.`coupon_id` = c.`id` and op.first = 1 )*100,2),0) change_rate,
(select count(op.id) from wx_order_press op (select count(op.id) from wx_order_press op
where op.`tenant_id` = '1006' and op.first = 1 and op.coupon_id = c.id) as press_count,
where op.`tenant_id` = #{tenantId} and op.first = 1 and op.coupon_id = c.id) as press_count,
(select count(o.id) from wx_order o (select count(o.id) from wx_order o
where o.`tenant_id` = '1006' and o.product_id = c.id and o.order_status = 1) as press_succ_count,
where o.`tenant_id` = #{tenantId} and o.product_id = c.id and o.order_status = 1) as press_succ_count,


(select count(op.id) from wx_order_press op (select count(op.id) from wx_order_press op
where op.`tenant_id` = '1006' and op.`coupon_id` = c.`id`) as join_count,
where op.`tenant_id` = #{tenantId} and op.`coupon_id` = c.`id`) as join_count,


IFNULL(round((select count(wco.id) xcount from wx_coupon_order wco IFNULL(round((select count(wco.id) xcount from wx_coupon_order wco
where wco.`tenant_id` = '1006' and wco.coupon_id = c.id and wco.coupon_order_status = 1
where wco.`tenant_id` = #{tenantId} and wco.coupon_id = c.id and wco.coupon_order_status = 1
)/(select count(op.id) from wx_order_press op )/(select count(op.id) from wx_order_press op
where op.`tenant_id` = '1006' and op.`coupon_id` = c.`id` and op.first = 1)
where op.`tenant_id` = #{tenantId} and op.`coupon_id` = c.`id` and op.first = 1)
*100,2),0) as payment_rate *100,2),0) as payment_rate


from wx_coupon c where c.type = 8 from wx_coupon c where c.type = 8


Ładowanie…
Anuluj
Zapisz