| | |
| | | map.put("head", PrintChina.printChina(InsOrderPlanVO.class)); |
| | | Map<String, Integer> map1 = getLook.selectPowerByMethodAndUserId(null); |
| | | String laboratory = null; |
| | | String userName = null; |
| | | String myName = null; |
| | | if (ObjectUtil.isNotEmpty(insOrderPlanDTO.getUserId())) { |
| | | userName = userMapper.selectById(map1.get("userId")).getName(); |
| | | myName = userMapper.selectById(map1.get("userId")).getName(); |
| | | insOrderPlanDTO.setUserId(null); |
| | | } |
| | | //检验人 |
| | | if (ObjectUtil.isNotEmpty(insOrderPlanDTO.getUserName())){ |
| | | myName=(ObjectUtils.isNotNull(myName)?myName+",":"")+insOrderPlanDTO.getUserName(); |
| | | insOrderPlanDTO.setUserName(null); |
| | | } |
| | | String sonLaboratory = insOrderPlanDTO.getSonLaboratory();//试验室 |
| | | insOrderPlanDTO.setSonLaboratory(null); |
| | | String sampleCode = insOrderPlanDTO.getSampleCode(); |
| | | insOrderPlanDTO.setSampleCode(null); |
| | | IPage<InsOrderPlanVO> insOrderPage = insSampleMapper.findInsSampleAndOrder(page, QueryWrappers.queryWrappers(insOrderPlanDTO), userName, sonLaboratory, laboratory,sampleCode); |
| | | IPage<InsOrderPlanVO> insOrderPage = insSampleMapper.findInsSampleAndOrder(page, QueryWrappers.queryWrappers(insOrderPlanDTO), myName, sonLaboratory, laboratory,sampleCode); |
| | | map.put("body", insOrderPage); |
| | | return map; |
| | | } |
| | |
| | | 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() |
| | |
| | | saveInsContext2(insProductResultDto); |
| | | } |
| | | return 1; |
| | | } |
| | | |
| | | //样品编号更改 |
| | | @Override |
| | | public int changeSampleCode(Integer sampleId, String sampleCode) { |
| | | InsSample insSample = new InsSample(); |
| | | insSample.setId(sampleId); |
| | | insSample.setSampleCode(sampleCode); |
| | | return insSampleMapper.updateById(insSample); |
| | | } |
| | | |
| | | /** |
| | |
| | | if (ObjectUtils.isEmpty(s)) { |
| | | continue; |
| | | } |
| | | double numericValue = Math.abs(Double.parseDouble(s)); |
| | | double numericValue = Double.parseDouble(s); |
| | | boolean valid = Arrays.stream(valuesToCheck) |
| | | .allMatch(v -> getResult(numericValue, v)); |
| | | if (!valid) { |
| | |
| | | .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; |
| | | } |