主程序

This commit is contained in:
tangw 2025-10-22 17:45:29 +08:00
parent 6873ee8393
commit ad59e5e93f
12 changed files with 346 additions and 356 deletions

View File

@ -14,4 +14,8 @@ public interface LabInstrMapper {
String getYqdl(@Param("yq")String yq);
String getBgdh(@Param("yq")String yq);
String getLisgroup(@Param("yq")String yq);
List<LabInstr> getInstrdList(@Param("lisgroup") String lisgroup, @Param("yljg") String yljg, @Param("useflag") String useflag, @Param("userno") String userno, @Param("powerbit") String powerbit);
List<LabInstr> querybylisgroup(@Param("lisgroup") String lisgroup, @Param("yljg") String yljg, @Param("useflag") String useflag);
}

View File

@ -1,14 +1,11 @@
package com.czlis.interfaceCommon.utils;
import com.czlis.common.core.domain.Result;
import com.czlis.common.core.domain.entity.lis.*;
import com.czlis.common.utils.ComDictUtils;
import com.czlis.common.utils.ComOptionUtils;
import com.czlis.interfaceCommon.mapper.*;
import com.czlis.interfaceCommon.pojo.entity.LastLabPatParam;
import com.sun.org.apache.bcel.internal.generic.RETURN;
import org.apache.commons.lang3.time.DateFormatUtils;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
@ -417,7 +414,12 @@ public class CommonUtil {
public LabInstr getLabInstr(String yq) {
return labInstrMapper.getLabInstr(yq);
}
public List<LabInstr> getInstrdList(String lisgroup,String yljg,String useflag,String userno,String powerbit){
return labInstrMapper.getInstrdList(lisgroup, yljg, useflag, userno, powerbit);
}
public List<LabInstr> querybylisgroup(String lisgroup,String yljg,String useflag){
return labInstrMapper.querybylisgroup(lisgroup, yljg, useflag);
}
public List<LabInstr> getLabInstrList(LabInstr labInstr) {
return labInstrMapper.getLabInstrList(labInstr);
}
@ -456,9 +458,9 @@ public class CommonUtil {
//字典查询单位名称
public String getCompany(String yljg) {
if (yljg == null || yljg.equals("")) return getCompany();
if (yljg == null || yljg.isEmpty()) return getCompany();
String zdmc = getComDictNameById("HOS", yljg);
if (zdmc == null || zdmc.equals("")) {
if (zdmc == null || zdmc.isEmpty()) {
return yljg;
} else {
return zdmc;
@ -467,7 +469,7 @@ public class CommonUtil {
public String getCompany() {
String zdmc = getComDictNameById("99", "COMPANY");
if (zdmc == null || zdmc.equals("")) {
if (zdmc == null || zdmc.isEmpty()) {
return "";
} else {
return zdmc;
@ -481,11 +483,11 @@ public class CommonUtil {
List<ComDict> comDictList = getDictCache(zdlb);
if (comDictList != null) {
List<ComDict> collect = comDictList.stream().filter(comDict -> comDict.getZddh().equals(zddh)).collect(Collectors.toList());
if (collect.size() > 0) {
if (!collect.isEmpty()) {
return collect.get(0).getZdmc();
}else{
List<ComDict> collect0 = comDictList.stream().filter(comDict -> comDict.getZdmc().equals(zddh)).collect(Collectors.toList());
if (collect0.size() > 0) {
if (!collect0.isEmpty()) {
return collect0.get(0).getZdmc();
}
}
@ -499,11 +501,11 @@ public class CommonUtil {
List<ComDict> comDictList = getDictCache(zdlb);
if (comDictList != null) {
List<ComDict> collect = comDictList.stream().filter(comDict -> comDict.getZdmc().equals(zdmc)).collect(Collectors.toList());
if (collect.size() > 0) {
if (!collect.isEmpty()) {
return collect.get(0).getZddh();
}else{
List<ComDict> collect0 = comDictList.stream().filter(comDict -> comDict.getZddh().equals(zdmc)).collect(Collectors.toList());
if (collect0.size() > 0) {
if (!collect0.isEmpty()) {
return collect0.get(0).getZddh();
}
}
@ -586,8 +588,7 @@ public class CommonUtil {
if ("S".equals(yhjs)) return true;
String userPower = comUsrpowerMapper.getUserPower(yq, yhdh);
if (userPower == null) return false;
if ("Y".equals(userPower.substring(powerIdx - 1, 1))) return true;
return false;
return "Y".equals(userPower.substring(powerIdx - 1, 1));
}
public byte[] getComUsrdzqm(String yhdh) {
return comUsrMapper.getComUsrdzqm(yhdh);

View File

@ -51,6 +51,7 @@ public class LisWorkUtils {
CommonUtil commonUtil;
@Autowired
LisWorkUtils lisWorkUtils;
/**
* 初步审核
*
@ -61,7 +62,7 @@ public class LisWorkUtils {
* @return
*/
public Result confirm1(Date jyrq, String yq, String ybh, String hdys, int problemId) {
if (hdys == null || "".equals(hdys)) return new Result("-1", "审核者为空,无法审核!");
if (hdys == null || hdys.isEmpty()) return new Result("-1", "审核者为空,无法审核!");
LabPat labPat = commonUtil.getLabPatOne(jyrq, yq, ybh);
labPat.setHdys(hdys);
List<LabResult> labResultList = commonUtil.getLabResultList(jyrq, yq, ybh);
@ -123,7 +124,7 @@ public class LisWorkUtils {
public Result saveallresult(Date jyrq, String yq, String ybh) {
int finsh = 1;
List<LabResult> labResultList = commonUtil.getLabResultList(jyrq, yq, ybh);
if (labResultList == null || labResultList.size() == 0) return new Result("-1", "结果为空!");
if (labResultList == null || labResultList.isEmpty()) return new Result("-1", "结果为空!");
for (LabResult labResult : labResultList) {
String csjg = labResult.getCsjg();
if ("未做".equals(csjg)) {
@ -164,7 +165,7 @@ public class LisWorkUtils {
* @return
*/
public Result confirm(Date jyrq, String yq, String ybh, String hdys, int problemId) {
if (hdys == null || "".equals(hdys)) return new Result("-1", "审核者为空,无法审核!");
if (hdys == null || hdys.isEmpty()) return new Result("-1", "审核者为空,无法审核!");
LabPat labPat = commonUtil.getLabPatOne(jyrq, yq, ybh);
labPat.setHdys(hdys);
List<LabResult> labResultList = commonUtil.getLabResultList(jyrq, yq, ybh);
@ -236,10 +237,10 @@ public class LisWorkUtils {
* @return
*/
private Result beforeconfirm(LabPat labPat, List<LabResult> labResultList, Integer checktype, Integer problemId) {
if (labPat == null) return new Result("-1", "病人信息为空禁止审核!");
Date jyrq = labPat.getJyrq();
String yq = labPat.getYq();
String ybh = labPat.getYbh();
if (labPat == null) return new Result("-1", "病人信息为空禁止审核!");
String jgbz = labPat.getJgbz();
if ("2".equals(jgbz)) return new Result("1", "报告已审核!");
if ("5".equals(jgbz)) return new Result("-1", "已锁定报告禁止审核!");
@ -252,33 +253,33 @@ public class LisWorkUtils {
}
String limit_brly = commonUtil.getHISOPT("limit_brly");
String brly = labPat.getBrly();
if ("1".equals(limit_brly) && (brly == null || "".equals(brly)))
if ("1".equals(limit_brly) && (brly == null || brly.isEmpty()))
return new Result("-1", "病人类型为空,禁止审核!");
String limit_yblx = commonUtil.getHISOPT("limit_yblx");
String yblx = labPat.getYblx();
if ("1".equals(limit_yblx) && (yblx == null || "".equals(yblx)))
if ("1".equals(limit_yblx) && (yblx == null || yblx.isEmpty()))
return new Result("-1", "样本类型为空,禁止审核!");
String limit_brxm = commonUtil.getHISOPT("limit_brxm");
String brxm = labPat.getBrxm();
if ("1".equals(limit_brxm) && (brxm == null || "".equals(brxm)))
if ("1".equals(limit_brxm) && (brxm == null || brxm.isEmpty()))
return new Result("-1", "病人姓名为空,禁止审核!");
if ((brxm == null || "".equals(brxm)) && problemId < 1) new Result("5", "姓名为空,你确定要审核吗?", 1);
if ((brxm == null || brxm.isEmpty()) && problemId < 1) new Result("5", "姓名为空,你确定要审核吗?", 1);
String limit_ksdh = commonUtil.getHISOPT("limit_ksdh");
String ksdh = labPat.getKsdh();
if ("1".equals(limit_ksdh) && (ksdh == null || "".equals(ksdh)))
if ("1".equals(limit_ksdh) && (ksdh == null || ksdh.isEmpty()))
return new Result("-1", "科室单位为空,禁止审核!");
String limit_patno = commonUtil.getHISOPT("limit_patno");
String brdh = labPat.getBrdh();
String brlyname = commonUtil.getComDictNameById("PT", brly);
if ("1".equals(limit_patno) && (brdh == null || "".equals(brdh))) {
if ("1".equals(limit_patno) && (brdh == null || brdh.isEmpty())) {
if (!"质控".equals(brlyname)) return new Result("-1", "病历号不能为空,禁止审核!");
}
String limit_brpatno = commonUtil.getHISOPT("limit_brpatno");
if ("1".equals(limit_brpatno) && (brdh == null || "".equals(brdh))) {
if ("1".equals(limit_brpatno) && (brdh == null || brdh.isEmpty())) {
if ("1".equals(brly) || "3".equals(brly)) return new Result("-1", "门诊住院的病历号不能为空,禁止审核!");
}
String yqdl = commonUtil.getYqdl(yq);
if (labResultList == null || labResultList.size() == 0) return new Result("-1", "结果为空禁止审核!");
if (labResultList == null || labResultList.isEmpty()) return new Result("-1", "结果为空禁止审核!");
for (LabResult labResult : labResultList) {
String csjg = labResult.getCsjg();
if ("未做".equals(csjg)) {
@ -307,7 +308,7 @@ public class LisWorkUtils {
if (wxh > 0) return new Result("-1", "有结果为****禁止审核!");
}
String sqh = labPat.getSqh();
if (sqh != null && !"".equals(sqh)) {
if (sqh != null && !sqh.isEmpty()) {
if (!"质控".equals(brlyname)) {
if ("1".equals(commonUtil.getHISOPT("sp_dublereport"))) {
LabPat labPat0 = lisWorkUtilsMapper.checkdublereport(sqh, ybh);
@ -329,7 +330,7 @@ public class LisWorkUtils {
}
String Userid = labPat.getHdys();
if (Userid == null || "".equals(Userid)) {
if (Userid == null || Userid.isEmpty()) {
Userid = SecurityUtils.getLoginUser().getUsername();
}
//初审不需要调用接口
@ -345,7 +346,7 @@ public class LisWorkUtils {
if (!"细菌仪".equals(yqdl)) {
if (!"1".equals(commonUtil.getHISOPT("wswcbbgbl"))) {
String ls_cbbgyq = commonUtil.getComOptValue(yq, "cbbgyq");
if (ls_cbbgyq != null && !"".equals(ls_cbbgyq)) {
if (ls_cbbgyq != null && !ls_cbbgyq.isEmpty()) {
String ls_ejbgyq = "EJBG" + ls_cbbgyq;
ls_cbbgyq = "CBBG" + ls_cbbgyq;
int count = commonUtil.getCountByKey(jyrq, ls_cbbgyq, ybh);
@ -398,9 +399,9 @@ public class LisWorkUtils {
Date currenttime = DateUtils.getNowDate();
int weekDay = DateUtils.getWeekDay(currenttime);
//周末不算
if (weekDay == 6 && weekDay == 7) return 0;
if (weekDay == 6 || weekDay == 7) return 0;
int lt_now = Integer.parseInt(DateUtils.time(currenttime, "HH:mm").replace(":", ""));
if ((sb1 == null || sb1.isEmpty()) && (sb2 == null || sb2.isEmpty())) {
if ((sb1 != null && !sb1.isEmpty()) && (sb2 != null && !sb2.isEmpty())) {
sb1 = sb1.replace(":", "");
sb2 = sb2.replace(":", "");
@ -409,6 +410,10 @@ public class LisWorkUtils {
int nsb2 = Integer.parseInt(sb2);
if (lt_now > nsb1 && lt_now < nsb2) return 1;
}
}
if ((sb3 != null && !sb3.isEmpty()) && (sb4 != null && !sb4.isEmpty())) {
sb3 = sb3.replace(":", "");
sb4 = sb4.replace(":", "");
if (LisUtil.isTureNumber(sb3) && LisUtil.isTureNumber(sb4)) {
int nsb3 = Integer.parseInt(sb3);
int nsb4 = Integer.parseInt(sb4);
@ -436,12 +441,12 @@ public class LisWorkUtils {
}
//计算项目更新
List<XmCalc> xmCalcList = commonUtil.getXmCalcList(yq);
if (xmCalcList.size() > 0) {
if (!xmCalcList.isEmpty()) {
labResultList = calcsample(labPat, labResultList, xmCalcList);
}
//补写结果表申请单项目编号
String sqh = labPat.getSqh();
if (sqh != null && !"".equals(sqh)) setItemSqxmdh(jyrq, yq, ybh, sqh);
if (sqh != null && !sqh.isEmpty()) setItemSqxmdh(jyrq, yq, ybh, sqh);
//保存最新参考值结果标志
labResultList = saverefs(labPat);
return labResultList;
@ -449,14 +454,13 @@ public class LisWorkUtils {
public void setItemSqxmdh(Date jyrq, String yq, String ybh) {
String sqh = commonUtil.getSqhByKey(jyrq, yq, ybh);
if (sqh == null || "".equals(sqh)) {
} else {
if (sqh != null && !sqh.isEmpty()) {
setItemSqxmdh(jyrq, yq, ybh, sqh);
}
}
private void setItemSqxmdh(Date jyrq, String yq, String ybh, String sqh) {
if (sqh != null && !"".equals(sqh)) {
if (sqh != null && !sqh.isEmpty()) {
int sl = labReqdetailMapper.getCountByKey(sqh);
if (sl == 1) {
String sqxmdh = lisWorkUtilsMapper.selectSqxmdh(sqh);
@ -471,7 +475,7 @@ public class LisWorkUtils {
LabPat labPat = commonUtil.getLabPatOne(jyrq, yq, ybh);
List<LabResult> labResultList = commonUtil.getLabResultList(jyrq, yq, ybh);
List<XmCalc> xmCalcList = commonUtil.getXmCalcList(yq);
if (xmCalcList.size() > 0) {
if (!xmCalcList.isEmpty()) {
calcsample(labPat, labResultList, xmCalcList);
}
return new Result("0", "保存成功!");
@ -491,11 +495,10 @@ public class LisWorkUtils {
boolean lb_jsx = false;
Map<String, String> variables = new HashMap<>();
String[] parameters = CalcUtils.getParameters(jsgs);
for (int i = 0; i < parameters.length; i++) {
String itemcode = parameters[i];
for (String itemcode : parameters) {
if ("SEX".equals(itemcode)) {
String sex = labPat.getBrxb();
if(sex==null||"".equals(sex)||" ".equals(sex)){
if (sex == null || sex.isEmpty() || " ".equals(sex)) {
setjgsg = false;
break;
}
@ -505,7 +508,7 @@ public class LisWorkUtils {
variables.put("SEX", sex);
lb_jsx = true;
} else if ("AGE".equals(itemcode)) {
if(labPat.getNl()==null||labPat.getNldw()==null||"".equals(labPat.getNldw())||" ".equals(labPat.getNldw())){
if (labPat.getNl() == null || labPat.getNldw() == null || labPat.getNldw().isEmpty() || " ".equals(labPat.getNldw())) {
setjgsg = false;
break;
}
@ -514,7 +517,7 @@ public class LisWorkUtils {
lb_jsx = true;
} else {
List<LabResult> collect = labResultList.stream().filter(result -> result.getXmdh().equals(itemcode)).collect(Collectors.toList());
if (collect.size() > 0) {
if (!collect.isEmpty()) {
variables.put(itemcode, collect.get(0).getCsjg());
} else {
setjgsg = false;
@ -613,7 +616,7 @@ public class LisWorkUtils {
String retCode = String.valueOf(map.get("retcode"));
String retMsg = String.valueOf(map.get("retmsg"));
log.info("调用存储过程{}返回值:{},{}", "sp_setrefs", retCode, retMsg);
if (retCode == null || "".equals(retCode) || "-1".equals(retCode)) lb_setbj = false;
if (retCode == null || retCode.isEmpty() || "-1".equals(retCode)) lb_setbj = false;
labResultList = commonUtil.getLabResultList(jyrq, yq, ybh);
log.info("labResultList.size:{}", labResultList.size());
List<XmInfo> xmInfoList = commonUtil.getXmInfoList(yq);
@ -629,8 +632,10 @@ public class LisWorkUtils {
//当结果为数值并且与周期诊断无关,计算存储过程保存成功后,只进行危急值判断
if (lb_nummode && lb_setbj && !"Y".equals(ygzd) && !"Y".equals(ygzq)) {
if (nowjz) {
String resultalarmflag1 = labResult.getAlarm_flag().trim();
if (!"".equals(resultalarmflag1) && resultalarmflag1 != null) {
String resultalarmflag1 = labResult.getAlarm_flag();
if(resultalarmflag1 != null)resultalarmflag1=resultalarmflag1.trim();
else resultalarmflag1="";
if (!resultalarmflag1.isEmpty()) {
labResult.setAlarm_flag("");
commonUtil.updateLabResult(labResult);
}
@ -659,7 +664,7 @@ public class LisWorkUtils {
} else {
String xmdh = labResult.getXmdh();
List<XmInfo> xmInfo0 = xmInfoList.stream().filter(xm -> xm.getXmdh().equals(xmdh)).collect(Collectors.toList());
if (xmInfo0.size() > 0) {
if (!xmInfo0.isEmpty()) {
XmInfo xmInfo = xmInfo0.get(0);
List<XmAlarmdetail> getXmAlarmdetail = xmAlarmdetailList.stream().filter(detail -> detail.getXmdh().equals(xmdh)).collect(Collectors.toList());
LabResult labResult0 = setxmdhrefs(labPat, labResult, xmInfo, getXmAlarmdetail, nowjz);
@ -704,7 +709,7 @@ public class LisWorkUtils {
*/
private int alarmcondition(LabPat labPat, LabResult labResult, List<XmAlarmdetail> getXmAlarmdetail) {
if (getXmAlarmdetail == null) return -1;
boolean lb_fcb = false, lb_hasval = false;
boolean lb_fcb, lb_hasval = false;
String csjg = labResult.getCsjg();
if (csjg == null || csjg.trim().isEmpty()) return -1;
String yq = labPat.getYq();
@ -842,7 +847,7 @@ public class LisWorkUtils {
if (altersx != null) hlimit = altersx;
}
//数值型结果判断
Double csjgnum = Double.valueOf(csjgnew);
double csjgnum = Double.parseDouble(csjgnew);
if (ckxx != null) if (csjgnum < ckxx) resultflag = "L";
if (cksx != null) if (csjgnum > cksx) resultflag = "H";
if (!nowjz) {
@ -858,7 +863,7 @@ public class LisWorkUtils {
//文字型结果判断
String jgbzold = labResult.getJgbz();
String lmtflag = getitemlmtflag(yq, xmdh, csjg);
if ("P".equals(jgbzold) && (csjg.indexOf("阳") >= 0 || csjg.indexOf("+") >= 0 || csjg.indexOf(":") >= 0) && (lmtflag == null || lmtflag.trim().isEmpty()))
if ("P".equals(jgbzold) && (csjg.contains("阳") || csjg.contains("+") || csjg.contains(":")) && (lmtflag == null || lmtflag.trim().isEmpty()))
lmtflag = "P";
resultflag = lmtflag;
if (!nowjz) {
@ -890,7 +895,7 @@ public class LisWorkUtils {
}
public String getitemlmtflag(String yq, String xmdh, String csjg) {
String jgbz = "";
String jgbz;
if (csjg == null || csjg.isEmpty()) {
return "";
}
@ -920,7 +925,7 @@ public class LisWorkUtils {
//医学审核条件判断
if (problemId < 6) {
String checkvalue = checkResultUtils.chksample(labPat, labResultList);
if (checkvalue != null && !"".equals(checkvalue)) {
if (checkvalue != null && !checkvalue.isEmpty()) {
return new Result("5", checkvalue, 6);
}
}
@ -1093,22 +1098,22 @@ public class LisWorkUtils {
Date bbsjsj = labReqmain.getBbsjsj();
Date jssj = labReqmain.getJssj();
Date sjsj = labReqmain.getSjsj();
if (sjsj == null) sjsj = jysj;
if (sjsj.after(confirmtime)) sjsj = jysj;
if (jssj == null) jssj = sjsj;
if (jssj.after(confirmtime)) jssj = sjsj;
if (sjsj == null&&jysj !=null) sjsj =new Date(jysj.getTime());
if (sjsj !=null&&sjsj.after(confirmtime)&&jysj !=null) sjsj =new Date(jysj.getTime());
if (jssj == null&&sjsj !=null) jssj =new Date(sjsj.getTime());
if (jssj !=null&&jssj.after(confirmtime)&&sjsj !=null) jssj = new Date(sjsj.getTime());
if (bbsjsj != null) {
if (bbsjsj.after(jssj) && jysj.after(bbsjsj)) jssj = jysj;
if (jysj !=null&&bbsjsj.after(jssj) && jysj.after(bbsjsj)) jssj = new Date(jysj.getTime());
}
if (cysj != null) {
if (cysj.after(jssj) && jysj.after(cysj)) jssj = jysj;
if (cysj != null&&jysj !=null) {
if (cysj.after(jssj) && jysj.after(cysj)) jssj =new Date(jysj.getTime());
}
if (jssj.after(sjsj)) sjsj = jysj;
if (jysj !=null&&jssj.after(sjsj)) sjsj =new Date(jysj.getTime());
List<LabReqsteplog> labReqsteplog = commonUtil.getLabReqsteplog(sqh);
if (bbsjsj != null && bbsjsj.after(jssj)) {
Date sj = jssj;
Date finalSj = sj;
if (jssj !=null&&bbsjsj != null && bbsjsj.after(jssj)) {
Date sj = new Date(jssj.getTime());
Date finalSj = new Date(jssj.getTime());
Optional<LabReqsteplog> maxTimeEntity = labReqsteplog.stream()
.filter(entity -> "13".equals(entity.getZt()))
.filter(entity -> entity.getChangedate().before(finalSj))
@ -1116,13 +1121,13 @@ public class LisWorkUtils {
if (maxTimeEntity.isPresent()) {
sj = maxTimeEntity.get().getChangedate();
}
bbsjsj = sj;
bbsjsj = new Date(sj.getTime());
labReqmain.setBbsjsj(bbsjsj);
} else {
bbsjsj = jssj;
if(jssj !=null) bbsjsj = new Date(jssj.getTime());
}
if (cysj != null && cysj.after(bbsjsj)) {
Date sj = bbsjsj;
if (bbsjsj != null && cysj != null && cysj.after(bbsjsj)) {
Date sj = new Date(bbsjsj.getTime());
Date finalSj = sj;
Optional<LabReqsteplog> maxTimeEntity = labReqsteplog.stream()
.filter(entity -> "12".equals(entity.getZt()))
@ -1131,25 +1136,25 @@ public class LisWorkUtils {
if (maxTimeEntity.isPresent()) {
sj = maxTimeEntity.get().getChangedate();
}
cysj = sj;
cysj =new Date(sj.getTime());
labReqmain.setCysj(cysj);
}
if (cysj != null && zxsj.after(cysj) && bbsjsj.after(zxsj)) {
Date sj = bbsjsj;
Date finalSj = sj;
if (bbsjsj != null && cysj != null && zxsj.after(cysj) && bbsjsj.after(zxsj)) {
Date finalSj = new Date(bbsjsj.getTime());
Optional<LabReqsteplog> maxTimeEntity = labReqsteplog.stream()
.filter(entity -> "12".equals(entity.getZt()))
.filter(entity -> entity.getChangedate().before(finalSj))
.max(Comparator.comparing(LabReqsteplog::getChangedate));
if (maxTimeEntity.isPresent()) {
cysj = maxTimeEntity.get().getChangedate();
} else cysj = zxsj;
} else cysj = new Date(zxsj.getTime());
labReqmain.setCysj(cysj);
} else {
cysj = bbsjsj;
if(bbsjsj != null ) cysj =new Date(bbsjsj.getTime());
}
if (zxsj != null && zxsj.after(cysj)) {
Date sj = cysj;
if (cysj != null && zxsj != null && zxsj.after(cysj)) {
Date sj = new Date(cysj.getTime());
Date finalSj = sj;
Optional<LabReqsteplog> maxTimeEntity = labReqsteplog.stream()
.filter(entity -> "11".equals(entity.getZt()))
@ -1159,10 +1164,10 @@ public class LisWorkUtils {
sj = maxTimeEntity.get().getChangedate();
}
zxsj = sj;
zxsj = new Date(sj.getTime());
labReqmain.setZxsj(zxsj);
}
labReqmain.setSjsj(sjsj);
if (sjsj != null)labReqmain.setSjsj(sjsj);
}
return labReqmain;
}
@ -1195,7 +1200,7 @@ public class LisWorkUtils {
labRefused.setSqh(ls_sqh);
labRefused.setRefusetext(ls_xpywrdh);
List<LabRefused> labRefusedList = commonUtil.getLabRefusedList(labRefused);
if (labRefusedList.size() == 0) {
if (labRefusedList.isEmpty()) {
labRefused.setRefusedtime(new Date());
labRefused.setKsdh(labPat.getKsdh());
labRefused.setBz("0");
@ -1215,8 +1220,8 @@ public class LisWorkUtils {
*/
private boolean getAlarmFlag(List<LabResult> labResultList) {
boolean wjz = false;
List<LabResult> labResultList0 = labResultList.stream().filter(xm -> !"".equals(xm.getAlarm_flag().trim()) && xm.getAlarm_flag() != null).collect(Collectors.toList());
if (labResultList0.size() > 0) {
List<LabResult> labResultList0 = labResultList.stream().filter(xm ->xm.getAlarm_flag() != null).filter(xm -> !xm.getAlarm_flag().trim().isEmpty()).collect(Collectors.toList());
if (!labResultList0.isEmpty()) {
wjz = true;
}
return wjz;
@ -1229,9 +1234,9 @@ public class LisWorkUtils {
* @return
*/
private String getAlarmMsg(List<LabResult> labResultList) {
String wjzmsg = "";
List<LabResult> labResultList0 = labResultList.stream().filter(xm -> !"".equals(xm.getAlarm_flag().trim()) && xm.getAlarm_flag() != null).collect(Collectors.toList());
if (labResultList0.size() > 0) {
StringBuilder wjzmsg = new StringBuilder();
List<LabResult> labResultList0 = labResultList.stream().filter(xm ->xm.getAlarm_flag() != null).filter(xm -> !xm.getAlarm_flag().trim().isEmpty()).collect(Collectors.toList());
if (!labResultList0.isEmpty()) {
for (LabResult labResult : labResultList0) {
String xmmc = labResult.getXmmc();
String cjsg = labResult.getCsjg();
@ -1241,10 +1246,10 @@ public class LisWorkUtils {
cjsg = "";
}
wjzmsg = wjzmsg + "项目:" + xmmc + cjsg + LisUtil.LINE_SEPARATOR;
wjzmsg.append("项目:").append(xmmc).append(cjsg).append(LisUtil.LINE_SEPARATOR);
}
}
return wjzmsg;
return wjzmsg.toString();
}
/**
@ -1343,11 +1348,11 @@ public class LisWorkUtils {
yhdh = sysUser.getNickName();
} else {
String yhxm = commonUtil.getComUsrName(yhdh);
if (yhxm != null && "".equals(yhxm)) yhdh = yhxm;
if (yhxm != null && yhxm.isEmpty()) yhdh = yhxm;
}
String sjys = labPat.getSjys();
String sjysname = commonUtil.getComDictNameById("SRD", sjys);
if (sjysname == null || "".equals(sjysname)) {
if (sjysname == null || sjysname.isEmpty()) {
sjysname = sjys;
}
if ("".equals(qrr) || qrr == null) {
@ -1369,8 +1374,8 @@ public class LisWorkUtils {
}
commonUtil.insertLabPatwarning(labPatwarning);
String ls_bz = "";
List<LabResult> labResultList0 = labResultList.stream().filter(xm -> !"".equals(xm.getAlarm_flag().trim()) && xm.getAlarm_flag() != null).collect(Collectors.toList());
if (labResultList0.size() > 0) {
List<LabResult> labResultList0 = labResultList.stream().filter(xm -> xm.getAlarm_flag() != null).filter(xm -> !xm.getAlarm_flag().trim().isEmpty()).collect(Collectors.toList());
if (!labResultList0.isEmpty()) {
for (LabResult labResult : labResultList0) {
LabResultwarning labResultwarning = new LabResultwarning();
labResultwarning.setJyrq(jyrq);
@ -1457,7 +1462,7 @@ public class LisWorkUtils {
* @return
*/
public Result unconfirm(Date jyrq, String yq, String ybh, String yhdh) {
if (yhdh == null || "".equals(yhdh)) return new Result("1", "操作者为空,无法解除审核!");
if (yhdh == null || yhdh.isEmpty()) return new Result("1", "操作者为空,无法解除审核!");
int problemId = ServletUtils.getParameterToInt("problemId", 0);
LabPat labPat = commonUtil.getLabPatOne(jyrq, yq, ybh);
if (problemId < 3) {
@ -1549,7 +1554,7 @@ public class LisWorkUtils {
}
public Result unconfirm1(Date jyrq, String yq, String ybh, String yhdh) {
if (yhdh == null || "".equals(yhdh)) return new Result("1", "操作者为空,无法解除审核!");
if (yhdh == null || yhdh.isEmpty()) return new Result("1", "操作者为空,无法解除审核!");
int problemId = ServletUtils.getParameterToInt("problemId", 0);
LabPat labPat = commonUtil.getLabPatOne(jyrq, yq, ybh);
if (problemId < 3) {
@ -1600,17 +1605,17 @@ public class LisWorkUtils {
loginConfigParam.setCurrent_labInputcol(labInputcolList);
}
}
Boolean setcalc = false;
boolean setcalc = false;
List<XmCalc> xmCalcList = null;
switch (column) {
case "brxb":
xmCalcList = commonUtil.getXmCalcbyxmdh(yq, "SEX");
if (xmCalcList.size() > 0) setcalc = true;
if (!xmCalcList.isEmpty()) setcalc = true;
break;
case "nl":
case "nldw":
xmCalcList = commonUtil.getXmCalcbyxmdh(yq, "AGE");
if (xmCalcList.size() > 0) setcalc = true;
if (!xmCalcList.isEmpty()) setcalc = true;
break;
}
if (setcalc) {
@ -1618,9 +1623,9 @@ public class LisWorkUtils {
LabPat labPat = commonUtil.getLabPatOne(jyrq, yq, ybh);
boolean nowjz = checknowjz(labPat);
labResultList = calcsample(labPat, labResultList, xmCalcList);
if(labResultList.size()>0) {
if (!labResultList.isEmpty()) {
List<LabResult> labResultList1 = labResultList.stream().filter(labR -> labR.getChangeflag() != null && labR.getChangeflag() == 1).collect(Collectors.toList());
if (labResultList1.size() > 0) {
if (!labResultList1.isEmpty()) {
for (LabResult labResult0 : labResultList1) {
changeresultf(labPat, labResult0, nowjz);
}
@ -1650,7 +1655,7 @@ public class LisWorkUtils {
String yqdl = commonUtil.getYqdl(yq);
if ("细菌仪".equals(yqdl)) {
String cbbgyq = commonUtil.getComOptValue(yq, "cbbgyq");
if(cbbgyq!=null&&!"".equals(cbbgyq)) {
if (cbbgyq != null && !cbbgyq.isEmpty()) {
String is_instr_cbbg = "CBBG" + cbbgyq;
String is_instr_ejbg = "EJBG" + cbbgyq;
String jgbz0 = commonUtil.getLabPatJgbz(jyrq, is_instr_cbbg, ybh);
@ -1673,6 +1678,7 @@ public class LisWorkUtils {
setComLog(jyrq, yq, ybh, yhdh, ComLogConstants.LG_M, "删除整个样本");
return new Result("0", "保存成功");
}
private void delsample(Date jyrq, String yq, String ybh) {
commonUtil.delLabResultMedAll(jyrq, yq, ybh);
commonUtil.delLabResultAll(jyrq, yq, ybh);
@ -1699,11 +1705,11 @@ public class LisWorkUtils {
labResult = setxmdhrefs(labPat, labResult, xmInfo, getXmAlarmdetail, nowjz);
commonUtil.insertLabResult(labResult);
List<XmCalc> xmCalcList = commonUtil.getXmCalcbyxmdh(yq, xmdh);
if (xmCalcList.size() > 0) {
if (!xmCalcList.isEmpty()) {
List<LabResult> labResultList = commonUtil.getLabResultList(jyrq, yq, ybh);
labResultList = calcsample(labPat, labResultList, xmCalcList);
List<LabResult> labResultList1 = labResultList.stream().filter(labR -> labR.getChangeflag() != null).filter(labR -> labR.getChangeflag() == 1).collect(Collectors.toList());
if (labResultList1.size() > 0) {
if (!labResultList1.isEmpty()) {
for (LabResult labResult0 : labResultList1) {
changeresultf(labPat, labResult0, nowjz);
}
@ -1743,11 +1749,11 @@ public class LisWorkUtils {
labResult = setxmdhrefs(labPat, labResult, xmInfo, getXmAlarmdetail, nowjz);
commonUtil.updateLabResult(labResult);
List<XmCalc> xmCalcList = commonUtil.getXmCalcbyxmdh(yq, xmdh);
if (xmCalcList.size() > 0) {
if (!xmCalcList.isEmpty()) {
List<LabResult> labResultList = commonUtil.getLabResultList(jyrq, yq, ybh);
labResultList = calcsample(labPat, labResultList, xmCalcList);
List<LabResult> labResultList1 = labResultList.stream().filter(labR -> labR.getChangeflag() != null).filter(labR -> labR.getChangeflag() == 1).collect(Collectors.toList());
if (labResultList1.size() > 0) {
if (!labResultList1.isEmpty()) {
for (LabResult labResult0 : labResultList1) {
changeresultf(labPat, labResult0, nowjz);
}
@ -1780,11 +1786,11 @@ public class LisWorkUtils {
LabInstrvsreqclass labInstrvsreqclass = new LabInstrvsreqclass();
labInstrvsreqclass.setYq(yq);
List<LabInstrvsreqclass> labInstrvsreqclassList = labInstrvsreqclassMapper.getLabInstrvsreqclassList(labInstrvsreqclass);
if (labInstrvsreqclassList.size() > 0) {
if (!labInstrvsreqclassList.isEmpty()) {
List<LabInstrvsreqclass> collect = labInstrvsreqclassList.stream().filter(labInstrvsreqclass1 -> labInstrvsreqclass1.getBgddh().equals(bgddh)).collect(Collectors.toList());
List<LabInstrvsreqclass> collect1 = labInstrvsreqclassList.stream().filter(labInstrvsreqclass1 -> labInstrvsreqclass1.getBgddh().equals("MZ_" + bgddh)).collect(Collectors.toList());
if (collect.size() > 0) return new Result("0", "");
if (collect1.size() > 0) return new Result("0", "");
if (!collect.isEmpty()) return new Result("0", "");
if (!collect1.isEmpty()) return new Result("0", "");
}
Long count = lisWorkUtilsMapper.checkReqClass(sqh, yq);
if (count > 0) {
@ -1848,9 +1854,10 @@ public class LisWorkUtils {
else commonUtil.updateLabPat(labPat);
return new Result("0", "保存成功!", labPat);
}
public Result newPat(Date jyrq, String ybh, String yq, String brdh, String brly, String yljg, int problemId) {
if (brly == null) brly = "";
if(yljg==null||"".equals(yljg))yljg=commonUtil.getLabInstr(yq).getYljg();
if (yljg == null || yljg.isEmpty()) yljg = commonUtil.getLabInstr(yq).getYljg();
LabPat labPat = commonUtil.getLabPatOne(jyrq, yq, ybh);
boolean newpatinfo = true;
if (labPat != null) {
@ -1863,7 +1870,7 @@ public class LisWorkUtils {
String sqh0 = labPat.getSqh();
String brxm = labPat.getBrxm();
if (problemId < 1) {
if ((brdh0 != null && !"".equals(brdh0)) || (sqh0 != null && !"".equals(sqh0)) || (brxm != null && !"".equals(brxm))) {
if ((brdh0 != null && !brdh0.isEmpty()) || (sqh0 != null && !sqh0.isEmpty()) || (brxm != null && !brxm.isEmpty())) {
return new Result("5", "当前样本已有病人信息是否替换!", 1);
}
}
@ -1907,7 +1914,7 @@ public class LisWorkUtils {
labPat.setZd(msgret[8]);
} else {
List<ComPat> comPatList = commonUtil.getComPat(brdh, yljg);
if(comPatList.size()>0) {
if (!comPatList.isEmpty()) {
ComPat comPat = comPatList.get(0);
labPat.setBrxm(comPat.getBrxm());
labPat.setCh(comPat.getCh());
@ -1943,6 +1950,7 @@ public class LisWorkUtils {
else commonUtil.updateLabPat(labPat);
return new Result("0", "保存成功!", labPat);
}
public Result newPatInfo(Date jyrq, String ybh, String sqh, String yq, int problemId) {
LabPat labPat = commonUtil.getLabPatOne(jyrq, yq, ybh);
@ -1957,7 +1965,7 @@ public class LisWorkUtils {
String sqh0 = labPat.getSqh();
String brxm = labPat.getBrxm();
if (problemId < 1) {
if ((brdh != null && !"".equals(brdh)) || (sqh0 != null && !"".equals(sqh0)) || (brxm != null && !"".equals(brxm))) {
if ((brdh != null && !brdh.isEmpty()) || (sqh0 != null && !sqh0.isEmpty()) || (brxm != null && !brxm.isEmpty())) {
return new Result("5", "当前样本已有病人信息是否替换!", 1);
}
}
@ -2010,10 +2018,11 @@ public class LisWorkUtils {
//6.写日志
lisWorkUtils.setComLog(jyrq, yq, ybh, yhdh, ComLogConstants.LG_SJ, sqh);
if(sqh!=null||"".equals(sqh))lisWorkUtils.setlabReqsteplog(sqh,LabReqmainConstants.START,yhdh);
if (sqh != null && !sqh.isEmpty()) lisWorkUtils.setlabReqsteplog(sqh, LabReqmainConstants.START, yhdh);
return new Result("0", "", labPat);
}
public LabPat loaddefault(LabPat labPat) {
Date jyrq = labPat.getJyrq();
String yq = labPat.getYq();
@ -2024,7 +2033,7 @@ public class LisWorkUtils {
SysLoginParam loginConfigParam = loginConfigParamUtil.getLoginConfigParam();
String Current_instrid = loginConfigParam.getCurrent_instrid();
List<LabInputcol> labInputcolList = loginConfigParam.getCurrent_labInputcol();
if (Current_instrid == null || !yq.equals(Current_instrid)) {
if (!yq.equals(Current_instrid)) {
loginConfigParam.setCurrent_yhdh_sybh("");
loginConfigParam.setCurrent_yhdh_eybh("");
loginConfigParam.setCurrent_hdys_sybh("");
@ -2032,10 +2041,10 @@ public class LisWorkUtils {
labInputcolList = commonUtil.getLabInputcol(yq);
loginConfigParam.setCurrent_labInputcol(labInputcolList);
}
List<LabInputcol> labInputcolList0 = labInputcolList.stream().filter(labInputcol0 -> labInputcol0.getMrz() != null && !"".equals(labInputcol0.getMrz())).collect(Collectors.toList());
List<LabInputcol> labInputcolList0 = labInputcolList.stream().filter(labInputcol0 -> labInputcol0.getMrz() != null && !labInputcol0.getMrz().isEmpty()).collect(Collectors.toList());
String mrz = null;
for (LabInputcol labInputcol : labInputcolList0) {
if (!"!".equals(labInputcol)) {
if (!"!".equals(labInputcol.getZdmc())) {
String zdmc = labInputcol.getZdmc();
switch (zdmc) {
@ -2046,12 +2055,12 @@ public class LisWorkUtils {
break;
case "yhdh":
String yhdh0 = labPat.getYhdh();
if (yhdh0 == null ||"".equals(yhdh0)) {
if (yhdh0 == null || yhdh0.isEmpty()) {
mrz = labInputcol.getMrz();
if (mrz != null && "".equals(mrz)) {
if (mrz != null && !mrz.isEmpty()) {
String sybh = loginConfigParam.getCurrent_yhdh_sybh();
String eybh = loginConfigParam.getCurrent_yhdh_eybh();
if ("".equals(sybh) && "".equals(eybh) && sybh != null && eybh != null) {
if (!"".equals(sybh) && !"".equals(eybh) && sybh != null && eybh != null) {
if (LisUtil.isStringBetween(ybh, sybh, eybh)) {
labPat.setYhdh(mrz);
}
@ -2063,10 +2072,10 @@ public class LisWorkUtils {
break;
case "hdys":
String hdys0 = labPat.getYhdh();
if (hdys0 == null ||"".equals(hdys0)) {
if (hdys0 == null || hdys0.isEmpty()) {
String sybh = loginConfigParam.getCurrent_hdys_sybh();
String eybh = loginConfigParam.getCurrent_hdys_eybh();
if ("".equals(sybh) && "".equals(eybh) && sybh != null && eybh != null) {
if (!"".equals(sybh) && !"".equals(eybh)) {
if (LisUtil.isStringBetween(ybh, sybh, eybh)) {
labPat.setHdys(mrz);
}
@ -2077,9 +2086,9 @@ public class LisWorkUtils {
break;
default:
String value = (String) EntityUtils.getItem(labPat, zdmc);
if (value == null ||"".equals(value)) {
if (value == null || value.isEmpty()) {
mrz = labInputcol.getMrz();
if (mrz != null && !"".equals(mrz)) {
if (mrz != null && !mrz.isEmpty()) {
EntityUtils.setItem(labPat, zdmc, mrz);
}
}
@ -2087,7 +2096,7 @@ public class LisWorkUtils {
}
}
String yhdh = SecurityUtils.getLoginUser().getUsername();
if (labPat.getYhdh() == null || "".equals(labPat.getYhdh()))
if (labPat.getYhdh() == null || labPat.getYhdh().isEmpty())
labPat.setYhdh(SecurityUtils.getLoginUser().getUsername());
labPat.setLastuser(yhdh);
labPat.setLastdt(ldt_now);

View File

@ -54,12 +54,12 @@ public class ReportUtil {
public void printBarCode(BarCodeParam mzBarCodeParam) {
try {
//构造数据
Map parameters = new HashMap();
Map<String,Object> parameters=new HashMap<>();
parameters.put("barcode", mzBarCodeParam.getSqh());
parameters.put("line1", mzBarCodeParam.getBrxm() + " " + mzBarCodeParam.getBrxb() + " " + mzBarCodeParam.getNl());
parameters.put("line2", mzBarCodeParam.getSfxmmc());
try {
//构造数据
JasperReportUtil.print(RuoYiConfig.getMzPrintName(), "barcode", parameters);
} catch (Exception e) {
e.printStackTrace();
@ -71,7 +71,6 @@ public class ReportUtil {
public void printBackpaper(List<String> sqhs) {
String sqh = sqhs.get(0);
BackPaperParam backPaperParam = backPaperMapper.selectReqmian(sqh);
// ObjectMapper objectMapper = new ObjectMapper();
Map<String, Object> parameters = BeanUtil.beanToMap(backPaperParam);
parameters.put("company", commonUtil.getCompany(backPaperParam.getYljg()));
parameters.put("age", AgeUtils.getAge(backPaperParam.getBrsr()));
@ -85,13 +84,13 @@ public class ReportUtil {
String bglqsm = "";
if (bglqdh1 != null) {
List<LabRptgetruledetailCX> labRptgetruledetail = backPaperMapper.getLabRptgetruledetail(bglqdh1);
if (labRptgetruledetail.size() > 0) {
if (!labRptgetruledetail.isEmpty()) {
bglqsm = labRptgetruledetail.get(0).getBglqsm();
}
}
if (bglqdh2 != null && bglqsm != null && !bglqsm.trim().equals("")) {
if (bglqdh2 != null && bglqsm != null && !bglqsm.trim().isEmpty()) {
List<LabRptgetruledetailCX> labRptgetruledetail = backPaperMapper.getLabRptgetruledetail(bglqdh2);
if (labRptgetruledetail.size() > 0) {
if (!labRptgetruledetail.isEmpty()) {
bglqsm = labRptgetruledetail.get(0).getBglqsm();
}
}
@ -101,7 +100,7 @@ public class ReportUtil {
try {
//构造数据
System.out.println("入参参数:" + parameters.toString());
System.out.println("入参参数:" + parameters);
JasperReportUtil.print(RuoYiConfig.getMzPrintName(), "backpaper", parameters, detailList);
} catch (Exception e) {
e.printStackTrace();
@ -116,7 +115,7 @@ public class ReportUtil {
public Result printToPdf(String templatename, BarCodeParam barCodeParam, String pdfName, boolean base64) {
String staticpath=ImageUtils.getStaticPath()+ File.separator;
String outputPath = staticpath+ File.separator + "printPDF"+ File.separator + UUID.randomUUID().toString() + ".pdf"; // PDF输出路径(多级目录会自动创建)
String outputPath = staticpath+ File.separator + "printPDF"+ File.separator + UUID.randomUUID() + ".pdf"; // PDF输出路径(多级目录会自动创建)
Map<String, Object> stringObjectMap = BeanUtil.beanToMap(barCodeParam);
try {
Connection connection = dataSource.getConnection();
@ -130,9 +129,9 @@ public class ReportUtil {
if (base64) {
//删除图片文件
String[] pic = barCodeParam.getPic();
if(pic != null && pic.length > 0){
for (int i = 0; i < pic.length; i++) {
String picFilePath =staticpath+ File.separator +"graphs"+File.separator + StrUtil.splitToArray(pic[i], "graphs/")[1];
if(pic != null){
for (String s : pic) {
String picFilePath = staticpath + File.separator + "graphs" + File.separator + StrUtil.splitToArray(s, "graphs/")[1];
FileUtils.deleteFile(picFilePath);
}
}
@ -154,8 +153,8 @@ public class ReportUtil {
return getHttpURL("printPDF")+"/"+pdfName+".pdf";
}
public String getHttpURL(String pathChild) {
String httpPath = "";
if (printURL == null || printURL.equals("")) {
String httpPath;
if (printURL == null || printURL.isEmpty()) {
httpPath = "http://" + IpUtils.getHostIp() + ":" + port + "/" + pathChild;
} else {
httpPath = "http://" + printURL + ":" + port + "/" + pathChild;
@ -166,10 +165,10 @@ public class ReportUtil {
/**
* 判断当前报告单是否使用A4报告单
*
* @param jyrq
* @param yq
* @param ybh
* @return
* @param jyrq 检验日期
* @param yq 仪器
* @param ybh 样本号
* @return 返回纸张格式
*/
public String getReportPaperSize(Date jyrq, String yq, String ybh) {
//是否分A4,A5报告单
@ -237,9 +236,9 @@ public class ReportUtil {
*/
public void mergePdfsHorizontally(String Base64input1, String Base64input2, String output) throws IOException {
//把base64数据生成pdf文件
String path1 = RuoYiConfig.getProfile() + "/config/static/printPDF/" + UUID.randomUUID().toString() + ".pdf";
String path1 = RuoYiConfig.getProfile() + "/config/static/printPDF/" + UUID.randomUUID() + ".pdf";
Base64.decodeToFile(Base64input1, new File(path1));
String path2 = RuoYiConfig.getProfile() + "/config/static/printPDF/" + UUID.randomUUID().toString() + ".pdf";
String path2 = RuoYiConfig.getProfile() + "/config/static/printPDF/" + UUID.randomUUID() + ".pdf";
Base64.decodeToFile(Base64input2, new File(path2));
try (PdfWriter writer = new PdfWriter(output);
PdfDocument pdfDoc = new PdfDocument(writer);
@ -360,10 +359,10 @@ public class ReportUtil {
String[] filename = new String[labGraphList.size()];
String httpPath = getHttpURL(filepath);
int filecount = 0;
if (labGraphList.size() > 0) {
if (!labGraphList.isEmpty()) {
for (LabGraph labGraph : labGraphList) {
String txlb = labGraph.getTxlb();
String txlbmc = UUID.randomUUID().toString() + "." + txlb.toLowerCase();
String txlbmc = UUID.randomUUID() + "." + txlb.toLowerCase();
byte[] txnr = labGraph.getTxnr();
try {
ImageUtils.generateToStaticDir(txnr, filepath, txlbmc);
@ -379,11 +378,11 @@ public class ReportUtil {
/**
* 获取电子签名
* @param yhdh
* @return
* @param yhdh 用户代号
* @return 签名地址
*/
public String getSignName(String yhdh) {
if(yhdh==null||"".equals(yhdh))return "";
if(yhdh==null|| yhdh.isEmpty())return "";
//SELECT zplx INTO :ls_pictype FROM off_staff WHERE rydh = :as_userno ;
String pictype="jpg";//暂时写死是jpg,8.0新版本后期可以考虑用户表增加字段指定类型
String dirpath="signname";

View File

@ -21,6 +21,25 @@
<select id="getLisgroup" resultType="String">
select lisgroup from lab_instr where yq=#{yq}
</select>
<select id="querybylisgroup" resultType="com.czlis.common.core.domain.entity.lis.LabInstr">
select * from lab_instr
<where>
<if test="lisgroup != null and lisgroup != ''">and lisgroup = #{lisgroup}</if>
<if test="yljg != null and yljg != ''">and yljg = #{yljg}</if>
<if test="useflag != null and useflag != ''">and useflag = #{useflag}</if>
</where>
ORDER BY yqmc ASC
</select>
<select id="getInstrdList" resultType="com.czlis.common.core.domain.entity.lis.LabInstr">
select * from lab_instr
<where>
<if test="lisgroup != null and lisgroup != ''">and lisgroup = #{lisgroup}</if>
<if test="yljg != null and yljg != ''">and yljg = #{yljg}</if>
<if test="useflag != null and useflag != ''">and useflag = #{useflag}</if>
</where>
and yq in (select yq from com_usrpower where yhdh = #{userno} and xtdh = 'LIS' and substring(yhqx,${powerbit},1) = 'Y')
ORDER BY yqmc ASC
</select>
<select id="getLabInstrList" resultType="com.czlis.common.core.domain.entity.lis.LabInstr" parameterType="com.czlis.common.core.domain.entity.lis.LabInstr">
select * from lab_instr
<where>

View File

@ -3,16 +3,13 @@ package com.czlis.liswork.controller.dict;
import com.czlis.common.annotation.Log;
import com.czlis.common.core.controller.BaseController;
import com.czlis.common.core.domain.Result;
import com.czlis.common.core.page.TableDataInfo;
import com.czlis.common.core.domain.entity.lis.LabInstr;
import com.czlis.common.enums.BusinessType;
import com.czlis.liswork.service.InstrService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* 仪器维护注册
@ -22,22 +19,21 @@ import java.util.List;
@RequestMapping("/instr")
public class InstrController extends BaseController {
@Autowired
private InstrService instrService;
private final InstrService instrService;
public InstrController(InstrService instrService) {
this.instrService = instrService;
}
@ApiOperation("查询数据")
@GetMapping("/query")
public TableDataInfo query(String yq){
startPage();
List<LabInstr> labInstrList = instrService.query(yq);
return getDataTable(labInstrList);
public Result query(String yq){
return new Result("0","",instrService.query(yq));
}
@ApiOperation("按组查询数据")
@GetMapping("/querybylisgroup")
public TableDataInfo querybylisgroup(String lisgroup){
startPage();
List<LabInstr> labInstrList = instrService.querybylisgroup(lisgroup);
return getDataTable(labInstrList);
public Result querybylisgroup(String lisgroup){
return instrService.querybylisgroup(lisgroup);
}
@ApiOperation("新增数据")
@PostMapping("/add")

View File

@ -3,14 +3,10 @@ package com.czlis.liswork.controller.work;
import com.czlis.common.annotation.Log;
import com.czlis.common.core.controller.BaseController;
import com.czlis.common.core.domain.Result;
import com.czlis.common.core.domain.entity.SysLoginParam;
import com.czlis.common.core.domain.entity.lis.LabPat;
import com.czlis.common.core.domain.entity.lis.LabResult;
import com.czlis.common.core.page.TableDataInfo;
import com.czlis.common.enums.BusinessType;
import com.czlis.interfaceCommon.utils.LoginConfigParamUtil;
import com.czlis.liswork.mapper.LisWorkMapper;
import com.czlis.liswork.service.LabPatService;
import com.czlis.liswork.service.LabResultService;
import com.czlis.liswork.service.LisWorkService;
import io.swagger.annotations.Api;
@ -19,7 +15,6 @@ import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
@ -36,16 +31,7 @@ public class LisWorkController extends BaseController {
@Autowired
private LisWorkService lisWorkService;
@Autowired
private LabPatService labPatService;
@Autowired
private LabResultService labResultService;
@Autowired
LoginConfigParamUtil loginConfigParamUtil;
/**
* 可操作仪器查询
*
* @return
*/
@ApiOperation("可操作仪器查询")
@GetMapping("/instrdlist")
public Result getInstrdList() {
@ -53,29 +39,18 @@ public class LisWorkController extends BaseController {
// SysLoginParam loginConfigParam = loginConfigParamUtil.getLoginConfigParam();
// loginConfigParam.setYq("BC5300");
// loginConfigParamUtil.setLoginConfigParam(loginConfigParam);
return lisWorkService.getInstrdList(getUserId());
return lisWorkService.getInstrdList();
}
@ApiOperation("仪器组可操作仪器查询")
@GetMapping("/getGroupInstrdList")
public Result getGroupInstrdList(String lisgroup){
return lisWorkService.getGroupInstrdList(lisgroup);
}
/**
* 切换仪器,查询仪器参数
*
* @param yq
* @return
*/
@ApiOperation("切换仪器,查询仪器参数")
@GetMapping("/instrdconfig")
public Result getInstrdConfig(String yq) {
return lisWorkService.getInstrdConfig(yq);
}
/**
* 获取样本列表
*
* @param jyrq
* @param yq
* @param days
* @return
*/
@ApiOperation("获取样本列表")
@GetMapping("/samplelist")
public Result getSampleList(Date jyrq,String yq,Long days){
@ -93,15 +68,6 @@ public class LisWorkController extends BaseController {
clearPage();
}
}
/**
* 获取普通样本信息
*
* @param jyrq
* @param yq
* @param ybh
* @return
*/
@ApiOperation("获取普通样本信息")
@GetMapping("/sampleinfo")
public Result sampleInfo(Date jyrq, String yq, String ybh) {
@ -118,26 +84,16 @@ public class LisWorkController extends BaseController {
public Result queryxmval(String yq,String xmdh) {
return lisWorkService.getXmVal(yq,xmdh);
}
/**
* 获取微生物样本信息
*
* @param jyrq
* @param yq
* @param ybh
* @return
*/
@ApiOperation("获取微生物样本信息")
@GetMapping("/sampleMedInfo")
public Result sampleMedInfo(Date jyrq, String yq, String ybh) {
return lisWorkService.sampleMedInfo(jyrq, yq, ybh);
}
@ApiOperation("工号密码验证")
@GetMapping("/checkuserid")
public Result checkUser(String yhdh, String mm) {
return lisWorkService.checkUser(yhdh, mm);
}
@ApiOperation("获取检验结果")
@GetMapping("/resultinfo")
public Result getresultinfo(LabResult labResult) {
@ -147,7 +103,6 @@ public class LisWorkController extends BaseController {
// log.info("jyrq,{}", jyrq.toString());
return lisWorkService.getresultinfo(jyrq, yq, ybh);
}
@Log(title = "主界面",businessType = BusinessType.DELETE_DETAIL)
@ApiOperation("删除检验结果")
@PostMapping("/deleteresult")

View File

@ -1,6 +1,7 @@
package com.czlis.liswork.mapper.xtwh;
import com.czlis.common.core.domain.entity.lis.LabInstr;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@ -9,6 +10,5 @@ public interface InstrMapper {
void add(LabInstr labInstr);
void update(LabInstr labInstr);
void delete(String yq);
List<LabInstr> querybylisgroup(String lisgroup);
}

View File

@ -13,6 +13,5 @@ public interface InstrService {
Result update(LabInstr labInstr);
Result delete(String yq);
List<LabInstr> querybylisgroup(String lisgroup);
Result querybylisgroup(String lisgroup);
}

View File

@ -10,8 +10,8 @@ import java.util.List;
public interface LisWorkService {
Result getInstrdList(Long userId);
Result getGroupInstrdList(Long userId,String groupId);
Result getInstrdList();
Result getGroupInstrdList(String groupId);
Result getInstrdConfig(String yq);
List<LabPat> getSampleList(Date jyrq, String yq, Long days);
Result getresultinfo(Date jyrq, String yq, String ybh);

View File

@ -5,7 +5,6 @@ import com.czlis.liswork.mapper.xtwh.InstrMapper;
import com.czlis.common.core.domain.entity.lis.LabInstr;
import com.czlis.liswork.service.InstrService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -15,8 +14,11 @@ import java.util.List;
@Slf4j
public class InstrServiceImpl implements InstrService {
@Autowired
private InstrMapper instrMapper;
private final InstrMapper instrMapper;
public InstrServiceImpl(InstrMapper instrMapper) {
this.instrMapper = instrMapper;
}
@Override
@ -25,8 +27,10 @@ public class InstrServiceImpl implements InstrService {
}
@Override
public List<LabInstr> querybylisgroup(String lisgroup) {
return instrMapper.querybylisgroup(lisgroup);
public Result querybylisgroup(String lisgroup) {
if("ALL".equals(lisgroup))lisgroup="";
List<LabInstr> labInstrList = instrMapper.querybylisgroup(lisgroup);
return new Result("0","",labInstrList);
}
@Override

View File

@ -15,10 +15,8 @@ import com.czlis.interfaceCommon.utils.*;
import com.czlis.liswork.mapper.LisWorkMapper;
import com.czlis.liswork.mapper.xtwh.InstrMapper;
import com.czlis.liswork.service.LisWorkService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.*;
@ -28,18 +26,20 @@ import java.util.stream.Collectors;
@Slf4j
public class LisWorkServiceImpl implements LisWorkService {
@Autowired
private LisWorkMapper lisWorkMapper;
@Autowired
CommonUtil commonUtil;
@Autowired
private InstrMapper instrMapper;
@Autowired
LoginConfigParamUtil loginConfigParamUtil;
@Autowired
ReportUtil reportUtil;
@Autowired
LisWorkUtils lisWorkUtils;
private final LisWorkMapper lisWorkMapper;
private final CommonUtil commonUtil;
private final LoginConfigParamUtil loginConfigParamUtil;
private final ReportUtil reportUtil;
private final LisWorkUtils lisWorkUtils;
public LisWorkServiceImpl(LisWorkMapper lisWorkMapper, CommonUtil commonUtil, LoginConfigParamUtil loginConfigParamUtil, ReportUtil reportUtil, LisWorkUtils lisWorkUtils) {
this.lisWorkMapper = lisWorkMapper;
this.commonUtil = commonUtil;
this.loginConfigParamUtil = loginConfigParamUtil;
this.reportUtil = reportUtil;
this.lisWorkUtils = lisWorkUtils;
}
@Override
public Result getXmInfo(String yq) {
List<XmInfo> xmInfoList =commonUtil.getXmInfoList(yq);
@ -59,7 +59,7 @@ public class LisWorkServiceImpl implements LisWorkService {
labPat=commonUtil.getLabPatOne(jyrq, yq, ybh);
if(labPat==null) return new Result("-1","未找到报告单,打印失败!");
String jgbz=labPat.getJgbz();
if(jgbz==null||"".equals(jgbz)) return new Result("-1","未找到报告单,打印失败!");
if(jgbz==null|| jgbz.isEmpty()) return new Result("-1","未找到报告单,打印失败!");
if(!"2".equals(jgbz))return new Result("1","报告单未审核,禁止打印!");
Result res=reportUtil.printReport(labPat);
if(!"1".equals(labPat.getDybz())) {
@ -72,28 +72,33 @@ public class LisWorkServiceImpl implements LisWorkService {
String yhdh=SecurityUtils.getLoginUser().getUsername();
lisWorkUtils.setComLog(jyrq,yq,ybh,yhdh, ComLogConstants.LG_P,"");
String sqh=labPat.getSqh();
if(sqh!=null&&!"".equals(sqh)){
if(sqh!=null&& !sqh.isEmpty()){
lisWorkUtils.setlabReqsteplog(sqh, LabReqmainConstants.REPORT,yhdh);
}
return res;
}
@Override
public Result getInstrdList(Long userId) {
public Result getInstrdList() {
List<Map<String,Object>> comUsrpowerList = lisWorkMapper.getInstrdList(String.valueOf(userId));
return new Result("0","获取仪器列表成功!",comUsrpowerList);
List<LabInstr> labInstr=commonUtil.querybylisgroup("","","0");
return new Result("0","获取仪器列表成功!",labInstr);
}
@Override
public Result getGroupInstrdList(Long userId,String groupId) {
if(userId==1){
List<LabInstr> labInstr=instrMapper.querybylisgroup(groupId);
return new Result("0","获取分组仪器列表成功!",labInstr);
public Result getGroupInstrdList(String groupId) {
if("ALL".equals(groupId))groupId="";
String yhdh=SecurityUtils.getLoginUser().getUsername();
SysLoginParam loginConfigParam =loginConfigParamUtil.getLoginConfigParam();
String yljg=loginConfigParam.getLoginYLJG();
if("".equals(yljg)||yljg==null)yljg="1";
List<LabInstr> labInstr;
if("admin".equals(yhdh)||"lis".equals(yhdh)){
labInstr = commonUtil.querybylisgroup(groupId, yljg, "0");
}else{
List<Map<String,Object>> comUsrpowerList = lisWorkMapper.getGroupInstrdList(String.valueOf(userId),groupId);
return new Result("0","获取分组仪器列表成功!",comUsrpowerList);
labInstr = commonUtil.getInstrdList(groupId, yljg, "0", yhdh, "2");
}
return new Result("0","获取分组仪器列表成功!",labInstr);
}
@Override
@ -164,7 +169,7 @@ public class LisWorkServiceImpl implements LisWorkService {
labInputcol.setDict("");
}
}
Map<String,Object> instrdConfig=new HashMap<String,Object>();
Map<String,Object> instrdConfig= new HashMap<>();
instrdConfig.put("ResultConfig",getInstrdResultConfig(yq));
instrdConfig.put("labInputcolList",labInputcolList);
return new Result("0","获取仪器参数成功!",instrdConfig);
@ -172,7 +177,7 @@ public class LisWorkServiceImpl implements LisWorkService {
private List<LabInputcol> getInstrdResultConfig(String yq){
String showod= commonUtil.getComOptValue(yq,"SHOWOD");
if(showod==null||"".equals(showod))showod="0";
if(showod==null|| showod.isEmpty())showod="0";
String showodflag="0";
String showcutoffflag="0";
String showrefsflag="1";
@ -195,11 +200,11 @@ public class LisWorkServiceImpl implements LisWorkService {
break;
}
String result_label= commonUtil.getComOptValue(yq,"RESULT_LABEL");
if(result_label==null||"".equals(result_label))result_label="结果";
if(result_label==null|| result_label.isEmpty())result_label="结果";
String od_label= commonUtil.getComOptValue(yq,"OD_LABEL");
if(od_label==null||"".equals(od_label))od_label="OD";
if(od_label==null|| od_label.isEmpty())od_label="OD";
String cutoff_label= commonUtil.getComOptValue(yq,"CUTOFF_LABEL");
if(cutoff_label==null||"".equals(cutoff_label))cutoff_label="CUTOFF";
if(cutoff_label==null|| cutoff_label.isEmpty())cutoff_label="CUTOFF";
List<LabInputcol> ResultConfig=new ArrayList<>();
LabInputcol labInputcol=new LabInputcol();
labInputcol.setXh(0);
@ -308,14 +313,14 @@ public class LisWorkServiceImpl implements LisWorkService {
public Result getresultinfo(Date jyrq, String yq, String ybh){
List<LabResult> labResultList=commonUtil.getresultinfo(jyrq,yq,ybh);
List<LabResultlog> labResultlog=commonUtil.getLabResultlog(jyrq,yq,ybh);
if(labResultList.size()>0 && labResultlog.size()>0) {
if(!labResultList.isEmpty() && !labResultlog.isEmpty()) {
for (LabResult labResult : labResultList) {
String xmdh=labResult.getXmdh();
String csjg=labResult.getCsjg();
if(csjg==null)csjg="";
if(xmdh!=null&&!"".equals(xmdh)) {
if(xmdh!=null&& !xmdh.isEmpty()) {
List<LabResultlog> labResultlog0 = labResultlog.stream().filter(rlog -> xmdh.equals(rlog.getXmdh())).collect(Collectors.toList());
if(labResultlog0.size()>0) {
if(!labResultlog0.isEmpty()) {
for(LabResultlog labResultlog1 : labResultlog0) {
String csjg0 = labResultlog1.getCsjg();
if (csjg0 == null) csjg0 = "";
@ -330,15 +335,13 @@ public class LisWorkServiceImpl implements LisWorkService {
}
LabPat labPat =commonUtil.getLabPatOne(jyrq,yq,ybh);
List<LabResult> labResultList0=getlastresult(labPat,labResultList);
if(labResultList0.size()>0) {
if(!labResultList0.isEmpty()) {
for (LabResult labResult : labResultList) {
labResult.setCp_lastjyrq(labResultList0.get(0).getJyrq());
String xmdh=labResult.getXmdh();
String csjg=labResult.getCsjg();
if(csjg==null)csjg="";
if(xmdh!=null&&!"".equals(xmdh)) {
if(xmdh!=null&& !xmdh.isEmpty()) {
List<LabResult> labResult0 = labResultList0.stream().filter(rlog -> xmdh.equals(rlog.getXmdh())).collect(Collectors.toList());
if(labResult0.size()>0) {
if(!labResult0.isEmpty()) {
String csjg0 =labResult0.get(0).getCsjg();
String result_flag=labResult0.get(0).getResult_flag();
if("未做".equals(csjg0)||csjg0==null){
@ -355,8 +358,10 @@ public class LisWorkServiceImpl implements LisWorkService {
}
/**
* 获取当前结果的上一次结果
* @return
* 获取上一次结果
* @param labPat 病人信息
* @param labResultall 结果
* @return 上一次结果
*/
private List<LabResult> getlastresult(LabPat labPat,List<LabResult> labResultall){
@ -406,12 +411,12 @@ public class LisWorkServiceImpl implements LisWorkService {
lastLabPatParam.setBrxm(brxm);
}
String interval = commonUtil.getComOptValue(yq,"COMPAREDA");
if(interval==null||"".equals(interval))interval="60";
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&&!"".equals(compother)) {
if(compother!=null&& !compother.isEmpty()) {
String instrlist = commonUtil.getComOptValue(yq, "COMPOTHERINSTRLIST");
//'CAL800','XS500I','33','40'
if("".equals(instrlist)||instrlist==null){lastLabPatParam.setYq(yq);}
@ -421,18 +426,17 @@ public class LisWorkServiceImpl implements LisWorkService {
}
}
List<LabPat> labPatList =commonUtil.getlastLabPat(lastLabPatParam);
if(labPatList.size()>0) {
if(!labPatList.isEmpty()) {
for(LabPat labPat0:labPatList) {
Date jyrq0 = labPat0.getJyrq();
String yq0 = labPat0.getYq();
String ybh0 = labPat0.getYbh();
if (jyrq0 == jyrq && yq0.equals(yq) && ybh0.equals(ybh)) {
}else {
if (!jyrq0.equals(jyrq) ||!yq0.equals(yq) ||!ybh0.equals(ybh)) {
List<LabResult> labResultList0 = commonUtil.getLabResultList(jyrq0, yq0, ybh0);
for(LabResult labResult:labResultList0) {
String xmdh=labResult.getXmdh();
List<LabResult> labResult0 = labResultall.stream().filter(rlog -> xmdh.equals(rlog.getXmdh())).collect(Collectors.toList());
if(labResult0.size()>0){
if(!labResult0.isEmpty()){
return labResultList0;
}
}
@ -445,11 +449,9 @@ public class LisWorkServiceImpl implements LisWorkService {
@Override
public List<LabPat> getSampleList(Date jyrq, String yq, Long days) {
if(days>1) {
List<LabPat> labPatListday = commonUtil.getSampleListday(yq, days);
return labPatListday;//new Result("0", "获取样本数据成功!", labPatListday);
return commonUtil.getSampleListday(yq, days);//new Result("0", "获取样本数据成功!", labPatListday);
}else {
List<LabPat> labPatListday = commonUtil.getsamplelist(jyrq, yq);
return labPatListday;//new Result("0", "获取样本数据成功!", labPatListday);
return commonUtil.getsamplelist(jyrq, yq);//new Result("0", "获取样本数据成功!", labPatListday);
}
}
@Override
@ -479,20 +481,22 @@ public class LisWorkServiceImpl implements LisWorkService {
@Override
public Result checkUser(String yhdh, String mm) {
if(yhdh == null || yhdh.equals("")) return new Result("-1","用户名不能为空!");
if(mm == null || mm.equals("")) return new Result("-1","密码不能为空!");
if(yhdh == null || yhdh.isEmpty()) return new Result("-1","用户名不能为空!");
if(mm == null || mm.isEmpty()) return new Result("-1","密码不能为空!");
SysUser sysUser = lisWorkMapper.getSysUser(yhdh);
if (StringUtils.isNull(sysUser)) {
log.info("登录用户:{} 不存在.", yhdh);
throw new ServiceException(MessageUtils.message("user.not.exists"));
} else if (UserStatus.DELETED.getCode().equals(sysUser.getDelFlag())) {
}
if (UserStatus.DELETED.getCode().equals(sysUser.getDelFlag())) {
log.info("登录用户:{} 已被删除.", yhdh);
throw new ServiceException(MessageUtils.message("user.password.delete"));
} else if (UserStatus.DISABLE.getCode().equals(sysUser.getStatus())) {
}
if (UserStatus.DISABLE.getCode().equals(sysUser.getStatus())) {
log.info("登录用户:{} 已被停用.", yhdh);
throw new ServiceException(MessageUtils.message("user.blocked"));
}
Boolean matchesflag =SecurityUtils.matchesPassword(mm,sysUser.getPassword());
boolean matchesflag =SecurityUtils.matchesPassword(mm,sysUser.getPassword());
if(matchesflag){
return new Result("0","登录成功!");
}else{