|
@@ -460,9 +460,10 @@ public class CustomExcelImportUtil {
|
|
}
|
|
}
|
|
|
|
|
|
public static void main(String[] args) throws IOException, InvalidFormatException {
|
|
public static void main(String[] args) throws IOException, InvalidFormatException {
|
|
- String[] files = {"C:\\Users\\cyz\\Downloads\\维护计划和机台信息\\C-006 (OS-M240).xls",
|
|
|
|
- "C:\\Users\\cyz\\Downloads\\维护计划和机台信息\\C-001 (OS-M235)-多列模板.xls"};
|
|
|
|
- InputStream inputstream = new FileInputStream(files[1]);
|
|
|
|
|
|
+ String[] files = {"C:\\Users\\cyz\\Downloads\\---C-020 (S-35).xls",
|
|
|
|
+ "C:\\Users\\cyz\\Downloads\\--C-025 (S-40).xls",
|
|
|
|
+ "C:\\Users\\cyz\\Downloads\\---C-021 (S-36).xls"};
|
|
|
|
+ InputStream inputstream = new FileInputStream(files[2]);
|
|
LocalDateTime now = LocalDateTime.now();
|
|
LocalDateTime now = LocalDateTime.now();
|
|
// List<SparePartInfoVO> list = importSparePartInfoList(now, inputstream);
|
|
// List<SparePartInfoVO> list = importSparePartInfoList(now, inputstream);
|
|
// List<SbInfoVO> list = importListByUpdateALl(inputstream);
|
|
// List<SbInfoVO> list = importListByUpdateALl(inputstream);
|
|
@@ -978,7 +979,6 @@ public class CustomExcelImportUtil {
|
|
if(isRowEmpty(row)){
|
|
if(isRowEmpty(row)){
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
- String index = row.getCell(1).getStringCellValue() + "";
|
|
|
|
try {
|
|
try {
|
|
if(type == 0){
|
|
if(type == 0){
|
|
setNoPerson(sbNo, row, record);
|
|
setNoPerson(sbNo, row, record);
|
|
@@ -1043,35 +1043,42 @@ public class CustomExcelImportUtil {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
private static void setNoRemark(Row row, CheckStandard record) {
|
|
private static void setNoRemark(Row row, CheckStandard record) {
|
|
- if(StringUtils.isNotEmpty(row.getCell(0).getStringCellValue()) || StringUtils.isNotEmpty(row.getCell(1).getStringCellValue()) ){
|
|
|
|
|
|
+ if(row.getCell(0) != null && StringUtils.isNotEmpty(row.getCell(0).getStringCellValue())){
|
|
record.setCheckUserType(1);
|
|
record.setCheckUserType(1);
|
|
record.setRemark("车间");
|
|
record.setRemark("车间");
|
|
- }else{
|
|
|
|
- record.setCheckUserType(2);
|
|
|
|
- record.setRemark("维修");
|
|
|
|
|
|
+ return;
|
|
}
|
|
}
|
|
|
|
+ if(row.getCell(1) != null && StringUtils.isNotEmpty(row.getCell(1).getStringCellValue())){
|
|
|
|
+ record.setCheckUserType(1);
|
|
|
|
+ record.setRemark("车间");
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ record.setCheckUserType(2);
|
|
|
|
+ record.setRemark("维修");
|
|
|
|
+
|
|
}
|
|
}
|
|
|
|
|
|
private static void setPeriod(Row row, CheckStandard record) {
|
|
private static void setPeriod(Row row, CheckStandard record) {
|
|
- if(StringUtils.isNotBlank(row.getCell(0).getStringCellValue())){
|
|
|
|
|
|
+ if(row.getCell(0) !=null && StringUtils.isNotBlank(row.getCell(0).getStringCellValue())){
|
|
record.setPeriod(1);
|
|
record.setPeriod(1);
|
|
record.setPeriodType(1);
|
|
record.setPeriodType(1);
|
|
- }else if(StringUtils.isNotBlank(row.getCell(1).getStringCellValue())){
|
|
|
|
|
|
+ }else if(row.getCell(1) !=null && StringUtils.isNotBlank(row.getCell(1).getStringCellValue())){
|
|
record.setPeriod(1);
|
|
record.setPeriod(1);
|
|
record.setPeriodType(2);
|
|
record.setPeriodType(2);
|
|
- }else if(StringUtils.isNotBlank(row.getCell(2).getStringCellValue())){
|
|
|
|
|
|
+ }else if(row.getCell(2) !=null && StringUtils.isNotBlank(row.getCell(2).getStringCellValue())){
|
|
record.setPeriod(1);
|
|
record.setPeriod(1);
|
|
record.setPeriodType(3);
|
|
record.setPeriodType(3);
|
|
- }else if(StringUtils.isNotBlank(row.getCell(3).getStringCellValue())){
|
|
|
|
|
|
+ }else if(row.getCell(3) !=null && StringUtils.isNotBlank(row.getCell(3).getStringCellValue())){
|
|
record.setPeriod(1);
|
|
record.setPeriod(1);
|
|
record.setPeriodType(4);
|
|
record.setPeriodType(4);
|
|
- }else if(StringUtils.isNotBlank(row.getCell(4).getStringCellValue())){
|
|
|
|
|
|
+ }else if(row.getCell(4) !=null && StringUtils.isNotBlank(row.getCell(4).getStringCellValue())){
|
|
record.setPeriod(2);
|
|
record.setPeriod(2);
|
|
record.setPeriodType(4);
|
|
record.setPeriodType(4);
|
|
- }else if(StringUtils.isNotBlank(row.getCell(5).getStringCellValue())){
|
|
|
|
|
|
+ }else if(row.getCell(5) !=null && StringUtils.isNotBlank(row.getCell(5).getStringCellValue())){
|
|
record.setPeriod(1);
|
|
record.setPeriod(1);
|
|
record.setPeriodType(5);
|
|
record.setPeriodType(5);
|
|
- }else if(StringUtils.isNotBlank(row.getCell(6).getStringCellValue())){
|
|
|
|
|
|
+ }else if(row.getCell(6) !=null && StringUtils.isNotBlank(row.getCell(6).getStringCellValue())){
|
|
record.setPeriod(3);
|
|
record.setPeriod(3);
|
|
record.setPeriodType(5);
|
|
record.setPeriodType(5);
|
|
}else{
|
|
}else{
|