| | |
| | | List<String> fileNameList = ListUtils.newArrayList(); |
| | | for (int i = 0, length = attachments.getRows(); i < length; i++) { |
| | | FieldSetEntity fieldSet = new FieldSetEntity(); |
| | | fieldSet.setTableName(CmnConst.product_oa_DOCUMENT); |
| | | fieldSet.setTableName(CmnConst.PRODUCT_OA_DOCUMENT); |
| | | FieldSetEntity fse = attachments.getFieldSetEntity(i); |
| | | //文件目录uuid |
| | | fieldSet.setValue(CmnConst.DIRECTORY_UUID, directory_uuid); |
| | |
| | | String file_name = fieldSetEntity.getString(CmnConst.FILE_NAME); |
| | | fieldSetEntity.setValue(CmnConst.UPDATED_BY, SpringMVCContextHolder.getCurrentUser().getUser_id());// 修改人 |
| | | fieldSetEntity.setValue(CmnConst.UPDATED_UTC_DATETIME, DateUtils.getDateTime());// 修改时间 |
| | | FieldSetEntity fie = baseDao.getFieldSetEntity(CmnConst.product_oa_DOCUMENT, uuid, false); |
| | | FieldSetEntity fie = baseDao.getFieldSetEntity(CmnConst.PRODUCT_OA_DOCUMENT, uuid, false); |
| | | String name = fie.getString(CmnConst.FILE_NAME); |
| | | //每次修改都亲空已读人员 |
| | | fieldSetEntity.setValue(CmnConst.READ_NUM, ""); |
| | |
| | | String file_names = fieldSetEntity.getString(CmnConst.FILE_NAME); |
| | | String[] file_name = file_names.split(","); |
| | | String[] uuid = uuids.split(","); |
| | | boolean flag = baseDao.delete(CmnConst.product_oa_DOCUMENT, uuid); |
| | | boolean flag = baseDao.delete(CmnConst.PRODUCT_OA_DOCUMENT, uuid); |
| | | this.documentation(uuid, "删除", file_name, null); |
| | | return flag; |
| | | } |
| | |
| | | .append(" a.*,CONCAT(CONVERT(a.file_size / 1024, decimal(10,2)), 'KB') file_size_kb,b.show_name name") |
| | | // .append(" concat(c.attachment_domain,'/',c.attachment_container,'/',c.module_uuid,'/',c.attachment_title,?) path ") |
| | | .append(" FROM ") |
| | | .append(" (SELECT * FROM product_oa_document WHERE directory_uuid = ? ") |
| | | .append(" (SELECT * FROM PRODUCT_OA_document WHERE directory_uuid = ? ") |
| | | .append(queryFilter) |
| | | .append(" ) a LEFT JOIN product_sys_staffs b ON a.created_by = b.user_id ") |
| | | .append(" LEFT JOIN product_sys_attachments c ON b.staff_avatar=c.uuid "); |
| | |
| | | @Override |
| | | public FieldSetEntity documentInfo(FieldSetEntity fieldSetEntity) throws BaseException { |
| | | String uuid = fieldSetEntity.getString(CmnConst.UUID); |
| | | FieldSetEntity fieldSet = baseDao.getFieldSetEntity(CmnConst.product_oa_DOCUMENT, uuid, true); |
| | | FieldSetEntity fieldSet = baseDao.getFieldSetEntity(CmnConst.PRODUCT_OA_DOCUMENT, uuid, true); |
| | | String file_name = fieldSet.getString(CmnConst.FILE_NAME); |
| | | String user_ids = fieldSetEntity.getString(CmnConst.USER_IDS); |
| | | String read = fieldSetEntity.getString(CmnConst.READ_NUM); |
| | |
| | | SystemUser user = SpringMVCContextHolder.getCurrentUser(); |
| | | DataTableEntity dataTableEntity = new DataTableEntity(); |
| | | FieldMetaEntity fieldMeta = new FieldMetaEntity(); |
| | | fieldMeta.setTableName(new String[]{CmnConst.product_oa_DOCUMENT_LOG}); |
| | | fieldMeta.setTableName(new String[]{CmnConst.PRODUCT_OA_DOCUMENT_LOG}); |
| | | dataTableEntity.setMeta(fieldMeta); |
| | | for (int i = 0; i < uuid.length; i++) { |
| | | FieldSetEntity fieldSetEntity = new FieldSetEntity(); |
| | | fieldSetEntity.setTableName(CmnConst.product_oa_DOCUMENT_LOG); |
| | | fieldSetEntity.setTableName(CmnConst.PRODUCT_OA_DOCUMENT_LOG); |
| | | fieldSetEntity.setMeta(fieldMeta); |
| | | fieldSetEntity.setValue(CmnConst.DOCUMENT_UUID, uuid[i]); |
| | | //fieldSetEntity.setValue(CmnConst.RECORD,record); |
| | |
| | | SystemUser user = SpringMVCContextHolder.getCurrentUser(); |
| | | DataTableEntity dataTableEntity = new DataTableEntity(); |
| | | FieldMetaEntity fieldMeta = new FieldMetaEntity(); |
| | | fieldMeta.setTableName(new String[]{CmnConst.product_oa_DOCUMENT_LOG}); |
| | | fieldMeta.setTableName(new String[]{CmnConst.PRODUCT_OA_DOCUMENT_LOG}); |
| | | dataTableEntity.setMeta(fieldMeta); |
| | | for (int i = 0; i < uuid.length; i++) { |
| | | FieldSetEntity fieldSetEntity = new FieldSetEntity(); |
| | | fieldSetEntity.setTableName(CmnConst.product_oa_DOCUMENT_LOG); |
| | | fieldSetEntity.setTableName(CmnConst.PRODUCT_OA_DOCUMENT_LOG); |
| | | fieldSetEntity.setMeta(fieldMeta); |
| | | fieldSetEntity.setValue(CmnConst.DOCUMENT_UUID, uuid[i]); |
| | | //fieldSetEntity.setValue(CmnConst.RECORD,record); |
| | |
| | | String butt = ""; |
| | | DataTableEntity dataTable = null; |
| | | FieldSetEntity fse = new FieldSetEntity(); |
| | | fse.setTableName(CmnConst.product_oa_DOCUMENT); |
| | | fse.setTableName(CmnConst.PRODUCT_OA_DOCUMENT); |
| | | if ("1".equals(fieldSetEntity.getString(CmnConst.DIRECTORY_TYPE))) { |
| | | //获取的user_id |
| | | Integer user_id = SpringMVCContextHolder.getCurrentUser().getUser_id(); |
| | |
| | | String directory_uuid = fieldSetEntity.getString(CmnConst.DIRECTORY_UUID); |
| | | //String key = "%,140,%"; |
| | | DataTableEntity dataTableEntity = new DataTableEntity(); |
| | | FieldSetEntity org = baseDao.getFieldSetByFilter(CmnConst.product_oa_DIRECTORY_RIGHTS, "directory_uuid=?", new String[]{directory_uuid}, false); |
| | | FieldSetEntity org = baseDao.getFieldSetByFilter(CmnConst.PRODUCT_OA_DIRECTORY_RIGHTS, "directory_uuid=?", new String[]{directory_uuid}, false); |
| | | if (verifyOrgExist(org.getString("storage_uuid"))) { |
| | | StringBuffer sql = new StringBuffer(); |
| | | sql.append(" SELECT substring_index(substring_index(a.rigths,',',b.help_topic_id+1),',',-1) fun FROM product_oa_directory_rights a ") |
| | | sql.append(" SELECT substring_index(substring_index(a.rigths,',',b.help_topic_id+1),',',-1) fun FROM PRODUCT_OA_directory_rights a ") |
| | | .append(" INNER join mysql.help_topic b on b.help_topic_id < (length(a.rigths) - length(replace(a.rigths,',',''))+1) ") |
| | | .append(" WHERE a.directory_uuid = ? "); |
| | | dataTableEntity = baseDao.listTable(sql.toString(), new String[]{directory_uuid}); |
| | |
| | | //1为公司文件目录 |
| | | if ("1".equals(type)) { |
| | | //String staffId = user.getCurrentStaff().getString("staff_id"); |
| | | sql.append(" select a.* from product_oa_directory a ") |
| | | .append(" LEFT JOIN ( SELECT a.directory_uuid FROM product_oa_directory_rights a LEFT JOIN product_sys_organizational_structure_storage b ") |
| | | sql.append(" select a.* from PRODUCT_OA_directory a ") |
| | | .append(" LEFT JOIN ( SELECT a.directory_uuid FROM PRODUCT_OA_directory_rights a LEFT JOIN product_sys_organizational_structure_storage b ") |
| | | .append(" on a.storage_uuid = b.uuid WHERE a.rigths like '%3%' AND CONCAT(',',b.staff_ids,',') like ? GROUP BY ") |
| | | .append(" a.directory_uuid) b ON a.uuid = b.directory_uuid where a.directory_type = 1 and a.org_level_uuid = ? "); |
| | | String staffId = "%" + user.getCurrentStaff().getString("staff_id") + "%"; |
| | |
| | | param.add(user.getOrg_level_uuid()); |
| | | //param.add("%,140,%"); |
| | | } else { |
| | | sql.append(" select * from product_oa_directory where directory_type = 2 AND created_by = ? "); |
| | | sql.append(" select * from PRODUCT_OA_directory where directory_type = 2 AND created_by = ? "); |
| | | param.add(user.getUser_id()); |
| | | } |
| | | JSONObject object = new JSONObject(); |
| | |
| | | sql.append(" and tricode_parent = ? "); |
| | | //加载文件路径 |
| | | DataTableEntity dataTableEntity = documentDirectoryService.getDirectoryStructure(fse); |
| | | object.put("product_oa_directory_path", BaseUtil.dataTableEntityToJson(dataTableEntity)); |
| | | object.put("PRODUCT_OA_directory_path", BaseUtil.dataTableEntityToJson(dataTableEntity)); |
| | | } |
| | | //sql.append(" GROUP BY tricode,tricode_parent,directory_name"); |
| | | DataTableEntity data = baseDao.listTable(sql.toString(), param.toArray()); |
| | | |
| | | object.put("product_oa_directory_sub", BaseUtil.dataTableEntityToJson(data)); |
| | | object.put("PRODUCT_OA_directory_sub", BaseUtil.dataTableEntityToJson(data)); |
| | | baseDao.listInternationDataTable(data, null); |
| | | |
| | | return object; |
| | |
| | | @Transactional |
| | | public void downloadFile(FieldSetEntity fieldSetEntity) throws BaseException { |
| | | String uuid = fieldSetEntity.getString(CmnConst.UUID); |
| | | FieldSetEntity fieldSet = baseDao.getFieldSetEntity(CmnConst.product_oa_DOCUMENT, uuid, false); |
| | | FieldSetEntity fieldSet = baseDao.getFieldSetEntity(CmnConst.PRODUCT_OA_DOCUMENT, uuid, false); |
| | | String file_name = fieldSet.getString(CmnConst.FILE_NAME); |
| | | this.documentation(new String[]{uuid}, "下载", new String[]{file_name}, null); |
| | | this.markRead(fieldSet); |
| | |
| | | //1为公司文件夹 |
| | | if (directory_type == 1) { |
| | | StringBuffer sql = new StringBuffer(); |
| | | sql.append(" SELECT * FROM product_oa_directory_rights ") |
| | | sql.append(" SELECT * FROM PRODUCT_OA_directory_rights ") |
| | | .append(" WHERE directory_uuid = ? ") |
| | | .append(" AND rigths like '%3%' AND concat(',',storage_uuid,',') like ? ");//3为新增 |
| | | String user_id = String.valueOf(SpringMVCContextHolder.getCurrentUser().getUser_id()); |
| | |
| | | } |
| | | //1为个人文件夹 |
| | | if (directory_type == 2 || row > 0) { |
| | | FieldSetEntity fieldSetEntity = baseDao.getFieldSetEntity(CmnConst.product_oa_DIRECTORY, directory_uuid, false); |
| | | FieldSetEntity fieldSetEntity = baseDao.getFieldSetEntity(CmnConst.PRODUCT_OA_DIRECTORY, directory_uuid, false); |
| | | //获取移动到的目录名 |
| | | String directory_name = fieldSetEntity.getString(CmnConst.DIRECTORY_NAME); |
| | | String uuids = fse.getString(CmnConst.UUID); |
| | | String[] uuid = uuids.split(","); |
| | | DataTableEntity dataTable = baseDao.listTable(CmnConst.product_oa_DOCUMENT, BaseUtil.buildQuestionMarkFilter(CmnConst.UUID, uuid.length, true), uuid); |
| | | DataTableEntity dataTable = baseDao.listTable(CmnConst.PRODUCT_OA_DOCUMENT, BaseUtil.buildQuestionMarkFilter(CmnConst.UUID, uuid.length, true), uuid); |
| | | List<String> uuidList = ListUtils.newArrayList(); |
| | | List<String> fileNameList = ListUtils.newArrayList(); |
| | | for (int i = 0, length = dataTable.getRows(); i < length; i++) { |
| | |
| | | |
| | | String params = directory_uuid + "," + uuids; |
| | | String[] param = params.split(","); |
| | | boolean flag = baseDao.executeUpdate("UPDATE product_oa_document SET directory_uuid = ? WHERE " + BaseUtil.buildQuestionMarkFilter(CmnConst.UUID, uuid.length, true), param); |
| | | boolean flag = baseDao.executeUpdate("UPDATE PRODUCT_OA_document SET directory_uuid = ? WHERE " + BaseUtil.buildQuestionMarkFilter(CmnConst.UUID, uuid.length, true), param); |
| | | this.documentation(uuidList.toArray(), "移动", fileNameList.toArray(), directory_name); |
| | | return flag; |
| | | } else { |
| | |
| | | |
| | | @Override |
| | | public DataTableEntity getDocumentLog(FieldSetEntity fieldSetEntity) throws BaseException { |
| | | return baseDao.listTable("SELECT CONCAT(b.show_name, a.state) log,a.created_utc_datetime FROM product_oa_document_log a LEFT JOIN product_sys_staffs b on a.created_by = b.user_id WHERE document_uuid = ? ORDER BY a.created_utc_datetime DESC", |
| | | return baseDao.listTable("SELECT CONCAT(b.show_name, a.state) log,a.created_utc_datetime FROM PRODUCT_OA_document_log a LEFT JOIN product_sys_staffs b on a.created_by = b.user_id WHERE document_uuid = ? ORDER BY a.created_utc_datetime DESC", |
| | | new String[]{fieldSetEntity.getString(CmnConst.DOCUMENT_UUID)}, fieldSetEntity.getInteger(CmnConst.PAGESIZE), fieldSetEntity.getInteger(CmnConst.CPAGE)); |
| | | } |
| | | } |