| | |
| | | Sheet sheet = workbook.getSheetAt(0); |
| | | List<ECR> ecrList = new LinkedList<>(); |
| | | ECR ecr = new ECR(); |
| | | String numberCellValue = sheet.getRow(1).getCell(5).getStringCellValue(); |
| | | String number = numberCellValue.substring(numberCellValue.indexOf("BG")); |
| | | Cell numberCell = sheet.getRow(1).getCell(5); |
| | | if(numberCell == null || !numberCell.getStringCellValue().contains("ECR编号")){ |
| | | return new Response().set(1,false,"ECR编号不能为空或单元格格式不规范!"); |
| | | } |
| | | String numberCellValue = numberCell.getStringCellValue(); |
| | | String number = numberCellValue.substring(6).trim(); |
| | | if(number.equals("")){ |
| | | return new Response().set(1,false,"ECR编号不能为空!"); |
| | | } |
| | | |
| | | Cell codeCell = sheet.getRow(2).getCell(0); |
| | | if(codeCell == null){ |
| | | return new Response().set(1,false,"变更料号不能为空!"); |
| | | if(codeCell == null || !codeCell.getStringCellValue().contains("变更料号")){ |
| | | return new Response().set(1,false,"变更料号不能为空或单元格格式不规范!"); |
| | | } |
| | | String codeCellValue = codeCell.getStringCellValue(); |
| | | //变更料号:xxx |
| | |
| | | } |
| | | |
| | | Cell modelCell = sheet.getRow(2).getCell(5); |
| | | if(modelCell == null){ |
| | | return new Response().set(1,false,"变更型号不能为空!"); |
| | | if(modelCell == null || !modelCell.getStringCellValue().contains("变更名称/型号")){ |
| | | return new Response().set(1,false,"变更型号不能为空或单元格格式不规范!"); |
| | | } |
| | | String modelCellValue = modelCell.getStringCellValue(); |
| | | //变更名称/型号:xxx |
| | |
| | | modelSplit = modelStr.split("/"); |
| | | } |
| | | |
| | | String proposeDateCellValue = sheet.getRow(2).getCell(14).getStringCellValue(); |
| | | Cell proposeDateCell = sheet.getRow(2).getCell(14); |
| | | if(proposeDateCell == null || !proposeDateCell.getStringCellValue().contains("申请日期")){ |
| | | return new Response().set(1,false,"申请日期不能为空或单元格格式不规范!"); |
| | | } |
| | | String proposeDateCellValue = proposeDateCell.getStringCellValue(); |
| | | //申请日期:xxx |
| | | String proposeDateStr = proposeDateCellValue.substring(5).trim(); |
| | | if(proposeDateStr.equals("")){ |
| | | return new Response().set(1,false,"申请日期不能为空!"); |
| | | } |
| | | Date proposeDate = DateUtil.YYYY_MM_DD_UNION.parse(proposeDateStr); |
| | | |
| | | String proposerCellValue = sheet.getRow(2).getCell(22).getStringCellValue(); |
| | | Cell proposerCell = sheet.getRow(2).getCell(22); |
| | | if(proposerCell == null || !proposerCell.getStringCellValue().contains("申请人")){ |
| | | return new Response().set(1,false,"申请人不能为空或单元格格式不规范!"); |
| | | } |
| | | String proposerCellValue = proposerCell.getStringCellValue(); |
| | | //申请人:xxx |
| | | String proposer = proposerCellValue.substring(4).trim(); |
| | | if(proposer.equals("")){ |
| | | return new Response().set(1,false,"申请人不能为空!"); |
| | | } |
| | | |
| | | String parentModel = sheet.getRow(3).getCell(0).getStringCellValue().substring(10).trim(); |
| | | Cell parentModelCell = sheet.getRow(3).getCell(0); |
| | | if(parentModelCell == null || !parentModelCell.getStringCellValue().contains("变更所属机型/系列")){ |
| | | return new Response().set(1,false,"物料所属型号不能为空或单元格格式不规范!"); |
| | | } |
| | | String parentModel = parentModelCell.getStringCellValue().substring(10).trim(); |
| | | if(parentModel.equals("")){ |
| | | return new Response().set(1,false,"物料所属型号不能为空!"); |
| | | } |
| | | |
| | | String changeDescriptionCellValue = sheet.getRow(4).getCell(0).getStringCellValue(); |
| | | Cell changeDescriptionCell = sheet.getRow(4).getCell(0); |
| | | if(changeDescriptionCell == null || changeDescriptionCell.getStringCellValue().trim().equals("")){ |
| | | return new Response().set(1,false,"变更描述不能为空!"); |
| | | } |
| | | String changeDescriptionCellValue = changeDescriptionCell.getStringCellValue(); |
| | | |
| | | //申请变更归类:index从16-22,被选中的标识为■D.品质改善 |
| | | StringBuilder changeTypeBuilder = new StringBuilder(); |
| | |
| | | if(solutionCellValue.contains("■")){ |
| | | String solutionStr = solutionCellValue.split("■")[1]; |
| | | solution = solutionStr.split("\\.")[1]; |
| | | }else{ |
| | | return new Response().set(1,false,"处理方式必须选中一项!"); |
| | | } |
| | | |
| | | //先将共同属性赋值给基础对象 |