流程图管理办法wps在线编辑提交
This commit is contained in:
parent
a916175335
commit
b4bca5a0bc
@ -22,6 +22,8 @@ import com.actionsoft.apps.coe.pal.pal.ws.web.VersionUtil;
|
||||
import com.actionsoft.apps.coe.pal.util.HttpPostUtil;
|
||||
import com.actionsoft.apps.coe.pal.util.WPS4Util;
|
||||
import com.actionsoft.apps.resource.plugin.profile.DCPluginProfile;
|
||||
import com.actionsoft.bpms.bo.engine.BO;
|
||||
import com.actionsoft.bpms.commons.formfile.model.delegate.FormFile;
|
||||
import com.actionsoft.bpms.commons.mvc.view.ResponseObject;
|
||||
import com.actionsoft.bpms.org.model.DepartmentModel;
|
||||
import com.actionsoft.bpms.org.model.RoleModel;
|
||||
@ -232,6 +234,8 @@ public class OutputWordUtil {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
//流程图新增逻辑,增加管理要求wps文件合并需求
|
||||
mergeMRWord(outFile.getPath(),repositoryId);
|
||||
|
||||
Document doc = new Document(outFile.getPath());
|
||||
Section section = doc.getLastSection();
|
||||
@ -2869,4 +2873,62 @@ public class OutputWordUtil {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断是否需求合并管理要求
|
||||
* @param uuid
|
||||
*/
|
||||
public static void mergeMRWord(String filePath, String uuid){
|
||||
Map<String, JSONObject> stringJSONObjectMap = PALRepositoryQueryAPIManager.queryRepositoryAttributeById(uuid);
|
||||
JSONObject attrJson = stringJSONObjectMap.get("management_requirements_Location");
|
||||
String text = attrJson.getString("text");
|
||||
if("不显示管理要求".equals(text)){
|
||||
return;
|
||||
}
|
||||
BO mrBO = SDK.getBOAPI().getByKeyField("BO_EU_PROCESS_MR", "FILEUUID", uuid);
|
||||
if(null!=mrBO){
|
||||
String status = mrBO.getString("STATUS");
|
||||
if(status.equals("1")){//如果为生效状态
|
||||
//先获取管理要求附件
|
||||
List<FormFile> systemfile = SDK.getBOAPI().getFiles(mrBO.getId(), "SYSTEMFILE");
|
||||
FormFile formFile = systemfile.get(0);
|
||||
DCContext fileDCContext = SDK.getBOAPI().getFileDCContext(formFile);
|
||||
//开始合并
|
||||
Document docs1 = new Document();
|
||||
docs1.loadFromFile(filePath);
|
||||
// 加载文档2
|
||||
Document docs2 = new Document();
|
||||
docs2.loadFromFile(fileDCContext.getFilePath());
|
||||
SectionCollection sections1 = docs1.getSections();
|
||||
//先确认要找到的段落
|
||||
int targetParagraphIndex = 0;
|
||||
if("流程图前".equals(text)){
|
||||
for (int i = 1; i < sections1.getCount(); i++) {
|
||||
Section section = sections1.get(i);
|
||||
for (int j = 0; j < section.getParagraphs().getCount(); j++) {
|
||||
Paragraph para = section.getParagraphs().get(j);
|
||||
if (para.getText().contains("流程图")) {
|
||||
targetParagraphIndex = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}else if("活动说明后".equals(text)){
|
||||
for (int i = 1; i < sections1.getCount(); i++) {
|
||||
Section section = sections1.get(i);
|
||||
for (int j = 0; j < section.getParagraphs().getCount(); j++) {
|
||||
Paragraph para = section.getParagraphs().get(j);
|
||||
if (para.getText().contains("流程说明")) {
|
||||
targetParagraphIndex = i+1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
sections1.insert(targetParagraphIndex, docs2.getSections().get(0).deepClone());
|
||||
// 保存文档2
|
||||
docs1.saveToFile(filePath, FileFormat.Docx_2013);
|
||||
docs1.dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -448,6 +448,7 @@
|
||||
var pid = "<#parentChartId>";
|
||||
var teamId = "<#teamId>";
|
||||
var jssdk;
|
||||
var mrStatus = "0";
|
||||
</script>
|
||||
<!--工具js-->
|
||||
<script type='text/javascript' charset='UTF-8' src='../apps/com.actionsoft.apps.coe.pal/lib/designer/extend/js/util/map.js'></script>
|
||||
@ -1193,6 +1194,8 @@
|
||||
$("#dock").css("right", 0);
|
||||
openWpsMRUrl();
|
||||
} else {
|
||||
//先判断是否要更新管理办法的生效状态
|
||||
updateMrStatus();
|
||||
$("#wpsPage").css('display', 'none');
|
||||
$("#shape_panel").css('display', 'block');
|
||||
$("#shape_panel_more_shape").css('display', 'block');
|
||||
@ -1224,6 +1227,32 @@
|
||||
}
|
||||
}
|
||||
|
||||
function updateMrStatus(){//更新管理办法的生效状态
|
||||
//先判断是否要更新管理办法的生效状态
|
||||
if(mrStatus == 0){//生效
|
||||
//先弹出二次确认框
|
||||
var options = {
|
||||
title : "当前管理办法未生效,是否更新管理办法的生效状态?",
|
||||
content:"确认生效",
|
||||
onConfirm: function(){
|
||||
$.ajax({
|
||||
url: "./jd?sid=" + sid + "&cmd=com.awspaas.user.apps.yiliwps.updateMrStatus&palId=" + ruuid,
|
||||
type: 'GET',
|
||||
success: function (data) {
|
||||
mrStatus = data.data.mrStatus;
|
||||
}
|
||||
});
|
||||
},
|
||||
onCancel : function(){
|
||||
$.simpleAlert("您选择了取消");
|
||||
}
|
||||
};
|
||||
$.confirm(options);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//保存wps内容
|
||||
async function saveWps() {
|
||||
try {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user