角色跳转模型
This commit is contained in:
parent
27a638908c
commit
26b8218598
@ -2917,20 +2917,25 @@ public class CoEPALController {
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
/**
|
||||
* 弹窗新建角色图形创建相应图形
|
||||
* @param me
|
||||
* @param
|
||||
* @return
|
||||
*/
|
||||
@Mapping("com.actionsoft.apps.coe.pal_pl_repository_designer_relation_shape_createDialogModel")
|
||||
public String createDialogModel(UserContext me,String uuid,String methodId,String category) {
|
||||
@Mapping("com.actionsoft.apps.coe.pal_pl_repository_designer_relation_shape_createDialogModel")
|
||||
public String createDialogModel(UserContext me,String uuid,String methodId) {
|
||||
CoeProcessLevelWeb web = new CoeProcessLevelWeb(me);
|
||||
return web.createDialogModel(uuid,methodId,category);
|
||||
return web.createDialogModel(uuid,methodId);
|
||||
}
|
||||
|
||||
|
||||
@Mapping("com.actionsoft.apps.coe.pal_pl_repository_designer_relation_shape_createFormDialogModel")
|
||||
public String createFormDialogModel(UserContext me,String uuid,String method,String category) {
|
||||
CoeProcessLevelWeb web = new CoeProcessLevelWeb(me);
|
||||
return web.createFormDialogModel(uuid,method,category);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询是否有相同角色/绩效图数据
|
||||
* @param me
|
||||
@ -2938,9 +2943,9 @@ public class CoEPALController {
|
||||
* @return
|
||||
*/
|
||||
@Mapping("com.actionsoft.apps.coe.pal_pl_repository_designer_relation_find_same_role")
|
||||
public String relationFindSameRole(UserContext me,String uuid) {
|
||||
public String relationFindSameRole(UserContext me,String uuid,String methodId) {
|
||||
CoeProcessLevelWeb web = new CoeProcessLevelWeb(me);
|
||||
return web.relationFindSameRole(uuid);
|
||||
return web.relationFindSameRole(uuid,methodId);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -8125,7 +8125,7 @@ public class CoeProcessLevelWeb extends ActionWeb {
|
||||
* @return
|
||||
* by zhaolei
|
||||
*/
|
||||
public String createDialogModel(String uuid,String methodId,String category){
|
||||
public String createDialogModel(String uuid,String methodId){
|
||||
|
||||
ResponseObject ro = ResponseObject.newOkResponse();
|
||||
try {
|
||||
@ -8140,24 +8140,14 @@ public class CoeProcessLevelWeb extends ActionWeb {
|
||||
String plRid = UUIDGener.getUUID();
|
||||
String id = UUIDGener.getUUID();
|
||||
|
||||
String titleName=null;
|
||||
String shapName=null;
|
||||
if(methodId.equals("control.kpi")){
|
||||
titleName="绩效图";
|
||||
shapName="kpi";
|
||||
}else if(methodId.equals("org.role")){
|
||||
titleName="角色图";
|
||||
shapName="role";
|
||||
}else if(methodId.equals("data.form")){
|
||||
titleName="表单图";
|
||||
shapName="form";
|
||||
}
|
||||
Timestamp nowTime = new Timestamp(System.currentTimeMillis());
|
||||
PALRepositoryModelImpl model = CoeProcessLevelUtil.createPALRepositoryModel(id, plRid, "6f4e292c-1b90-4dd2-8c20-7da159cb20a5", plname + titleName,
|
||||
"", 1, shapName, category, true, 1,
|
||||
id, false, methodId, "0", 1, null,
|
||||
null, "admin", "admin", nowTime, null, uuid,
|
||||
null, null, null, null, null, null, null, 1);
|
||||
Timestamp nowTime = new Timestamp(System.currentTimeMillis());
|
||||
PALRepositoryModelImpl model = CoeProcessLevelUtil.createPALRepositoryModel(id, plRid, "6f4e292c-1b90-4dd2-8c20-7da159cb20a5", plname + "角色图",
|
||||
"", 1, "org", "org", true, 1,
|
||||
id, false, "org.role", "0", 1, null,
|
||||
null, "admin", "admin", nowTime, null, uuid,
|
||||
null, null, null, null, null, null, null, 1);
|
||||
|
||||
|
||||
|
||||
System.out.println(model.getId());
|
||||
coeProcessLevel.insert(model);
|
||||
@ -8178,9 +8168,9 @@ public class CoeProcessLevelWeb extends ActionWeb {
|
||||
|
||||
|
||||
//拿到基础结构
|
||||
JSONObject shape = ShapeUtils.getProcessShapeDefinitionByName(methodId, shapName);
|
||||
JSONObject shape = ShapeUtils.getProcessShapeDefinitionByName(methodId, "role");
|
||||
shape.put("id", shapeId);
|
||||
shape.put("text", titleName);
|
||||
shape.put("text", "角色");
|
||||
|
||||
JSONObject props = shape.getJSONObject("props");// 位置大小
|
||||
props.put("zindex", 0);
|
||||
@ -8210,14 +8200,93 @@ public class CoeProcessLevelWeb extends ActionWeb {
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 创建角色图
|
||||
* @return
|
||||
* by zhaolei
|
||||
*/
|
||||
public String createFormDialogModel(String uuid,String method,String category){
|
||||
|
||||
ResponseObject ro = ResponseObject.newOkResponse();
|
||||
try {
|
||||
|
||||
RowMap rowMap = DBSql.getMap("SELECT PLNAME FROM APP_ACT_COE_PAL_REPOSITORY WHERE ID=?", uuid);
|
||||
if (rowMap != null) {
|
||||
String plname = rowMap.getString("PLNAME");
|
||||
|
||||
//先执行新建操作产生plid
|
||||
PALRepository coeProcessLevel = CoeProcessLevelDaoFacotory.createCoeProcessLevel();
|
||||
|
||||
String plRid = UUIDGener.getUUID();
|
||||
String id = UUIDGener.getUUID();
|
||||
|
||||
Timestamp nowTime = new Timestamp(System.currentTimeMillis());
|
||||
PALRepositoryModelImpl model = CoeProcessLevelUtil.createPALRepositoryModel(id, plRid, "6f4e292c-1b90-4dd2-8c20-7da159cb20a5", plname + "表单图",
|
||||
"", 1, "data", "data", true, 1,
|
||||
id, false, "data.form", "0", 1, null,
|
||||
null, "admin", "admin", nowTime, null, uuid,
|
||||
null, null, null, null, null, null, null, 1);;
|
||||
|
||||
|
||||
System.out.println(model.getId());
|
||||
coeProcessLevel.insert(model);
|
||||
|
||||
|
||||
BaseModel defineModel = CoeDesignerAPIManager.getInstance().getDefinition(model.getId(), 0);
|
||||
if (defineModel == null) {
|
||||
defineModel = CoeDesignerUtil.createModel(model.getId(), 0);
|
||||
defineModel.setCreateHistory(false);
|
||||
}
|
||||
|
||||
String define = defineModel.getDefinition();
|
||||
JSONObject definition = JSONObject.parseObject(define);
|
||||
JSONObject elements = definition.getJSONObject("elements");
|
||||
|
||||
//新建一个uuid
|
||||
String shapeId = UUIDGener.getObjectId();
|
||||
|
||||
|
||||
//拿到基础结构
|
||||
JSONObject shape = ShapeUtils.getProcessShapeDefinitionByName("data.form", "form");
|
||||
shape.put("id", shapeId);
|
||||
shape.put("text", "表单图");
|
||||
|
||||
JSONObject props = shape.getJSONObject("props");// 位置大小
|
||||
props.put("zindex", 0);
|
||||
props.put("x", Integer.parseInt("400"));
|
||||
props.put("y", Integer.parseInt("106"));
|
||||
props.put("w", Integer.parseInt("110"));
|
||||
props.put("h", Integer.parseInt("50"));
|
||||
props.put("zindex", 1);
|
||||
elements.put(shapeId, shape);
|
||||
|
||||
// 设置画布大小
|
||||
DiagramUtil.setDiagramHeightWidth(definition, elements);
|
||||
defineModel.setDefinition(definition.toString());
|
||||
// 保存文件
|
||||
CoeDesignerAPIManager.getInstance().storeDefinition(defineModel);// dao操作
|
||||
|
||||
ro.put("uuid", id);
|
||||
ro.put("result", "ok");
|
||||
}
|
||||
} catch (NumberFormatException e) {
|
||||
e.printStackTrace();
|
||||
ro.put("result","error");
|
||||
}
|
||||
|
||||
return ro.toString();
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 查找关联角色/绩效数据
|
||||
* @param uuid
|
||||
* @return
|
||||
*/
|
||||
public String relationFindSameRole(String uuid){
|
||||
public String relationFindSameRole(String uuid,String methodId){
|
||||
ResponseObject ro = ResponseObject.newOkResponse();
|
||||
RowMap rowMap=DBSql.getMap("SELECT EXT2 FROM APP_ACT_COE_PAL_REPOSITORY WHERE EXT2=?",uuid);
|
||||
RowMap rowMap=DBSql.getMap("SELECT EXT2 FROM APP_ACT_COE_PAL_REPOSITORY WHERE EXT2=? AND PLMETHODID=?",uuid,methodId);
|
||||
if(rowMap!=null){
|
||||
ro.put("result", "ok");
|
||||
}else{
|
||||
|
||||
@ -160,7 +160,6 @@
|
||||
<ul id="buttons" style="margin-top:10px;" class="clearfix">
|
||||
<li class="attr_more" ></li>
|
||||
<li><span title="点击打开附件管理" id="upfile" class="button">附件</span></li>
|
||||
<li><span title="弹出在线编辑弹窗" id="onlineEdit" class="button">在线编辑</span></li>
|
||||
</ul>
|
||||
<div title="" style="width:250px;display:none;" id="attr_dialog-normal">
|
||||
<div id='attr_content' style='margin:10px;height:280px;'>
|
||||
|
||||
@ -870,6 +870,7 @@ function openTextareaDialog(obj, title,id) {
|
||||
// 打开文件属性表格弹框
|
||||
|
||||
function showTableDialog(obj,value,id) {
|
||||
debugger;
|
||||
let tableRef = JSON.parse($(obj).attr('ref'))
|
||||
let tableName = $(obj).attr('tableTitle')
|
||||
let tableList = []
|
||||
@ -965,72 +966,173 @@ function removeTr(obj) {
|
||||
|
||||
//打开对象关联Dialog
|
||||
function openRelationDialog(obj, callback) {
|
||||
debugger;
|
||||
var title = obj.closest('tr').find('td:first').text();
|
||||
if (title == undefined || title == '') {
|
||||
title = '选择模型对象';
|
||||
}
|
||||
var ref = obj.attr('ref');// 存储关联范围配置
|
||||
var relationDlg = parent.FrmDialog.open({
|
||||
title: title,
|
||||
width:710,
|
||||
height: 400,
|
||||
url:"./w",
|
||||
data:{
|
||||
sid: $("#sid").val(),
|
||||
cmd: "com.actionsoft.apps.coe.pal_pl_repository_designer_shapes_tree",
|
||||
wsId: $("#wsid").val(),
|
||||
ref: ref,
|
||||
shapeId: "",
|
||||
attrId: obj.attr("id"),
|
||||
relationShapeIds: obj.attr("relationShapeId"),
|
||||
relationFileIds: obj.attr("relationFileId"),
|
||||
modelId: $("#id").val(),
|
||||
ruuid: uuid
|
||||
},
|
||||
id:"relationDialog",
|
||||
buttons: [
|
||||
{text:'确定',cls:"blue",handler:function(){
|
||||
var attrId = obj.attr("id");
|
||||
var relationFileId = "";
|
||||
var relationShapeId = "";
|
||||
var relationShapeText = "";
|
||||
var relations = relationDlg.win().getRelationShapeInfos();
|
||||
var isRequired = obj.attr('isRequired')
|
||||
if (isRequired == 'true' && relations.length == 0) {
|
||||
obj.val('');
|
||||
obj.attr('placeholder',title +'不能为空')
|
||||
obj.addClass("required_input_css");
|
||||
parent.FrmDialog.close("relationDialog");
|
||||
return;
|
||||
var method=JSON.parse(ref).method;
|
||||
if(method=="process" ){
|
||||
var relationDlg = parent.FrmDialog.open({
|
||||
title: title,
|
||||
width:710,
|
||||
height: 400,
|
||||
url:"./w",
|
||||
data:{
|
||||
sid: $("#sid").val(),
|
||||
cmd: "com.actionsoft.apps.coe.pal_pl_repository_designer_shapes_tree",
|
||||
wsId: $("#wsid").val(),
|
||||
ref: ref,
|
||||
shapeId: "",
|
||||
attrId: obj.attr("id"),
|
||||
relationShapeIds: obj.attr("relationShapeId"),
|
||||
relationFileIds: obj.attr("relationFileId"),
|
||||
modelId: $("#id").val(),
|
||||
ruuid: uuid
|
||||
},
|
||||
id:"relationDialog",
|
||||
buttons: [
|
||||
{
|
||||
text : '刷新',
|
||||
cls : "yellow",
|
||||
handler : function() {
|
||||
// 刷新页面
|
||||
document.getElementById("id-awsui-win-frm-2013-frmrelationDialog").contentWindow.location.reload(true);
|
||||
}
|
||||
if (relations != undefined && relations.length > 0) {
|
||||
for(var i = 0; i < relations.length; i++) {
|
||||
var relationShape = relations[i];
|
||||
if(i == relations.length -1) {
|
||||
relationFileId += relationShape.relationFileId;
|
||||
relationShapeId += relationShape.relationShapeId;
|
||||
relationShapeText += relationShape.relationShapeText;
|
||||
} else {
|
||||
relationFileId += relationShape.relationFileId + ",";
|
||||
relationShapeId += relationShape.relationShapeId + ",";
|
||||
relationShapeText += relationShape.relationShapeText + ",";
|
||||
},{
|
||||
text : "新建表单模型",
|
||||
cls : "green",
|
||||
handler : function() {
|
||||
//跳转角色/绩效图形,并新增角色/绩效图形
|
||||
$.ajax({
|
||||
type : "POST",
|
||||
url : "./jd?sid="
|
||||
+ $("#sid").val()
|
||||
+ "&cmd=com.actionsoft.apps.coe.pal_pl_repository_designer_relation_shape_createFormDialogModel",
|
||||
data : {
|
||||
uuid:uuid,
|
||||
method:method
|
||||
},
|
||||
success : function(msg) {
|
||||
if (msg.result == "ok") {
|
||||
window.open("./w?uuid=" + msg.data.uuid+"&teamId"
|
||||
+ "&cmd=com.actionsoft.apps.coe.pal_pl_repository_designer&sid=" + encodeURIComponent($('#sid').val()));
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
{text:'确定',cls:"blue",handler:function(){
|
||||
var attrId = obj.attr("id");
|
||||
var relationFileId = "";
|
||||
var relationShapeId = "";
|
||||
var relationShapeText = "";
|
||||
var relations = relationDlg.win().getRelationShapeInfos();
|
||||
var isRequired = obj.attr('isRequired')
|
||||
if (isRequired == 'true' && relations.length == 0) {
|
||||
obj.val('');
|
||||
obj.attr('placeholder',title +'不能为空')
|
||||
obj.addClass("required_input_css");
|
||||
parent.FrmDialog.close("relationDialog");
|
||||
return;
|
||||
}
|
||||
if (relations != undefined && relations.length > 0) {
|
||||
for(var i = 0; i < relations.length; i++) {
|
||||
var relationShape = relations[i];
|
||||
if(i == relations.length -1) {
|
||||
relationFileId += relationShape.relationFileId;
|
||||
relationShapeId += relationShape.relationShapeId;
|
||||
relationShapeText += relationShape.relationShapeText;
|
||||
} else {
|
||||
relationFileId += relationShape.relationFileId + ",";
|
||||
relationShapeId += relationShape.relationShapeId + ",";
|
||||
relationShapeText += relationShape.relationShapeText + ",";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
obj.attr("attrId", attrId);
|
||||
obj.attr("relationFileId", relationFileId);
|
||||
obj.attr("relationShapeId", relationShapeId);
|
||||
obj.val(relationShapeText);
|
||||
if (callback && callback == "saveContent") {
|
||||
saveContent(obj);
|
||||
}
|
||||
parent.FrmDialog.close("relationDialog");
|
||||
}},
|
||||
{text:'取消',handler:function(){
|
||||
parent.FrmDialog.close("relationDialog");
|
||||
}}
|
||||
]
|
||||
});
|
||||
obj.attr("attrId", attrId);
|
||||
obj.attr("relationFileId", relationFileId);
|
||||
obj.attr("relationShapeId", relationShapeId);
|
||||
obj.val(relationShapeText);
|
||||
if (callback && callback == "saveContent") {
|
||||
saveContent(obj);
|
||||
}
|
||||
parent.FrmDialog.close("relationDialog");
|
||||
}},
|
||||
{text:'取消',handler:function(){
|
||||
parent.FrmDialog.close("relationDialog");
|
||||
}}
|
||||
]
|
||||
});
|
||||
}else{
|
||||
var relationDlg = parent.FrmDialog.open({
|
||||
title: title,
|
||||
width:710,
|
||||
height: 400,
|
||||
url:"./w",
|
||||
data:{
|
||||
sid: $("#sid").val(),
|
||||
cmd: "com.actionsoft.apps.coe.pal_pl_repository_designer_shapes_tree",
|
||||
wsId: $("#wsid").val(),
|
||||
ref: ref,
|
||||
shapeId: "",
|
||||
attrId: obj.attr("id"),
|
||||
relationShapeIds: obj.attr("relationShapeId"),
|
||||
relationFileIds: obj.attr("relationFileId"),
|
||||
modelId: $("#id").val(),
|
||||
ruuid: uuid
|
||||
},
|
||||
id:"relationDialog",
|
||||
|
||||
buttons: [
|
||||
{text:'确定',cls:"blue",handler:function(){
|
||||
var attrId = obj.attr("id");
|
||||
var relationFileId = "";
|
||||
var relationShapeId = "";
|
||||
var relationShapeText = "";
|
||||
var relations = relationDlg.win().getRelationShapeInfos();
|
||||
var isRequired = obj.attr('isRequired')
|
||||
if (isRequired == 'true' && relations.length == 0) {
|
||||
obj.val('');
|
||||
obj.attr('placeholder',title +'不能为空')
|
||||
obj.addClass("required_input_css");
|
||||
parent.FrmDialog.close("relationDialog");
|
||||
return;
|
||||
}
|
||||
if (relations != undefined && relations.length > 0) {
|
||||
for(var i = 0; i < relations.length; i++) {
|
||||
var relationShape = relations[i];
|
||||
if(i == relations.length -1) {
|
||||
relationFileId += relationShape.relationFileId;
|
||||
relationShapeId += relationShape.relationShapeId;
|
||||
relationShapeText += relationShape.relationShapeText;
|
||||
} else {
|
||||
relationFileId += relationShape.relationFileId + ",";
|
||||
relationShapeId += relationShape.relationShapeId + ",";
|
||||
relationShapeText += relationShape.relationShapeText + ",";
|
||||
}
|
||||
}
|
||||
}
|
||||
obj.attr("attrId", attrId);
|
||||
obj.attr("relationFileId", relationFileId);
|
||||
obj.attr("relationShapeId", relationShapeId);
|
||||
obj.val(relationShapeText);
|
||||
if (callback && callback == "saveContent") {
|
||||
saveContent(obj);
|
||||
}
|
||||
parent.FrmDialog.close("relationDialog");
|
||||
}},
|
||||
{text:'取消',handler:function(){
|
||||
parent.FrmDialog.close("relationDialog");
|
||||
}}
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function selectAttrTabTag(showContent, selfObj) {
|
||||
|
||||
@ -85,6 +85,7 @@ function openDefaultNode() {
|
||||
|
||||
// 新建层次 打开对话框
|
||||
function createProcessLevel(wd, wsid, parentid, id) {
|
||||
debugger;
|
||||
var title = "";
|
||||
if (id == undefined) {
|
||||
id = 0;
|
||||
|
||||
@ -3421,6 +3421,7 @@ function getRelevanceAwsOrgNameByShapeId(objIds, shapeId) {
|
||||
|
||||
// 形状关联弹窗
|
||||
function openRelationDig(obj,value) {
|
||||
debugger;
|
||||
var shapeRelationValue = $("input[objid_shapeId='" + $(obj).attr("objid") + "']").val();
|
||||
var ref = $("input[objid_shapeId='" + $(obj).attr("objid") + "']").attr("ref"); // shape file shapeAndFile
|
||||
var relationShapeIds = '';
|
||||
@ -3453,7 +3454,7 @@ function openRelationDig(obj,value) {
|
||||
+ "&relationFileIds=" + relationFileIds
|
||||
+ "&ruuid=" + ruuid);
|
||||
|
||||
//根据角色/绩效图形,并新增对应图形
|
||||
//根据角色
|
||||
$.ajax({
|
||||
type : "POST",
|
||||
url : "./jd?sid="
|
||||
@ -3461,18 +3462,10 @@ function openRelationDig(obj,value) {
|
||||
+ "&cmd=com.actionsoft.apps.coe.pal_pl_repository_designer_relation_find_same_role",
|
||||
data : {
|
||||
uuid:ruuid,
|
||||
method:JSON.parse(ref).method
|
||||
methodId:methodId
|
||||
},
|
||||
success : function(msg) {
|
||||
|
||||
var modelname="";
|
||||
if(methodId=="control.kpi"){
|
||||
modelname="新建绩效模型";
|
||||
} else if(methodId=="org.role"){
|
||||
modelname="新建角色模型";
|
||||
} else if(methodId=="data.form"){
|
||||
modelname="新建表单模型";
|
||||
}
|
||||
|
||||
|
||||
if (msg.data.result == "ok" ) {
|
||||
$("#attr_dialog_normal_relevance_shapes_div").dialog({
|
||||
@ -3504,7 +3497,7 @@ function openRelationDig(obj,value) {
|
||||
}
|
||||
}]
|
||||
});
|
||||
}else if(msg.data.result == "error" && (methodId=="control.kpi" || methodId=="org.role")){
|
||||
}else{
|
||||
|
||||
$("#attr_dialog_normal_relevance_shapes_div").dialog({
|
||||
buttons : [
|
||||
@ -3516,10 +3509,10 @@ function openRelationDig(obj,value) {
|
||||
document.getElementById("attr_content_iframe_relevance_shapes").contentWindow.location.reload(true);
|
||||
}
|
||||
},{
|
||||
text : modelname,
|
||||
text : "新建角色模型",
|
||||
cls : "green",
|
||||
handler : function() {
|
||||
//跳转角色/绩效图形,并新增角色/绩效图形
|
||||
//跳转角色
|
||||
$.ajax({
|
||||
type : "POST",
|
||||
url : "./jd?sid="
|
||||
|
||||
Loading…
Reference in New Issue
Block a user