主程序

This commit is contained in:
tangw 2025-10-24 17:57:45 +08:00
parent 804f621646
commit 74f1515f59
9 changed files with 103 additions and 27 deletions

View File

@ -1,9 +1,11 @@
package com.czlis.interfaceCommon.mapper; package com.czlis.interfaceCommon.mapper;
import com.czlis.common.core.domain.entity.lis.LabPatlog;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import java.util.Date; import java.util.Date;
public interface LabPatlogMapper { public interface LabPatlogMapper {
int insertLabPatlog(@Param("jyrq") Date jyrq, @Param("yq")String yq, @Param("ybh") String ybh,@Param("xgrq")Date xgrq,@Param("xgyhdh")String xgyhdh,@Param("ip")String ip); int insertLabPatlog(@Param("jyrq") Date jyrq, @Param("yq")String yq, @Param("ybh") String ybh,@Param("xgrq")Date xgrq,@Param("xgyhdh")String xgyhdh,@Param("ip")String ip);
LabPatlog getLabPatlog(@Param("jyrq") Date jyrq, @Param("yq")String yq, @Param("ybh") String ybh,@Param("xgrq") Date xgrq);
} }

View File

@ -320,6 +320,9 @@ public class CommonUtil {
public void insertLabPatlog(Date jyrq, String yq, String ybh,Date xgrq,String xgyhdh,String ip) { public void insertLabPatlog(Date jyrq, String yq, String ybh,Date xgrq,String xgyhdh,String ip) {
labPatlogMapper.insertLabPatlog(jyrq, yq, ybh,xgrq,xgyhdh,ip); labPatlogMapper.insertLabPatlog(jyrq, yq, ybh,xgrq,xgyhdh,ip);
} }
public LabPatlog getLabPatlog(Date jyrq, String yq, String ybh,Date xgrq) {
return labPatlogMapper.getLabPatlog(jyrq, yq, ybh,xgrq);
}
public int getLabResultMedCount(Date jyrq, String yq, String ybh) { public int getLabResultMedCount(Date jyrq, String yq, String ybh) {
return labResultMedMapper.getLabResultMedCount(jyrq, yq, ybh); return labResultMedMapper.getLabResultMedCount(jyrq, yq, ybh);
} }

View File

@ -138,11 +138,15 @@ public class LisWorkUtils {
if(ybh==null||ybh.isEmpty())return new Result("-1", "主键为空!"); if(ybh==null||ybh.isEmpty())return new Result("-1", "主键为空!");
if(xmdh==null||xmdh.isEmpty())return new Result("-1", "主键为空!"); if(xmdh==null||xmdh.isEmpty())return new Result("-1", "主键为空!");
} }
commonUtil.delLabResultAll(jyrq0,yq0,ybh0); //commonUtil.delLabResultAll(jyrq0,yq0,ybh0);
for (LabResult labResult : labResultList) { for (LabResult labResult : labResultList) {
if(labResult.getChangeflag()==2) {
commonUtil.delLabResult(labResult);
commonUtil.insertLabResult(labResult); commonUtil.insertLabResult(labResult);
labResult.setChangeflag(0);
} }
return saveallresult(labResultList); }
return saveresult(labResultList);
} }
public Result saveallresult(Date jyrq, String yq, String ybh) { public Result saveallresult(Date jyrq, String yq, String ybh) {
List<LabResult> labResultList = commonUtil.getLabResultList(jyrq, yq, ybh); List<LabResult> labResultList = commonUtil.getLabResultList(jyrq, yq, ybh);
@ -2098,7 +2102,11 @@ public class LisWorkUtils {
if("1".equals(commonUtil.getHISOPT("zdsr"))){ if("1".equals(commonUtil.getHISOPT("zdsr"))){
labInputmdlList=commonUtil.getLabInputmdlzdsr(yq); labInputmdlList=commonUtil.getLabInputmdlzdsr(yq);
}else{ }else{
if(LisUtil.isNumber(ybh)) {
labInputmdlList = commonUtil.getLabInputmdlzdsrybh(yq, ybh); labInputmdlList = commonUtil.getLabInputmdlzdsrybh(yq, ybh);
}else{
labInputmdlList=new ArrayList<>();
}
} }
return labInputmdlList; return labInputmdlList;
} }

View File

@ -75,8 +75,7 @@
SELECT * FROM lab_inputmdl where yq = #{yq} and mbmc=#{mbmc} SELECT * FROM lab_inputmdl where yq = #{yq} and mbmc=#{mbmc}
</select> </select>
<select id="getLabInputmdlzdsrybh" resultType="com.czlis.common.core.domain.entity.lis.LabInputmdl"> <select id="getLabInputmdlzdsrybh" resultType="com.czlis.common.core.domain.entity.lis.LabInputmdl">
SELECT * FROM lab_inputmdl where yq = #{yq} AND zdsr = 'Y' SELECT * FROM lab_inputmdl where yq = #{yq} AND zdsr = 'Y' AND ${ybh}>=qsybh AND jsybh>= ${ybh}
AND right(space(20)+#{ybh},20) >= right(space(20)+qsybh,20) AND right(space(20)+jsybh,20) >= right(space(20)+#{ybh},20)
</select> </select>
<select id="getLabInputmdlzdsr" resultType="com.czlis.common.core.domain.entity.lis.LabInputmdl"> <select id="getLabInputmdlzdsr" resultType="com.czlis.common.core.domain.entity.lis.LabInputmdl">
SELECT * FROM lab_inputmdl where yq = #{yq} AND zdsr = 'Y' SELECT * FROM lab_inputmdl where yq = #{yq} AND zdsr = 'Y'

View File

@ -3,7 +3,7 @@
"http://mybatis.org/dtd/mybatis-3-mapper.dtd" > "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.czlis.interfaceCommon.mapper.LabPatlogMapper"> <mapper namespace="com.czlis.interfaceCommon.mapper.LabPatlogMapper">
<select id="getLabPatlog"> <select id="getLabPatlog">
select * from lab_patlog where jyrq = #{jyrq} and yq = #{yq} and ybh = #{ybh} select * from lab_patlog where jyrq = #{jyrq} and yq = #{yq} and ybh = #{ybh} and xgrq=#{xgrq}
</select> </select>
<insert id="insertLabPatlog"> <insert id="insertLabPatlog">
INSERT INTO lab_patlog ( wyh, jyrq, yq, ybh, xgrq, xgyhdh, yblx, fb, ksdh, INSERT INTO lab_patlog ( wyh, jyrq, yq, ybh, xgrq, xgyhdh, yblx, fb, ksdh,

View File

@ -109,7 +109,20 @@ public class LisWorkController extends BaseController {
public Result deleteresult(@RequestBody List<LabResult> labResultlist) { public Result deleteresult(@RequestBody List<LabResult> labResultlist) {
return labResultService.delLabResultList(labResultlist); return labResultService.delLabResultList(labResultlist);
} }
@Log(title = "主界面",businessType = BusinessType.UPDATE_DETAIL)
@ApiOperation("项目模板输入结果")
@GetMapping("/setinputmdl")
public Result setinputmdl(Date jyrq, String yq, String ybh,String mbmc) {
return lisWorkService.setinputmdl(jyrq,yq,ybh,mbmc);
}
@Log(title = "主界面",businessType = BusinessType.UPDATE_DETAIL)
@ApiOperation("结果修改记录")
@GetMapping("/getresultchangelog")
public Result getresultchangelog(Date jyrq, String yq, String ybh,String xmdh) {
return lisWorkService.getresultchangelog(jyrq,yq,ybh,xmdh);
}
@ApiOperation("打印报告") @ApiOperation("打印报告")
@GetMapping("/print") @GetMapping("/print")
public Result printReport(LabPat labPat) { public Result printReport(LabPat labPat) {

View File

@ -87,6 +87,8 @@ public class LisWorkOperController extends BaseController {
public Result saveresult(@RequestBody List<LabResult> labResult) { public Result saveresult(@RequestBody List<LabResult> labResult) {
return lisWorkOperService.saveallresult(labResult); return lisWorkOperService.saveallresult(labResult);
} }
/** /**
* 审核报告 * 审核报告
* *

View File

@ -20,6 +20,7 @@ public interface LisWorkService {
Result checkUser(String yhdh, String mm); Result checkUser(String yhdh, String mm);
Result getXmInfo(String yq); Result getXmInfo(String yq);
Result getXmVal(String yq,String xmdh); Result getXmVal(String yq,String xmdh);
Result setinputmdl(Date jyrq, String yq, String ybh,String mbmc);
Result printReport(LabPat labPat); Result printReport(LabPat labPat);
Result getresultchangelog(Date jyrq, String yq, String ybh,String xmdh);
} }

View File

@ -1,10 +1,12 @@
package com.czlis.liswork.service.impl; package com.czlis.liswork.service.impl;
import cn.hutool.core.date.DateUtil;
import com.czlis.common.core.domain.Result; import com.czlis.common.core.domain.Result;
import com.czlis.common.core.domain.entity.*; import com.czlis.common.core.domain.entity.*;
import com.czlis.common.core.domain.entity.lis.*; import com.czlis.common.core.domain.entity.lis.*;
import com.czlis.common.enums.UserStatus; import com.czlis.common.enums.UserStatus;
import com.czlis.common.exception.ServiceException; import com.czlis.common.exception.ServiceException;
import com.czlis.common.utils.DateUtils;
import com.czlis.common.utils.MessageUtils; import com.czlis.common.utils.MessageUtils;
import com.czlis.common.utils.SecurityUtils; import com.czlis.common.utils.SecurityUtils;
import com.czlis.common.utils.StringUtils; import com.czlis.common.utils.StringUtils;
@ -312,15 +314,15 @@ public class LisWorkServiceImpl implements LisWorkService {
@Override @Override
public Result getresultinfo(Date jyrq, String yq, String ybh){ public Result getresultinfo(Date jyrq, String yq, String ybh){
List<LabResult> labResultList=commonUtil.getLabResultList(jyrq,yq,ybh); List<LabResult> labResultList=commonUtil.getLabResultList(jyrq,yq,ybh);
if(!labResultList.isEmpty()){ if(labResultList.size()==0){
List<LabInputmdl> labInputmdlList=lisWorkUtils.chkautoinput(yq,ybh); List<LabInputmdl> labInputmdlList=lisWorkUtils.chkautoinput(yq,ybh);
if(labInputmdlList.isEmpty()) { if(!labInputmdlList.isEmpty()) {
for (LabInputmdl labInputmdl : labInputmdlList) { for (LabInputmdl labInputmdl : labInputmdlList) {
labResultList = lisWorkUtils.batchinput(jyrq, yq, ybh, labResultList, labInputmdl.getMbmc(), false); labResultList = lisWorkUtils.batchinput(jyrq, yq, ybh, labResultList, labInputmdl.getMbmc(), false);
String yblx = labInputmdl.getYblx(); String yblx = labInputmdl.getYblx();
if (yblx != null && !yblx.isEmpty()) { // if (yblx != null && !yblx.isEmpty()) {
// labPat.setYblx(yblx); // labPat.setYblx(yblx);
} // }
} }
} }
return new Result("0","成功!",labResultList); return new Result("0","成功!",labResultList);
@ -347,6 +349,8 @@ public class LisWorkServiceImpl implements LisWorkService {
} }
} }
LabPat labPat =commonUtil.getLabPatOne(jyrq,yq,ybh); LabPat labPat =commonUtil.getLabPatOne(jyrq,yq,ybh);
if(labPat!=null) {
List<LabResult> labResultList0 = getlastresult(labPat, labResultList); List<LabResult> labResultList0 = getlastresult(labPat, labResultList);
if (!labResultList0.isEmpty()) { if (!labResultList0.isEmpty()) {
for (LabResult labResult : labResultList) { for (LabResult labResult : labResultList) {
@ -357,19 +361,63 @@ public class LisWorkServiceImpl implements LisWorkService {
if (!labResult0.isEmpty()) { 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();
String alarm_flag= labResult0.get(0).getAlarm_flag();
if ("未做".equals(csjg0) || csjg0 == null) { if ("未做".equals(csjg0) || csjg0 == null) {
csjg0 = ""; csjg0 = "";
result_flag = ""; result_flag = "";
} }
if(!"".equals(alarm_flag)&&!" ".equals(alarm_flag)&&alarm_flag!=null) {
result_flag="J";
}
labResult.setCp_compa(csjg0); labResult.setCp_compa(csjg0);
labResult.setCp_lastflag(result_flag); labResult.setCp_lastflag(result_flag);
} }
} }
} }
} }
}
return new Result("0","成功!",labResultList); return new Result("0","成功!",labResultList);
} }
@Override
public Result setinputmdl(Date jyrq, String yq, String ybh,String mbmc){
List<LabResult> labResultList=new ArrayList<>();
labResultList = lisWorkUtils.batchinput(jyrq, yq, ybh, labResultList, mbmc, false);
return lisWorkUtils.saveresult(labResultList);
}
@Override
public Result getresultchangelog(Date jyrq, String yq, String ybh,String xmdh){
Map<String,String> map=new HashMap<>();
LabResult labResult=commonUtil.getLabResult(jyrq,yq,ybh,xmdh);
List<LabResultlog> labResultlog=commonUtil.getLabResultlogxmdh(jyrq,yq,ybh,xmdh);
if(labResult!=null && !labResultlog.isEmpty()) {
String csjg = labResult.getCsjg();
if(csjg==null)csjg="";
String finalCsjg = csjg;
List<LabResultlog> labResultlog0 = labResultlog.stream().filter(rlog -> !finalCsjg.equals(rlog.getCsjg())).collect(Collectors.toList());
if(!labResultlog0.isEmpty()) {
for(LabResultlog labResultlog1 : labResultlog0) {
String csjg0 = labResultlog1.getCsjg();
if (csjg0 == null) csjg0 = "";
if (!csjg.equals(csjg0)) {
Date xgrq=labResultlog1.getXgrq();
LabPatlog labPatlog=commonUtil.getLabPatlog(jyrq,yq,ybh,xgrq);
Date dysj=labPatlog.getDysj();
String hdys=labPatlog.getHdys();
String xgr=labResultlog1.getXgyhdh();
map.put("csjg",csjg0);
map.put("xgr",xgr);
map.put("xgrq", commonUtil.getDateTimeString(xgrq));
map.put("shys",hdys);
map.put("shsj",commonUtil.getDateTimeString(dysj));
break;
}
}
}
}
return new Result("0","成功!",map);
}
/** /**
* 获取上一次结果 * 获取上一次结果
* @param labPat 病人信息 * @param labPat 病人信息