修改实时订单搜索

This commit is contained in:
yuyang 2021-11-24 17:22:49 +08:00
parent e98550539d
commit 682de75a23
2 changed files with 77 additions and 63 deletions

View File

@ -412,11 +412,12 @@ public class XhpcHistoryOrderController extends BaseController {
logger.info(">>>>>>>>>>>>>>>>>>>>>>>小时统计定时任务>>>>>>>>>>>>>>>>>>>>>");
logger.info(">>>>>>>>>>>>>>>>>>>>>>>小时统计定时任务>>>>>>>>>>>>>>>>>>>>>");
logger.info(">>>>>>>>>>>>>>>>>>>>>>>小时统计定时任务>>>>>>>>>>>>>>>>>>>>>");
try{
//小时统计
List<XhpcChargeHistoryOrder> list = xhpcHistoryOrderService.getStatistisList(500,0);
if(list !=null && list.size()>0){
for (XhpcChargeHistoryOrder xhpc:list) {
try{
//开始时间结束时间模型id状态用户id运营商订单id场站id终端id历史订单id时间
Date startTime = xhpc.getStartTime();
Date endTime = xhpc.getEndTime();
@ -466,22 +467,35 @@ public class XhpcHistoryOrderController extends BaseController {
if(xhpc.getSource()==1){
xhpcSt.setInternetUserId(xhpc.getUserId());
}
List<Map<String, Object>> reatTimeList = xhpcHistoryOrderService.getReatTimeList(DateUtil.formatTime(startTime), DateUtil.formatTime(endTime), rateModelId);
Map<String, Object> map = reatTimeList.get(0);
xhpcSt.setElecPriceEvcs(new BigDecimal(map.get("powerFee").toString()));
xhpcSt.setServicePriceEvcs(new BigDecimal(map.get("serviceFee").toString()));
//时间没有跨天
// DateTime parse = DateUtil.parse(DateUtil.format(startTime, "yyyy-MM-dd"), "yyyy-MM-dd");
// DateTime parse1 = DateUtil.parse(DateUtil.format(endTime, "yyyy-MM-dd"), "yyyy-MM-dd");
// long betweenDay = DateUtil.between(parse,parse1, DateUnit.DAY);
// Map<String, Object> map = new HashMap<>();
// if(betweenDay==0){
// List<Map<String, Object>> reatTimeList = xhpcHistoryOrderService.getReatTimeList(DateUtil.formatTime(startTime), DateUtil.formatTime(endTime), rateModelId);
// map = reatTimeList.get(0);
// }else{
// //明天
// DateTime tomorrow = DateUtil.offsetDay(startTime,1);
// Date startTime3 =DateUtil.beginOfDay(tomorrow);
// List<Map<String, Object>> reatTimeList = xhpcHistoryOrderService.getReatTimeList(DateUtil.formatTime(startTime3), DateUtil.formatTime(endTime), rateModelId);
// map = reatTimeList.get(0);
// }
// xhpcSt.setElecPriceEvcs(new BigDecimal(map.get("powerFee").toString()));
// xhpcSt.setServicePriceEvcs(new BigDecimal(map.get("serviceFee").toString()));
xhpcSt.setStartTimeEvcs(DateUtil.format(startTime, "yyyy-MM-dd HH:mm:ss"));
xhpcSt.setEndTimeEvcs(DateUtil.format(endTime, "yyyy-MM-dd HH:mm:ss"));
xhpcSt.setCreateTime(xhpc.getEndTime());
xhpcStatisticsService.addStatisticsTime(xhpcSt);
//修改历史订单表状态
xhpcHistoryOrderService.updateXhpcHistoryOrder(xhpc.getHistoryOrderId(),1);
}
}
}catch (Exception e){
logger.info(">>>>>>>>>>>>>>>>>>>>>>>小时统计定时任务异常>>>>>>>>>>>>>>>>>>>>>"+xhpc.getHistoryOrderId());
}
}
}
}

View File

@ -423,7 +423,7 @@
and co.serial_number like concat('%', #{transactionNumber}, '%')
</if>
<if test="chargingStationName !=null and chargingStationName !=''">
and co.serial_number like concat('%', #{chargingStationName}, '%')
and ct.name like concat('%', #{chargingStationName}, '%')
</if>
<if test="terminalName !=null and terminalName !=''">
and ter.name like concat('%', #{terminalName}, '%')