| | |
| | | public static final String PRODUCT_SYS_CLIENTS = "product_sys_clients"; // 客户表 |
| | | public static final String PRODUCT_SYS_ATTACHMENTS = "product_sys_attachments"; // 附件表 |
| | | public static final String PRODUCT_SYS_DICT = "product_sys_dict"; |
| | | public static final String product_oa_DIRECTORY = "product_oa_directory"; //文档目录表 |
| | | public static final String product_oa_DIRECTORY_RIGHTS = "product_oa_directory_rights"; //文档目录权限表 |
| | | public static final String product_oa_DOCUMENT = "product_oa_document"; //文档表 |
| | | public static final String product_oa_DOCUMENT_LOG = "product_oa_document_log"; // 文档操作日志表 |
| | | public static final String PRODUCT_OA_DIRECTORY = "product_oa_directory"; //文档目录表 |
| | | public static final String PRODUCT_OA_DIRECTORY_RIGHTS = "product_oa_directory_rights"; //文档目录权限表 |
| | | public static final String PRODUCT_OA_DOCUMENT = "product_oa_document"; //文档表 |
| | | public static final String PRODUCT_OA_DOCUMENT_LOG = "product_oa_document_log"; // 文档操作日志表 |
| | | public static final String PRODUCT_SYS_PRINT_TEMPLATE_RECORD = "product_sys_print_template_reocrd";// 打印模板记录表 |
| | | public static final String PRODUCT_SYS_STAFFS = "product_sys_staffs"; |
| | | public static final String TABLE_PRODUCT_SYS_ORG_LEVELS = "product_sys_org_levels";// 组织机构表 |
| | |
| | | import com.product.module.sys.config.SystemErrorCode; |
| | | import com.product.module.sys.entity.SystemUser; |
| | | import com.product.module.sys.version.ApiVersion; |
| | | import com.product.util.BaseUtil; |
| | | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestMethod; |
| | |
| | | @RequestMapping("/api/directory") |
| | | @RestController |
| | | public class DocumentDirectoryConstoller extends AbstractBaseController { |
| | | |
| | | @Autowired |
| | | public DocumentDirectoryService documentDirectoryService; |
| | | DocumentDirectoryService documentDirectoryService; |
| | | |
| | | /** |
| | | * 数据权限验证 |
| | | */ |
| | | @Autowired |
| | | PermissionService permissionService; |
| | | |
| | | /** |
| | | * 新增文件夹数据 |
| | | * |
| | | * @param request |
| | | * @return |
| | | */ |
| | | @RequestMapping(value = "/all-directory-tree/{version}", method = RequestMethod.POST) |
| | | @ApiVersion(1) |
| | | public String allDirectoryTree(HttpServletRequest request) { |
| | | try { |
| | | // 获取参数 |
| | | FieldSetEntity fse = BaseUtil.getFieldSetEntity(request, CmnConst.PRODUCT_OA_DIRECTORY); |
| | | return com.product.util.ResultInfo.success(BaseUtil.dataTableEntityToJson(documentDirectoryService.allDirectoryTree())); |
| | | } catch (BaseException e) { |
| | | SpringMVCContextHolder.getSystemLogger().error(e); |
| | | return this.error(e); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | SpringMVCContextHolder.getSystemLogger().error(e); |
| | | return this.error(DocumentCode.DOCUMENT_CATALOG_SAVE_FAIL.getValue(), |
| | | DocumentCode.DOCUMENT_CATALOG_SAVE_FAIL.getText()); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 新增文件夹数据 |
| | | * |
| | | * @param request |
| | | * @return |
| | | */ |
| | |
| | | } |
| | | //判断参数是否为空 |
| | | if (fse == null) { |
| | | SpringMVCContextHolder.getSystemLogger().error(DocumentCode.DOCUMENT_FORM_NODATA.getValue(), DocumentCode.DOCUMENT_FORM_NODATA.getText()); |
| | | return this.error(DocumentCode.DOCUMENT_FORM_NODATA.getValue(), DocumentCode.DOCUMENT_FORM_NODATA.getText()); |
| | | SpringMVCContextHolder.getSystemLogger().error(DocumentCode.DOCUMENT_FORM_NODATA.getValue(), |
| | | DocumentCode.DOCUMENT_FORM_NODATA.getText()); |
| | | return this.error(DocumentCode.DOCUMENT_FORM_NODATA.getValue(), |
| | | DocumentCode.DOCUMENT_FORM_NODATA.getText()); |
| | | } |
| | | IDocumentDirectoryService service = (IDocumentDirectoryService)getProxyInstance(documentDirectoryService); |
| | | return OK_Add(service.addDocumentDirectory(fse)); |
| | |
| | | }catch (Exception e) { |
| | | e.printStackTrace(); |
| | | SpringMVCContextHolder.getSystemLogger().error(e); |
| | | return this.error(DocumentCode.DOCUMENT_CATALOG_SAVE_FAIL.getValue(), DocumentCode.DOCUMENT_CATALOG_SAVE_FAIL.getText()); |
| | | return this.error(DocumentCode.DOCUMENT_CATALOG_SAVE_FAIL.getValue(), |
| | | DocumentCode.DOCUMENT_CATALOG_SAVE_FAIL.getText()); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 修改文件夹 |
| | | * |
| | | * @param request |
| | | * @return |
| | | */ |
| | |
| | | } |
| | | //判断参数是否为空 |
| | | if (fse == null) { |
| | | SpringMVCContextHolder |
| | | .getSystemLogger().error(DocumentCode.DOCUMENT_FORM_NODATA.getValue(), DocumentCode.DOCUMENT_FORM_NODATA.getText()); |
| | | return this.error(DocumentCode.DOCUMENT_FORM_NODATA.getValue(), DocumentCode.DOCUMENT_FORM_NODATA.getText()); |
| | | SpringMVCContextHolder.getSystemLogger().error(DocumentCode.DOCUMENT_FORM_NODATA.getValue(), |
| | | DocumentCode.DOCUMENT_FORM_NODATA.getText()); |
| | | return this.error(DocumentCode.DOCUMENT_FORM_NODATA.getValue(), |
| | | DocumentCode.DOCUMENT_FORM_NODATA.getText()); |
| | | } |
| | | String uuid = fse.getString(CmnConst.UUID);//表uuid |
| | | //超级管理员为1 普通单位管理员2 |
| | |
| | | type = CoreConst.DATA_PERMISSION_VALID_TYPE_USER; |
| | | } |
| | | //数据操作的权限验证 |
| | | if(!permissionService.validDataPermission(CmnConst.product_oa_DIRECTORY,uuid,type)) { |
| | | SpringMVCContextHolder.getSystemLogger().error(SystemErrorCode.SYSTEM_NOT_OPER_PERMISSION.getValue(), SystemErrorCode.SYSTEM_NOT_OPER_PERMISSION.getText()); |
| | | return this.error(SystemErrorCode.SYSTEM_NOT_OPER_PERMISSION.getValue(), SystemErrorCode.SYSTEM_NOT_OPER_PERMISSION.getText()); |
| | | if (!permissionService.validDataPermission(CmnConst.PRODUCT_OA_DIRECTORY, uuid, type)) { |
| | | SpringMVCContextHolder.getSystemLogger().error(SystemErrorCode.SYSTEM_NOT_OPER_PERMISSION.getValue(), |
| | | SystemErrorCode.SYSTEM_NOT_OPER_PERMISSION.getText()); |
| | | return this.error(SystemErrorCode.SYSTEM_NOT_OPER_PERMISSION.getValue(), |
| | | SystemErrorCode.SYSTEM_NOT_OPER_PERMISSION.getText()); |
| | | } |
| | | IDocumentDirectoryService service = (IDocumentDirectoryService)getProxyInstance(documentDirectoryService); |
| | | if(service.upDocumentDirectory(fse)) { |
| | | return OK(); |
| | | } |
| | | return this.error(DocumentCode.DOCUMENT_CATALOG_SAVE_FAIL.getValue(), DocumentCode.DOCUMENT_CATALOG_SAVE_FAIL.getText()); |
| | | return this.error(DocumentCode.DOCUMENT_CATALOG_SAVE_FAIL.getValue(), |
| | | DocumentCode.DOCUMENT_CATALOG_SAVE_FAIL.getText()); |
| | | } catch (BaseException e) { |
| | | SpringMVCContextHolder.getSystemLogger().error(e); |
| | | return this.error(e); |
| | | }catch (Exception e) { |
| | | e.printStackTrace(); |
| | | SpringMVCContextHolder.getSystemLogger().error(e); |
| | | return this.error(DocumentCode.DOCUMENT_CATALOG_SAVE_FAIL.getValue(), DocumentCode.DOCUMENT_CATALOG_SAVE_FAIL.getText()); |
| | | return this.error(DocumentCode.DOCUMENT_CATALOG_SAVE_FAIL.getValue(), |
| | | DocumentCode.DOCUMENT_CATALOG_SAVE_FAIL.getText()); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 个人文件夹重命名 |
| | | * |
| | | * @param request |
| | | * @return |
| | | */ |
| | |
| | | } |
| | | //判断参数是否为空 |
| | | if (fse == null) { |
| | | SpringMVCContextHolder |
| | | .getSystemLogger().error(DocumentCode.DOCUMENT_FORM_NODATA.getValue(), DocumentCode.DOCUMENT_FORM_NODATA.getText()); |
| | | return this.error(DocumentCode.DOCUMENT_FORM_NODATA.getValue(), DocumentCode.DOCUMENT_FORM_NODATA.getText()); |
| | | SpringMVCContextHolder.getSystemLogger().error(DocumentCode.DOCUMENT_FORM_NODATA.getValue(), |
| | | DocumentCode.DOCUMENT_FORM_NODATA.getText()); |
| | | return this.error(DocumentCode.DOCUMENT_FORM_NODATA.getValue(), |
| | | DocumentCode.DOCUMENT_FORM_NODATA.getText()); |
| | | } |
| | | String uuid = fse.getString(CmnConst.UUID);//表uuid |
| | | //超级管理员为1 普通单位管理员2 |
| | |
| | | type = CoreConst.DATA_PERMISSION_VALID_TYPE_USER; |
| | | } |
| | | //数据操作的权限验证 |
| | | if(!permissionService.validDataPermission(CmnConst.product_oa_DIRECTORY,uuid,type)) { |
| | | SpringMVCContextHolder.getSystemLogger().error(SystemErrorCode.SYSTEM_NOT_OPER_PERMISSION.getValue(), SystemErrorCode.SYSTEM_NOT_OPER_PERMISSION.getText()); |
| | | return this.error(SystemErrorCode.SYSTEM_NOT_OPER_PERMISSION.getValue(), SystemErrorCode.SYSTEM_NOT_OPER_PERMISSION.getText()); |
| | | if (!permissionService.validDataPermission(CmnConst.PRODUCT_OA_DIRECTORY, uuid, type)) { |
| | | SpringMVCContextHolder.getSystemLogger().error(SystemErrorCode.SYSTEM_NOT_OPER_PERMISSION.getValue(), |
| | | SystemErrorCode.SYSTEM_NOT_OPER_PERMISSION.getText()); |
| | | return this.error(SystemErrorCode.SYSTEM_NOT_OPER_PERMISSION.getValue(), |
| | | SystemErrorCode.SYSTEM_NOT_OPER_PERMISSION.getText()); |
| | | } |
| | | IDocumentDirectoryService service = (IDocumentDirectoryService)getProxyInstance(documentDirectoryService); |
| | | if(service.upDocumentDirectoryName(fse)) { |
| | | return OK(); |
| | | } |
| | | return this.error(DocumentCode.DOCUMENT_DIRECTORY_NAME_FAIL.getValue(), DocumentCode.DOCUMENT_DIRECTORY_NAME_FAIL.getText()); |
| | | return this.error(DocumentCode.DOCUMENT_DIRECTORY_NAME_FAIL.getValue(), |
| | | DocumentCode.DOCUMENT_DIRECTORY_NAME_FAIL.getText()); |
| | | } catch (BaseException e) { |
| | | SpringMVCContextHolder.getSystemLogger().error(e); |
| | | return this.error(e); |
| | | }catch (Exception e) { |
| | | e.printStackTrace(); |
| | | SpringMVCContextHolder.getSystemLogger().error(e); |
| | | return this.error(DocumentCode.DOCUMENT_DIRECTORY_NAME_FAIL.getValue(), DocumentCode.DOCUMENT_DIRECTORY_NAME_FAIL.getText()); |
| | | return this.error(DocumentCode.DOCUMENT_DIRECTORY_NAME_FAIL.getValue(), |
| | | DocumentCode.DOCUMENT_DIRECTORY_NAME_FAIL.getText()); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 删除文件夹 |
| | | * |
| | | * @param request |
| | | * @return |
| | | */ |
| | |
| | | } |
| | | //判断参数是否为空 |
| | | if (fse == null) { |
| | | SpringMVCContextHolder |
| | | .getSystemLogger().error(DocumentCode.DOCUMENT_FORM_NODATA.getValue(), DocumentCode.DOCUMENT_FORM_NODATA.getText()); |
| | | return this.error(DocumentCode.DOCUMENT_FORM_NODATA.getValue(), DocumentCode.DOCUMENT_FORM_NODATA.getText()); |
| | | SpringMVCContextHolder.getSystemLogger().error(DocumentCode.DOCUMENT_FORM_NODATA.getValue(), |
| | | DocumentCode.DOCUMENT_FORM_NODATA.getText()); |
| | | return this.error(DocumentCode.DOCUMENT_FORM_NODATA.getValue(), |
| | | DocumentCode.DOCUMENT_FORM_NODATA.getText()); |
| | | } |
| | | String uuid = fse.getString(CmnConst.UUID);//表uuid |
| | | //超级管理员为1 普通单位管理员2 |
| | |
| | | type = CoreConst.DATA_PERMISSION_VALID_TYPE_USER; |
| | | } |
| | | //数据操作的权限验证 |
| | | if(!permissionService.validDataPermission(CmnConst.product_oa_DIRECTORY,uuid,type)) { |
| | | SpringMVCContextHolder.getSystemLogger().error(SystemErrorCode.SYSTEM_NOT_OPER_PERMISSION.getValue(), SystemErrorCode.SYSTEM_NOT_OPER_PERMISSION.getText()); |
| | | return this.error(SystemErrorCode.SYSTEM_NOT_OPER_PERMISSION.getValue(), SystemErrorCode.SYSTEM_NOT_OPER_PERMISSION.getText()); |
| | | if (!permissionService.validDataPermission(CmnConst.PRODUCT_OA_DIRECTORY, uuid, type)) { |
| | | SpringMVCContextHolder.getSystemLogger().error(SystemErrorCode.SYSTEM_NOT_OPER_PERMISSION.getValue(), |
| | | SystemErrorCode.SYSTEM_NOT_OPER_PERMISSION.getText()); |
| | | return this.error(SystemErrorCode.SYSTEM_NOT_OPER_PERMISSION.getValue(), |
| | | SystemErrorCode.SYSTEM_NOT_OPER_PERMISSION.getText()); |
| | | } |
| | | IDocumentDirectoryService service = (IDocumentDirectoryService)getProxyInstance(documentDirectoryService); |
| | | if(service.delDocumentDirectory(fse)){ |
| | | return OK(); |
| | | } |
| | | return this.error(DocumentCode.DOCUMENT_CATALOG_DELETE_FAIL.getValue(), DocumentCode.DOCUMENT_CATALOG_DELETE_FAIL.getText()); |
| | | return this.error(DocumentCode.DOCUMENT_CATALOG_DELETE_FAIL.getValue(), |
| | | DocumentCode.DOCUMENT_CATALOG_DELETE_FAIL.getText()); |
| | | } catch (BaseException e) { |
| | | SpringMVCContextHolder.getSystemLogger().error(e); |
| | | return this.error(e); |
| | | }catch (Exception e) { |
| | | e.printStackTrace(); |
| | | SpringMVCContextHolder.getSystemLogger().error(e); |
| | | return this.error(DocumentCode.DOCUMENT_CATALOG_DELETE_FAIL.getValue(), DocumentCode.DOCUMENT_CATALOG_DELETE_FAIL.getText()); |
| | | return this.error(DocumentCode.DOCUMENT_CATALOG_DELETE_FAIL.getValue(), |
| | | DocumentCode.DOCUMENT_CATALOG_DELETE_FAIL.getText()); |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 文件目录列表展示 |
| | | * |
| | | * @param request |
| | | * @return |
| | | */ |
| | |
| | | } |
| | | //判断参数是否为空 |
| | | if (fse == null) { |
| | | SpringMVCContextHolder |
| | | .getSystemLogger().error(DocumentCode.DOCUMENT_FORM_NODATA.getValue(), DocumentCode.DOCUMENT_FORM_NODATA.getText()); |
| | | return this.error(DocumentCode.DOCUMENT_FORM_NODATA.getValue(), DocumentCode.DOCUMENT_FORM_NODATA.getText()); |
| | | SpringMVCContextHolder.getSystemLogger().error(DocumentCode.DOCUMENT_FORM_NODATA.getValue(), |
| | | DocumentCode.DOCUMENT_FORM_NODATA.getText()); |
| | | return this.error(DocumentCode.DOCUMENT_FORM_NODATA.getValue(), |
| | | DocumentCode.DOCUMENT_FORM_NODATA.getText()); |
| | | } |
| | | return OK_List(documentDirectoryService.moveToList(fse)); |
| | | } catch (BaseException e) { |
| | |
| | | }catch (Exception e) { |
| | | e.printStackTrace(); |
| | | SpringMVCContextHolder.getSystemLogger().error(e); |
| | | return this.error(DocumentCode.DOCUMENT_CATALOG_GET_FAIL.getValue(), DocumentCode.DOCUMENT_CATALOG_GET_FAIL.getText()); |
| | | return this.error(DocumentCode.DOCUMENT_CATALOG_GET_FAIL.getValue(), |
| | | DocumentCode.DOCUMENT_CATALOG_GET_FAIL.getText()); |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 获取文档目录树形列表 |
| | | * |
| | | * @param request |
| | | * @return |
| | | */ |
| | |
| | | } |
| | | //判断参数是否为空 |
| | | if (fse == null) { |
| | | SpringMVCContextHolder |
| | | .getSystemLogger().error(DocumentCode.DOCUMENT_FORM_NODATA.getValue(), DocumentCode.DOCUMENT_FORM_NODATA.getText()); |
| | | return this.error(DocumentCode.DOCUMENT_FORM_NODATA.getValue(), DocumentCode.DOCUMENT_FORM_NODATA.getText()); |
| | | SpringMVCContextHolder.getSystemLogger().error(DocumentCode.DOCUMENT_FORM_NODATA.getValue(), |
| | | DocumentCode.DOCUMENT_FORM_NODATA.getText()); |
| | | return this.error(DocumentCode.DOCUMENT_FORM_NODATA.getValue(), |
| | | DocumentCode.DOCUMENT_FORM_NODATA.getText()); |
| | | } |
| | | return ResultInfo.success(documentDirectoryService.treeListAll(fse)); |
| | | } catch (BaseException e) { |
| | |
| | | }catch (Exception e) { |
| | | e.printStackTrace(); |
| | | SpringMVCContextHolder.getSystemLogger().error(e); |
| | | return this.error(DocumentCode.DOCUMENT_CATALOG_GET_TREE_FAIL.getValue(), DocumentCode.DOCUMENT_CATALOG_GET_TREE_FAIL.getText()); |
| | | return this.error(DocumentCode.DOCUMENT_CATALOG_GET_TREE_FAIL.getValue(), |
| | | DocumentCode.DOCUMENT_CATALOG_GET_TREE_FAIL.getText()); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 获取文档目录详情 |
| | | * |
| | | * @param request |
| | | * @return |
| | | */ |
| | |
| | | } |
| | | //判断参数是否为空 |
| | | if (fse == null) { |
| | | SpringMVCContextHolder |
| | | .getSystemLogger().error(DocumentCode.DOCUMENT_FORM_NODATA.getValue(), DocumentCode.DOCUMENT_FORM_NODATA.getText()); |
| | | return this.error(DocumentCode.DOCUMENT_FORM_NODATA.getValue(), DocumentCode.DOCUMENT_FORM_NODATA.getText()); |
| | | SpringMVCContextHolder.getSystemLogger().error(DocumentCode.DOCUMENT_FORM_NODATA.getValue(), |
| | | DocumentCode.DOCUMENT_FORM_NODATA.getText()); |
| | | return this.error(DocumentCode.DOCUMENT_FORM_NODATA.getValue(), |
| | | DocumentCode.DOCUMENT_FORM_NODATA.getText()); |
| | | } |
| | | String uuid = fse.getString(CmnConst.UUID);//表uuid |
| | | //超级管理员为1 普通单位管理员2 |
| | |
| | | type = CoreConst.DATA_PERMISSION_VALID_TYPE_USER; |
| | | } |
| | | //数据操作的权限验证 |
| | | if(!permissionService.validDataPermission(CmnConst.product_oa_DIRECTORY,uuid,type)) { |
| | | SpringMVCContextHolder.getSystemLogger().error(SystemErrorCode.SYSTEM_NOT_OPER_PERMISSION.getValue(), SystemErrorCode.SYSTEM_NOT_OPER_PERMISSION.getText()); |
| | | return this.error(SystemErrorCode.SYSTEM_NOT_OPER_PERMISSION.getValue(), SystemErrorCode.SYSTEM_NOT_OPER_PERMISSION.getText()); |
| | | if (!permissionService.validDataPermission(CmnConst.PRODUCT_OA_DIRECTORY, uuid, type)) { |
| | | SpringMVCContextHolder.getSystemLogger().error(SystemErrorCode.SYSTEM_NOT_OPER_PERMISSION.getValue(), |
| | | SystemErrorCode.SYSTEM_NOT_OPER_PERMISSION.getText()); |
| | | return this.error(SystemErrorCode.SYSTEM_NOT_OPER_PERMISSION.getValue(), |
| | | SystemErrorCode.SYSTEM_NOT_OPER_PERMISSION.getText()); |
| | | } |
| | | return OK_List(documentDirectoryService.documentDirectoryInfo(fse)); |
| | | } catch (BaseException e) { |
| | |
| | | }catch (Exception e) { |
| | | e.printStackTrace(); |
| | | SpringMVCContextHolder.getSystemLogger().error(e); |
| | | return this.error(DocumentCode.DOCUMENT_CATALOG_GET_FAIL.getValue(), DocumentCode.DOCUMENT_CATALOG_GET_FAIL.getText()); |
| | | return this.error(DocumentCode.DOCUMENT_CATALOG_GET_FAIL.getValue(), |
| | | DocumentCode.DOCUMENT_CATALOG_GET_FAIL.getText()); |
| | | } |
| | | } |
| | | } |
| | |
| | | @Autowired |
| | | public DocumentDirectoryService documentDirectoryService; |
| | | |
| | | /** |
| | | * 单位文件夹树 |
| | | * @return |
| | | */ |
| | | public DataTableEntity allDirectoryTree() { |
| | | DataTableEntity dtTree = baseDao.listTable(CmnConst.PRODUCT_OA_DIRECTORY, "directory_type = 1"); |
| | | if (!BaseUtil.dataTableIsEmpty(dtTree)) { |
| | | return BaseUtil.dataTableToTreeTable(dtTree, CmnConst.TRICODE, CmnConst.TRICODE_PARENT, null); |
| | | } |
| | | return dtTree; |
| | | } |
| | | |
| | | @Override |
| | | @Transactional |
| | | public String addDocumentDirectory(FieldSetEntity fieldSetEntity) throws BaseException { |
| | | |
| | | String triCode = CodeUtil.getNewCodeByTemp(CmnConst.product_oa_DIRECTORY,CmnConst.TRICODE,!StringUtils.isEmpty(fieldSetEntity.getString(CmnConst.TRICODE_PARENT))?fieldSetEntity.getString(CmnConst.TRICODE_PARENT):""); |
| | | String triCode = CodeUtil.getNewCodeByTemp(CmnConst.PRODUCT_OA_DIRECTORY, CmnConst.TRICODE, |
| | | !StringUtils.isEmpty(fieldSetEntity.getString(CmnConst.TRICODE_PARENT)) |
| | | ? fieldSetEntity.getString(CmnConst.TRICODE_PARENT) |
| | | : ""); |
| | | fieldSetEntity.setValue(CmnConst.TRICODE,triCode); |
| | | String[] codes = triCode.split("-"); |
| | | String org_level_uuid = SpringMVCContextHolder.getCurrentUser().getOrg_level_uuid(); |
| | |
| | | @Transactional |
| | | public boolean upDocumentDirectory(FieldSetEntity fieldSetEntity) throws BaseException { |
| | | String uuid = fieldSetEntity.getString(CmnConst.UUID); |
| | | FieldSetEntity fieldSet = baseDao.getFieldSetEntity(CmnConst.product_oa_DIRECTORY, uuid, false); |
| | | FieldSetEntity fieldSet = baseDao.getFieldSetEntity(CmnConst.PRODUCT_OA_DIRECTORY, uuid, false); |
| | | String tricode_parent1 = fieldSetEntity.getString(CmnConst.TRICODE_PARENT); |
| | | String tricode_parent2 = fieldSet.getString(CmnConst.TRICODE_PARENT); |
| | | boolean flag; |
| | | //上级目录tricode如果不相等 |
| | | if(!StringUtils.isEmpty(tricode_parent1) || !StringUtils.isEmpty(tricode_parent2)) { |
| | | if (!StringUtils.isEmpty(tricode_parent1) && !StringUtils.isEmpty(tricode_parent2) && !tricode_parent1.equals(tricode_parent2)) { |
| | | if (!StringUtils.isEmpty(tricode_parent1) && !StringUtils.isEmpty(tricode_parent2) |
| | | && !tricode_parent1.equals(tricode_parent2)) { |
| | | flag = true; |
| | | }else if(!StringUtils.isEmpty(tricode_parent1) && !StringUtils.isEmpty(tricode_parent2) && tricode_parent1.equals(tricode_parent2)){ |
| | | } else if (!StringUtils.isEmpty(tricode_parent1) && !StringUtils.isEmpty(tricode_parent2) |
| | | && tricode_parent1.equals(tricode_parent2)) { |
| | | flag = false; |
| | | }else if(!StringUtils.isEmpty(tricode_parent1) && StringUtils.isEmpty(tricode_parent2)){ |
| | | tricode_parent2 = ""; |
| | |
| | | |
| | | if(flag){ |
| | | StringBuffer sql=new StringBuffer() ; |
| | | sql.append(" update product_oa_directory set tricode=replace("); |
| | | sql.append(" update PRODUCT_OA_directory set tricode=replace("); |
| | | sql.append(" tricode,concat(?,'-'),concat(?,'-')),"); |
| | | sql.append(" tricode_parent=(case when tricode_parent=? then replace(tricode_parent,?,?) else "); |
| | | sql.append(" replace (tricode_parent,concat(?,'-'),concat(?,'-')) end )"); |
| | | sql.append(" where tricode like ?"); |
| | | baseDao.executeUpdate(sql.toString(), new String[]{ |
| | | tricode_parent1, |
| | | tricode_parent2, |
| | | tricode_parent1, |
| | | tricode_parent1, |
| | | tricode_parent2, |
| | | tricode_parent1, |
| | | tricode_parent2, |
| | | tricode_parent1+"-%", |
| | | }); |
| | | baseDao.executeUpdate(sql.toString(), new String[] { tricode_parent1, tricode_parent2, tricode_parent1, |
| | | tricode_parent1, tricode_parent2, tricode_parent1, tricode_parent2, tricode_parent1 + "-%", }); |
| | | } |
| | | |
| | | fieldSetEntity.setValue(CmnConst.UPDATED_BY, SpringMVCContextHolder.getCurrentUser().getUser_id());// 获取登录帐号 |
| | |
| | | if("2".equals(directory_type)){ |
| | | filter = " AND " + "created_by = " + SpringMVCContextHolder.getCurrentUserId(); |
| | | } |
| | | DataTableEntity dataTableEntity = baseDao.listTable("SELECT * FROM product_oa_directory WHERE directory_type = ? AND tricode_parent = (SELECT tricode FROM product_oa_directory where uuid = ?)" + filter, |
| | | DataTableEntity dataTableEntity = baseDao.listTable( |
| | | "SELECT * FROM PRODUCT_OA_directory WHERE directory_type = ? AND tricode_parent = (SELECT tricode FROM PRODUCT_OA_directory where uuid = ?)" |
| | | + filter, |
| | | new String[]{directory_type,uuid}); |
| | | if(BaseUtil.dataTableIsEmpty(dataTableEntity)){ |
| | | baseDao.delete(CmnConst.product_oa_DOCUMENT, "directory_uuid = ?", new String[]{uuid}); |
| | | return baseDao.delete(CmnConst.product_oa_DIRECTORY, new String[]{uuid}); |
| | | baseDao.delete(CmnConst.PRODUCT_OA_DOCUMENT, "directory_uuid = ?", new String[] { uuid }); |
| | | return baseDao.delete(CmnConst.PRODUCT_OA_DIRECTORY, new String[] { uuid }); |
| | | }else { |
| | | throw new BaseException(DocumentCode.DOCUMENT_CATALOG_DELETE_FAIL.getValue(), DocumentCode.DOCUMENT_CATALOG_DELETE_FAIL.getText(), this.getClass(),"public boolean delDocumentDirectory(FieldSetEntity fieldSetEntity) throws BaseException"); |
| | | throw new BaseException(DocumentCode.DOCUMENT_CATALOG_DELETE_FAIL.getValue(), |
| | | DocumentCode.DOCUMENT_CATALOG_DELETE_FAIL.getText(), this.getClass(), |
| | | "public boolean delDocumentDirectory(FieldSetEntity fieldSetEntity) throws BaseException"); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 获取当前文件路径 |
| | | * |
| | | * @param fieldSetEntity |
| | | * @return |
| | | * @throws BaseException |
| | |
| | | @Override |
| | | public DataTableEntity getDirectoryStructure(FieldSetEntity fieldSetEntity) throws BaseException { |
| | | String uuid = fieldSetEntity.getString(CmnConst.DIRECTORY_UUID); |
| | | fieldSetEntity = baseDao.getFieldSetEntity(CmnConst.product_oa_DIRECTORY, uuid, false); |
| | | fieldSetEntity = baseDao.getFieldSetEntity(CmnConst.PRODUCT_OA_DIRECTORY, uuid, false); |
| | | String triCode = fieldSetEntity.getString(CmnConst.TRICODE); |
| | | String type = fieldSetEntity.getString(CmnConst.DIRECTORY_TYPE); |
| | | List<String> codeList = ListUtils.newArrayList(); |
| | |
| | | //单位文件夹 |
| | | if("1".equals(type)){ |
| | | codeList.add(0,user.getOrg_level_uuid()); |
| | | dataTableEntity = baseDao.listTable(CmnConst.product_oa_DIRECTORY,"directory_type = 1 AND org_level_uuid = ? AND "+BaseUtil.buildQuestionMarkFilter(CmnConst.TRICODE,codeList.size()-1,true),codeList.toArray(),"tricode"); |
| | | dataTableEntity = baseDao.listTable(CmnConst.PRODUCT_OA_DIRECTORY, |
| | | "directory_type = 1 AND org_level_uuid = ? AND " |
| | | + BaseUtil.buildQuestionMarkFilter(CmnConst.TRICODE, codeList.size() - 1, true), |
| | | codeList.toArray(), "tricode"); |
| | | //个人文件夹 |
| | | }else { |
| | | codeList.add(0,String.valueOf(user.getUser_id())); |
| | | dataTableEntity = baseDao.listTable(CmnConst.product_oa_DIRECTORY,"directory_type = 2 AND created_by = ? AND "+BaseUtil.buildQuestionMarkFilter(CmnConst.TRICODE,codeList.size()-1,true),codeList.toArray(),"tricode"); |
| | | dataTableEntity = baseDao.listTable(CmnConst.PRODUCT_OA_DIRECTORY, |
| | | "directory_type = 2 AND created_by = ? AND " |
| | | + BaseUtil.buildQuestionMarkFilter(CmnConst.TRICODE, codeList.size() - 1, true), |
| | | codeList.toArray(), "tricode"); |
| | | } |
| | | baseDao.listInternationDataTable(dataTableEntity, null); |
| | | return dataTableEntity; |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public JSONArray treeListAll(FieldSetEntity fieldSetEntity) throws BaseException { |
| | |
| | | DataTableEntity data; |
| | | SystemUser user = SpringMVCContextHolder.getCurrentUser(); |
| | | StringBuffer sql = new StringBuffer(); |
| | | sql.append("SELECT a.*,ifnull(b.number,0) number FROM product_oa_directory a LEFT JOIN "); |
| | | sql.append("(SELECT COUNT(*) number,directory_uuid FROM product_oa_document GROUP BY directory_uuid) b on a.uuid=b.directory_uuid "); |
| | | sql.append("SELECT a.*,ifnull(b.number,0) number FROM PRODUCT_OA_directory a LEFT JOIN "); |
| | | sql.append( |
| | | "(SELECT COUNT(*) number,directory_uuid FROM PRODUCT_OA_document GROUP BY directory_uuid) b on a.uuid=b.directory_uuid "); |
| | | |
| | | if("1".equals(directory_type)){ |
| | | String org_level_uuid = user.getOrg_level_uuid(); |
| | | sql.append("where directory_type = 1 AND org_level_uuid = ? "); |
| | | data = baseDao.listTable(sql.toString(), new Object[]{org_level_uuid}); |
| | | // data = baseDao.listTable(CmnConst.product_oa_DIRECTORY, " directory_type = 1 AND org_level_uuid = ?", new String[]{org_level_uuid}, "tricode"); |
| | | // data = baseDao.listTable(CmnConst.PRODUCT_OA_DIRECTORY, " directory_type = 1 AND org_level_uuid = ?", new String[]{org_level_uuid}, "tricode"); |
| | | //个人文件夹 |
| | | }else { |
| | | Integer userId = user.getUser_id(); |
| | | sql.append("where directory_type = 2 AND created_by = ? "); |
| | | data = baseDao.listTable(sql.toString(), new Object[]{userId}); |
| | | |
| | | // data = baseDao.listTable(CmnConst.product_oa_DIRECTORY, " directory_type = 2 AND created_by = ?", new Object[]{userId}, "tricode"); |
| | | // data = baseDao.listTable(CmnConst.PRODUCT_OA_DIRECTORY, " directory_type = 2 AND created_by = ?", new Object[]{userId}, "tricode"); |
| | | } |
| | | baseDao.listInternationDataTable(data, null); |
| | | JSONArray menus = this.encapsulationTree(data); |
| | |
| | | array.add(orgLevelInfo); |
| | | return array; |
| | | } |
| | | |
| | | /** |
| | | * 封装树方法 |
| | | * |
| | | * @param |
| | | * @return |
| | | * @throws BaseException |
| | |
| | | @Override |
| | | public FieldSetEntity documentDirectoryInfo(FieldSetEntity fieldSetEntity) throws BaseException { |
| | | String uuid = fieldSetEntity.getString(CmnConst.UUID); |
| | | return baseDao.getFieldSetEntity(CmnConst.product_oa_DIRECTORY, uuid, true); |
| | | return baseDao.getFieldSetEntity(CmnConst.PRODUCT_OA_DIRECTORY, uuid, true); |
| | | } |
| | | |
| | | /** |
| | | * 移动到目录列表(根据当前用户过滤展示目录列表) |
| | | * 获取用户有新增(上传)权限的列表 |
| | | * 移动到目录列表(根据当前用户过滤展示目录列表) 获取用户有新增(上传)权限的列表 |
| | | * |
| | | * @param |
| | | * @return |
| | | * @throws BaseException |
| | |
| | | //1为单位文件夹 |
| | | if("1".equals(type)) { |
| | | param.append("%").append(userId).append("%"); |
| | | sql.append("SELECT a.* FROM "+CmnConst.product_oa_DIRECTORY+" a LEFT JOIN ") |
| | | .append(" product_oa_directory_rights b ON a.uuid = b.directory_uuid ") |
| | | sql.append("SELECT a.* FROM " + CmnConst.PRODUCT_OA_DIRECTORY + " a LEFT JOIN ") |
| | | .append(" PRODUCT_OA_directory_rights b ON a.uuid = b.directory_uuid ") |
| | | .append(" LEFT JOIN product_sys_organizational_structure_storage c on b.storage_uuid = c.uuid ") |
| | | .append(" WHERE a.directory_type = 1 AND b.rigths like '%3%' AND c.staff_ids like ? GROUP BY a.tricode "); |
| | | }else { |
| | | param.append(userId); |
| | | sql.append("SELECT * FROM product_oa_directory ") |
| | | .append(" WHERE directory_type = 2 AND created_by = ? "); |
| | | sql.append("SELECT * FROM PRODUCT_OA_directory ").append(" WHERE directory_type = 2 AND created_by = ? "); |
| | | } |
| | | DataTableEntity dataTableEntity = baseDao.listTable(sql.toString(), new String[]{param.toString()}); |
| | | baseDao.listInternationDataTable(dataTableEntity, null); |
| | |
| | | public boolean upDocumentDirectoryName(FieldSetEntity fse) throws BaseException { |
| | | String uuid = fse.getString(CmnConst.UUID); |
| | | String directoryName = fse.getString(CmnConst.DIRECTORY_NAME); |
| | | FieldSetEntity docField = baseDao.getFieldSetEntity(CmnConst.product_oa_DIRECTORY, uuid, false); |
| | | FieldSetEntity docField = baseDao.getFieldSetEntity(CmnConst.PRODUCT_OA_DIRECTORY, uuid, false); |
| | | docField.setValue(CmnConst.DIRECTORY_NAME, directoryName); |
| | | return baseDao.update(docField); |
| | | } |
| | |
| | | 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)); |
| | | } |
| | | } |