update 计算站点报表

This commit is contained in:
2023-06-05 17:06:07 +08:00
parent b22e055748
commit 59baaa998b
2 changed files with 34 additions and 3 deletions

View File

@@ -1,9 +1,12 @@
package com.jsowell.quartz.task;
import com.jsowell.common.constant.Constants;
import com.jsowell.common.util.DateUtils;
import com.jsowell.common.util.StringUtils;
import com.jsowell.pile.domain.PileStationInfo;
import com.jsowell.pile.domain.ykcCommond.PublishPileBillingTemplateCommand;
import com.jsowell.pile.domain.ykcCommond.StartChargingCommand;
import com.jsowell.pile.service.IPileStationInfoService;
import com.jsowell.pile.service.YKCPushCommandService;
import com.jsowell.pile.domain.OrderBasicInfo;
import com.jsowell.pile.service.IOrderBasicInfoService;
@@ -34,6 +37,9 @@ public class JsowellTask {
@Autowired
private YKCPushCommandService ykcPushCommandService;
@Autowired
private IPileStationInfoService pileStationInfoService;
/**
* 关闭15分钟未支付的订单
* close15MinutesOfUnpaidOrders
@@ -67,8 +73,6 @@ public class JsowellTask {
log.info("待启动充电订单:{}", list);
for (OrderBasicInfo orderInfo : list) {
// 下发充电桩设置指令
String pileSn = orderInfo.getPileSn();
// 发送启动充电指令前,再次下发计费模板
BillingTemplateVO billingTemplateVO = pileBillingTemplateService.selectBillingTemplateDetailByPileSn(pileSn);
@@ -98,4 +102,26 @@ public class JsowellTask {
ykcPushCommandService.pushStartChargingCommand(startChargingCommand);
}
}
/**
* 计算站点订单报表
* jsowellTask.calculateTheSiteOrdersReport()
*/
public void calculateTheSiteOrdersReport() {
// 查询出所有站点
PileStationInfo pileStationInfo = new PileStationInfo();
pileStationInfo.setDelFlag(Constants.ZERO);
List<PileStationInfo> list = pileStationInfoService.selectPileStationInfoList(pileStationInfo);
if (CollectionUtils.isEmpty(list)) {
return;
}
// 计算每个站点前一天的报表
for (PileStationInfo stationInfo : list) {
try {
orderBasicInfoService.generateDailyOrderReports(stationInfo.getId() + "");
} catch (Exception e) {
log.error("计算站点订单报表 发生异常 stationId:{}", stationInfo.getId(), e);
}
}
}
}