处理更新基线信息逻辑
This commit is contained in:
+9
-4
@@ -523,7 +523,10 @@ public class OnlyOfficeController {
|
|||||||
Date now = new Date();
|
Date now = new Date();
|
||||||
logger.info("更新基线信息开始==========================================");
|
logger.info("更新基线信息开始==========================================");
|
||||||
logger.info("时间:" + DateUtils.date2Str(now,DateUtils.time_sdf.get()));
|
logger.info("时间:" + DateUtils.date2Str(now,DateUtils.time_sdf.get()));
|
||||||
OnlineFileLog createTimeLatestOnlineFileLog = this.getCreateTimeLatestOnlineFileLog(fileId,now);
|
// 查询总次数,如果查了超过10次还没有查出来,则终止本次更新.
|
||||||
|
int queryCount = 0;
|
||||||
|
OnlineFileLog createTimeLatestOnlineFileLog = this.getCreateTimeLatestOnlineFileLog(fileId,now,queryCount);
|
||||||
|
if (null != createTimeLatestOnlineFileLog) {
|
||||||
createTimeLatestOnlineFileLog.setJxFileName(jxFileName);
|
createTimeLatestOnlineFileLog.setJxFileName(jxFileName);
|
||||||
createTimeLatestOnlineFileLog.setDataType(dataType);
|
createTimeLatestOnlineFileLog.setDataType(dataType);
|
||||||
|
|
||||||
@@ -590,6 +593,7 @@ public class OnlyOfficeController {
|
|||||||
logger.info("基线版本文件上传接口结束==========================================");
|
logger.info("基线版本文件上传接口结束==========================================");
|
||||||
|
|
||||||
this.onlineFileLogDao.updateById(createTimeLatestOnlineFileLog);
|
this.onlineFileLogDao.updateById(createTimeLatestOnlineFileLog);
|
||||||
|
}
|
||||||
return Result.OK();
|
return Result.OK();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -597,7 +601,7 @@ public class OnlyOfficeController {
|
|||||||
* 获取在线编辑文件保存历史,更新基线信息使用。
|
* 获取在线编辑文件保存历史,更新基线信息使用。
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public OnlineFileLog getCreateTimeLatestOnlineFileLog(String fileId,Date now){
|
public OnlineFileLog getCreateTimeLatestOnlineFileLog(String fileId,Date now,int queryCount){
|
||||||
QueryWrapper<OnlineFileLog> ofLogQueryWrap = new QueryWrapper<>();
|
QueryWrapper<OnlineFileLog> ofLogQueryWrap = new QueryWrapper<>();
|
||||||
ofLogQueryWrap.lambda().eq(OnlineFileLog::getHisId,fileId);
|
ofLogQueryWrap.lambda().eq(OnlineFileLog::getHisId,fileId);
|
||||||
ofLogQueryWrap.lambda().ge(OnlineFileLog::getCreateTime,now);
|
ofLogQueryWrap.lambda().ge(OnlineFileLog::getCreateTime,now);
|
||||||
@@ -631,13 +635,14 @@ public class OnlyOfficeController {
|
|||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
|
|
||||||
if (ObjectUtils.isEmpty(result)){
|
if (ObjectUtils.isEmpty(result) && queryCount < 10){
|
||||||
|
queryCount ++;
|
||||||
try {
|
try {
|
||||||
Thread.sleep(10000);
|
Thread.sleep(10000);
|
||||||
} catch (InterruptedException e) {
|
} catch (InterruptedException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
result = this.getCreateTimeLatestOnlineFileLog(fileId,now);
|
result = this.getCreateTimeLatestOnlineFileLog(fileId,now,queryCount);
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user