|
@@ -38,8 +38,27 @@ public <T> Object execute(IRequest request, T para) throws Exception {
|
|
|
String wherepart = scheme.getWhereSQLOnly();
|
|
|
wherepart = wherepart == null ? "1=1" : wherepart;
|
|
|
|
|
|
- //add by longht 增加查询过滤,按权限项目 20211220 start
|
|
|
- String powersql = "select wa_classitem.pk_wa_classitem "
|
|
|
+ // add by longht 增加查询过滤,按权限项目 20211220 start
|
|
|
+ String powersqlorg = " SELECT pk_org FROM sm_subject_org where 1=1 "
|
|
|
+ + " and ( subjectid = '"
|
|
|
+ + AppContext.getInstance().getPkUser() + "'"
|
|
|
+ + " or subjectid in ( SELECT sur.pk_role FROM sm_user_role sur where sur.cuserid = '"
|
|
|
+ + AppContext.getInstance().getPkUser() + "'))\n";
|
|
|
+ wherepart = wherepart + " and pk_org in (" + powersqlorg + ")";
|
|
|
+
|
|
|
+ // add by longht 增加查询过滤,按权限项目 20211220 start
|
|
|
+ String powersqlclass = "SELECT classid" +
|
|
|
+ " FROM wa_clspower where 1=1"
|
|
|
+ + " and ( pk_subject = '"
|
|
|
+ + AppContext.getInstance().getPkUser() + "'"
|
|
|
+ + " or pk_subject in ( SELECT sur.pk_role FROM sm_user_role sur where sur.cuserid = '"
|
|
|
+ + AppContext.getInstance().getPkUser() + "')) "
|
|
|
+ + " and subject_type = '1' \n";
|
|
|
+
|
|
|
+ wherepart = wherepart + " and pk_wa_class in (" + powersqlclass + ")";
|
|
|
+
|
|
|
+ // add by longht 增加查询过滤,按权限项目 20211220 start
|
|
|
+ String powersqlpro = "select wa_classitem.pk_wa_classitem "
|
|
|
// "select wa_itempower.pk_itempower,\n"
|
|
|
// + " wa_classitem.pk_wa_class,\n"
|
|
|
// + " wa_classitem.pk_wa_item,\n"
|
|
@@ -53,28 +72,26 @@ public <T> Object execute(IRequest request, T para) throws Exception {
|
|
|
// + " wa_classitem.ifromflag,\n"
|
|
|
// + " wa_itempower.subject_type,\n"
|
|
|
// + " wa_itempower.pk_subject\n"
|
|
|
- + " from wa_classitem\n"
|
|
|
- + " inner join wa_waclass\n"
|
|
|
+ + " from wa_classitem\n" + " inner join wa_waclass\n"
|
|
|
+ " on wa_waclass.pk_org = wa_classitem.pk_org\n"
|
|
|
+ " and wa_waclass.pk_wa_class = wa_classitem.pk_wa_class\n"
|
|
|
- + " and wa_waclass.cyear = wa_classitem.cyear\n"
|
|
|
- + " and wa_waclass.cperiod = wa_classitem.cperiod\n"
|
|
|
- + " inner join wa_item\n"
|
|
|
- + " on wa_classitem.pk_wa_item = wa_item.pk_wa_item\n"
|
|
|
- + " left outer join wa_itempower\n"
|
|
|
- + " on wa_itempower.pk_wa_item = wa_classitem.pk_wa_item\n"
|
|
|
+ + " and wa_waclass.cyear = wa_classitem.cyear\n" + " and wa_waclass.cperiod = wa_classitem.cperiod\n"
|
|
|
+ + " inner join wa_item\n" + " on wa_classitem.pk_wa_item = wa_item.pk_wa_item\n"
|
|
|
+ + " left outer join wa_itempower\n" + " on wa_itempower.pk_wa_item = wa_classitem.pk_wa_item\n"
|
|
|
+ " and wa_itempower.pk_wa_class = wa_classitem.pk_wa_class\n"
|
|
|
- + " and wa_itempower.pk_org = wa_classitem.pk_org\n"
|
|
|
- + " and ( wa_itempower.pk_subject = '"+ AppContext.getInstance().getPkUser() + "'"
|
|
|
- +" or pk_subject in ( SELECT sur.pk_role FROM sm_user_role sur where sur.cuserid = '"
|
|
|
- + AppContext.getInstance().getPkUser() +"'))\n"
|
|
|
- //+ " where wa_waclass.pk_org = '"+pk_org+"' \n"
|
|
|
+ + " and wa_itempower.pk_org = wa_classitem.pk_org\n" + " and ( wa_itempower.pk_subject = '"
|
|
|
+ + AppContext.getInstance().getPkUser() + "'"
|
|
|
+ + " or pk_subject in ( SELECT sur.pk_role FROM sm_user_role sur where sur.cuserid = '"
|
|
|
+ + AppContext.getInstance().getPkUser() + "'))\n"
|
|
|
+//+ " where wa_waclass.pk_org = '"+pk_org+"' \n"
|
|
|
+ " where 1=1 \n"
|
|
|
- //+ " wa_waclass.pk_wa_class = '"+pk_wa_class+"'\n"
|
|
|
- + " and wa_item.mid = 'N'\n"
|
|
|
- + " and wa_itempower.editflag ='Y'";
|
|
|
+//+ " wa_waclass.pk_wa_class = '"+pk_wa_class+"'\n"
|
|
|
+ + " and wa_item.mid = 'N'\n" + " and wa_itempower.editflag ='Y'";
|
|
|
+
|
|
|
+ wherepart = wherepart +" and pk_wa_classitem in ("+powersqlpro+")";
|
|
|
+
|
|
|
+
|
|
|
|
|
|
- wherepart = wherepart +" and pk_wa_classitem in ("+powersql+")";
|
|
|
//add by longht 增加查询过滤,按权限项目 20211220 end
|
|
|
String[] ids = service.queryPKs(wherepart);
|
|
|
if(ids == null || ids.length <= 0) {
|