Merge branch 'apps_4_test' of https://e.coding.net/yilidev/yilipalkaifa/apps into apps_dev

This commit is contained in:
zhaol 2025-07-11 17:17:30 +08:00
commit 66897fe5df
7 changed files with 117 additions and 13 deletions

View File

@ -116,7 +116,12 @@
<en><![CDATA[Process.Framework]]></en>
<big5><![CDATA[流程架构]]></big5>
</item>
<item key="process">
<item key="freedom.allmethod">
<cn><![CDATA[自由模型]]></cn>
<en><![CDATA[freedom.AllMethod]]></en>
<big5><![CDATA[自由模型]]></big5>
</item>
<item key="process">
<cn><![CDATA[流程制度]]></cn>
<en><![CDATA[Process]]></en>
<big5><![CDATA[流程制度]]></big5>

File diff suppressed because one or more lines are too long

View File

@ -3050,9 +3050,9 @@ public class CoEPALController {
* @return
*/
@Mapping("com.actionsoft.apps.coe.pal_processlevel_create_method_list")
public String getPalProcessLevelCreateMethodList(UserContext me, String category, String methodId) {
public String getPalProcessLevelCreateMethodList(UserContext me, String category, String methodId , String fileId) {
CoeProcessLevelWeb web = new CoeProcessLevelWeb(me);
return web.getPalProcessLevelCreateMethodList(category, methodId);
return web.getPalProcessLevelCreateMethodList(category, methodId,fileId);
}
/**

View File

@ -2611,6 +2611,9 @@ public class CoeProcessLevelWeb extends ActionWeb {
plLevel = plModel.getLevel();
plOrderIndex = plModel.getOrderIndex();
methodId = plModel.getMethodId();
if ("freedom.allmethod".equals(methodId)){
macroLibraries.put("classification", I18nRes.findValue(CoEConstant.APP_ID, methodId));
}
for (int i = 0, methodSize = methodModels.size(); i < methodSize; i++) {
PALMethodModel palMethodModel = methodModels.get(i);
String appId = palMethodModel.getId();
@ -8623,7 +8626,12 @@ public class CoeProcessLevelWeb extends ActionWeb {
* @param methodId
* @return
*/
public String getPalProcessLevelCreateMethodList(String category, String methodId) {
public String getPalProcessLevelCreateMethodList(String category, String methodId, String fileId) {
if(!"process.framework".equals(methodId) && !"default".equals(methodId)){//不是架构或者文件夹
ResponseObject ro = ResponseObject.newErrResponse();
ro.msg("methodId"+methodId+"当前所选择目录不是文件夹或者流程架构,请选择正确的目录!");
return ro.toString();
}
ResponseObject ro = ResponseObject.newOkResponse();
JSONArray fileArr = new JSONArray();// 文件类模型可以画图
JSONArray folderArr = new JSONArray();// 文件夹类模型作为文件夹
@ -8659,16 +8667,29 @@ public class CoeProcessLevelWeb extends ActionWeb {
methodObj.put("categoryName", I18nRes.findValue(CoEConstant.APP_ID, c));
methodObj.put("method", model.getId());
methodObj.put("methodName", I18nRes.findValue(CoEConstant.APP_ID, model.getId()));
if (model.getSchema().contains("架构KPI图")) {
methodObj.put("methodName", "架构KPI图");
}
if (model.getSchema().contains("角色图")) {
methodObj.put("methodName", "角色图");
if (!"freedom.allmethod".equals(model.getId())){
if (model.getSchema().contains("架构KPI图")){
methodObj.put("methodName", "架构KPI图");
}
if (model.getSchema().contains("角色图")){
methodObj.put("methodName", "角色图");
}
}
// System.out.println(c+"对应的"+ PALMethodManager.getInstance().havingCreateMethodPerm(category, methodId, "process", model.getId()));
//流程入口允许新建表单图和制度图 by金鹏
if (category.equals("process") && model.getSchema().contains("表单图")) {
if (model.getId().equals("freedom.allmethod")) {
if (StringUtils.isBlank(fileId)){
methodObj.put("havingCreatePerm", false);
}else {
String property = SDK.getAppAPI().getProperty(CoEConstant.APP_ID, "freedom.file");
if (StringUtils.isNotBlank(property)&&property.contains(fileId)){
methodObj.put("havingCreatePerm", true);
}else {
methodObj.put("havingCreatePerm", false);
}
}
}else if (category.equals("process") && model.getSchema().contains("表单图")) {
methodObj.put("havingCreatePerm", true);
} else if (category.equals("process") && model.getSchema().contains("制度")) {
methodObj.put("havingCreatePerm", true);
@ -11709,9 +11730,10 @@ public class CoeProcessLevelWeb extends ActionWeb {
PALRepositoryCache.getAllChildrenModelsByPid(model.getWsId(), model.getId(), childList, ids);
removeList.addAll(childList);
for (PALRepositoryModel removeModel : removeList) {
//普通用户不允许删除已发布的文件
if (removeModel.isPublish() && !"admin".equals(_uc.getUID())) {
return ResponseObject.newErrResponse("已发布文件["+ removeModel.getName() + VersionUtil.getVersionStrV(removeModel.getVersion()) + "]不允许删除,请联系系统管理员!").toString();
//校验禁止删除逻辑
String errorResponse = checkRemovalPermission(removeModel, _uc);
if (errorResponse != null) {
return errorResponse;
}
}
@ -13210,6 +13232,18 @@ public class CoeProcessLevelWeb extends ActionWeb {
return ro.toString();
}
// 提取重复的错误判断逻辑到一个方法中
private String checkRemovalPermission(PALRepositoryModel model, UserContext _uc) {
if ("admin".equals(_uc.getUID())) {
return null;
}
//非设计状态即草稿不允许删除
if (model.isPublish() || model.isStop() || model.isApproval()) {
return ResponseObject.newErrResponse("文件[" + model.getName() + VersionUtil.getVersionStrV(model.getVersion()) + "]非草稿状态不允许删除,请联系系统管理员!").toString();
}
return null;
}
class ComparatorMap implements Comparator<PALRepositoryModel> {
@Override
@ -13221,4 +13255,6 @@ public class CoeProcessLevelWeb extends ActionWeb {
}
}

View File

@ -1564,6 +1564,7 @@
<cmd-bean name="com.actionsoft.apps.coe.pal_processlevel_create_method_list">
<param name="category"/>
<param name="methodId"/>
<param name="fileId"/>
</cmd-bean>
<cmd-bean name="com.actionsoft.apps.coe.pal_processlevel_folder_create_save">
<param name="wsId"/>

View File

@ -0,0 +1,27 @@
package com.awspaas.user.apps.coe.method.process.freedom.listener;
import com.actionsoft.apps.coe.pal.pal.method.extend.MethodAppManager;
import com.actionsoft.apps.listener.AppListener;
import com.actionsoft.apps.resource.AppContext;
/**
* Created with IntelliJ IDEA.
*
* @Author: yuandongqiang
* @Date: 2025/6/4
* @Description:
*/
public class StartListener implements AppListener {
@Override
public boolean before(AppContext appContext) {
return true;
}
@Override
public void after(AppContext appContext) {
this.initMethod(appContext);
}
private void initMethod(AppContext appContext){
MethodAppManager.register("freedom.allmethod", appContext, "freedom.allmethod", "自由流程建模方法");
}
}

View File

@ -0,0 +1,34 @@
package com.awspaas.user.apps.coe.method.process.freedom.plugin;
import com.actionsoft.apps.listener.PluginListener;
import com.actionsoft.apps.resource.AppContext;
import com.actionsoft.apps.resource.plugin.profile.AWSPluginProfile;
import com.actionsoft.apps.resource.plugin.profile.AppExtensionProfile;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* Created with IntelliJ IDEA.
*
* @Author: yuandongqiang
* @Date: 2025/6/4
* @Description: 插件
*/
public class Plugins implements PluginListener {
@Override
public List<AWSPluginProfile> register(AppContext appContext) {
List<AWSPluginProfile> list = new ArrayList<AWSPluginProfile>();
// PAL应用扩展点
Map<String, Object> params1 = new HashMap<String, Object>();
params1.put("title", "自由模型建模方法");
params1.put("icon", "");
params1.put("desc", "自由模型建模方法");
params1.put("methodId", "freedom.allmethod");
params1.put("deletedClass", "");
list.add(new AppExtensionProfile("PAL流程资产库->自由模型建模方法", "aslp://com.actionsoft.apps.coe.pal/registerMethodApp", params1));
return list;
}
}