| | |
| | | import com.example.server.progressTrack.model.DjJdgzTrackRecord; |
| | | import com.example.server.teamGroup.service.SysTeamGroupClassService; |
| | | import com.example.server.user.service.UserService; |
| | | import com.example.server.utils.FileUtils; |
| | | import com.example.server.utils.ImportUtil; |
| | | import com.example.server.utils.TreeFieldUtils; |
| | | import com.example.server.utils.UUIDUtil; |
| | | import com.example.server.utils.*; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.apache.poi.hssf.usermodel.HSSFWorkbook; |
| | | import org.apache.poi.ss.usermodel.HorizontalAlignment; |
| | | import org.apache.poi.ss.usermodel.Row; |
| | | import org.apache.poi.ss.usermodel.Sheet; |
| | | import org.apache.poi.ss.usermodel.Workbook; |
| | | import org.apache.poi.ss.usermodel.*; |
| | | import org.apache.poi.xssf.usermodel.XSSFWorkbook; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | String trackLocationStr = ImportUtil.getCellValue(row, 5, pattern); |
| | | String currentStatusStr = ImportUtil.getCellValue(row, 6, pattern); |
| | | String hasDelayRiskStr = ImportUtil.getCellValue(row, 7, pattern); |
| | | String estimatedCompletionTimeStr = ImportUtil.getCellValue(row, 8, pattern); |
| | | Cell estimatedCompletionTimeStr = row.getCell(8); |
| | | //String estimatedCompletionTimeStr = ImportUtil.getCellValue(row, 8, pattern); |
| | | String problemStr = ImportUtil.getCellValue(row, 9, pattern); |
| | | String followupPlanStr = ImportUtil.getCellValue(row, 10, pattern); |
| | | String remarkStr = ImportUtil.getCellValue(row, 11, pattern); |
| | |
| | | data.setHasDelayRisk(hasDelayRiskMap.get(hasDelayRiskStr)); |
| | | } |
| | | |
| | | if (StringUtils.isNotBlank(estimatedCompletionTimeStr)) { |
| | | if (estimatedCompletionTimeStr.matches("[0-9/]+")) { |
| | | estimatedCompletionTimeStr = estimatedCompletionTimeStr.replace("/", "-"); |
| | | data.setEstimatedCompletionTime(estimatedCompletionTimeStr); |
| | | } else if (estimatedCompletionTimeStr.matches("[0-9.]+")) { |
| | | estimatedCompletionTimeStr = estimatedCompletionTimeStr.replace(".", "-"); |
| | | data.setEstimatedCompletionTime(estimatedCompletionTimeStr); |
| | | } else if (estimatedCompletionTimeStr.matches("[0-9-]+")) { |
| | | data.setEstimatedCompletionTime(estimatedCompletionTimeStr); |
| | | } else { |
| | | result = "第" + j + "行" + "第" + 1 + "个" + "预计完成时间日期格式不规范"; |
| | | if (estimatedCompletionTimeStr != null) { |
| | | try { |
| | | String date = ImportUtil.getDateStrFromCell(estimatedCompletionTimeStr); |
| | | |
| | | if (date == null) { |
| | | result = "第" + j + "行" + "预计完成时间不能为空"; |
| | | ImportUtil.updateErrMap(errMap, "预计完成时间不能为空", sheetName, row1); |
| | | isErr = true; |
| | | } else { |
| | | data.setEstimatedCompletionTime(date); |
| | | } |
| | | } catch (ExcelImportException e) { |
| | | result = "第" + j + "行" + "第" + 1 + "个" + "预计完成时间日期格式不正确"; |
| | | ImportUtil.updateErrMap(errMap, "预计完成时间日期格式不正确", sheetName, row1); |
| | | isErr = true; |
| | | } |
| | | } |