Commit d65bfc5a by fz

1.代码整理

1 parent 7c70db33
......@@ -701,44 +701,8 @@ public class AiLockingKeyServiceImpl implements AiLockingKeyService {
SmartVehicleBlueShareKeyExample shareKeyExample = smartVehicleBlueShareKeyService.getBlueKeyShareExampleByCarKeyID(keyId.getId());
List<SmartVehicleBlueShareKey> shareKeyList = smartVehicleBlueShareKeyService.selectByExample(shareKeyExample);
if (CollectionUtils.isEmpty(shareKeyList)){
return R.ok().data(PageInfo.of(shareKeyList));
}
//校验过期时间
/*SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
String nowTime = sdf.format(new Date());
Date nowDate = null;
try {
nowDate = sdf.parse(nowTime);
} catch (ParseException e) {
e.printStackTrace();
return R.error("时间格式不对:yyyy-MM-dd");
}
List<Long> expireList = new ArrayList<>();
//过期数据分类
Date finalNowDate = nowDate;
shareKeyList.stream().forEach(key -> {
Date expireDate = key.getExpireTime();
if (finalNowDate.after(expireDate)) {
expireList.add(key.getId());
//过期关闭
key.setShareStatus(0);
key.setExpireTime(new Date());
}
});
//如果当前时间已经超过过期时间,更新数据
if (CollectionUtils.isNotEmpty(expireList)) {
smartVehicleBlueShareKeyService.updateShareStatusByIds(expireList);
}*/
//重新根据分享状态排序
if(shareKeyList.size()>1){
if(CollectionUtils.isNotEmpty(shareKeyList) && shareKeyList.size()>1){
return R.ok().data(PageInfo.of(shareKeyList.stream().sorted().collect(Collectors.toList())));
}
......
......@@ -77,7 +77,6 @@ public class AiLockingKeyShareServiceImpl implements AiLockingKeyShareService {
key = keyList.get(0);
}
Map<String, Object> map = new HashMap<>();
map.put("key", key);
map.put("keyShareID", keyShareID);
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!