fs-danaus
2024-08-09 7204e3dff0490732e861ccd1338e3e3c31d768c6
src/com/yc/action/grid/Export496.java
@@ -91,7 +91,7 @@
                        });
                        alone.subFkKey = MainfkKey.toString();
                        //  }
                        Exprot496Entiry entiry = loadData(request, list9802, alone, page, mainPk, exprot496list);
                        Exprot496Entiry entiry = loadData(request, list9802, alone, page, mainPk, exprot496list,null);
                        //判断是否有关联的子功能,有则全都加载过来
                        if (!alone.formid.equals(alone.mainformid)) {
                            //不是第一个主功能号,取所有关联子功能数据
@@ -138,7 +138,7 @@
                                       finalWhere=subPkKey+" in("+ valuekeys.toString()+")";
                                    }
                                  page.setWhere(finalWhere);
                                    Exprot496Entiry subList = loadData(request, list9802, z, page, mainPk, exprot496list);
                                    Exprot496Entiry subList = loadData(request, list9802, z, page, mainPk, exprot496list,entiry);
                                  entiry.subList.add(subList);
                              }
                            });
@@ -180,7 +180,7 @@
     * @param exprot496list
     * @return
     */
    private Exprot496Entiry loadData(HttpServletRequest request, List<T9802Entity> list9802, T9771Entity alone, Page page, StringBuilder mainPk, List<Exprot496Entiry> exprot496list) {
    private Exprot496Entiry loadData(HttpServletRequest request, List<T9802Entity> list9802, T9771Entity alone, Page page, StringBuilder mainPk, List<Exprot496Entiry> exprot496list,Exprot496Entiry currentExprot496Entiry) {
        //取9676字段列表数据
        final StringJoiner fieldsJoiner = new StringJoiner(",");//字段列表
        final StringJoiner expressionJoiner = new StringJoiner(";");//权限表达式
@@ -255,7 +255,7 @@
            fieldsJoiner.add(alone.seekGroupID.replaceAll(";", ","));
        }
        if (StringUtils.isNotBlank(alone.subFkKey)) {
            String[] subFkKeys = alone.subFkKey.split(",");
            String[] subFkKeys = alone.subFkKey.replaceAll(";", ",").split(",");
            for (String subFkKey : subFkKeys) {
                tempFields = "," + fieldsJoiner.toString().toLowerCase() + ",";
                if (!tempFields.contains("," + subFkKey.toLowerCase() + ",")) {
@@ -268,7 +268,16 @@
            if (!alone.seekGroupID.equalsIgnoreCase(mainPk.toString())) {
                //不相同,需要从主功能号里取数拼接where, 第一个是主功能号数据
                if (exprot496list.size() > 0) {
                    page.setWhere(alone.seekGroupID + "=" + GridUtils.prossSqlParm(exprot496list.get(0).data.get(0).get(alone.seekGroupID.toLowerCase()) + ""));
                    String[] seekGroup= alone.seekGroupID.toLowerCase().replaceAll("rowid","").replaceAll("detailrowid","").split(";");//去掉rowid,detailrowid,因为这些只是限制条件,实际导出所有,所以取数可以过滤这些特定字段(rowid,detailrowid)
                    StringJoiner where=new StringJoiner(" and ");
                    Exprot496Entiry entiry496=exprot496list.get(0);
                    if(currentExprot496Entiry!=null){
                        entiry496=currentExprot496Entiry;
                    }
                    for(String str:seekGroup) {
                      where.add(str+ "=" + GridUtils.prossSqlParm(entiry496.data.get(0).get(str) + ""));
                    }
                    page.setWhere(where.toString());
                }
            }
        }
@@ -294,7 +303,7 @@
            newpage.setAutopaging(2);//不分页
            newpage.setId(fristField.toString());
            newpage.setPageNum(1);
            newpage.setOrderBy(orderByJoiner.length() > 0 ? orderByJoiner.toString().replaceAll(";", ",") : alone.seekGroupID);
            newpage.setOrderBy(orderByJoiner.length() > 0 ? orderByJoiner.toString().replaceAll(";", ",") : alone.seekGroupID.replaceAll(";",","));
            gridService.loadAll(newpage);// 第二步,调用相对应业务类取得数据,分页功能
        }catch (Exception ex) {
            throw ex;
@@ -314,7 +323,7 @@
        entiry.titleToFileName = titleToFile.toString();
        entiry.fk = alone.fK;
        entiry.seekGroupID = alone.seekGroupID;
        entiry.sheetName = alone.labelName == null ? alone.formname : alone.labelName;
        entiry.sheetName = StringUtils.isBlank(alone.labelName) ? alone.formname : alone.labelName;
        if (entiry.sheetName.contains("/")) {
            entiry.sheetName = entiry.sheetName.replaceAll("/", "-");
        }