|
|
|
@ -1,14 +1,7 @@
|
|
|
|
|
package com.dsideal.QingLong.DataShare.Model;
|
|
|
|
|
|
|
|
|
|
import com.dsideal.QingLong.Interceptor.EmptyInterface;
|
|
|
|
|
import com.dsideal.QingLong.Interceptor.IsLoginInterface;
|
|
|
|
|
import com.dsideal.QingLong.Interceptor.IsNumericInterface;
|
|
|
|
|
import com.dsideal.QingLong.Interceptor.IsSysAdminInterface;
|
|
|
|
|
import com.dsideal.QingLong.Util.CommonUtil;
|
|
|
|
|
import com.dsideal.QingLong.Util.PgUtil;
|
|
|
|
|
import com.jfinal.aop.Before;
|
|
|
|
|
import com.jfinal.ext.interceptor.GET;
|
|
|
|
|
import com.jfinal.ext.interceptor.POST;
|
|
|
|
|
import com.jfinal.kit.Kv;
|
|
|
|
|
import com.jfinal.kit.StrKit;
|
|
|
|
|
import com.jfinal.plugin.activerecord.Db;
|
|
|
|
@ -50,16 +43,32 @@ public class DataShareModel {
|
|
|
|
|
Db.save("t_datashare_system", "system_id", record);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 功能:删除系统
|
|
|
|
|
* @param system_id
|
|
|
|
|
*/
|
|
|
|
|
public void delSystem(int system_id) {
|
|
|
|
|
//此系统的用户
|
|
|
|
|
String user_name = getSystemById(system_id).getStr("user_name");
|
|
|
|
|
PgUtil.delUser(user_name);
|
|
|
|
|
Db.deleteById("t_datashare_system", "system_id", system_id);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 功能:更新系统
|
|
|
|
|
* @param system_id
|
|
|
|
|
* @param system_name
|
|
|
|
|
*/
|
|
|
|
|
public void updateSystem(int system_id, String system_name) {
|
|
|
|
|
String sql = "update t_datashare_system set system_name=? where system_id=?";
|
|
|
|
|
Db.update(sql, system_name, system_id);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 功能:获取系统信息
|
|
|
|
|
* @param system_id
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
public Record getSystemById(int system_id) {
|
|
|
|
|
return Db.findById("t_datashare_system", "system_id", system_id);
|
|
|
|
|
}
|
|
|
|
@ -115,6 +124,7 @@ public class DataShareModel {
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 功能:判断指定的一组表是不是有不存在的
|
|
|
|
|
*
|
|
|
|
|
* @param table_names
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|