fix: 修复组织机构及用户数据在同步时接口报错导致用户数据无法正常处理,直接将数据库中的数据全部删除的BUG
This commit is contained in:
+8
@@ -47,6 +47,7 @@ public class DataSyncServiceImpl implements IDataSyncService {
|
||||
try{
|
||||
SyncUserService syncUserService = new SyncUserService();
|
||||
List<String> res = syncUserService.syncFotonUser();
|
||||
if(res!=null && !res.isEmpty()){
|
||||
//存放岗位信息
|
||||
Map<String, String> positionMap = new HashMap<>();
|
||||
TsPosition position = new TsPosition();
|
||||
@@ -131,6 +132,9 @@ public class DataSyncServiceImpl implements IDataSyncService {
|
||||
logger.debug("本次更新的用户为:"+JSONObject.toJSONString(upUserList));
|
||||
tsUserService.updateBatchById(upUserList);
|
||||
}
|
||||
}else{
|
||||
logger.info("本次获取用户的数据为空,原因有2种:1、没有同步数据 2、请求接口报错");
|
||||
}
|
||||
}catch(Exception e){
|
||||
logger.error(e.getMessage(),e);
|
||||
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
||||
@@ -145,6 +149,7 @@ public class DataSyncServiceImpl implements IDataSyncService {
|
||||
try{
|
||||
SyncUserService syncUserService = new SyncUserService();
|
||||
List<String> res = syncUserService.syncFotonOrg();
|
||||
if(res!=null && !res.isEmpty()){
|
||||
//获取到所有用户数据
|
||||
List<String> strings=new ArrayList<>();
|
||||
//tsInstitutionService.clearData();
|
||||
@@ -208,6 +213,9 @@ public class DataSyncServiceImpl implements IDataSyncService {
|
||||
}
|
||||
tsInstitutionService.removeByIds(delIdList);
|
||||
}
|
||||
}else{
|
||||
logger.info("本次获取组织机构的数据为空,原因有2种:1、没有同步数据 2、请求接口报错");
|
||||
}
|
||||
}catch(Exception e){
|
||||
logger.error(e.getMessage(),e);
|
||||
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
||||
|
||||
Reference in New Issue
Block a user