修改日期统计

This commit is contained in:
yuyang 2021-11-12 04:32:51 +08:00
parent 8b804c3d43
commit 06dc081fc1
4 changed files with 59 additions and 9 deletions

View File

@ -87,7 +87,7 @@ public class XhpcHistoryOrderController extends BaseController {
* 终端统计
*/
@GetMapping("/test3")
@Scheduled(cron = "0 0 * * * ?")
@Scheduled(cron = "0 0/8 * * * ?")
public void test3(){
logger.info(">>>>>>>>>>>>>>>>>>>>>>>终端统计定时任务>>>>>>>>>>>>>>>>>>>>>");
logger.info(">>>>>>>>>>>>>>>>>>>>>>>终端统计定时任务>>>>>>>>>>>>>>>>>>>>>");
@ -98,7 +98,7 @@ public class XhpcHistoryOrderController extends BaseController {
* 场站统计
*/
@GetMapping("/test2")
@Scheduled(cron = "0 0/30 * * * ?")
@Scheduled(cron = "0 0/7 * * * ?")
public void test2(){
logger.info(">>>>>>>>>>>>>>>>>>>>>>>场站统计定时任务>>>>>>>>>>>>>>>>>>>>>");
logger.info(">>>>>>>>>>>>>>>>>>>>>>>场站统计定时任务>>>>>>>>>>>>>>>>>>>>>");
@ -110,7 +110,7 @@ public class XhpcHistoryOrderController extends BaseController {
* 日期统计
*/
@GetMapping("/test1")
@Scheduled(cron = "0 0/20 * * * ?")
@Scheduled(cron = "0 0/6 * * * ?")
public void test1(){
logger.info(">>>>>>>>>>>>>>>>>>>>>>>日期统计定时任务>>>>>>>>>>>>>>>>>>>>>");
logger.info(">>>>>>>>>>>>>>>>>>>>>>>日期统计定时任务>>>>>>>>>>>>>>>>>>>>>");
@ -172,15 +172,15 @@ public class XhpcHistoryOrderController extends BaseController {
xhpcSt.setHistoryOrderId(xhpc.getHistoryOrderId());
xhpcSt.setChargingPileId(xhpc.getChargingPileId());
xhpcSt.setType(type);
xhpcSt.setCreateTime(xhpc.getCreateTime());
xhpcStatisticsService.addStatisticsStation(xhpcSt);
//修改历史订单表状态
xhpcHistoryOrderService.updateXhpcHistoryOrder(xhpc.getHistoryOrderId(),type + 1);
}else{
//跨天
BigDecimal dec = new BigDecimal(DateUtil.between(startTime, DateUtil.endOfDay(startTime), DateUnit.MINUTE)/ 60).setScale(2, RoundingMode.HALF_UP);
//添加
addStation(xhpc, dec,type,DateUtil.formatTime(startTime),"23:59:59",divide);
Date updateTime2= DateUtil.endOfDay(startTime);
BigDecimal time5 = new BigDecimal((updateTime2.getTime()-startTime.getTime())).divide(new BigDecimal(60000),2, RoundingMode.HALF_UP);
addStation(xhpc, time5,type,DateUtil.formatTime(startTime),"23:59:59",divide);
DateTime tomorrow = DateUtil.offsetDay(startTime,1);
Date startTime3 =DateUtil.beginOfDay(tomorrow);
@ -401,6 +401,9 @@ public class XhpcHistoryOrderController extends BaseController {
BigDecimal servicePrice =new BigDecimal(objectMap.get("serviceFee").toString());
String startTime1 = objectMap.get("startTime").toString();
String endTime1 = objectMap.get("endTime").toString();
if("00:00:00".equals(endTime1)){
endTime1="23:59:59";
}
//总度数
BigDecimal chargingDegree2 = new BigDecimal((DateUtil.parse(endTime1).getTime() - DateUtil.parse(startTime1).getTime())/60000).multiply(divide).setScale(2, RoundingMode.HALF_UP);
chargingDegree1 =chargingDegree1.add(chargingDegree2);
@ -442,6 +445,7 @@ public class XhpcHistoryOrderController extends BaseController {
xhpcSt.setHistoryOrderId(xhpc.getHistoryOrderId());
xhpcSt.setChargingPileId(xhpc.getChargingPileId());
xhpcSt.setType(type);
xhpcSt.setCreateTime(xhpc.getCreateTime());
xhpcStatisticsService.addStatisticsStation(xhpcSt);
//修改历史订单表状态

View File

@ -161,6 +161,10 @@ public class XhpcChargeHistoryOrder {
*/
private Long operatorId;
/**
* 流量方id
*/
private Long internetUserId;
/**
* 用户id(当类型为流量方时=流量方id)
*/
@ -253,6 +257,21 @@ public class XhpcChargeHistoryOrder {
*/
private Double meterValueEndEvcs;
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
/**
* 历史订单时间
*/
private Date createTime;
public Double getMeterValueEndEvcs() {
return meterValueEndEvcs;
@ -713,4 +732,14 @@ public class XhpcChargeHistoryOrder {
this.operatorId = operatorId;
}
public Long getInternetUserId() {
return internetUserId;
}
public void setInternetUserId(Long internetUserId) {
this.internetUserId = internetUserId;
}
}

View File

@ -773,7 +773,8 @@
co.rate_model_id as rateModelId,
cs.operator_id as operatorId,
te.charging_pile_id as chargingPileId,
co.user_id as userId
co.user_id as userId,
ho.create_time as createTime
from xhpc_history_order ho
left join xhpc_charge_order co on co.charge_order_id = ho.charge_order_id
left join xhpc_charging_station cs on cs.charging_station_id = co.charging_station_id

View File

@ -115,6 +115,9 @@
sum(power_price) powerPrice,
sum(service_price) servicePrice,
sum(total_price) totalPrice,
sum(act_price) actPrice,
sum(act_power_price) actPowerPrice,
sum(act_service_price) actServicePrice,
sum(promotion_discount) promotionDiscount,
sum(internet_commission) internetCommission,
sum(internet_svc_commission) internetSvcCommission,
@ -122,6 +125,7 @@
sum(platform_svc_commisssion) platformSvcCommisssion,
sum(operation_commission) operationCommission,
sum(operation_svc_commission) operationSvcCommission,
DATE_FORMAT(create_time,'%Y-%m-%d') createTime
from xhpc_statistics_station
where del_flag=0 and type=1
@ -158,6 +162,9 @@
sum(ss.power_price) powerPrice,
sum(ss.service_price) servicePrice,
sum(ss.total_price) totalPrice,
sum(ss.act_price) actPrice,
sum(ss.act_power_price) actPowerPrice,
sum(ss.act_service_price) actServicePrice,
sum(ss.promotion_discount) promotionDiscount,
sum(ss.internet_commission) internetCommission,
sum(ss.internet_svc_commission) internetSvcCommission,
@ -210,6 +217,9 @@
sum(ss.power_price) powerPrice,
sum(ss.service_price) servicePrice,
sum(ss.total_price) totalPrice,
sum(ss.act_price) actPrice,
sum(ss.act_power_price) actPowerPrice,
sum(ss.act_service_price) actServicePrice,
sum(ss.promotion_discount) promotionDiscount,
sum(ss.internet_commission) internetCommission,
sum(ss.internet_svc_commission) internetSvcCommission,
@ -256,6 +266,9 @@
sum(ss.power_price) powerPrice,
sum(ss.service_price) servicePrice,
sum(ss.total_price) totalPrice,
sum(ss.act_price) actPrice,
sum(ss.act_power_price) actPowerPrice,
sum(ss.act_service_price) actServicePrice,
sum(ss.promotion_discount) promotionDiscount,
sum(ss.internet_commission) internetCommission,
sum(ss.internet_svc_commission) internetSvcCommission,
@ -267,7 +280,7 @@
DATE_FORMAT(ss.create_time,'%Y-%m-%d') createTime
from xhpc_statistics_station as ss
left join xhpc_internet_user as iu on iu.internet_user_id = ss.internet_user_id
where ss.del_flag=0 and ss.type=2
where ss.del_flag=0 and ss.type=2 and ss.internet_user_id !=null
<if test="startTime !=null and startTime !='' and endTime !=null and endTime !=''">
and #{startTime} &lt;=ss.create_time
and ss.create_time &lt;=#{endTime}
@ -292,6 +305,9 @@
sum(ss.power_price) powerPrice,
sum(ss.service_price) servicePrice,
sum(ss.total_price) totalPrice,
sum(ss.act_price) actPrice,
sum(ss.act_power_price) actPowerPrice,
sum(ss.act_service_price) actServicePrice,
sum(ss.promotion_discount) promotionDiscount,
sum(ss.internet_commission) internetCommission,
sum(ss.internet_svc_commission) internetSvcCommission,