@ -52,7 +52,7 @@ public class DbSwitchServiceImpl implements DbSwitchService {
@Override
@Override
public void manualSwitchDb ( Map < String , Object > map ) {
public void manualSwitchDb ( Map < String , Object > map ) {
String uuid = UuidUtil . getUuid ( ) ;
String uuid = UuidUtil . getUuid ( ) ;
log . info ( "[uuid:{}]- 开始手动同步数据库表中数据", uuid ) ;
log . info ( "[uuid:{}]- {}- 开始手动同步数据库表中数据", uuid , Constant . STR_FRONTEND ) ;
List < Integer > ids = ( List < Integer > ) map . get ( "ids" ) ;
List < Integer > ids = ( List < Integer > ) map . get ( "ids" ) ;
String checkedNodes = JSON . toJSONString ( map . get ( "checkedNodes" ) ) ;
String checkedNodes = JSON . toJSONString ( map . get ( "checkedNodes" ) ) ;
List < NameTableDcomDec > list = JSON . parseObject ( checkedNodes , new TypeReference < List < NameTableDcomDec > > ( ) {
List < NameTableDcomDec > list = JSON . parseObject ( checkedNodes , new TypeReference < List < NameTableDcomDec > > ( ) {
@ -118,7 +118,7 @@ public class DbSwitchServiceImpl implements DbSwitchService {
} else {
} else {
sqlParam = Constant . SELECT_FROM + source ;
sqlParam = Constant . SELECT_FROM + source ;
}
}
log . info ( "[uuid:{}]- 开始查询{}--{}数据", uuid , cName , source ) ;
log . info ( "[uuid:{}]- {}- 开始查询{}--{}数据", uuid , Constant . STR_FRONTEND , cName , source ) ;
ExportSqlUtil . initConnection ( driverName ,
ExportSqlUtil . initConnection ( driverName ,
url , username , password ) ;
url , username , password ) ;
//List<String> stringList = ExportSqlUtil.executeSQLAndBuildSqlFile("dbo", source, sqlParam);
//List<String> stringList = ExportSqlUtil.executeSQLAndBuildSqlFile("dbo", source, sqlParam);
@ -130,7 +130,7 @@ public class DbSwitchServiceImpl implements DbSwitchService {
//判断当前表名是不是CMS_USERPRMIS_TABLE
//判断当前表名是不是CMS_USERPRMIS_TABLE
if ( "CMS_USERPRMIS_TABLE" . equalsIgnoreCase ( source ) ) {
if ( "CMS_USERPRMIS_TABLE" . equalsIgnoreCase ( source ) ) {
log . info ( "[uuid:{}]- 开始执行CMS_USERPRMIS_TABLE表SQL", uuid ) ;
log . info ( "[uuid:{}]- {}- 开始执行CMS_USERPRMIS_TABLE表SQL", uuid , Constant . STR_FRONTEND ) ;
String impSql = "" ;
String impSql = "" ;
if ( Constant . STR_ONE . equals ( targetDbType ) ) {
if ( Constant . STR_ONE . equals ( targetDbType ) ) {
impSql = "update CMS_USERPRMIS_TABLE set MENUTYPE=(select convert(varchar,(ISNULL(PRMISFLAG, 1)+1))+'-' from CMS_PRMIS_TABLE where PRMISID=CMS_USERPRMIS_TABLE.PRMISID),ORGTYPE=1 where MENUTYPE is null or MENUTYPE=''" ;
impSql = "update CMS_USERPRMIS_TABLE set MENUTYPE=(select convert(varchar,(ISNULL(PRMISFLAG, 1)+1))+'-' from CMS_PRMIS_TABLE where PRMISID=CMS_USERPRMIS_TABLE.PRMISID),ORGTYPE=1 where MENUTYPE is null or MENUTYPE=''" ;
@ -140,9 +140,9 @@ public class DbSwitchServiceImpl implements DbSwitchService {
DatabaseUtil . updateSql ( targetDriver , targetUrl , logName , logPw , impSql ) ;
DatabaseUtil . updateSql ( targetDriver , targetUrl , logName , logPw , impSql ) ;
String publicSql = "UPDATE CMS_USERPRMIS_TABLE SET MENUTYPE = '2-' WHERE MENUTYPE IS NULL" ;
String publicSql = "UPDATE CMS_USERPRMIS_TABLE SET MENUTYPE = '2-' WHERE MENUTYPE IS NULL" ;
DatabaseUtil . updateSql ( targetDriver , targetUrl , logName , logPw , publicSql ) ;
DatabaseUtil . updateSql ( targetDriver , targetUrl , logName , logPw , publicSql ) ;
log . info ( "[uuid:{}]- 执行CMS_USERPRMIS_TABLE表SQL完成", uuid ) ;
log . info ( "[uuid:{}]- {}- 执行CMS_USERPRMIS_TABLE表SQL完成", uuid , Constant . STR_FRONTEND ) ;
}
}
log . info ( "[uuid:{}]- 同步更新--{}--{}--{}数据完成", uuid , staName , cName , source ) ;
log . info ( "[uuid:{}]- {}- 同步更新--{}--{}--{}数据完成", uuid , Constant . STR_FRONTEND , staName , cName , source ) ;
}
}
}
}
}
}
@ -150,6 +150,6 @@ public class DbSwitchServiceImpl implements DbSwitchService {
}
}
}
}
log . info ( "[uuid:{}]- 手动同步数据库表中数据完成", uuid ) ;
log . info ( "[uuid:{}]- {}- 手动同步数据库表中数据完成", uuid , Constant . STR_FRONTEND ) ;
}
}
}
}