过滤工程技术标准/增加工程技术标准手册生成逻辑/增加首页架构图页面/新建制度类型模型界面插入模版附件
This commit is contained in:
parent
d82e3372c5
commit
2d1667b2a9
Binary file not shown.
@ -135,16 +135,20 @@ public class PALMethodCache {
|
|||||||
} else {
|
} else {
|
||||||
List<String> result = new ArrayList<>();
|
List<String> result = new ArrayList<>();
|
||||||
//String[] methodArray = new String[] { "process", "org", "data", "itsystem", "control" };
|
//String[] methodArray = new String[] { "process", "org", "data", "itsystem", "control" };
|
||||||
String[] methodArrays = new String[] { "process", "data", "control", "org", "itsystem", "engineering" };
|
String[] methodArrays = new String[] { "process", "data", "control", "org", "itsystem"};
|
||||||
for (String method : methodArrays) {
|
for (String method : methodArrays) {
|
||||||
if (list.contains(method)) {
|
if (list.contains(method)) {
|
||||||
result.add(method);
|
result.add(method);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (String str : list) {
|
for (String str : list) {
|
||||||
if (!result.contains(str)) {
|
//过滤掉工程技术标准文件夹
|
||||||
result.add(str);
|
if(!str.equals("engineering")){
|
||||||
|
if (!result.contains(str)) {
|
||||||
|
result.add(str);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -430,7 +430,7 @@ public class OutputWordUtil {
|
|||||||
//定义表格数据
|
//定义表格数据
|
||||||
String[] header = {"版本", "拟制/修订单位","拟制/修订人","拟制/修订日期","审核人","复核人","审批人","修订内容及理由"};
|
String[] header = {"版本", "拟制/修订单位","拟制/修订人","拟制/修订日期","审核人","复核人","审批人","修订内容及理由"};
|
||||||
String[][] strArray2 = new String[versionHistoryTable.size()][];
|
String[][] strArray2 = new String[versionHistoryTable.size()][];
|
||||||
List<String[]> list = new LinkedList<>();
|
List<String[]> list = new LinkedList<>();
|
||||||
for (int i = 0; i < versionHistoryTable.size(); i++) {
|
for (int i = 0; i < versionHistoryTable.size(); i++) {
|
||||||
JSONObject jsonObject = versionHistoryTable.getJSONObject(i);
|
JSONObject jsonObject = versionHistoryTable.getJSONObject(i);
|
||||||
String[] strArray = new String[8];
|
String[] strArray = new String[8];
|
||||||
|
|||||||
@ -4613,6 +4613,18 @@ public class PALRepositoryQueryAPIManager {
|
|||||||
return getPublishPortalHtml(uc, uuid, taskId, checkPublish, true);
|
return getPublishPortalHtml(uc, uuid, taskId, checkPublish, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 流程发布门户详情页面(门户首页)
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public String getPublishPortalHomePageHtml(UserContext uc, String uuid, String taskId, boolean checkPublish) {
|
||||||
|
return getPublishPortalHomePageHtml(uc, uuid, taskId, checkPublish, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 流程发布门户详情页面(移动端)
|
* 流程发布门户详情页面(移动端)
|
||||||
*
|
*
|
||||||
@ -4684,6 +4696,68 @@ public class PALRepositoryQueryAPIManager {
|
|||||||
return web.getPortalDesignerHtml(uuid, upVisit, taskId);// 返回页面
|
return web.getPortalDesignerHtml(uuid, upVisit, taskId);// 返回页面
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 流程发布门户详情页面(首页)
|
||||||
|
* @param uc
|
||||||
|
* @param uuid
|
||||||
|
* @param taskId
|
||||||
|
* @param checkPublish
|
||||||
|
* @param upVisit
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public String getPublishPortalHomePageHtml(UserContext uc, String uuid, String taskId, boolean checkPublish, boolean upVisit) {
|
||||||
|
|
||||||
|
//权限校验
|
||||||
|
// if (!CoeCooperationAPIManager.getInstance().hasRepositoryPermision(uuid)) {
|
||||||
|
// return AlertWindow.getWarningMessagePage("打开失败", "无该文件查看权限");
|
||||||
|
// }
|
||||||
|
|
||||||
|
//三员管理,文件密级权限校验
|
||||||
|
if (HighSecurityUtil.isON() && HighSecurityUtil.fileSecuritySwitch()) {
|
||||||
|
CoeProcessLevelWeb web = new CoeProcessLevelWeb(uc);
|
||||||
|
ResponseObject responseObject = web.checkFilePemission(uuid);
|
||||||
|
if (responseObject.isErr()) {
|
||||||
|
return AlertWindow.getWarningMessagePage("打开失败", responseObject.getMsg());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
PALRepositoryModel model = PALRepositoryCache.getCache().get(uuid);
|
||||||
|
if (model == null) {
|
||||||
|
throw new AWSException("该流程未找到,打开失败");
|
||||||
|
}
|
||||||
|
if ("default".equals(model.getMethodId())) {
|
||||||
|
throw new AWSException("文件夹类型不支持打开");
|
||||||
|
}
|
||||||
|
if (checkPublish) {
|
||||||
|
if (!model.isPublish()) {
|
||||||
|
throw new AWSException("该流程当前状态为未发布状态,不允许打开");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 新的权限校验,若是该模型已发布,按照权限范围表中的权限控制是否可访问,若是该模型尚未发布(例如在发布过程中、已停用等),则不进行权限控制,都可访问
|
||||||
|
if (model.isPublish()) {
|
||||||
|
if (!hasAccessPortalDesignerPerm(uc, model)) {
|
||||||
|
String url = AWSPortalConf.getUrl()+"/r/w?sid="+uc.getSessionId()+"&cmd=com.actionsoft.apps.coe.pal.publisher.filePermissionApplication&palVersionId="+uuid;
|
||||||
|
return AlertWindow.getWarningMessagePage("打开失败", "您所在组织/职级暂未被授予该文件的阅览权限<br/><button onclick=\"window.open('"+url+"','_blank')\" class=\"awsui-btn awsui-btn-green\"'>点击申请查阅权限</button>");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (UtilString.isEmpty(taskId)) {// 停用或已发布状态查询流程手册
|
||||||
|
taskId = getProcessReportTaskId(model);
|
||||||
|
}
|
||||||
|
CoeDesignerWeb web = new CoeDesignerWeb(uc);
|
||||||
|
// 操作行为日志记录
|
||||||
|
if (SDK.getAppAPI().getPropertyBooleanValue(CoEConstant.APP_ID, "IS_RECORD_OP_LOG", false)) {
|
||||||
|
CoEOpLogAPI.auditOkOp(uc, CoEOpLogConst.MODULE_CATEGORY_REPOSITORY, CoEOpLogConst.OP_ACCESS, CoEOpLogConst.INFO_REPOSITORY_ACCESS);
|
||||||
|
}
|
||||||
|
return web.getPortalDesignerHomePageHtml(uuid, upVisit, taskId);// 返回页面
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 流程发布门户详情页面
|
* 流程发布门户详情页面
|
||||||
*
|
*
|
||||||
|
|||||||
@ -4272,7 +4272,7 @@ public class DesignerRelationShapeWeb extends ActionWeb {
|
|||||||
taskId = object.getJSONObject("data").getString("taskId");
|
taskId = object.getJSONObject("data").getString("taskId");
|
||||||
else
|
else
|
||||||
throw new AWSException("创建表单手册失败:" + uuid);
|
throw new AWSException("创建表单手册失败:" + uuid);
|
||||||
} else if ("control.policy".equals(model.getMethodId())) {
|
} else if ("control.policy".equals(model.getMethodId()) || "engineering.standard".equals(model.getMethodId())) {
|
||||||
taskId = PALRepositoryQueryAPIManager.getInstance().createOutputReportZd(wsId, _uc.getUID(), teamId, uuid);
|
taskId = PALRepositoryQueryAPIManager.getInstance().createOutputReportZd(wsId, _uc.getUID(), teamId, uuid);
|
||||||
JSONObject object = JSONObject.parseObject(taskId);
|
JSONObject object = JSONObject.parseObject(taskId);
|
||||||
if ("ok".equals(object.getString("result")))
|
if ("ok".equals(object.getString("result")))
|
||||||
|
|||||||
@ -3327,6 +3327,455 @@ public class CoeDesignerWeb extends ActionWeb {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public String getPortalDesignerHomePageHtml(String rUUID, boolean upVisit, String taskId) {
|
||||||
|
String processDefId = "";
|
||||||
|
Map<String, Object> macroLibraries = new HashMap<String, Object>();
|
||||||
|
macroLibraries.put("selectedElementId", "");
|
||||||
|
macroLibraries.put("js", "");
|
||||||
|
PALRepositoryModelImpl plModel = (PALRepositoryModelImpl) CoeProcessLevelDaoFacotory.createCoeProcessLevel().getInstance(rUUID);
|
||||||
|
|
||||||
|
if (plModel == null) {
|
||||||
|
return AlertWindow.getNotFoundMessagePage("未找到文件", "该文件已被删除");
|
||||||
|
}
|
||||||
|
|
||||||
|
macroLibraries.put("taskId", taskId);
|
||||||
|
// 增加三员管理模式taskid为new,change判断
|
||||||
|
if ("process".equals(plModel.getMethodCategory()) && !UtilString.isEmpty(taskId) && !"submit_create".equals(taskId) && !"new".equals(taskId) && !"change".equals(taskId)) {
|
||||||
|
macroLibraries.put("outputFileName", plModel.getName() + ".doc");
|
||||||
|
macroLibraries.put("taskId", taskId);
|
||||||
|
// 压缩包名称 和 手册模板
|
||||||
|
OutputTaskModel taskModel = new OutputTask().getTaskReportById(taskId);
|
||||||
|
if (taskModel != null) {
|
||||||
|
// 压缩包名称
|
||||||
|
macroLibraries.put("taskName", taskModel.getTaskName() + ".zip");
|
||||||
|
OutputAppProfile appFile = OutputAppManager.getProfile(taskModel.getProfileId());
|
||||||
|
// 手册模板(com.actionsoft.apps.coe.pal.output.pr)
|
||||||
|
macroLibraries.put("taskProfile", appFile.getAppContext().getId());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
String type = CoeDesignerConstant.DESIGNER_DIFINITION_DEFAULT;
|
||||||
|
if (plModel.getMethodId() != null && plModel.getMethodId().indexOf(CoeDesignerConstant.DESIGNER_DIFINITION_BPMN) != -1) {
|
||||||
|
type = CoeDesignerConstant.DESIGNER_DIFINITION_BPMN;
|
||||||
|
} else {
|
||||||
|
type = CoeDesignerConstant.DESIGNER_DIFINITION_DEFAULT;
|
||||||
|
}
|
||||||
|
|
||||||
|
boolean isCorrelateBpms = PALRepositoryQueryAPIManager.getInstance().isCorrelateBpms(plModel.getId(), true);
|
||||||
|
macroLibraries.put("isMarked", false);
|
||||||
|
//默认排序
|
||||||
|
List<String> defaultAttrSort;
|
||||||
|
if (CoeDesignerConstant.DESIGNER_DIFINITION_BPMN.equals(type)) {
|
||||||
|
// 删除与BPMS关联的无效关联关系
|
||||||
|
CoeProcessLevelUtil.deleteInvalidCorrelate(plModel.getId());
|
||||||
|
if (isCorrelateBpms) {
|
||||||
|
processDefId = PALRepositoryQueryAPIManager.getInstance().queryBpmsProcessDefIdByPalId(plModel.getId(), true);
|
||||||
|
} else {
|
||||||
|
processDefId = "";
|
||||||
|
}
|
||||||
|
getBpmnDesginerUI(plModel, macroLibraries, true, true);
|
||||||
|
defaultAttrSort = getBpmnParams(plModel, processDefId, macroLibraries);
|
||||||
|
macroLibraries.put("isMarked", CoeProcessLevelUtil.hasMarked(plModel.getId()));
|
||||||
|
} else {
|
||||||
|
getCoeDesginerUI(plModel, macroLibraries, true, true);
|
||||||
|
defaultAttrSort = getCoeParams(plModel, macroLibraries);
|
||||||
|
}
|
||||||
|
int state = 0;// 版本状态:设计、运行、停用
|
||||||
|
if (isCorrelateBpms) {
|
||||||
|
ProcessDefinition definition = ProcessDefCache.getInstance().get(processDefId);
|
||||||
|
if (definition != null) {
|
||||||
|
state = definition.getVersionStatus();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
macroLibraries.put("BPMNSupport", AWSServerEngineConfiguration.getEngineBPMNSupport());
|
||||||
|
macroLibraries.put("BPMNLevel0", AWSServerEngineConfiguration.getEngineBPMNLevel0());
|
||||||
|
macroLibraries.put("BPMNLevel1", AWSServerEngineConfiguration.getEngineBPMNLevel1());
|
||||||
|
macroLibraries.put("BPMNLevel2", AWSServerEngineConfiguration.getEngineBPMNLevel2());
|
||||||
|
String userUrl = SDK.getPortalAPI().getUserPhoto(_uc, _uc.getUID());
|
||||||
|
getMoreSharpe(plModel.getMethodId(), plModel.getId(), macroLibraries);// 获取更多图形
|
||||||
|
macroLibraries.put("ver", 0);
|
||||||
|
macroLibraries.put("methodId", plModel.getMethodId());
|
||||||
|
macroLibraries.put("sid", _uc.getSessionId());
|
||||||
|
macroLibraries.put("wsId", plModel.getWsId());
|
||||||
|
macroLibraries.put("uuid", rUUID);// definition的UUID
|
||||||
|
macroLibraries.put("parentChartId", plModel.getParentId());
|
||||||
|
macroLibraries.put("uid", _uc.getUID());
|
||||||
|
macroLibraries.put("userUrl", userUrl);
|
||||||
|
macroLibraries.put("userName", _uc.getUserModel().getUserName());
|
||||||
|
macroLibraries.put("schema", getSchema(plModel.getId(), plModel.getMethodId(), PALMethodUtil.getCustom(plModel.getMethodId(), plModel.getId())));
|
||||||
|
macroLibraries.put("sessionId", _uc.getSessionId());
|
||||||
|
macroLibraries.put("fileName", ShapeUtil.replaceBlank(plModel.getName()));
|
||||||
|
macroLibraries.put("typeName", I18nRes.findValue(CoEConstant.APP_ID, plModel.getMethodCategory()) + "图");
|
||||||
|
macroLibraries.put("openType", 0);
|
||||||
|
macroLibraries.put("teamId", "");
|
||||||
|
macroLibraries.put("perms", "");// 该流程权限(w,d,v)
|
||||||
|
macroLibraries.put("filePerms", "");// 所有具有权限的流程Id
|
||||||
|
macroLibraries.put("isPublish", plModel.isPublish());
|
||||||
|
CoeUserModel userModel = (CoeUserModel) CoeUserDaoFactory.createUser().getInstanceByUserId(_uc.getUID());
|
||||||
|
boolean isAdmin = (userModel != null && (userModel.getIsAdmin() == 1));
|
||||||
|
macroLibraries.put("isAdmin", isAdmin);
|
||||||
|
// 更多特性权限
|
||||||
|
String moreAttrRight = SDK.getAppAPI().getProperty(CoEConstant.APP_ID, "MOREATTR_RIGHT");// 1普通用户有设置更多特性权限,
|
||||||
|
if ("2".equals(moreAttrRight)) {// 只有admin显示
|
||||||
|
if ("admin".equals(_uc.getUID())) {
|
||||||
|
macroLibraries.put("moreAttrRight", true);
|
||||||
|
} else {
|
||||||
|
macroLibraries.put("moreAttrRight", false);
|
||||||
|
}
|
||||||
|
} else if ("0".equals(moreAttrRight)) {// 0只有管理员用户有权限
|
||||||
|
if (isAdmin) {// 管理员用户
|
||||||
|
macroLibraries.put("moreAttrRight", true);
|
||||||
|
} else {// 普通用户
|
||||||
|
macroLibraries.put("moreAttrRight", false);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
macroLibraries.put("moreAttrRight", true);
|
||||||
|
}
|
||||||
|
// 自动保存
|
||||||
|
String isSysAutoSave = SDK.getAppAPI().getProperty(CoEConstant.APP_ID, "SYS_AUTOSAVE");
|
||||||
|
macroLibraries.put("isAutoSave", isSysAutoSave);
|
||||||
|
macroLibraries.put("checkoutTip", "");
|
||||||
|
macroLibraries.put("isView", true);// 是否只读打开
|
||||||
|
|
||||||
|
// 是否允许用户自定义模板,0:不允许;1:允许。
|
||||||
|
AppAPI appApi = SDK.getAppAPI();
|
||||||
|
String isCustomDefine = appApi.getProperty(CoEConstant.APP_ID, CoEConstant.PROPERTY_CUSTOM_DEFINE_SCHEMA);
|
||||||
|
macroLibraries.put("isCustomDefine", isCustomDefine);
|
||||||
|
macroLibraries.put("openAppType", "0");
|
||||||
|
|
||||||
|
macroLibraries.put("editable", "0");
|
||||||
|
|
||||||
|
if (plModel.isPublish()) {
|
||||||
|
long viewCount = plModel.getViewCount();
|
||||||
|
plModel.setViewCount(viewCount + 1);
|
||||||
|
PALRepository dao = new PALRepository();
|
||||||
|
dao.update(plModel);
|
||||||
|
}
|
||||||
|
|
||||||
|
getDesginerDefaultParams(macroLibraries);// 获取默认参数配置
|
||||||
|
|
||||||
|
macroLibraries.put("usersPhoto", "");
|
||||||
|
macroLibraries.put("userNum", "");
|
||||||
|
DesignerRelationShapeCacheManager relationShapeCache = DesignerRelationShapeCacheManager.getInstance();
|
||||||
|
Map<String, Map<String, Object>> shapeMap = relationShapeCache.getShapemap();
|
||||||
|
boolean isExistCopy = shapeMap.get(_uc.getUID()) != null;
|
||||||
|
boolean isAppearCopy = shapeMap.get(_uc.getUID()) == null || shapeMap.get(_uc.getUID()).get("shapeCopyContent") == null;
|
||||||
|
// 默认为定义复制
|
||||||
|
macroLibraries.put("isExistCopy", isExistCopy);
|
||||||
|
macroLibraries.put("isAppearCopy", isAppearCopy);
|
||||||
|
|
||||||
|
macroLibraries.put("diagram", "");
|
||||||
|
macroLibraries.put("state", state);
|
||||||
|
// DockBtnBar中的各功能是否显示
|
||||||
|
macroLibraries.put("attributeView", "");
|
||||||
|
macroLibraries.put("messageView", "");
|
||||||
|
macroLibraries.put("printView", "");
|
||||||
|
macroLibraries.put("publishView", "");
|
||||||
|
|
||||||
|
String riskStyle = "display:none;";
|
||||||
|
// risk应用已下架
|
||||||
|
// if (SDK.getAppAPI().isInstalled("com.actionsoft.apps.coe.pal.risk") && SDK.getAppAPI().isActive("com.actionsoft.apps.coe.pal.risk")) {
|
||||||
|
// riskStyle = "";
|
||||||
|
// }
|
||||||
|
// if (plModel.getMethodId().equals("process.epc") || plModel.getMethodId().equals("process.bpmn2") || plModel.getMethodId().equals("process.flowchart")) {
|
||||||
|
// riskStyle = UtilString.isEmpty(riskStyle) ? "" : "display:none;";
|
||||||
|
// } else {
|
||||||
|
// riskStyle = "display:none;";
|
||||||
|
// }
|
||||||
|
macroLibraries.put("riskStyle", riskStyle);
|
||||||
|
String processOnIsInstall = "false";
|
||||||
|
if (SDK.getAppAPI().isInstalled("com.actionsoft.apps.coe.pal.processon")) {
|
||||||
|
processOnIsInstall = "true";
|
||||||
|
}
|
||||||
|
String processOnIsActive = "false";
|
||||||
|
if (SDK.getAppAPI().isActive("com.actionsoft.apps.coe.pal.processon")) {
|
||||||
|
processOnIsActive = "true";
|
||||||
|
}
|
||||||
|
macroLibraries.put("processOnIsInstall", processOnIsInstall);
|
||||||
|
macroLibraries.put("processOnIsActive", processOnIsActive);
|
||||||
|
|
||||||
|
JSONObject relationShapeIds = new JSONObject();
|
||||||
|
JSONObject relationShapeModels = new JSONObject();
|
||||||
|
|
||||||
|
String define = PALRepositoryQueryAPIManager.getInstance().getProcessDefinition(_uc, plModel.getId());
|
||||||
|
JSONObject definition = JSONObject.parseObject(define);
|
||||||
|
JSONObject elements = definition.getJSONObject("elements");
|
||||||
|
for (String id : elements.keySet()) {
|
||||||
|
JSONObject shapeObj = elements.getJSONObject(id);
|
||||||
|
String name = shapeObj.getString("name");
|
||||||
|
if ("linker".equals(name)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
Iterator<DesignerShapeRelationModel> modelIterator = DesignerShapeRelationCache.getByShapeId(plModel.getId(), id);
|
||||||
|
if (modelIterator != null) {
|
||||||
|
while (modelIterator.hasNext()) {
|
||||||
|
DesignerShapeRelationModel shapeRelationModel = modelIterator.next();
|
||||||
|
PALRepositoryModel relationPalModel = PALRepositoryCache.getCache().get(shapeRelationModel.getRelationFileId());
|
||||||
|
if (relationPalModel != null) {
|
||||||
|
relationShapeIds.put(shapeRelationModel.getRelationShapeId(), shapeRelationModel);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Map<String, JSONObject> map = PALRepositoryQueryAPIManager.getInstance().queryRepositoryShapeAttributeById(plModel.getId(), id, shapeObj, "|");
|
||||||
|
for (Entry<String, JSONObject> entry : map.entrySet()) {
|
||||||
|
JSONObject object = entry.getValue();
|
||||||
|
if (object == null || object.isEmpty()) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
relationShapeModels.put(id + "_" + entry.getKey(), Arrays.asList(object.getString("text").split("\\|")));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
macroLibraries.put("relationShapes", relationShapeIds);
|
||||||
|
macroLibraries.put("relationShapeModels", relationShapeModels);
|
||||||
|
|
||||||
|
if (defaultAttrSort != null && defaultAttrSort.size() > 0) {
|
||||||
|
StringBuilder sb = new StringBuilder();
|
||||||
|
for (int i = 0; i < defaultAttrSort.size(); i++) {
|
||||||
|
if (i == defaultAttrSort.size() - 1) {
|
||||||
|
sb.append(defaultAttrSort.get(i));
|
||||||
|
} else {
|
||||||
|
sb.append(defaultAttrSort.get(i) + "|");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
macroLibraries.put("defaultAttrSort", sb.toString());
|
||||||
|
} else {
|
||||||
|
macroLibraries.put("defaultAttrSort", "");
|
||||||
|
}
|
||||||
|
macroLibraries.put("importShapeStyle", "display:none");
|
||||||
|
StringBuilder sb = new StringBuilder();
|
||||||
|
Set<String> ids = new HashSet<>();
|
||||||
|
sb.append(plModel.getName());
|
||||||
|
ids.add(plModel.getId());
|
||||||
|
getFilePath(sb, ids, plModel);
|
||||||
|
|
||||||
|
|
||||||
|
macroLibraries.put("isStop", plModel.isStop());
|
||||||
|
macroLibraries.put("toolbarName", sb.toString());
|
||||||
|
|
||||||
|
List<String> shapeIds = new ArrayList<>();// 当前流程所有节点
|
||||||
|
List<Map<String, Object>> shapeList = CoeDesignerUtil.getShapeMessageJson2(rUUID);//获取所有节点
|
||||||
|
if (shapeList != null && shapeList.size() > 0) {
|
||||||
|
for (Map<String, Object> map : shapeList) {
|
||||||
|
shapeIds.add((String) map.get("id"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
getPalProcessLinkTag(plModel, macroLibraries);
|
||||||
|
/********************附件************************/
|
||||||
|
// 文件或节点自身附件
|
||||||
|
JSONObject upFileObject = new JSONObject();
|
||||||
|
upFileObject.put("file", new JSONArray());
|
||||||
|
for (String shape : shapeIds) {
|
||||||
|
upFileObject.put(shape, new JSONArray());
|
||||||
|
}
|
||||||
|
UpFileDao upFileDao = new UpFileDao();
|
||||||
|
String sqlWhere = " and PALREPOSITORYID ='" + rUUID + "'" + "order by CREATETIME asc";
|
||||||
|
List<UpfileModel> fileList = upFileDao.search(sqlWhere);
|
||||||
|
|
||||||
|
//三员管理下,过滤当前用户与文件密级显示
|
||||||
|
if (HighSecurityUtil.isON()) {
|
||||||
|
macroLibraries.put("isHighSecurity", true);
|
||||||
|
PALRepositoryQueryAPIManager.getInstance().upFileSecurityFilter(this._uc, fileList);
|
||||||
|
}
|
||||||
|
if (fileList != null && fileList.size() > 0) {
|
||||||
|
for (UpfileModel upfileModel : fileList) {
|
||||||
|
JSONObject object = new JSONObject();
|
||||||
|
object.put("id", upfileModel.getUuid());
|
||||||
|
object.put("name", upfileModel.getFileName());
|
||||||
|
object.put("type", "self");
|
||||||
|
if ("f".equals(upfileModel.getType())) {
|
||||||
|
upFileObject.getJSONArray("file").add(object);
|
||||||
|
}
|
||||||
|
if ("s".equals(upfileModel.getType())) {
|
||||||
|
if (upFileObject.getJSONArray(upfileModel.getShape_uuid()) == null) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
String filename = upfileModel.getFileName().substring(upfileModel.getFileName().lastIndexOf("."));
|
||||||
|
|
||||||
|
if (!filename.equals(".xml")) {
|
||||||
|
upFileObject.getJSONArray(upfileModel.getShape_uuid()).add(object);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 文件或节点的关联节点的附件
|
||||||
|
//查询流程和节点附件
|
||||||
|
List<DesignerShapeRelationModel> relationList = null;
|
||||||
|
// 查询关联的节点
|
||||||
|
DesignerShapeRelationDao relationDao = new DesignerShapeRelationDao();
|
||||||
|
relationList = relationDao.getModelListByFileId(rUUID);
|
||||||
|
|
||||||
|
//关联文件list
|
||||||
|
List<UpfileModel> relationUpfFileList = new ArrayList<>();
|
||||||
|
|
||||||
|
|
||||||
|
if (relationUpfFileList != null && relationUpfFileList.size() > 0) {
|
||||||
|
//三员管理,过滤关联文件密级显示
|
||||||
|
if (HighSecurityUtil.isON()) {
|
||||||
|
PALRepositoryQueryAPIManager.getInstance().upFileSecurityFilter(this._uc, relationUpfFileList);
|
||||||
|
}
|
||||||
|
for (UpfileModel relationUpFile : relationUpfFileList) {
|
||||||
|
JSONObject object = new JSONObject();
|
||||||
|
object.put("id", relationUpFile.getUuid());
|
||||||
|
object.put("name", relationUpFile.getFileName());
|
||||||
|
object.put("type", "relation");
|
||||||
|
upFileObject.getJSONArray("file").add(object);// 文件
|
||||||
|
}
|
||||||
|
}
|
||||||
|
macroLibraries.put("upfileData", upFileObject);
|
||||||
|
/********************附件************************/
|
||||||
|
/********************步骤说明************************/
|
||||||
|
// 获取所有关联属性
|
||||||
|
JSONObject relationShapes = new JSONObject();
|
||||||
|
if (shapeList != null && shapeList.size() > 0) {
|
||||||
|
for (Map<String, Object> map : shapeList) {
|
||||||
|
String shapeId1 = (String) map.get("id");
|
||||||
|
relationShapes.put(shapeId1, new JSONObject());
|
||||||
|
String shapeName = (String) map.get("type");
|
||||||
|
String shapeCategory = (String) map.get("category");
|
||||||
|
String shapeMethod = shapeCategory.replace("_", ".");
|
||||||
|
List<PALMethodAttributeModel> attributeModelList = CoeDesignerShapeAPIManager.getInstance().getValidAttributeModels(plModel.getWsId(), shapeMethod, shapeName, plModel.getMethodId());
|
||||||
|
Map<String, JSONObject> refMap = new HashMap();
|
||||||
|
Map<String, String> attrTypeMap = new HashMap<>();
|
||||||
|
for (PALMethodAttributeModel model : attributeModelList) {
|
||||||
|
if (!model.getUse()) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if ("relation".equals(model.getType()) || "awsorg".equals(model.getType())) {
|
||||||
|
refMap.put(model.getKey(), JSON.parseObject(model.getRef()));
|
||||||
|
}
|
||||||
|
attrTypeMap.put(model.getKey(), model.getType());
|
||||||
|
}
|
||||||
|
List<DesignerShapeRelationModel> list = new DesignerShapeRelationDao().getModelListByShapeIdAndRelationShapeId(plModel.getId(), shapeId1, null, null);
|
||||||
|
List<DesignerShapeRelationModel> modelList = new ArrayList<>();
|
||||||
|
for (DesignerShapeRelationModel model : list) {
|
||||||
|
String attrId = model.getAttrId();
|
||||||
|
if (attrTypeMap.containsKey(attrId)) {
|
||||||
|
if ("relation".equals(attrTypeMap.get(attrId))) {
|
||||||
|
if (refMap.containsKey(attrId)) {
|
||||||
|
String relationType = refMap.get(attrId).getString("type");
|
||||||
|
if ("file".equals(relationType)) {// 关联的文件
|
||||||
|
List<PALRepositoryModel> list2 = PALRepositoryCache.getByVersionId(plModel.getWsId(), model.getRelationFileId());
|
||||||
|
for (PALRepositoryModel model2 : list2) {
|
||||||
|
if (model2.isUse()) {
|
||||||
|
model.setRelationShapeText(model2.getName());
|
||||||
|
model.setRelationFileId(model2.getId());
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
modelList.add(model);
|
||||||
|
} else {
|
||||||
|
modelList.add(model);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else if ("awsorg".equals(attrTypeMap.get(attrId))) {
|
||||||
|
JSONObject object = JSONObject.parseObject(model.getRelationShapeText());
|
||||||
|
String id = object.getString("id");
|
||||||
|
HashSet<String> keys = new HashSet<>();
|
||||||
|
if (!keys.contains(id)) {
|
||||||
|
// 查询最新名称
|
||||||
|
if ("department".equals(object.getString("type"))) {
|
||||||
|
DepartmentModel dept = SDK.getORGAPI().getDepartmentById(object.getString("id"));
|
||||||
|
if (dept == null)
|
||||||
|
continue;
|
||||||
|
object.put("name", dept.getName());
|
||||||
|
}
|
||||||
|
if ("position".equals(object.getString("type"))) {
|
||||||
|
RoleModel roleModel = SDK.getORGAPI().getRoleById(object.getString("id"));
|
||||||
|
if (roleModel == null)
|
||||||
|
continue;
|
||||||
|
object.put("name", roleModel.getName());
|
||||||
|
}
|
||||||
|
if ("user".equals(object.getString("type"))) {
|
||||||
|
UserModel user = SDK.getORGAPI().getUser(object.getString("id"));
|
||||||
|
if (user == null)
|
||||||
|
continue;
|
||||||
|
object.put("name", user.getUserName());
|
||||||
|
}
|
||||||
|
if ("role".equals(object.getString("type"))) {
|
||||||
|
RoleModel roleModel = SDK.getORGAPI().getRoleById(object.getString("id"));
|
||||||
|
if (roleModel == null)
|
||||||
|
continue;
|
||||||
|
object.put("name", roleModel.getName());
|
||||||
|
}
|
||||||
|
modelList.add(model);
|
||||||
|
keys.add(id);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
// 去重
|
||||||
|
List<DesignerShapeRelationModel> tempList = new ArrayList<DesignerShapeRelationModel>();
|
||||||
|
Set<String> keys = new HashSet<>();
|
||||||
|
for (DesignerShapeRelationModel model : modelList) {
|
||||||
|
String key = model.getFileId() + model.getShapeId() + model.getAttrId() + model.getRelationFileId() + model.getRelationShapeId() + model.getRelationShapeText();
|
||||||
|
if (!keys.contains(key)) {
|
||||||
|
tempList.add(model);
|
||||||
|
keys.add(key);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
modelList = tempList;
|
||||||
|
modelList.sort((m1, m2) -> {
|
||||||
|
return m1.getId().compareTo(m2.getId());
|
||||||
|
});
|
||||||
|
for (DesignerShapeRelationModel model : modelList) {
|
||||||
|
if (attrTypeMap.containsKey(model.getAttrId())) {
|
||||||
|
if ("relation".equals(attrTypeMap.get(model.getAttrId()))) {
|
||||||
|
if (relationShapes.getJSONObject(shapeId1).containsKey(model.getAttrId())) {
|
||||||
|
relationShapes.getJSONObject(shapeId1).put(model.getAttrId(), relationShapes.getJSONObject(shapeId1).getString(model.getAttrId()) + "," + model.getRelationShapeText());
|
||||||
|
} else {
|
||||||
|
relationShapes.getJSONObject(shapeId1).put(model.getAttrId(), model.getRelationShapeText());
|
||||||
|
}
|
||||||
|
} else if ("awsorg".equals(attrTypeMap.get(model.getAttrId()))) {
|
||||||
|
if (relationShapes.getJSONObject(shapeId1).containsKey(model.getAttrId())) {
|
||||||
|
relationShapes.getJSONObject(shapeId1).put(model.getAttrId(), relationShapes.getJSONObject(shapeId1).getString(model.getAttrId()) + "," + JSONObject.parseObject(model.getRelationShapeText()).getString("name"));
|
||||||
|
} else {
|
||||||
|
relationShapes.getJSONObject(shapeId1).put(model.getAttrId(), JSONObject.parseObject(model.getRelationShapeText()).getString("name"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
boolean isLaneAttrConfig = appApi.getPropertyBooleanValue(CoEConstant.APP_ID, "IS_LANE_ATTR_CONFIG", false);
|
||||||
|
boolean isLaneForceRefreshShapeAttr = appApi.getPropertyBooleanValue(CoEConstant.APP_ID, "IS_LANE_FORCE_REFRESH_SHAPE_ATTR", false);
|
||||||
|
macroLibraries.put("isLaneAttrConfig", isLaneAttrConfig);
|
||||||
|
macroLibraries.put("isLaneForceRefreshShapeAttr", isLaneForceRefreshShapeAttr);
|
||||||
|
|
||||||
|
macroLibraries.put("relationShapesData", relationShapes);
|
||||||
|
/********************步骤说明************************/
|
||||||
|
/********************描述************************/
|
||||||
|
// 自定义属性
|
||||||
|
JSONObject object = CoeProcessLevelUtil.getProcessLevelPropertyVal(plModel.getId());
|
||||||
|
macroLibraries.put("processDesc", object);
|
||||||
|
if (upVisit) {
|
||||||
|
PALRepositoryQueryAPIManager.getInstance().UpDatePublishCount(plModel);
|
||||||
|
}
|
||||||
|
/********************描述************************/
|
||||||
|
|
||||||
|
return HtmlPageTemplate.merge(CoEConstant.APP_ID, "pal.pl.repository.designer.view.portal.homepage.html", macroLibraries);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 门户流程详情详情 (移动端)
|
* 门户流程详情详情 (移动端)
|
||||||
*
|
*
|
||||||
|
|||||||
@ -30,6 +30,8 @@ import java.util.Map;
|
|||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
import com.actionsoft.bpms.bo.engine.BO;
|
||||||
|
import com.actionsoft.bpms.commons.formfile.model.delegate.FormFile;
|
||||||
import org.apache.commons.collections.CollectionUtils;
|
import org.apache.commons.collections.CollectionUtils;
|
||||||
import org.apache.commons.lang.StringUtils;
|
import org.apache.commons.lang.StringUtils;
|
||||||
import org.apache.poi.hssf.usermodel.HSSFCell;
|
import org.apache.poi.hssf.usermodel.HSSFCell;
|
||||||
@ -8904,6 +8906,8 @@ public class CoeProcessLevelWeb extends ActionWeb {
|
|||||||
JSONObject definition = JSONObject.parseObject(define);
|
JSONObject definition = JSONObject.parseObject(define);
|
||||||
JSONObject elements = definition.getJSONObject("elements");
|
JSONObject elements = definition.getJSONObject("elements");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//新建一个uuid
|
//新建一个uuid
|
||||||
String shapeId = UUIDGener.getObjectId();
|
String shapeId = UUIDGener.getObjectId();
|
||||||
//拿到基础结构
|
//拿到基础结构
|
||||||
@ -8912,15 +8916,20 @@ public class CoeProcessLevelWeb extends ActionWeb {
|
|||||||
shape = ShapeUtils.getProcessShapeDefinitionByName("control_policy", "regulation");
|
shape = ShapeUtils.getProcessShapeDefinitionByName("control_policy", "regulation");
|
||||||
shape.put("id", shapeId);
|
shape.put("id", shapeId);
|
||||||
shape.put("text", title);
|
shape.put("text", title);
|
||||||
|
DBSql.update("update APP_ACT_COE_PAL_REPOSITORY set EXT3='regulation' where id = '"+uuid+"'");
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
shape = ShapeUtils.getProcessShapeDefinitionByName("control_policy", "I/O_L4");
|
shape = ShapeUtils.getProcessShapeDefinitionByName("control_policy", "I/O_L4");
|
||||||
shape.put("id", shapeId);
|
shape.put("id", shapeId);
|
||||||
shape.put("text", title);
|
DBSql.update("update APP_ACT_COE_PAL_REPOSITORY set EXT3='I/O_L4' where id = '"+uuid+"'");
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//图形的数据属性配置
|
//图形的数据属性配置
|
||||||
List<PALMethodAttributeModel> attributeModels = CoeDesignerShapeAPIManager.getInstance().getAllValidShapeAttributeModels(wsId, plModel.getMethodId());
|
List<PALMethodAttributeModel> attributeModels = CoeDesignerShapeAPIManager.getInstance().getAllValidShapeAttributeModels(wsId, plModel.getMethodId());
|
||||||
for (PALMethodAttributeModel attributeModel : attributeModels) {
|
for (PALMethodAttributeModel attributeModel : attributeModels) {
|
||||||
@ -8969,15 +8978,97 @@ public class CoeProcessLevelWeb extends ActionWeb {
|
|||||||
defineModel.setDefinition(definition.toString());
|
defineModel.setDefinition(definition.toString());
|
||||||
// 保存文件
|
// 保存文件
|
||||||
CoeDesignerAPIManager.getInstance().storeDefinition(defineModel);// dao操作
|
CoeDesignerAPIManager.getInstance().storeDefinition(defineModel);// dao操作
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//先获取附件模版
|
||||||
|
System.out.println(" >>>>进入模版文件" );
|
||||||
|
String repositoryName = "!form-ui-file-";
|
||||||
|
BO bo = SDK.getBOAPI().query("BO_EU_SYSTEM_DEMO_FILE").addQuery("FILESTATE=", true).detail();
|
||||||
|
List<FormFile> files = SDK.getBOAPI().getFiles(bo.getId(), "SYSTEMFILE");
|
||||||
|
FormFile formFile = files.get(0);
|
||||||
|
DCContext sourceDc = SDK.getBOAPI().getFileDCContext(formFile, repositoryName);
|
||||||
|
sourceDc.setSession(this.getContext());
|
||||||
|
|
||||||
|
InputStream originfile = SDK.getDCAPI().read(sourceDc);
|
||||||
|
|
||||||
|
|
||||||
|
String shpId = "";
|
||||||
|
if (!type.equals("1")) {
|
||||||
|
for (String key : elements.keySet()) {
|
||||||
|
JSONObject shape1 = elements.getJSONObject(key);
|
||||||
|
if ("I/O_L4".equals(shape1.getString("name"))) {
|
||||||
|
shpId = key;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
int lastDotIndex = formFile.getFileName().lastIndexOf(".");
|
||||||
|
String name = formFile.getFileName().substring(0, lastDotIndex);
|
||||||
|
|
||||||
|
boolean writeFileTodisk = writeFileTodisk(this.getContext(), shpId, formFile.getFileName(),
|
||||||
|
originfile, uuid, "s");
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
ro.put("result", "ok");
|
ro.put("result", "ok");
|
||||||
} catch (NumberFormatException e) {
|
} catch (NumberFormatException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
ro.put("result", "error");
|
ro.put("result", "error");
|
||||||
|
} catch (FileNotFoundException e) {
|
||||||
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
|
||||||
return ro.toString();
|
return ro.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 将文件挂载到附件
|
||||||
|
*
|
||||||
|
* @param me
|
||||||
|
* @param reid
|
||||||
|
* @param filename
|
||||||
|
* @param inputStream
|
||||||
|
* @param pl_uuid
|
||||||
|
* @param type
|
||||||
|
* @throws FileNotFoundException
|
||||||
|
*/
|
||||||
|
public boolean writeFileTodisk(UserContext me, String reid, String filename, InputStream inputStream, String pl_uuid, String type) throws FileNotFoundException {
|
||||||
|
//InputStream ins = new FileInputStream("");
|
||||||
|
DCPluginProfile fileProfile = DCProfileManager.getDCProfile(CoEConstant.APP_ID, CoeFileConstant.COE_UPFILE);
|
||||||
|
DCContext dcContextpdf = null;
|
||||||
|
//创建数据库数据
|
||||||
|
UpfileModel model = new UpfileModel();
|
||||||
|
model.setPl_uuid(pl_uuid);
|
||||||
|
if ("f".equals(type)) {
|
||||||
|
model.setShape_uuid("");
|
||||||
|
model.setType("f");
|
||||||
|
dcContextpdf = new DCContext(me, fileProfile, CoEConstant.APP_ID, "file", pl_uuid, filename);
|
||||||
|
} else {
|
||||||
|
//dcContextpdf = new DCContext(me, fileProfile, CoEConstant.APP_ID, "file", pl_uuid, filename);
|
||||||
|
dcContextpdf = new DCContext(me, fileProfile, CoEConstant.APP_ID, pl_uuid, reid, filename);
|
||||||
|
model.setShape_uuid(reid);
|
||||||
|
model.setType("s");
|
||||||
|
}
|
||||||
|
SDK.getDCAPI().write(inputStream, dcContextpdf);
|
||||||
|
model.setUuid(UUIDGener.getUUID());
|
||||||
|
model.setFileName(filename);
|
||||||
|
model.setDownload(1);
|
||||||
|
model.setCreateUser(me.getUID());
|
||||||
|
model.setCreateTime(new Timestamp(System.currentTimeMillis()));
|
||||||
|
if (new UpFileDao().create(model) > 0) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// 复制文件属性
|
// 复制文件属性
|
||||||
private void updateFileProperty(String oldUuid, String newUuid) {
|
private void updateFileProperty(String oldUuid, String newUuid) {
|
||||||
PALRepositoryPropertyDao repositoryPropertyDao = new PALRepositoryPropertyDao();
|
PALRepositoryPropertyDao repositoryPropertyDao = new PALRepositoryPropertyDao();
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user