From 9dd8b96f43b23e9a5ce2f1fbf640a4faf07b01fb Mon Sep 17 00:00:00 2001 From: tangw Date: Thu, 6 Nov 2025 18:51:50 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=BB=E7=A8=8B=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../interfaceCommon/utils/LisWorkUtils.java | 16 ----- .../impl/LisWorkPageInfoServiceImpl.java | 33 +++++----- .../service/impl/LisWorkServiceImpl.java | 61 +------------------ 3 files changed, 16 insertions(+), 94 deletions(-) diff --git a/lis-interfaceCommon/src/main/java/com/czlis/interfaceCommon/utils/LisWorkUtils.java b/lis-interfaceCommon/src/main/java/com/czlis/interfaceCommon/utils/LisWorkUtils.java index cb42adf..af925e9 100644 --- a/lis-interfaceCommon/src/main/java/com/czlis/interfaceCommon/utils/LisWorkUtils.java +++ b/lis-interfaceCommon/src/main/java/com/czlis/interfaceCommon/utils/LisWorkUtils.java @@ -14,7 +14,6 @@ import org.springframework.stereotype.Component; import java.util.ArrayList; import java.util.Date; import java.util.List; -import java.util.stream.Collectors; @Component @Slf4j @@ -35,21 +34,6 @@ public class LisWorkUtils extends LisWorkconfirm{ dayMessage.setMsg(content); return lisInterfaceUtil.invokeLisInterface(LisinterfaceNameConstants.DAYMESSAGE, dayMessage); } - public List getHistroypat(LabPat labPat) { - List nullret=new ArrayList<>(); - if(labPat==null){return nullret;} - Date jyrq = labPat.getJyrq(); - String yq = labPat.getYq(); - String ybh = labPat.getYbh(); - LastLabPatParam lastLabPatParam=getLastLabPatParam(labPat); - if(lastLabPatParam==null){return nullret;} - List labPatList = commonUtil.getlastLabPat(lastLabPatParam); - if(!labPatList.isEmpty()){ - List labPatList0=labPatList.stream().filter(st->!jyrq.equals(st.getJyrq())&&!yq.equals(st.getYq())&&!ybh.equals(st.getYbh())).collect(Collectors.toList()); - return labPatList0; - } - return labPatList; - } public LastLabPatParam getLastLabPatParam(LabPat labPat){ LastLabPatParam nullret=new LastLabPatParam(); Date jyrq = labPat.getJyrq(); diff --git a/liswork/src/main/java/com/czlis/liswork/service/impl/LisWorkPageInfoServiceImpl.java b/liswork/src/main/java/com/czlis/liswork/service/impl/LisWorkPageInfoServiceImpl.java index 5dfce4b..9424668 100644 --- a/liswork/src/main/java/com/czlis/liswork/service/impl/LisWorkPageInfoServiceImpl.java +++ b/liswork/src/main/java/com/czlis/liswork/service/impl/LisWorkPageInfoServiceImpl.java @@ -118,7 +118,10 @@ public Result deleteRedo(LabResultRe labResultRe){ if(lastLabPatParam==null){return new Result("-1","缺少查询条件!");} Map map=BeanUtil.beanToMap(lastLabPatParam); Result historyResult = getHistoryResult(jyrq,yq,ybh,map); - return new Result("0","获取成功!",historyResult.getData()); + if("0".equals(historyResult.getCode())) { + return new Result("0", "获取成功!", historyResult.getData()); + } + return new Result("-1","无历史数据!"); } /** @@ -159,18 +162,11 @@ public Result deleteRedo(LabResultRe labResultRe){ @Override public Result getOtherinstrDetail(String brdh, String yq, Date jyrq,String ybh) { - //List> otherinstrDetailList = lisWorkPageInfoMapper.getOtherinstrDetail(brdh,yq,jyrq); - Map map = new HashMap<>(); - map.put("jyrq",jyrq); - map.put("yq",yq); - map.put("ybh",ybh); - //本次结果 - List hisResultThisList = lisWorkPageInfoMapper.getHisResult(map); - if(hisResultThisList.size()<=0) return new Result("-1","没有找到对应的结果信息!"); - map.clear(); - map.put("yqdl", hisResultThisList.get(0).getYqdl()); - map.put("brdh",hisResultThisList.get(0).getBrdh()); - Result historyResult = getHistoryResult(jyrq,yq,ybh, map); + LabPat labPat=commonUtil.getLabPatOne(jyrq,yq,ybh); + LastLabPatParam lastLabPatParam=lisWorkUtils.getLastLabPatParam(labPat); + if(lastLabPatParam==null){return new Result("-1","缺少查询条件!");} + Map map=BeanUtil.beanToMap(lastLabPatParam); + Result historyResult = getHistoryResult(jyrq,yq,ybh,map); return new Result("0","获取成功!",historyResult.getData()); } @@ -196,9 +192,11 @@ public Result deleteRedo(LabResultRe labResultRe){ public Result getHistoryResult(Date jyrq, String yq, String ybh,Map map){ List hisResultList0 = lisWorkPageInfoMapper.getHisResult(map); if(hisResultList0.isEmpty()){return new Result("-1","无历史数据!");} - List hisResultThisList=hisResultList0.stream().filter(st->jyrq.equals(st.getJyrq())&&yq.equals(st.getYq().trim())&&ybh.equals(st.getYbh())).collect(Collectors.toList()); - List hisResultList=hisResultList0.stream().filter(st->!(jyrq.equals(st.getJyrq())&&yq.equals(st.getYq().trim())&&ybh.equals(st.getYbh()))).collect(Collectors.toList()); - if(hisResultList.isEmpty()){return new Result("-1","无历史数据!");} + List hisResultThisList=hisResultList0.stream().filter(st->jyrq.equals(st.getJyrq())&&yq.trim().equals(st.getYq().trim())&&ybh.equals(st.getYbh())).collect(Collectors.toList()); + HistoryResultDTO historyResultDTO = new HistoryResultDTO(); + historyResultDTO.setFirst(hisResultThisList); + List hisResultList=hisResultList0.stream().filter(st->!(jyrq.equals(st.getJyrq())&&yq.trim().equals(st.getYq().trim())&&ybh.equals(st.getYbh()))).collect(Collectors.toList()); + if(hisResultList.isEmpty()){return new Result("-1","无历史数据!",historyResultDTO);} // 依据 jyrq,yq,ybh 去重(自定义去重字段) List distinctList = hisResultList.stream() @@ -220,9 +218,6 @@ public Result deleteRedo(LabResultRe labResultRe){ .thenComparing(HistoryResult::getYbh).reversed()) .collect(Collectors.toList()); int i = 0; - HistoryResultDTO historyResultDTO = new HistoryResultDTO(); - //本次结果 - historyResultDTO.setFirst(hisResultThisList); for (HistoryResult HistoryResult0 : sortedList) { Date jyrq0=HistoryResult0.getJyrq(); String yq0=HistoryResult0.getYq(); diff --git a/liswork/src/main/java/com/czlis/liswork/service/impl/LisWorkServiceImpl.java b/liswork/src/main/java/com/czlis/liswork/service/impl/LisWorkServiceImpl.java index 9379ead..7c68a09 100644 --- a/liswork/src/main/java/com/czlis/liswork/service/impl/LisWorkServiceImpl.java +++ b/liswork/src/main/java/com/czlis/liswork/service/impl/LisWorkServiceImpl.java @@ -437,64 +437,7 @@ public class LisWorkServiceImpl implements LisWorkService { Date jyrq = labPat.getJyrq(); String yq = labPat.getYq(); String ybh = labPat.getYbh(); - LastLabPatParam lastLabPatParam = new LastLabPatParam(); - String comparecol = commonUtil.getComOptValue(yq, "COMPARECOL"); - String brdh = labPat.getBrdh(); - String mzh = labPat.getMzh(); - String sfzh = labPat.getSfzh(); - String brxm = labPat.getBrxm(); - List labResultList = new ArrayList<>(); - switch (comparecol) { - case "住院号": - if ("".equals(brdh) || brdh == null) { - return labResultList; - } - lastLabPatParam.setBrdh(brdh); - break; - case "卡号": - if ("".equals(mzh) || mzh == null) { - return labResultList; - } - lastLabPatParam.setMzh(mzh); - break; - case "身份证": - if ("".equals(sfzh) || sfzh == null) { - return labResultList; - } - lastLabPatParam.setSfzh(sfzh); - break; - case "姓名": - if ("".equals(brxm) || brxm == null) { - return labResultList; - } - lastLabPatParam.setBrxm(brxm); - break; - default: - if ("".equals(brdh) || brdh == null) { - return labResultList; - } - if ("".equals(brxm) || brxm == null) { - return labResultList; - } - lastLabPatParam.setBrdh(brdh); - lastLabPatParam.setBrxm(brxm); - } - String interval = commonUtil.getComOptValue(yq, "COMPAREDA"); - if (interval == null || interval.isEmpty()) interval = "60"; - int getday = -Integer.parseInt(interval); - lastLabPatParam.setEndda(jyrq); - lastLabPatParam.setStartda(LisUtil.relativeDate(jyrq, getday)); - String compother = commonUtil.getComOptValue(yq, "COMPOTHERINSTR"); - if (compother != null && !compother.isEmpty()) { - String instrlist = commonUtil.getComOptValue(yq, "COMPOTHERINSTRLIST"); - //'CAL800','XS500I','33','40' - if ("".equals(instrlist) || instrlist == null) { - lastLabPatParam.setYq(yq); - } else { - instrlist = "(" + instrlist + ",'" + yq + "')"; - lastLabPatParam.setInstrlist(instrlist); - } - } + LastLabPatParam lastLabPatParam=lisWorkUtils.getLastLabPatParam(labPat); List labPatList = commonUtil.getlastLabPat(lastLabPatParam); if (!labPatList.isEmpty()) { for (LabPat labPat0 : labPatList) { @@ -513,7 +456,7 @@ public class LisWorkServiceImpl implements LisWorkService { } } } - return labResultList; + return new ArrayList<>(); } @Override