| | |
| | | } catch (Exception e) { |
| | | result.setAfterCheck("");//'' |
| | | } |
| | | //实验结果 |
| | | try { |
| | | JSONObject resValue = JSON.parseObject(JSON.toJSONString(jo.get("testResult"))); |
| | | if (resValue.get("v") != null) { |
| | | Object o = JSON.parseObject(JSON.toJSONString(resValue.get("v"))).get("v"); |
| | | result.setTestResult(o.equals("") ? null : (o.toString())); |
| | | } |
| | | } catch (Exception e) { |
| | | result.setTestResult("");//'' |
| | | } |
| | | //设备编号 |
| | | if (jo.get("equipValue") != null) { |
| | | JSONArray jsonArray2 = JSON.parseArray(JSON.toJSONString(jo.get("equipValue"))); |
| | |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public int verifyPlan(Integer sampleId, String laboratory, Integer type, String tell) throws IOException { |
| | | public int verifyPlan(Integer sampleId, String laboratory, Integer type, String tell) { |
| | | LocalDateTime now = LocalDateTime.now(); |
| | | Integer userId = getLook.selectPowerByMethodAndUserId(null).get("userId"); |
| | | List<InsUnPass> insUnPasses = new ArrayList<>(); |
| | |
| | | |
| | | } |
| | | } |
| | | insOrder.setState(4); |
| | | insOrderMapper.updateById(insOrder); |
| | | /*生成对应的检验报告*/ |
| | | List<InsReportDto1> insReportDto1s=insOrderUserMapper.selectInsReportDto1(insOrder.getId()); |
| | | createReport(insOrder.getId(),insReportDto1s); |
| | | break; |
| | | } |
| | | } |
| | |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public int verifyPlan2(Integer sampleId, String laboratory, Integer type, String tell) throws IOException { |
| | | public int verifyPlan2(Integer sampleId, String laboratory, Integer type, String tell) { |
| | | Integer userId = getLook.selectPowerByMethodAndUserId(null).get("userId"); |
| | | InsSample insSample = insSampleMapper.selectById(sampleId); |
| | | InsOrder insOrder = insOrderMapper.selectById(insSample.getInsOrderId()); |
| | |
| | | .set(InsOrderState::getVerifyUser, userId) |
| | | .set(InsOrderState::getNum, record.getNum() + 1)//次数加1 |
| | | .set(InsOrderState::getCreateTime, LocalDateTime.now())); |
| | | insOrder.setState(1); |
| | | break; |
| | | case 1: |
| | | //继续试验:该样品该站点任务结束(可以再次扫码检验); |
| | |
| | | .set(InsOrderState::getVerifyTell, tell) |
| | | .set(InsOrderState::getVerifyUser, userId)); |
| | | } |
| | | insOrder.setState(1); |
| | | break; |
| | | case 2: |
| | | //结束试验:此委托单停止试验(无法再次检验)。 |
| | |
| | | try{ |
| | | outInsOrderState(laboratory, sample.getSampleCode(), insOrder.getEntrustCode()); |
| | | }catch (Exception e){ |
| | | |
| | | } |
| | | } |
| | | insOrder.setState(4); |
| | | /*生成对应的检验报告*/ |
| | | List<InsReportDto1> insReportDto1s=insOrderUserMapper.selectInsReportDto1(insOrder.getId()); |
| | | createReport(insOrder.getId(),insReportDto1s); |
| | | break; |
| | | } |
| | | insOrderMapper.updateById(insOrder); |
| | | } |
| | | return 1; |
| | | } |
| | | |
| | | |
| | | /*生成对应的检验报告*/ |
| | | private void createReport(Integer orderId,List<InsReportDto1> insReportDto1s){ |
| | | for (InsReportDto1 insReportDto1 : insReportDto1s) { |
| | | if (ObjectUtils.isNotEmpty(insReportDto1.getInsReportDto2s())){ |
| | | wordUtils.generateReport(orderId, insReportDto1); |
| | | // try{ |
| | | // wordUtils.generateReport(orderId, insReportDto1); |
| | | // }catch (Exception e){ |
| | | // throw new ErrorException("报告格式生成有误,请联系管理员!"); |
| | | // } |
| | | } |
| | | } |
| | | } |
| | | |
| | | private void getTemplateThing |
| | |
| | | String str = ""; |
| | | int count = 0; |
| | | for (InsProduct product : insProducts) { |
| | | //辐射试验,温湿度试验,功率试验的检验项目,不需要去手动填写检验值,只需要上传表格文件就可以了,后台提交的时候校验跳过这个检验项目 |
| | | if (product.getInspectionItem().equals("辐射试验") || product.getInspectionItem().equals("温湿度试验") || product.getInspectionItem().equals("功率试验")) { |
| | | //温湿度试验,功率试验的检验项目,不需要去手动填写检验值,只需要上传表格文件就可以了,后台提交的时候校验跳过这个检验项目 |
| | | if ( product.getInspectionItem().equals("温湿度试验") || product.getInspectionItem().equals("功率试验")) { |
| | | product.setInsResult(3);//不判定 |
| | | insProductMapper.updateById(product); |
| | | continue; |