发布校验代码提交

This commit is contained in:
zhal 2023-12-07 15:56:44 +08:00
parent d41d248057
commit 42689e9d2f
4 changed files with 54 additions and 38 deletions

View File

@ -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");

View File

@ -134,7 +134,22 @@ public class PublishFormBeforeSaveEvent extends InterruptListener implements Int
if(onemodel!=null) {
boolean isUse = onemodel.isUse();
boolean publish = onemodel.isPublish();
//如果状态是未发布
String versionId=onemodel.getVersionId();
//如果支持文件有多个版本其中有已发布的版本应校验通过
Boolean isPublish = false;
List<PALRepositoryModel> 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]);
@ -147,8 +162,7 @@ public class PublishFormBeforeSaveEvent extends InterruptListener implements Int
sb.append("模型名称:").append(model.getName()).append("关联文件模型名称:").append(onemodel.getName()).append("需进行选择发布!").append("</br>");
}
//如果当前不是使用中查找使用中版本
}else if(isUse==false && publish==true){
}/*else if(isUse==false && publish==true){
List<PALRepositoryModel> versions = PALRepositoryCache.getByVersionId(model.getVersionId());
if(versions.size()>0) {
for(int k=0;k<versions.size();k++) {
@ -171,7 +185,8 @@ public class PublishFormBeforeSaveEvent extends InterruptListener implements Int
}
}
}
}else if(isUse==false && publish==false) {
//如果不是使用中发布状态是未发布进行判断校验
}*/else if(isUse==false && publish==false) {
List<PALRepositoryModel> versions = PALRepositoryCache.getByVersionId(model.getVersionId());
if(versions.size()>0) {
@ -196,6 +211,7 @@ public class PublishFormBeforeSaveEvent extends InterruptListener implements Int
}
}
}
if(onemodel.getMethodId().equals("data.form")){
fileElements = CoeDesignerUtil.getShapeMessageJson4(splitRelationFileId[i]);

View File

@ -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);
}
}