主程序
This commit is contained in:
parent
6873ee8393
commit
ad59e5e93f
@ -14,4 +14,8 @@ public interface LabInstrMapper {
|
|||||||
String getYqdl(@Param("yq")String yq);
|
String getYqdl(@Param("yq")String yq);
|
||||||
String getBgdh(@Param("yq")String yq);
|
String getBgdh(@Param("yq")String yq);
|
||||||
String getLisgroup(@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);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,14 +1,11 @@
|
|||||||
package com.czlis.interfaceCommon.utils;
|
package com.czlis.interfaceCommon.utils;
|
||||||
|
|
||||||
import com.czlis.common.core.domain.Result;
|
|
||||||
import com.czlis.common.core.domain.entity.lis.*;
|
import com.czlis.common.core.domain.entity.lis.*;
|
||||||
import com.czlis.common.utils.ComDictUtils;
|
import com.czlis.common.utils.ComDictUtils;
|
||||||
import com.czlis.common.utils.ComOptionUtils;
|
import com.czlis.common.utils.ComOptionUtils;
|
||||||
import com.czlis.interfaceCommon.mapper.*;
|
import com.czlis.interfaceCommon.mapper.*;
|
||||||
import com.czlis.interfaceCommon.pojo.entity.LastLabPatParam;
|
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.commons.lang3.time.DateFormatUtils;
|
||||||
import org.apache.ibatis.annotations.Param;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
@ -417,7 +414,12 @@ public class CommonUtil {
|
|||||||
public LabInstr getLabInstr(String yq) {
|
public LabInstr getLabInstr(String yq) {
|
||||||
return labInstrMapper.getLabInstr(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) {
|
public List<LabInstr> getLabInstrList(LabInstr labInstr) {
|
||||||
return labInstrMapper.getLabInstrList(labInstr);
|
return labInstrMapper.getLabInstrList(labInstr);
|
||||||
}
|
}
|
||||||
@ -456,9 +458,9 @@ public class CommonUtil {
|
|||||||
|
|
||||||
//字典查询单位名称
|
//字典查询单位名称
|
||||||
public String getCompany(String yljg) {
|
public String getCompany(String yljg) {
|
||||||
if (yljg == null || yljg.equals("")) return getCompany();
|
if (yljg == null || yljg.isEmpty()) return getCompany();
|
||||||
String zdmc = getComDictNameById("HOS", yljg);
|
String zdmc = getComDictNameById("HOS", yljg);
|
||||||
if (zdmc == null || zdmc.equals("")) {
|
if (zdmc == null || zdmc.isEmpty()) {
|
||||||
return yljg;
|
return yljg;
|
||||||
} else {
|
} else {
|
||||||
return zdmc;
|
return zdmc;
|
||||||
@ -467,7 +469,7 @@ public class CommonUtil {
|
|||||||
|
|
||||||
public String getCompany() {
|
public String getCompany() {
|
||||||
String zdmc = getComDictNameById("99", "COMPANY");
|
String zdmc = getComDictNameById("99", "COMPANY");
|
||||||
if (zdmc == null || zdmc.equals("")) {
|
if (zdmc == null || zdmc.isEmpty()) {
|
||||||
return "";
|
return "";
|
||||||
} else {
|
} else {
|
||||||
return zdmc;
|
return zdmc;
|
||||||
@ -481,11 +483,11 @@ public class CommonUtil {
|
|||||||
List<ComDict> comDictList = getDictCache(zdlb);
|
List<ComDict> comDictList = getDictCache(zdlb);
|
||||||
if (comDictList != null) {
|
if (comDictList != null) {
|
||||||
List<ComDict> collect = comDictList.stream().filter(comDict -> comDict.getZddh().equals(zddh)).collect(Collectors.toList());
|
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();
|
return collect.get(0).getZdmc();
|
||||||
}else{
|
}else{
|
||||||
List<ComDict> collect0 = comDictList.stream().filter(comDict -> comDict.getZdmc().equals(zddh)).collect(Collectors.toList());
|
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();
|
return collect0.get(0).getZdmc();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -499,11 +501,11 @@ public class CommonUtil {
|
|||||||
List<ComDict> comDictList = getDictCache(zdlb);
|
List<ComDict> comDictList = getDictCache(zdlb);
|
||||||
if (comDictList != null) {
|
if (comDictList != null) {
|
||||||
List<ComDict> collect = comDictList.stream().filter(comDict -> comDict.getZdmc().equals(zdmc)).collect(Collectors.toList());
|
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();
|
return collect.get(0).getZddh();
|
||||||
}else{
|
}else{
|
||||||
List<ComDict> collect0 = comDictList.stream().filter(comDict -> comDict.getZddh().equals(zdmc)).collect(Collectors.toList());
|
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();
|
return collect0.get(0).getZddh();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -586,8 +588,7 @@ public class CommonUtil {
|
|||||||
if ("S".equals(yhjs)) return true;
|
if ("S".equals(yhjs)) return true;
|
||||||
String userPower = comUsrpowerMapper.getUserPower(yq, yhdh);
|
String userPower = comUsrpowerMapper.getUserPower(yq, yhdh);
|
||||||
if (userPower == null) return false;
|
if (userPower == null) return false;
|
||||||
if ("Y".equals(userPower.substring(powerIdx - 1, 1))) return true;
|
return "Y".equals(userPower.substring(powerIdx - 1, 1));
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
public byte[] getComUsrdzqm(String yhdh) {
|
public byte[] getComUsrdzqm(String yhdh) {
|
||||||
return comUsrMapper.getComUsrdzqm(yhdh);
|
return comUsrMapper.getComUsrdzqm(yhdh);
|
||||||
|
|||||||
@ -51,6 +51,7 @@ public class LisWorkUtils {
|
|||||||
CommonUtil commonUtil;
|
CommonUtil commonUtil;
|
||||||
@Autowired
|
@Autowired
|
||||||
LisWorkUtils lisWorkUtils;
|
LisWorkUtils lisWorkUtils;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 初步审核
|
* 初步审核
|
||||||
*
|
*
|
||||||
@ -61,7 +62,7 @@ public class LisWorkUtils {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public Result confirm1(Date jyrq, String yq, String ybh, String hdys, int problemId) {
|
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 labPat = commonUtil.getLabPatOne(jyrq, yq, ybh);
|
||||||
labPat.setHdys(hdys);
|
labPat.setHdys(hdys);
|
||||||
List<LabResult> labResultList = commonUtil.getLabResultList(jyrq, yq, ybh);
|
List<LabResult> labResultList = commonUtil.getLabResultList(jyrq, yq, ybh);
|
||||||
@ -123,7 +124,7 @@ public class LisWorkUtils {
|
|||||||
public Result saveallresult(Date jyrq, String yq, String ybh) {
|
public Result saveallresult(Date jyrq, String yq, String ybh) {
|
||||||
int finsh = 1;
|
int finsh = 1;
|
||||||
List<LabResult> labResultList = commonUtil.getLabResultList(jyrq, yq, ybh);
|
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) {
|
for (LabResult labResult : labResultList) {
|
||||||
String csjg = labResult.getCsjg();
|
String csjg = labResult.getCsjg();
|
||||||
if ("未做".equals(csjg)) {
|
if ("未做".equals(csjg)) {
|
||||||
@ -147,7 +148,7 @@ public class LisWorkUtils {
|
|||||||
String alarmflag = labPat.getAlarmflag();
|
String alarmflag = labPat.getAlarmflag();
|
||||||
if (("1".equals(alarmflag) && !wjz)) {
|
if (("1".equals(alarmflag) && !wjz)) {
|
||||||
labPat.setAlarmflag("");
|
labPat.setAlarmflag("");
|
||||||
} else if (("".equals(alarmflag)||" ".equals(alarmflag)|| alarmflag == null) && wjz) {
|
} else if (("".equals(alarmflag) || " ".equals(alarmflag) || alarmflag == null) && wjz) {
|
||||||
labPat.setAlarmflag("1");
|
labPat.setAlarmflag("1");
|
||||||
}
|
}
|
||||||
commonUtil.updateLabPat(labPat);
|
commonUtil.updateLabPat(labPat);
|
||||||
@ -164,7 +165,7 @@ public class LisWorkUtils {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public Result confirm(Date jyrq, String yq, String ybh, String hdys, int problemId) {
|
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 labPat = commonUtil.getLabPatOne(jyrq, yq, ybh);
|
||||||
labPat.setHdys(hdys);
|
labPat.setHdys(hdys);
|
||||||
List<LabResult> labResultList = commonUtil.getLabResultList(jyrq, yq, ybh);
|
List<LabResult> labResultList = commonUtil.getLabResultList(jyrq, yq, ybh);
|
||||||
@ -236,10 +237,10 @@ public class LisWorkUtils {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
private Result beforeconfirm(LabPat labPat, List<LabResult> labResultList, Integer checktype, Integer problemId) {
|
private Result beforeconfirm(LabPat labPat, List<LabResult> labResultList, Integer checktype, Integer problemId) {
|
||||||
|
if (labPat == null) return new Result("-1", "病人信息为空禁止审核!");
|
||||||
Date jyrq = labPat.getJyrq();
|
Date jyrq = labPat.getJyrq();
|
||||||
String yq = labPat.getYq();
|
String yq = labPat.getYq();
|
||||||
String ybh = labPat.getYbh();
|
String ybh = labPat.getYbh();
|
||||||
if (labPat == null) return new Result("-1", "病人信息为空禁止审核!");
|
|
||||||
String jgbz = labPat.getJgbz();
|
String jgbz = labPat.getJgbz();
|
||||||
if ("2".equals(jgbz)) return new Result("1", "报告已审核!");
|
if ("2".equals(jgbz)) return new Result("1", "报告已审核!");
|
||||||
if ("5".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 limit_brly = commonUtil.getHISOPT("limit_brly");
|
||||||
String brly = labPat.getBrly();
|
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", "病人类型为空,禁止审核!");
|
return new Result("-1", "病人类型为空,禁止审核!");
|
||||||
String limit_yblx = commonUtil.getHISOPT("limit_yblx");
|
String limit_yblx = commonUtil.getHISOPT("limit_yblx");
|
||||||
String yblx = labPat.getYblx();
|
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", "样本类型为空,禁止审核!");
|
return new Result("-1", "样本类型为空,禁止审核!");
|
||||||
String limit_brxm = commonUtil.getHISOPT("limit_brxm");
|
String limit_brxm = commonUtil.getHISOPT("limit_brxm");
|
||||||
String brxm = labPat.getBrxm();
|
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", "病人姓名为空,禁止审核!");
|
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 limit_ksdh = commonUtil.getHISOPT("limit_ksdh");
|
||||||
String ksdh = labPat.getKsdh();
|
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", "科室单位为空,禁止审核!");
|
return new Result("-1", "科室单位为空,禁止审核!");
|
||||||
String limit_patno = commonUtil.getHISOPT("limit_patno");
|
String limit_patno = commonUtil.getHISOPT("limit_patno");
|
||||||
String brdh = labPat.getBrdh();
|
String brdh = labPat.getBrdh();
|
||||||
String brlyname = commonUtil.getComDictNameById("PT", brly);
|
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", "病历号不能为空,禁止审核!");
|
if (!"质控".equals(brlyname)) return new Result("-1", "病历号不能为空,禁止审核!");
|
||||||
}
|
}
|
||||||
String limit_brpatno = commonUtil.getHISOPT("limit_brpatno");
|
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", "门诊住院的病历号不能为空,禁止审核!");
|
if ("1".equals(brly) || "3".equals(brly)) return new Result("-1", "门诊住院的病历号不能为空,禁止审核!");
|
||||||
}
|
}
|
||||||
String yqdl = commonUtil.getYqdl(yq);
|
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) {
|
for (LabResult labResult : labResultList) {
|
||||||
String csjg = labResult.getCsjg();
|
String csjg = labResult.getCsjg();
|
||||||
if ("未做".equals(csjg)) {
|
if ("未做".equals(csjg)) {
|
||||||
@ -307,7 +308,7 @@ public class LisWorkUtils {
|
|||||||
if (wxh > 0) return new Result("-1", "有结果为****禁止审核!");
|
if (wxh > 0) return new Result("-1", "有结果为****禁止审核!");
|
||||||
}
|
}
|
||||||
String sqh = labPat.getSqh();
|
String sqh = labPat.getSqh();
|
||||||
if (sqh != null && !"".equals(sqh)) {
|
if (sqh != null && !sqh.isEmpty()) {
|
||||||
if (!"质控".equals(brlyname)) {
|
if (!"质控".equals(brlyname)) {
|
||||||
if ("1".equals(commonUtil.getHISOPT("sp_dublereport"))) {
|
if ("1".equals(commonUtil.getHISOPT("sp_dublereport"))) {
|
||||||
LabPat labPat0 = lisWorkUtilsMapper.checkdublereport(sqh, ybh);
|
LabPat labPat0 = lisWorkUtilsMapper.checkdublereport(sqh, ybh);
|
||||||
@ -329,7 +330,7 @@ public class LisWorkUtils {
|
|||||||
}
|
}
|
||||||
|
|
||||||
String Userid = labPat.getHdys();
|
String Userid = labPat.getHdys();
|
||||||
if (Userid == null || "".equals(Userid)) {
|
if (Userid == null || Userid.isEmpty()) {
|
||||||
Userid = SecurityUtils.getLoginUser().getUsername();
|
Userid = SecurityUtils.getLoginUser().getUsername();
|
||||||
}
|
}
|
||||||
//初审不需要调用接口
|
//初审不需要调用接口
|
||||||
@ -345,7 +346,7 @@ public class LisWorkUtils {
|
|||||||
if (!"细菌仪".equals(yqdl)) {
|
if (!"细菌仪".equals(yqdl)) {
|
||||||
if (!"1".equals(commonUtil.getHISOPT("wswcbbgbl"))) {
|
if (!"1".equals(commonUtil.getHISOPT("wswcbbgbl"))) {
|
||||||
String ls_cbbgyq = commonUtil.getComOptValue(yq, "cbbgyq");
|
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;
|
String ls_ejbgyq = "EJBG" + ls_cbbgyq;
|
||||||
ls_cbbgyq = "CBBG" + ls_cbbgyq;
|
ls_cbbgyq = "CBBG" + ls_cbbgyq;
|
||||||
int count = commonUtil.getCountByKey(jyrq, ls_cbbgyq, ybh);
|
int count = commonUtil.getCountByKey(jyrq, ls_cbbgyq, ybh);
|
||||||
@ -398,9 +399,9 @@ public class LisWorkUtils {
|
|||||||
Date currenttime = DateUtils.getNowDate();
|
Date currenttime = DateUtils.getNowDate();
|
||||||
int weekDay = DateUtils.getWeekDay(currenttime);
|
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(":", ""));
|
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(":", "");
|
sb1 = sb1.replace(":", "");
|
||||||
sb2 = sb2.replace(":", "");
|
sb2 = sb2.replace(":", "");
|
||||||
|
|
||||||
@ -409,6 +410,10 @@ public class LisWorkUtils {
|
|||||||
int nsb2 = Integer.parseInt(sb2);
|
int nsb2 = Integer.parseInt(sb2);
|
||||||
if (lt_now > nsb1 && lt_now < nsb2) return 1;
|
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)) {
|
if (LisUtil.isTureNumber(sb3) && LisUtil.isTureNumber(sb4)) {
|
||||||
int nsb3 = Integer.parseInt(sb3);
|
int nsb3 = Integer.parseInt(sb3);
|
||||||
int nsb4 = Integer.parseInt(sb4);
|
int nsb4 = Integer.parseInt(sb4);
|
||||||
@ -436,12 +441,12 @@ public class LisWorkUtils {
|
|||||||
}
|
}
|
||||||
//计算项目更新
|
//计算项目更新
|
||||||
List<XmCalc> xmCalcList = commonUtil.getXmCalcList(yq);
|
List<XmCalc> xmCalcList = commonUtil.getXmCalcList(yq);
|
||||||
if (xmCalcList.size() > 0) {
|
if (!xmCalcList.isEmpty()) {
|
||||||
labResultList = calcsample(labPat, labResultList, xmCalcList);
|
labResultList = calcsample(labPat, labResultList, xmCalcList);
|
||||||
}
|
}
|
||||||
//补写结果表申请单项目编号
|
//补写结果表申请单项目编号
|
||||||
String sqh = labPat.getSqh();
|
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);
|
labResultList = saverefs(labPat);
|
||||||
return labResultList;
|
return labResultList;
|
||||||
@ -449,14 +454,13 @@ public class LisWorkUtils {
|
|||||||
|
|
||||||
public void setItemSqxmdh(Date jyrq, String yq, String ybh) {
|
public void setItemSqxmdh(Date jyrq, String yq, String ybh) {
|
||||||
String sqh = commonUtil.getSqhByKey(jyrq, yq, ybh);
|
String sqh = commonUtil.getSqhByKey(jyrq, yq, ybh);
|
||||||
if (sqh == null || "".equals(sqh)) {
|
if (sqh != null && !sqh.isEmpty()) {
|
||||||
} else {
|
|
||||||
setItemSqxmdh(jyrq, yq, ybh, sqh);
|
setItemSqxmdh(jyrq, yq, ybh, sqh);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setItemSqxmdh(Date jyrq, String yq, String ybh, String 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);
|
int sl = labReqdetailMapper.getCountByKey(sqh);
|
||||||
if (sl == 1) {
|
if (sl == 1) {
|
||||||
String sqxmdh = lisWorkUtilsMapper.selectSqxmdh(sqh);
|
String sqxmdh = lisWorkUtilsMapper.selectSqxmdh(sqh);
|
||||||
@ -471,7 +475,7 @@ public class LisWorkUtils {
|
|||||||
LabPat labPat = commonUtil.getLabPatOne(jyrq, yq, ybh);
|
LabPat labPat = commonUtil.getLabPatOne(jyrq, yq, ybh);
|
||||||
List<LabResult> labResultList = commonUtil.getLabResultList(jyrq, yq, ybh);
|
List<LabResult> labResultList = commonUtil.getLabResultList(jyrq, yq, ybh);
|
||||||
List<XmCalc> xmCalcList = commonUtil.getXmCalcList(yq);
|
List<XmCalc> xmCalcList = commonUtil.getXmCalcList(yq);
|
||||||
if (xmCalcList.size() > 0) {
|
if (!xmCalcList.isEmpty()) {
|
||||||
calcsample(labPat, labResultList, xmCalcList);
|
calcsample(labPat, labResultList, xmCalcList);
|
||||||
}
|
}
|
||||||
return new Result("0", "保存成功!");
|
return new Result("0", "保存成功!");
|
||||||
@ -491,21 +495,20 @@ public class LisWorkUtils {
|
|||||||
boolean lb_jsx = false;
|
boolean lb_jsx = false;
|
||||||
Map<String, String> variables = new HashMap<>();
|
Map<String, String> variables = new HashMap<>();
|
||||||
String[] parameters = CalcUtils.getParameters(jsgs);
|
String[] parameters = CalcUtils.getParameters(jsgs);
|
||||||
for (int i = 0; i < parameters.length; i++) {
|
for (String itemcode : parameters) {
|
||||||
String itemcode = parameters[i];
|
|
||||||
if ("SEX".equals(itemcode)) {
|
if ("SEX".equals(itemcode)) {
|
||||||
String sex = labPat.getBrxb();
|
String sex = labPat.getBrxb();
|
||||||
if(sex==null||"".equals(sex)||" ".equals(sex)){
|
if (sex == null || sex.isEmpty() || " ".equals(sex)) {
|
||||||
setjgsg = false;
|
setjgsg = false;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
sex=sex.trim();
|
sex = sex.trim();
|
||||||
if ("男".equals(sex)) sex = "1";
|
if ("男".equals(sex)) sex = "1";
|
||||||
if ("女".equals(sex)) sex = "2";
|
if ("女".equals(sex)) sex = "2";
|
||||||
variables.put("SEX", sex);
|
variables.put("SEX", sex);
|
||||||
lb_jsx = true;
|
lb_jsx = true;
|
||||||
} else if ("AGE".equals(itemcode)) {
|
} 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;
|
setjgsg = false;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -514,7 +517,7 @@ public class LisWorkUtils {
|
|||||||
lb_jsx = true;
|
lb_jsx = true;
|
||||||
} else {
|
} else {
|
||||||
List<LabResult> collect = labResultList.stream().filter(result -> result.getXmdh().equals(itemcode)).collect(Collectors.toList());
|
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());
|
variables.put(itemcode, collect.get(0).getCsjg());
|
||||||
} else {
|
} else {
|
||||||
setjgsg = false;
|
setjgsg = false;
|
||||||
@ -613,7 +616,7 @@ public class LisWorkUtils {
|
|||||||
String retCode = String.valueOf(map.get("retcode"));
|
String retCode = String.valueOf(map.get("retcode"));
|
||||||
String retMsg = String.valueOf(map.get("retmsg"));
|
String retMsg = String.valueOf(map.get("retmsg"));
|
||||||
log.info("调用存储过程{}返回值:{},{}", "sp_setrefs", retCode, 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);
|
labResultList = commonUtil.getLabResultList(jyrq, yq, ybh);
|
||||||
log.info("labResultList.size:{}", labResultList.size());
|
log.info("labResultList.size:{}", labResultList.size());
|
||||||
List<XmInfo> xmInfoList = commonUtil.getXmInfoList(yq);
|
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 (lb_nummode && lb_setbj && !"Y".equals(ygzd) && !"Y".equals(ygzq)) {
|
||||||
if (nowjz) {
|
if (nowjz) {
|
||||||
String resultalarmflag1 = labResult.getAlarm_flag().trim();
|
String resultalarmflag1 = labResult.getAlarm_flag();
|
||||||
if (!"".equals(resultalarmflag1) && resultalarmflag1 != null) {
|
if(resultalarmflag1 != null)resultalarmflag1=resultalarmflag1.trim();
|
||||||
|
else resultalarmflag1="";
|
||||||
|
if (!resultalarmflag1.isEmpty()) {
|
||||||
labResult.setAlarm_flag("");
|
labResult.setAlarm_flag("");
|
||||||
commonUtil.updateLabResult(labResult);
|
commonUtil.updateLabResult(labResult);
|
||||||
}
|
}
|
||||||
@ -659,7 +664,7 @@ public class LisWorkUtils {
|
|||||||
} else {
|
} else {
|
||||||
String xmdh = labResult.getXmdh();
|
String xmdh = labResult.getXmdh();
|
||||||
List<XmInfo> xmInfo0 = xmInfoList.stream().filter(xm -> xm.getXmdh().equals(xmdh)).collect(Collectors.toList());
|
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);
|
XmInfo xmInfo = xmInfo0.get(0);
|
||||||
List<XmAlarmdetail> getXmAlarmdetail = xmAlarmdetailList.stream().filter(detail -> detail.getXmdh().equals(xmdh)).collect(Collectors.toList());
|
List<XmAlarmdetail> getXmAlarmdetail = xmAlarmdetailList.stream().filter(detail -> detail.getXmdh().equals(xmdh)).collect(Collectors.toList());
|
||||||
LabResult labResult0 = setxmdhrefs(labPat, labResult, xmInfo, getXmAlarmdetail, nowjz);
|
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) {
|
private int alarmcondition(LabPat labPat, LabResult labResult, List<XmAlarmdetail> getXmAlarmdetail) {
|
||||||
if (getXmAlarmdetail == null) return -1;
|
if (getXmAlarmdetail == null) return -1;
|
||||||
boolean lb_fcb = false, lb_hasval = false;
|
boolean lb_fcb, lb_hasval = false;
|
||||||
String csjg = labResult.getCsjg();
|
String csjg = labResult.getCsjg();
|
||||||
if (csjg == null || csjg.trim().isEmpty()) return -1;
|
if (csjg == null || csjg.trim().isEmpty()) return -1;
|
||||||
String yq = labPat.getYq();
|
String yq = labPat.getYq();
|
||||||
@ -842,7 +847,7 @@ public class LisWorkUtils {
|
|||||||
if (altersx != null) hlimit = altersx;
|
if (altersx != null) hlimit = altersx;
|
||||||
}
|
}
|
||||||
//数值型结果判断
|
//数值型结果判断
|
||||||
Double csjgnum = Double.valueOf(csjgnew);
|
double csjgnum = Double.parseDouble(csjgnew);
|
||||||
if (ckxx != null) if (csjgnum < ckxx) resultflag = "L";
|
if (ckxx != null) if (csjgnum < ckxx) resultflag = "L";
|
||||||
if (cksx != null) if (csjgnum > cksx) resultflag = "H";
|
if (cksx != null) if (csjgnum > cksx) resultflag = "H";
|
||||||
if (!nowjz) {
|
if (!nowjz) {
|
||||||
@ -858,7 +863,7 @@ public class LisWorkUtils {
|
|||||||
//文字型结果判断
|
//文字型结果判断
|
||||||
String jgbzold = labResult.getJgbz();
|
String jgbzold = labResult.getJgbz();
|
||||||
String lmtflag = getitemlmtflag(yq, xmdh, csjg);
|
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";
|
lmtflag = "P";
|
||||||
resultflag = lmtflag;
|
resultflag = lmtflag;
|
||||||
if (!nowjz) {
|
if (!nowjz) {
|
||||||
@ -890,7 +895,7 @@ public class LisWorkUtils {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public String getitemlmtflag(String yq, String xmdh, String csjg) {
|
public String getitemlmtflag(String yq, String xmdh, String csjg) {
|
||||||
String jgbz = "";
|
String jgbz;
|
||||||
if (csjg == null || csjg.isEmpty()) {
|
if (csjg == null || csjg.isEmpty()) {
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
@ -920,7 +925,7 @@ public class LisWorkUtils {
|
|||||||
//医学审核条件判断
|
//医学审核条件判断
|
||||||
if (problemId < 6) {
|
if (problemId < 6) {
|
||||||
String checkvalue = checkResultUtils.chksample(labPat, labResultList);
|
String checkvalue = checkResultUtils.chksample(labPat, labResultList);
|
||||||
if (checkvalue != null && !"".equals(checkvalue)) {
|
if (checkvalue != null && !checkvalue.isEmpty()) {
|
||||||
return new Result("5", checkvalue, 6);
|
return new Result("5", checkvalue, 6);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1093,22 +1098,22 @@ public class LisWorkUtils {
|
|||||||
Date bbsjsj = labReqmain.getBbsjsj();
|
Date bbsjsj = labReqmain.getBbsjsj();
|
||||||
Date jssj = labReqmain.getJssj();
|
Date jssj = labReqmain.getJssj();
|
||||||
Date sjsj = labReqmain.getSjsj();
|
Date sjsj = labReqmain.getSjsj();
|
||||||
if (sjsj == null) sjsj = jysj;
|
if (sjsj == null&&jysj !=null) sjsj =new Date(jysj.getTime());
|
||||||
if (sjsj.after(confirmtime)) sjsj = jysj;
|
if (sjsj !=null&&sjsj.after(confirmtime)&&jysj !=null) sjsj =new Date(jysj.getTime());
|
||||||
if (jssj == null) jssj = sjsj;
|
if (jssj == null&&sjsj !=null) jssj =new Date(sjsj.getTime());
|
||||||
if (jssj.after(confirmtime)) jssj = sjsj;
|
if (jssj !=null&&jssj.after(confirmtime)&&sjsj !=null) jssj = new Date(sjsj.getTime());
|
||||||
if (bbsjsj != null) {
|
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 != null&&jysj !=null) {
|
||||||
if (cysj.after(jssj) && jysj.after(cysj)) jssj = jysj;
|
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);
|
List<LabReqsteplog> labReqsteplog = commonUtil.getLabReqsteplog(sqh);
|
||||||
if (bbsjsj != null && bbsjsj.after(jssj)) {
|
if (jssj !=null&&bbsjsj != null && bbsjsj.after(jssj)) {
|
||||||
Date sj = jssj;
|
Date sj = new Date(jssj.getTime());
|
||||||
Date finalSj = sj;
|
Date finalSj = new Date(jssj.getTime());
|
||||||
Optional<LabReqsteplog> maxTimeEntity = labReqsteplog.stream()
|
Optional<LabReqsteplog> maxTimeEntity = labReqsteplog.stream()
|
||||||
.filter(entity -> "13".equals(entity.getZt()))
|
.filter(entity -> "13".equals(entity.getZt()))
|
||||||
.filter(entity -> entity.getChangedate().before(finalSj))
|
.filter(entity -> entity.getChangedate().before(finalSj))
|
||||||
@ -1116,13 +1121,13 @@ public class LisWorkUtils {
|
|||||||
if (maxTimeEntity.isPresent()) {
|
if (maxTimeEntity.isPresent()) {
|
||||||
sj = maxTimeEntity.get().getChangedate();
|
sj = maxTimeEntity.get().getChangedate();
|
||||||
}
|
}
|
||||||
bbsjsj = sj;
|
bbsjsj = new Date(sj.getTime());
|
||||||
labReqmain.setBbsjsj(bbsjsj);
|
labReqmain.setBbsjsj(bbsjsj);
|
||||||
} else {
|
} else {
|
||||||
bbsjsj = jssj;
|
if(jssj !=null) bbsjsj = new Date(jssj.getTime());
|
||||||
}
|
}
|
||||||
if (cysj != null && cysj.after(bbsjsj)) {
|
if (bbsjsj != null && cysj != null && cysj.after(bbsjsj)) {
|
||||||
Date sj = bbsjsj;
|
Date sj = new Date(bbsjsj.getTime());
|
||||||
Date finalSj = sj;
|
Date finalSj = sj;
|
||||||
Optional<LabReqsteplog> maxTimeEntity = labReqsteplog.stream()
|
Optional<LabReqsteplog> maxTimeEntity = labReqsteplog.stream()
|
||||||
.filter(entity -> "12".equals(entity.getZt()))
|
.filter(entity -> "12".equals(entity.getZt()))
|
||||||
@ -1131,25 +1136,25 @@ public class LisWorkUtils {
|
|||||||
if (maxTimeEntity.isPresent()) {
|
if (maxTimeEntity.isPresent()) {
|
||||||
sj = maxTimeEntity.get().getChangedate();
|
sj = maxTimeEntity.get().getChangedate();
|
||||||
}
|
}
|
||||||
cysj = sj;
|
cysj =new Date(sj.getTime());
|
||||||
labReqmain.setCysj(cysj);
|
labReqmain.setCysj(cysj);
|
||||||
}
|
}
|
||||||
if (cysj != null && zxsj.after(cysj) && bbsjsj.after(zxsj)) {
|
if (bbsjsj != null && cysj != null && zxsj.after(cysj) && bbsjsj.after(zxsj)) {
|
||||||
Date sj = bbsjsj;
|
|
||||||
Date finalSj = sj;
|
Date finalSj = new Date(bbsjsj.getTime());
|
||||||
Optional<LabReqsteplog> maxTimeEntity = labReqsteplog.stream()
|
Optional<LabReqsteplog> maxTimeEntity = labReqsteplog.stream()
|
||||||
.filter(entity -> "12".equals(entity.getZt()))
|
.filter(entity -> "12".equals(entity.getZt()))
|
||||||
.filter(entity -> entity.getChangedate().before(finalSj))
|
.filter(entity -> entity.getChangedate().before(finalSj))
|
||||||
.max(Comparator.comparing(LabReqsteplog::getChangedate));
|
.max(Comparator.comparing(LabReqsteplog::getChangedate));
|
||||||
if (maxTimeEntity.isPresent()) {
|
if (maxTimeEntity.isPresent()) {
|
||||||
cysj = maxTimeEntity.get().getChangedate();
|
cysj = maxTimeEntity.get().getChangedate();
|
||||||
} else cysj = zxsj;
|
} else cysj = new Date(zxsj.getTime());
|
||||||
labReqmain.setCysj(cysj);
|
labReqmain.setCysj(cysj);
|
||||||
} else {
|
} else {
|
||||||
cysj = bbsjsj;
|
if(bbsjsj != null ) cysj =new Date(bbsjsj.getTime());
|
||||||
}
|
}
|
||||||
if (zxsj != null && zxsj.after(cysj)) {
|
if (cysj != null && zxsj != null && zxsj.after(cysj)) {
|
||||||
Date sj = cysj;
|
Date sj = new Date(cysj.getTime());
|
||||||
Date finalSj = sj;
|
Date finalSj = sj;
|
||||||
Optional<LabReqsteplog> maxTimeEntity = labReqsteplog.stream()
|
Optional<LabReqsteplog> maxTimeEntity = labReqsteplog.stream()
|
||||||
.filter(entity -> "11".equals(entity.getZt()))
|
.filter(entity -> "11".equals(entity.getZt()))
|
||||||
@ -1159,10 +1164,10 @@ public class LisWorkUtils {
|
|||||||
sj = maxTimeEntity.get().getChangedate();
|
sj = maxTimeEntity.get().getChangedate();
|
||||||
}
|
}
|
||||||
|
|
||||||
zxsj = sj;
|
zxsj = new Date(sj.getTime());
|
||||||
labReqmain.setZxsj(zxsj);
|
labReqmain.setZxsj(zxsj);
|
||||||
}
|
}
|
||||||
labReqmain.setSjsj(sjsj);
|
if (sjsj != null)labReqmain.setSjsj(sjsj);
|
||||||
}
|
}
|
||||||
return labReqmain;
|
return labReqmain;
|
||||||
}
|
}
|
||||||
@ -1195,7 +1200,7 @@ public class LisWorkUtils {
|
|||||||
labRefused.setSqh(ls_sqh);
|
labRefused.setSqh(ls_sqh);
|
||||||
labRefused.setRefusetext(ls_xpywrdh);
|
labRefused.setRefusetext(ls_xpywrdh);
|
||||||
List<LabRefused> labRefusedList = commonUtil.getLabRefusedList(labRefused);
|
List<LabRefused> labRefusedList = commonUtil.getLabRefusedList(labRefused);
|
||||||
if (labRefusedList.size() == 0) {
|
if (labRefusedList.isEmpty()) {
|
||||||
labRefused.setRefusedtime(new Date());
|
labRefused.setRefusedtime(new Date());
|
||||||
labRefused.setKsdh(labPat.getKsdh());
|
labRefused.setKsdh(labPat.getKsdh());
|
||||||
labRefused.setBz("0");
|
labRefused.setBz("0");
|
||||||
@ -1215,8 +1220,8 @@ public class LisWorkUtils {
|
|||||||
*/
|
*/
|
||||||
private boolean getAlarmFlag(List<LabResult> labResultList) {
|
private boolean getAlarmFlag(List<LabResult> labResultList) {
|
||||||
boolean wjz = false;
|
boolean wjz = false;
|
||||||
List<LabResult> labResultList0 = labResultList.stream().filter(xm -> !"".equals(xm.getAlarm_flag().trim()) && xm.getAlarm_flag() != null).collect(Collectors.toList());
|
List<LabResult> labResultList0 = labResultList.stream().filter(xm ->xm.getAlarm_flag() != null).filter(xm -> !xm.getAlarm_flag().trim().isEmpty()).collect(Collectors.toList());
|
||||||
if (labResultList0.size() > 0) {
|
if (!labResultList0.isEmpty()) {
|
||||||
wjz = true;
|
wjz = true;
|
||||||
}
|
}
|
||||||
return wjz;
|
return wjz;
|
||||||
@ -1229,9 +1234,9 @@ public class LisWorkUtils {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
private String getAlarmMsg(List<LabResult> labResultList) {
|
private String getAlarmMsg(List<LabResult> labResultList) {
|
||||||
String wjzmsg = "";
|
StringBuilder wjzmsg = new StringBuilder();
|
||||||
List<LabResult> labResultList0 = labResultList.stream().filter(xm -> !"".equals(xm.getAlarm_flag().trim()) && xm.getAlarm_flag() != null).collect(Collectors.toList());
|
List<LabResult> labResultList0 = labResultList.stream().filter(xm ->xm.getAlarm_flag() != null).filter(xm -> !xm.getAlarm_flag().trim().isEmpty()).collect(Collectors.toList());
|
||||||
if (labResultList0.size() > 0) {
|
if (!labResultList0.isEmpty()) {
|
||||||
for (LabResult labResult : labResultList0) {
|
for (LabResult labResult : labResultList0) {
|
||||||
String xmmc = labResult.getXmmc();
|
String xmmc = labResult.getXmmc();
|
||||||
String cjsg = labResult.getCsjg();
|
String cjsg = labResult.getCsjg();
|
||||||
@ -1241,10 +1246,10 @@ public class LisWorkUtils {
|
|||||||
cjsg = "";
|
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();
|
yhdh = sysUser.getNickName();
|
||||||
} else {
|
} else {
|
||||||
String yhxm = commonUtil.getComUsrName(yhdh);
|
String yhxm = commonUtil.getComUsrName(yhdh);
|
||||||
if (yhxm != null && "".equals(yhxm)) yhdh = yhxm;
|
if (yhxm != null && yhxm.isEmpty()) yhdh = yhxm;
|
||||||
}
|
}
|
||||||
String sjys = labPat.getSjys();
|
String sjys = labPat.getSjys();
|
||||||
String sjysname = commonUtil.getComDictNameById("SRD", sjys);
|
String sjysname = commonUtil.getComDictNameById("SRD", sjys);
|
||||||
if (sjysname == null || "".equals(sjysname)) {
|
if (sjysname == null || sjysname.isEmpty()) {
|
||||||
sjysname = sjys;
|
sjysname = sjys;
|
||||||
}
|
}
|
||||||
if ("".equals(qrr) || qrr == null) {
|
if ("".equals(qrr) || qrr == null) {
|
||||||
@ -1369,8 +1374,8 @@ public class LisWorkUtils {
|
|||||||
}
|
}
|
||||||
commonUtil.insertLabPatwarning(labPatwarning);
|
commonUtil.insertLabPatwarning(labPatwarning);
|
||||||
String ls_bz = "";
|
String ls_bz = "";
|
||||||
List<LabResult> labResultList0 = labResultList.stream().filter(xm -> !"".equals(xm.getAlarm_flag().trim()) && xm.getAlarm_flag() != null).collect(Collectors.toList());
|
List<LabResult> labResultList0 = labResultList.stream().filter(xm -> xm.getAlarm_flag() != null).filter(xm -> !xm.getAlarm_flag().trim().isEmpty()).collect(Collectors.toList());
|
||||||
if (labResultList0.size() > 0) {
|
if (!labResultList0.isEmpty()) {
|
||||||
for (LabResult labResult : labResultList0) {
|
for (LabResult labResult : labResultList0) {
|
||||||
LabResultwarning labResultwarning = new LabResultwarning();
|
LabResultwarning labResultwarning = new LabResultwarning();
|
||||||
labResultwarning.setJyrq(jyrq);
|
labResultwarning.setJyrq(jyrq);
|
||||||
@ -1457,7 +1462,7 @@ public class LisWorkUtils {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public Result unconfirm(Date jyrq, String yq, String ybh, String yhdh) {
|
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);
|
int problemId = ServletUtils.getParameterToInt("problemId", 0);
|
||||||
LabPat labPat = commonUtil.getLabPatOne(jyrq, yq, ybh);
|
LabPat labPat = commonUtil.getLabPatOne(jyrq, yq, ybh);
|
||||||
if (problemId < 3) {
|
if (problemId < 3) {
|
||||||
@ -1549,7 +1554,7 @@ public class LisWorkUtils {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public Result unconfirm1(Date jyrq, String yq, String ybh, String yhdh) {
|
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);
|
int problemId = ServletUtils.getParameterToInt("problemId", 0);
|
||||||
LabPat labPat = commonUtil.getLabPatOne(jyrq, yq, ybh);
|
LabPat labPat = commonUtil.getLabPatOne(jyrq, yq, ybh);
|
||||||
if (problemId < 3) {
|
if (problemId < 3) {
|
||||||
@ -1600,17 +1605,17 @@ public class LisWorkUtils {
|
|||||||
loginConfigParam.setCurrent_labInputcol(labInputcolList);
|
loginConfigParam.setCurrent_labInputcol(labInputcolList);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Boolean setcalc = false;
|
boolean setcalc = false;
|
||||||
List<XmCalc> xmCalcList = null;
|
List<XmCalc> xmCalcList = null;
|
||||||
switch (column) {
|
switch (column) {
|
||||||
case "brxb":
|
case "brxb":
|
||||||
xmCalcList = commonUtil.getXmCalcbyxmdh(yq, "SEX");
|
xmCalcList = commonUtil.getXmCalcbyxmdh(yq, "SEX");
|
||||||
if (xmCalcList.size() > 0) setcalc = true;
|
if (!xmCalcList.isEmpty()) setcalc = true;
|
||||||
break;
|
break;
|
||||||
case "nl":
|
case "nl":
|
||||||
case "nldw":
|
case "nldw":
|
||||||
xmCalcList = commonUtil.getXmCalcbyxmdh(yq, "AGE");
|
xmCalcList = commonUtil.getXmCalcbyxmdh(yq, "AGE");
|
||||||
if (xmCalcList.size() > 0) setcalc = true;
|
if (!xmCalcList.isEmpty()) setcalc = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (setcalc) {
|
if (setcalc) {
|
||||||
@ -1618,9 +1623,9 @@ public class LisWorkUtils {
|
|||||||
LabPat labPat = commonUtil.getLabPatOne(jyrq, yq, ybh);
|
LabPat labPat = commonUtil.getLabPatOne(jyrq, yq, ybh);
|
||||||
boolean nowjz = checknowjz(labPat);
|
boolean nowjz = checknowjz(labPat);
|
||||||
labResultList = calcsample(labPat, labResultList, xmCalcList);
|
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());
|
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) {
|
for (LabResult labResult0 : labResultList1) {
|
||||||
changeresultf(labPat, labResult0, nowjz);
|
changeresultf(labPat, labResult0, nowjz);
|
||||||
}
|
}
|
||||||
@ -1645,34 +1650,35 @@ public class LisWorkUtils {
|
|||||||
String jgbz = commonUtil.getLabPatJgbz(jyrq, yq, ybh);
|
String jgbz = commonUtil.getLabPatJgbz(jyrq, yq, ybh);
|
||||||
if ("2".equals(jgbz)) return new Result("-1", "结果已审核禁止删除!");
|
if ("2".equals(jgbz)) return new Result("-1", "结果已审核禁止删除!");
|
||||||
if ("5".equals(jgbz)) return new Result("-1", "结果已锁定禁止删除!");
|
if ("5".equals(jgbz)) return new Result("-1", "结果已锁定禁止删除!");
|
||||||
// if ("1".equals(jgbz)) return new Result("-1", "结果已初审禁止删除!");
|
// if ("1".equals(jgbz)) return new Result("-1", "结果已初审禁止删除!");
|
||||||
//IF MessageBox("删除","你确定删除当前 " + ls_ybh + " 号标本?",question!,YesNo!,2) = 2 THEN RETURN 1 交给前端
|
//IF MessageBox("删除","你确定删除当前 " + ls_ybh + " 号标本?",question!,YesNo!,2) = 2 THEN RETURN 1 交给前端
|
||||||
String yqdl=commonUtil.getYqdl(yq);
|
String yqdl = commonUtil.getYqdl(yq);
|
||||||
if("细菌仪".equals(yqdl)) {
|
if ("细菌仪".equals(yqdl)) {
|
||||||
String cbbgyq=commonUtil.getComOptValue(yq,"cbbgyq");
|
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_cbbg = "CBBG" + cbbgyq;
|
||||||
String is_instr_ejbg="EJBG"+cbbgyq;
|
String is_instr_ejbg = "EJBG" + cbbgyq;
|
||||||
String jgbz0 = commonUtil.getLabPatJgbz(jyrq, is_instr_cbbg, ybh);
|
String jgbz0 = commonUtil.getLabPatJgbz(jyrq, is_instr_cbbg, ybh);
|
||||||
if(jgbz0!=null) {
|
if (jgbz0 != null) {
|
||||||
if("2".equals(jgbz0)||"3".equals(jgbz0)){
|
if ("2".equals(jgbz0) || "3".equals(jgbz0)) {
|
||||||
return new Result("1", "初步报告已经被审核,撤回前无法删除!");
|
return new Result("1", "初步报告已经被审核,撤回前无法删除!");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
String jgbz1 = commonUtil.getLabPatJgbz(jyrq, is_instr_ejbg, ybh);
|
String jgbz1 = commonUtil.getLabPatJgbz(jyrq, is_instr_ejbg, ybh);
|
||||||
if(jgbz1!=null) {
|
if (jgbz1 != null) {
|
||||||
if("2".equals(jgbz1)||"4".equals(jgbz1)){
|
if ("2".equals(jgbz1) || "4".equals(jgbz1)) {
|
||||||
return new Result("1", "二级报告已经被审核,撤回前无法删除!");
|
return new Result("1", "二级报告已经被审核,撤回前无法删除!");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(jgbz0!=null) delsample(jyrq, is_instr_cbbg, ybh);
|
if (jgbz0 != null) delsample(jyrq, is_instr_cbbg, ybh);
|
||||||
if(jgbz1!=null) delsample(jyrq, is_instr_ejbg, ybh);
|
if (jgbz1 != null) delsample(jyrq, is_instr_ejbg, ybh);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
delsample(jyrq, yq, ybh);
|
delsample(jyrq, yq, ybh);
|
||||||
setComLog(jyrq, yq, ybh,yhdh,ComLogConstants.LG_M,"删除整个样本");
|
setComLog(jyrq, yq, ybh, yhdh, ComLogConstants.LG_M, "删除整个样本");
|
||||||
return new Result("0", "保存成功");
|
return new Result("0", "保存成功");
|
||||||
}
|
}
|
||||||
|
|
||||||
private void delsample(Date jyrq, String yq, String ybh) {
|
private void delsample(Date jyrq, String yq, String ybh) {
|
||||||
commonUtil.delLabResultMedAll(jyrq, yq, ybh);
|
commonUtil.delLabResultMedAll(jyrq, yq, ybh);
|
||||||
commonUtil.delLabResultAll(jyrq, yq, ybh);
|
commonUtil.delLabResultAll(jyrq, yq, ybh);
|
||||||
@ -1699,11 +1705,11 @@ public class LisWorkUtils {
|
|||||||
labResult = setxmdhrefs(labPat, labResult, xmInfo, getXmAlarmdetail, nowjz);
|
labResult = setxmdhrefs(labPat, labResult, xmInfo, getXmAlarmdetail, nowjz);
|
||||||
commonUtil.insertLabResult(labResult);
|
commonUtil.insertLabResult(labResult);
|
||||||
List<XmCalc> xmCalcList = commonUtil.getXmCalcbyxmdh(yq, xmdh);
|
List<XmCalc> xmCalcList = commonUtil.getXmCalcbyxmdh(yq, xmdh);
|
||||||
if (xmCalcList.size() > 0) {
|
if (!xmCalcList.isEmpty()) {
|
||||||
List<LabResult> labResultList = commonUtil.getLabResultList(jyrq, yq, ybh);
|
List<LabResult> labResultList = commonUtil.getLabResultList(jyrq, yq, ybh);
|
||||||
labResultList = calcsample(labPat, labResultList, xmCalcList);
|
labResultList = calcsample(labPat, labResultList, xmCalcList);
|
||||||
List<LabResult> labResultList1 = labResultList.stream().filter(labR -> labR.getChangeflag() != null).filter(labR -> labR.getChangeflag() == 1).collect(Collectors.toList());
|
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) {
|
for (LabResult labResult0 : labResultList1) {
|
||||||
changeresultf(labPat, labResult0, nowjz);
|
changeresultf(labPat, labResult0, nowjz);
|
||||||
}
|
}
|
||||||
@ -1743,11 +1749,11 @@ public class LisWorkUtils {
|
|||||||
labResult = setxmdhrefs(labPat, labResult, xmInfo, getXmAlarmdetail, nowjz);
|
labResult = setxmdhrefs(labPat, labResult, xmInfo, getXmAlarmdetail, nowjz);
|
||||||
commonUtil.updateLabResult(labResult);
|
commonUtil.updateLabResult(labResult);
|
||||||
List<XmCalc> xmCalcList = commonUtil.getXmCalcbyxmdh(yq, xmdh);
|
List<XmCalc> xmCalcList = commonUtil.getXmCalcbyxmdh(yq, xmdh);
|
||||||
if (xmCalcList.size() > 0) {
|
if (!xmCalcList.isEmpty()) {
|
||||||
List<LabResult> labResultList = commonUtil.getLabResultList(jyrq, yq, ybh);
|
List<LabResult> labResultList = commonUtil.getLabResultList(jyrq, yq, ybh);
|
||||||
labResultList = calcsample(labPat, labResultList, xmCalcList);
|
labResultList = calcsample(labPat, labResultList, xmCalcList);
|
||||||
List<LabResult> labResultList1 = labResultList.stream().filter(labR -> labR.getChangeflag() != null).filter(labR -> labR.getChangeflag() == 1).collect(Collectors.toList());
|
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) {
|
for (LabResult labResult0 : labResultList1) {
|
||||||
changeresultf(labPat, labResult0, nowjz);
|
changeresultf(labPat, labResult0, nowjz);
|
||||||
}
|
}
|
||||||
@ -1780,11 +1786,11 @@ public class LisWorkUtils {
|
|||||||
LabInstrvsreqclass labInstrvsreqclass = new LabInstrvsreqclass();
|
LabInstrvsreqclass labInstrvsreqclass = new LabInstrvsreqclass();
|
||||||
labInstrvsreqclass.setYq(yq);
|
labInstrvsreqclass.setYq(yq);
|
||||||
List<LabInstrvsreqclass> labInstrvsreqclassList = labInstrvsreqclassMapper.getLabInstrvsreqclassList(labInstrvsreqclass);
|
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> 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());
|
List<LabInstrvsreqclass> collect1 = labInstrvsreqclassList.stream().filter(labInstrvsreqclass1 -> labInstrvsreqclass1.getBgddh().equals("MZ_" + bgddh)).collect(Collectors.toList());
|
||||||
if (collect.size() > 0) return new Result("0", "");
|
if (!collect.isEmpty()) return new Result("0", "");
|
||||||
if (collect1.size() > 0) return new Result("0", "");
|
if (!collect1.isEmpty()) return new Result("0", "");
|
||||||
}
|
}
|
||||||
Long count = lisWorkUtilsMapper.checkReqClass(sqh, yq);
|
Long count = lisWorkUtilsMapper.checkReqClass(sqh, yq);
|
||||||
if (count > 0) {
|
if (count > 0) {
|
||||||
@ -1800,9 +1806,9 @@ public class LisWorkUtils {
|
|||||||
String yq = labPat.getYq();
|
String yq = labPat.getYq();
|
||||||
String ybh = labPat.getYbh();
|
String ybh = labPat.getYbh();
|
||||||
String userId = labPat.getYhdh();
|
String userId = labPat.getYhdh();
|
||||||
Date sjsj=commonUtil.getCurrentTime();
|
Date sjsj = commonUtil.getCurrentTime();
|
||||||
//修改状态和时间
|
//修改状态和时间
|
||||||
commonUtil.zxLabReqmain(sqh,userId);
|
commonUtil.zxLabReqmain(sqh, userId);
|
||||||
//保存lab_pat表信息
|
//保存lab_pat表信息
|
||||||
labPat.setYblx(commonUtil.getComDictIdByName("BT", labReqmain.getYblx()));
|
labPat.setYblx(commonUtil.getComDictIdByName("BT", labReqmain.getYblx()));
|
||||||
labPat.setKsdh(commonUtil.getComDictIdByName("DP", labReqmain.getKsdh()));
|
labPat.setKsdh(commonUtil.getComDictIdByName("DP", labReqmain.getKsdh()));
|
||||||
@ -1812,8 +1818,8 @@ public class LisWorkUtils {
|
|||||||
labPat.setBrxb(labReqmain.getBrxb());
|
labPat.setBrxb(labReqmain.getBrxb());
|
||||||
labPat.setBrly(labReqmain.getBrly());
|
labPat.setBrly(labReqmain.getBrly());
|
||||||
labPat.setSjys(labReqmain.getSqys());
|
labPat.setSjys(labReqmain.getSqys());
|
||||||
String brxb=labReqmain.getBrxb();
|
String brxb = labReqmain.getBrxb();
|
||||||
if(brxb!=null)brxb=brxb.trim();
|
if (brxb != null) brxb = brxb.trim();
|
||||||
labPat.setBrxb(brxb);
|
labPat.setBrxb(brxb);
|
||||||
labPat.setCh(labReqmain.getCh());
|
labPat.setCh(labReqmain.getCh());
|
||||||
Map<String, Object> ageFromBirthDay = AgeUtils.getAgeByBirthDate(labReqmain.getBrsr());
|
Map<String, Object> ageFromBirthDay = AgeUtils.getAgeByBirthDate(labReqmain.getBrsr());
|
||||||
@ -1837,7 +1843,7 @@ public class LisWorkUtils {
|
|||||||
labPat.setLstd(labReqmain.getLstd());
|
labPat.setLstd(labReqmain.getLstd());
|
||||||
labPat.setCjbw(labReqmain.getCjbw());
|
labPat.setCjbw(labReqmain.getCjbw());
|
||||||
String brxm0 = labPat.getBrxm();
|
String brxm0 = labPat.getBrxm();
|
||||||
if(!"".equals(brxm0)&&brxm0!=null) {
|
if (!"".equals(brxm0) && brxm0 != null) {
|
||||||
String pinyin = PinyinUtil.getFirstLetter(brxm0, ""); //拼音首字母
|
String pinyin = PinyinUtil.getFirstLetter(brxm0, ""); //拼音首字母
|
||||||
if (pinyin.length() >= 9) {
|
if (pinyin.length() >= 9) {
|
||||||
pinyin = pinyin.substring(0, 9);
|
pinyin = pinyin.substring(0, 9);
|
||||||
@ -1848,9 +1854,10 @@ public class LisWorkUtils {
|
|||||||
else commonUtil.updateLabPat(labPat);
|
else commonUtil.updateLabPat(labPat);
|
||||||
return new Result("0", "保存成功!", 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="";
|
public Result newPat(Date jyrq, String ybh, String yq, String brdh, String brly, String yljg, int problemId) {
|
||||||
if(yljg==null||"".equals(yljg))yljg=commonUtil.getLabInstr(yq).getYljg();
|
if (brly == null) brly = "";
|
||||||
|
if (yljg == null || yljg.isEmpty()) yljg = commonUtil.getLabInstr(yq).getYljg();
|
||||||
LabPat labPat = commonUtil.getLabPatOne(jyrq, yq, ybh);
|
LabPat labPat = commonUtil.getLabPatOne(jyrq, yq, ybh);
|
||||||
boolean newpatinfo = true;
|
boolean newpatinfo = true;
|
||||||
if (labPat != null) {
|
if (labPat != null) {
|
||||||
@ -1863,7 +1870,7 @@ public class LisWorkUtils {
|
|||||||
String sqh0 = labPat.getSqh();
|
String sqh0 = labPat.getSqh();
|
||||||
String brxm = labPat.getBrxm();
|
String brxm = labPat.getBrxm();
|
||||||
if (problemId < 1) {
|
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);
|
return new Result("5", "当前样本已有病人信息是否替换!", 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1875,63 +1882,63 @@ public class LisWorkUtils {
|
|||||||
labPat.setYq(yq);
|
labPat.setYq(yq);
|
||||||
labPat.setYbh(ybh);
|
labPat.setYbh(ybh);
|
||||||
labPat.setBrdh(brdh);
|
labPat.setBrdh(brdh);
|
||||||
if(!"".equals(brdh)){
|
if (!"".equals(brdh)) {
|
||||||
//4.获取病人信息
|
//4.获取病人信息
|
||||||
DayMessage dayMessage = new DayMessage();
|
DayMessage dayMessage = new DayMessage();
|
||||||
dayMessage.setIp("");
|
dayMessage.setIp("");
|
||||||
dayMessage.setYljg("1");
|
dayMessage.setYljg("1");
|
||||||
dayMessage.setUserid(yhdh);
|
dayMessage.setUserid(yhdh);
|
||||||
dayMessage.setMsgid(LisinterfaceNameConstants.DAYMESSAGE_GETPATIENT);
|
dayMessage.setMsgid(LisinterfaceNameConstants.DAYMESSAGE_GETPATIENT);
|
||||||
String val =brdh + "|"+brly+"|"+yljg; //这里有个医疗机构的,没有传,要考虑
|
String val = brdh + "|" + brly + "|" + yljg; //这里有个医疗机构的,没有传,要考虑
|
||||||
dayMessage.setMsg(val);
|
dayMessage.setMsg(val);
|
||||||
Result result = lisInterfaceUtil.invokeLisInterface(LisinterfaceNameConstants.DAYMESSAGE, dayMessage);
|
Result result = lisInterfaceUtil.invokeLisInterface(LisinterfaceNameConstants.DAYMESSAGE, dayMessage);
|
||||||
String msg=result.getMsg();
|
String msg = result.getMsg();
|
||||||
String[] msgret = msg.split("\\|");
|
String[] msgret = msg.split("\\|");
|
||||||
|
|
||||||
if(msgret.length>8) {
|
if (msgret.length > 8) {
|
||||||
labPat.setBrxm(msgret[0]);
|
labPat.setBrxm(msgret[0]);
|
||||||
labPat.setBrxb(msgret[1]);
|
labPat.setBrxb(msgret[1]);
|
||||||
String brsr=msgret[2];
|
String brsr = msgret[2];
|
||||||
if(!"".equals(brsr)&&brsr!=null) {
|
if (!"".equals(brsr) && brsr != null) {
|
||||||
Map<String, Object> ageFromBirthDay = AgeUtils.getAgeByBirthDate(brsr);
|
Map<String, Object> ageFromBirthDay = AgeUtils.getAgeByBirthDate(brsr);
|
||||||
String age = ageFromBirthDay.get("nl").toString();
|
String age = ageFromBirthDay.get("nl").toString();
|
||||||
String unit = ageFromBirthDay.get("nldw").toString();
|
String unit = ageFromBirthDay.get("nldw").toString();
|
||||||
labPat.setNl(Integer.parseInt(age));
|
labPat.setNl(Integer.parseInt(age));
|
||||||
labPat.setNldw(unit);
|
labPat.setNldw(unit);
|
||||||
|
}
|
||||||
|
labPat.setBrdh(msgret[3]);
|
||||||
|
labPat.setFb(msgret[4]);
|
||||||
|
labPat.setBrly(msgret[5]);
|
||||||
|
labPat.setCh(msgret[6]);
|
||||||
|
labPat.setKsdh(msgret[7]);
|
||||||
|
labPat.setZd(msgret[8]);
|
||||||
|
} else {
|
||||||
|
List<ComPat> comPatList = commonUtil.getComPat(brdh, yljg);
|
||||||
|
if (!comPatList.isEmpty()) {
|
||||||
|
ComPat comPat = comPatList.get(0);
|
||||||
|
labPat.setBrxm(comPat.getBrxm());
|
||||||
|
labPat.setCh(comPat.getCh());
|
||||||
|
labPat.setBrxm(comPat.getXb());
|
||||||
|
labPat.setBrly(comPat.getBrly());
|
||||||
|
labPat.setFb(comPat.getFb());
|
||||||
|
labPat.setKsdh(comPat.getKsdh());
|
||||||
|
labPat.setZd(comPat.getZd());
|
||||||
|
labPat.setMzh(comPat.getMzh());
|
||||||
|
labPat.setSjys(comPat.getSjys());
|
||||||
|
Date sr = comPat.getSr();
|
||||||
|
if (sr != null) {
|
||||||
|
Map<String, Object> ageFromBirthDay = AgeUtils.getAgeByBirthDate(sr);
|
||||||
|
String age = ageFromBirthDay.get("nl").toString();
|
||||||
|
String unit = ageFromBirthDay.get("nldw").toString();
|
||||||
|
labPat.setNl(Integer.parseInt(age));
|
||||||
|
labPat.setNldw(unit);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
labPat.setBrdh(msgret[3]);
|
|
||||||
labPat.setFb(msgret[4]);
|
|
||||||
labPat.setBrly(msgret[5]);
|
|
||||||
labPat.setCh(msgret[6]);
|
|
||||||
labPat.setKsdh(msgret[7]);
|
|
||||||
labPat.setZd(msgret[8]);
|
|
||||||
}else{
|
|
||||||
List<ComPat> comPatList= commonUtil.getComPat(brdh,yljg);
|
|
||||||
if(comPatList.size()>0) {
|
|
||||||
ComPat comPat=comPatList.get(0);
|
|
||||||
labPat.setBrxm(comPat.getBrxm());
|
|
||||||
labPat.setCh(comPat.getCh());
|
|
||||||
labPat.setBrxm(comPat.getXb());
|
|
||||||
labPat.setBrly(comPat.getBrly());
|
|
||||||
labPat.setFb(comPat.getFb());
|
|
||||||
labPat.setKsdh(comPat.getKsdh());
|
|
||||||
labPat.setZd(comPat.getZd());
|
|
||||||
labPat.setMzh(comPat.getMzh());
|
|
||||||
labPat.setSjys(comPat.getSjys());
|
|
||||||
Date sr=comPat.getSr();
|
|
||||||
if(sr!=null) {
|
|
||||||
Map<String, Object> ageFromBirthDay = AgeUtils.getAgeByBirthDate(sr);
|
|
||||||
String age = ageFromBirthDay.get("nl").toString();
|
|
||||||
String unit = ageFromBirthDay.get("nldw").toString();
|
|
||||||
labPat.setNl(Integer.parseInt(age));
|
|
||||||
labPat.setNldw(unit);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
labPat = loaddefault(labPat);
|
labPat = loaddefault(labPat);
|
||||||
String brxm0 = labPat.getBrxm();
|
String brxm0 = labPat.getBrxm();
|
||||||
if(!"".equals(brxm0)&&brxm0!=null) {
|
if (!"".equals(brxm0) && brxm0 != null) {
|
||||||
String pinyin = PinyinUtil.getFirstLetter(brxm0, ""); //拼音首字母
|
String pinyin = PinyinUtil.getFirstLetter(brxm0, ""); //拼音首字母
|
||||||
if (pinyin.length() >= 9) {
|
if (pinyin.length() >= 9) {
|
||||||
pinyin = pinyin.substring(0, 9);
|
pinyin = pinyin.substring(0, 9);
|
||||||
@ -1943,6 +1950,7 @@ public class LisWorkUtils {
|
|||||||
else commonUtil.updateLabPat(labPat);
|
else commonUtil.updateLabPat(labPat);
|
||||||
return new Result("0", "保存成功!", labPat);
|
return new Result("0", "保存成功!", labPat);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Result newPatInfo(Date jyrq, String ybh, String sqh, String yq, int problemId) {
|
public Result newPatInfo(Date jyrq, String ybh, String sqh, String yq, int problemId) {
|
||||||
|
|
||||||
LabPat labPat = commonUtil.getLabPatOne(jyrq, yq, ybh);
|
LabPat labPat = commonUtil.getLabPatOne(jyrq, yq, ybh);
|
||||||
@ -1957,7 +1965,7 @@ public class LisWorkUtils {
|
|||||||
String sqh0 = labPat.getSqh();
|
String sqh0 = labPat.getSqh();
|
||||||
String brxm = labPat.getBrxm();
|
String brxm = labPat.getBrxm();
|
||||||
if (problemId < 1) {
|
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);
|
return new Result("5", "当前样本已有病人信息是否替换!", 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2009,11 +2017,12 @@ public class LisWorkUtils {
|
|||||||
if (!result3.getCode().equals("0")) return result3;
|
if (!result3.getCode().equals("0")) return result3;
|
||||||
|
|
||||||
//6.写日志
|
//6.写日志
|
||||||
lisWorkUtils.setComLog(jyrq,yq,ybh,yhdh,ComLogConstants.LG_SJ,sqh);
|
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);
|
return new Result("0", "", labPat);
|
||||||
}
|
}
|
||||||
|
|
||||||
public LabPat loaddefault(LabPat labPat) {
|
public LabPat loaddefault(LabPat labPat) {
|
||||||
Date jyrq = labPat.getJyrq();
|
Date jyrq = labPat.getJyrq();
|
||||||
String yq = labPat.getYq();
|
String yq = labPat.getYq();
|
||||||
@ -2024,7 +2033,7 @@ public class LisWorkUtils {
|
|||||||
SysLoginParam loginConfigParam = loginConfigParamUtil.getLoginConfigParam();
|
SysLoginParam loginConfigParam = loginConfigParamUtil.getLoginConfigParam();
|
||||||
String Current_instrid = loginConfigParam.getCurrent_instrid();
|
String Current_instrid = loginConfigParam.getCurrent_instrid();
|
||||||
List<LabInputcol> labInputcolList = loginConfigParam.getCurrent_labInputcol();
|
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_sybh("");
|
||||||
loginConfigParam.setCurrent_yhdh_eybh("");
|
loginConfigParam.setCurrent_yhdh_eybh("");
|
||||||
loginConfigParam.setCurrent_hdys_sybh("");
|
loginConfigParam.setCurrent_hdys_sybh("");
|
||||||
@ -2032,10 +2041,10 @@ public class LisWorkUtils {
|
|||||||
labInputcolList = commonUtil.getLabInputcol(yq);
|
labInputcolList = commonUtil.getLabInputcol(yq);
|
||||||
loginConfigParam.setCurrent_labInputcol(labInputcolList);
|
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;
|
String mrz = null;
|
||||||
for (LabInputcol labInputcol : labInputcolList0) {
|
for (LabInputcol labInputcol : labInputcolList0) {
|
||||||
if (!"!".equals(labInputcol)) {
|
if (!"!".equals(labInputcol.getZdmc())) {
|
||||||
String zdmc = labInputcol.getZdmc();
|
String zdmc = labInputcol.getZdmc();
|
||||||
|
|
||||||
switch (zdmc) {
|
switch (zdmc) {
|
||||||
@ -2045,13 +2054,13 @@ public class LisWorkUtils {
|
|||||||
case "nl":
|
case "nl":
|
||||||
break;
|
break;
|
||||||
case "yhdh":
|
case "yhdh":
|
||||||
String yhdh0=labPat.getYhdh();
|
String yhdh0 = labPat.getYhdh();
|
||||||
if (yhdh0 == null ||"".equals(yhdh0)) {
|
if (yhdh0 == null || yhdh0.isEmpty()) {
|
||||||
mrz = labInputcol.getMrz();
|
mrz = labInputcol.getMrz();
|
||||||
if (mrz != null && "".equals(mrz)) {
|
if (mrz != null && !mrz.isEmpty()) {
|
||||||
String sybh = loginConfigParam.getCurrent_yhdh_sybh();
|
String sybh = loginConfigParam.getCurrent_yhdh_sybh();
|
||||||
String eybh = loginConfigParam.getCurrent_yhdh_eybh();
|
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)) {
|
if (LisUtil.isStringBetween(ybh, sybh, eybh)) {
|
||||||
labPat.setYhdh(mrz);
|
labPat.setYhdh(mrz);
|
||||||
}
|
}
|
||||||
@ -2062,11 +2071,11 @@ public class LisWorkUtils {
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case "hdys":
|
case "hdys":
|
||||||
String hdys0=labPat.getYhdh();
|
String hdys0 = labPat.getYhdh();
|
||||||
if (hdys0 == null ||"".equals(hdys0)) {
|
if (hdys0 == null || hdys0.isEmpty()) {
|
||||||
String sybh = loginConfigParam.getCurrent_hdys_sybh();
|
String sybh = loginConfigParam.getCurrent_hdys_sybh();
|
||||||
String eybh = loginConfigParam.getCurrent_hdys_eybh();
|
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)) {
|
if (LisUtil.isStringBetween(ybh, sybh, eybh)) {
|
||||||
labPat.setHdys(mrz);
|
labPat.setHdys(mrz);
|
||||||
}
|
}
|
||||||
@ -2076,10 +2085,10 @@ public class LisWorkUtils {
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
String value=(String)EntityUtils.getItem(labPat,zdmc);
|
String value = (String) EntityUtils.getItem(labPat, zdmc);
|
||||||
if (value == null ||"".equals(value)) {
|
if (value == null || value.isEmpty()) {
|
||||||
mrz = labInputcol.getMrz();
|
mrz = labInputcol.getMrz();
|
||||||
if (mrz != null && !"".equals(mrz)) {
|
if (mrz != null && !mrz.isEmpty()) {
|
||||||
EntityUtils.setItem(labPat, zdmc, mrz);
|
EntityUtils.setItem(labPat, zdmc, mrz);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2087,12 +2096,12 @@ public class LisWorkUtils {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
String yhdh = SecurityUtils.getLoginUser().getUsername();
|
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.setYhdh(SecurityUtils.getLoginUser().getUsername());
|
||||||
labPat.setLastuser(yhdh);
|
labPat.setLastuser(yhdh);
|
||||||
labPat.setLastdt(ldt_now);
|
labPat.setLastdt(ldt_now);
|
||||||
Integer shcs=labPat.getShcs();
|
Integer shcs = labPat.getShcs();
|
||||||
if(shcs==null)labPat.setShcs(0);
|
if (shcs == null) labPat.setShcs(0);
|
||||||
if (labPat.getJgbz() == null) labPat.setJgbz(LabPatConstants.DEFAULT);
|
if (labPat.getJgbz() == null) labPat.setJgbz(LabPatConstants.DEFAULT);
|
||||||
return labPat;
|
return labPat;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -54,15 +54,15 @@ public class ReportUtil {
|
|||||||
|
|
||||||
|
|
||||||
public void printBarCode(BarCodeParam mzBarCodeParam) {
|
public void printBarCode(BarCodeParam mzBarCodeParam) {
|
||||||
|
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 {
|
try {
|
||||||
//构造数据
|
//构造数据
|
||||||
Map parameters = new HashMap();
|
|
||||||
parameters.put("barcode", mzBarCodeParam.getSqh());
|
|
||||||
parameters.put("line1", mzBarCodeParam.getBrxm() + " " + mzBarCodeParam.getBrxb() + " " + mzBarCodeParam.getNl());
|
|
||||||
parameters.put("line2", mzBarCodeParam.getSfxmmc());
|
|
||||||
JasperReportUtil.print(RuoYiConfig.getMzPrintName(), "barcode", parameters);
|
JasperReportUtil.print(RuoYiConfig.getMzPrintName(), "barcode", parameters);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
log.error("打印条码报错,条码号:{}", mzBarCodeParam.getSqh(), e);
|
log.error("打印条码报错,条码号:{}", mzBarCodeParam.getSqh(), e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -71,7 +71,6 @@ public class ReportUtil {
|
|||||||
public void printBackpaper(List<String> sqhs) {
|
public void printBackpaper(List<String> sqhs) {
|
||||||
String sqh = sqhs.get(0);
|
String sqh = sqhs.get(0);
|
||||||
BackPaperParam backPaperParam = backPaperMapper.selectReqmian(sqh);
|
BackPaperParam backPaperParam = backPaperMapper.selectReqmian(sqh);
|
||||||
// ObjectMapper objectMapper = new ObjectMapper();
|
|
||||||
Map<String, Object> parameters = BeanUtil.beanToMap(backPaperParam);
|
Map<String, Object> parameters = BeanUtil.beanToMap(backPaperParam);
|
||||||
parameters.put("company", commonUtil.getCompany(backPaperParam.getYljg()));
|
parameters.put("company", commonUtil.getCompany(backPaperParam.getYljg()));
|
||||||
parameters.put("age", AgeUtils.getAge(backPaperParam.getBrsr()));
|
parameters.put("age", AgeUtils.getAge(backPaperParam.getBrsr()));
|
||||||
@ -85,13 +84,13 @@ public class ReportUtil {
|
|||||||
String bglqsm = "";
|
String bglqsm = "";
|
||||||
if (bglqdh1 != null) {
|
if (bglqdh1 != null) {
|
||||||
List<LabRptgetruledetailCX> labRptgetruledetail = backPaperMapper.getLabRptgetruledetail(bglqdh1);
|
List<LabRptgetruledetailCX> labRptgetruledetail = backPaperMapper.getLabRptgetruledetail(bglqdh1);
|
||||||
if (labRptgetruledetail.size() > 0) {
|
if (!labRptgetruledetail.isEmpty()) {
|
||||||
bglqsm = labRptgetruledetail.get(0).getBglqsm();
|
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);
|
List<LabRptgetruledetailCX> labRptgetruledetail = backPaperMapper.getLabRptgetruledetail(bglqdh2);
|
||||||
if (labRptgetruledetail.size() > 0) {
|
if (!labRptgetruledetail.isEmpty()) {
|
||||||
bglqsm = labRptgetruledetail.get(0).getBglqsm();
|
bglqsm = labRptgetruledetail.get(0).getBglqsm();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -101,7 +100,7 @@ public class ReportUtil {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
//构造数据
|
//构造数据
|
||||||
System.out.println("入参参数:" + parameters.toString());
|
System.out.println("入参参数:" + parameters);
|
||||||
JasperReportUtil.print(RuoYiConfig.getMzPrintName(), "backpaper", parameters, detailList);
|
JasperReportUtil.print(RuoYiConfig.getMzPrintName(), "backpaper", parameters, detailList);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
@ -116,7 +115,7 @@ public class ReportUtil {
|
|||||||
|
|
||||||
public Result printToPdf(String templatename, BarCodeParam barCodeParam, String pdfName, boolean base64) {
|
public Result printToPdf(String templatename, BarCodeParam barCodeParam, String pdfName, boolean base64) {
|
||||||
String staticpath=ImageUtils.getStaticPath()+ File.separator;
|
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);
|
Map<String, Object> stringObjectMap = BeanUtil.beanToMap(barCodeParam);
|
||||||
try {
|
try {
|
||||||
Connection connection = dataSource.getConnection();
|
Connection connection = dataSource.getConnection();
|
||||||
@ -130,9 +129,9 @@ public class ReportUtil {
|
|||||||
if (base64) {
|
if (base64) {
|
||||||
//删除图片文件
|
//删除图片文件
|
||||||
String[] pic = barCodeParam.getPic();
|
String[] pic = barCodeParam.getPic();
|
||||||
if(pic != null && pic.length > 0){
|
if(pic != null){
|
||||||
for (int i = 0; i < pic.length; i++) {
|
for (String s : pic) {
|
||||||
String picFilePath =staticpath+ File.separator +"graphs"+File.separator + StrUtil.splitToArray(pic[i], "graphs/")[1];
|
String picFilePath = staticpath + File.separator + "graphs" + File.separator + StrUtil.splitToArray(s, "graphs/")[1];
|
||||||
FileUtils.deleteFile(picFilePath);
|
FileUtils.deleteFile(picFilePath);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -154,8 +153,8 @@ public class ReportUtil {
|
|||||||
return getHttpURL("printPDF")+"/"+pdfName+".pdf";
|
return getHttpURL("printPDF")+"/"+pdfName+".pdf";
|
||||||
}
|
}
|
||||||
public String getHttpURL(String pathChild) {
|
public String getHttpURL(String pathChild) {
|
||||||
String httpPath = "";
|
String httpPath;
|
||||||
if (printURL == null || printURL.equals("")) {
|
if (printURL == null || printURL.isEmpty()) {
|
||||||
httpPath = "http://" + IpUtils.getHostIp() + ":" + port + "/" + pathChild;
|
httpPath = "http://" + IpUtils.getHostIp() + ":" + port + "/" + pathChild;
|
||||||
} else {
|
} else {
|
||||||
httpPath = "http://" + printURL + ":" + port + "/" + pathChild;
|
httpPath = "http://" + printURL + ":" + port + "/" + pathChild;
|
||||||
@ -166,10 +165,10 @@ public class ReportUtil {
|
|||||||
/**
|
/**
|
||||||
* 判断当前报告单是否使用A4报告单
|
* 判断当前报告单是否使用A4报告单
|
||||||
*
|
*
|
||||||
* @param jyrq
|
* @param jyrq 检验日期
|
||||||
* @param yq
|
* @param yq 仪器
|
||||||
* @param ybh
|
* @param ybh 样本号
|
||||||
* @return
|
* @return 返回纸张格式
|
||||||
*/
|
*/
|
||||||
public String getReportPaperSize(Date jyrq, String yq, String ybh) {
|
public String getReportPaperSize(Date jyrq, String yq, String ybh) {
|
||||||
//是否分A4,A5报告单
|
//是否分A4,A5报告单
|
||||||
@ -237,9 +236,9 @@ public class ReportUtil {
|
|||||||
*/
|
*/
|
||||||
public void mergePdfsHorizontally(String Base64input1, String Base64input2, String output) throws IOException {
|
public void mergePdfsHorizontally(String Base64input1, String Base64input2, String output) throws IOException {
|
||||||
//把base64数据生成pdf文件
|
//把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));
|
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));
|
Base64.decodeToFile(Base64input2, new File(path2));
|
||||||
try (PdfWriter writer = new PdfWriter(output);
|
try (PdfWriter writer = new PdfWriter(output);
|
||||||
PdfDocument pdfDoc = new PdfDocument(writer);
|
PdfDocument pdfDoc = new PdfDocument(writer);
|
||||||
@ -360,10 +359,10 @@ public class ReportUtil {
|
|||||||
String[] filename = new String[labGraphList.size()];
|
String[] filename = new String[labGraphList.size()];
|
||||||
String httpPath = getHttpURL(filepath);
|
String httpPath = getHttpURL(filepath);
|
||||||
int filecount = 0;
|
int filecount = 0;
|
||||||
if (labGraphList.size() > 0) {
|
if (!labGraphList.isEmpty()) {
|
||||||
for (LabGraph labGraph : labGraphList) {
|
for (LabGraph labGraph : labGraphList) {
|
||||||
String txlb = labGraph.getTxlb();
|
String txlb = labGraph.getTxlb();
|
||||||
String txlbmc = UUID.randomUUID().toString() + "." + txlb.toLowerCase();
|
String txlbmc = UUID.randomUUID() + "." + txlb.toLowerCase();
|
||||||
byte[] txnr = labGraph.getTxnr();
|
byte[] txnr = labGraph.getTxnr();
|
||||||
try {
|
try {
|
||||||
ImageUtils.generateToStaticDir(txnr, filepath, txlbmc);
|
ImageUtils.generateToStaticDir(txnr, filepath, txlbmc);
|
||||||
@ -379,11 +378,11 @@ public class ReportUtil {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取电子签名
|
* 获取电子签名
|
||||||
* @param yhdh
|
* @param yhdh 用户代号
|
||||||
* @return
|
* @return 签名地址
|
||||||
*/
|
*/
|
||||||
public String getSignName(String yhdh) {
|
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 ;
|
//SELECT zplx INTO :ls_pictype FROM off_staff WHERE rydh = :as_userno ;
|
||||||
String pictype="jpg";//暂时写死是jpg,8.0新版本后期可以考虑用户表增加字段指定类型
|
String pictype="jpg";//暂时写死是jpg,8.0新版本后期可以考虑用户表增加字段指定类型
|
||||||
String dirpath="signname";
|
String dirpath="signname";
|
||||||
|
|||||||
@ -21,6 +21,25 @@
|
|||||||
<select id="getLisgroup" resultType="String">
|
<select id="getLisgroup" resultType="String">
|
||||||
select lisgroup from lab_instr where yq=#{yq}
|
select lisgroup from lab_instr where yq=#{yq}
|
||||||
</select>
|
</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 id="getLabInstrList" resultType="com.czlis.common.core.domain.entity.lis.LabInstr" parameterType="com.czlis.common.core.domain.entity.lis.LabInstr">
|
||||||
select * from lab_instr
|
select * from lab_instr
|
||||||
<where>
|
<where>
|
||||||
|
|||||||
@ -3,16 +3,13 @@ package com.czlis.liswork.controller.dict;
|
|||||||
import com.czlis.common.annotation.Log;
|
import com.czlis.common.annotation.Log;
|
||||||
import com.czlis.common.core.controller.BaseController;
|
import com.czlis.common.core.controller.BaseController;
|
||||||
import com.czlis.common.core.domain.Result;
|
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.core.domain.entity.lis.LabInstr;
|
||||||
import com.czlis.common.enums.BusinessType;
|
import com.czlis.common.enums.BusinessType;
|
||||||
import com.czlis.liswork.service.InstrService;
|
import com.czlis.liswork.service.InstrService;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 仪器维护注册
|
* 仪器维护注册
|
||||||
@ -22,22 +19,21 @@ import java.util.List;
|
|||||||
@RequestMapping("/instr")
|
@RequestMapping("/instr")
|
||||||
public class InstrController extends BaseController {
|
public class InstrController extends BaseController {
|
||||||
|
|
||||||
@Autowired
|
private final InstrService instrService;
|
||||||
private InstrService instrService;
|
|
||||||
|
public InstrController(InstrService instrService) {
|
||||||
|
this.instrService = instrService;
|
||||||
|
}
|
||||||
|
|
||||||
@ApiOperation("查询数据")
|
@ApiOperation("查询数据")
|
||||||
@GetMapping("/query")
|
@GetMapping("/query")
|
||||||
public TableDataInfo query(String yq){
|
public Result query(String yq){
|
||||||
startPage();
|
return new Result("0","",instrService.query(yq));
|
||||||
List<LabInstr> labInstrList = instrService.query(yq);
|
|
||||||
return getDataTable(labInstrList);
|
|
||||||
}
|
}
|
||||||
@ApiOperation("按组查询数据")
|
@ApiOperation("按组查询数据")
|
||||||
@GetMapping("/querybylisgroup")
|
@GetMapping("/querybylisgroup")
|
||||||
public TableDataInfo querybylisgroup(String lisgroup){
|
public Result querybylisgroup(String lisgroup){
|
||||||
startPage();
|
return instrService.querybylisgroup(lisgroup);
|
||||||
List<LabInstr> labInstrList = instrService.querybylisgroup(lisgroup);
|
|
||||||
return getDataTable(labInstrList);
|
|
||||||
}
|
}
|
||||||
@ApiOperation("新增数据")
|
@ApiOperation("新增数据")
|
||||||
@PostMapping("/add")
|
@PostMapping("/add")
|
||||||
|
|||||||
@ -3,14 +3,10 @@ package com.czlis.liswork.controller.work;
|
|||||||
import com.czlis.common.annotation.Log;
|
import com.czlis.common.annotation.Log;
|
||||||
import com.czlis.common.core.controller.BaseController;
|
import com.czlis.common.core.controller.BaseController;
|
||||||
import com.czlis.common.core.domain.Result;
|
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.LabPat;
|
||||||
import com.czlis.common.core.domain.entity.lis.LabResult;
|
import com.czlis.common.core.domain.entity.lis.LabResult;
|
||||||
import com.czlis.common.core.page.TableDataInfo;
|
import com.czlis.common.core.page.TableDataInfo;
|
||||||
import com.czlis.common.enums.BusinessType;
|
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.LabResultService;
|
||||||
import com.czlis.liswork.service.LisWorkService;
|
import com.czlis.liswork.service.LisWorkService;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
@ -19,7 +15,6 @@ import lombok.extern.slf4j.Slf4j;
|
|||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@ -36,16 +31,7 @@ public class LisWorkController extends BaseController {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private LisWorkService lisWorkService;
|
private LisWorkService lisWorkService;
|
||||||
@Autowired
|
@Autowired
|
||||||
private LabPatService labPatService;
|
|
||||||
@Autowired
|
|
||||||
private LabResultService labResultService;
|
private LabResultService labResultService;
|
||||||
@Autowired
|
|
||||||
LoginConfigParamUtil loginConfigParamUtil;
|
|
||||||
/**
|
|
||||||
* 可操作仪器查询
|
|
||||||
*
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@ApiOperation("可操作仪器查询")
|
@ApiOperation("可操作仪器查询")
|
||||||
@GetMapping("/instrdlist")
|
@GetMapping("/instrdlist")
|
||||||
public Result getInstrdList() {
|
public Result getInstrdList() {
|
||||||
@ -53,29 +39,18 @@ public class LisWorkController extends BaseController {
|
|||||||
// SysLoginParam loginConfigParam = loginConfigParamUtil.getLoginConfigParam();
|
// SysLoginParam loginConfigParam = loginConfigParamUtil.getLoginConfigParam();
|
||||||
// loginConfigParam.setYq("BC5300");
|
// loginConfigParam.setYq("BC5300");
|
||||||
// loginConfigParamUtil.setLoginConfigParam(loginConfigParam);
|
// 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("切换仪器,查询仪器参数")
|
@ApiOperation("切换仪器,查询仪器参数")
|
||||||
@GetMapping("/instrdconfig")
|
@GetMapping("/instrdconfig")
|
||||||
public Result getInstrdConfig(String yq) {
|
public Result getInstrdConfig(String yq) {
|
||||||
return lisWorkService.getInstrdConfig(yq);
|
return lisWorkService.getInstrdConfig(yq);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取样本列表
|
|
||||||
*
|
|
||||||
* @param jyrq
|
|
||||||
* @param yq
|
|
||||||
* @param days
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@ApiOperation("获取样本列表")
|
@ApiOperation("获取样本列表")
|
||||||
@GetMapping("/samplelist")
|
@GetMapping("/samplelist")
|
||||||
public Result getSampleList(Date jyrq,String yq,Long days){
|
public Result getSampleList(Date jyrq,String yq,Long days){
|
||||||
@ -93,15 +68,6 @@ public class LisWorkController extends BaseController {
|
|||||||
clearPage();
|
clearPage();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取普通样本信息
|
|
||||||
*
|
|
||||||
* @param jyrq
|
|
||||||
* @param yq
|
|
||||||
* @param ybh
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@ApiOperation("获取普通样本信息")
|
@ApiOperation("获取普通样本信息")
|
||||||
@GetMapping("/sampleinfo")
|
@GetMapping("/sampleinfo")
|
||||||
public Result sampleInfo(Date jyrq, String yq, String ybh) {
|
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) {
|
public Result queryxmval(String yq,String xmdh) {
|
||||||
return lisWorkService.getXmVal(yq,xmdh);
|
return lisWorkService.getXmVal(yq,xmdh);
|
||||||
}
|
}
|
||||||
/**
|
|
||||||
* 获取微生物样本信息
|
|
||||||
*
|
|
||||||
* @param jyrq
|
|
||||||
* @param yq
|
|
||||||
* @param ybh
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@ApiOperation("获取微生物样本信息")
|
@ApiOperation("获取微生物样本信息")
|
||||||
@GetMapping("/sampleMedInfo")
|
@GetMapping("/sampleMedInfo")
|
||||||
public Result sampleMedInfo(Date jyrq, String yq, String ybh) {
|
public Result sampleMedInfo(Date jyrq, String yq, String ybh) {
|
||||||
return lisWorkService.sampleMedInfo(jyrq, yq, ybh);
|
return lisWorkService.sampleMedInfo(jyrq, yq, ybh);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation("工号密码验证")
|
@ApiOperation("工号密码验证")
|
||||||
@GetMapping("/checkuserid")
|
@GetMapping("/checkuserid")
|
||||||
public Result checkUser(String yhdh, String mm) {
|
public Result checkUser(String yhdh, String mm) {
|
||||||
return lisWorkService.checkUser(yhdh, mm);
|
return lisWorkService.checkUser(yhdh, mm);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation("获取检验结果")
|
@ApiOperation("获取检验结果")
|
||||||
@GetMapping("/resultinfo")
|
@GetMapping("/resultinfo")
|
||||||
public Result getresultinfo(LabResult labResult) {
|
public Result getresultinfo(LabResult labResult) {
|
||||||
@ -147,7 +103,6 @@ public class LisWorkController extends BaseController {
|
|||||||
// log.info("jyrq,{}", jyrq.toString());
|
// log.info("jyrq,{}", jyrq.toString());
|
||||||
return lisWorkService.getresultinfo(jyrq, yq, ybh);
|
return lisWorkService.getresultinfo(jyrq, yq, ybh);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Log(title = "主界面",businessType = BusinessType.DELETE_DETAIL)
|
@Log(title = "主界面",businessType = BusinessType.DELETE_DETAIL)
|
||||||
@ApiOperation("删除检验结果")
|
@ApiOperation("删除检验结果")
|
||||||
@PostMapping("/deleteresult")
|
@PostMapping("/deleteresult")
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
package com.czlis.liswork.mapper.xtwh;
|
package com.czlis.liswork.mapper.xtwh;
|
||||||
|
|
||||||
import com.czlis.common.core.domain.entity.lis.LabInstr;
|
import com.czlis.common.core.domain.entity.lis.LabInstr;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@ -9,6 +10,5 @@ public interface InstrMapper {
|
|||||||
void add(LabInstr labInstr);
|
void add(LabInstr labInstr);
|
||||||
void update(LabInstr labInstr);
|
void update(LabInstr labInstr);
|
||||||
void delete(String yq);
|
void delete(String yq);
|
||||||
|
|
||||||
List<LabInstr> querybylisgroup(String lisgroup);
|
List<LabInstr> querybylisgroup(String lisgroup);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -13,6 +13,5 @@ public interface InstrService {
|
|||||||
Result update(LabInstr labInstr);
|
Result update(LabInstr labInstr);
|
||||||
|
|
||||||
Result delete(String yq);
|
Result delete(String yq);
|
||||||
|
Result querybylisgroup(String lisgroup);
|
||||||
List<LabInstr> querybylisgroup(String lisgroup);
|
|
||||||
}
|
}
|
||||||
@ -10,8 +10,8 @@ import java.util.List;
|
|||||||
|
|
||||||
|
|
||||||
public interface LisWorkService {
|
public interface LisWorkService {
|
||||||
Result getInstrdList(Long userId);
|
Result getInstrdList();
|
||||||
Result getGroupInstrdList(Long userId,String groupId);
|
Result getGroupInstrdList(String groupId);
|
||||||
Result getInstrdConfig(String yq);
|
Result getInstrdConfig(String yq);
|
||||||
List<LabPat> getSampleList(Date jyrq, String yq, Long days);
|
List<LabPat> getSampleList(Date jyrq, String yq, Long days);
|
||||||
Result getresultinfo(Date jyrq, String yq, String ybh);
|
Result getresultinfo(Date jyrq, String yq, String ybh);
|
||||||
|
|||||||
@ -5,7 +5,6 @@ import com.czlis.liswork.mapper.xtwh.InstrMapper;
|
|||||||
import com.czlis.common.core.domain.entity.lis.LabInstr;
|
import com.czlis.common.core.domain.entity.lis.LabInstr;
|
||||||
import com.czlis.liswork.service.InstrService;
|
import com.czlis.liswork.service.InstrService;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
|
||||||
@ -15,8 +14,11 @@ import java.util.List;
|
|||||||
@Slf4j
|
@Slf4j
|
||||||
public class InstrServiceImpl implements InstrService {
|
public class InstrServiceImpl implements InstrService {
|
||||||
|
|
||||||
@Autowired
|
private final InstrMapper instrMapper;
|
||||||
private InstrMapper instrMapper;
|
|
||||||
|
public InstrServiceImpl(InstrMapper instrMapper) {
|
||||||
|
this.instrMapper = instrMapper;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -25,8 +27,10 @@ public class InstrServiceImpl implements InstrService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<LabInstr> querybylisgroup(String lisgroup) {
|
public Result querybylisgroup(String lisgroup) {
|
||||||
return instrMapper.querybylisgroup(lisgroup);
|
if("ALL".equals(lisgroup))lisgroup="";
|
||||||
|
List<LabInstr> labInstrList = instrMapper.querybylisgroup(lisgroup);
|
||||||
|
return new Result("0","",labInstrList);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@ -15,10 +15,8 @@ import com.czlis.interfaceCommon.utils.*;
|
|||||||
import com.czlis.liswork.mapper.LisWorkMapper;
|
import com.czlis.liswork.mapper.LisWorkMapper;
|
||||||
|
|
||||||
|
|
||||||
import com.czlis.liswork.mapper.xtwh.InstrMapper;
|
|
||||||
import com.czlis.liswork.service.LisWorkService;
|
import com.czlis.liswork.service.LisWorkService;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
@ -28,18 +26,20 @@ import java.util.stream.Collectors;
|
|||||||
@Slf4j
|
@Slf4j
|
||||||
public class LisWorkServiceImpl implements LisWorkService {
|
public class LisWorkServiceImpl implements LisWorkService {
|
||||||
|
|
||||||
@Autowired
|
private final LisWorkMapper lisWorkMapper;
|
||||||
private LisWorkMapper lisWorkMapper;
|
private final CommonUtil commonUtil;
|
||||||
@Autowired
|
private final LoginConfigParamUtil loginConfigParamUtil;
|
||||||
CommonUtil commonUtil;
|
private final ReportUtil reportUtil;
|
||||||
@Autowired
|
private final LisWorkUtils lisWorkUtils;
|
||||||
private InstrMapper instrMapper;
|
|
||||||
@Autowired
|
public LisWorkServiceImpl(LisWorkMapper lisWorkMapper, CommonUtil commonUtil, LoginConfigParamUtil loginConfigParamUtil, ReportUtil reportUtil, LisWorkUtils lisWorkUtils) {
|
||||||
LoginConfigParamUtil loginConfigParamUtil;
|
this.lisWorkMapper = lisWorkMapper;
|
||||||
@Autowired
|
this.commonUtil = commonUtil;
|
||||||
ReportUtil reportUtil;
|
this.loginConfigParamUtil = loginConfigParamUtil;
|
||||||
@Autowired
|
this.reportUtil = reportUtil;
|
||||||
LisWorkUtils lisWorkUtils;
|
this.lisWorkUtils = lisWorkUtils;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Result getXmInfo(String yq) {
|
public Result getXmInfo(String yq) {
|
||||||
List<XmInfo> xmInfoList =commonUtil.getXmInfoList(yq);
|
List<XmInfo> xmInfoList =commonUtil.getXmInfoList(yq);
|
||||||
@ -59,7 +59,7 @@ public class LisWorkServiceImpl implements LisWorkService {
|
|||||||
labPat=commonUtil.getLabPatOne(jyrq, yq, ybh);
|
labPat=commonUtil.getLabPatOne(jyrq, yq, ybh);
|
||||||
if(labPat==null) return new Result("-1","未找到报告单,打印失败!");
|
if(labPat==null) return new Result("-1","未找到报告单,打印失败!");
|
||||||
String jgbz=labPat.getJgbz();
|
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","报告单未审核,禁止打印!");
|
if(!"2".equals(jgbz))return new Result("1","报告单未审核,禁止打印!");
|
||||||
Result res=reportUtil.printReport(labPat);
|
Result res=reportUtil.printReport(labPat);
|
||||||
if(!"1".equals(labPat.getDybz())) {
|
if(!"1".equals(labPat.getDybz())) {
|
||||||
@ -72,28 +72,33 @@ public class LisWorkServiceImpl implements LisWorkService {
|
|||||||
String yhdh=SecurityUtils.getLoginUser().getUsername();
|
String yhdh=SecurityUtils.getLoginUser().getUsername();
|
||||||
lisWorkUtils.setComLog(jyrq,yq,ybh,yhdh, ComLogConstants.LG_P,"");
|
lisWorkUtils.setComLog(jyrq,yq,ybh,yhdh, ComLogConstants.LG_P,"");
|
||||||
String sqh=labPat.getSqh();
|
String sqh=labPat.getSqh();
|
||||||
if(sqh!=null&&!"".equals(sqh)){
|
if(sqh!=null&& !sqh.isEmpty()){
|
||||||
lisWorkUtils.setlabReqsteplog(sqh, LabReqmainConstants.REPORT,yhdh);
|
lisWorkUtils.setlabReqsteplog(sqh, LabReqmainConstants.REPORT,yhdh);
|
||||||
}
|
}
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Result getInstrdList(Long userId) {
|
public Result getInstrdList() {
|
||||||
|
|
||||||
List<Map<String,Object>> comUsrpowerList = lisWorkMapper.getInstrdList(String.valueOf(userId));
|
List<LabInstr> labInstr=commonUtil.querybylisgroup("","","0");
|
||||||
return new Result("0","获取仪器列表成功!",comUsrpowerList);
|
return new Result("0","获取仪器列表成功!",labInstr);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Result getGroupInstrdList(Long userId,String groupId) {
|
public Result getGroupInstrdList(String groupId) {
|
||||||
if(userId==1){
|
if("ALL".equals(groupId))groupId="";
|
||||||
List<LabInstr> labInstr=instrMapper.querybylisgroup(groupId);
|
String yhdh=SecurityUtils.getLoginUser().getUsername();
|
||||||
return new Result("0","获取分组仪器列表成功!",labInstr);
|
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{
|
}else{
|
||||||
List<Map<String,Object>> comUsrpowerList = lisWorkMapper.getGroupInstrdList(String.valueOf(userId),groupId);
|
labInstr = commonUtil.getInstrdList(groupId, yljg, "0", yhdh, "2");
|
||||||
return new Result("0","获取分组仪器列表成功!",comUsrpowerList);
|
|
||||||
}
|
}
|
||||||
|
return new Result("0","获取分组仪器列表成功!",labInstr);
|
||||||
|
|
||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
@ -164,7 +169,7 @@ public class LisWorkServiceImpl implements LisWorkService {
|
|||||||
labInputcol.setDict("");
|
labInputcol.setDict("");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Map<String,Object> instrdConfig=new HashMap<String,Object>();
|
Map<String,Object> instrdConfig= new HashMap<>();
|
||||||
instrdConfig.put("ResultConfig",getInstrdResultConfig(yq));
|
instrdConfig.put("ResultConfig",getInstrdResultConfig(yq));
|
||||||
instrdConfig.put("labInputcolList",labInputcolList);
|
instrdConfig.put("labInputcolList",labInputcolList);
|
||||||
return new Result("0","获取仪器参数成功!",instrdConfig);
|
return new Result("0","获取仪器参数成功!",instrdConfig);
|
||||||
@ -172,7 +177,7 @@ public class LisWorkServiceImpl implements LisWorkService {
|
|||||||
|
|
||||||
private List<LabInputcol> getInstrdResultConfig(String yq){
|
private List<LabInputcol> getInstrdResultConfig(String yq){
|
||||||
String showod= commonUtil.getComOptValue(yq,"SHOWOD");
|
String showod= commonUtil.getComOptValue(yq,"SHOWOD");
|
||||||
if(showod==null||"".equals(showod))showod="0";
|
if(showod==null|| showod.isEmpty())showod="0";
|
||||||
String showodflag="0";
|
String showodflag="0";
|
||||||
String showcutoffflag="0";
|
String showcutoffflag="0";
|
||||||
String showrefsflag="1";
|
String showrefsflag="1";
|
||||||
@ -195,11 +200,11 @@ public class LisWorkServiceImpl implements LisWorkService {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
String result_label= commonUtil.getComOptValue(yq,"RESULT_LABEL");
|
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");
|
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");
|
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<>();
|
List<LabInputcol> ResultConfig=new ArrayList<>();
|
||||||
LabInputcol labInputcol=new LabInputcol();
|
LabInputcol labInputcol=new LabInputcol();
|
||||||
labInputcol.setXh(0);
|
labInputcol.setXh(0);
|
||||||
@ -308,14 +313,14 @@ public class LisWorkServiceImpl implements LisWorkService {
|
|||||||
public Result getresultinfo(Date jyrq, String yq, String ybh){
|
public Result getresultinfo(Date jyrq, String yq, String ybh){
|
||||||
List<LabResult> labResultList=commonUtil.getresultinfo(jyrq,yq,ybh);
|
List<LabResult> labResultList=commonUtil.getresultinfo(jyrq,yq,ybh);
|
||||||
List<LabResultlog> labResultlog=commonUtil.getLabResultlog(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) {
|
for (LabResult labResult : labResultList) {
|
||||||
String xmdh=labResult.getXmdh();
|
String xmdh=labResult.getXmdh();
|
||||||
String csjg=labResult.getCsjg();
|
String csjg=labResult.getCsjg();
|
||||||
if(csjg==null)csjg="";
|
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());
|
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) {
|
for(LabResultlog labResultlog1 : labResultlog0) {
|
||||||
String csjg0 = labResultlog1.getCsjg();
|
String csjg0 = labResultlog1.getCsjg();
|
||||||
if (csjg0 == null) csjg0 = "";
|
if (csjg0 == null) csjg0 = "";
|
||||||
@ -330,15 +335,13 @@ public class LisWorkServiceImpl implements LisWorkService {
|
|||||||
}
|
}
|
||||||
LabPat labPat =commonUtil.getLabPatOne(jyrq,yq,ybh);
|
LabPat labPat =commonUtil.getLabPatOne(jyrq,yq,ybh);
|
||||||
List<LabResult> labResultList0=getlastresult(labPat,labResultList);
|
List<LabResult> labResultList0=getlastresult(labPat,labResultList);
|
||||||
if(labResultList0.size()>0) {
|
if(!labResultList0.isEmpty()) {
|
||||||
for (LabResult labResult : labResultList) {
|
for (LabResult labResult : labResultList) {
|
||||||
labResult.setCp_lastjyrq(labResultList0.get(0).getJyrq());
|
labResult.setCp_lastjyrq(labResultList0.get(0).getJyrq());
|
||||||
String xmdh=labResult.getXmdh();
|
String xmdh=labResult.getXmdh();
|
||||||
String csjg=labResult.getCsjg();
|
if(xmdh!=null&& !xmdh.isEmpty()) {
|
||||||
if(csjg==null)csjg="";
|
|
||||||
if(xmdh!=null&&!"".equals(xmdh)) {
|
|
||||||
List<LabResult> labResult0 = labResultList0.stream().filter(rlog -> xmdh.equals(rlog.getXmdh())).collect(Collectors.toList());
|
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 csjg0 =labResult0.get(0).getCsjg();
|
||||||
String result_flag=labResult0.get(0).getResult_flag();
|
String result_flag=labResult0.get(0).getResult_flag();
|
||||||
if("未做".equals(csjg0)||csjg0==null){
|
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){
|
private List<LabResult> getlastresult(LabPat labPat,List<LabResult> labResultall){
|
||||||
@ -406,12 +411,12 @@ public class LisWorkServiceImpl implements LisWorkService {
|
|||||||
lastLabPatParam.setBrxm(brxm);
|
lastLabPatParam.setBrxm(brxm);
|
||||||
}
|
}
|
||||||
String interval = commonUtil.getComOptValue(yq,"COMPAREDA");
|
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);
|
int getday=-Integer.parseInt(interval);
|
||||||
lastLabPatParam.setEndda(jyrq);
|
lastLabPatParam.setEndda(jyrq);
|
||||||
lastLabPatParam.setStartda(LisUtil.relativeDate(jyrq,getday));
|
lastLabPatParam.setStartda(LisUtil.relativeDate(jyrq,getday));
|
||||||
String compother= commonUtil.getComOptValue(yq,"COMPOTHERINSTR");
|
String compother= commonUtil.getComOptValue(yq,"COMPOTHERINSTR");
|
||||||
if(compother!=null&&!"".equals(compother)) {
|
if(compother!=null&& !compother.isEmpty()) {
|
||||||
String instrlist = commonUtil.getComOptValue(yq, "COMPOTHERINSTRLIST");
|
String instrlist = commonUtil.getComOptValue(yq, "COMPOTHERINSTRLIST");
|
||||||
//'CAL800','XS500I','33','40'
|
//'CAL800','XS500I','33','40'
|
||||||
if("".equals(instrlist)||instrlist==null){lastLabPatParam.setYq(yq);}
|
if("".equals(instrlist)||instrlist==null){lastLabPatParam.setYq(yq);}
|
||||||
@ -421,18 +426,17 @@ public class LisWorkServiceImpl implements LisWorkService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
List<LabPat> labPatList =commonUtil.getlastLabPat(lastLabPatParam);
|
List<LabPat> labPatList =commonUtil.getlastLabPat(lastLabPatParam);
|
||||||
if(labPatList.size()>0) {
|
if(!labPatList.isEmpty()) {
|
||||||
for(LabPat labPat0:labPatList) {
|
for(LabPat labPat0:labPatList) {
|
||||||
Date jyrq0 = labPat0.getJyrq();
|
Date jyrq0 = labPat0.getJyrq();
|
||||||
String yq0 = labPat0.getYq();
|
String yq0 = labPat0.getYq();
|
||||||
String ybh0 = labPat0.getYbh();
|
String ybh0 = labPat0.getYbh();
|
||||||
if (jyrq0 == jyrq && yq0.equals(yq) && ybh0.equals(ybh)) {
|
if (!jyrq0.equals(jyrq) ||!yq0.equals(yq) ||!ybh0.equals(ybh)) {
|
||||||
}else {
|
|
||||||
List<LabResult> labResultList0 = commonUtil.getLabResultList(jyrq0, yq0, ybh0);
|
List<LabResult> labResultList0 = commonUtil.getLabResultList(jyrq0, yq0, ybh0);
|
||||||
for(LabResult labResult:labResultList0) {
|
for(LabResult labResult:labResultList0) {
|
||||||
String xmdh=labResult.getXmdh();
|
String xmdh=labResult.getXmdh();
|
||||||
List<LabResult> labResult0 = labResultall.stream().filter(rlog -> xmdh.equals(rlog.getXmdh())).collect(Collectors.toList());
|
List<LabResult> labResult0 = labResultall.stream().filter(rlog -> xmdh.equals(rlog.getXmdh())).collect(Collectors.toList());
|
||||||
if(labResult0.size()>0){
|
if(!labResult0.isEmpty()){
|
||||||
return labResultList0;
|
return labResultList0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -445,11 +449,9 @@ public class LisWorkServiceImpl implements LisWorkService {
|
|||||||
@Override
|
@Override
|
||||||
public List<LabPat> getSampleList(Date jyrq, String yq, Long days) {
|
public List<LabPat> getSampleList(Date jyrq, String yq, Long days) {
|
||||||
if(days>1) {
|
if(days>1) {
|
||||||
List<LabPat> labPatListday = commonUtil.getSampleListday(yq, days);
|
return commonUtil.getSampleListday(yq, days);//new Result("0", "获取样本数据成功!", labPatListday);
|
||||||
return labPatListday;//new Result("0", "获取样本数据成功!", labPatListday);
|
|
||||||
}else {
|
}else {
|
||||||
List<LabPat> labPatListday = commonUtil.getsamplelist(jyrq, yq);
|
return commonUtil.getsamplelist(jyrq, yq);//new Result("0", "获取样本数据成功!", labPatListday);
|
||||||
return labPatListday;//new Result("0", "获取样本数据成功!", labPatListday);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
@ -479,20 +481,22 @@ public class LisWorkServiceImpl implements LisWorkService {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Result checkUser(String yhdh, String mm) {
|
public Result checkUser(String yhdh, String mm) {
|
||||||
if(yhdh == null || yhdh.equals("")) return new Result("-1","用户名不能为空!");
|
if(yhdh == null || yhdh.isEmpty()) return new Result("-1","用户名不能为空!");
|
||||||
if(mm == null || mm.equals("")) return new Result("-1","密码不能为空!");
|
if(mm == null || mm.isEmpty()) return new Result("-1","密码不能为空!");
|
||||||
SysUser sysUser = lisWorkMapper.getSysUser(yhdh);
|
SysUser sysUser = lisWorkMapper.getSysUser(yhdh);
|
||||||
if (StringUtils.isNull(sysUser)) {
|
if (StringUtils.isNull(sysUser)) {
|
||||||
log.info("登录用户:{} 不存在.", yhdh);
|
log.info("登录用户:{} 不存在.", yhdh);
|
||||||
throw new ServiceException(MessageUtils.message("user.not.exists"));
|
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);
|
log.info("登录用户:{} 已被删除.", yhdh);
|
||||||
throw new ServiceException(MessageUtils.message("user.password.delete"));
|
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);
|
log.info("登录用户:{} 已被停用.", yhdh);
|
||||||
throw new ServiceException(MessageUtils.message("user.blocked"));
|
throw new ServiceException(MessageUtils.message("user.blocked"));
|
||||||
}
|
}
|
||||||
Boolean matchesflag =SecurityUtils.matchesPassword(mm,sysUser.getPassword());
|
boolean matchesflag =SecurityUtils.matchesPassword(mm,sysUser.getPassword());
|
||||||
if(matchesflag){
|
if(matchesflag){
|
||||||
return new Result("0","登录成功!");
|
return new Result("0","登录成功!");
|
||||||
}else{
|
}else{
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user