| | |
| | | insOrderState.setInsOrderId(orderId); |
| | | insOrderState.setLaboratory(sonLaboratory); |
| | | insOrderState.setInsState(0); |
| | | insOrderState.setNum(1);//初始是第一次 |
| | | insOrderStateMapper.insert(insOrderState); |
| | | //这里是在给分配的指定的人和试验室下发检验人 |
| | | if (userId != null) { |
| | |
| | | Map<String, Object> map = new HashMap<>(); |
| | | InsOrder insOrder = insOrderMapper.selectById(id); |
| | | List<SampleProductDto> list = insSampleMapper.selectSampleProductListByOrderId2(id); |
| | | if (list.size()==0){ |
| | | list = insSampleMapper.selectSampleProductListByOrder2Id2(id); |
| | | } |
| | | map.put("insOrder", insOrder); |
| | | map.put("sampleProduct", list); |
| | | return map; |
| | |
| | | insOrder.setExamineTime(LocalDateTime.now()); |
| | | if (insOrder.getState() == 1) { |
| | | //审核通过才会生成委托编号 |
| | | String code = baseMapper.selLaboratoryCode(insOrder.getLaboratory()); |
| | | if (StringUtils.isEmpty(code)) { |
| | | code = ""; |
| | | } |
| | | Custom custom = customMapper.selectById(order.getCompanyId()); |
| | | System.out.println("=============" + custom.getCompany()); |
| | | System.out.println("-------------" + order.getCompany()); |
| | | String code2 = custom.getCode2(); |
| | | if (!custom.getCompany().equals(order.getCompany())) { |
| | | Custom one = customMapper.selectOne(Wrappers.<Custom>lambdaQuery().eq(Custom::getCompany, order.getCompany())); |
| | | insOrder.setCompanyId(one.getId()); |
| | | code2 = one.getCode2(); |
| | | } |
| | | insOrder.setEntrustCode(giveCode.giveCode2("JCZX/" + code + "-" + code2 + "-", insOrder.getCompanyId(), insOrder.getLaboratory(), "ins_order", "", "yyMM")); |
| | | insOrder.setEntrustCode(giveCode.giveCode2("TXJC-", insOrder.getCompanyId(), insOrder.getLaboratory(), "ins_order", "", "yyMMdd")); |
| | | //系统查询站点任务分布情况,将检验任务下发至最少的站台 |
| | | List<InsSample> insSamples = insSampleMapper.selectList(Wrappers.<InsSample>lambdaQuery() |
| | | .eq(InsSample::getInsOrderId, insOrder.getId()).select(InsSample::getId)); |
| | |
| | | Map<String, Object> map = new HashMap<>(); |
| | | InsOrder insOrder = insOrderMapper.selectById2(id); |
| | | List<SampleProductDto> list = insSampleMapper.getInsOrderAndSample(id, laboratory); |
| | | if (list.size()==0){ |
| | | list=insSampleMapper.getInsOrderAndSample2(id, laboratory); |
| | | } |
| | | for (SampleProductDto sampleProductDto : list) { |
| | | List<Integer> ids = sampleProductDto.getInsProduct().stream().map(InsProduct::getId).collect(Collectors.toList()); |
| | | List<InsProductUser> insProductUsers = insProductUserMapper.selectList(Wrappers.<InsProductUser>lambdaQuery() |