From 769f5f1c452560ab044fee905c1c514c9ca373bb Mon Sep 17 00:00:00 2001 From: zjh <1084500556@qq.com> Date: 星期四, 10 七月 2025 17:45:13 +0800 Subject: [PATCH] zjh20250710 --- ltkj-admin/src/main/java/com/ltkj/web/controller/his/HisApiMethod.java | 133 ++++++++++++++++++++++++++++++++++++++++---- 1 files changed, 120 insertions(+), 13 deletions(-) diff --git a/ltkj-admin/src/main/java/com/ltkj/web/controller/his/HisApiMethod.java b/ltkj-admin/src/main/java/com/ltkj/web/controller/his/HisApiMethod.java index ed00f68..c56b4a0 100644 --- a/ltkj-admin/src/main/java/com/ltkj/web/controller/his/HisApiMethod.java +++ b/ltkj-admin/src/main/java/com/ltkj/web/controller/his/HisApiMethod.java @@ -133,7 +133,7 @@ String code1 = object1.getStr("ResultCode"); if (code1.equals("0")) { JSONArray resultDatas = object1.getJSONArray("ResultData"); - if (null != resultDatas && resultDatas.size() > 0) { + if (null != resultDatas && !resultDatas.isEmpty()) { Map<String, Object> resultDatasss = (Map<String, Object>) resultDatas.get(0); String hisRegistrationId = resultDatasss.get("his_registration_id").toString(); jzh=hisRegistrationId; @@ -2530,11 +2530,11 @@ String lis_tmh_prefix = configService.selectConfigByKey("make_lis_tmh_prefix"); String isRequestLisAllzx = configService.selectConfigByKey("jcx_is_requestLisAllzx"); if (mergeRequest.equals("Y")){ + LambdaQueryWrapper<TjSampling> wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(TjSampling::getTjNum,tjOrder.getTjNumber()); + List<TjSampling> list = tjSamplingService.list(wrapper); if (isRequestLisAllzx != null && isRequestLisAllzx.equals("Y")){ log.info("杩涘叆鍥綋鏍规嵁灏忛」鏍囨湰鍚堝苟鍙戦�佹柟娉�"); - LambdaQueryWrapper<TjSampling> wrapper = new LambdaQueryWrapper<>(); - wrapper.eq(TjSampling::getTjNum,tjOrder.getTjNumber()); - List<TjSampling> list = tjSamplingService.list(wrapper); if(null !=list && !list.isEmpty()){ List<String> strings = list.stream().map(TjSampling::getProId).collect(Collectors.toList()); LambdaQueryWrapper<TjProject> wrapper1 = new LambdaQueryWrapper<>(); @@ -2543,7 +2543,9 @@ wrapper1.groupBy(TjProject::getProId); List<TjProject> tjProjectList = projectService.list(wrapper1); if(null != tjProjectList && !tjProjectList.isEmpty()){ - Map<String, List<TjProject>> listMap = tjProjectList.stream().collect(Collectors.groupingBy(TjProject::getSpecimenType)); + Map<String, List<TjProject>> listMap = tjProjectList.stream() + .collect(Collectors.groupingBy(p->p.getSpecimenType()+"_"+p.getYb())); + log.info("鍒嗙粍鍚� ->{}",JSONUtil.toJsonStr(listMap)); boolean save = lisApiMethod.save(listMap, tjOrder, customer); if (!save) { @@ -2560,9 +2562,9 @@ }else{ try { - LambdaQueryWrapper<TjSampling> wrapper = new LambdaQueryWrapper<>(); - wrapper.eq(TjSampling::getTjNum,tjOrder.getTjNumber()); - List<TjSampling> list = tjSamplingService.list(wrapper); +// LambdaQueryWrapper<TjSampling> wrapper = new LambdaQueryWrapper<>(); +// wrapper.eq(TjSampling::getTjNum,tjOrder.getTjNumber()); +// List<TjSampling> list = tjSamplingService.list(wrapper); log.info("閲囨牱鏁版嵁 ->{}",JSONUtil.toJsonStr(list)); if (!list.isEmpty()) { Map<String, List<TjSampling>> listMap = list.stream().collect(Collectors.groupingBy(TjSampling::getSpecimenTypeCode)); @@ -2915,7 +2917,7 @@ List<String> jysqdh = orderService.getHuoQuJysqdh(order.getCardId()); //2.1.6.5 浣滃簾闂ㄨ瘖妫�鏌ョ敵璇� - if (null != jcsqdh && jcsqdh.size()>0) { + if (null != jcsqdh && !jcsqdh.isEmpty()) { for (String s : jcsqdh) { AjaxResult result = controller.Outpindelexamapply(order.getCardId(), ysbm, s); String result1 = getAjaxResult(result); @@ -3048,7 +3050,7 @@ List<String> jysqdh = orderService.getHuoQuBlJysqdh(order.getCardId(),bldh); // }else { // 2.1.6.5 浣滃簾闂ㄨ瘖妫�鏌ョ敵璇� - if (null != jcsqdh && jcsqdh.size()>0) { + if (null != jcsqdh && !jcsqdh.isEmpty()) { for (String s : jcsqdh) { AjaxResult result = controller.Outpindelexamapply(order.getCardId(), ysbm, s); String result1 = getAjaxResult(result); @@ -3063,7 +3065,7 @@ } //2.1.6.3 浣滃簾闂ㄨ瘖妫�楠岀敵璇� - if (null != jysqdh && jysqdh.size()>0) { + if (null != jysqdh && !jysqdh.isEmpty()) { for (String s : jysqdh) { ajaxResult = controller.Outpindeltestapply(order.getCardId(), ysbm, s); result2 = getAjaxResult(ajaxResult); @@ -3078,7 +3080,7 @@ } //2.1.6.9 浣滃簾闂ㄨ瘖娌荤枟澶勭疆鐢宠 - if (null != zlsqdh && zlsqdh.size()>0) { + if (null != zlsqdh && !zlsqdh.isEmpty()) { for (String s : zlsqdh) { ajaxResult = controller.Outpintdelreatapply(order.getCardId(), ysbm, s); result2 = getAjaxResult(ajaxResult); @@ -3093,7 +3095,7 @@ } //浣滃簾鑽搧鐢宠 - if(null !=cfhs && cfhs.size()>0){ + if(null !=cfhs && !cfhs.isEmpty()){ for (String cfh : cfhs) { AjaxResult result = controller.Outpindelmedicapply(order.getCardId(), ysbm, cfh); String result1 = getAjaxResult(result); @@ -3202,6 +3204,111 @@ return true; } + + public void ZfBlHisApiMethod(String tjh,String bldh) { + + TjOrder order = orderService.getOrderByTjNum(tjh); + if(null !=order){ + String ysbm = configService.selectConfigByKey("request_default_ysbm"); + + List<String> zlsqdh = orderService.getHuoQuBlZlsqdh(order.getCardId(),bldh); + List<String> jcsqdh = orderService.getHuoQuBlJcsqdh(order.getCardId(),bldh); + List<String> jysqdh = orderService.getHuoQuBlJysqdh(order.getCardId(),bldh); + List<String> cfhs = cfService.getCfBlhs(order.getCardId(),bldh); + + AjaxResult ajaxResult = null; + String result2 = null; + JSONObject object1 = null; + String code1 = null; + log.info("鏌ヨ鍓�"); + TjCustomer customer1 = customerService.getById(order.getUserId()); + log.info("customer1 ->{}",customer1); + List<String> bljcsqdhByPacs = orderService.getBljcsqdhByPacs(order.getCardId(), bldh); + log.info("bljcsqdhByPacs ->{}",bljcsqdhByPacs); + // 浣滃簾妫�鏌ョ敵璇� + 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(); + JSONObject object = JSONUtil.parseObj(result); + String code = object.getStr("ResultCode"); + if(code.equals("1")){ + orderService.delHuoQuBlJcsqdh(order.getCardId(),bldh); + } + } + } + List<String> bljysqdhByLis = orderService.getBljysqdhByLis(order.getCardId(), bldh); + log.info("bljysqdhByLis ->{}",bljysqdhByLis); + // 浣滃簾妫�楠岀敵璇� + if (bljysqdhByLis != null && !bljysqdhByLis.isEmpty()){ + for (String sqdh : bljysqdhByLis) { + AjaxResult cancelLisAjaxResult = lisApiMethod.cancel(sqdh, order.getCardId(), customer1.getCusName()); + log.info("浣滃簾妫�楠� lis杩斿洖 ->{}",JSONUtil.toJsonStr(cancelLisAjaxResult)); + String result = cancelLisAjaxResult.get("data").toString(); + JSONObject object = JSONUtil.parseObj(result); + String code= object.getStr("ResultCode"); + if(code.equals("1")){ + orderService.delHuoQuBlJysqdh(order.getCardId(),bldh); + } + } + } + + + + if (null != jcsqdh && !jcsqdh.isEmpty()) { + for (String s : jcsqdh) { + AjaxResult result = controller.Outpindelexamapply(order.getCardId(), ysbm, s); + String result1 = getAjaxResult(result); + JSONObject object = getJSONObject(result1); + String code = object.getStr("ResultCode"); + if (code.equals("0")) { + orderService.delHuoQuBlJcsqdh(order.getCardId(),bldh); + } + } + } + + //2.1.6.3 浣滃簾闂ㄨ瘖妫�楠岀敵璇� + if (null != jysqdh && !jysqdh.isEmpty()) { + for (String s : jysqdh) { + ajaxResult = controller.Outpindeltestapply(order.getCardId(), ysbm, s); + result2 = getAjaxResult(ajaxResult); + object1 = getJSONObject(result2); + code1 = object1.getStr("ResultCode"); + if (code1.equals("0")) { + orderService.delHuoQuBlJysqdh(order.getCardId(),bldh); + } + } + } + + //2.1.6.9 浣滃簾闂ㄨ瘖娌荤枟澶勭疆鐢宠 + if (null != zlsqdh && !zlsqdh.isEmpty()) { + for (String s : zlsqdh) { + ajaxResult = controller.Outpintdelreatapply(order.getCardId(), ysbm, s); + result2 = getAjaxResult(ajaxResult); + object1 = getJSONObject(result2); + code1 = object1.getStr("ResultCode"); + if (code1.equals("0")) { + orderService.delHuoQuZlsqdh(order.getCardId(),bldh); + } + } + } + + //浣滃簾鑽搧鐢宠 + if(null !=cfhs && !cfhs.isEmpty()){ + for (String cfh : cfhs) { + AjaxResult result = controller.Outpindelmedicapply(order.getCardId(), ysbm, cfh); + String result1 = getAjaxResult(result); + JSONObject object = getJSONObject(result1); + String code = object.getStr("ResultCode"); + if(null !=code && code.equals("0")){ + cfService.delCfByCardId(cfh); + } + } + } + } + } + //鑾峰彇闂ㄨ瘖缁撶畻璁板綍 @Transactional public void getHisMzJsJl(TjOrder order) { -- Gitblit v1.8.0