默认展开角色数据/新建角色图校验/pal打包

This commit is contained in:
zhal 2022-10-25 15:26:27 +08:00
parent 18692464c2
commit 9e7a4a5d72
7 changed files with 289 additions and 53 deletions

View File

@ -14,8 +14,14 @@ import com.actionsoft.apps.coe.pal.pal.method.PALMethodManager;
import com.actionsoft.apps.coe.pal.pal.repository.PALRepositoryAPIManager; import com.actionsoft.apps.coe.pal.pal.repository.PALRepositoryAPIManager;
import com.actionsoft.apps.coe.pal.pal.repository.PALRepositoryQueryAPIManager; import com.actionsoft.apps.coe.pal.pal.repository.PALRepositoryQueryAPIManager;
import com.actionsoft.apps.coe.pal.pal.repository.cache.PALRepositoryAttributeCache; import com.actionsoft.apps.coe.pal.pal.repository.cache.PALRepositoryAttributeCache;
import com.actionsoft.apps.coe.pal.pal.repository.cache.PALRepositoryCache;
import com.actionsoft.apps.coe.pal.pal.repository.cache.PALRepositoryShapeAttributeCache; import com.actionsoft.apps.coe.pal.pal.repository.cache.PALRepositoryShapeAttributeCache;
import com.actionsoft.apps.coe.pal.pal.repository.dao.*; import com.actionsoft.apps.coe.pal.pal.repository.dao.*;
import com.actionsoft.apps.coe.pal.pal.repository.designer.dao.CoeDesignerDefaultDao;
import com.actionsoft.apps.coe.pal.pal.repository.designer.io.file.CoeDesignerFile;
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.util.CoeDesignerUtil;
import com.actionsoft.apps.coe.pal.pal.repository.model.*; import com.actionsoft.apps.coe.pal.pal.repository.model.*;
import com.actionsoft.apps.coe.pal.pal.repository.util.CoeProcessLevelUtil; import com.actionsoft.apps.coe.pal.pal.repository.util.CoeProcessLevelUtil;
import com.actionsoft.apps.coe.pal.util.HighSecurityUtil; import com.actionsoft.apps.coe.pal.util.HighSecurityUtil;
@ -73,7 +79,7 @@ public class PalManageWeb extends ActionWeb {
super(_uc); super(_uc);
this._uc = _uc; this._uc = _uc;
} }
protected CoeDesignerFile storer;// 存储操作器
/** /**
* 获取schema中的json * 获取schema中的json
* *
@ -706,9 +712,16 @@ public class PalManageWeb extends ActionWeb {
attributeXmlMap.put(attributeModel.getKey(), map1); attributeXmlMap.put(attributeModel.getKey(), map1);
} }
} }
for (PALRepositoryModel plModel : palList) { for (PALRepositoryModel plModel : palList) {
CoeDesignerShapeAPIManager.getInstance().updateShapeAttribute(_uc, plModel.getId(), methodId, shapeName, shapeAttrConfigs, attributeXmlMap); CoeDesignerShapeAPIManager.getInstance().updateShapeAttribute(_uc, plModel.getId(), methodId, shapeName, shapeAttrConfigs, attributeXmlMap);
} }
} }
// 操作行为日志记录 // 操作行为日志记录
if (SDK.getAppAPI().getPropertyBooleanValue(CoEConstant.APP_ID, "IS_RECORD_OP_LOG", false)) { if (SDK.getAppAPI().getPropertyBooleanValue(CoEConstant.APP_ID, "IS_RECORD_OP_LOG", false)) {

View File

@ -920,6 +920,37 @@ public class PALRepositoryQueryAPIManager {
return list; return list;
} }
public List<PALRepositoryModel> getPalRepositoryModelsByPidRole(String wsId, String pid,String ruuid) {
List<PALRepositoryModel> list = new ArrayList<PALRepositoryModel>();
List<PALRepositoryModel> repositoryModelList = PALRepositoryCache.getAllSubModelsByPid(wsId, pid);
if (repositoryModelList != null) {
for (PALRepositoryModel model : repositoryModelList) {
try {
PALRepositoryModelImpl newModel = ((PALRepositoryModelImpl) model).clone();
newModel.setNewParentId(pid);
list.add(newModel);
} catch (CloneNotSupportedException e) {
e.printStackTrace();
}
}
}
List data = new ArrayList();
data.add(0, "org.role");
data.add(1, ruuid);
RowMap rowMap = DBSql.getMap("SELECT ID FROM APP_ACT_COE_PAL_REPOSITORY WHERE EXT2=?", data.toString());
if (rowMap != null) {
PALRepositoryModel roleModel = PALRepositoryCache.getCache().get(rowMap.getString("ID"));
list.add(roleModel);
}
return list;
}
public void getAllPalRepositoryModelsByPid(String wsId, String pid, List<PALRepositoryModel> list) { public void getAllPalRepositoryModelsByPid(String wsId, String pid, List<PALRepositoryModel> list) {
List<PALRepositoryModel> children = getPalRepositoryModelsByPid(wsId, pid); List<PALRepositoryModel> children = getPalRepositoryModelsByPid(wsId, pid);
if (children != null && children.size() > 0) { if (children != null && children.size() > 0) {
@ -1027,6 +1058,63 @@ public class PALRepositoryQueryAPIManager {
return list; return list;
} }
public List<PALRepositoryModel> getUsedPalRepositoryModelsByPidRole(String wsId, String pid,String ruuid) {
List<PALRepositoryModel> list = getPalRepositoryModelsByPidRole(wsId, pid,ruuid);
List<PALRepositoryModel> removeList = new ArrayList<PALRepositoryModel>();
if (list != null) {
for (PALRepositoryModel model : list) {
if (!model.isUse()) {
removeList.add(model);
}
if(model.getName().equals("岗位模型")){
removeList.add(model);
}
}
}
list.removeAll(removeList);
//Collections.sort(list, new Comparator1());
/*List data = new ArrayList();
data.add(0, "org.role");
data.add(1, ruuid);
RowMap rowMap = DBSql.getMap("SELECT ID FROM APP_ACT_COE_PAL_REPOSITORY WHERE EXT2=?", data.toString());
if (rowMap != null) {
PALRepositoryModel roleModel = PALRepositoryCache.getCache().get(rowMap.getString("ID"));
list.add(roleModel);
}*/
return list;
}
public List<PALRepositoryModel> getUsedPalRepositoryModelsByPidRoleCorrelation(String wsId, String pid,String ruuid) {
List<PALRepositoryModel> list = getPalRepositoryModelsByPid(wsId, pid);
List<PALRepositoryModel> removeList = new ArrayList<PALRepositoryModel>();
if (list != null) {
for (PALRepositoryModel model : list) {
if (!model.isUse()) {
removeList.add(model);
}
List data = new ArrayList();
data.add(0, "org.role");
data.add(1, ruuid);
RowMap rowMap = DBSql.getMap("SELECT ID FROM APP_ACT_COE_PAL_REPOSITORY WHERE EXT2=? AND ID=?", data.toString(),model.getId());
if (rowMap == null) {
removeList.add(model);
}
}
}
list.removeAll(removeList);
Collections.sort(list, new Comparator1());
return list;
}
/**************************************************** 获取使用中的流程 *****************************************************/ /**************************************************** 获取使用中的流程 *****************************************************/
/** /**
@ -1346,7 +1434,19 @@ public class PALRepositoryQueryAPIManager {
return result; return result;
} }
/**
* 根据pid获取使用中的流程树(角色模型)
*
* @param wsId 流程库Id
* @param pid 父节点Id
* @return
*/
public JSONArray getUsedPalRepositoryTreeDataByPidRole(UserContext context, String wsId, String pid,String ruuid) {
List<PALRepositoryModel> list = getUsedPalRepositoryModelsByPidRole(wsId, pid,ruuid); // 根据父节点Id获取使用中的子节点
//Collections.sort(list, new Comparator1()); // 按级别排序
JSONArray result = list2JsonRole(context, list, true, false,ruuid);
return result;
}
/** /**
* *
* @param context * @param context
@ -1791,7 +1891,121 @@ public class PALRepositoryQueryAPIManager {
return jsonArray; return jsonArray;
} }
/**********************************************************筛选角色模型***************************************************/
/**
* 通过流程model列表获取流程树的json数组
*
* @param context
* @param list
* @return
*/
public JSONArray list2JsonRole(UserContext context, List<PALRepositoryModel> list, boolean isUsed, boolean isPublished,String ruuid) {
return list2JsonRole(context, list, isUsed, isPublished, null, null,ruuid);
}
private JSONArray list2JsonRole(UserContext context, List<PALRepositoryModel> list, boolean isUsed, boolean isPublished, String removeIds, String param,String ruuid) {
JSONArray jsonArray = new JSONArray();
for (PALRepositoryModel model : list) {
JSONObject object = new JSONObject();
object.put("id", model.getId().trim());
object.put("pid", model.getNewParentId().trim());
if (removeIds != null && removeIds.contains(model.getId().trim())) {
object.put("nocheck", true);
} else {
object.put("nocheck", false);
}
object.put("plNo", CoeProcessLevelUtil.getProcessLevelNoByUUId(model.getId(), model.getWsId()).trim());
object.put("name", I18nRes.findValue(CoEConstant.APP_ID, context.getLanguage(), model.getName()).trim());
object.put("wsId", model.getWsId());
PALMethodModel methodModel = PALMethodCache.getPALMethodModelById(model.getMethodId());
if (methodModel == null || methodModel.isFolder()) {// 没有该建模方法或者是文件夹类
object.put("title", object.get("name"));
} else {
object.put("title", object.get("name") + " " + VersionUtil.getVersionStrV(model.getVersion()).trim());
}
//三员管理文件密级校验
if (HighSecurityUtil.isON() && HighSecurityUtil.fileSecuritySwitch()){
ResponseObject responseObject = new CoeProcessLevelWeb(DispatcherRequest.getUserContext()).checkFilePemission(model.getId());
if (responseObject.isErr() && (methodModel != null && !methodModel.isFolder())){
object.put("nocheck", true);
}
}
object.put("drop", false);
object.put("isSystemFile", model.isSystemFile());
object.put("plMethodId", model.getMethodId().trim());
if (methodModel == null || methodModel.isFolder()) {// 没有该建模方法或者是文件夹类
object.put("iconFont", "&#58930;");
} else {
object.put("iconFont", "&#59101;");
}
if(model.getName().equals("角色模型")){
object.put("isParent", true);
object.put("open", true);
}else{
object.put("isParent", false);
object.remove("open");
}
/*List<PALRepositoryModel> children = null;
if (isUsed) {
children = getUsedPalRepositoryModelsByPidRoleCorrelation(model.getWsId(), model.getId(),ruuid);
if (param != null && "designer".equals(param) && children != null && children.size() > 0) {// 过滤掉发布版本
List<PALRepositoryModel> tempChildren = new ArrayList<>();
for (PALRepositoryModel model2 : children) {
if (!model2.isPublish()) {
tempChildren.add(model2);
}
}
children = tempChildren;
}
} else if (isPublished) {
children = getPublishedPalRepositoryModelsByPid(model.getWsId(), model.getId());
}
if (children == null || children.size() == 0) {
object.put("isParent", false);
//String icon = object.getString("icon");
object.put("leaf", true);// 叶子节点
// object.put("icon", icon.replace("16.png", "16.leaf.png"));
} else {
object.put("isParent", true);
object.put("open", false);
}*/
object.put("plLevel", model.getLevel());
object.put("plOrdexIndex", model.getOrderIndex());
object.put("plDiagramUrl", model.getDiagramUrl());
object.put("isDrops", model.isSystemFile());
object.put("isPublish", model.isPublish());
object.put("isStop", model.isStop());
object.put("isApproval", model.isApproval());
object.put("ext1", model.getExt1());
object.put("ext2", model.getExt2());
object.put("ext3", model.getExt3());
object.put("ext4", model.getExt4());
object.put("isUse", model.isUse());
object.put("url", "./w?sid=" + context.getSessionId() + "&cmd=com.actionsoft.apps.coe.pal_pl_repository_portal_page&ruuid=" + model.getId() + "&type=1&wsid=" + model.getWsId());
object.put("plCategory", model.getMethodCategory());
object.put("versionId", model.getVersionId());
object.put("orderIndex", model.getOrderIndex());
object.put("isBottomLevel", model.isBottomLevel());
String dutyDeptId = model.getDutyDept();
object.put("dutyDeptId", dutyDeptId == null ? "" : dutyDeptId);
String plDutyDeptName = dutyDeptId;
if (!UtilString.isEmpty(dutyDeptId)) {
if (SDK.getORGAPI().getDepartmentById(dutyDeptId) != null) {
plDutyDeptName = SDK.getORGAPI().getDepartmentById(dutyDeptId).getName();
}
}
object.put("dutyDeptName", UtilString.isEmpty(dutyDeptId) ? "" : plDutyDeptName);
String plDutyPerson = model.getDutyUser();
object.put("dutyPersonId", model.getDutyUser() == null ? "" : model.getDutyUser());
object.put("dutyPersionName", UtilString.isEmpty(plDutyPerson) ? "" : SDK.getORGAPI().getUserAliasNames(plDutyPerson));
jsonArray.add(object);
}
return jsonArray;
}
/*********************************************************************重写通过流程model列表获取流程树的json数组***by zhaolei*****************************************************/ /*********************************************************************重写通过流程model列表获取流程树的json数组***by zhaolei*****************************************************/
@ -1874,6 +2088,7 @@ public class PALRepositoryQueryAPIManager {
object.put("open", false); object.put("open", false);
} }
object.put("open",true);
object.put("plLevel", model.getLevel()); object.put("plLevel", model.getLevel());
object.put("plOrdexIndex", model.getOrderIndex()); object.put("plOrdexIndex", model.getOrderIndex());
object.put("plDiagramUrl", model.getDiagramUrl()); object.put("plDiagramUrl", model.getDiagramUrl());

View File

@ -271,8 +271,13 @@ public class PALRepositoryRemoveInfo extends DaoObject<PALRepositoryRemoveInfoMo
param.put("WSID", wsId); param.put("WSID", wsId);
} }
if (UtilString.isNotEmpty(versionIdsSql)) { if (UtilString.isNotEmpty(versionIdsSql)) {
sql.append(" and r.PLVERSIONID in (" + versionIdsSql + ")"); List<String> list = Arrays.asList(versionIdsSql.split(StringPool.COMMA));
sql.append(" and " + getAppendOrAndInString(list));
//sql.append(" and r.PLVERSIONID in (" + versionIdsSql + ")");
} }
if (UtilString.isNotEmpty(searchInput)) { if (UtilString.isNotEmpty(searchInput)) {
String namelike = ""; String namelike = "";
if (StringUtil.containSpecialChar(searchInput)) { if (StringUtil.containSpecialChar(searchInput)) {

View File

@ -831,54 +831,6 @@ public class DesignerRelationShapeWeb extends ActionWeb {
} }
} }
macroLibraries.put("treeData", jsonArr_new.toString()); macroLibraries.put("treeData", jsonArr_new.toString());
} else if (attrId.equals("role")) {
if (objects != null) {
for (int i = 0; i < objects.size(); i++) {
JSONObject jsonObject = objects.getJSONObject(i);
String id = jsonObject.getString("id");
String isParent = jsonObject.getString("isParent");
if (isParent != null) {
if (isParent.equals("true")) {
String title=jsonObject.getString("title");
if(title.equals("角色模型")){
jsonArr_new.add(objects.getJSONObject(i));
}else{
List<PALRepositoryModel> coeProcessLevelModels = CoeProcessLevelDaoFacotory.createCoeProcessLevel().getCoeProcessLevelByPid(id, wsId);
if (coeProcessLevelModels.size() > 0) {
for (int k = 0; k < coeProcessLevelModels.size(); k++) {
PALRepositoryModel coeProcessLevelModel = coeProcessLevelModels.get(k);
if (coeProcessLevelModel != null) {
List data = new ArrayList();
data.add(0, "org.role");
data.add(1, ruuid);
RowMap rowMap = DBSql.getMap("SELECT EXT2 FROM APP_ACT_COE_PAL_REPOSITORY WHERE ID=? AND EXT2=?", coeProcessLevelModel.getId(), data.toString());
if (rowMap != null) {
JSONObject json = getJSon(coeProcessLevelModel);
jsonArr_new.add(json);
}
}
}
}
}
} else {
List data = new ArrayList();
data.add(0, jsonObject.getString("plMethodId"));
data.add(1, ruuid);
RowMap rowMap = DBSql.getMap("SELECT EXT2 FROM APP_ACT_COE_PAL_REPOSITORY WHERE ID=? AND EXT2=?", id, data.toString());
if (rowMap != null) {
jsonArr_new.add(objects.getJSONObject(i));
}
}
} else {
jsonArr_new.add(objects.getJSONObject(i));
}
}
}
macroLibraries.put("treeData", jsonArr_new.toString());
} else if (attrId.equals("post")) { } else if (attrId.equals("post")) {
if (objects != null) { if (objects != null) {
for (int i = 0; i < objects.size(); i++) { for (int i = 0; i < objects.size(); i++) {
@ -1174,9 +1126,13 @@ public class DesignerRelationShapeWeb extends ActionWeb {
controlpmjm2.setOpen(true); controlpmjm2.setOpen(true);
jsonArray.add(controlpmjm2); jsonArray.add(controlpmjm2);
}*/ }*/
JSONArray nodes = null;
if(attrId.equals("role")){
nodes=PALRepositoryQueryAPIManager.getInstance().getUsedPalRepositoryTreeDataByPidRole(_uc, wsuuid, controlpmjm.getId(),ruuid);
}else{
nodes = PALRepositoryQueryAPIManager.getInstance().getUsedPalRepositoryTreeDataByPid(_uc, wsuuid, controlpmjm.getId());
}
JSONArray nodes = PALRepositoryQueryAPIManager.getInstance().getUsedPalRepositoryTreeDataByPid(_uc, wsuuid, controlpmjm.getId());
for (int i = 0; i < nodes.size(); i++) { for (int i = 0; i < nodes.size(); i++) {
JSONObject node = nodes.getJSONObject(i); JSONObject node = nodes.getJSONObject(i);
node.put("url", "./jd?sid=" + _uc.getSessionId() + "&cmd=com.actionsoft.apps.coe.pal_pl_repository_designer_shapes_info&ruuid=" + node.getString("id") + "&uuid=" + node.getString("id")); node.put("url", "./jd?sid=" + _uc.getSessionId() + "&cmd=com.actionsoft.apps.coe.pal_pl_repository_designer_shapes_info&ruuid=" + node.getString("id") + "&uuid=" + node.getString("id"));

View File

@ -0,0 +1,45 @@
package com.actionsoft.apps.coe.pal.pal.repository.job;
import com.actionsoft.apps.coe.pal.pal.repository.cache.PALRepositoryCache;
import com.actionsoft.apps.coe.pal.pal.repository.designer.io.file.CoeDesignerFile;
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.util.CoeDesignerUtil;
import com.actionsoft.apps.coe.pal.pal.repository.model.PALRepositoryModel;
import com.actionsoft.bpms.commons.database.RowMap;
import com.actionsoft.bpms.schedule.IJob;
import com.actionsoft.bpms.util.DBSql;
import com.actionsoft.sdk.local.SDK;
import com.alibaba.fastjson.JSONObject;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import java.util.List;
public class SystemExceptionFileJob implements IJob {
@Override
public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
List<RowMap> rowMaps=DBSql.getMaps("SELECT * FROM APP_ACT_COE_PAL_REPOSITORY WHERE PLMETHODID='control.policy' ");
for(int i=0;i<rowMaps.size();i++){
//查询对应绩效模型中数据模型进行填充数据
BaseModel defineModel = CoeDesignerAPIManager.getInstance().getDefinition(rowMaps.get(i).getString("ID"), 0);
try {
JSONObject definition=JSONObject.parseObject(defineModel.getDefinition());
} catch (Exception e) {
e.printStackTrace();
System.out.println("==========================错误信息输出开始=========================");
SDK.getLogAPI().consoleErr(rowMaps.get(i).getString("ID")+"========"+rowMaps.get(i).getString("PLNAME"));
System.out.println("==========================错误信息输出结束========================");
}
}
}
}

View File

@ -3582,6 +3582,7 @@ function openRelationDig(obj,value) {
text : "新建角色模型", text : "新建角色模型",
cls : "green", cls : "green",
handler : function() { handler : function() {
$(".dlg-button button").eq(3).attr('disabled',true);
//根据角色 //根据角色
$.ajax({ $.ajax({
type : "POST", type : "POST",
@ -3593,6 +3594,7 @@ function openRelationDig(obj,value) {
methodId:methodId methodId:methodId
}, },
success : function(msg) { success : function(msg) {
$(".dlg-button button").eq(3).removeAttr("disabled");
if (msg.data.result == "ok") { if (msg.data.result == "ok") {
window.top.$.simpleAlert("请勿重复新建角色模型!!!"); window.top.$.simpleAlert("请勿重复新建角色模型!!!");
}else{ }else{