| | |
| | | LambdaQueryWrapper<TjSampling> wrapper = new LambdaQueryWrapper<>(); |
| | | wrapper.eq(TjSampling::getTjNum,tjOrder.getTjNumber()); |
| | | List<TjSampling> list = tjSamplingService.list(wrapper); |
| | | log.info("采样数据 ->{}",list); |
| | | log.info("采样数据 ->{}",JSONUtil.toJsonStr(list)); |
| | | if (!list.isEmpty()) { |
| | | Map<String, List<TjSampling>> listMap = list.stream().collect(Collectors.groupingBy(TjSampling::getSpecimenTypeCode)); |
| | | // log.info("分组后 ->{}",JSONUtil.toJsonStr(listMap)); |
| | | log.info("分组后 ->{}",JSONUtil.toJsonStr(listMap)); |
| | | ArrayList<String> ids = new ArrayList<>(); |
| | | for (Map.Entry<String, List<TjSampling>> entry : listMap.entrySet()) { |
| | | // log.info("key ->{},val ->{}",entry.getKey(),entry.getValue()); |
| | | log.info("key ->{},val ->{}",entry.getKey(),entry.getValue()); |
| | | // Lis标本代码 |
| | | String specimenTypeCode = entry.getKey(); |
| | | List<TjSampling> samplings = entry.getValue(); |
| | | if (samplings.size() > 1) { |
| | | if (samplings.size() >= 2) { |
| | | // 进行合并 |
| | | List<String> stringList = samplings.stream().map(TjSampling::getId).collect(Collectors.toList()); |
| | | // log.info("提取id ->{}",stringList); |
| | | log.info("提取id ->{}",stringList); |
| | | for (int i = 0; i < stringList.size(); i++) { |
| | | String s = stringList.get(i); |
| | | if (tjSamplingService.isMergeItem(s) != 0) { |
| | |
| | | ids.add(s); |
| | | } |
| | | } |
| | | if (stringList.size() > 1) { |
| | | String id = tjSamplingService.mergeCaiYangApi(stringList); |
| | | ids.add(id); |
| | | }else { |
| | | ids.add(stringList.get(0)); |
| | | } |
| | | } else { |
| | | ids.add(samplings.get(0).getId()); |
| | | } |
| | |
| | | Date dates = new Date(); |
| | | final String date = DateUtil.format(dates, "yyyy-MM-dd HH:mm:ss"); |
| | | |
| | | List<String> jcsqdh = orderService.getHuoQuJcsqdh(order.getCardId()); |
| | | |
| | | List<String> jysqdh = orderService.getHuoQuJysqdh(order.getCardId()); |
| | | |
| | | |
| | | List<String> zlsqdh = orderService.getHuoQuZlsqdh(order.getCardId()); |
| | | |
| | |
| | | JSONObject object1 = null; |
| | | String code1 = null; |
| | | |
| | | if (isUseLisAndPacsRegister){ |
| | | // if (isUseLisAndPacsRegister){ |
| | | TjCustomer customer1 = customerService.getById(order.getUserId()); |
| | | // 作废检查申请 |
| | | if (jcsqdh != null && !jcsqdh.isEmpty()){ |
| | | for (String sqdh : jcsqdh) { |
| | | List<String> bljcsqdhByPacs = orderService.getBljcsqdhByPacs(order.getCardId()); |
| | | if (bljcsqdhByPacs != null && !bljcsqdhByPacs.isEmpty()){ |
| | | for (String sqdh : bljcsqdhByPacs) { |
| | | AjaxResult cancelPacsAjaxResult = pacsApiMethodService.updatePacsApply(sqdh, order.getCardId(), customer1.getCusName()); |
| | | String result = cancelPacsAjaxResult.get("data").toString(); |
| | | JSONObject object = JSONUtil.parseObj(result); |
| | |
| | | } |
| | | } |
| | | } |
| | | // 作废检验申请 TODO |
| | | if (jysqdh != null && !jysqdh.isEmpty()){ |
| | | List<String> huoQuJysqdhNotBuLu = orderService.getHuoQuJysqdhNotBuLu(order.getCardId()); |
| | | List<String> huoQuJysqdhBuLu = orderService.getHuoQuJysqdhBuLu(order.getCardId()); |
| | | for (String sqdh : huoQuJysqdhNotBuLu) { |
| | | // 作废检验申请 |
| | | List<String> bljysqdhByLis = orderService.getBljysqdhByLis(order.getCardId()); |
| | | if (bljysqdhByLis != null && !bljysqdhByLis.isEmpty()){ |
| | | for (String sqdh : bljysqdhByLis) { |
| | | AjaxResult cancelLisAjaxResult = lisApiMethod.cancel(sqdh, order.getCardId(), customer1.getCusName()); |
| | | log.info("lis请求返回 ->{}",JSONUtil.toJsonStr(cancelLisAjaxResult)); |
| | | if (cancelLisAjaxResult.get("code").toString().equals("200")){ |
| | |
| | | if(code.equals("1")){ |
| | | orderService.delHuoQuJysqdh(order.getCardId()); |
| | | } |
| | | } else { |
| | | String str = JSONUtil.parseObj(cancelLisAjaxResult.get("result").toString()).getJSONObject("Response").getStr("ResultContent"); |
| | | if (str.contains("申请已作废")) |
| | | orderService.delHuoQuJysqdh(order.getCardId()); |
| | | } |
| | | } |
| | | for (String s : huoQuJysqdhBuLu) { |
| | | ajaxResult = controller.Outpindeltestapply(order.getCardId(), "00029", s); |
| | | result2 = getAjaxResult(ajaxResult); |
| | | object1 = getJSONObject(result2); |
| | | code1 = object1.getStr("ResultCode"); |
| | | if (code1.equals("0")) { |
| | | orderService.delHuoQuJysqdh(order.getCardId()); |
| | | } |
| | | } |
| | | } |
| | | |
| | | }else { |
| | | // }else { |
| | | List<String> jcsqdh = orderService.getHuoQuJcsqdh(order.getCardId()); |
| | | |
| | | List<String> jysqdh = orderService.getHuoQuJysqdh(order.getCardId()); |
| | | //2.1.6.5 作废门诊检查申请 |
| | | if (null != jcsqdh && jcsqdh.size()>0) { |
| | | for (String s : jcsqdh) { |
| | |
| | | } |
| | | } |
| | | } |
| | | } |
| | | // } |
| | | |
| | | //2.1.3 门诊医生取消接诊 |
| | | ajaxResult = controller.Outpinunconapply(order.getCardId(), date, "00029"); |
| | |
| | | |
| | | //作废补录项目 |
| | | public boolean ZfBlXm(List<String> bldhs, TjOrder order) { |
| | | |
| | | log.info("bldhs ->{}",JSONUtil.toJsonStr(bldhs)); |
| | | if(null !=bldhs && bldhs.size()>0){ |
| | | log.info("进入判断"); |
| | | try { |
| | | for (String bldh : bldhs) { |
| | | List<String> jcsqdh = orderService.getHuoQuBlJcsqdh(order.getCardId(),bldh); |
| | | |
| | | List<String> jysqdh = orderService.getHuoQuBlJysqdh(order.getCardId(),bldh); |
| | | |
| | | |
| | | List<String> zlsqdh = orderService.getHuoQuBlZlsqdh(order.getCardId(),bldh); |
| | | |
| | |
| | | String result2 = null; |
| | | JSONObject object1 = null; |
| | | String code1 = null; |
| | | |
| | | if (lisApiMethod.isUseLisAndPacsRegister(order)) { |
| | | log.info("查询前"); |
| | | // if (lisApiMethod.isUseLisAndPacsRegister(order)) { |
| | | TjCustomer customer1 = customerService.getById(order.getUserId()); |
| | | log.info("customer1 ->{}",customer1); |
| | | List<String> bljcsqdhByPacs = orderService.getBljcsqdhByPacs(order.getCardId(), bldh); |
| | | log.info("bljcsqdhByPacs ->{}",bljcsqdhByPacs); |
| | | // 作废检查申请 |
| | | if (jcsqdh != null && !jcsqdh.isEmpty()){ |
| | | for (String sqdh : jcsqdh) { |
| | | if (bljcsqdhByPacs != null && !bljcsqdhByPacs.isEmpty()){ |
| | | for (String sqdh : bljcsqdhByPacs) { |
| | | AjaxResult cancelPacsAjaxResult = pacsApiMethodService.updatePacsApply(sqdh, order.getCardId(), customer1.getCusName()); |
| | | log.info("作废检查 pacs返回 ->{}",JSONUtil.toJsonStr(cancelPacsAjaxResult)); |
| | | String result = cancelPacsAjaxResult.get("data").toString(); |
| | |
| | | } |
| | | } |
| | | } |
| | | List<String> bljysqdhByLis = orderService.getBljysqdhByLis(order.getCardId(), bldh); |
| | | log.info("bljysqdhByLis ->{}",bljysqdhByLis); |
| | | // 作废检验申请 |
| | | if (jysqdh != null && !jysqdh.isEmpty()){ |
| | | for (String sqdh : jysqdh) { |
| | | if (bljysqdhByLis != null && !bljysqdhByLis.isEmpty()){ |
| | | for (String sqdh : bljysqdhByLis) { |
| | | AjaxResult cancelLisAjaxResult = lisApiMethod.cancel(sqdh, order.getCardId(), customer1.getCusName()); |
| | | log.info("作废检验 pacs返回 ->{}",JSONUtil.toJsonStr(cancelLisAjaxResult)); |
| | | String result = cancelLisAjaxResult.get("data").toString(); |
| | |
| | | } |
| | | } |
| | | |
| | | }else { |
| | | List<String> jcsqdh = orderService.getHuoQuBlJcsqdh(order.getCardId(),bldh); |
| | | |
| | | List<String> jysqdh = orderService.getHuoQuBlJysqdh(order.getCardId(),bldh); |
| | | // }else { |
| | | //2.1.6.5 作废门诊检查申请 |
| | | if (null != jcsqdh && jcsqdh.size()>0) { |
| | | for (String s : jcsqdh) { |
| | |
| | | } |
| | | } |
| | | } |
| | | } |
| | | // } |
| | | return true; |
| | | } |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | log.error(e.getMessage()); |
| | | return false; |
| | | } |
| | | } |