表单图优化附件显示内容|报告生成器批量下载功能
This commit is contained in:
parent
f861e49423
commit
c4bb76fe69
@ -444,7 +444,7 @@ public class OutPutReportWeb extends ActionWeb {
|
|||||||
if (teamId == null) {
|
if (teamId == null) {
|
||||||
jsonArr = PALRepositoryQueryAPIManager.getInstance().getPalRepositoryTreeDataByDeptId(_uc, wsid, methodType, versionType,departId);
|
jsonArr = PALRepositoryQueryAPIManager.getInstance().getPalRepositoryTreeDataByDeptId(_uc, wsid, methodType, versionType,departId);
|
||||||
} else {
|
} else {
|
||||||
jsonArr = PALRepositoryQueryAPIManager.getInstance().getPermPalRepositoryTreeDataByMethodsByDeptId(_uc, wsid, teamId, versionType, methodType,departId);
|
jsonArr = PALRepositoryQueryAPIManager.getInstance().getPermPalRepositoryTreeDataByMethodsByDeptId(_uc, wsid, teamId, versionType, methodType,departId,true);
|
||||||
}
|
}
|
||||||
return jsonArr.toString();
|
return jsonArr.toString();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -207,9 +207,6 @@ public class OutputWordUtil {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// 输出文档路径及名称
|
// 输出文档路径及名称
|
||||||
File outFile = new File(docName);
|
File outFile = new File(docName);
|
||||||
Writer out = null;
|
Writer out = null;
|
||||||
@ -232,12 +229,7 @@ public class OutputWordUtil {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
System.out.println("repositoryId==============="+repositoryId);
|
|
||||||
|
|
||||||
/*****************************************************************************/
|
|
||||||
System.out.println("outFile.getPath()================"+outFile.getPath());
|
|
||||||
Document doc = new Document(outFile.getPath());
|
Document doc = new Document(outFile.getPath());
|
||||||
|
|
||||||
Section section = doc.getLastSection();
|
Section section = doc.getLastSection();
|
||||||
UpFileDao upFileDao = new UpFileDao();
|
UpFileDao upFileDao = new UpFileDao();
|
||||||
UserContext userContext = DispatcherRequest.getUserContext();
|
UserContext userContext = DispatcherRequest.getUserContext();
|
||||||
@ -245,8 +237,6 @@ public class OutputWordUtil {
|
|||||||
DCContext dcContextModel = null;
|
DCContext dcContextModel = null;
|
||||||
List<UpfileModel> search = upFileDao.searchByRepositoryId(repositoryModel.getId(), "f");
|
List<UpfileModel> search = upFileDao.searchByRepositoryId(repositoryModel.getId(), "f");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//读取模型附件插入手册中文档对象
|
//读取模型附件插入手册中文档对象
|
||||||
if (search != null && search.size() > 0) {
|
if (search != null && search.size() > 0) {
|
||||||
|
|
||||||
@ -268,9 +258,7 @@ public class OutputWordUtil {
|
|||||||
tr4.getCharacterFormat().setFontSize(12);
|
tr4.getCharacterFormat().setFontSize(12);
|
||||||
paragraph4.applyStyle(BuiltinStyle.Body_Text); //应用标题1样式
|
paragraph4.applyStyle(BuiltinStyle.Body_Text); //应用标题1样式
|
||||||
|
|
||||||
|
|
||||||
long b1 = System.currentTimeMillis();
|
long b1 = System.currentTimeMillis();
|
||||||
|
|
||||||
for (UpfileModel upfileModel : search) {
|
for (UpfileModel upfileModel : search) {
|
||||||
DCPluginProfile dcProfile = DCProfileManager.getDCProfile(CoEConstant.APP_ID, CoeFileConstant.COE_UPFILE);
|
DCPluginProfile dcProfile = DCProfileManager.getDCProfile(CoEConstant.APP_ID, CoeFileConstant.COE_UPFILE);
|
||||||
if (dcProfile != null) {
|
if (dcProfile != null) {
|
||||||
@ -347,9 +335,7 @@ public class OutputWordUtil {
|
|||||||
paragraph5.appendText(dcContextModel.getFileName()+" ");
|
paragraph5.appendText(dcContextModel.getFileName()+" ");
|
||||||
paragraph5.appendOleObject(stream1, pic1, "txt");
|
paragraph5.appendOleObject(stream1, pic1, "txt");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
doc.saveToFile(outFile.getPath(), FileFormat.Docx_2013);
|
doc.saveToFile(outFile.getPath(), FileFormat.Docx_2013);
|
||||||
|
|||||||
@ -1269,8 +1269,8 @@ public class PALRepositoryQueryAPIManager {
|
|||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<PALRepositoryModel> getPalRepositoryModelsByTeamIdByDeptId(String wsId, String userId, String teamId, boolean isUsed, boolean isPublished,String departId) {
|
public List<PALRepositoryModel> getPalRepositoryModelsByTeamIdByDeptId(String wsId, String userId, String teamId, boolean isUsed, boolean isPublished) {
|
||||||
List<PALRepositoryModel> list = CoeProcessLevelUtil.getPermRepositoryListByDeptId(wsId, teamId, userId, null, null, isUsed, isPublished,departId);
|
List<PALRepositoryModel> list = CoeProcessLevelUtil.getPermRepositoryListByDeptId(wsId, teamId, userId, null, null, isUsed, isPublished);
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2153,7 +2153,7 @@ public class PALRepositoryQueryAPIManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public JSONArray getPermPalRepositoryTreeDataByMethodsByDeptId(UserContext context, String wsId, String teamId, String type, String methods,String departId) {
|
public JSONArray getPermPalRepositoryTreeDataByMethodsByDeptId(UserContext context, String wsId, String teamId, String type, String methods,String departId,boolean onlyPublish) {
|
||||||
JSONArray result = new JSONArray();
|
JSONArray result = new JSONArray();
|
||||||
|
|
||||||
List<PALRepositoryModel> list = null;
|
List<PALRepositoryModel> list = null;
|
||||||
@ -2164,7 +2164,7 @@ public class PALRepositoryQueryAPIManager {
|
|||||||
} else if ("isPublished".equals(type)) {
|
} else if ("isPublished".equals(type)) {
|
||||||
isPublished = true;
|
isPublished = true;
|
||||||
}
|
}
|
||||||
list = getPalRepositoryModelsByTeamIdByDeptId(wsId, context.getUID(), teamId, isUsed, isPublished,departId);
|
list = getPalRepositoryModelsByTeamIdByDeptId(wsId, context.getUID(), teamId, isUsed, isPublished);
|
||||||
if (list == null) {
|
if (list == null) {
|
||||||
list = new ArrayList<PALRepositoryModel>();
|
list = new ArrayList<PALRepositoryModel>();
|
||||||
}
|
}
|
||||||
@ -2180,6 +2180,26 @@ public class PALRepositoryQueryAPIManager {
|
|||||||
}
|
}
|
||||||
list = tempList;
|
list = tempList;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (onlyPublish){
|
||||||
|
List<PALRepositoryModel> modelList2 = new ArrayList<PALRepositoryModel>();
|
||||||
|
for (PALRepositoryModel repositoryModel : list) {
|
||||||
|
if ("process.framework".equals(repositoryModel.getMethodId()) || "default".equals(repositoryModel.getMethodId())){
|
||||||
|
// 判断文件夹及所有子级下是否存在已发布模型
|
||||||
|
List<PALRepositoryModel> children = new ArrayList<>();
|
||||||
|
getAllPublishedPalRepositoryModelsByPid(wsId, repositoryModel.getId(), children);
|
||||||
|
if (children.size() > 0){
|
||||||
|
modelList2.add(repositoryModel);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (repositoryModel.isPublish()){
|
||||||
|
modelList2.add(repositoryModel);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
list = modelList2;
|
||||||
|
}
|
||||||
|
|
||||||
Collections.sort(list, new Comparator1()); // 按级别排序
|
Collections.sort(list, new Comparator1()); // 按级别排序
|
||||||
List<PALRepositoryModel> newList = setNewPid(list);
|
List<PALRepositoryModel> newList = setNewPid(list);
|
||||||
|
|
||||||
|
|||||||
@ -1613,7 +1613,7 @@ public class CoeProcessLevelUtil {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public static List<PALRepositoryModel> getPermRepositoryListByDeptId(String wsId, String teamId, String userId, String category, String method, boolean isUse, boolean isPublish,String departId) {
|
public static List<PALRepositoryModel> getPermRepositoryListByDeptId(String wsId, String teamId, String userId, String category, String method, boolean isUse, boolean isPublish) {
|
||||||
List<PALRepositoryModel> result = new ArrayList<>();
|
List<PALRepositoryModel> result = new ArrayList<>();
|
||||||
Set<String> versionIds = getPermRepositoryVersionIds(wsId, teamId, userId, category, method);
|
Set<String> versionIds = getPermRepositoryVersionIds(wsId, teamId, userId, category, method);
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user