mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-05-06 11:00:13 +08:00
update 查询订单详情页时,检查订单状态
This commit is contained in:
@@ -379,7 +379,7 @@ public class OrderService {
|
||||
|
||||
// 监控信息
|
||||
OrderDetailInfoVO.OrderRealTimeInfo realTimeInfo = new OrderDetailInfoVO.OrderRealTimeInfo();
|
||||
RealTimeMonitorData realTimeMonitorData = chargingRealTimeDataList.get(0);
|
||||
RealTimeMonitorData realTimeMonitorData = chargingRealTimeDataList.get(0); // 最后一次实时数据
|
||||
realTimeInfo.setOrderAmount(realTimeMonitorData.getChargingAmount());
|
||||
realTimeInfo.setChargedDegree(realTimeMonitorData.getChargingDegree());
|
||||
realTimeInfo.setChargingTime(realTimeMonitorData.getSumChargingTime());
|
||||
@@ -393,7 +393,7 @@ public class OrderService {
|
||||
vo.setRealTimeMonitorDataList(infoList);
|
||||
|
||||
// 最后一次实时数据
|
||||
vo.setLastMonitorData(chargingRealTimeDataList.get(0));
|
||||
vo.setLastMonitorData(realTimeMonitorData);
|
||||
}
|
||||
|
||||
// 支付流水
|
||||
@@ -429,7 +429,20 @@ public class OrderService {
|
||||
log.error("后管查询订单详情时把redis中的实时数据存到表发生异常", e);
|
||||
}
|
||||
|
||||
// 校验
|
||||
try {
|
||||
if (StringUtils.equals(orderBasicInfo.getOrderStatus(), OrderStatusEnum.IN_THE_CHARGING.getValue())) {
|
||||
RealTimeMonitorData lastMonitorData = vo.getLastMonitorData();
|
||||
if (lastMonitorData != null) {
|
||||
String dateTime = lastMonitorData.getDateTime();
|
||||
if (DateUtils.intervalTime(dateTime, DateUtils.getDateTime()) > 2L) {
|
||||
// 间隔时间超过2分钟, 订单状态修改为异常
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error("后管查询订单详情时校验订单状态", e);
|
||||
}
|
||||
return vo;
|
||||
}
|
||||
|
||||
|
||||
@@ -65,10 +65,20 @@ public class DateUtils extends org.apache.commons.lang3.time.DateUtils {
|
||||
return dateTimeNow(YYYY_MM_DD);
|
||||
}
|
||||
|
||||
public static String getTime() {
|
||||
/**
|
||||
* 获取当前日期, 默认格式为yyyy-MM-dd HH:mm:ss
|
||||
*
|
||||
* @return String
|
||||
*/
|
||||
public static String getDateTime() {
|
||||
return dateTimeNow(YYYY_MM_DD_HH_MM_SS);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取当前日期, 默认格式为yyyyMMddHHmmss
|
||||
*
|
||||
* @return String
|
||||
*/
|
||||
public static String dateTimeNow() {
|
||||
return dateTimeNow(YYYYMMDDHHMMSS);
|
||||
}
|
||||
@@ -169,7 +179,7 @@ public class DateUtils extends org.apache.commons.lang3.time.DateUtils {
|
||||
// String s2 = formatDateTime(new Date());
|
||||
// System.out.println(s2);
|
||||
|
||||
String time = DateUtils.getTime();
|
||||
String time = DateUtils.getDateTime();
|
||||
System.out.println(time);
|
||||
|
||||
System.out.println(DateUtils.getDate());
|
||||
|
||||
@@ -52,7 +52,7 @@ public class NettyClient implements Runnable {
|
||||
ChannelFuture future = b.connect(HOST, PORT).sync();
|
||||
while (boo) {
|
||||
num++;
|
||||
future.channel().writeAndFlush("发送数据=======" + content + "--" + DateUtils.getTime());
|
||||
future.channel().writeAndFlush("发送数据=======" + content + "--" + DateUtils.getDateTime());
|
||||
try { //休眠一段时间
|
||||
Thread.sleep(3000);
|
||||
} catch (InterruptedException e) {
|
||||
|
||||
@@ -64,7 +64,7 @@ public class NettyClientHandler extends ChannelInboundHandlerAdapter {
|
||||
return;
|
||||
}
|
||||
//将客户端的信息直接返回写入ctx
|
||||
ctx.write(msg + " 时间:" + DateUtils.getTime());
|
||||
ctx.write(msg + " 时间:" + DateUtils.getDateTime());
|
||||
//刷新缓存区
|
||||
ctx.flush();
|
||||
}
|
||||
|
||||
@@ -67,7 +67,7 @@ public abstract class AbstractHandler implements InitializingBean {
|
||||
*/
|
||||
protected void saveLastTime(String pileSn) {
|
||||
String redisKey = CacheConstants.PILE_LAST_CONNECTION + pileSn;
|
||||
redisCache.setCacheObject(redisKey, DateUtils.getTime(), CacheConstants.cache_expire_time_1d);
|
||||
redisCache.setCacheObject(redisKey, DateUtils.getDateTime(), CacheConstants.cache_expire_time_1d);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -126,7 +126,7 @@ public class GroundLockDataUploadHandler extends AbstractHandler{
|
||||
.parkingStatus(parkingStatus)
|
||||
.groundLockElectric(groundLockElectric)
|
||||
.alarmStatus(alarmStatus)
|
||||
.time(DateUtils.getTime())
|
||||
.time(DateUtils.getDateTime())
|
||||
.build();
|
||||
|
||||
// 地锁信息放缓存中 缓存10分钟
|
||||
|
||||
@@ -13,7 +13,6 @@ import com.jsowell.common.core.domain.ykc.RealTimeMonitorData;
|
||||
import com.jsowell.common.core.page.PageResponse;
|
||||
import com.jsowell.common.core.redis.RedisCache;
|
||||
import com.jsowell.common.enums.ykc.PileConnectorDataBaseStatusEnum;
|
||||
import com.jsowell.common.enums.ykc.PileConnectorStatusEnum;
|
||||
import com.jsowell.common.enums.ykc.PileStatusEnum;
|
||||
import com.jsowell.common.util.DateUtils;
|
||||
import com.jsowell.common.util.StringUtils;
|
||||
@@ -674,7 +673,7 @@ public class PileConnectorInfoServiceImpl implements IPileConnectorInfoService {
|
||||
// 没有最后连接时间,返回离线
|
||||
return true;
|
||||
}
|
||||
long l = DateUtils.intervalTime(lastConnectionTime, DateUtils.getTime());
|
||||
long l = DateUtils.intervalTime(lastConnectionTime, DateUtils.getDateTime());
|
||||
return l >= 1L;
|
||||
}
|
||||
|
||||
|
||||
@@ -263,7 +263,7 @@ public class YKCPushCommandServiceImpl implements YKCPushCommandService {
|
||||
String pileSn = command.getPileSn();
|
||||
// Date date = new Date();
|
||||
// Date parseDate = DateUtils.parseDate("2023-02-28 16:45:20");
|
||||
Date date = DateUtils.parseDate(DateUtils.getTime());
|
||||
Date date = DateUtils.parseDate(DateUtils.getDateTime());
|
||||
// 根据不同程序版本获取工具类
|
||||
// String programVersion = redisCache.getCacheMapValue(CacheConstants.PILE_PROGRAM_VERSION, pileSn);
|
||||
// AbsCp56Time2aUtil cp56Time2aUtil = Cp56Time2aFactory.getInvokeStrategy(programVersion);
|
||||
|
||||
@@ -345,7 +345,7 @@ public class LianLianServiceImpl implements LianLianService {
|
||||
info.setVoltageA(new BigDecimal(realTimeMonitorData.getOutputVoltage()));
|
||||
info.setSoc(new BigDecimal(realTimeMonitorData.getSOC()));
|
||||
info.setStartTime(DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, orderBasicInfo.getChargeStartTime()));
|
||||
info.setEndTime(DateUtils.getTime()); // 本次采样时间
|
||||
info.setEndTime(DateUtils.getDateTime()); // 本次采样时间
|
||||
info.setTotalPower(new BigDecimal(realTimeMonitorData.getChargingDegree())); // 累计充电量
|
||||
// info.setElecMoney(); // 累计电费
|
||||
// info.setSeviceMoney(); // 累计服务费
|
||||
@@ -665,7 +665,7 @@ public class LianLianServiceImpl implements LianLianService {
|
||||
.VoltageA(new BigDecimal(data.getOutputVoltage())) // 电压
|
||||
.Soc(new BigDecimal(data.getSOC()))
|
||||
.StartTime(DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, orderInfo.getChargeStartTime())) // 开始时间
|
||||
.EndTime(DateUtils.getTime()) // 本次采样时间
|
||||
.EndTime(DateUtils.getDateTime()) // 本次采样时间
|
||||
.TotalPower(new BigDecimal(data.getChargingDegree())) // 累计充电量
|
||||
.ElecMoney(orderDetail.getTotalElectricityAmount()) // 累计电费
|
||||
.SeviceMoney(orderDetail.getTotalServiceAmount()) // 累计服务费
|
||||
@@ -1373,7 +1373,7 @@ public class LianLianServiceImpl implements LianLianService {
|
||||
.voltageA(new BigDecimal(realTimeMonitorData.getOutputVoltage()))
|
||||
.soc(new BigDecimal(realTimeMonitorData.getSOC()))
|
||||
.startTime(DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, orderInfo.getChargeStartTime()))
|
||||
.endTime(DateUtils.getTime())
|
||||
.endTime(DateUtils.getDateTime())
|
||||
.totalPower(new BigDecimal(realTimeMonitorData.getChargingDegree()))
|
||||
.elecMoney(new BigDecimal("0")) // TODO
|
||||
.seviceMoney(new BigDecimal("0")) // TODO
|
||||
|
||||
Reference in New Issue
Block a user