Просмотр исходного кода

修改器件数据解析方式

sunyj 9 лет назад
Родитель
Сommit
f6c4eeff43

+ 6 - 6
search-console/src/main/java/com/uas/search/console/util/MergeComponentData.java

@@ -52,11 +52,11 @@ public class MergeComponentData {
 		if (!StringUtils.isEmpty(strs[5])) {
 			component.setOriginalQty(Double.valueOf(strs[5]));
 		}
-		component.setUuid(strs[6].substring(1, strs[6].length() - 1));
-		if (!StringUtils.isEmpty(strs[7])) {
-			component.setInactionStockQty(Double.valueOf(strs[7]));
+		if (!StringUtils.isEmpty(strs[6])) {
+			component.setInactionStockQty(Double.valueOf(strs[6]));
 		}
-		component.setKindid(Long.parseLong(strs[8]));
+		component.setKindid(Long.parseLong(strs[7]));
+		component.setUuid(strs[8].substring(1, strs[8].length() - 1));
 		return component;
 	}
 
@@ -98,7 +98,7 @@ public class MergeComponentData {
 			String propertyValueLine = null;
 			PropertyValueSimpleInfo propertyValue = null;
 			int dataCount = 0;
-			while (!StringUtils.isEmpty(componentLine = componentReader.readLine())) {
+			while ((componentLine = componentReader.readLine()) != null) {
 				dataCount++;
 				// 一个文件存放100000条数据,一旦超过,写入新的文件
 				if (dataCount > SINGLE_FILE_MAX_SIZE) {
@@ -121,7 +121,7 @@ public class MergeComponentData {
 					propertyValue.setComponentid(null);
 					properties.add(propertyValue);
 					// 读到文件最后一行
-					if (StringUtils.isEmpty(propertyValueLine = propertyValueReader.readLine())) {
+					if ((propertyValueLine = propertyValueReader.readLine()) == null) {
 						break;
 					}
 					propertyValue = parsePropertyValue(propertyValueLine);