主程序
This commit is contained in:
parent
da1806ebfa
commit
9dd8b96f43
@ -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<LabPat> getHistroypat(LabPat labPat) {
|
||||
List<LabPat> 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<LabPat> labPatList = commonUtil.getlastLabPat(lastLabPatParam);
|
||||
if(!labPatList.isEmpty()){
|
||||
List<LabPat> 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();
|
||||
|
||||
@ -118,8 +118,11 @@ public Result deleteRedo(LabResultRe labResultRe){
|
||||
if(lastLabPatParam==null){return new Result("-1","缺少查询条件!");}
|
||||
Map<String,Object> map=BeanUtil.beanToMap(lastLabPatParam);
|
||||
Result historyResult = getHistoryResult(jyrq,yq,ybh,map);
|
||||
if("0".equals(historyResult.getCode())) {
|
||||
return new Result("0", "获取成功!", historyResult.getData());
|
||||
}
|
||||
return new Result("-1","无历史数据!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取收费信息
|
||||
@ -159,17 +162,10 @@ public Result deleteRedo(LabResultRe labResultRe){
|
||||
|
||||
@Override
|
||||
public Result getOtherinstrDetail(String brdh, String yq, Date jyrq,String ybh) {
|
||||
//List<Map<String,Object>> otherinstrDetailList = lisWorkPageInfoMapper.getOtherinstrDetail(brdh,yq,jyrq);
|
||||
Map<String,Object> map = new HashMap<>();
|
||||
map.put("jyrq",jyrq);
|
||||
map.put("yq",yq);
|
||||
map.put("ybh",ybh);
|
||||
//本次结果
|
||||
List<HistoryResult> 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());
|
||||
LabPat labPat=commonUtil.getLabPatOne(jyrq,yq,ybh);
|
||||
LastLabPatParam lastLabPatParam=lisWorkUtils.getLastLabPatParam(labPat);
|
||||
if(lastLabPatParam==null){return new Result("-1","缺少查询条件!");}
|
||||
Map<String,Object> 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<String,Object> map){
|
||||
List<HistoryResult> hisResultList0 = lisWorkPageInfoMapper.getHisResult(map);
|
||||
if(hisResultList0.isEmpty()){return new Result("-1","无历史数据!");}
|
||||
List<HistoryResult> hisResultThisList=hisResultList0.stream().filter(st->jyrq.equals(st.getJyrq())&&yq.equals(st.getYq().trim())&&ybh.equals(st.getYbh())).collect(Collectors.toList());
|
||||
List<HistoryResult> 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<HistoryResult> 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<HistoryResult> 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<HistoryResult> 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();
|
||||
|
||||
@ -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<LabResult> 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<LabPat> 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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user