diff --git a/com.actionsoft.apps.coe.pal.publisher/lib/com.actionsoft.apps.coe.pal.publisher.jar b/com.actionsoft.apps.coe.pal.publisher/lib/com.actionsoft.apps.coe.pal.publisher.jar index 5b5e311f..0d66654d 100644 Binary files a/com.actionsoft.apps.coe.pal.publisher/lib/com.actionsoft.apps.coe.pal.publisher.jar and b/com.actionsoft.apps.coe.pal.publisher/lib/com.actionsoft.apps.coe.pal.publisher.jar differ diff --git a/com.actionsoft.apps.coe.pal.publisher/src/com/actionsoft/apps/coe/pal/publisher/client/web/ProcessPublishWeb.java b/com.actionsoft.apps.coe.pal.publisher/src/com/actionsoft/apps/coe/pal/publisher/client/web/ProcessPublishWeb.java index 20569165..3e05138d 100644 --- a/com.actionsoft.apps.coe.pal.publisher/src/com/actionsoft/apps/coe/pal/publisher/client/web/ProcessPublishWeb.java +++ b/com.actionsoft.apps.coe.pal.publisher/src/com/actionsoft/apps/coe/pal/publisher/client/web/ProcessPublishWeb.java @@ -2500,7 +2500,7 @@ public class ProcessPublishWeb extends ActionWeb { String name = parseObject.getString("name"); if (!"流程制度".equals(name)) { String versionId = parseObject.getString("versionId"); - String sql = "SELECT PLNAME FROM APP_ACT_COE_PAL_REPOSITORY WHERE PLVERSIONID = '" + versionId + "' and ISPUBLISH = '0' and ISSTOP = '0' order by plver "; + String sql = "SELECT PLNAME FROM APP_ACT_COE_PAL_REPOSITORY WHERE PLVERSIONID = '" + versionId + "' and ISPUBLISH = '0' and ISSTOP = '0' order by plver desc "; String newName = DBSql.getString(sql); parseObject.replace("name", newName); parseObject.replace("isParent", "false"); diff --git a/com.actionsoft.apps.coe.pal.publisher/src/com/actionsoft/apps/coe/pal/publisher/event/PublishFormBeforeSaveEvent.java b/com.actionsoft.apps.coe.pal.publisher/src/com/actionsoft/apps/coe/pal/publisher/event/PublishFormBeforeSaveEvent.java index 3bdc8c4b..9c6d7b88 100644 --- a/com.actionsoft.apps.coe.pal.publisher/src/com/actionsoft/apps/coe/pal/publisher/event/PublishFormBeforeSaveEvent.java +++ b/com.actionsoft.apps.coe.pal.publisher/src/com/actionsoft/apps/coe/pal/publisher/event/PublishFormBeforeSaveEvent.java @@ -134,67 +134,83 @@ public class PublishFormBeforeSaveEvent extends InterruptListener implements Int if(onemodel!=null) { boolean isUse = onemodel.isUse(); boolean publish = onemodel.isPublish(); - //如果状态是未发布 - if (isUse == true && publish == false) { + + String versionId=onemodel.getVersionId(); + + //如果支持文件有多个版本,其中有已发布的版本,应校验通过 + + Boolean isPublish = false; + List models = PALRepositoryCache.getByVersionId(versionId); + if (models != null && models.size() > 0) { + for(PALRepositoryModel oneModel:models){ + if(oneModel.isPublish()==true){ + isPublish=true; + } + } + } + if(isPublish==false){ + //如果当前是使用中但是状态是未发布进行校验判断 + if (isUse == true && publish == false) { fileElements = CoeDesignerUtil.getShapeMessageJson4(onemodel.getId()); - RowMap publishNrowMap = DBSql.getMap("SELECT T1.* FROM BO_ACT_COE_PUBLISH_N T1 LEFT JOIN APP_ACT_COE_PAL_REPOSITORY T2 on T1.PUBLISHFILEID=T2.ID WHERE T1.BINDID=? AND T1.PUBLISHFILEID=? AND T2.ISPUBLISH=0", bindid, splitRelationFileId[i]); + RowMap publishNrowMap = DBSql.getMap("SELECT T1.* FROM BO_ACT_COE_PUBLISH_N T1 LEFT JOIN APP_ACT_COE_PAL_REPOSITORY T2 on T1.PUBLISHFILEID=T2.ID WHERE T1.BINDID=? AND T1.PUBLISHFILEID=? AND T2.ISPUBLISH=0", bindid, splitRelationFileId[i]); - RowMap publishCrowMap = DBSql.getMap("SELECT T1.* FROM BO_ACT_COE_PUBLISH_C T1 LEFT JOIN APP_ACT_COE_PAL_REPOSITORY T2 on T1.CHANGEDFILEIDNEW=T2.ID WHERE T1.BINDID=? AND T1.CHANGEDFILEIDNEW=? AND T2.ISPUBLISH=0", bindid, splitRelationFileId[i]); + RowMap publishCrowMap = DBSql.getMap("SELECT T1.* FROM BO_ACT_COE_PUBLISH_C T1 LEFT JOIN APP_ACT_COE_PAL_REPOSITORY T2 on T1.CHANGEDFILEIDNEW=T2.ID WHERE T1.BINDID=? AND T1.CHANGEDFILEIDNEW=? AND T2.ISPUBLISH=0", bindid, splitRelationFileId[i]); - if (publishNrowMap == null && publishCrowMap == null) { - sb.append("模型名称:").append(model.getName()).append("关联文件模型名称:").append(onemodel.getName()).append("需进行选择发布!").append("
"); - } - //如果当前不是使用中查找使用中版本 - }else if(isUse==false && publish==true){ + if (publishNrowMap == null && publishCrowMap == null) { + sb.append("模型名称:").append(model.getName()).append("关联文件模型名称:").append(onemodel.getName()).append("需进行选择发布!").append("
"); + } + //如果当前不是使用中查找使用中版本 + }/*else if(isUse==false && publish==true){ + List versions = PALRepositoryCache.getByVersionId(model.getVersionId()); + if(versions.size()>0) { + for(int k=0;k versions = PALRepositoryCache.getByVersionId(model.getVersionId()); - if(versions.size()>0) { - for(int k=0;k"); + if (publishNrowMap == null && publishCrowMap == null) { + sb.append("模型名称:").append(model.getName()).append("关联文件模型名称:").append(onemodel.getName()).append("需进行选择发布!").append("
"); + } } } } - } - }else if(isUse==false && publish==false) { + //如果不是使用中,发布状态是未发布进行判断校验 + }*/else if(isUse==false && publish==false) { - List versions = PALRepositoryCache.getByVersionId(model.getVersionId()); - if(versions.size()>0) { - for(int k=0;k versions = PALRepositoryCache.getByVersionId(model.getVersionId()); + if(versions.size()>0) { + for(int k=0;k"); + if (publishNrowMap == null && publishCrowMap == null) { + sb.append("模型名称:").append(model.getName()).append("关联文件模型名称:").append(onemodel.getName()).append("需进行选择发布!").append("
"); + } } } } - } + } } if(onemodel.getMethodId().equals("data.form")){ fileElements = CoeDesignerUtil.getShapeMessageJson4(splitRelationFileId[i]); diff --git a/com.actionsoft.apps.coe.pal.publisher/src/com/actionsoft/apps/coe/pal/publisher/pubEvent/ProcessEndAfterEvent_new.java b/com.actionsoft.apps.coe.pal.publisher/src/com/actionsoft/apps/coe/pal/publisher/pubEvent/ProcessEndAfterEvent_new.java index ff4e07cf..fb271c4e 100644 --- a/com.actionsoft.apps.coe.pal.publisher/src/com/actionsoft/apps/coe/pal/publisher/pubEvent/ProcessEndAfterEvent_new.java +++ b/com.actionsoft.apps.coe.pal.publisher/src/com/actionsoft/apps/coe/pal/publisher/pubEvent/ProcessEndAfterEvent_new.java @@ -770,7 +770,7 @@ public class ProcessEndAfterEvent_new extends ExecuteListener implements Execute jsonObject.put("abstract", dcContext);//信息摘要 jsonObject.put("title", dcContext.getFileName().substring(0,dcContext.getFileName().indexOf(".")));//信息标题 coontest.add(jsonObject); - //createIndexesByContent(processExecutionContext,coontest); + createIndexesByContent(processExecutionContext,coontest); } } @@ -818,7 +818,7 @@ public class ProcessEndAfterEvent_new extends ExecuteListener implements Execute jsonObject.put("abstract", dcContexts);//信息摘要 jsonObject.put("title", dcContexts.getFileName().substring(0,dcContexts.getFileName().indexOf(".")));//信息标题 coontest.add(jsonObject); - //createIndexesByContent(processExecutionContext,coontest); + createIndexesByContent(processExecutionContext,coontest); } }