Pārlūkot izejas kodu

求解日志问题

huangxingxing 1 mēnesi atpakaļ
vecāks
revīzija
a620265f8a

+ 7 - 2
src/main/java/com/miniframe/bisiness/system/D000015Service.java

@@ -1,5 +1,6 @@
 package com.miniframe.bisiness.system;
 
+import java.io.FileNotFoundException;
 import java.nio.file.Path;
 import java.nio.file.Paths;
 import java.util.Map;
@@ -34,8 +35,12 @@ public class D000015Service extends D000015BaseModel implements ExecProcessFlow
 		String outPath= TemplateGenerator.BPATH+"/"+aid+"/"+accident.getJid()+"/"+accident.getStype().toLowerCase();
 		String fileName ="log.txt";
 
-		String logs =XIFileUtils.readFileAsString(outPath+"/"+fileName);
-		this.getD_d000015().setLogs(logs);
+		try{
+			String logs =XIFileUtils.readFileAsString(outPath+"/"+fileName);
+			this.getD_d000015().setLogs(logs);
+		}catch (FileNotFoundException e){
+			this.getD_d000015().setLogs("");
+		}
 //		Path path = Paths.get(outPath+"/"+fileName);
 //		String mimeType = MFMimeTypeUtils.getMimeType(path);
 //		HttpServerTransFile transFile = new HttpServerTransFile(fileName, mimeType, path);

+ 1 - 1
src/main/java/com/miniframe/template/TemplateGenerator2.java

@@ -646,7 +646,7 @@ public class TemplateGenerator2 {
         dataModel.put("personnum", pcodes.size());
         List<DPersonVo> personVos = new ArrayList<>();
         //TODO 目前不支持多个用户
-        for (int i = 0; i < 1 ; i++) {
+        for (int i = 0; i < pcodes.size() ; i++) {
             DPersonVo personVo =new DPersonVo();
             personVo.setNum(i);
             personVo.setPcode(pcodes.get(i));