|
|
@@ -51,7 +51,7 @@ public class role extends Controller {
|
|
|
// sqlFactory.addParameter_SQL("where", where);
|
|
|
// Rows rows = dbConnect.runSqlQuery(sqlFactory);
|
|
|
QuerySQL querySQL = SQLFactory.createQuerySQL(this, "sys_role", "roleid", "rolename",
|
|
|
- "remarks","usertype","issystem","isshieldinfo","createby","createdate","changeby","changedate","siteid");
|
|
|
+ "remarks", "usertype", "issystem", "isshieldinfo", "createby", "createdate", "changeby", "changedate", "siteid");
|
|
|
querySQL.setTableAlias("t1");
|
|
|
querySQL.setSiteid(siteid);
|
|
|
querySQL.setWhere("ifnull(sys_enterpriseid, 0) = 0");
|
|
|
@@ -228,9 +228,9 @@ public class role extends Controller {
|
|
|
// Rows approws = dbConnect.runSqlQuery(appselectsql);
|
|
|
QuerySQL querySQL = SQLFactory.createQuerySQL(this, "sys_system", "systemname");
|
|
|
querySQL.setTableAlias("t1");
|
|
|
- querySQL.addJoinTable(JOINTYPE.inner, "sys_systemclient", "t2", "t1.systemid = t2.systemid and t2.isused = 1","systemclientname");
|
|
|
- querySQL.addJoinTable(JOINTYPE.inner, "sys_systemmodule", "t3", "t2.systemclientid = t3.systemclientid and t3.isused = 1","systemmodulename");
|
|
|
- querySQL.addJoinTable(JOINTYPE.inner, "sys_systemapp", "t4", "t3.systemmoduleid = t4.systemmoduleid and t4.isused = 1 and t4.isneedauth = 1","systemappid","systemappname","remarks");
|
|
|
+ querySQL.addJoinTable(JOINTYPE.inner, "sys_systemclient", "t2", "t1.systemid = t2.systemid and t2.isused = 1", "systemclientname");
|
|
|
+ querySQL.addJoinTable(JOINTYPE.inner, "sys_systemmodule", "t3", "t2.systemclientid = t3.systemclientid and t3.isused = 1", "systemmodulename");
|
|
|
+ querySQL.addJoinTable(JOINTYPE.inner, "sys_systemapp", "t4", "t3.systemmoduleid = t4.systemmoduleid and t4.isused = 1 and t4.isneedauth = 1", "systemappid", "systemappname", "remarks");
|
|
|
querySQL.setWhere("t1.isused = 1");
|
|
|
querySQL.setWhere("exists(select optionid from sys_systemapp_options where systemappid = t4.systemappid)");
|
|
|
querySQL.setWhere(where.toString());
|
|
|
@@ -359,35 +359,27 @@ public class role extends Controller {
|
|
|
|
|
|
@API(title = "角色授权,报表选择查询", apiversion = R.ID20221213141501.v1.class)
|
|
|
public String roleAuthReportSelect() throws YosException {
|
|
|
- /*
|
|
|
- 过滤条件设置
|
|
|
- */
|
|
|
- StringBuffer where = new StringBuffer(" 1=1 ");
|
|
|
- if (content.containsKey("where")) {
|
|
|
- JSONObject whereObject = content.getJSONObject("where");
|
|
|
- if (whereObject.containsKey("condition") && !"".equals(whereObject.getString("condition"))) {
|
|
|
- where.append(" and(");
|
|
|
- where.append("t2.name like'%").append(whereObject.getString("condition")).append("%' ");
|
|
|
- where.append(")");
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
long roleid = content.getLong("roleid");
|
|
|
- SQLFactory sqlFactory = new SQLFactory(this, "角色授权报表选择查询");
|
|
|
- sqlFactory.addParameter("siteid", siteid);
|
|
|
- sqlFactory.addParameter("roleid", roleid);
|
|
|
- sqlFactory.addParameter_SQL("where", where);
|
|
|
- Rows rows = dbConnect.runSqlQuery(sqlFactory.getSQL());
|
|
|
+ ArrayList<Long> sys_reportid = dbConnect.runSqlQuery("select sys_reportid from sys_rolereportauth where roleid=" + roleid).toArrayList("sys_reportid", new ArrayList<>());
|
|
|
+ QuerySQL querySQL = SQLFactory.createQuerySQL(this, "sys_report", "sys_reportid", "name", "type").setTableAlias("t1");
|
|
|
+ querySQL.addJoinTable(JOINTYPE.inner, "sys_systemapp", "t2", "t1.systemappid=t2.systemappid", "systemappname");
|
|
|
+ querySQL.setWhere("ifnull(t1.siteid, '') = '' or t1.siteid = '" + siteid + "'");
|
|
|
+ querySQL.setWhere("t1.isused", true);
|
|
|
+ querySQL.setWhere("t1.sys_reportid", Op.NOT_IN, sys_reportid);
|
|
|
+ Rows rows = querySQL.query();
|
|
|
return getSucReturnObject().setData(rows).toString();
|
|
|
}
|
|
|
|
|
|
@API(title = "角色报表查询", apiversion = R.ID20221213141601.v1.class)
|
|
|
public String roleAuthReportQuery() throws YosException {
|
|
|
long roleid = content.getLong("roleid");
|
|
|
- SQLFactory sqlFactory = new SQLFactory(this, "角色授权报表查询");
|
|
|
- sqlFactory.addParameter("siteid", siteid);
|
|
|
- sqlFactory.addParameter("roleid", roleid);
|
|
|
- Rows rows = dbConnect.runSqlQuery(sqlFactory.getSQL());
|
|
|
+ QuerySQL querySQL = SQLFactory.createQuerySQL(this, "sys_rolereportauth", "sys_reportid").setTableAlias("t1");
|
|
|
+ querySQL.addJoinTable(JOINTYPE.inner, "sys_report", "t2", "t1.sys_reportid=t2.sys_reportid", "name", "type");
|
|
|
+ querySQL.addJoinTable(JOINTYPE.inner, "sys_systemapp", "t3", "t2.systemappid=t3.systemappid", "systemappname");
|
|
|
+ querySQL.setWhere("t1.roleid", roleid);
|
|
|
+ querySQL.setWhere("ifnull(t2.siteid, '') = '' or t2.siteid = '" + siteid + "'");
|
|
|
+ querySQL.setWhere("t2.isused", true);
|
|
|
+ Rows rows = querySQL.query();
|
|
|
return getSucReturnObject().setData(rows).toString();
|
|
|
}
|
|
|
|
|
|
@@ -482,9 +474,9 @@ public class role extends Controller {
|
|
|
QuerySQL querySQL = SQLFactory.createQuerySQL(this, "sys_userrole", "userid", "userroleid",
|
|
|
"roleid");
|
|
|
querySQL.setTableAlias("t1");
|
|
|
- querySQL.addJoinTable(JOINTYPE.inner, "sys_users", "t2", "t1.userid = t2.userid","name","accountno","remarks","phonenumber","status");
|
|
|
+ querySQL.addJoinTable(JOINTYPE.inner, "sys_users", "t2", "t1.userid = t2.userid", "name", "accountno", "remarks", "phonenumber", "status");
|
|
|
querySQL.setSiteid(siteid);
|
|
|
- querySQL.setWhere("t1.roleid",roleid);
|
|
|
+ querySQL.setWhere("t1.roleid", roleid);
|
|
|
querySQL.setPage(pageSize, pageNumber);
|
|
|
Rows rows = querySQL.query();
|
|
|
return getSucReturnObject().setData(rows).toString();
|