update 算法应用平台Service

This commit is contained in:
Lemon
2024-12-11 11:23:40 +08:00
parent 05cf609297
commit c321ca9ffc
6 changed files with 225 additions and 24 deletions

View File

@@ -165,6 +165,12 @@ public interface PileBasicInfoService {
*/
void saveBMSChargeInfo2Redis(BMSChargeInfoData bmsChargeInfoData);
/**
* 根据交易流水号获取0x25数据时间倒序
* @return
*/
List<BMSChargeInfoData> getBMSChargeInfoList(String transactionCode);
/**
* 根据交易流水号查询0x23数据时间倒序
* @param transactionCode

View File

@@ -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