调整启动充电判断,桩不存在方第一判断
This commit is contained in:
parent
8df78911bc
commit
8031059d31
@ -156,6 +156,11 @@ public class XhpcChargeOrderServiceImpl extends BaseService implements IXhpcChar
|
|||||||
if (terminalSerialNumber.length() != 16 || !m.matches()) {
|
if (terminalSerialNumber.length() != 16 || !m.matches()) {
|
||||||
return AjaxResult.error(1104, "无效的终端编号");
|
return AjaxResult.error(1104, "无效的终端编号");
|
||||||
}
|
}
|
||||||
|
//终端信息
|
||||||
|
XhpcTerminal xhpcTerminal = xhpcChargeOrderMapper.getXhpcTerminalSerialNumber(terminalSerialNumber,tenantId);
|
||||||
|
if (xhpcTerminal == null || xhpcTerminal.getTerminalId() == null || xhpcTerminal.getChargingPileId() == null || xhpcTerminal.getPileSerialNumber() == null) {
|
||||||
|
return AjaxResult.error(1104, "因限电该桩已停用,请选择其他桩进行充电");
|
||||||
|
}
|
||||||
//查看充电用户金额是否大于5元
|
//查看充电用户金额是否大于5元
|
||||||
//Map<String, Object> userMessage = xhpcChargeOrderMapper.getUserMessage(userId);
|
//Map<String, Object> userMessage = xhpcChargeOrderMapper.getUserMessage(userId);
|
||||||
BigDecimal a = new BigDecimal(5);
|
BigDecimal a = new BigDecimal(5);
|
||||||
@ -206,11 +211,7 @@ public class XhpcChargeOrderServiceImpl extends BaseService implements IXhpcChar
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
logger.info("<<<<<<<<<<<<<<<<<<<<<<<<终端编号>>>>"+terminalSerialNumber+">>>>>>>>>>>>>"+tenantId);
|
logger.info("<<<<<<<<<<<<<<<<<<<<<<<<终端编号>>>>"+terminalSerialNumber+">>>>>>>>>>>>>"+tenantId);
|
||||||
//终端信息
|
|
||||||
XhpcTerminal xhpcTerminal = xhpcChargeOrderMapper.getXhpcTerminalSerialNumber(terminalSerialNumber,tenantId);
|
|
||||||
if (xhpcTerminal == null || xhpcTerminal.getTerminalId() == null || xhpcTerminal.getChargingPileId() == null || xhpcTerminal.getPileSerialNumber() == null) {
|
|
||||||
return AjaxResult.error(1104, "无效的终端编号");
|
|
||||||
}
|
|
||||||
logger.info("<<<<<<<<<<<<<<<<<<<<<<<<终端编号>>>>>>>>>>>>>>>>");
|
logger.info("<<<<<<<<<<<<<<<<<<<<<<<<终端编号>>>>>>>>>>>>>>>>");
|
||||||
//余额
|
//余额
|
||||||
String balance = new BigDecimal(userMessage.get("balance").toString()).multiply(new BigDecimal(100)).toString();
|
String balance = new BigDecimal(userMessage.get("balance").toString()).multiply(new BigDecimal(100)).toString();
|
||||||
@ -335,7 +336,7 @@ public class XhpcChargeOrderServiceImpl extends BaseService implements IXhpcChar
|
|||||||
//终端信息
|
//终端信息
|
||||||
XhpcTerminal xhpcTerminal = xhpcChargeOrderMapper.getXhpcTerminalSerialNumber(serialNumber,tenantId);
|
XhpcTerminal xhpcTerminal = xhpcChargeOrderMapper.getXhpcTerminalSerialNumber(serialNumber,tenantId);
|
||||||
if (xhpcTerminal == null || xhpcTerminal.getTerminalId() == null || xhpcTerminal.getChargingPileId() == null || xhpcTerminal.getPileSerialNumber() == null) {
|
if (xhpcTerminal == null || xhpcTerminal.getTerminalId() == null || xhpcTerminal.getChargingPileId() == null || xhpcTerminal.getPileSerialNumber() == null) {
|
||||||
return AjaxResult.error(1104, "无效的终端编号");
|
return AjaxResult.error(1104, "因限电该桩已停用,请选择其他桩进行充电");
|
||||||
}
|
}
|
||||||
|
|
||||||
//获取桩信息
|
//获取桩信息
|
||||||
@ -348,7 +349,7 @@ public class XhpcChargeOrderServiceImpl extends BaseService implements IXhpcChar
|
|||||||
//获取充电订单号
|
//获取充电订单号
|
||||||
XhpcChargeOrder order = xhpcChargeOrderMapper.getChargingOrderId(chargingOrderId);
|
XhpcChargeOrder order = xhpcChargeOrderMapper.getChargingOrderId(chargingOrderId);
|
||||||
if(order ==null){
|
if(order ==null){
|
||||||
return AjaxResult.error(1104, "无效的终端编号");
|
return AjaxResult.error(1104, "因限电该桩已停用,请选择其他桩进行充电");
|
||||||
}else{
|
}else{
|
||||||
if(order.getSource()==1){
|
if(order.getSource()==1){
|
||||||
return AjaxResult.error(1104, "请在启动方停止充电");
|
return AjaxResult.error(1104, "请在启动方停止充电");
|
||||||
@ -486,7 +487,13 @@ public class XhpcChargeOrderServiceImpl extends BaseService implements IXhpcChar
|
|||||||
startChargingData.setTel(driverId);
|
startChargingData.setTel(driverId);
|
||||||
|
|
||||||
startChargingData.setPileNo(connectorId.substring(0, connectorId.length() - 3));
|
startChargingData.setPileNo(connectorId.substring(0, connectorId.length() - 3));
|
||||||
|
//终端信息
|
||||||
|
XhpcTerminal xhpcTerminal = xhpcChargeOrderMapper.getXhpcTerminalSerialNumber(connectorId,null);
|
||||||
|
if (xhpcTerminal == null || xhpcTerminal.getTerminalId() == null || xhpcTerminal.getChargingPileId() == null || xhpcTerminal.getPileSerialNumber() == null) {
|
||||||
|
r.setCode(1);
|
||||||
|
r.setMsg("因限电该桩已停用,请选择其他桩进行充电");
|
||||||
|
return r;
|
||||||
|
}
|
||||||
//终端状态是否空闲
|
//终端状态是否空闲
|
||||||
//是否插枪
|
//是否插枪
|
||||||
Map<String, Object> cacheMap = REDIS.getCacheMap("gun:" + connectorId);
|
Map<String, Object> cacheMap = REDIS.getCacheMap("gun:" + connectorId);
|
||||||
@ -531,13 +538,7 @@ public class XhpcChargeOrderServiceImpl extends BaseService implements IXhpcChar
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//终端信息
|
|
||||||
XhpcTerminal xhpcTerminal = xhpcChargeOrderMapper.getXhpcTerminalSerialNumber(connectorId,null);
|
|
||||||
if (xhpcTerminal == null || xhpcTerminal.getTerminalId() == null || xhpcTerminal.getChargingPileId() == null || xhpcTerminal.getPileSerialNumber() == null) {
|
|
||||||
r.setCode(1);
|
|
||||||
r.setMsg("无效的终端编号");
|
|
||||||
return r;
|
|
||||||
}
|
|
||||||
|
|
||||||
//启动充电
|
//启动充电
|
||||||
//订单流水号 终端号+年月日时分秒+自增4位 共32位
|
//订单流水号 终端号+年月日时分秒+自增4位 共32位
|
||||||
|
|||||||
@ -397,7 +397,7 @@ public class XhpcHistoryOrderServiceImpl extends BaseService implements IXhpcHis
|
|||||||
writer.addHeaderAlias("updateTime", "结算时间");
|
writer.addHeaderAlias("updateTime", "结算时间");
|
||||||
writer.addHeaderAlias("chargingModeName", "订单来源");
|
writer.addHeaderAlias("chargingModeName", "订单来源");
|
||||||
writer.addHeaderAlias("stopReasonEvcs", "停止原因");
|
writer.addHeaderAlias("stopReasonEvcs", "停止原因");
|
||||||
|
writer.addHeaderAlias("sourceName", "用户类型");
|
||||||
|
|
||||||
// writer.addHeaderAlias("plateNum", "电站名称");
|
// writer.addHeaderAlias("plateNum", "电站名称");
|
||||||
// writer.addHeaderAlias("disputeOrderStatus", "桩编号");
|
// writer.addHeaderAlias("disputeOrderStatus", "桩编号");
|
||||||
|
|||||||
@ -993,7 +993,7 @@
|
|||||||
left join xhpc_charge_order co on co.charge_order_id = ho.charge_order_id
|
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
|
left join xhpc_charging_station cs on cs.charging_station_id = co.charging_station_id
|
||||||
left join xhpc_terminal as te on te.terminal_id = ho.terminal_id
|
left join xhpc_terminal as te on te.terminal_id = ho.terminal_id
|
||||||
where ho.history_order_id not in (select history_order_id from xhpc_statistics_time_interval )
|
where ho.history_order_id not in (select history_order_id from xhpc_statistics_station where type =2 )
|
||||||
and ho.total_price is not null and now() >DATE_ADD(ho.end_time,interval 6 hour)
|
and ho.total_price is not null and now() >DATE_ADD(ho.end_time,interval 6 hour)
|
||||||
limit 0,#{number}
|
limit 0,#{number}
|
||||||
</select>
|
</select>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user