history项目对照
This commit is contained in:
parent
289187847f
commit
6f0262ad04
@ -17,25 +17,27 @@ import java.util.List;
|
||||
|
||||
@Component
|
||||
@Slf4j
|
||||
public class LisWorkUtils extends LisWorkconfirm{
|
||||
public class LisWorkUtils extends LisWorkconfirm {
|
||||
|
||||
/**
|
||||
* 通用调用医院定制接口
|
||||
*
|
||||
* @param msgid
|
||||
* @param content
|
||||
* @return
|
||||
*/
|
||||
public Result setDayMessage(String msgid,String content){
|
||||
public Result setDayMessage(String msgid, String content) {
|
||||
DayMessage dayMessage = new DayMessage();
|
||||
dayMessage.setIp(getIP());
|
||||
dayMessage.setYljg(getYLJG());
|
||||
dayMessage.setUserid(getusername());
|
||||
dayMessage.setMsgid(msgid);
|
||||
dayMessage.setMsg(content);
|
||||
return lisInterfaceUtil.invokeLisInterface(LisinterfaceNameConstants.DAYMESSAGE, dayMessage);
|
||||
return lisInterfaceUtil.invokeLisInterface(LisinterfaceNameConstants.DAYMESSAGE, dayMessage);
|
||||
}
|
||||
public LastLabPatParam getLastLabPatParam(LabPat labPat){
|
||||
LastLabPatParam nullret=new LastLabPatParam();
|
||||
|
||||
public LastLabPatParam getLastLabPatParam(LabPat labPat) {
|
||||
LastLabPatParam nullret = new LastLabPatParam();
|
||||
Date jyrq = labPat.getJyrq();
|
||||
String yq = labPat.getYq();
|
||||
String ybh = labPat.getYbh();
|
||||
|
||||
@ -40,92 +40,102 @@ public class LisWorkPageInfoServiceImpl implements LisWorkPageInfoService {
|
||||
if (!labGraphList.isEmpty()) {
|
||||
for (LabGraph labGraph : labGraphList) {
|
||||
byte[] txnr = labGraph.getTxnr();
|
||||
String picdata=Base64.encode(txnr);
|
||||
String bz1=labGraph.getBz1();
|
||||
if(bz1==null)bz1="1";
|
||||
int lbidx=bz1.indexOf(".");
|
||||
if(lbidx>0)bz1=bz1.substring(0,lbidx);
|
||||
Map<String,String> map = new HashMap<>();
|
||||
map.put("xh",bz1);
|
||||
map.put("txlb",labGraph.getTxlb());
|
||||
map.put("txmc",labGraph.getTxmc());
|
||||
map.put("bz",labGraph.getBz2());
|
||||
map.put("picbase64",picdata);
|
||||
String picdata = Base64.encode(txnr);
|
||||
String bz1 = labGraph.getBz1();
|
||||
if (bz1 == null) bz1 = "1";
|
||||
int lbidx = bz1.indexOf(".");
|
||||
if (lbidx > 0) bz1 = bz1.substring(0, lbidx);
|
||||
Map<String, String> map = new HashMap<>();
|
||||
map.put("xh", bz1);
|
||||
map.put("txlb", labGraph.getTxlb());
|
||||
map.put("txmc", labGraph.getTxmc());
|
||||
map.put("bz", labGraph.getBz2());
|
||||
map.put("picbase64", picdata);
|
||||
listOfMaps.add(map);
|
||||
}
|
||||
}
|
||||
return new Result("0","获取数据成功!",listOfMaps);
|
||||
return new Result("0", "获取数据成功!", listOfMaps);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result getRedo(Date jyrq, String yq, String ybh) {
|
||||
List<LabResultRe> labResultReList = lisWorkPageInfoMapper.getRedo(jyrq,yq,ybh);
|
||||
return new Result("0","获取数据成功!",labResultReList);
|
||||
List<LabResultRe> labResultReList = lisWorkPageInfoMapper.getRedo(jyrq, yq, ybh);
|
||||
return new Result("0", "获取数据成功!", labResultReList);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Result swapRedo(LabResultRe labResultRe) {
|
||||
Date jyrq=labResultRe.getJyrq();
|
||||
String yq=labResultRe.getYq();
|
||||
String ybh=labResultRe.getYbh();
|
||||
String xmdh=labResultRe.getXmdh();
|
||||
String csjg=labResultRe.getCsjg();
|
||||
LabPat labPat=commonUtil.getLabPatOne(jyrq,yq,ybh);
|
||||
if(labPat!=null){
|
||||
String jgbz=labPat.getJgbz();
|
||||
if(jgbz==null)jgbz="0";
|
||||
if("2".equals(jgbz)||"5".equals(jgbz)){
|
||||
return new Result("1","样本已审核禁止交换!");
|
||||
Date jyrq = labResultRe.getJyrq();
|
||||
String yq = labResultRe.getYq();
|
||||
String ybh = labResultRe.getYbh();
|
||||
String xmdh = labResultRe.getXmdh();
|
||||
String csjg = labResultRe.getCsjg();
|
||||
LabPat labPat = commonUtil.getLabPatOne(jyrq, yq, ybh);
|
||||
if (labPat != null) {
|
||||
String jgbz = labPat.getJgbz();
|
||||
if (jgbz == null) jgbz = "0";
|
||||
if ("2".equals(jgbz) || "5".equals(jgbz)) {
|
||||
return new Result("1", "样本已审核禁止交换!");
|
||||
}
|
||||
}
|
||||
LabResult labResult=commonUtil.getLabResult(jyrq,yq,ybh,xmdh);
|
||||
if(labResult==null){
|
||||
return new Result("1","当前结果为空无法交换!");
|
||||
LabResult labResult = commonUtil.getLabResult(jyrq, yq, ybh, xmdh);
|
||||
if (labResult == null) {
|
||||
return new Result("1", "当前结果为空无法交换!");
|
||||
}
|
||||
String csjg0=labResult.getCsjg();
|
||||
String csjg0 = labResult.getCsjg();
|
||||
labResultRe.setCsjg(csjg0);
|
||||
labResult.setCsjg(csjg);
|
||||
labResult.setRedo_flag("1");
|
||||
lisWorkUtils.changeresult(labResult);
|
||||
lisWorkPageInfoMapper.updateLabResultRe(labResultRe);
|
||||
return new Result("0","交换数据成功!",labResultRe);
|
||||
return new Result("0", "交换数据成功!", labResultRe);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Result saveRedo(LabResultRe labResultRe) {
|
||||
Date jyrq=labResultRe.getJyrq();
|
||||
String yq=labResultRe.getYq();
|
||||
String ybh=labResultRe.getYbh();
|
||||
String xmdh=labResultRe.getXmdh();
|
||||
LabResultRe labResultRe0 =lisWorkPageInfoMapper.getLabResultRe(jyrq,yq,ybh,xmdh);
|
||||
if(labResultRe0==null){
|
||||
Date jyrq = labResultRe.getJyrq();
|
||||
String yq = labResultRe.getYq();
|
||||
String ybh = labResultRe.getYbh();
|
||||
String xmdh = labResultRe.getXmdh();
|
||||
LabResultRe labResultRe0 = lisWorkPageInfoMapper.getLabResultRe(jyrq, yq, ybh, xmdh);
|
||||
if (labResultRe0 == null) {
|
||||
lisWorkPageInfoMapper.insertLabResultRe(labResultRe);
|
||||
}else{
|
||||
} else {
|
||||
lisWorkPageInfoMapper.updateLabResultRe(labResultRe);
|
||||
}
|
||||
return new Result("0","保存成功!",labResultRe);
|
||||
return new Result("0", "保存成功!", labResultRe);
|
||||
}
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Result deleteRedo(LabResultRe labResultRe){
|
||||
lisWorkPageInfoMapper.deleteRedo(labResultRe);
|
||||
return new Result("0","成功!");
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Result deleteRedo(LabResultRe labResultRe) {
|
||||
lisWorkPageInfoMapper.deleteRedo(labResultRe);
|
||||
return new Result("0", "成功!");
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result getHistory(Date jyrq, String yq, String ybh) {
|
||||
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);
|
||||
if("0".equals(historyResult.getCode())) {
|
||||
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);
|
||||
if(map == null || map.size() <= 0){
|
||||
return new Result("-1","查询条件转换错误!");
|
||||
}
|
||||
Result historyResult = getHistoryResult(jyrq, yq, ybh, map);
|
||||
if ("0".equals(historyResult.getCode())) {
|
||||
return new Result("0", "获取成功!", historyResult.getData());
|
||||
}
|
||||
return new Result("-1","无历史数据!");
|
||||
return new Result("-1", "无历史数据!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取收费信息
|
||||
*
|
||||
* @param jyrq
|
||||
* @param yq
|
||||
* @param ybh
|
||||
@ -134,10 +144,10 @@ public Result deleteRedo(LabResultRe labResultRe){
|
||||
@Override
|
||||
public Result getReqdetail(Date jyrq, String yq, String ybh) {
|
||||
LabPat labPatOne = commonUtil.getLabPatOne(jyrq, yq, ybh);
|
||||
if(labPatOne == null) return new Result("-1","没有查到对应的上机记录!");
|
||||
if (labPatOne == null) return new Result("-1", "没有查到对应的上机记录!");
|
||||
String sqh = labPatOne.getSqh();
|
||||
List<Map<String,Object>> labReqdetailList = lisWorkPageInfoMapper.getReqdetail(sqh);
|
||||
return new Result("0","获取数据成功!",labReqdetailList);
|
||||
List<Map<String, Object>> labReqdetailList = lisWorkPageInfoMapper.getReqdetail(sqh);
|
||||
return new Result("0", "获取数据成功!", labReqdetailList);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -147,31 +157,34 @@ public Result deleteRedo(LabResultRe labResultRe){
|
||||
String value = "30";
|
||||
DateTime dayEnd = DateUtil.offsetDay(DateUtil.date(), Integer.parseInt(value));
|
||||
LabPat labPatOne = commonUtil.getLabPatOne(jyrq, yq, ybh);
|
||||
if(labPatOne == null) return new Result("0","没有查到需要的数据!");
|
||||
if (labPatOne == null) return new Result("0", "没有查到需要的数据!");
|
||||
String brdh = labPatOne.getBrdh();
|
||||
String brxm = labPatOne.getBrxm();
|
||||
List<Map<String,Object>> queryList = lisWorkPageInfoMapper.getOtherinstr(jyrq,dayEnd,brdh,brxm);
|
||||
return new Result("0","查询数据成功!",queryList);
|
||||
List<Map<String, Object>> queryList = lisWorkPageInfoMapper.getOtherinstr(jyrq, dayEnd, brdh, brxm);
|
||||
return new Result("0", "查询数据成功!", queryList);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result getReqInfo(Date jyrq, String yq, String ybh) {
|
||||
List<Map<String,Object>> reqInfoList = lisWorkPageInfoMapper.getReqInfo(jyrq,yq,ybh);
|
||||
return new Result("0","获取标本流转数据成功!",reqInfoList);
|
||||
List<Map<String, Object>> reqInfoList = lisWorkPageInfoMapper.getReqInfo(jyrq, yq, ybh);
|
||||
return new Result("0", "获取标本流转数据成功!", reqInfoList);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result getOtherinstrDetail(String brdh, String yq, Date jyrq,String ybh) {
|
||||
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());
|
||||
public Result getOtherinstrDetail(String brdh, String yq, Date jyrq, String ybh) {
|
||||
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());
|
||||
}
|
||||
|
||||
/**
|
||||
* 申请项目明细
|
||||
*
|
||||
* @param yq
|
||||
* @param sqxmdh
|
||||
* @return
|
||||
@ -179,31 +192,35 @@ public Result deleteRedo(LabResultRe labResultRe){
|
||||
@Override
|
||||
public Result getReqdetailMX(String yq, String sqxmdh) {
|
||||
List<Map<String, Object>> bgxmList = lisWorkPageInfoMapper.getbgxm(yq, sqxmdh);
|
||||
return new Result("0","获取数据成功!",bgxmList);
|
||||
return new Result("0", "获取数据成功!", bgxmList);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result getInputmdl(String yq) {
|
||||
List<LabInputmdl> labInputmdlList = lisWorkPageInfoMapper.getInputmdl(yq);
|
||||
return new Result("0","获取数据成功!",labInputmdlList);
|
||||
List<LabInputmdl> labInputmdlList = lisWorkPageInfoMapper.getInputmdl(yq);
|
||||
return new Result("0", "获取数据成功!", labInputmdlList);
|
||||
}
|
||||
|
||||
|
||||
public Result getHistoryResult(Date jyrq, String yq, String ybh,Map<String,Object> map){
|
||||
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.trim().equals(st.getYq().trim())&&ybh.equals(st.getYbh())).collect(Collectors.toList());
|
||||
if (hisResultList0.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);}
|
||||
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()
|
||||
// 利用 LinkedHashSet 去重并保留顺序,键为 "jyrq,yq,ybh" 的组合
|
||||
.collect(Collectors.toMap(
|
||||
// 生成唯一键:将所选字段拼接为字符串(确保唯一)
|
||||
item -> item.getJyrq() + "_" + item.getYq().trim()+"_"+item.getYbh(),
|
||||
item -> item.getJyrq() + "_" + item.getYq().trim() + "_" + item.getYbh(),
|
||||
// 值为对象本身
|
||||
item -> item,
|
||||
// 若键重复,保留第一个出现的对象
|
||||
@ -219,61 +236,61 @@ public Result deleteRedo(LabResultRe labResultRe){
|
||||
.collect(Collectors.toList());
|
||||
int i = 0;
|
||||
for (HistoryResult HistoryResult0 : sortedList) {
|
||||
Date jyrq0=HistoryResult0.getJyrq();
|
||||
String yq0=HistoryResult0.getYq();
|
||||
String ybh0=HistoryResult0.getYbh();
|
||||
Date jyrq0 = HistoryResult0.getJyrq();
|
||||
String yq0 = HistoryResult0.getYq();
|
||||
String ybh0 = HistoryResult0.getYbh();
|
||||
|
||||
List<HistoryResult> historySingleResultList=hisResultList.stream().filter(st->jyrq0.equals(st.getJyrq())&&yq0.equals(st.getYq())&&ybh0.equals(st.getYbh())).collect(Collectors.toList());
|
||||
boolean havexmdh=false;
|
||||
List<HistoryResult> historySingleResultList = hisResultList.stream().filter(st -> jyrq0.equals(st.getJyrq()) && yq0.equals(st.getYq()) && ybh0.equals(st.getYbh())).collect(Collectors.toList());
|
||||
boolean havexmdh = false;
|
||||
for (HistoryResult labResult : hisResultThisList) {
|
||||
String xmdh = labResult.getXmdh();
|
||||
List<HistoryResult> labResult0 = historySingleResultList.stream().filter(rlog -> xmdh.equals(rlog.getXmdh())).collect(Collectors.toList());
|
||||
if (!labResult0.isEmpty()) {
|
||||
havexmdh=true;
|
||||
havexmdh = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (havexmdh) {
|
||||
i++;
|
||||
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;
|
||||
}
|
||||
i++;
|
||||
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);
|
||||
return new Result("0", "获取成功!", historyResultDTO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result getclinicref(String yq, String xmdh) {
|
||||
String lcyy=lisWorkPageInfoMapper.getclinicref(yq,xmdh);
|
||||
return new Result("0","获取成功!",lcyy);
|
||||
String lcyy = lisWorkPageInfoMapper.getclinicref(yq, xmdh);
|
||||
return new Result("0", "获取成功!", lcyy);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -162,7 +162,7 @@
|
||||
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
|
||||
<if test="startda != null">and a.jyrq >= #{startda}</if>
|
||||
<if test="endda != null">and #{endda} >= a.jyrq </if>
|
||||
<if test="endda != null"><![CDATA[and a.jyrq <= #{endda}]]> </if>
|
||||
<if test="yqdl != null and yqdl != ''"> and d.yqdl = #{yqdl}</if>
|
||||
<if test="brdh != null and brdh != ''"> and a.brdh = #{brdh}</if>
|
||||
<if test="brxm != null and brxm !=''">and a.brxm = #{brxm}</if>
|
||||
@ -173,6 +173,7 @@
|
||||
<if test="yq != null and yq != ''"> and a.yq = #{yq}</if>
|
||||
<if test="ybh != null and ybh != ''"> and a.ybh = #{ybh}</if>
|
||||
order by c.dyxh asc
|
||||
|
||||
</select>
|
||||
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user