mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-20 11:05:18 +08:00
update 算法应用平台Service
This commit is contained in:
@@ -165,6 +165,12 @@ public interface PileBasicInfoService {
|
||||
*/
|
||||
void saveBMSChargeInfo2Redis(BMSChargeInfoData bmsChargeInfoData);
|
||||
|
||||
/**
|
||||
* 根据交易流水号获取0x25数据(时间倒序)
|
||||
* @return
|
||||
*/
|
||||
List<BMSChargeInfoData> getBMSChargeInfoList(String transactionCode);
|
||||
|
||||
/**
|
||||
* 根据交易流水号查询0x23数据(时间倒序)
|
||||
* @param transactionCode
|
||||
|
||||
@@ -721,6 +721,34 @@ public class PileBasicInfoServiceImpl implements PileBasicInfoService {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据交易流水号获取0x25数据
|
||||
* @param transactionCode
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<BMSChargeInfoData> getBMSChargeInfoList(String transactionCode) {
|
||||
List<BMSChargeInfoData> resultList = Lists.newArrayList();
|
||||
if (StringUtils.isBlank(transactionCode)) {
|
||||
return resultList;
|
||||
}
|
||||
String redisKey = CacheConstants.BMS_CHARGE_INFO_BY_TRANSACTION_CODE + transactionCode;
|
||||
// 拿到所有数据
|
||||
Map<Object, Object> map = redisCache.hmget(redisKey);
|
||||
if (map != null && !map.isEmpty()) {
|
||||
List<String> keyList = map.keySet().stream()
|
||||
.map(x -> (String) x)
|
||||
.sorted(Comparator.reverseOrder()) // 对keyList排序 时间倒序
|
||||
.collect(Collectors.toList());
|
||||
for (String s : keyList) {
|
||||
Object o = map.get(s);
|
||||
BMSChargeInfoData data = JSONObject.parseObject((String) o, BMSChargeInfoData.class);
|
||||
resultList.add(data);
|
||||
}
|
||||
}
|
||||
return resultList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据交易流水号查询0x23数据(时间倒序)
|
||||
* @param transactionCode
|
||||
|
||||
Reference in New Issue
Block a user