Commit 6fab7ef5 authored by jichao's avatar jichao

上传参数模板,当没有参数code时,不保存

parent c72c009d
...@@ -132,6 +132,10 @@ public class ParamLibraryServiceImpl implements ParamLibraryService { ...@@ -132,6 +132,10 @@ public class ParamLibraryServiceImpl implements ParamLibraryService {
String code1 = this.getCode(sheet, 3), String code1 = this.getCode(sheet, 3),
code2 = this.getCode(sheet, 4), code2 = this.getCode(sheet, 4),
code3 = this.getCode(sheet, 5); code3 = this.getCode(sheet, 5);
//如果code1、2、3都没有值,表示没有添加参数模板
if (code1 == null && code2 == null && code3 == null) {
} else {
//读取需要保存的数据 //读取需要保存的数据
for (int i = 8; i < sheet.getLastRowNum() + 1; i++) { for (int i = 8; i < sheet.getLastRowNum() + 1; i++) {
BusParamLibrary b = new BusParamLibrary(); BusParamLibrary b = new BusParamLibrary();
...@@ -168,6 +172,7 @@ public class ParamLibraryServiceImpl implements ParamLibraryService { ...@@ -168,6 +172,7 @@ public class ParamLibraryServiceImpl implements ParamLibraryService {
//添加 //添加
result = paramLibraryRepository.saveBusParamLibraryList(resultList); result = paramLibraryRepository.saveBusParamLibraryList(resultList);
} }
}
} catch (IOException e) { } catch (IOException e) {
e.printStackTrace(); e.printStackTrace();
} finally { } finally {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment