ソースを参照

日志文件读取

huangxingxing 1 年間 前
コミット
c1924e5c3f

+ 1 - 0
definitionsrc/returncode/returncode-business.properties

@@ -75,3 +75,4 @@ EB3100010 = \u5B58\u5728\u76F8\u540C\u7684\u7269\u7406\u5C5E\u6027\uFF01
 EB3100011 = \u7269\u7406\u5C5E\u6027\u4E0D\u5B58\u5728\uFF01
 EB3100012 = \u4EFB\u52A1\u4E0D\u5B58\u5728\uFF01
 EB3100013 = \u7269\u7406\u5C5E\u6027\u4FE1\u606F\u7F3A\u5931\uFF01
+EB3100014 = \u7ED3\u679C\u6587\u4EF6\u4E0D\u5B58\u5728\uFF01

+ 1 - 0
definitionsrc/returncode/returncode-business_zh_CN.properties

@@ -75,3 +75,4 @@ EB3100010 = \u5B58\u5728\u76F8\u540C\u7684\u7269\u7406\u5C5E\u6027\uFF01
 EB3100011 = \u7269\u7406\u5C5E\u6027\u4E0D\u5B58\u5728\uFF01
 EB3100012 = \u4EFB\u52A1\u4E0D\u5B58\u5728\uFF01
 EB3100013 = \u7269\u7406\u5C5E\u6027\u4FE1\u606F\u7F3A\u5931\uFF01
+EB3100014 = \u7ED3\u679C\u6587\u4EF6\u4E0D\u5B58\u5728\uFF01

+ 34 - 28
src/main/java/com/miniframe/bisiness/system/D10016Service.java

@@ -8,6 +8,7 @@ import java.util.ArrayList;
 import java.util.List;
 import java.util.Map;
 import com.miniframe.core.ExecProcessFlow;
+import com.miniframe.core.exception.BusinessException;
 import com.miniframe.core.ext.UtilTools;
 import com.miniframe.generate.business.system.model.D10016BaseModel;
 import com.miniframe.generate.comm.system.D_D10016_CHVALS_RECODE;
@@ -48,37 +49,42 @@ public class D10016Service extends D10016BaseModel implements ExecProcessFlow {
 		}
 
 //		Path path = Paths.get(outPath+"/"+fileName);
-		FileReader fileReader = new FileReader(outPath+"/"+fileName);
-		BufferedReader reader = new BufferedReader(fileReader);
-		String line;
-		int linNum =1;
-		List<D_D10016_COCODES_RECODE> coodeList= new ArrayList<>();
-		List<D_D10016_CHVALS_RECODE> chvalsList= new ArrayList<>();
-		while ((line = reader.readLine()) != null) {
-			String[] t = line.trim().split(",");
-			if(linNum==1){
-				for (int i=1;i<t.length;i++) {
-					D_D10016_COCODES_RECODE cocode =new D_D10016_COCODES_RECODE();
-					cocode.setCocode(t[i]);
-					coodeList.add(cocode);
+		try{
+			FileReader fileReader = new FileReader(outPath+"/"+fileName);
+			BufferedReader reader = new BufferedReader(fileReader);
+			String line;
+			int linNum =1;
+			List<D_D10016_COCODES_RECODE> coodeList= new ArrayList<>();
+			List<D_D10016_CHVALS_RECODE> chvalsList= new ArrayList<>();
+			while ((line = reader.readLine()) != null) {
+				String[] t = line.trim().split(",");
+				if(linNum==1){
+					for (int i=1;i<t.length;i++) {
+						D_D10016_COCODES_RECODE cocode =new D_D10016_COCODES_RECODE();
+						cocode.setCocode(t[i]);
+						coodeList.add(cocode);
+					}
+				}else {
+					D_D10016_CHVALS_RECODE chval=new D_D10016_CHVALS_RECODE();
+					chval.setChcode(t.length>0?t[0]:"0");
+					chval.setV1(t.length>1?t[1]:"0");
+					chval.setV2(t.length>2?t[2]:"0");
+					chval.setV3(t.length>3?t[3]:"0");
+					chval.setV4(t.length>4?t[4]:"0");
+					chval.setV5(t.length>5?t[5]:"0");
+					chval.setV6(t.length>6?t[6]:"0");
+					chvalsList.add(chval);
 				}
-			}else {
-				D_D10016_CHVALS_RECODE chval=new D_D10016_CHVALS_RECODE();
-				chval.setChcode(t.length>0?t[0]:"0");
-				chval.setV1(t.length>1?t[1]:"0");
-				chval.setV2(t.length>2?t[2]:"0");
-				chval.setV3(t.length>3?t[3]:"0");
-				chval.setV4(t.length>4?t[4]:"0");
-				chval.setV5(t.length>5?t[5]:"0");
-				chval.setV6(t.length>6?t[6]:"0");
-				chvalsList.add(chval);
+				linNum++;
 			}
-			linNum++;
+			fileReader.close();
+			reader.close();
+			this.getD_d10016().setChvals(chvalsList);
+			this.getD_d10016().setCocodes(coodeList);
+		}catch (Exception e){
+			System.out.println(e);
+			throw  new BusinessException("EB3100014");
 		}
-		fileReader.close();
-		reader.close();
-		this.getD_d10016().setChvals(chvalsList);
-		this.getD_d10016().setCocodes(coodeList);
 
 //		XIFileUtils.readFileAsString(outPath+"/"+fileName);
 //		String mimeType = MFMimeTypeUtils.getMimeType(path);

+ 2 - 1
系统设计/数据定义/返 回 码/business(业务系统).csv

@@ -83,4 +83,5 @@
 3100010,EB3100010,存在相同的物理属性!,
 3100011,EB3100011,物理属性不存在!,
 3100012,EB3100012,任务不存在!,
-3100013,EB3100013,物理属性信息缺失!,
+3100013,EB3100013,物理属性信息缺失!,
+3100014,EB3100014,结果文件不存在!,