Merge remote-tracking branch 'origin/master' into datamigration-word
# Conflicts: # com.actionsoft.apps.coe.pal.datamigration/src/com/actionsoft/apps/coe/pal/datamigration/DataMigrationController.java # com.actionsoft.apps.coe.pal.datamigration/src/com/actionsoft/apps/coe/pal/datamigration/util/readword/WordFinal.java # com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/pal/repository/util/CoeProcessLevelUtil.java
This commit is contained in:
commit
1c5c532317
@ -22,15 +22,16 @@
|
|||||||
<attribute key="output" title="输出" type="textarea" value="" ref="" readonly="false" groupPath="baseAttribute" scope="*" isValid="true"/>
|
<attribute key="output" title="输出" type="textarea" value="" ref="" readonly="false" groupPath="baseAttribute" scope="*" isValid="true"/>
|
||||||
<attribute key="R_relevant_flies" title="相关文件" type="relation" value="" ref="{"method":"process","type":"file","multiple":false}" readonly="true" groupPath="process_model" scope="%" isValid="true"/>
|
<attribute key="R_relevant_flies" title="相关文件" type="relation" value="" ref="{"method":"process","type":"file","multiple":false}" readonly="true" groupPath="process_model" scope="%" isValid="true"/>
|
||||||
<attribute key="support_files" title="支持文件" type="relation" value="" ref="{"method":"process","type":"shape","multiple":false,"value":""}" readonly="true" groupPath="process_model" scope="%" isValid="true"/>
|
<attribute key="support_files" title="支持文件" type="relation" value="" ref="{"method":"process","type":"shape","multiple":false,"value":""}" readonly="true" groupPath="process_model" scope="%" isValid="true"/>
|
||||||
<attribute key="term" title="术语" type="table" value="" desc="术语" isRequired="false" ref="" readonly="false" groupPath="process_model" scope="%" isValid="true"/>
|
|
||||||
<attribute key="Organizational_role" title="组织角色" type="table" value="" desc="组织角色" isRequired="false" ref="" readonly="false" groupPath="process_model" scope="%" isValid="true"/>
|
|
||||||
<attribute key="relevant_flies" title="相关知识" type="link" value="" desc="相关知识" isRequired="false" ref="" readonly="false" groupPath="process_model" scope="%" isValid="true"/>
|
<attribute key="relevant_flies" title="相关知识" type="link" value="" desc="相关知识" isRequired="false" ref="" readonly="false" groupPath="process_model" scope="%" isValid="true"/>
|
||||||
<attribute key="Process_owner" title="流程责任人" type="awsorg" value="" desc="流程责任人" isRequired="false" ref="{"scope":["user"],"multiple":false}" readonly="true" groupPath="process_model" scope="%" isValid="true"/>
|
<attribute key="Process_owner" title="流程责任人" type="awsorg" value="" desc="流程责任人" isRequired="false" ref="{"scope":["user"],"multiple":false}" readonly="true" groupPath="process_model" scope="%" isValid="true"/>
|
||||||
<attribute key="Issuing_department" title="发布部门" type="awsorg" value="" desc="发布部门" isRequired="false" ref="{"scope":["department"],"multiple":false}" readonly="true" groupPath="process_model" scope="%" isValid="true"/>
|
<attribute key="Issuing_department" title="发布部门" type="awsorg" value="" desc="发布部门" isRequired="false" ref="{"scope":["department"],"multiple":false}" readonly="true" groupPath="process_model" scope="%" isValid="true"/>
|
||||||
<attribute key="effective_date" title="生效日期" type="DateTimePicker" value="" desc="生效日期" isRequired="false" ref="" readonly="false" groupPath="process_model" scope="%" isValid="true"/>
|
<attribute key="effective_date" title="生效日期" type="DateTimePicker" value="" desc="生效日期" isRequired="false" ref="" readonly="false" groupPath="process_model" scope="%" isValid="true"/>
|
||||||
<attribute key="role" title="角色" type="awsorg" value="" desc="角色" isRequired="false" ref="{"scope":["role"],"multiple":false}" readonly="true" groupPath="baseAttribute" scope="*" isValid="true"/>
|
|
||||||
<attribute key="post" title="岗位" type="awsorg" value="" desc="岗位" isRequired="false" ref="{"scope":["position"],"multiple":false}" readonly="true" groupPath="baseAttribute" scope="*" isValid="true"/>
|
|
||||||
<attribute key="input" title="输入" type="textarea" value="" desc="输入" isRequired="false" ref="" readonly="false" groupPath="baseAttribute" scope="*" isValid="true"/>
|
<attribute key="input" title="输入" type="textarea" value="" desc="输入" isRequired="false" ref="" readonly="false" groupPath="baseAttribute" scope="*" isValid="true"/>
|
||||||
<attribute key="information_systems" title="信息系统" type="string" value="" desc="信息系统" isRequired="false" ref="" readonly="false" groupPath="baseAttribute" scope="*" isValid="true"/>
|
<attribute key="relevant_demand" title="相关要求" type="relation" value="" desc="相关要求" isRequired="false" ref="{"method":"itsystem","type":"shape","multiple":false,"value":""}" readonly="true" groupPath="baseAttribute" scope="*" isValid="true"/>
|
||||||
<attribute key="relevant_demand" title="相关要求" type="relation" value="" desc="相关要求" isRequired="false" ref="{"method":"itsystem","type":"shape","multiple":false,"value":""}" readonly="true" groupPath="baseAttribute" scope="*" isValid="true"/>
|
<attribute key="post" title="岗位" type="relation" value="" desc="岗位" isRequired="false" ref="{"method":"org.normal","type":"shape","multiple":false,"value":""}" readonly="true" groupPath="baseAttribute" scope="*" isValid="true"/>
|
||||||
|
<attribute key="role" title="角色" type="relation" value="" desc="角色" isRequired="false" ref="{"method":"org.normal","type":"shape","multiple":false}" readonly="true" groupPath="baseAttribute" scope="*" isValid="true"/>
|
||||||
|
<attribute key="term" title="术语" type="table" value="" desc="术语" isRequired="false" ref="{"firstColumn":"Listing1","secondColumn":"Listing2"}" readonly="false" groupPath="process_model" scope="*" isValid="true"/>
|
||||||
|
<attribute key="Organizational_role" title="组织角色" type="table" value="" desc="组织角色" isRequired="false" ref="{"firstColumn":"Listing1","secondColumn":"Listing2"}" readonly="false" groupPath="process_model" scope="*" isValid="true"/>
|
||||||
|
<attribute key="post_text" title="岗位" type="string" value="" desc="岗位" isRequired="false" ref="" readonly="false" groupPath="baseAttribute" scope="*" isValid="true"/>
|
||||||
|
<attribute key="information_systems" title="信息系统" type="relation" value="" desc="信息系统" isRequired="false" ref="{"method":"itsystem.normal","type":"shape","multiple":false,"value":""}" readonly="true" groupPath="baseAttribute" scope="*" isValid="true"/>
|
||||||
</attributes>
|
</attributes>
|
||||||
|
|||||||
@ -5,10 +5,7 @@ import com.actionsoft.apps.coe.pal.constant.CoEConstant;
|
|||||||
import com.actionsoft.apps.coe.pal.cooperation.aslp.ListApps;
|
import com.actionsoft.apps.coe.pal.cooperation.aslp.ListApps;
|
||||||
import com.actionsoft.apps.coe.pal.cooperation.cache.model.TeamInfo;
|
import com.actionsoft.apps.coe.pal.cooperation.cache.model.TeamInfo;
|
||||||
import com.actionsoft.apps.coe.pal.cooperation.cache.model.UserInfo;
|
import com.actionsoft.apps.coe.pal.cooperation.cache.model.UserInfo;
|
||||||
import com.actionsoft.apps.coe.pal.cooperation.dao.CoeCooperationMemberDao;
|
import com.actionsoft.apps.coe.pal.cooperation.dao.*;
|
||||||
import com.actionsoft.apps.coe.pal.cooperation.dao.CoeCooperationRoleDao;
|
|
||||||
import com.actionsoft.apps.coe.pal.cooperation.dao.CoeCooperationRolePermDao;
|
|
||||||
import com.actionsoft.apps.coe.pal.cooperation.dao.CoeCooperationTeamDao;
|
|
||||||
import com.actionsoft.apps.coe.pal.cooperation.extend.CooperationAppManager;
|
import com.actionsoft.apps.coe.pal.cooperation.extend.CooperationAppManager;
|
||||||
import com.actionsoft.apps.coe.pal.cooperation.extend.CooperationAppProfile;
|
import com.actionsoft.apps.coe.pal.cooperation.extend.CooperationAppProfile;
|
||||||
import com.actionsoft.apps.coe.pal.cooperation.model.CoeCooperationMemberModel;
|
import com.actionsoft.apps.coe.pal.cooperation.model.CoeCooperationMemberModel;
|
||||||
@ -144,59 +141,6 @@ public class CooperationQueryAPIManager {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<TeamInfo> getAllTeamInfo(){
|
|
||||||
List<TeamInfo> list = new ArrayList<>();
|
|
||||||
|
|
||||||
List<CoeCooperationTeamModel> allTeam = new CoeCooperationTeamDao().getAllTeam();
|
|
||||||
for (CoeCooperationTeamModel teamModel : allTeam) {
|
|
||||||
TeamInfo teamInfo = new TeamInfo();
|
|
||||||
teamInfo.setTeamId(teamModel.getId());
|
|
||||||
List<UserInfo> userInfos = this.getUserInfoByTeamId(teamModel.getId());
|
|
||||||
teamInfo.setUsers(userInfos);
|
|
||||||
list.add(teamInfo);
|
|
||||||
}
|
|
||||||
return list;
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<UserInfo> getUserInfoByTeamId(String teamId){
|
|
||||||
List<UserInfo> list = new ArrayList<>();
|
|
||||||
|
|
||||||
List<CoeCooperationMemberModel> memberModels = new CoeCooperationMemberDao().queryUserListByTeam(teamId);
|
|
||||||
for (CoeCooperationMemberModel memberModel : memberModels) {
|
|
||||||
UserInfo userInfo = new UserInfo();
|
|
||||||
userInfo.setUserid(memberModel.getUserId());
|
|
||||||
userInfo.getRoleIds().add(memberModel.getRoleId());
|
|
||||||
|
|
||||||
//获取角色信息,设置全局权限
|
|
||||||
CoeCooperationRoleModel roleModel = new CoeCooperationRoleDao().queryById(memberModel.getRoleId());
|
|
||||||
userInfo.setAppPermission( roleModel.getAppPerm());
|
|
||||||
List<String> actionPermList = Arrays.stream(roleModel.getActionPerm().split(",")).collect(Collectors.toList());
|
|
||||||
userInfo.getOperatePermission().addAll(actionPermList);
|
|
||||||
//设置全部数据权限
|
|
||||||
userInfo.setIsAllDataPermission(roleModel.getDataPerm().equals("all"));
|
|
||||||
|
|
||||||
if (!userInfo.getIsAllDataPermission()){
|
|
||||||
//获取角色下数据权限,设置数据权限
|
|
||||||
List<CoeCooperationRolePermModel> rolePerms = new CoeCooperationRolePermDao().getRolePermByTeamIdAndRoleId(teamId, memberModel.getRoleId());
|
|
||||||
for (CoeCooperationRolePermModel rolePerm : rolePerms) {
|
|
||||||
Set<String> dataPerm = userInfo.getDataPermission().get(rolePerm.getPalVersionId());
|
|
||||||
if (null == dataPerm){
|
|
||||||
dataPerm = new HashSet<>();
|
|
||||||
}
|
|
||||||
if (StringUtils.isNotEmpty(rolePerm.getActionPerm())){
|
|
||||||
dataPerm.addAll(Arrays.asList(rolePerm.getActionPerm().split(",").clone()));
|
|
||||||
}
|
|
||||||
userInfo.getDataPermission().put(rolePerm.getPalVersionId(), dataPerm);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
list.add(userInfo);
|
|
||||||
}
|
|
||||||
|
|
||||||
return list;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据父节点获取权限范围内的子流程(小组权限范围内)
|
* 根据父节点获取权限范围内的子流程(小组权限范围内)
|
||||||
* @param wsId
|
* @param wsId
|
||||||
|
|||||||
@ -32,8 +32,6 @@ public class Plugins implements PluginListener {
|
|||||||
params2.put("deletedClass", "");
|
params2.put("deletedClass", "");
|
||||||
list.add(new AppExtensionProfile("PAL小组->回收站", "aslp://com.actionsoft.apps.coe.pal.cooperation/registerApp", params2));
|
list.add(new AppExtensionProfile("PAL小组->回收站", "aslp://com.actionsoft.apps.coe.pal.cooperation/registerApp", params2));
|
||||||
|
|
||||||
//小组用户权限信息cache
|
|
||||||
list.add(new CachePluginProfile(CooperationCache.class));
|
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -0,0 +1 @@
|
|||||||
|
CREATE TABLE APP_ACT_COE_PAL_DATAM_LOG(ID CHAR(36) NOT NULL ,WSID CHAR(36),FILENAME VARCHAR(100), FILEPATH VARCHAR(500), LOGPATH VARCHAR(500), CREATEUSER VARCHAR(20),CREATEUSERNAME VARCHAR(20),CREATEDATE DATETIME, STARTDATE DATETIME, ENDDATE DATETIME, RESULTSTATUS SMALLINT(1), MAININFO VARCHAR(500), EXT1 VARCHAR(64),EXT2 VARCHAR(128),EXT3 VARCHAR(255),EXT4 VARCHAR(255) ,CONSTRAINT APP_ACT_COE_PAL_DATAM_LOG_PK PRIMARY KEY (ID));
|
||||||
@ -0,0 +1 @@
|
|||||||
|
CREATE TABLE APP_ACT_COE_PAL_DATAM_LOG(ID CHAR(36) NOT NULL ,WSID CHAR(36),FILENAME NVARCHAR2(100), FILEPATH NVARCHAR2(500), LOGPATH NVARCHAR2(500), CREATEUSER NVARCHAR2(20),CREATEUSERNAME NVARCHAR2(20), CREATEDATE DATE, STARTDATE DATE, ENDDATE DATE, RESULTSTATUS NUMBER(1), MAININFO NVARCHAR2(500), EXT1 NVARCHAR2(64),EXT2 NVARCHAR2(128),EXT3 NVARCHAR2(255),EXT4 NVARCHAR2(255) ,CONSTRAINT APP_ACT_COE_PAL_DATAM_LOG_PK PRIMARY KEY (ID));
|
||||||
Binary file not shown.
BIN
com.actionsoft.apps.coe.pal.datamigration/lib/lombok-1.18.16.jar
Normal file
BIN
com.actionsoft.apps.coe.pal.datamigration/lib/lombok-1.18.16.jar
Normal file
Binary file not shown.
@ -9,6 +9,15 @@ import com.actionsoft.bpms.server.bind.annotation.Mapping;
|
|||||||
@Controller
|
@Controller
|
||||||
public class DataMigrationController {
|
public class DataMigrationController {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 数据迁移
|
||||||
|
* @param uc
|
||||||
|
* @param wsId
|
||||||
|
* @param groupValue
|
||||||
|
* @param fileValue
|
||||||
|
* @param fileName
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
@Mapping("com.actionsoft.apps.coe.pal.datamigration_data_migrate")
|
@Mapping("com.actionsoft.apps.coe.pal.datamigration_data_migrate")
|
||||||
public String dataMigrate(UserContext uc, String wsId,String groupValue,String fileValue,String fileName) {
|
public String dataMigrate(UserContext uc, String wsId,String groupValue,String fileValue,String fileName) {
|
||||||
return new DataMigrationWeb(uc).dataMigrate(wsId,groupValue,fileValue,fileName);
|
return new DataMigrationWeb(uc).dataMigrate(wsId,groupValue,fileValue,fileName);
|
||||||
|
|||||||
@ -0,0 +1,16 @@
|
|||||||
|
package com.actionsoft.apps.coe.pal.datamigration.aris.constant;
|
||||||
|
|
||||||
|
public class ArisConstant {
|
||||||
|
|
||||||
|
public final static String REPOSITORY_NAME = "arisXML";// aris xml文件导入dc根目录
|
||||||
|
|
||||||
|
public final static String UPFILE = "upfile";// aris xml文件上传根目录,在REPOSITORY_NAME之下
|
||||||
|
|
||||||
|
public final static String LOG_GROUP_VALUE = "log";// aris xml文件导入日志根目录,在REPOSITORY_NAME之下
|
||||||
|
|
||||||
|
public final static String IMPORT_LOG_FILE_SIMPLE = "simpleImport.log";// 简要日志,展示给前端,体现大致的导入内容和进度
|
||||||
|
public final static String IMPORT_LOG_FILE_FULL = "fullImport.log";// 详细日志,包括全量信息内容
|
||||||
|
public final static String IMPORT_LOG_FILE_WARN = "warnErrImport.log";// 错误&警告日志,单独记录错误&警告日志,同时详细日志中也有记录
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@ -24,12 +24,12 @@ public class XMLUtil {
|
|||||||
* @param fromFilePath
|
* @param fromFilePath
|
||||||
* @param toFilePath
|
* @param toFilePath
|
||||||
*/
|
*/
|
||||||
public static void unicode2String(String fromFilePath, String toFilePath) {
|
public static void unicode2String(String fromFilePath, String toFilePath) throws DocumentException, FileNotFoundException{
|
||||||
Document d = XMLUtil.readXML(fromFilePath, true);
|
Document d = XMLUtil.readXML(fromFilePath, true);
|
||||||
XMLUtil.writeXml(d, toFilePath);
|
XMLUtil.writeXml(d, toFilePath);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Document readXML(String filePath, boolean ignoreDtd) {
|
public static Document readXML(String filePath, boolean ignoreDtd) throws DocumentException, FileNotFoundException {
|
||||||
if (filePath == null) {
|
if (filePath == null) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@ -60,16 +60,12 @@ public class XMLUtil {
|
|||||||
|
|
||||||
return document;
|
return document;
|
||||||
} catch (DocumentException e) {
|
} catch (DocumentException e) {
|
||||||
File fil = new File(filePath);
|
e.printStackTrace();
|
||||||
try {
|
throw e;
|
||||||
document = reader.read(fil);
|
|
||||||
} catch (Exception e1) {
|
|
||||||
|
|
||||||
}
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
|
throw e;
|
||||||
}
|
}
|
||||||
return null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Document readXMLFromInputStream(InputStream in) {
|
public static Document readXMLFromInputStream(InputStream in) {
|
||||||
|
|||||||
@ -2,12 +2,15 @@ package com.actionsoft.apps.coe.pal.datamigration.aris.web;
|
|||||||
|
|
||||||
import com.actionsoft.apps.coe.pal.datamigration.aris.mapping.ModelMappingAPIManager;
|
import com.actionsoft.apps.coe.pal.datamigration.aris.mapping.ModelMappingAPIManager;
|
||||||
import com.actionsoft.apps.coe.pal.datamigration.aris.model.*;
|
import com.actionsoft.apps.coe.pal.datamigration.aris.model.*;
|
||||||
|
import com.actionsoft.apps.coe.pal.datamigration.constant.Constant;
|
||||||
|
import com.actionsoft.apps.coe.pal.datamigration.util.LogUtil;
|
||||||
import com.actionsoft.bpms.util.UtilString;
|
import com.actionsoft.bpms.util.UtilString;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import org.apache.commons.lang.StringUtils;
|
import org.apache.commons.lang.StringUtils;
|
||||||
import org.dom4j.Document;
|
import org.dom4j.Document;
|
||||||
import org.dom4j.Element;
|
import org.dom4j.Element;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -29,22 +32,22 @@ public class ArisXmlHandleWeb {
|
|||||||
|
|
||||||
public Map<String, Set<String>> objDefLinkerMap = new HashMap<>();// 记录所有定义形状的连线map记录
|
public Map<String, Set<String>> objDefLinkerMap = new HashMap<>();// 记录所有定义形状的连线map记录
|
||||||
|
|
||||||
|
|
||||||
// 连线 todo
|
|
||||||
|
|
||||||
// 属性 todo
|
|
||||||
|
|
||||||
// 处理文档
|
// 处理文档
|
||||||
public void handleXmlDoc(Document doc) {
|
public void handleXmlDoc(Document doc) throws Exception{
|
||||||
// 获取根元素节点
|
try {
|
||||||
Element root = doc.getRootElement();
|
// 获取根元素节点
|
||||||
String groupPath = "/";
|
Element root = doc.getRootElement();
|
||||||
getNodes(root, groupPath);
|
String groupPath = "/";
|
||||||
// 整合Model路径
|
getNodes(root, groupPath);
|
||||||
calculateModelPath();
|
// 整合Model路径
|
||||||
// 计算定义形状之间的连线
|
calculateModelPath();
|
||||||
calculateObjDefLinker();
|
// 计算定义形状之间的连线
|
||||||
test();
|
calculateObjDefLinker();
|
||||||
|
// test();
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,375 @@
|
|||||||
|
package com.actionsoft.apps.coe.pal.datamigration.aris.web;
|
||||||
|
|
||||||
|
import com.actionsoft.apps.coe.pal.constant.CoEConstant;
|
||||||
|
import com.actionsoft.apps.coe.pal.datamigration.aris.constant.ArisConstant;
|
||||||
|
import com.actionsoft.apps.coe.pal.datamigration.aris.model.*;
|
||||||
|
import com.actionsoft.apps.coe.pal.datamigration.aris.util.XMLUtil;
|
||||||
|
import com.actionsoft.apps.coe.pal.datamigration.constant.Constant;
|
||||||
|
import com.actionsoft.apps.coe.pal.datamigration.log.cache.LogRealTimeCountCache;
|
||||||
|
import com.actionsoft.apps.coe.pal.datamigration.log.model.LogModel;
|
||||||
|
import com.actionsoft.apps.coe.pal.datamigration.log.model.LogRealTimeCountModel;
|
||||||
|
import com.actionsoft.apps.coe.pal.datamigration.util.LogUtil;
|
||||||
|
import com.actionsoft.apps.coe.pal.datamigration.util.ShapeUtil;
|
||||||
|
import com.actionsoft.apps.coe.pal.pal.method.model.PALMethodAttributeModel;
|
||||||
|
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.designer.CoeDesignerShapeAPIManager;
|
||||||
|
import com.actionsoft.apps.resource.plugin.profile.DCPluginProfile;
|
||||||
|
import com.actionsoft.bpms.commons.mvc.view.ActionWeb;
|
||||||
|
import com.actionsoft.bpms.commons.mvc.view.ResponseObject;
|
||||||
|
import com.actionsoft.bpms.server.UserContext;
|
||||||
|
import com.actionsoft.bpms.server.fs.DCContext;
|
||||||
|
import com.actionsoft.bpms.server.fs.dc.DCProfileManager;
|
||||||
|
import com.actionsoft.bpms.util.UUIDGener;
|
||||||
|
import com.actionsoft.bpms.util.UtilDate;
|
||||||
|
import com.actionsoft.bpms.util.UtilString;
|
||||||
|
import com.actionsoft.i18n.I18nRes;
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import org.dom4j.Document;
|
||||||
|
import org.dom4j.DocumentException;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
import java.io.FileNotFoundException;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.sql.Timestamp;
|
||||||
|
import java.text.SimpleDateFormat;
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
public class ArisXmlImportWeb extends ActionWeb {
|
||||||
|
|
||||||
|
UserContext _uc;
|
||||||
|
|
||||||
|
public ArisXmlImportWeb() {
|
||||||
|
}
|
||||||
|
|
||||||
|
public ArisXmlImportWeb(UserContext uc) {
|
||||||
|
_uc = uc;
|
||||||
|
}
|
||||||
|
|
||||||
|
private String logId;
|
||||||
|
private String logPath;
|
||||||
|
private File simpleLogFile;
|
||||||
|
private File fullLogFile;
|
||||||
|
private File warnLogFile;
|
||||||
|
private String filePath;
|
||||||
|
private String fileName;
|
||||||
|
private long startTime = System.currentTimeMillis();
|
||||||
|
|
||||||
|
// Timestamp startDate = new Timestamp(System.currentTimeMillis());
|
||||||
|
|
||||||
|
|
||||||
|
public void initParams () {
|
||||||
|
logId = UUIDGener.getUUID();// 记录缓存
|
||||||
|
String fileValue = "arisXML-" + new SimpleDateFormat("yyyy-MM-dd-HHmmss").format(new Date()) + "-" + _uc.getUID();
|
||||||
|
// 创建dc目录
|
||||||
|
DCPluginProfile dcProfile = DCProfileManager.getDCProfile(Constant.APP_ID, ArisConstant.REPOSITORY_NAME);
|
||||||
|
DCContext dc = new DCContext(_uc, dcProfile, Constant.APP_ID, ArisConstant.LOG_GROUP_VALUE, fileValue);
|
||||||
|
String dirPath = dc.getPath();
|
||||||
|
File dir = new File(dirPath);
|
||||||
|
dir.mkdirs();
|
||||||
|
simpleLogFile = new File(dirPath, ArisConstant.IMPORT_LOG_FILE_SIMPLE);
|
||||||
|
try {
|
||||||
|
simpleLogFile.createNewFile();
|
||||||
|
} catch (IOException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
fullLogFile = new File(dirPath, ArisConstant.IMPORT_LOG_FILE_FULL);
|
||||||
|
try {
|
||||||
|
fullLogFile.createNewFile();
|
||||||
|
} catch (IOException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
warnLogFile = new File(dirPath, ArisConstant.IMPORT_LOG_FILE_WARN);
|
||||||
|
try {
|
||||||
|
warnLogFile.createNewFile();
|
||||||
|
} catch (IOException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
|
||||||
|
logPath = simpleLogFile.getPath();// 前端实时展示的日志
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建日志记录Model
|
||||||
|
* @param id
|
||||||
|
* @param wsId
|
||||||
|
* @param fileName
|
||||||
|
* @param filePath
|
||||||
|
* @param createDate
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
private void createLogModel(String id, String wsId, String fileName, String filePath, Timestamp createDate) {
|
||||||
|
LogModel model = new LogModel();
|
||||||
|
model.setId(id);
|
||||||
|
model.setWsId(wsId);
|
||||||
|
model.setFileName(fileName);
|
||||||
|
model.setFilePath(filePath);
|
||||||
|
model.setLogPath(logPath);
|
||||||
|
model.setCreateUser(_uc.getUID());
|
||||||
|
model.setCreateUserName(_uc.getUserName());
|
||||||
|
model.setCreateDate(createDate);
|
||||||
|
model.setStartDate(createDate);
|
||||||
|
model.setResultStatus(Constant.LOG_RESULT_StATUS_RUN);
|
||||||
|
model.setMainInfo("导入进行中");
|
||||||
|
// 存储日志db
|
||||||
|
LogUtil.createLog(model);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导入停止时更新日志db状态
|
||||||
|
* @param logFileMsg
|
||||||
|
* @param logDbMsg
|
||||||
|
*/
|
||||||
|
private void updateErrLog(String logFileMsg, String logDbMsg) {
|
||||||
|
// 记录日志
|
||||||
|
LogUtil.appendLog(logFileMsg, simpleLogFile, fullLogFile, warnLogFile);
|
||||||
|
// 日志表记录导入结果
|
||||||
|
LogUtil.updateLog(logId, new Timestamp(System.currentTimeMillis()), Constant.LOG_RESULT_StATUS_ERROR, logDbMsg);
|
||||||
|
// 清空缓存
|
||||||
|
LogRealTimeCountCache.getCache().remove(logId);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 迁移测试
|
||||||
|
*
|
||||||
|
* @param wsId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public String dataMigrate(String wsId, String groupValue, String fileValue, String fileName) {
|
||||||
|
// 初始化一些参数
|
||||||
|
initParams();
|
||||||
|
// 读取dc
|
||||||
|
DCPluginProfile dcProfile = DCProfileManager.getDCProfile(Constant.APP_ID, "migration");// repositoryName要调整新的路径,配合前端, todo
|
||||||
|
DCContext dc = new DCContext(_uc, dcProfile, Constant.APP_ID, groupValue, fileValue, fileName);
|
||||||
|
this.fileName = fileName;
|
||||||
|
this.filePath = dc.getFilePath();
|
||||||
|
Timestamp startDate = new Timestamp(startTime);
|
||||||
|
// 创建日志信息db
|
||||||
|
createLogModel(logId, wsId, fileName, filePath, startDate);
|
||||||
|
LogUtil.appendLog("注:该日志文件存储简要日志信息", simpleLogFile);
|
||||||
|
LogUtil.appendLog("注:该日志文件存储详细日志信息", fullLogFile);
|
||||||
|
LogUtil.appendLog("注:该日志文件记录警告、出错日志信息", warnLogFile);
|
||||||
|
|
||||||
|
LogUtil.appendLog("Aris XML流程导入 Begin " + UtilDate.datetimeFormat(startDate), simpleLogFile, fullLogFile, warnLogFile);
|
||||||
|
|
||||||
|
String msg;
|
||||||
|
|
||||||
|
// 校验资产库是否存在可用
|
||||||
|
boolean isActive = PALRepositoryQueryAPIManager.getInstance().isActiveWorkSpace(wsId);
|
||||||
|
if (!isActive) {
|
||||||
|
msg = Constant.LOG_ERROR + "资产库不存在或已停用," + Constant.IMPORT_STOP_MSG;
|
||||||
|
updateErrLog(msg, msg);
|
||||||
|
return ResponseObject.newErrResponse("资产库不存在或已停用").toString();
|
||||||
|
}
|
||||||
|
LogUtil.appendLog(Constant.LOG_SUCCESS + "校验资产库存在并可用", simpleLogFile, fullLogFile);
|
||||||
|
|
||||||
|
// 校验文件/形状属性配置是否正常
|
||||||
|
ResponseObject checkRo = checkMethodConfig(wsId);
|
||||||
|
if (checkRo.isErr()) {
|
||||||
|
return checkRo.toString();
|
||||||
|
}
|
||||||
|
// 校验文件是否存在
|
||||||
|
File file = new File(dc.getFilePath());
|
||||||
|
if (!file.exists()) {
|
||||||
|
msg = Constant.LOG_ERROR + "上传文件不存在," + Constant.IMPORT_STOP_MSG;
|
||||||
|
updateErrLog(msg, msg);
|
||||||
|
return ResponseObject.newErrResponse("上传文件不存在").toString();
|
||||||
|
}
|
||||||
|
LogUtil.appendLog(Constant.LOG_SUCCESS + "校验上传文件是否存在", simpleLogFile, fullLogFile);
|
||||||
|
|
||||||
|
if (!".xml".equals(fileName.substring(fileName.lastIndexOf(".")))) {
|
||||||
|
msg = Constant.LOG_ERROR + "上传文件名称格式不正确," + Constant.IMPORT_STOP_MSG;
|
||||||
|
updateErrLog(msg, msg);
|
||||||
|
return ResponseObject.newErrResponse("上传文件名称格式不正确,请上传XML文件").toString();
|
||||||
|
}
|
||||||
|
LogUtil.appendLog(Constant.LOG_SUCCESS + "校验上传文件是否为XML格式", simpleLogFile, fullLogFile);
|
||||||
|
|
||||||
|
// 校验xml文档是否能够正常解析
|
||||||
|
Document doc = analysisXMLFile(file.getPath(), true);
|
||||||
|
// String toFilePath = "/Users/sunlh/Documents/ideaData/actionsoft/aws6.4.1.1008.yili2/apps/com.actionsoft.apps.coe.pal.datamigration/testFile/targetFile/";
|
||||||
|
// XMLUtil.writeXml(d, toFilePath + fileName);
|
||||||
|
// 解析xml文件
|
||||||
|
if (doc == null) {
|
||||||
|
msg = Constant.LOG_ERROR + "解析XML文件结构," + Constant.IMPORT_STOP_MSG;
|
||||||
|
updateErrLog(msg, msg);
|
||||||
|
return ResponseObject.newErrResponse("解析XML文件错误,详情见日志").toString();
|
||||||
|
}
|
||||||
|
LogUtil.appendLog(Constant.LOG_SUCCESS + "解析XML文件结构", simpleLogFile, fullLogFile);
|
||||||
|
ArisXmlHandleWeb handleWeb = new ArisXmlHandleWeb();
|
||||||
|
// 解析Aris流程内容
|
||||||
|
try {
|
||||||
|
handleWeb.handleXmlDoc(doc);
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
msg = Constant.LOG_ERROR + "解析XML文件内容异常,异常信息:" + e.getMessage() + "," + Constant.IMPORT_STOP_MSG;
|
||||||
|
updateErrLog(msg, msg);
|
||||||
|
}
|
||||||
|
LogUtil.appendLog(Constant.LOG_SUCCESS + "解析XML文件内容", simpleLogFile, fullLogFile);
|
||||||
|
|
||||||
|
// 统计epc流程图的个数,用以进度展示
|
||||||
|
int totalEpcCount = countProcessMainInfo(handleWeb.modelMap);
|
||||||
|
if (totalEpcCount == 0) {
|
||||||
|
msg = Constant.LOG_ERROR + "上传文件不包含任何" + I18nRes.findValue(CoEConstant.APP_ID, Constant.PROCESS_EPC) + "," + Constant.IMPORT_STOP_MSG;
|
||||||
|
updateErrLog(msg, msg);
|
||||||
|
return ResponseObject.newErrResponse("上传文件不包含任何" + I18nRes.findValue(CoEConstant.APP_ID, Constant.PROCESS_EPC)).toString();
|
||||||
|
}
|
||||||
|
// 存储缓存,导入计数
|
||||||
|
LogRealTimeCountModel countModel = new LogRealTimeCountModel();
|
||||||
|
countModel.setTotalCount(totalEpcCount);
|
||||||
|
countModel.setSuccessCount(0);
|
||||||
|
countModel.setArisBlankCount(0);
|
||||||
|
countModel.setPalExistsCount(0);
|
||||||
|
countModel.setImportingCount(0);
|
||||||
|
countModel.setMatchFieldCount(0);
|
||||||
|
LogRealTimeCountCache.getCache().put(logId, countModel, true);
|
||||||
|
|
||||||
|
LogUtil.appendLog(Constant.LOG_START + "导入" + I18nRes.findValue(CoEConstant.APP_ID, Constant.PROCESS_EPC + ",共【" + totalEpcCount + "】条流程"));
|
||||||
|
// 开始执行导入
|
||||||
|
new Thread(()->{new ArisXmlImportRun(_uc, wsId, logId, logPath, simpleLogFile, fullLogFile, warnLogFile, this.filePath, this.fileName, startTime).execute(handleWeb);}) .start();
|
||||||
|
|
||||||
|
ResponseObject ro = ResponseObject.newOkResponse();
|
||||||
|
ro.put("logId", logId);
|
||||||
|
ro.put("path", logPath);
|
||||||
|
ro.put("endLog", Constant.END_LOG);
|
||||||
|
return ro.toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 统计EPC流程图个数,用以展示进度
|
||||||
|
* @param modelMap
|
||||||
|
*/
|
||||||
|
private int countProcessMainInfo(Map<String, ModelModel> modelMap) {
|
||||||
|
int count = 0;
|
||||||
|
for (Map.Entry<String, ModelModel> entry : modelMap.entrySet()) {
|
||||||
|
ModelModel model = entry.getValue();
|
||||||
|
if ("MT_EEPC".equals(model.getType())) {
|
||||||
|
count++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return count;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 解析xml文档
|
||||||
|
* @param path
|
||||||
|
* @param b
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
private Document analysisXMLFile(String path, boolean b) {
|
||||||
|
Document d = null;
|
||||||
|
try {
|
||||||
|
d = XMLUtil.readXML(path, true);
|
||||||
|
} catch (DocumentException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
String msg = Constant.LOG_ERROR + "解析XML文件结构出错,错误信息:" + e.getMessage() + Constant.IMPORT_STOP_MSG;
|
||||||
|
updateErrLog(msg, msg);
|
||||||
|
} catch (FileNotFoundException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
String msg = Constant.LOG_ERROR + "解析XML文件结构出错,错误信息:" + e.getMessage() + Constant.IMPORT_STOP_MSG;
|
||||||
|
updateErrLog(msg, msg);
|
||||||
|
}
|
||||||
|
return d;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 校验文件/形状属性是否存在
|
||||||
|
* @param wsId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
private ResponseObject checkMethodConfig(String wsId) {
|
||||||
|
// 校验EPC图的文件属性
|
||||||
|
// 校验前置流程、后置流程
|
||||||
|
ResponseObject checkRo = checkMethodAttrExist(wsId, Constant.PROCESS_EPC, null, Constant.METHOD_PRE_PROCESS, Constant.METHOD_NEXT_PROCESS, Constant.METHOD_ARIS_URL);
|
||||||
|
if (checkRo.isErr()) {
|
||||||
|
return checkRo;
|
||||||
|
}
|
||||||
|
// 校验epc流程图的形状属性是否配置
|
||||||
|
// 校验线上审批的编号、输入、输出、描述、角色、信息系统
|
||||||
|
checkRo = checkMethodAttrExist(wsId, Constant.PROCESS_EPC, Constant.METHOD_APPROVAL_NODE, Constant.METHOD_NUMBER, Constant.METHOD_INPUT, Constant.METHOD_OUTPUT, Constant.METHOD_DESC, Constant.METHOD_ROLE, Constant.METHOD_INFO_SYSTEM);
|
||||||
|
if (checkRo.isErr()) {
|
||||||
|
return checkRo;
|
||||||
|
}
|
||||||
|
// 校验线下审批的编号、输入、输出、描述、角色、信息系统
|
||||||
|
checkRo = checkMethodAttrExist(wsId, Constant.PROCESS_EPC, Constant.METHOD_SERVICE_NODE, Constant.METHOD_NUMBER, Constant.METHOD_INPUT, Constant.METHOD_OUTPUT, Constant.METHOD_DESC, Constant.METHOD_ROLE, Constant.METHOD_INFO_SYSTEM);
|
||||||
|
if (checkRo.isErr()) {
|
||||||
|
return checkRo;
|
||||||
|
}
|
||||||
|
// 校验系统任务的编号、输入、输出、描述、角色、信息系统
|
||||||
|
checkRo = checkMethodAttrExist(wsId, Constant.PROCESS_EPC, Constant.METHOD_APPROVAL_NODE3, Constant.METHOD_NUMBER, Constant.METHOD_INPUT, Constant.METHOD_OUTPUT, Constant.METHOD_DESC, Constant.METHOD_ROLE, Constant.METHOD_INFO_SYSTEM);
|
||||||
|
if (checkRo.isErr()) {
|
||||||
|
return checkRo;
|
||||||
|
}
|
||||||
|
// 校验人工任务的编号、输入、输出、描述、角色、信息系统
|
||||||
|
checkRo = checkMethodAttrExist(wsId, Constant.PROCESS_EPC, Constant.METHOD_SERVICE_NODE4, Constant.METHOD_NUMBER, Constant.METHOD_INPUT, Constant.METHOD_OUTPUT, Constant.METHOD_DESC, Constant.METHOD_ROLE, Constant.METHOD_INFO_SYSTEM);
|
||||||
|
if (checkRo.isErr()) {
|
||||||
|
return checkRo;
|
||||||
|
}
|
||||||
|
// 校验角色图的岗位属性
|
||||||
|
// 校验角色的岗位文本
|
||||||
|
checkRo = checkMethodAttrExist(wsId, Constant.ORG_ROLE, Constant.METHOD_ROLE, Constant.METHOD_POST_TEXT);
|
||||||
|
if (checkRo.isErr()) {
|
||||||
|
return checkRo;
|
||||||
|
}
|
||||||
|
return ResponseObject.newOkResponse();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 校验属性是否存在
|
||||||
|
* @param methodId
|
||||||
|
* @param shapeName
|
||||||
|
* @param attrs
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
private ResponseObject checkMethodAttrExist(String wsId, String methodId, String shapeName, String ... attrs) {
|
||||||
|
String methodName = I18nRes.findValue(CoEConstant.APP_ID, methodId);
|
||||||
|
// 形状属性校验
|
||||||
|
if (UtilString.isNotEmpty(shapeName)) {
|
||||||
|
JSONObject shape = ShapeUtil.getProcessShapeDefinitionByName(methodId, shapeName);
|
||||||
|
if (isEmptyJsonOject(shape)) {
|
||||||
|
String msg = Constant.LOG_ERROR + "模型【" + methodName + "】中的形状【" + shapeName + "】不存在," + Constant.IMPORT_STOP_MSG;
|
||||||
|
updateErrLog(msg, msg);
|
||||||
|
return ResponseObject.newErrResponse("模型【" + methodName + "】中的形状【" + shapeName + "】不存在");
|
||||||
|
}
|
||||||
|
String shapeText = shape.getString("text");
|
||||||
|
List<PALMethodAttributeModel> list = CoeDesignerShapeAPIManager.getInstance().getValidAndUseAttributeModels(wsId, methodId, shapeName, methodId);
|
||||||
|
Map<String, PALMethodAttributeModel> attrMap = new HashMap<>();
|
||||||
|
for (PALMethodAttributeModel attrModel : list) {
|
||||||
|
attrMap.put(attrModel.getKey(), attrModel);
|
||||||
|
}
|
||||||
|
for (String attrId : attrs) {
|
||||||
|
if (!attrMap.containsKey(attrId)) {
|
||||||
|
String msg = Constant.LOG_ERROR + "模型【" + methodName + "】中的形状【" + shapeText + "】属性【" + attrId + "】不存在,请检查相应属性配置," + Constant.IMPORT_STOP_MSG;
|
||||||
|
updateErrLog(msg, msg);
|
||||||
|
return ResponseObject.newErrResponse("模型【" + methodName + "】中的形状【" + shapeText + "】属性【" + attrId + "】不存在");
|
||||||
|
}
|
||||||
|
LogUtil.appendLog(Constant.LOG_SUCCESS + "模型【" + methodName + "】中的形状【" + shapeText + "】属性【" + attrId + "】", simpleLogFile, fullLogFile);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// 文件属性校验
|
||||||
|
List<PALMethodAttributeModel> list = PALRepositoryAPIManager.getInstance().getValidAndUseAttributeModels(wsId, methodId);
|
||||||
|
Map<String, PALMethodAttributeModel> attrMap = new HashMap<>();
|
||||||
|
for (PALMethodAttributeModel attrModel : list) {
|
||||||
|
attrMap.put(attrModel.getKey(), attrModel);
|
||||||
|
}
|
||||||
|
for (String attrId : attrs) {
|
||||||
|
if (!attrMap.containsKey(attrId)) {
|
||||||
|
String msg = Constant.LOG_ERROR + "模型【" + methodName + "】的文件属性【" + attrId + "】不存在,请检查相应属性配置," + Constant.IMPORT_STOP_MSG;
|
||||||
|
updateErrLog(msg, msg);
|
||||||
|
return ResponseObject.newErrResponse("模型【" + methodName + "】的文件属性【" + attrId + "】不存在");
|
||||||
|
}
|
||||||
|
LogUtil.appendLog(Constant.LOG_SUCCESS + "模型【" + methodName + "】的文件属性【" + attrId + "】", simpleLogFile, fullLogFile);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return ResponseObject.newOkResponse();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 校验是否为空的对象
|
||||||
|
* @param o
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
private boolean isEmptyJsonOject(JSONObject o) {
|
||||||
|
return o == null || o.isEmpty();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -14,7 +14,7 @@ public class Constant {
|
|||||||
public final static double ANGLE_LEFT = 3.141592653589793;
|
public final static double ANGLE_LEFT = 3.141592653589793;
|
||||||
public final static double ANGLE_UP = 4.71238898038469;
|
public final static double ANGLE_UP = 4.71238898038469;
|
||||||
|
|
||||||
// 建模属性代码--编号
|
// 建模属性代码--编号 --活动序号
|
||||||
// public static final String METHOD_NUMBER = "number";
|
// public static final String METHOD_NUMBER = "number";
|
||||||
public static final String METHOD_NUMBER = "activity_number";
|
public static final String METHOD_NUMBER = "activity_number";
|
||||||
|
|
||||||
@ -46,11 +46,11 @@ public class Constant {
|
|||||||
|
|
||||||
// 建模属性代码--前置流程
|
// 建模属性代码--前置流程
|
||||||
// public static final String METHOD_PRE_PROCESS = "PRE_PROCESS";
|
// public static final String METHOD_PRE_PROCESS = "PRE_PROCESS";
|
||||||
public static final String METHOD_PRE_PROCESS = "pre_process";
|
public static final String METHOD_PRE_PROCESS = "lead_process";
|
||||||
|
|
||||||
// 建模属性代码--后置流程
|
// 建模属性代码--后置流程
|
||||||
// public static final String METHOD_NEXT_PROCESS = "NEXT_PROCESS";
|
// public static final String METHOD_NEXT_PROCESS = "NEXT_PROCESS";
|
||||||
public static final String METHOD_NEXT_PROCESS = "next_process";
|
public static final String METHOD_NEXT_PROCESS = "rear_process";
|
||||||
|
|
||||||
// 流程属性--ARIS地址
|
// 流程属性--ARIS地址
|
||||||
// public static final String METHOD_ARIS_URL = "ARISURL";
|
// public static final String METHOD_ARIS_URL = "ARISURL";
|
||||||
@ -58,4 +58,48 @@ public class Constant {
|
|||||||
|
|
||||||
// 存放与流程同名的角色模型的文件夹名称
|
// 存放与流程同名的角色模型的文件夹名称
|
||||||
public static final String DEFAULT_FOLDER_NAME = "角色模型";
|
public static final String DEFAULT_FOLDER_NAME = "角色模型";
|
||||||
|
|
||||||
|
|
||||||
|
// 日志常量记录
|
||||||
|
public static final String LOG_SUCCESS = "【成功】";
|
||||||
|
public static final String LOG_WARNING = "【警告】";
|
||||||
|
public static final String LOG_ERROR = "【错误】";
|
||||||
|
// 日志导入开始节点
|
||||||
|
public static final String LOG_START = "【开始】";
|
||||||
|
// 日志导入完成节点
|
||||||
|
public static final String LOG_END = "【完成】";
|
||||||
|
public static final String LOG_DESC = "【说明】";
|
||||||
|
|
||||||
|
|
||||||
|
// 日志表resultType字段常量code
|
||||||
|
public static final int LOG_RESULT_StATUS_RUN = 0;// 进行中
|
||||||
|
public static final int LOG_RESULT_StATUS_SUCCESS = 1;// 完成
|
||||||
|
public static final int LOG_RESULT_StATUS_ERROR = 2;// 失败
|
||||||
|
|
||||||
|
public static final String IMPORT_STOP_MSG = "导入停止";
|
||||||
|
|
||||||
|
// 日志结束语
|
||||||
|
public static final String END_LOG = "**建议下载本次输出日志做备忘";
|
||||||
|
|
||||||
|
|
||||||
|
public static final String PROCESS_EPC = "process.epc";
|
||||||
|
|
||||||
|
public static final String ORG_ROLE = "org.role";
|
||||||
|
|
||||||
|
public static final String ITSYSTEM_NORMAIL = "itsystem.normal";
|
||||||
|
|
||||||
|
public static final String METHOD_APPROVAL_NODE = "method_approval_node";// 线上审批
|
||||||
|
|
||||||
|
public static final String METHOD_SERVICE_NODE = "method_service_node";// 线下审批
|
||||||
|
|
||||||
|
public static final String METHOD_APPROVAL_NODE3 = "method_approval_node3";// 系统任务
|
||||||
|
public static final String METHOD_SERVICE_NODE4 = "method_service_node4";// 人工任务
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -0,0 +1,27 @@
|
|||||||
|
package com.actionsoft.apps.coe.pal.datamigration.log.cache;
|
||||||
|
|
||||||
|
import com.actionsoft.apps.coe.pal.datamigration.log.model.LogRealTimeCountModel;
|
||||||
|
import com.actionsoft.apps.resource.plugin.profile.CachePluginProfile;
|
||||||
|
import com.actionsoft.bpms.commons.cache.Cache;
|
||||||
|
import com.actionsoft.bpms.commons.cache.CacheManager;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 存储导入数据
|
||||||
|
* @author sunlh
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public class LogRealTimeCountCache extends Cache<String, LogRealTimeCountModel>{
|
||||||
|
|
||||||
|
public LogRealTimeCountCache(CachePluginProfile configuration) {
|
||||||
|
super(configuration);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void load() {
|
||||||
|
}
|
||||||
|
|
||||||
|
public static LogRealTimeCountCache getCache() {
|
||||||
|
return CacheManager.getCache(LogRealTimeCountCache.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,169 @@
|
|||||||
|
package com.actionsoft.apps.coe.pal.datamigration.log.dao;
|
||||||
|
|
||||||
|
import com.actionsoft.apps.coe.pal.datamigration.log.model.LogModel;
|
||||||
|
import com.actionsoft.bpms.commons.database.RowMapper;
|
||||||
|
import com.actionsoft.bpms.commons.mvc.dao.DaoObject;
|
||||||
|
import com.actionsoft.bpms.util.DBSql;
|
||||||
|
import com.actionsoft.bpms.util.UUIDGener;
|
||||||
|
import com.actionsoft.bpms.util.UtilString;
|
||||||
|
import com.actionsoft.exception.AWSDataAccessException;
|
||||||
|
|
||||||
|
import java.sql.Connection;
|
||||||
|
import java.sql.ResultSet;
|
||||||
|
import java.sql.SQLException;
|
||||||
|
import java.sql.Timestamp;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
public class LogDao extends DaoObject<LogModel> {
|
||||||
|
@Override
|
||||||
|
public int insert(LogModel model) throws AWSDataAccessException {
|
||||||
|
if (model == null) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
Connection conn = DBSql.open();
|
||||||
|
int r = 0;
|
||||||
|
if (UtilString.isEmpty(model.getId())) {
|
||||||
|
model.setId(UUIDGener.getUUID());
|
||||||
|
}
|
||||||
|
Map<String, Object> paraMap = new HashMap<String, Object>();
|
||||||
|
paraMap.put(LogModel.ID, model.getId());
|
||||||
|
paraMap.put(LogModel.WSID, model.getWsId());
|
||||||
|
paraMap.put(LogModel.FILENAME, model.getFileName());
|
||||||
|
paraMap.put(LogModel.FILEPATH, model.getFilePath());
|
||||||
|
paraMap.put(LogModel.LOGPATH, model.getLogPath());
|
||||||
|
paraMap.put(LogModel.CREATEUSER, model.getCreateUser());
|
||||||
|
paraMap.put(LogModel.CREATEUSERNAME, model.getCreateUserName());
|
||||||
|
paraMap.put(LogModel.CREATEDATE, model.getCreateDate());
|
||||||
|
paraMap.put(LogModel.STARTDATE, model.getStartDate());
|
||||||
|
paraMap.put(LogModel.ENDDATE, model.getEndDate());
|
||||||
|
paraMap.put(LogModel.RESULTSTATUS, model.getResultStatus());
|
||||||
|
paraMap.put(LogModel.MAININFO, model.getMainInfo());
|
||||||
|
paraMap.put(LogModel.EXT1, model.getExt1());
|
||||||
|
paraMap.put(LogModel.EXT2, model.getExt2());
|
||||||
|
paraMap.put(LogModel.EXT3, model.getExt3());
|
||||||
|
paraMap.put(LogModel.EXT4, model.getExt4());
|
||||||
|
String sql = DBSql.getInsertStatement(entityName(), paraMap);
|
||||||
|
r = DBSql.update(conn, sql, paraMap);
|
||||||
|
DBSql.close(conn);
|
||||||
|
return r;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int update(LogModel model) throws AWSDataAccessException {
|
||||||
|
String updateSql = "UPDATE "+ entityName()
|
||||||
|
+ " SET "+ LogModel.WSID +"=?, "
|
||||||
|
+ LogModel.FILENAME +"=?, "
|
||||||
|
+ LogModel.FILEPATH +"=?, "
|
||||||
|
+ LogModel.LOGPATH +"=?, "
|
||||||
|
+ LogModel.CREATEUSER +"=?, "
|
||||||
|
+ LogModel.CREATEUSERNAME +"=?, "
|
||||||
|
+ LogModel.CREATEDATE +"=?, "
|
||||||
|
+ LogModel.STARTDATE +"=?, "
|
||||||
|
+ LogModel.ENDDATE +"=?, "
|
||||||
|
+ LogModel.RESULTSTATUS +"=?, "
|
||||||
|
+ LogModel.MAININFO +"=?, "
|
||||||
|
+ LogModel.EXT1 +"=?, "
|
||||||
|
+ LogModel.EXT2 +"=?, "
|
||||||
|
+ LogModel.EXT3 +"=?, "
|
||||||
|
+ LogModel.EXT4 +"=? "
|
||||||
|
+ "WHERE "+ LogModel.ID +"=? ";
|
||||||
|
return DBSql.update(updateSql, new Object[] {model.getWsId(), model.getFileName(), model.getFilePath(), model.getLogPath(), model.getCreateUser(), model.getCreateUserName(),
|
||||||
|
model.getCreateDate(), model.getStartDate(), model.getEndDate(), model.getResultStatus(), model.getMainInfo(), model.getExt1(), model.getExt2(), model.getExt3(), model.getExt4(), model.getId()});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新关键信息
|
||||||
|
* @param id
|
||||||
|
* @param endDate
|
||||||
|
* @param resultType
|
||||||
|
* @param mainInfo
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public int update(String id, Timestamp endDate, int resultType, String mainInfo) {
|
||||||
|
String updateSql = "UPDATE "+ entityName()
|
||||||
|
+ " SET "+ LogModel.ENDDATE +"=?, "
|
||||||
|
+ LogModel.RESULTSTATUS +"=?, "
|
||||||
|
+ LogModel.MAININFO +"=? "
|
||||||
|
+ "WHERE "+ LogModel.ID +"=? ";
|
||||||
|
return DBSql.update(updateSql, new Object[] {endDate, resultType, mainInfo, id});
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String entityName() {
|
||||||
|
return LogModel.DATABASE_ENTITY;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public RowMapper<LogModel> rowMapper() {
|
||||||
|
return new Mapper();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取单条日志记录信息
|
||||||
|
* @param id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public LogModel getInstance(String id) {
|
||||||
|
String sql = "SELECT * FROM " + entityName() + " WHERE ID = ?";
|
||||||
|
return DBSql.getObject(sql, rowMapper(), id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取所有日志,按照创建时间倒序查询
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public List<LogModel> getAllInstance() {
|
||||||
|
String sql = "SELECT * FROM " + entityName() + " ORDER BY " + LogModel.CREATEDATE + " DESC";
|
||||||
|
return DBSql.query(sql, rowMapper());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除
|
||||||
|
* @param id
|
||||||
|
* @throws AWSDataAccessException
|
||||||
|
*/
|
||||||
|
public void remove(String id) throws AWSDataAccessException{
|
||||||
|
String sql = "DELETE FROM " + entityName()
|
||||||
|
+ " WHERE " + LogModel.ID + "=?";
|
||||||
|
DBSql.update(sql, new Object[]{id});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除所有
|
||||||
|
*/
|
||||||
|
public void removeAll() throws AWSDataAccessException{
|
||||||
|
String sql = "DELETE FROM " + entityName();
|
||||||
|
DBSql.update(sql);
|
||||||
|
}
|
||||||
|
|
||||||
|
private class Mapper implements RowMapper<LogModel> {
|
||||||
|
public LogModel mapRow(ResultSet rset, int rowNum) throws SQLException {
|
||||||
|
LogModel model = new LogModel();
|
||||||
|
try {
|
||||||
|
model.setId(rset.getString(LogModel.ID));
|
||||||
|
model.setWsId(rset.getString(LogModel.WSID));
|
||||||
|
model.setFileName(rset.getString(LogModel.FILENAME));
|
||||||
|
model.setFilePath(rset.getString(LogModel.FILEPATH));
|
||||||
|
model.setLogPath(rset.getString(LogModel.LOGPATH));
|
||||||
|
model.setCreateUser(rset.getString(LogModel.CREATEUSER));
|
||||||
|
model.setCreateUserName(rset.getString(LogModel.CREATEUSERNAME));
|
||||||
|
model.setCreateDate(rset.getTimestamp(LogModel.CREATEDATE));
|
||||||
|
model.setStartDate(rset.getTimestamp(LogModel.STARTDATE));
|
||||||
|
model.setEndDate(rset.getTimestamp(LogModel.ENDDATE));
|
||||||
|
model.setResultStatus(rset.getInt(LogModel.RESULTSTATUS));
|
||||||
|
model.setMainInfo(rset.getString(LogModel.MAININFO));
|
||||||
|
model.setExt1(rset.getString(LogModel.EXT1));
|
||||||
|
model.setExt2(rset.getString(LogModel.EXT2));
|
||||||
|
model.setExt3(rset.getString(LogModel.EXT3));
|
||||||
|
model.setExt4(rset.getString(LogModel.EXT4));
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
return model;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,177 @@
|
|||||||
|
package com.actionsoft.apps.coe.pal.datamigration.log.model;
|
||||||
|
|
||||||
|
import java.sql.Timestamp;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 日志记录表
|
||||||
|
*/
|
||||||
|
public class LogModel {
|
||||||
|
|
||||||
|
public static final String DATABASE_ENTITY = "APP_ACT_COE_PAL_DATAM_LOG";
|
||||||
|
public static final String ID = "ID";
|
||||||
|
public static final String WSID = "WSID";
|
||||||
|
public static final String FILENAME = "FILENAME";
|
||||||
|
public static final String FILEPATH = "FILEPATH";
|
||||||
|
public static final String LOGPATH = "LOGPATH";
|
||||||
|
public static final String CREATEUSER = "CREATEUSER";
|
||||||
|
public static final String CREATEUSERNAME = "CREATEUSERNAME";
|
||||||
|
public static final String CREATEDATE = "CREATEDATE";
|
||||||
|
public static final String STARTDATE = "STARTDATE";
|
||||||
|
public static final String ENDDATE = "ENDDATE";
|
||||||
|
public static final String RESULTSTATUS = "RESULTSTATUS";
|
||||||
|
public static final String MAININFO = "MAININFO";
|
||||||
|
public static final String EXT1 = "EXT1";
|
||||||
|
public static final String EXT2 = "EXT2";
|
||||||
|
public static final String EXT3 = "EXT3";
|
||||||
|
public static final String EXT4 = "EXT4";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
private String id;
|
||||||
|
private String wsId;// 资产库ID
|
||||||
|
private String fileName;// 上传文件名,若若是多个文件,只写一个文件,例如xxxxx文件等xx个文件
|
||||||
|
private String filePath;// dc路径(包含此次上传所有文件的上级文件夹路径)
|
||||||
|
private String logPath;// dc路径,存储日志文件的路径
|
||||||
|
private String createUser;// 创建人userId
|
||||||
|
private String createUserName;// 创建人中文名称
|
||||||
|
private Timestamp createDate;// 上传时间,程序开始导入时间
|
||||||
|
private Timestamp startDate;// 上传时间,程序开始导入时间
|
||||||
|
private Timestamp endDate;// 最终结束时间,成功/失败都需要记录
|
||||||
|
private int resultStatus;// 结果状态,0进行中,1成功,2失败
|
||||||
|
private String mainInfo;// 一句话简介整个上传结果,内容无限制,示例:若是进行中可描述为:正在上传;若是失败可描述为具体的异常信息;若是成功可描述为:上传多少条,成功多少条信息
|
||||||
|
private String ext1;// 扩展字段
|
||||||
|
private String ext2;// 扩展字段
|
||||||
|
private String ext3;// 扩展字段
|
||||||
|
private String ext4;// 扩展字段
|
||||||
|
|
||||||
|
public LogModel() {
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setId(String id) {
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getWsId() {
|
||||||
|
return wsId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setWsId(String wsId) {
|
||||||
|
this.wsId = wsId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getFileName() {
|
||||||
|
return fileName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFileName(String fileName) {
|
||||||
|
this.fileName = fileName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getFilePath() {
|
||||||
|
return filePath;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFilePath(String filePath) {
|
||||||
|
this.filePath = filePath;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getLogPath() {
|
||||||
|
return logPath;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLogPath(String logPath) {
|
||||||
|
this.logPath = logPath;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCreateUser() {
|
||||||
|
return createUser;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCreateUser(String createUser) {
|
||||||
|
this.createUser = createUser;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCreateUserName() {
|
||||||
|
return createUserName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCreateUserName(String createUserName) {
|
||||||
|
this.createUserName = createUserName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Timestamp getCreateDate() {
|
||||||
|
return createDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCreateDate(Timestamp createDate) {
|
||||||
|
this.createDate = createDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Timestamp getStartDate() {
|
||||||
|
return startDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setStartDate(Timestamp startDate) {
|
||||||
|
this.startDate = startDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Timestamp getEndDate() {
|
||||||
|
return endDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setEndDate(Timestamp endDate) {
|
||||||
|
this.endDate = endDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getResultStatus() {
|
||||||
|
return resultStatus;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setResultStatus(int resultStatus) {
|
||||||
|
this.resultStatus = resultStatus;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getMainInfo() {
|
||||||
|
return mainInfo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMainInfo(String mainInfo) {
|
||||||
|
this.mainInfo = mainInfo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getExt1() {
|
||||||
|
return ext1;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setExt1(String ext1) {
|
||||||
|
this.ext1 = ext1;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getExt2() {
|
||||||
|
return ext2;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setExt2(String ext2) {
|
||||||
|
this.ext2 = ext2;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getExt3() {
|
||||||
|
return ext3;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setExt3(String ext3) {
|
||||||
|
this.ext3 = ext3;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getExt4() {
|
||||||
|
return ext4;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setExt4(String ext4) {
|
||||||
|
this.ext4 = ext4;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,67 @@
|
|||||||
|
package com.actionsoft.apps.coe.pal.datamigration.log.model;
|
||||||
|
|
||||||
|
import com.actionsoft.bpms.commons.mvc.model.ModelBean;
|
||||||
|
|
||||||
|
|
||||||
|
public class LogRealTimeCountModel extends ModelBean {
|
||||||
|
|
||||||
|
private int totalCount;// 总共条数
|
||||||
|
private int successCount;// 成功条数
|
||||||
|
private int importingCount;// 当前正在导入的第几条数据
|
||||||
|
private int palExistsCount;// pal已存在条数,针对Aris xml流程导入
|
||||||
|
private int arisBlankCount;// aris没有模型的条数,针对Aris xml流程导入
|
||||||
|
private int matchFieldCount;// aris与PAL匹配失败的数据条数,针对Aris xml流程导入
|
||||||
|
// 可自定义其他类型数据导入/迁移计数对象
|
||||||
|
|
||||||
|
|
||||||
|
public LogRealTimeCountModel() {
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getTotalCount() {
|
||||||
|
return totalCount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTotalCount(int totalCount) {
|
||||||
|
this.totalCount = totalCount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getSuccessCount() {
|
||||||
|
return successCount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSuccessCount(int successCount) {
|
||||||
|
this.successCount = successCount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getPalExistsCount() {
|
||||||
|
return palExistsCount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPalExistsCount(int palExistsCount) {
|
||||||
|
this.palExistsCount = palExistsCount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getArisBlankCount() {
|
||||||
|
return arisBlankCount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setArisBlankCount(int arisBlankCount) {
|
||||||
|
this.arisBlankCount = arisBlankCount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getImportingCount() {
|
||||||
|
return importingCount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setImportingCount(int importingCount) {
|
||||||
|
this.importingCount = importingCount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getMatchFieldCount() {
|
||||||
|
return matchFieldCount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMatchFieldCount(int matchFieldCount) {
|
||||||
|
this.matchFieldCount = matchFieldCount;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -1,5 +1,7 @@
|
|||||||
package com.actionsoft.apps.coe.pal.datamigration.plugin;
|
package com.actionsoft.apps.coe.pal.datamigration.plugin;
|
||||||
|
|
||||||
|
import com.actionsoft.apps.coe.pal.datamigration.aris.constant.ArisConstant;
|
||||||
|
import com.actionsoft.apps.coe.pal.datamigration.log.cache.LogRealTimeCountCache;
|
||||||
import com.actionsoft.apps.coe.pal.datamigration.web.DataMigrationWeb;
|
import com.actionsoft.apps.coe.pal.datamigration.web.DataMigrationWeb;
|
||||||
import com.actionsoft.apps.coe.pal.pal.repository.upfile.CoeFileProcessor;
|
import com.actionsoft.apps.coe.pal.pal.repository.upfile.CoeFileProcessor;
|
||||||
import com.actionsoft.apps.listener.PluginListener;
|
import com.actionsoft.apps.listener.PluginListener;
|
||||||
@ -21,8 +23,11 @@ public class Plugins implements PluginListener {
|
|||||||
public List<AWSPluginProfile> register(AppContext context) {
|
public List<AWSPluginProfile> register(AppContext context) {
|
||||||
List<AWSPluginProfile> list = new ArrayList<AWSPluginProfile>();
|
List<AWSPluginProfile> list = new ArrayList<AWSPluginProfile>();
|
||||||
|
|
||||||
|
// 注册缓存
|
||||||
|
list.add(new CachePluginProfile(LogRealTimeCountCache.class));
|
||||||
|
|
||||||
list.add(new DCPluginProfile("migration", CoeFileProcessor.class.getName(), "存放数据迁移文件", false, false));
|
list.add(new DCPluginProfile("migration", CoeFileProcessor.class.getName(), "存放数据迁移文件", false, false));
|
||||||
|
list.add(new DCPluginProfile(ArisConstant.REPOSITORY_NAME, CoeFileProcessor.class.getName(), "存在arisXML数据迁移日志", false, false));
|
||||||
|
|
||||||
// PAL应用扩展点
|
// PAL应用扩展点
|
||||||
Map<String, Object> params0 = new HashMap<String, Object>();
|
Map<String, Object> params0 = new HashMap<String, Object>();
|
||||||
|
|||||||
@ -0,0 +1,159 @@
|
|||||||
|
package com.actionsoft.apps.coe.pal.datamigration.util;
|
||||||
|
|
||||||
|
import com.actionsoft.apps.coe.pal.datamigration.log.dao.LogDao;
|
||||||
|
import com.actionsoft.apps.coe.pal.datamigration.log.model.LogModel;
|
||||||
|
import com.actionsoft.bpms.commons.log.auditing.constant.AuditConst;
|
||||||
|
import com.actionsoft.bpms.commons.security.logging.model.Level;
|
||||||
|
import com.actionsoft.bpms.server.UserContext;
|
||||||
|
import com.actionsoft.sdk.local.SDK;
|
||||||
|
|
||||||
|
import java.io.*;
|
||||||
|
import java.nio.charset.StandardCharsets;
|
||||||
|
import java.sql.Timestamp;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class LogUtil {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 追加日志内容
|
||||||
|
* @param content 内容
|
||||||
|
* @param file 文件
|
||||||
|
*/
|
||||||
|
public static void appendLog(String content, File file) {
|
||||||
|
try {
|
||||||
|
String logFilePath = file.getPath();
|
||||||
|
// 构造函数中的第二个参数true表示以追加形式写文件
|
||||||
|
FileOutputStream fos = new FileOutputStream(logFilePath, true);
|
||||||
|
OutputStreamWriter osw = new OutputStreamWriter(fos, StandardCharsets.UTF_8);
|
||||||
|
osw.write(content + "\n");
|
||||||
|
osw.close();
|
||||||
|
fos.close();
|
||||||
|
} catch (IOException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
System.out.println("文件写入失败!" + e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void appendLog(String content, File ... files) {
|
||||||
|
for (File file : files) {
|
||||||
|
appendLog(content, file);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String getStackTrace(Throwable t) {
|
||||||
|
StringWriter sw = new StringWriter();
|
||||||
|
PrintWriter pw = new PrintWriter(sw);
|
||||||
|
try {
|
||||||
|
t.printStackTrace(pw);
|
||||||
|
return sw.toString();
|
||||||
|
} finally {
|
||||||
|
pw.close();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String getLogContent(File file) {
|
||||||
|
StringBuilder builder = new StringBuilder();
|
||||||
|
InputStreamReader reader = null;
|
||||||
|
BufferedReader br = null;
|
||||||
|
try {
|
||||||
|
reader = new InputStreamReader(new FileInputStream(file), StandardCharsets.UTF_8);
|
||||||
|
br = new BufferedReader(reader);
|
||||||
|
String s;
|
||||||
|
while ((s = br.readLine()) != null) {
|
||||||
|
builder.append(s).append("\n");
|
||||||
|
}
|
||||||
|
|
||||||
|
} catch (FileNotFoundException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
} catch (IOException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
} finally {
|
||||||
|
try {
|
||||||
|
if (reader != null) {
|
||||||
|
reader.close();
|
||||||
|
}
|
||||||
|
if (br != null) {
|
||||||
|
br.close();
|
||||||
|
}
|
||||||
|
} catch (IOException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return builder.toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 记录一条审计日志
|
||||||
|
* @param me
|
||||||
|
* @param op
|
||||||
|
* @param obj
|
||||||
|
* @param info
|
||||||
|
* @param level
|
||||||
|
*/
|
||||||
|
public static void recordAuditLog(UserContext me, String op, String obj, String info, Level level) {
|
||||||
|
SDK.getLogAPI().audit(AuditConst.CHANNEL_CLIENT, AuditConst.CATALOG_PROCESS, me.getUID(), op, obj, info, me.getClientIP(), level);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建日志(日志操作行为,非具体日志信息)
|
||||||
|
* @param model
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static int createLog(LogModel model) {
|
||||||
|
return new LogDao().insert(model);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询日志(日志操作行为,非具体日志信息)
|
||||||
|
* @param id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static LogModel queryLog(String id) {
|
||||||
|
return new LogDao().getInstance(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除日志(日志操作行为,非具体日志信息)
|
||||||
|
* @param id
|
||||||
|
*/
|
||||||
|
public static void removeLog(String id) {
|
||||||
|
new LogDao().remove(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 清空日志(日志操作行为,非具体日志信息)
|
||||||
|
*/
|
||||||
|
public static void removeAllLog() {
|
||||||
|
new LogDao().removeAll();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询所有日(日志操作行为,非具体日志信息),按照创建时间倒序
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static List<LogModel> queryAllLog() {
|
||||||
|
return new LogDao().getAllInstance();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新日志(日志操作行为,非具体日志信息)
|
||||||
|
* @param model
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static int updateLog(LogModel model) {
|
||||||
|
return new LogDao().update(model);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新日志(日志操作行为,非具体日志信息)
|
||||||
|
* @param id
|
||||||
|
* @param endDate 结束时间
|
||||||
|
* @param resultType 结果状态
|
||||||
|
* @param mainInfo 主要信息
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static int updateLog(String id, Timestamp endDate, int resultType, String mainInfo) {
|
||||||
|
return new LogDao().update(id, endDate, resultType, mainInfo);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -9,11 +9,14 @@ import com.actionsoft.apps.coe.pal.pal.method.model.PALMethodModel;
|
|||||||
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.model.PALRepositoryModel;
|
import com.actionsoft.apps.coe.pal.pal.repository.model.PALRepositoryModel;
|
||||||
|
import com.actionsoft.apps.coe.pal.pal.repository.util.CoeProcessLevelUtil;
|
||||||
import com.actionsoft.apps.lifecycle.api.AppsAPIManager;
|
import com.actionsoft.apps.lifecycle.api.AppsAPIManager;
|
||||||
import com.actionsoft.apps.resource.AppContext;
|
import com.actionsoft.apps.resource.AppContext;
|
||||||
import com.actionsoft.bpms.server.UserContext;
|
import com.actionsoft.bpms.server.UserContext;
|
||||||
import com.actionsoft.i18n.I18nRes;
|
import com.actionsoft.i18n.I18nRes;
|
||||||
|
import com.alibaba.fastjson.JSONArray;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import org.apache.commons.lang.StringUtils;
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
@ -183,11 +186,8 @@ public class ProcessUtil {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public static boolean isView(PALRepositoryModel model) {
|
public static boolean isView(PALRepositoryModel model) {
|
||||||
if (model.isPublish() || model.isApproval() || model.isStop()) {
|
return model.isPublish() || model.isApproval() || model.isStop();
|
||||||
return true;
|
}
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
@ -197,10 +197,21 @@ public class ProcessUtil {
|
|||||||
public static boolean isBlank(UserContext uc, PALRepositoryModel model) {
|
public static boolean isBlank(UserContext uc, PALRepositoryModel model) {
|
||||||
String define = PALRepositoryQueryAPIManager.getInstance().getProcessDefinition(uc, model.getId());
|
String define = PALRepositoryQueryAPIManager.getInstance().getProcessDefinition(uc, model.getId());
|
||||||
JSONObject array = JSONObject.parseObject(define);
|
JSONObject array = JSONObject.parseObject(define);
|
||||||
if (array.containsKey("elements") && array.getJSONObject("elements").size() == 0) {
|
return array.containsKey("elements") && array.getJSONObject("elements").size() == 0;
|
||||||
return true;
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取模型文本路径
|
||||||
|
* @param id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static String getRepositoryPath(String id) {
|
||||||
|
JSONArray pathArr = CoeProcessLevelUtil.getRepositoryPath(id);
|
||||||
|
List<String> list = new ArrayList<>();
|
||||||
|
for (int i = 0; i < pathArr.size(); i++) {
|
||||||
|
list.add(pathArr.getJSONObject(i).getString("name"));
|
||||||
}
|
}
|
||||||
return false;
|
return StringUtils.join(list, "\\");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -3,6 +3,7 @@ package com.actionsoft.apps.coe.pal.datamigration.util;
|
|||||||
import com.actionsoft.apps.coe.pal.datamigration.constant.Constant;
|
import com.actionsoft.apps.coe.pal.datamigration.constant.Constant;
|
||||||
import com.actionsoft.apps.coe.pal.datamigration.model.po.WordAttribute;
|
import com.actionsoft.apps.coe.pal.datamigration.model.po.WordAttribute;
|
||||||
import com.actionsoft.apps.coe.pal.datamigration.model.po.WordField;
|
import com.actionsoft.apps.coe.pal.datamigration.model.po.WordField;
|
||||||
|
import com.actionsoft.apps.coe.pal.pal.ws.web.VersionUtil;
|
||||||
import com.alibaba.fastjson.JSON;
|
import com.alibaba.fastjson.JSON;
|
||||||
import com.alibaba.fastjson.JSONArray;
|
import com.alibaba.fastjson.JSONArray;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
@ -271,9 +272,13 @@ public class WordUtil {
|
|||||||
String text = cell.text().trim();
|
String text = cell.text().trim();
|
||||||
//去除text特殊符号
|
//去除text特殊符号
|
||||||
if (null != text && !"".equals(text)) {
|
if (null != text && !"".equals(text)) {
|
||||||
text = text.replaceAll("\\p{C}", "");
|
text = text.replaceAll("\\p{C}", " ");
|
||||||
|
}
|
||||||
|
if (text.matches("[\\u4e00-\\u9fa5\\s]+$")){
|
||||||
|
text = text.replace(" ",",");
|
||||||
|
}else {
|
||||||
|
text = text.replace(" ","");
|
||||||
}
|
}
|
||||||
text.replace(" ","");
|
|
||||||
|
|
||||||
if (i == 0){
|
if (i == 0){
|
||||||
//首行为标题行
|
//首行为标题行
|
||||||
|
|||||||
@ -0,0 +1,94 @@
|
|||||||
|
package com.actionsoft.apps.coe.pal.datamigration.util.readword;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author baizp
|
||||||
|
* @Description:
|
||||||
|
* @date 2022/6/21 17:21
|
||||||
|
*/
|
||||||
|
import java.io.IOException;
|
||||||
|
|
||||||
|
import org.apache.poi.xwpf.usermodel.XWPFDocument;
|
||||||
|
import org.apache.xmlbeans.*;
|
||||||
|
import org.openxmlformats.schemas.drawingml.x2006.main.*;
|
||||||
|
import org.openxmlformats.schemas.drawingml.x2006.wordprocessingDrawing.CTInline;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* [ref] https://issues.apache.org/bugzilla/show_bug.cgi?id=49765
|
||||||
|
* [ref] http://pastebin.com/index/CbQ3iw8t, http://pastebin.com/2YAneYgt
|
||||||
|
*/
|
||||||
|
public class CustomXWPFDocument extends XWPFDocument
|
||||||
|
{
|
||||||
|
public CustomXWPFDocument() throws IOException
|
||||||
|
{
|
||||||
|
super();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void createPictureCxCy(String blipId,int id, long cx, long cy)
|
||||||
|
{
|
||||||
|
CTInline inline = createParagraph().createRun().getCTR().addNewDrawing().addNewInline();
|
||||||
|
|
||||||
|
String picXml = "" +
|
||||||
|
"<a:graphic xmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\">" +
|
||||||
|
" <a:graphicData uri=\"http://schemas.openxmlformats.org/drawingml/2006/picture\">" +
|
||||||
|
" <pic:pic xmlns:pic=\"http://schemas.openxmlformats.org/drawingml/2006/picture\">" +
|
||||||
|
" <pic:nvPicPr>" +
|
||||||
|
" <pic:cNvPr id=\"" + id + "\" name=\"Generated\"/>" +
|
||||||
|
" <pic:cNvPicPr/>" +
|
||||||
|
" </pic:nvPicPr>" +
|
||||||
|
" <pic:blipFill>" +
|
||||||
|
" <a:blip r:embed=\"" + blipId + "\" xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\"/>" +
|
||||||
|
" <a:stretch>" +
|
||||||
|
" <a:fillRect/>" +
|
||||||
|
" </a:stretch>" +
|
||||||
|
" </pic:blipFill>" +
|
||||||
|
" <pic:spPr>" +
|
||||||
|
" <a:xfrm>" +
|
||||||
|
" <a:off x=\"0\" y=\"0\"/>" +
|
||||||
|
" <a:ext cx=\"" + cx + "\" cy=\"" + cy + "\"/>" +
|
||||||
|
" </a:xfrm>" +
|
||||||
|
" <a:prstGeom prst=\"rect\">" +
|
||||||
|
" <a:avLst/>" +
|
||||||
|
" </a:prstGeom>" +
|
||||||
|
" </pic:spPr>" +
|
||||||
|
" </pic:pic>" +
|
||||||
|
" </a:graphicData>" +
|
||||||
|
"</a:graphic>";
|
||||||
|
|
||||||
|
//CTGraphicalObjectData graphicData = inline.addNewGraphic().addNewGraphicData();
|
||||||
|
XmlToken xmlToken = null;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
xmlToken = XmlToken.Factory.parse(picXml);
|
||||||
|
}
|
||||||
|
catch(XmlException xe)
|
||||||
|
{
|
||||||
|
xe.printStackTrace();
|
||||||
|
}
|
||||||
|
inline.set(xmlToken);
|
||||||
|
//graphicData.set(xmlToken);
|
||||||
|
|
||||||
|
inline.setDistT(0);
|
||||||
|
inline.setDistB(0);
|
||||||
|
inline.setDistL(0);
|
||||||
|
inline.setDistR(0);
|
||||||
|
|
||||||
|
CTPositiveSize2D extent = inline.addNewExtent();
|
||||||
|
extent.setCx(cx);
|
||||||
|
extent.setCy(cy);
|
||||||
|
|
||||||
|
CTNonVisualDrawingProps docPr = inline.addNewDocPr();
|
||||||
|
docPr.setId(id);
|
||||||
|
docPr.setName("Picture " + id);
|
||||||
|
docPr.setDescr("Generated");
|
||||||
|
}
|
||||||
|
|
||||||
|
public void createPicture(String blipId,int id, int width, int height)
|
||||||
|
{
|
||||||
|
final int EMU = 9525;
|
||||||
|
width *= EMU;
|
||||||
|
height *= EMU;
|
||||||
|
//String blipId = getAllPictures().get(id).getPackageRelationship().getId();
|
||||||
|
|
||||||
|
createPictureCxCy(blipId, id, width, height);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -174,13 +174,12 @@ public class WordFinal {
|
|||||||
if("f".equals(type)){
|
if("f".equals(type)){
|
||||||
model.setShape_uuid("");
|
model.setShape_uuid("");
|
||||||
model.setType("f");
|
model.setType("f");
|
||||||
model.setPl_uuid(reid);
|
|
||||||
}else {
|
}else {
|
||||||
model.setShape_uuid(reid);
|
model.setShape_uuid(reid);
|
||||||
model.setType("s");
|
model.setType("s");
|
||||||
model.setPl_uuid("");
|
|
||||||
}
|
}
|
||||||
model.setUuid(UUIDGener.getUUID());
|
model.setUuid(UUIDGener.getUUID());
|
||||||
|
model.setPl_uuid(reid);
|
||||||
model.setFileName(filename);
|
model.setFileName(filename);
|
||||||
model.setDownload(1);
|
model.setDownload(1);
|
||||||
model.setCreateUser(me.getUID());
|
model.setCreateUser(me.getUID());
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
Binary file not shown.
@ -67,17 +67,6 @@ public class Plugins implements PluginListener {
|
|||||||
params2.put("templates", array2.toString());
|
params2.put("templates", array2.toString());
|
||||||
list.add(new AppExtensionProfile("PAL报告->步骤竖表", "aslp://com.actionsoft.apps.coe.pal/registerOutputApp", params2));
|
list.add(new AppExtensionProfile("PAL报告->步骤竖表", "aslp://com.actionsoft.apps.coe.pal/registerOutputApp", params2));
|
||||||
|
|
||||||
/*Map<String, Object> params4 = new HashMap<String, Object>();
|
|
||||||
params4.put("groupName", "流程手册");
|
|
||||||
params4.put("title", "流程手册");
|
|
||||||
params4.put("targetMethodScope", PrReportComment.TARGET_METHOD_SCOPE);// 建模大类、建模方法,多个用逗号隔开,如果为空表示全部
|
|
||||||
params4.put("targetMethodType", "");// 建模方法中的图元,为空表示只选择文件,不选择图元;为"-"表示所有类型图元
|
|
||||||
params4.put("relationMethodScope", "-");// 如果设置-,表示不需要用户选择关联范围,向导页被忽略
|
|
||||||
params4.put("lang", "cn");// 该App支持的语言,多个用逗号隔开
|
|
||||||
params4.put("optionClass", Report4WizardOption.class.getName());// 附加的报表选项,如果该值没有,向导页被忽略
|
|
||||||
params4.put("generClass", Report4Gener.class.getName());// 生成报告
|
|
||||||
list.add(new AppExtensionProfile("PAL报告->流程手册", "aslp://com.actionsoft.apps.coe.pal/registerOutputApp", params4));*/
|
|
||||||
|
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -3,7 +3,6 @@ package com.actionsoft.apps.coe.pal.output.pr.report1;
|
|||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
import com.actionsoft.apps.AppsConst;
|
|
||||||
import com.actionsoft.apps.coe.pal.constant.CoEConstant;
|
import com.actionsoft.apps.coe.pal.constant.CoEConstant;
|
||||||
import com.actionsoft.apps.coe.pal.output.pr.util.PrReportComment;
|
import com.actionsoft.apps.coe.pal.output.pr.util.PrReportComment;
|
||||||
import com.actionsoft.apps.coe.pal.output.pr.util.ReportRepositoryCompare;
|
import com.actionsoft.apps.coe.pal.output.pr.util.ReportRepositoryCompare;
|
||||||
@ -12,7 +11,6 @@ import com.actionsoft.apps.coe.pal.pal.output.extend.OutputAppManager;
|
|||||||
import com.actionsoft.apps.coe.pal.pal.output.extend.OutputAppProfile;
|
import com.actionsoft.apps.coe.pal.pal.output.extend.OutputAppProfile;
|
||||||
import com.actionsoft.apps.coe.pal.pal.output.model.OutputTaskModel;
|
import com.actionsoft.apps.coe.pal.pal.output.model.OutputTaskModel;
|
||||||
import com.actionsoft.apps.coe.pal.pal.output.util.OutputExcelUtil;
|
import com.actionsoft.apps.coe.pal.pal.output.util.OutputExcelUtil;
|
||||||
import com.actionsoft.apps.coe.pal.pal.output.util.OutputUtil;
|
|
||||||
import com.actionsoft.apps.coe.pal.pal.output.util.OutputWordUtil;
|
import com.actionsoft.apps.coe.pal.pal.output.util.OutputWordUtil;
|
||||||
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.PALRepositoryCache;
|
import com.actionsoft.apps.coe.pal.pal.repository.cache.PALRepositoryCache;
|
||||||
@ -28,7 +26,6 @@ import com.actionsoft.apps.coe.pal.pal.repository.upfile.model.UpfileModel;
|
|||||||
import com.actionsoft.apps.coe.pal.system.property.CoePropertyUtil;
|
import com.actionsoft.apps.coe.pal.system.property.CoePropertyUtil;
|
||||||
import com.actionsoft.apps.coe.pal.util.HighSecurityUtil;
|
import com.actionsoft.apps.coe.pal.util.HighSecurityUtil;
|
||||||
import com.actionsoft.apps.resource.plugin.profile.DCPluginProfile;
|
import com.actionsoft.apps.resource.plugin.profile.DCPluginProfile;
|
||||||
import com.actionsoft.bpms.commons.mvc.dao.IDaoQuery;
|
|
||||||
import com.actionsoft.bpms.commons.mvc.view.ResponseObject;
|
import com.actionsoft.bpms.commons.mvc.view.ResponseObject;
|
||||||
import com.actionsoft.bpms.server.DispatcherRequest;
|
import com.actionsoft.bpms.server.DispatcherRequest;
|
||||||
import com.actionsoft.bpms.server.UserContext;
|
import com.actionsoft.bpms.server.UserContext;
|
||||||
@ -41,8 +38,10 @@ import com.actionsoft.sdk.local.api.internal.PlatformAPIImpl;
|
|||||||
import com.alibaba.fastjson.JSONArray;
|
import com.alibaba.fastjson.JSONArray;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
|
||||||
|
|
||||||
import static com.actionsoft.apps.coe.pal.pal.output.util.OutputWordUtil.specialCharTransfer;
|
import static com.actionsoft.apps.coe.pal.pal.output.util.OutputWordUtil.specialCharTransfer;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 生成流程手册-步骤横表横表的入口
|
* 生成流程手册-步骤横表横表的入口
|
||||||
*
|
*
|
||||||
@ -185,7 +184,7 @@ public class Report1Gener {
|
|||||||
// 记录关联属性的流程节点,防止多次查询重复文件信息耗费时间
|
// 记录关联属性的流程节点,防止多次查询重复文件信息耗费时间
|
||||||
Set<String> relationFileIds = new HashSet<>();
|
Set<String> relationFileIds = new HashSet<>();
|
||||||
Map<String, Map<String, Object>> relationFileMap = new HashMap<>();
|
Map<String, Map<String, Object>> relationFileMap = new HashMap<>();
|
||||||
|
|
||||||
PrReportComment prReportComment = new PrReportComment();
|
PrReportComment prReportComment = new PrReportComment();
|
||||||
PALRepositoryModel repositoryModel = PALRepositoryQueryAPIManager.getInstance().queryPalRepositoryModelByPalId(repositoryId);
|
PALRepositoryModel repositoryModel = PALRepositoryQueryAPIManager.getInstance().queryPalRepositoryModelByPalId(repositoryId);
|
||||||
if (repositoryModel == null) {
|
if (repositoryModel == null) {
|
||||||
@ -202,6 +201,7 @@ public class Report1Gener {
|
|||||||
Set<String> dangerSet = new HashSet<String>();// 风险
|
Set<String> dangerSet = new HashSet<String>();// 风险
|
||||||
Set<String> regulateSet = new HashSet<String>();// 控制
|
Set<String> regulateSet = new HashSet<String>();// 控制
|
||||||
Set<String> KPISet = new HashSet<String>();// kpi
|
Set<String> KPISet = new HashSet<String>();// kpi
|
||||||
|
System.out.println("id======================="+repositoryId);
|
||||||
|
|
||||||
List<Map<String, Object>> repositoryFileElements = CoeDesignerUtil.getShapeMessageJson4(repositoryId); //流程文件内容
|
List<Map<String, Object>> repositoryFileElements = CoeDesignerUtil.getShapeMessageJson4(repositoryId); //流程文件内容
|
||||||
if (wizardJsonData.getBoolean("orderNuberFirst")) { // 根据页面选择进行排序
|
if (wizardJsonData.getBoolean("orderNuberFirst")) { // 根据页面选择进行排序
|
||||||
|
|||||||
@ -2,6 +2,7 @@ package com.actionsoft.apps.coe.pal.output.pr.report2;
|
|||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
|
import com.actionsoft.apps.coe.pal.output.pr.util.PrReportComment;
|
||||||
import com.actionsoft.apps.coe.pal.pal.output.extend.GenerLogExd;
|
import com.actionsoft.apps.coe.pal.pal.output.extend.GenerLogExd;
|
||||||
import com.actionsoft.apps.coe.pal.pal.output.extend.OutputAppManager;
|
import com.actionsoft.apps.coe.pal.pal.output.extend.OutputAppManager;
|
||||||
import com.actionsoft.apps.coe.pal.pal.output.extend.OutputAppProfile;
|
import com.actionsoft.apps.coe.pal.pal.output.extend.OutputAppProfile;
|
||||||
@ -19,8 +20,6 @@ import com.actionsoft.apps.coe.pal.system.property.CoePropertyUtil;
|
|||||||
import com.actionsoft.sdk.local.SDK;
|
import com.actionsoft.sdk.local.SDK;
|
||||||
import com.alibaba.fastjson.JSONArray;
|
import com.alibaba.fastjson.JSONArray;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
|
||||||
import com.actionsoft.apps.coe.pal.output.pr.util.PrReportComment;
|
|
||||||
import com.actionsoft.bpms.commons.mvc.view.ResponseObject;
|
import com.actionsoft.bpms.commons.mvc.view.ResponseObject;
|
||||||
import com.actionsoft.bpms.server.fs.DCContext;
|
import com.actionsoft.bpms.server.fs.DCContext;
|
||||||
import com.actionsoft.sdk.local.api.internal.PlatformAPIImpl;
|
import com.actionsoft.sdk.local.api.internal.PlatformAPIImpl;
|
||||||
|
|||||||
@ -7,38 +7,20 @@ import java.io.IOException;
|
|||||||
import java.sql.Timestamp;
|
import java.sql.Timestamp;
|
||||||
import java.text.DateFormat;
|
import java.text.DateFormat;
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.Collections;
|
|
||||||
import java.util.HashSet;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Set;
|
|
||||||
|
|
||||||
import javax.imageio.ImageIO;
|
import javax.imageio.ImageIO;
|
||||||
|
|
||||||
import com.actionsoft.apps.coe.pal.constant.CoEConstant;
|
import com.actionsoft.apps.coe.pal.constant.CoEConstant;
|
||||||
import com.actionsoft.apps.coe.pal.pal.manage.publish.dao.PublishListHistory;
|
import com.actionsoft.apps.coe.pal.pal.manage.publish.dao.PublishListHistory;
|
||||||
import com.actionsoft.apps.coe.pal.pal.output.util.OutputWordUtil;
|
import com.actionsoft.apps.coe.pal.pal.output.util.OutputWordUtil;
|
||||||
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.PALRepositoryCache;
|
|
||||||
import com.actionsoft.apps.coe.pal.pal.repository.cache.PALRepositoryPropertyCache;
|
|
||||||
import com.actionsoft.apps.coe.pal.pal.repository.dao.PALRepositoryPropertyDao;
|
|
||||||
import com.actionsoft.apps.coe.pal.pal.repository.designer.relation.cache.DesignerShapeRelationCache;
|
|
||||||
import com.actionsoft.apps.coe.pal.pal.repository.designer.relation.model.DesignerShapeRelationModel;
|
|
||||||
import com.actionsoft.apps.coe.pal.pal.repository.model.PALRepositoryAttributeModel;
|
|
||||||
import com.actionsoft.apps.coe.pal.pal.repository.model.PALRepositoryModel;
|
import com.actionsoft.apps.coe.pal.pal.repository.model.PALRepositoryModel;
|
||||||
import com.actionsoft.apps.coe.pal.pal.repository.model.PALRepositoryPropertyModel;
|
|
||||||
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.system.property.CoePropertyUtil;
|
|
||||||
import org.apache.commons.lang.StringUtils;
|
|
||||||
|
|
||||||
import com.actionsoft.bpms.org.cache.UserCache;
|
import com.actionsoft.bpms.org.cache.UserCache;
|
||||||
import com.actionsoft.bpms.util.Base64;
|
import com.actionsoft.bpms.util.Base64;
|
||||||
import com.actionsoft.bpms.util.UtilDate;
|
import com.actionsoft.bpms.util.UtilDate;
|
||||||
import com.actionsoft.bpms.util.UtilFile;
|
import com.actionsoft.bpms.util.UtilFile;
|
||||||
import com.actionsoft.bpms.util.UtilString;
|
import com.actionsoft.bpms.util.UtilString;
|
||||||
import com.actionsoft.sdk.local.SDK;
|
import com.actionsoft.sdk.local.SDK;
|
||||||
|
|
||||||
import com.alibaba.fastjson.JSONArray;
|
import com.alibaba.fastjson.JSONArray;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
|
||||||
|
|||||||
@ -6,13 +6,10 @@ import java.util.Collections;
|
|||||||
import java.util.Comparator;
|
import java.util.Comparator;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.Iterator;
|
|
||||||
import java.util.LinkedList;
|
import java.util.LinkedList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
import com.actionsoft.apps.coe.pal.constant.CoEConstant;
|
|
||||||
import com.actionsoft.apps.coe.pal.pal.output.util.OutputWordUtil;
|
import com.actionsoft.apps.coe.pal.pal.output.util.OutputWordUtil;
|
||||||
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;
|
||||||
|
|||||||
BIN
com.actionsoft.apps.coe.pal.output.pr/~$横表-流程手册2.doc
Normal file
BIN
com.actionsoft.apps.coe.pal.output.pr/~$横表-流程手册2.doc
Normal file
Binary file not shown.
BIN
com.actionsoft.apps.coe.pal.output.pr/~WRL0001.tmp
Normal file
BIN
com.actionsoft.apps.coe.pal.output.pr/~WRL0001.tmp
Normal file
Binary file not shown.
Binary file not shown.
@ -5901,7 +5901,7 @@ y7fdOgAAAABJRU5ErkJggk==
|
|||||||
<w:sz w:val="21"/>
|
<w:sz w:val="21"/>
|
||||||
<w:sz-cs w:val="21"/>
|
<w:sz-cs w:val="21"/>
|
||||||
</w:rPr>
|
</w:rPr>
|
||||||
<w:t>${pl_Purpose}</w:t>
|
<w:t>${pl_goal}</w:t>
|
||||||
</w:r>
|
</w:r>
|
||||||
</w:p>
|
</w:p>
|
||||||
</w:tc>
|
</w:tc>
|
||||||
@ -6664,7 +6664,7 @@ y7fdOgAAAABJRU5ErkJggk==
|
|||||||
<w:sz w:val="21"/>
|
<w:sz w:val="21"/>
|
||||||
<w:sz-cs w:val="21"/>
|
<w:sz-cs w:val="21"/>
|
||||||
</w:rPr>
|
</w:rPr>
|
||||||
<w:t>${table2.shape_activity_name}</w:t>
|
<w:t>${table2.shape_activity_number}</w:t>
|
||||||
</w:r>
|
</w:r>
|
||||||
</w:p>
|
</w:p>
|
||||||
</w:tc>
|
</w:tc>
|
||||||
|
|||||||
Binary file not shown.
File diff suppressed because one or more lines are too long
@ -4,7 +4,7 @@
|
|||||||
<attribute key="Purpose" title="目的" type="string" value="" ref="" readonly="false" groupPath="baseAttribute" scope="*" isValid="true"/>
|
<attribute key="Purpose" title="目的" type="string" value="" ref="" readonly="false" groupPath="baseAttribute" scope="*" isValid="true"/>
|
||||||
<attribute key="file_number" title="文件编码" type="string" value="" ref="" readonly="true" groupPath="baseAttribute" scope="*" isValid="true"/>
|
<attribute key="file_number" title="文件编码" type="string" value="" ref="" readonly="true" groupPath="baseAttribute" scope="*" isValid="true"/>
|
||||||
<attribute key="R_Organizational_and_role_responsibilities" title="组织/角色职责" type="string" value="" ref="" readonly="false" groupPath="baseAttribute" scope="*" isValid="true"/>
|
<attribute key="R_Organizational_and_role_responsibilities" title="组织/角色职责" type="string" value="" ref="" readonly="false" groupPath="baseAttribute" scope="*" isValid="true"/>
|
||||||
<attribute key="application" title="使用范围" type="string" value="" desc="1" isRequired="false" ref="" readonly="false" groupPath="baseAttribute" scope="*" isValid="true"/>
|
<attribute key="application" title="适用范围" type="string" value="" desc="1" isRequired="false" ref="" readonly="false" groupPath="baseAttribute" scope="*" isValid="true"/>
|
||||||
<attribute key="versions" title="版本" type="string" value="" desc="1" isRequired="false" ref="" readonly="true" groupPath="baseAttribute" scope="*" isValid="true"/>
|
<attribute key="versions" title="版本" type="string" value="" desc="1" isRequired="false" ref="" readonly="true" groupPath="baseAttribute" scope="*" isValid="true"/>
|
||||||
<attribute key="Drafted_and_revised_by" title="拟制/修订人" type="string" value="" desc="1" isRequired="false" ref="" readonly="false" groupPath="baseAttribute" scope="*" isValid="true"/>
|
<attribute key="Drafted_and_revised_by" title="拟制/修订人" type="string" value="" desc="1" isRequired="false" ref="" readonly="false" groupPath="baseAttribute" scope="*" isValid="true"/>
|
||||||
<attribute key="Process_Architecture_L1" title="流程架构L1" type="string" value="" desc="1" isRequired="false" ref="" readonly="false" groupPath="baseAttribute" scope="*" isValid="true"/>
|
<attribute key="Process_Architecture_L1" title="流程架构L1" type="string" value="" desc="1" isRequired="false" ref="" readonly="false" groupPath="baseAttribute" scope="*" isValid="true"/>
|
||||||
@ -19,12 +19,12 @@
|
|||||||
<attribute key="Process_owner" title="流程责任人" type="awsorg" value="" desc="流程责任人" isRequired="false" ref="{"scope":["user"],"multiple":false}" readonly="true" groupPath="baseAttribute" scope="*" isValid="true"/>
|
<attribute key="Process_owner" title="流程责任人" type="awsorg" value="" desc="流程责任人" isRequired="false" ref="{"scope":["user"],"multiple":false}" readonly="true" groupPath="baseAttribute" scope="*" isValid="true"/>
|
||||||
<attribute key="effective_date" title="生效日期" type="DateTimePicker" value="" desc="生效日期" isRequired="false" ref="" readonly="false" groupPath="baseAttribute" scope="*" isValid="true"/>
|
<attribute key="effective_date" title="生效日期" type="DateTimePicker" value="" desc="生效日期" isRequired="false" ref="" readonly="false" groupPath="baseAttribute" scope="*" isValid="true"/>
|
||||||
<attribute key="Contents_and_reasons_for_revision" title="修订内容及理由" type="string" value="" desc="修订内容及理由" isRequired="false" ref="" readonly="false" groupPath="baseAttribute" scope="*" isValid="true"/>
|
<attribute key="Contents_and_reasons_for_revision" title="修订内容及理由" type="string" value="" desc="修订内容及理由" isRequired="false" ref="" readonly="false" groupPath="baseAttribute" scope="*" isValid="true"/>
|
||||||
<attribute key="term" title="术语" type="table" value="" desc="术语" isRequired="false" ref="" readonly="false" groupPath="baseAttribute" scope="*" isValid="true"/>
|
|
||||||
<attribute key="Organizational_role" title="组织角色" type="table" value="" desc="组织角色" isRequired="false" ref="" readonly="false" groupPath="baseAttribute" scope="*" isValid="true"/>
|
|
||||||
<attribute key="Process_performance_metrics" title="流程绩效" type="relation" value="" desc="流程绩效" isRequired="false" ref="{"method":"control.kpi","type":"shape","multiple":false}" readonly="true" groupPath="baseAttribute" scope="*" isValid="true"/>
|
<attribute key="Process_performance_metrics" title="流程绩效" type="relation" value="" desc="流程绩效" isRequired="false" ref="{"method":"control.kpi","type":"shape","multiple":false}" readonly="true" groupPath="baseAttribute" scope="*" isValid="true"/>
|
||||||
<attribute key="pre_process" title="前置流程" type="relation" value="" desc="前置流程" isRequired="false" ref="{"method":"process","type":"shape","multiple":false,"value":""}" readonly="true" groupPath="baseAttribute" scope="*" isValid="true"/>
|
<attribute key="pre_process" title="前置流程" type="relation" value="" desc="前置流程" isRequired="false" ref="{"method":"process","type":"shape","multiple":false,"value":""}" readonly="true" groupPath="baseAttribute" scope="*" isValid="true"/>
|
||||||
<attribute key="next_process" title="后置流程" type="relation" value="" desc="后置流程" isRequired="false" ref="{"method":"process","type":"shape","multiple":false,"value":""}" readonly="true" groupPath="baseAttribute" scope="*" isValid="true"/>
|
<attribute key="next_process" title="后置流程" type="relation" value="" desc="后置流程" isRequired="false" ref="{"method":"process","type":"shape","multiple":false,"value":""}" readonly="true" groupPath="baseAttribute" scope="*" isValid="true"/>
|
||||||
<attribute key="related_knowledge" title="相关知识" type="link" value="" desc="相关知识" isRequired="false" ref="" readonly="false" groupPath="baseAttribute" scope="*" isValid="true"/>
|
<attribute key="related_knowledge" title="相关知识" type="link" value="" desc="相关知识" isRequired="false" ref="" readonly="false" groupPath="baseAttribute" scope="*" isValid="true"/>
|
||||||
<attribute key="Issuing_department" title="发布部门" type="awsorg" value="" desc="发布部门" isRequired="false" ref="{"scope":["department"],"multiple":false}" readonly="true" groupPath="baseAttribute" scope="*" isValid="true"/>
|
<attribute key="Issuing_department" title="发布部门" type="awsorg" value="" desc="发布部门" isRequired="false" ref="{"scope":["department"],"multiple":false}" readonly="true" groupPath="baseAttribute" scope="*" isValid="true"/>
|
||||||
<attribute key="Drafted_and_revised_date" title="拟制/修订日期" type="DateTimePicker" value="" desc="拟制/修订日期" isRequired="false" ref="" readonly="false" groupPath="baseAttribute" scope="*" isValid="true"/>
|
<attribute key="Drafted_and_revised_date" title="拟制/修订日期" type="DateTimePicker" value="" desc="拟制/修订日期" isRequired="false" ref="" readonly="false" groupPath="baseAttribute" scope="*" isValid="true"/>
|
||||||
|
<attribute key="term" title="术语" type="table" value="" desc="术语" isRequired="false" ref="{"firstColumn":"listing1","secondColumn":"listing2"}" readonly="false" groupPath="baseAttribute" scope="*" isValid="true"/>
|
||||||
|
<attribute key="Organizational_role" title="组织角色" type="table" value="" desc="组织角色" isRequired="false" ref="{"firstColumn":"listing1","secondColumn":"listing2"}" readonly="false" groupPath="baseAttribute" scope="*" isValid="true"/>
|
||||||
</attributes>
|
</attributes>
|
||||||
|
|||||||
@ -2,5 +2,6 @@
|
|||||||
|
|
||||||
<attributes type="customer">
|
<attributes type="customer">
|
||||||
<attribute key="post" title="岗位" type="string" value="" desc="1" isRequired="false" ref="" readonly="false" groupPath="baseAttribute" scope="%,*" isValid="true"/>
|
<attribute key="post" title="岗位" type="string" value="" desc="1" isRequired="false" ref="" readonly="false" groupPath="baseAttribute" scope="%,*" isValid="true"/>
|
||||||
<attribute key="post_text" title="岗位文本" type="string" value="" desc="岗位文本信息" isRequired="false" ref="" readonly="false" groupPath="baseAttribute" scope="*" isValid="true"/>
|
<attribute key="post_text" title="岗位文本" type="string" value="" desc="岗位文本信息" isRequired="false" ref="" readonly="false" groupPath="baseAttribute" scope="*" isValid="true"/>
|
||||||
|
<attribute key="post_test" title="岗位" type="string" value="" desc="岗位" isRequired="false" ref="" readonly="false" groupPath="baseAttribute" scope="*" isValid="true"/>
|
||||||
</attributes>
|
</attributes>
|
||||||
|
|||||||
@ -57,7 +57,7 @@ public class CoEPALController {
|
|||||||
@Mapping("com.actionsoft.apps.coe.pal_main_page")
|
@Mapping("com.actionsoft.apps.coe.pal_main_page")
|
||||||
public String COEPALMAIN(UserContext me, String wsuuid) {
|
public String COEPALMAIN(UserContext me, String wsuuid) {
|
||||||
Map<String, Object> macroLibraries = new HashMap<String, Object>();
|
Map<String, Object> macroLibraries = new HashMap<String, Object>();
|
||||||
CoeWorkSpaceModel model = (CoeWorkSpaceModel) CoeWorkSpaceDaoFactory.createCoeWorkSpace().getInstance(wsuuid);
|
CoeWorkSpaceModel model = CoeWorkSpaceDaoFactory.createCoeWorkSpace().getInstance(wsuuid);
|
||||||
macroLibraries.put("sid", me.getSessionId());
|
macroLibraries.put("sid", me.getSessionId());
|
||||||
macroLibraries.put("wsuuid", wsuuid);
|
macroLibraries.put("wsuuid", wsuuid);
|
||||||
// 资产库去掉了版本号,已不做多版本
|
// 资产库去掉了版本号,已不做多版本
|
||||||
@ -203,6 +203,16 @@ public class CoEPALController {
|
|||||||
return web.getManageMethodData();
|
return web.getManageMethodData();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 保存形状定义描述
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Mapping("com.actionsoft.apps.coe.pal_pl_manage_method_object_desc_save")
|
||||||
|
public String coePalPlManageMethodObjectDescSave(UserContext me, String shapeName, String desc, String methodId) {
|
||||||
|
PalManageWeb web = new PalManageWeb(me);
|
||||||
|
return web.saveMethodObjectDesc(shapeName, desc, methodId);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 建模方法->查询特定建模方法的形状定义数据
|
* 建模方法->查询特定建模方法的形状定义数据
|
||||||
* @param me
|
* @param me
|
||||||
@ -1331,7 +1341,7 @@ public class CoEPALController {
|
|||||||
@Deprecated
|
@Deprecated
|
||||||
@Mapping("com.actionsoft.apps.coe.pal_processlevel_query_check")
|
@Mapping("com.actionsoft.apps.coe.pal_processlevel_query_check")
|
||||||
public String coePALPROCESSLEVELQUERYCHECK(UserContext me, String uuid) {
|
public String coePALPROCESSLEVELQUERYCHECK(UserContext me, String uuid) {
|
||||||
PALRepositoryModel coeProcessLevelModel = (PALRepositoryModel) CoeProcessLevelDaoFacotory.createCoeProcessLevel().getInstance(uuid);
|
PALRepositoryModel coeProcessLevelModel = CoeProcessLevelDaoFacotory.createCoeProcessLevel().getInstance(uuid);
|
||||||
return coeProcessLevelModel != null ? uuid : "";
|
return coeProcessLevelModel != null ? uuid : "";
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2917,17 +2927,16 @@ public class CoEPALController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
/**
|
|
||||||
* 弹窗新建角色图形创建相应图形
|
* 弹窗新建角色图形创建相应图形
|
||||||
* @param me
|
* @param me
|
||||||
* @param
|
* @param
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@Mapping("com.actionsoft.apps.coe.pal_pl_repository_designer_relation_shape_createDialogModel")
|
@Mapping("com.actionsoft.apps.coe.pal_pl_repository_designer_relation_shape_createDialogModel")
|
||||||
public String createDialogModel(UserContext me,String uuid,String methodId,String category) {
|
public String createDialogModel(UserContext me,String uuid,String methodId) {
|
||||||
CoeProcessLevelWeb web = new CoeProcessLevelWeb(me);
|
CoeProcessLevelWeb web = new CoeProcessLevelWeb(me);
|
||||||
return web.createDialogModel(uuid,methodId,category);
|
return web.createDialogModel(uuid,methodId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -2938,9 +2947,9 @@ public class CoEPALController {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@Mapping("com.actionsoft.apps.coe.pal_pl_repository_designer_relation_find_same_role")
|
@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);
|
CoeProcessLevelWeb web = new CoeProcessLevelWeb(me);
|
||||||
return web.relationFindSameRole(uuid);
|
return web.relationFindSameRole(uuid,methodId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -2,6 +2,9 @@ package com.actionsoft.apps.coe.pal.cooperation;
|
|||||||
|
|
||||||
|
|
||||||
import com.actionsoft.apps.coe.pal.constant.CoEConstant;
|
import com.actionsoft.apps.coe.pal.constant.CoEConstant;
|
||||||
|
import com.actionsoft.apps.coe.pal.cooperation.cache.CooperationCache;
|
||||||
|
import com.actionsoft.apps.coe.pal.cooperation.cache.model.TeamInfo;
|
||||||
|
import com.actionsoft.apps.coe.pal.cooperation.cache.model.UserInfo;
|
||||||
import com.actionsoft.apps.coe.pal.cooperation.constant.CoeCooperationConst;
|
import com.actionsoft.apps.coe.pal.cooperation.constant.CoeCooperationConst;
|
||||||
import com.actionsoft.apps.coe.pal.cooperation.dao.*;
|
import com.actionsoft.apps.coe.pal.cooperation.dao.*;
|
||||||
import com.actionsoft.apps.coe.pal.cooperation.model.*;
|
import com.actionsoft.apps.coe.pal.cooperation.model.*;
|
||||||
@ -24,10 +27,12 @@ import com.actionsoft.bpms.util.UtilString;
|
|||||||
import com.actionsoft.sdk.local.SDK;
|
import com.actionsoft.sdk.local.SDK;
|
||||||
import com.actionsoft.sdk.local.api.AppAPI;
|
import com.actionsoft.sdk.local.api.AppAPI;
|
||||||
import com.alibaba.fastjson.JSONArray;
|
import com.alibaba.fastjson.JSONArray;
|
||||||
|
import org.apache.commons.lang.StringUtils;
|
||||||
|
|
||||||
import javax.servlet.RequestDispatcher;
|
import javax.servlet.RequestDispatcher;
|
||||||
import java.sql.Timestamp;
|
import java.sql.Timestamp;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Created by sunlh
|
* @Created by sunlh
|
||||||
@ -580,28 +585,43 @@ public class CoeCooperationAPIManager {
|
|||||||
* @param ro havingWritePerm、havingRemovePerm、havingVersionManagePerm 返回true false
|
* @param ro havingWritePerm、havingRemovePerm、havingVersionManagePerm 返回true false
|
||||||
*/
|
*/
|
||||||
public void queryCooperationMemberActionPerm(String teamId, String userId, ResponseObject ro) {
|
public void queryCooperationMemberActionPerm(String teamId, String userId, ResponseObject ro) {
|
||||||
// 权限获取
|
boolean isOlderVersion = SDK.getAppAPI().getPropertyBooleanValue("com.actionsoft.apps.coe.pal", "IsOlderVersion", true);
|
||||||
boolean havingWritePerm = true;
|
if (isOlderVersion){
|
||||||
boolean havingRemovePerm = true;
|
// 权限获取
|
||||||
boolean havingVersionManagePerm = true;
|
boolean havingWritePerm = true;
|
||||||
int validUserPermDataCount = 0;// 当前小组成员有效(流程表中存在)的数据权限数量
|
boolean havingRemovePerm = true;
|
||||||
if (!UtilString.isEmpty(teamId) && isInstall()) {
|
boolean havingVersionManagePerm = true;
|
||||||
CoeCooperationRoleModel role = queryCooperationRoleByUser(teamId, userId);
|
int validUserPermDataCount = 0;// 当前小组成员有效(流程表中存在)的数据权限数量
|
||||||
if (role != null) {
|
if (!UtilString.isEmpty(teamId) && isInstall()) {
|
||||||
if (role.getActionPerm() == null) {
|
Set<String> userOperatePermission = CooperationCache.getUserOperatePermission(teamId, userId);
|
||||||
role.setActionPerm("");
|
havingWritePerm = userOperatePermission.contains(CoeCooperationConst.ACTION_WRITE);// 新增、修改权限
|
||||||
};
|
havingRemovePerm = userOperatePermission.contains(CoeCooperationConst.ACTION_DELETE);// 删除权限
|
||||||
havingWritePerm = role.getActionPerm().contains(CoeCooperationConst.ACTION_WRITE);// 新增、修改权限
|
havingVersionManagePerm = userOperatePermission.contains(CoeCooperationConst.ACTION_VERSION);// 版本管理权限
|
||||||
havingRemovePerm = role.getActionPerm().contains(CoeCooperationConst.ACTION_DELETE);// 删除权限
|
|
||||||
havingVersionManagePerm = role.getActionPerm().contains(CoeCooperationConst.ACTION_VERSION);// 版本管理权限
|
|
||||||
}
|
}
|
||||||
|
ro.put("isOlderVersion", isOlderVersion);
|
||||||
|
ro.put("havingWritePerm", havingWritePerm);// 新增、修改权限
|
||||||
|
ro.put("havingRemovePerm", havingRemovePerm);// 删除权限
|
||||||
|
ro.put("havingVersionManagePerm", havingVersionManagePerm);// 版本管理权限
|
||||||
|
Set<String> permDataVerIdList = CooperationCache.getUserDataVisitablePermission(teamId, userId,true);
|
||||||
|
validUserPermDataCount = permDataVerIdList != null ? permDataVerIdList.size() : 0;
|
||||||
|
ro.put("validUserPermDataCount", validUserPermDataCount);
|
||||||
|
}else {
|
||||||
|
boolean havingCreatePerm = true;
|
||||||
|
boolean havingBatchPerm = true;
|
||||||
|
int validUserPermDataCount = 0;
|
||||||
|
if (!UtilString.isEmpty(teamId) && isInstall()) {
|
||||||
|
Set<String> userOperatePermission = CooperationCache.getUserOperatePermission(teamId, userId);
|
||||||
|
havingCreatePerm = userOperatePermission.contains(CoeCooperationConst.ACTION_CREATE_PROCESS);
|
||||||
|
havingBatchPerm = userOperatePermission.contains(CoeCooperationConst.ACTION_BATCH);
|
||||||
|
}
|
||||||
|
|
||||||
|
ro.put("isOlderVersion", !isOlderVersion);// 新增、修改权限
|
||||||
|
ro.put("havingCreatePerm", havingCreatePerm);// 新增、修改权限
|
||||||
|
ro.put("havingBatchPerm", havingBatchPerm);// 删除权限
|
||||||
|
Set<String> dataVisitablePermission = CooperationCache.getUserDataVisitablePermission(teamId, userId,true);
|
||||||
|
validUserPermDataCount = dataVisitablePermission != null ? dataVisitablePermission.size() : 0;
|
||||||
|
ro.put("validUserPermDataCount", validUserPermDataCount);
|
||||||
}
|
}
|
||||||
ro.put("havingWritePerm", havingWritePerm);// 新增、修改权限
|
|
||||||
ro.put("havingRemovePerm", havingRemovePerm);// 删除权限
|
|
||||||
ro.put("havingVersionManagePerm", havingVersionManagePerm);// 版本管理权限
|
|
||||||
List<String> permDataVerIdList = queryCooperationRoleDataPermByTeamUser(teamId, userId, true);
|
|
||||||
validUserPermDataCount = permDataVerIdList != null ? permDataVerIdList.size() : 0;
|
|
||||||
ro.put("validUserPermDataCount", validUserPermDataCount);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -735,4 +755,125 @@ public class CoeCooperationAPIManager {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public List<TeamInfo> getAllTeamInfo(){
|
||||||
|
List<TeamInfo> list = new ArrayList<>();
|
||||||
|
|
||||||
|
List<CoeCooperationTeamModel> allTeam = new CoeCooperationTeamDao().getAllTeam();
|
||||||
|
for (CoeCooperationTeamModel teamModel : allTeam) {
|
||||||
|
TeamInfo teamInfo = new TeamInfo();
|
||||||
|
teamInfo.setTeamId(teamModel.getId());
|
||||||
|
List<UserInfo> userInfos = this.getUserInfoByTeamId(teamModel.getId());
|
||||||
|
teamInfo.setUsers(userInfos);
|
||||||
|
|
||||||
|
List<String> permVerIds = new CoeCooperationTeamPermDao().getCooperationTeamPermVerIds(teamModel.getId());
|
||||||
|
teamInfo.getVersionIds().addAll(permVerIds);
|
||||||
|
|
||||||
|
list.add(teamInfo);
|
||||||
|
}
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<UserInfo> getUserInfoByTeamId(String teamId){
|
||||||
|
List<UserInfo> list = new ArrayList<>();
|
||||||
|
|
||||||
|
Map<String,UserInfo> userMap = new HashMap<>();
|
||||||
|
List<CoeCooperationMemberModel> memberModels = new CoeCooperationMemberDao().queryUserListByTeam(teamId);
|
||||||
|
for (CoeCooperationMemberModel memberModel : memberModels) {
|
||||||
|
UserInfo userInfo = userMap.get(memberModel.getUserId());
|
||||||
|
if (null == userInfo){
|
||||||
|
userInfo = new UserInfo();
|
||||||
|
userInfo.setUserid(memberModel.getUserId());
|
||||||
|
userInfo.getRoleIds().add(memberModel.getRoleId());
|
||||||
|
}else {
|
||||||
|
userInfo.getRoleIds().add(memberModel.getRoleId());
|
||||||
|
}
|
||||||
|
userMap.put(memberModel.getUserId(),userInfo);
|
||||||
|
}
|
||||||
|
|
||||||
|
for (UserInfo userInfo : userMap.values()) {
|
||||||
|
List<String> roleIds = userInfo.getRoleIds();
|
||||||
|
Set<String> appPerm = this.getAppPerm(roleIds);
|
||||||
|
userInfo.setAppPermission(appPerm);
|
||||||
|
|
||||||
|
Set<String> actionPerm = this.getActionPerm(roleIds);
|
||||||
|
userInfo.setOperatePermission(actionPerm);
|
||||||
|
|
||||||
|
boolean allDataPerm = this.isAllDataPerm(roleIds);
|
||||||
|
userInfo.setIsAllDataPermission(allDataPerm);
|
||||||
|
|
||||||
|
if (!allDataPerm){
|
||||||
|
Map<String, Set<String>> dataPerm = this.getDataPerm(teamId, roleIds);
|
||||||
|
userInfo.setDataPermission(dataPerm);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
list.addAll(userMap.values());
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
|
private Set<String> getAppPerm(List<String> roleIds){
|
||||||
|
Set<String> set = new HashSet<>();
|
||||||
|
for (String roleId : roleIds) {
|
||||||
|
CoeCooperationRoleModel roleModel = new CoeCooperationRoleDao().queryById(roleId);
|
||||||
|
if (null == roleModel){
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
//设置全局app权限
|
||||||
|
List<String> appPerm = Arrays.stream(roleModel.getAppPerm().split(",")).collect(Collectors.toList());
|
||||||
|
set.addAll(appPerm);
|
||||||
|
}
|
||||||
|
return set;
|
||||||
|
}
|
||||||
|
|
||||||
|
private Set<String> getActionPerm(List<String> roleIds){
|
||||||
|
Set<String> set = new HashSet<>();
|
||||||
|
for (String roleId : roleIds) {
|
||||||
|
CoeCooperationRoleModel roleModel = new CoeCooperationRoleDao().queryById(roleId);
|
||||||
|
if (null == roleModel){
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
//设置全局操作权限
|
||||||
|
List<String> actionPermList = Arrays.stream(roleModel.getActionPerm().split(",")).collect(Collectors.toList());
|
||||||
|
set.addAll(actionPermList);
|
||||||
|
}
|
||||||
|
return set;
|
||||||
|
}
|
||||||
|
|
||||||
|
private boolean isAllDataPerm(List<String> roleIds){
|
||||||
|
for (String roleId : roleIds) {
|
||||||
|
CoeCooperationRoleModel roleModel = new CoeCooperationRoleDao().queryById(roleId);
|
||||||
|
if (null == roleModel){
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (roleModel.getDataPerm().equals("all")){
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
private Map<String,Set<String>> getDataPerm(String teamId,List<String> roleIds){
|
||||||
|
Map<String,Set<String>> map = new HashMap<>();
|
||||||
|
for (String roleId : roleIds) {
|
||||||
|
CoeCooperationRoleModel roleModel = new CoeCooperationRoleDao().queryById(roleId);
|
||||||
|
if (null == roleModel) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
//获取角色下数据权限,设置数据权限
|
||||||
|
List<CoeCooperationRolePermModel> rolePerms = new CoeCooperationRolePermDao().getRolePermByTeamIdAndRoleId(teamId, roleId);
|
||||||
|
for (CoeCooperationRolePermModel rolePerm : rolePerms) {
|
||||||
|
Set<String> dataPerm = map.get(rolePerm.getPalVersionId());
|
||||||
|
if (null == dataPerm){
|
||||||
|
dataPerm = new HashSet<>();
|
||||||
|
}
|
||||||
|
if (StringUtils.isNotEmpty(rolePerm.getActionPerm())){
|
||||||
|
dataPerm.addAll(Arrays.asList(rolePerm.getActionPerm().split(",").clone()));
|
||||||
|
}
|
||||||
|
map.put(rolePerm.getPalVersionId(), dataPerm);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,16 +1,21 @@
|
|||||||
package com.actionsoft.apps.coe.pal.cooperation.cache;
|
package com.actionsoft.apps.coe.pal.cooperation.cache;
|
||||||
|
|
||||||
import com.actionsoft.apps.coe.pal.cooperation.CooperationQueryAPIManager;
|
|
||||||
|
import com.actionsoft.apps.coe.pal.constant.CoEConstant;
|
||||||
|
import com.actionsoft.apps.coe.pal.cooperation.CoeCooperationAPIManager;
|
||||||
import com.actionsoft.apps.coe.pal.cooperation.cache.model.TeamInfo;
|
import com.actionsoft.apps.coe.pal.cooperation.cache.model.TeamInfo;
|
||||||
import com.actionsoft.apps.coe.pal.cooperation.cache.model.UserInfo;
|
import com.actionsoft.apps.coe.pal.cooperation.cache.model.UserInfo;
|
||||||
import com.actionsoft.apps.coe.pal.cooperation.constant.Constant;
|
import com.actionsoft.apps.coe.pal.cooperation.constant.CoeCooperationConst;
|
||||||
import com.actionsoft.apps.coe.pal.cooperation.extend.CooperationAppManager;
|
import com.actionsoft.apps.coe.pal.pal.repository.cache.PALRepositoryCache;
|
||||||
import com.actionsoft.apps.coe.pal.cooperation.extend.CooperationAppProfile;
|
import com.actionsoft.apps.coe.pal.pal.repository.model.PALRepositoryModel;
|
||||||
import com.actionsoft.apps.resource.plugin.profile.CachePluginProfile;
|
import com.actionsoft.apps.resource.plugin.profile.CachePluginProfile;
|
||||||
import com.actionsoft.bpms.commons.cache.Cache;
|
import com.actionsoft.bpms.commons.cache.Cache;
|
||||||
import com.actionsoft.bpms.commons.cache.CacheManager;
|
import com.actionsoft.bpms.commons.cache.CacheManager;
|
||||||
|
import com.actionsoft.bpms.commons.mvc.view.ResponseObject;
|
||||||
import com.actionsoft.bpms.util.ConsolePrinter;
|
import com.actionsoft.bpms.util.ConsolePrinter;
|
||||||
import com.actionsoft.sdk.local.SDK;
|
import com.actionsoft.sdk.local.SDK;
|
||||||
|
import com.actionsoft.sdk.local.api.AppAPI;
|
||||||
|
import com.alibaba.fastjson.JSONArray;
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
@ -22,13 +27,13 @@ public class CooperationCache extends Cache<String, TeamInfo> {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void load() {
|
protected void load() {
|
||||||
List<TeamInfo> allTeamInfo = CooperationQueryAPIManager.getInstance().getAllTeamInfo();
|
List<TeamInfo> allTeamInfo = CoeCooperationAPIManager.getInstance().getAllTeamInfo();
|
||||||
for (TeamInfo teamInfo : allTeamInfo) {
|
for (TeamInfo teamInfo : allTeamInfo) {
|
||||||
put(teamInfo.getTeamId(),teamInfo);
|
put(teamInfo.getTeamId(),teamInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
//平台console打印
|
//平台console打印
|
||||||
ConsolePrinter.info("[" + SDK.getAppAPI().getAppContext(Constant.APP_ID).getNameI18N() + "]Cache加载pal 小组用户角色权限信息 [" + (( allTeamInfo == null) ? 0 : allTeamInfo.size()) + "个]");
|
ConsolePrinter.info("[" + SDK.getAppAPI().getAppContext(CoEConstant.APP_ID).getNameI18N() + "]Cache加载pal 小组用户角色权限信息 [" + (( allTeamInfo == null) ? 0 : allTeamInfo.size()) + "个]");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -74,6 +79,9 @@ public class CooperationCache extends Cache<String, TeamInfo> {
|
|||||||
*/
|
*/
|
||||||
public static UserInfo getUserInfo(String teamId,String userid){
|
public static UserInfo getUserInfo(String teamId,String userid){
|
||||||
TeamInfo teamInfo = getCache().get(teamId);
|
TeamInfo teamInfo = getCache().get(teamId);
|
||||||
|
if (null == teamInfo){
|
||||||
|
return null;
|
||||||
|
}
|
||||||
for (UserInfo user : teamInfo.getUsers()) {
|
for (UserInfo user : teamInfo.getUsers()) {
|
||||||
if (user.getUserid().equals(userid)){
|
if (user.getUserid().equals(userid)){
|
||||||
return user;
|
return user;
|
||||||
@ -120,30 +128,54 @@ public class CooperationCache extends Cache<String, TeamInfo> {
|
|||||||
if (null == userInfo){
|
if (null == userInfo){
|
||||||
return new HashSet<>();
|
return new HashSet<>();
|
||||||
}
|
}
|
||||||
String appPerm = userInfo.getAppPermission();
|
Set<String> appPermission = userInfo.getAppPermission();
|
||||||
if ("all".equals(appPerm)){
|
if (appPermission.contains("all")){
|
||||||
Set<String> set = new HashSet<>();
|
Set<String> set = new HashSet<>();
|
||||||
List<CooperationAppProfile> appProfiles = CooperationAppManager.getList();
|
// aslp服务地址
|
||||||
for (CooperationAppProfile profile : appProfiles) {
|
String aslp = "aslp://com.actionsoft.apps.coe.pal.cooperation/listApps";
|
||||||
set.add(profile.getId());
|
//列出已注册的流程团队扩展App
|
||||||
|
ResponseObject ro = SDK.getAppAPI().callASLP(SDK.getAppAPI().getAppContext(CoEConstant.APP_ID), aslp, new HashMap<String, Object>());
|
||||||
|
if (ro.isOk()) {
|
||||||
|
JSONArray appArr = (JSONArray)((Map)ro.getData()).get("apps");
|
||||||
|
for (int i = 0; i < appArr.size(); i++) {
|
||||||
|
set.add(appArr.getJSONObject(i).getString("id"));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return set;
|
return set;
|
||||||
}
|
}
|
||||||
return Arrays.stream(appPerm.split(",")).collect(Collectors.toSet());
|
return appPermission;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据小组与用户id获取用户数据访问权限
|
* 根据小组与用户id获取用户数据访问权限
|
||||||
* @param teamId
|
* @param teamId
|
||||||
* @param userid
|
* @param userid
|
||||||
|
* @param isValidPermData 查询使用中的文件标志,true:过滤掉进入回收站的数据,false:查询全部权限数据
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public static Set<String> getUserDataVisitablePermission(String teamId,String userid){
|
public static Set<String> getUserDataVisitablePermission(String teamId,String userid,boolean isValidPermData){
|
||||||
UserInfo userInfo = CooperationCache.getUserInfo(teamId, userid);
|
UserInfo userInfo = CooperationCache.getUserInfo(teamId, userid);
|
||||||
if (null == userInfo){
|
if (null == userInfo){
|
||||||
return new HashSet<>();
|
return new HashSet<>();
|
||||||
}
|
}
|
||||||
return userInfo.getDataPermission().keySet();
|
if (userInfo.getIsAllDataPermission()){
|
||||||
|
TeamInfo teamInfo = CooperationCache.getTeamInfo(teamId);
|
||||||
|
return teamInfo.getVersionIds();
|
||||||
|
}
|
||||||
|
Set<String> set = new HashSet<>();
|
||||||
|
Set<String> keySet = userInfo.getDataPermission().keySet();
|
||||||
|
for (String next : keySet) {
|
||||||
|
if (isValidPermData) {
|
||||||
|
// 在流程表的校验,抛弃回收站中删除文件
|
||||||
|
List<PALRepositoryModel> verModels = PALRepositoryCache.getByVersionId(next);
|
||||||
|
if (verModels != null && verModels.size() > 0) {
|
||||||
|
set.add(next);
|
||||||
|
}
|
||||||
|
}else {
|
||||||
|
set.add(next);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return set;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -158,6 +190,9 @@ public class CooperationCache extends Cache<String, TeamInfo> {
|
|||||||
if (null == userInfo){
|
if (null == userInfo){
|
||||||
return new HashSet<>();
|
return new HashSet<>();
|
||||||
}
|
}
|
||||||
|
if (userInfo.getIsAllDataPermission()){
|
||||||
|
return Arrays.stream(new String [] {CoeCooperationConst.ACTION_WRITE,CoeCooperationConst.ACTION_DELETE,CoeCooperationConst.ACTION_VERSION}).collect(Collectors.toSet());
|
||||||
|
}
|
||||||
return userInfo.getDataPermission().get(versionId);
|
return userInfo.getDataPermission().get(versionId);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1,7 +1,9 @@
|
|||||||
package com.actionsoft.apps.coe.pal.cooperation.cache.model;
|
package com.actionsoft.apps.coe.pal.cooperation.cache.model;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
import java.util.HashSet;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
public class TeamInfo implements Serializable {
|
public class TeamInfo implements Serializable {
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
@ -10,6 +12,8 @@ public class TeamInfo implements Serializable {
|
|||||||
|
|
||||||
private List<UserInfo> users;
|
private List<UserInfo> users;
|
||||||
|
|
||||||
|
private Set<String> versionIds = new HashSet<>();
|
||||||
|
|
||||||
public TeamInfo() {}
|
public TeamInfo() {}
|
||||||
|
|
||||||
public String getTeamId() {
|
public String getTeamId() {
|
||||||
@ -27,4 +31,12 @@ public class TeamInfo implements Serializable {
|
|||||||
public void setUsers(List<UserInfo> users) {
|
public void setUsers(List<UserInfo> users) {
|
||||||
this.users = users;
|
this.users = users;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Set<String> getVersionIds() {
|
||||||
|
return versionIds;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setVersionIds(Set<String> versionIds) {
|
||||||
|
this.versionIds = versionIds;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@ -9,7 +9,7 @@ public class UserInfo implements Serializable {
|
|||||||
private String userid;
|
private String userid;
|
||||||
private List<String> roleIds = new ArrayList<>();
|
private List<String> roleIds = new ArrayList<>();
|
||||||
private Set<String> operatePermission = new HashSet<>();
|
private Set<String> operatePermission = new HashSet<>();
|
||||||
private String appPermission ;
|
private Set<String> appPermission = new HashSet<>();
|
||||||
private Map<String,Set<String>> dataPermission = new HashMap<>();
|
private Map<String,Set<String>> dataPermission = new HashMap<>();
|
||||||
private boolean isAllDataPermission;
|
private boolean isAllDataPermission;
|
||||||
|
|
||||||
@ -40,11 +40,11 @@ public class UserInfo implements Serializable {
|
|||||||
this.operatePermission = operatePermission;
|
this.operatePermission = operatePermission;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getAppPermission() {
|
public Set<String> getAppPermission() {
|
||||||
return appPermission;
|
return appPermission;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setAppPermission(String appPermission) {
|
public void setAppPermission(Set<String> appPermission) {
|
||||||
this.appPermission = appPermission;
|
this.appPermission = appPermission;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -52,7 +52,7 @@ public class UserInfo implements Serializable {
|
|||||||
return dataPermission;
|
return dataPermission;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setIsDataPermission(Map<String, Set<String>> dataPermission) {
|
public void setDataPermission(Map<String, Set<String>> dataPermission) {
|
||||||
this.dataPermission = dataPermission;
|
this.dataPermission = dataPermission;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -61,4 +61,14 @@ public class CoeCooperationConst {
|
|||||||
*/
|
*/
|
||||||
public static final String ACTION_VERSION = "v";
|
public static final String ACTION_VERSION = "v";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新版角色操作权限:新建流程
|
||||||
|
*/
|
||||||
|
public static final String ACTION_CREATE_PROCESS = "createProcess";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新版角色操作权限:新建流程
|
||||||
|
*/
|
||||||
|
public static final String ACTION_BATCH = "batch";
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -151,6 +151,14 @@ public class CoEOpLogConst extends AuditConst {
|
|||||||
public static final String INFO_OUTPUT_DOWNLOAD = "下载报告手册文档";
|
public static final String INFO_OUTPUT_DOWNLOAD = "下载报告手册文档";
|
||||||
public static final String INFO_OUTPUT_DOWNLOAD_LOG = "下载报告手册文档日志";
|
public static final String INFO_OUTPUT_DOWNLOAD_LOG = "下载报告手册文档日志";
|
||||||
|
|
||||||
|
// 数据迁移
|
||||||
|
public static final String INFO_DATAMIGRATION_ACCESS = "访问数据迁移模块";
|
||||||
|
public static final String INFO_DATAMIGRATION_CREATE = "新建数据迁移";
|
||||||
|
public static final String INFO_DATAMIGRATION_UPDATE = "更新数据迁移";
|
||||||
|
public static final String INFO_DATAMIGRATION_DELETE = "访问数据迁移";
|
||||||
|
public static final String INFO_DATAMIGRATION_DOWNLOAD_LOG = "下载数据迁移日志";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -418,24 +418,26 @@ public class PalManageWeb extends ActionWeb {
|
|||||||
tempSchema = replaceTextEPC(tempSchema);
|
tempSchema = replaceTextEPC(tempSchema);
|
||||||
List<String> list = getSchemaToJson(tempSchema);
|
List<String> list = getSchemaToJson(tempSchema);
|
||||||
String type = I18nRes.findValue(CoEConstant.APP_ID, methodId.split("\\.")[0]);
|
String type = I18nRes.findValue(CoEConstant.APP_ID, methodId.split("\\.")[0]);
|
||||||
|
// 建模对象描述
|
||||||
|
JSONObject methodObjectDesc = SDK.getAppAPI().getPropertyJSONObjectValue(CoEConstant.APP_ID, "METHOD_OBJECT_DESC", new JSONObject());
|
||||||
JSONArray data = new JSONArray();
|
JSONArray data = new JSONArray();
|
||||||
for (int i = 0; i < list.size(); i++) {
|
for (int i = 0; i < list.size(); i++) {
|
||||||
String s = list.get(i);
|
String s = list.get(i);
|
||||||
String name = "";
|
String name = "";
|
||||||
String title = "";
|
String title = "";
|
||||||
if (s.contains("name:\"")) {
|
if (s.contains("name:\"")) {
|
||||||
s = s.substring(s.indexOf("name:\""), s.length());
|
s = s.substring(s.indexOf("name:\""));
|
||||||
name = s.substring(s.indexOf("name:\"") + 6, s.indexOf("\","));
|
name = s.substring(s.indexOf("name:\"") + 6, s.indexOf("\","));
|
||||||
} else {
|
} else {
|
||||||
s = s.substring(s.indexOf("name:"), s.length());
|
s = s.substring(s.indexOf("name:"));
|
||||||
name = s.substring(s.indexOf("name:") + 5, s.indexOf("\","));
|
name = s.substring(s.indexOf("name:") + 5, s.indexOf("\","));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (s.contains("title:\"")) {
|
if (s.contains("title:\"")) {
|
||||||
s = s.substring(s.indexOf("title:\""), s.length());
|
s = s.substring(s.indexOf("title:\""));
|
||||||
title = s.substring(s.indexOf("title:\"") + 7, s.indexOf("\","));
|
title = s.substring(s.indexOf("title:\"") + 7, s.indexOf("\","));
|
||||||
} else {
|
} else {
|
||||||
s = s.substring(s.indexOf("title:"), s.length());
|
s = s.substring(s.indexOf("title:"));
|
||||||
title = s.substring(s.indexOf("title:") + 6, s.indexOf(","));
|
title = s.substring(s.indexOf("title:") + 6, s.indexOf(","));
|
||||||
}
|
}
|
||||||
if ("Participant".equals(title) || "VerticalSeparatorBar".equals(title) || "verticalSeparatorBar".equals(name) || "horizontalSeparatorBar".equals(name)) {
|
if ("Participant".equals(title) || "VerticalSeparatorBar".equals(title) || "verticalSeparatorBar".equals(name) || "horizontalSeparatorBar".equals(name)) {
|
||||||
@ -452,6 +454,12 @@ public class PalManageWeb extends ActionWeb {
|
|||||||
obj.put("modelId", methodId);
|
obj.put("modelId", methodId);
|
||||||
obj.put("type", type);
|
obj.put("type", type);
|
||||||
obj.put("showShapeConfig", !name.equals("horizontalSeparator") && !name.equals("verticalSeparator"));
|
obj.put("showShapeConfig", !name.equals("horizontalSeparator") && !name.equals("verticalSeparator"));
|
||||||
|
// 描述信息查询
|
||||||
|
String desc = "";
|
||||||
|
if (methodObjectDesc.containsKey(methodId) && methodObjectDesc.getJSONObject(methodId).containsKey(name) && methodObjectDesc.getJSONObject(methodId).getJSONObject(name).containsKey("desc")) {
|
||||||
|
desc = methodObjectDesc.getJSONObject(methodId).getJSONObject(name).getString("desc");
|
||||||
|
}
|
||||||
|
obj.put("desc", desc);
|
||||||
data.add(obj);
|
data.add(obj);
|
||||||
}
|
}
|
||||||
ro.put("data", data);
|
ro.put("data", data);
|
||||||
@ -1410,4 +1418,25 @@ public class PalManageWeb extends ActionWeb {
|
|||||||
return HtmlPageTemplate.merge(CoEConstant.APP_ID, template, map);
|
return HtmlPageTemplate.merge(CoEConstant.APP_ID, template, map);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 保存形状定义描述
|
||||||
|
* @param shapeName 形状name
|
||||||
|
* @param desc 形状定义描述
|
||||||
|
* @param methodId 建模方法
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public String saveMethodObjectDesc(String shapeName, String desc, String methodId) {
|
||||||
|
ResponseObject ro = ResponseObject.newOkResponse();
|
||||||
|
desc = desc == null ? "" : desc.trim();
|
||||||
|
JSONObject methodObjectDesc = SDK.getAppAPI().getPropertyJSONObjectValue(CoEConstant.APP_ID, "METHOD_OBJECT_DESC", new JSONObject());
|
||||||
|
if (!methodObjectDesc.containsKey(methodId)) {
|
||||||
|
methodObjectDesc.put(methodId, new JSONObject());
|
||||||
|
}
|
||||||
|
if (!methodObjectDesc.getJSONObject(methodId).containsKey(shapeName)) {
|
||||||
|
methodObjectDesc.getJSONObject(methodId).put(shapeName, new JSONObject());
|
||||||
|
}
|
||||||
|
methodObjectDesc.getJSONObject(methodId).getJSONObject(shapeName).put("desc", desc);
|
||||||
|
SDK.getAppAPI().setProperty(CoEConstant.APP_ID, "METHOD_OBJECT_DESC", methodObjectDesc.toString());
|
||||||
|
return ro.toString();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
package com.actionsoft.apps.coe.pal.pal.output;
|
package com.actionsoft.apps.coe.pal.pal.output;
|
||||||
import java.io.FileInputStream;
|
|
||||||
|
import java.io.FileInputStream;
|
||||||
|
|
||||||
import java.io.ByteArrayInputStream;
|
import java.io.ByteArrayInputStream;
|
||||||
import java.io.ByteArrayOutputStream;
|
import java.io.ByteArrayOutputStream;
|
||||||
@ -35,227 +36,226 @@ import com.alibaba.fastjson.JSONObject;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 报告生成器内部API封装
|
* 报告生成器内部API封装
|
||||||
*
|
*
|
||||||
* @author jack
|
* @author jack
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
public class OutputAPIManager {
|
public class OutputAPIManager {
|
||||||
private static OutputAPIManager instance = new OutputAPIManager();
|
private static OutputAPIManager instance = new OutputAPIManager();
|
||||||
|
|
||||||
private OutputAPIManager() {
|
private OutputAPIManager() {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static OutputAPIManager getInstance() {
|
public static OutputAPIManager getInstance() {
|
||||||
return instance;
|
return instance;
|
||||||
}
|
}
|
||||||
|
|
||||||
// -------------------任务保存/提取----------------------
|
// -------------------任务保存/提取----------------------
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 保存向导限定目标范围、限定关联范围、报告选项等非数据库持久的JSON数据串
|
* 保存向导限定目标范围、限定关联范围、报告选项等非数据库持久的JSON数据串
|
||||||
*
|
*
|
||||||
* @param wsId 资产库id
|
* @param wsId 资产库id
|
||||||
* @param id 任务Id
|
* @param id 任务Id
|
||||||
* @param profileId 报告生成器扩展App的配置Id
|
* @param profileId 报告生成器扩展App的配置Id
|
||||||
* @param jsonData 拼装的json数据串
|
* @param jsonData 拼装的json数据串
|
||||||
*/
|
*/
|
||||||
public void saveWizardJsonData(String wsId, String id, String profileId, String jsonData) throws AWSException {
|
public void saveWizardJsonData(String wsId, String id, String profileId, String jsonData) throws AWSException {
|
||||||
// --------app appProfile----------
|
// --------app appProfile----------
|
||||||
OutputAppProfile appProfile = OutputAppManager.getProfile(profileId);
|
OutputAppProfile appProfile = OutputAppManager.getProfile(profileId);
|
||||||
if (appProfile == null)
|
if (appProfile == null)
|
||||||
throw new AWSException("Not Find OutputAppProfile! profileId=" + profileId);
|
throw new AWSException("Not Find OutputAppProfile! profileId=" + profileId);
|
||||||
// --------dc context-----------
|
// --------dc context-----------
|
||||||
DCPluginProfile dcProfile = SDK.getDCAPI().getDCProfile(appProfile.getAppContext().getId(), OutputConst.EXT_APP_DC_OUTPUT);
|
DCPluginProfile dcProfile = SDK.getDCAPI().getDCProfile(appProfile.getAppContext().getId(), OutputConst.EXT_APP_DC_OUTPUT);
|
||||||
if (dcProfile == null)
|
if (dcProfile == null)
|
||||||
throw new AWSException("Not Find DCProfile! repositoryName=" + OutputConst.EXT_APP_DC_OUTPUT);
|
throw new AWSException("Not Find DCProfile! repositoryName=" + OutputConst.EXT_APP_DC_OUTPUT);
|
||||||
DCContext dcContext = new DCContext(null, dcProfile, appProfile.getAppContext().getId(), wsId, id, OutputConst.FILE_WIZARD_CONFIG);
|
DCContext dcContext = new DCContext(null, dcProfile, appProfile.getAppContext().getId(), wsId, id, OutputConst.FILE_WIZARD_CONFIG);
|
||||||
InputStream in = null;
|
InputStream in = null;
|
||||||
try {
|
try {
|
||||||
in = new ByteArrayInputStream(jsonData.getBytes("UTF-8"));
|
in = new ByteArrayInputStream(jsonData.getBytes("UTF-8"));
|
||||||
boolean isSave = SDK.getDCAPI().write(in, dcContext);
|
boolean isSave = SDK.getDCAPI().write(in, dcContext);
|
||||||
if (!isSave) {
|
if (!isSave) {
|
||||||
throw new AWSException("Save Parameter Error!");
|
throw new AWSException("Save Parameter Error!");
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
throw new AWSException(e);
|
throw new AWSException(e);
|
||||||
} finally {
|
} finally {
|
||||||
try {
|
try {
|
||||||
if (in != null)
|
if (in != null)
|
||||||
in.close();
|
in.close();
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除文件
|
* 删除文件
|
||||||
*
|
*
|
||||||
* @param wsId 资产库id
|
* @param wsId 资产库id
|
||||||
* @param id 任务Id
|
* @param id 任务Id
|
||||||
* @param profileId 报告生成器扩展App的配置Id
|
* @param profileId 报告生成器扩展App的配置Id
|
||||||
* @throws AWSException
|
* @throws AWSException
|
||||||
*/
|
*/
|
||||||
public void delFile(String wsId, String id, String profileId) throws AWSException {
|
public void delFile(String wsId, String id, String profileId) throws AWSException {
|
||||||
UtilFile file = getFilePath(wsId, id, profileId);
|
UtilFile file = getFilePath(wsId, id, profileId);
|
||||||
if (file.isDirectory()) {
|
if (file.isDirectory()) {
|
||||||
File[] files = file.listFiles();
|
File[] files = file.listFiles();
|
||||||
for (File f : files) {
|
for (File f : files) {
|
||||||
if (f.exists()) {
|
if (f.exists()) {
|
||||||
boolean flag = f.getAbsoluteFile().delete();
|
boolean flag = f.getAbsoluteFile().delete();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
file.delete();
|
file.delete();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除资产库时同时删除文件
|
* 删除资产库时同时删除文件
|
||||||
*
|
*
|
||||||
* @param wsid 资产库id
|
* @throws AWSException
|
||||||
* @throws AWSException
|
* @param wsid 资产库id
|
||||||
*/
|
*/
|
||||||
public void delTaskByWsid(String wsid) throws AWSException {
|
public void delTaskByWsid(String wsid) throws AWSException {
|
||||||
List<OutputTaskModel> list = new OutputTask().getTasksByWsid(wsid);
|
List<OutputTaskModel> list = new OutputTask().getTasksByWsid(wsid);
|
||||||
if (new OutputTask().delTaskByWsid(wsid)) {
|
if (new OutputTask().delTaskByWsid(wsid)) {
|
||||||
String profileId = null;
|
String profileId = null;
|
||||||
for (OutputTaskModel model : list) {
|
for (OutputTaskModel model : list) {
|
||||||
profileId = model.getProfileId();
|
profileId = model.getProfileId();
|
||||||
delFile(wsid, model.getId(), model.getProfileId());
|
delFile(wsid, model.getId(), model.getProfileId());
|
||||||
}
|
}
|
||||||
if (profileId != null) {
|
if (profileId != null) {
|
||||||
delFile(wsid, "", profileId);
|
delFile(wsid, "", profileId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 得到文件
|
* 得到文件
|
||||||
*
|
*
|
||||||
* @param wsId 资产库id
|
* @param wsId 资产库id
|
||||||
* @param id 任务Id
|
* @param id 任务Id
|
||||||
* @param profileId 报告生成器扩展App的配置Id
|
* @param profileId 报告生成器扩展App的配置Id
|
||||||
* @throws AWSException
|
* @throws AWSException
|
||||||
*/
|
*/
|
||||||
public UtilFile getFilePath(String wsId, String id, String profileId) throws AWSException {
|
public UtilFile getFilePath(String wsId, String id, String profileId) throws AWSException {
|
||||||
OutputAppProfile appProfile = OutputAppManager.getProfile(profileId);
|
OutputAppProfile appProfile = OutputAppManager.getProfile(profileId);
|
||||||
if (appProfile == null)
|
if (appProfile == null)
|
||||||
throw new AWSException("Not Find OutputAppProfile! profileId=" + profileId);
|
throw new AWSException("Not Find OutputAppProfile! profileId=" + profileId);
|
||||||
DCPluginProfile dcProfile = SDK.getDCAPI().getDCProfile(appProfile.getAppContext().getId(), OutputConst.EXT_APP_DC_OUTPUT);
|
DCPluginProfile dcProfile = SDK.getDCAPI().getDCProfile(appProfile.getAppContext().getId(), OutputConst.EXT_APP_DC_OUTPUT);
|
||||||
if (dcProfile == null)
|
if (dcProfile == null)
|
||||||
throw new AWSException("Not Find DCProfile! repositoryName=" + OutputConst.EXT_APP_DC_OUTPUT);
|
throw new AWSException("Not Find DCProfile! repositoryName=" + OutputConst.EXT_APP_DC_OUTPUT);
|
||||||
DCContext dcContext = new DCContext(null, dcProfile, appProfile.getAppContext().getId(), wsId, id);
|
DCContext dcContext = new DCContext(null, dcProfile, appProfile.getAppContext().getId(), wsId, id);
|
||||||
UtilFile file = new UtilFile(dcContext.getPath());
|
UtilFile file = new UtilFile(dcContext.getPath());
|
||||||
return file;
|
return file;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 保存向导限定目标范围、限定关联范围、报告选项等非数据库持久的JSON数据串
|
* 保存向导限定目标范围、限定关联范围、报告选项等非数据库持久的JSON数据串
|
||||||
*
|
*
|
||||||
* @param wsId 资产库id
|
* @param wsId 资产库id
|
||||||
* @param id 任务Id
|
* @param id 任务Id
|
||||||
* @param profileId 报告生成器扩展App的配置Id
|
* @param profileId 报告生成器扩展App的配置Id
|
||||||
*/
|
*/
|
||||||
public String getWizardJsonData(String wsId, String id, String profileId) throws AWSException {
|
public String getWizardJsonData(String wsId, String id, String profileId) throws AWSException {
|
||||||
// --------app appProfile----------
|
// --------app appProfile----------
|
||||||
OutputAppProfile appProfile = OutputAppManager.getProfile(profileId);
|
OutputAppProfile appProfile = OutputAppManager.getProfile(profileId);
|
||||||
if (appProfile == null)
|
if (appProfile == null)
|
||||||
throw new AWSException("Not Find OutputAppProfile! profileId=" + profileId);
|
throw new AWSException("Not Find OutputAppProfile! profileId=" + profileId);
|
||||||
// --------dc context-----------
|
// --------dc context-----------
|
||||||
DCPluginProfile dcProfile = SDK.getDCAPI().getDCProfile(appProfile.getAppContext().getId(), OutputConst.EXT_APP_DC_OUTPUT);
|
DCPluginProfile dcProfile = SDK.getDCAPI().getDCProfile(appProfile.getAppContext().getId(), OutputConst.EXT_APP_DC_OUTPUT);
|
||||||
if (dcProfile == null)
|
if (dcProfile == null)
|
||||||
throw new AWSException("Not Find DCProfile! repositoryName=" + OutputConst.EXT_APP_DC_OUTPUT);
|
throw new AWSException("Not Find DCProfile! repositoryName=" + OutputConst.EXT_APP_DC_OUTPUT);
|
||||||
DCContext dcContext = new DCContext(null, dcProfile, appProfile.getAppContext().getId(), wsId, id, OutputConst.FILE_WIZARD_CONFIG);
|
DCContext dcContext = new DCContext(null, dcProfile, appProfile.getAppContext().getId(), wsId, id, OutputConst.FILE_WIZARD_CONFIG);
|
||||||
File configFile = new File(dcContext.getFilePath());
|
File configFile = new File(dcContext.getFilePath());
|
||||||
// 如果该配置还不存在,没有保存过
|
// 如果该配置还不存在,没有保存过
|
||||||
if (!configFile.exists()) {
|
if (!configFile.exists()) {
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
InputStream in = null;
|
InputStream in = null;
|
||||||
try {
|
try {
|
||||||
//in = SDK.getDCAPI().read(dcContext);
|
//in = SDK.getDCAPI().read(dcContext);
|
||||||
in = new FileInputStream(configFile);
|
in = new FileInputStream(configFile);
|
||||||
int b = -1;
|
int b = -1;
|
||||||
ByteArrayOutputStream baos = new ByteArrayOutputStream();
|
ByteArrayOutputStream baos = new ByteArrayOutputStream();
|
||||||
while((b=in.read())!=-1){
|
while ((b = in.read()) != -1) {
|
||||||
baos.write(b);
|
baos.write(b);
|
||||||
}
|
}
|
||||||
return baos.toString("UTF-8");
|
return baos.toString("UTF-8");
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
throw new AWSException(e);
|
throw new AWSException(e);
|
||||||
} finally {
|
} finally {
|
||||||
try {
|
try {
|
||||||
if (in != null)
|
if (in != null)
|
||||||
in.close();
|
in.close();
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// -------------------任务执行/操作----------------------
|
// -------------------任务执行/操作----------------------
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 克隆一个任务
|
* 克隆一个任务
|
||||||
*
|
*
|
||||||
* @param userId 操作人账户
|
* @param userId 操作人账户
|
||||||
* @param id 源任务id,必须是已执行完毕的
|
* @param id 源任务id,必须是已执行完毕的
|
||||||
* @throws AWSException
|
* @throws AWSException
|
||||||
*/
|
*/
|
||||||
public void cloneTask(String userId, String id) throws Exception {
|
public void cloneTask(String userId, String id) throws Exception {
|
||||||
OutputTaskModel outputTaskModel = new OutputTask().queryById(id);
|
OutputTaskModel outputTaskModel = new OutputTask().queryById(id);
|
||||||
if (outputTaskModel == null)
|
if (outputTaskModel == null)
|
||||||
throw new AWSException("Not Find outputTask! id=" + id);
|
throw new AWSException("Not Find outputTask! id=" + id);
|
||||||
if (outputTaskModel.getTaskState() != OutputConst.TASK_STATE_SUCESS && outputTaskModel.getTaskState() != OutputConst.TASK_STATE_ERROR)
|
if (outputTaskModel.getTaskState() != OutputConst.TASK_STATE_SUCESS && outputTaskModel.getTaskState() != OutputConst.TASK_STATE_ERROR)
|
||||||
throw new AWSException("Task State is " + outputTaskModel.getTaskState() + ", Refuse to Clone!");
|
throw new AWSException("Task State is " + outputTaskModel.getTaskState() + ", Refuse to Clone!");
|
||||||
OutputAppProfile appProfile = OutputAppManager.getProfile(outputTaskModel.getProfileId());
|
OutputAppProfile appProfile = OutputAppManager.getProfile(outputTaskModel.getProfileId());
|
||||||
if (appProfile == null)
|
if (appProfile == null)
|
||||||
throw new AWSException("Not Find OutputAppProfile! profileId=" + outputTaskModel.getProfileId());
|
throw new AWSException("Not Find OutputAppProfile! profileId=" + outputTaskModel.getProfileId());
|
||||||
// --------dc context-----------
|
// --------dc context-----------
|
||||||
DCPluginProfile dcProfile = SDK.getDCAPI().getDCProfile(appProfile.getAppContext().getId(), OutputConst.EXT_APP_DC_OUTPUT);
|
DCPluginProfile dcProfile = SDK.getDCAPI().getDCProfile(appProfile.getAppContext().getId(), OutputConst.EXT_APP_DC_OUTPUT);
|
||||||
if (dcProfile == null)
|
if (dcProfile == null)
|
||||||
throw new AWSException("Not Find DCProfile! repositoryName=" + OutputConst.EXT_APP_DC_OUTPUT);
|
throw new AWSException("Not Find DCProfile! repositoryName=" + OutputConst.EXT_APP_DC_OUTPUT);
|
||||||
DCContext sourceDcContext = new DCContext(null, dcProfile, appProfile.getAppContext().getId(), outputTaskModel.getWsId(), id, OutputConst.FILE_WIZARD_CONFIG);
|
DCContext sourceDcContext = new DCContext(null, dcProfile, appProfile.getAppContext().getId(), outputTaskModel.getWsId(), id, OutputConst.FILE_WIZARD_CONFIG);
|
||||||
//判断源文件是否存在
|
//判断源文件是否存在
|
||||||
UtilFile sourceFile = new UtilFile(sourceDcContext.getFilePath());
|
UtilFile sourceFile = new UtilFile(sourceDcContext.getFilePath());
|
||||||
if (!sourceFile.exists()) {
|
if (!sourceFile.exists()) {
|
||||||
throw new Exception("sourceFile not found");
|
throw new Exception("sourceFile not found");
|
||||||
}
|
}
|
||||||
outputTaskModel.setId(UUIDGener.getUUID());
|
outputTaskModel.setId(UUIDGener.getUUID());
|
||||||
outputTaskModel.setUserId(userId);
|
outputTaskModel.setUserId(userId);
|
||||||
new OutputTask().insert(outputTaskModel);
|
new OutputTask().insert(outputTaskModel);
|
||||||
// copy config.txt
|
// copy config.txt
|
||||||
DCContext targetDcContext = new DCContext(null, dcProfile, appProfile.getAppContext().getId(), outputTaskModel.getWsId(), outputTaskModel.getId(), OutputConst.FILE_WIZARD_CONFIG);
|
DCContext targetDcContext = new DCContext(null, dcProfile, appProfile.getAppContext().getId(), outputTaskModel.getWsId(), outputTaskModel.getId(), OutputConst.FILE_WIZARD_CONFIG);
|
||||||
SDK.getDCAPI().copyDCFile(sourceDcContext, targetDcContext);
|
SDK.getDCAPI().copyDCFile(sourceDcContext, targetDcContext);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 创建线程,执行报告生成任务
|
* 创建线程,执行报告生成任务
|
||||||
*
|
*
|
||||||
* @param id
|
* @param id
|
||||||
*/
|
*/
|
||||||
public void startTask(String id, UserContext uc) throws AWSException {
|
public void startTask(String id, UserContext uc) throws AWSException {
|
||||||
OutputTaskModel outputTaskModel = new OutputTask().queryById(id);
|
OutputTaskModel outputTaskModel = new OutputTask().queryById(id);
|
||||||
if (outputTaskModel == null)
|
if (outputTaskModel == null)
|
||||||
throw new AWSException("Not Find outputTask! id=" + id);
|
throw new AWSException("Not Find outputTask! id=" + id);
|
||||||
|
|
||||||
if (outputTaskModel.getTaskState() != OutputConst.TASK_STATE_NONE)
|
if (outputTaskModel.getTaskState() != OutputConst.TASK_STATE_NONE)
|
||||||
throw new AWSException("Task State is " + outputTaskModel.getTaskState() + ", Refuse to Start!");
|
throw new AWSException("Task State is " + outputTaskModel.getTaskState() + ", Refuse to Start!");
|
||||||
|
|
||||||
// --------app appProfile----------
|
// --------app appProfile----------
|
||||||
OutputAppProfile appProfile = OutputAppManager.getProfile(outputTaskModel.getProfileId());
|
OutputAppProfile appProfile = OutputAppManager.getProfile(outputTaskModel.getProfileId());
|
||||||
if (appProfile == null)
|
if (appProfile == null)
|
||||||
throw new AWSException("Not Find OutputAppProfile! profileId=" + outputTaskModel.getProfileId());
|
throw new AWSException("Not Find OutputAppProfile! profileId=" + outputTaskModel.getProfileId());
|
||||||
String gennerClass = appProfile.getGenerClass();
|
String gennerClass = appProfile.getGenerClass();
|
||||||
if (UtilString.isEmpty(gennerClass))
|
if (UtilString.isEmpty(gennerClass))
|
||||||
throw new AWSException("OutputAppProfile 'gennerClass' is Null! AppName=" + appProfile.getTitle());
|
throw new AWSException("OutputAppProfile 'gennerClass' is Null! AppName=" + appProfile.getTitle());
|
||||||
|
|
||||||
// --------dc context-----------
|
// --------dc context-----------
|
||||||
DCPluginProfile dcProfile = SDK.getDCAPI().getDCProfile(appProfile.getAppContext().getId(), OutputConst.EXT_APP_DC_OUTPUT);
|
DCPluginProfile dcProfile = SDK.getDCAPI().getDCProfile(appProfile.getAppContext().getId(), OutputConst.EXT_APP_DC_OUTPUT);
|
||||||
if (dcProfile == null)
|
if (dcProfile == null)
|
||||||
throw new AWSException("Not Find DCProfile! repositoryName=" + OutputConst.EXT_APP_DC_OUTPUT);
|
throw new AWSException("Not Find DCProfile! repositoryName=" + OutputConst.EXT_APP_DC_OUTPUT);
|
||||||
DCContext dcContext = new DCContext(uc, dcProfile, appProfile.getAppContext().getId(), outputTaskModel.getWsId(), id);
|
DCContext dcContext = new DCContext(uc, dcProfile, appProfile.getAppContext().getId(), outputTaskModel.getWsId(), id);
|
||||||
|
|
||||||
// ---------config---------------
|
// ---------config---------------
|
||||||
String wizardJsonData = getWizardJsonData(outputTaskModel.getWsId(), id, appProfile.getId());
|
String wizardJsonData = getWizardJsonData(outputTaskModel.getWsId(), id, appProfile.getId());
|
||||||
/*JSONObject object = JSONObject.parseObject(wizardJsonData);
|
/*JSONObject object = JSONObject.parseObject(wizardJsonData);
|
||||||
|
|
||||||
String fileIds = object.getString("targetFileId");
|
String fileIds = object.getString("targetFileId");
|
||||||
@ -274,251 +274,252 @@ public class OutputAPIManager {
|
|||||||
signalThread.setName("CoE Output Report Genner-" + appProfile.getTitle() + "-" + outputTaskModel.getTaskName() + "-" + arr[i]);
|
signalThread.setName("CoE Output Report Genner-" + appProfile.getTitle() + "-" + outputTaskModel.getTaskName() + "-" + arr[i]);
|
||||||
signalThread.start();
|
signalThread.start();
|
||||||
}*/
|
}*/
|
||||||
|
|
||||||
// start thread
|
|
||||||
GennerReport gener = new GennerReport(outputTaskModel, appProfile, dcContext, wizardJsonData);
|
|
||||||
|
|
||||||
Thread signalThread = new Thread(gener);
|
|
||||||
signalThread.setName("CoE Output Report Genner-" + appProfile.getTitle() + "-" + outputTaskModel.getTaskName());
|
|
||||||
signalThread.start();
|
|
||||||
// 操作行为日志记录
|
|
||||||
if (SDK.getAppAPI().getPropertyBooleanValue(CoEConstant.APP_ID, "IS_RECORD_OP_LOG", false)) {
|
|
||||||
CoEOpLogAPI.auditOkOp(uc, CoEOpLogConst.MODULE_CATEGORY_APPCENTER, CoEOpLogConst.OP_CREATE, CoEOpLogConst.INFO_OUTPUT_CREATE);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 创建线程,执行报告生成任务
|
|
||||||
*
|
|
||||||
* @param id
|
|
||||||
*/
|
|
||||||
public ResponseObject startTaskAndReturnResult(String id, UserContext uc) throws AWSException {
|
|
||||||
OutputTaskModel outputTaskModel = new OutputTask().queryById(id);
|
|
||||||
if (outputTaskModel == null)
|
|
||||||
throw new AWSException("Not Find outputTask! id=" + id);
|
|
||||||
|
|
||||||
if (outputTaskModel.getTaskState() != OutputConst.TASK_STATE_NONE)
|
// start thread
|
||||||
throw new AWSException("Task State is " + outputTaskModel.getTaskState() + ", Refuse to Start!");
|
GennerReport gener = new GennerReport(outputTaskModel, appProfile, dcContext, wizardJsonData);
|
||||||
|
|
||||||
// --------app appProfile----------
|
Thread signalThread = new Thread(gener);
|
||||||
OutputAppProfile appProfile = OutputAppManager.getProfile(outputTaskModel.getProfileId());
|
signalThread.setName("CoE Output Report Genner-" + appProfile.getTitle() + "-" + outputTaskModel.getTaskName());
|
||||||
if (appProfile == null)
|
signalThread.start();
|
||||||
throw new AWSException("Not Find OutputAppProfile! profileId=" + outputTaskModel.getProfileId());
|
// 操作行为日志记录
|
||||||
String gennerClass = appProfile.getGenerClass();
|
if (SDK.getAppAPI().getPropertyBooleanValue(CoEConstant.APP_ID, "IS_RECORD_OP_LOG", false)) {
|
||||||
if (UtilString.isEmpty(gennerClass))
|
CoEOpLogAPI.auditOkOp(uc, CoEOpLogConst.MODULE_CATEGORY_APPCENTER, CoEOpLogConst.OP_CREATE, CoEOpLogConst.INFO_OUTPUT_CREATE);
|
||||||
throw new AWSException("OutputAppProfile 'gennerClass' is Null! AppName=" + appProfile.getTitle());
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// --------dc context-----------
|
/**
|
||||||
DCPluginProfile dcProfile = SDK.getDCAPI().getDCProfile(appProfile.getAppContext().getId(), OutputConst.EXT_APP_DC_OUTPUT);
|
* 创建线程,执行报告生成任务
|
||||||
if (dcProfile == null)
|
*
|
||||||
throw new AWSException("Not Find DCProfile! repositoryName=" + OutputConst.EXT_APP_DC_OUTPUT);
|
* @param id
|
||||||
DCContext dcContext = new DCContext(uc, dcProfile, appProfile.getAppContext().getId(), outputTaskModel.getWsId(), id);
|
*/
|
||||||
|
public ResponseObject startTaskAndReturnResult(String id, UserContext uc) throws AWSException {
|
||||||
|
OutputTaskModel outputTaskModel = new OutputTask().queryById(id);
|
||||||
|
if (outputTaskModel == null)
|
||||||
|
throw new AWSException("Not Find outputTask! id=" + id);
|
||||||
|
|
||||||
// ---------config---------------
|
if (outputTaskModel.getTaskState() != OutputConst.TASK_STATE_NONE)
|
||||||
String wizardJsonData = getWizardJsonData(outputTaskModel.getWsId(), id, appProfile.getId());
|
throw new AWSException("Task State is " + outputTaskModel.getTaskState() + ", Refuse to Start!");
|
||||||
|
|
||||||
CallableGennerReport gener = new CallableGennerReport(outputTaskModel, appProfile, dcContext, wizardJsonData);
|
|
||||||
FutureTask<ResponseObject> task = new FutureTask<>(gener);
|
|
||||||
Thread signalThread = new Thread(task);
|
|
||||||
signalThread.setName("CoE Output Report Genner-" + appProfile.getTitle() + "-" + outputTaskModel.getTaskName());
|
|
||||||
signalThread.start();
|
|
||||||
try {
|
|
||||||
return task.get();
|
|
||||||
} catch (InterruptedException | ExecutionException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
return ResponseObject.newErrResponse();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
// --------app appProfile----------
|
||||||
* 三员管理模式下,重新生成步骤横表手册
|
OutputAppProfile appProfile = OutputAppManager.getProfile(outputTaskModel.getProfileId());
|
||||||
* @param outputTaskModel
|
if (appProfile == null)
|
||||||
*/
|
throw new AWSException("Not Find OutputAppProfile! profileId=" + outputTaskModel.getProfileId());
|
||||||
public void reGennerReport(UserContext uc,OutputTaskModel outputTaskModel,String id){
|
String gennerClass = appProfile.getGenerClass();
|
||||||
|
if (UtilString.isEmpty(gennerClass))
|
||||||
|
throw new AWSException("OutputAppProfile 'gennerClass' is Null! AppName=" + appProfile.getTitle());
|
||||||
|
|
||||||
if (outputTaskModel == null)
|
// --------dc context-----------
|
||||||
throw new AWSException("Not Find outputTask! ");
|
DCPluginProfile dcProfile = SDK.getDCAPI().getDCProfile(appProfile.getAppContext().getId(), OutputConst.EXT_APP_DC_OUTPUT);
|
||||||
|
if (dcProfile == null)
|
||||||
|
throw new AWSException("Not Find DCProfile! repositoryName=" + OutputConst.EXT_APP_DC_OUTPUT);
|
||||||
|
DCContext dcContext = new DCContext(uc, dcProfile, appProfile.getAppContext().getId(), outputTaskModel.getWsId(), id);
|
||||||
|
|
||||||
// --------app appProfile----------
|
// ---------config---------------
|
||||||
OutputAppProfile appProfile = OutputAppManager.getProfile(outputTaskModel.getProfileId());
|
String wizardJsonData = getWizardJsonData(outputTaskModel.getWsId(), id, appProfile.getId());
|
||||||
if (appProfile == null)
|
|
||||||
throw new AWSException("Not Find OutputAppProfile! profileId=" + outputTaskModel.getProfileId());
|
|
||||||
String gennerClass = appProfile.getGenerClass();
|
|
||||||
if (UtilString.isEmpty(gennerClass))
|
|
||||||
throw new AWSException("OutputAppProfile 'gennerClass' is Null! AppName=" + appProfile.getTitle());
|
|
||||||
|
|
||||||
// --------dc context-----------
|
CallableGennerReport gener = new CallableGennerReport(outputTaskModel, appProfile, dcContext, wizardJsonData);
|
||||||
DCPluginProfile dcProfile = SDK.getDCAPI().getDCProfile(appProfile.getAppContext().getId(), OutputConst.EXT_APP_DC_OUTPUT);
|
FutureTask<ResponseObject> task = new FutureTask<>(gener);
|
||||||
if (dcProfile == null)
|
Thread signalThread = new Thread(task);
|
||||||
throw new AWSException("Not Find DCProfile! repositoryName=" + OutputConst.EXT_APP_DC_OUTPUT);
|
signalThread.setName("CoE Output Report Genner-" + appProfile.getTitle() + "-" + outputTaskModel.getTaskName());
|
||||||
DCContext dcContext = new DCContext(uc, dcProfile, appProfile.getAppContext().getId(), outputTaskModel.getWsId(), id);
|
signalThread.start();
|
||||||
|
try {
|
||||||
|
return task.get();
|
||||||
|
} catch (InterruptedException | ExecutionException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
return ResponseObject.newErrResponse();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// ---------config---------------
|
/**
|
||||||
//获取原有config.txt的json
|
* 三员管理模式下,重新生成步骤横表手册
|
||||||
String wizardJsonData = getWizardJsonData(outputTaskModel.getWsId(), outputTaskModel.getId(), appProfile.getId());
|
*
|
||||||
|
* @param outputTaskModel
|
||||||
|
*/
|
||||||
|
public void reGennerReport(UserContext uc, OutputTaskModel outputTaskModel, String id) {
|
||||||
|
|
||||||
// 根据原有config保存新的配置
|
if (outputTaskModel == null)
|
||||||
this.saveWizardJsonData(outputTaskModel.getWsId(), id, outputTaskModel.getProfileId(), wizardJsonData);
|
throw new AWSException("Not Find outputTask! ");
|
||||||
|
|
||||||
//同步执行
|
// --------app appProfile----------
|
||||||
GennerReport gener = new GennerReport(outputTaskModel, appProfile, dcContext, wizardJsonData);
|
OutputAppProfile appProfile = OutputAppManager.getProfile(outputTaskModel.getProfileId());
|
||||||
gener.run();
|
if (appProfile == null)
|
||||||
}
|
throw new AWSException("Not Find OutputAppProfile! profileId=" + outputTaskModel.getProfileId());
|
||||||
|
String gennerClass = appProfile.getGenerClass();
|
||||||
|
if (UtilString.isEmpty(gennerClass))
|
||||||
|
throw new AWSException("OutputAppProfile 'gennerClass' is Null! AppName=" + appProfile.getTitle());
|
||||||
|
|
||||||
class CallableGennerReport implements Callable<ResponseObject> {
|
// --------dc context-----------
|
||||||
|
DCPluginProfile dcProfile = SDK.getDCAPI().getDCProfile(appProfile.getAppContext().getId(), OutputConst.EXT_APP_DC_OUTPUT);
|
||||||
|
if (dcProfile == null)
|
||||||
|
throw new AWSException("Not Find DCProfile! repositoryName=" + OutputConst.EXT_APP_DC_OUTPUT);
|
||||||
|
DCContext dcContext = new DCContext(uc, dcProfile, appProfile.getAppContext().getId(), outputTaskModel.getWsId(), id);
|
||||||
|
|
||||||
private OutputTaskModel task;
|
// ---------config---------------
|
||||||
private OutputAppProfile appProfile;
|
//获取原有config.txt的json
|
||||||
private DCContext dcContext;
|
String wizardJsonData = getWizardJsonData(outputTaskModel.getWsId(), outputTaskModel.getId(), appProfile.getId());
|
||||||
private String wizardJsonData;
|
|
||||||
|
|
||||||
public CallableGennerReport(OutputTaskModel task, OutputAppProfile appProfile, DCContext dcContext, String wizardJsonData) {
|
// 根据原有config保存新的配置
|
||||||
this.appProfile = appProfile;
|
this.saveWizardJsonData(outputTaskModel.getWsId(), id, outputTaskModel.getProfileId(), wizardJsonData);
|
||||||
this.task = task;
|
|
||||||
this.dcContext = dcContext;
|
//同步执行
|
||||||
this.wizardJsonData = wizardJsonData;
|
GennerReport gener = new GennerReport(outputTaskModel, appProfile, dcContext, wizardJsonData);
|
||||||
}
|
gener.run();
|
||||||
|
}
|
||||||
@Override
|
|
||||||
public ResponseObject call() throws Exception {
|
class CallableGennerReport implements Callable<ResponseObject> {
|
||||||
Constructor<?> cons = null;
|
|
||||||
try {
|
private OutputTaskModel task;
|
||||||
cons = ClassReflect.getConstructor(appProfile.getGenerClass(), null, appProfile.getAppContext());
|
private OutputAppProfile appProfile;
|
||||||
} catch (Exception e) {
|
private DCContext dcContext;
|
||||||
e.printStackTrace();
|
private String wizardJsonData;
|
||||||
SDK.getAppAPI().err(appProfile.getAppContext(), appProfile.getGenerClass() + "--" + e.toString());
|
|
||||||
return ResponseObject.newErrResponse();
|
public CallableGennerReport(OutputTaskModel task, OutputAppProfile appProfile, DCContext dcContext, String wizardJsonData) {
|
||||||
}
|
this.appProfile = appProfile;
|
||||||
// 获得该接口实现类实例
|
this.task = task;
|
||||||
try {
|
this.dcContext = dcContext;
|
||||||
Class generClass = appProfile.getAppContext().getBindClassLoader().loadClass(appProfile.getGenerClass());
|
this.wizardJsonData = wizardJsonData;
|
||||||
Object obj = cons.newInstance();
|
}
|
||||||
Method execute = generClass.getMethod("execute", new Class[] { OutputTaskModel.class, String.class, DCContext.class });
|
|
||||||
// 标记执行
|
@Override
|
||||||
new OutputTask().updateRunning(task.getId());
|
public ResponseObject call() throws Exception {
|
||||||
// 正式执行
|
Constructor<?> cons = null;
|
||||||
ResponseObject ro = (ResponseObject) execute.invoke(obj, new Object[] { task, wizardJsonData, dcContext });
|
try {
|
||||||
// 处理日志
|
cons = ClassReflect.getConstructor(appProfile.getGenerClass(), null, appProfile.getAppContext());
|
||||||
List<String> logs = (List<String>) ro.get("logs");
|
} catch (Exception e) {
|
||||||
if (logs != null && !logs.isEmpty()) {
|
e.printStackTrace();
|
||||||
StringBuilder sb = new StringBuilder();
|
SDK.getAppAPI().err(appProfile.getAppContext(), appProfile.getGenerClass() + "--" + e.toString());
|
||||||
for (String msg : logs) {
|
return ResponseObject.newErrResponse();
|
||||||
sb.append(msg + (AWSServerConf.isLinuxOS() ? "" : "\r") + "\n");
|
}
|
||||||
}
|
// 获得该接口实现类实例
|
||||||
// 保存日志文件
|
try {
|
||||||
InputStream in = null;
|
Class generClass = appProfile.getAppContext().getBindClassLoader().loadClass(appProfile.getGenerClass());
|
||||||
try {
|
Object obj = cons.newInstance();
|
||||||
in = new ByteArrayInputStream(sb.toString().getBytes("UTF-8"));
|
Method execute = generClass.getMethod("execute", new Class[]{OutputTaskModel.class, String.class, DCContext.class});
|
||||||
dcContext.setFileName(OutputConst.FILE_TASK_LOG);
|
// 标记执行
|
||||||
SDK.getDCAPI().write(in, dcContext);
|
new OutputTask().updateRunning(task.getId());
|
||||||
} catch (Exception e) {
|
// 正式执行
|
||||||
e.printStackTrace();
|
ResponseObject ro = (ResponseObject) execute.invoke(obj, new Object[]{task, wizardJsonData, dcContext});
|
||||||
} finally {
|
// 处理日志
|
||||||
try {
|
List<String> logs = (List<String>) ro.get("logs");
|
||||||
if (in != null)
|
if (logs != null && !logs.isEmpty()) {
|
||||||
in.close();
|
StringBuilder sb = new StringBuilder();
|
||||||
} catch (Exception e) {
|
for (String msg : logs) {
|
||||||
}
|
sb.append(msg + (AWSServerConf.isLinuxOS() ? "" : "\r") + "\n");
|
||||||
}
|
}
|
||||||
}
|
// 保存日志文件
|
||||||
// 标记结束
|
InputStream in = null;
|
||||||
if (ro.isOk()) {
|
try {
|
||||||
new OutputTask().updateSucess(task.getId());
|
in = new ByteArrayInputStream(sb.toString().getBytes("UTF-8"));
|
||||||
return ResponseObject.newOkResponse();
|
dcContext.setFileName(OutputConst.FILE_TASK_LOG);
|
||||||
} else {
|
SDK.getDCAPI().write(in, dcContext);
|
||||||
new OutputTask().updateError(task.getId());
|
} catch (Exception e) {
|
||||||
return ResponseObject.newErrResponse();
|
e.printStackTrace();
|
||||||
}
|
} finally {
|
||||||
} catch (Exception e) {
|
try {
|
||||||
e.printStackTrace();
|
if (in != null)
|
||||||
SDK.getAppAPI().err(appProfile.getAppContext(), appProfile.getGenerClass() + "--" + e.toString());
|
in.close();
|
||||||
return ResponseObject.newErrResponse();
|
} catch (Exception e) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
// 标记结束
|
||||||
|
if (ro.isOk()) {
|
||||||
/**
|
new OutputTask().updateSucess(task.getId());
|
||||||
* 得到限定范围的流程id
|
return ResponseObject.newOkResponse();
|
||||||
*
|
} else {
|
||||||
* @param wsId 资产库id
|
new OutputTask().updateError(task.getId());
|
||||||
* @param id 任务Id
|
return ResponseObject.newErrResponse();
|
||||||
* @param profileId 报告生成器扩展App的配置Id
|
}
|
||||||
* @return
|
} catch (Exception e) {
|
||||||
* @throws AWSException
|
e.printStackTrace();
|
||||||
*/
|
SDK.getAppAPI().err(appProfile.getAppContext(), appProfile.getGenerClass() + "--" + e.toString());
|
||||||
/* public String getargetFileIds(String wsId, String id, String profileId)
|
return ResponseObject.newErrResponse();
|
||||||
* throws AWSException { UtilFile file = new UtilFile(getFilePath(wsId, id,
|
}
|
||||||
* profileId) + "/" + OutputConst.FILE_WIZARD_CONFIG); if (file.exists()) {
|
}
|
||||||
* String config = file.readStr(); return
|
|
||||||
* JSONObject.fromObject(config).getString("targetFileId"); } return ""; } */
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 得到限定范围的流程id
|
||||||
|
*
|
||||||
|
* @param wsId 资产库id
|
||||||
|
* @param id 任务Id
|
||||||
|
* @param profileId 报告生成器扩展App的配置Id
|
||||||
|
* @return
|
||||||
|
* @throws AWSException
|
||||||
|
*/
|
||||||
|
/* public String getargetFileIds(String wsId, String id, String profileId)
|
||||||
|
* throws AWSException { UtilFile file = new UtilFile(getFilePath(wsId, id,
|
||||||
|
* profileId) + "/" + OutputConst.FILE_WIZARD_CONFIG); if (file.exists()) {
|
||||||
|
* String config = file.readStr(); return
|
||||||
|
* JSONObject.fromObject(config).getString("targetFileId"); } return ""; } */
|
||||||
}
|
}
|
||||||
|
|
||||||
class GennerReport implements Runnable {
|
class GennerReport implements Runnable {
|
||||||
private OutputTaskModel task;
|
private OutputTaskModel task;
|
||||||
private OutputAppProfile appProfile;
|
private OutputAppProfile appProfile;
|
||||||
private DCContext dcContext;
|
private DCContext dcContext;
|
||||||
private String wizardJsonData;
|
private String wizardJsonData;
|
||||||
|
|
||||||
public GennerReport(OutputTaskModel task, OutputAppProfile appProfile, DCContext dcContext, String wizardJsonData) {
|
public GennerReport(OutputTaskModel task, OutputAppProfile appProfile, DCContext dcContext, String wizardJsonData) {
|
||||||
this.appProfile = appProfile;
|
this.appProfile = appProfile;
|
||||||
this.task = task;
|
this.task = task;
|
||||||
this.dcContext = dcContext;
|
this.dcContext = dcContext;
|
||||||
this.wizardJsonData = wizardJsonData;
|
this.wizardJsonData = wizardJsonData;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void run() {
|
public void run() {
|
||||||
Constructor<?> cons = null;
|
Constructor<?> cons = null;
|
||||||
try {
|
try {
|
||||||
cons = ClassReflect.getConstructor(appProfile.getGenerClass(), null, appProfile.getAppContext());
|
cons = ClassReflect.getConstructor(appProfile.getGenerClass(), null, appProfile.getAppContext());
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
SDK.getAppAPI().err(appProfile.getAppContext(), appProfile.getGenerClass() + "--" + e.toString());
|
SDK.getAppAPI().err(appProfile.getAppContext(), appProfile.getGenerClass() + "--" + e.toString());
|
||||||
}
|
}
|
||||||
if (cons != null) {
|
if (cons != null) {
|
||||||
// 获得该接口实现类实例
|
// 获得该接口实现类实例
|
||||||
try {
|
try {
|
||||||
Class generClass = appProfile.getAppContext().getBindClassLoader().loadClass(appProfile.getGenerClass());
|
Class generClass = appProfile.getAppContext().getBindClassLoader().loadClass(appProfile.getGenerClass());
|
||||||
Object obj = cons.newInstance();
|
Object obj = cons.newInstance();
|
||||||
Method execute = generClass.getMethod("execute", new Class[] { OutputTaskModel.class, String.class, DCContext.class });
|
Method execute = generClass.getMethod("execute", new Class[]{OutputTaskModel.class, String.class, DCContext.class});
|
||||||
// 标记执行
|
// 标记执行
|
||||||
new OutputTask().updateRunning(task.getId());
|
new OutputTask().updateRunning(task.getId());
|
||||||
// 正式执行
|
// 正式执行
|
||||||
ResponseObject ro = (ResponseObject) execute.invoke(obj, new Object[] { task, wizardJsonData, dcContext });
|
ResponseObject ro = (ResponseObject) execute.invoke(obj, new Object[]{task, wizardJsonData, dcContext});
|
||||||
// 处理日志
|
// 处理日志
|
||||||
List<String> logs = (List<String>) ro.get("logs");
|
List<String> logs = (List<String>) ro.get("logs");
|
||||||
if (logs != null && !logs.isEmpty()) {
|
if (logs != null && !logs.isEmpty()) {
|
||||||
StringBuilder sb = new StringBuilder();
|
StringBuilder sb = new StringBuilder();
|
||||||
for (String msg : logs) {
|
for (String msg : logs) {
|
||||||
sb.append(msg + (AWSServerConf.isLinuxOS() ? "" : "\r") + "\n");
|
sb.append(msg + (AWSServerConf.isLinuxOS() ? "" : "\r") + "\n");
|
||||||
}
|
}
|
||||||
// 保存日志文件
|
// 保存日志文件
|
||||||
InputStream in = null;
|
InputStream in = null;
|
||||||
try {
|
try {
|
||||||
in = new ByteArrayInputStream(sb.toString().getBytes("UTF-8"));
|
in = new ByteArrayInputStream(sb.toString().getBytes("UTF-8"));
|
||||||
dcContext.setFileName(OutputConst.FILE_TASK_LOG);
|
dcContext.setFileName(OutputConst.FILE_TASK_LOG);
|
||||||
SDK.getDCAPI().write(in, dcContext);
|
SDK.getDCAPI().write(in, dcContext);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
} finally {
|
} finally {
|
||||||
try {
|
try {
|
||||||
if (in != null)
|
if (in != null)
|
||||||
in.close();
|
in.close();
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// 标记结束
|
// 标记结束
|
||||||
if (ro.isOk()) {
|
if (ro.isOk()) {
|
||||||
new OutputTask().updateSucess(task.getId());
|
new OutputTask().updateSucess(task.getId());
|
||||||
} else {
|
} else {
|
||||||
new OutputTask().updateError(task.getId());
|
new OutputTask().updateError(task.getId());
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
SDK.getAppAPI().err(appProfile.getAppContext(), appProfile.getGenerClass() + "--" + e.toString());
|
SDK.getAppAPI().err(appProfile.getAppContext(), appProfile.getGenerClass() + "--" + e.toString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -760,7 +760,7 @@ public class DesignerRelationShapeWeb extends ActionWeb {
|
|||||||
JSONArray jsonArr_new= new JSONArray();
|
JSONArray jsonArr_new= new JSONArray();
|
||||||
JSONArray objects=JSONArray.parseArray(treeJson);
|
JSONArray objects=JSONArray.parseArray(treeJson);
|
||||||
//角色图属性代码是role/绩效图属性代码是
|
//角色图属性代码是role/绩效图属性代码是
|
||||||
if (attrId.equals("role") || attrId.equals("performance")) {
|
if (attrId.equals("role") || attrId.equals("Process_performance_metrics")) {
|
||||||
if (objects != null) {
|
if (objects != null) {
|
||||||
for (int i = 0; i < objects.size(); i++) {
|
for (int i = 0; i < objects.size(); i++) {
|
||||||
JSONObject jsonObject = objects.getJSONObject(i);
|
JSONObject jsonObject = objects.getJSONObject(i);
|
||||||
|
|||||||
@ -5,6 +5,7 @@ import java.io.File;
|
|||||||
import java.io.FileOutputStream;
|
import java.io.FileOutputStream;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.UnsupportedEncodingException;
|
import java.io.UnsupportedEncodingException;
|
||||||
|
import java.nio.charset.StandardCharsets;
|
||||||
import java.sql.Timestamp;
|
import java.sql.Timestamp;
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
@ -183,11 +184,11 @@ public class CoeDesignerWeb extends ActionWeb {
|
|||||||
try {
|
try {
|
||||||
int size = myArray.size();
|
int size = myArray.size();
|
||||||
for (i = 0; i < size; i++) {
|
for (i = 0; i < size; i++) {
|
||||||
uid = myArray.get(i).toString();
|
uid = myArray.get(i);
|
||||||
if (uid.trim().equals(""))
|
if (uid.trim().equals(""))
|
||||||
continue;
|
continue;
|
||||||
uid = SDK.getORGAPI().getUserId(uid);
|
uid = SDK.getORGAPI().getUserId(uid);
|
||||||
UserModel model = (UserModel) UserCache.getModel(uid);
|
UserModel model = UserCache.getModel(uid);
|
||||||
String name = uid;
|
String name = uid;
|
||||||
if (model != null) {
|
if (model != null) {
|
||||||
name = model.getUserName();
|
name = model.getUserName();
|
||||||
@ -461,7 +462,7 @@ public class CoeDesignerWeb extends ActionWeb {
|
|||||||
if (!plModel.isPublish() && !isView && !plModel.isStop() && !plModel.isApproval()) {
|
if (!plModel.isPublish() && !isView && !plModel.isStop() && !plModel.isApproval()) {
|
||||||
CoeListenCacheManager manager = CoeListenCacheManager.getInstance();
|
CoeListenCacheManager manager = CoeListenCacheManager.getInstance();
|
||||||
Map<String, ListenClient> listenClients = manager.getCollaborationUsers(rUUID);
|
Map<String, ListenClient> listenClients = manager.getCollaborationUsers(rUUID);
|
||||||
StringBuilder userPhoto = new StringBuilder("");
|
StringBuilder userPhoto = new StringBuilder();
|
||||||
int userNum = 1;
|
int userNum = 1;
|
||||||
if (listenClients != null) {
|
if (listenClients != null) {
|
||||||
for (ListenClient listenClient : listenClients.values()) {
|
for (ListenClient listenClient : listenClients.values()) {
|
||||||
@ -502,11 +503,7 @@ public class CoeDesignerWeb extends ActionWeb {
|
|||||||
UtilFile utilFile = new UtilFile(p + "/" + plModel.getId() + ".png");
|
UtilFile utilFile = new UtilFile(p + "/" + plModel.getId() + ".png");
|
||||||
if (utilFile.exists()) {
|
if (utilFile.exists()) {
|
||||||
byte[] base64Bytes = Base64.encode(utilFile.readBytes());
|
byte[] base64Bytes = Base64.encode(utilFile.readBytes());
|
||||||
try {
|
diagram = "data:image/png;base64," + new String(base64Bytes, StandardCharsets.UTF_8);
|
||||||
diagram = "data:image/png;base64," + new String(base64Bytes, "UTF-8");
|
|
||||||
} catch (UnsupportedEncodingException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -604,6 +601,8 @@ public class CoeDesignerWeb extends ActionWeb {
|
|||||||
}
|
}
|
||||||
// 帮助工具栏扩展
|
// 帮助工具栏扩展
|
||||||
getHelptoolExtUrl(macroLibraries);
|
getHelptoolExtUrl(macroLibraries);
|
||||||
|
// 图形描述
|
||||||
|
getMethodObjectDesc(macroLibraries);
|
||||||
// 操作行为日志记录
|
// 操作行为日志记录
|
||||||
if (SDK.getAppAPI().getPropertyBooleanValue(CoEConstant.APP_ID, "IS_RECORD_OP_LOG", false)) {
|
if (SDK.getAppAPI().getPropertyBooleanValue(CoEConstant.APP_ID, "IS_RECORD_OP_LOG", false)) {
|
||||||
CoEOpLogAPI.auditOkOp(_uc, CoEOpLogConst.MODULE_CATEGORY_REPOSITORY, CoEOpLogConst.OP_ACCESS, CoEOpLogConst.INFO_REPOSITORY_ACCESS);
|
CoEOpLogAPI.auditOkOp(_uc, CoEOpLogConst.MODULE_CATEGORY_REPOSITORY, CoEOpLogConst.OP_ACCESS, CoEOpLogConst.INFO_REPOSITORY_ACCESS);
|
||||||
@ -624,6 +623,27 @@ public class CoeDesignerWeb extends ActionWeb {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取形状描述定义
|
||||||
|
* @param macroLibraries
|
||||||
|
*/
|
||||||
|
private void getMethodObjectDesc(Map<String, Object> macroLibraries) {
|
||||||
|
JSONObject result = new JSONObject();
|
||||||
|
JSONObject methodObjectDesc = SDK.getAppAPI().getPropertyJSONObjectValue(CoEConstant.APP_ID, "METHOD_OBJECT_DESC", new JSONObject());
|
||||||
|
for (String methodId : methodObjectDesc.keySet()) {
|
||||||
|
for (String shapeName : methodObjectDesc.getJSONObject(methodId).keySet()) {
|
||||||
|
JSONObject shapeObj = methodObjectDesc.getJSONObject(methodId).getJSONObject(shapeName);
|
||||||
|
if (shapeObj.containsKey("desc")) {
|
||||||
|
String desc = shapeObj.getString("desc");
|
||||||
|
if (desc != null && !"".equals(desc.trim())) {
|
||||||
|
result.put(methodId + '-' + shapeName, desc);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
macroLibraries.put("methodObjectDesc", result);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 帮助工具栏扩展
|
* 帮助工具栏扩展
|
||||||
* @param macroLibraries
|
* @param macroLibraries
|
||||||
@ -733,11 +753,7 @@ public class CoeDesignerWeb extends ActionWeb {
|
|||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
byte[] base64Bytes = Base64.encode(utilFile.readBytes());
|
byte[] base64Bytes = Base64.encode(utilFile.readBytes());
|
||||||
try {
|
diagram = "data:image/png;base64," + new String(base64Bytes, StandardCharsets.UTF_8);
|
||||||
diagram = "data:image/png;base64," + new String(base64Bytes, "UTF-8");
|
|
||||||
} catch (UnsupportedEncodingException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -913,7 +929,7 @@ public class CoeDesignerWeb extends ActionWeb {
|
|||||||
macroLibraries.put("checkouttime", UtilDate.getAliasDatetime(DesignerFileUtil.getCheckOutTime(appId, processDefId)));
|
macroLibraries.put("checkouttime", UtilDate.getAliasDatetime(DesignerFileUtil.getCheckOutTime(appId, processDefId)));
|
||||||
macroLibraries.put("checkoutip", DesignerFileUtil.getCheckOutIP(appId, processDefId));
|
macroLibraries.put("checkoutip", DesignerFileUtil.getCheckOutIP(appId, processDefId));
|
||||||
macroLibraries.put("user", getContext().getUID());
|
macroLibraries.put("user", getContext().getUID());
|
||||||
UserModel model = (UserModel) UserCache.getModel(getContext().getUID());
|
UserModel model = UserCache.getModel(getContext().getUID());
|
||||||
macroLibraries.put("currentUserName", model.getUserName());
|
macroLibraries.put("currentUserName", model.getUserName());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1441,7 +1457,7 @@ public class CoeDesignerWeb extends ActionWeb {
|
|||||||
|
|
||||||
public JSONArray getHistoryDataJson(String uuid) {
|
public JSONArray getHistoryDataJson(String uuid) {
|
||||||
JSONArray historyJson = new JSONArray();
|
JSONArray historyJson = new JSONArray();
|
||||||
PALRepositoryModel plModel = (PALRepositoryModel) CoeProcessLevelDaoFacotory.createCoeProcessLevel().getInstance(uuid);
|
PALRepositoryModel plModel = CoeProcessLevelDaoFacotory.createCoeProcessLevel().getInstance(uuid);
|
||||||
if (!"".equals(plModel.getFilePath())) {
|
if (!"".equals(plModel.getFilePath())) {
|
||||||
CoeFile jsonUtil = new CoeFile();
|
CoeFile jsonUtil = new CoeFile();
|
||||||
historyJson = jsonUtil.getHistoryJsonData(plModel.getFilePath());
|
historyJson = jsonUtil.getHistoryJsonData(plModel.getFilePath());
|
||||||
@ -1462,7 +1478,7 @@ public class CoeDesignerWeb extends ActionWeb {
|
|||||||
JSONObject json = new JSONObject();
|
JSONObject json = new JSONObject();
|
||||||
JSONArray versions = getHistoryDataJson(uuid);
|
JSONArray versions = getHistoryDataJson(uuid);
|
||||||
JSONObject users = new JSONObject();
|
JSONObject users = new JSONObject();
|
||||||
UserModel model = (UserModel) UserCache.getModel(getContext().getUID());
|
UserModel model = UserCache.getModel(getContext().getUID());
|
||||||
users.put(getContext().getUID(), model.getUserName());
|
users.put(getContext().getUID(), model.getUserName());
|
||||||
json.put("users", users);
|
json.put("users", users);
|
||||||
json.put("versions", versions);
|
json.put("versions", versions);
|
||||||
@ -1561,7 +1577,7 @@ public class CoeDesignerWeb extends ActionWeb {
|
|||||||
* @deprecated
|
* @deprecated
|
||||||
*/
|
*/
|
||||||
private Map<String, String> updateCPShapes(String olduuid, String uuId, String define) {
|
private Map<String, String> updateCPShapes(String olduuid, String uuId, String define) {
|
||||||
PALRepositoryModel levelModel = (PALRepositoryModel) CoeProcessLevelDaoFacotory.createCoeProcessLevel().getInstance(uuId);
|
PALRepositoryModel levelModel = CoeProcessLevelDaoFacotory.createCoeProcessLevel().getInstance(uuId);
|
||||||
String filePath = levelModel.getFilePath();
|
String filePath = levelModel.getFilePath();
|
||||||
filePath = filePath + File.separator + levelModel.getId();
|
filePath = filePath + File.separator + levelModel.getId();
|
||||||
UtilFile utilFile = new UtilFile(filePath);
|
UtilFile utilFile = new UtilFile(filePath);
|
||||||
@ -1582,11 +1598,7 @@ public class CoeDesignerWeb extends ActionWeb {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (list.size() > 0 && updateShapes(list, uuId)) {
|
if (list.size() > 0 && updateShapes(list, uuId)) {
|
||||||
try {
|
utilFile.write(messageJson.getBytes(StandardCharsets.UTF_8));
|
||||||
utilFile.write(messageJson.getBytes("utf-8"));
|
|
||||||
} catch (UnsupportedEncodingException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
DesignerRelationShapeCacheManager cache = DesignerRelationShapeCacheManager.getInstance();
|
DesignerRelationShapeCacheManager cache = DesignerRelationShapeCacheManager.getInstance();
|
||||||
Map<String, Set<JSONObject>> shapeMap = cache.getEventMap();
|
Map<String, Set<JSONObject>> shapeMap = cache.getEventMap();
|
||||||
@ -1691,7 +1703,7 @@ public class CoeDesignerWeb extends ActionWeb {
|
|||||||
if (uuid.indexOf("obj_") == 0) {
|
if (uuid.indexOf("obj_") == 0) {
|
||||||
photo = "data:image/png;base64," + BPMNIO.getBPMNImage( ProcessDefCache.getInstance().getModel(uuid).getAppId(), uuid);
|
photo = "data:image/png;base64," + BPMNIO.getBPMNImage( ProcessDefCache.getInstance().getModel(uuid).getAppId(), uuid);
|
||||||
} else {
|
} else {
|
||||||
PALRepositoryModel cplm = (PALRepositoryModel) CoeProcessLevelDaoFacotory.createCoeProcessLevel().getInstance(uuid);
|
PALRepositoryModel cplm = CoeProcessLevelDaoFacotory.createCoeProcessLevel().getInstance(uuid);
|
||||||
if (cplm != null) {
|
if (cplm != null) {
|
||||||
PALRepositoryQueryAPIManager.getInstance().checkImage(cplm.getId(), true, false);// 生成图片
|
PALRepositoryQueryAPIManager.getInstance().checkImage(cplm.getId(), true, false);// 生成图片
|
||||||
String path = cplm.getFilePath();
|
String path = cplm.getFilePath();
|
||||||
@ -1699,11 +1711,7 @@ public class CoeDesignerWeb extends ActionWeb {
|
|||||||
UtilFile utilFile = new UtilFile(path + "/" + cplm.getId() + ".png");
|
UtilFile utilFile = new UtilFile(path + "/" + cplm.getId() + ".png");
|
||||||
if (utilFile.exists()) {
|
if (utilFile.exists()) {
|
||||||
byte[] base64Bytes = Base64.encode(utilFile.readBytes());
|
byte[] base64Bytes = Base64.encode(utilFile.readBytes());
|
||||||
try {
|
photo = "data:image/png;base64," + new String(base64Bytes, StandardCharsets.UTF_8);
|
||||||
photo = "data:image/png;base64," + new String(base64Bytes, "UTF-8");
|
|
||||||
} catch (UnsupportedEncodingException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1846,7 +1854,7 @@ public class CoeDesignerWeb extends ActionWeb {
|
|||||||
FileOutputStream fos = null;
|
FileOutputStream fos = null;
|
||||||
try {
|
try {
|
||||||
fos = new FileOutputStream(exportFile);
|
fos = new FileOutputStream(exportFile);
|
||||||
fos.write(buffer.toString().getBytes("UTF-8"));
|
fos.write(buffer.toString().getBytes(StandardCharsets.UTF_8));
|
||||||
fos.flush();
|
fos.flush();
|
||||||
fos.close();
|
fos.close();
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
@ -1913,7 +1921,7 @@ public class CoeDesignerWeb extends ActionWeb {
|
|||||||
FileOutputStream fos = null;
|
FileOutputStream fos = null;
|
||||||
try {
|
try {
|
||||||
fos = new FileOutputStream(exportFile);
|
fos = new FileOutputStream(exportFile);
|
||||||
fos.write(JSON.toJSONString(object).getBytes("UTF-8"));
|
fos.write(JSON.toJSONString(object).getBytes(StandardCharsets.UTF_8));
|
||||||
fos.flush();
|
fos.flush();
|
||||||
fos.close();
|
fos.close();
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
@ -1935,7 +1943,7 @@ public class CoeDesignerWeb extends ActionWeb {
|
|||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
PALRepositoryModel cplm = (PALRepositoryModel) CoeProcessLevelDaoFacotory.createCoeProcessLevel().getInstance(uuid);
|
PALRepositoryModel cplm = CoeProcessLevelDaoFacotory.createCoeProcessLevel().getInstance(uuid);
|
||||||
if (cplm == null) throw new AWSException("流程未找到 " + uuid);
|
if (cplm == null) throw new AWSException("流程未找到 " + uuid);
|
||||||
PALRepositoryQueryAPIManager.getInstance().checkImage(cplm.getId(), true, true);// 生成图片
|
PALRepositoryQueryAPIManager.getInstance().checkImage(cplm.getId(), true, true);// 生成图片
|
||||||
String path = cplm.getFilePath();
|
String path = cplm.getFilePath();
|
||||||
@ -2052,7 +2060,7 @@ public class CoeDesignerWeb extends ActionWeb {
|
|||||||
if (!pdfDir.exists()) {
|
if (!pdfDir.exists()) {
|
||||||
pdfDir.mkdirs();
|
pdfDir.mkdirs();
|
||||||
}
|
}
|
||||||
String date = new SimpleDateFormat("yyyyMMdd").format(new Date()).toString();
|
String date = new SimpleDateFormat("yyyyMMdd").format(new Date());
|
||||||
/*File [] pdfFiles = pdfDir.listFiles(new MyFilenameFilter(date));
|
/*File [] pdfFiles = pdfDir.listFiles(new MyFilenameFilter(date));
|
||||||
int maxNo = 0;
|
int maxNo = 0;
|
||||||
if (pdfFiles != null && pdfFiles.length > 0) {
|
if (pdfFiles != null && pdfFiles.length > 0) {
|
||||||
@ -2214,7 +2222,7 @@ public class CoeDesignerWeb extends ActionWeb {
|
|||||||
if (isAdmin) {
|
if (isAdmin) {
|
||||||
shapes.append(methodModel.getSchema()).append("\r\n");
|
shapes.append(methodModel.getSchema()).append("\r\n");
|
||||||
} else {
|
} else {
|
||||||
shapes.append(schema.substring(0, schema.indexOf("Schema.addShape"))).append("\r\n");
|
shapes.append(schema, 0, schema.indexOf("Schema.addShape")).append("\r\n");
|
||||||
}
|
}
|
||||||
if (methodModel.getCustomSchema() != null) {
|
if (methodModel.getCustomSchema() != null) {
|
||||||
shapes.append(methodModel.getCustomSchema()).append("\r\n");
|
shapes.append(methodModel.getCustomSchema()).append("\r\n");
|
||||||
@ -2457,7 +2465,7 @@ public class CoeDesignerWeb extends ActionWeb {
|
|||||||
newSchemas[i] = "";
|
newSchemas[i] = "";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
oldSchema = new StringBuilder("");
|
oldSchema = new StringBuilder();
|
||||||
for (int i = 0; i < newSchemas.length; i++) {
|
for (int i = 0; i < newSchemas.length; i++) {
|
||||||
if (!"".equals(newSchemas[i])) {
|
if (!"".equals(newSchemas[i])) {
|
||||||
oldSchema.append("Schema.addShape").append(newSchemas[i]).append("\n\r");
|
oldSchema.append("Schema.addShape").append(newSchemas[i]).append("\n\r");
|
||||||
@ -2465,17 +2473,11 @@ public class CoeDesignerWeb extends ActionWeb {
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
try {
|
// 写入新模板
|
||||||
// 写入新模板
|
schema = schema.replaceAll("\\\\t\\\\n", "\t\n").replaceAll("\\\\", "");
|
||||||
schema = schema.replaceAll("\\\\t\\\\n", "\t\n").replaceAll("\\\\", "");
|
schema = "Schema.addShape(" + schema + ");\n\r";
|
||||||
schema = "Schema.addShape(" + schema + ");\n\r";
|
oldSchema.append(schema);
|
||||||
oldSchema.append(schema);
|
file.write(oldSchema.toString().getBytes(StandardCharsets.UTF_8));
|
||||||
file.write(oldSchema.toString().getBytes("UTF-8"));
|
|
||||||
} catch (UnsupportedEncodingException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
ro = ResponseObject.newErrResponse();
|
|
||||||
return ro.toString();
|
|
||||||
}
|
|
||||||
|
|
||||||
// 更新缓存
|
// 更新缓存
|
||||||
PALMethodModel palMethodModel = PALMethodCache.getPALMethodModelMap().get(methodId);
|
PALMethodModel palMethodModel = PALMethodCache.getPALMethodModelMap().get(methodId);
|
||||||
@ -2525,19 +2527,15 @@ public class CoeDesignerWeb extends ActionWeb {
|
|||||||
newSchemas[i] = "";
|
newSchemas[i] = "";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
StringBuilder oldSchema = new StringBuilder("");
|
StringBuilder oldSchema = new StringBuilder();
|
||||||
for (int i = 0; i < newSchemas.length; i++) {
|
for (int i = 0; i < newSchemas.length; i++) {
|
||||||
if (!"".equals(newSchemas[i])) {
|
if (!"".equals(newSchemas[i])) {
|
||||||
oldSchema.append("Schema.addShape").append(newSchemas[i]).append("\n\r");
|
oldSchema.append("Schema.addShape").append(newSchemas[i]).append("\n\r");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
// 重新写入文件
|
||||||
// 重新写入文件
|
file.write(oldSchema.toString().getBytes(StandardCharsets.UTF_8));
|
||||||
file.write(oldSchema.toString().getBytes("UTF-8"));
|
|
||||||
} catch (UnsupportedEncodingException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
|
|
||||||
// 重新加载缓存
|
// 重新加载缓存
|
||||||
PALMethodModel palMethodModel = PALMethodCache.getPALMethodModelMap().get(methodId);
|
PALMethodModel palMethodModel = PALMethodCache.getPALMethodModelMap().get(methodId);
|
||||||
@ -3065,7 +3063,7 @@ public class CoeDesignerWeb extends ActionWeb {
|
|||||||
Set<String> ids = new HashSet<>();
|
Set<String> ids = new HashSet<>();
|
||||||
sb.append(plModel.getName());
|
sb.append(plModel.getName());
|
||||||
ids.add(plModel.getId());
|
ids.add(plModel.getId());
|
||||||
getFilePath(sb, ids, (PALRepositoryModel)plModel);
|
getFilePath(sb, ids, plModel);
|
||||||
macroLibraries.put("toolbarName", sb.toString());
|
macroLibraries.put("toolbarName", sb.toString());
|
||||||
|
|
||||||
List<String> shapeIds = new ArrayList<>();// 当前流程所有节点
|
List<String> shapeIds = new ArrayList<>();// 当前流程所有节点
|
||||||
@ -3309,7 +3307,7 @@ public class CoeDesignerWeb extends ActionWeb {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
if (uuid != null && !"".equals(uuid)) {
|
if (uuid != null && !"".equals(uuid)) {
|
||||||
PALRepositoryModel m = (PALRepositoryModel) CoeProcessLevelDaoFacotory.createCoeProcessLevel().getInstance(uuid);
|
PALRepositoryModel m = CoeProcessLevelDaoFacotory.createCoeProcessLevel().getInstance(uuid);
|
||||||
PALMethodModel palMethodModel = PALMethodCache.getPALMethodModelById(m.getMethodId());
|
PALMethodModel palMethodModel = PALMethodCache.getPALMethodModelById(m.getMethodId());
|
||||||
if (palMethodModel == null) {
|
if (palMethodModel == null) {
|
||||||
return null;
|
return null;
|
||||||
@ -3646,7 +3644,7 @@ public class CoeDesignerWeb extends ActionWeb {
|
|||||||
*/
|
*/
|
||||||
public String deletePalDesignerVersion(String wsId, String teamId, String id) {
|
public String deletePalDesignerVersion(String wsId, String teamId, String id) {
|
||||||
ResponseObject ro;
|
ResponseObject ro;
|
||||||
PALRepositoryModel plModel = (PALRepositoryModel) CoeProcessLevelDaoFacotory.createCoeProcessLevel().getInstance(id);
|
PALRepositoryModel plModel = CoeProcessLevelDaoFacotory.createCoeProcessLevel().getInstance(id);
|
||||||
List<PALRepositoryModel> list = new ArrayList<PALRepositoryModel>();
|
List<PALRepositoryModel> list = new ArrayList<PALRepositoryModel>();
|
||||||
list.add(plModel);
|
list.add(plModel);
|
||||||
CoeProcessRecycleWeb recycleWeb = new CoeProcessRecycleWeb(_uc);
|
CoeProcessRecycleWeb recycleWeb = new CoeProcessRecycleWeb(_uc);
|
||||||
@ -3678,7 +3676,7 @@ public class CoeDesignerWeb extends ActionWeb {
|
|||||||
public String changePalDesignerVersionUse(String wsId, String teamId, String id) {
|
public String changePalDesignerVersionUse(String wsId, String teamId, String id) {
|
||||||
int answer = 0;
|
int answer = 0;
|
||||||
PALRepository repository = CoeProcessLevelDaoFacotory.createCoeProcessLevel();
|
PALRepository repository = CoeProcessLevelDaoFacotory.createCoeProcessLevel();
|
||||||
PALRepositoryModel lastPlModel = (PALRepositoryModel) repository.getInstance(id);
|
PALRepositoryModel lastPlModel = repository.getInstance(id);
|
||||||
answer = repository.updateStateOfVersionUuid(lastPlModel.getVersionId());// 更新所有的为0
|
answer = repository.updateStateOfVersionUuid(lastPlModel.getVersionId());// 更新所有的为0
|
||||||
answer = repository.updateUseStateOfVersionUuid(lastPlModel.getId());// 更新当前版本为使用状态
|
answer = repository.updateUseStateOfVersionUuid(lastPlModel.getId());// 更新当前版本为使用状态
|
||||||
CoeProcessLevelNoCache.getInstance().reloadInBackground(lastPlModel.getWsId());
|
CoeProcessLevelNoCache.getInstance().reloadInBackground(lastPlModel.getWsId());
|
||||||
|
|||||||
@ -1,17 +1,15 @@
|
|||||||
package com.actionsoft.apps.coe.pal.pal.repository.job;
|
package com.actionsoft.apps.coe.pal.pal.repository.job;
|
||||||
|
|
||||||
import com.actionsoft.apps.coe.pal.datamigration.util.DiagramUtil;
|
|
||||||
import com.actionsoft.apps.coe.pal.datamigration.util.ShapeUtil;
|
|
||||||
import com.actionsoft.apps.coe.pal.pal.repository.cache.PALRepositoryCache;
|
|
||||||
import com.actionsoft.apps.coe.pal.pal.repository.dao.CoeProcessLevelDaoFacotory;
|
import com.actionsoft.apps.coe.pal.pal.repository.dao.CoeProcessLevelDaoFacotory;
|
||||||
import com.actionsoft.apps.coe.pal.pal.repository.dao.PALRepository;
|
import com.actionsoft.apps.coe.pal.pal.repository.dao.PALRepository;
|
||||||
import com.actionsoft.apps.coe.pal.pal.repository.designer.manage.CoeDesignerAPIManager;
|
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.model.BaseModel;
|
||||||
import com.actionsoft.apps.coe.pal.pal.repository.designer.util.CoeDesignerUtil;
|
import com.actionsoft.apps.coe.pal.pal.repository.designer.util.CoeDesignerUtil;
|
||||||
import com.actionsoft.apps.coe.pal.pal.repository.model.PALRepositoryModel;
|
|
||||||
import com.actionsoft.apps.coe.pal.pal.repository.model.impl.PALRepositoryModelImpl;
|
import com.actionsoft.apps.coe.pal.pal.repository.model.impl.PALRepositoryModelImpl;
|
||||||
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.pal.repository.util.DiagramsUtil;
|
||||||
|
import com.actionsoft.apps.coe.pal.pal.repository.util.ShapeUtil;
|
||||||
import com.actionsoft.bpms.commons.database.RowMap;
|
import com.actionsoft.bpms.commons.database.RowMap;
|
||||||
import com.actionsoft.bpms.schedule.IJob;
|
import com.actionsoft.bpms.schedule.IJob;
|
||||||
import com.actionsoft.bpms.util.DBSql;
|
import com.actionsoft.bpms.util.DBSql;
|
||||||
@ -223,7 +221,7 @@ public class SynchronousOrgJob implements IJob {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 设置画布大小
|
// 设置画布大小
|
||||||
DiagramUtil.setDiagramHeightWidth(definition, elements);
|
DiagramsUtil.setDiagramHeightWidth(definition, elements);
|
||||||
defineModel.setDefinition(definition.toString());
|
defineModel.setDefinition(definition.toString());
|
||||||
// 保存文件
|
// 保存文件
|
||||||
CoeDesignerAPIManager.getInstance().storeDefinition(defineModel);// dao操作
|
CoeDesignerAPIManager.getInstance().storeDefinition(defineModel);// dao操作
|
||||||
|
|||||||
@ -1,50 +1,52 @@
|
|||||||
package com.actionsoft.apps.coe.pal.pal.repository.util;
|
package com.actionsoft.apps.coe.pal.pal.repository.util;
|
||||||
|
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
|
|
||||||
public class DiagramUtil {
|
public class DiagramsUtil {
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 设置画布大小
|
/**
|
||||||
* @param elements
|
* 设置画布大小
|
||||||
*/
|
* @param elements
|
||||||
public static void setDiagramHeightWidth(JSONObject definition, JSONObject elements) {
|
*/
|
||||||
// 获取最大宽高,给100长度富余
|
public static void setDiagramHeightWidth(JSONObject definition, JSONObject elements) {
|
||||||
JSONObject maxHW = getMaxPositionXY(elements);
|
// 获取最大宽高,给100长度富余
|
||||||
int maxX = maxHW.getInteger("maxX") + 150;
|
JSONObject maxHW = getMaxPositionXY(elements);
|
||||||
int maxH = maxHW.getInteger("maxY") + 150;
|
int maxX = maxHW.getInteger("maxX") + 150;
|
||||||
JSONObject page = definition.getJSONObject("page");
|
int maxH = maxHW.getInteger("maxY") + 150;
|
||||||
int pageW = page.getInteger("width");
|
JSONObject page = definition.getJSONObject("page");
|
||||||
int pageH = page.getInteger("height");
|
int pageW = page.getInteger("width");
|
||||||
page.put("width", pageW > maxX ? pageW : maxX);
|
int pageH = page.getInteger("height");
|
||||||
page.put("height", pageH > maxH ? pageH : maxH);
|
page.put("width", pageW > maxX ? pageW : maxX);
|
||||||
definition.put("page", page);
|
page.put("height", pageH > maxH ? pageH : maxH);
|
||||||
}
|
definition.put("page", page);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public static JSONObject getMaxPositionXY(JSONObject elements) {
|
|
||||||
int maxX = -99999;
|
public static JSONObject getMaxPositionXY(JSONObject elements) {
|
||||||
int maxY = -99999;
|
int maxX = -99999;
|
||||||
Iterator<String> it = elements.keySet().iterator();
|
int maxY = -99999;
|
||||||
while (it.hasNext()) {
|
Iterator<String> it = elements.keySet().iterator();
|
||||||
String key = it.next();
|
while (it.hasNext()) {
|
||||||
JSONObject shape = elements.getJSONObject(key);
|
String key = it.next();
|
||||||
String shapeName = shape.getString("name");
|
JSONObject shape = elements.getJSONObject(key);
|
||||||
if(!"linker".equals(shapeName)) {
|
String shapeName = shape.getString("name");
|
||||||
JSONObject props = shape.getJSONObject("props");
|
if(!"linker".equals(shapeName)) {
|
||||||
int x = props.getInteger("x");
|
JSONObject props = shape.getJSONObject("props");
|
||||||
int y = props.getInteger("y");
|
int x = props.getInteger("x");
|
||||||
maxX = maxX < x ? x : maxX;
|
int y = props.getInteger("y");
|
||||||
maxY = maxY < y ? y : maxY;
|
maxX = maxX < x ? x : maxX;
|
||||||
}
|
maxY = maxY < y ? y : maxY;
|
||||||
}
|
}
|
||||||
JSONObject result = new JSONObject();
|
}
|
||||||
result.put("maxX", maxX);
|
JSONObject result = new JSONObject();
|
||||||
result.put("maxY", maxY);
|
result.put("maxX", maxX);
|
||||||
return result;
|
result.put("maxY", maxY);
|
||||||
}
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,313 @@
|
|||||||
|
package com.actionsoft.apps.coe.pal.pal.repository.util;
|
||||||
|
|
||||||
|
import com.actionsoft.apps.AppsConst;
|
||||||
|
//import com.actionsoft.apps.coe.pal.datamigration.util.ProcessUtil;
|
||||||
|
import com.actionsoft.apps.coe.pal.pal.method.PALMethodManager;
|
||||||
|
import com.actionsoft.apps.coe.pal.pal.method.model.PALMethodAttributeModel;
|
||||||
|
import com.actionsoft.apps.coe.pal.pal.method.model.PALMethodModel;
|
||||||
|
import com.actionsoft.apps.coe.pal.pal.repository.designer.CoeDesignerShapeAPIManager;
|
||||||
|
import com.actionsoft.apps.coe.pal.pal.repository.designer.util.CoeDesignerUtil;
|
||||||
|
import com.actionsoft.apps.lifecycle.api.AppsAPIManager;
|
||||||
|
import com.actionsoft.apps.resource.AppContext;
|
||||||
|
import com.alibaba.fastjson.JSONArray;
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
public class ShapeUtil {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* BPMN图并不全部使用,给定范围
|
||||||
|
*/
|
||||||
|
private static List<String> bpmnShapeScope() {
|
||||||
|
List<String> list = new ArrayList<>();
|
||||||
|
list.add("startEvent");// 开始事件
|
||||||
|
list.add("messageStartEvent");// 消息开始事件
|
||||||
|
list.add("timerStartEvent");// 时间开始事件
|
||||||
|
list.add("signalStartEvent");// 信号开始事件
|
||||||
|
list.add("userTask");// 人工任务
|
||||||
|
list.add("serviceTask");// 服务任务
|
||||||
|
list.add("manualTask");// 手工任务
|
||||||
|
list.add("scriptTask");// 脚本任务
|
||||||
|
list.add("inclusiveGateway");// 包容网关
|
||||||
|
list.add("complexGateway");// 复杂网关
|
||||||
|
list.add("eventBasedGateway");// 事件网关
|
||||||
|
list.add("parallelGateway");// 并行网关
|
||||||
|
list.add("exclusiveGateway");// 排他网关
|
||||||
|
list.add("timerIntermediateCatchEvent");// 捕获时间事件
|
||||||
|
list.add("messageIntermediateCatchEvent");// 捕获消息事件
|
||||||
|
list.add("signalIntermediateCatchEvent");// 捕获信号事件
|
||||||
|
list.add("messageIntermediateThrowingEvent");// 抛出消息事件
|
||||||
|
list.add("signalIntermediateThrowingEvent");// 抛出信号事件
|
||||||
|
list.add("messageBoundaryInterrputingEvent");// 边界消息事件
|
||||||
|
list.add("signalBoundaryInterrputingEvent");// 边界信号事件
|
||||||
|
list.add("errorBoundaryInterrputingEvent");// 边界错误事件
|
||||||
|
list.add("endEvent");// 结束事件
|
||||||
|
list.add("terminateEndEvent");// 终止事件
|
||||||
|
list.add("messageEndEvent");// 消息结束事件
|
||||||
|
list.add("signalEndEvent");// 信号结束事件
|
||||||
|
list.add("errorEndEvent");// 错误结束事件
|
||||||
|
list.add("callActivityCallingProcess");// 调用子流程
|
||||||
|
list.add("group");// 组
|
||||||
|
// list.add("textAnnotation");// 注释
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取流程下文件分类
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static List<String> getProcessCategoryCategoryMehtodList() {
|
||||||
|
List<String> list = new ArrayList<String>();
|
||||||
|
List<PALMethodModel> methodModels = PALMethodManager.getInstance().getPALMethodModelListByMethod("process");
|
||||||
|
List<AppContext> listApps = AppsAPIManager.getInstance().getInstalledApps();
|
||||||
|
int size = listApps.size();
|
||||||
|
Map<String, String> map1 = new HashMap<String, String>();
|
||||||
|
for (int i = 0; i < size; i++) {
|
||||||
|
map1.put(listApps.get(i).getId(), listApps.get(i).getRuntimeState());
|
||||||
|
}
|
||||||
|
for (int i = 0, methodSize = methodModels.size(); i < methodSize; i++) {
|
||||||
|
PALMethodModel palMethodModel = methodModels.get(i);
|
||||||
|
String appId = palMethodModel.getId();
|
||||||
|
if (map1.containsKey("com.actionsoft.apps.coe.method." + appId)) {
|
||||||
|
String methodId1 = map1.get("com.actionsoft.apps.coe.method." + appId);
|
||||||
|
if (methodId1.equals(AppsConst.RUNTIME_STATE_STOPPED) || methodId1.equals(AppsConst.RUNTIME_STATE_FAILED) || methodId1.equals(AppsConst.RUNTIME_STATE_READY) || methodId1.equals(AppsConst.RUNTIME_STATE_STARTING) || methodId1.equals(AppsConst.RUNTIME_STATE_STOPPING) || methodId1.equals(AppsConst.RUNTIME_STATE_UNINSTALLED) || methodId1.equals(AppsConst.RUNTIME_STATE_UNINSTALLING) || methodId1.equals(AppsConst.RUNTIME_STATE_FAILED))
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
list.add(palMethodModel.getId());
|
||||||
|
}
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取流程类别下所有模型的形状title
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static Map<String, List<String>> getProcessShapeTitles() {
|
||||||
|
Map<String, List<String>> result = new HashMap<>();
|
||||||
|
// 获取流程类别下所有的模型分类
|
||||||
|
List<String> methods = getProcessCategoryCategoryMehtodList();
|
||||||
|
for (String methodId : methods) {
|
||||||
|
List<String> list = new ArrayList<>();
|
||||||
|
JSONArray shapes = CoeDesignerUtil.getShapeDefinition(methodId);
|
||||||
|
for (Object shape : shapes) {
|
||||||
|
JSONObject shapeObj = (JSONObject) shape;
|
||||||
|
if (shapeObj.containsKey("title")) {
|
||||||
|
if (methodId.contains("bpmn")) {
|
||||||
|
if (bpmnShapeScope().contains(shapeObj.getString("name"))) {
|
||||||
|
list.add(shapeObj.getString("title"));
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
list.add(shapeObj.getString("title"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
result.put(methodId, list);
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static List<String> getProcessShapeTypeList(String methodId) {
|
||||||
|
List<String> result = new ArrayList<>();
|
||||||
|
JSONArray shapes = CoeDesignerUtil.getShapeDefinition(methodId);
|
||||||
|
for (Object shape : shapes) {
|
||||||
|
JSONObject shapeObj = (JSONObject) shape;
|
||||||
|
if (shapeObj.containsKey("title")) {
|
||||||
|
if (methodId.contains("bpmn")) {
|
||||||
|
if (bpmnShapeScope().contains(shapeObj.getString("name"))) {
|
||||||
|
result.add(shapeObj.getString("title"));
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
result.add(shapeObj.getString("title"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static JSONArray getProcessShapeTypeArr(String methodId) {
|
||||||
|
JSONArray result = new JSONArray();
|
||||||
|
JSONArray shapes = CoeDesignerUtil.getShapeDefinition(methodId);
|
||||||
|
for (Object shape : shapes) {
|
||||||
|
JSONObject shapeObj = (JSONObject) shape;
|
||||||
|
if (shapeObj.containsKey("title")) {
|
||||||
|
if (methodId.contains("bpmn")) {
|
||||||
|
if (bpmnShapeScope().contains(shapeObj.getString("name"))) {
|
||||||
|
result.add(shapeObj.getString("title"));
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
result.add(shapeObj.getString("title"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Set<String> getProcessMethodAttrNames(String wsId, String methodId) {
|
||||||
|
Set<String> result = new HashSet<>();
|
||||||
|
List<PALMethodAttributeModel> attributeModelList = CoeDesignerShapeAPIManager.getInstance().getAllValidShapeAttributeModels(wsId, methodId);
|
||||||
|
for (PALMethodAttributeModel attributeModel : attributeModelList) {
|
||||||
|
result.add(attributeModel.getNewTitle());
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String getProcessShapeName(String methodId, String shapeTitle) {
|
||||||
|
JSONArray shapes = CoeDesignerUtil.getShapeDefinition(methodId);
|
||||||
|
for (Object shape : shapes) {
|
||||||
|
JSONObject shapeObj = (JSONObject) shape;
|
||||||
|
if (shapeObj.containsKey("title")) {
|
||||||
|
if (methodId.contains("bpmn")) {
|
||||||
|
if (bpmnShapeScope().contains(shapeObj.getString("name")) && shapeObj.getString("title").equals(shapeTitle)) {
|
||||||
|
return shapeObj.getString("name");
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (shapeObj.getString("title").equals(shapeTitle)) {
|
||||||
|
return shapeObj.getString("name");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取流程节点定义
|
||||||
|
* @param methodId 类型
|
||||||
|
* @param shapeTitle 节点默认标题
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static JSONObject getProcessShapeDefinition(String methodId, String shapeTitle) {
|
||||||
|
JSONArray shapes = CoeDesignerUtil.getShapeDefinition(methodId);
|
||||||
|
for (Object shape : shapes) {
|
||||||
|
JSONObject shapeObj = (JSONObject) shape;
|
||||||
|
if (shapeObj.containsKey("title")) {
|
||||||
|
if (methodId.contains("bpmn")) {
|
||||||
|
if (bpmnShapeScope().contains(shapeObj.getString("name")) && shapeObj.getString("title").equals(shapeTitle)) {
|
||||||
|
return shapeObj;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (shapeObj.getString("title").equals(shapeTitle)) {
|
||||||
|
return shapeObj;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取流程节点定义
|
||||||
|
* @param methodId 类型
|
||||||
|
* @param shapeName 节点类型
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static JSONObject getProcessShapeDefinitionByName(String methodId, String shapeName) {
|
||||||
|
JSONArray shapes = CoeDesignerUtil.getShapeDefinition(methodId);
|
||||||
|
for (Object shape : shapes) {
|
||||||
|
JSONObject shapeObj = (JSONObject) shape;
|
||||||
|
if (shapeObj.containsKey("name")) {
|
||||||
|
String name = shapeObj.getString("name");
|
||||||
|
if (methodId.contains("bpmn")) {
|
||||||
|
if (bpmnShapeScope().contains(shapeObj.getString("name")) && name.equals(shapeName)) {
|
||||||
|
return shapeObj;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (name.equals(shapeName)) {
|
||||||
|
return shapeObj;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 具体流程类别下的扩展属性列表
|
||||||
|
* @param methodId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static JSONObject getProcessUseShapeMethodAttrByShapeName(String wsId, String shapeMethod, String methodId, String shapeName) {
|
||||||
|
JSONObject result = new JSONObject();
|
||||||
|
List<PALMethodAttributeModel> attributeModelList = CoeDesignerShapeAPIManager.getInstance().getValidAndUseAttributeModels(wsId, shapeMethod, shapeName, methodId);
|
||||||
|
for (PALMethodAttributeModel attributeModel : attributeModelList) {
|
||||||
|
String scope = attributeModel.getScope();
|
||||||
|
if (scope.contains("*") || "*".equals(scope) || scope.contains(shapeName)) {
|
||||||
|
JSONObject obj = new JSONObject();
|
||||||
|
obj.put("readonly", attributeModel.getReadonly());
|
||||||
|
obj.put("id", attributeModel.getKey());
|
||||||
|
obj.put("key", attributeModel.getKey());
|
||||||
|
obj.put("scope", attributeModel.getScope());
|
||||||
|
obj.put("name", attributeModel.getTitle());
|
||||||
|
obj.put("title", attributeModel.getNewTitle());
|
||||||
|
obj.put("type", attributeModel.getType());
|
||||||
|
obj.put("ref", attributeModel.getRef());
|
||||||
|
obj.put("groupPath", attributeModel.getGroupPath());
|
||||||
|
result.put(attributeModel.getKey(), obj);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 具体流程类别下的扩展属性列表
|
||||||
|
* @param methodId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static JSONObject getProcessShapeMethodAttr(String wsId, String methodId, String shapeTitle) {
|
||||||
|
JSONObject result = new JSONObject();
|
||||||
|
// 获取图形名称的
|
||||||
|
String shapeName = getProcessShapeName(methodId, shapeTitle);
|
||||||
|
if (shapeName == null) {
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
List<PALMethodAttributeModel> attributeModelList = CoeDesignerShapeAPIManager.getInstance().getAllValidShapeAttributeModels(wsId, methodId);
|
||||||
|
for (PALMethodAttributeModel attributeModel : attributeModelList) {
|
||||||
|
String scope = attributeModel.getScope();
|
||||||
|
if (scope.contains("*") || "*".equals(scope) || scope.contains(shapeName)) {
|
||||||
|
JSONObject obj = new JSONObject();
|
||||||
|
obj.put("readonly", attributeModel.getReadonly());
|
||||||
|
obj.put("id", attributeModel.getKey());
|
||||||
|
obj.put("key", attributeModel.getKey());
|
||||||
|
obj.put("scope", attributeModel.getScope());
|
||||||
|
obj.put("name", attributeModel.getTitle());
|
||||||
|
obj.put("title", attributeModel.getNewTitle());
|
||||||
|
obj.put("type", attributeModel.getType());
|
||||||
|
obj.put("ref", attributeModel.getRef());
|
||||||
|
obj.put("groupPath", attributeModel.getGroupPath());
|
||||||
|
result.put(attributeModel.getNewTitle(), obj);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 具体流程类别下的扩展属性列表
|
||||||
|
* @param methodId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static JSONObject getProcessShapeMethodAttrById(String wsId, String methodId, String attrId) {
|
||||||
|
JSONObject result = new JSONObject();
|
||||||
|
List<PALMethodAttributeModel> attributeModelList = CoeDesignerShapeAPIManager.getInstance().getAllValidShapeAttributeModels(wsId, methodId);
|
||||||
|
for (PALMethodAttributeModel attributeModel : attributeModelList) {
|
||||||
|
if (attrId.equals(attributeModel.getKey())) {
|
||||||
|
result.put("readonly", attributeModel.getReadonly());
|
||||||
|
result.put("pid", attributeModel.getGroupPath());
|
||||||
|
result.put("id", attributeModel.getKey());
|
||||||
|
result.put("key", attributeModel.getKey());
|
||||||
|
result.put("scope", attributeModel.getScope());
|
||||||
|
result.put("name", attributeModel.getTitle());
|
||||||
|
result.put("title", attributeModel.getNewTitle());
|
||||||
|
result.put("type", attributeModel.getType());
|
||||||
|
result.put("ref", attributeModel.getRef());
|
||||||
|
result.put("value", attributeModel.getValue());
|
||||||
|
result.put("groupPath", attributeModel.getGroupPath());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -5,7 +5,7 @@ import com.actionsoft.apps.AppsConst;
|
|||||||
import com.actionsoft.apps.coe.pal.cooperation.CoeCooperationAPIManager;
|
import com.actionsoft.apps.coe.pal.cooperation.CoeCooperationAPIManager;
|
||||||
import com.actionsoft.apps.coe.pal.log.CoEOpLogAPI;
|
import com.actionsoft.apps.coe.pal.log.CoEOpLogAPI;
|
||||||
import com.actionsoft.apps.coe.pal.log.CoEOpLogConst;
|
import com.actionsoft.apps.coe.pal.log.CoEOpLogConst;
|
||||||
import com.actionsoft.apps.coe.pal.pal.repository.util.DiagramUtil;
|
import com.actionsoft.apps.coe.pal.pal.repository.util.DiagramsUtil;
|
||||||
import com.actionsoft.apps.coe.pal.pal.repository.util.ShapeUtils;
|
import com.actionsoft.apps.coe.pal.pal.repository.util.ShapeUtils;
|
||||||
import com.actionsoft.apps.coe.pal.pal.ws.constant.CoeWsConstant;
|
import com.actionsoft.apps.coe.pal.pal.ws.constant.CoeWsConstant;
|
||||||
import com.actionsoft.apps.coe.pal.util.HighSecurityUtil;
|
import com.actionsoft.apps.coe.pal.util.HighSecurityUtil;
|
||||||
@ -8052,6 +8052,9 @@ public class CoeProcessLevelWeb extends ActionWeb {
|
|||||||
return ro.toString();
|
return ro.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据用户选择类型创建相应制度图形
|
* 根据用户选择类型创建相应制度图形
|
||||||
* @param type
|
* @param type
|
||||||
@ -8080,7 +8083,7 @@ public class CoeProcessLevelWeb extends ActionWeb {
|
|||||||
//新建一个uuid
|
//新建一个uuid
|
||||||
String shapeId = UUIDGener.getObjectId();
|
String shapeId = UUIDGener.getObjectId();
|
||||||
|
|
||||||
//拿到基础结构
|
//拿到基础结构
|
||||||
JSONObject shape;
|
JSONObject shape;
|
||||||
if(type.equals("1")){
|
if(type.equals("1")){
|
||||||
shape=ShapeUtils.getProcessShapeDefinitionByName("control_policy", "regulation");
|
shape=ShapeUtils.getProcessShapeDefinitionByName("control_policy", "regulation");
|
||||||
@ -8106,7 +8109,7 @@ public class CoeProcessLevelWeb extends ActionWeb {
|
|||||||
elements.put(shapeId, shape);
|
elements.put(shapeId, shape);
|
||||||
|
|
||||||
// 设置画布大小
|
// 设置画布大小
|
||||||
DiagramUtil.setDiagramHeightWidth(definition, elements);
|
DiagramsUtil.setDiagramHeightWidth(definition, elements);
|
||||||
defineModel.setDefinition(definition.toString());
|
defineModel.setDefinition(definition.toString());
|
||||||
// 保存文件
|
// 保存文件
|
||||||
CoeDesignerAPIManager.getInstance().storeDefinition(defineModel);// dao操作
|
CoeDesignerAPIManager.getInstance().storeDefinition(defineModel);// dao操作
|
||||||
@ -8121,11 +8124,11 @@ public class CoeProcessLevelWeb extends ActionWeb {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 创建角色图
|
* 创建角色/绩效/表单模型
|
||||||
* @return
|
* @return
|
||||||
* by zhaolei
|
* by zhaolei
|
||||||
*/
|
*/
|
||||||
public String createDialogModel(String uuid,String methodId,String category){
|
public String createDialogModel(String uuid,String methodId){
|
||||||
|
|
||||||
ResponseObject ro = ResponseObject.newOkResponse();
|
ResponseObject ro = ResponseObject.newOkResponse();
|
||||||
try {
|
try {
|
||||||
@ -8134,27 +8137,41 @@ public class CoeProcessLevelWeb extends ActionWeb {
|
|||||||
if (rowMap != null) {
|
if (rowMap != null) {
|
||||||
String plname = rowMap.getString("PLNAME");
|
String plname = rowMap.getString("PLNAME");
|
||||||
|
|
||||||
|
String titleName=null;
|
||||||
|
String shapName=null;
|
||||||
|
String parentId=null;
|
||||||
|
String category=null;
|
||||||
|
String graphTitle=null;
|
||||||
|
if(methodId.equals("org.role")){
|
||||||
|
titleName="角色图";
|
||||||
|
shapName="role";
|
||||||
|
parentId="org";
|
||||||
|
category="org";
|
||||||
|
graphTitle="角色";
|
||||||
|
}else if(methodId.equals("process")){
|
||||||
|
titleName="表单图";
|
||||||
|
shapName="form";
|
||||||
|
parentId="data";
|
||||||
|
category="data";
|
||||||
|
methodId="data.form";
|
||||||
|
graphTitle="表单";
|
||||||
|
}else if(methodId.equals("control.kpi")){
|
||||||
|
titleName="绩效图";
|
||||||
|
shapName="kpi";
|
||||||
|
parentId="control";
|
||||||
|
category="control";
|
||||||
|
graphTitle="绩效";
|
||||||
|
}
|
||||||
|
|
||||||
//先执行新建操作产生plid
|
//先执行新建操作产生plid
|
||||||
PALRepository coeProcessLevel = CoeProcessLevelDaoFacotory.createCoeProcessLevel();
|
PALRepository coeProcessLevel = CoeProcessLevelDaoFacotory.createCoeProcessLevel();
|
||||||
|
|
||||||
String plRid = UUIDGener.getUUID();
|
String plRid = UUIDGener.getUUID();
|
||||||
String id = 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());
|
Timestamp nowTime = new Timestamp(System.currentTimeMillis());
|
||||||
PALRepositoryModelImpl model = CoeProcessLevelUtil.createPALRepositoryModel(id, plRid, "6f4e292c-1b90-4dd2-8c20-7da159cb20a5", plname + titleName,
|
PALRepositoryModelImpl model = CoeProcessLevelUtil.createPALRepositoryModel(id, plRid, "6f4e292c-1b90-4dd2-8c20-7da159cb20a5", plname + titleName,
|
||||||
"", 1, shapName, category, true, 1,
|
"", 1, parentId, category, true, 1,
|
||||||
id, false, methodId, "0", 1, null,
|
id, false, methodId, "0", 1, null,
|
||||||
null, "admin", "admin", nowTime, null, uuid,
|
null, "admin", "admin", nowTime, null, uuid,
|
||||||
null, null, null, null, null, null, null, 1);
|
null, null, null, null, null, null, null, 1);
|
||||||
@ -8176,11 +8193,10 @@ public class CoeProcessLevelWeb extends ActionWeb {
|
|||||||
//新建一个uuid
|
//新建一个uuid
|
||||||
String shapeId = UUIDGener.getObjectId();
|
String shapeId = UUIDGener.getObjectId();
|
||||||
|
|
||||||
|
|
||||||
//拿到基础结构
|
//拿到基础结构
|
||||||
JSONObject shape = ShapeUtils.getProcessShapeDefinitionByName(methodId, shapName);
|
JSONObject shape = ShapeUtils.getProcessShapeDefinitionByName(methodId, shapName);
|
||||||
shape.put("id", shapeId);
|
shape.put("id", shapeId);
|
||||||
shape.put("text", titleName);
|
shape.put("text", graphTitle);
|
||||||
|
|
||||||
JSONObject props = shape.getJSONObject("props");// 位置大小
|
JSONObject props = shape.getJSONObject("props");// 位置大小
|
||||||
props.put("zindex", 0);
|
props.put("zindex", 0);
|
||||||
@ -8192,7 +8208,7 @@ public class CoeProcessLevelWeb extends ActionWeb {
|
|||||||
elements.put(shapeId, shape);
|
elements.put(shapeId, shape);
|
||||||
|
|
||||||
// 设置画布大小
|
// 设置画布大小
|
||||||
DiagramUtil.setDiagramHeightWidth(definition, elements);
|
DiagramsUtil.setDiagramHeightWidth(definition, elements);
|
||||||
defineModel.setDefinition(definition.toString());
|
defineModel.setDefinition(definition.toString());
|
||||||
// 保存文件
|
// 保存文件
|
||||||
CoeDesignerAPIManager.getInstance().storeDefinition(defineModel);// dao操作
|
CoeDesignerAPIManager.getInstance().storeDefinition(defineModel);// dao操作
|
||||||
@ -8215,9 +8231,9 @@ public class CoeProcessLevelWeb extends ActionWeb {
|
|||||||
* @param uuid
|
* @param uuid
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public String relationFindSameRole(String uuid){
|
public String relationFindSameRole(String uuid,String methodId){
|
||||||
ResponseObject ro = ResponseObject.newOkResponse();
|
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){
|
if(rowMap!=null){
|
||||||
ro.put("result", "ok");
|
ro.put("result", "ok");
|
||||||
}else{
|
}else{
|
||||||
|
|||||||
@ -14,6 +14,7 @@ import com.actionsoft.apps.coe.pal.aslp.MethodAPI.QueryMethodListByMethod;
|
|||||||
import com.actionsoft.apps.coe.pal.aslp.PermAPI.*;
|
import com.actionsoft.apps.coe.pal.aslp.PermAPI.*;
|
||||||
import com.actionsoft.apps.coe.pal.aslp.PublishAPI.PublishPALRepository;
|
import com.actionsoft.apps.coe.pal.aslp.PublishAPI.PublishPALRepository;
|
||||||
import com.actionsoft.apps.coe.pal.aslp.RepositoryAPI.*;
|
import com.actionsoft.apps.coe.pal.aslp.RepositoryAPI.*;
|
||||||
|
import com.actionsoft.apps.coe.pal.cooperation.cache.CooperationCache;
|
||||||
import com.actionsoft.apps.coe.pal.pal.home.aslp.RegisterExtendsApp;
|
import com.actionsoft.apps.coe.pal.pal.home.aslp.RegisterExtendsApp;
|
||||||
import com.actionsoft.apps.coe.pal.pal.method.aslp.RegisterMethodApp;
|
import com.actionsoft.apps.coe.pal.pal.method.aslp.RegisterMethodApp;
|
||||||
import com.actionsoft.apps.coe.pal.pal.repository.addons.RepositoryDiagramExistMark;
|
import com.actionsoft.apps.coe.pal.pal.repository.addons.RepositoryDiagramExistMark;
|
||||||
@ -165,6 +166,9 @@ public class Plugins implements PluginListener {
|
|||||||
list.add(new ASLPPluginProfile("queryAllPublishedPALRepositoryModelsByPid", QueryAllPublishedPALRepositoryModelsByPid.class.getName(), "获取流程资产库下所有已发布的子流程,请直接调用SDK.getPALRepositoryQueryAPI.getAllPublishedPalRepositoryModelsByPid()方法", new HttpASLP(HttpASLP.AUTH_AWS_SID, null)));
|
list.add(new ASLPPluginProfile("queryAllPublishedPALRepositoryModelsByPid", QueryAllPublishedPALRepositoryModelsByPid.class.getName(), "获取流程资产库下所有已发布的子流程,请直接调用SDK.getPALRepositoryQueryAPI.getAllPublishedPalRepositoryModelsByPid()方法", new HttpASLP(HttpASLP.AUTH_AWS_SID, null)));
|
||||||
|
|
||||||
list.add(new AddOnsPluginProfile(RepositoryDiagramExistMark.class.getName(), "PAL初始化模型图标记", null));
|
list.add(new AddOnsPluginProfile(RepositoryDiagramExistMark.class.getName(), "PAL初始化模型图标记", null));
|
||||||
|
|
||||||
|
//小组用户权限信息cache
|
||||||
|
list.add(new CachePluginProfile(CooperationCache.class));
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -13,4 +13,4 @@
|
|||||||
var mainType = "<#mainType>";
|
var mainType = "<#mainType>";
|
||||||
var uid = "<#uid>";
|
var uid = "<#uid>";
|
||||||
var wHref = "./w";
|
var wHref = "./w";
|
||||||
var jdHref = "./jd";</script><link href=../apps/com.actionsoft.apps.coe.pal/main/css/chunk-00fc6489.ef94bb38.css rel=prefetch><link href=../apps/com.actionsoft.apps.coe.pal/main/css/chunk-055385ac.e55cad48.css rel=prefetch><link href=../apps/com.actionsoft.apps.coe.pal/main/css/chunk-0ba0316e.d3570084.css rel=prefetch><link href=../apps/com.actionsoft.apps.coe.pal/main/css/chunk-4def56c4.ef0a5aa8.css rel=prefetch><link href=../apps/com.actionsoft.apps.coe.pal/main/css/chunk-4e7e9573.38619268.css rel=prefetch><link href=../apps/com.actionsoft.apps.coe.pal/main/css/chunk-5a76c238.283a9f57.css rel=prefetch><link href=../apps/com.actionsoft.apps.coe.pal/main/css/chunk-6f1c20e8.c5c7126f.css rel=prefetch><link href=../apps/com.actionsoft.apps.coe.pal/main/css/chunk-8cb92970.adde4cab.css rel=prefetch><link href=../apps/com.actionsoft.apps.coe.pal/main/css/chunk-dd13ef3a.66cd3c5f.css rel=prefetch><link href=../apps/com.actionsoft.apps.coe.pal/main/js/chunk-00fc6489.1d5ae77f.js rel=prefetch><link href=../apps/com.actionsoft.apps.coe.pal/main/js/chunk-055385ac.212b1e7f.js rel=prefetch><link href=../apps/com.actionsoft.apps.coe.pal/main/js/chunk-0ba0316e.a3ac659b.js rel=prefetch><link href=../apps/com.actionsoft.apps.coe.pal/main/js/chunk-2d0ab156.e3edaaa6.js rel=prefetch><link href=../apps/com.actionsoft.apps.coe.pal/main/js/chunk-2d0b25b0.3ebfc816.js rel=prefetch><link href=../apps/com.actionsoft.apps.coe.pal/main/js/chunk-2d0f078a.9e10275b.js rel=prefetch><link href=../apps/com.actionsoft.apps.coe.pal/main/js/chunk-2d216d3a.99234111.js rel=prefetch><link href=../apps/com.actionsoft.apps.coe.pal/main/js/chunk-2d224b23.135c5954.js rel=prefetch><link href=../apps/com.actionsoft.apps.coe.pal/main/js/chunk-2d224ef1.7eee62fe.js rel=prefetch><link href=../apps/com.actionsoft.apps.coe.pal/main/js/chunk-4def56c4.66811286.js rel=prefetch><link href=../apps/com.actionsoft.apps.coe.pal/main/js/chunk-4e7e9573.db603cfd.js rel=prefetch><link href=../apps/com.actionsoft.apps.coe.pal/main/js/chunk-5a76c238.27830c12.js rel=prefetch><link href=../apps/com.actionsoft.apps.coe.pal/main/js/chunk-5ca06e36.1dd1e85a.js rel=prefetch><link href=../apps/com.actionsoft.apps.coe.pal/main/js/chunk-6f1c20e8.c979e2d7.js rel=prefetch><link href=../apps/com.actionsoft.apps.coe.pal/main/js/chunk-8cb92970.9380bd91.js rel=prefetch><link href=../apps/com.actionsoft.apps.coe.pal/main/js/chunk-bf7921b8.1d6eee48.js rel=prefetch><link href=../apps/com.actionsoft.apps.coe.pal/main/js/chunk-dd13ef3a.0bade222.js rel=prefetch><link href=../apps/com.actionsoft.apps.coe.pal/main/css/app.b58aa8df.css rel=preload as=style><link href=../apps/com.actionsoft.apps.coe.pal/main/js/app.f669c4d9.js rel=preload as=script><link href=../apps/com.actionsoft.apps.coe.pal/main/js/chunk-vendors.16b2cce8.js rel=preload as=script><link href=../apps/com.actionsoft.apps.coe.pal/main/css/app.b58aa8df.css rel=stylesheet></head><body style=margin:0;><div id=app></div><script src=../apps/com.actionsoft.apps.coe.pal/main/js/chunk-vendors.16b2cce8.js></script><script src=../apps/com.actionsoft.apps.coe.pal/main/js/app.f669c4d9.js></script></body></html>
|
var jdHref = "./jd";</script><link href=../apps/com.actionsoft.apps.coe.pal/main/css/chunk-055385ac.e55cad48.css rel=prefetch><link href=../apps/com.actionsoft.apps.coe.pal/main/css/chunk-0afe55bf.4778a8ec.css rel=prefetch><link href=../apps/com.actionsoft.apps.coe.pal/main/css/chunk-0ba0316e.d3570084.css rel=prefetch><link href=../apps/com.actionsoft.apps.coe.pal/main/css/chunk-1cf2c888.d77cd146.css rel=prefetch><link href=../apps/com.actionsoft.apps.coe.pal/main/css/chunk-4def56c4.ef0a5aa8.css rel=prefetch><link href=../apps/com.actionsoft.apps.coe.pal/main/css/chunk-4e7e9573.38619268.css rel=prefetch><link href=../apps/com.actionsoft.apps.coe.pal/main/css/chunk-5a76c238.283a9f57.css rel=prefetch><link href=../apps/com.actionsoft.apps.coe.pal/main/css/chunk-6f1c20e8.c5c7126f.css rel=prefetch><link href=../apps/com.actionsoft.apps.coe.pal/main/css/chunk-8cb92970.adde4cab.css rel=prefetch><link href=../apps/com.actionsoft.apps.coe.pal/main/js/chunk-055385ac.00905b6d.js rel=prefetch><link href=../apps/com.actionsoft.apps.coe.pal/main/js/chunk-0afe55bf.b357fae1.js rel=prefetch><link href=../apps/com.actionsoft.apps.coe.pal/main/js/chunk-0ba0316e.688f76dc.js rel=prefetch><link href=../apps/com.actionsoft.apps.coe.pal/main/js/chunk-1cf2c888.6cc6d796.js rel=prefetch><link href=../apps/com.actionsoft.apps.coe.pal/main/js/chunk-2d0ab156.4806769f.js rel=prefetch><link href=../apps/com.actionsoft.apps.coe.pal/main/js/chunk-2d0b25b0.416cbd4d.js rel=prefetch><link href=../apps/com.actionsoft.apps.coe.pal/main/js/chunk-2d0f078a.177d1eb1.js rel=prefetch><link href=../apps/com.actionsoft.apps.coe.pal/main/js/chunk-2d216d3a.60b5daee.js rel=prefetch><link href=../apps/com.actionsoft.apps.coe.pal/main/js/chunk-2d224b23.aa0a1486.js rel=prefetch><link href=../apps/com.actionsoft.apps.coe.pal/main/js/chunk-2d224ef1.e0c4eebc.js rel=prefetch><link href=../apps/com.actionsoft.apps.coe.pal/main/js/chunk-4def56c4.b7c9006f.js rel=prefetch><link href=../apps/com.actionsoft.apps.coe.pal/main/js/chunk-4e7e9573.53d1c82e.js rel=prefetch><link href=../apps/com.actionsoft.apps.coe.pal/main/js/chunk-5a76c238.44d7b7f6.js rel=prefetch><link href=../apps/com.actionsoft.apps.coe.pal/main/js/chunk-5ca06e36.b040a926.js rel=prefetch><link href=../apps/com.actionsoft.apps.coe.pal/main/js/chunk-6f1c20e8.96211ef7.js rel=prefetch><link href=../apps/com.actionsoft.apps.coe.pal/main/js/chunk-8cb92970.328ebf72.js rel=prefetch><link href=../apps/com.actionsoft.apps.coe.pal/main/js/chunk-bf7921b8.4686146e.js rel=prefetch><link href=../apps/com.actionsoft.apps.coe.pal/main/css/app.8c8bd95f.css rel=preload as=style><link href=../apps/com.actionsoft.apps.coe.pal/main/js/app.4583b8e6.js rel=preload as=script><link href=../apps/com.actionsoft.apps.coe.pal/main/js/chunk-vendors.30b385c5.js rel=preload as=script><link href=../apps/com.actionsoft.apps.coe.pal/main/css/app.8c8bd95f.css rel=stylesheet></head><body style=margin:0;><div id=app></div><script src=../apps/com.actionsoft.apps.coe.pal/main/js/chunk-vendors.30b385c5.js></script><script src=../apps/com.actionsoft.apps.coe.pal/main/js/app.4583b8e6.js></script></body></html>
|
||||||
@ -160,7 +160,6 @@
|
|||||||
<ul id="buttons" style="margin-top:10px;" class="clearfix">
|
<ul id="buttons" style="margin-top:10px;" class="clearfix">
|
||||||
<li class="attr_more" ></li>
|
<li class="attr_more" ></li>
|
||||||
<li><span title="点击打开附件管理" id="upfile" class="button">附件</span></li>
|
<li><span title="点击打开附件管理" id="upfile" class="button">附件</span></li>
|
||||||
<li><span title="弹出在线编辑弹窗" id="onlineEdit" class="button">在线编辑</span></li>
|
|
||||||
</ul>
|
</ul>
|
||||||
<div title="" style="width:250px;display:none;" id="attr_dialog-normal">
|
<div title="" style="width:250px;display:none;" id="attr_dialog-normal">
|
||||||
<div id='attr_content' style='margin:10px;height:280px;'>
|
<div id='attr_content' style='margin:10px;height:280px;'>
|
||||||
|
|||||||
@ -80,8 +80,6 @@
|
|||||||
<script type='text/javascript' charset='UTF-8' src='../apps/com.actionsoft.apps.coe.pal/lib/designer/scripts/util.js'></script>
|
<script type='text/javascript' charset='UTF-8' src='../apps/com.actionsoft.apps.coe.pal/lib/designer/scripts/util.js'></script>
|
||||||
<!--扩展设计器的样式-->
|
<!--扩展设计器的样式-->
|
||||||
<link type='text/css' rel='stylesheet' href='../apps/com.actionsoft.apps.coe.pal/lib/designer/extend/css/designer.extend.css' />
|
<link type='text/css' rel='stylesheet' href='../apps/com.actionsoft.apps.coe.pal/lib/designer/extend/css/designer.extend.css' />
|
||||||
|
|
||||||
|
|
||||||
<!--针对设计器进行颜色扩展,以及文字扩充-->
|
<!--针对设计器进行颜色扩展,以及文字扩充-->
|
||||||
<script type='text/javascript' charset='UTF-8' src='../apps/com.actionsoft.apps.coe.pal/lib/designer/extend/js/designer.extend.userdefined.js'></script>
|
<script type='text/javascript' charset='UTF-8' src='../apps/com.actionsoft.apps.coe.pal/lib/designer/extend/js/designer.extend.userdefined.js'></script>
|
||||||
<!-- <script type='text/javascript' charset='UTF-8' src='../apps/_bpm.platform/js/designer/extend/js/designer.extend.userdefined.js'></script>-->
|
<!-- <script type='text/javascript' charset='UTF-8' src='../apps/_bpm.platform/js/designer/extend/js/designer.extend.userdefined.js'></script>-->
|
||||||
@ -90,7 +88,6 @@
|
|||||||
<script type="text/javascript" charset='UTF-8' src="../apps/com.actionsoft.apps.coe.pal/lib/designer/extend/js/util/json.js"></script>
|
<script type="text/javascript" charset='UTF-8' src="../apps/com.actionsoft.apps.coe.pal/lib/designer/extend/js/util/json.js"></script>
|
||||||
<script type="text/javascript" src="../commons/js/jquery/scripts/ui/aws.util.js"></script>
|
<script type="text/javascript" src="../commons/js/jquery/scripts/ui/aws.util.js"></script>
|
||||||
<script type='text/javascript' src='../commons/js/public.js'></script>
|
<script type='text/javascript' src='../commons/js/public.js'></script>
|
||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
//公共信息
|
//公共信息
|
||||||
var appId = "<#appId>";
|
var appId = "<#appId>";
|
||||||
@ -293,7 +290,6 @@
|
|||||||
if (navigator.userAgent.toLowerCase().match(/chrome/) != null) {
|
if (navigator.userAgent.toLowerCase().match(/chrome/) != null) {
|
||||||
$(function() {
|
$(function() {
|
||||||
$(".footer_chrome").show();
|
$(".footer_chrome").show();
|
||||||
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
@ -351,6 +347,9 @@
|
|||||||
$(document).ready(function(){
|
$(document).ready(function(){
|
||||||
// 自定义帮助扩展
|
// 自定义帮助扩展
|
||||||
initCustomHelpToolExtMenuUrl();
|
initCustomHelpToolExtMenuUrl();
|
||||||
|
if (methodId !== 'process.epc') {
|
||||||
|
$('#bar_sort').css('display','none')
|
||||||
|
}
|
||||||
|
|
||||||
if (!installBatch) {// 未安装批处理应用,删除功能入口
|
if (!installBatch) {// 未安装批处理应用,删除功能入口
|
||||||
$('li[ac=batchreplace]').remove();
|
$('li[ac=batchreplace]').remove();
|
||||||
@ -622,6 +621,9 @@
|
|||||||
<div id="bar_redo" class="toolbar_button" awsui-qtip='恢复 (Ctrl+Y)'>
|
<div id="bar_redo" class="toolbar_button" awsui-qtip='恢复 (Ctrl+Y)'>
|
||||||
<div class="ico redo"></div>
|
<div class="ico redo"></div>
|
||||||
</div>
|
</div>
|
||||||
|
<div id="bar_sort" class="toolbar_button" awsui-qtip='编号刷'>
|
||||||
|
<div class="ico sort"></div>
|
||||||
|
</div>
|
||||||
<div id="bar_brush" class="toolbar_button" awsui-qtip='格式刷 (Ctrl+Shift+B)'>
|
<div id="bar_brush" class="toolbar_button" awsui-qtip='格式刷 (Ctrl+Shift+B)'>
|
||||||
<div class="ico brush"></div>
|
<div class="ico brush"></div>
|
||||||
</div>
|
</div>
|
||||||
@ -929,6 +931,9 @@
|
|||||||
<div id="dock_btn_link" class="toolbar_button" onclick="Dock.showView('link');setCookie('<#uuid>', 'page,true');" awsui-qtip="链接">
|
<div id="dock_btn_link" class="toolbar_button" onclick="Dock.showView('link');setCookie('<#uuid>', 'page,true');" awsui-qtip="链接">
|
||||||
<div class="ico ico_link"></div>
|
<div class="ico ico_link"></div>
|
||||||
</div>
|
</div>
|
||||||
|
<div id="dock_btn_diff" class="toolbar_button" onclick="Dock.showView('diff');setCookie('<#uuid>', 'page,true');" awsui-qtip="版本差异">
|
||||||
|
<div class="ico ico_dock_diff"></div>
|
||||||
|
</div>
|
||||||
<#processlink_ete_analysis>
|
<#processlink_ete_analysis>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -1287,6 +1292,18 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="dock_view dock_view_diff" style="width: 300px;">
|
||||||
|
<div class="dock_view_header">
|
||||||
|
版本差异
|
||||||
|
<span id="validate_count"></span>
|
||||||
|
<div class="ico ico_dock_collapse"></div>
|
||||||
|
</div>
|
||||||
|
<div id="sideDiffDiv" class="dock_content" style="padding: 0px; max-height: 400px; overflow-y: auto;">
|
||||||
|
<table style="border-collapse:collapse;background-color: white;margin: 10px">
|
||||||
|
<tbody class="diffTableTbody" id="diffTable"></tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!--
|
<!--
|
||||||
@ -2829,8 +2846,8 @@
|
|||||||
<iframe width="100%" id="upfile-content-iframe" name="upfile-content-iframe" frameBorder="0" style="width: 100%; height:100%;"></iframe>
|
<iframe width="100%" id="upfile-content-iframe" name="upfile-content-iframe" frameBorder="0" style="width: 100%; height:100%;"></iframe>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="visio_import_dlg" title="Visio导入" style="display: none;">
|
<div id="visio_import_dlg" title="Visio导入" style="display: none;">
|
||||||
<table class="awsui-ux" cellspacing="3" cellpadding="0" style="width: 100%; margin: 25px auto;">
|
<table class="awsui-ux" cellspacing="3" cellpadding="0" style="width: 100%; margin: 25px auto;">
|
||||||
<tr>
|
<tr>
|
||||||
<td style="width: 250px;"><input id="visio_import_input" type="text" placeholder="请上传visio文件..." class="awsui-input" readonly=true style="width: 240px;" /></td>
|
<td style="width: 250px;"><input id="visio_import_input" type="text" placeholder="请上传visio文件..." class="awsui-input" readonly=true style="width: 240px;" /></td>
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@ -1722,5 +1722,9 @@
|
|||||||
<param name="uuids"/>
|
<param name="uuids"/>
|
||||||
<param name="isSub"/>
|
<param name="isSub"/>
|
||||||
</cmd-bean>
|
</cmd-bean>
|
||||||
|
<cmd-bean name="com.actionsoft.apps.coe.pal_pl_manage_method_object_desc_save">
|
||||||
|
<param name="shapeName"/>
|
||||||
|
<param name="desc"/>
|
||||||
|
<param name="methodId"/>
|
||||||
|
</cmd-bean>
|
||||||
</aws-actions>
|
</aws-actions>
|
||||||
@ -870,6 +870,7 @@ function openTextareaDialog(obj, title,id) {
|
|||||||
// 打开文件属性表格弹框
|
// 打开文件属性表格弹框
|
||||||
|
|
||||||
function showTableDialog(obj,value,id) {
|
function showTableDialog(obj,value,id) {
|
||||||
|
debugger;
|
||||||
let tableRef = JSON.parse($(obj).attr('ref'))
|
let tableRef = JSON.parse($(obj).attr('ref'))
|
||||||
let tableName = $(obj).attr('tableTitle')
|
let tableName = $(obj).attr('tableTitle')
|
||||||
let tableList = []
|
let tableList = []
|
||||||
@ -965,72 +966,180 @@ function removeTr(obj) {
|
|||||||
|
|
||||||
//打开对象关联Dialog
|
//打开对象关联Dialog
|
||||||
function openRelationDialog(obj, callback) {
|
function openRelationDialog(obj, callback) {
|
||||||
|
debugger;
|
||||||
var title = obj.closest('tr').find('td:first').text();
|
var title = obj.closest('tr').find('td:first').text();
|
||||||
if (title == undefined || title == '') {
|
if (title == undefined || title == '') {
|
||||||
title = '选择模型对象';
|
title = '选择模型对象';
|
||||||
}
|
}
|
||||||
var ref = obj.attr('ref');// 存储关联范围配置
|
var ref = obj.attr('ref');// 存储关联范围配置
|
||||||
var relationDlg = parent.FrmDialog.open({
|
var method=JSON.parse(ref).method;
|
||||||
title: title,
|
|
||||||
width:710,
|
var methodName="";
|
||||||
height: 400,
|
if(method=="process"){
|
||||||
url:"./w",
|
methodName="新建表单模型";
|
||||||
data:{
|
}else if(method=="control.kpi"){
|
||||||
sid: $("#sid").val(),
|
methodName="新建绩效模型";
|
||||||
cmd: "com.actionsoft.apps.coe.pal_pl_repository_designer_shapes_tree",
|
}
|
||||||
wsId: $("#wsid").val(),
|
if(method=="process" || method=="control.kpi"){
|
||||||
ref: ref,
|
var relationDlg = parent.FrmDialog.open({
|
||||||
shapeId: "",
|
title: title,
|
||||||
attrId: obj.attr("id"),
|
width:710,
|
||||||
relationShapeIds: obj.attr("relationShapeId"),
|
height: 400,
|
||||||
relationFileIds: obj.attr("relationFileId"),
|
url:"./w",
|
||||||
modelId: $("#id").val(),
|
data:{
|
||||||
ruuid: uuid
|
sid: $("#sid").val(),
|
||||||
},
|
cmd: "com.actionsoft.apps.coe.pal_pl_repository_designer_shapes_tree",
|
||||||
id:"relationDialog",
|
wsId: $("#wsid").val(),
|
||||||
buttons: [
|
ref: ref,
|
||||||
{text:'确定',cls:"blue",handler:function(){
|
shapeId: "",
|
||||||
var attrId = obj.attr("id");
|
attrId: obj.attr("id"),
|
||||||
var relationFileId = "";
|
relationShapeIds: obj.attr("relationShapeId"),
|
||||||
var relationShapeId = "";
|
relationFileIds: obj.attr("relationFileId"),
|
||||||
var relationShapeText = "";
|
modelId: $("#id").val(),
|
||||||
var relations = relationDlg.win().getRelationShapeInfos();
|
ruuid: uuid
|
||||||
var isRequired = obj.attr('isRequired')
|
},
|
||||||
if (isRequired == 'true' && relations.length == 0) {
|
id:"relationDialog",
|
||||||
obj.val('');
|
buttons: [
|
||||||
obj.attr('placeholder',title +'不能为空')
|
{
|
||||||
obj.addClass("required_input_css");
|
text : '刷新',
|
||||||
parent.FrmDialog.close("relationDialog");
|
cls : "yellow",
|
||||||
return;
|
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++) {
|
text : methodName,
|
||||||
var relationShape = relations[i];
|
cls : "green",
|
||||||
if(i == relations.length -1) {
|
handler : function() {
|
||||||
relationFileId += relationShape.relationFileId;
|
//跳转表单/绩效模型
|
||||||
relationShapeId += relationShape.relationShapeId;
|
$.ajax({
|
||||||
relationShapeText += relationShape.relationShapeText;
|
type : "POST",
|
||||||
} else {
|
url : "./jd?sid="
|
||||||
relationFileId += relationShape.relationFileId + ",";
|
+ $("#sid").val()
|
||||||
relationShapeId += relationShape.relationShapeId + ",";
|
+ "&cmd=com.actionsoft.apps.coe.pal_pl_repository_designer_relation_shape_createDialogModel",
|
||||||
relationShapeText += relationShape.relationShapeText + ",";
|
data : {
|
||||||
|
uuid:uuid,
|
||||||
|
methodId: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("attrId", attrId);
|
obj.attr("relationFileId", relationFileId);
|
||||||
obj.attr("relationFileId", relationFileId);
|
obj.attr("relationShapeId", relationShapeId);
|
||||||
obj.attr("relationShapeId", relationShapeId);
|
obj.val(relationShapeText);
|
||||||
obj.val(relationShapeText);
|
if (callback && callback == "saveContent") {
|
||||||
if (callback && callback == "saveContent") {
|
saveContent(obj);
|
||||||
saveContent(obj);
|
}
|
||||||
}
|
parent.FrmDialog.close("relationDialog");
|
||||||
parent.FrmDialog.close("relationDialog");
|
}},
|
||||||
}},
|
{text:'取消',handler:function(){
|
||||||
{text:'取消',handler:function(){
|
parent.FrmDialog.close("relationDialog");
|
||||||
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) {
|
function selectAttrTabTag(showContent, selfObj) {
|
||||||
|
|||||||
@ -85,6 +85,7 @@ function openDefaultNode() {
|
|||||||
|
|
||||||
// 新建层次 打开对话框
|
// 新建层次 打开对话框
|
||||||
function createProcessLevel(wd, wsid, parentid, id) {
|
function createProcessLevel(wd, wsid, parentid, id) {
|
||||||
|
debugger;
|
||||||
var title = "";
|
var title = "";
|
||||||
if (id == undefined) {
|
if (id == undefined) {
|
||||||
id = 0;
|
id = 0;
|
||||||
|
|||||||
@ -200,7 +200,76 @@ $(function() {
|
|||||||
// saveTimer();
|
// saveTimer();
|
||||||
intervalRefresh();
|
intervalRefresh();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 编号刷点击事件
|
||||||
|
$('#bar_sort').off("click").on("click",function (){
|
||||||
|
if ($("#saving_tip").text() != "已保存成功" && $("#saving_tip").text() != "保存成功" && $("#saving_tip").text() != "您的文件已经成功保存") {
|
||||||
|
$.simpleAlert('页面未保存,请先保存', 'error', 1500);
|
||||||
|
return;
|
||||||
|
} else {
|
||||||
|
// $.simpleAlert("正在编号", "loading");
|
||||||
|
// $.ajax({
|
||||||
|
// type: "POST",
|
||||||
|
// url: "./jd",
|
||||||
|
// data: {
|
||||||
|
// sid: CLB.sid,
|
||||||
|
// cmd: "com.actionsoft.apps.coe.pal_repository_process_define_save",
|
||||||
|
// uuid: ruuid,
|
||||||
|
// },
|
||||||
|
// success: function (msg, textStatus, jqXHR) {
|
||||||
|
// $.simpleAlert("close");
|
||||||
|
// console.log(msg)
|
||||||
|
// },
|
||||||
|
// error: function (jqXHR, textStatus, errorThrown) {
|
||||||
|
// $.simpleAlert("close");
|
||||||
|
// $.simpleAlert('编号失败', 'error', 1500);
|
||||||
|
// }
|
||||||
|
// })
|
||||||
|
let numObj = {
|
||||||
|
brushId: 'number_brush',
|
||||||
|
orderList: [
|
||||||
|
{ shapeId: 'obj_c9e1cda208700001132717c019b9a350',order: 1},
|
||||||
|
{ shapeId: 'obj_c9e1cda2b8a000013b42e5f045db1f01',order: 2},
|
||||||
|
{ shapeId: 'obj_c9e1cda4ac10000164dd6bb015406b40',order: 3},
|
||||||
|
{ shapeId: 'obj_c9e1cda3109000015741104116a918a8',order: 4},
|
||||||
|
{ shapeId: 'obj_c9e1cdab200000014a2eade016e8170d',order: 5},
|
||||||
|
{ shapeId: 'obj_c9e1cdb266f0000159a7c8afa7701a68',order: 6},
|
||||||
|
]
|
||||||
|
}
|
||||||
|
let obj = Model.define
|
||||||
|
console.log(obj)
|
||||||
|
let elements = obj.elements
|
||||||
|
let orderList = numObj.orderList
|
||||||
|
for (let j = 0; j < orderList.length; j++) {
|
||||||
|
for(let i in elements) {
|
||||||
|
if (orderList[j].shapeId == i) {
|
||||||
|
for(let a = 0; a < elements[i].dataAttributes.length; a ++ ) {
|
||||||
|
if(elements[i].dataAttributes[a].attributesJsonArray !== undefined) {
|
||||||
|
for(let b = 0; b < elements[i].dataAttributes[a].attributesJsonArray.length; b ++) {
|
||||||
|
if(elements[i].dataAttributes[a].attributesJsonArray[b].id == numObj.brushId) {
|
||||||
|
elements[i].dataAttributes[a].attributesJsonArray[b].value = orderList[j].order
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// for(let i in elements) {
|
||||||
|
// for(let a = 0; a < elements[i].dataAttributes.length; a ++ ) {
|
||||||
|
// if(elements[i].dataAttributes[a].attributesJsonArray !== undefined) {
|
||||||
|
// for(let b = 0; b < elements[i].dataAttributes[a].attributesJsonArray.length; b ++) {
|
||||||
|
// if(elements[i].dataAttributes[a].attributesJsonArray[b].id == 'number_brush') {
|
||||||
|
// elements[i].dataAttributes[a].attributesJsonArray[b].value = 24
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
$("#saving_tip").css("color", "rgb(255, 0, 0)");
|
||||||
|
$("#saving_tip").text("文件已修改,未保存");
|
||||||
|
}
|
||||||
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -363,6 +363,13 @@ height: 25px;
|
|||||||
padding:0 5px;
|
padding:0 5px;
|
||||||
white-space: normal;
|
white-space: normal;
|
||||||
}
|
}
|
||||||
|
.diffTableTbody tr td{
|
||||||
|
border:1px solid #ccc;
|
||||||
|
padding:5px;
|
||||||
|
white-space: normal;
|
||||||
|
min-height: 25px;
|
||||||
|
line-height: 20px;
|
||||||
|
}
|
||||||
.dialogTableTbody tr td{
|
.dialogTableTbody tr td{
|
||||||
color: #666666;
|
color: #666666;
|
||||||
border:1px solid #ccc;
|
border:1px solid #ccc;
|
||||||
|
|||||||
@ -3421,6 +3421,7 @@ function getRelevanceAwsOrgNameByShapeId(objIds, shapeId) {
|
|||||||
|
|
||||||
// 形状关联弹窗
|
// 形状关联弹窗
|
||||||
function openRelationDig(obj,value) {
|
function openRelationDig(obj,value) {
|
||||||
|
debugger;
|
||||||
var shapeRelationValue = $("input[objid_shapeId='" + $(obj).attr("objid") + "']").val();
|
var shapeRelationValue = $("input[objid_shapeId='" + $(obj).attr("objid") + "']").val();
|
||||||
var ref = $("input[objid_shapeId='" + $(obj).attr("objid") + "']").attr("ref"); // shape file shapeAndFile
|
var ref = $("input[objid_shapeId='" + $(obj).attr("objid") + "']").attr("ref"); // shape file shapeAndFile
|
||||||
var relationShapeIds = '';
|
var relationShapeIds = '';
|
||||||
@ -3453,7 +3454,7 @@ function openRelationDig(obj,value) {
|
|||||||
+ "&relationFileIds=" + relationFileIds
|
+ "&relationFileIds=" + relationFileIds
|
||||||
+ "&ruuid=" + ruuid);
|
+ "&ruuid=" + ruuid);
|
||||||
|
|
||||||
//根据角色/绩效图形,并新增对应图形
|
//根据角色
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type : "POST",
|
type : "POST",
|
||||||
url : "./jd?sid="
|
url : "./jd?sid="
|
||||||
@ -3461,18 +3462,10 @@ function openRelationDig(obj,value) {
|
|||||||
+ "&cmd=com.actionsoft.apps.coe.pal_pl_repository_designer_relation_find_same_role",
|
+ "&cmd=com.actionsoft.apps.coe.pal_pl_repository_designer_relation_find_same_role",
|
||||||
data : {
|
data : {
|
||||||
uuid:ruuid,
|
uuid:ruuid,
|
||||||
method:JSON.parse(ref).method
|
methodId:methodId
|
||||||
},
|
},
|
||||||
success : function(msg) {
|
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" ) {
|
if (msg.data.result == "ok" ) {
|
||||||
$("#attr_dialog_normal_relevance_shapes_div").dialog({
|
$("#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({
|
$("#attr_dialog_normal_relevance_shapes_div").dialog({
|
||||||
buttons : [
|
buttons : [
|
||||||
@ -3516,10 +3509,10 @@ function openRelationDig(obj,value) {
|
|||||||
document.getElementById("attr_content_iframe_relevance_shapes").contentWindow.location.reload(true);
|
document.getElementById("attr_content_iframe_relevance_shapes").contentWindow.location.reload(true);
|
||||||
}
|
}
|
||||||
},{
|
},{
|
||||||
text : modelname,
|
text : "新建角色模型",
|
||||||
cls : "green",
|
cls : "green",
|
||||||
handler : function() {
|
handler : function() {
|
||||||
//跳转角色/绩效图形,并新增角色/绩效图形
|
//跳转角色
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type : "POST",
|
type : "POST",
|
||||||
url : "./jd?sid="
|
url : "./jd?sid="
|
||||||
|
|||||||
@ -196,7 +196,19 @@ var Designer = {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
var h = $("#shape_thumb");
|
var h = $("#shape_thumb");
|
||||||
h.children("div").text(b.title);
|
var title = b.title;
|
||||||
|
var category = b.category;
|
||||||
|
if (b.category == "bpmn") {
|
||||||
|
category = 'process_bpmn2';
|
||||||
|
}
|
||||||
|
if (category == 'lane') {
|
||||||
|
category = methodId;
|
||||||
|
}
|
||||||
|
category = category.replace(/_/g,".");
|
||||||
|
if (methodObjectDesc[category + '-' + b.name]) {
|
||||||
|
title += (':' + methodObjectDesc[category + '-' + b.name]);
|
||||||
|
}
|
||||||
|
h.children("div").text(title);
|
||||||
var j = h.children("canvas")[0].getContext("2d");
|
var j = h.children("canvas")[0].getContext("2d");
|
||||||
var A = {
|
var A = {
|
||||||
x: 0,
|
x: 0,
|
||||||
@ -3268,7 +3280,20 @@ var Designer = {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (r.attribute.visible) {
|
if (r.attribute.visible) {
|
||||||
var u = $("<div class='panel_box' shapeName='" + y + "'><canvas title='" + r.title + "' title_pos='right' width='" + (Designer.config.panelItemWidth) + "' height='" + (Designer.config.panelItemHeight) + "'></canvas></div>").appendTo(s);
|
var title = r.title;
|
||||||
|
var category = r.category;
|
||||||
|
if (r.category == "bpmn") {
|
||||||
|
category = 'process_bpmn2';
|
||||||
|
}
|
||||||
|
category = category.replace(/_/g,".");
|
||||||
|
if (category == 'lane') {
|
||||||
|
category = methodId;
|
||||||
|
}
|
||||||
|
if (methodObjectDesc[category + '-' + r.name]) {
|
||||||
|
title += (':' + methodObjectDesc[category + '-' + r.name]);
|
||||||
|
}
|
||||||
|
|
||||||
|
var u = $("<div class='panel_box' shapeName='" + y + "'><canvas title='" + title + "' title_pos='right' width='" + (Designer.config.panelItemWidth) + "' height='" + (Designer.config.panelItemHeight) + "'></canvas></div>").appendTo(s);
|
||||||
var x = u.children("canvas")[0];
|
var x = u.children("canvas")[0];
|
||||||
Designer.painter.drawPanelItem(x, r.name)
|
Designer.painter.drawPanelItem(x, r.name)
|
||||||
}
|
}
|
||||||
@ -6046,7 +6071,7 @@ var Utils = {
|
|||||||
shape: am
|
shape: am
|
||||||
};
|
};
|
||||||
at.push(al);
|
at.push(al);
|
||||||
continue
|
|
||||||
} else {
|
} else {
|
||||||
if (this.pointInRect(am.from.x.toScale(), am.from.y.toScale(), ae)) {
|
if (this.pointInRect(am.from.x.toScale(), am.from.y.toScale(), ae)) {
|
||||||
var al = {
|
var al = {
|
||||||
@ -6055,7 +6080,7 @@ var Utils = {
|
|||||||
shape: am
|
shape: am
|
||||||
};
|
};
|
||||||
at.push(al);
|
at.push(al);
|
||||||
continue
|
|
||||||
} else {
|
} else {
|
||||||
var aj = i.find(".text_canvas");
|
var aj = i.find(".text_canvas");
|
||||||
var ah = aj.position();
|
var ah = aj.position();
|
||||||
@ -6087,7 +6112,7 @@ var Utils = {
|
|||||||
pointIndex: ag
|
pointIndex: ag
|
||||||
};
|
};
|
||||||
at.push(al);
|
at.push(al);
|
||||||
continue
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -6182,9 +6207,9 @@ var Utils = {
|
|||||||
shape: am
|
shape: am
|
||||||
};
|
};
|
||||||
at.push(al);
|
at.push(al);
|
||||||
continue
|
|
||||||
} else {
|
} else {
|
||||||
continue
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
var al = {
|
var al = {
|
||||||
@ -6192,7 +6217,7 @@ var Utils = {
|
|||||||
shape: am
|
shape: am
|
||||||
};
|
};
|
||||||
at.push(al);
|
at.push(al);
|
||||||
continue
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (!am.attribute || typeof am.attribute.linkable == "undefined" || am.attribute.linkable) {
|
if (!am.attribute || typeof am.attribute.linkable == "undefined" || am.attribute.linkable) {
|
||||||
@ -6255,7 +6280,7 @@ var Utils = {
|
|||||||
}
|
}
|
||||||
if (al != null) {
|
if (al != null) {
|
||||||
at.push(al);
|
at.push(al);
|
||||||
continue
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@ -3042,6 +3042,82 @@ var Dock = {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
else if(this.currentView == 'diff') {
|
||||||
|
// var html = "<div style=\"font-size: 16px; color: #aaa; text-align: center; vertical-align: middle; line-height: 200px;\">暂无版本差异</div>";
|
||||||
|
var html = ''
|
||||||
|
var diffContent = [
|
||||||
|
{
|
||||||
|
versionName: 'Ver 2.0',
|
||||||
|
updateTime: '5月19日 16:00',
|
||||||
|
updateContent: [
|
||||||
|
{
|
||||||
|
title: '文件修改:',
|
||||||
|
detail: ['[内容]增加了111111111111111111','[责任部门]增加了11111111111111111']
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '节点修改:',
|
||||||
|
detail: ['删除[开始事件]节点','删除[开始]节点','删除[人工]节点']
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '[文件]删除11111111111',
|
||||||
|
detail: []
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
versionName: 'Ver 1.0',
|
||||||
|
updateTime: '5月14日 15:00',
|
||||||
|
updateContent: [
|
||||||
|
{
|
||||||
|
title: '文件修改',
|
||||||
|
detail: ['[内容]增加了111111111111 ',]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '节点修改',
|
||||||
|
detail: ['删除[开始事件]节点','删除[开始]节点','删除[人工]节点','删除[结束]节点']
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '[制度]增加了11111111111111',
|
||||||
|
detail: []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '[文件]删除了11111111111',
|
||||||
|
detail: []
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
for (var i = 0; i < diffContent.length; i++) {
|
||||||
|
var diffCount = 0
|
||||||
|
var content = diffContent[i].updateContent
|
||||||
|
var diffListHtml = ''
|
||||||
|
for (var j = 0; j < content.length; j++) {
|
||||||
|
var diffDetailHtml = ''
|
||||||
|
var listDetail = content[j].detail
|
||||||
|
if (listDetail.length == 0) {
|
||||||
|
diffCount +=1
|
||||||
|
}
|
||||||
|
for (var k = 0; k < listDetail.length; k++) {
|
||||||
|
diffCount +=1
|
||||||
|
diffDetailHtml += '<div style="margin-left: 10px">' + '·' +listDetail[k]+'</div>'
|
||||||
|
}
|
||||||
|
diffListHtml += '<div>' + content[j].title +'</div>'
|
||||||
|
+ '<div>'+diffDetailHtml+'</div>'
|
||||||
|
|
||||||
|
}
|
||||||
|
html += '<tr>'
|
||||||
|
+ '<td style="width:50px;">' + diffContent[i].versionName + '</td>'
|
||||||
|
+ '<td style="width:250px">' + diffContent[i].updateTime + '<span style="padding-left: 10px">' + '(' + diffCount + '处修改)' + '</span>' + '</td>'
|
||||||
|
+ '</tr>'
|
||||||
|
+ '<tr>'
|
||||||
|
+ '<td style="width:50px"></td>'
|
||||||
|
+ '<td style="width:250px">' + diffListHtml + '</td>'
|
||||||
|
+ '</tr>'
|
||||||
|
|
||||||
|
}
|
||||||
|
$("#diffTable").empty().html(html)
|
||||||
|
|
||||||
|
}
|
||||||
if (this.currentView == "history") {
|
if (this.currentView == "history") {
|
||||||
if (drawNav && Dock.historyVersions == null) {
|
if (drawNav && Dock.historyVersions == null) {
|
||||||
this.loadHistorys();
|
this.loadHistorys();
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@ -147,6 +147,9 @@ html{
|
|||||||
.ico.redo{
|
.ico.redo{
|
||||||
background-position: -20px 0px;
|
background-position: -20px 0px;
|
||||||
}
|
}
|
||||||
|
.ico.sort{
|
||||||
|
background-position: 1px -637px;
|
||||||
|
}
|
||||||
.ico.brush{
|
.ico.brush{
|
||||||
background-position: -20px -20px;
|
background-position: -20px -20px;
|
||||||
}
|
}
|
||||||
@ -284,6 +287,9 @@ html{
|
|||||||
.ico_link{
|
.ico_link{
|
||||||
background-position: -20px -420px;
|
background-position: -20px -420px;
|
||||||
}
|
}
|
||||||
|
.ico_dock_diff {
|
||||||
|
background-position: -20px -440px;
|
||||||
|
}
|
||||||
.ico_risk{
|
.ico_risk{
|
||||||
background-position: -40px -620px;
|
background-position: -40px -620px;
|
||||||
}
|
}
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 18 KiB |
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
After Width: | Height: | Size: 158 KiB |
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -0,0 +1 @@
|
|||||||
|
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2d0ab156"],{1485:function(t,a,e){"use strict";e.r(a);var n=function(){var t=this,a=t.$createElement,e=t._self._c||a;return e("div",{staticStyle:{width:"100%",height:"100%"}},[e("iframe",{staticStyle:{border:"0"},attrs:{id:"iframe",width:"100%",height:"100%",name:"iframe",src:t.src}})])},i=[],s={name:"MappingManagement",data:function(){return{src:"./w?sid="+this.$store.state.sessionId+"&cmd=com.actionsoft.apps.coe.pal.mappingmanagement_main_page&dataType="+this.$route.params.dataType}}},r=s,c=e("cba8"),p=Object(c["a"])(r,n,i,!1,null,"56fd105e",null);a["default"]=p.exports}}]);
|
||||||
File diff suppressed because one or more lines are too long
@ -0,0 +1 @@
|
|||||||
|
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2d0f078a"],{"9d09":function(t,e,i){"use strict";i.r(e);var n=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{style:{width:"100%",height:t.mainHeight}},[i("iframe",{staticStyle:{border:"0"},attrs:{id:"orgIframe",width:"100%",height:parseInt(t.mainHeight)-4+"px",name:"orgIframe",src:t.src}})])},s=[],a={name:"BPMOrg",data:function(){return{src:"./w?sid="+this.$store.state.sessionId+"&cmd=com.actionsoft.apps.coe.pal_average_user_org",mainHeight:parseInt(this.$store.getters.getTopMainHeightFn)-4+"px"}},computed:{listenTopMainHeight:function(){return this.$store.getters.getTopMainHeightFn}},watch:{listenTopMainHeight:function(t,e){this.mainHeight=parseInt(this.$store.getters.getTopMainHeightFn)-4+"px"}}},r=a,o=i("cba8"),c=Object(o["a"])(r,n,s,!1,null,"2280cc48",null);e["default"]=c.exports}}]);
|
||||||
@ -0,0 +1 @@
|
|||||||
|
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2d216d3a"],{c3b6:function(t,e,i){"use strict";i.r(e);var n=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{style:{width:"100%",height:t.mainHeight},attrs:{id:"cooperation"}},[i("iframe",{staticStyle:{border:"0"},attrs:{id:"coopIframe",width:"100%",height:parseInt(t.mainHeight)-4+"px",name:"coopIframe",src:t.src}})])},a=[],o={name:"cooperationCreate",data:function(){return{src:wHref+"?sid="+this.$store.state.sessionId+"&mainPage=create&cmd=com.actionsoft.apps.coe.pal.cooperation_main",mainHeight:parseInt(this.$store.getters.getTopMainHeightFn)-4+"px"}},computed:{listenTopMainHeight:function(){return this.$store.getters.getTopMainHeightFn}},watch:{listenTopMainHeight:function(t,e){this.mainHeight=parseInt(this.$store.getters.getTopMainHeightFn)-4+"px"}}},s=o,r=i("cba8"),c=Object(r["a"])(s,n,a,!1,null,"6a826a48",null);e["default"]=c.exports}}]);
|
||||||
@ -0,0 +1 @@
|
|||||||
|
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2d224b23"],{e0df:function(t,e,i){"use strict";i.r(e);var n=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{style:{width:"100%",height:t.mainHeight},attrs:{id:"cooperationUpdate"}},[i("iframe",{staticStyle:{border:"0"},attrs:{id:"coopIframe",width:"100%",height:parseInt(t.mainHeight)-4+"px",name:"coopIframe",src:t.src}})])},a=[],o={name:"CooperationUpdate",data:function(){return{src:wHref+"?sid="+this.$store.state.sessionId+"&mainPage=update&cmd=com.actionsoft.apps.coe.pal.cooperation_main",mainHeight:parseInt(this.$store.getters.getTopMainHeightFn)-4+"px"}},computed:{listenTopMainHeight:function(){return this.$store.getters.getTopMainHeightFn}},watch:{listenTopMainHeight:function(t,e){this.mainHeight=parseInt(this.$store.getters.getTopMainHeightFn)-4+"px"}}},s=o,r=i("cba8"),p=Object(r["a"])(s,n,a,!1,null,"543345d8",null);e["default"]=p.exports}}]);
|
||||||
@ -0,0 +1 @@
|
|||||||
|
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2d224ef1"],{e1f5:function(e,s,t){"use strict";t.r(s);var n=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t("div",{staticClass:"devGetSession"},[e._v(" 正在获取session ")])},a=[],o=t("a18c"),d=t("0f08"),i=t("4360");d["a"].post({url:"jd",data:{userid:devUserInfo.userid,pwd:devUserInfo.pwd,lang:"cn",cmd:"com.actionsoft.apps.getsession.get",deviceType:"pc"}}).then((function(e){"error"==e.result?alert("获取session错误:"+e.msg):(i["a"].commit("edit",{sessionId:e.data.sid}),o["a"].replace("/"))}));var c={data:function(){return{dwList:[]}},methods:{},mounted:function(){}},r=c,u=t("cba8"),l=Object(u["a"])(r,n,a,!1,null,null,null);s["default"]=l.exports}}]);
|
||||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Binary file not shown.
@ -4,7 +4,6 @@ import java.util.ArrayList;
|
|||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import com.actionsoft.apps.coe.pal.pal.output.constant.OutputConst;
|
import com.actionsoft.apps.coe.pal.pal.output.constant.OutputConst;
|
||||||
import com.actionsoft.apps.listener.PluginListener;
|
import com.actionsoft.apps.listener.PluginListener;
|
||||||
import com.actionsoft.apps.resource.AppContext;
|
import com.actionsoft.apps.resource.AppContext;
|
||||||
@ -12,8 +11,8 @@ import com.actionsoft.apps.resource.plugin.profile.AWSPluginProfile;
|
|||||||
import com.actionsoft.apps.resource.plugin.profile.AppExtensionProfile;
|
import com.actionsoft.apps.resource.plugin.profile.AppExtensionProfile;
|
||||||
import com.actionsoft.apps.resource.plugin.profile.DCPluginProfile;
|
import com.actionsoft.apps.resource.plugin.profile.DCPluginProfile;
|
||||||
import com.alibaba.fastjson.JSONArray;
|
import com.alibaba.fastjson.JSONArray;
|
||||||
|
import com.awspaas.apps.coe.pal.output.bd.report1.Report1WizardOptionbd;
|
||||||
import com.awspaas.apps.coe.pal.output.bd.report1.Report1Gener;
|
import com.awspaas.apps.coe.pal.output.bd.report1.Report1Gener;
|
||||||
import com.awspaas.apps.coe.pal.output.bd.report1.Report1WizardOption;
|
|
||||||
|
|
||||||
public class Plugins implements PluginListener {
|
public class Plugins implements PluginListener {
|
||||||
|
|
||||||
@ -29,17 +28,13 @@ public class Plugins implements PluginListener {
|
|||||||
|
|
||||||
// 注册应用扩展点
|
// 注册应用扩展点
|
||||||
Map<String, Object> params1 = new HashMap<String, Object>();
|
Map<String, Object> params1 = new HashMap<String, Object>();
|
||||||
params1.put("groupName", "表达的手册");
|
params1.put("groupName", "表达手册");
|
||||||
params1.put("title", "表单-手册");
|
params1.put("title", "表单-手册");
|
||||||
/* params1.put("targetMethodScope", PrReportComment.TARGET_METHOD_SCOPE);// 建模大类、建模方法,多个用逗号隔开,如果为空表示全部
|
|
||||||
params1.put("targetMethodType", "");// 建模方法中的图元,为空表示只选择文件,不选择图元;为"-"表示所有类型图元
|
|
||||||
params1.put("relationMethodScope", "-");// 如果设置-,表示不需要用户选择关联范围,向导页被忽略*/
|
|
||||||
params1.put("targetMethodScope", "data.form");// 建模大类、建模方法,多个用逗号隔开,如果为空表示全部 org.normal
|
params1.put("targetMethodScope", "data.form");// 建模大类、建模方法,多个用逗号隔开,如果为空表示全部 org.normal
|
||||||
params1.put("targetMethodType", "");// 建模方法中的图元,为空表示只选择文件,不选择图元;为"-"表示所有类型图元
|
params1.put("targetMethodType", "");// 建模方法中的图元,为空表示只选择文件,不选择图元;为"-"表示所有类型图元
|
||||||
params1.put("relationMethodScope", "-");// 如果设置-,表示不需要用户选择关联范围,向导页被忽略
|
params1.put("relationMethodScope", "-");// 如果设置-,表示不需要用户选择关联范围,向导页被忽略
|
||||||
|
|
||||||
params1.put("lang", "cn");// 该App支持的语言,多个用逗号隔开
|
params1.put("lang", "cn");// 该App支持的语言,多个用逗号隔开
|
||||||
params1.put("optionClass", Report1WizardOption.class.getName());// 附加的报表选项,如果该值没有,向导页被忽略
|
params1.put("optionClass", Report1WizardOptionbd.class.getName());// 附加的报表选项,如果该值没有,向导页被忽略
|
||||||
params1.put("generClass", Report1Gener.class.getName());// 生成报告
|
params1.put("generClass", Report1Gener.class.getName());// 生成报告
|
||||||
// 模版上传下载参数
|
// 模版上传下载参数
|
||||||
params1.put("isDownload", true);
|
params1.put("isDownload", true);
|
||||||
@ -48,57 +43,6 @@ public class Plugins implements PluginListener {
|
|||||||
array3.add("表单-手册.xml");
|
array3.add("表单-手册.xml");
|
||||||
params1.put("templates", array3.toString());
|
params1.put("templates", array3.toString());
|
||||||
list.add(new AppExtensionProfile("PAL报告->表单-手册", "aslp://com.actionsoft.apps.coe.pal/registerOutputApp", params1));
|
list.add(new AppExtensionProfile("PAL报告->表单-手册", "aslp://com.actionsoft.apps.coe.pal/registerOutputApp", params1));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// 注册应用扩展点
|
|
||||||
/*Map<String, Object> params1 = new HashMap<String, Object>();
|
|
||||||
params1.put("groupName", "流程手册");
|
|
||||||
params1.put("title", "步骤横表");
|
|
||||||
params1.put("targetMethodScope", PrReportComment.TARGET_METHOD_SCOPE);// 建模大类、建模方法,多个用逗号隔开,如果为空表示全部
|
|
||||||
params1.put("targetMethodType", "");// 建模方法中的图元,为空表示只选择文件,不选择图元;为"-"表示所有类型图元
|
|
||||||
params1.put("relationMethodScope", "-");// 如果设置-,表示不需要用户选择关联范围,向导页被忽略
|
|
||||||
params1.put("lang", "cn");// 该App支持的语言,多个用逗号隔开
|
|
||||||
params1.put("optionClass", Report1WizardOption.class.getName());// 附加的报表选项,如果该值没有,向导页被忽略
|
|
||||||
params1.put("generClass", Report1Gener.class.getName());// 生成报告
|
|
||||||
// 模版上传下载参数
|
|
||||||
params1.put("isDownload", true);
|
|
||||||
JSONArray array1 = new JSONArray();
|
|
||||||
array1.add("步骤横表-流程手册.doc");
|
|
||||||
array1.add("步骤横表-流程手册.xml");
|
|
||||||
params1.put("templates", array1.toString());
|
|
||||||
list.add(new AppExtensionProfile("PAL报告->步骤横表", "aslp://com.actionsoft.apps.coe.pal/registerOutputApp", params1));
|
|
||||||
|
|
||||||
Map<String, Object> params2 = new HashMap<String, Object>();
|
|
||||||
params2.put("groupName", "流程手册");
|
|
||||||
params2.put("title", "步骤竖表");
|
|
||||||
params2.put("targetMethodScope", PrReportComment.TARGET_METHOD_SCOPE);// 建模大类、建模方法,多个用逗号隔开,如果为空表示全部
|
|
||||||
params2.put("targetMethodType", "");// 建模方法中的图元,为空表示只选择文件,不选择图元;为"-"表示所有类型图元
|
|
||||||
params2.put("relationMethodScope", "-");// 如果设置-,表示不需要用户选择关联范围,向导页被忽略
|
|
||||||
params2.put("lang", "cn");// 该App支持的语言,多个用逗号隔开
|
|
||||||
params2.put("optionClass", Report2WizardOption.class.getName());// 附加的报表选项,如果该值没有,向导页被忽略
|
|
||||||
params2.put("generClass", Report2Gener.class.getName());// 生成报告
|
|
||||||
// 模版上传下载参数
|
|
||||||
params2.put("isDownload", true);
|
|
||||||
JSONArray array2 = new JSONArray();
|
|
||||||
array2.add("步骤竖表-流程手册.doc");
|
|
||||||
array2.add("步骤竖表-流程手册.xml");
|
|
||||||
params2.put("templates", array2.toString());
|
|
||||||
list.add(new AppExtensionProfile("PAL报告->步骤竖表", "aslp://com.actionsoft.apps.coe.pal/registerOutputApp", params2));
|
|
||||||
|
|
||||||
Map<String, Object> params4 = new HashMap<String, Object>();
|
|
||||||
params4.put("groupName", "流程手册");
|
|
||||||
params4.put("title", "流程手册");
|
|
||||||
params4.put("targetMethodScope", PrReportComment.TARGET_METHOD_SCOPE);// 建模大类、建模方法,多个用逗号隔开,如果为空表示全部
|
|
||||||
params4.put("targetMethodType", "");// 建模方法中的图元,为空表示只选择文件,不选择图元;为"-"表示所有类型图元
|
|
||||||
params4.put("relationMethodScope", "-");// 如果设置-,表示不需要用户选择关联范围,向导页被忽略
|
|
||||||
params4.put("lang", "cn");// 该App支持的语言,多个用逗号隔开
|
|
||||||
params4.put("optionClass", Report4WizardOption.class.getName());// 附加的报表选项,如果该值没有,向导页被忽略
|
|
||||||
params4.put("generClass", Report4Gener.class.getName());// 生成报告
|
|
||||||
list.add(new AppExtensionProfile("PAL报告->流程手册", "aslp://com.actionsoft.apps.coe.pal/registerOutputApp", params4));*/
|
|
||||||
|
|
||||||
|
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user