diff --git a/com.awspaas.user.apps.coe.pal.output.zd/lib/com.awspaas.user.apps.coe.pal.output.zd.jar b/com.awspaas.user.apps.coe.pal.output.zd/lib/com.awspaas.user.apps.coe.pal.output.zd.jar index 31a1c465..369f765a 100644 Binary files a/com.awspaas.user.apps.coe.pal.output.zd/lib/com.awspaas.user.apps.coe.pal.output.zd.jar and b/com.awspaas.user.apps.coe.pal.output.zd/lib/com.awspaas.user.apps.coe.pal.output.zd.jar differ diff --git a/com.awspaas.user.apps.coe.pal.output.zd/src/com/awspaas/apps/coe/pal/output/zd/report1/Report1Gener.java b/com.awspaas.user.apps.coe.pal.output.zd/src/com/awspaas/apps/coe/pal/output/zd/report1/Report1Gener.java index 8258cfaa..f933ba8d 100644 --- a/com.awspaas.user.apps.coe.pal.output.zd/src/com/awspaas/apps/coe/pal/output/zd/report1/Report1Gener.java +++ b/com.awspaas.user.apps.coe.pal.output.zd/src/com/awspaas/apps/coe/pal/output/zd/report1/Report1Gener.java @@ -256,78 +256,89 @@ public class Report1Gener { if(HighSecurityUtil.isON()){ PALRepositoryQueryAPIManager.getInstance().upFileSecurityFilter(this.userContext,search); } + boolean isFile=false; if (search != null && search.size() > 0) { - //创建附件目录及复制附件 - fileName = fileName + "_file"; - file = new File(docPath, fileName); - if (!file.exists()) { - log.info("创建附件"); - file.mkdir(); + + for (UpfileModel oneupfileModel : search) { + if ("f".equals(oneupfileModel.getType())) {// 文件 + isFile=true; + //创建附件目录及复制附件 + fileName = fileName + "_file"; + file = new File(docPath, fileName); + if (!file.exists()) { + log.info("创建附件"); + file.mkdir(); + } + break; + } } + } - JSONArray fileTable = new JSONArray(); //流程附件Table - //文件属性附件处理 - int fileIndex = 1; - ArrayList isNumberAscArray = new ArrayList(); - if (search != null && search.size() > 0) { - // 复制附件 - for (UpfileModel upfileModel : search) { - if (!"f".equals(upfileModel.getType())) {// 文件 - continue; - } - // 复制doccenter下的文件 - DCContext dcContext = null; - DCPluginProfile dcProfile = DCProfileManager.getDCProfile(CoEConstant.APP_ID, CoeFileConstant.COE_UPFILE); - if (dcProfile != null) { - dcContext = new DCContext(userContext, dcProfile, CoEConstant.APP_ID, "file", upfileModel.getPl_uuid(), upfileModel.getFileName()); - } - File sourceFile = new UtilFile(dcContext.getFilePath()); - File targetFile = new UtilFile(file.toString() + File.separator + dcContext.getFileName()); - try { - UtilFile.copyFile(sourceFile, targetFile); - } catch (Exception e) { - System.out.println(e); - e.printStackTrace(); - } - JSONObject object = new JSONObject(); - //按照附件编号排序 - String fileNamel= upfileModel.getFileName(); - if(UtilString.isNotEmpty(fileNamel)&&fileNamel.contains("附件")&&fileNamel.length()>2&&(fileNamel.contains(":")||fileNamel.contains(":"))) { - if(fileNamel.indexOf("附件")==0) { - int indexOf2 = 3; - if(fileNamel.contains(":")) { - indexOf2 = fileNamel.indexOf(":"); - }else if(fileNamel.contains(":")) { - indexOf2 = fileNamel.indexOf(":"); + if(isFile){ + JSONArray fileTable = new JSONArray(); //流程附件Table + //文件属性附件处理 + int fileIndex = 1; + ArrayList isNumberAscArray = new ArrayList(); + if (search != null && search.size() > 0) { + // 复制附件 + for (UpfileModel upfileModel : search) { + if (!"f".equals(upfileModel.getType())) {// 文件 + continue; } - String numberStr = fileNamel.substring(2,indexOf2); - if(isNumeric(numberStr)&&UtilString.isNotEmpty(numberStr)) { - isNumberAscArray.add("true"); - int fileNumber = Integer.parseInt(numberStr); - object.put("file_number", fileNumber); + // 复制doccenter下的文件 + DCContext dcContext = null; + DCPluginProfile dcProfile = DCProfileManager.getDCProfile(CoEConstant.APP_ID, CoeFileConstant.COE_UPFILE); + if (dcProfile != null) { + dcContext = new DCContext(userContext, dcProfile, CoEConstant.APP_ID, "file", upfileModel.getPl_uuid(), upfileModel.getFileName()); + } + File sourceFile = new UtilFile(dcContext.getFilePath()); + File targetFile = new UtilFile(file.toString() + File.separator + dcContext.getFileName()); + try { + UtilFile.copyFile(sourceFile, targetFile); + } catch (Exception e) { + System.out.println(e); + e.printStackTrace(); + } + JSONObject object = new JSONObject(); + //按照附件编号排序 + String fileNamel= upfileModel.getFileName(); + if(UtilString.isNotEmpty(fileNamel)&&fileNamel.contains("附件")&&fileNamel.length()>2&&(fileNamel.contains(":")||fileNamel.contains(":"))) { + if(fileNamel.indexOf("附件")==0) { + int indexOf2 = 3; + if(fileNamel.contains(":")) { + indexOf2 = fileNamel.indexOf(":"); + }else if(fileNamel.contains(":")) { + indexOf2 = fileNamel.indexOf(":"); + } + String numberStr = fileNamel.substring(2,indexOf2); + if(isNumeric(numberStr)&&UtilString.isNotEmpty(numberStr)) { + isNumberAscArray.add("true"); + int fileNumber = Integer.parseInt(numberStr); + object.put("file_number", fileNumber); + }else { + isNumberAscArray.add("false"); + } + } + }else { isNumberAscArray.add("false"); } + String file_name; + if(upfileModel.getFileName().contains("--")){ + file_name=upfileModel.getFileName().replaceAll("--+|---", "-"); + }else{ + file_name=upfileModel.getFileName(); + } + object.put("file_name", file_name); + object.put("file_name", file_name); + String link = fileName + File.separator + upfileModel.getFileName(); + object.put("link", link); + fileTable.add(object); + fileIndex++; } - - }else { - isNumberAscArray.add("false"); } - String file_name; - if(upfileModel.getFileName().contains("--")){ - file_name=upfileModel.getFileName().replaceAll("--+|---", "-"); - }else{ - file_name=upfileModel.getFileName(); - } - object.put("file_name", file_name); - object.put("file_name", file_name); - String link = fileName + File.separator + upfileModel.getFileName(); - object.put("link", link); - fileTable.add(object); - fileIndex++; } - } return dataMap; }