| | |
| | | List<InsProductResult2> result2s = new ArrayList<>(); |
| | | List<InsProductUser> insProductUsers = new ArrayList<>(); |
| | | for (InsProductResult2 insProductResult2 : insProductResultDtos.getInsProductResult2s()) { |
| | | InsProduct insProduct = new InsProduct(); |
| | | insProduct.setId(insProductResult2.getInsProductId());//项目id |
| | | InsProductResult2 result2 = new InsProductResult2(); |
| | | //要求值 |
| | | result2.setAsk(insProductResult2.getAsk()); |
| | | //次数 |
| | | result2.setNum(orderState.getNum()); |
| | | //关联项目id |
| | | result2.setInsProductId(insProductResult2.getInsProductId()); |
| | | //频率 |
| | | result2.setFrequency(insProductResultDtos.getFrequency()); |
| | |
| | | if (insProductResult2.getEquipName() != null) { |
| | | result2.setEquipName(insProductResult2.getEquipName()); |
| | | } |
| | | insProduct = insProductMapper.selectById(insProduct.getId()); |
| | | // InsProduct insProduct = insProductMapper.selectById(insProductResult2.getInsProductId()); |
| | | //值 |
| | | if (insProductResult2.getValue() != null) { |
| | | result2.setValue(insProductResult2.getValue()); |
| | |
| | | int ressult = 1; |
| | | String valueStr = insProductResult2.getValue(); |
| | | String regex = "[\u4e00-\u9fa5]"; |
| | | if (!insProduct.getAsk().contains(",")) { |
| | | if (insProduct.getAsk().equals("/") || Pattern.compile(regex).matcher(insProduct.getAsk()).find()) { |
| | | if (!insProductResult2.getAsk().contains(",")) { |
| | | if (insProductResult2.getAsk().equals("/") || Pattern.compile(regex).matcher(insProductResult2.getAsk()).find()) { |
| | | ressult = 3; //不判定 |
| | | } else if (!isValueValid(valueStr, new String[]{insProduct.getAsk()})) { |
| | | } else if (!isValueValid(valueStr, new String[]{insProductResult2.getAsk()})) { |
| | | ressult = 0; //不合格 |
| | | } |
| | | } else { |
| | | // 如果要求值是(2°≥20,7°≥25,12°≥25)这种情况 |
| | | String[] askParts = insProduct.getAsk().split(","); |
| | | String[] askParts = insProductResult2.getAsk().split(","); |
| | | String[] angles = insProductResult2.getAngle().split(","); |
| | | for (String s : askParts) { |
| | | String[] askSplit = s.split("°"); |
| | |
| | | result2.setCreateUser(userId); |
| | | result2.setUpdateUser(userId); |
| | | result2s.add(result2); |
| | | //insProductResult2Mapper.insert(result2); |
| | | //insProduct.setUpdateUser(userId); |
| | | //insProducts.add(insProduct); |
| | | //insProductMapper.updateById(insProduct); |
| | | insProductUsers.add(new InsProductUser(null, userId, LocalDateTime.now(), insProduct.getId())); |
| | | //insProductUserMapper.insert(new InsProductUser(null, userId, LocalDateTime.now(), insProduct.getId())); |
| | | insProductUsers.add(new InsProductUser(null, userId, LocalDateTime.now(), insProductResult2.getInsProductId())); |
| | | /*更新样品的检验状态*/ |
| | | insSample.setInsState(1); |
| | | Long l = insProductMapper.selectCount(Wrappers.<InsProduct>lambdaQuery() |
| | |
| | | .set(InsOrderState::getVerifyTell, tell) |
| | | .set(InsOrderState::getVerifyUser, userId)); |
| | | /*生成对应的检验报告*/ |
| | | List<InsReportDto1> insReportDto1s=insOrderUserMapper.selectInsReportDto1(insOrder.getId()); |
| | | List<InsReportDto1> insReportDto1s=insOrderUserMapper.selectInsReportDto1(insOrder.getId(),null); |
| | | createReport(insOrder.getId(),insReportDto1s); |
| | | break; |
| | | } |
| | |
| | | .set(InsOrderState::getVerifyUser, userId)); |
| | | } |
| | | /*生成对应的检验报告*/ |
| | | List<InsReportDto1> insReportDto1s=insOrderUserMapper.selectInsReportDto1(insOrder.getId()); |
| | | List<InsReportDto1> insReportDto1s=insOrderUserMapper.selectInsReportDto1(insOrder.getId(),sampleId); |
| | | createReport(insOrder.getId(),insReportDto1s); |
| | | break; |
| | | } |