|
|
|
@ -95,7 +95,9 @@ public class DataShareModel {
|
|
|
|
|
*/
|
|
|
|
|
public void share(int system_id, String table_names) {
|
|
|
|
|
//系统的数据库账号
|
|
|
|
|
String user_name = getSystemById(system_id).getStr("user_name");
|
|
|
|
|
Record record = getSystemById(system_id);
|
|
|
|
|
String user_name = record.getStr("user_name");
|
|
|
|
|
String subscribe_system_ids=record.getStr("subscribe_system_ids");
|
|
|
|
|
//1、回收原来共享表的写权限
|
|
|
|
|
for (Record r : getShareTable(system_id)) {//原来有哪些共享表?
|
|
|
|
|
String table_name = r.getStr("table_name");
|
|
|
|
@ -107,6 +109,7 @@ public class DataShareModel {
|
|
|
|
|
}
|
|
|
|
|
//3、原来订阅这个系统有第三方系统有哪些,它们的用户都需要取消对原来表的读授权
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//4、删除旧数据
|
|
|
|
|
String sql = "delete from t_datashare_table where system_id=?";
|
|
|
|
|
Db.update(sql, system_id);
|
|
|
|
|