历史结果
This commit is contained in:
parent
426be1babc
commit
3e2d003548
@ -1,5 +1,6 @@
|
||||
package com.czlis.liswork.controller.work;
|
||||
|
||||
import com.czlis.common.annotation.Anonymous;
|
||||
import com.czlis.common.core.controller.BaseController;
|
||||
import com.czlis.common.core.domain.Result;
|
||||
import com.czlis.liswork.service.LisWorkPageInfoService;
|
||||
@ -32,6 +33,7 @@ public class LisWorkPageInfoController extends BaseController {
|
||||
return lisWorkPageInfoService.getRedo(jyrq,yq,ybh);
|
||||
}
|
||||
|
||||
@Anonymous
|
||||
@ApiOperation("获取历史结果")
|
||||
@GetMapping("/history")
|
||||
public Result getHistory(Date jyrq,String yq,String ybh){
|
||||
|
||||
@ -0,0 +1,23 @@
|
||||
package com.czlis.liswork.pojo.DTO;
|
||||
|
||||
import com.czlis.liswork.pojo.HistoryResult;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class HistoryResultDTO {
|
||||
private List<HistoryResult> one;
|
||||
private List<HistoryResult> two;
|
||||
private List<HistoryResult> three;
|
||||
private List<HistoryResult> four;
|
||||
private List<HistoryResult> five;
|
||||
private List<HistoryResult> six;
|
||||
private List<HistoryResult> seven;
|
||||
private List<HistoryResult> eight;
|
||||
private List<HistoryResult> nine;
|
||||
}
|
||||
@ -20,5 +20,9 @@ public class HistoryResult {
|
||||
private String nl;
|
||||
private String yqdl;
|
||||
private String brdh;
|
||||
private String brxm;
|
||||
private String result_flag;
|
||||
private String yljg;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -10,6 +10,7 @@ import com.czlis.common.utils.file.FileUtils;
|
||||
import com.czlis.common.utils.file.ImageUtils;
|
||||
import com.czlis.interfaceCommon.utils.ReportUtil;
|
||||
import com.czlis.liswork.mapper.LisWorkPageInfoMapper;
|
||||
import com.czlis.liswork.pojo.DTO.HistoryResultDTO;
|
||||
import com.czlis.liswork.pojo.HistoryResult;
|
||||
import com.czlis.liswork.service.LisWorkPageInfoService;
|
||||
import com.czlis.interfaceCommon.utils.CommonUtil;
|
||||
@ -69,28 +70,74 @@ public class LisWorkPageInfoServiceImpl implements LisWorkPageInfoService {
|
||||
map.put("yqdl", hisResultThisList.get(0).getYqdl());
|
||||
map.put("brdh",hisResultThisList.get(0).getBrdh());
|
||||
List<HistoryResult> hisResultList = lisWorkPageInfoMapper.getHisResult(map);
|
||||
for (HistoryResult historyResult : hisResultThisList) {
|
||||
List<HistoryResult> collect = hisResultList.stream().filter(historyResult1 ->
|
||||
historyResult1.getXmdh().equals(historyResult.getXmdh()) && !historyResult1.getJyrq().equals(historyResult.getJyrq())).collect(Collectors.toList());
|
||||
if(!collect.isEmpty()) hisResultThisList.addAll(collect);
|
||||
}
|
||||
//排序
|
||||
hisResultThisList.sort(new Comparator<HistoryResult>() {
|
||||
// for (HistoryResult historyResult : hisResultThisList) {
|
||||
// List<HistoryResult> collect = hisResultList.stream().filter(historyResult1 ->
|
||||
// historyResult1.getXmdh().equals(historyResult.getXmdh()) && !historyResult1.getJyrq().equals(historyResult.getJyrq())).collect(Collectors.toList());
|
||||
// if(!collect.isEmpty()) hisResultThisList.addAll(collect);
|
||||
// }
|
||||
//排序,先按时间排序,再按项目代号排序
|
||||
hisResultList.sort(new Comparator<HistoryResult>() {
|
||||
@Override
|
||||
public int compare(HistoryResult o1, HistoryResult o2) {
|
||||
String xmdh = o1.getXmdh();
|
||||
String xmdh2 = o2.getXmdh();
|
||||
int i = xmdh.compareTo(xmdh2);
|
||||
if(i == 0) {
|
||||
Date jyrq1 = o1.getJyrq();
|
||||
Date jyrq2 = o2.getJyrq();
|
||||
return jyrq1.compareTo(jyrq2);
|
||||
int i1 = jyrq2.compareTo(jyrq1);
|
||||
if(i1 == 0){
|
||||
String xmdh = o1.getXmdh();
|
||||
String xmdh2 = o2.getXmdh();
|
||||
return xmdh.compareTo(xmdh2);
|
||||
}else{
|
||||
return i;
|
||||
return i1;
|
||||
}
|
||||
}
|
||||
});
|
||||
return new Result("0","获取成功!",hisResultThisList);
|
||||
Date jyrqTemp = null;
|
||||
int i = 0;
|
||||
HistoryResultDTO historyResultDTO = new HistoryResultDTO();
|
||||
List<Date> jyrqList = new ArrayList<>();
|
||||
for (HistoryResult historyResult : hisResultList) {
|
||||
Date jyrq1 = historyResult.getJyrq();
|
||||
int compare = DateUtil.compare(jyrq1, jyrqTemp);
|
||||
if(compare != 0){
|
||||
jyrqList.add(jyrq1);
|
||||
}
|
||||
jyrqTemp = jyrq1;
|
||||
}
|
||||
for (Date jyrqDate : jyrqList) {
|
||||
i++;
|
||||
List<HistoryResult> historySingleResultList = hisResultList.stream().filter(historyResult -> historyResult.getJyrq().equals(jyrqDate)).collect(Collectors.toList());
|
||||
switch (i){
|
||||
case 1:
|
||||
historyResultDTO.setOne(historySingleResultList);
|
||||
break;
|
||||
case 2:
|
||||
historyResultDTO.setTwo(historySingleResultList);
|
||||
break;
|
||||
case 3:
|
||||
historyResultDTO.setThree(historySingleResultList);
|
||||
break;
|
||||
case 4:
|
||||
historyResultDTO.setFour(historySingleResultList);
|
||||
break;
|
||||
case 5:
|
||||
historyResultDTO.setFive(historySingleResultList);
|
||||
break;
|
||||
case 6:
|
||||
historyResultDTO.setSix(historySingleResultList);
|
||||
break;
|
||||
case 7:
|
||||
historyResultDTO.setSeven(historySingleResultList);
|
||||
break;
|
||||
case 8:
|
||||
historyResultDTO.setEight(historySingleResultList);
|
||||
break;
|
||||
case 9:
|
||||
historyResultDTO.setNine(historySingleResultList);
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
return new Result("0","获取成功!",historyResultDTO);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -364,7 +364,7 @@ public class LisWorkServiceImpl implements LisWorkService {
|
||||
* @return 上一次结果
|
||||
*/
|
||||
|
||||
private List<LabResult> getlastresult(LabPat labPat,List<LabResult> labResultall){
|
||||
public List<LabResult> getlastresult(LabPat labPat,List<LabResult> labResultall){
|
||||
Date jyrq=labPat.getJyrq();
|
||||
String yq=labPat.getYq();
|
||||
String ybh=labPat.getYbh();
|
||||
|
||||
@ -84,7 +84,7 @@
|
||||
<select id="getHisResult" resultType="com.czlis.liswork.pojo.HistoryResult">
|
||||
select b.jyrq,c.xmdh, c.xmmc,b.csjg,b.ybh,b.yq,d.yqdl,a.brdh,
|
||||
(case a.brxb when '1' then '男' when '2' then '女' end) as brxb ,
|
||||
a.nl+a.nldw as nl
|
||||
a.nl+a.nldw as nl,a.brxm as brxm,b.result_flag,(select top 1 zdmc from com_dict where zdlb = 'HOS' and zddh = a.yljg) as yljg
|
||||
from lab_pat a, lab_result b,xm_info c,lab_instr d
|
||||
where a.jyrq = b.jyrq and a.yq = b.yq and a.ybh = b.ybh and a.jgbz = '2'
|
||||
and c.yq = b.yq and c.xmdh = b.xmdh and d.yq = a.yq and a.jyrq > getdate() - 360
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user