diff --git a/com.actionsoft.apps.coe.pal/lib/com.actionsoft.apps.coe.pal.jar b/com.actionsoft.apps.coe.pal/lib/com.actionsoft.apps.coe.pal.jar index eab3f979..41847454 100644 Binary files a/com.actionsoft.apps.coe.pal/lib/com.actionsoft.apps.coe.pal.jar and b/com.actionsoft.apps.coe.pal/lib/com.actionsoft.apps.coe.pal.jar differ diff --git a/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/CoEPALController.java b/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/CoEPALController.java index e324775a..5dec293e 100755 --- a/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/CoEPALController.java +++ b/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/CoEPALController.java @@ -2,27 +2,14 @@ package com.actionsoft.apps.coe.pal; import com.actionsoft.apps.AppsConst; import com.actionsoft.apps.coe.pal.constant.CoEConstant; -import com.actionsoft.apps.coe.pal.pal.repository.cache.PALRepositoryCache; -import com.actionsoft.apps.coe.pal.pal.repository.designer.no.epc.web.EpcGraphWeb; -import com.actionsoft.bpms.bpmn.modeler.ProcessBPMNDesignerController; -import com.actionsoft.bpms.commons.htmlframework.AlertWindow; -import com.actionsoft.bpms.commons.htmlframework.HtmlPageTemplate; -import com.actionsoft.bpms.commons.login.constant.LoginConst; -import com.actionsoft.bpms.commons.mvc.view.ResponseObject; -import com.actionsoft.bpms.commons.session.SessionImpl; -import com.actionsoft.bpms.form.engine.FormEngine; -import com.actionsoft.bpms.server.RequestParams; -import com.actionsoft.bpms.server.UserContext; -import com.actionsoft.bpms.server.bind.annotation.Controller; -import com.actionsoft.bpms.server.bind.annotation.Mapping; -import com.actionsoft.bpms.server.bind.annotation.Param; -import com.actionsoft.bpms.util.UUIDGener; import com.actionsoft.apps.coe.pal.pal.backup.web.CoEPALBackupWeb; import com.actionsoft.apps.coe.pal.pal.home.web.PalHomeWeb; import com.actionsoft.apps.coe.pal.pal.manage.method.PalManageWeb; import com.actionsoft.apps.coe.pal.pal.output.OutPutReportWeb; import com.actionsoft.apps.coe.pal.pal.repository.PALRepositoryQueryAPIManager; +import com.actionsoft.apps.coe.pal.pal.repository.cache.PALRepositoryCache; import com.actionsoft.apps.coe.pal.pal.repository.dao.CoeProcessLevelDaoFacotory; +import com.actionsoft.apps.coe.pal.pal.repository.designer.no.epc.web.EpcGraphWeb; import com.actionsoft.apps.coe.pal.pal.repository.designer.realtime.web.CoeRealtimeWeb; import com.actionsoft.apps.coe.pal.pal.repository.designer.relation.manager.DesignerRelationShapeCacheManager; import com.actionsoft.apps.coe.pal.pal.repository.designer.relation.web.DesignerRelationShapeWeb; @@ -37,6 +24,19 @@ import com.actionsoft.apps.coe.pal.pal.ws.model.CoeWorkSpaceModel; import com.actionsoft.apps.coe.pal.pal.ws.web.CoeWorkSpaceWeb; import com.actionsoft.apps.coe.pal.teamwork.web.ProcessPublishWeb; import com.actionsoft.apps.coe.pal.teamwork.web.TeamWorkManagerWeb; +import com.actionsoft.bpms.bpmn.modeler.ProcessBPMNDesignerController; +import com.actionsoft.bpms.commons.htmlframework.AlertWindow; +import com.actionsoft.bpms.commons.htmlframework.HtmlPageTemplate; +import com.actionsoft.bpms.commons.login.constant.LoginConst; +import com.actionsoft.bpms.commons.mvc.view.ResponseObject; +import com.actionsoft.bpms.commons.session.SessionImpl; +import com.actionsoft.bpms.form.engine.FormEngine; +import com.actionsoft.bpms.server.RequestParams; +import com.actionsoft.bpms.server.UserContext; +import com.actionsoft.bpms.server.bind.annotation.Controller; +import com.actionsoft.bpms.server.bind.annotation.Mapping; +import com.actionsoft.bpms.server.bind.annotation.Param; +import com.actionsoft.bpms.util.UUIDGener; import com.actionsoft.bpms.util.UtilString; import com.actionsoft.exception.ExceptionUtil; import com.actionsoft.i18n.I18nRes; @@ -49,1453 +49,1475 @@ import java.util.Map; /** * PAL相关的CMD处理 - * + * * @author zhouxuan */ @Controller public class CoEPALController { - // @Mapping("COE_PAL_MAIN") - @Mapping("com.actionsoft.apps.coe.pal_main_page") - public String COEPALMAIN(UserContext me, String wsuuid) { - Map macroLibraries = new HashMap(); - CoeWorkSpaceModel model = CoeWorkSpaceDaoFactory.createCoeWorkSpace().getInstance(wsuuid); - macroLibraries.put("sid", me.getSessionId()); - macroLibraries.put("wsuuid", wsuuid); - // 资产库去掉了版本号,已不做多版本 - macroLibraries.put("wsName", model.getWsName() /* + " " + VersionUtil.getVerStr (model.getWsVer()) */); - macroLibraries.put("desc", model.getWsDesc()); - macroLibraries.put("orgTypeName", WsOrgTypeEnum.getObject(model.getWsOrgType()).get("orgTypeName")); - macroLibraries.put("orgTypeImg", WsOrgTypeEnum.getObject(model.getWsOrgType()).get("orgTypeImg")); - int tcType = model.getWsTctype(); - if (tcType == 0) { - macroLibraries.put("tcType", "二分法"); - } else if (tcType == 1) { - macroLibraries.put("tcType", "三分法"); - } else { - macroLibraries.put("tcType", "自定义"); - } - CoeWorkSpaceWeb web = new CoeWorkSpaceWeb(me); - boolean b = web.getAccessHome(wsuuid); - macroLibraries.put("visitAccess", "style=\"display:none\""); - if (b) { - macroLibraries.put("visitAccess", ""); - } - return HtmlPageTemplate.merge(CoEConstant.APP_ID, "pal.main.html", macroLibraries); - } - - // @Mapping("COE_PAL_HOME") - @Mapping("com.actionsoft.apps.coe.pal_home_page") - public String COEPALHOME(UserContext me, String wsid) { - PalHomeWeb homeWeb = new PalHomeWeb(me); - return homeWeb.getHomeHtml(wsid); - } - - // @Mapping("COE_PAL_APP") - @Mapping("com.actionsoft.apps.coe.pal_app_page") - public String toCoEPALApp(UserContext me, String wsId, String teamId, String clazzName) { - PalHomeWeb homeWeb = new PalHomeWeb(me); - return homeWeb.toAppHome(wsId, teamId, clazzName); - } - - // 流程库 - // @Mapping("COE_PAL_PL") - @Mapping("com.actionsoft.apps.coe.pal_pl_page") - public String COEPALPAL(UserContext me, String wsuuid) { - CoeProcessLevelWeb fileWeb = new CoeProcessLevelWeb(me); - return fileWeb.getCoeRepositoryHtml(wsuuid); - } - - // 流程库搜索页面 - // @Mapping("COE_PAL_PL_SEARCH_PAGE") - @Mapping("com.actionsoft.apps.coe.pal_pl_search_page") - public String coePalPlSearchPage(UserContext me, String wsId, String plId, String palPath) { - CoeProcessLevelWeb fileWeb = new CoeProcessLevelWeb(me); - return fileWeb.toCoePalPlSearch(wsId, plId, palPath); - } - - // 流程库搜索 - // @Mapping("COE_PAL_PL_SEARCH") - @Mapping("com.actionsoft.apps.coe.pal_pl_search") - public String coePalPlSearch(UserContext me, String wsId, String plId, String fileType, String fileName, String shapeType, String shapeName, String attributes) { - CoeProcessLevelWeb fileWeb = new CoeProcessLevelWeb(me); - return fileWeb.coePalPlSearch(wsId, plId, fileType, fileName, shapeType, shapeName, attributes); - } - - // 流程库搜索-导出 - // @Mapping("COE_PAL_PL_SEARCH_EXPORT") - @Mapping("com.actionsoft.apps.coe.pal_pl_search_export") - public String coePalPlSearchExport(UserContext me, String exportData, String exportAttributes) { - CoeProcessLevelWeb fileWeb = new CoeProcessLevelWeb(me); - return fileWeb.coePalPlSearchExport(exportData, exportAttributes); - } - - // 流程库搜索-导入 - // @Mapping("COE_PAL_PL_SEARCH_IMPORT") - @Mapping("com.actionsoft.apps.coe.pal_pl_search_import") - public String coePalPlSearchImportPage(UserContext me, String wsId, String fileName, String category) { - CoeProcessLevelWeb fileWeb = new CoeProcessLevelWeb(me); - return fileWeb.coePalPlSearchImport(wsId, fileName, category); - } - - //流程库-流程导出数据的处理 - // @Mapping("COE_PAL_PL_EXPORT_HANDLE") - @Mapping("com.actionsoft.apps.coe.pal_pl_export_handle") - public String coePalPlExportHandle(UserContext me, String repositoryIds) { - CoeProcessLevelWeb fileWeb = new CoeProcessLevelWeb(me); - return fileWeb.coePalPlExport(me, repositoryIds); - } - - //流程库-已经生成的流程导出文件进行下载 - // @Mapping("COE_PAL_PL_EXPORT") - @Mapping("com.actionsoft.apps.coe.pal_pl_export") - public String coePalPlExport(UserContext me, String exportTitle, int exportCount, String dcId) { - CoeProcessLevelWeb fileWeb = new CoeProcessLevelWeb(me); - return fileWeb.getCoePalPlExport(me, exportTitle, exportCount, dcId); - } - - //流程库-打开流程导入页面 - // @Mapping("COE_PAL_PL_IMPORT_OPEN") - @Mapping("com.actionsoft.apps.coe.pal_pl_import_page") - public String coePalPlImportOpen(UserContext me) { - CoeProcessLevelWeb fileWeb = new CoeProcessLevelWeb(me); - return fileWeb.openCoePalPlImport(); - } - - //流程库-处理流程导入 - // @Mapping("COE_PAL_PL_IMPORT") - @Mapping("com.actionsoft.apps.coe.pal_pl_import") - public String coePalPlImport(UserContext me, String fileList, String wsId, String teamId, String plCategory, String parentId) { - CoeProcessLevelWeb fileWeb = new CoeProcessLevelWeb(me); - return fileWeb.handleCoePalPlImport(fileList, wsId, parentId, plCategory, teamId); - } - - //流程库-流程导入成功后的清单页 - // @Mapping("COE_PAL_PL_IMPORT_RESULT") - @Mapping("com.actionsoft.apps.coe.pal_pl_import_result") - public String coePalPlImportResult(UserContext me, String data) { - CoeProcessLevelWeb fileWeb = new CoeProcessLevelWeb(me); - return fileWeb.openCoePalPlImportResult(data); - } - - //流程库-流程导入成功的日志报告导出 - // @Mapping("COE_PAL_PL_IMPORT_RESULT_EXPORT") - @Mapping("com.actionsoft.apps.coe.pal_pl_import_result_export") - public String CoePalPlImportResultExport(UserContext me, String fileName) { - CoeProcessLevelWeb fileWeb = new CoeProcessLevelWeb(me); - return fileWeb.exportCoePalPlImportResult(fileName); - } - - //流程对比 - // @Mapping("COE_PAL_PL_VERSION_COMPARE") - @Mapping("com.actionsoft.apps.coe.pal_pl_version_compare") - public String coePalPlVersionCompare(UserContext me, String firstId, String secondId) { - CoeProcessLevelWeb fileWeb = new CoeProcessLevelWeb(me); - return fileWeb.getCoePalPlVersionCompare(firstId, secondId); - } - - /** - * 建模方法->查询所有建模方法 - * @param me - * @return - */ - @Mapping("com.actionsoft.apps.coe.pal_pl_manage_method_data_query") - public String coePalPlManageMethodData(UserContext me) { - PalManageWeb web = new PalManageWeb(me); - return web.getManageMethodData(); - } - - /** - * 保存形状定义描述 - * @return - */ - @Mapping("com.actionsoft.apps.coe.pal_pl_manage_method_object_desc_save") - public String coePalPlManageMethodObjectDescSave(UserContext me, String shapeName, String desc, String methodId) { - PalManageWeb web = new PalManageWeb(me); - return web.saveMethodObjectDesc(shapeName, desc, methodId); - } - - /** - * 建模方法->查询特定建模方法的形状定义数据 - * @param me - * @param methodId - * @return - */ - @Mapping("com.actionsoft.apps.coe.pal_pl_manage_method_shape_definition_data_query") - public String coePalPlManageMainContent(UserContext me, String methodId) { - PalManageWeb web = new PalManageWeb(me); - return web.getManageMethodShapeDefinitionData(methodId); - } - - /** - * 建模方法->设置更多特性->获取形状属性设置 - * @param me - * @param wsId - * @param methodId - * @param shapeName - * @return - */ - @Mapping("com.actionsoft.apps.coe.pal_pl_manage_method_shape_more_attr_config_query") - public String coePalPlManageShapeMoreAttrConfig(UserContext me ,String wsId, String methodId, String shapeName) { - PalManageWeb web = new PalManageWeb(me); - return web.getManageShapeMoreAttrConfigData(wsId, methodId, shapeName); - } - - /** - * 建模方法->设置更多特性->获取文件属性设置 - * @param me - * @param wsId - * @param methodId - * @return - */ - @Mapping("com.actionsoft.apps.coe.pal_pl_manage_method_file_more_attr_config_query") - public String coePalPlManageFileMoreAttrConfig(UserContext me, String wsId, String methodId) { - PalManageWeb web = new PalManageWeb(me); - return web.getManageFileMoreAttrConfigData(wsId, methodId); - } - - /** - * 建模方法->设置更多特性-保存文件/形状属性(原更多特性)设置 - * @param me - * @param wsId - * @param methodId - * @param type "file","shape" - * @param shapeName - * @param attrData 更多特性属性内容 - * @return - */ - @Mapping("com.actionsoft.apps.coe.pal_pl_manage_method_more_attr_config_save") - public String coePalPlManageMoreAttrConfigSave(UserContext me, String wsId, String methodId, String type, String shapeName, String attrData) { - PalManageWeb web = new PalManageWeb(me); - return web.saveCoePalPlManageMoreAttrConfig(wsId, methodId, type, shapeName, attrData); - } - - /** - * 建模方法->设置更多特性-保存文件/形状属性(原更多特性)设置之后保存进度查询 - * @param me - * @param logId - * @param timer - * @return - */ - @Mapping("com.actionsoft.apps.coe.pal_pl_manage_method_more_attr_config_save_log_query") - public String coePalPlManageMoreAttrConfigSaveLogQuery(UserContext me, String logId, String timer) { - PalManageWeb web = new PalManageWeb(me); - return web.coePalPlManageMoreAttrConfigSaveLogQuery(logId, timer); - } - - /** - * 建模方法->连线关系 - * @param me - * @param methodId - * @return - */ - @Mapping("com.actionsoft.apps.coe.pal_pl_manage_method_link_data_query") - public String coePalManageMethodLink(UserContext me, String methodId) { - PalManageWeb web = new PalManageWeb(me); - return web.getManageMethodLinkData(methodId); - } - - /** - * 建模方法->数据特性->特性树 - * @param me - * @param wsId - * @param methodId - * @return - */ - @Mapping("com.actionsoft.apps.coe.pal_pl_manage_method_attr_tree_data_query") - public String coePalManageMethodAttrTree(UserContext me, String wsId, String methodId) { - PalManageWeb web = new PalManageWeb(me); - return web.getManageMethodAttrTreeData(wsId, methodId); - } - - /** - * 建模方法->数据特性->表格数据 - * @param me - * @param wsId - * @param methodId - * @return - */ - @Mapping("com.actionsoft.apps.coe.pal_pl_manage_method_attr_table_data_query") - public String coePalManageMethodAttrTable(UserContext me, String wsId, String methodId, String type) { - PalManageWeb web = new PalManageWeb(me); - return web.getManageMethodAttrTableData(wsId, methodId, type); - } - - /** - * 建模方法->数据特性->获取指定建模方法所有形状 - * @param me - * @param methodId - * @return - */ - @Mapping("com.actionsoft.apps.coe.pal_pl_manage_method_attr_shape_option_query") - public String coePalPlManageMainAttrMessage(UserContext me, String methodId) { - PalManageWeb web = new PalManageWeb(me); - return web.getCoePalPlManageMainAttrMessage(methodId); - } - - /** - * 建模方法->数据特性->新增、修改属性到xml保存 - * @param me - * @return - */ - @Mapping("com.actionsoft.apps.coe.pal_pl_manage_method_attr_add_or_update_save") - public String coePalPlManageMainAttrSave(UserContext me, String methodId, boolean isCreate, String key, String title, String type, String ref, String value, boolean readonly, String groupPath, boolean isValid, String scope, boolean bpmFileShow, boolean bpmShapeShow,String desc,boolean isRequired) { - PalManageWeb web = new PalManageWeb(me); - if ("relation".equals(type) || "awsorg".equals(type)) {// 关联类型限定只读 - readonly = true; - } - return web.saveCoePalPlManageAttr(methodId, isCreate, key, title, type, ref, value, readonly, groupPath, isValid, scope, bpmFileShow, bpmShapeShow,desc,isRequired); - } - - /** - * 建模方法->数据特性->更新xml文件的只读和有效 - * @param me - * @return - */ - @Mapping("com.actionsoft.apps.coe.pal_pl_manage_method_attr_readonly_and_valid_update") - public String coePalPlManageMainAttrReadonlyValidSave(UserContext me, String methodId, String key, boolean readonly, boolean isValid,boolean isRequired) { - PalManageWeb web = new PalManageWeb(me); - return web.saveCoePalPlManageMainAttrReadonlyValid(methodId, key, readonly, isValid,isRequired); - } - - /** - * 建模方法->数据特性-更新xml文件的是否在bpm审批时显示通配 - * @param me - * @param methodId - * @param key - * @param bpmShow - * @param type - * @return - */ - @Mapping("com.actionsoft.apps.coe.pal_pl_manage_method_attr_bpm_show_update") - public String coePalPlManageMainAttrBpmShowSave(UserContext me, String methodId, String key, boolean bpmShow, String type) { - PalManageWeb web = new PalManageWeb(me); - return web.saveCoePalPlManageMainAttrBpmShowSave(methodId, key, bpmShow, type); - } - - /** - * 建模方法->数据特性->删除xml文件指定属性 - * @param me - * @param methodId - * @param attrId - * @return - */ - @Mapping("com.actionsoft.apps.coe.pal_pl_manage_method_attr_remove") - public String removePalPlManageMethodAttr(UserContext me, String methodId, String attrId) { - PalManageWeb web = new PalManageWeb(me); - return web.removePalPlManageMethodAttr(methodId, attrId); - } - - /** - * 建模方法->数据特性->更新文件属性和形状属性的属性名称 - * @param me - * @param wsId - * @param methodId - * @param type file、shape - * @param attrId - * @param newTitle - * @return - */ - @Mapping("com.actionsoft.apps.coe.pal_pl_manage_method_attr_file_and_shape_update") - public String coePalPlManageMainFileAndShapeAttrUpdate(UserContext me, String wsId, String methodId, String type, String attrId, String newTitle, int orderIndex) { - PalManageWeb web = new PalManageWeb(me); - return web.updateCoePalPlManageMainFileAndShapeAttr(wsId, methodId, type, attrId, newTitle, orderIndex); - } - - /** - * 建模方法->数据特性->更新文件属性和形状属性的属性排序 - * @param me - * @param wsId - * @param methodId - * @param type file shape - * @param attrs - * @return - */ - @Mapping("com.actionsoft.apps.coe.pal_pl_manage_method_attr_file_and_shape_sort_update") - public String coePalPlManageMainFileAndShapeAttrSortUpdate(UserContext me, String wsId, String methodId, String type, String attrs) { - PalManageWeb web = new PalManageWeb(me); - return web.coePalPlManageMainFileAndShapeAttrSortUpdate(wsId, methodId, type, attrs); - } - - //建模方法->建模对象->形状配置->查询形状的配置信息 - @Mapping("com.actionsoft.apps.coe.pal_pl_manage_shape_config_query") - public String coePalPlManageShapeConfigQuery(UserContext me, String wsId, String methodId, String shapeId) { - PalManageWeb web = new PalManageWeb(me); - return web.getCoePalPlManageShapeConfigByShapeId(wsId, methodId, shapeId); - } - - //建模方法->建模对象->形状配置->查询形状的属性树 - @Mapping("com.actionsoft.apps.coe.pal_pl_manage_shape_config_attr_tree_query") - public String coePalPlManageShapeConfigAttrTreeQuery(UserContext me, String wsId, String methodId, String shapeId) { - PalManageWeb web = new PalManageWeb(me); - return web.getCoePalPlManageShapeAttrTreeData(wsId, methodId, shapeId); - } - - //建模方法->建模对象->形状配置->保存形状的配置信息 - @Mapping("com.actionsoft.apps.coe.pal_pl_manage_shape_config_save") - public String coePalPlManageShapeConfigSave(UserContext me, String wsId, String methodId, String shapeId, String data) { - PalManageWeb fileWeb = new PalManageWeb(me); - return fileWeb.saveCoePalPlManageShapeConfig(wsId, methodId, shapeId, data); - } - - // 流程级别首页 - // @Mapping("COE_PAL_PL_RESPOSITORY_PORTAL") - @Mapping("com.actionsoft.apps.coe.pal_pl_repository_portal_page") - public String COEPALPLFilePortal(UserContext me, String ruuid, String wsid, String type) { - CoeProcessLevelWeb fileWeb = new CoeProcessLevelWeb(me); - return fileWeb.getPortalHtml(ruuid, wsid, type); - } - - // 流程级别mark BPN - // @Mapping("COE_PAL_PL_RESPOSITORY_MARK") - @Mapping("com.actionsoft.apps.coe.pal_pl_repository_mark") - public String COEPALPLFileMark(UserContext me, String uuid) { - CoeProcessLevelWeb fileWeb = new CoeProcessLevelWeb(me); - return fileWeb.mark(uuid); - - } - - // 取消流程级别mark BPN - // @Mapping("COE_PAL_PL_RESPOSITORY_RMARK") - @Mapping("com.actionsoft.apps.coe.pal_pl_repository_rmark") - public String COEPALPLFileRMark(UserContext me, String uuid) { - CoeProcessLevelWeb fileWeb = new CoeProcessLevelWeb(me); - return fileWeb.rmark(uuid); - } - - // 取消AWS流程关联 - // @Mapping("COE_PAL_PL_RESPOSITORY_CANCELCORRELATE") - @Mapping("com.actionsoft.apps.coe.pal_pl_repository_cancelcorrelate") - public String COEPALPLCancelCorrelate(UserContext me, String uuid) { - CoeProcessLevelWeb we = new CoeProcessLevelWeb(me); - return we.COEPALPLCancelCorrelate(uuid); - } - - // 分级-版本 - // @Mapping("COE_PAL_PL_RESPOSITORY_VERSION") - @Mapping("com.actionsoft.apps.coe.pal_pl_repository_version") - public String COEPALPLFileVersion(UserContext me, String uuid, String appId, String processVersionId) { - CoeProcessLevelWeb fileWeb = new CoeProcessLevelWeb(me); - return fileWeb.versionHtml(uuid, appId, processVersionId); - } - - // pal关联流程源文件在aws端被删除的处理 - // @Mapping("COE_PAL_PL_RESPOSITORY_CORRELATERESOURCE_CHECK") - @Mapping("com.actionsoft.apps.coe.pal_pl_repository_correlateresource_check") - public String COEPALPLCorrelateresourceCheck(UserContext me, String uuid) { - CoeProcessLevelWeb web = new CoeProcessLevelWeb(me); - return web.correlateResourceCheck(uuid); - } - - // coe设计器页面 - // @Mapping("COE_PAL_PL_RESPOSITORY_DESIGNER") - @Mapping("com.actionsoft.apps.coe.pal_pl_repository_designer") - public String COEPALPLFileDesigner(UserContext me, String uuid, int openType, String teamId, String perms, String filePerms, String openAppType) { - CoeDesignerWeb designerWeb = new CoeDesignerWeb(me); - return designerWeb.getDesignerHtml(uuid, openType, teamId, perms, filePerms, openAppType); - } - - // coe设计器页面-只读 - // @Mapping("COE_PAL_PL_RESPOSITORY_DESIGNER_VIEWER") - @Mapping("com.actionsoft.apps.coe.pal_pl_repository_designer_viewer") - public String COEPALPLFileDesignerViewer(UserContext me, String uuid, int openType, String teamId, String perms, String filePerms, String openAppType, String dockDisplay) { - CoeDesignerWeb designerWeb = new CoeDesignerWeb(me); - return designerWeb.getDesignerHtml(uuid, openType, null, true, teamId, perms, filePerms, openAppType, dockDisplay); - } - - // coe设计器页面-只读(无session) - // @Mapping(value = "COE_PAL_PL_RESPOSITORY_DESIGNER_VIEWER_NOSESSION",session = false, noSessionEvaluate = "无", noSessionReason = "外来人员访问考试") - @Mapping(value = "com.actionsoft.apps.coe.pal_pl_repository_designer_viewer_nosession",session = false, noSessionEvaluate = "无", noSessionReason = "外来人员访问考试") - public String COEPALPLFileDesignerViewer(String uid, String uuid, String processDefId) { - return PALRepositoryQueryAPIManager.getInstance().openDesignerRepositoryViewer(uid, uuid, processDefId); - } - - // coe设计器页面-链接-权限判断 - // @Mapping("COE_PAL_PL_RESPOSITORY_DESIGNER_VIEWER_LINK_PERM") - @Mapping("com.actionsoft.apps.coe.pal_pl_repository_designer_viewer_link_perm") - public String getPalLinkPerm(UserContext me, String uuids, String modelType, String filePerms) { - TeamWorkManagerWeb web = new TeamWorkManagerWeb(me); - return web.getPalLinkPerm(uuids, modelType, filePerms); - } - - // 流程相关发布信息 - // @Mapping("COE_PAL_PL_RESPOSITORY_COMMENTLIST") - @Mapping("com.actionsoft.apps.coe.pal_pl_repository_commentlist") - public String getPALCommentListByRepositoryId(UserContext me, String repositoryId, String openAppType) { - CoeDesignerWeb web = new CoeDesignerWeb(me); - return web.getPALCommentList(repositoryId, openAppType); - } - - // 流程相关发布信息 - // @Mapping("COE_PAL_PL_RESPOSITORY_COMMENT_SAVE") - @Mapping("com.actionsoft.apps.coe.pal_pl_repository_comment_save") - public String savePALComment(UserContext me, String comment, String wsId, String teamId, String repositoryId, String pId, String openAppType) { - CoeDesignerWeb web = new CoeDesignerWeb(me); - return web.savePALComment(comment, wsId, teamId, repositoryId, pId, openAppType); - } - - // coe设计器-打印 - // @Mapping("COE_PAL_PL_RESPOSITORY_DESIGNER_PRINT") - @Mapping("com.actionsoft.apps.coe.pal_pl_repository_designer_print") - public String COEPALPrint(UserContext me, String id) { - CoeDesignerWeb web = new CoeDesignerWeb(me); - return web.toPalRepositoryPrint(id); - } - - // coe设计器页面 - // @Mapping("COE_PAL_PL_RESPOSITORY_DESIGNER_OPEN_SHAPE") - @Mapping("com.actionsoft.apps.coe.pal_pl_repository_designer_open_shape_page") - public String COEPALPLFileDesignerOpen(UserContext me, String uuid, int openType, String shapeId, String perms, String filePerms) { - CoeDesignerWeb designerWeb = new CoeDesignerWeb(me); - return designerWeb.getDesignerHtml(uuid, openType, shapeId, perms, filePerms, "1"); - - } - - // coe设计器 更新文件title - // @Mapping("COE_PAL_PL_RESPOSITORY_DESIGNER_UPDATATITLE") - @Mapping("com.actionsoft.apps.coe.pal_pl_repository_designer_updatetitle") - public String COEPALPLFileDesignerUpdateTitle(UserContext me, RequestParams params) { - CoeProcessLevelWeb we = new CoeProcessLevelWeb(me); - String uuid = params.get("uuid"); - String title = params.get("title", ""); - // 添加到事件列表 - CoeRealtimeWeb realtimeWeb = new CoeRealtimeWeb(me); - Map paramsMap = new HashMap(); - paramsMap.put("uuid", uuid); - paramsMap.put("action", "changeTitle"); - paramsMap.put("clientId", ""); - paramsMap.put("messages", "{\"action\": \"changeTitle\", \"title\": \"" + title + "\", \"clientId\": \"\"}"); - paramsMap.put("title", title); - paramsMap.put("sid", me.getSessionId()); - realtimeWeb.addRealtimeEvents(paramsMap); - return we.updatePLName(uuid, title); - } - - // coe设计器模板 - // @Mapping("COE_PAL_PL_RESPOSITORY_DESIGNER_TEMPLATE") - @Mapping("com.actionsoft.apps.coe.pal_pl_repository_designer_template") - public String COEPALPLFileDesignerTemplate(UserContext me, String uuid) { - CoeDesignerWeb designerWeb = new CoeDesignerWeb(me); - return designerWeb.getDesignerTemplateHtml(uuid); - - } - - // coe设计器消息(保存、修改、删除) - // @Mapping("COE_PAL_PL_RESPOSITORY_DESIGNER_SHAPE") - @Mapping("com.actionsoft.apps.coe.pal_pl_repository_designer_shape") - public String COEPALPLFileDesignerShape(UserContext me, String uuid, String methodId, String categories, String wsId) { - CoeDesignerWeb designerWeb = new CoeDesignerWeb(me); - return designerWeb.getShape(uuid, methodId, categories, wsId); - - } - - // @Mapping("COE_PAL_PL_RESPOSITORY_DESIGNER_MESSAGE") - @Mapping("com.actionsoft.apps.coe.pal_pl_repository_designer_message") - public String COEPALPLFileDesignerMessage(UserContext me, RequestParams params) { - String action = params.get("action"); - String type = params.get("type"); - String uuid = params.get("uuid"); - int ver = params.getInt("ver"); - String messages = params.get("messages"); - String teamId = params.get("teamId"); - String lockUser = params.get("lockUser"); - CoeDesignerWeb designerWeb = new CoeDesignerWeb(me); - if (!action.equals("changeTitle")) { - CoeRealtimeWeb realtimeWeb = new CoeRealtimeWeb(me); - Map paramsMap = new HashMap(); - paramsMap.put("action", action); - paramsMap.put("messages", messages); - paramsMap.put("clientId", params.get("clientId")); - paramsMap.put("uuid", params.get("uuid")); - paramsMap.put("sid", me.getSessionId()); - realtimeWeb.addRealtimeEvents(paramsMap); - DesignerRelationShapeWeb relationShapeWeb = new DesignerRelationShapeWeb(me); - JSONArray jsonArr = JSONArray.parseArray(messages); - DesignerRelationShapeCacheManager event = DesignerRelationShapeCacheManager.getInstance(); - event.setFlag(false); - if (jsonArr.size() == 1) { - JSONObject jsonObj = jsonArr.getJSONObject(0); - if ("update".equals(jsonObj.getString("action"))) { - relationShapeWeb.updateShapesName(jsonObj.getJSONObject("content"), uuid); - relationShapeWeb.updateShapes(jsonObj.getJSONObject("content"), uuid); - } else { - event.setFlag(false); - } - } - for (Object obj : jsonArr) { - JSONObject jsonObj = (JSONObject) obj; - if ("remove".equals(jsonObj.getString("action"))) { - relationShapeWeb.removeShapes(jsonObj.getJSONArray("content"), uuid); - break; - } - if ("create".equals(jsonObj.getString("action"))) { - relationShapeWeb.recoverRemoveShapes(jsonObj.getJSONArray("content")); - relationShapeWeb.updateEventMap(jsonObj.getJSONArray("content"), uuid); - break; - } - - } - } - String msg = ""; - if ("command".equals(action)) { - String str = designerWeb.designerMessage(type, uuid, ver, messages, teamId, lockUser); - msg = str; - } else { - msg = ""; - } - ResponseObject ro = ResponseObject.newOkResponse(msg); - return ro.toString(); - } - - // 根据aws流程ID获取关联到pal资产库的流程ID - // @Mapping("COE_PAL_PL_RESPOSITORY_DESIGNER_PL_ID") - @Mapping("com.actionsoft.apps.coe.pal_pl_repository_designer_pl_id") - public String COEPALPLID(UserContext me, String newDefId) { - CoeDesignerWeb we = new CoeDesignerWeb(me); - return we.getPLIdByAWSId(newDefId); - } - - // coe设计器BPMN保存 - // @Mapping("COE_PAL_PL_RESPOSITORY_DESIGNER_SAVE") - @Mapping("com.actionsoft.apps.coe.pal_pl_repository_designer_save") - public String COEPALPLFileDesignerSave(UserContext me, RequestParams params) { - String appId = params.get("appId", AppsConst.SYS_APP_PLATFORM); - String uuid = params.get("ruuid"); - int ver = params.getInt("ver", 0); - String processDefId = params.get("processDefId", ""); - String op = params.get("op"); - String define = params.get("define"); - String drawMessage = params.get("messages", ""); - CoeDesignerWeb designerWeb = new CoeDesignerWeb(me); - return designerWeb.definitionOfBpmnSave(uuid, ver, appId, processDefId, op, define, drawMessage); - } - - // coe设计器BPMN校验 - // @Mapping("COE_PAL_PL_RESPOSITORY_DESIGNER_BPMN_VALIDATE") - @Mapping("com.actionsoft.apps.coe.pal_pl_repository_designer_bpmn_validate") - public String COEPALPLFileDesignerBPMNValidate(UserContext me, RequestParams params) { - String appId = params.get("appId", AppsConst.SYS_APP_PLATFORM); - String processDefId = params.get("processDefId", ""); - String define = params.get("define"); - CoeDesignerWeb designerWeb = new CoeDesignerWeb(me); - return designerWeb.bpmnValidate(appId, processDefId, define); - } - - // coe设计器历史版本 - // @Mapping("COE_PAL_PL_RESPOSITORY_DESIGNER_HISTORY_VERSION_JSON_DATA") - @Mapping("com.actionsoft.apps.coe.pal_pl_repository_designer_history_version_json_data") - public String COEPALPLFileDesignerHistoryVersionJsonData(UserContext me, RequestParams params) { - String type = params.get("type"); - String appId = params.get("appId", AppsConst.SYS_APP_PLATFORM); - String uuid = params.get("chartId"); - String processDefId = params.get("processDefId", ""); - CoeDesignerWeb designerWeb = new CoeDesignerWeb(me); - return designerWeb.historyVersions(type, appId, uuid, processDefId); - } - - // 流程的select类型属性的option - // @Mapping("COE_PAL_PL_ATTRIBUTE_OPTION") - @Mapping("com.actionsoft.apps.coe.pal_pl_attribute_option") - public String getAttributeSelectOptions(UserContext me, String category) { - CoeDesignerWeb web = new CoeDesignerWeb(me); - return web.getAttributeSelectOptions(category); - } - - // 预览图片 - // @Mapping("COE_PAL_PL_RESPOSITORY_DF") - @Mapping("com.actionsoft.apps.coe.pal_pl_repository_df") - public String COEPALPLRESPOSITORYDF(UserContext me, String uuid) { - CoeDesignerWeb designerWeb = new CoeDesignerWeb(me); - return designerWeb.getPNGUrl(uuid); - } - - // @Mapping("COE_PAL_PL_RESPOSITORY_DOWNLOAD_PNG") - @Mapping("com.actionsoft.apps.coe.pal_pl_repository_download_png") - public String COEPALPLRESPOSITORYDownloadPng(UserContext me, String uuid, String type) { - CoeDesignerWeb designerWeb = new CoeDesignerWeb(me); - return designerWeb.getPNGDownloadUrl(uuid, type); - } - - // coe设计器单个历史版本 - // @Mapping("COE_PAL_PL_RESPOSITORY_DESIGNER_HISTORY_DEFINE_JSON_DATA") - @Mapping("com.actionsoft.apps.coe.pal_pl_repository_designer_history_define_json_data") - public String COEPALPLFileDesignerHistoryDefineJsonData(UserContext me, RequestParams params) { - String type = params.get("type"); - String uuid = params.get("chartId"); - String appId = params.get("appId"); - String processDefId = params.get("processDefId", ""); - int ver = params.getInt("ver"); - CoeDesignerWeb designerWeb = new CoeDesignerWeb(me); - return designerWeb.getDefine(type, appId, uuid, processDefId, ver); - } - - // coe设计器恢复历史版本 - // @Mapping("COE_PAL_PL_RESPOSITORY_DESIGNER_HISTORY_RESTORE_VERSION") - @Mapping("com.actionsoft.apps.coe.pal_pl_repository_designer_history_restore_version") - public String COEPALPLFileDesignerHistoryRestoreVersion(UserContext me, RequestParams params) { - String type = params.get("type"); - String appId = params.get("appId"); - String uuid = params.get("chartId"); - String processDefId = params.get("processDefId"); - int ver = params.getInt("ver"); - CoeDesignerWeb designerWeb = new CoeDesignerWeb(me); - return designerWeb.restoreHistoryVersion(type, appId, uuid, processDefId, ver); - } - - // coe设计器--多人协作,保存修改信息 - // @Mapping("COE_PAL_PL_RESPOSITORY_DESIGNER_ADD_REALTIMEEVENTS") - @Mapping("com.actionsoft.apps.coe.pal_pl_repository_designer_add_realtimeevents") - public String COEPALPLAddRealtimeEvents(UserContext me, RequestParams params) { - CoeRealtimeWeb realtimeWeb = new CoeRealtimeWeb(me); - Map paramsMap = new HashMap(); - paramsMap.put("action", params.get("action")); - paramsMap.put("messages", params.get("messages")); - paramsMap.put("clientId", params.get("clientId")); - paramsMap.put("uuid", params.get("uuid")); - paramsMap.put("sid", me.getSessionId()); - realtimeWeb.addRealtimeEvents(paramsMap); - DesignerRelationShapeWeb relationShapeWeb = new DesignerRelationShapeWeb(me); - JSONArray jsonArr = JSONArray.parseArray(params.get("messages")); - DesignerRelationShapeCacheManager event = DesignerRelationShapeCacheManager.getInstance(); - event.setFlag(false); - if (jsonArr.size() == 1) { - JSONObject jsonObj = jsonArr.getJSONObject(0); - if ("update".equals(jsonObj.getString("action"))) { - relationShapeWeb.updateShapes(jsonObj.getJSONObject("content"), params.get("uuid")); - } else { - event.setFlag(false); - } - } - - for (Object obj : jsonArr) { - JSONObject jsonObj = (JSONObject) obj; - if ("remove".equals(jsonObj.getString("action"))) { - relationShapeWeb.removeShapes(jsonObj.getJSONArray("content"), params.get("uuid")); - break; - } - if ("create".equals(jsonObj.getString("action"))) { - relationShapeWeb.recoverRemoveShapes(jsonObj.getJSONArray("content")); - break; - } - - } - return ResponseObject.newOkResponse().toString(); - } - - // 自定义Schema保存 - // @Mapping("COE_PAL_PL_RESPOSITORY_DESIGNER_SCHEMA_SAVE") - @Mapping("com.actionsoft.apps.coe.pal_pl_repository_designer_schema_save") - public String COEPALPLCustomSchemaSave(UserContext me, String schema, String methodId, String category) { - CoeDesignerWeb web = new CoeDesignerWeb(me); - - return web.saveCOEPALPLCustomSchema(schema, methodId, category); - } - - // 自定义Schema保存 - // @Mapping("COE_PAL_PL_RESPOSITORY_DESIGNER_SCHEMA_REMOVE") - @Mapping("com.actionsoft.apps.coe.pal_pl_repository_designer_schema_remove") - public String COEPALPLCustomSchemaRemove(UserContext me, String schemaName, String methodId) { - CoeDesignerWeb web = new CoeDesignerWeb(me); - return web.removeCOEPALPLCustomSchema(schemaName, methodId); - } - - // 流程资产首页 - // @Mapping("COE_PAL_WS_PORTAL") - @Mapping("com.actionsoft.apps.coe.pal_ws_portal") - public String coePALWSPortal(UserContext me) { - CoeWorkSpaceWeb we = new CoeWorkSpaceWeb(me); - return we.getCoeWorkSpaceHtml(); - } - - // 流程资产数据 - // @Mapping("COE_PAL_WS_DATA") - @Mapping("com.actionsoft.apps.coe.pal_ws_data") - public String coePALWSData(UserContext me, String start, String pageSize) { - CoeWorkSpaceWeb we = new CoeWorkSpaceWeb(me); - return we.getCoeWorkSpaceGridData(); - } - - // 流程资产预览 - // @Mapping("COE_PAL_WS_PREVIEW") - @Mapping("com.actionsoft.apps.coe.pal_ws_preview") - public String coePALWSPREVIEW(UserContext me, String wsId) { - CoeWorkSpaceWeb we = new CoeWorkSpaceWeb(me); - return we.getCoeWorkSpacePreview(wsId); - } - - // 流程资产 添加 - // @Mapping("COE_PAL_WS_CREATE") - @Mapping("com.actionsoft.apps.coe.pal_ws_create") - public String coePALWSCreate(UserContext me, String id) { - CoeWorkSpaceWeb we = new CoeWorkSpaceWeb(me); - return we.createOrUpdateWorkspace(id); - } - - // 流程资产 导入外资产库 - // @Mapping("COE_PAL_WS_IMPORT") - @Mapping("com.actionsoft.apps.coe.pal_ws_import") - public String coePALWSImport(UserContext me) { - CoeWorkSpaceWeb we = new CoeWorkSpaceWeb(me); - return we.importWorkspace(); - } - - // 查询资产库树结构 - // @Mapping("COE_PAL_WS_TREE_DATA_JSON") - @Mapping("com.actionsoft.apps.coe.pal_ws_tree_data_json") - public String getRepositoryTreeData(UserContext me, String wsId, String pid) { - CoeWorkSpaceWeb we = new CoeWorkSpaceWeb(me); - return we.getRepositoryTreeData(wsId, pid); - } - - // 流程资产 查询是否已经存在资产库 - // @Mapping("COE_PAL_WS_IS_EXIST") - @Mapping("com.actionsoft.apps.coe.pal_ws_is_exist") - public String coePALWSIsExist(UserContext me, String wsFileName, String source) { - CoeWorkSpaceWeb we = new CoeWorkSpaceWeb(me); - return we.workspaceIsExist(wsFileName, source); - } - - /** - * 查询服务器中待导入的资产库文件 - * @param me - * @return - */ - @Mapping("com.actionsoft.apps.coe.pal_ws_remote_import_query") - public String getPALWSRemoteImportData(UserContext me) { - CoeWorkSpaceWeb web = new CoeWorkSpaceWeb(me); - return web.getPALWSRemoteImportData(); - } - - // 流程资产 保存 - // @Mapping("COE_PAL_WS_SAVE") - @Mapping("com.actionsoft.apps.coe.pal_ws_save") - public String coePALWSSave(UserContext me, String id, String state, String tctype, String orderIndex, String wsOrgType, String wsName, String wsDm, String wsAdmin, String wsDsc, String wsBgUrl) { - CoeWorkSpaceWeb we = new CoeWorkSpaceWeb(me); - return we.saveCoeWorkspace(id, wsName, wsDm, wsAdmin, wsDsc, Integer.parseInt(state), Integer.parseInt(tctype), wsBgUrl, Integer.parseInt(orderIndex), Integer.parseInt(wsOrgType)); - } - - // 流程资产 保存导入的资产库 - // @Mapping("COE_PAL_WS_SAVE_IMPORT") - @Mapping("com.actionsoft.apps.coe.pal_ws_save_import") - public String coePALWSSaveImport(UserContext me, String wsFileName, String replaceChoice, String source) throws Exception { - CoeWorkSpaceWeb we = new CoeWorkSpaceWeb(me); - return we.saveImportCoeWorkspace(wsFileName, replaceChoice, source); - } - - // 流程资产 选择用户 - // @Mapping("COE_PAL_WS_USERLIST") - @Mapping("com.actionsoft.apps.coe.pal_ws_userlist") - public String coePALWSUserList(UserContext me, String users, String removeUserIds) { - CoeWorkSpaceWeb web = new CoeWorkSpaceWeb(me); - return web.toPALWSUserList(users, removeUserIds); - } - - // 停用启用流程资产 - // @Mapping("COE_PAL_WS_STOPOROPEN") - @Mapping("com.actionsoft.apps.coe.pal_ws_stoporopen") - public String coePALWSStopOrOpen(UserContext me, String id, String state) { - CoeWorkSpaceWeb we = new CoeWorkSpaceWeb(me); - return we.stopCoeWorkspace(id, Integer.parseInt(state)); - } - - // 删除流程资产 - // @Mapping("COE_PAL_WS_REMOVE") - @Mapping("com.actionsoft.apps.coe.pal_ws_remove") - public String coePALWSRemove(UserContext me, String id, String versionId) { - CoeWorkSpaceWeb we = new CoeWorkSpaceWeb(me); - return we.removeCoeWorkspace(id, versionId); - } - - // 导出流程资产 - // @Mapping("COE_PAL_WS_EXP") - @Mapping("com.actionsoft.apps.coe.pal_ws_exp") - public String coePALWSExp(UserContext me, String id, String clientType) { - CoeWorkSpaceWeb we = new CoeWorkSpaceWeb(me); - return we.expCoeWorkSpace(id, clientType); - } - - // 导入流程资产 - // @Mapping("COE_PAL_WS_IMP") - @Mapping("com.actionsoft.apps.coe.pal_ws_imp") - public String coePALWSImp(UserContext me, String name) { - CoeWorkSpaceWeb we = new CoeWorkSpaceWeb(me); - return we.impCoeWorkSpace(name); - } - - /** - * 流程版本管理显示页面 - * - * @param versionId - * @return - */ - // @Mapping("COE_PAL_WS_VERSION_MANAGE") - @Mapping("com.actionsoft.apps.coe.pal_ws_version_manage_page") - public String coePALProcessVersion(UserContext me, String versionId, String wsUsedUUID) { - CoeWorkSpaceWeb po = new CoeWorkSpaceWeb(me); - return po.getCoeWorkSpaceVersionHtml(versionId, wsUsedUUID); - } - - // @Mapping("COE_PAL_WS_VERSION_SAVE") - @Mapping("com.actionsoft.apps.coe.pal_ws_version_save") - public String coePALProcessVersion(UserContext me, String wsuuid, String maxVersionNo, String wsVersionId, String wsUsedUUID) { - CoeWorkSpaceWeb po = new CoeWorkSpaceWeb(me); - return po.getCoeWorkSpaceVersionSaveHtml(wsuuid, maxVersionNo, wsVersionId, wsUsedUUID); - } - - // @Mapping("COE_PAL_WS_VERSION_USED") - @Mapping("com.actionsoft.apps.coe.pal_ws_version_used") - public String coePALProcessVersionUsed(UserContext me, String wsUsedUUID, String wsSelectVersionId) { - CoeWorkSpaceWeb po = new CoeWorkSpaceWeb(me); - return po.getCoeWorkSpaceVersionUsedHtml(wsUsedUUID, wsSelectVersionId); - } - - // 版本的删除 - // @Mapping("COE_PAL_WS_VERSION_DEL") - @Mapping("com.actionsoft.apps.coe.pal_ws_version_del") - public String coePALProcessVersionDel(UserContext me, String wsUUID, String versionId) { - CoeWorkSpaceWeb po = new CoeWorkSpaceWeb(me); - return po.getCoeWorkSpaceVersionDel(wsUUID, versionId); - } - - // 流程资产关联BPM - // @Mapping("COE_PAL_PROCESSLEVEL_CORRELATE") - @Mapping("com.actionsoft.apps.coe.pal_processlevel_correlate") - public String coePALWSCorrelate(UserContext me) { - CoeProcessLevelWeb we = new CoeProcessLevelWeb(me); - return we.correlateWorkspace(); - } - - // 获取流程资产关联的初始数据 - // @Mapping("COE_PAL_PROCESSLEVEL_CORRELATE_DATA_JSON") - @Mapping("com.actionsoft.apps.coe.pal_processlevel_correlate_data_json") - public String coePALWSCorrelateData(UserContext me) { - CoeProcessLevelWeb we = new CoeProcessLevelWeb(me); - return we.getCoePALWSCorrelateData(); - } - - // 查询AWS未关联流程树 - // @Mapping("COE_PAL_PROCESSLEVEL_NOCORRELATE_TREE_DATA_JSON") - @Mapping("com.actionsoft.apps.coe.pal_processlevel_nocorrelate_tree_data_json") - public String getAwsNoCorrelateTree(UserContext me, String appId, String pid, String requestType, String param) { - CoeProcessLevelWeb we = new CoeProcessLevelWeb(me); - return we.getAwsCorrelateTree(appId, pid, requestType, param, "noCorrelate"); - } - - // 查询AWS已关联流程树 - // @Mapping("COE_PAL_PROCESSLEVEL_CORRELATED_TREE_DATA_JSON") - @Mapping("com.actionsoft.apps.coe.pal_processlevel_correlated_tree_data_json") - public String getAwsCorrelatedTree(UserContext me, String appId, String pid, String requestType, String param) { - CoeProcessLevelWeb we = new CoeProcessLevelWeb(me); - return we.getAwsCorrelateTree(appId, pid, requestType, param, "correlated"); - } - - // 新建关联时快速搜索 - // @Mapping("COE_PAL_PROCESSLEVEL_CORRELATE_SEARCH") - @Mapping("com.actionsoft.apps.coe.pal_processlevel_correlate_search") - public String getCorrelateSearch(UserContext me, String query, String type, String limit, String currentPage) { - CoeProcessLevelWeb we = new CoeProcessLevelWeb(me); - return we.getCorrelateSearchDataToJson(query, type, Integer.parseInt(limit), Integer.parseInt(currentPage)); - } - - // PAL关联AWS流程保存 - // @Mapping("COE_PAL_PROCESSLEVEL_CORRELATE_CREATE_SAVE") - @Mapping("com.actionsoft.apps.coe.pal_processlevel_correlate_create_save") - public String coePALProcessLevelCorrelateCreateSave(UserContext me, String wsId, String currentCorrelation) { - CoeProcessLevelWeb we = new CoeProcessLevelWeb(me); - return we.coePALProcessLevelCorrelateCreateSave(wsId, currentCorrelation); - } - - // 跳转到流程分级首页 - // @Mapping("COE_PAL_PROCESSLEVEL_PORTAL") - // @Mapping("com.actionsoft.apps.coe.pal_processlevel_portal_page") - // public String coePALProcessLevelPortal(UserContext me, String wsId, - // String type) { - // CoeProcessLevelWeb we = new CoeProcessLevelWeb(me); - // return we.getCoeProcessLevelHtml(wsId, type); - // } - - // 跳转到流程分级tree - // @Mapping("COE_PAL_PROCESSLEVEL_TREE") - @Mapping("com.actionsoft.apps.coe.pal_processlevel_tree") - public String coePALProcessLevelTree(UserContext me, String wsId) { - CoeProcessLevelWeb we = new CoeProcessLevelWeb(me); - return we.getCoeProcessLevelTree(wsId); - } - - // 流程分级 新建级次 - // @Mapping("COE_PAL_PROCESSLEVEL_CREAT") - @Mapping("com.actionsoft.apps.coe.pal_processlevel_create") - public String coePALProcessLevelCreat(UserContext me, String wsid, String pid, String id, String type, String editable) { - CoeProcessLevelWeb we = new CoeProcessLevelWeb(me); - return we.createOrUpdateCoeProcessLevel(wsid, pid, id, type, editable); - } - - // 流程分级 新建级次ajax数据 - // @Mapping("COE_PAL_PROCESSLEVEL_CREATE_AJAX") - @Mapping("com.actionsoft.apps.coe.pal_processlevel_create_ajax") - public String coePALProcessLevelCreateAjax(UserContext me, String wsid, String pid, String id, String type) { - CoeProcessLevelWeb we = new CoeProcessLevelWeb(me); - return we.coePALProcessLevelCreateAjax(wsid, pid, id, type); - } - - // 复制库文件 - // @Mapping("COE_PAL_PROCESSLEVEL_COPE") - @Mapping("com.actionsoft.apps.coe.pal_processlevel_copy") - public String coePALPROCESSLEVELCOPE(UserContext me, String sourceUUID, String targetUUID, String copyType) { - CoeProcessLevelWeb we = new CoeProcessLevelWeb(me); - return we.copyFile(PALRepositoryCache.getCache().get(sourceUUID).getWsId(), null, sourceUUID, targetUUID, copyType); - } - - // 根据空间类型得到树json - // @Mapping("COE_PAL_PROCESSLEVEL_TREEJSON") - @Mapping("com.actionsoft.apps.coe.pal_processlevel_treejson") - public String coePALProcessLevelTreeJson(UserContext me, String wsid, String pid) { - CoeProcessLevelWeb we = new CoeProcessLevelWeb(me); - return we.getTreeJson(wsid, pid); - } - - // 上传附件-protal页面 - // @Mapping("COE_PAL_PROCESSLEVEL_UPFILE_PORTAL") - @Deprecated - @Mapping("com.actionsoft.apps.coe.pal_processlevel_upfile_portal_page") - public String coePALProcessLevelUPFILEPORTAL(UserContext me, RequestParams params) { - String pl_uuid = params.get("pl_uuid"); - String shape_uuid = params.get("shape_uuid"); - String type = params.get("type"); - UpfileWeb web = new UpfileWeb(me); - return web.upFilePortalHtml(pl_uuid, shape_uuid, type); - } - - - /** - * 获取流程属性信息填充绩效模型 - * @param me - * @param params - * @return - */ - @Mapping("com.actionsoft.apps.coe.pal_processlevel_getPerformance") - public String processlevelGetPerformance(UserContext me, RequestParams params) { - String uuid = params.get("fileId"); - String methodId = params.get("methodId"); - UpfileWeb web = new UpfileWeb(me); - return web.processlevelGetPerformance(uuid,me,methodId); - } - - - - // 上传附件-load - // @Mapping("COE_PAL_PROCESSLEVEL_UPFILE_LOAD") - @Mapping("com.actionsoft.apps.coe.pal_processlevel_upfile_load") - public String coePALProcessLevelUPFILELOAD(UserContext me, RequestParams params) { - String pl_uuid = params.get("pl_uuid"); - String shape_uuid = params.get("shape_uuid"); - String type = params.get("type"); - String uuids = params.get("uuids"); - String wsId = params.get("wsId"); - String teamId = params.get("teamId"); - UpfileWeb web = new UpfileWeb(me); - return web.loadUpFiles(pl_uuid, shape_uuid, type, uuids, wsId, teamId); - } - - /** - * 三员管理下加载用户权限下所有密级文件,包含未标密 - * @param me - * @param params - * @return - */ - @Mapping("com.actionsoft.apps.coe.pal_processlevel_upfile_load_all") - public String coePALProcessLevelUPFILELOADALL(UserContext me, RequestParams params) { - String pl_uuid = params.get("pl_uuid"); - String shape_uuid = params.get("shape_uuid"); - String type = params.get("type"); - String uuids = params.get("uuids"); - String wsId = params.get("wsId"); - String teamId = params.get("teamId"); - UpfileWeb web = new UpfileWeb(me); - return web.loadUpFilesAll(pl_uuid, shape_uuid, type, uuids, wsId, teamId); - } - - /** - * 更新附件密级 - * @param me - * @param uuid - * @param securityLevel - * @return - */ - @Mapping("com.actionsoft.apps.coe.pal_processlevel_upfile_security_level_update") - public String coePALProcessLevelUPFILESecurityLevelUpdate(UserContext me,String uuid,String securityLevel){ - UpfileWeb web = new UpfileWeb(me); - return web.updateUpFileSecurityLevel(uuid,securityLevel); - } - - /** - * 获取流程树中第一个附件未标密文件在树中路径 - * @return - */ - @Mapping("com.actionsoft.apps.coe.pal_processlevel_upfile_unmark_path") - public String coePALProcessLevelUPFILEUnmarkPathGet(UserContext me,String wsId,String teamId){ - - return PALRepositoryQueryAPIManager.getInstance().getUnmarkPath(me,wsId,teamId); - } - - // 上传附件-load - // @Mapping("COE_PAL_PROCESSLEVEL_RELATION_UPFILE_LOAD") - @Mapping("com.actionsoft.apps.coe.pal_processlevel_relation_upfile_load") - public String coePALProcessLevelRelationUPFILELOAD(UserContext me, RequestParams params) { - String pl_uuid = params.get("pl_uuid"); - String shape_uuid = params.get("shape_uuid"); - String type = params.get("type"); - UpfileWeb web = new UpfileWeb(me); - return web.loadRelationUpfiles(pl_uuid, shape_uuid, type); - } - - // 上传附件-add file - // @Mapping("COE_PAL_PROCESSLEVEL_UPFILE_ADD") - @Mapping("com.actionsoft.apps.coe.pal_processlevel_upfile_add") - public String coePALProcessLevelUPFILEADD(UserContext me, RequestParams params) { - String pl_uuid = params.get("pl_uuid"); - String shape_uuid = params.get("shape_uuid"); - String type = params.get("type"); - String download = params.get("download"); - String fileName = params.get("fileName"); - String securityLevel = params.get("securityLevel"); - UpfileWeb web = new UpfileWeb(me); - return web.addUpFile(pl_uuid, shape_uuid, type, download, fileName,securityLevel); - } - - // 上传附件2(设计器内部批量上传改版)-add file - @Mapping("com.actionsoft.apps.coe.pal_processlevel_upfile_add2") - public String coePALProcessLevelUPFILEADD2(UserContext me, RequestParams params) { - String pl_uuid = params.get("pl_uuid"); - String shape_uuid = params.get("shape_uuid"); - String type = params.get("type"); - String download = params.get("download"); - String files = params.get("files"); - return new UpfileWeb(me).addUpFile2(pl_uuid, shape_uuid, type, download, files); - } - - // 附件-删除附件 - // @Mapping("COE_PAL_PROCESSLEVEL_UPFILE_DEL") - @Mapping("com.actionsoft.apps.coe.pal_processlevel_upfile_del") - public String coePALProcessLevelUPFILEDEL(UserContext me, RequestParams params) { - String uuid = params.get("uuid"); - UpfileWeb web = new UpfileWeb(me); - return web.delete(uuid); - } - - // 附件-在线预览 - // @Mapping("COE_PAL_PROCESSLEVEL_UPFILE_READ") - @Mapping("com.actionsoft.apps.coe.pal_processlevel_upfile_read") - public String coePALProcessLevelUPFILERead(UserContext me, RequestParams params) { - UpfileWeb web = new UpfileWeb(me); - String uuid = params.get("uuid"); - return web.readFile(uuid); - } - - - /** - * 相关文件/支持文件附件下载 - * @param me - * @param params - * @return - */ - @Mapping("com.actionsoft.apps.coe.pal_outputreport_output_downloadZipfile") - public String COEPALOUTPUTREPORTOutputProcessDownloadZipFILE(UserContext me, RequestParams params,String methodId) throws Exception { - UpfileWeb web = new UpfileWeb(me); - String splitId = params.get("splitId"); - String toolbarname=params.get("toolbarname"); - String taskId=params.get("taskIdParams"); - return web.readZipFileDownLoad(splitId,toolbarname,taskId,methodId); - } - - - /** - * 流程手册单个下载 - * @param me - * @param params - * @return - * @throws Exception - */ - @Mapping("com.actionsoft.apps.coe.pal_outputreport_output_single_file_downLoad") - public String coePALProcessSingleFileDownload(UserContext me, RequestParams params) throws Exception { - UpfileWeb web = new UpfileWeb(me); - String fileId = params.get("fileId"); - return web.coePALProcessSingleFileDownload(fileId); - } - - @Mapping("com.actionsoft.apps.coe.pal_outputreport_output_query_manual_logdata") - public String coePALProcessManualLogData(UserContext me, RequestParams params) throws Exception { - UpfileWeb web = new UpfileWeb(me); - String ruuid = params.get("ruuid"); - return web.coePALProcessManualLogData(ruuid); - } - - - - // 文件属性的单个 值 修改 - // @Mapping("COE_PAL_PROCESSLEVEL_MORE_ATTR_CONTENT_SAVE") - @Mapping("com.actionsoft.apps.coe.pal_processlevel_more_attr_content_save") - public String coePALProcessLevelMoreAttrContentSave(UserContext me, String uuid, String josnKey, String josnContent) { - CoeProcessLevelWeb we = new CoeProcessLevelWeb(me); - return we.moreAttrContentSave(uuid, josnKey, josnContent); - } - - // 文件属性的固定属性 值 修改 - @Mapping("com.actionsoft.apps.coe.pal_processlevel_default_attr_content_save") - public String coePALProcessLevelDefaultAttrContentSave(UserContext me, String uuid, String josnKey, String josnContent) { - CoeProcessLevelWeb we = new CoeProcessLevelWeb(me); - return we.defaultAttrContentSave(uuid, josnKey, josnContent); - } - - // 删除该节点下及其子节点的所有数据 - // @Mapping("COE_PAL_PROCESSLEVEL_TREEREMOVE") - @Mapping("com.actionsoft.apps.coe.pal_processlevel_tree_remove") - public String coePALProcessLevelTreeRemove(UserContext me, String wsid, String pid) { - CoeProcessLevelWeb we = new CoeProcessLevelWeb(me); - return we.removeTreeNode(pid, wsid); - } - - // 获取该节点下是否有子节点 - // @Mapping("COE_PAL_PROCESSLEVEL_ISTREECHILDREN") - @Mapping("com.actionsoft.apps.coe.pal_processlevel_istreechildren") - public String coePALProcessLevelIsTreeChildren(UserContext me, String wsid, String pid) { - CoeProcessLevelWeb we = new CoeProcessLevelWeb(me); - return we.getChildrenStr(pid, wsid); - } - - // 同级设置orderindex - // @Mapping("COE_PAL_PROCESSLEVEL_SETPLORDERINDEX") - @Mapping("com.actionsoft.apps.coe.pal_processlevel_setploaderindex") - public String coePALProcessLevelSetPlOrderIndex(UserContext me, String orderIndexs) { - CoeProcessLevelWeb we = new CoeProcessLevelWeb(me); - return we.setPlOrderIndex(orderIndexs); - } - - // 跨级设置pid - // @Mapping("COE_PAL_PROCESSLEVEL_SETPLPID") - @Mapping("com.actionsoft.apps.coe.pal_processlevel_setplid") - public String coePALProcessLevelSetPlPid(UserContext me, String pids) { - CoeProcessLevelWeb we = new CoeProcessLevelWeb(me); - return we.setPlPids(pids); - } - - // 拖拽修改pal的pid或orderIndex - // @Mapping("COE_PAL_UPDATE_INDEX_OR_PID") - @Mapping("com.actionsoft.apps.coe.pal_update_index_or_pid") - public String updatePalIndexOrPid(UserContext me, String sourceId, String targetId, String type, String position) { - CoeProcessLevelWeb we = new CoeProcessLevelWeb(me); - return we.updatePalIndexOrPid(sourceId, targetId, type, position); - } - - // 流程分级统计 - // @Mapping("COE_PL_COUNT") - @Mapping("com.actionsoft.apps.coe.pal_pl_count") - public String coePLCount(UserContext me, String wsId, String condition) { - CoeProcessLevelWeb web = new CoeProcessLevelWeb(me); - return web.getPLStatistics(wsId, condition); - } - - // 跳转到流程清单首页 - // @Mapping("COE_PAL_PROCESSLEVEL_LIST_PORTAL") - @Mapping("com.actionsoft.apps.coe.pal_processlevel_list_portal_page") - public String coePALProcessLevelListPortal(UserContext me, String wsId, String condition) { - CoeProcessListWeb we = new CoeProcessListWeb(me); - return we.getCoeProcessListHtml(wsId, condition); - } - - // 跳转到流程清单Datagrid - // @Mapping("COE_PAL_PROCESSLEVEL_GRIDDATA") - @Mapping("com.actionsoft.apps.coe.pal_processlevel_griddata") - public String coePALProcessLevelGridData(UserContext me, String start, String pageSize, String wsId, String conditions) { - CoeProcessListWeb we = new CoeProcessListWeb(me); - if (wsId.equals("")) { - wsId = "0"; - } - return we.getCoeProcessListGridData(Integer.parseInt(start), Integer.parseInt(pageSize), wsId, conditions); - } - - // 设置流程图 - // @Mapping("COE_PAL_PROCESSLEVEL_FLOWCHART") - @Mapping("com.actionsoft.apps.coe.pal_processlevel_flowchart_page") - public String coePALProcessLevelFlowChart(UserContext me, String id, String type) { - CoeProcessListWeb we = new CoeProcessListWeb(me); - return we.flowChartHtml(id, type); - } - - // 保存流程图 - // @Mapping("COE_PAL_PROCESSLEVEL_SAVEFLOWCHART") - @Mapping("com.actionsoft.apps.coe.pal_processlevel_flowchart_save") - public String coePALProcessLevelSaveFlowChart(UserContext me, String id, String plDiagramUrl) { - CoeProcessListWeb we = new CoeProcessListWeb(me); - return we.saveflowChart(id, plDiagramUrl); - } - - // 标记颜色 - // @Mapping("COE_PAL_PROCESSLEVEL_SIGN") - @Mapping("com.actionsoft.apps.coe.pal_processlevel_sign") - public String coePALProcessLevelSign(UserContext me, String id) { - CoeProcessListWeb we = new CoeProcessListWeb(me); - return we.signColorHtml(id); - } - - // 保存标记颜色 - // @Mapping("COE_PAL_PROCESSLEVEL_SAVESIGN") - @Mapping("com.actionsoft.apps.coe.pal_processlevel_sign_save") - public String coePALProcessLevelSaveSign(UserContext me, String id, String plColor) { - CoeProcessListWeb we = new CoeProcessListWeb(me); - return we.saveSignColor(id, plColor); - } - - // 向上 - // @Mapping("COE_PAL_PROCESSLEVEL_UP") - @Mapping("com.actionsoft.apps.coe.pal_processlevel_up") - public String coePALProcessLevelUp(UserContext me, String id, String orderIndex, String upId, String upOrderIndex) { - CoeProcessListWeb we = new CoeProcessListWeb(me); - return we.uP(id, Integer.parseInt(orderIndex), upId, Integer.parseInt(upOrderIndex)); - } - - // 导出excel - // @Mapping("COE_PAL_PROCESSLEVEL_EXPEXCEL") - @Mapping("com.actionsoft.apps.coe.pal_processlevel_expexcel") - public String coePALProcessLevelExpExcel(UserContext me, String wsId, String conditions) { - CoeProcessListWeb we = new CoeProcessListWeb(me); - return we.expExcel(wsId, conditions); - } - - // 新版新建 - // @Mapping("COE_PAL_PROCESSLEVEL_CREATE_V2") - @Mapping("com.actionsoft.apps.coe.pal_processlevel_create_v2") - public String coePALProcessLevelCreateV2(UserContext me, String wsid, String id) { - CoeProcessLevelWeb we = new CoeProcessLevelWeb(me); - return we.createProcessLevel(wsid, id); - } - - // 新版新建-模板内容 - // @Mapping("COE_PAL_PROCESSLEVEL_CREATE_TEMPLATE") - @Mapping("com.actionsoft.apps.coe.pal_processlevel_create_template") - public String coePALProcessLevelCreateTemplate(UserContext me, String methodId) { - CoeProcessLevelWeb we = new CoeProcessLevelWeb(me); - return we.getTemplateByMethodId(methodId); - } - - // 资产库 模糊搜索 - // @Mapping("COE_PAL_PROCESSLEVEL_QUERY") - @Deprecated - @Mapping("com.actionsoft.apps.coe.pal_processlevel_query") - public String coePALPROCESSLEVELQUERY(UserContext me, String autoContent, String wsid) { - CoeProcessLevelWeb we = new CoeProcessLevelWeb(me); - return we.getPLInfoByName(autoContent, wsid); - } - - // 资产库模型查询 - @Mapping("com.actionsoft.apps.coe.pal_processlevel_basic_query") - public String coePalProcessLevelBasicQuery(UserContext me, String wsId, String teamId, String name, String timeStamp) { - CoeProcessLevelWeb web = new CoeProcessLevelWeb(me); - return web.basicQueryCoeProcessLevelByName(wsId, teamId, name, timeStamp); - } - - // 资产库模糊查询-高级查询-查询主信息 - @Mapping("com.actionsoft.apps.coe.pal_processlevel_condition_main_query") - public String coePalProcessLevelConditionMainQuery(UserContext me, String wsId, String teamId) { - CoeProcessLevelWeb web = new CoeProcessLevelWeb(me); - return web.conditionQueryCoeProcessLevelMainData(wsId, teamId); - } - - // 资产库模糊查询-高级查询-查询符合的数据 - @Mapping("com.actionsoft.apps.coe.pal_processlevel_condition_data_query") - public String coePalProcessLevelConditionDataQuery(UserContext me, String wsId, String teamId, String type, String method, String createUser, String updateDate, String key, String timeStamp) { - CoeProcessLevelWeb web = new CoeProcessLevelWeb(me); - return web.conditionQueryCoeProcessLevelData(wsId, teamId, type, method, createUser, updateDate, key, timeStamp); - } - - // 资产库 模糊搜索 检查是否存在库文件 - // @Mapping("COE_PAL_PROCESSLEVEL_QUERY_CHECK") - @Deprecated - @Mapping("com.actionsoft.apps.coe.pal_processlevel_query_check") - public String coePALPROCESSLEVELQUERYCHECK(UserContext me, String uuid) { - PALRepositoryModel coeProcessLevelModel = CoeProcessLevelDaoFacotory.createCoeProcessLevel().getInstance(uuid); - return coeProcessLevelModel != null ? uuid : ""; - } - - // @Mapping("COE_PAL_PL_RESPOSITORY_DESIGNER_LINK_TREE") - @Mapping("com.actionsoft.apps.coe.pal_pl_repository_designer_link_tree") - public String COEPALPLFileDesignerLinkTree(UserContext me, String wsid, String teamId, String palId) { - CoeDesignerWeb designerWeb = new CoeDesignerWeb(me); - return designerWeb.getDesignerLinkTree(wsid, teamId, palId); - } - - // 自定义文件链接文件的搜索功能 - // @Mapping("COE_PAL_PL_RESPOSITORY_DESIGNER_LINK_TREE_SEARCH") - @Mapping("com.actionsoft.apps.coe.pal_pl_repository_designer_link_tree_search") - public String COEPALPLFileDesignerLinkTreeSearchByName(UserContext me, String seachName, String wsid) { - CoeDesignerWeb designerWeb = new CoeDesignerWeb(me); - return designerWeb.getDesignerLinkTreeSearchByName(seachName, wsid); - } - - // @Mapping("COE_PAL_PL_USING_PL_ID") - @Mapping("com.actionsoft.apps.coe.pal_pl_using_plid_query") - public String COEPALPLUsingPlId(UserContext me, String uuid) { - CoeProcessLevelWeb coeProcessLevelWeb = new CoeProcessLevelWeb(me); - return coeProcessLevelWeb.getUsingPlId(uuid); - } - - // 多人协作监听 - // @Mapping("COE_PAL_PL_RESPOSITORY_DESIGNER_REALTIME_LISTEN") - @Mapping("com.actionsoft.apps.coe.pal_pl_repository_designer_realtime_listen") - public String COEPALPLRespositoryDesignerRealtimeListen(UserContext me, String clientId, String userId, String name, String subject, String listenTime) { - CoeRealtimeWeb coeRealtimeWeb = new CoeRealtimeWeb(me); - return coeRealtimeWeb.listen(clientId, userId, name, subject, listenTime); - } - - // 复制操作时缓存数据 - // @Mapping("COE_PAL_PL_RESPOSITORY_DESIGNER_RELATION_SHAPE_COPY") - @Mapping("com.actionsoft.apps.coe.pal_pl_repository_designer_relation_shape_copy") - public String COEPALPLRespositoryDesignerRelationShapeCopy(UserContext me, RequestParams params) { - DesignerRelationShapeWeb relationShapeWeb = new DesignerRelationShapeWeb(me); - String userId = params.get("userId"); - String clientId = params.get("clientId"); - String type = params.get("type"); - String subject = params.get("subject"); - String ver = params.get("ver"); - String shapeId = params.get("shapeId"); - String messageJson = params.get("messageJson"); - String shapeGroupId = params.get("shapeGroupId"); - return relationShapeWeb.respositoryDesignerRelationShapeCopy(userId, clientId, subject, type, ver, shapeId, messageJson, shapeGroupId); - } - - // 粘贴时从缓存中获取数据 - // @Mapping("COE_PAL_PL_RESPOSITORY_DESIGNER_RELATION_SHAPE_PASTE_AJAX") - @Mapping("com.actionsoft.apps.coe.pal_pl_repository_designer_relation_shape_paste_ajax") - public String COEPALPLRespositoryDesignerRelationShapePasteAjax(UserContext me, String userId, String clientId, String subject, String action, String type, String ver) { - DesignerRelationShapeWeb relationShapeWeb = new DesignerRelationShapeWeb(me); - return relationShapeWeb.respositoryDesignerRelationShapePasteAjax(userId, clientId, subject, action, type, ver); - } - - // @Mapping("COE_PAL_PL_RESPOSITORY_DESIGNER_REALTIME_LEAVE") - @Mapping("com.actionsoft.apps.coe.pal_pl_repository_designer_realtime_leave") - public String COEPALPLRespositoryDesignerRealtimeLeave(UserContext me, String userId, String uuid) { - CoeRealtimeWeb coeRealtimeWeb = new CoeRealtimeWeb(me); - Map params = new HashMap(); - params.put("action", "leave"); - params.put("uuid", uuid); - params.put("sid", me.getSessionId()); - params.put("userId", userId); - params.put("messages", "{\"action\": \"leave\", \"userId\": \"" + userId + "\", \"name\":\"" + me.getUserName() + "\"}"); - coeRealtimeWeb.addRealtimeEvents(params); - //return ""; - CoeDesignerWeb web = new CoeDesignerWeb(me);//释放用户锁 - return web.releaseCheckoutRight(uuid); - } - - // 复制操作时缓存数据 - // @Mapping("COE_PAL_PL_RESPOSITORY_DESIGNER_RELATION_SHAPE_PASTE") - @Mapping("com.actionsoft.apps.coe.pal_pl_repository_designer_relation_shape_paste") - public String COEPALPLRespositoryDesignerRelationShapePaste(UserContext me, RequestParams params) { - DesignerRelationShapeWeb relationShapeWeb = new DesignerRelationShapeWeb(me); - String subject = params.get("subject"); - String messageJson = params.get("messageJson"); - return relationShapeWeb.pasteToDatabse(subject, messageJson); - } + // @Mapping("COE_PAL_MAIN") + @Mapping("com.actionsoft.apps.coe.pal_main_page") + public String COEPALMAIN(UserContext me, String wsuuid) { + Map macroLibraries = new HashMap(); + CoeWorkSpaceModel model = CoeWorkSpaceDaoFactory.createCoeWorkSpace().getInstance(wsuuid); + macroLibraries.put("sid", me.getSessionId()); + macroLibraries.put("wsuuid", wsuuid); + // 资产库去掉了版本号,已不做多版本 + macroLibraries.put("wsName", model.getWsName() /* + " " + VersionUtil.getVerStr (model.getWsVer()) */); + macroLibraries.put("desc", model.getWsDesc()); + macroLibraries.put("orgTypeName", WsOrgTypeEnum.getObject(model.getWsOrgType()).get("orgTypeName")); + macroLibraries.put("orgTypeImg", WsOrgTypeEnum.getObject(model.getWsOrgType()).get("orgTypeImg")); + int tcType = model.getWsTctype(); + if (tcType == 0) { + macroLibraries.put("tcType", "二分法"); + } else if (tcType == 1) { + macroLibraries.put("tcType", "三分法"); + } else { + macroLibraries.put("tcType", "自定义"); + } + CoeWorkSpaceWeb web = new CoeWorkSpaceWeb(me); + boolean b = web.getAccessHome(wsuuid); + macroLibraries.put("visitAccess", "style=\"display:none\""); + if (b) { + macroLibraries.put("visitAccess", ""); + } + return HtmlPageTemplate.merge(CoEConstant.APP_ID, "pal.main.html", macroLibraries); + } + + // @Mapping("COE_PAL_HOME") + @Mapping("com.actionsoft.apps.coe.pal_home_page") + public String COEPALHOME(UserContext me, String wsid) { + PalHomeWeb homeWeb = new PalHomeWeb(me); + return homeWeb.getHomeHtml(wsid); + } + + // @Mapping("COE_PAL_APP") + @Mapping("com.actionsoft.apps.coe.pal_app_page") + public String toCoEPALApp(UserContext me, String wsId, String teamId, String clazzName) { + PalHomeWeb homeWeb = new PalHomeWeb(me); + return homeWeb.toAppHome(wsId, teamId, clazzName); + } + + // 流程库 + // @Mapping("COE_PAL_PL") + @Mapping("com.actionsoft.apps.coe.pal_pl_page") + public String COEPALPAL(UserContext me, String wsuuid) { + CoeProcessLevelWeb fileWeb = new CoeProcessLevelWeb(me); + return fileWeb.getCoeRepositoryHtml(wsuuid); + } + + // 流程库搜索页面 + // @Mapping("COE_PAL_PL_SEARCH_PAGE") + @Mapping("com.actionsoft.apps.coe.pal_pl_search_page") + public String coePalPlSearchPage(UserContext me, String wsId, String plId, String palPath) { + CoeProcessLevelWeb fileWeb = new CoeProcessLevelWeb(me); + return fileWeb.toCoePalPlSearch(wsId, plId, palPath); + } + + // 流程库搜索 + // @Mapping("COE_PAL_PL_SEARCH") + @Mapping("com.actionsoft.apps.coe.pal_pl_search") + public String coePalPlSearch(UserContext me, String wsId, String plId, String fileType, String fileName, String shapeType, String shapeName, String attributes) { + CoeProcessLevelWeb fileWeb = new CoeProcessLevelWeb(me); + return fileWeb.coePalPlSearch(wsId, plId, fileType, fileName, shapeType, shapeName, attributes); + } + + // 流程库搜索-导出 + // @Mapping("COE_PAL_PL_SEARCH_EXPORT") + @Mapping("com.actionsoft.apps.coe.pal_pl_search_export") + public String coePalPlSearchExport(UserContext me, String exportData, String exportAttributes) { + CoeProcessLevelWeb fileWeb = new CoeProcessLevelWeb(me); + return fileWeb.coePalPlSearchExport(exportData, exportAttributes); + } + + // 流程库搜索-导入 + // @Mapping("COE_PAL_PL_SEARCH_IMPORT") + @Mapping("com.actionsoft.apps.coe.pal_pl_search_import") + public String coePalPlSearchImportPage(UserContext me, String wsId, String fileName, String category) { + CoeProcessLevelWeb fileWeb = new CoeProcessLevelWeb(me); + return fileWeb.coePalPlSearchImport(wsId, fileName, category); + } + + //流程库-流程导出数据的处理 + // @Mapping("COE_PAL_PL_EXPORT_HANDLE") + @Mapping("com.actionsoft.apps.coe.pal_pl_export_handle") + public String coePalPlExportHandle(UserContext me, String repositoryIds) { + CoeProcessLevelWeb fileWeb = new CoeProcessLevelWeb(me); + return fileWeb.coePalPlExport(me, repositoryIds); + } + + //流程库-已经生成的流程导出文件进行下载 + // @Mapping("COE_PAL_PL_EXPORT") + @Mapping("com.actionsoft.apps.coe.pal_pl_export") + public String coePalPlExport(UserContext me, String exportTitle, int exportCount, String dcId) { + CoeProcessLevelWeb fileWeb = new CoeProcessLevelWeb(me); + return fileWeb.getCoePalPlExport(me, exportTitle, exportCount, dcId); + } + + //流程库-打开流程导入页面 + // @Mapping("COE_PAL_PL_IMPORT_OPEN") + @Mapping("com.actionsoft.apps.coe.pal_pl_import_page") + public String coePalPlImportOpen(UserContext me) { + CoeProcessLevelWeb fileWeb = new CoeProcessLevelWeb(me); + return fileWeb.openCoePalPlImport(); + } + + //流程库-处理流程导入 + // @Mapping("COE_PAL_PL_IMPORT") + @Mapping("com.actionsoft.apps.coe.pal_pl_import") + public String coePalPlImport(UserContext me, String fileList, String wsId, String teamId, String plCategory, String parentId) { + CoeProcessLevelWeb fileWeb = new CoeProcessLevelWeb(me); + return fileWeb.handleCoePalPlImport(fileList, wsId, parentId, plCategory, teamId); + } + + //流程库-流程导入成功后的清单页 + // @Mapping("COE_PAL_PL_IMPORT_RESULT") + @Mapping("com.actionsoft.apps.coe.pal_pl_import_result") + public String coePalPlImportResult(UserContext me, String data) { + CoeProcessLevelWeb fileWeb = new CoeProcessLevelWeb(me); + return fileWeb.openCoePalPlImportResult(data); + } + + //流程库-流程导入成功的日志报告导出 + // @Mapping("COE_PAL_PL_IMPORT_RESULT_EXPORT") + @Mapping("com.actionsoft.apps.coe.pal_pl_import_result_export") + public String CoePalPlImportResultExport(UserContext me, String fileName) { + CoeProcessLevelWeb fileWeb = new CoeProcessLevelWeb(me); + return fileWeb.exportCoePalPlImportResult(fileName); + } + + //流程对比 + // @Mapping("COE_PAL_PL_VERSION_COMPARE") + @Mapping("com.actionsoft.apps.coe.pal_pl_version_compare") + public String coePalPlVersionCompare(UserContext me, String firstId, String secondId) { + CoeProcessLevelWeb fileWeb = new CoeProcessLevelWeb(me); + return fileWeb.getCoePalPlVersionCompare(firstId, secondId); + } + + /** + * 建模方法->查询所有建模方法 + * + * @param me + * @return + */ + @Mapping("com.actionsoft.apps.coe.pal_pl_manage_method_data_query") + public String coePalPlManageMethodData(UserContext me) { + PalManageWeb web = new PalManageWeb(me); + return web.getManageMethodData(); + } + + /** + * 保存形状定义描述 + * + * @return + */ + @Mapping("com.actionsoft.apps.coe.pal_pl_manage_method_object_desc_save") + public String coePalPlManageMethodObjectDescSave(UserContext me, String shapeName, String desc, String methodId) { + PalManageWeb web = new PalManageWeb(me); + return web.saveMethodObjectDesc(shapeName, desc, methodId); + } + + /** + * 建模方法->查询特定建模方法的形状定义数据 + * + * @param me + * @param methodId + * @return + */ + @Mapping("com.actionsoft.apps.coe.pal_pl_manage_method_shape_definition_data_query") + public String coePalPlManageMainContent(UserContext me, String methodId) { + PalManageWeb web = new PalManageWeb(me); + return web.getManageMethodShapeDefinitionData(methodId); + } + + /** + * 建模方法->设置更多特性->获取形状属性设置 + * + * @param me + * @param wsId + * @param methodId + * @param shapeName + * @return + */ + @Mapping("com.actionsoft.apps.coe.pal_pl_manage_method_shape_more_attr_config_query") + public String coePalPlManageShapeMoreAttrConfig(UserContext me, String wsId, String methodId, String shapeName) { + PalManageWeb web = new PalManageWeb(me); + return web.getManageShapeMoreAttrConfigData(wsId, methodId, shapeName); + } + + /** + * 建模方法->设置更多特性->获取文件属性设置 + * + * @param me + * @param wsId + * @param methodId + * @return + */ + @Mapping("com.actionsoft.apps.coe.pal_pl_manage_method_file_more_attr_config_query") + public String coePalPlManageFileMoreAttrConfig(UserContext me, String wsId, String methodId) { + PalManageWeb web = new PalManageWeb(me); + return web.getManageFileMoreAttrConfigData(wsId, methodId); + } + + /** + * 建模方法->设置更多特性-保存文件/形状属性(原更多特性)设置 + * + * @param me + * @param wsId + * @param methodId + * @param type "file","shape" + * @param shapeName + * @param attrData 更多特性属性内容 + * @return + */ + @Mapping("com.actionsoft.apps.coe.pal_pl_manage_method_more_attr_config_save") + public String coePalPlManageMoreAttrConfigSave(UserContext me, String wsId, String methodId, String type, String shapeName, String attrData) { + PalManageWeb web = new PalManageWeb(me); + return web.saveCoePalPlManageMoreAttrConfig(wsId, methodId, type, shapeName, attrData); + } + + /** + * 建模方法->设置更多特性-保存文件/形状属性(原更多特性)设置之后保存进度查询 + * + * @param me + * @param logId + * @param timer + * @return + */ + @Mapping("com.actionsoft.apps.coe.pal_pl_manage_method_more_attr_config_save_log_query") + public String coePalPlManageMoreAttrConfigSaveLogQuery(UserContext me, String logId, String timer) { + PalManageWeb web = new PalManageWeb(me); + return web.coePalPlManageMoreAttrConfigSaveLogQuery(logId, timer); + } + + /** + * 建模方法->连线关系 + * + * @param me + * @param methodId + * @return + */ + @Mapping("com.actionsoft.apps.coe.pal_pl_manage_method_link_data_query") + public String coePalManageMethodLink(UserContext me, String methodId) { + PalManageWeb web = new PalManageWeb(me); + return web.getManageMethodLinkData(methodId); + } + + /** + * 建模方法->数据特性->特性树 + * + * @param me + * @param wsId + * @param methodId + * @return + */ + @Mapping("com.actionsoft.apps.coe.pal_pl_manage_method_attr_tree_data_query") + public String coePalManageMethodAttrTree(UserContext me, String wsId, String methodId) { + PalManageWeb web = new PalManageWeb(me); + return web.getManageMethodAttrTreeData(wsId, methodId); + } + + /** + * 建模方法->数据特性->表格数据 + * + * @param me + * @param wsId + * @param methodId + * @return + */ + @Mapping("com.actionsoft.apps.coe.pal_pl_manage_method_attr_table_data_query") + public String coePalManageMethodAttrTable(UserContext me, String wsId, String methodId, String type) { + PalManageWeb web = new PalManageWeb(me); + return web.getManageMethodAttrTableData(wsId, methodId, type); + } + + /** + * 建模方法->数据特性->获取指定建模方法所有形状 + * + * @param me + * @param methodId + * @return + */ + @Mapping("com.actionsoft.apps.coe.pal_pl_manage_method_attr_shape_option_query") + public String coePalPlManageMainAttrMessage(UserContext me, String methodId) { + PalManageWeb web = new PalManageWeb(me); + return web.getCoePalPlManageMainAttrMessage(methodId); + } + + /** + * 建模方法->数据特性->新增、修改属性到xml保存 + * + * @param me + * @return + */ + @Mapping("com.actionsoft.apps.coe.pal_pl_manage_method_attr_add_or_update_save") + public String coePalPlManageMainAttrSave(UserContext me, String methodId, boolean isCreate, String key, String title, String type, String ref, String value, boolean readonly, String groupPath, boolean isValid, String scope, boolean bpmFileShow, boolean bpmShapeShow, String desc, boolean isRequired) { + PalManageWeb web = new PalManageWeb(me); + if ("relation".equals(type) || "awsorg".equals(type)) {// 关联类型限定只读 + readonly = true; + } + return web.saveCoePalPlManageAttr(methodId, isCreate, key, title, type, ref, value, readonly, groupPath, isValid, scope, bpmFileShow, bpmShapeShow, desc, isRequired); + } + + /** + * 建模方法->数据特性->更新xml文件的只读和有效 + * + * @param me + * @return + */ + @Mapping("com.actionsoft.apps.coe.pal_pl_manage_method_attr_readonly_and_valid_update") + public String coePalPlManageMainAttrReadonlyValidSave(UserContext me, String methodId, String key, boolean readonly, boolean isValid, boolean isRequired) { + PalManageWeb web = new PalManageWeb(me); + return web.saveCoePalPlManageMainAttrReadonlyValid(methodId, key, readonly, isValid, isRequired); + } + + /** + * 建模方法->数据特性-更新xml文件的是否在bpm审批时显示通配 + * + * @param me + * @param methodId + * @param key + * @param bpmShow + * @param type + * @return + */ + @Mapping("com.actionsoft.apps.coe.pal_pl_manage_method_attr_bpm_show_update") + public String coePalPlManageMainAttrBpmShowSave(UserContext me, String methodId, String key, boolean bpmShow, String type) { + PalManageWeb web = new PalManageWeb(me); + return web.saveCoePalPlManageMainAttrBpmShowSave(methodId, key, bpmShow, type); + } + + /** + * 建模方法->数据特性->删除xml文件指定属性 + * + * @param me + * @param methodId + * @param attrId + * @return + */ + @Mapping("com.actionsoft.apps.coe.pal_pl_manage_method_attr_remove") + public String removePalPlManageMethodAttr(UserContext me, String methodId, String attrId) { + PalManageWeb web = new PalManageWeb(me); + return web.removePalPlManageMethodAttr(methodId, attrId); + } + + /** + * 建模方法->数据特性->更新文件属性和形状属性的属性名称 + * + * @param me + * @param wsId + * @param methodId + * @param type file、shape + * @param attrId + * @param newTitle + * @return + */ + @Mapping("com.actionsoft.apps.coe.pal_pl_manage_method_attr_file_and_shape_update") + public String coePalPlManageMainFileAndShapeAttrUpdate(UserContext me, String wsId, String methodId, String type, String attrId, String newTitle, int orderIndex) { + PalManageWeb web = new PalManageWeb(me); + return web.updateCoePalPlManageMainFileAndShapeAttr(wsId, methodId, type, attrId, newTitle, orderIndex); + } + + /** + * 建模方法->数据特性->更新文件属性和形状属性的属性排序 + * + * @param me + * @param wsId + * @param methodId + * @param type file shape + * @param attrs + * @return + */ + @Mapping("com.actionsoft.apps.coe.pal_pl_manage_method_attr_file_and_shape_sort_update") + public String coePalPlManageMainFileAndShapeAttrSortUpdate(UserContext me, String wsId, String methodId, String type, String attrs) { + PalManageWeb web = new PalManageWeb(me); + return web.coePalPlManageMainFileAndShapeAttrSortUpdate(wsId, methodId, type, attrs); + } + + //建模方法->建模对象->形状配置->查询形状的配置信息 + @Mapping("com.actionsoft.apps.coe.pal_pl_manage_shape_config_query") + public String coePalPlManageShapeConfigQuery(UserContext me, String wsId, String methodId, String shapeId) { + PalManageWeb web = new PalManageWeb(me); + return web.getCoePalPlManageShapeConfigByShapeId(wsId, methodId, shapeId); + } + + //建模方法->建模对象->形状配置->查询形状的属性树 + @Mapping("com.actionsoft.apps.coe.pal_pl_manage_shape_config_attr_tree_query") + public String coePalPlManageShapeConfigAttrTreeQuery(UserContext me, String wsId, String methodId, String shapeId) { + PalManageWeb web = new PalManageWeb(me); + return web.getCoePalPlManageShapeAttrTreeData(wsId, methodId, shapeId); + } + + //建模方法->建模对象->形状配置->保存形状的配置信息 + @Mapping("com.actionsoft.apps.coe.pal_pl_manage_shape_config_save") + public String coePalPlManageShapeConfigSave(UserContext me, String wsId, String methodId, String shapeId, String data) { + PalManageWeb fileWeb = new PalManageWeb(me); + return fileWeb.saveCoePalPlManageShapeConfig(wsId, methodId, shapeId, data); + } + + // 流程级别首页 + // @Mapping("COE_PAL_PL_RESPOSITORY_PORTAL") + @Mapping("com.actionsoft.apps.coe.pal_pl_repository_portal_page") + public String COEPALPLFilePortal(UserContext me, String ruuid, String wsid, String type) { + CoeProcessLevelWeb fileWeb = new CoeProcessLevelWeb(me); + return fileWeb.getPortalHtml(ruuid, wsid, type); + } + + // 流程级别mark BPN + // @Mapping("COE_PAL_PL_RESPOSITORY_MARK") + @Mapping("com.actionsoft.apps.coe.pal_pl_repository_mark") + public String COEPALPLFileMark(UserContext me, String uuid) { + CoeProcessLevelWeb fileWeb = new CoeProcessLevelWeb(me); + return fileWeb.mark(uuid); + + } + + // 取消流程级别mark BPN + // @Mapping("COE_PAL_PL_RESPOSITORY_RMARK") + @Mapping("com.actionsoft.apps.coe.pal_pl_repository_rmark") + public String COEPALPLFileRMark(UserContext me, String uuid) { + CoeProcessLevelWeb fileWeb = new CoeProcessLevelWeb(me); + return fileWeb.rmark(uuid); + } + + // 取消AWS流程关联 + // @Mapping("COE_PAL_PL_RESPOSITORY_CANCELCORRELATE") + @Mapping("com.actionsoft.apps.coe.pal_pl_repository_cancelcorrelate") + public String COEPALPLCancelCorrelate(UserContext me, String uuid) { + CoeProcessLevelWeb we = new CoeProcessLevelWeb(me); + return we.COEPALPLCancelCorrelate(uuid); + } + + // 分级-版本 + // @Mapping("COE_PAL_PL_RESPOSITORY_VERSION") + @Mapping("com.actionsoft.apps.coe.pal_pl_repository_version") + public String COEPALPLFileVersion(UserContext me, String uuid, String appId, String processVersionId) { + CoeProcessLevelWeb fileWeb = new CoeProcessLevelWeb(me); + return fileWeb.versionHtml(uuid, appId, processVersionId); + } + + // pal关联流程源文件在aws端被删除的处理 + // @Mapping("COE_PAL_PL_RESPOSITORY_CORRELATERESOURCE_CHECK") + @Mapping("com.actionsoft.apps.coe.pal_pl_repository_correlateresource_check") + public String COEPALPLCorrelateresourceCheck(UserContext me, String uuid) { + CoeProcessLevelWeb web = new CoeProcessLevelWeb(me); + return web.correlateResourceCheck(uuid); + } + + // coe设计器页面 + // @Mapping("COE_PAL_PL_RESPOSITORY_DESIGNER") + @Mapping("com.actionsoft.apps.coe.pal_pl_repository_designer") + public String COEPALPLFileDesigner(UserContext me, String uuid, int openType, String teamId, String perms, String filePerms, String openAppType) { + CoeDesignerWeb designerWeb = new CoeDesignerWeb(me); + return designerWeb.getDesignerHtml(uuid, openType, teamId, perms, filePerms, openAppType); + } + + // coe设计器页面-只读 + // @Mapping("COE_PAL_PL_RESPOSITORY_DESIGNER_VIEWER") + @Mapping("com.actionsoft.apps.coe.pal_pl_repository_designer_viewer") + public String COEPALPLFileDesignerViewer(UserContext me, String uuid, int openType, String teamId, String perms, String filePerms, String openAppType, String dockDisplay) { + CoeDesignerWeb designerWeb = new CoeDesignerWeb(me); + return designerWeb.getDesignerHtml(uuid, openType, null, true, teamId, perms, filePerms, openAppType, dockDisplay); + } + + // coe设计器页面-只读(无session) + // @Mapping(value = "COE_PAL_PL_RESPOSITORY_DESIGNER_VIEWER_NOSESSION",session = false, noSessionEvaluate = "无", noSessionReason = "外来人员访问考试") + @Mapping(value = "com.actionsoft.apps.coe.pal_pl_repository_designer_viewer_nosession", session = false, noSessionEvaluate = "无", noSessionReason = "外来人员访问考试") + public String COEPALPLFileDesignerViewer(String uid, String uuid, String processDefId) { + return PALRepositoryQueryAPIManager.getInstance().openDesignerRepositoryViewer(uid, uuid, processDefId); + } + + // coe设计器页面-链接-权限判断 + // @Mapping("COE_PAL_PL_RESPOSITORY_DESIGNER_VIEWER_LINK_PERM") + @Mapping("com.actionsoft.apps.coe.pal_pl_repository_designer_viewer_link_perm") + public String getPalLinkPerm(UserContext me, String uuids, String modelType, String filePerms) { + TeamWorkManagerWeb web = new TeamWorkManagerWeb(me); + return web.getPalLinkPerm(uuids, modelType, filePerms); + } + + // 流程相关发布信息 + // @Mapping("COE_PAL_PL_RESPOSITORY_COMMENTLIST") + @Mapping("com.actionsoft.apps.coe.pal_pl_repository_commentlist") + public String getPALCommentListByRepositoryId(UserContext me, String repositoryId, String openAppType) { + CoeDesignerWeb web = new CoeDesignerWeb(me); + return web.getPALCommentList(repositoryId, openAppType); + } + + // 流程相关发布信息 + // @Mapping("COE_PAL_PL_RESPOSITORY_COMMENT_SAVE") + @Mapping("com.actionsoft.apps.coe.pal_pl_repository_comment_save") + public String savePALComment(UserContext me, String comment, String wsId, String teamId, String repositoryId, String pId, String openAppType) { + CoeDesignerWeb web = new CoeDesignerWeb(me); + return web.savePALComment(comment, wsId, teamId, repositoryId, pId, openAppType); + } + + // coe设计器-打印 + // @Mapping("COE_PAL_PL_RESPOSITORY_DESIGNER_PRINT") + @Mapping("com.actionsoft.apps.coe.pal_pl_repository_designer_print") + public String COEPALPrint(UserContext me, String id) { + CoeDesignerWeb web = new CoeDesignerWeb(me); + return web.toPalRepositoryPrint(id); + } + + // coe设计器页面 + // @Mapping("COE_PAL_PL_RESPOSITORY_DESIGNER_OPEN_SHAPE") + @Mapping("com.actionsoft.apps.coe.pal_pl_repository_designer_open_shape_page") + public String COEPALPLFileDesignerOpen(UserContext me, String uuid, int openType, String shapeId, String perms, String filePerms) { + CoeDesignerWeb designerWeb = new CoeDesignerWeb(me); + return designerWeb.getDesignerHtml(uuid, openType, shapeId, perms, filePerms, "1"); + + } + + // coe设计器 更新文件title + // @Mapping("COE_PAL_PL_RESPOSITORY_DESIGNER_UPDATATITLE") + @Mapping("com.actionsoft.apps.coe.pal_pl_repository_designer_updatetitle") + public String COEPALPLFileDesignerUpdateTitle(UserContext me, RequestParams params) { + CoeProcessLevelWeb we = new CoeProcessLevelWeb(me); + String uuid = params.get("uuid"); + String title = params.get("title", ""); + // 添加到事件列表 + CoeRealtimeWeb realtimeWeb = new CoeRealtimeWeb(me); + Map paramsMap = new HashMap(); + paramsMap.put("uuid", uuid); + paramsMap.put("action", "changeTitle"); + paramsMap.put("clientId", ""); + paramsMap.put("messages", "{\"action\": \"changeTitle\", \"title\": \"" + title + "\", \"clientId\": \"\"}"); + paramsMap.put("title", title); + paramsMap.put("sid", me.getSessionId()); + realtimeWeb.addRealtimeEvents(paramsMap); + return we.updatePLName(uuid, title); + } + + // coe设计器模板 + // @Mapping("COE_PAL_PL_RESPOSITORY_DESIGNER_TEMPLATE") + @Mapping("com.actionsoft.apps.coe.pal_pl_repository_designer_template") + public String COEPALPLFileDesignerTemplate(UserContext me, String uuid) { + CoeDesignerWeb designerWeb = new CoeDesignerWeb(me); + return designerWeb.getDesignerTemplateHtml(uuid); + + } + + // coe设计器消息(保存、修改、删除) + // @Mapping("COE_PAL_PL_RESPOSITORY_DESIGNER_SHAPE") + @Mapping("com.actionsoft.apps.coe.pal_pl_repository_designer_shape") + public String COEPALPLFileDesignerShape(UserContext me, String uuid, String methodId, String categories, String wsId) { + CoeDesignerWeb designerWeb = new CoeDesignerWeb(me); + return designerWeb.getShape(uuid, methodId, categories, wsId); + + } + + // @Mapping("COE_PAL_PL_RESPOSITORY_DESIGNER_MESSAGE") + @Mapping("com.actionsoft.apps.coe.pal_pl_repository_designer_message") + public String COEPALPLFileDesignerMessage(UserContext me, RequestParams params) { + String action = params.get("action"); + String type = params.get("type"); + String uuid = params.get("uuid"); + int ver = params.getInt("ver"); + String messages = params.get("messages"); + String teamId = params.get("teamId"); + String lockUser = params.get("lockUser"); + CoeDesignerWeb designerWeb = new CoeDesignerWeb(me); + if (!action.equals("changeTitle")) { + CoeRealtimeWeb realtimeWeb = new CoeRealtimeWeb(me); + Map paramsMap = new HashMap(); + paramsMap.put("action", action); + paramsMap.put("messages", messages); + paramsMap.put("clientId", params.get("clientId")); + paramsMap.put("uuid", params.get("uuid")); + paramsMap.put("sid", me.getSessionId()); + realtimeWeb.addRealtimeEvents(paramsMap); + DesignerRelationShapeWeb relationShapeWeb = new DesignerRelationShapeWeb(me); + JSONArray jsonArr = JSONArray.parseArray(messages); + DesignerRelationShapeCacheManager event = DesignerRelationShapeCacheManager.getInstance(); + event.setFlag(false); + if (jsonArr.size() == 1) { + JSONObject jsonObj = jsonArr.getJSONObject(0); + if ("update".equals(jsonObj.getString("action"))) { + relationShapeWeb.updateShapesName(jsonObj.getJSONObject("content"), uuid); + relationShapeWeb.updateShapes(jsonObj.getJSONObject("content"), uuid); + } else { + event.setFlag(false); + } + } + for (Object obj : jsonArr) { + JSONObject jsonObj = (JSONObject) obj; + if ("remove".equals(jsonObj.getString("action"))) { + relationShapeWeb.removeShapes(jsonObj.getJSONArray("content"), uuid); + break; + } + if ("create".equals(jsonObj.getString("action"))) { + relationShapeWeb.recoverRemoveShapes(jsonObj.getJSONArray("content")); + relationShapeWeb.updateEventMap(jsonObj.getJSONArray("content"), uuid); + break; + } + + } + } + String msg = ""; + if ("command".equals(action)) { + String str = designerWeb.designerMessage(type, uuid, ver, messages, teamId, lockUser); + msg = str; + } else { + msg = ""; + } + ResponseObject ro = ResponseObject.newOkResponse(msg); + return ro.toString(); + } + + // 根据aws流程ID获取关联到pal资产库的流程ID + // @Mapping("COE_PAL_PL_RESPOSITORY_DESIGNER_PL_ID") + @Mapping("com.actionsoft.apps.coe.pal_pl_repository_designer_pl_id") + public String COEPALPLID(UserContext me, String newDefId) { + CoeDesignerWeb we = new CoeDesignerWeb(me); + return we.getPLIdByAWSId(newDefId); + } + + // coe设计器BPMN保存 + // @Mapping("COE_PAL_PL_RESPOSITORY_DESIGNER_SAVE") + @Mapping("com.actionsoft.apps.coe.pal_pl_repository_designer_save") + public String COEPALPLFileDesignerSave(UserContext me, RequestParams params) { + String appId = params.get("appId", AppsConst.SYS_APP_PLATFORM); + String uuid = params.get("ruuid"); + int ver = params.getInt("ver", 0); + String processDefId = params.get("processDefId", ""); + String op = params.get("op"); + String define = params.get("define"); + String drawMessage = params.get("messages", ""); + CoeDesignerWeb designerWeb = new CoeDesignerWeb(me); + return designerWeb.definitionOfBpmnSave(uuid, ver, appId, processDefId, op, define, drawMessage); + } + + // coe设计器BPMN校验 + // @Mapping("COE_PAL_PL_RESPOSITORY_DESIGNER_BPMN_VALIDATE") + @Mapping("com.actionsoft.apps.coe.pal_pl_repository_designer_bpmn_validate") + public String COEPALPLFileDesignerBPMNValidate(UserContext me, RequestParams params) { + String appId = params.get("appId", AppsConst.SYS_APP_PLATFORM); + String processDefId = params.get("processDefId", ""); + String define = params.get("define"); + CoeDesignerWeb designerWeb = new CoeDesignerWeb(me); + return designerWeb.bpmnValidate(appId, processDefId, define); + } + + // coe设计器历史版本 + // @Mapping("COE_PAL_PL_RESPOSITORY_DESIGNER_HISTORY_VERSION_JSON_DATA") + @Mapping("com.actionsoft.apps.coe.pal_pl_repository_designer_history_version_json_data") + public String COEPALPLFileDesignerHistoryVersionJsonData(UserContext me, RequestParams params) { + String type = params.get("type"); + String appId = params.get("appId", AppsConst.SYS_APP_PLATFORM); + String uuid = params.get("chartId"); + String processDefId = params.get("processDefId", ""); + CoeDesignerWeb designerWeb = new CoeDesignerWeb(me); + return designerWeb.historyVersions(type, appId, uuid, processDefId); + } + + // 流程的select类型属性的option + // @Mapping("COE_PAL_PL_ATTRIBUTE_OPTION") + @Mapping("com.actionsoft.apps.coe.pal_pl_attribute_option") + public String getAttributeSelectOptions(UserContext me, String category) { + CoeDesignerWeb web = new CoeDesignerWeb(me); + return web.getAttributeSelectOptions(category); + } + + // 预览图片 + // @Mapping("COE_PAL_PL_RESPOSITORY_DF") + @Mapping("com.actionsoft.apps.coe.pal_pl_repository_df") + public String COEPALPLRESPOSITORYDF(UserContext me, String uuid) { + CoeDesignerWeb designerWeb = new CoeDesignerWeb(me); + return designerWeb.getPNGUrl(uuid); + } + + // @Mapping("COE_PAL_PL_RESPOSITORY_DOWNLOAD_PNG") + @Mapping("com.actionsoft.apps.coe.pal_pl_repository_download_png") + public String COEPALPLRESPOSITORYDownloadPng(UserContext me, String uuid, String type) { + CoeDesignerWeb designerWeb = new CoeDesignerWeb(me); + return designerWeb.getPNGDownloadUrl(uuid, type); + } + + // coe设计器单个历史版本 + // @Mapping("COE_PAL_PL_RESPOSITORY_DESIGNER_HISTORY_DEFINE_JSON_DATA") + @Mapping("com.actionsoft.apps.coe.pal_pl_repository_designer_history_define_json_data") + public String COEPALPLFileDesignerHistoryDefineJsonData(UserContext me, RequestParams params) { + String type = params.get("type"); + String uuid = params.get("chartId"); + String appId = params.get("appId"); + String processDefId = params.get("processDefId", ""); + int ver = params.getInt("ver"); + CoeDesignerWeb designerWeb = new CoeDesignerWeb(me); + return designerWeb.getDefine(type, appId, uuid, processDefId, ver); + } + + // coe设计器恢复历史版本 + // @Mapping("COE_PAL_PL_RESPOSITORY_DESIGNER_HISTORY_RESTORE_VERSION") + @Mapping("com.actionsoft.apps.coe.pal_pl_repository_designer_history_restore_version") + public String COEPALPLFileDesignerHistoryRestoreVersion(UserContext me, RequestParams params) { + String type = params.get("type"); + String appId = params.get("appId"); + String uuid = params.get("chartId"); + String processDefId = params.get("processDefId"); + int ver = params.getInt("ver"); + CoeDesignerWeb designerWeb = new CoeDesignerWeb(me); + return designerWeb.restoreHistoryVersion(type, appId, uuid, processDefId, ver); + } + + // coe设计器--多人协作,保存修改信息 + // @Mapping("COE_PAL_PL_RESPOSITORY_DESIGNER_ADD_REALTIMEEVENTS") + @Mapping("com.actionsoft.apps.coe.pal_pl_repository_designer_add_realtimeevents") + public String COEPALPLAddRealtimeEvents(UserContext me, RequestParams params) { + CoeRealtimeWeb realtimeWeb = new CoeRealtimeWeb(me); + Map paramsMap = new HashMap(); + paramsMap.put("action", params.get("action")); + paramsMap.put("messages", params.get("messages")); + paramsMap.put("clientId", params.get("clientId")); + paramsMap.put("uuid", params.get("uuid")); + paramsMap.put("sid", me.getSessionId()); + realtimeWeb.addRealtimeEvents(paramsMap); + DesignerRelationShapeWeb relationShapeWeb = new DesignerRelationShapeWeb(me); + JSONArray jsonArr = JSONArray.parseArray(params.get("messages")); + DesignerRelationShapeCacheManager event = DesignerRelationShapeCacheManager.getInstance(); + event.setFlag(false); + if (jsonArr.size() == 1) { + JSONObject jsonObj = jsonArr.getJSONObject(0); + if ("update".equals(jsonObj.getString("action"))) { + relationShapeWeb.updateShapes(jsonObj.getJSONObject("content"), params.get("uuid")); + } else { + event.setFlag(false); + } + } + + for (Object obj : jsonArr) { + JSONObject jsonObj = (JSONObject) obj; + if ("remove".equals(jsonObj.getString("action"))) { + relationShapeWeb.removeShapes(jsonObj.getJSONArray("content"), params.get("uuid")); + break; + } + if ("create".equals(jsonObj.getString("action"))) { + relationShapeWeb.recoverRemoveShapes(jsonObj.getJSONArray("content")); + break; + } + + } + return ResponseObject.newOkResponse().toString(); + } + + // 自定义Schema保存 + // @Mapping("COE_PAL_PL_RESPOSITORY_DESIGNER_SCHEMA_SAVE") + @Mapping("com.actionsoft.apps.coe.pal_pl_repository_designer_schema_save") + public String COEPALPLCustomSchemaSave(UserContext me, String schema, String methodId, String category) { + CoeDesignerWeb web = new CoeDesignerWeb(me); + + return web.saveCOEPALPLCustomSchema(schema, methodId, category); + } + + // 自定义Schema保存 + // @Mapping("COE_PAL_PL_RESPOSITORY_DESIGNER_SCHEMA_REMOVE") + @Mapping("com.actionsoft.apps.coe.pal_pl_repository_designer_schema_remove") + public String COEPALPLCustomSchemaRemove(UserContext me, String schemaName, String methodId) { + CoeDesignerWeb web = new CoeDesignerWeb(me); + return web.removeCOEPALPLCustomSchema(schemaName, methodId); + } + + // 流程资产首页 + // @Mapping("COE_PAL_WS_PORTAL") + @Mapping("com.actionsoft.apps.coe.pal_ws_portal") + public String coePALWSPortal(UserContext me) { + CoeWorkSpaceWeb we = new CoeWorkSpaceWeb(me); + return we.getCoeWorkSpaceHtml(); + } + + // 流程资产数据 + // @Mapping("COE_PAL_WS_DATA") + @Mapping("com.actionsoft.apps.coe.pal_ws_data") + public String coePALWSData(UserContext me, String start, String pageSize) { + CoeWorkSpaceWeb we = new CoeWorkSpaceWeb(me); + return we.getCoeWorkSpaceGridData(); + } + + // 流程资产预览 + // @Mapping("COE_PAL_WS_PREVIEW") + @Mapping("com.actionsoft.apps.coe.pal_ws_preview") + public String coePALWSPREVIEW(UserContext me, String wsId) { + CoeWorkSpaceWeb we = new CoeWorkSpaceWeb(me); + return we.getCoeWorkSpacePreview(wsId); + } + + // 流程资产 添加 + // @Mapping("COE_PAL_WS_CREATE") + @Mapping("com.actionsoft.apps.coe.pal_ws_create") + public String coePALWSCreate(UserContext me, String id) { + CoeWorkSpaceWeb we = new CoeWorkSpaceWeb(me); + return we.createOrUpdateWorkspace(id); + } + + // 流程资产 导入外资产库 + // @Mapping("COE_PAL_WS_IMPORT") + @Mapping("com.actionsoft.apps.coe.pal_ws_import") + public String coePALWSImport(UserContext me) { + CoeWorkSpaceWeb we = new CoeWorkSpaceWeb(me); + return we.importWorkspace(); + } + + // 查询资产库树结构 + // @Mapping("COE_PAL_WS_TREE_DATA_JSON") + @Mapping("com.actionsoft.apps.coe.pal_ws_tree_data_json") + public String getRepositoryTreeData(UserContext me, String wsId, String pid) { + CoeWorkSpaceWeb we = new CoeWorkSpaceWeb(me); + return we.getRepositoryTreeData(wsId, pid); + } + + // 流程资产 查询是否已经存在资产库 + // @Mapping("COE_PAL_WS_IS_EXIST") + @Mapping("com.actionsoft.apps.coe.pal_ws_is_exist") + public String coePALWSIsExist(UserContext me, String wsFileName, String source) { + CoeWorkSpaceWeb we = new CoeWorkSpaceWeb(me); + return we.workspaceIsExist(wsFileName, source); + } + + /** + * 查询服务器中待导入的资产库文件 + * + * @param me + * @return + */ + @Mapping("com.actionsoft.apps.coe.pal_ws_remote_import_query") + public String getPALWSRemoteImportData(UserContext me) { + CoeWorkSpaceWeb web = new CoeWorkSpaceWeb(me); + return web.getPALWSRemoteImportData(); + } + + // 流程资产 保存 + // @Mapping("COE_PAL_WS_SAVE") + @Mapping("com.actionsoft.apps.coe.pal_ws_save") + public String coePALWSSave(UserContext me, String id, String state, String tctype, String orderIndex, String wsOrgType, String wsName, String wsDm, String wsAdmin, String wsDsc, String wsBgUrl) { + CoeWorkSpaceWeb we = new CoeWorkSpaceWeb(me); + return we.saveCoeWorkspace(id, wsName, wsDm, wsAdmin, wsDsc, Integer.parseInt(state), Integer.parseInt(tctype), wsBgUrl, Integer.parseInt(orderIndex), Integer.parseInt(wsOrgType)); + } + + // 流程资产 保存导入的资产库 + // @Mapping("COE_PAL_WS_SAVE_IMPORT") + @Mapping("com.actionsoft.apps.coe.pal_ws_save_import") + public String coePALWSSaveImport(UserContext me, String wsFileName, String replaceChoice, String source) throws Exception { + CoeWorkSpaceWeb we = new CoeWorkSpaceWeb(me); + return we.saveImportCoeWorkspace(wsFileName, replaceChoice, source); + } + + // 流程资产 选择用户 + // @Mapping("COE_PAL_WS_USERLIST") + @Mapping("com.actionsoft.apps.coe.pal_ws_userlist") + public String coePALWSUserList(UserContext me, String users, String removeUserIds) { + CoeWorkSpaceWeb web = new CoeWorkSpaceWeb(me); + return web.toPALWSUserList(users, removeUserIds); + } + + // 停用启用流程资产 + // @Mapping("COE_PAL_WS_STOPOROPEN") + @Mapping("com.actionsoft.apps.coe.pal_ws_stoporopen") + public String coePALWSStopOrOpen(UserContext me, String id, String state) { + CoeWorkSpaceWeb we = new CoeWorkSpaceWeb(me); + return we.stopCoeWorkspace(id, Integer.parseInt(state)); + } + + // 删除流程资产 + // @Mapping("COE_PAL_WS_REMOVE") + @Mapping("com.actionsoft.apps.coe.pal_ws_remove") + public String coePALWSRemove(UserContext me, String id, String versionId) { + CoeWorkSpaceWeb we = new CoeWorkSpaceWeb(me); + return we.removeCoeWorkspace(id, versionId); + } + + // 导出流程资产 + // @Mapping("COE_PAL_WS_EXP") + @Mapping("com.actionsoft.apps.coe.pal_ws_exp") + public String coePALWSExp(UserContext me, String id, String clientType) { + CoeWorkSpaceWeb we = new CoeWorkSpaceWeb(me); + return we.expCoeWorkSpace(id, clientType); + } + + // 导入流程资产 + // @Mapping("COE_PAL_WS_IMP") + @Mapping("com.actionsoft.apps.coe.pal_ws_imp") + public String coePALWSImp(UserContext me, String name) { + CoeWorkSpaceWeb we = new CoeWorkSpaceWeb(me); + return we.impCoeWorkSpace(name); + } + + /** + * 流程版本管理显示页面 + * + * @param versionId + * @return + */ + // @Mapping("COE_PAL_WS_VERSION_MANAGE") + @Mapping("com.actionsoft.apps.coe.pal_ws_version_manage_page") + public String coePALProcessVersion(UserContext me, String versionId, String wsUsedUUID) { + CoeWorkSpaceWeb po = new CoeWorkSpaceWeb(me); + return po.getCoeWorkSpaceVersionHtml(versionId, wsUsedUUID); + } + + // @Mapping("COE_PAL_WS_VERSION_SAVE") + @Mapping("com.actionsoft.apps.coe.pal_ws_version_save") + public String coePALProcessVersion(UserContext me, String wsuuid, String maxVersionNo, String wsVersionId, String wsUsedUUID) { + CoeWorkSpaceWeb po = new CoeWorkSpaceWeb(me); + return po.getCoeWorkSpaceVersionSaveHtml(wsuuid, maxVersionNo, wsVersionId, wsUsedUUID); + } + + // @Mapping("COE_PAL_WS_VERSION_USED") + @Mapping("com.actionsoft.apps.coe.pal_ws_version_used") + public String coePALProcessVersionUsed(UserContext me, String wsUsedUUID, String wsSelectVersionId) { + CoeWorkSpaceWeb po = new CoeWorkSpaceWeb(me); + return po.getCoeWorkSpaceVersionUsedHtml(wsUsedUUID, wsSelectVersionId); + } + + // 版本的删除 + // @Mapping("COE_PAL_WS_VERSION_DEL") + @Mapping("com.actionsoft.apps.coe.pal_ws_version_del") + public String coePALProcessVersionDel(UserContext me, String wsUUID, String versionId) { + CoeWorkSpaceWeb po = new CoeWorkSpaceWeb(me); + return po.getCoeWorkSpaceVersionDel(wsUUID, versionId); + } + + // 流程资产关联BPM + // @Mapping("COE_PAL_PROCESSLEVEL_CORRELATE") + @Mapping("com.actionsoft.apps.coe.pal_processlevel_correlate") + public String coePALWSCorrelate(UserContext me) { + CoeProcessLevelWeb we = new CoeProcessLevelWeb(me); + return we.correlateWorkspace(); + } + + // 获取流程资产关联的初始数据 + // @Mapping("COE_PAL_PROCESSLEVEL_CORRELATE_DATA_JSON") + @Mapping("com.actionsoft.apps.coe.pal_processlevel_correlate_data_json") + public String coePALWSCorrelateData(UserContext me) { + CoeProcessLevelWeb we = new CoeProcessLevelWeb(me); + return we.getCoePALWSCorrelateData(); + } + + // 查询AWS未关联流程树 + // @Mapping("COE_PAL_PROCESSLEVEL_NOCORRELATE_TREE_DATA_JSON") + @Mapping("com.actionsoft.apps.coe.pal_processlevel_nocorrelate_tree_data_json") + public String getAwsNoCorrelateTree(UserContext me, String appId, String pid, String requestType, String param) { + CoeProcessLevelWeb we = new CoeProcessLevelWeb(me); + return we.getAwsCorrelateTree(appId, pid, requestType, param, "noCorrelate"); + } + + // 查询AWS已关联流程树 + // @Mapping("COE_PAL_PROCESSLEVEL_CORRELATED_TREE_DATA_JSON") + @Mapping("com.actionsoft.apps.coe.pal_processlevel_correlated_tree_data_json") + public String getAwsCorrelatedTree(UserContext me, String appId, String pid, String requestType, String param) { + CoeProcessLevelWeb we = new CoeProcessLevelWeb(me); + return we.getAwsCorrelateTree(appId, pid, requestType, param, "correlated"); + } + + // 新建关联时快速搜索 + // @Mapping("COE_PAL_PROCESSLEVEL_CORRELATE_SEARCH") + @Mapping("com.actionsoft.apps.coe.pal_processlevel_correlate_search") + public String getCorrelateSearch(UserContext me, String query, String type, String limit, String currentPage) { + CoeProcessLevelWeb we = new CoeProcessLevelWeb(me); + return we.getCorrelateSearchDataToJson(query, type, Integer.parseInt(limit), Integer.parseInt(currentPage)); + } + + // PAL关联AWS流程保存 + // @Mapping("COE_PAL_PROCESSLEVEL_CORRELATE_CREATE_SAVE") + @Mapping("com.actionsoft.apps.coe.pal_processlevel_correlate_create_save") + public String coePALProcessLevelCorrelateCreateSave(UserContext me, String wsId, String currentCorrelation) { + CoeProcessLevelWeb we = new CoeProcessLevelWeb(me); + return we.coePALProcessLevelCorrelateCreateSave(wsId, currentCorrelation); + } + + // 跳转到流程分级首页 + // @Mapping("COE_PAL_PROCESSLEVEL_PORTAL") + // @Mapping("com.actionsoft.apps.coe.pal_processlevel_portal_page") + // public String coePALProcessLevelPortal(UserContext me, String wsId, + // String type) { + // CoeProcessLevelWeb we = new CoeProcessLevelWeb(me); + // return we.getCoeProcessLevelHtml(wsId, type); + // } + + // 跳转到流程分级tree + // @Mapping("COE_PAL_PROCESSLEVEL_TREE") + @Mapping("com.actionsoft.apps.coe.pal_processlevel_tree") + public String coePALProcessLevelTree(UserContext me, String wsId) { + CoeProcessLevelWeb we = new CoeProcessLevelWeb(me); + return we.getCoeProcessLevelTree(wsId); + } + + // 流程分级 新建级次 + // @Mapping("COE_PAL_PROCESSLEVEL_CREAT") + @Mapping("com.actionsoft.apps.coe.pal_processlevel_create") + public String coePALProcessLevelCreat(UserContext me, String wsid, String pid, String id, String type, String editable) { + CoeProcessLevelWeb we = new CoeProcessLevelWeb(me); + return we.createOrUpdateCoeProcessLevel(wsid, pid, id, type, editable); + } + + // 流程分级 新建级次ajax数据 + // @Mapping("COE_PAL_PROCESSLEVEL_CREATE_AJAX") + @Mapping("com.actionsoft.apps.coe.pal_processlevel_create_ajax") + public String coePALProcessLevelCreateAjax(UserContext me, String wsid, String pid, String id, String type) { + CoeProcessLevelWeb we = new CoeProcessLevelWeb(me); + return we.coePALProcessLevelCreateAjax(wsid, pid, id, type); + } + + // 复制库文件 + // @Mapping("COE_PAL_PROCESSLEVEL_COPE") + @Mapping("com.actionsoft.apps.coe.pal_processlevel_copy") + public String coePALPROCESSLEVELCOPE(UserContext me, String sourceUUID, String targetUUID, String copyType) { + CoeProcessLevelWeb we = new CoeProcessLevelWeb(me); + return we.copyFile(PALRepositoryCache.getCache().get(sourceUUID).getWsId(), null, sourceUUID, targetUUID, copyType); + } + + // 根据空间类型得到树json + // @Mapping("COE_PAL_PROCESSLEVEL_TREEJSON") + @Mapping("com.actionsoft.apps.coe.pal_processlevel_treejson") + public String coePALProcessLevelTreeJson(UserContext me, String wsid, String pid) { + CoeProcessLevelWeb we = new CoeProcessLevelWeb(me); + return we.getTreeJson(wsid, pid); + } + + // 上传附件-protal页面 + // @Mapping("COE_PAL_PROCESSLEVEL_UPFILE_PORTAL") + @Deprecated + @Mapping("com.actionsoft.apps.coe.pal_processlevel_upfile_portal_page") + public String coePALProcessLevelUPFILEPORTAL(UserContext me, RequestParams params) { + String pl_uuid = params.get("pl_uuid"); + String shape_uuid = params.get("shape_uuid"); + String type = params.get("type"); + UpfileWeb web = new UpfileWeb(me); + return web.upFilePortalHtml(pl_uuid, shape_uuid, type); + } + + + /** + * 获取流程属性信息填充绩效模型 + * + * @param me + * @param params + * @return + */ + @Mapping("com.actionsoft.apps.coe.pal_processlevel_getPerformance") + public String processlevelGetPerformance(UserContext me, RequestParams params) { + String uuid = params.get("fileId"); + String methodId = params.get("methodId"); + UpfileWeb web = new UpfileWeb(me); + return web.processlevelGetPerformance(uuid, me, methodId); + } + + + // 上传附件-load + // @Mapping("COE_PAL_PROCESSLEVEL_UPFILE_LOAD") + @Mapping("com.actionsoft.apps.coe.pal_processlevel_upfile_load") + public String coePALProcessLevelUPFILELOAD(UserContext me, RequestParams params) { + String pl_uuid = params.get("pl_uuid"); + String shape_uuid = params.get("shape_uuid"); + String type = params.get("type"); + String uuids = params.get("uuids"); + String wsId = params.get("wsId"); + String teamId = params.get("teamId"); + UpfileWeb web = new UpfileWeb(me); + return web.loadUpFiles(pl_uuid, shape_uuid, type, uuids, wsId, teamId); + } + + /** + * 三员管理下加载用户权限下所有密级文件,包含未标密 + * + * @param me + * @param params + * @return + */ + @Mapping("com.actionsoft.apps.coe.pal_processlevel_upfile_load_all") + public String coePALProcessLevelUPFILELOADALL(UserContext me, RequestParams params) { + String pl_uuid = params.get("pl_uuid"); + String shape_uuid = params.get("shape_uuid"); + String type = params.get("type"); + String uuids = params.get("uuids"); + String wsId = params.get("wsId"); + String teamId = params.get("teamId"); + UpfileWeb web = new UpfileWeb(me); + return web.loadUpFilesAll(pl_uuid, shape_uuid, type, uuids, wsId, teamId); + } + + /** + * 更新附件密级 + * + * @param me + * @param uuid + * @param securityLevel + * @return + */ + @Mapping("com.actionsoft.apps.coe.pal_processlevel_upfile_security_level_update") + public String coePALProcessLevelUPFILESecurityLevelUpdate(UserContext me, String uuid, String securityLevel) { + UpfileWeb web = new UpfileWeb(me); + return web.updateUpFileSecurityLevel(uuid, securityLevel); + } + + /** + * 获取流程树中第一个附件未标密文件在树中路径 + * + * @return + */ + @Mapping("com.actionsoft.apps.coe.pal_processlevel_upfile_unmark_path") + public String coePALProcessLevelUPFILEUnmarkPathGet(UserContext me, String wsId, String teamId) { + + return PALRepositoryQueryAPIManager.getInstance().getUnmarkPath(me, wsId, teamId); + } + + // 上传附件-load + // @Mapping("COE_PAL_PROCESSLEVEL_RELATION_UPFILE_LOAD") + @Mapping("com.actionsoft.apps.coe.pal_processlevel_relation_upfile_load") + public String coePALProcessLevelRelationUPFILELOAD(UserContext me, RequestParams params) { + String pl_uuid = params.get("pl_uuid"); + String shape_uuid = params.get("shape_uuid"); + String type = params.get("type"); + UpfileWeb web = new UpfileWeb(me); + return web.loadRelationUpfiles(pl_uuid, shape_uuid, type); + } + + // 上传附件-add file + // @Mapping("COE_PAL_PROCESSLEVEL_UPFILE_ADD") + @Mapping("com.actionsoft.apps.coe.pal_processlevel_upfile_add") + public String coePALProcessLevelUPFILEADD(UserContext me, RequestParams params) { + String pl_uuid = params.get("pl_uuid"); + String shape_uuid = params.get("shape_uuid"); + String type = params.get("type"); + String download = params.get("download"); + String fileName = params.get("fileName"); + String securityLevel = params.get("securityLevel"); + UpfileWeb web = new UpfileWeb(me); + return web.addUpFile(pl_uuid, shape_uuid, type, download, fileName, securityLevel); + } + + // 上传附件2(设计器内部批量上传改版)-add file + @Mapping("com.actionsoft.apps.coe.pal_processlevel_upfile_add2") + public String coePALProcessLevelUPFILEADD2(UserContext me, RequestParams params) { + String pl_uuid = params.get("pl_uuid"); + String shape_uuid = params.get("shape_uuid"); + String type = params.get("type"); + String download = params.get("download"); + String files = params.get("files"); + return new UpfileWeb(me).addUpFile2(pl_uuid, shape_uuid, type, download, files); + } + + // 附件-删除附件 + // @Mapping("COE_PAL_PROCESSLEVEL_UPFILE_DEL") + @Mapping("com.actionsoft.apps.coe.pal_processlevel_upfile_del") + public String coePALProcessLevelUPFILEDEL(UserContext me, RequestParams params) { + String uuid = params.get("uuid"); + UpfileWeb web = new UpfileWeb(me); + return web.delete(uuid); + } + + // 附件-在线预览 + // @Mapping("COE_PAL_PROCESSLEVEL_UPFILE_READ") + @Mapping("com.actionsoft.apps.coe.pal_processlevel_upfile_read") + public String coePALProcessLevelUPFILERead(UserContext me, RequestParams params) { + UpfileWeb web = new UpfileWeb(me); + String uuid = params.get("uuid"); + return web.readFile(uuid); + } + + + /** + * 相关文件/支持文件附件下载 + * + * @param me + * @param params + * @return + */ + @Mapping("com.actionsoft.apps.coe.pal_outputreport_output_downloadZipfile") + public String COEPALOUTPUTREPORTOutputProcessDownloadZipFILE(UserContext me, RequestParams params, String methodId) throws Exception { + UpfileWeb web = new UpfileWeb(me); + String splitId = params.get("splitId"); + String toolbarname = params.get("toolbarname"); + String taskId = params.get("taskIdParams"); + return web.readZipFileDownLoad(splitId, toolbarname, taskId, methodId); + } + + + /** + * 流程手册单个下载 + * + * @param me + * @param params + * @return + * @throws Exception + */ + @Mapping("com.actionsoft.apps.coe.pal_outputreport_output_single_file_downLoad") + public String coePALProcessSingleFileDownload(UserContext me, RequestParams params) throws Exception { + UpfileWeb web = new UpfileWeb(me); + String fileId = params.get("fileId"); + return web.coePALProcessSingleFileDownload(fileId); + } + + @Mapping("com.actionsoft.apps.coe.pal_outputreport_output_query_manual_logdata") + public String coePALProcessManualLogData(UserContext me, RequestParams params) throws Exception { + UpfileWeb web = new UpfileWeb(me); + String ruuid = params.get("ruuid"); + return web.coePALProcessManualLogData(ruuid); + } + + + // 文件属性的单个 值 修改 + // @Mapping("COE_PAL_PROCESSLEVEL_MORE_ATTR_CONTENT_SAVE") + @Mapping("com.actionsoft.apps.coe.pal_processlevel_more_attr_content_save") + public String coePALProcessLevelMoreAttrContentSave(UserContext me, String uuid, String josnKey, String josnContent) { + CoeProcessLevelWeb we = new CoeProcessLevelWeb(me); + return we.moreAttrContentSave(uuid, josnKey, josnContent); + } + + // 文件属性的固定属性 值 修改 + @Mapping("com.actionsoft.apps.coe.pal_processlevel_default_attr_content_save") + public String coePALProcessLevelDefaultAttrContentSave(UserContext me, String uuid, String josnKey, String josnContent) { + CoeProcessLevelWeb we = new CoeProcessLevelWeb(me); + return we.defaultAttrContentSave(uuid, josnKey, josnContent); + } + + // 删除该节点下及其子节点的所有数据 + // @Mapping("COE_PAL_PROCESSLEVEL_TREEREMOVE") + @Mapping("com.actionsoft.apps.coe.pal_processlevel_tree_remove") + public String coePALProcessLevelTreeRemove(UserContext me, String wsid, String pid) { + CoeProcessLevelWeb we = new CoeProcessLevelWeb(me); + return we.removeTreeNode(pid, wsid); + } + + // 获取该节点下是否有子节点 + // @Mapping("COE_PAL_PROCESSLEVEL_ISTREECHILDREN") + @Mapping("com.actionsoft.apps.coe.pal_processlevel_istreechildren") + public String coePALProcessLevelIsTreeChildren(UserContext me, String wsid, String pid) { + CoeProcessLevelWeb we = new CoeProcessLevelWeb(me); + return we.getChildrenStr(pid, wsid); + } + + // 同级设置orderindex + // @Mapping("COE_PAL_PROCESSLEVEL_SETPLORDERINDEX") + @Mapping("com.actionsoft.apps.coe.pal_processlevel_setploaderindex") + public String coePALProcessLevelSetPlOrderIndex(UserContext me, String orderIndexs) { + CoeProcessLevelWeb we = new CoeProcessLevelWeb(me); + return we.setPlOrderIndex(orderIndexs); + } + + // 跨级设置pid + // @Mapping("COE_PAL_PROCESSLEVEL_SETPLPID") + @Mapping("com.actionsoft.apps.coe.pal_processlevel_setplid") + public String coePALProcessLevelSetPlPid(UserContext me, String pids) { + CoeProcessLevelWeb we = new CoeProcessLevelWeb(me); + return we.setPlPids(pids); + } + + // 拖拽修改pal的pid或orderIndex + // @Mapping("COE_PAL_UPDATE_INDEX_OR_PID") + @Mapping("com.actionsoft.apps.coe.pal_update_index_or_pid") + public String updatePalIndexOrPid(UserContext me, String sourceId, String targetId, String type, String position) { + CoeProcessLevelWeb we = new CoeProcessLevelWeb(me); + return we.updatePalIndexOrPid(sourceId, targetId, type, position); + } + + // 流程分级统计 + // @Mapping("COE_PL_COUNT") + @Mapping("com.actionsoft.apps.coe.pal_pl_count") + public String coePLCount(UserContext me, String wsId, String condition) { + CoeProcessLevelWeb web = new CoeProcessLevelWeb(me); + return web.getPLStatistics(wsId, condition); + } + + // 跳转到流程清单首页 + // @Mapping("COE_PAL_PROCESSLEVEL_LIST_PORTAL") + @Mapping("com.actionsoft.apps.coe.pal_processlevel_list_portal_page") + public String coePALProcessLevelListPortal(UserContext me, String wsId, String condition) { + CoeProcessListWeb we = new CoeProcessListWeb(me); + return we.getCoeProcessListHtml(wsId, condition); + } + + // 跳转到流程清单Datagrid + // @Mapping("COE_PAL_PROCESSLEVEL_GRIDDATA") + @Mapping("com.actionsoft.apps.coe.pal_processlevel_griddata") + public String coePALProcessLevelGridData(UserContext me, String start, String pageSize, String wsId, String conditions) { + CoeProcessListWeb we = new CoeProcessListWeb(me); + if (wsId.equals("")) { + wsId = "0"; + } + return we.getCoeProcessListGridData(Integer.parseInt(start), Integer.parseInt(pageSize), wsId, conditions); + } + + // 设置流程图 + // @Mapping("COE_PAL_PROCESSLEVEL_FLOWCHART") + @Mapping("com.actionsoft.apps.coe.pal_processlevel_flowchart_page") + public String coePALProcessLevelFlowChart(UserContext me, String id, String type) { + CoeProcessListWeb we = new CoeProcessListWeb(me); + return we.flowChartHtml(id, type); + } + + // 保存流程图 + // @Mapping("COE_PAL_PROCESSLEVEL_SAVEFLOWCHART") + @Mapping("com.actionsoft.apps.coe.pal_processlevel_flowchart_save") + public String coePALProcessLevelSaveFlowChart(UserContext me, String id, String plDiagramUrl) { + CoeProcessListWeb we = new CoeProcessListWeb(me); + return we.saveflowChart(id, plDiagramUrl); + } + + // 标记颜色 + // @Mapping("COE_PAL_PROCESSLEVEL_SIGN") + @Mapping("com.actionsoft.apps.coe.pal_processlevel_sign") + public String coePALProcessLevelSign(UserContext me, String id) { + CoeProcessListWeb we = new CoeProcessListWeb(me); + return we.signColorHtml(id); + } + + // 保存标记颜色 + // @Mapping("COE_PAL_PROCESSLEVEL_SAVESIGN") + @Mapping("com.actionsoft.apps.coe.pal_processlevel_sign_save") + public String coePALProcessLevelSaveSign(UserContext me, String id, String plColor) { + CoeProcessListWeb we = new CoeProcessListWeb(me); + return we.saveSignColor(id, plColor); + } + + // 向上 + // @Mapping("COE_PAL_PROCESSLEVEL_UP") + @Mapping("com.actionsoft.apps.coe.pal_processlevel_up") + public String coePALProcessLevelUp(UserContext me, String id, String orderIndex, String upId, String upOrderIndex) { + CoeProcessListWeb we = new CoeProcessListWeb(me); + return we.uP(id, Integer.parseInt(orderIndex), upId, Integer.parseInt(upOrderIndex)); + } + + // 导出excel + // @Mapping("COE_PAL_PROCESSLEVEL_EXPEXCEL") + @Mapping("com.actionsoft.apps.coe.pal_processlevel_expexcel") + public String coePALProcessLevelExpExcel(UserContext me, String wsId, String conditions) { + CoeProcessListWeb we = new CoeProcessListWeb(me); + return we.expExcel(wsId, conditions); + } + + // 新版新建 + // @Mapping("COE_PAL_PROCESSLEVEL_CREATE_V2") + @Mapping("com.actionsoft.apps.coe.pal_processlevel_create_v2") + public String coePALProcessLevelCreateV2(UserContext me, String wsid, String id) { + CoeProcessLevelWeb we = new CoeProcessLevelWeb(me); + return we.createProcessLevel(wsid, id); + } + + // 新版新建-模板内容 + // @Mapping("COE_PAL_PROCESSLEVEL_CREATE_TEMPLATE") + @Mapping("com.actionsoft.apps.coe.pal_processlevel_create_template") + public String coePALProcessLevelCreateTemplate(UserContext me, String methodId) { + CoeProcessLevelWeb we = new CoeProcessLevelWeb(me); + return we.getTemplateByMethodId(methodId); + } + + // 资产库 模糊搜索 + // @Mapping("COE_PAL_PROCESSLEVEL_QUERY") + @Deprecated + @Mapping("com.actionsoft.apps.coe.pal_processlevel_query") + public String coePALPROCESSLEVELQUERY(UserContext me, String autoContent, String wsid) { + CoeProcessLevelWeb we = new CoeProcessLevelWeb(me); + return we.getPLInfoByName(autoContent, wsid); + } + + // 资产库模型查询 + @Mapping("com.actionsoft.apps.coe.pal_processlevel_basic_query") + public String coePalProcessLevelBasicQuery(UserContext me, String wsId, String teamId, String name, String timeStamp) { + CoeProcessLevelWeb web = new CoeProcessLevelWeb(me); + return web.basicQueryCoeProcessLevelByName(wsId, teamId, name, timeStamp); + } + + // 资产库模糊查询-高级查询-查询主信息 + @Mapping("com.actionsoft.apps.coe.pal_processlevel_condition_main_query") + public String coePalProcessLevelConditionMainQuery(UserContext me, String wsId, String teamId) { + CoeProcessLevelWeb web = new CoeProcessLevelWeb(me); + return web.conditionQueryCoeProcessLevelMainData(wsId, teamId); + } + + // 资产库模糊查询-高级查询-查询符合的数据 + @Mapping("com.actionsoft.apps.coe.pal_processlevel_condition_data_query") + public String coePalProcessLevelConditionDataQuery(UserContext me, String wsId, String teamId, String type, String method, String createUser, String updateDate, String key, String timeStamp) { + CoeProcessLevelWeb web = new CoeProcessLevelWeb(me); + return web.conditionQueryCoeProcessLevelData(wsId, teamId, type, method, createUser, updateDate, key, timeStamp); + } + + // 资产库 模糊搜索 检查是否存在库文件 + // @Mapping("COE_PAL_PROCESSLEVEL_QUERY_CHECK") + @Deprecated + @Mapping("com.actionsoft.apps.coe.pal_processlevel_query_check") + public String coePALPROCESSLEVELQUERYCHECK(UserContext me, String uuid) { + PALRepositoryModel coeProcessLevelModel = CoeProcessLevelDaoFacotory.createCoeProcessLevel().getInstance(uuid); + return coeProcessLevelModel != null ? uuid : ""; + } + + // @Mapping("COE_PAL_PL_RESPOSITORY_DESIGNER_LINK_TREE") + @Mapping("com.actionsoft.apps.coe.pal_pl_repository_designer_link_tree") + public String COEPALPLFileDesignerLinkTree(UserContext me, String wsid, String teamId, String palId) { + CoeDesignerWeb designerWeb = new CoeDesignerWeb(me); + return designerWeb.getDesignerLinkTree(wsid, teamId, palId); + } + + // 自定义文件链接文件的搜索功能 + // @Mapping("COE_PAL_PL_RESPOSITORY_DESIGNER_LINK_TREE_SEARCH") + @Mapping("com.actionsoft.apps.coe.pal_pl_repository_designer_link_tree_search") + public String COEPALPLFileDesignerLinkTreeSearchByName(UserContext me, String seachName, String wsid) { + CoeDesignerWeb designerWeb = new CoeDesignerWeb(me); + return designerWeb.getDesignerLinkTreeSearchByName(seachName, wsid); + } + + // @Mapping("COE_PAL_PL_USING_PL_ID") + @Mapping("com.actionsoft.apps.coe.pal_pl_using_plid_query") + public String COEPALPLUsingPlId(UserContext me, String uuid) { + CoeProcessLevelWeb coeProcessLevelWeb = new CoeProcessLevelWeb(me); + return coeProcessLevelWeb.getUsingPlId(uuid); + } + + // 多人协作监听 + // @Mapping("COE_PAL_PL_RESPOSITORY_DESIGNER_REALTIME_LISTEN") + @Mapping("com.actionsoft.apps.coe.pal_pl_repository_designer_realtime_listen") + public String COEPALPLRespositoryDesignerRealtimeListen(UserContext me, String clientId, String userId, String name, String subject, String listenTime) { + CoeRealtimeWeb coeRealtimeWeb = new CoeRealtimeWeb(me); + return coeRealtimeWeb.listen(clientId, userId, name, subject, listenTime); + } + + // 复制操作时缓存数据 + // @Mapping("COE_PAL_PL_RESPOSITORY_DESIGNER_RELATION_SHAPE_COPY") + @Mapping("com.actionsoft.apps.coe.pal_pl_repository_designer_relation_shape_copy") + public String COEPALPLRespositoryDesignerRelationShapeCopy(UserContext me, RequestParams params) { + DesignerRelationShapeWeb relationShapeWeb = new DesignerRelationShapeWeb(me); + String userId = params.get("userId"); + String clientId = params.get("clientId"); + String type = params.get("type"); + String subject = params.get("subject"); + String ver = params.get("ver"); + String shapeId = params.get("shapeId"); + String messageJson = params.get("messageJson"); + String shapeGroupId = params.get("shapeGroupId"); + return relationShapeWeb.respositoryDesignerRelationShapeCopy(userId, clientId, subject, type, ver, shapeId, messageJson, shapeGroupId); + } + + // 粘贴时从缓存中获取数据 + // @Mapping("COE_PAL_PL_RESPOSITORY_DESIGNER_RELATION_SHAPE_PASTE_AJAX") + @Mapping("com.actionsoft.apps.coe.pal_pl_repository_designer_relation_shape_paste_ajax") + public String COEPALPLRespositoryDesignerRelationShapePasteAjax(UserContext me, String userId, String clientId, String subject, String action, String type, String ver) { + DesignerRelationShapeWeb relationShapeWeb = new DesignerRelationShapeWeb(me); + return relationShapeWeb.respositoryDesignerRelationShapePasteAjax(userId, clientId, subject, action, type, ver); + } + + // @Mapping("COE_PAL_PL_RESPOSITORY_DESIGNER_REALTIME_LEAVE") + @Mapping("com.actionsoft.apps.coe.pal_pl_repository_designer_realtime_leave") + public String COEPALPLRespositoryDesignerRealtimeLeave(UserContext me, String userId, String uuid) { + CoeRealtimeWeb coeRealtimeWeb = new CoeRealtimeWeb(me); + Map params = new HashMap(); + params.put("action", "leave"); + params.put("uuid", uuid); + params.put("sid", me.getSessionId()); + params.put("userId", userId); + params.put("messages", "{\"action\": \"leave\", \"userId\": \"" + userId + "\", \"name\":\"" + me.getUserName() + "\"}"); + coeRealtimeWeb.addRealtimeEvents(params); + //return ""; + CoeDesignerWeb web = new CoeDesignerWeb(me);//释放用户锁 + return web.releaseCheckoutRight(uuid); + } + + // 复制操作时缓存数据 + // @Mapping("COE_PAL_PL_RESPOSITORY_DESIGNER_RELATION_SHAPE_PASTE") + @Mapping("com.actionsoft.apps.coe.pal_pl_repository_designer_relation_shape_paste") + public String COEPALPLRespositoryDesignerRelationShapePaste(UserContext me, RequestParams params) { + DesignerRelationShapeWeb relationShapeWeb = new DesignerRelationShapeWeb(me); + String subject = params.get("subject"); + String messageJson = params.get("messageJson"); + return relationShapeWeb.pasteToDatabse(subject, messageJson); + } /*// 出现复制监听 @Mapping("COE_PAL_PL_RESPOSITORY_DESIGNER_RELATION_LISTEN") @@ -1504,7 +1526,7 @@ public class CoEPALController { DesignerRelationShapeWeb relationShapeWeb = new DesignerRelationShapeWeb(me); return relationShapeWeb.listen(clientId, userId, name, subject, listenTime); } - + // 出现复制统计 @Mapping("COE_PAL_PL_RESPOSITORY_DESIGNER_RELATION_SHAPE_COUNT") @Mapping("com.actionsoft.apps.coe.pal_pl_repository_designer_relation_shape_count") @@ -1513,2076 +1535,2151 @@ public class CoEPALController { return relationShapeWeb.designerRelationShapeCount(shapeGroupId, shapeId, isCopy); }*/ - // 形状关联 - // @Mapping("COE_PAL_PL_RESPOSITORY_DESIGNER_SHAPES_TREE") - @Mapping("com.actionsoft.apps.coe.pal_pl_repository_designer_shapes_tree") - public String COEPALPLRespositoryDesignerRelevanceShapesTree(UserContext me, String wsId, String modelId, String ref, String shapeId, String attrId, String relationShapeIds, String relationFileIds, String teamId, String ruuid) { - DesignerRelationShapeWeb relationShapeWeb = new DesignerRelationShapeWeb(me); - return relationShapeWeb.designerRelevanceShapes(wsId, modelId, ref, shapeId, attrId, relationShapeIds, relationFileIds, teamId, ruuid); - } - - // @Mapping("COE_PAL_PL_RESPOSITORY_DESIGNER_SHAPES_TREE_NODE") - @Mapping("com.actionsoft.apps.coe.pal_pl_repository_designer_shapes_tree_node") - public String COEPALRepositoryDesignerRelevanceShapesTreeDate(UserContext me, String wsId, String pid,String attrId,String ruuid,String teamId) { - DesignerRelationShapeWeb web = new DesignerRelationShapeWeb(me); - return web.getTreeJson(wsId, pid,attrId,ruuid,teamId); - } - -// @Mapping("COE_PAL_PL_RESPOSITORY_DESIGNER_PROCESS_MODELS_TREE_NODE") - @Mapping("com.actionsoft.apps.coe.pal_pl_repository_designer_process_models_tree_node") - public String COEPALRepositoryDesignerRelevanceProcessModelsTreeDate(UserContext me, String wsId, String pid, String methodScope,String attrId,String ruuid,String teamId) { - DesignerRelationShapeWeb web = new DesignerRelationShapeWeb(me); - return web.getProcessModelsTreeJson(wsId, pid, methodScope,attrId,ruuid,teamId); - } - - /** - * 数据属性模型的快速搜索 - * @param me - * @param wsId - * @param category - * @return - */ - // @Mapping("COE_PAL_PL_RESPOSITORY_DESIGNER_SHAPES_TREE_QUERY") - @Mapping("com.actionsoft.apps.coe.pal_pl_repository_designer_shapes_tree_query") - public String COEPALRespositoryDesignerRelevanceShapesTreeQuery(UserContext me, String wsId, String category, String autoContent) { - DesignerRelationShapeWeb web = new DesignerRelationShapeWeb(me); - return web.getShapesTreeDataJson(wsId, category, autoContent); - } - - // 形状关联 - // @Mapping("COE_PAL_PL_RESPOSITORY_DESIGNER_SHAPES_INFO") - @Mapping("com.actionsoft.apps.coe.pal_pl_repository_designer_shapes_info") - public String COEPALPLRespositoryDesignerRelevanceShapesInfo(UserContext me, String uuid, String shapeId, String attrId) { - DesignerRelationShapeWeb relationShapeWeb = new DesignerRelationShapeWeb(me); - return relationShapeWeb.designerRelevanceShapesInfo(uuid, shapeId, attrId); - } - - // 流程模型关联 - // @Mapping("COE_PAL_PL_RESPOSITORY_DESIGNER_PROCESS_MODELS_INFO") - @Mapping("com.actionsoft.apps.coe.pal_pl_repository_designer_process_models_info") - public String COEPALPLRespositoryDesignerRelevanceProcessModelsInfo(UserContext me, String uuid, String wsId) { - DesignerRelationShapeWeb relationShapeWeb = new DesignerRelationShapeWeb(me); - return relationShapeWeb.designerRelevanceProcessModelsInfo(uuid, wsId); - } - - // 自定义复制操作时缓存数据 - // @Mapping("COE_PAL_PL_RESPOSITORY_DESIGNER_RELATION_SHAPE_CUSTOM_COPY") - @Mapping("com.actionsoft.apps.coe.pal_pl_repository_designer_relation_shape_custom_copy") - public String COEPALPLRespositoryDesignerRelationShapeCuntomCopy(UserContext me, RequestParams params) { - DesignerRelationShapeWeb relationShapeWeb = new DesignerRelationShapeWeb(me); - String userId = params.get("userId"); - String clientId = params.get("clientId"); - String type = params.get("type"); - String subject = params.get("subject"); - String ver = params.get("ver"); - String shapeId = params.get("shapeId"); - String messageJson = params.get("messageJson"); - String shapeGroupId = params.get("shapeGroupId"); - return relationShapeWeb.respositoryDesignerRelationShapeCustomCopy(userId, clientId, subject, type, ver, shapeId, messageJson, shapeGroupId); - } - - // 自定义复制 - // @Mapping("COE_PAL_PL_RESPOSITORY_DESIGNER_RELATION_SHAPE_CUSTOM_PASTE_AJAX") - @Mapping("com.actionsoft.apps.coe.pal_pl_repository_designer_relation_shape_custom_paste_ajax") - public String COEPALPLRespositoryDesignerRelationShapeCustomPasteAjax(UserContext me, String userId, String clientId, String subject, String action, String type, String ver) { - DesignerRelationShapeWeb relationShapeWeb = new DesignerRelationShapeWeb(me); - return relationShapeWeb.respositoryDesignerRelationShapeCustomPasteAjax(userId, clientId, subject, action, type, ver); - } - - // @Mapping("COE_PAL_PL_REPOSITORY_CUSTOM_PASTE_SHAPE_RELATION_SAVE") - @Mapping("com.actionsoft.apps.coe.pal_pl_repository_custom_paste_shape_relation_save") - public String COEPALPLRepositoryCustomPasteShapeRelationSave(UserContext me, String shapeMap, String relationShape, String pasteRelation) { - DesignerRelationShapeWeb web = new DesignerRelationShapeWeb(me); - return web.pasteRelationSave(shapeMap, relationShape, pasteRelation); - } - - /** - * 图形粘贴对附件的粘贴 - * @param me - * @param shapeMap - * @return - */ - // @Mapping("COE_PAL_PL_REPOSITORY_CUSTOM_PASTE_SHAPE_FILE_SAVE") - @Mapping("com.actionsoft.apps.coe.pal_pl_repository_custom_paste_shape_file_save") - public String COEPALPLRepositoryCustomPasteShapeFileSave(UserContext me, String shapeMap) { - UpfileWeb web = new UpfileWeb(me); - return web.pasteShapeFile(shapeMap, me.getUID()); - } - - // 使用什么样的副本进行粘贴 - // @Mapping("COE_PAL_PL_RESPOSITORY_DESIGNER_RELATION_SHAPE_USED_PASTE") - @Mapping("com.actionsoft.apps.coe.pal_pl_repository_designer_relation_shape_used_paste") - public String COEPALPLRespositoryDesignerRelationShapeUsedPaste(UserContext me, String userId) { - DesignerRelationShapeWeb relationShapeWeb = new DesignerRelationShapeWeb(me); - return relationShapeWeb.respositoryDesignerRelationShapeUsed(userId) + ""; - } - - // 形状关联信息的存储 - // @Mapping("COE_PAL_PL_RESPOSITORY_DESIGNER_RELATION_SHAPE_RELEVANCE_SAVE") - @Mapping("com.actionsoft.apps.coe.pal_pl_repository_designer_relation_shape_relevance_save") - public String COEPALPLRespositoryDesignerRelationShapeRelevanceSave(UserContext me, RequestParams params) { - DesignerRelationShapeWeb relationShapeWeb = new DesignerRelationShapeWeb(me); - String relationShapes = params.get("relationShapes"); - String shapeId = params.get("shapeId"); - String fileUUID = params.get("fileUUID"); - String shapeGroupId = params.get("shapeGroupId"); - String attrId = params.get("attrId"); - String ref = params.get("ref"); - return relationShapeWeb.respositoryDesignerRelationShapeRelevanceSave(relationShapes, shapeId, fileUUID, shapeGroupId, attrId, ref); - } - - // 关联形状的展示 - // @Mapping("COE_PAL_PL_RESPOSITORY_DESIGNER_RELATION_SHAPE_RELEVANCE_SHOW") - @Mapping("com.actionsoft.apps.coe.pal_pl_repository_designer_relation_shape_relevance_show") - public String COEPALPLRespositoryDesignerRelationShapeRelevanceShow(UserContext me, RequestParams params) { - DesignerRelationShapeWeb relationShapeWeb = new DesignerRelationShapeWeb(me); - String shapeId = params.get("shapeId"); - String fileId = params.get("fileId"); - return relationShapeWeb.respositoryDesignerRelationShapeRelevanceShow(shapeId, fileId); - } - - // 图形更多属性中,如果删除了一些属性,需要修改关联表中的关联 - // @Mapping("COE_PAL_PL_RESPOSITORY_DESIGNER_RELATION_SHAPE_RELEVANCE_CHECK") - @Mapping("com.actionsoft.apps.coe.pal_pl_repository_designer_relation_shape_relevance_check") - public String COEPALPLRepositoryDesignerRelationShapeRelevanceCheck(UserContext me, String fileId, String shapeId, String attrIds) { - DesignerRelationShapeWeb relationShapeWeb = new DesignerRelationShapeWeb(me); - return relationShapeWeb.relationCheck(fileId, shapeId, attrIds); - } - - // 查询要删除的图形是否被关联 - // @Mapping("COE_PAL_PL_RESPOSITORY_DESIGNER_RELATION_SEARCH") - @Mapping("com.actionsoft.apps.coe.pal_pl_repository_designer_relation_search") - public String COEPALRepositoryDesignerRelationSearch(UserContext me, String fileId, String shapeIds) { - DesignerRelationShapeWeb web = new DesignerRelationShapeWeb(me); - return web.relationSearch(fileId, shapeIds); - } - - // 属性关联的形状显示 - // @Mapping("COE_PAL_PL_RESPOSITORY_DESIGNER_RELATION_SHAPE_RELEVANCE_NAME") - @Mapping("com.actionsoft.apps.coe.pal_pl_repository_designer_relation_shape_relevance_name") - public String COEPALPLRespositoryDesignerRelationShapeRelevancName(UserContext me, RequestParams params) { - DesignerRelationShapeWeb relationShapeWeb = new DesignerRelationShapeWeb(me); - String fileId = params.get("fileId"); - String shapeId = params.get("shapeId"); - String shapeName = params.get("shapeName"); - String shapeCategory = params.get("shapeCategory"); - return relationShapeWeb.respositoryDesignerRelationShapeRelevanceName(fileId, shapeId, shapeName, shapeCategory); - } - - // 关联的删除 - // @Mapping("COE_PAL_PL_RESPOSITORY_DESIGNER_RELATION_SHAPE_RELEVANCE_REMOVE") - @Mapping("com.actionsoft.apps.coe.pal_pl_repository_designer_relation_shape_relevance_remove") - public String COEPALPLRespositoryDesignerRelationShapeRelevancRemove(UserContext me, RequestParams params) { - DesignerRelationShapeWeb relationShapeWeb = new DesignerRelationShapeWeb(me); - String attrId = params.get("uuid"); - String fileId = params.get("fileId"); - String shapeId = params.get("shapeId"); - return relationShapeWeb.removeRelationByAttrId(fileId, shapeId, attrId); - } - - // 报告生成器首页 - // @Mapping("COE_PAL_OUTPUTREPORT_HOME") - @Mapping("com.actionsoft.apps.coe.pal_outputreport_home") - public String COEPALOutPutReportHome(UserContext me, String wsid) { - OutPutReportWeb outPutReport = new OutPutReportWeb(me); - return outPutReport.outPutReportHome(wsid, ""); - } - - // 报告生成器首页 - // @Mapping("COE_PAL_OUTPUTREPORT_HOME_DATA") - @Mapping("com.actionsoft.apps.coe.pal_outputreport_home_data") - public String COEPALOutPutReportHomeData(UserContext me, RequestParams params) { - OutPutReportWeb outPutReport = new OutPutReportWeb(me); - int start = params.getInt("start"); - int end = params.getInt("end"); - String wsid = params.get("wsid"); - String teamId = params.get("teamId"); - String data = params.get("data"); - return outPutReport.getTaskData(start, end, wsid, teamId, data); - } - - // 报告生成器首页 - - // @Mapping("COE_PAL_OUTPUTREPORT_JSON_DATA") - @Mapping("com.actionsoft.apps.coe.pal_outputreport_json_data") - public String COEPALOutPutReportJsonData(UserContext me, String language, String templateOperate) { - OutPutReportWeb outPutReport = new OutPutReportWeb(me); - return outPutReport.jsonData(language, templateOperate); - } - - // @Mapping("COE_PAL_OUTPUTREPORT_PAL_FILE_JSON_DATA") - @Mapping("com.actionsoft.apps.coe.pal_outputreport_pal_file_json_data") - public String COEPALOutPutReportPALFileJsonData(UserContext me, String methodType, String wsid, String pid, String versionType, String teamId) { - OutPutReportWeb outPutReport = new OutPutReportWeb(me); - return outPutReport.PALFileJsonData(methodType, wsid, pid, versionType, teamId); - } - - // @Mapping("COE_PAL_OUTPUTREPORT_PAL_FILE_JSON_DATA_ROOT") - @Mapping("com.actionsoft.apps.coe.pal_outputreport_pal_file_json_data_root") - public String COEPALOutPutReportPALFileJsonDataRoot(UserContext me, String methodType, String wsid, String versionType, String teamId, String targetMethodType) { - OutPutReportWeb outPutReport = new OutPutReportWeb(me); - return outPutReport.PALFileJsonDataRoot(methodType, wsid, versionType, teamId, targetMethodType); - } - - // @Mapping("COE_PAL_OUTPUTREPORT_PAL_FILE_JSON_DATA_ROOT_TREE_DATA") - @Mapping("com.actionsoft.apps.coe.pal_outputreport_pal_file_json_data_root_tree_data") - public String COEPALOutPutReportPALFileJsonDataRootTreeData(UserContext me, String methodType, String wsid, String versionType, String teamId) { - OutPutReportWeb outPutReport = new OutPutReportWeb(me); - return outPutReport.PALFileJsonDataRootTreeData(methodType, wsid, versionType, teamId); - } - - // @Mapping("COE_PAL_OUTPUTREPORT_PAL_FILE_RELATION_JSON_DATA_ROOT") - @Mapping("com.actionsoft.apps.coe.pal_file_relation_json_data_root") - public String COEPALOutPutReportPALFileRelationJsonDataRoot(UserContext me, String methodType, String wsid, String versionType, String teamId) { - OutPutReportWeb outPutReport = new OutPutReportWeb(me); - return outPutReport.PALFileRelationJsonDataRoot(methodType, wsid, versionType, teamId); - } - - // @Mapping("COE_PAL_OUTPUTREPORT_PAL_FILE_RELATION_JSON_DATA") - @Mapping("com.actionsoft.apps.coe.pal_outputreport_pal_file_relation_json_data") - public String COEPALOutPutReportPALFileRelationJsonData(UserContext me, String methodType, String wsid, String pid, String versionType, String teamId) { - OutPutReportWeb outPutReport = new OutPutReportWeb(me); - return outPutReport.PALFileRelationJsonData(methodType, pid, wsid, versionType, teamId); - } - - // 获得流程文件中某个类型的所有图形元素 - // @Mapping("COE_PAL_OUTPUTREPORT_PAL_FILE_SHAPES") - @Mapping("com.actionsoft.apps.coe.pal_outputreport_pal_file_shapes") - public String getRepositoryShapes(UserContext me, String uuid, String type) { - OutPutReportWeb web = new OutPutReportWeb(me); - return web.getRepositoryShapes(uuid, type); - } - - /** - * 报告保存 - * - * @param me - * @param params - * @return - */ - // @Mapping("COE_PAL_OUTPUTREPORT_COMPLETE") - @Mapping("com.actionsoft.apps.coe.pal_outputreport_complete") - public String COEPALOutPutReportSave(UserContext me, RequestParams params) { - OutPutReportWeb outPutReport = new OutPutReportWeb(me); - String lang = params.get("lang"); - String taskName = params.get("taskName"); - String userId = params.get("userId"); - String wsId = params.get("wsId"); - String teamId = params.get("teamId"); - String profileId = params.get("profileId"); - String isExecute = params.get("isExecute"); - String config = params.get("config"); - String targetFileId = params.get("targetFileId"); - String targetShape = params.get("targetShape"); - String relationFileId = params.get("relationFileId"); - String isModify = params.get("isModify"); - String taskId = params.get("taskId"); - return outPutReport.reportSave(lang, taskName, userId, teamId, profileId, wsId, isExecute, config, targetFileId, targetShape, relationFileId, isModify, taskId); - } - - /** - * 报告删除 - * - * @param me - * @param params - * @return - */ - // @Mapping("COE_PAL_OUTPUTREPORT_DELETE") - @Mapping("com.actionsoft.apps.coe.pal_outputreport_delete") - public String COEPALOutPutReportDelete(UserContext me, RequestParams params) { - OutPutReportWeb outPutReport = new OutPutReportWeb(me); - String wsid = params.get("wsid"); - String id = params.get("id"); - String profileId = params.get("profileId"); - String teamId = params.get("teamId"); - return outPutReport.reportDelete(id, wsid, profileId, teamId); - } - - /** - * 报告统计 - * - * @param me - * @param params - * @return - */ - // @Mapping("COE_PAL_OUTPUTREPORT_HOME_DATA_COUNT") - @Mapping("com.actionsoft.apps.coe.pal_outputreport_home_data_count") - public String COEPALOutPutReportCount(UserContext me, RequestParams params) { - OutPutReportWeb outPutReport = new OutPutReportWeb(me); - String wsid = params.get("wsid"); - String teamId = params.get("teamId"); - String data = params.get("data"); - return outPutReport.reportCount(teamId, wsid, data); - } - - /** - * 报告执行 - * - * @param me - * @param params - * @return - */ - // @Mapping("COE_PAL_OUTPUTREPORT_EXECUTE") - @Mapping("com.actionsoft.apps.coe.pal_outputreport_execute") - public String COEPALOutPutReportExecute(UserContext me, RequestParams params) { - OutPutReportWeb outPutReport = new OutPutReportWeb(me); - String wsid = params.get("wsid"); - String id = params.get("id"); - String profileId = params.get("profileId"); - return outPutReport.reportExecute(id, wsid, profileId); - } - - /** - * 报告修改 - * - * @param me - * @param params - * @return - */ - // @Mapping("COE_PAL_OUTPUTREPORT_MODIRY") - @Mapping("com.actionsoft.apps.coe.pal_outputreport_modify") - public String COEPALOutPutReportModify(UserContext me, RequestParams params) { - OutPutReportWeb outPutReport = new OutPutReportWeb(me); - String id = params.get("id"); - return outPutReport.reportModify(id); - } - - /** - * 单个报告的刷新 - * - * @param me - * @param params - * @return - */ - // @Mapping("COE_PAL_OUTPUTREPORT_EXECUTE_REFRESH") - @Mapping("com.actionsoft.apps.coe.pal_outputreport_execute_refresh") - public String COEPALOutPutReportExecuteRefresh(UserContext me, RequestParams params) { - OutPutReportWeb outPutReport = new OutPutReportWeb(me); - String id = params.get("id"); - String teamId = params.get("teamId"); - return outPutReport.refreshRowData(id, teamId); - } - - /** - * 下载模版 - * @param me - * @param appId 模版所属应用 - * @param templates 模版路径名称 - * @return - */ - // @Mapping("COE_PAL_OUTPUTREPORT_TEMPLATES_DOWNLOAD") - @Mapping("com.actionsoft.apps.coe.pal_outputreport_templates_download") - public String downloadOutPutReportTemplates(UserContext me, String appId, String templates) { - OutPutReportWeb web = new OutPutReportWeb(me); - return web.downloadOutPutReportTemplates(appId, templates); - } - - /** - * 上传模版 - * @param me - * @param appId 模版所属应用 - * @param param 模版在dc中的路径参数 - * @return - */ - // @Mapping("COE_PAL_OUTPUTREPORT_TEMPLATES_UPLOAD") - @Mapping("com.actionsoft.apps.coe.pal_outputreport_templates_upload") - public String uploadOutPutReportTemplates(UserContext me, String appId, String profileId, String param) { - OutPutReportWeb web = new OutPutReportWeb(me); - return web.uploadOutPutReportTemplates(appId, profileId, param); - } - - // @Mapping("COE_PAL_PUBLISHER_ADD_HOME") - @Mapping("com.actionsoft.apps.coe.pal_publisher_add_home") - public String COEPALPublisherData(UserContext me, String wsid, String teamId) { - ProcessPublishWeb web = new ProcessPublishWeb(me); - return web.PALPublisherData(wsid, teamId); - } - - // @Mapping("COE_PAL_PUBLISHER_STOP_HOME") - @Mapping("com.actionsoft.apps.coe.pal_publisher_stop_home") - public String COEPALPublisherStopDataHome(UserContext me, String wsid, String teamId) { - ProcessPublishWeb web = new ProcessPublishWeb(me); - return web.PALPublisherData(wsid, teamId); - } - - // @Mapping("COE_PAL_PUBLISHER_CHANGE_HOME") - @Mapping("com.actionsoft.apps.coe.pal_publisher_change_home") - public String COEPALPublisherChangeDataHome(UserContext me, String wsid, String teamId) { - ProcessPublishWeb web = new ProcessPublishWeb(me); - return web.PALPublisherData(wsid, teamId); - } - - /** - * 新发布流程申请 - * @param me - * @param processInstId - * @param taskInstId - * @param openState - * @param currentPage - * @param formItemDefId - * @param formData - * @return - */ - // @Mapping("COE_PAL_PUBLISH_ADD_SAVE_DATA") - @Mapping("com.actionsoft.apps.coe.pal_publish_add_save_data") - public String COEPALPublishAddSaveData(UserContext me, String processInstId, String taskInstId, int openState, int currentPage, String formItemDefId, String formData) { - JSONArray jsonArr = JSONArray.parseArray(formData); - FormEngine web = new FormEngine(me, processInstId, taskInstId, openState, currentPage); - for (int i = 0; i < jsonArr.size(); i++) { - JSONObject json = jsonArr.getJSONObject(i); - if (json.getString("id").length() < 16) { - continue; - } - JSONObject jsonData = new JSONObject(); - jsonData.put("PUBLISHDESC", ""); - jsonData.put("PUBLISTHTYPE", json.getString("fileType")); - jsonData.put("PUBLISHFILENAME", json.getString("name")); - jsonData.put("PUBLISHVERSION", json.getString("fileVersion")); - jsonData.put("PUBLISHFILEID", json.getString("id")); - formData = jsonData.toString(); - boolean isCreate = true; - String rowBoId = UUIDGener.getUUID(); - web.saveCommonGridRowData(web.getContext(), formItemDefId, rowBoId, formData, isCreate, "", "", "", false); - } - ResponseObject ro = ResponseObject.newOkResponse(); - ro.msg(I18nRes.findValue(AppsConst.SYS_APP_PORTAL, "保存成功")); - return ro.toString(); - } - - /** - * 新发布流程申请 - * @param me - * @param processInstId - * @param taskInstId - * @param openState - * @param currentPage - * @param formItemDefId - * @param formData - * @return - */ - // @Mapping("COE_PAL_PUBLISH_STOP_SAVE_DATA") - @Mapping("com.actionsoft.apps.coe.pal_publish_stop_save_data") - public String COEPALPublishStopSaveData(UserContext me, String processInstId, String taskInstId, int openState, int currentPage, String formItemDefId, String formData) { - JSONArray jsonArr = JSONArray.parseArray(formData); - FormEngine web = new FormEngine(me, processInstId, taskInstId, openState, currentPage); - for (int i = 0; i < jsonArr.size(); i++) { - JSONObject json = jsonArr.getJSONObject(i); - if (json.getString("id").length() < 16) { - continue; - } - JSONObject jsonData = new JSONObject(); - jsonData.put("STOPDESC", ""); - jsonData.put("STOPTYPE", json.getString("fileType")); - jsonData.put("STOPFILENAME", json.getString("name")); - jsonData.put("STOPVERSION", json.getString("fileVersion")); - jsonData.put("STOPFILEID", json.getString("id")); - formData = jsonData.toString(); - boolean isCreate = true; - String rowBoId = UUIDGener.getUUID(); - web.saveCommonGridRowData(web.getContext(), formItemDefId, rowBoId, formData, isCreate, "", "", "", false); - } - ResponseObject ro = ResponseObject.newOkResponse(); - ro.msg(I18nRes.findValue(AppsConst.SYS_APP_PORTAL, "保存成功")); - return ro.toString(); - } - - /** - * 新发布流程申请 - * @param me - * @param processInstId - * @param taskInstId - * @param openState - * @param currentPage - * @param formItemDefId - * @param formData - * @return - */ - // @Mapping("COE_PAL_PUBLISH_CHANGE_SAVE_DATA") - @Mapping("com.actionsoft.apps.coe.pal_publish_change_save_data") - public String COEPALPublishChangeSaveData(UserContext me, String processInstId, String taskInstId, int openState, int currentPage, String formItemDefId, String formData) { - JSONArray jsonArr = JSONArray.parseArray(formData); - FormEngine web = new FormEngine(me, processInstId, taskInstId, openState, currentPage); - for (int i = 0; i < jsonArr.size(); i++) { - JSONObject json = jsonArr.getJSONObject(i); - if (json.getString("id").length() < 16) { - continue; - } - JSONObject jsonData = new JSONObject(); - jsonData.put("CHANGEDDESC", ""); - jsonData.put("CHANGETYPE", json.getString("fileType")); - jsonData.put("CHANGEFILENAME", json.getString("name")); - jsonData.put("CHANGEDVERSION", json.getString("fileVersion")); - jsonData.put("CHANGEFILEID", json.getString("id")); - formData = jsonData.toString(); - boolean isCreate = true; - String rowBoId = UUIDGener.getUUID(); - web.saveCommonGridRowData(web.getContext(), formItemDefId, rowBoId, formData, isCreate, "", "", "", false); - } - ResponseObject ro = ResponseObject.newOkResponse(); - ro.msg(I18nRes.findValue(AppsConst.SYS_APP_PORTAL, "保存成功")); - return ro.toString(); - } - - /** - * 新增发布子表单数据 - * - * @param me - * @param processInstId - * @return - */ - // @Mapping("COE_PAL_PUBLISH_ADD_SHOW_DATA") - @Mapping("com.actionsoft.apps.coe.pal_publish_add_show_data") - public String COEPALPublishAddShowData(UserContext me, String processInstId) { - ProcessPublishWeb web = new ProcessPublishWeb(me); - return web.getPublishAddData(processInstId); - } - - /** - * 停用发布子表单数据 - * - * @param me - * @param processInstId - * @return - */ - // @Mapping("COE_PAL_PUBLISH_STOP_SHOW_DATA") - @Mapping("com.actionsoft.apps.coe.pal_publish_stop_show_data") - public String COEPALPublishStopShowData(UserContext me, String processInstId) { - ProcessPublishWeb web = new ProcessPublishWeb(me); - return web.getPublishStopData(processInstId); - } - - /** - * 修改发布子表单数据 - * - * @param me - * @param processInstId - * @return - */ - // @Mapping("COE_PAL_PUBLISH_CHANGE_SHOW_DATA") - @Mapping("com.actionsoft.apps.coe.pal_publish_change_show_data") - public String COEPALPublishChangeShowData(UserContext me, String processInstId) { - ProcessPublishWeb web = new ProcessPublishWeb(me); - return web.getPublishChangeData(processInstId); - } - - /** - * 获取资产库文件发布历史 - * - * @param me - * @param repositoryId - * @param wsId - * @return - * @author zhangming - */ - // @Mapping("COE_PAL_PUBLISH_HISTORY_OF_REPOSITORY") - @Mapping("com.actionsoft.apps.coe.pal_publish_history_of_repository") - public String COEPALPublishHistoryOfRepository(UserContext me, String repositoryId, String wsId) { - ProcessPublishWeb web = new ProcessPublishWeb(me); - return web.getPublishHistoryList(repositoryId, wsId); - } - - /** - * 资产库备份首页 - * - * @param me - * @param wsId - * @return - * @author zhangming - */ - // @Mapping("COE_PAL_BACKUP_HOME") - @Mapping("com.actionsoft.apps.coe.pal_backup_home") - public String CoEPALBackupHome(UserContext me, String wsId) { - CoEPALBackupWeb web = new CoEPALBackupWeb(me); - return web.getHomePage(wsId); - } - - /** - * 资产库备份首页-数据 - * - * @param me - * @param wsId - * @return - * @author zhangming - */ - // @Mapping("COE_PAL_BACKUP_DATA") - @Mapping("com.actionsoft.apps.coe.pal_backup_data") - public String CoEPALBackupData(UserContext me, String wsId) { - CoEPALBackupWeb web = new CoEPALBackupWeb(me); - return web.getBackupData(wsId); - } - - /** - * 资产库备份-新增 - * - * @param me - * @param wsId - * @param remark - * @return - * @author zhangming - */ - // @Mapping("COE_PAL_BACKUP_ADD") - @Mapping("com.actionsoft.apps.coe.pal_backup_add") - public String CoEPALBackupAdd(UserContext me, String wsId, String remark) { - CoEPALBackupWeb web = new CoEPALBackupWeb(me); - return web.saveBackup(wsId, remark); - } - - /** - * 资产库备份-删除 - * - * @param me - * @param wsId - * @param id - * @return - * @author zhangming - */ - // @Mapping("COE_PAL_BACKUP_DELETE") - @Mapping("com.actionsoft.apps.coe.pal_backup_delete") - public String CoEPALBackupDelete(UserContext me, String wsId, String id) { - CoEPALBackupWeb web = new CoEPALBackupWeb(me); - return web.deleteBackup(wsId, id); - } - - /** - * 资产库备份-恢复 - * - * @param me - * @param wsId - * @param id - * @return - * @author zhangming - */ - // @Mapping("COE_PAL_BACKUP_RECOVER") - @Mapping("com.actionsoft.apps.coe.pal_backup_recover") - public String CoEPALBackupRecover(UserContext me, String wsId, String id) { - CoEPALBackupWeb web = new CoEPALBackupWeb(me); - return web.recoverBackup(wsId, id); - } - - /** - * 资产库备份-获取状态 - * - * @param me - * @param wsId - * @param id - * @return - * @author zhangming - */ - // @Mapping("COE_PAL_BACKUP_STATE") - @Mapping("com.actionsoft.apps.coe.pal_backup_state") - public String CoEPALBackupState(UserContext me, String wsId, String id) { - CoEPALBackupWeb web = new CoEPALBackupWeb(me); - return web.getBackupState(wsId, id); - } - - /** - * 资产库备份-导出备份数据 - * - * @param me - * @param wsId - * @param id - * @return - * @throws Exception - * - */ - // @Mapping("COE_PAL_BACKUP_EXPORT") - @Mapping("com.actionsoft.apps.coe.pal_backup_export") - public String CoEPALBackupExport(UserContext me, String wsId, String id) throws Exception { - CoEPALBackupWeb web = new CoEPALBackupWeb(me); - return web.getBackupExport(wsId, id); - } - - /** - * 资产库备份-导出备份数据-进度查询 - * - * @param me - * @param wsId - * @param id - * @return - * @throws Exception - */ - // @Mapping("COE_PAL_BACKUP_EXPORT_PROGRESS") - @Mapping("com.actionsoft.apps.coe.pal_backup_export_progress") - public String CoEPALBackupExportProgress(UserContext me, String wsId, String id) throws Exception { - CoEPALBackupWeb web = new CoEPALBackupWeb(me); - return web.getBackupExportProgress(wsId, id); - } - - /** - * 资产库备份-导出备份数据-下载地址 - * - * @param me - * @param wsId - * @param id - * @return - * @throws Exception - */ - // @Mapping("COE_PAL_BACKUP_EXPORT_DOWNLOAD") - @Mapping("com.actionsoft.apps.coe.pal_backup_export_download") - public String CoEPALBackupExportDownload(UserContext me, String wsId, String id) throws Exception { - CoEPALBackupWeb web = new CoEPALBackupWeb(me); - return web.getBackupExportDownload(wsId, id); - } - - /** - * 资产库备份-修改 - * - * @param me - * @param id - * @param remark - * @return - * @author zhangming - */ - // @Mapping("COE_PAL_BACKUP_UPDATE") - @Mapping("com.actionsoft.apps.coe.pal_backup_update") - public String CoEPALBackupUpdate(UserContext me, String id, String remark) { - CoEPALBackupWeb web = new CoEPALBackupWeb(me); - return web.updateBackup(id, remark); - } - - /** - * 导入org模型 - * - * @param me - * @param wsId - * @param parentId - * @param fileName - * @return - * @author zhangming - */ - // @Mapping("COE_PAL_REPOSITORY_IMPORT_ORG") - @Mapping("com.actionsoft.apps.coe.pal_repository_import_org") - public String CoEPALRepositoryImportOrg(UserContext me, String wsId, String teamId, String parentId, String fileName) { - CoeProcessLevelWeb web = new CoeProcessLevelWeb(me); - return web.importOrgModel(wsId, parentId, fileName, teamId); - } - - /** - * 导入org模型的excel下载模板 - * - * @param me - * @param category - * @return - * @author zhangming - */ - // @Mapping("COE_PAL_REPOSITORY_IMPORT_ORG_TEMPLATE") - @Mapping("com.actionsoft.apps.coe.pal_repository_import_org_template") - public String CoEPALRepositoryTemplateOrgUrl(UserContext me, String category) { - CoeProcessLevelWeb web = new CoeProcessLevelWeb(me); - return web.getImportTemplateUrl(category); - } - - /** - * 部门流程根节点 - * - * @param me - * @param wsId - * @param categorys - * @return - */ - // @Mapping("COE_PAL_REPOSITORY_GET_PAL_TREEDATA_BY_DEPT") - @Mapping("com.actionsoft.apps.coe.pal_repository_get_pal_treedata_by_dept") - public String getCoEPALRepositoryTreeDataByDept(UserContext me, String wsId, String categorys) { - CoeProcessLevelWeb web = new CoeProcessLevelWeb(me); - return web.getCoEPALRepositoryTreeDataByDept(wsId, categorys); - } - - /** - * 流程根节点 - * - * @param me - * @param wsId - * @param categorys - * @return - */ - // @Mapping("COE_PAL_REPOSITORY_GET_PAL_TREEDATA") - @Mapping("com.actionsoft.apps.coe.pal_repository_get_pal_treedata") - public String getCoEPALRepositoryTreeData(UserContext me, String wsId, String categorys) { - CoeProcessLevelWeb web = new CoeProcessLevelWeb(me); - return web.getCoEPALRepositoryTreeData(wsId, categorys); - } - - /** - * 查询流程的链接 - * @param me - * @param wsId - * @param plId - * @return - */ - // @Mapping("COE_PAL_LINK_OF_REPOSITORY") - @Mapping("com.actionsoft.apps.coe.pal_link_of_repository") - public String getPALLinkOfRepository(UserContext me, String wsId, String plId) { - CoeProcessLevelWeb web = new CoeProcessLevelWeb(me); - return web.getPALLinkOfRepository(wsId, plId); - } - - /** - * 全量保存流程文件 - * - * @param me - * @param uuid - * @param define - * @return - */ - // @Mapping("COE_PAL_REPOSITORY_PROCESS_DEFINE_SAVE") - @Mapping("com.actionsoft.apps.coe.pal_repository_process_define_save") - public String saveProcessDefine(UserContext me, String uuid, String define, String teamId, String messages) { - CoeProcessLevelWeb web = new CoeProcessLevelWeb(me); - - String ro = ""; - try { - ro = web.saveProcessDefine(me, uuid, define, teamId, messages); - } catch (IOException e) { - e.printStackTrace(); - return ResponseObject.newErrResponse(ExceptionUtil.getMessage(e)).toString(); - } - return ro; - } - - /** - * 检查流程的锁定信息 - * - * @param me - * @param uuid - * @return - */ - // @Mapping("COE_PAL_REPOSITORY_PROCESS_DEFINE_GET_LOCK_INFO") - @Mapping("com.actionsoft.apps.coe.pal_repository_process_define_get_lock_info") - public String getCheckoutInfo(UserContext me, String uuid) { - CoeDesignerWeb web = new CoeDesignerWeb(me); - return web.getCheckoutInfo(uuid); - } - - /** - * 强制获取流程编辑权 - * - * @param me - * @param uuid - * @return - */ - // @Mapping("COE_PAL_REPOSITORY_PROCESS_DEFINE_EDIT_GETLOCK") - @Mapping("com.actionsoft.apps.coe.pal_repository_process_define_edit_getlock") - public String setCheckoutRight(UserContext me, String uuid) { - CoeDesignerWeb web = new CoeDesignerWeb(me); - return web.setCheckoutRight(uuid); - } - - /** - * 释放流程编辑权 - * - * @param me - * @param uuid - * @return - */ - // @Mapping("COE_PAL_REPOSITORY_PROCESS_DEFINE_EDIT_RELEASELOCK") - @Mapping("com.actionsoft.apps.coe.pal_repository_process_define_edit_releaselock") - public String releaseCheckoutRight(UserContext me, String uuid) { - CoeDesignerWeb web = new CoeDesignerWeb(me); - return web.releaseCheckoutRight(uuid); - } - - /** - * 删除流程节点文本或删除节点,修改关联表中的数据 - * - * @param me - * @param uuid - * @param shapeId - * @param shapeText - * @param type - * @return - */ - // @Mapping("COE_PAL_REPOSITORY_DESIGNER_SHAPE_UPDATE_TEXT_OR_DELETE") - @Mapping("com.actionsoft.apps.coe.pal_repository_designer_shape_update_text_or_delete") - public String updateShapeTextOrDeleteShape(UserContext me, String uuid, String shapeId, String shapeText, int type) { - CoeDesignerWeb web = new CoeDesignerWeb(me); - return web.updateShapeTextOrDeleteShape(uuid, shapeId, shapeText, type); - } - - /** - * shape同名符号提示 - * @param me - * @param uuid - * @param shapeId - * @param shapeText - * @return - */ - // @Mapping("COE_PAL_REPOSITORY_DESIGNER_SHAPE_SAME_TEXT_CHECK") - @Mapping("com.actionsoft.apps.coe.pal_repository_designer_shape_same_text_check") - public String getShapeSameTexts(UserContext me, String uuid, String shapeId, String shapeText) { - CoeDesignerWeb web = new CoeDesignerWeb(me); - return web.getShapeSameTexts(uuid, shapeId, shapeText); - } - - /** - * 节点属性是deptAddress,获取关联的部门名称 - * @param me - * @param deptIds - * @return - */ - // @Mapping("COE_PAL_PL_RESPOSITORY_DESIGNER_RELATION_SHAP_DEPT_NAME") - @Mapping("com.actionsoft.apps.coe.pal_pl_repository_designer_relation_shape_deptname_query") - public String repositoryDesignerRelationShapDeptName(UserContext me, String deptIds) { - CoeDesignerWeb web = new CoeDesignerWeb(me); - return web.getRelationShapDeptName(deptIds); - } - - /** - * 导出流程 - * @param me - * @param wsId - * @param uuid - * @return - * @throws Exception - */ - // @Mapping("COE_PAL_PL_REPOSITORY_PROCESSLEVEL_EXPORT_REPOSITORY") - @Mapping("com.actionsoft.apps.coe.pal_pl_repository_processlevel_repository_export") - public String exportRepository(UserContext me, String wsId, String uuid) throws Exception { - CoeProcessLevelWeb web = new CoeProcessLevelWeb(me); - return web.exportRepository(wsId, uuid); - } - - /** - * 导入流程 - * @param me - * @param wsId - * @param uuid - * @return - * @throws Exception - */ - // @Mapping("COE_PAL_PL_REPOSITORY_PROCESSLEVEL_IMPORT_REPOSITORY") - @Mapping("com.actionsoft.apps.coe.pal_pl_repository_processlevel_repository_import") - public String importRepository(UserContext me, String wsId, String uuid, String fileName) throws Exception { - CoeProcessLevelWeb web = new CoeProcessLevelWeb(me); - return web.importRepository(wsId, uuid, fileName); - } - - /* - * 锁定 解锁当前流程模型 其他人员只能读,不可修改 - * @param uuid 流程模型唯一标识 - * @param optype 操作 lockpro 锁定 unlockpro 解锁 - * */ - // @Mapping("COE_PAL_PL_RESPOSITORY_LOCK_UNLUCK_PROCESS") - @Mapping("com.actionsoft.apps.coe.pal_pl_repository_lock_or_unlock_process") - public String COEPALlockOrUnlockProcess(UserContext me, String uuid, String optype) { - CoeDesignerWeb designerWeb = new CoeDesignerWeb(me); - return designerWeb.lockOrUnlockProcess(uuid, optype); - } - - /** - * 判断当前流程模型是否已经上锁 上锁人员 - * @param me - * @param uuid - * @return - */ - // @Mapping("COE_PAL_PL_RESPOSITORY_CHECK_PROCESS_LOCK_STATE") - @Mapping("com.actionsoft.apps.coe.pal_pl_repository_process_lock_state_check") - public String checkProcessLockState(UserContext me, String uuid) { - CoeDesignerWeb designerWeb = new CoeDesignerWeb(me); - return designerWeb.checkProcessLockState(uuid); - } - - /** - * 根据流程源文件校验节点关联属性是否存在有关联节点id但是数据库无该关联信息的情况 - * 根据流程源文件反向插入关联数据到APP_ACT_COE_PAL_SHAPE_RLAT - * @param wsId - * @return - */ - // @Mapping("COE_PAL_WS_CHECK_SHAPE_RELATION_INTEGRITY") - @Mapping("com.actionsoft.apps.coe.pal_ws_shape_relation_integrity_check") - public String COEPALCheckShapeRelationIntegrity(UserContext me, String wsId) { - DesignerRelationShapeWeb web = new DesignerRelationShapeWeb(me); - return web.checkAndRepairShapeRelation(wsId); - } - - /** - * 关联关系DB数据恢复 - * @param lossData 需要恢复的数据 - */ - // @Mapping("COE_PAL_WS_SHAPE_RELATION_RESTORE") - @Mapping("com.actionsoft.apps.coe.pal_ws_shape_relation_restore") - public String COEPALShapeRelationRestore(UserContext me, String lossData) { - DesignerRelationShapeWeb web = new DesignerRelationShapeWeb(me); - return web.shapeRelationRestore(lossData); - } - - /** - * 特殊文件属性(列表形式属性)保存 - * @return - */ - // @Mapping("COE_PAL_PROCESSLEVEL_SPECIAL_ATTRIBUTE_SAVE") - @Mapping("com.actionsoft.apps.coe.pal_processlevel_special_attribute_save") - public String COEPALPROCESSLEVELSpecialAttributeSave(UserContext me, String wsId, String id, String plId, String type, String opType, String value) { - CoeProcessLevelWeb web = new CoeProcessLevelWeb(me); - return web.SpecialAttributeSave(wsId, id, plId, type, opType, value); - } - - /** - * 特殊文件属性(列表形式属性)删除 - * @return - */ - // @Mapping("COE_PAL_PROCESSLEVEL_SPECIAL_ATTRIBUTE_DELETE") - @Mapping("com.actionsoft.apps.coe.pal_processlevel_special_attribute_delete") - public String COEPALPROCESSLEVELSpecialAttributeDelete(UserContext me, String id) { - CoeProcessLevelWeb web = new CoeProcessLevelWeb(me); - return web.SpecialAttributeSaveDelete(id); - } - - /** - * 检测是否可以导出流程手册 - * @param me - * @param fileId - * @return - */ - // @Mapping("COE_PAL_OUTPUTREPORT_OUTPUT_PROCESS_CHECK") - @Mapping("com.actionsoft.apps.coe.pal_outputreport_output_process_check") - public String COEPALOUTPUTREPORTOutputProcessCheck (UserContext me, String fileId) { - OutPutReportWeb web = new OutPutReportWeb(me); - return web.checkOutputProcess(fileId); - } - - // @Mapping("COE_PAL_OUTPUTREPORT_OUTPUT_PROCESS_CREATE") - @Mapping("com.actionsoft.apps.coe.pal_outputreport_output_process_create") - public String COEPALOUTPUTREPORTOutputProcessCreate (UserContext me, String wsId, String teamId, String fileId) { - PALRepositoryModel model = PALRepositoryCache.getCache().get(fileId); - String methodId = model.getMethodId(); - if ("data.form".equals(methodId)) { - return PALRepositoryQueryAPIManager.getInstance().createOutputReportBd(wsId, me.getUID(), teamId, fileId); - } else if ("control.policy".equals(methodId)) { - return PALRepositoryQueryAPIManager.getInstance().createOutputReportZd(wsId, me.getUID(), teamId, fileId); - } - return PALRepositoryQueryAPIManager.getInstance().createOutputReportPr(wsId, me.getUID(), teamId, fileId); - } - - /** - * 流程手册预览 - * @param me - * @param taskId - * @return - */ - // @Mapping("COE_PAL_OUTPUTREPORT_OUTPUT_PROCESS_PREVIEW") - @Mapping("com.actionsoft.apps.coe.pal_outputreport_output_process_preview") - public String COEPALOUTPUTREPORTOutputProcessPreview(UserContext me, String taskId) { - return PALRepositoryQueryAPIManager.getInstance().outputReportPreview(me, taskId); - } - - - /** - * 流程阅览 流程手册下载 - * @param me - * @param taskId - * @return - * by zhaolei - */ - @Mapping("com.actionsoft.apps.coe.pal_outputreport_output_process_download") - public String COEPALOUTPUTREPORTOutputProcessDownload(UserContext me, String taskId,String ruuid) { - return PALRepositoryQueryAPIManager.getInstance().outputReportDownload(me, taskId,ruuid); - } - - - - /** - * 查询导出组织模型等结构 - * 简单查询 - * @param me - * @param ruuid - * @param wsId - * @return - */ - // @Mapping(value="COE_PAL_PL_RESPOSITORY_EXPORT_ORG_DATA") - @Mapping("com.actionsoft.apps.coe.pal_pl_repository_export_org_data") - public String COEPALRESPOSITORYExportOrgData(UserContext me, String ruuid, String wsId) { - CoeProcessLevelWeb web = new CoeProcessLevelWeb(me); - return web.exportOrgData(wsId, ruuid); - } - - /** - * 制度表单等工具栏中上传附件删除 - * @param ruuid - * @param fileName - * @return - */ - // @Mapping(value="COE_PAL_PROCESSLEVEL_SHAPE_UPFILE_DEL") - @Mapping("com.actionsoft.apps.coe.pal_processlevel_shape_upfile_del") - public String COEPALPROCESSLEVELShapeUpfileDel(UserContext me, String appId, String repositoryName, String groupValue, String ruuid, String fileName) { - CoeProcessLevelWeb web = new CoeProcessLevelWeb(me); - return web.delShapeUpfile(appId, repositoryName, groupValue, ruuid, fileName); - } - - /** - * 制度表单等工具栏中上传附件保存并生成相应活动节点 - * @param ruuid - * @param fileNames - * @return - */ - // @Mapping(value="COE_PAL_PROCESSLEVEL_SHAPE_UPFILE_SAVE") - @Mapping("com.actionsoft.apps.coe.pal_processlevel_shape_upfile_save") - public String COEPALPROCESSLEVELShapeUpfileSave(UserContext me, String appId, String repositoryName, String groupValue, String ruuid, String fileNames, String type) { - CoeProcessLevelWeb web = new CoeProcessLevelWeb(me); - return web.saveShapeUpfile(appId, repositoryName, groupValue, ruuid, fileNames, type); - } - - /** - * 创建模型图片和缩略图 - * @param uuid - * @return - */ - // @Mapping(value="COE_PAL_PL_RESPOSITORY_SAVEIMAGE") - @Mapping("com.actionsoft.apps.coe.pal_pl_repository_image_save") - public String COEPALPLRESPOSITORYSaveImage(UserContext me, String uuid) { - PALRepositoryQueryAPIManager.getInstance().saveImage(uuid, true, true); - return ResponseObject.newOkResponse().toString(); - } - - /** - * 获取打开一个流程所需要的参数 - * 应用于流程树结构双击打开流程设计器 - * @param me - * @param wsId - * @param uuid - * @return - */ - // @Mapping(value="COE_PAL_PROCESSLEVEL_DESIGNER_DATA") - @Mapping("com.actionsoft.apps.coe.pal_processlevel_designer_data_query") - public String COEPALPROCESSLEVELDesignerData(UserContext me, String wsId, String uuid) { - CoeProcessLevelWeb web = new CoeProcessLevelWeb(me); - String result = web.getPortalParam(uuid, wsId); - return result; - } - - /** - * 新版门户流程只读页面打开前校验 - * @param me - * @param uuid - * @return - */ - // @Mapping("COE_PAL_PL_RESPOSITORY_DESIGNER_VIEWER_PORTAL_LINK_PERM") - @Mapping("com.actionsoft.apps.coe.pal_pl_repository_designer_viewer_portal_link_perm_check") - public String COEPALRESPOSITORYDesignerViewerPortalLinkPerm(UserContext me, String uuid) { - CoeDesignerWeb web = new CoeDesignerWeb(me); - return web.getDesignerViewerPortalLinkPerm(uuid); - } - - /** - * 新版门户打开 - * @param me - * @param uuid - * @return - */ - // @Mapping("COE_PAL_PL_RESPOSITORY_DESIGNER_VIEWER_PORTAL_OPEN") - @Mapping("com.actionsoft.apps.coe.pal_pl_repository_designer_viewer_portal_open_page") - public String COEPALRESPOSITORYDesignerViewerPortalOpen(UserContext me, String uuid) { - return PALRepositoryQueryAPIManager.getInstance().getPublishPortalHtml(me, uuid, null); - } - - /** - * 保存节点的地址簿属性内容到关联表 - * @return - */ - // @Mapping("COE_PAL_PL_RESPOSITORY_DESIGNER_ADDRESS_SHAPE_DATA_SAVE") - @Mapping("com.actionsoft.apps.coe.pal_pl_repository_designer_address_shape_data_save") - public String COEPALRESPOSITORYDesignerAddressShapeDataSave(UserContext me, String data) { - DesignerRelationShapeWeb web = new DesignerRelationShapeWeb(me); - return web.saveAddressShapeData(data); - } - - /** - * 获取关联的地址簿id - * @param me - * @param objIds - * @param shapeId - * @param uuid - * @return - */ - // @Mapping("COE_PAL_PL_RESPOSITORY_DESIGNER_ADDRESS_SHAPE") - @Mapping("com.actionsoft.apps.coe.pal_pl_repository_designer_address_shape_query") - public String COEPALRESPOSITORYDesignerAddressShape(UserContext me, String objIds, String shapeId, String uuid) { - DesignerRelationShapeWeb web = new DesignerRelationShapeWeb(me); - return web.getAddressShape(objIds, shapeId, uuid); - } - - /** - * 获取关联的地址簿名称 - * 只读情况下显示 - * @param me - * @param objIds - * @param shapeId - * @param uuid - * @param type - * @return - */ - // @Mapping("COE_PAL_PL_RESPOSITORY_DESIGNER_ADDRESS_NAMES_SHAPE") - @Mapping("com.actionsoft.apps.coe.pal_pl_repository_designer_address_names_shape_query") - public String COEPALRESPOSITORYDesignerAddressShape(UserContext me, String objIds, String shapeId, String uuid, String type) { - DesignerRelationShapeWeb web = new DesignerRelationShapeWeb(me); - return web.getAddressNames(objIds, shapeId, uuid, type); - } - - /** - * 获取aws平台的组织机构/岗位角色树 - * @param me - * @param wsId - * @param fileId - * @param shapeId - * @param attrId - * @return - */ - // @Mapping("COE_PAL_PL_RESPOSITORY_DESIGNER_AWS_ORG") - @Mapping("com.actionsoft.apps.coe.pal_pl_repository_designer_aws_org_page") - public String COEPALRESPOSITORYDesignerAwsOrg(UserContext me, String wsId, String fileId, String shapeId, String attrId, String ref) { - DesignerRelationShapeWeb web = new DesignerRelationShapeWeb(me); - return web.getAwsOrgPortal(wsId, fileId, shapeId, attrId, ref); - } - - /** - * 获取aws平台树结构 - * @param me - * @param pid - * @param uuid - * @param type - * @return - */ - // @Mapping("COE_PAL_PL_RESPOSITORY_DESIGNER_SHAPES_AWS_ORG_TREE_NODE") - @Mapping("com.actionsoft.apps.coe.pal_pl_repository_designer_shapes_aws_org_tree_node_query") - public String COEPALRESPOSITORYDesignerAwsOrgTreeNode(UserContext me, String pid, String uuid, String type, String scope, boolean multiple) { - DesignerRelationShapeWeb web = new DesignerRelationShapeWeb(me); - return web.getAwsOrgTreeData(pid, uuid, type, scope, multiple); - // return web.getPermAwsOrgTreeData(pid, uuid, type, scope, multiple); - } - - /** - * 获取子节点 - * @param me - * @param uuid - * @param type - * @return - */ - // @Mapping("COE_PAL_PL_RESPOSITORY_DESIGNER_SHAPES_AWS_ORG_TREE_NODE_CHILD_DATE") - @Mapping("com.actionsoft.apps.coe.pal_pl_repository_designer_shapes_aws_org_tree_node_child_query") - public String COEPALRESPOSITORYDesignerAwsOrgTreeNodeChildData(UserContext me, String uuid, String type) { - DesignerRelationShapeWeb web = new DesignerRelationShapeWeb(me); - return web.getAwsOrgTreeNodeChildData(uuid, type); - } - - /** - * 模糊查询 - * @return - */ - // @Mapping("COE_PAL_PL_RESPOSITORY_DESIGNER_SHAPES_AWS_ORG_TREE_QUERY") - @Mapping("com.actionsoft.apps.coe.pal_pl_repository_designer_shapes_aws_org_tree_query") - public String COEPALRESPOSITORYDesignerAwsOrgTreeQuery(UserContext me, String autoContent, String wsId, String ref) { - DesignerRelationShapeWeb web = new DesignerRelationShapeWeb(me); - return web.queryAwsOrgTree(autoContent, wsId, ref); - } - - /** - * 保存aws平台组织关联关系 - * @param me - * @param relationAwsOrg - * @param shapeId - * @param fileId - * @param shapeGroupId - * @param attrId - * @return - */ - // @Mapping("COE_PAL_PL_RESPOSITORY_DESIGNER_AWS_ORG_RELEVANCE_SAVE") - @Mapping("com.actionsoft.apps.coe.pal_pl_repository_designer_aws_org_relevance_save") - public String COEPALRESPOSITORYDesignerAwsOrgRelevanceSave(UserContext me, String relationAwsOrg, String shapeId, String fileId, String shapeGroupId, String attrId, String shapeText) { - DesignerRelationShapeWeb web = new DesignerRelationShapeWeb(me); - return web.saveAwsOrgRelevance(relationAwsOrg, shapeId, fileId, shapeGroupId, attrId, shapeText); - } - - /** - * 查询aws平台组织名称 - * @param me - * @param fileId - * @param shapeId - * @return - */ - // @Mapping("COE_PAL_PL_RESPOSITORY_DESIGNER_AWS_ORG_RELEVANCE_NAME") - @Mapping("com.actionsoft.apps.coe.pal_pl_repository_designer_aws_org_relevance_name_query") - public String COEPALRESPOSITORYDesignerAwsOrgRelevanceName(UserContext me, String fileId, String shapeId, String shapeName, String shapeCategory) { - DesignerRelationShapeWeb web = new DesignerRelationShapeWeb(me); - return web.getAwsOrgRelevanceName(fileId, shapeId, shapeName, shapeCategory); - } - - /** - * 报告生成器 - * raci、岗位手册关联awsorg相关 - * @param me - * @param wsid - * @param teamId - * @param methodType - * @param targetMethodType - * @return - */ - // @Mapping("COE_PAL_OUTPUTREPORT_PAL_AWS_ORG_PAGE") - @Mapping("com.actionsoft.apps.coe.pal_outputreport_pal_aws_org_page") - public String COEPALOutputreportAwsOrgPage(UserContext me, String wsid, String teamId, String methodType, String targetMethodType, String type) { - OutPutReportWeb outPutReport = new OutPutReportWeb(me); - return outPutReport.getOutputreportAwsOrgPage(wsid, teamId, methodType, targetMethodType, type); - } - - /** - * 报告生成器 - * raci树结构(aws org) - * @param me - * @param wsid - * @param teamId - * @param methodType - * @return - */ - // @Mapping("COE_PAL_OUTPUTREPORT_PAL_AWS_ORG_PAGE_TREE_DATA") - @Mapping("com.actionsoft.apps.coe.pal_outputreport_pal_aws_org_tree_data_query") - public String COEPALOutputreportAwsOrgTreeData(UserContext me, String wsid, String teamId, String methodType, String type) { - OutPutReportWeb outPutReport = new OutPutReportWeb(me); - return outPutReport.getOutputreportAwsOrgTreeData(wsid, teamId, methodType, type); - } - - /** - * 删除流程中的节点时记录日志 - * 查看designer.extend.core.js文件 - * @param me - * @param uuid - * @param delnode - * @param delnum - * @return - */ - // @Mapping("COE_PAL_REPOSITORY_DESIGNER_SHAPE_DELETE_LOG_RECORD_NOOP") - @Mapping("com.actionsoft.apps.coe.pal_pl_repository_designer_shape_log_record_noop_delete") - public String COEPALRepositoryDesignerDeleteLog(UserContext me, String uuid, String delnode, String delnum) { - CoeProcessLevelWeb processWeb = new CoeProcessLevelWeb(me); - return processWeb.COEPALRepositoryDesignerDeleteLog(uuid, delnode, delnum); - } - - //======******======******====== COE 和 CONSOLE 互调的命令 begin ======******======******======// - /** - * 调用平台流程属性形状属性 - * @param me - * @param params - * @return - */ - // @Mapping("COE_M_PROCESS_DESIGNER_PROPERTIES_PAGE") - @Mapping("com.actionsoft.apps.coe.pal_m_process_designer_properties_page") - public String processDesignerPropertiesPage(UserContext me, RequestParams params) { - ProcessBPMNDesignerController controller = new ProcessBPMNDesignerController(); - try { - // PAL调用平台,重新创建session - String sid = new SessionImpl().registerSession(LoginConst.SYSTEM_ADMIN_CONSOLE, me.getUID(), me.getClientIP(), me.getLanguage(), me.getDeviceType(), false, null).getSessionId(); - return controller.getPropertiesPage(UserContext.fromSessionId(sid), params); - } catch (Exception e) { - return AlertWindow.getErrorMessagePage("发生错误", e.getMessage()); - } - } - - /** - * 平台与PAL是否存在共享状态 - * @param me - * @param processDefId - * @return - */ - // @Mapping("COE_PAL_PROCESS_DESIGNER_MANAGE_FACTORY_JUDGECORRELATE") - @Mapping("com.actionsoft.apps.coe.pal_process_designer_manage_factory_judge_correlate") - public String manageFactorJudgeCorrelateBpms(UserContext me, String processDefId) { - CoeDesignerWeb web = new CoeDesignerWeb(me); - return web.manageFactorJudgeCorrelateBpms(processDefId); - } - - //======******======******====== COE 和 CONSOLE 互调的命令 begin ======******======******======// - - /** - * 新建、更新资产库查询数据 - * @param me - * @param wsId 资产库id,可为空 - * @return - */ - @Mapping("com.actionsoft.apps.coe.pal_ws_update_data_query") - public String getUpdateWorkspaceDataById(UserContext me, String wsId) { - CoeWorkSpaceWeb web = new CoeWorkSpaceWeb(me); - return web.getUpdateWorkspaceDataById(wsId); - } - - /** - * 更新/保存资产库 - * @param me - * @param wsId 为空则新建,不为空则更新 - * @param name 名称 - * @param desc 描述 - * @param type 类型 - * @param admin 管理员 - * @return - */ - @Mapping("com.actionsoft.apps.coe.pal_ws_update_save") - public String saveWorkspace(UserContext me, String wsId, String name, String desc, String type, String admin) { - CoeWorkSpaceWeb web = new CoeWorkSpaceWeb(me); - return web.saveWorkspace(wsId, name, desc, Integer.parseInt(type), admin); - } - - /** - * 管理中心 获取管理中心App - * @param me - * @return - */ - @Mapping("com.actionsoft.apps.coe.pal_pl_manage_app_data") - public String getPalPlManageApp(UserContext me) { - PalManageWeb fileWeb = new PalManageWeb(me); - return fileWeb.getPalPlManageApp(); - } - - /** - * 获取资产库管理数据 - * @param me - * @return - */ - @Mapping("com.actionsoft.apps.coe.pal_ws_manage_data") - public String getPalPlWsManageData(UserContext me) { - CoeWorkSpaceWeb we = new CoeWorkSpaceWeb(me); - return we.getCoeWorkSpaceManageData(); - } - - @Mapping("com.actionsoft.apps.coe.pal_ws_backup_data_query") - public String getPalPlWsBackupData(UserContext me, String wsId) { - CoEPALBackupWeb web = new CoEPALBackupWeb(me); - return web.getPalPlWsBackupData(wsId); - } - - /** - * 加载流程树 - * @return - */ - @Mapping("com.actionsoft.apps.coe.pal_processlevel_tree_data") - public String getPalProcesslevelTreeData(UserContext me, String wsId, String teamId, String pid,String createUsers,String orgIds,String methodIds) { - CoeProcessLevelWeb web = new CoeProcessLevelWeb(me); - return web.getPalProcesslevelTreeData(wsId, teamId, pid,createUsers,orgIds,methodIds); - } - - /** - * 查询新建文件类型 - * @param me - * @return - */ - @Mapping("com.actionsoft.apps.coe.pal_processlevel_create_method_list") - public String getPalProcessLevelCreateMethodList(UserContext me, String category, String methodId) { - CoeProcessLevelWeb web = new CoeProcessLevelWeb(me); - return web.getPalProcessLevelCreateMethodList(category, methodId); - } - - /** - * 保存/修改新建文件夹、层级 - * @return - */ - @Mapping("com.actionsoft.apps.coe.pal_processlevel_folder_create_save") - public String saveCreatePalProcessLevelFolder(UserContext me, String wsId, String teamId, String method, String id, String parentId, String name, String desc) { - CoeProcessLevelWeb web = new CoeProcessLevelWeb(me); - return web.saveCreatePalProcessLevelFolder(wsId, teamId, method, id, parentId, name, desc); - } - - /** - * 创建空白模型 - * @param me - * @param wsId - * @param teamId - * @param category - * @param method - * @param parentId - * @param container 模板 - * @return - */ - @Mapping("com.actionsoft.apps.coe.pal_processlevel_repository_create_save") - public String saveCreatePalProcessLevelRepository(UserContext me, String wsId, String teamId, String category, String method, String parentId, String container,Integer securityLevel) { - CoeProcessLevelWeb web = new CoeProcessLevelWeb(me); - return web.saveCreatePalProcessLevelRepository(wsId, teamId, category, method, parentId, container,securityLevel); - } - - - - - - - /** - * 创建空白模板 - * @param me - * @param wsId - * @param teamId - * @param category - * @param method - * @param parentId - * @param container - * @param securityLevel - * @param name - * @author zhaolei - * @return - */ - @Mapping("com.actionsoft.apps.coe.pal_processlevel_repository_create_save_Designer") - public String saveCreatePalProcessLevelRepositoryDesigner(UserContext me, String wsId, String teamId, String category, String method, String parentId, String container,Integer securityLevel,String name) { - CoeProcessLevelWeb web = new CoeProcessLevelWeb(me); - return web.saveCreatePalProcessLevelRepositoryDesigner(wsId, teamId, category, method, parentId, container,securityLevel,name); - } - - /** - * 获取路径 - * @param me - * @param parentId - * @return - */ - @Mapping("com.actionsoft.apps.coe.getArchitecturePath") - public String getArchitecturePath(UserContext me, String parentId) { - CoeProcessLevelWeb web = new CoeProcessLevelWeb(me); - return web.getArchitecturePath(parentId); - } - - /** - * 校验重名功能 - * @param me - * @param title - * @author zhaolei - * @return - */ - @Mapping("com.actionsoft.apps.coe.pal_pl_repository_designer_checkname") - public String checkCreatePalProcessLevelRepository(UserContext me,String title,String method) { - CoeProcessLevelWeb web = new CoeProcessLevelWeb(me); - return web.checkCreatePalProcessLevelRepository(title,method); - } - - /** - * 根据用户选择类型创建相应制度图形 - * @param me - * @param type - * @return - */ - @Mapping("com.actionsoft.apps.coe.pal_pl_repository_designer_CreateSystemModelBySelectType") - public String CreateSystemModelBySelectType(UserContext me,String wsId,String title,String type,String method,String uuid,String parentId) { - CoeProcessLevelWeb web = new CoeProcessLevelWeb(me); - return web.CreateSystemModelBySelectType(wsId,title,type,method,uuid,parentId); - } - - - /** - * 创建角色/绩效/表单模型 - * @param me - * @param - * @return - */ - @Mapping("com.actionsoft.apps.coe.pal_pl_repository_designer_relation_shape_createDialogModel") - public String createDialogModel(UserContext me,String uuid,String methodId,String wsId,String teamId) { - CoeProcessLevelWeb web = new CoeProcessLevelWeb(me); - return web.createDialogModel(uuid,methodId,wsId,teamId); - } - - - /** - * 查询是否有相同角色/绩效图数据 - * @param me - * @param - * @return - */ - @Mapping("com.actionsoft.apps.coe.pal_pl_repository_designer_relation_find_same_role") - public String relationFindSameRole(UserContext me,String uuid,String methodId) { - CoeProcessLevelWeb web = new CoeProcessLevelWeb(me); - return web.relationFindSameRole(uuid,methodId); - } - - - /** - * 质量校验功能 - * @param me - * @param sid - * @param uuid - * @param obj - * @return - */ - @Mapping("com.actionsoft.apps.coe.pal_repository_process_define_Quality_check") - public String defineQualityCheck(UserContext me,String sid,String uuid,String obj) { - CoeProcessLevelWeb web = new CoeProcessLevelWeb(me); - return web.bindefineQualityCheck(sid,uuid,obj); - } - - - @Mapping("com.actionsoft.apps.coe.pal_repository_process_define_Performance_check") - public String definePerformanceCheck(UserContext me,String sid,String obj) { - CoeProcessLevelWeb web = new CoeProcessLevelWeb(me); - return web.definePerformanceCheck(sid,obj); - } - - - - /** - * 添加回复功能 - * @param me - * @param ruuid - * @param replyContent - * @return - */ - @Mapping("com.actionsoft.apps.coe.pal_pl_repository_designer_add_reply") - public String createReply(UserContext me,String ruuid,String replyContent) { - CoeProcessLevelWeb web = new CoeProcessLevelWeb(me); - return web.createReply(me,ruuid,replyContent); - } - - /** - *加载回复列表 - * @param me - * @param ruuid - * @param replyContent - * @return - */ - @Mapping("com.actionsoft.apps.coe.pal_pl_repository_designer_GetReply") - public String GetReply(UserContext me, RequestParams params, String start, String size, String ruuid) { - String returnstrs = ""; - int startnum = -1; - int sizenum = -1; - if (!UtilString.isEmpty(start)) { - startnum = Integer.parseInt(start); - } else { - startnum = 1; - } - if (!UtilString.isEmpty(size)) { - sizenum = Integer.parseInt(size); - } else { - sizenum = 20; - } - - CoeProcessLevelWeb mdWeb = new CoeProcessLevelWeb(me); - returnstrs = mdWeb.getReplyList(startnum, sizenum, ruuid); - return returnstrs.toString(); - - } - - /** - * 删除评论功能 - * @param me - * @param params - * @param sid - * @param replyId - * @param messageId - * @return - */ - @Mapping("com.actionsoft.apps.coe.pal_delete_reply_by_id") - public String deleteReply(UserContext me, RequestParams params, String sid, String replyId, String messageId) { - CoeProcessLevelWeb web = new CoeProcessLevelWeb(me); - return web.deleteReply(replyId, messageId); - } - - - - /** - * 获取最近编辑的文件和收藏的文件 - * @param me - * @param wsId - * @param teamId - * @return - */ - @Mapping("com.actionsoft.apps.coe.pal_processlevel_recent_and_favorite_data_query") - public String getRecentAndFavoriteRepository(UserContext me, String wsId, String teamId,String createUsers,String orgIds,String methodIds) { - CoeProcessLevelWeb web = new CoeProcessLevelWeb(me); - return web.getRecentAndFavoriteRepository(me,wsId, teamId,createUsers,orgIds,methodIds); - } - - /** - * 收藏文件模型 - * @param me - * @param wsId - * @param teamId - * @param versionId - * @return - */ - @Mapping("com.actionsoft.apps.coe.pal_processlevel_favorite_save") - public String savePalProcessLevelFavoriteData(UserContext me, String wsId, String teamId, String versionId) { - CoeProcessLevelWeb web = new CoeProcessLevelWeb(me); - return web.savePalProcessLevelFavoriteData(wsId, teamId, versionId); - } - - /** - * 取消收藏 - * @param me - * @param wsId - * @param teamId - * @param versionId - * @return - */ - @Mapping("com.actionsoft.apps.coe.pal_processlevel_favorite_cancel") - public String cancelPalProcessLevelFavorite(UserContext me, String wsId, String teamId, String versionId) { - CoeProcessLevelWeb web = new CoeProcessLevelWeb(me); - return web.cancelPalProcessLevelFavorite(wsId, teamId, versionId); - } - - /** - * 查询子文件 - * @param me - * @param wsId - * @param teamId - * @param id - * @return - */ - @Mapping("com.actionsoft.apps.coe.pal_processlevel_repository_child_data_query") - public String getPalProcessLevelRepositoryChildData(UserContext me, String wsId, String teamId, String id,String createUsers,String orgIds,String methodIds) { - CoeProcessLevelWeb web = new CoeProcessLevelWeb(me); - return web.getPalProcessLevelRepositoryChildData(wsId, teamId, id,createUsers,orgIds,methodIds); - } - - - - /** - * Repository 树形子列表元素orderIndex调整 - * 不允许跨级排序 - * @param me - * @param wsId 所属资产库ID - * @param currentId 待调整位置uuid - * @param originId 插入位置的uuid - * @return - */ - @Mapping("com.actionsoft.apps.coe.pal_processlevel_repository_order_index_update") - public String updatePalProcessLevelRepositoryOrderIndex(UserContext me,String wsId,String currentId,String originId){ - CoeProcessLevelWeb web = new CoeProcessLevelWeb(me); - return web.updatePalProcessLevelRepositoryOrderIndex(wsId, currentId, originId); - } - - - /** - * 获取模型文件详情 - * @param me - * @param wsId - * @param teamId - * @param id - * @return - */ - @Mapping("com.actionsoft.apps.coe.pal_processlevel_repository_detail_data_query") - public String getPalProcessLevelRepositoryDetailData(UserContext me, String wsId, String teamId, String id) { - CoeProcessLevelWeb web = new CoeProcessLevelWeb(me); - return web.getPalProcessLevelRepositoryDetailData(wsId, teamId, id); - } - - /** - * 批量移动文件 - * @param uc - * @param sourceData - * @param targetData - * @return - */ - @Mapping("com.actionsoft.apps.coe.pal_processlevel_move_save") - public String movePalProcessLevelRepository(UserContext uc,String teamId, String sourceData, String targetData) { - CoeProcessLevelWeb web = new CoeProcessLevelWeb(uc); - return web.movePalProcessLevelRepository(teamId ,sourceData, targetData); - } - - /** - * 复制文件 - * @param uc - * @param wsId - * @param teamId - * @param sourceIds - * @param targetId - * @return - */ - @Mapping("com.actionsoft.apps.coe.pal_processlevel_copy_save") - public String copyPalProcessLevelRepository(UserContext uc, String wsId, String teamId, String sourceIds, String targetId) { - CoeProcessLevelWeb web = new CoeProcessLevelWeb(uc); - return web.copyPalProcessLevelRepository(wsId, teamId, sourceIds, targetId); - } - - /** - * 删除 - * @param uc - * @param wsId - * @param teamId - * @param repositoryIds - * @return - */ - @Mapping("com.actionsoft.apps.coe.pal_processlevel_remove") - public String removePalRepositoryLevel(UserContext uc, String wsId, String teamId, String repositoryIds) { - CoeProcessLevelWeb web = new CoeProcessLevelWeb(uc); - return web.removePalRepositoryLevel(wsId, teamId, repositoryIds); - } - - /** - * 设计器-查询版本数据 - * @param uc - * @param wsId - * @param teamId - * @param id - * @return - */ - @Mapping("com.actionsoft.apps.coe.pal_pl_repository_designer_version_manager_data") - public String getPalProcessLevelVersionData(UserContext uc, String wsId, String teamId, String id) { - CoeDesignerWeb web = new CoeDesignerWeb(uc); - return web.getPalProcessLevelVersionData(wsId, teamId, id); - } - - /** - * 设计器-创建新版本 - * @param uc - * @param wsId - * @param teamId - * @param id - * @return - */ - @Mapping("com.actionsoft.apps.coe.pal_pl_repository_designer_version_manager_create") - public String createPalDesignerNewVersion(UserContext uc, String wsId, String teamId, String id,@Param(defaultValue = "true") boolean isLargeIteration) { - CoeDesignerWeb web = new CoeDesignerWeb(uc); - return web.createPalDesignerNewVersion(wsId, teamId, id,isLargeIteration); - } - - /** - * 设计器-删除某版本文件(放入回收站) - * @param uc - * @param wsId - * @param teamId - * @param id - * @return - */ - @Mapping("com.actionsoft.apps.coe.pal_pl_repository_designer_version_manager_delete") - public String deletePalDesignerVersion(UserContext uc, String wsId, String teamId, String id) { - CoeDesignerWeb web = new CoeDesignerWeb(uc); - return web.deletePalDesignerVersion(wsId, teamId, id); - } - - /** - * 设计器-切换版本状态为使用中 - * @param uc - * @param wsId - * @param teamId - * @param id - * @return - */ - @Mapping("com.actionsoft.apps.coe.pal_pl_repository_designer_version_manager_use") - public String changePalDesignerVersionUse(UserContext uc, String wsId, String teamId, String id) { - CoeDesignerWeb web = new CoeDesignerWeb(uc); - return web.changePalDesignerVersionUse(wsId, teamId, id); - } - - /** - * 查询文件属性 - * @param uc - * @param wsId - * @param teamId - * @param id - * @return - */ - @Mapping("com.actionsoft.apps.coe.pal_processlevel_property_data_query") - public String getPalProcessLevelPropertyData(UserContext uc, String wsId, String teamId, String id) { - CoeProcessLevelWeb web = new CoeProcessLevelWeb(uc); - return web.getPalProcessLevelPropertyData(wsId, teamId, id); - } - - //管理->形状定义->形状配置->查询的dialog - // @Mapping("COE_PAL_PL_MANAGE_SHAPE_CONFIG_QUERY_DIALOG") - @Mapping("com.actionsoft.apps.coe.pal_pl_manage_shape_config_dialog_page") - public String coePalPlManageShapeConfigQueryDialog(UserContext me, String wsId, String type, String shapeId, String category, String defaultCategory, String commonShapeConfig, String specialShapeConfig, String attributesJsonArray, String relationData, String shapeKey) { - PalManageWeb fileWeb = new PalManageWeb(me); - return fileWeb.openCoePalPlManageShapeConfigQueryDialog(wsId, type, shapeId, category, defaultCategory, commonShapeConfig, specialShapeConfig, attributesJsonArray, relationData, shapeKey); - } - - //管理->形状定义->形状配置->更新的dialog - // @Mapping("COE_PAL_PL_MANAGE_SHAPE_CONFIG_UPDATE_DIALOG") - @Mapping("com.actionsoft.apps.coe.pal_pl_manage_shape_config_update_dialog_page") - public String coePalPlManageShapeConfigUpdateDialog(UserContext me, String wsId, String shapeId, String category, String defaultCategory, String horVerArray, String type, String horizontal, String verity, String showType, String textContent, String key, String attrName, String isShowAttrName, String iconContent) { - PalManageWeb fileWeb = new PalManageWeb(me); - return fileWeb.openCoePalPlManageShapeConfigUpdateDialog(wsId, shapeId, category, defaultCategory, horVerArray, type, horizontal, verity, showType, textContent, key, attrName, isShowAttrName, iconContent); - } - - //管理->形状定义->形状配置->获取更新dialog中的下拉框的值 - // @Mapping("COE_PAL_PL_MANAGE_SHAPE_CONFIG_UPDATE_SELECT_CONTENT") - @Mapping("com.actionsoft.apps.coe.pal_pl_manage_shape_config_update_select_content") - public String coePalPlManageShapeConfigUpdateSelectContent(UserContext me) { - PalManageWeb fileWeb = new PalManageWeb(me); - return fileWeb.openCoePalPlManageShapeConfigUpdateSelectContent(); - } - - // 流程的数据属性 - // @Mapping("COE_PAL_PL_MORE_ATTRIBUTE") - @Mapping("com.actionsoft.apps.coe.pal_pl_more_attribute") - public String COEPALPLMoreAttribute(UserContext me, String type, String wsId, String uuid, String processDefId, String shapeName, String category, String defaultCategory) { - CoeDesignerWeb designerWeb = new CoeDesignerWeb(me); - return designerWeb.getMoreAttritbute(me, type, wsId, uuid, type, shapeName, category, defaultCategory); - } - - /** - * 单个更新流程文件三员管理密级 - * @param me - * @param uuid 文件id - * @param securityLevel - * @return - */ - @Mapping("com.actionsoft.apps.coe.pal_pl_file_security_level_update") - public String updatePalProcessFileSecurityLevel(UserContext me,String uuid,Integer securityLevel){ - CoeProcessLevelWeb web = new CoeProcessLevelWeb(me); - return web.updateRepositorySecurityLevel(uuid,securityLevel); - } - - /** - * 批量更新流程文件三员管理密级 - * @param me - * @param fileList - * @return - */ - @Mapping("com.actionsoft.apps.coe.pal_pl_file_security_level_batch_update") - public String updatePalProcessFileSecurityLevel(UserContext me,String fileList){ - CoeProcessLevelWeb web = new CoeProcessLevelWeb(me); - return web.batchUpdateRepositorySecurityLevel(fileList); - } - - /** - * 获取流程文件未标密数量 - * @param me - * @param wsId - * @param teamId - * @return - */ - @Mapping("com.actionsoft.apps.coe.pal_pl_file_unmark_num_query") - public String getPalProcessFileUnmarkNum(UserContext me,String wsId,String teamId){ - CoeProcessLevelWeb web = new CoeProcessLevelWeb(me); - return web.getUnmarkFileNum(wsId,teamId); - } - - /** - * 校验用户是否有访问文件的权限 - * @param me - * @param uuid - * @return - */ - @Mapping("com.actionsoft.apps.coe.pal_pl_file_permission_query") - public String checkPalProcessFilePermission(UserContext me,String uuid){ - CoeProcessLevelWeb web = new CoeProcessLevelWeb(me); - return web.checkFilePemission(uuid).toString(); - } - - /** - * 批量校验文件的密级权限 - * @param me - * @param uuids - * @param isSub 是否进行下属列表密级权限校验 - * @return - */ - @Mapping("com.actionsoft.apps.coe.pal_pl_file_permission_batch_query") - public String checkPalProcessFilePermissionBathch(UserContext me,String uuids,boolean isSub){ - CoeProcessLevelWeb web = new CoeProcessLevelWeb(me); - return web.checkFilePermissionBatch(uuids,isSub).toString(); - } + // 形状关联 + // @Mapping("COE_PAL_PL_RESPOSITORY_DESIGNER_SHAPES_TREE") + @Mapping("com.actionsoft.apps.coe.pal_pl_repository_designer_shapes_tree") + public String COEPALPLRespositoryDesignerRelevanceShapesTree(UserContext me, String wsId, String modelId, String ref, String shapeId, String attrId, String relationShapeIds, String relationFileIds, String teamId, String ruuid) { + DesignerRelationShapeWeb relationShapeWeb = new DesignerRelationShapeWeb(me); + return relationShapeWeb.designerRelevanceShapes(wsId, modelId, ref, shapeId, attrId, relationShapeIds, relationFileIds, teamId, ruuid); + } + + // @Mapping("COE_PAL_PL_RESPOSITORY_DESIGNER_SHAPES_TREE_NODE") + @Mapping("com.actionsoft.apps.coe.pal_pl_repository_designer_shapes_tree_node") + public String COEPALRepositoryDesignerRelevanceShapesTreeDate(UserContext me, String wsId, String pid, String attrId, String ruuid, String teamId) { + DesignerRelationShapeWeb web = new DesignerRelationShapeWeb(me); + return web.getTreeJson(wsId, pid, attrId, ruuid, teamId); + } + + // @Mapping("COE_PAL_PL_RESPOSITORY_DESIGNER_PROCESS_MODELS_TREE_NODE") + @Mapping("com.actionsoft.apps.coe.pal_pl_repository_designer_process_models_tree_node") + public String COEPALRepositoryDesignerRelevanceProcessModelsTreeDate(UserContext me, String wsId, String pid, String methodScope, String attrId, String ruuid, String teamId) { + DesignerRelationShapeWeb web = new DesignerRelationShapeWeb(me); + return web.getProcessModelsTreeJson(wsId, pid, methodScope, attrId, ruuid, teamId); + } + + /** + * 数据属性模型的快速搜索 + * + * @param me + * @param wsId + * @param category + * @return + */ + // @Mapping("COE_PAL_PL_RESPOSITORY_DESIGNER_SHAPES_TREE_QUERY") + @Mapping("com.actionsoft.apps.coe.pal_pl_repository_designer_shapes_tree_query") + public String COEPALRespositoryDesignerRelevanceShapesTreeQuery(UserContext me, String wsId, String category, String autoContent) { + DesignerRelationShapeWeb web = new DesignerRelationShapeWeb(me); + return web.getShapesTreeDataJson(wsId, category, autoContent); + } + + // 形状关联 + // @Mapping("COE_PAL_PL_RESPOSITORY_DESIGNER_SHAPES_INFO") + @Mapping("com.actionsoft.apps.coe.pal_pl_repository_designer_shapes_info") + public String COEPALPLRespositoryDesignerRelevanceShapesInfo(UserContext me, String uuid, String shapeId, String attrId) { + DesignerRelationShapeWeb relationShapeWeb = new DesignerRelationShapeWeb(me); + return relationShapeWeb.designerRelevanceShapesInfo(uuid, shapeId, attrId); + } + + // 流程模型关联 + // @Mapping("COE_PAL_PL_RESPOSITORY_DESIGNER_PROCESS_MODELS_INFO") + @Mapping("com.actionsoft.apps.coe.pal_pl_repository_designer_process_models_info") + public String COEPALPLRespositoryDesignerRelevanceProcessModelsInfo(UserContext me, String uuid, String wsId) { + DesignerRelationShapeWeb relationShapeWeb = new DesignerRelationShapeWeb(me); + return relationShapeWeb.designerRelevanceProcessModelsInfo(uuid, wsId); + } + + // 自定义复制操作时缓存数据 + // @Mapping("COE_PAL_PL_RESPOSITORY_DESIGNER_RELATION_SHAPE_CUSTOM_COPY") + @Mapping("com.actionsoft.apps.coe.pal_pl_repository_designer_relation_shape_custom_copy") + public String COEPALPLRespositoryDesignerRelationShapeCuntomCopy(UserContext me, RequestParams params) { + DesignerRelationShapeWeb relationShapeWeb = new DesignerRelationShapeWeb(me); + String userId = params.get("userId"); + String clientId = params.get("clientId"); + String type = params.get("type"); + String subject = params.get("subject"); + String ver = params.get("ver"); + String shapeId = params.get("shapeId"); + String messageJson = params.get("messageJson"); + String shapeGroupId = params.get("shapeGroupId"); + return relationShapeWeb.respositoryDesignerRelationShapeCustomCopy(userId, clientId, subject, type, ver, shapeId, messageJson, shapeGroupId); + } + + // 自定义复制 + // @Mapping("COE_PAL_PL_RESPOSITORY_DESIGNER_RELATION_SHAPE_CUSTOM_PASTE_AJAX") + @Mapping("com.actionsoft.apps.coe.pal_pl_repository_designer_relation_shape_custom_paste_ajax") + public String COEPALPLRespositoryDesignerRelationShapeCustomPasteAjax(UserContext me, String userId, String clientId, String subject, String action, String type, String ver) { + DesignerRelationShapeWeb relationShapeWeb = new DesignerRelationShapeWeb(me); + return relationShapeWeb.respositoryDesignerRelationShapeCustomPasteAjax(userId, clientId, subject, action, type, ver); + } + + // @Mapping("COE_PAL_PL_REPOSITORY_CUSTOM_PASTE_SHAPE_RELATION_SAVE") + @Mapping("com.actionsoft.apps.coe.pal_pl_repository_custom_paste_shape_relation_save") + public String COEPALPLRepositoryCustomPasteShapeRelationSave(UserContext me, String shapeMap, String relationShape, String pasteRelation) { + DesignerRelationShapeWeb web = new DesignerRelationShapeWeb(me); + return web.pasteRelationSave(shapeMap, relationShape, pasteRelation); + } + + /** + * 图形粘贴对附件的粘贴 + * + * @param me + * @param shapeMap + * @return + */ + // @Mapping("COE_PAL_PL_REPOSITORY_CUSTOM_PASTE_SHAPE_FILE_SAVE") + @Mapping("com.actionsoft.apps.coe.pal_pl_repository_custom_paste_shape_file_save") + public String COEPALPLRepositoryCustomPasteShapeFileSave(UserContext me, String shapeMap) { + UpfileWeb web = new UpfileWeb(me); + return web.pasteShapeFile(shapeMap, me.getUID()); + } + + // 使用什么样的副本进行粘贴 + // @Mapping("COE_PAL_PL_RESPOSITORY_DESIGNER_RELATION_SHAPE_USED_PASTE") + @Mapping("com.actionsoft.apps.coe.pal_pl_repository_designer_relation_shape_used_paste") + public String COEPALPLRespositoryDesignerRelationShapeUsedPaste(UserContext me, String userId) { + DesignerRelationShapeWeb relationShapeWeb = new DesignerRelationShapeWeb(me); + return relationShapeWeb.respositoryDesignerRelationShapeUsed(userId) + ""; + } + + // 形状关联信息的存储 + // @Mapping("COE_PAL_PL_RESPOSITORY_DESIGNER_RELATION_SHAPE_RELEVANCE_SAVE") + @Mapping("com.actionsoft.apps.coe.pal_pl_repository_designer_relation_shape_relevance_save") + public String COEPALPLRespositoryDesignerRelationShapeRelevanceSave(UserContext me, RequestParams params) { + DesignerRelationShapeWeb relationShapeWeb = new DesignerRelationShapeWeb(me); + String relationShapes = params.get("relationShapes"); + String shapeId = params.get("shapeId"); + String fileUUID = params.get("fileUUID"); + String shapeGroupId = params.get("shapeGroupId"); + String attrId = params.get("attrId"); + String ref = params.get("ref"); + return relationShapeWeb.respositoryDesignerRelationShapeRelevanceSave(relationShapes, shapeId, fileUUID, shapeGroupId, attrId, ref); + } + + // 关联形状的展示 + // @Mapping("COE_PAL_PL_RESPOSITORY_DESIGNER_RELATION_SHAPE_RELEVANCE_SHOW") + @Mapping("com.actionsoft.apps.coe.pal_pl_repository_designer_relation_shape_relevance_show") + public String COEPALPLRespositoryDesignerRelationShapeRelevanceShow(UserContext me, RequestParams params) { + DesignerRelationShapeWeb relationShapeWeb = new DesignerRelationShapeWeb(me); + String shapeId = params.get("shapeId"); + String fileId = params.get("fileId"); + return relationShapeWeb.respositoryDesignerRelationShapeRelevanceShow(shapeId, fileId); + } + + // 图形更多属性中,如果删除了一些属性,需要修改关联表中的关联 + // @Mapping("COE_PAL_PL_RESPOSITORY_DESIGNER_RELATION_SHAPE_RELEVANCE_CHECK") + @Mapping("com.actionsoft.apps.coe.pal_pl_repository_designer_relation_shape_relevance_check") + public String COEPALPLRepositoryDesignerRelationShapeRelevanceCheck(UserContext me, String fileId, String shapeId, String attrIds) { + DesignerRelationShapeWeb relationShapeWeb = new DesignerRelationShapeWeb(me); + return relationShapeWeb.relationCheck(fileId, shapeId, attrIds); + } + + // 查询要删除的图形是否被关联 + // @Mapping("COE_PAL_PL_RESPOSITORY_DESIGNER_RELATION_SEARCH") + @Mapping("com.actionsoft.apps.coe.pal_pl_repository_designer_relation_search") + public String COEPALRepositoryDesignerRelationSearch(UserContext me, String fileId, String shapeIds) { + DesignerRelationShapeWeb web = new DesignerRelationShapeWeb(me); + return web.relationSearch(fileId, shapeIds); + } + + // 属性关联的形状显示 + // @Mapping("COE_PAL_PL_RESPOSITORY_DESIGNER_RELATION_SHAPE_RELEVANCE_NAME") + @Mapping("com.actionsoft.apps.coe.pal_pl_repository_designer_relation_shape_relevance_name") + public String COEPALPLRespositoryDesignerRelationShapeRelevancName(UserContext me, RequestParams params) { + DesignerRelationShapeWeb relationShapeWeb = new DesignerRelationShapeWeb(me); + String fileId = params.get("fileId"); + String shapeId = params.get("shapeId"); + String shapeName = params.get("shapeName"); + String shapeCategory = params.get("shapeCategory"); + return relationShapeWeb.respositoryDesignerRelationShapeRelevanceName(fileId, shapeId, shapeName, shapeCategory); + } + + // 关联的删除 + // @Mapping("COE_PAL_PL_RESPOSITORY_DESIGNER_RELATION_SHAPE_RELEVANCE_REMOVE") + @Mapping("com.actionsoft.apps.coe.pal_pl_repository_designer_relation_shape_relevance_remove") + public String COEPALPLRespositoryDesignerRelationShapeRelevancRemove(UserContext me, RequestParams params) { + DesignerRelationShapeWeb relationShapeWeb = new DesignerRelationShapeWeb(me); + String attrId = params.get("uuid"); + String fileId = params.get("fileId"); + String shapeId = params.get("shapeId"); + return relationShapeWeb.removeRelationByAttrId(fileId, shapeId, attrId); + } + + // 报告生成器首页 + // @Mapping("COE_PAL_OUTPUTREPORT_HOME") + @Mapping("com.actionsoft.apps.coe.pal_outputreport_home") + public String COEPALOutPutReportHome(UserContext me, String wsid) { + OutPutReportWeb outPutReport = new OutPutReportWeb(me); + return outPutReport.outPutReportHome(wsid, ""); + } + + // 报告生成器首页 + // @Mapping("COE_PAL_OUTPUTREPORT_HOME_DATA") + @Mapping("com.actionsoft.apps.coe.pal_outputreport_home_data") + public String COEPALOutPutReportHomeData(UserContext me, RequestParams params) { + OutPutReportWeb outPutReport = new OutPutReportWeb(me); + int start = params.getInt("start"); + int end = params.getInt("end"); + String wsid = params.get("wsid"); + String teamId = params.get("teamId"); + String data = params.get("data"); + return outPutReport.getTaskData(start, end, wsid, teamId, data); + } + + // 报告生成器首页 + + // @Mapping("COE_PAL_OUTPUTREPORT_JSON_DATA") + @Mapping("com.actionsoft.apps.coe.pal_outputreport_json_data") + public String COEPALOutPutReportJsonData(UserContext me, String language, String templateOperate) { + OutPutReportWeb outPutReport = new OutPutReportWeb(me); + return outPutReport.jsonData(language, templateOperate); + } + + // @Mapping("COE_PAL_OUTPUTREPORT_PAL_FILE_JSON_DATA") + @Mapping("com.actionsoft.apps.coe.pal_outputreport_pal_file_json_data") + public String COEPALOutPutReportPALFileJsonData(UserContext me, String methodType, String wsid, String pid, String versionType, String teamId) { + OutPutReportWeb outPutReport = new OutPutReportWeb(me); + return outPutReport.PALFileJsonData(methodType, wsid, pid, versionType, teamId); + } + + // @Mapping("COE_PAL_OUTPUTREPORT_PAL_FILE_JSON_DATA_ROOT") + @Mapping("com.actionsoft.apps.coe.pal_outputreport_pal_file_json_data_root") + public String COEPALOutPutReportPALFileJsonDataRoot(UserContext me, String methodType, String wsid, String versionType, String teamId, String targetMethodType) { + OutPutReportWeb outPutReport = new OutPutReportWeb(me); + return outPutReport.PALFileJsonDataRoot(methodType, wsid, versionType, teamId, targetMethodType); + } + + // @Mapping("COE_PAL_OUTPUTREPORT_PAL_FILE_JSON_DATA_ROOT_TREE_DATA") + @Mapping("com.actionsoft.apps.coe.pal_outputreport_pal_file_json_data_root_tree_data") + public String COEPALOutPutReportPALFileJsonDataRootTreeData(UserContext me, String methodType, String wsid, String versionType, String teamId) { + OutPutReportWeb outPutReport = new OutPutReportWeb(me); + return outPutReport.PALFileJsonDataRootTreeData(methodType, wsid, versionType, teamId); + } + + // @Mapping("COE_PAL_OUTPUTREPORT_PAL_FILE_RELATION_JSON_DATA_ROOT") + @Mapping("com.actionsoft.apps.coe.pal_file_relation_json_data_root") + public String COEPALOutPutReportPALFileRelationJsonDataRoot(UserContext me, String methodType, String wsid, String versionType, String teamId) { + OutPutReportWeb outPutReport = new OutPutReportWeb(me); + return outPutReport.PALFileRelationJsonDataRoot(methodType, wsid, versionType, teamId); + } + + // @Mapping("COE_PAL_OUTPUTREPORT_PAL_FILE_RELATION_JSON_DATA") + @Mapping("com.actionsoft.apps.coe.pal_outputreport_pal_file_relation_json_data") + public String COEPALOutPutReportPALFileRelationJsonData(UserContext me, String methodType, String wsid, String pid, String versionType, String teamId) { + OutPutReportWeb outPutReport = new OutPutReportWeb(me); + return outPutReport.PALFileRelationJsonData(methodType, pid, wsid, versionType, teamId); + } + + // 获得流程文件中某个类型的所有图形元素 + // @Mapping("COE_PAL_OUTPUTREPORT_PAL_FILE_SHAPES") + @Mapping("com.actionsoft.apps.coe.pal_outputreport_pal_file_shapes") + public String getRepositoryShapes(UserContext me, String uuid, String type) { + OutPutReportWeb web = new OutPutReportWeb(me); + return web.getRepositoryShapes(uuid, type); + } + + /** + * 报告保存 + * + * @param me + * @param params + * @return + */ + // @Mapping("COE_PAL_OUTPUTREPORT_COMPLETE") + @Mapping("com.actionsoft.apps.coe.pal_outputreport_complete") + public String COEPALOutPutReportSave(UserContext me, RequestParams params) { + OutPutReportWeb outPutReport = new OutPutReportWeb(me); + String lang = params.get("lang"); + String taskName = params.get("taskName"); + String userId = params.get("userId"); + String wsId = params.get("wsId"); + String teamId = params.get("teamId"); + String profileId = params.get("profileId"); + String isExecute = params.get("isExecute"); + String config = params.get("config"); + String targetFileId = params.get("targetFileId"); + String targetShape = params.get("targetShape"); + String relationFileId = params.get("relationFileId"); + String isModify = params.get("isModify"); + String taskId = params.get("taskId"); + return outPutReport.reportSave(lang, taskName, userId, teamId, profileId, wsId, isExecute, config, targetFileId, targetShape, relationFileId, isModify, taskId); + } + + /** + * 报告删除 + * + * @param me + * @param params + * @return + */ + // @Mapping("COE_PAL_OUTPUTREPORT_DELETE") + @Mapping("com.actionsoft.apps.coe.pal_outputreport_delete") + public String COEPALOutPutReportDelete(UserContext me, RequestParams params) { + OutPutReportWeb outPutReport = new OutPutReportWeb(me); + String wsid = params.get("wsid"); + String id = params.get("id"); + String profileId = params.get("profileId"); + String teamId = params.get("teamId"); + return outPutReport.reportDelete(id, wsid, profileId, teamId); + } + + /** + * 报告统计 + * + * @param me + * @param params + * @return + */ + // @Mapping("COE_PAL_OUTPUTREPORT_HOME_DATA_COUNT") + @Mapping("com.actionsoft.apps.coe.pal_outputreport_home_data_count") + public String COEPALOutPutReportCount(UserContext me, RequestParams params) { + OutPutReportWeb outPutReport = new OutPutReportWeb(me); + String wsid = params.get("wsid"); + String teamId = params.get("teamId"); + String data = params.get("data"); + return outPutReport.reportCount(teamId, wsid, data); + } + + /** + * 报告执行 + * + * @param me + * @param params + * @return + */ + // @Mapping("COE_PAL_OUTPUTREPORT_EXECUTE") + @Mapping("com.actionsoft.apps.coe.pal_outputreport_execute") + public String COEPALOutPutReportExecute(UserContext me, RequestParams params) { + OutPutReportWeb outPutReport = new OutPutReportWeb(me); + String wsid = params.get("wsid"); + String id = params.get("id"); + String profileId = params.get("profileId"); + return outPutReport.reportExecute(id, wsid, profileId); + } + + /** + * 报告修改 + * + * @param me + * @param params + * @return + */ + // @Mapping("COE_PAL_OUTPUTREPORT_MODIRY") + @Mapping("com.actionsoft.apps.coe.pal_outputreport_modify") + public String COEPALOutPutReportModify(UserContext me, RequestParams params) { + OutPutReportWeb outPutReport = new OutPutReportWeb(me); + String id = params.get("id"); + return outPutReport.reportModify(id); + } + + /** + * 单个报告的刷新 + * + * @param me + * @param params + * @return + */ + // @Mapping("COE_PAL_OUTPUTREPORT_EXECUTE_REFRESH") + @Mapping("com.actionsoft.apps.coe.pal_outputreport_execute_refresh") + public String COEPALOutPutReportExecuteRefresh(UserContext me, RequestParams params) { + OutPutReportWeb outPutReport = new OutPutReportWeb(me); + String id = params.get("id"); + String teamId = params.get("teamId"); + return outPutReport.refreshRowData(id, teamId); + } + + /** + * 下载模版 + * + * @param me + * @param appId 模版所属应用 + * @param templates 模版路径名称 + * @return + */ + // @Mapping("COE_PAL_OUTPUTREPORT_TEMPLATES_DOWNLOAD") + @Mapping("com.actionsoft.apps.coe.pal_outputreport_templates_download") + public String downloadOutPutReportTemplates(UserContext me, String appId, String templates) { + OutPutReportWeb web = new OutPutReportWeb(me); + return web.downloadOutPutReportTemplates(appId, templates); + } + + /** + * 上传模版 + * + * @param me + * @param appId 模版所属应用 + * @param param 模版在dc中的路径参数 + * @return + */ + // @Mapping("COE_PAL_OUTPUTREPORT_TEMPLATES_UPLOAD") + @Mapping("com.actionsoft.apps.coe.pal_outputreport_templates_upload") + public String uploadOutPutReportTemplates(UserContext me, String appId, String profileId, String param) { + OutPutReportWeb web = new OutPutReportWeb(me); + return web.uploadOutPutReportTemplates(appId, profileId, param); + } + + // @Mapping("COE_PAL_PUBLISHER_ADD_HOME") + @Mapping("com.actionsoft.apps.coe.pal_publisher_add_home") + public String COEPALPublisherData(UserContext me, String wsid, String teamId) { + ProcessPublishWeb web = new ProcessPublishWeb(me); + return web.PALPublisherData(wsid, teamId); + } + + // @Mapping("COE_PAL_PUBLISHER_STOP_HOME") + @Mapping("com.actionsoft.apps.coe.pal_publisher_stop_home") + public String COEPALPublisherStopDataHome(UserContext me, String wsid, String teamId) { + ProcessPublishWeb web = new ProcessPublishWeb(me); + return web.PALPublisherData(wsid, teamId); + } + + // @Mapping("COE_PAL_PUBLISHER_CHANGE_HOME") + @Mapping("com.actionsoft.apps.coe.pal_publisher_change_home") + public String COEPALPublisherChangeDataHome(UserContext me, String wsid, String teamId) { + ProcessPublishWeb web = new ProcessPublishWeb(me); + return web.PALPublisherData(wsid, teamId); + } + + /** + * 新发布流程申请 + * + * @param me + * @param processInstId + * @param taskInstId + * @param openState + * @param currentPage + * @param formItemDefId + * @param formData + * @return + */ + // @Mapping("COE_PAL_PUBLISH_ADD_SAVE_DATA") + @Mapping("com.actionsoft.apps.coe.pal_publish_add_save_data") + public String COEPALPublishAddSaveData(UserContext me, String processInstId, String taskInstId, int openState, int currentPage, String formItemDefId, String formData) { + JSONArray jsonArr = JSONArray.parseArray(formData); + FormEngine web = new FormEngine(me, processInstId, taskInstId, openState, currentPage); + for (int i = 0; i < jsonArr.size(); i++) { + JSONObject json = jsonArr.getJSONObject(i); + if (json.getString("id").length() < 16) { + continue; + } + JSONObject jsonData = new JSONObject(); + jsonData.put("PUBLISHDESC", ""); + jsonData.put("PUBLISTHTYPE", json.getString("fileType")); + jsonData.put("PUBLISHFILENAME", json.getString("name")); + jsonData.put("PUBLISHVERSION", json.getString("fileVersion")); + jsonData.put("PUBLISHFILEID", json.getString("id")); + formData = jsonData.toString(); + boolean isCreate = true; + String rowBoId = UUIDGener.getUUID(); + web.saveCommonGridRowData(web.getContext(), formItemDefId, rowBoId, formData, isCreate, "", "", "", false); + } + ResponseObject ro = ResponseObject.newOkResponse(); + ro.msg(I18nRes.findValue(AppsConst.SYS_APP_PORTAL, "保存成功")); + return ro.toString(); + } + + /** + * 新发布流程申请 + * + * @param me + * @param processInstId + * @param taskInstId + * @param openState + * @param currentPage + * @param formItemDefId + * @param formData + * @return + */ + // @Mapping("COE_PAL_PUBLISH_STOP_SAVE_DATA") + @Mapping("com.actionsoft.apps.coe.pal_publish_stop_save_data") + public String COEPALPublishStopSaveData(UserContext me, String processInstId, String taskInstId, int openState, int currentPage, String formItemDefId, String formData) { + JSONArray jsonArr = JSONArray.parseArray(formData); + FormEngine web = new FormEngine(me, processInstId, taskInstId, openState, currentPage); + for (int i = 0; i < jsonArr.size(); i++) { + JSONObject json = jsonArr.getJSONObject(i); + if (json.getString("id").length() < 16) { + continue; + } + JSONObject jsonData = new JSONObject(); + jsonData.put("STOPDESC", ""); + jsonData.put("STOPTYPE", json.getString("fileType")); + jsonData.put("STOPFILENAME", json.getString("name")); + jsonData.put("STOPVERSION", json.getString("fileVersion")); + jsonData.put("STOPFILEID", json.getString("id")); + formData = jsonData.toString(); + boolean isCreate = true; + String rowBoId = UUIDGener.getUUID(); + web.saveCommonGridRowData(web.getContext(), formItemDefId, rowBoId, formData, isCreate, "", "", "", false); + } + ResponseObject ro = ResponseObject.newOkResponse(); + ro.msg(I18nRes.findValue(AppsConst.SYS_APP_PORTAL, "保存成功")); + return ro.toString(); + } + + /** + * 新发布流程申请 + * + * @param me + * @param processInstId + * @param taskInstId + * @param openState + * @param currentPage + * @param formItemDefId + * @param formData + * @return + */ + // @Mapping("COE_PAL_PUBLISH_CHANGE_SAVE_DATA") + @Mapping("com.actionsoft.apps.coe.pal_publish_change_save_data") + public String COEPALPublishChangeSaveData(UserContext me, String processInstId, String taskInstId, int openState, int currentPage, String formItemDefId, String formData) { + JSONArray jsonArr = JSONArray.parseArray(formData); + FormEngine web = new FormEngine(me, processInstId, taskInstId, openState, currentPage); + for (int i = 0; i < jsonArr.size(); i++) { + JSONObject json = jsonArr.getJSONObject(i); + if (json.getString("id").length() < 16) { + continue; + } + JSONObject jsonData = new JSONObject(); + jsonData.put("CHANGEDDESC", ""); + jsonData.put("CHANGETYPE", json.getString("fileType")); + jsonData.put("CHANGEFILENAME", json.getString("name")); + jsonData.put("CHANGEDVERSION", json.getString("fileVersion")); + jsonData.put("CHANGEFILEID", json.getString("id")); + formData = jsonData.toString(); + boolean isCreate = true; + String rowBoId = UUIDGener.getUUID(); + web.saveCommonGridRowData(web.getContext(), formItemDefId, rowBoId, formData, isCreate, "", "", "", false); + } + ResponseObject ro = ResponseObject.newOkResponse(); + ro.msg(I18nRes.findValue(AppsConst.SYS_APP_PORTAL, "保存成功")); + return ro.toString(); + } + + /** + * 新增发布子表单数据 + * + * @param me + * @param processInstId + * @return + */ + // @Mapping("COE_PAL_PUBLISH_ADD_SHOW_DATA") + @Mapping("com.actionsoft.apps.coe.pal_publish_add_show_data") + public String COEPALPublishAddShowData(UserContext me, String processInstId) { + ProcessPublishWeb web = new ProcessPublishWeb(me); + return web.getPublishAddData(processInstId); + } + + /** + * 停用发布子表单数据 + * + * @param me + * @param processInstId + * @return + */ + // @Mapping("COE_PAL_PUBLISH_STOP_SHOW_DATA") + @Mapping("com.actionsoft.apps.coe.pal_publish_stop_show_data") + public String COEPALPublishStopShowData(UserContext me, String processInstId) { + ProcessPublishWeb web = new ProcessPublishWeb(me); + return web.getPublishStopData(processInstId); + } + + /** + * 修改发布子表单数据 + * + * @param me + * @param processInstId + * @return + */ + // @Mapping("COE_PAL_PUBLISH_CHANGE_SHOW_DATA") + @Mapping("com.actionsoft.apps.coe.pal_publish_change_show_data") + public String COEPALPublishChangeShowData(UserContext me, String processInstId) { + ProcessPublishWeb web = new ProcessPublishWeb(me); + return web.getPublishChangeData(processInstId); + } + + /** + * 获取资产库文件发布历史 + * + * @param me + * @param repositoryId + * @param wsId + * @return + * @author zhangming + */ + // @Mapping("COE_PAL_PUBLISH_HISTORY_OF_REPOSITORY") + @Mapping("com.actionsoft.apps.coe.pal_publish_history_of_repository") + public String COEPALPublishHistoryOfRepository(UserContext me, String repositoryId, String wsId) { + ProcessPublishWeb web = new ProcessPublishWeb(me); + return web.getPublishHistoryList(repositoryId, wsId); + } + + /** + * 资产库备份首页 + * + * @param me + * @param wsId + * @return + * @author zhangming + */ + // @Mapping("COE_PAL_BACKUP_HOME") + @Mapping("com.actionsoft.apps.coe.pal_backup_home") + public String CoEPALBackupHome(UserContext me, String wsId) { + CoEPALBackupWeb web = new CoEPALBackupWeb(me); + return web.getHomePage(wsId); + } + + /** + * 资产库备份首页-数据 + * + * @param me + * @param wsId + * @return + * @author zhangming + */ + // @Mapping("COE_PAL_BACKUP_DATA") + @Mapping("com.actionsoft.apps.coe.pal_backup_data") + public String CoEPALBackupData(UserContext me, String wsId) { + CoEPALBackupWeb web = new CoEPALBackupWeb(me); + return web.getBackupData(wsId); + } + + /** + * 资产库备份-新增 + * + * @param me + * @param wsId + * @param remark + * @return + * @author zhangming + */ + // @Mapping("COE_PAL_BACKUP_ADD") + @Mapping("com.actionsoft.apps.coe.pal_backup_add") + public String CoEPALBackupAdd(UserContext me, String wsId, String remark) { + CoEPALBackupWeb web = new CoEPALBackupWeb(me); + return web.saveBackup(wsId, remark); + } + + /** + * 资产库备份-删除 + * + * @param me + * @param wsId + * @param id + * @return + * @author zhangming + */ + // @Mapping("COE_PAL_BACKUP_DELETE") + @Mapping("com.actionsoft.apps.coe.pal_backup_delete") + public String CoEPALBackupDelete(UserContext me, String wsId, String id) { + CoEPALBackupWeb web = new CoEPALBackupWeb(me); + return web.deleteBackup(wsId, id); + } + + /** + * 资产库备份-恢复 + * + * @param me + * @param wsId + * @param id + * @return + * @author zhangming + */ + // @Mapping("COE_PAL_BACKUP_RECOVER") + @Mapping("com.actionsoft.apps.coe.pal_backup_recover") + public String CoEPALBackupRecover(UserContext me, String wsId, String id) { + CoEPALBackupWeb web = new CoEPALBackupWeb(me); + return web.recoverBackup(wsId, id); + } + + /** + * 资产库备份-获取状态 + * + * @param me + * @param wsId + * @param id + * @return + * @author zhangming + */ + // @Mapping("COE_PAL_BACKUP_STATE") + @Mapping("com.actionsoft.apps.coe.pal_backup_state") + public String CoEPALBackupState(UserContext me, String wsId, String id) { + CoEPALBackupWeb web = new CoEPALBackupWeb(me); + return web.getBackupState(wsId, id); + } + + /** + * 资产库备份-导出备份数据 + * + * @param me + * @param wsId + * @param id + * @return + * @throws Exception + */ + // @Mapping("COE_PAL_BACKUP_EXPORT") + @Mapping("com.actionsoft.apps.coe.pal_backup_export") + public String CoEPALBackupExport(UserContext me, String wsId, String id) throws Exception { + CoEPALBackupWeb web = new CoEPALBackupWeb(me); + return web.getBackupExport(wsId, id); + } + + /** + * 资产库备份-导出备份数据-进度查询 + * + * @param me + * @param wsId + * @param id + * @return + * @throws Exception + */ + // @Mapping("COE_PAL_BACKUP_EXPORT_PROGRESS") + @Mapping("com.actionsoft.apps.coe.pal_backup_export_progress") + public String CoEPALBackupExportProgress(UserContext me, String wsId, String id) throws Exception { + CoEPALBackupWeb web = new CoEPALBackupWeb(me); + return web.getBackupExportProgress(wsId, id); + } + + /** + * 资产库备份-导出备份数据-下载地址 + * + * @param me + * @param wsId + * @param id + * @return + * @throws Exception + */ + // @Mapping("COE_PAL_BACKUP_EXPORT_DOWNLOAD") + @Mapping("com.actionsoft.apps.coe.pal_backup_export_download") + public String CoEPALBackupExportDownload(UserContext me, String wsId, String id) throws Exception { + CoEPALBackupWeb web = new CoEPALBackupWeb(me); + return web.getBackupExportDownload(wsId, id); + } + + /** + * 资产库备份-修改 + * + * @param me + * @param id + * @param remark + * @return + * @author zhangming + */ + // @Mapping("COE_PAL_BACKUP_UPDATE") + @Mapping("com.actionsoft.apps.coe.pal_backup_update") + public String CoEPALBackupUpdate(UserContext me, String id, String remark) { + CoEPALBackupWeb web = new CoEPALBackupWeb(me); + return web.updateBackup(id, remark); + } + + /** + * 导入org模型 + * + * @param me + * @param wsId + * @param parentId + * @param fileName + * @return + * @author zhangming + */ + // @Mapping("COE_PAL_REPOSITORY_IMPORT_ORG") + @Mapping("com.actionsoft.apps.coe.pal_repository_import_org") + public String CoEPALRepositoryImportOrg(UserContext me, String wsId, String teamId, String parentId, String fileName) { + CoeProcessLevelWeb web = new CoeProcessLevelWeb(me); + return web.importOrgModel(wsId, parentId, fileName, teamId); + } + + /** + * 导入org模型的excel下载模板 + * + * @param me + * @param category + * @return + * @author zhangming + */ + // @Mapping("COE_PAL_REPOSITORY_IMPORT_ORG_TEMPLATE") + @Mapping("com.actionsoft.apps.coe.pal_repository_import_org_template") + public String CoEPALRepositoryTemplateOrgUrl(UserContext me, String category) { + CoeProcessLevelWeb web = new CoeProcessLevelWeb(me); + return web.getImportTemplateUrl(category); + } + + /** + * 部门流程根节点 + * + * @param me + * @param wsId + * @param categorys + * @return + */ + // @Mapping("COE_PAL_REPOSITORY_GET_PAL_TREEDATA_BY_DEPT") + @Mapping("com.actionsoft.apps.coe.pal_repository_get_pal_treedata_by_dept") + public String getCoEPALRepositoryTreeDataByDept(UserContext me, String wsId, String categorys) { + CoeProcessLevelWeb web = new CoeProcessLevelWeb(me); + return web.getCoEPALRepositoryTreeDataByDept(wsId, categorys); + } + + /** + * 流程根节点 + * + * @param me + * @param wsId + * @param categorys + * @return + */ + // @Mapping("COE_PAL_REPOSITORY_GET_PAL_TREEDATA") + @Mapping("com.actionsoft.apps.coe.pal_repository_get_pal_treedata") + public String getCoEPALRepositoryTreeData(UserContext me, String wsId, String categorys) { + CoeProcessLevelWeb web = new CoeProcessLevelWeb(me); + return web.getCoEPALRepositoryTreeData(wsId, categorys); + } + + /** + * 查询流程的链接 + * + * @param me + * @param wsId + * @param plId + * @return + */ + // @Mapping("COE_PAL_LINK_OF_REPOSITORY") + @Mapping("com.actionsoft.apps.coe.pal_link_of_repository") + public String getPALLinkOfRepository(UserContext me, String wsId, String plId) { + CoeProcessLevelWeb web = new CoeProcessLevelWeb(me); + return web.getPALLinkOfRepository(wsId, plId); + } + + /** + * 全量保存流程文件 + * + * @param me + * @param uuid + * @param define + * @return + */ + // @Mapping("COE_PAL_REPOSITORY_PROCESS_DEFINE_SAVE") + @Mapping("com.actionsoft.apps.coe.pal_repository_process_define_save") + public String saveProcessDefine(UserContext me, String uuid, String define, String teamId, String messages) { + CoeProcessLevelWeb web = new CoeProcessLevelWeb(me); + + String ro = ""; + try { + ro = web.saveProcessDefine(me, uuid, define, teamId, messages); + } catch (IOException e) { + e.printStackTrace(); + return ResponseObject.newErrResponse(ExceptionUtil.getMessage(e)).toString(); + } + return ro; + } + + /** + * 检查流程的锁定信息 + * + * @param me + * @param uuid + * @return + */ + // @Mapping("COE_PAL_REPOSITORY_PROCESS_DEFINE_GET_LOCK_INFO") + @Mapping("com.actionsoft.apps.coe.pal_repository_process_define_get_lock_info") + public String getCheckoutInfo(UserContext me, String uuid) { + CoeDesignerWeb web = new CoeDesignerWeb(me); + return web.getCheckoutInfo(uuid); + } + + /** + * 强制获取流程编辑权 + * + * @param me + * @param uuid + * @return + */ + // @Mapping("COE_PAL_REPOSITORY_PROCESS_DEFINE_EDIT_GETLOCK") + @Mapping("com.actionsoft.apps.coe.pal_repository_process_define_edit_getlock") + public String setCheckoutRight(UserContext me, String uuid) { + CoeDesignerWeb web = new CoeDesignerWeb(me); + return web.setCheckoutRight(uuid); + } + + /** + * 释放流程编辑权 + * + * @param me + * @param uuid + * @return + */ + // @Mapping("COE_PAL_REPOSITORY_PROCESS_DEFINE_EDIT_RELEASELOCK") + @Mapping("com.actionsoft.apps.coe.pal_repository_process_define_edit_releaselock") + public String releaseCheckoutRight(UserContext me, String uuid) { + CoeDesignerWeb web = new CoeDesignerWeb(me); + return web.releaseCheckoutRight(uuid); + } + + /** + * 删除流程节点文本或删除节点,修改关联表中的数据 + * + * @param me + * @param uuid + * @param shapeId + * @param shapeText + * @param type + * @return + */ + // @Mapping("COE_PAL_REPOSITORY_DESIGNER_SHAPE_UPDATE_TEXT_OR_DELETE") + @Mapping("com.actionsoft.apps.coe.pal_repository_designer_shape_update_text_or_delete") + public String updateShapeTextOrDeleteShape(UserContext me, String uuid, String shapeId, String shapeText, int type) { + CoeDesignerWeb web = new CoeDesignerWeb(me); + return web.updateShapeTextOrDeleteShape(uuid, shapeId, shapeText, type); + } + + /** + * shape同名符号提示 + * + * @param me + * @param uuid + * @param shapeId + * @param shapeText + * @return + */ + // @Mapping("COE_PAL_REPOSITORY_DESIGNER_SHAPE_SAME_TEXT_CHECK") + @Mapping("com.actionsoft.apps.coe.pal_repository_designer_shape_same_text_check") + public String getShapeSameTexts(UserContext me, String uuid, String shapeId, String shapeText) { + CoeDesignerWeb web = new CoeDesignerWeb(me); + return web.getShapeSameTexts(uuid, shapeId, shapeText); + } + + /** + * 节点属性是deptAddress,获取关联的部门名称 + * + * @param me + * @param deptIds + * @return + */ + // @Mapping("COE_PAL_PL_RESPOSITORY_DESIGNER_RELATION_SHAP_DEPT_NAME") + @Mapping("com.actionsoft.apps.coe.pal_pl_repository_designer_relation_shape_deptname_query") + public String repositoryDesignerRelationShapDeptName(UserContext me, String deptIds) { + CoeDesignerWeb web = new CoeDesignerWeb(me); + return web.getRelationShapDeptName(deptIds); + } + + /** + * 导出流程 + * + * @param me + * @param wsId + * @param uuid + * @return + * @throws Exception + */ + // @Mapping("COE_PAL_PL_REPOSITORY_PROCESSLEVEL_EXPORT_REPOSITORY") + @Mapping("com.actionsoft.apps.coe.pal_pl_repository_processlevel_repository_export") + public String exportRepository(UserContext me, String wsId, String uuid) throws Exception { + CoeProcessLevelWeb web = new CoeProcessLevelWeb(me); + return web.exportRepository(wsId, uuid); + } + + /** + * 导入流程 + * + * @param me + * @param wsId + * @param uuid + * @return + * @throws Exception + */ + // @Mapping("COE_PAL_PL_REPOSITORY_PROCESSLEVEL_IMPORT_REPOSITORY") + @Mapping("com.actionsoft.apps.coe.pal_pl_repository_processlevel_repository_import") + public String importRepository(UserContext me, String wsId, String uuid, String fileName) throws Exception { + CoeProcessLevelWeb web = new CoeProcessLevelWeb(me); + return web.importRepository(wsId, uuid, fileName); + } + + /* + * 锁定 解锁当前流程模型 其他人员只能读,不可修改 + * @param uuid 流程模型唯一标识 + * @param optype 操作 lockpro 锁定 unlockpro 解锁 + * */ + // @Mapping("COE_PAL_PL_RESPOSITORY_LOCK_UNLUCK_PROCESS") + @Mapping("com.actionsoft.apps.coe.pal_pl_repository_lock_or_unlock_process") + public String COEPALlockOrUnlockProcess(UserContext me, String uuid, String optype) { + CoeDesignerWeb designerWeb = new CoeDesignerWeb(me); + return designerWeb.lockOrUnlockProcess(uuid, optype); + } + + /** + * 判断当前流程模型是否已经上锁 上锁人员 + * + * @param me + * @param uuid + * @return + */ + // @Mapping("COE_PAL_PL_RESPOSITORY_CHECK_PROCESS_LOCK_STATE") + @Mapping("com.actionsoft.apps.coe.pal_pl_repository_process_lock_state_check") + public String checkProcessLockState(UserContext me, String uuid) { + CoeDesignerWeb designerWeb = new CoeDesignerWeb(me); + return designerWeb.checkProcessLockState(uuid); + } + + /** + * 根据流程源文件校验节点关联属性是否存在有关联节点id但是数据库无该关联信息的情况 + * 根据流程源文件反向插入关联数据到APP_ACT_COE_PAL_SHAPE_RLAT + * + * @param wsId + * @return + */ + // @Mapping("COE_PAL_WS_CHECK_SHAPE_RELATION_INTEGRITY") + @Mapping("com.actionsoft.apps.coe.pal_ws_shape_relation_integrity_check") + public String COEPALCheckShapeRelationIntegrity(UserContext me, String wsId) { + DesignerRelationShapeWeb web = new DesignerRelationShapeWeb(me); + return web.checkAndRepairShapeRelation(wsId); + } + + /** + * 关联关系DB数据恢复 + * + * @param lossData 需要恢复的数据 + */ + // @Mapping("COE_PAL_WS_SHAPE_RELATION_RESTORE") + @Mapping("com.actionsoft.apps.coe.pal_ws_shape_relation_restore") + public String COEPALShapeRelationRestore(UserContext me, String lossData) { + DesignerRelationShapeWeb web = new DesignerRelationShapeWeb(me); + return web.shapeRelationRestore(lossData); + } + + /** + * 特殊文件属性(列表形式属性)保存 + * + * @return + */ + // @Mapping("COE_PAL_PROCESSLEVEL_SPECIAL_ATTRIBUTE_SAVE") + @Mapping("com.actionsoft.apps.coe.pal_processlevel_special_attribute_save") + public String COEPALPROCESSLEVELSpecialAttributeSave(UserContext me, String wsId, String id, String plId, String type, String opType, String value) { + CoeProcessLevelWeb web = new CoeProcessLevelWeb(me); + return web.SpecialAttributeSave(wsId, id, plId, type, opType, value); + } + + /** + * 特殊文件属性(列表形式属性)删除 + * + * @return + */ + // @Mapping("COE_PAL_PROCESSLEVEL_SPECIAL_ATTRIBUTE_DELETE") + @Mapping("com.actionsoft.apps.coe.pal_processlevel_special_attribute_delete") + public String COEPALPROCESSLEVELSpecialAttributeDelete(UserContext me, String id) { + CoeProcessLevelWeb web = new CoeProcessLevelWeb(me); + return web.SpecialAttributeSaveDelete(id); + } + + /** + * 检测是否可以导出流程手册 + * + * @param me + * @param fileId + * @return + */ + // @Mapping("COE_PAL_OUTPUTREPORT_OUTPUT_PROCESS_CHECK") + @Mapping("com.actionsoft.apps.coe.pal_outputreport_output_process_check") + public String COEPALOUTPUTREPORTOutputProcessCheck(UserContext me, String fileId) { + OutPutReportWeb web = new OutPutReportWeb(me); + return web.checkOutputProcess(fileId); + } + + // @Mapping("COE_PAL_OUTPUTREPORT_OUTPUT_PROCESS_CREATE") + @Mapping("com.actionsoft.apps.coe.pal_outputreport_output_process_create") + public String COEPALOUTPUTREPORTOutputProcessCreate(UserContext me, String wsId, String teamId, String fileId) { + PALRepositoryModel model = PALRepositoryCache.getCache().get(fileId); + String methodId = model.getMethodId(); + if ("data.form".equals(methodId)) { + return PALRepositoryQueryAPIManager.getInstance().createOutputReportBd(wsId, me.getUID(), teamId, fileId); + } else if ("control.policy".equals(methodId)) { + return PALRepositoryQueryAPIManager.getInstance().createOutputReportZd(wsId, me.getUID(), teamId, fileId); + } + return PALRepositoryQueryAPIManager.getInstance().createOutputReportPr(wsId, me.getUID(), teamId, fileId); + } + + /** + * 流程手册预览 + * + * @param me + * @param taskId + * @return + */ + // @Mapping("COE_PAL_OUTPUTREPORT_OUTPUT_PROCESS_PREVIEW") + @Mapping("com.actionsoft.apps.coe.pal_outputreport_output_process_preview") + public String COEPALOUTPUTREPORTOutputProcessPreview(UserContext me, String taskId) { + return PALRepositoryQueryAPIManager.getInstance().outputReportPreview(me, taskId); + } + + + /** + * 流程阅览 流程手册下载 + * + * @param me + * @param taskId + * @return by zhaolei + */ + @Mapping("com.actionsoft.apps.coe.pal_outputreport_output_process_download") + public String COEPALOUTPUTREPORTOutputProcessDownload(UserContext me, String taskId, String ruuid) { + return PALRepositoryQueryAPIManager.getInstance().outputReportDownload(me, taskId, ruuid); + } + + + /** + * 查询导出组织模型等结构 + * 简单查询 + * + * @param me + * @param ruuid + * @param wsId + * @return + */ + // @Mapping(value="COE_PAL_PL_RESPOSITORY_EXPORT_ORG_DATA") + @Mapping("com.actionsoft.apps.coe.pal_pl_repository_export_org_data") + public String COEPALRESPOSITORYExportOrgData(UserContext me, String ruuid, String wsId) { + CoeProcessLevelWeb web = new CoeProcessLevelWeb(me); + return web.exportOrgData(wsId, ruuid); + } + + /** + * 制度表单等工具栏中上传附件删除 + * + * @param ruuid + * @param fileName + * @return + */ + // @Mapping(value="COE_PAL_PROCESSLEVEL_SHAPE_UPFILE_DEL") + @Mapping("com.actionsoft.apps.coe.pal_processlevel_shape_upfile_del") + public String COEPALPROCESSLEVELShapeUpfileDel(UserContext me, String appId, String repositoryName, String groupValue, String ruuid, String fileName) { + CoeProcessLevelWeb web = new CoeProcessLevelWeb(me); + return web.delShapeUpfile(appId, repositoryName, groupValue, ruuid, fileName); + } + + /** + * 制度表单等工具栏中上传附件保存并生成相应活动节点 + * + * @param ruuid + * @param fileNames + * @return + */ + // @Mapping(value="COE_PAL_PROCESSLEVEL_SHAPE_UPFILE_SAVE") + @Mapping("com.actionsoft.apps.coe.pal_processlevel_shape_upfile_save") + public String COEPALPROCESSLEVELShapeUpfileSave(UserContext me, String appId, String repositoryName, String groupValue, String ruuid, String fileNames, String type) { + CoeProcessLevelWeb web = new CoeProcessLevelWeb(me); + return web.saveShapeUpfile(appId, repositoryName, groupValue, ruuid, fileNames, type); + } + + /** + * 创建模型图片和缩略图 + * + * @param uuid + * @return + */ + // @Mapping(value="COE_PAL_PL_RESPOSITORY_SAVEIMAGE") + @Mapping("com.actionsoft.apps.coe.pal_pl_repository_image_save") + public String COEPALPLRESPOSITORYSaveImage(UserContext me, String uuid) { + PALRepositoryQueryAPIManager.getInstance().saveImage(uuid, true, true); + return ResponseObject.newOkResponse().toString(); + } + + /** + * 获取打开一个流程所需要的参数 + * 应用于流程树结构双击打开流程设计器 + * + * @param me + * @param wsId + * @param uuid + * @return + */ + // @Mapping(value="COE_PAL_PROCESSLEVEL_DESIGNER_DATA") + @Mapping("com.actionsoft.apps.coe.pal_processlevel_designer_data_query") + public String COEPALPROCESSLEVELDesignerData(UserContext me, String wsId, String uuid) { + CoeProcessLevelWeb web = new CoeProcessLevelWeb(me); + String result = web.getPortalParam(uuid, wsId); + return result; + } + + /** + * 新版门户流程只读页面打开前校验 + * + * @param me + * @param uuid + * @return + */ + // @Mapping("COE_PAL_PL_RESPOSITORY_DESIGNER_VIEWER_PORTAL_LINK_PERM") + @Mapping("com.actionsoft.apps.coe.pal_pl_repository_designer_viewer_portal_link_perm_check") + public String COEPALRESPOSITORYDesignerViewerPortalLinkPerm(UserContext me, String uuid) { + CoeDesignerWeb web = new CoeDesignerWeb(me); + return web.getDesignerViewerPortalLinkPerm(uuid); + } + + /** + * 新版门户打开 + * + * @param me + * @param uuid + * @return + */ + // @Mapping("COE_PAL_PL_RESPOSITORY_DESIGNER_VIEWER_PORTAL_OPEN") + @Mapping("com.actionsoft.apps.coe.pal_pl_repository_designer_viewer_portal_open_page") + public String COEPALRESPOSITORYDesignerViewerPortalOpen(UserContext me, String uuid) { + return PALRepositoryQueryAPIManager.getInstance().getPublishPortalHtml(me, uuid, null); + } + + /** + * 保存节点的地址簿属性内容到关联表 + * + * @return + */ + // @Mapping("COE_PAL_PL_RESPOSITORY_DESIGNER_ADDRESS_SHAPE_DATA_SAVE") + @Mapping("com.actionsoft.apps.coe.pal_pl_repository_designer_address_shape_data_save") + public String COEPALRESPOSITORYDesignerAddressShapeDataSave(UserContext me, String data) { + DesignerRelationShapeWeb web = new DesignerRelationShapeWeb(me); + return web.saveAddressShapeData(data); + } + + /** + * 获取关联的地址簿id + * + * @param me + * @param objIds + * @param shapeId + * @param uuid + * @return + */ + // @Mapping("COE_PAL_PL_RESPOSITORY_DESIGNER_ADDRESS_SHAPE") + @Mapping("com.actionsoft.apps.coe.pal_pl_repository_designer_address_shape_query") + public String COEPALRESPOSITORYDesignerAddressShape(UserContext me, String objIds, String shapeId, String uuid) { + DesignerRelationShapeWeb web = new DesignerRelationShapeWeb(me); + return web.getAddressShape(objIds, shapeId, uuid); + } + + /** + * 获取关联的地址簿名称 + * 只读情况下显示 + * + * @param me + * @param objIds + * @param shapeId + * @param uuid + * @param type + * @return + */ + // @Mapping("COE_PAL_PL_RESPOSITORY_DESIGNER_ADDRESS_NAMES_SHAPE") + @Mapping("com.actionsoft.apps.coe.pal_pl_repository_designer_address_names_shape_query") + public String COEPALRESPOSITORYDesignerAddressShape(UserContext me, String objIds, String shapeId, String uuid, String type) { + DesignerRelationShapeWeb web = new DesignerRelationShapeWeb(me); + return web.getAddressNames(objIds, shapeId, uuid, type); + } + + /** + * 获取aws平台的组织机构/岗位角色树 + * + * @param me + * @param wsId + * @param fileId + * @param shapeId + * @param attrId + * @return + */ + // @Mapping("COE_PAL_PL_RESPOSITORY_DESIGNER_AWS_ORG") + @Mapping("com.actionsoft.apps.coe.pal_pl_repository_designer_aws_org_page") + public String COEPALRESPOSITORYDesignerAwsOrg(UserContext me, String wsId, String fileId, String shapeId, String attrId, String ref) { + DesignerRelationShapeWeb web = new DesignerRelationShapeWeb(me); + return web.getAwsOrgPortal(wsId, fileId, shapeId, attrId, ref); + } + + /** + * 获取aws平台树结构 + * + * @param me + * @param pid + * @param uuid + * @param type + * @return + */ + // @Mapping("COE_PAL_PL_RESPOSITORY_DESIGNER_SHAPES_AWS_ORG_TREE_NODE") + @Mapping("com.actionsoft.apps.coe.pal_pl_repository_designer_shapes_aws_org_tree_node_query") + public String COEPALRESPOSITORYDesignerAwsOrgTreeNode(UserContext me, String pid, String uuid, String type, String scope, boolean multiple) { + DesignerRelationShapeWeb web = new DesignerRelationShapeWeb(me); + return web.getAwsOrgTreeData(pid, uuid, type, scope, multiple); + // return web.getPermAwsOrgTreeData(pid, uuid, type, scope, multiple); + } + + /** + * 获取子节点 + * + * @param me + * @param uuid + * @param type + * @return + */ + // @Mapping("COE_PAL_PL_RESPOSITORY_DESIGNER_SHAPES_AWS_ORG_TREE_NODE_CHILD_DATE") + @Mapping("com.actionsoft.apps.coe.pal_pl_repository_designer_shapes_aws_org_tree_node_child_query") + public String COEPALRESPOSITORYDesignerAwsOrgTreeNodeChildData(UserContext me, String uuid, String type) { + DesignerRelationShapeWeb web = new DesignerRelationShapeWeb(me); + return web.getAwsOrgTreeNodeChildData(uuid, type); + } + + /** + * 模糊查询 + * + * @return + */ + // @Mapping("COE_PAL_PL_RESPOSITORY_DESIGNER_SHAPES_AWS_ORG_TREE_QUERY") + @Mapping("com.actionsoft.apps.coe.pal_pl_repository_designer_shapes_aws_org_tree_query") + public String COEPALRESPOSITORYDesignerAwsOrgTreeQuery(UserContext me, String autoContent, String wsId, String ref) { + DesignerRelationShapeWeb web = new DesignerRelationShapeWeb(me); + return web.queryAwsOrgTree(autoContent, wsId, ref); + } + + /** + * 保存aws平台组织关联关系 + * + * @param me + * @param relationAwsOrg + * @param shapeId + * @param fileId + * @param shapeGroupId + * @param attrId + * @return + */ + // @Mapping("COE_PAL_PL_RESPOSITORY_DESIGNER_AWS_ORG_RELEVANCE_SAVE") + @Mapping("com.actionsoft.apps.coe.pal_pl_repository_designer_aws_org_relevance_save") + public String COEPALRESPOSITORYDesignerAwsOrgRelevanceSave(UserContext me, String relationAwsOrg, String shapeId, String fileId, String shapeGroupId, String attrId, String shapeText) { + DesignerRelationShapeWeb web = new DesignerRelationShapeWeb(me); + return web.saveAwsOrgRelevance(relationAwsOrg, shapeId, fileId, shapeGroupId, attrId, shapeText); + } + + /** + * 查询aws平台组织名称 + * + * @param me + * @param fileId + * @param shapeId + * @return + */ + // @Mapping("COE_PAL_PL_RESPOSITORY_DESIGNER_AWS_ORG_RELEVANCE_NAME") + @Mapping("com.actionsoft.apps.coe.pal_pl_repository_designer_aws_org_relevance_name_query") + public String COEPALRESPOSITORYDesignerAwsOrgRelevanceName(UserContext me, String fileId, String shapeId, String shapeName, String shapeCategory) { + DesignerRelationShapeWeb web = new DesignerRelationShapeWeb(me); + return web.getAwsOrgRelevanceName(fileId, shapeId, shapeName, shapeCategory); + } + + /** + * 报告生成器 + * raci、岗位手册关联awsorg相关 + * + * @param me + * @param wsid + * @param teamId + * @param methodType + * @param targetMethodType + * @return + */ + // @Mapping("COE_PAL_OUTPUTREPORT_PAL_AWS_ORG_PAGE") + @Mapping("com.actionsoft.apps.coe.pal_outputreport_pal_aws_org_page") + public String COEPALOutputreportAwsOrgPage(UserContext me, String wsid, String teamId, String methodType, String targetMethodType, String type) { + OutPutReportWeb outPutReport = new OutPutReportWeb(me); + return outPutReport.getOutputreportAwsOrgPage(wsid, teamId, methodType, targetMethodType, type); + } + + /** + * 报告生成器 + * raci树结构(aws org) + * + * @param me + * @param wsid + * @param teamId + * @param methodType + * @return + */ + // @Mapping("COE_PAL_OUTPUTREPORT_PAL_AWS_ORG_PAGE_TREE_DATA") + @Mapping("com.actionsoft.apps.coe.pal_outputreport_pal_aws_org_tree_data_query") + public String COEPALOutputreportAwsOrgTreeData(UserContext me, String wsid, String teamId, String methodType, String type) { + OutPutReportWeb outPutReport = new OutPutReportWeb(me); + return outPutReport.getOutputreportAwsOrgTreeData(wsid, teamId, methodType, type); + } + + /** + * 删除流程中的节点时记录日志 + * 查看designer.extend.core.js文件 + * + * @param me + * @param uuid + * @param delnode + * @param delnum + * @return + */ + // @Mapping("COE_PAL_REPOSITORY_DESIGNER_SHAPE_DELETE_LOG_RECORD_NOOP") + @Mapping("com.actionsoft.apps.coe.pal_pl_repository_designer_shape_log_record_noop_delete") + public String COEPALRepositoryDesignerDeleteLog(UserContext me, String uuid, String delnode, String delnum) { + CoeProcessLevelWeb processWeb = new CoeProcessLevelWeb(me); + return processWeb.COEPALRepositoryDesignerDeleteLog(uuid, delnode, delnum); + } + + //======******======******====== COE 和 CONSOLE 互调的命令 begin ======******======******======// + + /** + * 调用平台流程属性形状属性 + * + * @param me + * @param params + * @return + */ + // @Mapping("COE_M_PROCESS_DESIGNER_PROPERTIES_PAGE") + @Mapping("com.actionsoft.apps.coe.pal_m_process_designer_properties_page") + public String processDesignerPropertiesPage(UserContext me, RequestParams params) { + ProcessBPMNDesignerController controller = new ProcessBPMNDesignerController(); + try { + // PAL调用平台,重新创建session + String sid = new SessionImpl().registerSession(LoginConst.SYSTEM_ADMIN_CONSOLE, me.getUID(), me.getClientIP(), me.getLanguage(), me.getDeviceType(), false, null).getSessionId(); + return controller.getPropertiesPage(UserContext.fromSessionId(sid), params); + } catch (Exception e) { + return AlertWindow.getErrorMessagePage("发生错误", e.getMessage()); + } + } + + /** + * 平台与PAL是否存在共享状态 + * + * @param me + * @param processDefId + * @return + */ + // @Mapping("COE_PAL_PROCESS_DESIGNER_MANAGE_FACTORY_JUDGECORRELATE") + @Mapping("com.actionsoft.apps.coe.pal_process_designer_manage_factory_judge_correlate") + public String manageFactorJudgeCorrelateBpms(UserContext me, String processDefId) { + CoeDesignerWeb web = new CoeDesignerWeb(me); + return web.manageFactorJudgeCorrelateBpms(processDefId); + } + + //======******======******====== COE 和 CONSOLE 互调的命令 begin ======******======******======// + + /** + * 新建、更新资产库查询数据 + * + * @param me + * @param wsId 资产库id,可为空 + * @return + */ + @Mapping("com.actionsoft.apps.coe.pal_ws_update_data_query") + public String getUpdateWorkspaceDataById(UserContext me, String wsId) { + CoeWorkSpaceWeb web = new CoeWorkSpaceWeb(me); + return web.getUpdateWorkspaceDataById(wsId); + } + + /** + * 更新/保存资产库 + * + * @param me + * @param wsId 为空则新建,不为空则更新 + * @param name 名称 + * @param desc 描述 + * @param type 类型 + * @param admin 管理员 + * @return + */ + @Mapping("com.actionsoft.apps.coe.pal_ws_update_save") + public String saveWorkspace(UserContext me, String wsId, String name, String desc, String type, String admin) { + CoeWorkSpaceWeb web = new CoeWorkSpaceWeb(me); + return web.saveWorkspace(wsId, name, desc, Integer.parseInt(type), admin); + } + + /** + * 管理中心 获取管理中心App + * + * @param me + * @return + */ + @Mapping("com.actionsoft.apps.coe.pal_pl_manage_app_data") + public String getPalPlManageApp(UserContext me) { + PalManageWeb fileWeb = new PalManageWeb(me); + return fileWeb.getPalPlManageApp(); + } + + /** + * 获取资产库管理数据 + * + * @param me + * @return + */ + @Mapping("com.actionsoft.apps.coe.pal_ws_manage_data") + public String getPalPlWsManageData(UserContext me) { + CoeWorkSpaceWeb we = new CoeWorkSpaceWeb(me); + return we.getCoeWorkSpaceManageData(); + } + + @Mapping("com.actionsoft.apps.coe.pal_ws_backup_data_query") + public String getPalPlWsBackupData(UserContext me, String wsId) { + CoEPALBackupWeb web = new CoEPALBackupWeb(me); + return web.getPalPlWsBackupData(wsId); + } + + /** + * 加载流程树 + * + * @return + */ + @Mapping("com.actionsoft.apps.coe.pal_processlevel_tree_data") + public String getPalProcesslevelTreeData(UserContext me, String wsId, String teamId, String pid, String createUsers, String orgIds, String methodIds) { + CoeProcessLevelWeb web = new CoeProcessLevelWeb(me); + return web.getPalProcesslevelTreeData(wsId, teamId, pid, createUsers, orgIds, methodIds); + } + + /** + * 查询新建文件类型 + * + * @param me + * @return + */ + @Mapping("com.actionsoft.apps.coe.pal_processlevel_create_method_list") + public String getPalProcessLevelCreateMethodList(UserContext me, String category, String methodId) { + CoeProcessLevelWeb web = new CoeProcessLevelWeb(me); + return web.getPalProcessLevelCreateMethodList(category, methodId); + } + + /** + * 保存/修改新建文件夹、层级 + * + * @return + */ + @Mapping("com.actionsoft.apps.coe.pal_processlevel_folder_create_save") + public String saveCreatePalProcessLevelFolder(UserContext me, String wsId, String teamId, String method, String id, String parentId, String name, String desc) { + CoeProcessLevelWeb web = new CoeProcessLevelWeb(me); + return web.saveCreatePalProcessLevelFolder(wsId, teamId, method, id, parentId, name, desc); + } + + /** + * 创建空白模型 + * + * @param me + * @param wsId + * @param teamId + * @param category + * @param method + * @param parentId + * @param container 模板 + * @return + */ + @Mapping("com.actionsoft.apps.coe.pal_processlevel_repository_create_save") + public String saveCreatePalProcessLevelRepository(UserContext me, String wsId, String teamId, String category, String method, String parentId, String container, Integer securityLevel) { + CoeProcessLevelWeb web = new CoeProcessLevelWeb(me); + return web.saveCreatePalProcessLevelRepository(wsId, teamId, category, method, parentId, container, securityLevel); + } + + + /** + * 创建空白模板 + * + * @param me + * @param wsId + * @param teamId + * @param category + * @param method + * @param parentId + * @param container + * @param securityLevel + * @param name + * @return + * @author zhaolei + */ + @Mapping("com.actionsoft.apps.coe.pal_processlevel_repository_create_save_Designer") + public String saveCreatePalProcessLevelRepositoryDesigner(UserContext me, String wsId, String teamId, String category, String method, String parentId, String container, Integer securityLevel, String name) { + CoeProcessLevelWeb web = new CoeProcessLevelWeb(me); + return web.saveCreatePalProcessLevelRepositoryDesigner(wsId, teamId, category, method, parentId, container, securityLevel, name); + } + + /** + * 获取路径 + * + * @param me + * @param parentId + * @return + */ + @Mapping("com.actionsoft.apps.coe.getArchitecturePath") + public String getArchitecturePath(UserContext me, String parentId) { + CoeProcessLevelWeb web = new CoeProcessLevelWeb(me); + return web.getArchitecturePath(parentId); + } + + /** + * 校验重名功能 + * + * @param me + * @param title + * @return + * @author zhaolei + */ + @Mapping("com.actionsoft.apps.coe.pal_pl_repository_designer_checkname") + public String checkCreatePalProcessLevelRepository(UserContext me, String title, String method) { + CoeProcessLevelWeb web = new CoeProcessLevelWeb(me); + return web.checkCreatePalProcessLevelRepository(title, method); + } + + /** + * 根据用户选择类型创建相应制度图形 + * + * @param me + * @param type + * @return + */ + @Mapping("com.actionsoft.apps.coe.pal_pl_repository_designer_CreateSystemModelBySelectType") + public String CreateSystemModelBySelectType(UserContext me, String wsId, String title, String type, String method, String uuid, String parentId) { + CoeProcessLevelWeb web = new CoeProcessLevelWeb(me); + return web.CreateSystemModelBySelectType(wsId, title, type, method, uuid, parentId); + } + + + /** + * 创建角色/绩效/表单模型 + * + * @param me + * @param + * @return + */ + @Mapping("com.actionsoft.apps.coe.pal_pl_repository_designer_relation_shape_createDialogModel") + public String createDialogModel(UserContext me, String uuid, String methodId, String wsId, String teamId) { + CoeProcessLevelWeb web = new CoeProcessLevelWeb(me); + return web.createDialogModel(uuid, methodId, wsId, teamId); + } + + + /** + * 查询是否有相同角色/绩效图数据 + * + * @param me + * @param + * @return + */ + @Mapping("com.actionsoft.apps.coe.pal_pl_repository_designer_relation_find_same_role") + public String relationFindSameRole(UserContext me, String uuid, String methodId) { + CoeProcessLevelWeb web = new CoeProcessLevelWeb(me); + return web.relationFindSameRole(uuid, methodId); + } + + + /** + * 质量校验功能 + * + * @param me + * @param sid + * @param uuid + * @param obj + * @return + */ + @Mapping("com.actionsoft.apps.coe.pal_repository_process_define_Quality_check") + public String defineQualityCheck(UserContext me, String sid, String uuid, String obj) { + CoeProcessLevelWeb web = new CoeProcessLevelWeb(me); + return web.bindefineQualityCheck(sid, uuid, obj); + } + + + @Mapping("com.actionsoft.apps.coe.pal_repository_process_define_Performance_check") + public String definePerformanceCheck(UserContext me, String sid, String obj) { + CoeProcessLevelWeb web = new CoeProcessLevelWeb(me); + return web.definePerformanceCheck(sid, obj); + } + + + /** + * 添加回复功能 + * + * @param me + * @param ruuid + * @param replyContent + * @return + */ + @Mapping("com.actionsoft.apps.coe.pal_pl_repository_designer_add_reply") + public String createReply(UserContext me, String ruuid, String replyContent) { + CoeProcessLevelWeb web = new CoeProcessLevelWeb(me); + return web.createReply(me, ruuid, replyContent); + } + + /** + * 加载回复列表 + * + * @param me + * @param ruuid + * @param replyContent + * @return + */ + @Mapping("com.actionsoft.apps.coe.pal_pl_repository_designer_GetReply") + public String GetReply(UserContext me, RequestParams params, String start, String size, String ruuid) { + String returnstrs = ""; + int startnum = -1; + int sizenum = -1; + if (!UtilString.isEmpty(start)) { + startnum = Integer.parseInt(start); + } else { + startnum = 1; + } + if (!UtilString.isEmpty(size)) { + sizenum = Integer.parseInt(size); + } else { + sizenum = 20; + } + + CoeProcessLevelWeb mdWeb = new CoeProcessLevelWeb(me); + returnstrs = mdWeb.getReplyList(startnum, sizenum, ruuid); + return returnstrs.toString(); + + } + + /** + * 删除评论功能 + * + * @param me + * @param params + * @param sid + * @param replyId + * @param messageId + * @return + */ + @Mapping("com.actionsoft.apps.coe.pal_delete_reply_by_id") + public String deleteReply(UserContext me, RequestParams params, String sid, String replyId, String messageId) { + CoeProcessLevelWeb web = new CoeProcessLevelWeb(me); + return web.deleteReply(replyId, messageId); + } + + + /** + * 获取最近编辑的文件和收藏的文件 + * + * @param me + * @param wsId + * @param teamId + * @return + */ + @Mapping("com.actionsoft.apps.coe.pal_processlevel_recent_and_favorite_data_query") + public String getRecentAndFavoriteRepository(UserContext me, String wsId, String teamId, String createUsers, String orgIds, String methodIds) { + CoeProcessLevelWeb web = new CoeProcessLevelWeb(me); + return web.getRecentAndFavoriteRepository(me, wsId, teamId, createUsers, orgIds, methodIds); + } + + /** + * 收藏文件模型 + * + * @param me + * @param wsId + * @param teamId + * @param versionId + * @return + */ + @Mapping("com.actionsoft.apps.coe.pal_processlevel_favorite_save") + public String savePalProcessLevelFavoriteData(UserContext me, String wsId, String teamId, String versionId) { + CoeProcessLevelWeb web = new CoeProcessLevelWeb(me); + return web.savePalProcessLevelFavoriteData(wsId, teamId, versionId); + } + + /** + * 取消收藏 + * + * @param me + * @param wsId + * @param teamId + * @param versionId + * @return + */ + @Mapping("com.actionsoft.apps.coe.pal_processlevel_favorite_cancel") + public String cancelPalProcessLevelFavorite(UserContext me, String wsId, String teamId, String versionId) { + CoeProcessLevelWeb web = new CoeProcessLevelWeb(me); + return web.cancelPalProcessLevelFavorite(wsId, teamId, versionId); + } + + /** + * 查询子文件 + * + * @param me + * @param wsId + * @param teamId + * @param id + * @return + */ + @Mapping("com.actionsoft.apps.coe.pal_processlevel_repository_child_data_query") + public String getPalProcessLevelRepositoryChildData(UserContext me, String wsId, String teamId, String id, String createUsers, String orgIds, String methodIds) { + CoeProcessLevelWeb web = new CoeProcessLevelWeb(me); + return web.getPalProcessLevelRepositoryChildData(wsId, teamId, id, createUsers, orgIds, methodIds); + } + + + /** + * Repository 树形子列表元素orderIndex调整 + * 不允许跨级排序 + * + * @param me + * @param wsId 所属资产库ID + * @param currentId 待调整位置uuid + * @param originId 插入位置的uuid + * @return + */ + @Mapping("com.actionsoft.apps.coe.pal_processlevel_repository_order_index_update") + public String updatePalProcessLevelRepositoryOrderIndex(UserContext me, String wsId, String currentId, String originId) { + CoeProcessLevelWeb web = new CoeProcessLevelWeb(me); + return web.updatePalProcessLevelRepositoryOrderIndex(wsId, currentId, originId); + } + + + /** + * 获取模型文件详情 + * + * @param me + * @param wsId + * @param teamId + * @param id + * @return + */ + @Mapping("com.actionsoft.apps.coe.pal_processlevel_repository_detail_data_query") + public String getPalProcessLevelRepositoryDetailData(UserContext me, String wsId, String teamId, String id) { + CoeProcessLevelWeb web = new CoeProcessLevelWeb(me); + return web.getPalProcessLevelRepositoryDetailData(wsId, teamId, id); + } + + /** + * 批量移动文件 + * + * @param uc + * @param sourceData + * @param targetData + * @return + */ + @Mapping("com.actionsoft.apps.coe.pal_processlevel_move_save") + public String movePalProcessLevelRepository(UserContext uc, String teamId, String sourceData, String targetData) { + CoeProcessLevelWeb web = new CoeProcessLevelWeb(uc); + return web.movePalProcessLevelRepository(teamId, sourceData, targetData); + } + + /** + * 复制文件 + * + * @param uc + * @param wsId + * @param teamId + * @param sourceIds + * @param targetId + * @return + */ + @Mapping("com.actionsoft.apps.coe.pal_processlevel_copy_save") + public String copyPalProcessLevelRepository(UserContext uc, String wsId, String teamId, String sourceIds, String targetId) { + CoeProcessLevelWeb web = new CoeProcessLevelWeb(uc); + return web.copyPalProcessLevelRepository(wsId, teamId, sourceIds, targetId); + } + + /** + * 删除 + * + * @param uc + * @param wsId + * @param teamId + * @param repositoryIds + * @return + */ + @Mapping("com.actionsoft.apps.coe.pal_processlevel_remove") + public String removePalRepositoryLevel(UserContext uc, String wsId, String teamId, String repositoryIds) { + CoeProcessLevelWeb web = new CoeProcessLevelWeb(uc); + return web.removePalRepositoryLevel(wsId, teamId, repositoryIds); + } + + /** + * 设计器-查询版本数据 + * + * @param uc + * @param wsId + * @param teamId + * @param id + * @return + */ + @Mapping("com.actionsoft.apps.coe.pal_pl_repository_designer_version_manager_data") + public String getPalProcessLevelVersionData(UserContext uc, String wsId, String teamId, String id) { + CoeDesignerWeb web = new CoeDesignerWeb(uc); + return web.getPalProcessLevelVersionData(wsId, teamId, id); + } + + /** + * 设计器-创建新版本 + * + * @param uc + * @param wsId + * @param teamId + * @param id + * @return + */ + @Mapping("com.actionsoft.apps.coe.pal_pl_repository_designer_version_manager_create") + public String createPalDesignerNewVersion(UserContext uc, String wsId, String teamId, String id, @Param(defaultValue = "true") boolean isLargeIteration) { + CoeDesignerWeb web = new CoeDesignerWeb(uc); + return web.createPalDesignerNewVersion(wsId, teamId, id, isLargeIteration); + } + + /** + * 设计器-删除某版本文件(放入回收站) + * + * @param uc + * @param wsId + * @param teamId + * @param id + * @return + */ + @Mapping("com.actionsoft.apps.coe.pal_pl_repository_designer_version_manager_delete") + public String deletePalDesignerVersion(UserContext uc, String wsId, String teamId, String id) { + CoeDesignerWeb web = new CoeDesignerWeb(uc); + return web.deletePalDesignerVersion(wsId, teamId, id); + } + + /** + * 设计器-切换版本状态为使用中 + * + * @param uc + * @param wsId + * @param teamId + * @param id + * @return + */ + @Mapping("com.actionsoft.apps.coe.pal_pl_repository_designer_version_manager_use") + public String changePalDesignerVersionUse(UserContext uc, String wsId, String teamId, String id) { + CoeDesignerWeb web = new CoeDesignerWeb(uc); + return web.changePalDesignerVersionUse(wsId, teamId, id); + } + + /** + * 查询文件属性 + * + * @param uc + * @param wsId + * @param teamId + * @param id + * @return + */ + @Mapping("com.actionsoft.apps.coe.pal_processlevel_property_data_query") + public String getPalProcessLevelPropertyData(UserContext uc, String wsId, String teamId, String id) { + CoeProcessLevelWeb web = new CoeProcessLevelWeb(uc); + return web.getPalProcessLevelPropertyData(wsId, teamId, id); + } + + //管理->形状定义->形状配置->查询的dialog + // @Mapping("COE_PAL_PL_MANAGE_SHAPE_CONFIG_QUERY_DIALOG") + @Mapping("com.actionsoft.apps.coe.pal_pl_manage_shape_config_dialog_page") + public String coePalPlManageShapeConfigQueryDialog(UserContext me, String wsId, String type, String shapeId, String category, String defaultCategory, String commonShapeConfig, String specialShapeConfig, String attributesJsonArray, String relationData, String shapeKey) { + PalManageWeb fileWeb = new PalManageWeb(me); + return fileWeb.openCoePalPlManageShapeConfigQueryDialog(wsId, type, shapeId, category, defaultCategory, commonShapeConfig, specialShapeConfig, attributesJsonArray, relationData, shapeKey); + } + + //管理->形状定义->形状配置->更新的dialog + // @Mapping("COE_PAL_PL_MANAGE_SHAPE_CONFIG_UPDATE_DIALOG") + @Mapping("com.actionsoft.apps.coe.pal_pl_manage_shape_config_update_dialog_page") + public String coePalPlManageShapeConfigUpdateDialog(UserContext me, String wsId, String shapeId, String category, String defaultCategory, String horVerArray, String type, String horizontal, String verity, String showType, String textContent, String key, String attrName, String isShowAttrName, String iconContent) { + PalManageWeb fileWeb = new PalManageWeb(me); + return fileWeb.openCoePalPlManageShapeConfigUpdateDialog(wsId, shapeId, category, defaultCategory, horVerArray, type, horizontal, verity, showType, textContent, key, attrName, isShowAttrName, iconContent); + } + + //管理->形状定义->形状配置->获取更新dialog中的下拉框的值 + // @Mapping("COE_PAL_PL_MANAGE_SHAPE_CONFIG_UPDATE_SELECT_CONTENT") + @Mapping("com.actionsoft.apps.coe.pal_pl_manage_shape_config_update_select_content") + public String coePalPlManageShapeConfigUpdateSelectContent(UserContext me) { + PalManageWeb fileWeb = new PalManageWeb(me); + return fileWeb.openCoePalPlManageShapeConfigUpdateSelectContent(); + } + + // 流程的数据属性 + // @Mapping("COE_PAL_PL_MORE_ATTRIBUTE") + @Mapping("com.actionsoft.apps.coe.pal_pl_more_attribute") + public String COEPALPLMoreAttribute(UserContext me, String type, String wsId, String uuid, String processDefId, String shapeName, String category, String defaultCategory) { + CoeDesignerWeb designerWeb = new CoeDesignerWeb(me); + return designerWeb.getMoreAttritbute(me, type, wsId, uuid, type, shapeName, category, defaultCategory); + } + + /** + * 单个更新流程文件三员管理密级 + * + * @param me + * @param uuid 文件id + * @param securityLevel + * @return + */ + @Mapping("com.actionsoft.apps.coe.pal_pl_file_security_level_update") + public String updatePalProcessFileSecurityLevel(UserContext me, String uuid, Integer securityLevel) { + CoeProcessLevelWeb web = new CoeProcessLevelWeb(me); + return web.updateRepositorySecurityLevel(uuid, securityLevel); + } + + /** + * 批量更新流程文件三员管理密级 + * + * @param me + * @param fileList + * @return + */ + @Mapping("com.actionsoft.apps.coe.pal_pl_file_security_level_batch_update") + public String updatePalProcessFileSecurityLevel(UserContext me, String fileList) { + CoeProcessLevelWeb web = new CoeProcessLevelWeb(me); + return web.batchUpdateRepositorySecurityLevel(fileList); + } + + /** + * 获取流程文件未标密数量 + * + * @param me + * @param wsId + * @param teamId + * @return + */ + @Mapping("com.actionsoft.apps.coe.pal_pl_file_unmark_num_query") + public String getPalProcessFileUnmarkNum(UserContext me, String wsId, String teamId) { + CoeProcessLevelWeb web = new CoeProcessLevelWeb(me); + return web.getUnmarkFileNum(wsId, teamId); + } + + /** + * 校验用户是否有访问文件的权限 + * + * @param me + * @param uuid + * @return + */ + @Mapping("com.actionsoft.apps.coe.pal_pl_file_permission_query") + public String checkPalProcessFilePermission(UserContext me, String uuid) { + CoeProcessLevelWeb web = new CoeProcessLevelWeb(me); + return web.checkFilePemission(uuid).toString(); + } + + /** + * 批量校验文件的密级权限 + * + * @param me + * @param uuids + * @param isSub 是否进行下属列表密级权限校验 + * @return + */ + @Mapping("com.actionsoft.apps.coe.pal_pl_file_permission_batch_query") + public String checkPalProcessFilePermissionBathch(UserContext me, String uuids, boolean isSub) { + CoeProcessLevelWeb web = new CoeProcessLevelWeb(me); + return web.checkFilePermissionBatch(uuids, isSub).toString(); + } /** * 设计器页面右侧版本差异窗口接口 + * * @param me * @param id 当前资产库文件ID * @return */ - @Mapping("com.actionsoft.apps.coe.pal_repository_model_version_diff_query") - public String getRepositoryModelVersionDiff(UserContext me,String id){ + @Mapping("com.actionsoft.apps.coe.pal_repository_model_version_diff_query") + public String getRepositoryModelVersionDiff(UserContext me, String id) { CoeProcessLevelWeb web = new CoeProcessLevelWeb(me); return web.getRepositoryModelVersionDiff(id); } - /** - * 校验形状属性 - * @param me - * @param uuid - * @param define 若为空字符串,则获取系统当前保存的define进行校验 - * @return - */ - @Mapping("com.actionsoft.apps.coe.pal_repository_define_shape_attr_valid") - public String validRepositoryShapeAttr(UserContext me, String uuid, String define) { - CoeDesignerWeb web = new CoeDesignerWeb(me); - return web.validRepositoryShapeAttr(uuid, define); - } + /** + * 校验形状属性 + * + * @param me + * @param uuid + * @param define 若为空字符串,则获取系统当前保存的define进行校验 + * @return + */ + @Mapping("com.actionsoft.apps.coe.pal_repository_define_shape_attr_valid") + public String validRepositoryShapeAttr(UserContext me, String uuid, String define) { + CoeDesignerWeb web = new CoeDesignerWeb(me); + return web.validRepositoryShapeAttr(uuid, define); + } - /** - * 架构筛选条件查询 - * @param me - * @param wsId - * @param teamId - * @return - */ - @Mapping("com.actionsoft.apps.coe.pal_condition_data_query") - public String queryConditionData(UserContext me,String wsId,String teamId){ - CoeProcessLevelWeb web = new CoeProcessLevelWeb(me); - return web.queryConditionData(wsId,teamId); - } + /** + * 架构筛选条件查询 + * + * @param me + * @param wsId + * @param teamId + * @return + */ + @Mapping("com.actionsoft.apps.coe.pal_condition_data_query") + public String queryConditionData(UserContext me, String wsId, String teamId) { + CoeProcessLevelWeb web = new CoeProcessLevelWeb(me); + return web.queryConditionData(wsId, teamId); + } - /** - * 编号刷 - * @param uc - * @param uuid - * @return - */ - @Mapping("com.actionsoft.apps.coe.pal_repository_designer_no_refresh") - public String refreshDesignerNo(UserContext uc, String uuid) { - EpcGraphWeb web = new EpcGraphWeb(uc); - return web.refreshDesignerNo(uuid); - } + /** + * 编号刷 + * + * @param uc + * @param uuid + * @return + */ + @Mapping("com.actionsoft.apps.coe.pal_repository_designer_no_refresh") + public String refreshDesignerNo(UserContext uc, String uuid) { + EpcGraphWeb web = new EpcGraphWeb(uc); + return web.refreshDesignerNo(uuid); + } - /** - * 前后置流程界面操作,查询关联的模型的信息 - * @param uc - * @param oldFileIds - * @param newFileIds - * @return - */ - @Mapping("com.actionsoft.apps.coe.pal_pl_repository_designer_relation_info_query") - public String queryRelationInfo(UserContext uc, String oldFileIds, String newFileIds) { - CoeProcessLevelWeb web = new CoeProcessLevelWeb(uc); - return web.queryRelationInfo(oldFileIds, newFileIds); - } + /** + * 前后置流程界面操作,查询关联的模型的信息 + * + * @param uc + * @param oldFileIds + * @param newFileIds + * @return + */ + @Mapping("com.actionsoft.apps.coe.pal_pl_repository_designer_relation_info_query") + public String queryRelationInfo(UserContext uc, String oldFileIds, String newFileIds) { + CoeProcessLevelWeb web = new CoeProcessLevelWeb(uc); + return web.queryRelationInfo(oldFileIds, newFileIds); + } - @Mapping("com.actionsoft.apps.coe.pal_pl_repository_designer_shape_relation_rear_lead_save") - public String saveRearLeadProcessRelationData(UserContext uc, String uuid, String relationFileId, String relationShapeText, String type) { - DesignerRelationShapeWeb web = new DesignerRelationShapeWeb(uc); - return web.saveRearLeadProcessRelationData(uuid, relationFileId, relationShapeText, type); - } + @Mapping("com.actionsoft.apps.coe.pal_pl_repository_designer_shape_relation_rear_lead_save") + public String saveRearLeadProcessRelationData(UserContext uc, String uuid, String relationFileId, String relationShapeText, String type) { + DesignerRelationShapeWeb web = new DesignerRelationShapeWeb(uc); + return web.saveRearLeadProcessRelationData(uuid, relationFileId, relationShapeText, type); + } - /** - * 校验是否有前后置流程属性 - * @param me - * @param removeProcedureShapes - * @param fileId - * @return - */ - @Mapping("com.actionsoft.apps.coe.pal_pl_repository_designer_lead_rear_relation_search") - public String searchLeadRearRelationData(UserContext me, String removeProcedureShapes, String fileId) { - DesignerRelationShapeWeb web = new DesignerRelationShapeWeb(me); - return web.searchLeadRearRelationData(fileId, removeProcedureShapes); - } + /** + * 校验是否有前后置流程属性 + * + * @param me + * @param removeProcedureShapes + * @param fileId + * @return + */ + @Mapping("com.actionsoft.apps.coe.pal_pl_repository_designer_lead_rear_relation_search") + public String searchLeadRearRelationData(UserContext me, String removeProcedureShapes, String fileId) { + DesignerRelationShapeWeb web = new DesignerRelationShapeWeb(me); + return web.searchLeadRearRelationData(fileId, removeProcedureShapes); + } - @Mapping("com.actionsoft.apps.coe.pal_repository_designer_lead_rear_relation_delete") - public String deleteLeadRearRelationData(UserContext me, String uuid, String data) { - DesignerRelationShapeWeb web = new DesignerRelationShapeWeb(me); - return web.deleteLeadRearRelationData(uuid, data); - } + @Mapping("com.actionsoft.apps.coe.pal_repository_designer_lead_rear_relation_delete") + public String deleteLeadRearRelationData(UserContext me, String uuid, String data) { + DesignerRelationShapeWeb web = new DesignerRelationShapeWeb(me); + return web.deleteLeadRearRelationData(uuid, data); + } - /** - * 获得建模导引前端页面 - * - * @param me me - * @return {@link String} - */ - @Mapping("com.actionsoft.apps.coe.pal_modeling_guide") - public String getModelingGuide(UserContext me , String methodId , String sid) { - DesignerRelationShapeWeb web = new DesignerRelationShapeWeb(me); - return web.getModelingGuide(methodId, sid); - } + /** + * 获得建模导引前端页面 + * + * @param me me + * @return {@link String} + */ + @Mapping("com.actionsoft.apps.coe.pal_modeling_guide") + public String getModelingGuide(UserContext me, String methodId, String sid) { + DesignerRelationShapeWeb web = new DesignerRelationShapeWeb(me); + return web.getModelingGuide(methodId, sid); + } - /** - * 获得建模导引前端页面 - * - * @param me me - * @return {@link String} - */ - @Mapping("com.actionsoft.apps.coe.pal_guide_carousel") - public String getModelingGuideCarousel(UserContext me , String step , String modelType) { - DesignerRelationShapeWeb web = new DesignerRelationShapeWeb(me); - return web.getModelingGuideCarousel(step , modelType); - } + /** + * 获得建模导引前端页面 + * + * @param me me + * @return {@link String} + */ + @Mapping("com.actionsoft.apps.coe.pal_guide_carousel") + public String getModelingGuideCarousel(UserContext me, String step, String modelType) { + DesignerRelationShapeWeb web = new DesignerRelationShapeWeb(me); + return web.getModelingGuideCarousel(step, modelType); + } - /** - * 检查用户是否第一次创建模型 - * - * @param me me - * @param methodId 模型类型 - * @return {@link String} - */ - @Mapping("com.actionsoft.apps.coe.pal_guide_check_create") - public String checkUserFirstCreateModel(UserContext me , String methodId,String type) { - DesignerRelationShapeWeb web = new DesignerRelationShapeWeb(me); - return web.checkUserFirstCreateModel(methodId,type); - } + /** + * 检查用户是否第一次创建模型 + * + * @param me me + * @param methodId 模型类型 + * @return {@link String} + */ + @Mapping("com.actionsoft.apps.coe.pal_guide_check_create") + public String checkUserFirstCreateModel(UserContext me, String methodId, String type) { + DesignerRelationShapeWeb web = new DesignerRelationShapeWeb(me); + return web.checkUserFirstCreateModel(methodId, type); + } } diff --git a/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/pal/output/OutPutReportWeb.java b/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/pal/output/OutPutReportWeb.java index 70edfa51..4e4540e5 100755 --- a/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/pal/output/OutPutReportWeb.java +++ b/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/pal/output/OutPutReportWeb.java @@ -1,40 +1,13 @@ package com.actionsoft.apps.coe.pal.pal.output; -import java.io.File; -import java.math.BigDecimal; -import java.sql.Timestamp; -import java.text.SimpleDateFormat; -import java.util.*; - - import com.actionsoft.apps.AppsConst; +import com.actionsoft.apps.coe.pal.constant.CoEConstant; import com.actionsoft.apps.coe.pal.cooperation.CoeCooperationAPIManager; import com.actionsoft.apps.coe.pal.cooperation.model.CoeCooperationTeamModel; import com.actionsoft.apps.coe.pal.log.CoEOpLogAPI; import com.actionsoft.apps.coe.pal.log.CoEOpLogConst; -import com.actionsoft.apps.coe.pal.util.BpmOrgUtil; -import com.actionsoft.apps.coe.pal.util.HighSecurityUtil; -import com.actionsoft.apps.resource.AppContext; -import com.actionsoft.apps.resource.plugin.profile.DCPluginProfile; -import com.actionsoft.bpms.commons.htmlframework.AlertWindow; -import com.actionsoft.bpms.commons.htmlframework.HtmlPageTemplate; -import com.actionsoft.bpms.commons.mvc.view.ActionWeb; -import com.actionsoft.bpms.commons.mvc.view.ResponseObject; -import com.actionsoft.bpms.org.cache.RoleCache; -import com.actionsoft.bpms.org.model.RoleModel; -import com.actionsoft.bpms.org.model.UserModel; -import com.actionsoft.bpms.server.DispatcherRequest; -import com.actionsoft.bpms.server.UserContext; -import com.actionsoft.bpms.server.conf.portal.LanguageModel; -import com.actionsoft.bpms.server.fs.DCContext; -import com.actionsoft.bpms.server.fs.dc.DCProfileManager; -import com.actionsoft.bpms.server.fs.dc.DCUtil; -import com.actionsoft.bpms.util.UUIDGener; -import com.actionsoft.bpms.util.UtilDate; -import com.actionsoft.bpms.util.UtilFile; -import com.actionsoft.bpms.util.UtilString; -import com.actionsoft.apps.coe.pal.constant.CoEConstant; import com.actionsoft.apps.coe.pal.pal.output.dao.OutputTask; +import com.actionsoft.apps.coe.pal.pal.output.extend.GenerLogExd; import com.actionsoft.apps.coe.pal.pal.output.extend.OutputAppManager; import com.actionsoft.apps.coe.pal.pal.output.extend.OutputAppProfile; import com.actionsoft.apps.coe.pal.pal.output.model.OutputTaskModel; @@ -44,16 +17,41 @@ import com.actionsoft.apps.coe.pal.pal.repository.designer.relation.web.Designer import com.actionsoft.apps.coe.pal.pal.repository.designer.util.CoeDesignerUtil; import com.actionsoft.apps.coe.pal.pal.repository.designer.util.ShapeUtil; import com.actionsoft.apps.coe.pal.pal.repository.model.PALRepositoryModel; +import com.actionsoft.apps.coe.pal.util.BpmOrgUtil; +import com.actionsoft.apps.coe.pal.util.HighSecurityUtil; import com.actionsoft.apps.coe.pal.util.StringHandleUtil; +import com.actionsoft.apps.resource.AppContext; +import com.actionsoft.apps.resource.plugin.profile.DCPluginProfile; +import com.actionsoft.bpms.commons.htmlframework.AlertWindow; +import com.actionsoft.bpms.commons.htmlframework.HtmlPageTemplate; +import com.actionsoft.bpms.commons.mvc.view.ActionWeb; +import com.actionsoft.bpms.commons.mvc.view.ResponseObject; +import com.actionsoft.bpms.org.cache.RoleCache; +import com.actionsoft.bpms.org.model.RoleModel; +import com.actionsoft.bpms.org.model.UserModel; +import com.actionsoft.bpms.server.UserContext; +import com.actionsoft.bpms.server.conf.portal.LanguageModel; +import com.actionsoft.bpms.server.fs.DCContext; +import com.actionsoft.bpms.server.fs.dc.DCProfileManager; +import com.actionsoft.bpms.server.fs.dc.DCUtil; +import com.actionsoft.bpms.util.UUIDGener; +import com.actionsoft.bpms.util.UtilDate; +import com.actionsoft.bpms.util.UtilFile; +import com.actionsoft.bpms.util.UtilString; import com.actionsoft.exception.AWSException; import com.actionsoft.i18n.I18nRes; import com.actionsoft.sdk.local.SDK; import com.actionsoft.sdk.local.api.ORGAPI; - import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import com.google.common.collect.Sets; +import java.io.File; +import java.math.BigDecimal; +import java.sql.Timestamp; +import java.text.SimpleDateFormat; +import java.util.*; + /** * 报告生成器web类 * @@ -62,1363 +60,1373 @@ import com.google.common.collect.Sets; * 2014年7月25日 */ public class OutPutReportWeb extends ActionWeb { - UserContext _uc; + UserContext _uc; + GenerLogExd log = new GenerLogExd(); - public OutPutReportWeb() { - } + public OutPutReportWeb() { + } - public OutPutReportWeb(UserContext uc) { - super(uc); - _uc = uc; - } + public OutPutReportWeb(UserContext uc) { + super(uc); + _uc = uc; + } - /** - * 报告生成器首页 - * - * @param wsId 流程id - * @return - */ - public String outPutReportHome(String wsId, String teamId) { - Map map = new HashMap(); - boolean isActive = PALRepositoryQueryAPIManager.getInstance().isActiveWorkSpace(wsId); - if (!isActive) { - return AlertWindow.getAuthorityMessagePage("资产库被停用", "资产库被停用,该小组无法访问流程发布功能,请联系系统管理员"); - } - if (UtilString.isNotEmpty(teamId)) { - CoeCooperationTeamModel team = CoeCooperationAPIManager.getInstance().queryCooperationTeamById(teamId, true); - if (team == null) { - return AlertWindow.getAuthorityMessagePage("小组查询失败", "小组不存在或已停用,该小组无法访问流程发布功能,请联系系统管理员"); - } - if (!team.getWsId().equals(wsId)) { - return AlertWindow.getAuthorityMessagePage("小组信息错误", "小组与对应的资产库信息不匹配,参数错误,请联系系统管理员"); - } - } - map.put("sid", getSessionId()); - List list = SDK.getPlatformAPI().getlanguages(); - StringBuilder sb = new StringBuilder(); - for (LanguageModel model : list) { - sb.append(""); - } - - // 获取应用参数 - String versionRange = SDK.getAppAPI().getProperty("com.actionsoft.apps.coe.pal.output", "VERSION_RANGE"); - if (versionRange == null || "".equals(versionRange.trim())) { - versionRange = ""; - } - map.put("versionRange", versionRange); - boolean shapeNumberSort = SDK.getAppAPI().getPropertyBooleanValue("com.actionsoft.apps.coe.pal.output", "SHAPE_NUMBER_SORT", true); - map.put("shapeNumberSort", shapeNumberSort); - - map.put("language", sb.toString()); - map.put("wsid", wsId); - map.put("userId", this.getContext().getUserModel().getUID()); - map.put("teamId", teamId); - map.put("totalPage", getCountTotal(wsId, teamId)); - String template = "pal.pl.repository.outputreport.htm"; - // 操作行为日志记录 - if (SDK.getAppAPI().getPropertyBooleanValue(CoEConstant.APP_ID, "IS_RECORD_OP_LOG", false)) { - CoEOpLogAPI.auditOkOp(_uc, CoEOpLogConst.MODULE_CATEGORY_APPCENTER, CoEOpLogConst.OP_ACCESS, CoEOpLogConst.INFO_APPCENTER_ACCESS_PREFIX + SDK.getAppAPI().getAppContext("com.actionsoft.apps.coe.pal.output").getName() + CoEOpLogConst.INFO_APPCENTER_ACCESS_SUFFIX); - } - return HtmlPageTemplate.merge(CoEConstant.APP_ID, template, map); - } + /** + * 报告生成器首页 + * + * @param wsId 流程id + * @return + */ + public String outPutReportHome(String wsId, String teamId) { + Map map = new HashMap(); + boolean isActive = PALRepositoryQueryAPIManager.getInstance().isActiveWorkSpace(wsId); + if (!isActive) { + return AlertWindow.getAuthorityMessagePage("资产库被停用", "资产库被停用,该小组无法访问流程发布功能,请联系系统管理员"); + } + if (UtilString.isNotEmpty(teamId)) { + CoeCooperationTeamModel team = CoeCooperationAPIManager.getInstance().queryCooperationTeamById(teamId, true); + if (team == null) { + return AlertWindow.getAuthorityMessagePage("小组查询失败", "小组不存在或已停用,该小组无法访问流程发布功能,请联系系统管理员"); + } + if (!team.getWsId().equals(wsId)) { + return AlertWindow.getAuthorityMessagePage("小组信息错误", "小组与对应的资产库信息不匹配,参数错误,请联系系统管理员"); + } + } + map.put("sid", getSessionId()); + List list = SDK.getPlatformAPI().getlanguages(); + StringBuilder sb = new StringBuilder(); + for (LanguageModel model : list) { + sb.append(""); + } - /** - * 拿到总的记录条数 - * - * @param wsId - * @param teamId - * @return - */ - public int getCountTotal(String wsId, String teamId) { - List listIds = OutputAppManager.getProfileName(""); - String profileId = getProfileId(listIds); - int count = getCount(teamId, wsId, "", profileId); - return count; - } + // 获取应用参数 + String versionRange = SDK.getAppAPI().getProperty("com.actionsoft.apps.coe.pal.output", "VERSION_RANGE"); + if (versionRange == null || "".equals(versionRange.trim())) { + versionRange = ""; + } + map.put("versionRange", versionRange); + boolean shapeNumberSort = SDK.getAppAPI().getPropertyBooleanValue("com.actionsoft.apps.coe.pal.output", "SHAPE_NUMBER_SORT", true); + map.put("shapeNumberSort", shapeNumberSort); - /** - * 得到报告的数据 - * - * @param start  开始记录 - * @param limit   记录条数 - * @param wsid  流程库id - * @param teamId  小组id - * @param data  查询条件 - * @return string - */ - public String getTaskData(int start, int limit, String wsid, String teamId, String data) { - List listIds = OutputAppManager.getProfileName(data); - String profileId = getProfilesIds(listIds); - List list = new OutputTask().getTaskToList(start, limit, wsid, teamId, data, profileId); - StringBuilder sb = new StringBuilder(); - for (OutputTaskModel model : list) { - OutputAppProfile appFile = OutputAppManager.getProfile(model.getProfileId()); - if (appFile != null) { - if (SDK.getAppAPI().isActive(appFile.getAppContext().getId())) { - String td = resData(sb, model, teamId); - sb.append("" + td + ""); - } - } - } - ResponseObject ro = ResponseObject.newOkResponse(); - ro.put("html", sb.toString()); - return ro.toString(); - } + map.put("language", sb.toString()); + map.put("wsid", wsId); + map.put("userId", this.getContext().getUserModel().getUID()); + map.put("teamId", teamId); + map.put("totalPage", getCountTotal(wsId, teamId)); + String template = "pal.pl.repository.outputreport.htm"; + // 操作行为日志记录 + if (SDK.getAppAPI().getPropertyBooleanValue(CoEConstant.APP_ID, "IS_RECORD_OP_LOG", false)) { + CoEOpLogAPI.auditOkOp(_uc, CoEOpLogConst.MODULE_CATEGORY_APPCENTER, CoEOpLogConst.OP_ACCESS, CoEOpLogConst.INFO_APPCENTER_ACCESS_PREFIX + SDK.getAppAPI().getAppContext("com.actionsoft.apps.coe.pal.output").getName() + CoEOpLogConst.INFO_APPCENTER_ACCESS_SUFFIX); + } + return HtmlPageTemplate.merge(CoEConstant.APP_ID, template, map); + } - private String getProfilesIds(List listIds) { - StringBuilder sb1 = new StringBuilder().append(""); - for (String str : listIds) { - sb1.append("'").append(str).append("',"); - } - String profileId = sb1.toString(); - if (profileId.lastIndexOf(",") > 0) { - profileId = profileId.substring(0, profileId.lastIndexOf(",")); - } - return profileId; - } + /** + * 拿到总的记录条数 + * + * @param wsId + * @param teamId + * @return + */ + public int getCountTotal(String wsId, String teamId) { + List listIds = OutputAppManager.getProfileName(""); + String profileId = getProfileId(listIds); + int count = getCount(teamId, wsId, "", profileId); + return count; + } - /** - * 数据组装 - * - * @param sb - * @param model - */ - private String resData(StringBuilder sb, OutputTaskModel model, String teamId) { - OutputAppProfile appFile = OutputAppManager.getProfile(model.getProfileId()); - String reportTypeName = appFile.getTitle(); - ORGAPI org = SDK.getORGAPI(); - UserModel userModel = org.getUser(model.getUserId()); - String ownName = model.getUserId(); - if (userModel != null) { - ownName = userModel.getUserName(); - } - Timestamp endTime = model.getEndTime(); - String endTimeStr = ""; - String totalTimeS = "..."; - double totalTime = 0.00; - Timestamp begomTimeO = model.getBeginTime(); - if (endTime == null) { - } else { - endTimeStr = UtilDate.datetimeFormat(new Date(endTime.getTime())); - totalTime = (double) ((double) endTime.getTime() - (double) begomTimeO.getTime()) / 1000.00; + /** + * 得到报告的数据 + * + * @param start  开始记录 + * @param limit   记录条数 + * @param wsid  流程库id + * @param teamId  小组id + * @param data  查询条件 + * @return string + */ + public String getTaskData(int start, int limit, String wsid, String teamId, String data) { + List listIds = OutputAppManager.getProfileName(data); + String profileId = getProfilesIds(listIds); + List list = new OutputTask().getTaskToList(start, limit, wsid, teamId, data, profileId); + StringBuilder sb = new StringBuilder(); + for (OutputTaskModel model : list) { + OutputAppProfile appFile = OutputAppManager.getProfile(model.getProfileId()); + if (appFile != null) { + if (SDK.getAppAPI().isActive(appFile.getAppContext().getId())) { + String td = resData(sb, model, teamId); + sb.append("" + td + ""); + } + } + } + ResponseObject ro = ResponseObject.newOkResponse(); + ro.put("html", sb.toString()); + return ro.toString(); + } - BigDecimal b = new BigDecimal(totalTime); - totalTime = b.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue(); - totalTimeS = totalTime + "s"; - } + private String getProfilesIds(List listIds) { + StringBuilder sb1 = new StringBuilder().append(""); + for (String str : listIds) { + sb1.append("'").append(str).append("',"); + } + String profileId = sb1.toString(); + if (profileId.lastIndexOf(",") > 0) { + profileId = profileId.substring(0, profileId.lastIndexOf(",")); + } + return profileId; + } - String beginTime = ""; - if (begomTimeO == null) { - } else { - beginTime = UtilDate.datetimeFormat(new Date(begomTimeO.getTime())); - } - int sta = model.getTaskState(); - String state = "失败"; - - String operate = "" + "" + ""; - if (sta == 0) { - state = "就绪"; - if (!"".equals(teamId)) { - operate = "" + ""; - } else { - operate = "" + ""; - } - } else if (sta == 1) { - state = "正在执行" + ""; - operate = ""; - } else if (sta == 2) { - operate = ""; - state = "成功"; - String clickFun = ""; - String buttonType = ""; - String cursorType = "default"; - if((appFile.getAppContext().getId().equals("com.actionsoft.apps.coe.pal.output.pr") || appFile.getAppContext().getId().equals("com.awspaas.user.apps.coe.pal.output.bd") || appFile.getAppContext().getId().equals("com.awspaas.user.apps.coe.pal.output.zd")) && SDK.getAppAPI().isInstalled("com.actionsoft.apps.addons.onlinedoc") && SDK.getAppAPI().isActive("com.actionsoft.apps.addons.onlinedoc")) { - // if ("步骤横表".equals(reportTypeName) || "步骤竖表".equals(reportTypeName)) { - clickFun = "onclick=\"OutputReport.previewReport('" + model.getId() + "','" + appFile.getAppContext().getId() + "')\""; - buttonType = ""; - cursorType = "pointer"; - operate += ""+ buttonType + ""; - } - operate += "" + "" + "" + ""; - } - - Map params = new HashMap(); - String teamName = ""; - if (!UtilString.isEmpty(model.getTeamId())) { - teamName = getTeamName(model, params, teamName); - } - String qtip = ""; - if (endTime != null) { - qtip = beginTime + "
" + endTimeStr; - } - String td = "" + StringHandleUtil.replaceSpecialChart(model.getTaskName()) + "" + "" + reportTypeName + "" + "" + teamName + "" + "" + ownName + " " + "" + totalTimeS + "" + "" + state + " " + "" + operate + ""; - if (!"".equals(teamId)) { - td = "" + StringHandleUtil.replaceSpecialChart(model.getTaskName()) + "" + reportTypeName + "" + "" + ownName + " " + "" + totalTimeS + "" + "" + state + " " + "" + operate + ""; - } - return td; - } + /** + * 数据组装 + * + * @param sb + * @param model + */ + private String resData(StringBuilder sb, OutputTaskModel model, String teamId) { + OutputAppProfile appFile = OutputAppManager.getProfile(model.getProfileId()); + String reportTypeName = appFile.getTitle(); + ORGAPI org = SDK.getORGAPI(); + UserModel userModel = org.getUser(model.getUserId()); + String ownName = model.getUserId(); + if (userModel != null) { + ownName = userModel.getUserName(); + } + Timestamp endTime = model.getEndTime(); + String endTimeStr = ""; + String totalTimeS = "..."; + double totalTime = 0.00; + Timestamp begomTimeO = model.getBeginTime(); + if (endTime == null) { + } else { + endTimeStr = UtilDate.datetimeFormat(new Date(endTime.getTime())); + totalTime = (double) ((double) endTime.getTime() - (double) begomTimeO.getTime()) / 1000.00; - /** - * 得到小组的名称 - * - * @param model - * @param params - * @param teamName - * @return - */ - private String getTeamName(OutputTaskModel model, Map params, String teamName) { - ResponseObject ro; - boolean active = CoeCooperationAPIManager.getInstance().isInstall(); - if (!active) { - return ""; - } - params.put("teamId", model.getTeamId()); - params.put("sid", _uc.getSessionId()); - CoeCooperationTeamModel team = CoeCooperationAPIManager.getInstance().queryCooperationTeamById(model.getTeamId()); - if (team != null) { - return team.getTeamName(); - } - return ""; - } + BigDecimal b = new BigDecimal(totalTime); + totalTime = b.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue(); + totalTimeS = totalTime + "s"; + } - /** - * 注册的App的生成的json数树 - * - * @param language - * @param templateOperate - * @return - */ - public String jsonData(String language, String templateOperate) { - // 多语言过滤, 暂时没有实现多语言 - if (!"cn".equals(language)) { - return ""; - } - List list = OutputAppManager.getList(); - JSONArray jsonArray = new JSONArray(); + String beginTime = ""; + if (begomTimeO == null) { + } else { + beginTime = UtilDate.datetimeFormat(new Date(begomTimeO.getTime())); + } + int sta = model.getTaskState(); + String state = "失败"; - // 加载报告类型 - Map appMap = new HashMap(); - for (OutputAppProfile model : list) { - String appId = model.getAppContext().getId(); - appMap.put(appId.substring(appId.lastIndexOf(".") + 1), model); - } - String raciDataType = SDK.getAppAPI().getProperty("com.actionsoft.apps.coe.pal.output.raci", "raciDataType");// raci - if (raciDataType == null) { - raciDataType = "pal"; - } - String orDataType = SDK.getAppAPI().getProperty("com.actionsoft.apps.coe.pal.output.or", "orDataType");// or - if (orDataType == null) { - orDataType = "pal"; - } - for (Map.Entry entry : appMap.entrySet()) { - OutputAppProfile profile = entry.getValue(); - JSONObject json = new JSONObject(); - json.put("id", "output_" + entry.getKey()); - json.put("name", profile.getGroupName()); - json.put("open", true); - json.put("icon", "../apps/" + profile.getAppContext().getId() + "/img/parent16.png"); - jsonArray.add(json); - } - // 排序 pr or raci risk,加入制度手册与表单手册排序 - if (jsonArray != null && !jsonArray.isEmpty()) { - JSONArray temp = new JSONArray(); - String [] arr = {"output_pr", "output_or", "output_raci","output_bd","output_zd","output_risk"}; - for (int i = 0; i < arr.length; i++) { - for (int j = 0; j < jsonArray.size(); j++) { - if (arr[i].equals(jsonArray.getJSONObject(j).getString("id"))) { - temp.add(jsonArray.getJSONObject(j)); - } - } - } - List tempList = Arrays.asList(arr); - for (int j = 0; j < jsonArray.size(); j++) { - if (!tempList.contains(jsonArray.getJSONObject(j).getString("id"))) { - temp.add(jsonArray.getJSONObject(j)); - } - } - jsonArray = temp; - } - // 加载每种报告类型中的具体类型 - for (OutputAppProfile model : list) { - createJsonData(jsonArray, model); - } - Map map = new HashMap(); - map.put("sid", getSessionId()); - map.put("treeData", jsonArray.toString()); - map.put("raciDataType", raciDataType); - map.put("orDataType", orDataType); - map.put("templateOperate", UtilString.isEmpty(templateOperate) ? "0" : templateOperate); - return HtmlPageTemplate.merge(CoEConstant.APP_ID, "pal.pl.repository.outputreport.tree.htm", map); - } + String operate = "" + "" + ""; + if (sta == 0) { + state = "就绪"; + if (!"".equals(teamId)) { + operate = "" + ""; + } else { + operate = "" + ""; + } + } else if (sta == 1) { + state = "正在执行" + ""; + operate = ""; + } else if (sta == 2) { + operate = ""; + state = "成功"; + String clickFun = ""; + String buttonType = ""; + String cursorType = "default"; + if ((appFile.getAppContext().getId().equals("com.actionsoft.apps.coe.pal.output.pr") || appFile.getAppContext().getId().equals("com.awspaas.user.apps.coe.pal.output.bd") || appFile.getAppContext().getId().equals("com.awspaas.user.apps.coe.pal.output.zd")) && SDK.getAppAPI().isInstalled("com.actionsoft.apps.addons.onlinedoc") && SDK.getAppAPI().isActive("com.actionsoft.apps.addons.onlinedoc")) { + // if ("步骤横表".equals(reportTypeName) || "步骤竖表".equals(reportTypeName)) { + clickFun = "onclick=\"OutputReport.previewReport('" + model.getId() + "','" + appFile.getAppContext().getId() + "')\""; + buttonType = ""; + cursorType = "pointer"; + operate += "" + buttonType + ""; + } + operate += "" + "" + "" + ""; + } - private void createJsonData(JSONArray jsonArray, OutputAppProfile model) { - JSONObject json; - json = new JSONObject(); - json.put("id", model.getId()); - json.put("name", model.getTitle()); - json.put("groupName", model.getGroupName()); - String appId = model.getAppContext().getId(); - json.put("pid", "output_" + appId.substring(appId.lastIndexOf(".") + 1)); - json.put("targetMethodScope", model.getTargetMethodScope()); - json.put("targetMethodType", model.getTargetMethodType()); - json.put("relationMethodScope", model.getRelationMethodScope()); - json.put("lang", model.getLang()); - json.put("optionClass", model.getOptionClass()); - json.put("generClass", model.getGenerClass()); - json.put("icon", "../apps/" + model.getAppContext().getId() + "/img/icon16.png"); - json.put("isDownload", model.isDownload()); - json.put("templates", model.getTemplates()); - json.put("appId", model.getAppContext().getId()); - jsonArray.add(json); - } + Map params = new HashMap(); + String teamName = ""; + if (!UtilString.isEmpty(model.getTeamId())) { + teamName = getTeamName(model, params, teamName); + } + String qtip = ""; + if (endTime != null) { + qtip = beginTime + "
" + endTimeStr; + } + String td = "" + StringHandleUtil.replaceSpecialChart(model.getTaskName()) + "" + "" + reportTypeName + "" + "" + teamName + "" + "" + ownName + " " + "" + totalTimeS + "" + "" + state + " " + "" + operate + ""; + if (!"".equals(teamId)) { + td = "" + StringHandleUtil.replaceSpecialChart(model.getTaskName()) + "" + reportTypeName + "" + "" + ownName + " " + "" + totalTimeS + "" + "" + state + " " + "" + operate + ""; + } + return td; + } - /** - * 限定范围树展开的数据 - * - * @param methodType 建模大类、建模方法,多个用逗号隔开,如果为空表示全部 - * @param wsid 流程id - * @param pid 父id - * @param versionType 版本类型 - * @return - */ - public String PALFileJsonData(String methodType, String wsid, String pid, String versionType, String teamId) { - List list = PALRepositoryQueryAPIManager.getInstance().getJsonToList(pid, wsid, super.getContext().getLanguage(), methodType); - JSONArray jsonArr = new JSONArray(); - for (JSONObject json : list) { - jsonArr.add(json); - } - return jsonArr.toString(); - } + /** + * 得到小组的名称 + * + * @param model + * @param params + * @param teamName + * @return + */ + private String getTeamName(OutputTaskModel model, Map params, String teamName) { + ResponseObject ro; + boolean active = CoeCooperationAPIManager.getInstance().isInstall(); + if (!active) { + return ""; + } + params.put("teamId", model.getTeamId()); + params.put("sid", _uc.getSessionId()); + CoeCooperationTeamModel team = CoeCooperationAPIManager.getInstance().queryCooperationTeamById(model.getTeamId()); + if (team != null) { + return team.getTeamName(); + } + return ""; + } - /** - * 限定范围树的根节点 - * - * @param methodType - * @param wsid - * @param versionType - * @param targetMethodType - * @return - */ - public String PALFileJsonDataRoot(String methodType, String wsid, String versionType, String teamId, String targetMethodType) { - Map map = new HashMap(); - map.put("sid", getSessionId()); - map.put("targetMethodType", targetMethodType == null ? "" : targetMethodType); - map.put("methodType", methodType); - map.put("wsid", wsid); - map.put("versionType", versionType); - map.put("wsid", wsid); - map.put("teamId", teamId); - return HtmlPageTemplate.merge(CoEConstant.APP_ID, "pal.pl.repository.outputreport.pal.file.tree.htm", map); - } + /** + * 注册的App的生成的json数树 + * + * @param language + * @param templateOperate + * @return + */ + public String jsonData(String language, String templateOperate) { + // 多语言过滤, 暂时没有实现多语言 + if (!"cn".equals(language)) { + return ""; + } + List list = OutputAppManager.getList(); + JSONArray jsonArray = new JSONArray(); - private String getSessionId() { - return this.getContext().getSessionId(); - } + // 加载报告类型 + Map appMap = new HashMap(); + for (OutputAppProfile model : list) { + String appId = model.getAppContext().getId(); + appMap.put(appId.substring(appId.lastIndexOf(".") + 1), model); + } + String raciDataType = SDK.getAppAPI().getProperty("com.actionsoft.apps.coe.pal.output.raci", "raciDataType");// raci + if (raciDataType == null) { + raciDataType = "pal"; + } + String orDataType = SDK.getAppAPI().getProperty("com.actionsoft.apps.coe.pal.output.or", "orDataType");// or + if (orDataType == null) { + orDataType = "pal"; + } + for (Map.Entry entry : appMap.entrySet()) { + OutputAppProfile profile = entry.getValue(); + JSONObject json = new JSONObject(); + json.put("id", "output_" + entry.getKey()); + json.put("name", profile.getGroupName()); + json.put("open", true); + json.put("icon", "../apps/" + profile.getAppContext().getId() + "/img/parent16.png"); + jsonArray.add(json); + } + // 排序 pr or raci risk,加入制度手册与表单手册排序 + if (jsonArray != null && !jsonArray.isEmpty()) { + JSONArray temp = new JSONArray(); + String[] arr = {"output_pr", "output_or", "output_raci", "output_bd", "output_zd", "output_risk"}; + for (int i = 0; i < arr.length; i++) { + for (int j = 0; j < jsonArray.size(); j++) { + if (arr[i].equals(jsonArray.getJSONObject(j).getString("id"))) { + temp.add(jsonArray.getJSONObject(j)); + } + } + } + List tempList = Arrays.asList(arr); + for (int j = 0; j < jsonArray.size(); j++) { + if (!tempList.contains(jsonArray.getJSONObject(j).getString("id"))) { + temp.add(jsonArray.getJSONObject(j)); + } + } + jsonArray = temp; + } + // 加载每种报告类型中的具体类型 + for (OutputAppProfile model : list) { + createJsonData(jsonArray, model); + } + Map map = new HashMap(); + map.put("sid", getSessionId()); + map.put("treeData", jsonArray.toString()); + map.put("raciDataType", raciDataType); + map.put("orDataType", orDataType); + map.put("templateOperate", UtilString.isEmpty(templateOperate) ? "0" : templateOperate); + return HtmlPageTemplate.merge(CoEConstant.APP_ID, "pal.pl.repository.outputreport.tree.htm", map); + } - /** - * 获取有权限以及Methods限制的流程树 - * - * @param methodType - * @param wsid - * @param versionType - * @param teamId - * @return - */ - public String PALFileJsonDataRootTreeData(String methodType, String wsid, String versionType, String teamId) { - JSONArray jsonArr = null; - //if (teamId == null || "".equals(teamId)) { - if (teamId == null) { - jsonArr = PALRepositoryQueryAPIManager.getInstance().getPalRepositoryTreeData(_uc, wsid, methodType, versionType); - } else { - jsonArr = PALRepositoryQueryAPIManager.getInstance().getPermPalRepositoryTreeDataByMethods(_uc, wsid, teamId, versionType, methodType); - } - return jsonArr.toString(); - } + private void createJsonData(JSONArray jsonArray, OutputAppProfile model) { + JSONObject json; + json = new JSONObject(); + json.put("id", model.getId()); + json.put("name", model.getTitle()); + json.put("groupName", model.getGroupName()); + String appId = model.getAppContext().getId(); + json.put("pid", "output_" + appId.substring(appId.lastIndexOf(".") + 1)); + json.put("targetMethodScope", model.getTargetMethodScope()); + json.put("targetMethodType", model.getTargetMethodType()); + json.put("relationMethodScope", model.getRelationMethodScope()); + json.put("lang", model.getLang()); + json.put("optionClass", model.getOptionClass()); + json.put("generClass", model.getGenerClass()); + json.put("icon", "../apps/" + model.getAppContext().getId() + "/img/icon16.png"); + json.put("isDownload", model.isDownload()); + json.put("templates", model.getTemplates()); + json.put("appId", model.getAppContext().getId()); + jsonArray.add(json); + } - /** - * 报告数据保存 - * - * @param lang  语言 - * @param taskName  任务名称 - * @param userId  操作人 - * @param teamId  小组id - * @param profileId  要生成的报告的appId - * @param wsId  流程库id - * @param isExecute  是否执行 - * @param config  配置的数据 - * @param targetFileId 限定范围的文件id - * @param targetShape 限定范围文件元素的id - * @param relationFileId  关联文件id - * @param isModify  是否修改 - * @param taskId 任务id - * @return - */ - public String reportSave(String lang, String taskName, String userId, String teamId, String profileId, String wsId, String isExecute, String config, String targetFileId, String targetShape, String relationFileId, String isModify, String taskId) { - OutputTaskModel model = null; - if ("true".equals(isModify)) { - OutputTask outTask = new OutputTask(); - model = outTask.queryById(taskId); - wsId = model.getWsId(); - setModel(lang, taskName, userId, teamId, profileId, wsId, model); - outTask.update(model); - } else { - model = createModel(lang, taskName, userId, teamId, profileId, wsId); - taskId = model.getId(); - new OutputTask().insert(model); - } - ResponseObject ro = null; - try { - // 保存配置的数据 - OutputAPIManager.getInstance().saveWizardJsonData(wsId, model.getId(), profileId, createJson(config, targetFileId, targetShape, relationFileId).toString()); - // 是否立即执行 - if ("Y".equals(isExecute)) { - OutputAPIManager.getInstance().startTask(model.getId(), _uc); - } - model = null; + /** + * 限定范围树展开的数据 + * + * @param methodType 建模大类、建模方法,多个用逗号隔开,如果为空表示全部 + * @param wsid 流程id + * @param pid 父id + * @param versionType 版本类型 + * @return + */ + public String PALFileJsonData(String methodType, String wsid, String pid, String versionType, String teamId) { + List list = PALRepositoryQueryAPIManager.getInstance().getJsonToList(pid, wsid, super.getContext().getLanguage(), methodType); + JSONArray jsonArr = new JSONArray(); + for (JSONObject json : list) { + jsonArr.add(json); + } + return jsonArr.toString(); + } - ro = createRes(true, wsId, teamId, taskId); - } catch (AWSException e) { - ro = createRes(false, wsId, teamId, taskId); - e.printStackTrace(System.err); - } - return ro.toString(); - } - - /** - * 报告数据保存 - * 使用Callable等待手册线程执行完 - * - * @param lang  语言 - * @param taskName  任务名称 - * @param userId  操作人 - * @param teamId  小组id - * @param profileId  要生成的报告的appId - * @param wsId  流程库id - * @param isExecute  是否执行 - * @param config  配置的数据 - * @param targetFileId 限定范围的文件id - * @param targetShape 限定范围文件元素的id - * @param relationFileId  关联文件id - * @param isModify  是否修改 - * @param taskId 任务id - * @return - */ - public String reportSaveByCallable(String lang, String taskName, String userId, String teamId, String profileId, String wsId, String isExecute, String config, String targetFileId, String targetShape, String relationFileId, String isModify, String taskId) { - OutputTaskModel model = null; - if ("true".equals(isModify)) { - OutputTask outTask = new OutputTask(); - model = outTask.queryById(taskId); - wsId = model.getWsId(); - setModel(lang, taskName, userId, teamId, profileId, wsId, model); - outTask.update(model); - } else { - model = createModel(lang, taskName, userId, teamId, profileId, wsId); - taskId = model.getId(); - new OutputTask().insert(model); - } - ResponseObject ro = null; - try { - // 保存配置的数据 - OutputAPIManager.getInstance().saveWizardJsonData(wsId, model.getId(), profileId, createJson(config, targetFileId, targetShape, relationFileId).toString()); - // 是否立即执行 - if ("Y".equals(isExecute)) { - ResponseObject r = OutputAPIManager.getInstance().startTaskAndReturnResult(model.getId(), _uc); - if (r.isErr()) { - throw new AWSException("流程手册创建失败"); - } - } - model = null; + /** + * 限定范围树的根节点 + * + * @param methodType + * @param wsid + * @param versionType + * @param targetMethodType + * @return + */ + public String PALFileJsonDataRoot(String methodType, String wsid, String versionType, String teamId, String targetMethodType) { + Map map = new HashMap(); + map.put("sid", getSessionId()); + map.put("targetMethodType", targetMethodType == null ? "" : targetMethodType); + map.put("methodType", methodType); + map.put("wsid", wsid); + map.put("versionType", versionType); + map.put("wsid", wsid); + map.put("teamId", teamId); + return HtmlPageTemplate.merge(CoEConstant.APP_ID, "pal.pl.repository.outputreport.pal.file.tree.htm", map); + } - ro = createRes(true, wsId, teamId, taskId); - } catch (AWSException e) { - ro = createRes(false, wsId, teamId, taskId); - e.printStackTrace(System.err); - } - return ro.toString(); - } + private String getSessionId() { + return this.getContext().getSessionId(); + } - /** - * 存储的jsonData组装 - * - * @param config - * @param targetFileId - * @param targetShape - * @param relationFileId - * @return - */ - private JSONObject createJson(String config, String targetFileId, String targetShape, String relationFileId) { - JSONObject json = JSONObject.parseObject(config); - json.put("targetFileId", targetFileId); - json.put("targetShape", targetShape); - json.put("relationFileId", relationFileId); - return json; - } + /** + * 获取有权限以及Methods限制的流程树 + * + * @param methodType + * @param wsid + * @param versionType + * @param teamId + * @return + */ + public String PALFileJsonDataRootTreeData(String methodType, String wsid, String versionType, String teamId) { + JSONArray jsonArr = null; + //if (teamId == null || "".equals(teamId)) { + if (teamId == null) { + jsonArr = PALRepositoryQueryAPIManager.getInstance().getPalRepositoryTreeData(_uc, wsid, methodType, versionType); + } else { + jsonArr = PALRepositoryQueryAPIManager.getInstance().getPermPalRepositoryTreeDataByMethods(_uc, wsid, teamId, versionType, methodType); + } + return jsonArr.toString(); + } - /** - * 返回对象组装 - * - * @param flag - * @param wsid - * @return - */ - @SuppressWarnings("deprecation") - private ResponseObject createRes(boolean flag, String wsid, String teamId, String taskId) { - ResponseObject ro = ResponseObject.newErrResponse(); - if (flag) { - JSONObject json = new JSONObject(); - ro = ResponseObject.newOkResponse(); - json.put("totalPage", getCountTotal(wsid, teamId)); - json.put("taskId", taskId); - ro.setData(json); - } else { - ro = ResponseObject.newErrResponse(); - } - return ro; - } + /** + * 报告数据保存 + * + * @param lang  语言 + * @param taskName  任务名称 + * @param userId  操作人 + * @param teamId  小组id + * @param profileId  要生成的报告的appId + * @param wsId  流程库id + * @param isExecute  是否执行 + * @param config  配置的数据 + * @param targetFileId 限定范围的文件id + * @param targetShape 限定范围文件元素的id + * @param relationFileId  关联文件id + * @param isModify  是否修改 + * @param taskId 任务id + * @return + */ + public String reportSave(String lang, String taskName, String userId, String teamId, String profileId, String wsId, String isExecute, String config, String targetFileId, String targetShape, String relationFileId, String isModify, String taskId) { + OutputTaskModel model = null; + if ("true".equals(isModify)) { + OutputTask outTask = new OutputTask(); + model = outTask.queryById(taskId); + wsId = model.getWsId(); + setModel(lang, taskName, userId, teamId, profileId, wsId, model); + outTask.update(model); + } else { + model = createModel(lang, taskName, userId, teamId, profileId, wsId); + taskId = model.getId(); + new OutputTask().insert(model); + } + ResponseObject ro = null; + try { + // 保存配置的数据 + OutputAPIManager.getInstance().saveWizardJsonData(wsId, model.getId(), profileId, createJson(config, targetFileId, targetShape, relationFileId).toString()); + // 是否立即执行 + if ("Y".equals(isExecute)) { + OutputAPIManager.getInstance().startTask(model.getId(), _uc); + } + model = null; - /** - * 对象组装 - * - * @param lang - * @param taskName - * @param userId - * @param teamId - * @param profileId - * @param wsId - * @return - */ - private OutputTaskModel createModel(String lang, String taskName, String userId, String teamId, String profileId, String wsId) { - OutputTaskModel model = new OutputTaskModel(); - model.setCreateTime(new Timestamp(System.currentTimeMillis())); - model.setId(UUIDGener.getUUID()); - setModel(lang, taskName, userId, teamId, profileId, wsId, model); - return model; - } + ro = createRes(true, wsId, teamId, taskId); + } catch (AWSException e) { + ro = createRes(false, wsId, teamId, taskId); + e.printStackTrace(System.err); + } + return ro.toString(); + } - private void setModel(String lang, String taskName, String userId, String teamId, String profileId, String wsId, OutputTaskModel model) { - model.setLang(lang); - model.setProfileId(profileId); - if (model.getUserId() == null || "".equals(model.getUserId())) { - if (userId == null || "".equals(userId)) { - model.setUserId(_uc.getUID()); - } else { - model.setUserId(userId); - } - } - model.setTaskName(taskName); - model.setWsId(wsId); - model.setTeamId(teamId); - } + /** + * 报告数据保存 + * 使用Callable等待手册线程执行完 + * + * @param lang  语言 + * @param taskName  任务名称 + * @param userId  操作人 + * @param teamId  小组id + * @param profileId  要生成的报告的appId + * @param wsId  流程库id + * @param isExecute  是否执行 + * @param config  配置的数据 + * @param targetFileId 限定范围的文件id + * @param targetShape 限定范围文件元素的id + * @param relationFileId  关联文件id + * @param isModify  是否修改 + * @param taskId 任务id + * @return + */ + public String reportSaveByCallable(String lang, String taskName, String userId, String teamId, String profileId, String wsId, String isExecute, String config, String targetFileId, String targetShape, String relationFileId, String isModify, String taskId) { + OutputTaskModel model = null; + if ("true".equals(isModify)) { + OutputTask outTask = new OutputTask(); + model = outTask.queryById(taskId); + wsId = model.getWsId(); + setModel(lang, taskName, userId, teamId, profileId, wsId, model); + outTask.update(model); + } else { + model = createModel(lang, taskName, userId, teamId, profileId, wsId); + taskId = model.getId(); + new OutputTask().insert(model); + } + ResponseObject ro = null; + try { + // 保存配置的数据 + OutputAPIManager.getInstance().saveWizardJsonData(wsId, model.getId(), profileId, createJson(config, targetFileId, targetShape, relationFileId).toString()); + // 是否立即执行 + if ("Y".equals(isExecute)) { + ResponseObject r = OutputAPIManager.getInstance().startTaskAndReturnResult(model.getId(), _uc); + if (r.isErr()) { + throw new AWSException("流程手册创建失败"); + } + } + model = null; - /** - * 关联关系的tree数据 - * - * @param methodType  建模方法大类 - * @param wsid  流程库id - * @param versionType  版本id - * @param teamId  小组id - * @return - */ - public String PALFileRelationJsonDataRoot(String methodType, String wsid, String versionType, String teamId) { - JSONArray jsonArr = null; - if (teamId == null || "".equals(teamId)) { - jsonArr = PALRepositoryQueryAPIManager.getInstance().getPalRepositoryTreeData(_uc, wsid, methodType, versionType); - } else { - jsonArr = PALRepositoryQueryAPIManager.getInstance().getPermPalRepositoryTreeDataByMethods(_uc, wsid, teamId, versionType, methodType); - } - // jsonArr = PALRepositoryQueryAPIManager.getInstance().getLimitPALTree(new JSONArray(), methodType, wsid, versionType); - Map map = new HashMap(); - map.put("sid", getSessionId()); - map.put("treeData", jsonArr.toString()); - return HtmlPageTemplate.merge(CoEConstant.APP_ID, "pal.pl.repository.outputreport.pal.file.relation.tree.htm", map); - } + ro = createRes(true, wsId, teamId, taskId); + } catch (AWSException e) { + ro = createRes(false, wsId, teamId, taskId); + e.printStackTrace(System.err); + } + return ro.toString(); + } - /** - * 根据teamId得到流程库的id - * - * @param teamId - * @return - */ - public String getWsIdByTeamId(String teamId) { - CoeCooperationTeamModel team = CoeCooperationAPIManager.getInstance().queryCooperationTeamById(teamId, true); - if (team != null) { - return team.getWsId(); - } - return null; - } + /** + * 存储的jsonData组装 + * + * @param config + * @param targetFileId + * @param targetShape + * @param relationFileId + * @return + */ + private JSONObject createJson(String config, String targetFileId, String targetShape, String relationFileId) { + JSONObject json = JSONObject.parseObject(config); + json.put("targetFileId", targetFileId); + json.put("targetShape", targetShape); + json.put("relationFileId", relationFileId); + return json; + } - /** - * 返回关联的json数据组tree - * - * @param methodType - * @param pid - * @param wsid - * @param versionType - * @param teamId - * @return - */ - public String PALFileRelationJsonData(String methodType, String pid, String wsid, String versionType, String teamId) { - List list = PALRepositoryQueryAPIManager.getInstance().getJsonToList(pid, wsid, super.getContext().getLanguage(), methodType); - JSONArray jsonArr = new JSONArray(); - for (JSONObject json : list) { - jsonArr.add(json); - } - return jsonArr.toString(); - } + /** + * 返回对象组装 + * + * @param flag + * @param wsid + * @return + */ + @SuppressWarnings("deprecation") + private ResponseObject createRes(boolean flag, String wsid, String teamId, String taskId) { + ResponseObject ro = ResponseObject.newErrResponse(); + if (flag) { + JSONObject json = new JSONObject(); + ro = ResponseObject.newOkResponse(); + json.put("totalPage", getCountTotal(wsid, teamId)); + json.put("taskId", taskId); + ro.setData(json); + } else { + ro = ResponseObject.newErrResponse(); + } + return ro; + } - /** - * 报告删除 - * - * @param id - * @param wsid - * @param profileId - * @return - */ - public String reportDelete(String id, String wsid, String profileId, String teamId) { - ResponseObject ro = null; - //三员管理,流程文件密级switch开启,密级权限校验 - if (HighSecurityUtil.isON() && HighSecurityUtil.fileSecuritySwitch()){ - OutputTaskModel model = new OutputTask().getTaskReportById(id); - if (null != model){ - ResponseObject securityPermission = PALRepositoryQueryAPIManager.getInstance().checkOutputSecurityPermission(_uc, model); - if (securityPermission.isErr()){ - return securityPermission.toString(); - } - } - } - boolean flag = new OutputTask().delete(id, wsid); - if (flag) { - ro = isDeleteOk(id, wsid, profileId, teamId); - // 操作行为日志记录 - if (SDK.getAppAPI().getPropertyBooleanValue(CoEConstant.APP_ID, "IS_RECORD_OP_LOG", false)) { - CoEOpLogAPI.auditOkOp(_uc, CoEOpLogConst.MODULE_CATEGORY_APPCENTER, CoEOpLogConst.OP_DELETE, CoEOpLogConst.INFO_OUTPUT_DELETE); - } - } else { - ro = ResponseObject.newErrResponse(); - } - return ro.toString(); - } + /** + * 对象组装 + * + * @param lang + * @param taskName + * @param userId + * @param teamId + * @param profileId + * @param wsId + * @return + */ + private OutputTaskModel createModel(String lang, String taskName, String userId, String teamId, String profileId, String wsId) { + OutputTaskModel model = new OutputTaskModel(); + model.setCreateTime(new Timestamp(System.currentTimeMillis())); + model.setId(UUIDGener.getUUID()); + setModel(lang, taskName, userId, teamId, profileId, wsId, model); + return model; + } - private ResponseObject isDeleteOk(String id, String wsid, String profileId, String teamId) { - ResponseObject ro; - try { - OutputAPIManager.getInstance().delFile(wsid, id, profileId); - } catch (AWSException e) { - e.printStackTrace(); - } - ro = ResponseObject.newOkResponse(); - JSONObject json = new JSONObject(); - json.put("totalPage", getCountTotal(wsid, teamId)); - ro.setData(json); - return ro; - } + private void setModel(String lang, String taskName, String userId, String teamId, String profileId, String wsId, OutputTaskModel model) { + model.setLang(lang); + model.setProfileId(profileId); + if (model.getUserId() == null || "".equals(model.getUserId())) { + if (userId == null || "".equals(userId)) { + model.setUserId(_uc.getUID()); + } else { + model.setUserId(userId); + } + } + model.setTaskName(taskName); + model.setWsId(wsId); + model.setTeamId(teamId); + } - /** - * 报告统计 - * - * @param teamId  小组id - * @param wsid  流程库id - * @param data  查询条件 - * @return - */ - public String reportCount(String teamId, String wsid, String data) { - List listIds = OutputAppManager.getProfileName(data); - String profileId = getProfileId(listIds); - int count = getCount(teamId, wsid, data, profileId); - ResponseObject ro = ResponseObject.newOkResponse(); - JSONObject json = new JSONObject(); - json.put("count", count); - ro.setData(json); - return ro.toString(); - } + /** + * 关联关系的tree数据 + * + * @param methodType  建模方法大类 + * @param wsid  流程库id + * @param versionType  版本id + * @param teamId  小组id + * @return + */ + public String PALFileRelationJsonDataRoot(String methodType, String wsid, String versionType, String teamId) { + JSONArray jsonArr = null; + if (teamId == null || "".equals(teamId)) { + jsonArr = PALRepositoryQueryAPIManager.getInstance().getPalRepositoryTreeData(_uc, wsid, methodType, versionType); + } else { + jsonArr = PALRepositoryQueryAPIManager.getInstance().getPermPalRepositoryTreeDataByMethods(_uc, wsid, teamId, versionType, methodType); + } + // jsonArr = PALRepositoryQueryAPIManager.getInstance().getLimitPALTree(new JSONArray(), methodType, wsid, versionType); + Map map = new HashMap(); + map.put("sid", getSessionId()); + map.put("treeData", jsonArr.toString()); + return HtmlPageTemplate.merge(CoEConstant.APP_ID, "pal.pl.repository.outputreport.pal.file.relation.tree.htm", map); + } - private int getCount(String teamId, String wsid, String data, String profileId) { - return new OutputTask().getCount(wsid, teamId, data, profileId); - } + /** + * 根据teamId得到流程库的id + * + * @param teamId + * @return + */ + public String getWsIdByTeamId(String teamId) { + CoeCooperationTeamModel team = CoeCooperationAPIManager.getInstance().queryCooperationTeamById(teamId, true); + if (team != null) { + return team.getWsId(); + } + return null; + } - private String getProfileId(List listIds) { - StringBuilder sb1 = new StringBuilder(); - for (String str : listIds) { - sb1.append("'").append(str).append("',"); - } - String profileId = sb1.toString(); - if (profileId.lastIndexOf(",") > 0) { - profileId = profileId.substring(0, profileId.lastIndexOf(",")); - } - return profileId; - } + /** + * 返回关联的json数据组tree + * + * @param methodType + * @param pid + * @param wsid + * @param versionType + * @param teamId + * @return + */ + public String PALFileRelationJsonData(String methodType, String pid, String wsid, String versionType, String teamId) { + List list = PALRepositoryQueryAPIManager.getInstance().getJsonToList(pid, wsid, super.getContext().getLanguage(), methodType); + JSONArray jsonArr = new JSONArray(); + for (JSONObject json : list) { + jsonArr.add(json); + } + return jsonArr.toString(); + } - /** - * 执行报告 - * - * @param id  报告id - * @param wsid  流程库id - * @param profileId  生成报告的appId - * @return - */ - public String reportExecute(String id, String wsid, String profileId) { - try { - OutputAPIManager.getInstance().startTask(id, _uc); - } catch (AWSException e) { - e.printStackTrace(); - } - return ResponseObject.newOkResponse().toString(); - } + /** + * 报告删除 + * + * @param id + * @param wsid + * @param profileId + * @return + */ + public String reportDelete(String id, String wsid, String profileId, String teamId) { + ResponseObject ro = null; + //三员管理,流程文件密级switch开启,密级权限校验 + if (HighSecurityUtil.isON() && HighSecurityUtil.fileSecuritySwitch()) { + OutputTaskModel model = new OutputTask().getTaskReportById(id); + if (null != model) { + ResponseObject securityPermission = PALRepositoryQueryAPIManager.getInstance().checkOutputSecurityPermission(_uc, model); + if (securityPermission.isErr()) { + return securityPermission.toString(); + } + } + } + boolean flag = new OutputTask().delete(id, wsid); + if (flag) { + ro = isDeleteOk(id, wsid, profileId, teamId); + // 操作行为日志记录 + if (SDK.getAppAPI().getPropertyBooleanValue(CoEConstant.APP_ID, "IS_RECORD_OP_LOG", false)) { + CoEOpLogAPI.auditOkOp(_uc, CoEOpLogConst.MODULE_CATEGORY_APPCENTER, CoEOpLogConst.OP_DELETE, CoEOpLogConst.INFO_OUTPUT_DELETE); + } + } else { + ro = ResponseObject.newErrResponse(); + } + return ro.toString(); + } - /** - * 修改报告 - * - * @param id  任务id - * @return - */ - public String reportModify(String id) { - OutputTaskModel outputTaskModel = new OutputTask().queryById(id); - OutputAppProfile appProfile = OutputAppManager.getProfile(outputTaskModel.getProfileId()); - ResponseObject ro = ResponseObject.newErrResponse(); - try { - String wizardJsonData = OutputAPIManager.getInstance().getWizardJsonData(outputTaskModel.getWsId(), id, appProfile.getId()); - ro = modifyJsonData(outputTaskModel, wizardJsonData); - } catch (AWSException e) { - ro = ResponseObject.newErrResponse(); - e.printStackTrace(); - } - return ro.toString(); - } + private ResponseObject isDeleteOk(String id, String wsid, String profileId, String teamId) { + ResponseObject ro; + try { + OutputAPIManager.getInstance().delFile(wsid, id, profileId); + } catch (AWSException e) { + e.printStackTrace(); + } + ro = ResponseObject.newOkResponse(); + JSONObject json = new JSONObject(); + json.put("totalPage", getCountTotal(wsid, teamId)); + ro.setData(json); + return ro; + } - /** - * 修改时返回给页面的数据 - * - * @param outputTaskModel - * @param wizardJsonData - * @return - */ - private ResponseObject modifyJsonData(OutputTaskModel outputTaskModel, String wizardJsonData) { - ResponseObject ro = ResponseObject.newOkResponse(); - JSONObject json = JSONObject.parseObject(wizardJsonData); - json.put("reportName", outputTaskModel.getTaskName()); - json.put("taskId", outputTaskModel.getId()); - json.put("profileId", outputTaskModel.getProfileId()); - ro.setData(json); - return ro; - } + /** + * 报告统计 + * + * @param teamId  小组id + * @param wsid  流程库id + * @param data  查询条件 + * @return + */ + public String reportCount(String teamId, String wsid, String data) { + List listIds = OutputAppManager.getProfileName(data); + String profileId = getProfileId(listIds); + int count = getCount(teamId, wsid, data, profileId); + ResponseObject ro = ResponseObject.newOkResponse(); + JSONObject json = new JSONObject(); + json.put("count", count); + ro.setData(json); + return ro.toString(); + } - /** - * 单个报告的刷新 - * - * @param id 报告的id - * @return - */ - public String refreshRowData(String id, String teamId) { - ResponseObject ro = null; - try { - ro = ResponseObject.newOkResponse(); - OutputTaskModel model = new OutputTask().getTaskReportById(id); - StringBuilder sb = new StringBuilder(); - JSONObject json = new JSONObject(); - json.put("tdContent", resData(sb, model, teamId)); - int state = model.getTaskState(); - json.put("taskState", state); - ro.setData(json); - return ro.toString(); - } catch (Exception e) { - e.printStackTrace(); - } - ro = ResponseObject.newErrResponse(); - return ro.toString(); - } + private int getCount(String teamId, String wsid, String data, String profileId) { + return new OutputTask().getCount(wsid, teamId, data, profileId); + } - /** - * 获得流程文件中的图形列表 - * - * @param id 流程文件Id - * @param type 要获得的图形的类型,“-”表示所有类型 - * @return - */ - public String getRepositoryShapes(String id, String type) { - ResponseObject ro = ResponseObject.newOkResponse(); + private String getProfileId(List listIds) { + StringBuilder sb1 = new StringBuilder(); + for (String str : listIds) { + sb1.append("'").append(str).append("',"); + } + String profileId = sb1.toString(); + if (profileId.lastIndexOf(",") > 0) { + profileId = profileId.substring(0, profileId.lastIndexOf(",")); + } + return profileId; + } - boolean isShowTree = SDK.getAppAPI().getPropertyBooleanValue("com.actionsoft.apps.coe.pal.output", "OR_ORG_TREE", false); - if (!isShowTree) { - Set typeSet = new HashSet(); - String[] types = type.split(","); - for (String t : types) { - typeSet.add(t); - } - List> list = CoeDesignerUtil.getShapeMessageJson(id); // 指定流程文件内容 + /** + * 执行报告 + * + * @param id  报告id + * @param wsid  流程库id + * @param profileId  生成报告的appId + * @return + */ + public String reportExecute(String id, String wsid, String profileId) { + try { + OutputAPIManager.getInstance().startTask(id, _uc); + } catch (AWSException e) { + e.printStackTrace(); + } + return ResponseObject.newOkResponse().toString(); + } - JSONArray jsonArray = new JSONArray(); - if (list != null) { - for (Map map : list) { - if (map.containsKey("type") && typeSet.contains((String) map.get("type"))) { - jsonArray.add(map); - } - } - } - ro.put("data", jsonArray); - ro.put("flag", 1); - } else { - String messageJson = PALRepositoryQueryAPIManager.getInstance().getProcessDefinition(null, id); - JSONObject definition = JSONObject.parseObject(messageJson); - JSONObject elements = definition.getJSONObject("elements"); - JSONArray array = ShapeUtil.getLinker(messageJson); - //第一步找出根节点 - JSONArray rootArray = new JSONArray(); - for (Map.Entry entry : elements.entrySet()) { - String key = entry.getKey(); - JSONObject shape = elements.getJSONObject(key); - if (!"linker".equals(shape.getString("name"))) { - boolean flag = true; - for (int i = 0; i < array.size(); i++) { - JSONObject tempObj = array.getJSONObject(i); - String toId = tempObj.getString("to"); - if (toId != null && toId.equals(key)) { - flag = false; - } - } - if (flag) { - rootArray.add(shape); - } - } - } - //第二步从根节点出发遍历子节点 - JSONArray resultArray = new JSONArray(); - for (int i = 0; i < rootArray.size(); i++) { - JSONObject shape = rootArray.getJSONObject(i); - JSONObject object = new JSONObject(); - Set shapeIds = Sets.newHashSet(); - shapeIds.add(shape.getString("id")); - object.put("id", i + 1); - object.put("name", shape.getString("text")); - object.put("shapeId", shape.getString("id")); - object.put("open", true); - resultArray.add(object); - getResultTree(shape, array, resultArray, i + 1, elements, shapeIds); - } - ro.put("data", JSONArray.toJSONString(resultArray)); - ro.put("flag", 2); - } - return ro.toString(); - } + /** + * 修改报告 + * + * @param id  任务id + * @return + */ + public String reportModify(String id) { + OutputTaskModel outputTaskModel = new OutputTask().queryById(id); + OutputAppProfile appProfile = OutputAppManager.getProfile(outputTaskModel.getProfileId()); + ResponseObject ro = ResponseObject.newErrResponse(); + try { + String wizardJsonData = OutputAPIManager.getInstance().getWizardJsonData(outputTaskModel.getWsId(), id, appProfile.getId()); + ro = modifyJsonData(outputTaskModel, wizardJsonData); + } catch (AWSException e) { + ro = ResponseObject.newErrResponse(); + e.printStackTrace(); + } + return ro.toString(); + } - public JSONArray getResultTree(JSONObject shape, JSONArray array, JSONArray resultArray, int id, JSONObject elements, Set shapeIds) { - JSONArray tmpShapeArray = new JSONArray(); - for (int i = 0; i < array.size(); i++) { - JSONObject tmpObject = array.getJSONObject(i); - String tmpId = tmpObject.getString("to"); - if (tmpObject.getString("from").equals(shape.getString("id")) && tmpId != null && !shapeIds.contains(tmpId)) { - shapeIds.add(tmpId); - tmpShapeArray.add(elements.getJSONObject(tmpId)); - } - } - if (tmpShapeArray.size() == 0) { - return resultArray; - } - for (int j = 0; j < tmpShapeArray.size(); j++) { - JSONObject tmpShape = tmpShapeArray.getJSONObject(j); - JSONObject object = new JSONObject(); - int tmpId = id * 10 + j + 1; - object.put("id", tmpId); - object.put("pid", id); - object.put("name", tmpShape.getString("text")); - object.put("shapeId", tmpShape.getString("id")); - resultArray.add(object); - getResultTree(tmpShape, array, resultArray, tmpId, elements, shapeIds); - } - return resultArray; - } + /** + * 修改时返回给页面的数据 + * + * @param outputTaskModel + * @param wizardJsonData + * @return + */ + private ResponseObject modifyJsonData(OutputTaskModel outputTaskModel, String wizardJsonData) { + ResponseObject ro = ResponseObject.newOkResponse(); + JSONObject json = JSONObject.parseObject(wizardJsonData); + json.put("reportName", outputTaskModel.getTaskName()); + json.put("taskId", outputTaskModel.getId()); + json.put("profileId", outputTaskModel.getProfileId()); + ro.setData(json); + return ro; + } - /** - * 根据appId获取相应的流程手册 - * @return - */ - public List getOutputAppByAppId(String appId) { - List list = OutputAppManager.getList(); - List newList = new ArrayList<>(); - for (OutputAppProfile model : list) { - if (appId.equals(model.getAppContext().getId())) { - newList.add(model); - } - } - return newList; - } - - /** - * 检测是否可以导出流程手册 - * @param fileId 流程id - * @return - */ - public String checkOutputProcess(String fileId) { - PALRepositoryModel pmodel = PALRepositoryCache.getCache().get(fileId); - if (pmodel == null) { - return ResponseObject.newErrResponse().toString(); - } - ResponseObject ro = ResponseObject.newOkResponse(); - List newList = new ArrayList<>(); - List list = OutputAppManager.getList(); - for (OutputAppProfile model : list) { - String appId = model.getAppContext().getId(); - if ("com.actionsoft.apps.coe.pal.output.pr".equals(appId) && model.getTargetMethodScope().contains(pmodel.getMethodId())) { - newList.add(model); - } else if ("com.awspaas.user.apps.coe.pal.output.bd".equals(appId) && model.getTargetMethodScope().contains(pmodel.getMethodId())) { - newList.add(model); - } else if ("com.awspaas.user.apps.coe.pal.output.zd".equals(appId) && model.getTargetMethodScope().contains(pmodel.getMethodId())) { - newList.add(model); - } - } - JSONArray array = new JSONArray(); - for (OutputAppProfile model : newList) { - JSONObject object = new JSONObject(); - object.put("id", model.getId()); - object.put("groupName", model.getGroupName()); - object.put("title", model.getTitle()); - array.add(object); - } - boolean shapeNumberSort = SDK.getAppAPI().getPropertyBooleanValue("com.actionsoft.apps.coe.pal.output", "SHAPE_NUMBER_SORT", true); - ro.put("shapeNumberSort", shapeNumberSort); - ro.put("data", array); - return ro.toString(); - } + /** + * 单个报告的刷新 + * + * @param id 报告的id + * @return + */ + public String refreshRowData(String id, String teamId) { + ResponseObject ro = null; + try { + ro = ResponseObject.newOkResponse(); + OutputTaskModel model = new OutputTask().getTaskReportById(id); + StringBuilder sb = new StringBuilder(); + JSONObject json = new JSONObject(); + json.put("tdContent", resData(sb, model, teamId)); + int state = model.getTaskState(); + json.put("taskState", state); + ro.setData(json); + return ro.toString(); + } catch (Exception e) { + e.printStackTrace(); + } + ro = ResponseObject.newErrResponse(); + return ro.toString(); + } - /** - * 报告生成器 - * raci关联awsorg相关 - * @param wsid - * @param teamId - * @param methodType - * @param targetMethodType - * @return - */ - public String getOutputreportAwsOrgPage(String wsid, String teamId, String methodType, String targetMethodType, String type) { - Map map = new HashMap(); - map.put("sid", getSessionId()); - map.put("targetMethodType", targetMethodType == null ? "" : targetMethodType); - map.put("methodType", methodType); - map.put("wsid", wsid); - map.put("teamId", teamId); - map.put("type", type); - return HtmlPageTemplate.merge(CoEConstant.APP_ID, "pal.pl.repository.outputreport.pal.tree.aws.org.htm", map); - } + /** + * 获得流程文件中的图形列表 + * + * @param id 流程文件Id + * @param type 要获得的图形的类型,“-”表示所有类型 + * @return + */ + public String getRepositoryShapes(String id, String type) { + ResponseObject ro = ResponseObject.newOkResponse(); - /** - * 报告生成器 - * raci树结构(aws org) - * @param wsid - * @param teamId - * @param methodType - * @return - */ - public String getOutputreportAwsOrgTreeData(String wsid, String teamId, String methodType, String type) { - ResponseObject ro = ResponseObject.newOkResponse(); - JSONArray treeData = new JSONArray(); - // department,user,role,position - if (type.contains("department") && type.contains("user")) { - // 组织 - JSONObject org = new JSONObject(); - String orgRoot = "aws_node_org"; - org.put("id", orgRoot); - org.put("name", I18nRes.findValue(AppsConst.SYS_APP_PLATFORM, "组织")); - org.put("open", true); - org.put("nocheck", true); - org.put("type", "orgRoot"); - org.put("uuid", "orgRoot"); - JSONObject iconFont = new JSONObject(); - iconFont.put("code", BpmOrgUtil.ORG_ROOT_ICON_CODE); - iconFont.put("color", BpmOrgUtil.ORG_ROOT_ICON_COLOR); - org.put("iconFont", iconFont); - treeData.add(org); - // 单位/部门/人员 - JSONArray data = new JSONArray(); - getSubCompanyTreeNodeByOrgRoot(orgRoot, data); - for (int i = 0; i < data.size(); i++) { - treeData.add(data.get(i)); - } - } - if (type.contains("role")) { - // 岗位根目录 - JSONObject position = new JSONObject(); - String positionRoot = "aws_node_position"; - position.put("id", positionRoot); - position.put("name", I18nRes.findValue(AppsConst.SYS_APP_PLATFORM, "岗位")); - position.put("open", true); - position.put("nocheck", true); - position.put("type", "positionRoot"); - position.put("uuid", "positionRoot"); - JSONObject iconFont = new JSONObject(); - iconFont.put("code", BpmOrgUtil.POSITION_ROOT_ICON_CODE); - iconFont.put("color", BpmOrgUtil.POSITION_ROOT_ICON_COLOR); - position.put("iconFont", iconFont); - treeData.add(position); - // 岗位组/岗位 - JSONArray data2 = new JSONArray(); - getPositionTree(positionRoot, data2); - for (int i = 0; i < data2.size(); i++) { - treeData.add(data2.get(i)); - } - // 角色根目录 - JSONObject role = new JSONObject(); - String roleRoot = "aws_node_role"; - role.put("id", roleRoot); - role.put("name", I18nRes.findValue(AppsConst.SYS_APP_PLATFORM, "角色")); - role.put("open", false); - role.put("nocheck", true); - role.put("type", "roleRoot"); - role.put("uuid", "roleRoot"); - JSONObject iconFont2 = new JSONObject(); - iconFont2.put("code", BpmOrgUtil.ROLE_ROOT_ICON_CODE); - iconFont2.put("color", BpmOrgUtil.ROLE_ROOT_ICON_COLOR); - role.put("iconFont", iconFont2); - treeData.add(role); - // 角色组/角色 - JSONArray data3 = new JSONArray(); - getRoleTree(roleRoot, data3); - for (int i = 0; i < data3.size(); i++) { - treeData.add(data3.get(i)); - } - } - ro.put("data", treeData); - return ro.toString(); - } + boolean isShowTree = SDK.getAppAPI().getPropertyBooleanValue("com.actionsoft.apps.coe.pal.output", "OR_ORG_TREE", false); + if (!isShowTree) { + Set typeSet = new HashSet(); + String[] types = type.split(","); + for (String t : types) { + typeSet.add(t); + } + List> list = CoeDesignerUtil.getShapeMessageJson(id); // 指定流程文件内容 - /** - * 获取岗位树 - * @return - */ - private void getPositionTree(String root, JSONArray data) { - String[] roleCategoryList = RoleCache.getCategoryNames(); - if (roleCategoryList != null && roleCategoryList.length > 0) { - for (String name : roleCategoryList) { - if (!UtilString.isEmpty(name)) { - JSONArray groupArr = new JSONArray(); - JSONObject obj = new JSONObject(); - // 获取岗位 - List roleList = SDK.getORGAPI().getRolesByCategory(name); - if (!isEmpty(roleList)) { - for (RoleModel model : roleList) { - if (model != null && model.getRoleType() == 1) { - JSONObject roleObj = new JSONObject(); - roleObj.put("id", "aws_node_position_" + model.getId()); - roleObj.put("pid", "aws_node_positionGroup_" + name); - roleObj.put("uuid", model.getId()); - roleObj.put("name", model.getName()); - roleObj.put("nocheck", false); - roleObj.put("type", "position"); - JSONObject iconFont = new JSONObject(); - iconFont.put("code", BpmOrgUtil.POSITION_ICON_CODE); - iconFont.put("color", BpmOrgUtil.POSITION_ICON_COLOR); - roleObj.put("iconFont", iconFont); - groupArr.add(roleObj); - } - } - } - if (groupArr.size() > 0) { - // 岗位组 - obj.put("id", "aws_node_positionGroup_" + name); - obj.put("pid", "aws_node_position"); - obj.put("uuid", name); - obj.put("name", name); - obj.put("nocheck", true); - obj.put("open", false); - obj.put("type", "positionGroup"); - JSONObject iconFont = new JSONObject(); - iconFont.put("code", BpmOrgUtil.POSITION_GROUP_ICON_CODE); - iconFont.put("color", BpmOrgUtil.POSITION_GROUP_ICON_COLOR); - obj.put("iconFont", iconFont); - groupArr.add(0, obj); - data.addAll(groupArr); - } - } - } - } - } + JSONArray jsonArray = new JSONArray(); + if (list != null) { + for (Map map : list) { + if (map.containsKey("type") && typeSet.contains((String) map.get("type"))) { + jsonArray.add(map); + } + } + } + ro.put("data", jsonArray); + ro.put("flag", 1); + } else { + String messageJson = PALRepositoryQueryAPIManager.getInstance().getProcessDefinition(null, id); + JSONObject definition = JSONObject.parseObject(messageJson); + JSONObject elements = definition.getJSONObject("elements"); + JSONArray array = ShapeUtil.getLinker(messageJson); + //第一步找出根节点 + JSONArray rootArray = new JSONArray(); + for (Map.Entry entry : elements.entrySet()) { + String key = entry.getKey(); + JSONObject shape = elements.getJSONObject(key); + if (!"linker".equals(shape.getString("name"))) { + boolean flag = true; + for (int i = 0; i < array.size(); i++) { + JSONObject tempObj = array.getJSONObject(i); + String toId = tempObj.getString("to"); + if (toId != null && toId.equals(key)) { + flag = false; + } + } + if (flag) { + rootArray.add(shape); + } + } + } + //第二步从根节点出发遍历子节点 + JSONArray resultArray = new JSONArray(); + for (int i = 0; i < rootArray.size(); i++) { + JSONObject shape = rootArray.getJSONObject(i); + JSONObject object = new JSONObject(); + Set shapeIds = Sets.newHashSet(); + shapeIds.add(shape.getString("id")); + object.put("id", i + 1); + object.put("name", shape.getString("text")); + object.put("shapeId", shape.getString("id")); + object.put("open", true); + resultArray.add(object); + getResultTree(shape, array, resultArray, i + 1, elements, shapeIds); + } + ro.put("data", JSONArray.toJSONString(resultArray)); + ro.put("flag", 2); + } + return ro.toString(); + } - /** - * 获取角色树 - * @return - */ - private void getRoleTree(String root, JSONArray data) { - String[] roleCategoryList = RoleCache.getCategoryNames(); - if (roleCategoryList != null && roleCategoryList.length > 0) { - for (String name : roleCategoryList) { - if (!UtilString.isEmpty(name)) { - JSONArray groupArr = new JSONArray(); - JSONObject obj = new JSONObject(); - // 获取角色 - List roleList = SDK.getORGAPI().getRolesByCategory(name); - if (!isEmpty(roleList)) { - for (RoleModel model : roleList) { - if (model != null && model.getRoleType() == 0) { - JSONObject roleObj = new JSONObject(); - roleObj.put("id", "aws_node_role_" + model.getId()); - roleObj.put("pid", "aws_node_roleGroup_" + name); - roleObj.put("uuid", model.getId()); - roleObj.put("name", model.getName()); - roleObj.put("nocheck", false); - roleObj.put("type", "role"); - JSONObject iconFont = new JSONObject(); - iconFont.put("code", BpmOrgUtil.ROLE_ICON_CODE); - iconFont.put("color", BpmOrgUtil.ROLE_ICON_COLOR); - roleObj.put("iconFont", iconFont); - groupArr.add(roleObj); - } - } - } - if (groupArr.size() > 0) { - // 岗位组 - obj.put("id", "aws_node_roleGroup_" + name); - obj.put("pid", "aws_node_role"); - obj.put("uuid", name); - obj.put("name", name); - obj.put("nocheck", true); - obj.put("open", false); - obj.put("type", "roleGroup"); - JSONObject iconFont = new JSONObject(); - iconFont.put("code", BpmOrgUtil.ROLE_GROUP_ICON_CODE); - iconFont.put("color", BpmOrgUtil.ROLE_GROUP_ICON_COLOR); - obj.put("iconFont", iconFont); - groupArr.add(0, obj); - data.addAll(groupArr); - } - } - } - } - } + public JSONArray getResultTree(JSONObject shape, JSONArray array, JSONArray resultArray, int id, JSONObject elements, Set shapeIds) { + JSONArray tmpShapeArray = new JSONArray(); + for (int i = 0; i < array.size(); i++) { + JSONObject tmpObject = array.getJSONObject(i); + String tmpId = tmpObject.getString("to"); + if (tmpObject.getString("from").equals(shape.getString("id")) && tmpId != null && !shapeIds.contains(tmpId)) { + shapeIds.add(tmpId); + tmpShapeArray.add(elements.getJSONObject(tmpId)); + } + } + if (tmpShapeArray.size() == 0) { + return resultArray; + } + for (int j = 0; j < tmpShapeArray.size(); j++) { + JSONObject tmpShape = tmpShapeArray.getJSONObject(j); + JSONObject object = new JSONObject(); + int tmpId = id * 10 + j + 1; + object.put("id", tmpId); + object.put("pid", id); + object.put("name", tmpShape.getString("text")); + object.put("shapeId", tmpShape.getString("id")); + resultArray.add(object); + getResultTree(tmpShape, array, resultArray, tmpId, elements, shapeIds); + } + return resultArray; + } - // 获取单位 - private void getSubCompanyTreeNodeByOrgRoot(String root, JSONArray data) { - DesignerRelationShapeWeb web = new DesignerRelationShapeWeb(_uc); - JSONArray tempArr = web.getCompanyTree();// 获取单位列表 - for (int i = 0; i < tempArr.size(); i++) { - JSONObject com = tempArr.getJSONObject(i); - data.add(com); - JSONArray deptArr = web.getDepartmentByCompany(com.getString("id"), com.getString("uuid"), "department,position,role,user", true);// 单位下第一级子部门 - for (int j = 0; j < deptArr.size(); j++) { - JSONObject dept = deptArr.getJSONObject(j); - data.add(dept); - // 部门下的子部门和用户 - getSubDepartmentAndUser(dept.getString("id"), dept.getString("uuid"), data, web); - } - } - } - - // 递归获取部门树结构子节点 - private void getSubDepartmentAndUser(String pid, String uuid, JSONArray data, DesignerRelationShapeWeb web) { - JSONArray temp = web.getDepartmentByParent(pid, uuid, "department,position,role,user", true);// 子部门和用户 - for (int i = 0; i < temp.size(); i++) { - JSONObject object = temp.getJSONObject(i); - data.add(object); - if ("department".equals(object.getString("type"))) { - getSubDepartmentAndUser(object.getString("id"), object.getString("uuid"), data, web); - } - } - } + /** + * 根据appId获取相应的流程手册 + * + * @return + */ + public List getOutputAppByAppId(String appId) { + List list = OutputAppManager.getList(); + List newList = new ArrayList<>(); + for (OutputAppProfile model : list) { + if (appId.equals(model.getAppContext().getId())) { + newList.add(model); + } + } + return newList; + } - private boolean isEmpty(List list) { - return (list == null || list.size() == 0); - } + /** + * 检测是否可以导出流程手册 + * + * @param fileId 流程id + * @return + */ + public String checkOutputProcess(String fileId) { + PALRepositoryModel pmodel = PALRepositoryCache.getCache().get(fileId); + if (pmodel == null) { + return ResponseObject.newErrResponse().toString(); + } + ResponseObject ro = ResponseObject.newOkResponse(); + List newList = new ArrayList<>(); + List list = OutputAppManager.getList(); + for (OutputAppProfile model : list) { + String appId = model.getAppContext().getId(); + if ("com.actionsoft.apps.coe.pal.output.pr".equals(appId) && model.getTargetMethodScope().contains(pmodel.getMethodId())) { + newList.add(model); + } else if ("com.awspaas.user.apps.coe.pal.output.bd".equals(appId) && model.getTargetMethodScope().contains(pmodel.getMethodId())) { + newList.add(model); + } else if ("com.awspaas.user.apps.coe.pal.output.zd".equals(appId) && model.getTargetMethodScope().contains(pmodel.getMethodId())) { + newList.add(model); + } + } + JSONArray array = new JSONArray(); + for (OutputAppProfile model : newList) { + JSONObject object = new JSONObject(); + object.put("id", model.getId()); + object.put("groupName", model.getGroupName()); + object.put("title", model.getTitle()); + array.add(object); + } + boolean shapeNumberSort = SDK.getAppAPI().getPropertyBooleanValue("com.actionsoft.apps.coe.pal.output", "SHAPE_NUMBER_SORT", true); + ro.put("shapeNumberSort", shapeNumberSort); + ro.put("data", array); + return ro.toString(); + } - private ResponseObject checkAppStatus(String appId) { - AppContext outputContext = SDK.getAppAPI().getAppContext("com.actionsoft.apps.coe.pal.output"); - if (outputContext == null) { - return ResponseObject.newErrResponse("未找到报告生成器应用"); - } - boolean isInstallOutput = SDK.getAppAPI().isInstalled(outputContext); - if (!isInstallOutput) { - return ResponseObject.newErrResponse("报告生成器应用未安装"); - } - boolean isActiveOutput = SDK.getAppAPI().isActive(outputContext); - if (!isActiveOutput) { - return ResponseObject.newErrResponse("报告生成器应用未启动"); - } - AppContext appContext = SDK.getAppAPI().getAppContext(appId); - if (appContext == null) { - return ResponseObject.newErrResponse("未找到该应用[appId=" + appId + "]"); - } - boolean isInstall = SDK.getAppAPI().isInstalled(appId); - if (!isInstall) { - return ResponseObject.newErrResponse(appContext.getName() + "应用未安装"); - } - boolean isActive = SDK.getAppAPI().isActive(appId); - if (!isActive) { - return ResponseObject.newErrResponse(appContext.getName() + "应用未启动"); - } - return ResponseObject.newOkResponse(); - } - - /** - * 流程报告模版下载 - * @param appId - * @param templates - * @return - */ - public String downloadOutPutReportTemplates(String appId, String templates) { - ResponseObject checkRo = checkAppStatus(appId); - if (checkRo.isErr()) { - return checkRo.toString(); - } - AppContext appContext = SDK.getAppAPI().getAppContext(appId); - String path = appContext.getPath(); - String msg = "模型为空无法下载,请联系系统管理员"; - if (UtilString.isEmpty(templates)) { - return ResponseObject.newErrResponse(msg).toString(); - } - ResponseObject ro = null; - // 查找对应应用下模版 - List files = new ArrayList<>(); - JSONArray templatesArr = JSONArray.parseArray(templates); - if (templatesArr == null || templatesArr.size() == 0) { - return ResponseObject.newErrResponse(msg).toString(); - } - for (Object object : templatesArr) { - String template = (String) object; - if (UtilString.isEmpty(template)) { - return ResponseObject.newErrResponse(msg).toString(); - } - UtilFile file = new UtilFile(path + File.separator + template); - if (file.exists()) { - files.add(file); - } - } - String outputAppId = CoEConstant.APP_ID; - String groupValue = "outputTemplate"; - String dirName = files.get(0).getName(); - dirName = dirName.substring(0, dirName.lastIndexOf(".")); - String fileValue = "download" + System.currentTimeMillis(); - - DCContext dcContext = DCUtil.createTempFileContext(outputAppId, groupValue, fileValue, null); - try { - for (UtilFile sourceFile : files) { - UtilFile.copyFile(sourceFile, new UtilFile(dcContext.getPath() + File.separator + sourceFile.getName())); - } - // 创建压缩包 - DCContext dcContext2 = DCUtil.createTempFileContext(outputAppId, groupValue, fileValue + "_zip", "zip"); - dcContext2.setFileName(dirName+ ".zip"); - File ff = new File(dcContext2.getFilePath()); - File f = new File(dcContext.getPath()); - UtilFile.zipCompress(f.getPath(), ff); - dcContext2.setSession(_uc); - ro = ResponseObject.newOkResponse(); - JSONObject json = new JSONObject(); - json.put("url", dcContext2.getDownloadURL()); - ro.setData(json); - return ro.toString(); - } catch (Exception e) { - e.printStackTrace(); - } - return ResponseObject.newErrResponse("下载失败").toString(); - } + /** + * 报告生成器 + * raci关联awsorg相关 + * + * @param wsid + * @param teamId + * @param methodType + * @param targetMethodType + * @return + */ + public String getOutputreportAwsOrgPage(String wsid, String teamId, String methodType, String targetMethodType, String type) { + Map map = new HashMap(); + map.put("sid", getSessionId()); + map.put("targetMethodType", targetMethodType == null ? "" : targetMethodType); + map.put("methodType", methodType); + map.put("wsid", wsid); + map.put("teamId", teamId); + map.put("type", type); + return HtmlPageTemplate.merge(CoEConstant.APP_ID, "pal.pl.repository.outputreport.pal.tree.aws.org.htm", map); + } + + /** + * 报告生成器 + * raci树结构(aws org) + * + * @param wsid + * @param teamId + * @param methodType + * @return + */ + public String getOutputreportAwsOrgTreeData(String wsid, String teamId, String methodType, String type) { + ResponseObject ro = ResponseObject.newOkResponse(); + JSONArray treeData = new JSONArray(); + // department,user,role,position + if (type.contains("department") && type.contains("user")) { + // 组织 + JSONObject org = new JSONObject(); + String orgRoot = "aws_node_org"; + org.put("id", orgRoot); + org.put("name", I18nRes.findValue(AppsConst.SYS_APP_PLATFORM, "组织")); + org.put("open", true); + org.put("nocheck", true); + org.put("type", "orgRoot"); + org.put("uuid", "orgRoot"); + JSONObject iconFont = new JSONObject(); + iconFont.put("code", BpmOrgUtil.ORG_ROOT_ICON_CODE); + iconFont.put("color", BpmOrgUtil.ORG_ROOT_ICON_COLOR); + org.put("iconFont", iconFont); + treeData.add(org); + // 单位/部门/人员 + JSONArray data = new JSONArray(); + getSubCompanyTreeNodeByOrgRoot(orgRoot, data); + for (int i = 0; i < data.size(); i++) { + treeData.add(data.get(i)); + } + } + if (type.contains("role")) { + // 岗位根目录 + JSONObject position = new JSONObject(); + String positionRoot = "aws_node_position"; + position.put("id", positionRoot); + position.put("name", I18nRes.findValue(AppsConst.SYS_APP_PLATFORM, "岗位")); + position.put("open", true); + position.put("nocheck", true); + position.put("type", "positionRoot"); + position.put("uuid", "positionRoot"); + JSONObject iconFont = new JSONObject(); + iconFont.put("code", BpmOrgUtil.POSITION_ROOT_ICON_CODE); + iconFont.put("color", BpmOrgUtil.POSITION_ROOT_ICON_COLOR); + position.put("iconFont", iconFont); + treeData.add(position); + // 岗位组/岗位 + JSONArray data2 = new JSONArray(); + getPositionTree(positionRoot, data2); + for (int i = 0; i < data2.size(); i++) { + treeData.add(data2.get(i)); + } + // 角色根目录 + JSONObject role = new JSONObject(); + String roleRoot = "aws_node_role"; + role.put("id", roleRoot); + role.put("name", I18nRes.findValue(AppsConst.SYS_APP_PLATFORM, "角色")); + role.put("open", false); + role.put("nocheck", true); + role.put("type", "roleRoot"); + role.put("uuid", "roleRoot"); + JSONObject iconFont2 = new JSONObject(); + iconFont2.put("code", BpmOrgUtil.ROLE_ROOT_ICON_CODE); + iconFont2.put("color", BpmOrgUtil.ROLE_ROOT_ICON_COLOR); + role.put("iconFont", iconFont2); + treeData.add(role); + // 角色组/角色 + JSONArray data3 = new JSONArray(); + getRoleTree(roleRoot, data3); + for (int i = 0; i < data3.size(); i++) { + treeData.add(data3.get(i)); + } + } + ro.put("data", treeData); + return ro.toString(); + } + + /** + * 获取岗位树 + * + * @return + */ + private void getPositionTree(String root, JSONArray data) { + String[] roleCategoryList = RoleCache.getCategoryNames(); + if (roleCategoryList != null && roleCategoryList.length > 0) { + for (String name : roleCategoryList) { + if (!UtilString.isEmpty(name)) { + JSONArray groupArr = new JSONArray(); + JSONObject obj = new JSONObject(); + // 获取岗位 + List roleList = SDK.getORGAPI().getRolesByCategory(name); + if (!isEmpty(roleList)) { + for (RoleModel model : roleList) { + if (model != null && model.getRoleType() == 1) { + JSONObject roleObj = new JSONObject(); + roleObj.put("id", "aws_node_position_" + model.getId()); + roleObj.put("pid", "aws_node_positionGroup_" + name); + roleObj.put("uuid", model.getId()); + roleObj.put("name", model.getName()); + roleObj.put("nocheck", false); + roleObj.put("type", "position"); + JSONObject iconFont = new JSONObject(); + iconFont.put("code", BpmOrgUtil.POSITION_ICON_CODE); + iconFont.put("color", BpmOrgUtil.POSITION_ICON_COLOR); + roleObj.put("iconFont", iconFont); + groupArr.add(roleObj); + } + } + } + if (groupArr.size() > 0) { + // 岗位组 + obj.put("id", "aws_node_positionGroup_" + name); + obj.put("pid", "aws_node_position"); + obj.put("uuid", name); + obj.put("name", name); + obj.put("nocheck", true); + obj.put("open", false); + obj.put("type", "positionGroup"); + JSONObject iconFont = new JSONObject(); + iconFont.put("code", BpmOrgUtil.POSITION_GROUP_ICON_CODE); + iconFont.put("color", BpmOrgUtil.POSITION_GROUP_ICON_COLOR); + obj.put("iconFont", iconFont); + groupArr.add(0, obj); + data.addAll(groupArr); + } + } + } + } + } + + /** + * 获取角色树 + * + * @return + */ + private void getRoleTree(String root, JSONArray data) { + String[] roleCategoryList = RoleCache.getCategoryNames(); + if (roleCategoryList != null && roleCategoryList.length > 0) { + for (String name : roleCategoryList) { + if (!UtilString.isEmpty(name)) { + JSONArray groupArr = new JSONArray(); + JSONObject obj = new JSONObject(); + // 获取角色 + List roleList = SDK.getORGAPI().getRolesByCategory(name); + if (!isEmpty(roleList)) { + for (RoleModel model : roleList) { + if (model != null && model.getRoleType() == 0) { + JSONObject roleObj = new JSONObject(); + roleObj.put("id", "aws_node_role_" + model.getId()); + roleObj.put("pid", "aws_node_roleGroup_" + name); + roleObj.put("uuid", model.getId()); + roleObj.put("name", model.getName()); + roleObj.put("nocheck", false); + roleObj.put("type", "role"); + JSONObject iconFont = new JSONObject(); + iconFont.put("code", BpmOrgUtil.ROLE_ICON_CODE); + iconFont.put("color", BpmOrgUtil.ROLE_ICON_COLOR); + roleObj.put("iconFont", iconFont); + groupArr.add(roleObj); + } + } + } + if (groupArr.size() > 0) { + // 岗位组 + obj.put("id", "aws_node_roleGroup_" + name); + obj.put("pid", "aws_node_role"); + obj.put("uuid", name); + obj.put("name", name); + obj.put("nocheck", true); + obj.put("open", false); + obj.put("type", "roleGroup"); + JSONObject iconFont = new JSONObject(); + iconFont.put("code", BpmOrgUtil.ROLE_GROUP_ICON_CODE); + iconFont.put("color", BpmOrgUtil.ROLE_GROUP_ICON_COLOR); + obj.put("iconFont", iconFont); + groupArr.add(0, obj); + data.addAll(groupArr); + } + } + } + } + } + + // 获取单位 + private void getSubCompanyTreeNodeByOrgRoot(String root, JSONArray data) { + DesignerRelationShapeWeb web = new DesignerRelationShapeWeb(_uc); + JSONArray tempArr = web.getCompanyTree();// 获取单位列表 + for (int i = 0; i < tempArr.size(); i++) { + JSONObject com = tempArr.getJSONObject(i); + data.add(com); + JSONArray deptArr = web.getDepartmentByCompany(com.getString("id"), com.getString("uuid"), "department,position,role,user", true);// 单位下第一级子部门 + for (int j = 0; j < deptArr.size(); j++) { + JSONObject dept = deptArr.getJSONObject(j); + data.add(dept); + // 部门下的子部门和用户 + getSubDepartmentAndUser(dept.getString("id"), dept.getString("uuid"), data, web); + } + } + } + + // 递归获取部门树结构子节点 + private void getSubDepartmentAndUser(String pid, String uuid, JSONArray data, DesignerRelationShapeWeb web) { + JSONArray temp = web.getDepartmentByParent(pid, uuid, "department,position,role,user", true);// 子部门和用户 + for (int i = 0; i < temp.size(); i++) { + JSONObject object = temp.getJSONObject(i); + data.add(object); + if ("department".equals(object.getString("type"))) { + getSubDepartmentAndUser(object.getString("id"), object.getString("uuid"), data, web); + } + } + } + + private boolean isEmpty(List list) { + return (list == null || list.size() == 0); + } + + private ResponseObject checkAppStatus(String appId) { + AppContext outputContext = SDK.getAppAPI().getAppContext("com.actionsoft.apps.coe.pal.output"); + if (outputContext == null) { + return ResponseObject.newErrResponse("未找到报告生成器应用"); + } + boolean isInstallOutput = SDK.getAppAPI().isInstalled(outputContext); + if (!isInstallOutput) { + return ResponseObject.newErrResponse("报告生成器应用未安装"); + } + boolean isActiveOutput = SDK.getAppAPI().isActive(outputContext); + if (!isActiveOutput) { + return ResponseObject.newErrResponse("报告生成器应用未启动"); + } + AppContext appContext = SDK.getAppAPI().getAppContext(appId); + if (appContext == null) { + return ResponseObject.newErrResponse("未找到该应用[appId=" + appId + "]"); + } + boolean isInstall = SDK.getAppAPI().isInstalled(appId); + if (!isInstall) { + return ResponseObject.newErrResponse(appContext.getName() + "应用未安装"); + } + boolean isActive = SDK.getAppAPI().isActive(appId); + if (!isActive) { + return ResponseObject.newErrResponse(appContext.getName() + "应用未启动"); + } + return ResponseObject.newOkResponse(); + } + + /** + * 流程报告模版下载 + * + * @param appId + * @param templates + * @return + */ + public String downloadOutPutReportTemplates(String appId, String templates) { + ResponseObject checkRo = checkAppStatus(appId); + if (checkRo.isErr()) { + return checkRo.toString(); + } + AppContext appContext = SDK.getAppAPI().getAppContext(appId); + String path = appContext.getPath(); + String msg = "模型为空无法下载,请联系系统管理员"; + if (UtilString.isEmpty(templates)) { + return ResponseObject.newErrResponse(msg).toString(); + } + ResponseObject ro = null; + // 查找对应应用下模版 + List files = new ArrayList<>(); + JSONArray templatesArr = JSONArray.parseArray(templates); + if (templatesArr == null || templatesArr.size() == 0) { + return ResponseObject.newErrResponse(msg).toString(); + } + for (Object object : templatesArr) { + String template = (String) object; + if (UtilString.isEmpty(template)) { + return ResponseObject.newErrResponse(msg).toString(); + } + UtilFile file = new UtilFile(path + File.separator + template); + if (file.exists()) { + files.add(file); + } + } + String outputAppId = CoEConstant.APP_ID; + String groupValue = "outputTemplate"; + String dirName = files.get(0).getName(); + dirName = dirName.substring(0, dirName.lastIndexOf(".")); + String fileValue = "download" + System.currentTimeMillis(); + + DCContext dcContext = DCUtil.createTempFileContext(outputAppId, groupValue, fileValue, null); + try { + for (UtilFile sourceFile : files) { + UtilFile.copyFile(sourceFile, new UtilFile(dcContext.getPath() + File.separator + sourceFile.getName())); + } + // 创建压缩包 + DCContext dcContext2 = DCUtil.createTempFileContext(outputAppId, groupValue, fileValue + "_zip", "zip"); + dcContext2.setFileName(dirName + ".zip"); + File ff = new File(dcContext2.getFilePath()); + File f = new File(dcContext.getPath()); + UtilFile.zipCompress(f.getPath(), ff); + dcContext2.setSession(_uc); + ro = ResponseObject.newOkResponse(); + JSONObject json = new JSONObject(); + json.put("url", dcContext2.getDownloadURL()); + ro.setData(json); + return ro.toString(); + } catch (Exception e) { + e.printStackTrace(); + } + return ResponseObject.newErrResponse("下载失败").toString(); + } + + /** + * 上传模版 + * + * @param appId + * @param profileId + * @param param + * @return + */ + public String uploadOutPutReportTemplates(String appId, String profileId, String param) { + // 校验 + ResponseObject checkRo = checkAppStatus(appId); + if (checkRo.isErr()) { + return checkRo.toString(); + } + if (UtilString.isEmpty(param)) { + return ResponseObject.newErrResponse("上传失败,参数不能为空").toString(); + } + JSONObject paramObj = JSONObject.parseObject(param); + String repositoryName = paramObj.getString("repositoryName"); + String groupValue = paramObj.getString("groupValue"); + String fileValue = paramObj.getString("fileValue"); + String fileName = paramObj.getString("fileName"); + if (UtilString.isEmpty(repositoryName) || UtilString.isEmpty(groupValue) || UtilString.isEmpty(fileValue) || UtilString.isEmpty(fileName)) { + return ResponseObject.newErrResponse("上传失败,参数不能为空").toString(); + } + // 获取附件 + DCPluginProfile dcProfile = DCProfileManager.getDCProfile(CoEConstant.APP_ID, repositoryName); + if (dcProfile == null) { + return ResponseObject.newErrResponse("上传失败").toString(); + } + DCContext dcContext = new DCContext(_uc, dcProfile, CoEConstant.APP_ID, groupValue, fileValue, fileName); + File zipFile = new UtilFile(dcContext.getFilePath()); + File parentFile = new File(dcContext.getPath()); + // 解压 + UtilFile zipExpandFile = new UtilFile(parentFile + UtilFile.separator + "zipExpand"); + try { + UtilFile.removeFile(zipExpandFile); + zipExpandFile.mkdir(); + UtilFile.zipExpand(zipFile, zipExpandFile.getPath()); + } catch (Exception e) { + e.printStackTrace(); + throw new AWSException("文件解压失败"); + } + // 对比手册与上传文件是否一致,命名及数量 + File[] files = zipExpandFile.listFiles(); + if (files == null) { + return ResponseObject.newErrResponse("上传文件解压错误").toString(); + } + OutputAppProfile profile = OutputAppManager.getProfile(profileId); + if (!profile.isDownload()) { + return ResponseObject.newErrResponse("不支持上传下载模版操作").toString(); + } + String templates = profile.getTemplates(); + JSONArray templatesArr = JSONArray.parseArray(templates); + if (templatesArr == null || templatesArr.isEmpty()) { + return ResponseObject.newErrResponse("不支持上传下载模版操作").toString(); + } + List uploadFiles = new ArrayList<>(); + for (Object object : templatesArr) { + String name = (String) object; + for (File file : files) { + if (file.getName().equals(name)) { + uploadFiles.add(file); + } + } + } + if (uploadFiles.size() != templatesArr.size()) { + return ResponseObject.newErrResponse("请确认压缩文件中是否包含
" + templatesArr.toString().replace("[", "").replace("]", "")).toString(); + } + // 创建logs + List historyFiles = new ArrayList<>(); + AppContext appContext = SDK.getAppAPI().getAppContext(appId); + String path = appContext.getPath(); + for (Object object : templatesArr) { + String template = (String) object; + UtilFile file = new UtilFile(path + File.separator + template); + if (!file.exists()) { + SDK.getLogAPI().consoleErr("应用[" + appContext.getName() + "]中缺失文件[" + file.getName() + "]"); + return ResponseObject.newErrResponse("服务器中文件缺失,请联系管理员").toString(); + } else { + historyFiles.add(file); + } + } + File logsFile = new File(appContext.getPath() + File.separator + "logs"); + if (!logsFile.exists() || !logsFile.isDirectory()) { + logsFile.mkdir(); + } + String logName = "log" + new SimpleDateFormat("yyyyMMddHHmmss").format(new Date()); + File currLogFile = new File(logsFile, logName); + // 当前复制到历史记录 + if (!currLogFile.exists() || !currLogFile.isDirectory()) { + currLogFile.mkdir(); + } + try { + for (File file : historyFiles) { + UtilFile.copyFile(file, new File(currLogFile, file.getName())); + SDK.getLogAPI().consoleInfo("模型上传[复制模型-备份],从[" + file + "]复制至[" + new File(currLogFile, file.getName()) + "]成功"); + } + } catch (Exception e) { + e.printStackTrace(); + } + // 上传文件替换到当前使用中 + try { + for (File file : uploadFiles) { + UtilFile.copyFile(file, new File(appContext.getPath(), file.getName())); + SDK.getLogAPI().consoleInfo("模型上传[复制模型-上传],从[" + file + "]复制至[" + new File(appContext.getPath(), file.getName()) + "]成功"); + } + } catch (Exception e) { + e.printStackTrace(); + } + ResponseObject ro = ResponseObject.newOkResponse(); + return ro.toString(); + } - /** - * 上传模版 - * @param appId - * @param profileId - * @param param - * @return - */ - public String uploadOutPutReportTemplates(String appId, String profileId, String param) { - // 校验 - ResponseObject checkRo = checkAppStatus(appId); - if (checkRo.isErr()) { - return checkRo.toString(); - } - if (UtilString.isEmpty(param)) { - return ResponseObject.newErrResponse("上传失败,参数不能为空").toString(); - } - JSONObject paramObj = JSONObject.parseObject(param); - String repositoryName = paramObj.getString("repositoryName"); - String groupValue = paramObj.getString("groupValue"); - String fileValue = paramObj.getString("fileValue"); - String fileName = paramObj.getString("fileName"); - if (UtilString.isEmpty(repositoryName) || UtilString.isEmpty(groupValue) || UtilString.isEmpty(fileValue) || UtilString.isEmpty(fileName)) { - return ResponseObject.newErrResponse("上传失败,参数不能为空").toString(); - } - // 获取附件 - DCPluginProfile dcProfile = DCProfileManager.getDCProfile(CoEConstant.APP_ID, repositoryName); - if (dcProfile == null) { - return ResponseObject.newErrResponse("上传失败").toString(); - } - DCContext dcContext = new DCContext(_uc, dcProfile, CoEConstant.APP_ID, groupValue, fileValue, fileName); - File zipFile = new UtilFile(dcContext.getFilePath()); - File parentFile = new File(dcContext.getPath()); - // 解压 - UtilFile zipExpandFile = new UtilFile(parentFile + UtilFile.separator + "zipExpand"); - try { - UtilFile.removeFile(zipExpandFile); - zipExpandFile.mkdir(); - UtilFile.zipExpand(zipFile, zipExpandFile.getPath()); - } catch (Exception e) { - e.printStackTrace(); - throw new AWSException("文件解压失败"); - } - // 对比手册与上传文件是否一致,命名及数量 - File [] files = zipExpandFile.listFiles(); - if (files == null) { - return ResponseObject.newErrResponse("上传文件解压错误").toString(); - } - OutputAppProfile profile = OutputAppManager.getProfile(profileId); - if (!profile.isDownload()) { - return ResponseObject.newErrResponse("不支持上传下载模版操作").toString(); - } - String templates = profile.getTemplates(); - JSONArray templatesArr = JSONArray.parseArray(templates); - if (templatesArr == null || templatesArr.isEmpty()) { - return ResponseObject.newErrResponse("不支持上传下载模版操作").toString(); - } - List uploadFiles = new ArrayList<>(); - for (Object object : templatesArr) { - String name = (String) object; - for (File file : files) { - if (file.getName().equals(name)) { - uploadFiles.add(file); - } - } - } - if (uploadFiles.size() != templatesArr.size()) { - return ResponseObject.newErrResponse("请确认压缩文件中是否包含
" + templatesArr.toString().replace("[", "").replace("]", "")).toString(); - } - // 创建logs - List historyFiles = new ArrayList<>(); - AppContext appContext = SDK.getAppAPI().getAppContext(appId); - String path = appContext.getPath(); - for (Object object : templatesArr) { - String template = (String) object; - UtilFile file = new UtilFile(path + File.separator + template); - if (!file.exists()) { - SDK.getLogAPI().consoleErr("应用[" + appContext.getName() + "]中缺失文件[" + file.getName() + "]"); - return ResponseObject.newErrResponse("服务器中文件缺失,请联系管理员").toString(); - } else { - historyFiles.add(file); - } - } - File logsFile = new File(appContext.getPath() + File.separator + "logs"); - if (!logsFile.exists() || !logsFile.isDirectory()) { - logsFile.mkdir(); - } - String logName = "log" + new SimpleDateFormat("yyyyMMddHHmmss").format(new Date()); - File currLogFile = new File(logsFile, logName); - // 当前复制到历史记录 - if (!currLogFile.exists() || !currLogFile.isDirectory()) { - currLogFile.mkdir(); - } - try { - for (File file : historyFiles) { - UtilFile.copyFile(file, new File(currLogFile, file.getName())); - SDK.getLogAPI().consoleInfo("模型上传[复制模型-备份],从[" + file + "]复制至[" + new File(currLogFile, file.getName()) + "]成功"); - } - } catch (Exception e) { - e.printStackTrace(); - } - // 上传文件替换到当前使用中 - try { - for (File file : uploadFiles) { - UtilFile.copyFile(file, new File(appContext.getPath(), file.getName())); - SDK.getLogAPI().consoleInfo("模型上传[复制模型-上传],从[" + file + "]复制至[" + new File(appContext.getPath(), file.getName()) + "]成功"); - } - } catch (Exception e) { - e.printStackTrace(); - } - ResponseObject ro = ResponseObject.newOkResponse(); - return ro.toString(); - } } diff --git a/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/pal/output/util/OutputWordUtil.java b/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/pal/output/util/OutputWordUtil.java index 373d254d..382b8336 100755 --- a/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/pal/output/util/OutputWordUtil.java +++ b/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/pal/output/util/OutputWordUtil.java @@ -1,45 +1,26 @@ package com.actionsoft.apps.coe.pal.pal.output.util; -import com.actionsoft.apps.coe.pal.constant.CoEConstant; import com.actionsoft.apps.coe.pal.pal.method.cache.PALMethodCache; import com.actionsoft.apps.coe.pal.pal.method.model.PALMethodAttributeModel; import com.actionsoft.apps.coe.pal.pal.method.model.PALMethodModel; -import com.actionsoft.apps.coe.pal.pal.repository.PALRepositoryQueryAPIManager; import com.actionsoft.apps.coe.pal.pal.repository.cache.PALRepositoryCache; -import com.actionsoft.apps.coe.pal.pal.repository.designer.relation.cache.DesignerShapeRelationCache; import com.actionsoft.apps.coe.pal.pal.repository.designer.relation.dao.DesignerShapeRelationDao; import com.actionsoft.apps.coe.pal.pal.repository.designer.relation.model.DesignerShapeRelationModel; import com.actionsoft.apps.coe.pal.pal.repository.designer.util.CoeDesignerUtil; import com.actionsoft.apps.coe.pal.pal.repository.model.PALRepositoryModel; -import com.actionsoft.apps.coe.pal.pal.repository.upfile.constant.CoeFileConstant; -import com.actionsoft.apps.coe.pal.pal.repository.upfile.dao.UpFileDao; -import com.actionsoft.apps.coe.pal.pal.repository.upfile.model.UpfileModel; -import com.actionsoft.apps.resource.plugin.profile.DCPluginProfile; import com.actionsoft.bpms.org.model.DepartmentModel; import com.actionsoft.bpms.org.model.RoleModel; import com.actionsoft.bpms.org.model.UserModel; -import com.actionsoft.bpms.server.DispatcherRequest; -import com.actionsoft.bpms.server.UserContext; -import com.actionsoft.bpms.server.fs.DCContext; -import com.actionsoft.bpms.server.fs.dc.DCProfileManager; import com.actionsoft.bpms.util.UtilFile; import com.actionsoft.bpms.util.UtilString; import com.actionsoft.sdk.local.SDK; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; -import com.sini.com.spire.doc.*; -import com.sini.com.spire.doc.documents.*; -import com.sini.com.spire.doc.fields.DocPicture; -import com.sini.com.spire.doc.fields.TextRange; -import com.sini.com.spire.doc.formatting.CharacterFormat; -import com.sini.com.spire.doc.formatting.ParagraphFormat; import freemarker.template.Configuration; import freemarker.template.Template; import freemarker.template.TemplateException; -import java.awt.*; import java.io.*; -import java.util.List; import java.util.*; public class OutputWordUtil { @@ -166,7 +147,7 @@ public class OutputWordUtil { * @param tempName * @param docName */ - public static void createDoc2(JSONObject dataMap, String tempPath, String tempName, String docName) { + public static void createDoc2(com.alibaba.fastjson.JSONObject dataMap, String tempPath, String tempName, String docName) { Configuration configuration = new Configuration(); configuration.setDefaultEncoding("UTF-8"); @@ -205,623 +186,6 @@ public class OutputWordUtil { } } - - /** - * 生成word文件 - * - * @param dataMap - * @param tempPath - * @param tempName - * @param docName - */ - public static void createZdDoc2(JSONObject dataMap, String tempPath, String tempName, String docName, JSONObject wizardJsonData, String repositoryId) throws FileNotFoundException { - Configuration configuration = new Configuration(); - configuration.setDefaultEncoding("UTF-8"); - - // 设置模本装置方法和路径 - try { - UtilFile temps = new UtilFile(tempPath); - configuration.setDirectoryForTemplateLoading(temps); - } catch (IOException e2) { - e2.printStackTrace(); - } - Template t = null; - try { - t = configuration.getTemplate(tempName, "UTF-8"); - } catch (IOException e) { - e.printStackTrace(); - } - // 输出文档路径及名称 - File outFile = new File(docName); - Writer out = null; - try { - out = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(outFile), "UTF-8")); - } catch (Exception e1) { - e1.printStackTrace(); - } - - - try { - if (t != null && out != null) { - t.process(dataMap, out); - out.flush(); - out.close(); - } - } catch (TemplateException e) { - e.printStackTrace(); - } catch (IOException e) { - e.printStackTrace(); - } - - - //***********************************************************使用spire 生成模板后复制文件****************************************************/ - List> repositoryFileElements = CoeDesignerUtil.getShapeMessageJson4(repositoryId); //流程文件内容 - if (wizardJsonData.getBoolean("orderNuberFirst")) { // 根据页面选择进行排序 - OutputWordUtil.orderByNumber(repositoryFileElements); - } - - String controlShapeId = ""; - if (repositoryFileElements != null) { - int index = 1;// 流程步骤序号 - int dangerIndex = 1;// 风险序号 - int regulateIndex = 1;// 控制序号 - for (Map shape : repositoryFileElements) { - String type = shape.get("type").toString(); - if ("regulation".equals(type)) { - controlShapeId = shape.get("id").toString(); - } else if ("I/O_L4".equals(type)) { - controlShapeId = shape.get("id").toString(); - } - } - } - - - UserContext userContext = DispatcherRequest.getUserContext(); - - Map result = new HashMap<>(); - result.put("listDef", ""); - result.put("content", ""); - if (UtilString.isEmpty(controlShapeId)) { - - } - PALRepositoryModel repositoryModel = PALRepositoryQueryAPIManager.getInstance().queryPalRepositoryModelByPalId(repositoryId); - if (repositoryModel == null) { - - } - String content = ""; - StringBuilder listStr = new StringBuilder(); - // 读取附件 - // 流程附件列表 - UpFileDao upFileDao = new UpFileDao(); - List search = upFileDao.search(repositoryModel.getId(), controlShapeId, null); - - DCContext dcContextpdf = null; - File file = null; - if (search != null && search.size() > 0) { - // 复制附件 - for (UpfileModel upfileModel : search) { - DCPluginProfile dcProfile = DCProfileManager.getDCProfile(CoEConstant.APP_ID, CoeFileConstant.COE_UPFILE); - - if (dcProfile != null) { - dcContextpdf = new DCContext(userContext, dcProfile, CoEConstant.APP_ID, upfileModel.getPl_uuid(), upfileModel.getShape_uuid(), upfileModel.getFileName()); - String path = dcContextpdf.getPath(); - String fileName = dcContextpdf.getFileName(); - - //创建 Document 类的对象并从磁盘加载 Word 文档 - Document document = new Document(outFile.getPath()); - - //将另一个文档插入当前文档 - document.insertTextFromFile(path + fileName, FileFormat.Docx_2013); - // document.insertTextFromFile("/Users/sunlh/Downloads/手册格式问题测试文档(3)new.docx", FileFormat.Docx_2013); - //保存结果文档 - document.saveToFile(outFile.getPath(), FileFormat.Docx_2013); - } - } - - } - - - /****************************插入支持文件、相关文件、附则等信息********************************************************/ - Document doc = new Document(outFile.getPath()); - //获取最后一节 - Section section = doc.getLastSection(); - - - //相关文件 R_relevant_flies - JSONArray relevant_flies = new JSONArray(); //组织职责Table - List relationList2 = DesignerShapeRelationCache.getListByAttrId(repositoryModel.getId(), "", "related_files"); - int count = 0; - if (relationList2.size() > 0) { - for (DesignerShapeRelationModel relation : relationList2) { - String relationFileId = relation.getRelationFileId();// 支持或相关文件的ID - PALRepositoryModel model = PALRepositoryCache.getCache().get(relationFileId); - if (model != null) { - count++; - String name = model.getName(); - JSONObject tmp = new JSONObject(); - tmp.put("name", name); - tmp.put("desc", count); - - relevant_flies.add(tmp); - } - } - - CharacterFormat format = new CharacterFormat(); - //创建字体格式 - format.setFontName("宋体"); - //添加段落,设置一级序列 - Paragraph paragraph = section.addParagraph(); - - ParagraphFormat paragraphFormat1 = paragraph.getFormat(); - paragraphFormat1.setHorizontalAlignment(HorizontalAlignment.Left); - - TextRange tr = paragraph.appendText("相关文件"); - tr.getCharacterFormat().setBold(true); - tr.getCharacterFormat().setFontName("宋体"); - //tr.applyCharacterFormat(format); //应用字体格式 - paragraph.applyStyle(BuiltinStyle.Heading_1); //应用标题1样式 - - - Section section2 = doc.addSection(); - - - //定义表格数据 - String[] header = {"序号", "文件名称"}; - - String[][] strArray2 = new String[relevant_flies.size()][]; - List list = new LinkedList<>(); - for (int i = 0; i < relevant_flies.size(); i++) { - JSONObject jsonObject = relevant_flies.getJSONObject(i); - String[] strArray = new String[2]; - strArray[0] = jsonObject.getString("desc").toString(); - strArray[1] = jsonObject.getString("name").toString(); - list.add(strArray); - strArray2[i] = strArray; - } - - String[][] data = strArray2; - - //添加表格 - Table table = section.addTable(true); - table.resetCells(data.length + 1, header.length); - - TableRow row = table.getRows().get(0); - row.isHeader(true); - row.setHeight(20); - row.setHeightType(TableRowHeightType.Exactly); - for (int i = 0; i < header.length; i++) { - row.getCells().get(i).getCellFormat().setVerticalAlignment(VerticalAlignment.Middle); - Paragraph p = row.getCells().get(i).addParagraph(); - p.getFormat().setHorizontalAlignment(HorizontalAlignment.Center); - TextRange txtRange = p.appendText(header[i]); - txtRange.getCharacterFormat().setBold(true); - } - - //将数据添加到其余行 - for (int r = 0; r < data.length; r++) { - TableRow dataRow = table.getRows().get(r + 1); - dataRow.setHeight(25); - dataRow.setHeightType(TableRowHeightType.Exactly); - dataRow.getRowFormat().setBackColor(Color.white); - for (int c = 0; c < data[r].length; c++) { - dataRow.getCells().get(c).getCellFormat().setVerticalAlignment(VerticalAlignment.Middle); - dataRow.getCells().get(c).addParagraph().appendText(data[r][c]); - } - } - - - } - - - //支持文件 - JSONArray supportfiles = new JSONArray(); //组织职责Table - List relationList = DesignerShapeRelationCache.getListByAttrId(repositoryModel.getId(), "", "support_files"); - int index = 0; - if (relationList.size() > 0) { - for (DesignerShapeRelationModel relation : relationList) { - String relationFileId = relation.getRelationFileId();// 支持或相关文件的ID - PALRepositoryModel model = PALRepositoryCache.getCache().get(relationFileId); - if (model != null) { - index++; - String name = model.getName(); - JSONObject tmp = new JSONObject(); - tmp.put("name", name); - tmp.put("desc", index); - supportfiles.add(tmp); - } - } - - - CharacterFormat format2 = new CharacterFormat(); - //创建字体格式 - format2.setFontName("宋体"); - //添加段落,设置一级序列 - Paragraph paragraph2 = section.addParagraph(); - ParagraphFormat paragraphFormat2 = paragraph2.getFormat(); - paragraphFormat2.setHorizontalAlignment(HorizontalAlignment.Left); - TextRange tr2 = paragraph2.appendText("支持文件"); - tr2.getCharacterFormat().setBold(true); - tr2.getCharacterFormat().setFontName("宋体"); - paragraph2.applyStyle(BuiltinStyle.Heading_1); //应用标题1样式 - - - //定义表格数据 - String[] header = {"序号", "文件名称"}; - String[][] strArray2 = new String[supportfiles.size()][]; - List list = new LinkedList<>(); - for (int i = 0; i < supportfiles.size(); i++) { - JSONObject jsonObject = supportfiles.getJSONObject(i); - String[] strArray = new String[2]; - strArray[0] = jsonObject.getString("desc").toString(); - strArray[1] = jsonObject.getString("name").toString(); - list.add(strArray); - strArray2[i] = strArray; - } - - String[][] data = strArray2; - - //添加表格 - Table table = section.addTable(true); - table.resetCells(data.length + 1, header.length); - - TableRow row = table.getRows().get(0); - row.isHeader(true); - row.setHeight(20); - row.setHeightType(TableRowHeightType.Exactly); - for (int i = 0; i < header.length; i++) { - row.getCells().get(i).getCellFormat().setVerticalAlignment(VerticalAlignment.Middle); - Paragraph p = row.getCells().get(i).addParagraph(); - p.getFormat().setHorizontalAlignment(HorizontalAlignment.Center); - TextRange txtRange = p.appendText(header[i]); - txtRange.getCharacterFormat().setBold(true); - } - - //将数据添加到其余行 - for (int r = 0; r < data.length; r++) { - TableRow dataRow = table.getRows().get(r + 1); - dataRow.setHeight(25); - dataRow.setHeightType(TableRowHeightType.Exactly); - dataRow.getRowFormat().setBackColor(Color.white); - for (int c = 0; c < data[r].length; c++) { - dataRow.getCells().get(c).getCellFormat().setVerticalAlignment(VerticalAlignment.Middle); - dataRow.getCells().get(c).addParagraph().appendText(data[r][c]); - } - } - - - } - - /*CharacterFormat format3=new CharacterFormat(); - //创建字体格式 - format3.setFontName("宋体"); - //添加段落,设置一级序列 - Paragraph paragraph3 = section.addParagraph(); - TextRange tr3 = paragraph3.appendText("7.附则"); - tr3.getCharacterFormat().setBold(true); - tr3.getCharacterFormat().setFontName("宋体"); - paragraph3.applyStyle(BuiltinStyle.Heading_7); //应用标题1样式 - - //添加段落 - Paragraph paragraph5 = section.addParagraph(); - - // 附则处理 - List T_supplementary_articles_table = new ArrayList<>(); - String [] tmp = dataMap.getString("pl_T_supplementary_articles").split("\n"); - for (int i = 0; i < tmp.length; i++) { - if (UtilString.isNotEmpty(tmp[i])) { - T_supplementary_articles_table.add(tmp[i]); - } - } - - TextRange tr5 = paragraph5.appendText(T_supplementary_articles_table.toString()); - tr5.getCharacterFormat().setFontName("宋体");*/ - - - CharacterFormat format4 = new CharacterFormat(); - //创建字体格式 - format4.setFontName("宋体"); - //添加段落 - Paragraph paragraph4 = section.addParagraph(); - - ParagraphFormat paragraphFormat4 = paragraph4.getFormat(); - paragraphFormat4.setHorizontalAlignment(HorizontalAlignment.Left); - - TextRange tr4 = paragraph4.appendText("附件"); - ; - - tr4.getCharacterFormat().setBold(true); - tr4.getCharacterFormat().setFontName("宋体"); - paragraph4.applyStyle(BuiltinStyle.Heading_1); //应用标题1样式 - - //doc.saveToFile(outFile.getPath(), FileFormat.Docx_2013); - - - //查询模型文件属性上传附件信息 - List search2 = upFileDao.searchByRepositoryIdGroupByFilename(repositoryModel.getId(), "f"); - - System.out.println("search2==================" + search2.toString()); - DCContext dcContextModel = null; - - - // 排序 - Collections.sort(search2, new Comparator() { - @Override - public int compare(UpfileModel o1, UpfileModel o2) { - String p1 = o1.getFileName(); - String p2 = o2.getFileName(); - if ((p1.substring(0, 2).equals("附件") && p2.substring(0, 2).equals("附件") && p1.indexOf(":") != -1 && p2.indexOf(":") != -1)) { - return Integer.parseInt(p1.substring(2, p1.indexOf(":"))) - Integer.parseInt(p2.substring(2, p2.indexOf(":"))); - } else { - return 0; - } - - - } - }); - - //读取模型附件插入手册中文档对象 - if (search2 != null && search2.size() > 0) { - for (UpfileModel upfileModel : search2) { - DCPluginProfile dcProfile = DCProfileManager.getDCProfile(CoEConstant.APP_ID, CoeFileConstant.COE_UPFILE); - if (dcProfile != null) { - - // 处理DocCenter - dcContextModel = new DCContext(userContext, dcProfile, CoEConstant.APP_ID, "file", upfileModel.getPl_uuid(), upfileModel.getFileName()); - //添加段落 - Paragraph paragraph5 = section.addParagraph(); - - //加载一个图片,它将作为外部文件的符号显示在Word文档中 - //获取最后一个.的位置 - int lastIndexOf = dcContextModel.getFileName().lastIndexOf("."); - //获取文件的后缀名 .jpg - String suffix = dcContextModel.getFileName().substring(lastIndexOf); - - DocPicture pdfIcon = new DocPicture(doc); - - InputStream stream1 = new FileInputStream(dcContextModel.getFilePath()); - DocPicture pic1 = new DocPicture(doc); - - if (suffix.equals(".doc") || suffix.equals(".docx")) { - pic1.loadImage("../doccenter/com.awspaas.user.apps.coe.pal.output.zd/filepic/word.png"); - paragraph5.appendText(dcContextModel.getFileName()); - if (suffix.equals(".doc")) { - paragraph5.appendOleObject(stream1, pic1, "doc"); - } else if (suffix.equals(".docx")) { - paragraph5.appendOleObject(stream1, pic1, "docx"); - } - } else if (suffix.equals(".pdf")) { - pic1.loadImage("../doccenter/com.awspaas.user.apps.coe.pal.output.zd/filepic/pdf.png"); - paragraph5.appendText(dcContextModel.getFileName()); - paragraph5.appendOleObject(stream1, pic1, "pdf"); - } else if (suffix.equals(".xls") || suffix.equals(".xlsx")) { - pic1.loadImage("../doccenter/com.awspaas.user.apps.coe.pal.output.zd/filepic/xls.png"); - paragraph5.appendText(dcContextModel.getFileName()); - if (suffix.equals(".xls")) { - paragraph5.appendOleObject(stream1, pic1, "xls"); - } else if (suffix.equals(".xlsx")) { - paragraph5.appendOleObject(stream1, pic1, "xlsx"); - } - } else if (suffix.equals(".png") || suffix.equals(".jgp")) { - pic1.loadImage("../doccenter/com.awspaas.user.apps.coe.pal.output.zd/filepic/png.png"); - paragraph5.appendText(dcContextModel.getFileName()); - if (suffix.equals(".png")) { - paragraph5.appendOleObject(stream1, pic1, "png"); - } else if (suffix.equals(".jpg")) { - paragraph5.appendOleObject(stream1, pic1, "jpg"); - } - } else if (suffix.equals(".zip") || suffix.equals(".rar")) { - pic1.loadImage("../doccenter/com.awspaas.user.apps.coe.pal.output.zd/filepic/zip.png"); - paragraph5.appendText(dcContextModel.getFileName()); - if (suffix.equals(".zip")) { - paragraph5.appendOleObject(stream1, pic1, "zip"); - } else if (suffix.equals(".rar")) { - paragraph5.appendOleObject(stream1, pic1, "rar"); - } - } else if (suffix.equals(".mp3") || suffix.equals(".mp4")) { - pic1.loadImage("../doccenter/com.awspaas.user.apps.coe.pal.output.zd/filepic/mp3.png"); - paragraph5.appendText(dcContextModel.getFileName()); - if (suffix.equals(".mp3")) { - paragraph5.appendOleObject(stream1, pic1, "mp3"); - } else if (suffix.equals(".mp4")) { - paragraph5.appendOleObject(stream1, pic1, "mp4"); - } - } else if (suffix.equals(".txt")) { - pic1.loadImage("../doccenter/com.awspaas.user.apps.coe.pal.output.zd/filepic/txt.png"); - paragraph5.appendText(dcContextModel.getFileName()); - paragraph5.appendOleObject(stream1, pic1, "txt"); - } else if (suffix.equals(".ppt") || suffix.equals(".pptx")) { - pic1.loadImage("../doccenter/com.awspaas.user.apps.coe.pal.output.zd/filepic/ppt.png"); - paragraph5.appendText(dcContextModel.getFileName()); - if (suffix.equals(".ppt")) { - paragraph5.appendOleObject(stream1, pic1, "ppt"); - } else if (suffix.equals(".pptx")) { - paragraph5.appendOleObject(stream1, pic1, "pptx"); - } - } - - - } - - } - - } - doc.saveToFile(outFile.getPath(), FileFormat.Docx_2013); - } - - - /** - * 生成word文件 - * - * @param dataMap - * @param tempPath - * @param tempName - * @param docName - */ - public static void createBdDoc2(JSONObject dataMap, String tempPath, String tempName, String docName, String repositoryId) throws FileNotFoundException { - Configuration configuration = new Configuration(); - configuration.setDefaultEncoding("UTF-8"); - - // 设置模本装置方法和路径 - try { - UtilFile temps = new UtilFile(tempPath); - configuration.setDirectoryForTemplateLoading(temps); - } catch (IOException e2) { - e2.printStackTrace(); - } - Template t = null; - try { - t = configuration.getTemplate(tempName, "UTF-8"); - } catch (IOException e) { - e.printStackTrace(); - } - // 输出文档路径及名称 - File outFile = new File(docName); - Writer out = null; - try { - out = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(outFile), "UTF-8")); - } catch (Exception e1) { - e1.printStackTrace(); - } - - try { - if (t != null && out != null) { - t.process(dataMap, out); - out.flush(); - out.close(); - } - } catch (TemplateException e) { - e.printStackTrace(); - } catch (IOException e) { - e.printStackTrace(); - } - - /**************************************************插入文件对象**********************************************************************/ - Document doc = new Document(outFile.getPath()); - //获取最后一节 - Section section = doc.getLastSection(); - - - CharacterFormat format4 = new CharacterFormat(); - //创建字体格式 - format4.setFontName("宋体"); - //添加段落 - Paragraph paragraph = section.addParagraph(); - - - ParagraphFormat paragraphFormat4 = paragraph.getFormat(); - paragraphFormat4.setHorizontalAlignment(HorizontalAlignment.Left); - - TextRange tr4 = paragraph.appendText("表单/模板"); - - tr4.getCharacterFormat().setBold(true); - tr4.getCharacterFormat().setFontName("宋体"); - paragraph.applyStyle(BuiltinStyle.Heading_1); //应用标题1样式 - - //doc.saveToFile(outFile.getPath(), FileFormat.Docx_2013); - - - PALRepositoryModel repositoryModel = PALRepositoryQueryAPIManager.getInstance().queryPalRepositoryModelByPalId(repositoryId); - - UpFileDao upFileDao = new UpFileDao(); - //查询模型文件属性上传附件信息 - List search = upFileDao.searchByRepositoryId(repositoryModel.getId(), "s"); - - - DCContext dcContextModel = null; - UserContext userContext = DispatcherRequest.getUserContext(); - if (search != null && search.size() > 0) { - // 复制附件 - for (UpfileModel upfileModel : search) { - DCPluginProfile dcProfile = DCProfileManager.getDCProfile(CoEConstant.APP_ID, CoeFileConstant.COE_UPFILE); - - if (dcProfile != null) { - dcContextModel = new DCContext(userContext, dcProfile, CoEConstant.APP_ID, upfileModel.getPl_uuid(), upfileModel.getShape_uuid(), upfileModel.getFileName()); - String path = dcContextModel.getPath(); - String fileName = dcContextModel.getFileName(); - - - //添加段落 - Paragraph paragraph5 = section.addParagraph(); - - //加载一个图片,它将作为外部文件的符号显示在Word文档中 - //获取最后一个.的位置 - int lastIndexOf = dcContextModel.getFileName().lastIndexOf("."); - //获取文件的后缀名 .jpg - String suffix = dcContextModel.getFileName().substring(lastIndexOf); - - DocPicture pdfIcon = new DocPicture(doc); - - InputStream stream1 = new FileInputStream(dcContextModel.getFilePath()); - DocPicture pic1 = new DocPicture(doc); - - if (suffix.equals(".doc") || suffix.equals(".docx")) { - pic1.loadImage("../doccenter/com.awspaas.user.apps.coe.pal.output.zd/filepic/word.png"); - paragraph5.appendText(dcContextModel.getFileName()); - if (suffix.equals(".doc")) { - paragraph5.appendOleObject(stream1, pic1, "doc"); - } else if (suffix.equals(".docx")) { - paragraph5.appendOleObject(stream1, pic1, "docx"); - } - } else if (suffix.equals(".pdf")) { - pic1.loadImage("../doccenter/com.awspaas.user.apps.coe.pal.output.zd/filepic/pdf.png"); - paragraph5.appendText(dcContextModel.getFileName()); - paragraph5.appendOleObject(stream1, pic1, "pdf"); - } else if (suffix.equals(".xls") || suffix.equals(".xlsx")) { - pic1.loadImage("../doccenter/com.awspaas.user.apps.coe.pal.output.zd/filepic/xls.png"); - paragraph5.appendText(dcContextModel.getFileName()); - if (suffix.equals(".xls")) { - paragraph5.appendOleObject(stream1, pic1, "xls"); - } else if (suffix.equals(".xlsx")) { - paragraph5.appendOleObject(stream1, pic1, "xlsx"); - } - } else if (suffix.equals(".png") || suffix.equals(".jgp")) { - pic1.loadImage("../doccenter/com.awspaas.user.apps.coe.pal.output.zd/filepic/png.png"); - paragraph5.appendText(dcContextModel.getFileName()); - if (suffix.equals(".png")) { - paragraph5.appendOleObject(stream1, pic1, "png"); - } else if (suffix.equals(".jpg")) { - paragraph5.appendOleObject(stream1, pic1, "jpg"); - } - } else if (suffix.equals(".zip") || suffix.equals(".rar")) { - pic1.loadImage("../doccenter/com.awspaas.user.apps.coe.pal.output.zd/filepic/zip.png"); - paragraph5.appendText(dcContextModel.getFileName()); - if (suffix.equals(".zip")) { - paragraph5.appendOleObject(stream1, pic1, "zip"); - } else if (suffix.equals(".rar")) { - paragraph5.appendOleObject(stream1, pic1, "rar"); - } - } else if (suffix.equals(".mp3") || suffix.equals(".mp4")) { - pic1.loadImage("../doccenter/com.awspaas.user.apps.coe.pal.output.zd/filepic/mp3.png"); - paragraph5.appendText(dcContextModel.getFileName()); - if (suffix.equals(".mp3")) { - paragraph5.appendOleObject(stream1, pic1, "mp3"); - } else if (suffix.equals(".mp4")) { - paragraph5.appendOleObject(stream1, pic1, "mp4"); - } - } else if (suffix.equals(".txt")) { - pic1.loadImage("../doccenter/com.awspaas.user.apps.coe.pal.output.zd/filepic/txt.png"); - paragraph5.appendText(dcContextModel.getFileName()); - paragraph5.appendOleObject(stream1, pic1, "txt"); - } else if (suffix.equals(".ppt") || suffix.equals(".pptx")) { - pic1.loadImage("../doccenter/com.awspaas.user.apps.coe.pal.output.zd/filepic/ppt.png"); - paragraph5.appendText(dcContextModel.getFileName()); - if (suffix.equals(".ppt")) { - paragraph5.appendOleObject(stream1, pic1, "ppt"); - } else if (suffix.equals(".pptx")) { - paragraph5.appendOleObject(stream1, pic1, "pptx"); - } - } - - - } - } - - } - - doc.saveToFile(outFile.getPath(), FileFormat.Docx_2013); - } - - /** * 将文件的扩展属性设置默认值为空字符串(防止没有设置扩展属性而使得导出文件出错) * @@ -1035,7 +399,7 @@ public class OutputWordUtil { JSONObject dataAttributes = (JSONObject) element.get("attributes"); if (dataAttributes != null) { - JSONArray dataAttributesJsonArray = dataAttributes.getJSONArray("attributesJsonArray"); + com.alibaba.fastjson.JSONArray dataAttributesJsonArray = dataAttributes.getJSONArray("attributesJsonArray"); for (int i = 0; i < dataAttributesJsonArray.size(); i++) { JSONObject dataAttribute = dataAttributesJsonArray.getJSONObject(i); if (dataAttribute == null || "null".equals(dataAttribute.toString())) { @@ -1084,7 +448,7 @@ public class OutputWordUtil { * @param relationShapeIds */ @Deprecated - public static void setTableValue2(String repositoryId, JSONArray table, String relationShapeIds) { + public static void setTableValue2(String repositoryId, com.alibaba.fastjson.JSONArray table, String relationShapeIds) { // 记录关联属性的流程节点,防止多次查询重复文件信息耗费时间 Set relationFileIds = new HashSet<>(); List> relationFileElements2 = new ArrayList>(); @@ -1128,17 +492,17 @@ public class OutputWordUtil { for (Map element : relationFileElements2) { String id = (String) element.get("id"); if (relationShapeId.equals(id)) { - JSONObject _tr = new JSONObject(); + com.alibaba.fastjson.JSONObject _tr = new com.alibaba.fastjson.JSONObject(); OutputWordUtil.setShapeDefaultValue2((String) element.get("pid"), _tr); String name = specialCharTransfer(element.get("text").toString()); _tr.put(OutputWordUtil.SHAPE_NAME, name.replace("\n", OutputWordUtil.WRAPSTRING)); _tr.put(OutputWordUtil.SERIAL_NUMBER, index); - JSONObject dataAttributes = (JSONObject) element.get("attributes"); + com.alibaba.fastjson.JSONObject dataAttributes = (com.alibaba.fastjson.JSONObject) element.get("attributes"); if (dataAttributes != null) { - JSONArray dataAttributesJsonArray = dataAttributes.getJSONArray("attributesJsonArray"); + com.alibaba.fastjson.JSONArray dataAttributesJsonArray = dataAttributes.getJSONArray("attributesJsonArray"); for (int i = 0; i < dataAttributesJsonArray.size(); i++) { - JSONObject dataAttribute = dataAttributesJsonArray.getJSONObject(i); + com.alibaba.fastjson.JSONObject dataAttribute = dataAttributesJsonArray.getJSONObject(i); if (dataAttribute == null || "null".equals(dataAttribute.toString())) { continue; } @@ -1151,7 +515,7 @@ public class OutputWordUtil { if (!"".equals(privateAttributeContentStr) && !"[]".equals(privateAttributeContentStr)) { String firstChart = privateAttributeContentStr.substring(0, 1); if ("{".equals(firstChart)) { - JSONObject privateAttributeContent = dataAttributes.getJSONObject("privateAttributeContent"); + com.alibaba.fastjson.JSONObject privateAttributeContent = dataAttributes.getJSONObject("privateAttributeContent"); for (String key : privateAttributeContent.keySet()) { _tr.put("shape_" + key, specialCharTransfer(privateAttributeContent.getString(key))); } @@ -1199,6 +563,7 @@ public class OutputWordUtil { if (!shapeModelMap.containsKey(repositoryShape.getRelationShapeId())) { continue; } + String relationFileId = repositoryShape.getRelationFileId(); List> relationFileElements = CoeDesignerUtil.getShapeMessageJson2(relationFileId); // 关联流程文件内容 if (relationFileElements != null) { @@ -1214,11 +579,11 @@ public class OutputWordUtil { sbRole.append(","); } - JSONObject dataAttributes = (JSONObject) element.get("attributes"); + com.alibaba.fastjson.JSONObject dataAttributes = (com.alibaba.fastjson.JSONObject) element.get("attributes"); if (dataAttributes != null) { - JSONArray dataAttributesJsonArray = dataAttributes.getJSONArray("attributesJsonArray"); + com.alibaba.fastjson.JSONArray dataAttributesJsonArray = dataAttributes.getJSONArray("attributesJsonArray"); for (int i = 0; i < dataAttributesJsonArray.size(); i++) { - JSONObject dataAttribute = dataAttributesJsonArray.getJSONObject(i); + com.alibaba.fastjson.JSONObject dataAttribute = dataAttributesJsonArray.getJSONObject(i); if (dataAttribute == null || "null".equals(dataAttribute.toString())) { continue; } @@ -1413,7 +778,7 @@ public class OutputWordUtil { * @param relationFileElements */ @Deprecated - public static void setRelationShapeValueByOrgAndRole(JSONObject _tr, JSONObject dataAttribute, + public static void setRelationShapeValueByOrgAndRole(com.alibaba.fastjson.JSONObject _tr, com.alibaba.fastjson.JSONObject dataAttribute, Map shapeModelMap, List> relationFileElements, String shapeId, Set relationFileIds) { String key = dataAttribute.getString("key"); if ("organization".equals(dataAttribute.getString("groupPath")) && "relation".equals(dataAttribute.getString("type"))) { @@ -1485,7 +850,7 @@ public class OutputWordUtil { * @return */ @Deprecated - public static void setShapeValue2(JSONObject _tr, JSONObject dataAttribute, Map shapeRelationModelMap) { + public static void setShapeValue2(com.alibaba.fastjson.JSONObject _tr, com.alibaba.fastjson.JSONObject dataAttribute, Map shapeRelationModelMap) { String result = ""; String key = dataAttribute.getString("key"); if ("string".equals(dataAttribute.getString("type")) || "textarea".equals(dataAttribute.getString("type"))) { @@ -1599,8 +964,8 @@ public class OutputWordUtil { return dataJson.getJSONObject("privateAttributeContent").getString("number"); } } - if (json.get("attributes") instanceof JSONObject) {// fastJson - JSONObject dataJson = (JSONObject) json.get("attributes"); + if (json.get("attributes") instanceof com.alibaba.fastjson.JSONObject) {// fastJson + com.alibaba.fastjson.JSONObject dataJson = (com.alibaba.fastjson.JSONObject) json.get("attributes"); if (dataJson.containsKey("privateAttributeContent") && dataJson.get("privateAttributeContent").getClass().getName().contains("JSONObject")) { return dataJson.getJSONObject("privateAttributeContent").getString("number"); } diff --git a/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/pal/repository/designer/relation/web/DesignerRelationShapeWeb.java b/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/pal/repository/designer/relation/web/DesignerRelationShapeWeb.java index 1734ecd2..25f381e8 100755 --- a/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/pal/repository/designer/relation/web/DesignerRelationShapeWeb.java +++ b/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/pal/repository/designer/relation/web/DesignerRelationShapeWeb.java @@ -1,49 +1,13 @@ package com.actionsoft.apps.coe.pal.pal.repository.designer.relation.web; -import java.io.File; -import java.io.UnsupportedEncodingException; -import java.sql.Timestamp; -import java.time.LocalDateTime; -import java.time.format.DateTimeFormatter; -import java.util.*; -import java.util.stream.Collectors; - import com.actionsoft.apps.AppsConst; import com.actionsoft.apps.coe.pal.constant.CoEConstant; import com.actionsoft.apps.coe.pal.cooperation.CoeCooperationAPIManager; import com.actionsoft.apps.coe.pal.cooperation.cache.CooperationCache; import com.actionsoft.apps.coe.pal.cooperation.cache.model.TeamInfo; import com.actionsoft.apps.coe.pal.cooperation.cache.model.UserInfo; -import com.actionsoft.apps.coe.pal.pal.manage.publish.constant.PublishConst; -import com.actionsoft.apps.coe.pal.pal.method.model.PALMethodAttributeModel; -import com.actionsoft.apps.coe.pal.pal.repository.designer.CoeDesignerShapeAPIManager; -import com.actionsoft.apps.coe.pal.pal.repository.designer.relation.manager.DesignerShapeCopyCache; -import com.actionsoft.apps.coe.pal.pal.repository.model.impl.PALRepositoryModelImpl; -import com.actionsoft.apps.coe.pal.pal.repository.web.CoeProcessLevelWeb; -import com.actionsoft.apps.coe.pal.system.util.StringUtil; -import com.actionsoft.apps.coe.pal.util.BpmOrgUtil; -import com.actionsoft.apps.coe.pal.util.HighSecurityUtil; -import com.actionsoft.bpms.bo.engine.BO; -import com.actionsoft.bpms.commons.cache.Cache; -import com.actionsoft.bpms.commons.database.RowMap; -import com.actionsoft.bpms.commons.formfile.model.delegate.FormFile; -import com.actionsoft.bpms.commons.htmlframework.HtmlPageTemplate; -import com.actionsoft.bpms.commons.mvc.view.ActionWeb; -import com.actionsoft.bpms.commons.mvc.view.ResponseObject; -import com.actionsoft.bpms.commons.security.ac.cache.AccessControlCache; -import com.actionsoft.bpms.commons.security.ac.constant.ACConst; -import com.actionsoft.bpms.commons.security.ac.model.AccessControlModel; -import com.actionsoft.bpms.org.cache.CompanyCache; -import com.actionsoft.bpms.org.cache.DepartmentCache; -import com.actionsoft.bpms.org.cache.RoleCache; -import com.actionsoft.bpms.org.cache.UserCache; -import com.actionsoft.bpms.org.model.*; -import com.actionsoft.bpms.org.web.CompanyWeb; -import com.actionsoft.bpms.server.UserContext; -import com.actionsoft.bpms.server.fs.DCContext; -import com.actionsoft.bpms.server.fs.dc.DCProfileManager; -import com.actionsoft.bpms.util.*; import com.actionsoft.apps.coe.pal.pal.method.cache.PALMethodCache; +import com.actionsoft.apps.coe.pal.pal.method.model.PALMethodAttributeModel; import com.actionsoft.apps.coe.pal.pal.method.model.PALMethodJsonModel; import com.actionsoft.apps.coe.pal.pal.method.util.PALMethodUtil; import com.actionsoft.apps.coe.pal.pal.repository.PALRepositoryQueryAPIManager; @@ -51,11 +15,13 @@ import com.actionsoft.apps.coe.pal.pal.repository.cache.PALRepositoryCache; import com.actionsoft.apps.coe.pal.pal.repository.cache.PALRepositoryPropertyCache; import com.actionsoft.apps.coe.pal.pal.repository.dao.CoeProcessLevelDaoFacotory; import com.actionsoft.apps.coe.pal.pal.repository.dao.PALRepository; +import com.actionsoft.apps.coe.pal.pal.repository.designer.CoeDesignerShapeAPIManager; import com.actionsoft.apps.coe.pal.pal.repository.designer.manage.CoeDesignerAPIManager; import com.actionsoft.apps.coe.pal.pal.repository.designer.model.BaseModel; import com.actionsoft.apps.coe.pal.pal.repository.designer.relation.cache.DesignerShapeRelationCache; import com.actionsoft.apps.coe.pal.pal.repository.designer.relation.dao.DesignerShapeRelationDao; import com.actionsoft.apps.coe.pal.pal.repository.designer.relation.manager.DesignerRelationShapeCacheManager; +import com.actionsoft.apps.coe.pal.pal.repository.designer.relation.manager.DesignerShapeCopyCache; import com.actionsoft.apps.coe.pal.pal.repository.designer.relation.model.DesignerShapeCopyModel; import com.actionsoft.apps.coe.pal.pal.repository.designer.relation.model.DesignerShapeFileRelationModel; import com.actionsoft.apps.coe.pal.pal.repository.designer.relation.model.DesignerShapePasteModel; @@ -66,9 +32,32 @@ import com.actionsoft.apps.coe.pal.pal.repository.model.CoeProcessLevelAutoBean; import com.actionsoft.apps.coe.pal.pal.repository.model.PALRepositoryModel; import com.actionsoft.apps.coe.pal.pal.repository.model.PALRepositoryPropertyModel; import com.actionsoft.apps.coe.pal.pal.repository.util.CoeProcessLevelUtil; +import com.actionsoft.apps.coe.pal.pal.repository.web.CoeProcessLevelWeb; import com.actionsoft.apps.coe.pal.pal.ws.web.VersionUtil; +import com.actionsoft.apps.coe.pal.util.BpmOrgUtil; +import com.actionsoft.apps.coe.pal.util.HighSecurityUtil; import com.actionsoft.apps.coe.pal.util.StringHandleUtil; import com.actionsoft.apps.coe.pal.util.UtilMapSort; +import com.actionsoft.bpms.bo.engine.BO; +import com.actionsoft.bpms.commons.cache.Cache; +import com.actionsoft.bpms.commons.database.RowMap; +import com.actionsoft.bpms.commons.formfile.model.delegate.FormFile; +import com.actionsoft.bpms.commons.htmlframework.HtmlPageTemplate; +import com.actionsoft.bpms.commons.mvc.view.ActionWeb; +import com.actionsoft.bpms.commons.mvc.view.ResponseObject; +import com.actionsoft.bpms.commons.security.ac.cache.AccessControlCache; +import com.actionsoft.bpms.commons.security.ac.model.AccessControlModel; +import com.actionsoft.bpms.org.cache.DepartmentCache; +import com.actionsoft.bpms.org.cache.RoleCache; +import com.actionsoft.bpms.org.cache.UserCache; +import com.actionsoft.bpms.org.model.CompanyModel; +import com.actionsoft.bpms.org.model.DepartmentModel; +import com.actionsoft.bpms.org.model.RoleModel; +import com.actionsoft.bpms.org.model.UserModel; +import com.actionsoft.bpms.org.web.CompanyWeb; +import com.actionsoft.bpms.server.UserContext; +import com.actionsoft.bpms.server.fs.DCContext; +import com.actionsoft.bpms.util.*; import com.actionsoft.exception.AWSException; import com.actionsoft.exception.AWSObjectNotFindException; import com.actionsoft.i18n.I18nRes; @@ -77,7 +66,12 @@ import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import org.apache.commons.lang.StringUtils; -import org.apache.poi.hssf.record.DVALRecord; + +import java.io.File; +import java.io.UnsupportedEncodingException; +import java.util.*; +import java.util.stream.Collectors; + public class DesignerRelationShapeWeb extends ActionWeb { private UserContext _uc; @@ -946,13 +940,13 @@ public class DesignerRelationShapeWeb extends ActionWeb { } } macroLibraries.put("treeData", jsonArr_new.toString()); - } else if ("child_process".equals(attrId)){ + } else if ("child_process".equals(attrId)) { // 端到端功能 只保留文件夹 架构 process.epc process.flowchart objects = objects.stream() - .filter(o -> !((JSONObject)o).containsKey("plMethodId") || "default".equals(((JSONObject)o).getString("plMethodId")) - || "process.framework".equals(((JSONObject)o).getString("plMethodId")) - || "process.epc".equals(((JSONObject)o).getString("plMethodId")) - || "process.flowchart".equals(((JSONObject)o).getString("plMethodId"))).collect(Collectors.toCollection(JSONArray::new)); + .filter(o -> !((JSONObject) o).containsKey("plMethodId") || "default".equals(((JSONObject) o).getString("plMethodId")) + || "process.framework".equals(((JSONObject) o).getString("plMethodId")) + || "process.epc".equals(((JSONObject) o).getString("plMethodId")) + || "process.flowchart".equals(((JSONObject) o).getString("plMethodId"))).collect(Collectors.toCollection(JSONArray::new)); macroLibraries.put("treeData", objects.toString()); } else { macroLibraries.put("treeData", treeJson); @@ -1403,9 +1397,9 @@ public class DesignerRelationShapeWeb extends ActionWeb { } // 端到端功能 只保留文件夹 架构 process.epc process.flowchart - if ("child_process".equals(attrId)){ + if ("child_process".equals(attrId)) { String plMethodId = node.getString("plMethodId"); - if ("default".equals(plMethodId) || "process.framework".equals(plMethodId) || "process.epc".equals(plMethodId) || "process.flowchart".equals(plMethodId)){ + if ("default".equals(plMethodId) || "process.framework".equals(plMethodId) || "process.epc".equals(plMethodId) || "process.flowchart".equals(plMethodId)) { if (isParent.equals("true")) { node.put("nocheck", true); result.add(node); @@ -4126,24 +4120,24 @@ public class DesignerRelationShapeWeb extends ActionWeb { * @param methodId 模型类型 * @return {@link String} */ - public String checkUserFirstCreateModel(String methodId,String type) { + public String checkUserFirstCreateModel(String methodId, String type) { ResponseObject ro = ResponseObject.newOkResponse(); String sql = "SELECT COUNT(1) FROM APP_ACT_COE_PAL_REPOSITORY WHERE CREATEUSER=? AND PLMETHODID=? "; String uid = _uc.getUID(); int anInt = DBSql.getInt(sql, new Object[]{uid, methodId}); - System.out.println("是否第一次新建模型>>>>>"+anInt); + System.out.println("是否第一次新建模型>>>>>" + anInt); //只有一条记录的时候判断是否第一次创建对应模型 if (type.equals("0")) { if (anInt == 1) { String getCreateDateSql = "SELECT ID FROM APP_ACT_COE_PAL_REPOSITORY WHERE CREATEUSER='" + uid + "' AND PLMETHODID='" + methodId + "'"; String getID = DBSql.getString(getCreateDateSql); - String isfirstSql = "SELECT ISFIRSTCREATE FROM APP_ACT_COE_PAL_REPOSITORY WHERE ID = '"+getID+"'"; - String isfirst= DBSql.getString(isfirstSql); - System.out.println("isfirst>>>>>>>>"+isfirst); - if (isfirst==null||isfirst==""){ - DBSql.update("UPDATE APP_ACT_COE_PAL_REPOSITORY SET ISFIRSTCREATE = 1 WHERE ID = '"+getID+"'"); + String isfirstSql = "SELECT ISFIRSTCREATE FROM APP_ACT_COE_PAL_REPOSITORY WHERE ID = '" + getID + "'"; + String isfirst = DBSql.getString(isfirstSql); + System.out.println("isfirst>>>>>>>>" + isfirst); + if (isfirst == null || isfirst == "") { + DBSql.update("UPDATE APP_ACT_COE_PAL_REPOSITORY SET ISFIRSTCREATE = 1 WHERE ID = '" + getID + "'"); ro.put("isFirst", true); - }else if (isfirst.equals("1")){ + } else if (isfirst.equals("1")) { ro.put("isFirst", false); } @@ -4152,11 +4146,12 @@ public class DesignerRelationShapeWeb extends ActionWeb { } else { ro.put("isFirst", true); } - }else { + } else { ro.put("isFirst", false); } return ro.toString(); } + } \ No newline at end of file diff --git a/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/pal/repository/upfile/dao/UpFileDao.java b/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/pal/repository/upfile/dao/UpFileDao.java index e0d287c9..58fd8e63 100755 --- a/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/pal/repository/upfile/dao/UpFileDao.java +++ b/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/pal/repository/upfile/dao/UpFileDao.java @@ -129,18 +129,6 @@ public class UpFileDao { } - public List searchBGroup(String sqlWhere) { - StringBuffer sql = new StringBuffer(); - sql.append("select ID,SHAPEID,FILETYPE,DOWNLOAD,PALREPOSITORYID,FILENAME from ").append(UpfileModel.DATABASE_ENTITY).append(" where 1 = 1 ").append(sqlWhere); - try { - return DBSql.query(sql.toString(), new UpfileModelMapper()); - } catch (AWSDataAccessException e) { - e.printStackTrace(); - } - return new ArrayList(); - } - - private class UpfileModelMapper implements RowMapper { public UpfileModel mapRow(ResultSet rs, int arg1) throws SQLException { UpfileModel model = new UpfileModel(); @@ -210,21 +198,12 @@ public class UpFileDao { public List searchByRepositoryId(String repositoryId, String type) { StringBuffer sqlWhere = new StringBuffer(); if (!UtilString.isEmpty(type)) { - sqlWhere.append(" and PALREPOSITORYID ='").append(repositoryId).append("' and FILETYPE='").append(type).append("'"); + sqlWhere.append(" and PALREPOSITORYID ='").append(repositoryId).append("' and FILETYPE='").append(type).append("'").append(" ").append("order by FILENAME"); } return search(sqlWhere.toString()); } - public List searchByRepositoryIdGroupByFilename(String repositoryId, String type) { - StringBuffer sqlWhere = new StringBuffer(); - if (!UtilString.isEmpty(type)) { - sqlWhere.append(" and PALREPOSITORYID ='").append(repositoryId).append("' and FILETYPE='").append(type).append("'").append("GROUP BY ID,SHAPEID,FILETYPE,DOWNLOAD,PALREPOSITORYID,FILENAME"); - } - System.out.println("sqlWhere=============" + sqlWhere); - return searchBGroup(sqlWhere.toString()); - } - /** * 按照条件查询 *