| | |
| | | |
| | | /** |
| | | * 单位文件夹树 |
| | | * |
| | | * @return |
| | | */ |
| | | public DataTableEntity allDirectoryTree() { |
| | |
| | | |
| | | /** |
| | | * 文档目录保存 |
| | | * |
| | | * @param fse |
| | | * @return |
| | | */ |
| | |
| | | orgLevelInfo.put("org_level_uuid", user.getOrg_level_uuid()); |
| | | orgLevelInfo.put("children", menus); |
| | | JSONArray array = new JSONArray(); |
| | | if (!"1".equals(directory_type)) { |
| | | // 查询数量 |
| | | sql.setLength(0); |
| | | sql.append(" SELECT\n"); |
| | | sql.append(" ( SELECT count(*) FROM product_oa_document_collection WHERE document_collector = ? ) collection_count,\n"); |
| | | sql.append(" ( SELECT count( sub_uuid ) FROM product_oa_document_borrow_sub WHERE borrow_uuid IN ( SELECT uuid FROM product_oa_document_borrow WHERE borrower = ? ) GROUP BY sub_uuid ) borrow_count\n"); |
| | | sql.append(" FROM\n"); |
| | | sql.append("DUAL\n"); |
| | | FieldSetEntity fieldSetBySQL = baseDao.getFieldSetBySQL(sql.toString(), new Object[]{user.getUser_id(), user.getUser_id()}, false); |
| | | int collectionCount = 0; |
| | | int borrowCount = 0; |
| | | if (fieldSetBySQL != null) { |
| | | collectionCount = BaseUtil.ifNull(fieldSetBySQL.getInteger("collection_count"), 0); |
| | | borrowCount = BaseUtil.ifNull(fieldSetBySQL.getInteger("borrow_count"), 0); |
| | | } |
| | | //添加收藏夹和借阅文件夹 |
| | | JSONObject favorite = new JSONObject(); |
| | | favorite.put("directory_name", "收藏夹"); |
| | | favorite.put("uuid", "!favorite"); |
| | | favorite.put("number", collectionCount); |
| | | menus.add(0, favorite); |
| | | JSONObject borrow = new JSONObject(); |
| | | borrow.put("directory_name", "借阅文件"); |
| | | borrow.put("uuid", "!borrow"); |
| | | borrow.put("number", borrowCount); |
| | | menus.add(1, borrow); |
| | | } |
| | | array.add(orgLevelInfo); |
| | | return array; |
| | | } |