|
|
|
@ -97,7 +97,8 @@ public class DataShareModel {
|
|
|
|
|
//系统的数据库账号
|
|
|
|
|
Record record = getSystemById(system_id);
|
|
|
|
|
String user_name = record.getStr("user_name");
|
|
|
|
|
String subscribe_system_ids=record.getStr("subscribe_system_ids");
|
|
|
|
|
String subscribe_system_ids = record.getStr("subscribe_system_ids");
|
|
|
|
|
|
|
|
|
|
//1、回收原来共享表的写权限
|
|
|
|
|
for (Record r : getShareTable(system_id)) {//原来有哪些共享表?
|
|
|
|
|
String table_name = r.getStr("table_name");
|
|
|
|
@ -108,6 +109,9 @@ public class DataShareModel {
|
|
|
|
|
PgUtil.grantUserPrivilege(user_name, s, PgUtil.WRITE);
|
|
|
|
|
}
|
|
|
|
|
//3、原来订阅这个系统有第三方系统有哪些,它们的用户都需要取消对原来表的读授权
|
|
|
|
|
for (String s : subscribe_system_ids.split(",")) {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//4、删除旧数据
|
|
|
|
@ -115,7 +119,7 @@ public class DataShareModel {
|
|
|
|
|
Db.update(sql, system_id);
|
|
|
|
|
//5、保存新数据
|
|
|
|
|
for (String s : table_names.split(",")) {
|
|
|
|
|
Record record = new Record();
|
|
|
|
|
record = new Record();
|
|
|
|
|
record.set("system_id", system_id);
|
|
|
|
|
record.set("table_name", s);
|
|
|
|
|
Db.save("t_datashare_table", "id", record);
|
|
|
|
|