|
@@ -457,13 +457,13 @@ public class CustomExcelImportUtil {
|
|
|
public static void main(String[] args) throws IOException, InvalidFormatException {
|
|
|
//String path = "C:\\Users\\cyz\\Downloads\\老版维保计划\\noperson";
|
|
|
//File dirFile = new File("C:\\Users\\cyz\\Downloads\\老版维保计划\\noperson");
|
|
|
- String[] files = {"C:\\Users\\cyz\\\\Downloads\\保养标准20210812160348862.xls"};
|
|
|
+ String[] files = {"C:\\Users\\cyz\\\\Downloads\\2021.8.27 保养初始时间导入 desma.xls"};
|
|
|
for(String fileStr:files){
|
|
|
System.out.println(fileStr);
|
|
|
InputStream inputstream = new FileInputStream(fileStr);
|
|
|
LocalDateTime now = LocalDateTime.now();
|
|
|
//List<SbInfoVO> list = importSbInfoList(inputstream);
|
|
|
- List<SbInfoVO> list = importListByUpdateALl(inputstream);
|
|
|
+ List<CheckStandard> list = importCheckStandardListByUpdate(inputstream);
|
|
|
list.forEach(item -> {
|
|
|
System.out.println(item.toString());
|
|
|
});
|
|
@@ -1028,13 +1028,13 @@ public class CustomExcelImportUtil {
|
|
|
}
|
|
|
try {
|
|
|
record.setId(row.getCell(0).getStringCellValue().trim());
|
|
|
- record.setName(row.getCell(3).getStringCellValue().trim());
|
|
|
- record.setNo(row.getCell(4).getStringCellValue().trim());
|
|
|
- record.setRequirement(row.getCell(5).getStringCellValue().trim());
|
|
|
- record.setRemark(row.getCell(6).getStringCellValue().trim());
|
|
|
- String period = row.getCell(7).getStringCellValue();
|
|
|
+ record.setName(row.getCell(5).getStringCellValue().trim());
|
|
|
+ record.setNo(row.getCell(6).getStringCellValue().trim());
|
|
|
+ record.setRequirement(row.getCell(7).getStringCellValue().trim());
|
|
|
+ record.setRemark(row.getCell(8).getStringCellValue().trim());
|
|
|
+ String period = row.getCell(9).getStringCellValue();
|
|
|
record.setPeriod(Double.valueOf(period).intValue());
|
|
|
- String periodType = row.getCell(8).getStringCellValue();
|
|
|
+ String periodType = row.getCell(10).getStringCellValue();
|
|
|
if(periodType.equals("天")){
|
|
|
record.setPeriodType(CheckPlanPeriodTypeEnum.DAY.getValue());
|
|
|
}else if(periodType.equals("周")){
|
|
@@ -1050,8 +1050,8 @@ public class CustomExcelImportUtil {
|
|
|
}else if(periodType.equals("台时")){
|
|
|
record.setPeriodType(CheckPlanPeriodTypeEnum.TAISHI.getValue());
|
|
|
}
|
|
|
- String lastDate = row.getCell(9).getStringCellValue().trim();
|
|
|
- String nextDate = row.getCell(10).getStringCellValue().trim();
|
|
|
+ String lastDate = row.getCell(11).getStringCellValue().trim();
|
|
|
+ String nextDate = row.getCell(12).getStringCellValue().trim();
|
|
|
if(StringUtils.isNotBlank(lastDate)){
|
|
|
record.setLastDate(DateUtils.strToLocalDate(lastDate, DateUtils.PATTERN_YMD));
|
|
|
}
|
|
@@ -1066,7 +1066,13 @@ public class CustomExcelImportUtil {
|
|
|
record.setCheckUserType(CheckUserTypeEnum.USE_USER.getValue());
|
|
|
}
|
|
|
}else{
|
|
|
- record.setCheckUserType(Integer.valueOf(checkUserType));
|
|
|
+ if(checkUserType.equals("使用人")){
|
|
|
+ record.setCheckUserType(CheckPlanUserTypeEnum.USE_USER.getValue());
|
|
|
+ }else if(checkUserType.equals("维修人")){
|
|
|
+ record.setCheckUserType(CheckUserTypeEnum.REPAIR_USER.getValue());
|
|
|
+ }else{
|
|
|
+ record.setCheckUserType(CheckUserTypeEnum.ZHIDING.getValue());
|
|
|
+ }
|
|
|
}
|
|
|
} catch (Exception e) {
|
|
|
throw new BusinessException("导入异常,行号:"+ i + ", 错误信息" + e.getMessage() + ", 错误原因" + e.getCause());
|