| | |
| | | InsSample insSample = insSampleMapper.selectOne(Wrappers.<InsSample>lambdaQuery() |
| | | .eq(InsSample::getSampleCode, sampleCode) |
| | | .eq(InsSample::getInsOrderId, insOrders.get(0).getId())); |
| | | List<String> collect = insProductMapper.selectList(Wrappers.<InsProduct>lambdaQuery() |
| | | List<InsProduct> insProducts = insProductMapper.selectList(Wrappers.<InsProduct>lambdaQuery() |
| | | .eq(InsProduct::getState, 1) |
| | | .eq(InsProduct::getInsSampleId, insSample.getId())).stream().map(InsProduct::getSonLaboratory).collect(Collectors.toList()); |
| | | if (!collect.contains(sonLaboratory)) { |
| | | .eq(InsProduct::getSonLaboratory,sonLaboratory) |
| | | .eq(InsProduct::getInsSampleId, insSample.getId())); |
| | | if (insProducts.size()<=0) { |
| | | throw new ErrorException("该样品没有" + sonLaboratory + "站点的相关项目,请查看下单详情!"); |
| | | } |
| | | //判断该订单是否站点任务有结束试验(只要任一任务结束试验都不能再次试验) |
| | |
| | | orderState.setNum(orderState.getNum() + 1);//递增 |
| | | orderState.setCreateTime(LocalDateTime.now()); |
| | | insOrderStateMapper.updateById(orderState); |
| | | //这里需要将原来的检验项目的状态重置为null(根据样品id和试验室来判断项目) |
| | | insProducts.stream().forEach(insProduct -> { |
| | | insProduct.setInsResult(null); |
| | | insProductMapper.updateById(insProduct); |
| | | }); |
| | | } |
| | | } else { |
| | | InsOrderState insOrderState = new InsOrderState(); |
| | |
| | | .set(InsOrderState::getVerifyUser, userId) |
| | | .set(InsOrderState::getNum, record.getNum() + 1)//次数加1 |
| | | .set(InsOrderState::getCreateTime, LocalDateTime.now())); |
| | | //这里需要将原来的检验项目的状态重置为null(根据样品id和试验室来判断项目) |
| | | insProducts.stream().forEach(insProduct -> { |
| | | insProduct.setInsResult(null); |
| | | insProductMapper.updateById(insProduct); |
| | | }); |
| | | break; |
| | | case 1: |
| | | //继续试验:该样品该站点任务结束(可以再次扫码检验); |
| | |
| | | Integer userId = getLook.selectPowerByMethodAndUserId(null).get("userId"); |
| | | InsSample insSample = insSampleMapper.selectById(sampleId); |
| | | InsOrder insOrder = insOrderMapper.selectById(insSample.getInsOrderId()); |
| | | List<InsProduct> insProducts = insProductMapper.selectList(Wrappers.<InsProduct>lambdaQuery() |
| | | .eq(InsProduct::getInsSampleId, insSample.getId()) |
| | | .eq(InsProduct::getSonLaboratory, laboratory) |
| | | .eq(InsProduct::getState, 1)); |
| | | /*type=0 再次试验; type=1 继续试验 ; type=2 结束试验*/ |
| | | // 查询根据 id 倒序排列的第一条记录 |
| | | InsOrderState record = insOrderStateMapper.selectOne(Wrappers.<InsOrderState>lambdaQuery() |
| | |
| | | .set(InsOrderState::getVerifyUser, userId) |
| | | .set(InsOrderState::getNum, record.getNum() + 1)//次数加1 |
| | | .set(InsOrderState::getCreateTime, LocalDateTime.now())); |
| | | //这里需要将原来的检验项目的状态重置为null(根据样品id和试验室来判断项目) |
| | | insProducts.stream().forEach(insProduct -> { |
| | | insProduct.setInsResult(null); |
| | | insProductMapper.updateById(insProduct); |
| | | }); |
| | | break; |
| | | case 1: |
| | | //继续试验:该样品该站点任务结束(可以再次扫码检验); |
| | |
| | | info.setConsigneeId(submitPlanDto.getVerifyUser()); |
| | | info.setViewStatus(false); |
| | | info.setJumpPath("b1-inspect-order-plan"); |
| | | info.setEntrustCode(insOrder.getEntrustCode());//委托编号 |
| | | info.setLaboratory(submitPlanDto.getLaboratory());//站点 |
| | | informationNotificationService.addInformationNotification(info); |
| | | //复核人--检验单相关负责人 |
| | | InsSampleUser insSampleUser = new InsSampleUser(); |