fix: 基础数据同步增加日志输出,对过程进行追踪

This commit is contained in:
zyd
2022-06-08 10:36:34 +08:00
parent fb72b31b43
commit 8d65415ae2
2 changed files with 12 additions and 1 deletions
@@ -28,7 +28,9 @@ public class ScheduledSync {
@Async
public void syncSchedulingTasks() {
log.info("======================================开始同步基础数据========================================");
iDataSyncService.orgDataSync(); //时间短
iDataSyncService.dataSync(); //时间长
log.info("======================================结束同步基础数据========================================");
}
}
@@ -124,9 +124,11 @@ public class DataSyncServiceImpl implements IDataSyncService {
}
}
if(!addUserList.isEmpty()){
logger.debug("本次新增的用户为:"+JSONObject.toJSONString(addUserList));
tsUserService.saveBatch(addUserList);
}
if(!upUserList.isEmpty()){
logger.debug("本次更新的用户为:"+JSONObject.toJSONString(upUserList));
tsUserService.updateBatchById(upUserList);
}
}catch(Exception e){
@@ -189,15 +191,22 @@ public class DataSyncServiceImpl implements IDataSyncService {
}
//需要新增的数据
if(!addTsInstitutionList.isEmpty()){
logger.debug("本次新增的组织机构为:"+JSONObject.toJSONString(addTsInstitutionList));
tsInstitutionService.saveBatch(addTsInstitutionList);
}
//需要更新的数据
if(!updateTsInstitutionList.isEmpty()){
logger.debug("本次更新的组织机构为:"+JSONObject.toJSONString(updateTsInstitutionList));
tsInstitutionService.updateBatchById(updateTsInstitutionList);
}
//需要删除的数据
if(!delTsInstitutionList.isEmpty()){
tsInstitutionService.updateBatchById(delTsInstitutionList);
logger.debug("本次删除的组织机构为:"+JSONObject.toJSONString(delTsInstitutionList));
List<String> delIdList = new ArrayList<>();
for(TsInstitution data : delTsInstitutionList){
delIdList.add(data.getId());
}
tsInstitutionService.removeByIds(delIdList);
}
}catch(Exception e){
logger.error(e.getMessage(),e);