Merge remote-tracking branch 'origin/master'
# 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/htmltodocx/Test.java # com.actionsoft.apps.coe.pal.datamigration/src/com/actionsoft/apps/coe/pal/datamigration/util/readtable/ReadTable.java # com.actionsoft.apps.coe.pal.datamigration/src/com/actionsoft/apps/coe/pal/datamigration/util/readtable/WordTableAttrFile.java
This commit is contained in:
commit
6d5308528b
Binary file not shown.
@ -1,7 +1,9 @@
|
||||
package com.actionsoft.apps.coe.pal.datamigration;
|
||||
|
||||
import com.actionsoft.apps.coe.pal.datamigration.util.readtable.ReadTable;
|
||||
import com.actionsoft.apps.coe.pal.datamigration.aris.web.ArisXmlImportWeb;
|
||||
import com.actionsoft.apps.coe.pal.datamigration.util.readword.ReadWordUtil;
|
||||
import com.actionsoft.apps.coe.pal.datamigration.web.DataMigrationWeb;
|
||||
import com.actionsoft.bpms.commons.mvc.view.ResponseObject;
|
||||
import com.actionsoft.bpms.server.UserContext;
|
||||
import com.actionsoft.bpms.server.bind.annotation.Controller;
|
||||
import com.actionsoft.bpms.server.bind.annotation.Mapping;
|
||||
@ -49,18 +51,57 @@ public class DataMigrationController {
|
||||
}
|
||||
|
||||
/**
|
||||
* by bzp 表单文件上传之后 解析文件
|
||||
* @param me
|
||||
* @param wsId
|
||||
* @param groupValue
|
||||
* @param fileValue
|
||||
* @param fileName
|
||||
* 查询aris流程导入日志
|
||||
* @param uc
|
||||
* @param logId
|
||||
* @param path
|
||||
* @param timer
|
||||
* @return
|
||||
*/
|
||||
@Mapping("com.actionsoft.apps.coe.pal.formImport_process_attribute_import")
|
||||
public String formattributeimport(UserContext me,String wsId,String groupValue,String fileValue,String fileName){
|
||||
new ReadTable().getTableInfo(me,wsId,groupValue,fileValue,fileName);
|
||||
ResponseObject ro = ResponseObject.newOkResponse();
|
||||
return ro.toString();
|
||||
@Mapping("com.actionsoft.apps.coe.pal.datamigration_data_migrate_log_query")
|
||||
public String queryArisXmlImportLog(UserContext uc, String logId, String path, String timer) {
|
||||
ArisXmlImportWeb web = new ArisXmlImportWeb(uc);
|
||||
return web.queryArisXmlImportLog(logId, path, timer);
|
||||
}
|
||||
|
||||
/**
|
||||
* 下载日志
|
||||
* @param uc
|
||||
* @param logId
|
||||
* @param path
|
||||
* @return
|
||||
*/
|
||||
@Mapping("com.actionsoft.apps.coe.pal.datamigration_data_migrate_log_download")
|
||||
public String downloadArisXmlImportLog(UserContext uc, String logId, String path) {
|
||||
ArisXmlImportWeb web = new ArisXmlImportWeb(uc);
|
||||
return web.downloadArisXmlImportLog(logId, path);
|
||||
}
|
||||
|
||||
/**
|
||||
* by bzp
|
||||
* 富文本保存 并解析
|
||||
*
|
||||
* @param me
|
||||
* @param content
|
||||
* @return
|
||||
*/
|
||||
@Mapping("com.actionsoft.apps.coe.pal.saveRichtext")
|
||||
public String saveRichtext(UserContext me, String content, String pluuid, String shapId) {
|
||||
DataMigrationWeb web = new DataMigrationWeb(me);
|
||||
return web.saveRichText(me, content, pluuid, shapId).toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* by bzp
|
||||
* 富文本加载时 获取内容
|
||||
* @param me
|
||||
* @param pluuid
|
||||
* @param shapId
|
||||
* @return
|
||||
*/
|
||||
@Mapping("com.actionsoft.apps.coe.pal.getRichtext")
|
||||
public String getRichtext(UserContext me, String pluuid, String shapId) {
|
||||
DataMigrationWeb web = new DataMigrationWeb(me);
|
||||
return web.getRichText(me, pluuid, shapId);
|
||||
}
|
||||
}
|
||||
|
||||
@ -0,0 +1,238 @@
|
||||
package com.actionsoft.apps.coe.pal.datamigration.util;
|
||||
|
||||
import com.actionsoft.apps.coe.pal.datamigration.aris.constant.ArisConstant;
|
||||
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.dao.LogDao;
|
||||
import com.actionsoft.apps.coe.pal.datamigration.log.model.LogModel;
|
||||
import com.actionsoft.apps.resource.plugin.profile.DCPluginProfile;
|
||||
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 java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.sql.Timestamp;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
|
||||
public class WordLogUtil {
|
||||
|
||||
private UserContext uc;
|
||||
private String logId;
|
||||
private String logPath;
|
||||
private File infoLogFile;
|
||||
private File warnLogFile;
|
||||
private File errorLogFile;
|
||||
private File fullLogFile;
|
||||
private String filePath;
|
||||
private String fileName;
|
||||
|
||||
public WordLogUtil(UserContext _uc){
|
||||
this.uc = _uc;
|
||||
logId = UUIDGener.getUUID();// 记录缓存
|
||||
String fileValue = "AttrtibuteImported-" + new SimpleDateFormat("yyyy-MM-dd HH-mm-ss").format(new Date()) + "--" + _uc.getUID();
|
||||
// 创建dc目录
|
||||
DCPluginProfile dcProfile = DCProfileManager.getDCProfile(Constant.APP_ID, Constant.UPFILE);
|
||||
DCContext dc = new DCContext(_uc, dcProfile, Constant.APP_ID, "log", fileValue);
|
||||
|
||||
String dirPath = dc.getPath();
|
||||
File file = new File(dirPath);
|
||||
if (!file.exists()){
|
||||
file.mkdirs();
|
||||
}
|
||||
|
||||
try {
|
||||
infoLogFile = new File(dirPath,"simpleImport.log");
|
||||
if (!infoLogFile.exists()){
|
||||
infoLogFile.createNewFile();
|
||||
}
|
||||
|
||||
fullLogFile = new File(dirPath,"fullImport.log");
|
||||
if (!fullLogFile.exists()){
|
||||
fullLogFile.createNewFile();
|
||||
}
|
||||
|
||||
warnLogFile = new File(dirPath,"warningImport.log" );
|
||||
if (!warnLogFile.exists()){
|
||||
warnLogFile.createNewFile();
|
||||
}
|
||||
errorLogFile = new File(dirPath,"errorImport.log");
|
||||
if (!errorLogFile.exists()){
|
||||
errorLogFile.createNewFile();
|
||||
}
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
logPath = fullLogFile.getPath();// 前端实时展示的日志
|
||||
}
|
||||
|
||||
|
||||
public void appendInfoLog(String content) {
|
||||
LogUtil.appendLog(content,infoLogFile);
|
||||
}
|
||||
|
||||
public void appendFullLog(String content) {
|
||||
LogUtil.appendLog(content,fullLogFile);
|
||||
}
|
||||
|
||||
public void appendErrorLog(String content) {
|
||||
LogUtil.appendLog(content,errorLogFile);
|
||||
}
|
||||
public void appendWarnLog(String content) {
|
||||
LogUtil.appendLog(content,warnLogFile);
|
||||
}
|
||||
|
||||
public void appendAllAndInfoLog(String content) {
|
||||
LogUtil.appendLog(content,fullLogFile,infoLogFile);
|
||||
}
|
||||
public void appendAllAndWarnLog(String content) {
|
||||
LogUtil.appendLog(content,fullLogFile,warnLogFile);
|
||||
}
|
||||
|
||||
public void appendAllAndErrorLog(String content) {
|
||||
LogUtil.appendLog(content,fullLogFile,errorLogFile);
|
||||
}
|
||||
|
||||
public void appendAllLog(String content) {
|
||||
LogUtil.appendLog(content,infoLogFile,fullLogFile,warnLogFile,errorLogFile);
|
||||
}
|
||||
|
||||
/**
|
||||
* 记录一次批量上传行为
|
||||
* @param id
|
||||
* @param wsId 资产库id
|
||||
* @param fileName 批量记录名称
|
||||
* @param filePath 批量上传的dc地址
|
||||
* @param createDate 创建时间
|
||||
*/
|
||||
public 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);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取此次批量结果状态值
|
||||
* @return
|
||||
*/
|
||||
public int getLogResultStatus(){
|
||||
return LogUtil.queryLog(logId).getResultStatus();
|
||||
}
|
||||
|
||||
public void updateErrLog(String logFileMsg, String logDbMsg) {
|
||||
// 记录日志
|
||||
this.appendAllAndErrorLog(logFileMsg);
|
||||
// 日志表记录导入结果
|
||||
LogUtil.updateLog(logId, new Timestamp(System.currentTimeMillis()), Constant.LOG_RESULT_StATUS_ERROR, logDbMsg);
|
||||
// 清空缓存
|
||||
// LogRealTimeCountCache.getCache().remove(logId);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 更新日志(日志操作行为,非具体日志信息)
|
||||
* @param id
|
||||
* @param endDate 结束时间
|
||||
* @param resultType 结果状态
|
||||
* @param mainInfo 主要信息
|
||||
* @return
|
||||
*/
|
||||
public int updateLog(Timestamp endDate, int resultType, String mainInfo) {
|
||||
return new LogDao().update(logId, endDate, resultType, mainInfo);
|
||||
}
|
||||
|
||||
public String takeTime(long startTime,long endTime) {
|
||||
long time = endTime - startTime;
|
||||
String timeMsg = "";
|
||||
if (time > 1000 * 60) {
|
||||
timeMsg = "[" + (time / 1000 / 60) + "]分钟";
|
||||
} else if (time > 1000) {
|
||||
timeMsg = "[" + (time / 1000) + "]秒";
|
||||
} else {
|
||||
timeMsg = "[" + time + "]毫秒";
|
||||
}
|
||||
return timeMsg;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public String getLogId() {
|
||||
return logId;
|
||||
}
|
||||
|
||||
public void setLogId(String logId) {
|
||||
this.logId = logId;
|
||||
}
|
||||
|
||||
public String getLogPath() {
|
||||
return logPath;
|
||||
}
|
||||
|
||||
public void setLogPath(String logPath) {
|
||||
this.logPath = logPath;
|
||||
}
|
||||
|
||||
public File getInfoLogFile() {
|
||||
return infoLogFile;
|
||||
}
|
||||
|
||||
public void setInfoLogFile(File infoLogFile) {
|
||||
this.infoLogFile = infoLogFile;
|
||||
}
|
||||
|
||||
public File getWarnLogFile() {
|
||||
return warnLogFile;
|
||||
}
|
||||
|
||||
public void setWarnLogFile(File warnLogFile) {
|
||||
this.warnLogFile = warnLogFile;
|
||||
}
|
||||
|
||||
public File getErrorLogFile() {
|
||||
return errorLogFile;
|
||||
}
|
||||
|
||||
public void setErrorLogFile(File errorLogFile) {
|
||||
this.errorLogFile = errorLogFile;
|
||||
}
|
||||
|
||||
public File getFullLogFile() {
|
||||
return fullLogFile;
|
||||
}
|
||||
|
||||
public void setFullLogFile(File fullLogFile) {
|
||||
this.fullLogFile = fullLogFile;
|
||||
}
|
||||
|
||||
public String getFilePath() {
|
||||
return filePath;
|
||||
}
|
||||
|
||||
public void setFilePath(String filePath) {
|
||||
this.filePath = filePath;
|
||||
}
|
||||
|
||||
public String getFileName() {
|
||||
return fileName;
|
||||
}
|
||||
|
||||
public void setFileName(String fileName) {
|
||||
this.fileName = fileName;
|
||||
}
|
||||
}
|
||||
@ -12,6 +12,7 @@ import org.apache.poi.hwpf.HWPFDocument;
|
||||
import org.apache.poi.hwpf.usermodel.*;
|
||||
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.IOException;
|
||||
import java.util.*;
|
||||
|
||||
@ -72,64 +73,56 @@ public class WordUtil {
|
||||
|
||||
public WordUtil() { }
|
||||
|
||||
public boolean analysisWordTable(String filePath){
|
||||
try {
|
||||
HWPFDocument doc = new HWPFDocument(new FileInputStream(filePath));
|
||||
Range range = doc.getRange();
|
||||
|
||||
for (int i =0;i<range.numParagraphs();i++){
|
||||
Paragraph paragraph = range.getParagraph(i);
|
||||
String text = paragraph.text();
|
||||
if (StringUtils.isEmpty(text)||"\r".equals(text)){
|
||||
continue;
|
||||
}
|
||||
|
||||
//获取文件编码
|
||||
if (text.contains("文件编码") && fileFieldMap.get("文件编码") == null){
|
||||
this.fileNo = this.getFileNo(text);
|
||||
this.isOldVersion = this.isOldVersion(this.fileNo);
|
||||
fileFieldMap.put("文件编码",new WordField<>(this.fileNo));
|
||||
}
|
||||
|
||||
//获取文件名称
|
||||
if (this.isTitle(paragraph)){
|
||||
this.fileName += text.trim();
|
||||
}
|
||||
|
||||
if (this.isOldVersion){
|
||||
//旧版本文档
|
||||
AnalysisStrategyContext strategyContext = new AnalysisStrategyContext();
|
||||
if (this.isTitle(paragraph)){
|
||||
//文件标题下解析后续table
|
||||
AnalysisStrategy titleField = strategyContext.getStrategy("VerticalFeild");
|
||||
Map<String, WordField<Object>> analysis = titleField.analysis(doc, i);
|
||||
fileFieldMap.putAll(analysis);
|
||||
}
|
||||
WordAttribute wordAttribute = oldWordAttributeMap.get(text.trim());
|
||||
if (null == wordAttribute){
|
||||
continue;
|
||||
}
|
||||
AnalysisStrategy strategy = strategyContext.getStrategy(wordAttribute.getType());
|
||||
Map<String, WordField<Object>> analysis = strategy.analysis(doc, i);
|
||||
fileFieldMap.putAll(analysis);
|
||||
}else {
|
||||
WordAttribute wordAttribute = wordAttributeMap.get(text.trim());
|
||||
if (null == wordAttribute){
|
||||
continue;
|
||||
}
|
||||
AnalysisStrategy strategy = new AnalysisStrategyContext().getStrategy(wordAttribute.getType());
|
||||
Map<String, WordField<Object>> analysis = strategy.analysis(doc,i);
|
||||
fileFieldMap.putAll(analysis);
|
||||
}
|
||||
public void analysisWordTable(String filePath) throws IOException ,RuntimeException {
|
||||
HWPFDocument doc = new HWPFDocument(new FileInputStream(filePath));
|
||||
Range range = doc.getRange();
|
||||
|
||||
for (int i =0;i<range.numParagraphs();i++){
|
||||
Paragraph paragraph = range.getParagraph(i);
|
||||
String text = paragraph.text();
|
||||
if (StringUtils.isEmpty(text)||"\r".equals(text)){
|
||||
continue;
|
||||
}
|
||||
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
return false;
|
||||
}
|
||||
//获取文件编码
|
||||
if (text.contains("文件编码") && fileFieldMap.get("文件编码") == null){
|
||||
this.fileNo = this.getFileNo(text);
|
||||
this.isOldVersion = this.isOldVersion(this.fileNo);
|
||||
fileFieldMap.put("文件编码",new WordField<>(this.fileNo));
|
||||
}
|
||||
|
||||
return true;
|
||||
//获取文件名称
|
||||
if (this.isTitle(paragraph)){
|
||||
this.fileName += text.trim();
|
||||
}
|
||||
|
||||
if (this.isOldVersion){
|
||||
//旧版本文档
|
||||
AnalysisStrategyContext strategyContext = new AnalysisStrategyContext();
|
||||
if (this.isTitle(paragraph)){
|
||||
//文件标题下解析后续table
|
||||
AnalysisStrategy titleField = strategyContext.getStrategy("VerticalFeild");
|
||||
Map<String, WordField<Object>> analysis = titleField.analysis(doc, i);
|
||||
fileFieldMap.putAll(analysis);
|
||||
}
|
||||
WordAttribute wordAttribute = oldWordAttributeMap.get(text.trim());
|
||||
if (null == wordAttribute){
|
||||
continue;
|
||||
}
|
||||
AnalysisStrategy strategy = strategyContext.getStrategy(wordAttribute.getType());
|
||||
Map<String, WordField<Object>> analysis = strategy.analysis(doc, i);
|
||||
fileFieldMap.putAll(analysis);
|
||||
}else {
|
||||
WordAttribute wordAttribute = wordAttributeMap.get(text.trim());
|
||||
if (null == wordAttribute){
|
||||
continue;
|
||||
}
|
||||
AnalysisStrategy strategy = new AnalysisStrategyContext().getStrategy(wordAttribute.getType());
|
||||
Map<String, WordField<Object>> analysis = strategy.analysis(doc,i);
|
||||
fileFieldMap.putAll(analysis);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
private String getFileNo(String text){
|
||||
|
||||
File diff suppressed because one or more lines are too long
@ -37,6 +37,7 @@ import java.util.*;
|
||||
public class ReadTable {
|
||||
public static Map<String, WordAttribute> wordAttributeMap = new HashMap<>();
|
||||
public static Map<String, String> nameToIdMap = new HashMap<>();
|
||||
public static Map<String, String> idToNameMap = new HashMap<>();
|
||||
|
||||
//基础字段
|
||||
public Map<String, String> fieldMap = new HashMap<>();
|
||||
@ -59,6 +60,7 @@ public class ReadTable {
|
||||
});
|
||||
nameToId.forEach(wordAttribute -> {
|
||||
nameToIdMap.put(wordAttribute.getTitle(), wordAttribute.getType());
|
||||
idToNameMap.put(wordAttribute.getType(), wordAttribute.getTitle());
|
||||
});
|
||||
}
|
||||
|
||||
@ -110,7 +112,18 @@ public class ReadTable {
|
||||
InputStream docfile = SDK.getDCAPI().read(dcContextpdfdoc);
|
||||
//画一个图形 并返回图形ID
|
||||
String shapId = createOneMap(wsId, docname.replace(".doc", ""), userContext, docfile);
|
||||
|
||||
//先把默认属性给他弄上~~~然后再赋值
|
||||
BaseModel defineModel = CoeDesignerAPIManager.getInstance().getDefinition(palRepositoryModel.getId(), 0);
|
||||
if (defineModel == null) {
|
||||
defineModel = CoeDesignerUtil.createModel(palRepositoryModel.getId(), 0);
|
||||
defineModel.setCreateHistory(false);
|
||||
}
|
||||
String define = defineModel.getDefinition();
|
||||
JSONObject definition = JSONObject.parseObject(define);
|
||||
JSONObject elements = definition.getJSONObject("elements");
|
||||
Map<String, Map<String, JSONObject>> methodAttrsMap = new HashMap<>();
|
||||
//handleShapeDefaultAttr("", palRepositoryModel, elements, methodAttrsMap, docfile);
|
||||
//writeAttrbute(userContext, docfile, docname.replace(".doc", ""), elements.getJSONObject(shapId));
|
||||
//解析附件进行复制
|
||||
DCContext dcContextpdf1 = new DCContext(userContext, dcProfilepdfdoc, "com.actionsoft.apps.coe.pal.datamigration", groupValue, fileValue, docxname);
|
||||
InputStream docxfile = SDK.getDCAPI().read(dcContextpdf1);
|
||||
@ -129,7 +142,7 @@ public class ReadTable {
|
||||
nameToIdMap.forEach((key, value) -> {
|
||||
//根据key去更新
|
||||
WordField tmpw = fileFieldMap.get(key);
|
||||
if (tmpw != null) {
|
||||
/*if (tmpw != null) {
|
||||
JSONObject tmp = new JSONObject();
|
||||
tmp.put("ref", "");
|
||||
tmp.put("icon", "../apps/com.actionsoft.apps.coe.pal/img/icon/shape_attribute.png");
|
||||
@ -142,7 +155,7 @@ public class ReadTable {
|
||||
tmp.put("groupPath", "baseAttribute");
|
||||
tmp.put("key", value);
|
||||
attribute.add(tmp);
|
||||
}
|
||||
}*/
|
||||
});
|
||||
}
|
||||
return shapeze;
|
||||
@ -181,8 +194,10 @@ public class ReadTable {
|
||||
props1.put("w", 110);
|
||||
props1.put("h", 50);
|
||||
props1.put("zindex", 0);
|
||||
writeAttrbute(userContext, docfile, name, shapeze);
|
||||
elements.put(shapeIdz, shapeze);
|
||||
|
||||
Map<String, Map<String, JSONObject>> methodAttrsMap = new HashMap<>();
|
||||
handleShapeDefaultAttr("", palRepositoryModel, elements, methodAttrsMap, docfile);
|
||||
// 设置画布大小
|
||||
defineModel.setDefinition(definition.toString());
|
||||
// 保存文件
|
||||
@ -225,20 +240,20 @@ public class ReadTable {
|
||||
break;
|
||||
}
|
||||
}*/
|
||||
//标题后续直接为table
|
||||
if (nowPara.isInTable()) {
|
||||
Table table = range.getTable(nowPara);
|
||||
Map<String, List<String>> tabelDocText = this.getHorizontalTableMapText(table);
|
||||
tabelDocText.keySet().forEach(key -> {
|
||||
List<String> strings = tabelDocText.get(key);
|
||||
if (!strings.isEmpty()) {
|
||||
fieldMap.put(key.replace(" ",""), strings.get(0));
|
||||
fileFieldMap.put(key.replace(" ",""), new WordField<>(strings.get(0)));
|
||||
}
|
||||
});
|
||||
i += table.numParagraphs();
|
||||
}
|
||||
// continue;
|
||||
//标题后续直接为table
|
||||
if (nowPara.isInTable()) {
|
||||
Table table = range.getTable(nowPara);
|
||||
Map<String, List<String>> tabelDocText = this.getHorizontalTableMapText(table);
|
||||
tabelDocText.keySet().forEach(key -> {
|
||||
List<String> strings = tabelDocText.get(key);
|
||||
if (!strings.isEmpty()) {
|
||||
fieldMap.put(key.replace(" ", ""), strings.get(0));
|
||||
fileFieldMap.put(key.replace(" ", ""), new WordField<>(strings.get(0)));
|
||||
}
|
||||
});
|
||||
i += table.numParagraphs();
|
||||
}
|
||||
// continue;
|
||||
//}
|
||||
}
|
||||
} catch (IOException e) {
|
||||
@ -292,4 +307,92 @@ public class ReadTable {
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 自定义属性
|
||||
*
|
||||
* @param wsId
|
||||
* @param palModel
|
||||
* @param elements
|
||||
* @param methodAttrsMap
|
||||
*/
|
||||
public void handleShapeDefaultAttr(String wsId, PALRepositoryModel palModel, JSONObject elements, Map<String, Map<String, JSONObject>> methodAttrsMap, InputStream file) {
|
||||
boolean result = analysisWordTable(file);
|
||||
for (String key : elements.keySet()) {
|
||||
JSONObject shape = elements.getJSONObject(key);
|
||||
if ("linker".equals(shape.getString("name"))) {
|
||||
continue;
|
||||
}
|
||||
String shapeMehtodId = shape.getString("category").replace("_", ".");
|
||||
String shapeName = shape.getString("name");
|
||||
|
||||
if (methodAttrsMap.containsKey(palModel.getMethodId()) && methodAttrsMap.containsKey(shapeName)) {
|
||||
} else {
|
||||
if (!methodAttrsMap.containsKey(palModel.getMethodId())) {
|
||||
methodAttrsMap.put(palModel.getMethodId(), new HashMap<>());
|
||||
}
|
||||
JSONObject attrs = ShapeUtil.getProcessUseShapeMethodAttrByShapeName(palModel.getWsId(), shapeMehtodId, palModel.getMethodId(), shapeName);
|
||||
if (attrs != null) {
|
||||
methodAttrsMap.get(palModel.getMethodId()).put(shapeName, attrs);
|
||||
}
|
||||
}
|
||||
JSONObject attrs = methodAttrsMap.get(palModel.getMethodId()).get(shapeName);// 最终属性内容
|
||||
attrs = JSONObject.parseObject(attrs.toString());// 复制
|
||||
JSONArray dataAttributes = shape.getJSONArray("dataAttributes");
|
||||
if (!dataAttributes.isEmpty() && dataAttributes.size() > 0) {
|
||||
for (Object attribute : dataAttributes) {
|
||||
JSONObject obj = (JSONObject) attribute;
|
||||
if (obj.containsKey("attributesJsonArray")) {
|
||||
JSONArray attributesJsonArray = obj.getJSONArray("attributesJsonArray");
|
||||
Set<String> attrIds = new HashSet<>();
|
||||
for (int i = 0; i < attributesJsonArray.size(); i++) {
|
||||
if (attributesJsonArray.getJSONObject(i).containsKey("id")) {
|
||||
attrIds.add(attributesJsonArray.getJSONObject(i).getString("id"));
|
||||
}
|
||||
}
|
||||
for (String attrId : attrs.keySet()) {
|
||||
if (!attrIds.contains(attrId)) {
|
||||
JSONObject eleAttrObj = getDefaultAttrObj(attrs.getJSONObject(attrId));
|
||||
String id = eleAttrObj.getString("id");
|
||||
String name = idToNameMap.get(id);
|
||||
WordField tmpw = fileFieldMap.get(name);
|
||||
if (tmpw != null) {
|
||||
eleAttrObj.put("value", tmpw.getData());
|
||||
}
|
||||
attributesJsonArray.add(eleAttrObj);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取默认属性内容
|
||||
*
|
||||
* @param attr
|
||||
* @return
|
||||
*/
|
||||
public JSONObject getDefaultAttrObj(JSONObject attr) {
|
||||
String ref = attr.getString("ref");
|
||||
boolean readonly = attr.getBooleanValue("readonly");
|
||||
String scope = attr.getString("scope");
|
||||
String attrName = attr.getString("title");
|
||||
String attrId = attr.getString("id");
|
||||
String type = attr.getString("type");
|
||||
String groupPath = attr.getString("groupPath");
|
||||
String attrKey = attr.getString("key");
|
||||
String attrValue = "";
|
||||
JSONObject object2 = new JSONObject();
|
||||
object2.put("ref", ref);
|
||||
object2.put("readonly", readonly);
|
||||
object2.put("scope", scope);
|
||||
object2.put("name", attrName);
|
||||
object2.put("id", attrId);
|
||||
object2.put("type", type);
|
||||
object2.put("groupPath", groupPath);
|
||||
object2.put("key", attrKey);
|
||||
object2.put("value", "");
|
||||
return object2;
|
||||
}
|
||||
}
|
||||
|
||||
@ -6,7 +6,7 @@ package com.actionsoft.apps.coe.pal.datamigration.util.readtable;
|
||||
* @date 2022/6/21 17:21
|
||||
*/
|
||||
|
||||
import com.actionsoft.apps.coe.pal.datamigration.constant.CoEConstant;
|
||||
import com.actionsoft.apps.coe.pal.constant.CoEConstant;
|
||||
import com.actionsoft.apps.coe.pal.datamigration.util.readword.CustomXWPFDocument;
|
||||
import com.actionsoft.apps.coe.pal.pal.repository.upfile.constant.CoeFileConstant;
|
||||
import com.actionsoft.apps.coe.pal.pal.repository.upfile.dao.UpFileDao;
|
||||
|
||||
@ -9,9 +9,7 @@ import com.actionsoft.apps.coe.pal.datamigration.aris.web.ArisXmlImportWeb;
|
||||
import com.actionsoft.apps.coe.pal.datamigration.constant.Constant;
|
||||
import com.actionsoft.apps.coe.pal.datamigration.model.po.AwsOrgInfo;
|
||||
import com.actionsoft.apps.coe.pal.datamigration.model.po.WordField;
|
||||
import com.actionsoft.apps.coe.pal.datamigration.util.ExcelUtil;
|
||||
import com.actionsoft.apps.coe.pal.datamigration.util.ShapeUtil;
|
||||
import com.actionsoft.apps.coe.pal.datamigration.util.WordUtil;
|
||||
import com.actionsoft.apps.coe.pal.datamigration.util.*;
|
||||
import com.actionsoft.apps.coe.pal.datamigration.util.readword.CreateMaps;
|
||||
import com.actionsoft.apps.coe.pal.log.CoEOpLogAPI;
|
||||
import com.actionsoft.apps.coe.pal.log.CoEOpLogConst;
|
||||
@ -126,185 +124,79 @@ public class DataMigrationWeb extends ActionWeb {
|
||||
* @param fileName
|
||||
* @return
|
||||
*/
|
||||
public String processAttributeImport(String wsId, String groupValue, String fileValue, String fileName) {
|
||||
public String processAttributeImport(String wsId, String groupValue, String fileValue) {
|
||||
ResponseObject ro = ResponseObject.newOkResponse();
|
||||
|
||||
//构建DCContext 获取上传文件
|
||||
DCContext fileDcContext = this.getFileDcContext(groupValue, fileValue, fileName);
|
||||
DCContext fileDcContext = this.getFileDcContext(groupValue, fileValue);
|
||||
if (null == fileDcContext) {
|
||||
return ResponseObject.newErrResponse("文件参数异常").toString();
|
||||
}
|
||||
//批量解析文档
|
||||
File dirFile = new File(fileDcContext.getPath());
|
||||
File[] fileArr = dirFile.listFiles();
|
||||
|
||||
//解析Word文档
|
||||
WordUtil wordUtil = new WordUtil();
|
||||
boolean analysisFlag = wordUtil.analysisWordTable(fileDcContext.getFilePath());
|
||||
// boolean analysisFlag = wordUtil.analysisWordTable("/Users/actionsoft/Documents/IdeaWorkSpace/demo/src/main/resources/伊利集团流程制度类文件发布流程vf.doc");
|
||||
if (!analysisFlag) {
|
||||
return ResponseObject.newErrResponse("文件解析异常").toString();
|
||||
//日志记录名称搭建
|
||||
String fileName = "";
|
||||
for (int i = 0; i < fileArr.length; i++) {
|
||||
File file = fileArr[i];
|
||||
fileName = StringUtils.isEmpty(fileName) ? fileName + file.getName() : fileName + ","+ file.getName();
|
||||
if (i>=2){
|
||||
fileName += "等";
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
//获取解析后的文件名称,同名策略匹配pal寻找对应文件
|
||||
String repositoryName = wordUtil.getFileName();
|
||||
PALRepositoryModel importModel = this.getRepositoryByName(wsId, repositoryName);
|
||||
if (null == importModel) {
|
||||
return ResponseObject.newErrResponse("匹配pal文件异常,找不到同名文件").toString();
|
||||
Timestamp startTime = new Timestamp(System.currentTimeMillis());
|
||||
WordLogUtil wordLogUtil = new WordLogUtil(_uc);
|
||||
//新建数据库记录
|
||||
wordLogUtil.createLogModel(wordLogUtil.getLogId(),wsId,fileName,fileDcContext.getPath(),startTime);
|
||||
|
||||
//初始化日志
|
||||
wordLogUtil.appendInfoLog("注:该日志文件存储简要日志信息");
|
||||
wordLogUtil.appendFullLog("注:该日志文件存储详细日志信息");
|
||||
wordLogUtil.appendErrorLog("注:该日志文件记录错误日志信息");
|
||||
wordLogUtil.appendWarnLog("注:该日志文件记录警告日志信息");
|
||||
|
||||
wordLogUtil.appendAllLog("\n[信息]操作人:" + _uc.getUserName() + "<" + _uc.getUID() + ">");
|
||||
wordLogUtil.appendAllLog("[信息]操作时间:" + UtilDate.datetimeFormat(startTime));
|
||||
|
||||
// 校验资产库是否存在可用
|
||||
boolean isActive = PALRepositoryQueryAPIManager.getInstance().isActiveWorkSpace(wsId);
|
||||
if (!isActive) {
|
||||
String msg = Constant.LOG_ERROR + "资产库不存在或已停用," + Constant.IMPORT_STOP_MSG;
|
||||
wordLogUtil.updateErrLog(msg, msg);
|
||||
return ResponseObject.newErrResponse("资产库不存在或已停用").toString();
|
||||
}
|
||||
|
||||
Map<String, WordField<Object>> fileFieldMap = wordUtil.getFileFieldMap();
|
||||
//获取导入文件对应的关联文件属性list
|
||||
PALRepositoryPropertyDao propDao = new PALRepositoryPropertyDao();
|
||||
DesignerShapeRelationDao relationDao = new DesignerShapeRelationDao();
|
||||
List<PALRepositoryPropertyModel> importPropertyList = propDao.getPropertysByPlid(importModel.getId(), "");
|
||||
for (PALRepositoryPropertyModel importProperty : importPropertyList) {
|
||||
WordField<Object> wordField = fileFieldMap.get(importProperty.getPropertyName());
|
||||
//旧版本的映射字段支持
|
||||
if (null == wordField && wordUtil.getIsOldVersion()) {
|
||||
Map<String, String> oldWordMapping = wordUtil.getOldWordMapping();
|
||||
for (String s : oldWordMapping.keySet()) {
|
||||
if (s.equals(importProperty.getPropertyName())) {
|
||||
String s1 = oldWordMapping.get(s);
|
||||
wordField = fileFieldMap.get(s1);
|
||||
}
|
||||
new Thread(()->{
|
||||
int success = 0;
|
||||
int error = 0;
|
||||
for (File file : fileArr) {
|
||||
wordLogUtil.appendAllLog("\n[信息]流程属性Word文件:" + file.getName());
|
||||
wordLogUtil.appendAllLog("[信息]流程属性Word文件路径:"+ file.getPath());
|
||||
wordLogUtil.appendAllLog("-----------流程属性Word文件 Begin " + UtilDate.datetimeFormat(startTime));
|
||||
ResponseObject res = new DataMigrationWeb().analysisWord(wsId, file.getPath(), wordLogUtil);
|
||||
if (res.isErr()){
|
||||
error++;
|
||||
wordLogUtil.appendAllAndErrorLog(Constant.LOG_ERROR + "word文件--"+file.getName()+" 解析异常:"+res.getMsg()+" ,中断解析\n");
|
||||
}
|
||||
// wordField = fileFieldMap.get(oldWordMapping.get(importProperty.getPropertyName()));
|
||||
}
|
||||
if (null == wordField) {
|
||||
continue;
|
||||
}
|
||||
//使用缓存获取具体建模属性
|
||||
PALRepositoryAttributeModel repositoryAttrModel = PALRepositoryAttributeCache.getAttributeByMethodIdAndAttrId(wsId, importModel.getMethodId(), importProperty.getPropertyId());
|
||||
if (null == repositoryAttrModel) {
|
||||
continue;
|
||||
}
|
||||
if ("table".equals(repositoryAttrModel.getType())) {
|
||||
//将解析的列表数据转化为数据存储json
|
||||
JSONObject object = new JSONObject();
|
||||
object.put("name", importProperty.getPropertyName());
|
||||
JSONArray array = new JSONArray();
|
||||
List<List<String>> tableFields = (List<List<String>>) wordField.getData();
|
||||
if (!tableFields.isEmpty()) {
|
||||
for (List<String> value : tableFields) {
|
||||
if (!value.isEmpty() && value.size() > 1) {
|
||||
JSONObject obj = new JSONObject();
|
||||
obj.put("id", UUIDGener.getUUID());
|
||||
obj.put("name", value.get(0));
|
||||
obj.put("desc", value.get(1));
|
||||
array.add(obj);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (array.size() > 0) {
|
||||
//特殊处理表头
|
||||
PALMethodAttributeModel attributeModel = null;
|
||||
List<PALMethodAttributeModel> attributes = PALMethodCache.getPALMethodModelById(importModel.getMethodId()).getAttributes();
|
||||
for (PALMethodAttributeModel attribute : attributes) {
|
||||
if (attribute.getType().equals(importProperty.getPropertyId())){
|
||||
attributeModel = attribute;
|
||||
}
|
||||
}
|
||||
if (null == attributeModel || StringUtils.isEmpty(attributeModel.getRef())){
|
||||
array.getJSONObject(0).put("id", "table_head");
|
||||
}else{
|
||||
JSONObject attrRef = JSON.parseObject(attributeModel.getRef());
|
||||
array.getJSONObject(0).put("id", "table_head");
|
||||
array.getJSONObject(0).put("id", attrRef.get("firstColumn"));
|
||||
array.getJSONObject(0).put("id", attrRef.get("secondColumn"));
|
||||
}
|
||||
}
|
||||
object.put("table", array);
|
||||
//更新数据库值
|
||||
importProperty.setPropertyValue(object.toJSONString());
|
||||
propDao.update(importProperty);
|
||||
} else if ("awsorg".equals(repositoryAttrModel.getType())) {
|
||||
//aws组织架构解析,多组结构解析
|
||||
String orgName = (String) wordField.getData();
|
||||
List<AwsOrgInfo> awsOrgInfos = this.getOrgByName(orgName);
|
||||
if (!awsOrgInfos.isEmpty()) {
|
||||
//先更新property数据 [{"name":"部门3","id":"fdea04c8-502f-4367-82b7-a5ebe0ce5f67","type":"department"}]
|
||||
importProperty.setPropertyValue(JSON.toJSONString(awsOrgInfos));
|
||||
propDao.update(importProperty);
|
||||
|
||||
//先删除property关联关系,然后新增关系
|
||||
relationDao.deleteByAttrId(importModel.getId(), "", importProperty.getPropertyId());
|
||||
for (AwsOrgInfo awsOrgInfo : awsOrgInfos) {
|
||||
DesignerShapeRelationModel model = new DesignerShapeRelationModel();
|
||||
model.setFileId(importModel.getId());
|
||||
model.setShapeId("");
|
||||
model.setShapeText("");
|
||||
model.setAttrId(importProperty.getPropertyId());
|
||||
model.setRelationFileId("00000000-0000-0000-0000-000000000000");
|
||||
model.setRelationShapeId("00000000-0000-0000-0000-000000000000");
|
||||
model.setRelationShapeText(JSON.toJSONString(awsOrgInfo));
|
||||
relationDao.insert(model);
|
||||
}
|
||||
}
|
||||
} else if ("relation".equals(repositoryAttrModel.getType())) {
|
||||
//关联文件
|
||||
List<PALRepositoryModel> fileList = new ArrayList<>();
|
||||
List<String> relations = (List<String>) wordField.getData();
|
||||
for (String relation : relations) {
|
||||
PALRepositoryModel repository = this.getRepositoryByName(wsId, this.trimFileName(relation));
|
||||
if (repository != null) {
|
||||
fileList.add(repository);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//更新property数据
|
||||
String relationFileIds = "";
|
||||
for (PALRepositoryModel model : fileList) {
|
||||
relationFileIds += model.getId() + ",";
|
||||
}
|
||||
if (relationFileIds.length() > 1) {
|
||||
relationFileIds = relationFileIds.substring(0, relationFileIds.length() - 1);
|
||||
}
|
||||
JSONObject propertyJson = JSON.parseObject(importProperty.getPropertyValue());
|
||||
propertyJson.put("relationFileId", relationFileIds);
|
||||
importProperty.setPropertyValue(propertyJson.toJSONString());
|
||||
propDao.update(importProperty);
|
||||
|
||||
//先删除property关联关系,然后新增关系
|
||||
if (!fileList.isEmpty()) {
|
||||
relationDao.deleteByAttrId(importModel.getId(), "", importProperty.getPropertyId());
|
||||
for (PALRepositoryModel repositoryModel : fileList) {
|
||||
DesignerShapeRelationModel relationModel = new DesignerShapeRelationModel();
|
||||
relationModel.setFileId(importModel.getId());
|
||||
relationModel.setShapeId("");
|
||||
relationModel.setShapeText("");
|
||||
relationModel.setAttrId(importProperty.getPropertyId());
|
||||
relationModel.setRelationFileId(repositoryModel.getVersionId());
|
||||
relationModel.setRelationShapeId("");
|
||||
relationModel.setRelationShapeText(repositoryModel.getName());
|
||||
relationDao.insert(relationModel);
|
||||
}
|
||||
}
|
||||
|
||||
} else if ("select".equals(repositoryAttrModel.getType()) || "select_m".equals(repositoryAttrModel.getType())) {
|
||||
|
||||
} else if ("boolean".equals(repositoryAttrModel.getType())) {
|
||||
|
||||
} else if ("DateTimePicker".equals(repositoryAttrModel.getType())) {
|
||||
String time = (String) wordField.getData();
|
||||
try {
|
||||
Date formatTime = new SimpleDateFormat("yyyy年MM月dd日").parse(time);
|
||||
time = UtilDate.datetimeFormat(formatTime);
|
||||
} catch (ParseException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
//更新数据库值
|
||||
importProperty.setPropertyValue(time);
|
||||
propDao.update(importProperty);
|
||||
} else {
|
||||
if (wordField.getData() instanceof String) {
|
||||
//直接获取Word解析字符内容
|
||||
String value = (String) wordField.getData();
|
||||
//更新数据库值
|
||||
importProperty.setPropertyValue(value);
|
||||
propDao.update(importProperty);
|
||||
if (res.isOk()){
|
||||
success++;
|
||||
wordLogUtil.appendAllAndInfoLog(Constant.LOG_END+ "word文件--"+file.getName()+" :"+res.getMsg()+"\n");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Timestamp endTime = new Timestamp(System.currentTimeMillis());
|
||||
if (success > 0){
|
||||
String resultMsg = "批量导入成功:总耗时" + wordLogUtil.takeTime(startTime.getTime(),endTime.getTime()) + ",总计文档["+fileArr.length+"]条,导入成功[" + success + "]条,导入失败[" + error + "]条";
|
||||
wordLogUtil.updateLog(new Timestamp(System.currentTimeMillis()), Constant.LOG_RESULT_StATUS_SUCCESS, resultMsg);
|
||||
wordLogUtil.appendAllAndInfoLog(resultMsg);
|
||||
}else {
|
||||
String resultMsg = "批量导入失败:总耗时" + wordLogUtil.takeTime(startTime.getTime(),endTime.getTime()) + ",总计文档["+fileArr.length+"]条,导入成功[" + success + "]条,导入失败[" + error + "]条";
|
||||
wordLogUtil.updateLog(new Timestamp(System.currentTimeMillis()), Constant.LOG_RESULT_StATUS_ERROR, resultMsg);
|
||||
wordLogUtil.appendAllAndInfoLog(resultMsg);
|
||||
}
|
||||
}).start();
|
||||
|
||||
return ro.toString();
|
||||
}
|
||||
@ -378,7 +270,7 @@ public class DataMigrationWeb extends ActionWeb {
|
||||
shape.put("text", shapeName);
|
||||
|
||||
//图形的数据属性配置
|
||||
List<PALMethodAttributeModel> attributeModels = PALRepositoryAPIManager.getInstance().getValidAttributeModels(wsId, importModel.getMethodId());
|
||||
List<PALMethodAttributeModel> attributeModels = CoeDesignerShapeAPIManager.getInstance().getAllValidShapeAttributeModels(wsId, importModel.getMethodId());
|
||||
for (PALMethodAttributeModel attributeModel : attributeModels) {
|
||||
|
||||
Integer propertyIndex = titleMap.get(attributeModel.getTitle());
|
||||
@ -534,6 +426,254 @@ public class DataMigrationWeb extends ActionWeb {
|
||||
return index == null ? 0 : index;
|
||||
}
|
||||
|
||||
private ResponseObject analysisWord(String wsId,String filePath,WordLogUtil logUtil){
|
||||
//解析Word文档
|
||||
WordUtil wordUtil = new WordUtil();
|
||||
try {
|
||||
wordUtil.analysisWordTable(filePath);
|
||||
} catch (IOException e) {
|
||||
return ResponseObject.newErrResponse("word 文件解析异常: "+e.getMessage());
|
||||
} catch (RuntimeException e){
|
||||
return ResponseObject.newErrResponse("word 文件解析异常: "+e.getMessage());
|
||||
}
|
||||
|
||||
//获取解析后的文件名称,同名策略匹配pal寻找对应文件
|
||||
String repositoryName = wordUtil.getFileName();
|
||||
PALRepositoryModel importModel = this.getRepositoryByName(wsId, repositoryName);
|
||||
if (null == importModel) {
|
||||
return ResponseObject.newErrResponse("匹配pal文件异常,找不到同名文件");
|
||||
}
|
||||
|
||||
Map<String, WordField<Object>> fileFieldMap = wordUtil.getFileFieldMap();
|
||||
//获取导入文件对应的关联文件属性list
|
||||
PALRepositoryPropertyDao propDao = new PALRepositoryPropertyDao();
|
||||
DesignerShapeRelationDao relationDao = new DesignerShapeRelationDao();
|
||||
List<PALRepositoryPropertyModel> importPropertyList = propDao.getPropertysByPlid(importModel.getId(), "");
|
||||
if (importPropertyList.isEmpty()){
|
||||
return ResponseObject.newErrResponse("流程文件属性配置异常,没有获取到文件属性");
|
||||
}
|
||||
for (PALRepositoryPropertyModel importProperty : importPropertyList) {
|
||||
WordField<Object> wordField = fileFieldMap.get(importProperty.getPropertyName());
|
||||
//旧版本的映射字段支持
|
||||
if (null == wordField && wordUtil.getIsOldVersion()) {
|
||||
Map<String, String> oldWordMapping = wordUtil.getOldWordMapping();
|
||||
for (String s : oldWordMapping.keySet()) {
|
||||
if (s.equals(importProperty.getPropertyName())) {
|
||||
String s1 = oldWordMapping.get(s);
|
||||
wordField = fileFieldMap.get(s1);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (null == wordField) {
|
||||
continue;
|
||||
}
|
||||
logUtil.appendAllAndInfoLog(Constant.LOG_DESC+" 获取Word解析数据成功:["+importProperty.getPropertyName()+"]");
|
||||
//使用缓存获取具体建模属性
|
||||
PALRepositoryAttributeModel repositoryAttrModel = PALRepositoryAttributeCache.getAttributeByMethodIdAndAttrId(wsId, importModel.getMethodId(), importProperty.getPropertyId());
|
||||
if (null == repositoryAttrModel) {
|
||||
logUtil.appendAllAndErrorLog(Constant.LOG_ERROR+" 获取建模属性失败:["+importProperty.getPropertyName()+"]");
|
||||
continue;
|
||||
}
|
||||
if ("table".equals(repositoryAttrModel.getType())) {
|
||||
logUtil.appendAllAndInfoLog(Constant.LOG_DESC+" 文件属性["+importProperty.getPropertyName()+"]类型为:表格");
|
||||
//将解析的列表数据转化为数据存储json
|
||||
JSONObject object = new JSONObject();
|
||||
object.put("name", importProperty.getPropertyName());
|
||||
JSONArray array = new JSONArray();
|
||||
List<List<String>> tableFields = (List<List<String>>) wordField.getData();
|
||||
if (!tableFields.isEmpty()) {
|
||||
for (List<String> value : tableFields) {
|
||||
if (!value.isEmpty() && value.size() > 1) {
|
||||
JSONObject obj = new JSONObject();
|
||||
obj.put("id", UUIDGener.getUUID());
|
||||
obj.put("name", value.get(0));
|
||||
obj.put("desc", value.get(1));
|
||||
array.add(obj);
|
||||
}
|
||||
}
|
||||
}else {
|
||||
logUtil.appendAllAndWarnLog(Constant.LOG_WARNING+" 获取["+importProperty.getPropertyName()+"] word 解析数据为 空");
|
||||
}
|
||||
if (array.size() > 0) {
|
||||
//特殊处理表头
|
||||
PALMethodAttributeModel attributeModel = null;
|
||||
List<PALMethodAttributeModel> attributes = PALMethodCache.getPALMethodModelById(importModel.getMethodId()).getAttributes();
|
||||
for (PALMethodAttributeModel attribute : attributes) {
|
||||
if (attribute.getType().equals(importProperty.getPropertyId())){
|
||||
attributeModel = attribute;
|
||||
}
|
||||
}
|
||||
if (null == attributeModel || StringUtils.isEmpty(attributeModel.getRef())){
|
||||
array.getJSONObject(0).put("id", "table_head");
|
||||
}else{
|
||||
JSONObject attrRef = JSON.parseObject(attributeModel.getRef());
|
||||
array.getJSONObject(0).put("id", "table_head");
|
||||
array.getJSONObject(0).put("id", attrRef.get("firstColumn"));
|
||||
array.getJSONObject(0).put("id", attrRef.get("secondColumn"));
|
||||
}
|
||||
}
|
||||
object.put("table", array);
|
||||
//更新数据库值
|
||||
importProperty.setPropertyValue(object.toJSONString());
|
||||
int update = propDao.update(importProperty);
|
||||
if (update>0){
|
||||
logUtil.appendAllAndInfoLog(Constant.LOG_DESC+" 文件属性["+importProperty.getPropertyName()+"] 保存属性值成功");
|
||||
}else {
|
||||
logUtil.appendAllAndWarnLog(Constant.LOG_WARNING+" 文件属性["+importProperty.getPropertyName()+"] 保存属性值失败");
|
||||
}
|
||||
|
||||
} else if ("awsorg".equals(repositoryAttrModel.getType())) {
|
||||
logUtil.appendAllAndInfoLog(Constant.LOG_DESC+" 文件属性["+importProperty.getPropertyName()+"]类型为:BPM组织架构");
|
||||
//aws组织架构解析,多组结构解析
|
||||
String orgName = (String) wordField.getData();
|
||||
List<AwsOrgInfo> awsOrgInfos = this.getOrgByName(orgName);
|
||||
if (!awsOrgInfos.isEmpty()) {
|
||||
//先更新property数据 [{"name":"部门3","id":"fdea04c8-502f-4367-82b7-a5ebe0ce5f67","type":"department"}]
|
||||
importProperty.setPropertyValue(JSON.toJSONString(awsOrgInfos));
|
||||
int update = propDao.update(importProperty);
|
||||
if (update>0){
|
||||
logUtil.appendAllAndInfoLog(Constant.LOG_DESC+" 文件属性["+importProperty.getPropertyName()+"] 保存属性值成功");
|
||||
}else {
|
||||
logUtil.appendAllAndWarnLog(Constant.LOG_WARNING+" 文件属性["+importProperty.getPropertyName()+"] 保存属性值失败");
|
||||
}
|
||||
|
||||
//先删除property关联关系,然后新增关系
|
||||
relationDao.deleteByAttrId(importModel.getId(), "", importProperty.getPropertyId());
|
||||
int insert = 0;
|
||||
for (AwsOrgInfo awsOrgInfo : awsOrgInfos) {
|
||||
DesignerShapeRelationModel model = new DesignerShapeRelationModel();
|
||||
model.setFileId(importModel.getId());
|
||||
model.setShapeId("");
|
||||
model.setShapeText("");
|
||||
model.setAttrId(importProperty.getPropertyId());
|
||||
model.setRelationFileId("00000000-0000-0000-0000-000000000000");
|
||||
model.setRelationShapeId("00000000-0000-0000-0000-000000000000");
|
||||
model.setRelationShapeText(JSON.toJSONString(awsOrgInfo));
|
||||
insert += relationDao.insert(model);
|
||||
}
|
||||
if (insert == awsOrgInfos.size()){
|
||||
logUtil.appendAllAndInfoLog(Constant.LOG_DESC+" 文件属性["+importProperty.getPropertyName()+"] 保存关联关系成功");
|
||||
}else {
|
||||
logUtil.appendAllAndWarnLog(Constant.LOG_WARNING+" 文件属性["+importProperty.getPropertyName()+"] 保存关联关系失败");
|
||||
}
|
||||
}else {
|
||||
logUtil.appendAllAndWarnLog(Constant.LOG_WARNING+" 获取["+importProperty.getPropertyName()+"] BPM组织架构为 空");
|
||||
}
|
||||
} else if ("relation".equals(repositoryAttrModel.getType())) {
|
||||
logUtil.appendAllAndInfoLog(Constant.LOG_DESC+" 文件属性["+importProperty.getPropertyName()+"]类型为:pal模型关联");
|
||||
//关联文件
|
||||
List<PALRepositoryModel> fileList = new ArrayList<>();
|
||||
List<String> relations = (List<String>) wordField.getData();
|
||||
if (relations.isEmpty()){
|
||||
logUtil.appendAllAndWarnLog(Constant.LOG_WARNING+" 获取["+importProperty.getPropertyName()+"] pal模型关联数据为 空");
|
||||
}
|
||||
for (String relation : relations) {
|
||||
PALRepositoryModel repository = this.getRepositoryByName(wsId, this.trimFileName(relation));
|
||||
if (repository != null) {
|
||||
logUtil.appendAllAndInfoLog(Constant.LOG_DESC+" 文件属性["+importProperty.getPropertyName()+"] 获取关联pal模型<"+this.trimFileName(relation)+"> 成功");
|
||||
fileList.add(repository);
|
||||
}else {
|
||||
logUtil.appendAllAndWarnLog(Constant.LOG_WARNING+" 文件属性["+importProperty.getPropertyName()+"] 获取关联pal模型<"+this.trimFileName(relation)+"> 失败");
|
||||
}
|
||||
}
|
||||
|
||||
//更新property数据
|
||||
String relationFileIds = "";
|
||||
for (PALRepositoryModel model : fileList) {
|
||||
relationFileIds += model.getId() + ",";
|
||||
}
|
||||
if (relationFileIds.length() > 1) {
|
||||
relationFileIds = relationFileIds.substring(0, relationFileIds.length() - 1);
|
||||
}
|
||||
JSONObject propertyJson = JSON.parseObject(importProperty.getPropertyValue());
|
||||
propertyJson.put("relationFileId", relationFileIds);
|
||||
importProperty.setPropertyValue(propertyJson.toJSONString());
|
||||
int update = propDao.update(importProperty);
|
||||
if (update>0){
|
||||
logUtil.appendAllAndInfoLog(Constant.LOG_DESC+" 文件属性["+importProperty.getPropertyName()+"] 保存属性值成功");
|
||||
}else {
|
||||
logUtil.appendAllAndWarnLog(Constant.LOG_WARNING+" 文件属性["+importProperty.getPropertyName()+"] 保存属性值失败");
|
||||
}
|
||||
|
||||
//先删除property关联关系,然后新增关系
|
||||
if (!fileList.isEmpty()) {
|
||||
int insert = 0;
|
||||
relationDao.deleteByAttrId(importModel.getId(), "", importProperty.getPropertyId());
|
||||
for (PALRepositoryModel repositoryModel : fileList) {
|
||||
DesignerShapeRelationModel relationModel = new DesignerShapeRelationModel();
|
||||
relationModel.setFileId(importModel.getId());
|
||||
relationModel.setShapeId("");
|
||||
relationModel.setShapeText("");
|
||||
relationModel.setAttrId(importProperty.getPropertyId());
|
||||
relationModel.setRelationFileId(repositoryModel.getVersionId());
|
||||
relationModel.setRelationShapeId("");
|
||||
relationModel.setRelationShapeText(repositoryModel.getName());
|
||||
insert += relationDao.insert(relationModel);
|
||||
}
|
||||
if (insert == fileList.size()){
|
||||
logUtil.appendAllAndInfoLog(Constant.LOG_DESC+" 文件属性["+importProperty.getPropertyName()+"] 保存关联关系成功");
|
||||
}else {
|
||||
logUtil.appendAllAndWarnLog(Constant.LOG_WARNING+" 文件属性["+importProperty.getPropertyName()+"] 保存关联关系失败");
|
||||
}
|
||||
}
|
||||
|
||||
} else if ("select".equals(repositoryAttrModel.getType()) || "select_m".equals(repositoryAttrModel.getType())) {
|
||||
|
||||
} else if ("boolean".equals(repositoryAttrModel.getType())) {
|
||||
|
||||
} else if ("DateTimePicker".equals(repositoryAttrModel.getType())) {
|
||||
logUtil.appendAllAndInfoLog(Constant.LOG_DESC+" 文件属性["+importProperty.getPropertyName()+"]类型为:时间选择器");
|
||||
String time = (String) wordField.getData();
|
||||
if (StringUtils.isEmpty(time)){
|
||||
logUtil.appendAllAndWarnLog(Constant.LOG_WARNING+" 获取["+importProperty.getPropertyName()+"] word 解析时间字符为 空");
|
||||
}
|
||||
try {
|
||||
Date formatTime = new SimpleDateFormat("yyyy年MM月dd日").parse(time);
|
||||
time = UtilDate.datetimeFormat(formatTime);
|
||||
} catch (ParseException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
//更新数据库值
|
||||
importProperty.setPropertyValue(time);
|
||||
int update = propDao.update(importProperty);
|
||||
if (update>0){
|
||||
logUtil.appendAllAndInfoLog(Constant.LOG_DESC+" 文件属性["+importProperty.getPropertyName()+"] 保存属性值成功");
|
||||
}else {
|
||||
logUtil.appendAllAndWarnLog(Constant.LOG_WARNING+" 文件属性["+importProperty.getPropertyName()+"] 保存属性值失败");
|
||||
}
|
||||
} else {
|
||||
if (wordField.getData() instanceof String) {
|
||||
logUtil.appendAllAndInfoLog(Constant.LOG_DESC+" 文件属性["+importProperty.getPropertyName()+"]类型为:字符");
|
||||
//直接获取Word解析字符内容
|
||||
String value = (String) wordField.getData();
|
||||
if (StringUtils.isEmpty(value)){
|
||||
logUtil.appendAllAndWarnLog(Constant.LOG_WARNING+" 获取["+importProperty.getPropertyName()+"] word 解析字符为 空");
|
||||
}
|
||||
//更新数据库值
|
||||
importProperty.setPropertyValue(value);
|
||||
int update = propDao.update(importProperty);
|
||||
if (update>0){
|
||||
logUtil.appendAllAndInfoLog(Constant.LOG_DESC+" 文件属性["+importProperty.getPropertyName()+"] 保存属性值成功");
|
||||
}else {
|
||||
logUtil.appendAllAndWarnLog(Constant.LOG_WARNING+" 文件属性["+importProperty.getPropertyName()+"] 保存属性值失败");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
return ResponseObject.newOkResponse("导入成功");
|
||||
}
|
||||
|
||||
private DCContext getFileDcContext(String groupValue, String fileValue) {
|
||||
DCContext context = null;
|
||||
|
||||
DCPluginProfile dcProfile = DCProfileManager.getDCProfile(Constant.APP_ID, Constant.UPFILE);
|
||||
if (null != dcProfile) {
|
||||
context = new DCContext(super.getContext(), dcProfile, Constant.APP_ID, groupValue, fileValue);
|
||||
}
|
||||
|
||||
return context;
|
||||
}
|
||||
private DCContext getFileDcContext(String groupValue, String fileValue, String fileName) {
|
||||
DCContext context = null;
|
||||
|
||||
|
||||
@ -22,8 +22,8 @@
|
||||
const production = true;
|
||||
const devUserInfo = {};
|
||||
</script>
|
||||
<script type="module" crossorigin src="../apps/com.actionsoft.apps.coe.pal.datamigration/main/js/entry-index-3c31c3f8.js"></script>
|
||||
<link rel="stylesheet" href="../apps/com.actionsoft.apps.coe.pal.datamigration/main/assets/asset-style-929fa14b.css">
|
||||
<script type="module" crossorigin src="../apps/com.actionsoft.apps.coe.pal.datamigration/main/js/entry-index-aca4a5f2.js"></script>
|
||||
<link rel="stylesheet" href="../apps/com.actionsoft.apps.coe.pal.datamigration/main/assets/asset-style-5d2b970d.css">
|
||||
</head>
|
||||
<body style="margin:0;">
|
||||
<div id="app"></div>
|
||||
|
||||
@ -10,7 +10,7 @@
|
||||
<param name="wsId"/>
|
||||
<param name="groupValue"/>
|
||||
<param name="fileValue"/>
|
||||
<param name="fileName"/>
|
||||
<!-- <param name="fileName"/>-->
|
||||
</cmd-bean>
|
||||
<cmd-bean name="com.actionsoft.apps.coe.pal.datamigration_IT_attribute_import">
|
||||
<param name="wsId"/>
|
||||
@ -18,7 +18,7 @@
|
||||
<param name="fileValue"/>
|
||||
<param name="fileName"/>
|
||||
</cmd-bean>
|
||||
<!--by bzp-->
|
||||
<!--by bzp 制度解析-->
|
||||
<cmd-bean name="com.actionsoft.apps.coe.pal.systemImport_process_attribute_import">
|
||||
<param name="wsId"/>
|
||||
<param name="groupValue"/>
|
||||
@ -32,4 +32,22 @@
|
||||
<param name="fileValue"/>
|
||||
<param name="fileName"/>
|
||||
</cmd-bean>
|
||||
<!--by bzp 表单解析-->
|
||||
<cmd-bean name="com.actionsoft.apps.coe.pal.formImport_process_attribute_import">
|
||||
<param name="wsId"/>
|
||||
<param name="groupValue"/>
|
||||
<param name="fileValue"/>
|
||||
<param name="fileName"/>
|
||||
</cmd-bean>
|
||||
<!--by bzp 保存富文本-->
|
||||
<cmd-bean name="com.actionsoft.apps.coe.pal.saveRichtext">
|
||||
<param name="content"/>
|
||||
<param name="pluuid"/>
|
||||
<param name="shapId"/>
|
||||
</cmd-bean>
|
||||
<!--by bzp 获取富文本-->
|
||||
<cmd-bean name="com.actionsoft.apps.coe.pal.getRichtext">
|
||||
<param name="pluuid"/>
|
||||
<param name="shapId"/>
|
||||
</cmd-bean>
|
||||
</aws-actions>
|
||||
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.
@ -16,6 +16,7 @@ import java.util.concurrent.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import com.actionsoft.apps.coe.pal.constant.CoEConstant;
|
||||
import com.actionsoft.apps.coe.pal.cooperation.cache.CooperationCache;
|
||||
import com.actionsoft.apps.coe.pal.cooperation.CoeCooperationAPIManager;
|
||||
import com.actionsoft.apps.coe.pal.cooperation.model.CoeCooperationTeamModel;
|
||||
import com.actionsoft.apps.coe.pal.pal.manage.publish.PublishAPIManager;
|
||||
@ -1921,7 +1922,8 @@ public class ProcessPublishWeb extends ActionWeb {
|
||||
}
|
||||
}
|
||||
List<PALRepositoryModel> list = dao.getPublishedRepositoryList(wsId);
|
||||
List<String> versionIds = CoeCooperationAPIManager.getInstance().queryCooperationRoleDataPermByTeamUser(teamId, _uc.getUID());
|
||||
// List<String> versionIds = CoeCooperationAPIManager.getInstance().queryCooperationRoleDataPermByTeamUser(teamId, _uc.getUID());
|
||||
Set<String> versionIds = CooperationCache.getUserDataVisitablePermission(teamId, _uc.getUID(), false);
|
||||
if (UtilString.isNotEmpty(teamId)) {
|
||||
if (list != null) {
|
||||
List<PALRepositoryModel> removeList = new ArrayList<PALRepositoryModel>();
|
||||
@ -1953,7 +1955,8 @@ public class ProcessPublishWeb extends ActionWeb {
|
||||
}
|
||||
}
|
||||
List<PALRepositoryModel> list = dao.getPublishedRepositoryList(wsId);
|
||||
List<String> versionIds = CoeCooperationAPIManager.getInstance().queryCooperationRoleDataPermByTeamUser(teamId, _uc.getUID());
|
||||
// List<String> versionIds = CoeCooperationAPIManager.getInstance().queryCooperationRoleDataPermByTeamUser(teamId, _uc.getUID());
|
||||
Set<String> versionIds = CooperationCache.getUserDataVisitablePermission(teamId, _uc.getUID(), false);
|
||||
if (UtilString.isNotEmpty(teamId)) {
|
||||
if (list != null) {
|
||||
List<PALRepositoryModel> removeList = new ArrayList<PALRepositoryModel>();
|
||||
|
||||
Binary file not shown.
@ -36,6 +36,7 @@ import com.actionsoft.apps.coe.pal.pal.ws.model.CoeWorkSpaceModel;
|
||||
import com.actionsoft.apps.coe.pal.pal.ws.web.CoeWorkSpaceWeb;
|
||||
import com.actionsoft.apps.coe.pal.teamwork.web.ProcessPublishWeb;
|
||||
import com.actionsoft.apps.coe.pal.teamwork.web.TeamWorkManagerWeb;
|
||||
import com.actionsoft.bpms.util.UtilString;
|
||||
import com.actionsoft.exception.ExceptionUtil;
|
||||
import com.actionsoft.i18n.I18nRes;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
@ -3005,6 +3006,66 @@ public class CoEPALController {
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 添加回复功能
|
||||
* @param me
|
||||
* @param ruuid
|
||||
* @param replyContent
|
||||
* @return
|
||||
*/
|
||||
@Mapping("com.actionsoft.apps.coe.pal_pl_repository_designer_add_reply")
|
||||
public String createReply(UserContext me,String ruuid,String replyContent) {
|
||||
CoeProcessLevelWeb web = new CoeProcessLevelWeb(me);
|
||||
return web.createReply(me,ruuid,replyContent);
|
||||
}
|
||||
|
||||
/**
|
||||
*加载回复列表
|
||||
* @param me
|
||||
* @param ruuid
|
||||
* @param replyContent
|
||||
* @return
|
||||
*/
|
||||
@Mapping("com.actionsoft.apps.coe.pal_pl_repository_designer_GetReply")
|
||||
public String GetReply(UserContext me, RequestParams params, String start, String size, String ruuid) {
|
||||
String returnstrs = "";
|
||||
int startnum = -1;
|
||||
int sizenum = -1;
|
||||
if (!UtilString.isEmpty(start)) {
|
||||
startnum = Integer.parseInt(start);
|
||||
} else {
|
||||
startnum = 1;
|
||||
}
|
||||
if (!UtilString.isEmpty(size)) {
|
||||
sizenum = Integer.parseInt(size);
|
||||
} else {
|
||||
sizenum = 20;
|
||||
}
|
||||
|
||||
CoeProcessLevelWeb mdWeb = new CoeProcessLevelWeb(me);
|
||||
returnstrs = mdWeb.getReplyList(startnum, sizenum, ruuid);
|
||||
return returnstrs.toString();
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除评论功能
|
||||
* @param me
|
||||
* @param params
|
||||
* @param sid
|
||||
* @param replyId
|
||||
* @param messageId
|
||||
* @return
|
||||
*/
|
||||
@Mapping("com.actionsoft.apps.coe.pal_delete_reply_by_id")
|
||||
public String deleteReply(UserContext me, RequestParams params, String sid, String replyId, String messageId) {
|
||||
CoeProcessLevelWeb web = new CoeProcessLevelWeb(me);
|
||||
return web.deleteReply(replyId, messageId);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 获取最近编辑的文件和收藏的文件
|
||||
* @param me
|
||||
@ -3297,4 +3358,30 @@ public class CoEPALController {
|
||||
return web.checkFilePermissionBatch(uuids,isSub).toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* 设计器页面右侧版本差异窗口接口
|
||||
* @param me
|
||||
* @param id 当前资产库文件ID
|
||||
* @return
|
||||
*/
|
||||
@Mapping("com.actionsoft.apps.coe.pal_repository_model_version_diff_query")
|
||||
public String getRepositoryModelVersionDiff(UserContext me,String id){
|
||||
CoeProcessLevelWeb web = new CoeProcessLevelWeb(me);
|
||||
return web.getRepositoryModelVersionDiff(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验形状属性
|
||||
* @param me
|
||||
* @param uuid
|
||||
* @param define 若为空字符串,则获取系统当前保存的define进行校验
|
||||
* @return
|
||||
*/
|
||||
@Mapping("com.actionsoft.apps.coe.pal_repository_define_shape_attr_valid")
|
||||
public String validRepositoryShapeAttr(UserContext me, String uuid, String define) {
|
||||
CoeDesignerWeb web = new CoeDesignerWeb(me);
|
||||
return web.validRepositoryShapeAttr(uuid, define);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -505,8 +505,8 @@ public class CoeCooperationAPIManager {
|
||||
// 获取用户权限,判断是否已存在
|
||||
List<String> rolePermList = new CoeCooperationRolePermDao().getRolePermListByRole(teamId, hideRole.getId());
|
||||
if (!rolePermList.contains(palVersionId)) {
|
||||
// 添加角色权限
|
||||
CoeCooperationRolePermModel rolePerm = new CoeCooperationRolePermModel(UUIDGener.getUUID(), teamId, hideRole.getId(), palVersionId);
|
||||
// 添加角色权限, 当前用户新建默认给全部的操作权限
|
||||
CoeCooperationRolePermModel rolePerm = new CoeCooperationRolePermModel(UUIDGener.getUUID(), teamId, hideRole.getId(), palVersionId,"w,d,v");
|
||||
new CoeCooperationRolePermDao().insert(rolePerm);
|
||||
}
|
||||
}
|
||||
|
||||
@ -5,6 +5,7 @@ import java.util.*;
|
||||
import com.actionsoft.apps.AppsConst;
|
||||
import com.actionsoft.apps.coe.pal.constant.CoEConstant;
|
||||
import com.actionsoft.apps.coe.pal.cooperation.CoeCooperationAPIManager;
|
||||
import com.actionsoft.apps.coe.pal.cooperation.cache.CooperationCache;
|
||||
import com.actionsoft.apps.coe.pal.pal.repository.cache.PALRepositoryCache;
|
||||
import com.actionsoft.apps.coe.pal.pal.repository.model.PALRepositoryModel;
|
||||
import com.actionsoft.apps.lifecycle.api.AppsAPIManager;
|
||||
@ -140,7 +141,8 @@ public class PALMethodCache {
|
||||
List<String> methodList = PALMethodCache.getPALMethodList(sort);
|
||||
if (UtilString.isNotEmpty(teamId)) {
|
||||
List<String> permMethodList = new ArrayList<>();
|
||||
List<String> versionIds = CoeCooperationAPIManager.getInstance().queryCooperationRoleDataPermByTeamUser(teamId, userId);
|
||||
// List<String> versionIds = CoeCooperationAPIManager.getInstance().queryCooperationRoleDataPermByTeamUser(teamId, userId);
|
||||
Set<String> versionIds = CooperationCache.getUserDataVisitablePermission(teamId, userId, false);
|
||||
for (String verId : versionIds) {
|
||||
List<PALRepositoryModel> verModels = PALRepositoryCache.getByVersionId(verId);
|
||||
if (verModels != null && verModels.size() > 0 && !permMethodList.contains(verModels.get(0).getMethodCategory())) {
|
||||
@ -169,7 +171,8 @@ public class PALMethodCache {
|
||||
List<String> methodList = PALMethodCache.getPALMethodList(sort);
|
||||
if (UtilString.isNotEmpty(teamId)) {
|
||||
List<String> permMethodList = new ArrayList<>();
|
||||
List<String> versionIds = CoeCooperationAPIManager.getInstance().queryCooperationRoleDataPermByTeamUser(teamId, userId);
|
||||
// List<String> versionIds = CoeCooperationAPIManager.getInstance().queryCooperationRoleDataPermByTeamUser(teamId, userId);
|
||||
Set<String> versionIds = CooperationCache.getUserDataVisitablePermission(teamId, userId, false);
|
||||
for (String verId : versionIds) {
|
||||
List<PALRepositoryModel> verModels = PALRepositoryCache.getByVersionId(verId);
|
||||
if (verModels != null && verModels.size() > 0 && !permMethodList.contains(verModels.get(0).getMethodCategory())) {
|
||||
|
||||
@ -0,0 +1,11 @@
|
||||
package com.actionsoft.apps.coe.pal.pal.repository.dao;
|
||||
|
||||
public class PalDaoFactory {
|
||||
|
||||
|
||||
|
||||
public static PalDataReplyDao createPalDataReplyDao() { return new PalDataReplyDao(); }
|
||||
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,223 @@
|
||||
package com.actionsoft.apps.coe.pal.pal.repository.dao;
|
||||
|
||||
import com.actionsoft.apps.coe.pal.pal.repository.model.PalDataReplyModel;
|
||||
import com.actionsoft.bpms.commons.database.RowMapper;
|
||||
import com.actionsoft.bpms.commons.mvc.dao.DaoObject;
|
||||
import com.actionsoft.bpms.commons.pagination.SQLPagination;
|
||||
import com.actionsoft.bpms.util.DBSql;
|
||||
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.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
|
||||
public class PalDataReplyDao
|
||||
extends DaoObject<PalDataReplyModel>
|
||||
{
|
||||
@Override
|
||||
public String entityName() { return "APP_ACT_PAL_DATA_REPLY"; }
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public int insert(PalDataReplyModel model) {
|
||||
Map<String, Object> paramsMap = new HashMap<>();
|
||||
paramsMap.put("ID", model.getId());
|
||||
paramsMap.put("DATAID", model.getDataId());
|
||||
paramsMap.put("REPLYER", model.getReplyer());
|
||||
paramsMap.put("REPLYTIME", model.getReplyTime());
|
||||
paramsMap.put("REPLYCONTENT", model.getReplyContent());
|
||||
paramsMap.put("REPLYERIP", model.getReplyerIp());
|
||||
paramsMap.put("ORGID", model.getOrgId());
|
||||
int result = DBSql.update(DBSql.getInsertStatement("APP_ACT_PAL_DATA_REPLY", paramsMap), paramsMap);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public RowMapper<PalDataReplyModel> rowMapper() { return null; }
|
||||
|
||||
private static class PalMessageReplyModelMapper implements RowMapper<PalDataReplyModel> {
|
||||
private PalMessageReplyModelMapper() {}
|
||||
|
||||
@Override
|
||||
public PalDataReplyModel mapRow(ResultSet rs, int arg1) throws SQLException {
|
||||
PalDataReplyModel model = new PalDataReplyModel();
|
||||
|
||||
model.setId(rs.getString("ID"));
|
||||
model.setDataId(rs.getString("DATAID"));
|
||||
model.setReplyer(rs.getString("REPLYER"));
|
||||
model.setReplyTime(rs.getTimestamp("REPLYTIME"));
|
||||
model.setReplyContent(rs.getString("REPLYCONTENT"));
|
||||
model.setOrgId(rs.getString("ORGID"));
|
||||
model.setReplyerIp(rs.getString("ID"));
|
||||
|
||||
return model;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int update(PalDataReplyModel model) throws AWSDataAccessException {
|
||||
Map<String, Object> paramsMap = new HashMap<>();
|
||||
StringBuffer sql = new StringBuffer();
|
||||
sql.append("update ").append("APP_ACT_PAL_DATA_REPLY").append(" set REPLYCONTENT=:replycontent where id=:id");
|
||||
|
||||
paramsMap.put("replycontent", model.getReplyContent());
|
||||
paramsMap.put("id", model.getId());
|
||||
int result = DBSql.update(sql.toString(), paramsMap);
|
||||
return result;
|
||||
}
|
||||
|
||||
public List<PalDataReplyModel> getReplyByDataId(String dataid) throws SQLException {
|
||||
List<PalDataReplyModel> list = new ArrayList<>();
|
||||
StringBuffer sql = new StringBuffer();
|
||||
try {
|
||||
sql.append("select * from ").append("APP_ACT_PAL_DATA_REPLY").append(" where ").append("DATAID").append(" = ? order by replytime desc");
|
||||
list = DBSql.query(sql.toString(), new PalMessageReplyModelMapper(), new Object[] { dataid });
|
||||
} catch (Exception e) {
|
||||
throw new SQLException(e);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public int getReplyListCount(String dataId, String whereSql, String orderBy) throws SQLException {
|
||||
StringBuffer sql = new StringBuffer();
|
||||
sql.append("select count(id) from ").append("APP_ACT_PAL_DATA_REPLY").append(" where 1=1 ");
|
||||
if (!UtilString.isEmpty(whereSql)) {
|
||||
sql.append(" and " + whereSql);
|
||||
}
|
||||
return DBSql.getInt(sql.toString(), new Object[] { dataId });
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public List<PalDataReplyModel> getReplyList(String dataId, int start, int size, String whereSql, String orderBy) throws SQLException {
|
||||
List<PalDataReplyModel> list = new ArrayList<>();
|
||||
StringBuffer sql = new StringBuffer();
|
||||
sql.append("select * from ").append("APP_ACT_PAL_DATA_REPLY").append(" where 1=1 ");
|
||||
if (!UtilString.isEmpty(whereSql)) {
|
||||
sql.append(" and " + whereSql);
|
||||
}
|
||||
|
||||
|
||||
if (!UtilString.isEmpty(orderBy)) {
|
||||
sql.append(orderBy);
|
||||
}
|
||||
if (start > 0 && size > 0) {
|
||||
list = DBSql.query(SQLPagination.getPaginitionSQL(sql.toString(), start, size), new PalMessageReplyModelMapper(), new Object[] { dataId });
|
||||
} else {
|
||||
list = DBSql.query(sql.toString(), new PalMessageReplyModelMapper(), new Object[] { dataId });
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public List<PalDataReplyModel> getManageReplyList(int start, int size, String whereSql, String orderBy) throws SQLException {
|
||||
List<PalDataReplyModel> list = new ArrayList<>();
|
||||
StringBuffer sql = new StringBuffer();
|
||||
sql.append("select * from ").append("APP_ACT_PAL_DATA_REPLY").append(" where 1=1 ");
|
||||
if (!UtilString.isEmpty(whereSql)) {
|
||||
sql.append(" and " + whereSql);
|
||||
}
|
||||
|
||||
|
||||
if (!UtilString.isEmpty(orderBy)) {
|
||||
sql.append(orderBy);
|
||||
}
|
||||
if (start > 0 && size > 0) {
|
||||
list = DBSql.query(SQLPagination.getPaginitionSQL(sql.toString(), start, size), new PalMessageReplyModelMapper(), new Object[0]);
|
||||
} else {
|
||||
list = DBSql.query(sql.toString(), new PalMessageReplyModelMapper(), new Object[0]);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public int getManageReplyListCount(String whereSql, String orderBy) throws SQLException {
|
||||
StringBuffer sql = new StringBuffer();
|
||||
sql.append("select count(id) from ").append("APP_ACT_PAL_DATA_REPLY").append(" where 1=1 ");
|
||||
if (!UtilString.isEmpty(whereSql)) {
|
||||
sql.append(" and " + whereSql);
|
||||
}
|
||||
return DBSql.getInt(sql.toString(), new Object[0]);
|
||||
}
|
||||
|
||||
public boolean deleteReplyByDataid(String dataid) throws SQLException {
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
StringBuffer sql = new StringBuffer();
|
||||
sql.append(" delete from ").append("APP_ACT_PAL_DATA_REPLY").append(" where ").append("DATAID").append("=:dataid");
|
||||
params.put("dataid", dataid);
|
||||
DBSql.update(sql.toString(), params);
|
||||
return true;
|
||||
}
|
||||
|
||||
public boolean deleteReplyByDataid(String dataid, Connection conn) throws SQLException {
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
StringBuffer sql = new StringBuffer();
|
||||
sql.append(" delete from ").append("APP_ACT_PAL_DATA_REPLY").append(" where ").append("DATAID").append("=:dataid");
|
||||
params.put("dataid", dataid);
|
||||
DBSql.update(conn, sql.toString(), params);
|
||||
return true;
|
||||
}
|
||||
|
||||
public boolean deleteReplyById(String replyid) throws SQLException {
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
StringBuffer sql = new StringBuffer();
|
||||
sql.append(" delete from ").append("APP_ACT_PAL_DATA_REPLY").append(" where ID=:replyid");
|
||||
params.put("replyid", replyid);
|
||||
DBSql.update(sql.toString(), params);
|
||||
return true;
|
||||
}
|
||||
|
||||
public PalDataReplyModel getReplyById(String id) {
|
||||
StringBuffer sql = new StringBuffer();
|
||||
sql.append("SELECT * FROM ").append("APP_ACT_PAL_DATA_REPLY").append(" WHERE ID = ?");
|
||||
return (PalDataReplyModel)DBSql.getObject(sql.toString(), new PalMessageReplyModelMapper(), new Object[] { id });
|
||||
}
|
||||
}
|
||||
@ -3401,6 +3401,80 @@ public class CoeDesignerWeb extends ActionWeb {
|
||||
return ro.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验形状属性
|
||||
* @param uuid
|
||||
* @param define 若为空字符串,则获取系统当前保存的define进行校验
|
||||
* @return
|
||||
*/
|
||||
public String validRepositoryShapeAttr(String uuid, String define) {
|
||||
PALRepositoryModel model = PALRepositoryCache.getCache().get(uuid);
|
||||
if (model == null) {
|
||||
return ResponseObject.newErrResponse("模型不存在").toString();
|
||||
}
|
||||
if (UtilString.isEmpty(define) || "null".equals(define) || "undefined".equals(define)) {
|
||||
define = PALRepositoryQueryAPIManager.getInstance().getProcessDefinition(_uc, uuid);
|
||||
}
|
||||
Map<String, PALMethodAttributeModel> methodAttributeModelMap = new HashMap<>();
|
||||
|
||||
// 校验形状
|
||||
List<JSONObject> elements = ShapeUtil.getShapeJsonToJsonObject(define);
|
||||
List<JSONObject> resultList = new ArrayList<>();
|
||||
for (JSONObject o : elements) {
|
||||
String shapeId = o.getString("id");
|
||||
String shapeName = o.getString("name");
|
||||
String text = UtilString.isEmpty(o.getString("text")) ? o.getString("title") : o.getString("text");
|
||||
String shapeCategory = o.getString("category");
|
||||
JSONObject dataAttributes = o.getJSONObject("dataAttributes");
|
||||
JSONArray attributesJsonArray = dataAttributes.getJSONArray("attributesJsonArray");
|
||||
for (int i = 0; i < attributesJsonArray.size(); i++) {
|
||||
JSONObject attr = attributesJsonArray.getJSONObject(i);
|
||||
String attrId = attr.getString("id");
|
||||
String value = attr.getString("value");
|
||||
if (!methodAttributeModelMap.containsKey(shapeName + "-" + attrId)) {
|
||||
List<PALMethodAttributeModel> methodAttributeModels = CoeDesignerShapeAPIManager.getInstance().getValidAndUseAttributeModels(model.getWsId(), shapeCategory.replace("_", "."), shapeName, model.getMethodId());
|
||||
for (PALMethodAttributeModel attributeModel : methodAttributeModels) {
|
||||
if (!methodAttributeModelMap.containsKey(shapeName + "-" + attributeModel.getKey())) {
|
||||
methodAttributeModelMap.put(shapeName + "-" + attributeModel.getKey(), attributeModel);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!methodAttributeModelMap.containsKey(shapeName + "-" + attrId)) {
|
||||
continue;// 没有配置到形状的属性,不处理
|
||||
}
|
||||
PALMethodAttributeModel attrModel = methodAttributeModelMap.get(shapeName + "-" + attrId);
|
||||
if (attrModel.getIsRequired()) {// 筛选必填
|
||||
String attrType = attrModel.getType();
|
||||
boolean flag = true;
|
||||
if ("relation".equals(attrType) || "awsorg".equals(attrType)) {
|
||||
List<DesignerShapeRelationModel> list = DesignerShapeRelationCache.getListByAttrId(model.getId(), shapeId, attrId);
|
||||
if (list == null || list.isEmpty()) {
|
||||
flag = false;
|
||||
}
|
||||
} else {
|
||||
flag = UtilString.isNotEmpty(value);
|
||||
}
|
||||
if (!flag) {
|
||||
JSONObject tmp = new JSONObject();
|
||||
tmp.put("shapeId", shapeId);
|
||||
tmp.put("shapeName", text);
|
||||
tmp.put("attrName", attrModel.getNewTitle());
|
||||
tmp.put("attrId", attrId);
|
||||
resultList.add(tmp);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
ResponseObject ro = ResponseObject.newOkResponse();
|
||||
if (!resultList.isEmpty()) {
|
||||
ro.setData(resultList);
|
||||
ro.err("校验未通过");
|
||||
return ro.toString();
|
||||
}
|
||||
return ResponseObject.newOkResponse().toString();
|
||||
|
||||
}
|
||||
|
||||
/******************************************新版门户流程详情end********************************************************/
|
||||
|
||||
//获取excel数据的内部类
|
||||
|
||||
@ -42,7 +42,6 @@ public class SynchronousOrgJob implements IJob {
|
||||
@Override
|
||||
public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
|
||||
|
||||
Map<String, String> idRelationMap = new HashMap<>();
|
||||
//先执行新建操作产生plid
|
||||
PALRepository coeProcessLevel = CoeProcessLevelDaoFacotory.createCoeProcessLevel();
|
||||
|
||||
@ -54,6 +53,7 @@ public class SynchronousOrgJob implements IJob {
|
||||
Timestamp nowTime = new Timestamp(System.currentTimeMillis());
|
||||
|
||||
|
||||
|
||||
PALRepositoryModelImpl model = CoeProcessLevelUtil.createPALRepositoryModel(id1, plRid1, "6f4e292c-1b90-4dd2-8c20-7da159cb20a5", "内蒙古伊利实业集团股份有限公司",
|
||||
"", 1, "org", "org", true, 1,
|
||||
id1, false, "org.normal", "0", 1, null,
|
||||
@ -61,6 +61,7 @@ public class SynchronousOrgJob implements IJob {
|
||||
null, null, null, null, null, null, null, 1);
|
||||
coeProcessLevel.insert(model);
|
||||
|
||||
|
||||
parentModelId=model.getId();
|
||||
orgindex = 0;
|
||||
createTree();
|
||||
@ -88,7 +89,6 @@ public class SynchronousOrgJob implements IJob {
|
||||
Timestamp nowTime = new Timestamp(System.currentTimeMillis());
|
||||
|
||||
if (org.getString("PARENTDEPARTMENTID").equals("0")) {
|
||||
System.out.println("orgdepartment======="+org.getString("DEPARTMENTNAME"));
|
||||
String sql1 = "SELECT ID FROM APP_ACT_COE_PAL_REPOSITORY WHERE WSID='6f4e292c-1b90-4dd2-8c20-7da159cb20a5' and EXT1='" + org.getString("ID") + "'";
|
||||
String parentPalOrgId1 = DBSql.getString(sql1);
|
||||
if(StringUtil.isEmpty(parentPalOrgId1)){
|
||||
@ -108,8 +108,6 @@ public class SynchronousOrgJob implements IJob {
|
||||
|
||||
if(StringUtil.isNotEmpty(parentPalOrgId)){
|
||||
|
||||
System.out.println("orgdepartment======"+org.getString("ID"));
|
||||
System.out.println("orgdepartment======="+org.getString("DEPARTMENTNAME"));
|
||||
PALRepositoryModelImpl model2 = CoeProcessLevelUtil.createPALRepositoryModel(id1, plRid1, "6f4e292c-1b90-4dd2-8c20-7da159cb20a5", org.getString("DEPARTMENTNAME"),
|
||||
"", 1, getParentPalOrgId(org), "org", true, 1,
|
||||
id1, false, "org.normal", "0", Integer.valueOf(org.getString("ORDERINDEX")), null,
|
||||
@ -187,6 +185,8 @@ public class SynchronousOrgJob implements IJob {
|
||||
definition.remove("commonShapeConfig");
|
||||
}
|
||||
|
||||
|
||||
|
||||
List<RowMap> orgdepartmentList=DBSql.getMaps("select POSITION_NO,POSITION_NAME from ORGUSER WHERE DEPARTMENTID=?",departmentId);
|
||||
|
||||
int zindex = 1;
|
||||
|
||||
@ -0,0 +1,101 @@
|
||||
package com.actionsoft.apps.coe.pal.pal.repository.model;
|
||||
|
||||
import com.actionsoft.bpms.commons.mvc.model.ModelBean;
|
||||
import java.sql.Timestamp;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public class PalDataReplyModel
|
||||
extends ModelBean
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
public static final String DATABASE_ENTITY = "APP_ACT_PAL_DATA_REPLY";
|
||||
public static final String REPLY_ID = "ID";
|
||||
public static final String DATA_ID = "DATAID";
|
||||
public static final String REPLY_CONTENT = "REPLYCONTENT";
|
||||
public static final String REPLY_TIME = "REPLYTIME";
|
||||
public static final String REPLYER = "REPLYER";
|
||||
public static final String REPLYER_IP = "REPLYERIP";
|
||||
public static final String ORG_ID = "ORGID";
|
||||
private String id;
|
||||
private String dataId;
|
||||
private String replyContent;
|
||||
private Timestamp replyTime;
|
||||
private String replyer;
|
||||
private String orgId;
|
||||
private String replyerIp;
|
||||
|
||||
public PalDataReplyModel() {}
|
||||
|
||||
public PalDataReplyModel(String id, String dataId, String replyContent, Timestamp replyTime, String replyer, String orgId, String replyerIp) {
|
||||
this.id = id;
|
||||
this.dataId = dataId;
|
||||
this.replyContent = replyContent;
|
||||
this.replyTime = replyTime;
|
||||
this.replyer = replyer;
|
||||
this.orgId = orgId;
|
||||
this.replyerIp = replyerIp;
|
||||
}
|
||||
|
||||
|
||||
public Timestamp getReplyTime() { return this.replyTime; }
|
||||
|
||||
|
||||
|
||||
public void setReplyTime(Timestamp replyTime) { this.replyTime = replyTime; }
|
||||
|
||||
|
||||
|
||||
public String getReplyer() { return this.replyer; }
|
||||
|
||||
|
||||
|
||||
public void setReplyer(String replyer) { this.replyer = replyer; }
|
||||
|
||||
|
||||
|
||||
public String getId() { return this.id; }
|
||||
|
||||
|
||||
|
||||
public void setId(String id) { this.id = id; }
|
||||
|
||||
|
||||
|
||||
public String getReplyContent() { return this.replyContent; }
|
||||
|
||||
|
||||
|
||||
public void setReplyContent(String replyContent) { this.replyContent = replyContent; }
|
||||
|
||||
|
||||
|
||||
public String getOrgId() { return this.orgId; }
|
||||
|
||||
|
||||
|
||||
public void setOrgId(String orgId) { this.orgId = orgId; }
|
||||
|
||||
|
||||
|
||||
public String getDataId() { return this.dataId; }
|
||||
|
||||
|
||||
|
||||
public void setDataId(String dataId) { this.dataId = dataId; }
|
||||
|
||||
|
||||
|
||||
public String getReplyerIp() { return this.replyerIp; }
|
||||
|
||||
|
||||
|
||||
public void setReplyerIp(String replyerIp) { this.replyerIp = replyerIp; }
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@ -912,12 +912,12 @@
|
||||
<li ac="selectall">全选
|
||||
<div class="extend">Ctrl+A</div>
|
||||
</li>
|
||||
<li ac="selectVertical">调整垂直间距
|
||||
<div class="extend"></div>
|
||||
</li>
|
||||
<li ac="selectHorizontal">调整水平间距
|
||||
<div class="extend"></div>
|
||||
</li>
|
||||
<!-- <li ac="selectVertical">调整垂直间距-->
|
||||
<!-- <div class="extend"></div>-->
|
||||
<!-- </li>-->
|
||||
<!-- <li ac="selectHorizontal">调整水平间距-->
|
||||
<!-- <div class="extend"></div>-->
|
||||
<!-- </li>-->
|
||||
<li class="devider devi_selectall"></li>
|
||||
<li ac="drawline">
|
||||
<div class="ico linkertype_normal"></div>创建连线
|
||||
@ -928,7 +928,8 @@
|
||||
<div class="extend"></div>
|
||||
</li>
|
||||
</ul>
|
||||
<div id="designer_subline" style="position:absolute;"></div>
|
||||
<!-- <div id="designer_subline1" style="position:absolute;"></div>-->
|
||||
<!-- <div id="designer_subline2" style="position:absolute;"></div>-->
|
||||
</div>
|
||||
</div>
|
||||
<div id="shape_img_container"></div>
|
||||
@ -1155,7 +1156,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="dock_view dock_view_attribute" style="width: 350px">
|
||||
<div class="dock_view dock_view_attribute" style="width: 350px;overflow: auto">
|
||||
<div class="dock_view_header">
|
||||
<font id='dock_view_header_title'>文件属性</font>
|
||||
<div class="ico ico_dock_collapse"></div>
|
||||
|
||||
@ -83,6 +83,9 @@
|
||||
<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 rel="stylesheet" type="text/css" href="../apps/com.actionsoft.apps.cms/css/cms.site.css?v=1655363443943">
|
||||
|
||||
<!--针对设计器进行颜色扩展,以及文字扩充-->
|
||||
<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>-->
|
||||
@ -91,6 +94,10 @@
|
||||
<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/public.js'></script>
|
||||
|
||||
<script type="text/javascript" src="../apps/com.actionsoft.apps.cms/js/cms.showsite.js?v=1655363445459"></script>
|
||||
<script type="text/javascript" src="../apps/com.actionsoft.apps.cms/js/cms.util.js?v=1655363445484"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
//公共信息
|
||||
var appId = "<#appId>";
|
||||
@ -224,6 +231,313 @@
|
||||
var wsId = "<#wsId>";
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
var sid = "32da61f5-83ac-4dfe-ba8e-3879f694390d";
|
||||
var appId = 'com.actionsoft.apps.cms';
|
||||
var userId = "admin";
|
||||
var userName = "管理员";
|
||||
var userNameAlias = "admin<管理员>";
|
||||
var siteId = "635782b9-9acc-4bd1-9c1f-760774874e49";
|
||||
var siteName = "资讯中心";
|
||||
var toMessageDetailPage="false";
|
||||
var homeMessageId="";
|
||||
var showSiteBannerFlag="1";
|
||||
var showNavFlag="1";
|
||||
var navBgColor="DCF3FD";
|
||||
var navFontColor="5297cc";
|
||||
var navHoverBgColor="5297cc";
|
||||
var navHoverFontColor="DCF3FD";
|
||||
var siteBanner="aws_cms_banner_2.jpg";
|
||||
var siteBgImage="";
|
||||
var isSiteAdmin="1";
|
||||
var havaSiteScanPermit="1";
|
||||
var isAdmin="1";
|
||||
var fullsearchcanuseflag="2";
|
||||
var backgroundcanuseflag="2";
|
||||
var canSeeModuleFlag="1";
|
||||
var hasOneSiteAdminPerFlag="1";
|
||||
var meizhancanuseflag="2";
|
||||
var quickAddFlagForSystem="0";
|
||||
var onlyShowManageFlag="2";
|
||||
var hideTopFlag="2";
|
||||
var messageAddFlagForSystem="0";
|
||||
var canVisitOuterNetFlag="0";
|
||||
var toMessageListPage="false";
|
||||
var homeModuleId="";
|
||||
var nowTheme="1";
|
||||
var bannerHeight="300";
|
||||
var openType="0";
|
||||
var toDesignFlag="0";
|
||||
var onlinedoccanuseflag="2";
|
||||
var supportType="";
|
||||
var supportOfficeType="";
|
||||
var subListStyle="1";
|
||||
var showInPage="0";
|
||||
var showFirstReadInfo="0";
|
||||
var language="cn";
|
||||
var homeNavText="首页";
|
||||
var showHomeNav="0";
|
||||
var fillUpFlag="1";
|
||||
var datePattern="6";
|
||||
var topMarqueeFlag="0";
|
||||
var autoPlay="1";
|
||||
var esResult="1";
|
||||
var numberForNew="3";
|
||||
var defaultPictureUrl = "../apps/com.actionsoft.apps.cms/img/icon_nopicture_default.png";
|
||||
var showReadScope = "0";
|
||||
var canDownloadAtt = "0";
|
||||
var showTitlePicture = "0";
|
||||
var themeApplyToTitle = "1";
|
||||
var showHomeBtn = "0";
|
||||
var customBannerHost = "";
|
||||
var moduleContentScanFlag = "1";
|
||||
var saveHistoryDataFlag = "1";
|
||||
var showReplyNum = "0";
|
||||
var boId = "";
|
||||
var portalUrl = "http://192.168.34.1:8088/portal";
|
||||
|
||||
// 国际化
|
||||
var 首页 = '首页';
|
||||
var 风格设置= '风格设置';
|
||||
var 导航设置 = '导航设置';
|
||||
var 背景设置 = '背景设置';
|
||||
var 显示图片 = '显示图片';
|
||||
var 隐藏图片 = '隐藏图片';
|
||||
var 是 = '是';
|
||||
var 否 = '否';
|
||||
var 返回 = '返回';
|
||||
var 返回首页 = '返回首页';
|
||||
var 设置主题风格颜色 = '设置主题风格颜色';
|
||||
var 粘贴图片网址 = '粘贴图片网址';
|
||||
var 保存图片= '保存图片';
|
||||
var 保存= '保存';
|
||||
var 关闭= '关闭';
|
||||
var 内容管理= '内容管理';
|
||||
var 内容管理APP= '内容管理';
|
||||
var 栏目管理= '栏目管理';
|
||||
var 内容回收站= '内容回收站';
|
||||
var 重构索引= '重构索引';
|
||||
var 导航= '导航';
|
||||
var 清空= '清空';
|
||||
|
||||
var 序号= '序号';
|
||||
var 标题= '标题';
|
||||
var 发布人= '发布人';
|
||||
var 作者= '作者';
|
||||
var 创建时间= '创建时间';
|
||||
var 阅读量= '阅读量';
|
||||
var 操作= '操作';
|
||||
|
||||
var 添加= '添加';
|
||||
var 板块修改= '板块修改';
|
||||
var 板块添加= '板块添加';
|
||||
var 大= '大';
|
||||
var 中= '中';
|
||||
var 小= '小';
|
||||
var 时间= '时间';
|
||||
var 浏览量= '浏览量';
|
||||
var 回复量= '回复量';
|
||||
var 部件= '部件';
|
||||
var 板块= '板块';
|
||||
var 添加部件= '添加部件';
|
||||
var 修改部件= '修改部件';
|
||||
var 请选择= '请选择';
|
||||
var 应用到全站= '应用到全站';
|
||||
var 添加导航= '添加导航';
|
||||
var 添加成功= '添加成功';
|
||||
var 操作成功= '操作成功';
|
||||
var 修改失败= '修改失败';
|
||||
var 修改成功= '修改成功';
|
||||
var 保存失败= '保存失败';
|
||||
var 保存成功= '保存成功';
|
||||
var 部件删除提示 = '确定要删除该条部件信息吗?';
|
||||
var 板块删除提示 = '确定要删除该条板块信息吗?<br/>删除板块时会删除其下的部件';
|
||||
var 站点管理="站点管理";
|
||||
var 添加站点="添加站点";
|
||||
var 修改站点="修改站点";
|
||||
var 该默认站点不允许被暂停="该默认站点不允许被暂停";
|
||||
var 您无权进行此操作="您无权进行此操作";
|
||||
var 清空加载提示="正在清空,请稍候...";
|
||||
var 加载提示="正在加载,请稍候...";
|
||||
var 暂无信息="暂无信息";
|
||||
var 还原="还原";
|
||||
var 彻底删除="彻底删除";
|
||||
var 信息还原提示="确定要还原该条信息吗?";
|
||||
var 排序="排序";
|
||||
var 状态="状态";
|
||||
var 描述="描述";
|
||||
var 名称="名称";
|
||||
var 类型="类型";
|
||||
var 分类="分类";
|
||||
|
||||
var 自定义URL ="自定义URL";
|
||||
var 目标窗口 ="目标窗口";
|
||||
var 选择站点 ="选择站点";
|
||||
var 导航 ="导航";
|
||||
var 站点 ="站点";
|
||||
|
||||
var 重构索引库提示= '确定要重构内容管理索引库吗?';
|
||||
var 重构索引loading= '正在重新生成索引库,请稍候...';
|
||||
var 彻底删除信息提示= '确定要彻底删除该条信息吗?';
|
||||
var 清空回收站提示= '确定要清空该站点的回收站吗?';
|
||||
var 操作提示loading= '操作提示loading';
|
||||
var 选择用户= '选择用户';
|
||||
var 选择部门= '选择部门';
|
||||
var 查看= '查看';
|
||||
var 历史修改记录= '历史修改记录';
|
||||
var 删除回复提示= '确定要删除该条回复吗?';
|
||||
var 回复详情= '回复详情';
|
||||
var 加载更多= '加载更多';
|
||||
var 回复人回复时间= '回复人/回复时间';
|
||||
var 未记录阅读信息= '未记录阅读信息';
|
||||
var 阅读人= '阅读人';
|
||||
var 阅读时间= '阅读时间';
|
||||
var 单位= '单位';
|
||||
var 部门= '部门';
|
||||
var 发布时间= '发布时间';
|
||||
var 回复内容= '回复内容';
|
||||
var 阅读情况= '阅读情况';
|
||||
var 回复统计= '回复统计';
|
||||
var 关闭回复= '关闭回复';
|
||||
var 开启回复= '开启回复';
|
||||
var 置顶= '置顶';
|
||||
var 取消置顶= '取消置顶';
|
||||
var 发布= '发布';
|
||||
var 取消发布= '取消发布';
|
||||
var 更多= '更多';
|
||||
var 历史记录= '历史记录';
|
||||
var 已发= '已发';
|
||||
var 未发= '未发';
|
||||
var 置顶中= '置顶中';
|
||||
var 修改= '修改';
|
||||
var 删除= '删除';
|
||||
var 删除成功= '删除成功';
|
||||
var 启用= '启用';
|
||||
var 置顶提示= '确定要将该条信息置顶吗?';
|
||||
var 取消置顶提示= '确定要将该条信息取消置顶吗?';
|
||||
var 所选记录删除提示= '确认要把所选记录删除吗?';
|
||||
var 所选记录删除到回收站提示= '确认要把所选记录删除到回收站吗?';
|
||||
var 关闭信息回复提示= '确定要关闭该条信息的回复吗?';
|
||||
var 开启信息回复提示= '确定要开启该条信息的回复吗?';
|
||||
var 暂停所选栏目提示= '确定要暂停所选栏目吗?';
|
||||
var 启用所选栏目提示= '确定要启用所选栏目吗?';
|
||||
var 所选记录删除提示= '确认要把所选记录删除吗?';
|
||||
var 所选记录删除到回收站提示= '确认要把所选记录删除到回收站吗?';
|
||||
var 相关引用= '相关引用';
|
||||
var 清除= '清除';
|
||||
var 部门dept= '部门';
|
||||
var 搜索= '搜索';
|
||||
var 重置= '重置';
|
||||
var 请输入标题关键字= '请输入标题关键字';
|
||||
var 全文检索placeholder= '请输入标题、导读、内容、附件名、附件内容关键字';
|
||||
var 请选择用户= '请选择用户';
|
||||
var 请选择部门= '请选择部门';
|
||||
var 使用中= '使用中';
|
||||
var 添加栏目= '添加栏目';
|
||||
var 修改栏目= '修改栏目';
|
||||
var 确认要把该标题图删除吗= '确认要把该标题图删除吗?';
|
||||
var 添加子栏目= '添加子栏目';
|
||||
var 暂停= '暂停';
|
||||
var 确定要清除该栏目下的信息吗此操作不可恢复= '确定要清除该栏目下的信息吗?此操作不可恢复!';
|
||||
var 发布提示= '确定要发布该条信息吗?';
|
||||
var 取消发布提示= '确定要取消发布该条信息吗?';
|
||||
var 搜索结果= '搜索结果';
|
||||
var 请选择栏目= '请选择栏目';
|
||||
var 选择栏目= '选择栏目';
|
||||
var 已暂停= '已暂停';
|
||||
var 更改设置loading= '更改设置中,请稍候...';
|
||||
var 设置刷新提示= '保存成功,设置项刷新后生效,是否刷新?';
|
||||
var 请输入图片网址= '请输入图片网址';
|
||||
var 标题栏背景图='标题栏背景图';
|
||||
var 部件高='部件高';
|
||||
var 不允许超过100个字符='不允许超过100个字符';
|
||||
var 只能为10的倍数='只能为10的倍数';
|
||||
var 关联栏目='关联栏目';
|
||||
var 查询='查询';
|
||||
var 从='从';
|
||||
var 至='至';
|
||||
var 回复量浏览量= '回复量/浏览量';
|
||||
var 该栏目被暂停= '该栏目被暂停';
|
||||
var 搜索提示= '正在搜索,请稍候...';
|
||||
var 添加信息提示= '确认添加信息吗?';
|
||||
var 详细= '详细';
|
||||
var 打包下载图集= '打包下载图集';
|
||||
var 该信息已经被取消发布= '该信息已经被取消发布';
|
||||
|
||||
var 导读= '导读';
|
||||
var 无效的链接= '无效的链接';
|
||||
var 来源= '来源';
|
||||
var 摄影者= '摄影者';
|
||||
var 收藏= '收藏';
|
||||
var 取消收藏= '取消收藏';
|
||||
var 发布人= '发布人';
|
||||
var 浏览量= '浏览量';
|
||||
var 发布时间= '发布时间';
|
||||
var 部门= '部门';
|
||||
var 点击下载= '点击下载';
|
||||
var 附件= '附件';
|
||||
var 阅读范围声明= '阅读范围声明';
|
||||
var 关键词= '关键词';
|
||||
var 转发= '转发';
|
||||
var 打印= '打印';
|
||||
var 修改= '修改';
|
||||
var 删除= '删除';
|
||||
var 信息未找到= '信息未找到';
|
||||
var 写下你的看法= '写下你的看法';
|
||||
var 该信息不允许回复= '该信息不允许回复';
|
||||
var 选择表情= '选择表情';
|
||||
var 提交= '提交';
|
||||
var 文件预览btn= '文 件 预 览';
|
||||
var 文件下载btn= '文 件 下 载';
|
||||
var 条回复= '条回复';
|
||||
var 做第一个回复者吧= '做第一个回复者吧';
|
||||
var 回复内容= '回复内容';
|
||||
var 不允许为空= '不允许为空';
|
||||
var 删除回复提示= '确定要删除该条回复吗?';
|
||||
var 请选择一个工作网络或者小组= '请选择一个工作网络或者小组';
|
||||
var 转发到工作网络= '转发到工作网络';
|
||||
var 修改成功= '修改成功';
|
||||
var 操作成功= '操作成功';
|
||||
var 确定要删除该条信息吗该操作不可恢复= '确定要删除该条信息吗?<br/>该操作不可恢复';
|
||||
var 阅读记录= '阅读记录';
|
||||
var 序号= '序号';
|
||||
var 阅读人= '阅读人';
|
||||
var 阅读时间= '阅读时间';
|
||||
var 部门= '部门';
|
||||
var 单位= '单位';
|
||||
var 未记录阅读信息= '未记录阅读信息';
|
||||
var 加载更多= '加载更多';
|
||||
var 暂无信息= '暂无信息';
|
||||
var 详情= '详情';
|
||||
var 该信息已经被取消发布= '该信息已经被取消发布';
|
||||
var 确定要删除该导航信息吗= '确定要删除该导航信息吗';
|
||||
var 浅绿色= '浅绿色';
|
||||
var 蓝色= '蓝色';
|
||||
var 青绿色= '青绿色';
|
||||
var 红色= '红色';
|
||||
var 门户默认蓝= '门户默认蓝';
|
||||
var 紫色= '紫色';
|
||||
var 橘色= '橘色';
|
||||
var 湖蓝= '湖蓝';
|
||||
var 点击进入站点进行设计= '点击进入站点进行设计';
|
||||
var 清空站点数据= '清空站点数据';
|
||||
var 清空站点数据提示= '该操作不可恢复,请谨慎处理?';
|
||||
var 确定要清空该站点下的所有数据吗= '确定要清空该站点下的所有数据吗';
|
||||
var 流程= '流程';
|
||||
var 栏目= '栏目';
|
||||
var 全文检索服务有误提示= '全文检索服务有误,自动为您展示数据库查询结果';
|
||||
var 查看阅读范围= '查看阅读范围';
|
||||
|
||||
var 下一页 = "下一页";
|
||||
var 上一页 = "上一页";
|
||||
var 显示0到1条共2条 = "显示 {0} 到 {1} 条,共 {2} 条";
|
||||
var 更新时间 = "更新时间";
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
<!--工具js-->
|
||||
<script type='text/javascript' charset='UTF-8' src='../apps/com.actionsoft.apps.coe.pal/lib/designer/extend/js/util/map.js'></script>
|
||||
<script type='text/javascript' charset='UTF-8' src='../apps/com.actionsoft.apps.coe.pal/lib/designer/extend/js/util/uuid.js'></script>
|
||||
@ -252,6 +566,14 @@
|
||||
<!-- 不支持HTML5的浏览器 -->
|
||||
<link rel="stylesheet" href="../apps/com.actionsoft.apps.coe.pal/css/pal.pl.repository.designer.view.css">
|
||||
<script type="text/javascript" src="../apps/com.actionsoft.apps.coe.pal/js/pal.pl.repository.designer.view.js"></script>
|
||||
|
||||
|
||||
<!--表情选择-->
|
||||
<link href="../apps/com.actionsoft.apps.cms/lib/faceselect/jquery.sinaEmotion.css?v=1655363446475" rel="stylesheet">
|
||||
<script src="../apps/com.actionsoft.apps.cms/lib/faceselect/jquery.sinaEmotion.js?v=1655363446479"></script>
|
||||
|
||||
<script type="text/javascript" src="../apps/com.actionsoft.apps.cms/js/commentFunction.js"></script>
|
||||
|
||||
<#processlink_ete_js>
|
||||
<style type="text/css">
|
||||
.portalAttr{
|
||||
@ -307,6 +629,9 @@
|
||||
$(".footer_chrome").show();
|
||||
});
|
||||
}
|
||||
</script>
|
||||
<script type="text/javascript">
|
||||
|
||||
</script>
|
||||
<script>
|
||||
$(document).ready(function(){
|
||||
@ -329,9 +654,23 @@
|
||||
$('#tab').css('display', 'inline-block');
|
||||
clickTab('processDesc');
|
||||
initProcessDesc();
|
||||
initPl();
|
||||
});
|
||||
|
||||
function initOutputFileLink() {
|
||||
|
||||
function initPl() {
|
||||
|
||||
$(".message-detial-reply").empty();
|
||||
$(".message-detial-reply").append("<div class='reply-title'>"+"写下你的看法"+"</div><div class='reply-box'></div><div class='reply-list'></div>");
|
||||
var addreplystr="";
|
||||
addreplystr+="<div class='reply-panel'><textarea class='txt emotion replycontent' id='replycontent' maxlength='5000'></textarea>";
|
||||
addreplystr+="<span title='"+"选择表情"+"' style='background:url(../apps/com.actionsoft.apps.cms/img/system/face_emotion.png);background-size:22px 22px;display: inline-block;width: 22px;height: 22px;margin-left: 5px;' id='showemotion'></span><input type='button' class='button blue reply-add-btn' onclick=addReply('"+ruuid+"'); value='"+"提交"+"'/>";
|
||||
addreplystr+="</div>";
|
||||
$(".reply-box").append(addreplystr);
|
||||
$('#showemotion').SinaEmotion($('.emotion'));
|
||||
loadReplyData(ruuid,1,0);
|
||||
}
|
||||
|
||||
function initOutputFileLink() {
|
||||
if(taskId != "") {
|
||||
var html = '';
|
||||
// 只包含手册的链接
|
||||
@ -526,8 +865,8 @@
|
||||
<span><#typeName></span>
|
||||
<div class="toolbar_info2" style="width:369px;">
|
||||
<div id="tab" style="display: none;font-size: 17px;">
|
||||
<div id="processDesc" class="headerTab" onclick="clickTab('processDesc');">描述</div>
|
||||
<div id="processAttr" class="headerTab" onclick="clickTab('processAttr');">步骤说明</div>
|
||||
<div id="processDesc" class="headerTab" onclick="clickTab('processDesc');">文件属性</div>
|
||||
<div id="processAttr" class="headerTab" onclick="clickTab('processAttr');">活动属性</div>
|
||||
<div id="processFile" class="headerTab" onclick="clickTab('processFile');">制度/操作指导</div>
|
||||
</div>
|
||||
<div style="display: inline-block;float:right;">
|
||||
@ -557,6 +896,8 @@
|
||||
<div id="canvas_container" style="padding:0px;background-color:white;">
|
||||
<div id="designer_canvas">
|
||||
<canvas id="designer_grids" style="background-color:white;">您的浏览器不支持HTML5,请使用IE9及以上版本,或Chrome、Firefox等浏览器</canvas>
|
||||
<div class="message-detial-reply">
|
||||
</div>
|
||||
<!-- 链接图层 -->
|
||||
<ul id="link-dialog-normal_contextmenu" class="menu list options_menu">
|
||||
</ul>
|
||||
|
||||
@ -1727,4 +1727,11 @@
|
||||
<param name="desc"/>
|
||||
<param name="methodId"/>
|
||||
</cmd-bean>
|
||||
<cmd-bean name="com.actionsoft.apps.coe.pal_repository_model_version_diff_query">
|
||||
<param name="id"/>
|
||||
</cmd-bean>
|
||||
<cmd-bean name="com.actionsoft.apps.coe.pal_repository_define_shape_attr_valid">
|
||||
<param name="uuid"/>
|
||||
<param name="define"/>
|
||||
</cmd-bean>
|
||||
</aws-actions>
|
||||
152
com.actionsoft.apps.coe.pal/web/com.actionsoft.apps.coe.pal/js/coe.team.pal.designer.js
Executable file → Normal file
152
com.actionsoft.apps.coe.pal/web/com.actionsoft.apps.coe.pal/js/coe.team.pal.designer.js
Executable file → Normal file
@ -22,8 +22,8 @@ $(function() {
|
||||
},
|
||||
error: function (jqXHR, textStatus, errorThrown) {
|
||||
$.simpleAlert(errorThrown, 'err');
|
||||
console.log(jqXHR)
|
||||
console.log(textStatus)
|
||||
console.log(jqXHR);
|
||||
console.log(textStatus);
|
||||
console.log(errorThrown)
|
||||
}
|
||||
});
|
||||
@ -78,7 +78,6 @@ $(function() {
|
||||
});
|
||||
}
|
||||
function initSaveFun() {
|
||||
debugger;
|
||||
Dock.showView('');
|
||||
var obj = Model.define;
|
||||
var tempMessageArr = {};
|
||||
@ -90,75 +89,88 @@ $(function() {
|
||||
tempMessageArr[messageId] = messageArrayForSave[messageId];
|
||||
}
|
||||
var messageArray = JSON.stringify(tempMessageArr);
|
||||
var elements = obj.elements
|
||||
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].isRequired && elements[i].dataAttributes[a].attributesJsonArray[b].value == '') {
|
||||
$.simpleAlert("close");
|
||||
$.simpleAlert("必填项不能为空", 'error');
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "./jd",
|
||||
data: {
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "./jd",
|
||||
data: {
|
||||
sid: CLB.sid,
|
||||
cmd: "com.actionsoft.apps.coe.pal_repository_process_define_save",
|
||||
cmd: "com.actionsoft.apps.coe.pal_repository_define_shape_attr_valid",
|
||||
uuid: ruuid,
|
||||
define: awsui.encode(obj),
|
||||
teamId: $("#teamId").val(),
|
||||
BPMInstanceName: BPMInstanceName,
|
||||
messages: messageArray
|
||||
},
|
||||
success: function (msg, textStatus, jqXHR) {
|
||||
if(msg.result == "ok") {
|
||||
$.simpleAlert("close");
|
||||
messageArrayForSave = {};
|
||||
$("#saving_tip").css("color", "rgb(26, 164, 125)");
|
||||
$("#saving_tip").text("保存成功");
|
||||
recordShapeText();// 记录最新的节点及其文本text
|
||||
//更多属性的处理,当节点处理完成后再处理更多属性
|
||||
if (saveAttributesJson.length > 0 || removeAttributeJson.length > 0){
|
||||
$.ajax({
|
||||
type : "POST",
|
||||
url : "./jd",
|
||||
data : {
|
||||
sid : encodeURI(CLB.sid),
|
||||
cmd : "com.actionsoft.apps.coe.pal_pl_repository_more_attribute_save",
|
||||
wsId : $("#wsId").val(),
|
||||
uuid : ruuid,
|
||||
attributesJson : JSON.stringify(saveAttributesJson),
|
||||
removeAttributeJson : JSON.stringify(removeAttributeJson)
|
||||
},
|
||||
success:function(r) {
|
||||
saveAttributesJson = [];
|
||||
removeAttributeJson = [];
|
||||
},
|
||||
error:function(r) {
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "./jd",
|
||||
data: {
|
||||
sid: CLB.sid,
|
||||
cmd: "com.actionsoft.apps.coe.pal_repository_process_define_save",
|
||||
uuid: ruuid,
|
||||
define: awsui.encode(obj),
|
||||
teamId: $("#teamId").val(),
|
||||
BPMInstanceName: BPMInstanceName,
|
||||
messages: messageArray
|
||||
},
|
||||
success: function (msg, textStatus, jqXHR) {
|
||||
if(msg.result == "ok") {
|
||||
$.simpleAlert("close");
|
||||
messageArrayForSave = {};
|
||||
$("#saving_tip").css("color", "rgb(26, 164, 125)");
|
||||
$("#saving_tip").text("保存成功");
|
||||
recordShapeText();// 记录最新的节点及其文本text
|
||||
//更多属性的处理,当节点处理完成后再处理更多属性
|
||||
if (saveAttributesJson.length > 0 || removeAttributeJson.length > 0){
|
||||
$.ajax({
|
||||
type : "POST",
|
||||
url : "./jd",
|
||||
data : {
|
||||
sid : encodeURI(CLB.sid),
|
||||
cmd : "com.actionsoft.apps.coe.pal_pl_repository_more_attribute_save",
|
||||
wsId : $("#wsId").val(),
|
||||
uuid : ruuid,
|
||||
attributesJson : JSON.stringify(saveAttributesJson),
|
||||
removeAttributeJson : JSON.stringify(removeAttributeJson)
|
||||
},
|
||||
success:function(r) {
|
||||
saveAttributesJson = [];
|
||||
removeAttributeJson = [];
|
||||
},
|
||||
error:function(r) {
|
||||
}
|
||||
});
|
||||
}
|
||||
$.simpleAlert("保存成功", "ok");
|
||||
//保存结束时间戳
|
||||
//var saveEndTime = new Date().getTime();
|
||||
//console.log("流程保存时间:", (saveEndTime - saveStartTime) + "毫秒");
|
||||
} else {
|
||||
$.simpleAlert("close");
|
||||
$.simpleAlert(msg.data.desc, 'error', 2000);
|
||||
}
|
||||
});
|
||||
}
|
||||
$.simpleAlert("保存成功", "ok");
|
||||
//保存结束时间戳
|
||||
//var saveEndTime = new Date().getTime();
|
||||
//console.log("流程保存时间:", (saveEndTime - saveStartTime) + "毫秒");
|
||||
},
|
||||
error: function (jqXHR, textStatus, errorThrown) {
|
||||
$.simpleAlert("close");
|
||||
$.simpleAlert('保存失败', 'error', 1500);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
$.simpleAlert("close");
|
||||
$.simpleAlert(msg.data.desc, 'error', 2000);
|
||||
var result = msg.data;
|
||||
var resultMsg = [];
|
||||
for (var i = 0; i < result.length; i++) {
|
||||
var o = result[i];
|
||||
resultMsg.push('[' + o.shapeName + ']的[' + o.attrName + ']不能为空' );
|
||||
}
|
||||
$.simpleAlert(resultMsg.join('<br>'), 'error');
|
||||
// $.simpleAlert(ro.msg, 'error');
|
||||
}
|
||||
},
|
||||
error: function (jqXHR, textStatus, errorThrown) {
|
||||
$.simpleAlert("close");
|
||||
$.simpleAlert('保存失败', 'error', 1500);
|
||||
$.simpleAlert('校验失败', 'error', 1500);
|
||||
}
|
||||
});
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -181,7 +193,7 @@ $(function() {
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
//在弹出“是否离开”的提示框后,选择离开,则触发onunload事件
|
||||
window.onunload = function(){
|
||||
@ -197,7 +209,7 @@ $(function() {
|
||||
uuid: ruuid
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
// saveTimer();
|
||||
intervalRefresh();
|
||||
}
|
||||
@ -238,7 +250,7 @@ $(function() {
|
||||
$('#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({
|
||||
@ -268,11 +280,11 @@ $(function() {
|
||||
{ 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
|
||||
};
|
||||
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) {
|
||||
@ -303,7 +315,7 @@ $(function() {
|
||||
$("#saving_tip").text("文件已修改,未保存");
|
||||
}
|
||||
})
|
||||
})
|
||||
});
|
||||
|
||||
|
||||
/**定时保存**/
|
||||
@ -321,7 +333,7 @@ function saveTimer() {
|
||||
alertmsg(count, msg);
|
||||
}
|
||||
}})
|
||||
}
|
||||
};
|
||||
alertmsg(count, msg);
|
||||
// $.simpleAlert("5秒之后自动进行保存", "info", 5000, {callback:function(){$("#bar_save").click();}});
|
||||
}, 300000);
|
||||
@ -343,7 +355,7 @@ function intervalRefresh() {
|
||||
alert : false,
|
||||
ok: function(msg){
|
||||
if (msg.data.isLocked) {
|
||||
var m = '当前流程被 ' + msg.data.currentUserName + ' 强行获取编辑权或锁定'
|
||||
var m = '当前流程被 ' + msg.data.currentUserName + ' 强行获取编辑权或锁定';
|
||||
$.simpleAlert(m,"info",4000,{mode:true,callback:function() {
|
||||
if ($("#saving_tip").text() != "已保存成功" && $("#saving_tip").text() != "保存成功" && $("#saving_tip").text() != "您的文件已经成功保存" && $("#saving_tip").text() != "") {
|
||||
$("#saving_tip").text('');// 防止reload时出现浏览器自带提示
|
||||
@ -389,7 +401,7 @@ var CommonLock = {
|
||||
window.location.reload();
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// 记录所有节点及节点名称,保存时对比
|
||||
var shapeTextRecord = {};
|
||||
|
||||
@ -6,6 +6,8 @@ Designer.contextMenu.show = function(x, y) {
|
||||
var currentFocus = Utils.getShapeByPosition(x, y, false);
|
||||
menu.children().hide();
|
||||
menu.children("li[ac=selectall]").show();
|
||||
menu.children("li[ac=selectVertical]").show();
|
||||
menu.children("li[ac=selectHorizontal]").show();
|
||||
menu.children(".devi_selectall").show();
|
||||
menu.children("li[ac=drawline]").show();
|
||||
menu.children("li[ac=processAttribute]").show();
|
||||
@ -163,6 +165,10 @@ Designer.contextMenu.execAction = function(item) {
|
||||
showPropertiesDialog(true);
|
||||
} else if (action == "customdefine") {
|
||||
openCustomDefineDialog();
|
||||
} else if(action == 'selectVertical') {
|
||||
Designer.selectVertical(this.menuPos);
|
||||
} else if (action == 'selectHorizontal') {
|
||||
Designer.selectHorizontal(this.menuPos);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@ -1117,7 +1117,6 @@ function getLinkFileValue(treeNode) {
|
||||
// 数属性tab页面效果js
|
||||
|
||||
function selectAttrTabTag(showContent, selfObj) {
|
||||
debugger;
|
||||
// 操作标签
|
||||
var tag = $("#tabUlContainer li");
|
||||
var taglength = tag.length;
|
||||
@ -1303,7 +1302,7 @@ function noPermissionMsg(){
|
||||
// 属性的动态切换
|
||||
|
||||
function attributeShowTabContent(currentShape) {
|
||||
debugger;
|
||||
|
||||
// 属性弹出层显示的内容
|
||||
var shape = Utils.getSelected()[0];
|
||||
if (!shape) {
|
||||
@ -1443,7 +1442,6 @@ function getPrivateAttributeHtml(attributesJsonArray, tbodyId, shape) {
|
||||
+ ' <div class="attribute_td_div_css">' + obj.value + '</div>'
|
||||
+ ' </td></tr>';
|
||||
if ((!objReadonly && objType == "string") || (!objReadonly && objType == "list") || (!objReadonly && objType == "link")) {
|
||||
debugger;
|
||||
// 目前支持到文本的输入 ,需求定下了再改
|
||||
constr = '<tr ' + mouseout + mouseover + ' objid="' + obj.id + '" class="tagContentTableTr">'
|
||||
+ ' <td>' + objName + requiredSpan + '</td>'
|
||||
@ -1941,7 +1939,6 @@ function showEditButton(obj) {
|
||||
|
||||
var inputUpdate = false;
|
||||
function saveInputContent(obj,value) {
|
||||
debugger;
|
||||
// 按钮
|
||||
// $(obj).siblings("span::contains('...')").hide();
|
||||
inputUpdate = true;
|
||||
@ -2777,10 +2774,16 @@ function setDivHeight() {/*
|
||||
}
|
||||
|
||||
function changeArributeByShape() {
|
||||
debugger;
|
||||
if (Utils.getSelected()[0] == null) {
|
||||
$("#dock_content_attribute").hide();
|
||||
$("#attr_no_more_attribute_id").show();
|
||||
var iframeDocument=$("#file_attribute")[0].contentWindow.document;
|
||||
var body = $(iframeDocument).find('body')
|
||||
var pickerNum = $(body).find('input[name="dateTimePicker"]').length
|
||||
if (pickerNum > 0) {
|
||||
var height = $(body).find('#frmMain').height() + 300
|
||||
$("#file_attribute").height(height)
|
||||
}
|
||||
} else {
|
||||
// 属性弹出层显示的内容
|
||||
var shape = Utils.getSelected()[0];
|
||||
@ -3426,7 +3429,7 @@ function getRelevanceAwsOrgNameByShapeId(objIds, shapeId) {
|
||||
|
||||
// 形状关联弹窗
|
||||
function openRelationDig(obj,value) {
|
||||
debugger;
|
||||
|
||||
var shapeRelationValue = $("input[objid_shapeId='" + $(obj).attr("objid") + "']").val();
|
||||
var ref = $("input[objid_shapeId='" + $(obj).attr("objid") + "']").attr("ref"); // shape file shapeAndFile
|
||||
var relationShapeIds = '';
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
/**
|
||||
* 设计器对外提供的方法
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
@ -17,55 +17,216 @@ Designer.addFunction("open", function(definition){
|
||||
$(".shape_box").remove();
|
||||
Model.define.elements = {};
|
||||
Model.persistence.elements = {};
|
||||
Model.define.page = definition.page;
|
||||
|
||||
Model.define.page = definition.page;
|
||||
|
||||
//*******此处添加AWS流程设计器特有的属性*******//
|
||||
Model.define.processProperties=definition.processProperties;//此处添加aws全局属性
|
||||
Model.define.processDocument=definition.processDocument;//此处添加aws全局属性
|
||||
Model.define.uuid=definition.uuid;//此处添加流程uuid
|
||||
//Model.define.title=definition.title;//此处添加流程title
|
||||
//向页面processDefId processDefTitle 赋值
|
||||
//process.processDefId=definition.uuid;
|
||||
process.title=definition.title;
|
||||
Model.define.processProperties=definition.processProperties;//此处添加aws全局属性
|
||||
Model.define.processDocument=definition.processDocument;//此处添加aws全局属性
|
||||
Model.define.uuid=definition.uuid;//此处添加流程uuid
|
||||
//Model.define.title=definition.title;//此处添加流程title
|
||||
//向页面processDefId processDefTitle 赋值
|
||||
//process.processDefId=definition.uuid;
|
||||
process.title=definition.title;
|
||||
//*******添加结束*******//
|
||||
|
||||
Model.persistence.page = Utils.copy(definition.page);
|
||||
Designer.initialize.initCanvas();
|
||||
var shapes = definition.elements;
|
||||
//先构造形状,再构造连接线,因为连接线的绘制过程有可能依赖所连接的图形
|
||||
var shapeCount = 0;
|
||||
for(var shapeId in shapes){
|
||||
var shape = shapes[shapeId];
|
||||
if(shape.name != "linker"){
|
||||
Schema.initShapeFunctions(shape);
|
||||
Designer.painter.renderShape(shape);
|
||||
Model.add(shape, false);
|
||||
}
|
||||
shapeCount++;
|
||||
}
|
||||
for(var shapeId in shapes){
|
||||
var shape = shapes[shapeId];
|
||||
if(shape.name == "linker"){
|
||||
Designer.painter.renderLinker(shape);
|
||||
Model.add(shape, false);
|
||||
}
|
||||
}
|
||||
if(shapeCount == 0){
|
||||
Model.build();
|
||||
}
|
||||
Navigator.draw();
|
||||
|
||||
Model.persistence.page = Utils.copy(definition.page);
|
||||
Designer.initialize.initCanvas();
|
||||
var shapes = definition.elements;
|
||||
//先构造形状,再构造连接线,因为连接线的绘制过程有可能依赖所连接的图形
|
||||
var shapeCount = 0;
|
||||
for(var shapeId in shapes){
|
||||
var shape = shapes[shapeId];
|
||||
if(shape.name != "linker"){
|
||||
Schema.initShapeFunctions(shape);
|
||||
Designer.painter.renderShape(shape);
|
||||
Model.add(shape, false);
|
||||
}
|
||||
shapeCount++;
|
||||
}
|
||||
for(var shapeId in shapes){
|
||||
var shape = shapes[shapeId];
|
||||
if(shape.name == "linker"){
|
||||
Designer.painter.renderLinker(shape);
|
||||
Model.add(shape, false);
|
||||
}
|
||||
}
|
||||
if(shapeCount == 0){
|
||||
Model.build();
|
||||
}
|
||||
Navigator.draw();
|
||||
});
|
||||
|
||||
/**
|
||||
* 设计器方法:全选
|
||||
*/
|
||||
Designer.addFunction("selectAll", function(){
|
||||
var shapes = Model.define.elements;
|
||||
var shapeIds = [];
|
||||
for(var shapeId in shapes){
|
||||
shapeIds.push(shapeId);
|
||||
}
|
||||
Utils.selectShape(shapeIds);
|
||||
var shapes = Model.define.elements;
|
||||
var shapeIds = [];
|
||||
for(var shapeId in shapes){
|
||||
shapeIds.push(shapeId);
|
||||
}
|
||||
Utils.selectShape(shapeIds);
|
||||
});
|
||||
|
||||
/**
|
||||
* 设计器方法:调节垂直间距
|
||||
*/
|
||||
Designer.addFunction("selectVertical", function(menuPos){
|
||||
var selectedIds = [];
|
||||
var lineArr = []
|
||||
var shapeArr = []
|
||||
var menuY = menuPos.y
|
||||
var shapes = Model.define.elements;
|
||||
console.log(shapes)
|
||||
|
||||
var subline1 = $('#designer_subline1')
|
||||
var subline2 = $('#designer_subline2')
|
||||
subline1.css({
|
||||
display : "block",
|
||||
"z-index" : Model.orderList.length + 4,
|
||||
width: Model.define.page.width,
|
||||
height: 0,
|
||||
borderStyle:'dotted',
|
||||
borderWidth: '1px',
|
||||
left: 0,
|
||||
top : menuY
|
||||
});
|
||||
subline2.css({
|
||||
display : "block",
|
||||
"z-index" : Model.orderList.length + 5,
|
||||
width: Model.define.page.width,
|
||||
height: 0,
|
||||
borderStyle:'dotted',
|
||||
borderWidth: '1px',
|
||||
left: 0,
|
||||
top : menuY,
|
||||
cursor: 'move'
|
||||
});
|
||||
|
||||
var container = $("#canvas_container");
|
||||
var canvas = $("#designer_canvas");
|
||||
subline2.bind('mousedown.drag',function (b) {
|
||||
container.bind('mousemove.drag',function (e) {
|
||||
var newPos = Utils.getRelativePos(e.pageX, e.pageY, canvas);
|
||||
if (newPos.y >= menuY) {
|
||||
subline1.css({
|
||||
backgroundColor: 'rgba(114,253,107,0.5)',
|
||||
height: newPos.y - menuY
|
||||
})
|
||||
subline2.css({
|
||||
backgroundColor: 'translate',
|
||||
height: 0
|
||||
})
|
||||
} else {
|
||||
subline1.css({
|
||||
backgroundColor: 'translate',
|
||||
height: 0
|
||||
})
|
||||
subline2.css({
|
||||
backgroundColor: 'rgba(246,163,163,0.5)',
|
||||
height: menuY - newPos.y
|
||||
})
|
||||
}
|
||||
subline2.css({
|
||||
top : newPos.y,
|
||||
});
|
||||
$(document).unbind("mouseup.drop").bind("mouseup.drop",
|
||||
function() {
|
||||
subline1.css({
|
||||
backgroundColor: 'translate',
|
||||
height: 0
|
||||
})
|
||||
subline2.css({
|
||||
backgroundColor: 'translate',
|
||||
height: 0
|
||||
})
|
||||
subline1.hide()
|
||||
subline2.hide()
|
||||
$(document).unbind("mouseup.drop")
|
||||
})
|
||||
})
|
||||
$(document).bind('mouseup.drag',function () {
|
||||
container.unbind("mousemove.drag");
|
||||
// subline2.unbind("mousedown.drag");
|
||||
$(document).unbind("mouseup.drag");
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
for(var shapeId in shapes){
|
||||
if (shapes[shapeId].points == undefined) {
|
||||
shapeArr.push(shapes[shapeId])
|
||||
} else {
|
||||
lineArr.push(shapes[shapeId])
|
||||
}
|
||||
}
|
||||
|
||||
for (var i = 0; i < shapeArr.length; i++) {
|
||||
if (shapeArr[i].props.y + shapeArr[i].props.h >= menuY) {
|
||||
selectedIds.push(shapeArr[i].id)
|
||||
}
|
||||
}
|
||||
for (var i = 0; i < lineArr.length; i++) {
|
||||
if (lineArr[i].from.y >= menuY || lineArr[i].to.y >= menuY) {
|
||||
selectedIds.push(lineArr[i].id)
|
||||
}
|
||||
}
|
||||
// Utils.selectShape(selectedIds);
|
||||
|
||||
|
||||
// for (var i = 0; i < selectedIds.length; i++) {
|
||||
// N(selectedIds[i])
|
||||
// $(".shape_contour[forshape=" + selectedIds[i].id + "]").css({
|
||||
// left: selectedIds[i].props.x.toScale(),
|
||||
// top: selectedIds[i].props.y.toScale()
|
||||
// })
|
||||
// }
|
||||
// var K = Utils.getSelectedLinkerIds();
|
||||
// if (selectedIds.length == 1 && K.length == 1) {
|
||||
// return
|
||||
// }
|
||||
// if (K.length > 0) {
|
||||
// var I = Utils.getSelectedIds();
|
||||
// Designer.painter.drawControls(I)
|
||||
// } else {
|
||||
// var E = $("#shape_controls");
|
||||
// E.css({
|
||||
// left: parseFloat(E.css("left")),
|
||||
// top: parseFloat(E.css("top")) + 100
|
||||
// })
|
||||
// }
|
||||
// var F = $("#shape_controls").position();
|
||||
// if (F && Utils.getSelected().length > 0) {
|
||||
// Designer.op.showTip("X: " + Math.round(F.left.restoreScale()) + " Y: " + Math.round(F.top.restoreScale()));
|
||||
// }
|
||||
// function N(a) {
|
||||
// a.props.x += 0;
|
||||
// a.props.y += 100;
|
||||
// var b = $("#" + a.id);
|
||||
// b.css({
|
||||
// left: parseFloat(b.css("left")),
|
||||
// top: parseFloat(b.css("top")) + 100
|
||||
// })
|
||||
// }
|
||||
});
|
||||
|
||||
/**
|
||||
* 设计器方法:调节水平间距
|
||||
*/
|
||||
Designer.addFunction("selectHorizontal", function(menuPos){
|
||||
var menuX = menuPos.x
|
||||
let subline = $('#designer_subline')
|
||||
console.log(subline)
|
||||
subline.css({
|
||||
display : "block",
|
||||
"z-index" : Model.orderList.length + 4,
|
||||
width: 0,
|
||||
height: Model.define.page.height,
|
||||
borderStyle:'dotted',
|
||||
borderWidth: '1px',
|
||||
left: menuX,
|
||||
top :0,
|
||||
});
|
||||
});
|
||||
|
||||
/**
|
||||
|
||||
@ -3045,78 +3045,51 @@ 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: []
|
||||
$.ajax({
|
||||
url: "./jd?sid=" + $("#sid").val()
|
||||
+ "&cmd=com.actionsoft.apps.coe.pal_repository_model_version_diff_query&wsId=" + $("#wsId").val()
|
||||
+ "&id=" + ruuid,
|
||||
success: function (ro) {
|
||||
// console.log("历史差异结果: " + JSON.stringify(ro))
|
||||
if (ro.result == "ok") {
|
||||
var diffContent = ro.data;
|
||||
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>'
|
||||
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
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
|
||||
$("#diffTable").empty().html(html)
|
||||
} else {
|
||||
html = '<tr>'
|
||||
+ ro.msg
|
||||
+ '</tr>'
|
||||
$("#diffTable").empty().html(html)
|
||||
}
|
||||
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 (drawNav && Dock.historyVersions == null) {
|
||||
|
||||
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user