| @@ -272,10 +272,7 @@ public class WxCouponController extends BaseController { | |||
| //默认时间本月第一天,截止到当天 | |||
| Map<String,Object> result = new HashedMap(); | |||
| 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){ | |||
| 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); | |||
| } | |||
| @ApiOperation("卷营销列表接口") | |||
| @ApiOperation("券营销列表接口") | |||
| @GetMapping("findCouponCountList") | |||
| @ApiImplicitParams({ | |||
| @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(); | |||
| 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){ | |||
| 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)}) | |||
| @SystemControllerLog(description = "券投放-砍价营销列表") | |||
| public ResultData findPressCountList(@ModelAttribute WxCoupon wxCoupon, Integer pageNum, Integer pageSize) { | |||
| //默认时间本月第一天,截止到当天 | |||
| Map<String,Object> result = new HashedMap(); | |||
| 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){ | |||
| wxCoupon.setEnddate(DateUtils.stringToDate(DateUtils.getSystemTime("yyyy-MM-dd") + " 23:59:59")); | |||
| @@ -122,6 +122,10 @@ public class TenantInfoImpl implements TenantInfo { | |||
| return true; | |||
| if ("com.iformall.mapper.WxBillPropertyMapper.autoAddLatePayPrice".equals(ms.getId())) | |||
| return true; | |||
| if ("com.iformall.mapper.WxBillRentMapper.insertBillAction".equals(ms.getId())) | |||
| return true; | |||
| if ("com.iformall.mapper.WxBillPropertyMapper.insertBillAction".equals(ms.getId())) | |||
| return true; | |||
| return false; | |||
| } | |||
| } | |||
| @@ -2220,7 +2220,7 @@ public class WxChartServiceImpl implements WxChartDataService { | |||
| //默认时间本月第一天,截止到当天 | |||
| if (StringUtils.isEmpty(paramsMap.get("startdate"))) { | |||
| wxCoupon.setStartdate(getMonthFirstDay()); | |||
| wxCoupon.setStartdate(DateUtils.getFirstDayForCurrMonth()); | |||
| }else{ | |||
| Date startTime = DateUtils.stringToDate(startdate); | |||
| wxCoupon.setStartdate(startTime); | |||
| @@ -2265,7 +2265,7 @@ public class WxChartServiceImpl implements WxChartDataService { | |||
| //默认时间本月第一天,截止到当天 | |||
| if (StringUtils.isEmpty(paramsMap.get("startdate"))) { | |||
| wxCoupon.setStartdate(getMonthFirstDay()); | |||
| wxCoupon.setStartdate(DateUtils.getFirstDayForCurrMonth()); | |||
| }else{ | |||
| Date startTime = DateUtils.stringToDate(startdate); | |||
| wxCoupon.setStartdate(startTime); | |||
| @@ -2331,7 +2331,7 @@ public class WxChartServiceImpl implements WxChartDataService { | |||
| //默认时间本月第一天,截止到当天 | |||
| if (StringUtils.isEmpty(paramsMap.get("startdate"))) { | |||
| wxCoupon.setStartdate(getMonthFirstDay()); | |||
| wxCoupon.setStartdate(DateUtils.getFirstDayForCurrMonth()); | |||
| }else{ | |||
| Date startTime = DateUtils.stringToDate(startdate); | |||
| wxCoupon.setStartdate(startTime); | |||
| @@ -2382,16 +2382,6 @@ public class WxChartServiceImpl implements WxChartDataService { | |||
| 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 | |||
| @@ -2407,7 +2397,7 @@ public class WxChartServiceImpl implements WxChartDataService { | |||
| Date startTime = new Date(); | |||
| Date endTime = startTime; | |||
| if (StringUtils.isEmpty(paramsMap.get("startdate"))) { | |||
| startTime = getMonthFirstDay(); | |||
| startTime = DateUtils.getFirstDayForCurrMonth(); | |||
| params.put("startdate", startTime); | |||
| } else { | |||
| startTime = DateUtils.stringToDate(startdate + " 00:00:00"); | |||
| @@ -985,7 +985,12 @@ public class DateUtils { | |||
| */ | |||
| public static Date getFirstDayForCurrMonth(){ | |||
| Calendar cale = Calendar.getInstance(); | |||
| cale.add(Calendar.MONTH, 0); | |||
| 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(); | |||
| } | |||
| /** | |||
| @@ -227,7 +227,7 @@ | |||
| </select> | |||
| <update id="insertBillAction"> | |||
| insert into wx_bill_action(id,user_name,`action`,bill_id,details) | |||
| insert into wx_bill_action(id,user_name,`action`,bill_id,details,tenant_id) | |||
| select | |||
| (select unix_timestamp(now()) + CEILING(RAND()*90000+10000)) id | |||
| ,'系统端' user_name,7 `action`,b.id bill_id, | |||
| @@ -241,7 +241,7 @@ | |||
| b.owe * (c.late_pay_ratio) /10000 | |||
| ,2) | |||
| ) | |||
| ,'元') details | |||
| ,'元') details,b.tenant_id | |||
| from wx_bill_property b left join wx_property_contract c on(b.`property_contract_id`=c.id) | |||
| where c.late_pay_ratio >0 | |||
| and DATEDIFF(now(), date_add(b.receive_date,interval(c.late_pay_day) day)) >0 | |||
| @@ -229,7 +229,7 @@ | |||
| </select> | |||
| <update id="insertBillAction"> | |||
| insert into wx_bill_action(id,user_name,`action`,bill_id,details) | |||
| insert into wx_bill_action(id,user_name,`action`,bill_id,details,tenant_id) | |||
| select | |||
| (select unix_timestamp(now()) + CEILING(RAND()*90000+10000)) id | |||
| ,'系统端' user_name,7 `action`,b.id bill_id, | |||
| @@ -243,7 +243,7 @@ | |||
| b.owe * (c.late_pay_ratio) /10000 | |||
| ,2) | |||
| ) | |||
| ,'元') details | |||
| ,'元') details,b.tenant_id | |||
| from wx_bill_rent b left join wx_rent_contract c on(b.rent_contract_id=c.id) | |||
| where c.late_pay_ratio >0 | |||
| and DATEDIFF(now(), date_add(b.receive_date,interval(c.late_pay_day) day)) >0 | |||
| @@ -654,20 +654,20 @@ | |||
| <select id="findPressData" parameterType="com.iformall.domain.po.WxCoupon" resultMap="statisMap"> | |||
| 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 | |||
| 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 | |||
| 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 | |||
| 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 | |||
| 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 | |||
| 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 | |||
| from wx_coupon c where c.type = 8 | |||
| @@ -950,7 +950,7 @@ | |||
| <sql id="allCUserCardListColumns"> | |||
| co.id,co.tenant_id,co.coupon_id,co.coupon_type,co.expired_time,co.coupon_order_status,co.create_date,co.update_date, | |||
| c.cover_img,c.title,c.sub_title,c.detail,c.unit,c.remark, | |||
| a.amount,a.remaining_amount,a.support_transfer | |||
| a.amount,a.remaining_amount,case when c.status=1 then 0 else a.support_transfer end support_transfer | |||
| </sql> | |||
| <sql id="allCUserCardDetailColumns"> | |||