解决角色模型重复新建问题/解决数据属性默认显示undefined/PAL打包

This commit is contained in:
zhal 2022-08-04 21:28:50 +08:00
parent 5406729607
commit 4f46851301
7 changed files with 183 additions and 98 deletions

View File

@ -755,12 +755,12 @@ public class DesignerRelationShapeWeb extends ActionWeb {
// macroLibraries.put("treeData", getTreeJson(wsId, "", category, type, method));
// by bzp
String treeJson=getTreeJson(wsId, "", category, type, method,ruuid,attrId);
String treeJson = getTreeJson(wsId, "", category, type, method, ruuid, attrId);
boolean showflag=true;
boolean showflag = true;
//JSONObject jsonObject = JSONObject.parseObject(json);
JSONArray jsonArr_new= new JSONArray();
JSONArray objects=JSONArray.parseArray(treeJson);
JSONArray jsonArr_new = new JSONArray();
JSONArray objects = JSONArray.parseArray(treeJson);
//角色图属性代码是role/绩效图属性代码为Process_performance_metrics进行判断
if (attrId.equals("Process_performance_metrics")) {
if (objects != null) {
@ -770,9 +770,9 @@ public class DesignerRelationShapeWeb extends ActionWeb {
String id = jsonObject.getString("id");
if (UtilString.isNotEmpty(url)) {
List data=new ArrayList();
data.add(0,jsonObject.getString("plMethodId"));
data.add(1,ruuid);
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));
@ -783,45 +783,45 @@ public class DesignerRelationShapeWeb extends ActionWeb {
}
}
macroLibraries.put("treeData", jsonArr_new.toString());
}else if(attrId.equals("role")) {
} 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");
String isParent = jsonObject.getString("isParent");
if (isParent != null) {
if (isParent.equals("true")) {
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) {
showflag=false;
if (showflag==false) {
jsonArr_new.add(objects.getJSONObject(i));
showflag=true;
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) {
showflag = false;
if (showflag == false) {
jsonArr_new.add(objects.getJSONObject(i));
showflag = true;
}
JSONObject json = getJSon(coeProcessLevelModel);
jsonArr_new.add(json);
}
JSONObject json = getJSon(coeProcessLevelModel);
jsonArr_new.add(json);
}
}
}
}
}else{
List data=new ArrayList();
data.add(0,jsonObject.getString("plMethodId"));
data.add(1,ruuid);
} 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{
} else {
jsonArr_new.add(objects.getJSONObject(i));
}
@ -829,82 +829,112 @@ public class DesignerRelationShapeWeb extends ActionWeb {
}
macroLibraries.put("treeData", jsonArr_new.toString());
}else if(attrId.equals("post")){
} else if (attrId.equals("post")) {
if (objects != null) {
for (int i = 0; i < objects.size(); i++) {
String id= objects.getJSONObject(i).getString("id");
String url =objects.getJSONObject(i).getString("url");
String id = objects.getJSONObject(i).getString("id");
String url = objects.getJSONObject(i).getString("url");
if (UtilString.isNotEmpty(url)) {
String titles=objects.getJSONObject(i).getString("title");
if(titles.equals("岗位模型")){
jsonArr_new.add(objects.getJSONObject(i));
}else{
List<Map<String, Object>> nodeElements = CoeDesignerUtil.getShapeMessageJson4(id);
if(nodeElements.size()>0){
String title = nodeElements.get(0).get("title").toString();
if(title.equals("岗位")){
jsonArr_new.add(objects.getJSONObject(i));
}
if (UtilString.isNotEmpty(url)) {
String titles = objects.getJSONObject(i).getString("title");
if (titles.equals("岗位模型")) {
jsonArr_new.add(objects.getJSONObject(i));
} else {
List<Map<String, Object>> nodeElements = CoeDesignerUtil.getShapeMessageJson4(id);
if (nodeElements.size() > 0) {
String title = nodeElements.get(0).get("title").toString();
if (title.equals("岗位")) {
jsonArr_new.add(objects.getJSONObject(i));
}
}
}else{
jsonArr_new.add(objects.getJSONObject(i));
}
}
}
macroLibraries.put("treeData", jsonArr_new.toString());
}else if(attrId.equals("R_relevant_flies")){//相关文件
for (int i = 0; i < objects.size(); i++) {
JSONObject jsonObject = objects.getJSONObject(i);
String isParent=jsonObject.getString("isParent");
if(isParent!=null){
if(isParent.equals("false")){
//过滤废止数据
RowMap rowMap=DBSql.getMap("SELECT * FROM APP_ACT_COE_PAL_REPOSITORY WHERE PLNAME=? AND ISSTOP=? AND ISUSE=?",jsonObject.getString("name"),1,1);
if(rowMap!=null){
continue;
}
RowMap publishRowMap=DBSql.getMap("SELECT * FROM APP_ACT_COE_PAL_REPOSITORY WHERE PLNAME=? AND ISPUBLISH=? AND ISUSE=?",jsonObject.getString("name"),1,1);
if(publishRowMap!=null){
jsonObject.put("nocheck",false);
jsonArr_new.add(jsonObject);
}
}else{
jsonObject.put("nocheck", true);
jsonArr_new.add(jsonObject);
}
}else{
jsonObject.put("nocheck", true);
jsonArr_new.add(jsonObject);
}
}
} else {
jsonArr_new.add(objects.getJSONObject(i));
}
}
}
macroLibraries.put("treeData", jsonArr_new.toString());
} else if(attrId.equals("support_files")) { //支持文件
} else if (attrId.equals("R_relevant_flies")) {//相关文件
for (int i = 0; i < objects.size(); i++) {
JSONObject jsonObject = objects.getJSONObject(i);
String isParent=jsonObject.getString("isParent");
if(isParent!=null){
if(isParent.equals("false")){
String isParent = jsonObject.getString("isParent");
if (isParent != null) {
if (isParent.equals("false")) {
//过滤废止数据
RowMap rowMap=DBSql.getMap("SELECT * FROM APP_ACT_COE_PAL_REPOSITORY WHERE PLNAME=? AND ISSTOP=? AND ISUSE=?",jsonObject.getString("name"),1,1);
if(rowMap!=null){
RowMap rowMap = DBSql.getMap("SELECT * FROM APP_ACT_COE_PAL_REPOSITORY WHERE PLNAME=? AND ISSTOP=? AND ISUSE=?", jsonObject.getString("name"), 1, 1);
if (rowMap != null) {
continue;
}
}else{
RowMap publishRowMap = DBSql.getMap("SELECT * FROM APP_ACT_COE_PAL_REPOSITORY WHERE PLNAME=? AND ISPUBLISH=? AND ISUSE=?", jsonObject.getString("name"), 1, 1);
if (publishRowMap != null) {
jsonObject.put("nocheck", false);
jsonArr_new.add(jsonObject);
}
} else {
jsonObject.put("nocheck", true);
jsonArr_new.add(jsonObject);
}
}else{
} else {
jsonObject.put("nocheck", true);
jsonArr_new.add(jsonObject);
}
}
macroLibraries.put("treeData", treeJson);
}else{
macroLibraries.put("treeData", jsonArr_new.toString());
} else if (attrId.equals("support_files")) { //支持文件
for (int i = 0; i < objects.size(); i++) {
JSONObject jsonObject = objects.getJSONObject(i);
String isParent = jsonObject.getString("isParent");
if (isParent != null) {
if (isParent.equals("false")) {
RowMap isPublishRowMap = DBSql.getMap("SELECT ISPUBLISH FROM APP_ACT_COE_PAL_REPOSITORY WHERE PLNAME=? AND ISUSE=?", jsonObject.getString("name"), 1);
if(isPublishRowMap.getString("ISPUBLISH").equals("0")){
//过滤废止数据
RowMap rowMap = DBSql.getMap("SELECT ISSTOP FROM APP_ACT_COE_PAL_REPOSITORY WHERE PLNAME=? AND ISUSE=?", jsonObject.getString("name"), 1);
String isstop=rowMap.getString("ISSTOP");
if (isstop.equals("1")) {
continue;
}else{
jsonObject.put("nocheck", false);
jsonArr_new.add(jsonObject);
}
}
} else {
jsonObject.put("nocheck", true);
jsonArr_new.add(jsonObject);
}
} else {
jsonObject.put("nocheck", true);
jsonArr_new.add(jsonObject);
}
}
macroLibraries.put("treeData", jsonArr_new.toString());
}else if(attrId.equals("lead_process") || attrId.equals("rear_process")){//前置属性后置属性
for (int i = 0; i < objects.size(); i++) {
JSONObject jsonObject = objects.getJSONObject(i);
String isParent = jsonObject.getString("isParent");
if (isParent != null) {
if (isParent.equals("true")) {
jsonObject.put("nocheck", true);
jsonArr_new.add(jsonObject);
}else{
jsonObject.put("nocheck", false);
jsonArr_new.add(jsonObject);
}
} else {
jsonObject.put("nocheck", true);
jsonArr_new.add(jsonObject);
}
}
macroLibraries.put("treeData", jsonArr_new.toString());
}else{
macroLibraries.put("treeData", treeJson);
}
@ -1246,19 +1276,71 @@ public class DesignerRelationShapeWeb extends ActionWeb {
PALRepositoryModel model = PALRepositoryCache.getCache().get(id);
if (model != null) {
//如果为相关文件 未发布不可选中
if(attrId.equals("R_relevant_flies")){
RowMap rowMap=DBSql.getMap("SELECT * FROM APP_ACT_COE_PAL_REPOSITORY WHERE PLNAME=? AND ISPUBLISH=? AND ISUSE=?", name,1,1);
if(isParent.equals("true")){
node.put("nocheck", true);
result.add(node);
}else if(isParent.equals("false") && rowMap!=null){
node.put("nocheck", false);
RowMap stoprowMap=DBSql.getMap("SELECT ISSTOP FROM APP_ACT_COE_PAL_REPOSITORY WHERE PLNAME=? AND ISUSE=?", name,1);
if(stoprowMap.getString("ISSTOP").equals("0")){
//如果为相关文件 未发布不可选中
if(attrId.equals("R_relevant_flies")){
/*RowMap rowMap=DBSql.getMap("SELECT * FROM APP_ACT_COE_PAL_REPOSITORY WHERE PLNAME=? AND ISPUBLISH=? AND ISUSE=?", name,1,1);
if(isParent.equals("true")){
node.put("nocheck", true);
result.add(node);
}else if(isParent.equals("false") && rowMap!=null){
node.put("nocheck", false);
}*/
RowMap rowMap=DBSql.getMap("SELECT ISPUBLISH FROM APP_ACT_COE_PAL_REPOSITORY WHERE PLNAME=? AND ISUSE=?", name,1);
if(isParent.equals("true")){
node.put("nocheck", true);
result.add(node);
}else if(isParent.equals("false")){
if(rowMap.getString("ISPUBLISH").equals("1")) {
node.put("nocheck", false);
result.add(node);
}
}
}
//如果为支持文件
if(attrId.equals("support_files")){
RowMap rowMap=DBSql.getMap("SELECT ISPUBLISH FROM APP_ACT_COE_PAL_REPOSITORY WHERE PLNAME=? AND ISUSE=?", name,1);
if(isParent.equals("true")){
node.put("nocheck", true);
result.add(node);
}else if(isParent.equals("false")){
if(rowMap.getString("ISPUBLISH").equals("0")) {
node.put("nocheck", false);
result.add(node);
}
}
} else if (attrId.equals("lead_process") || attrId.equals("rear_process")) {
if(isParent.equals("true")) {
node.put("nocheck", true);
result.add(node);
}else{
node.put("nocheck", false);
result.add(node);
}
}else{
String methodId = node.getString("plMethodId");
if ("control.kpi".equals(methodId) && methodScope.equals(methodId)) {
//根据ID去查 是否有关联管流程
String tmpId = node.getString("id");
String sql = "select FILEID from APP_ACT_COE_PAL_SHAPE_RLAT where ATTRID='Process_performance_metrics' and RELATIONFILEID='%s'";
String reId = DBSql.getString(String.format(sql, tmpId));
//还要判断是不是当前流程
if (!reId.isEmpty() && !ruuid.equals(reId)) {
continue;
}
result.add(node);
}
}
}
}
if(attrId.equals("R_relevant_flies")){
/*if(attrId.equals("R_relevant_flies")){
if(isPublish.equals("true") && isStop.equals("false")){
result.add(node);
}
@ -1280,7 +1362,7 @@ public class DesignerRelationShapeWeb extends ActionWeb {
result.add(node);
}
}
}*/
}

View File

@ -596,6 +596,7 @@ public class CoeDesignerWeb extends ActionWeb {
object.put("name", attrModel.getNewTitle());
object.put("readonly", attrModel.getReadonly());
object.put("type", attrModel.getType());
object.put("desc", attrModel.getDesc()==null ? "" : attrModel.getDesc());
object.put("isRequired", attrModel.getIsRequired());
attrDefineObj.put(attrModel.getKey(), object);

View File

@ -2377,6 +2377,7 @@ public class CoeProcessLevelUtil {
*/
public static String getLastPublishTaskIdByModelId(String repositoryId) {
String sql = "SELECT pl.TASKID FROM APP_ACT_COE_PAL_PUBLISH p, APP_ACT_COE_PAL_PUBLISH_LIST pl WHERE pl.pid = p.id AND pl.palrepositoryid = ? ORDER BY publishdate DESC";
//String sql="SELECT TASKID FROM BO_ACT_COE_PUBLISH_N where PUBLISHFILEID=?";
String taskId = DBSql.getObject(sql, new RowMapper<String>() {
@Override
public String mapRow(ResultSet rs, int arg1) throws SQLException {

View File

@ -594,6 +594,7 @@ function autoAjaxWaitFn() {
}
function autoajax(ro) {
debugger;
if(relationType == 'file') {// 前后置流程
closeProcessSearchDialog();
$('#processSearchData').empty();

View File

@ -987,7 +987,6 @@ function openRelationDialog(obj, callback) {
methodName="新建绩效模型";
}
if(title=="支持文件" || method=="control.kpi"){
//根据角色
$.ajax({
type: "POST",
@ -1000,7 +999,6 @@ function openRelationDialog(obj, callback) {
},
success: function (msg) {
if (msg.data.result == "ok") {
var relationDlg = parent.FrmDialog.open({
title: title,
width:710,

View File

@ -3476,7 +3476,6 @@ function openRelationDig(obj,value) {
+ "&relationShapeIds=" + relationShapeIds
+ "&relationFileIds=" + relationFileIds
+ "&ruuid=" + ruuid);
debugger;
if(methodId=="org.role"){
//根据角色
$.ajax({
@ -3525,6 +3524,7 @@ function openRelationDig(obj,value) {
{
text : '刷新',
cls : "yellow",
handler : function() {
// 刷新页面
document.getElementById("attr_content_iframe_relevance_shapes").contentWindow.location.reload(true);
@ -3544,10 +3544,10 @@ function openRelationDig(obj,value) {
methodId:methodId
},
success : function(msg) {
if (msg.data.result == "ok") {
window.top.$.simpleAlert("请勿重复新建角色模型!!!");
}else{
//跳转角色
$.ajax({
type : "POST",
@ -3562,6 +3562,8 @@ function openRelationDig(obj,value) {
},
success : function(msg) {
if (msg.result == "ok") {
//关闭新建按钮
$(".dlg-button button").eq(2).hide();
window.open("./w?uuid=" + msg.data.uuid+"&teamId="+$('#teamId').val()
+ "&cmd=com.actionsoft.apps.coe.pal_pl_repository_designer&sid=" + encodeURIComponent($('#sid').val()));
}