mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-20 02:55:04 +08:00
update 启动预约订单
This commit is contained in:
@@ -334,6 +334,8 @@ public class OrderService {
|
||||
.payAmount(dto.getChargeAmount())
|
||||
.payMode(dto.getPayMode())
|
||||
.orderAmount(BigDecimal.ZERO)
|
||||
.startType("appointment") // 测试代码用完删除
|
||||
.appointmentTime(DateUtils.addMinute(new Date(), 5))
|
||||
.build();
|
||||
|
||||
// 订单详情
|
||||
|
||||
@@ -18,6 +18,7 @@ import com.jsowell.common.enums.ykc.OrderStatusEnum;
|
||||
import com.jsowell.common.enums.ykc.PileConnectorDataBaseStatusEnum;
|
||||
import com.jsowell.common.enums.ykc.ReturnCodeEnum;
|
||||
import com.jsowell.common.enums.ykc.StartModeEnum;
|
||||
import com.jsowell.common.enums.ykc.StartTypeEnum;
|
||||
import com.jsowell.common.exception.BusinessException;
|
||||
import com.jsowell.common.util.DateUtils;
|
||||
import com.jsowell.common.util.SecurityUtils;
|
||||
@@ -53,7 +54,6 @@ import com.jsowell.pile.vo.uniapp.MemberVO;
|
||||
import com.jsowell.pile.vo.uniapp.OrderVO;
|
||||
import com.jsowell.pile.vo.uniapp.PersonPileConnectorSumInfoVO;
|
||||
import com.jsowell.pile.vo.uniapp.SendMessageVO;
|
||||
import com.jsowell.pile.vo.web.BillingTemplateVO;
|
||||
import com.jsowell.pile.vo.web.IndexOrderInfoVO;
|
||||
import com.jsowell.pile.vo.web.OrderListVO;
|
||||
import com.jsowell.pile.vo.web.OrderTotalDataVO;
|
||||
@@ -323,12 +323,17 @@ public class OrderBasicInfoServiceImpl implements IOrderBasicInfoService {
|
||||
long currentTimeMillis = System.currentTimeMillis();
|
||||
// 判断支付成功时间距当前时间是否大于15分钟
|
||||
for (OrderBasicInfo orderBasicInfo : orderList) {
|
||||
String orderCode = orderBasicInfo.getOrderCode();
|
||||
Date payTime = orderBasicInfo.getPayTime();
|
||||
if (payTime == null) {
|
||||
continue;
|
||||
// 立即启动的订单使用支付时间判断,预约充电的订单使用预约时间判断
|
||||
long time;
|
||||
String startType = orderBasicInfo.getStartType();
|
||||
if (StringUtils.equals(StartTypeEnum.NOW.getValue(), startType)) {
|
||||
Date payTime = orderBasicInfo.getPayTime();
|
||||
time = payTime == null ? 0L : payTime.getTime();
|
||||
} else {
|
||||
Date appointmentTime = orderBasicInfo.getAppointmentTime();
|
||||
time = appointmentTime == null ? 0L : appointmentTime.getTime();
|
||||
}
|
||||
long time = payTime.getTime();
|
||||
|
||||
if (currentTimeMillis - time < 1000 * 60 * 15) {
|
||||
continue;
|
||||
}
|
||||
@@ -337,7 +342,7 @@ public class OrderBasicInfoServiceImpl implements IOrderBasicInfoService {
|
||||
PileConnectorInfoVO connector = pileConnectorInfoService.getPileConnectorInfoByConnectorCode(pileConnectorCode);
|
||||
// 充电桩不在线,则不做处理。请联系管理员操作
|
||||
if (PileConnectorDataBaseStatusEnum.OFF_NETWORK.getValue().equals(String.valueOf(connector.getStatus()))) {
|
||||
logger.info("订单号:{}已经支付超过15分钟,充电桩:{}未启动,但是该桩为离线状态,请联系管理员处理", orderCode, pileConnectorCode);
|
||||
logger.info("订单号:{}已经支付超过15分钟,充电桩:{}未启动,但是该桩为离线状态,请联系管理员处理", orderBasicInfo.getOrderCode(), pileConnectorCode);
|
||||
continue;
|
||||
}
|
||||
// 获取订单的实时检测数据,有实时数据说明充电了,没有实时数据说明桩确实没有充电
|
||||
|
||||
@@ -876,6 +876,6 @@
|
||||
and pay_status = '1'
|
||||
and start_type = 'appointment'
|
||||
and order_status = '0'
|
||||
and settlement_time <![CDATA[ <= ]]> #{dateTime,jdbcType=TIMESTAMP}
|
||||
and appointment_time <![CDATA[ <= ]]> #{dateTime,jdbcType=TIMESTAMP}
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -64,6 +64,7 @@ public class JsowellTask {
|
||||
if (CollectionUtils.isEmpty(list)) {
|
||||
return;
|
||||
}
|
||||
log.info("待启动充电订单:{}", list);
|
||||
for (OrderBasicInfo orderInfo : list) {
|
||||
String pileSn = orderInfo.getPileSn();
|
||||
// 发送启动充电指令前,再次下发计费模板
|
||||
|
||||
Reference in New Issue
Block a user