mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-20 02:55:04 +08:00
新增 查询充电启动状态缓存,查询启动充电结果逻辑
This commit is contained in:
@@ -709,9 +709,17 @@ public class OrderService {
|
||||
reason = orderInfo.getReason();
|
||||
} else {
|
||||
// 查询订单的实时监测数据
|
||||
List<RealTimeMonitorData> chargingRealTimeData = orderBasicInfoService.getChargingRealTimeData(orderInfo.getTransactionCode());
|
||||
if (CollectionUtils.isNotEmpty(chargingRealTimeData)) {
|
||||
// 实时监测数据不为空说明已经在充电中了
|
||||
// List<RealTimeMonitorData> chargingRealTimeData = orderBasicInfoService.getChargingRealTimeData(orderInfo.getTransactionCode());
|
||||
// if (CollectionUtils.isNotEmpty(chargingRealTimeData)) {
|
||||
// // 实时监测数据不为空说明已经在充电中了
|
||||
// status = Constants.ONE;
|
||||
// }
|
||||
|
||||
// 查询缓存中该笔订单的启动状态
|
||||
String redisKey = CacheConstants.QUERY_ORDER_START_RESULT_BY_ORDER_CODE + orderCode;
|
||||
String startResult = (String) redisCache.getCacheObject(redisKey);
|
||||
if (StringUtils.equals(Constants.ONE, startResult)) {
|
||||
// 启动成功
|
||||
status = Constants.ONE;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -170,6 +170,11 @@ public class CacheConstants {
|
||||
*/
|
||||
public static final String SELECT_PILE_CONNECTOR_INFO_LIST = "select_pile_connector_info_list:";
|
||||
|
||||
/**
|
||||
* 查询订单启动结果
|
||||
*/
|
||||
public static final String QUERY_ORDER_START_RESULT_BY_ORDER_CODE = "query_order_start_result_by_order_code:";
|
||||
|
||||
/**
|
||||
* 0x3b交易记录缓存key
|
||||
*/
|
||||
|
||||
@@ -19,7 +19,8 @@ public class ZipUtil {
|
||||
}
|
||||
String fileName = "images-" + System.currentTimeMillis() + ".zip";
|
||||
File zipFile = new File(fileName);
|
||||
try (FileOutputStream fos = new FileOutputStream(zipFile); ZipOutputStream zos = new ZipOutputStream(fos)) {
|
||||
try (FileOutputStream fos = new FileOutputStream(zipFile);
|
||||
ZipOutputStream zos = new ZipOutputStream(fos)) {
|
||||
for (int i = 0; i < imageUrls.size(); i++) {
|
||||
String imageUrl = imageUrls.get(i);
|
||||
URL url = new URL(imageUrl);
|
||||
|
||||
@@ -671,6 +671,11 @@ public class OrderBasicInfoServiceImpl implements OrderBasicInfoService {
|
||||
orderInfo.setChargeStartTime(new Date());
|
||||
}
|
||||
updateOrderBasicInfo(orderInfo);
|
||||
|
||||
// 添加一条启动成功的缓存
|
||||
String redisKey = CacheConstants.QUERY_ORDER_START_RESULT_BY_ORDER_CODE + orderInfo.getOrderCode();
|
||||
redisCache.setCacheObject(redisKey, Constants.ONE, 10, TimeUnit.MINUTES);
|
||||
|
||||
// // 判断是否要向小程序发送通知
|
||||
// if (StringUtils.isNotEmpty(orderInfo.getMemberId())){
|
||||
// // 发送小程序通知
|
||||
|
||||
Reference in New Issue
Block a user