主程序
This commit is contained in:
parent
8ea468caad
commit
ad111df84e
@ -0,0 +1,10 @@
|
||||
package com.czlis.interfaceCommon.mapper;
|
||||
|
||||
import com.czlis.common.core.domain.entity.lis.LabInputmdlDetail;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface LabInputmdlDetailMapper {
|
||||
List<LabInputmdlDetail> getLabInputmdlDetail(@Param("yq") String yq, @Param("mbmc") String mbmc);
|
||||
}
|
||||
@ -0,0 +1,13 @@
|
||||
package com.czlis.interfaceCommon.mapper;
|
||||
|
||||
import com.czlis.common.core.domain.entity.lis.LabInputmdl;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface LabInputmdlMapper {
|
||||
List<LabInputmdl> getLabInputmdl(String yq);
|
||||
LabInputmdl getLabInputmdlmbmc(@Param("yq") String yq,@Param("mbmc") String mbmc);
|
||||
List<LabInputmdl> getLabInputmdlzdsr(String yq);
|
||||
List<LabInputmdl> getLabInputmdlzdsrybh(@Param("yq") String yq,@Param("ybh") String ybh);
|
||||
}
|
||||
@ -15,4 +15,5 @@ public interface LabResultMapper {
|
||||
int updateLabResult(LabResult labResult);
|
||||
int delNullLabResult(@Param("jyrq") Date jyrq, @Param("yq") String yq, @Param("ybh") String ybh);
|
||||
List<LabResult> getLabResultWithSql(@Param("jyrq") Date jyrq, @Param("yq") String yq, @Param("ybh") String ybh,@Param("wheresql") String wheresql);
|
||||
int insertLabResultByBarcode(@Param("jyrq") Date jyrq, @Param("yq") String yq,@Param("ybh") String ybh,@Param("sqh") String sqh);
|
||||
}
|
||||
|
||||
@ -83,6 +83,10 @@ public class CommonUtil {
|
||||
ComSeqMapper comSeqMapper;
|
||||
@Autowired
|
||||
LabReqpackMapper labReqpackMapper;
|
||||
@Autowired
|
||||
LabInputmdlMapper labInputmdlMapper;
|
||||
@Autowired
|
||||
LabInputmdlDetailMapper labInputmdlDetailMapper;
|
||||
//====检验主表操作方法集合===
|
||||
public LabPat getLabPatOne(Date jyrq, String yq, String ybh) {
|
||||
return labPatMapper.getLabPatOne(jyrq, yq, ybh);
|
||||
@ -253,10 +257,10 @@ public class CommonUtil {
|
||||
labResultMapper.insertLabResult(labResult);
|
||||
}
|
||||
|
||||
public List<LabResult> getresultinfo(Date jyrq, String yq, String ybh) {
|
||||
return labResultMapper.getLabResultList(jyrq, yq, ybh);
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void insertLabResultByBarcode(Date jyrq, String yq, String ybh, String sqh){
|
||||
labResultMapper.insertLabResultByBarcode(jyrq,yq,ybh,sqh);
|
||||
}
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public int delLabResult(LabResult labResult) {
|
||||
return labResultMapper.delLabResult(labResult);
|
||||
@ -377,6 +381,21 @@ public class CommonUtil {
|
||||
public List<XmVal> getXmVal(String yq,String xmdh) {
|
||||
return xmValMapper.getXmVal(yq,xmdh);
|
||||
}
|
||||
public List<LabInputmdl> getLabInputmdl(String yq) {
|
||||
return labInputmdlMapper.getLabInputmdl(yq);
|
||||
}
|
||||
public LabInputmdl getLabInputmdlmbmc(String yq,String mbmc) {
|
||||
return labInputmdlMapper.getLabInputmdlmbmc(yq,mbmc);
|
||||
}
|
||||
public List<LabInputmdl> getLabInputmdlzdsr(String yq) {
|
||||
return labInputmdlMapper.getLabInputmdlzdsr(yq);
|
||||
}
|
||||
public List<LabInputmdl> getLabInputmdlzdsrybh(String yq,String ybh) {
|
||||
return labInputmdlMapper.getLabInputmdlzdsrybh(yq,ybh);
|
||||
}
|
||||
public List<LabInputmdlDetail> getLabInputmdlDetail(String yq,String mbmc) {
|
||||
return labInputmdlDetailMapper.getLabInputmdlDetail(yq,mbmc);
|
||||
}
|
||||
public List<XmAlarmdetail> getXmAlarmdetail(String yq, String xmdh) {
|
||||
return xmAlarmdetailMapper.getXmAlarmdetail(yq, xmdh);
|
||||
}
|
||||
|
||||
@ -1835,6 +1835,7 @@ public class LisWorkUtils {
|
||||
String yq = labPat.getYq();
|
||||
String ybh = labPat.getYbh();
|
||||
String userId = labPat.getYhdh();
|
||||
Date jyrq=labPat.getJyrq();
|
||||
Date sjsj = commonUtil.getCurrentTime();
|
||||
//修改状态和时间
|
||||
commonUtil.zxLabReqmain(sqh, userId);
|
||||
@ -1881,6 +1882,27 @@ public class LisWorkUtils {
|
||||
}
|
||||
if (newpatinfo) commonUtil.insertLabPat(labPat);
|
||||
else commonUtil.updateLabPat(labPat);
|
||||
commonUtil.insertLabResultByBarcode(jyrq, ybh, yq, sqh);
|
||||
List<LabResult> labResultList=commonUtil.getLabResultList(jyrq, ybh, yq);
|
||||
List<LabInputmdl> labInputmdlList=chkautoinput(yq,ybh);
|
||||
boolean setyblx=false;
|
||||
if(!labInputmdlList.isEmpty()) {
|
||||
for (LabInputmdl labInputmdl : labInputmdlList) {
|
||||
labResultList = batchinput(jyrq, yq, ybh, labResultList, labInputmdl.getMbmc(), true);
|
||||
String yblx = labInputmdl.getYblx();
|
||||
if (yblx != null && !yblx.isEmpty()) {
|
||||
labPat.setYblx(yblx);
|
||||
setyblx=true;
|
||||
}
|
||||
}
|
||||
if(!labResultList.stream().filter(s->s.getChangeflag()==1).collect(Collectors.toList()).isEmpty()){
|
||||
if(setyblx) commonUtil.updateLabPat(labPat);
|
||||
}
|
||||
}
|
||||
labResultList=saveallresult(labPat,labResultList);
|
||||
// Map<String,Object> map=new HashMap<>();
|
||||
// map.put("labpat",labPat);
|
||||
// map.put("labresult",labResultList);
|
||||
return new Result("0", "保存成功!", labPat);
|
||||
}
|
||||
|
||||
@ -1966,6 +1988,18 @@ public class LisWorkUtils {
|
||||
}
|
||||
}
|
||||
labPat = loaddefault(labPat);
|
||||
List<LabInputmdl> labInputmdlList=chkautoinput(yq,ybh);
|
||||
if(!labInputmdlList.isEmpty()) {
|
||||
List<LabResult> labResultList=commonUtil.getLabResultList(jyrq, ybh, yq);
|
||||
for (LabInputmdl labInputmdl : labInputmdlList) {
|
||||
labResultList = batchinput(jyrq, yq, ybh, labResultList, labInputmdl.getMbmc(), true);
|
||||
String yblx = labInputmdl.getYblx();
|
||||
if (yblx != null && !yblx.isEmpty()) {
|
||||
labPat.setYblx(yblx);
|
||||
}
|
||||
}
|
||||
labResultList=saveallresult(labPat,labResultList);
|
||||
}
|
||||
String brxm0 = labPat.getBrxm();
|
||||
if (!"".equals(brxm0) && brxm0 != null) {
|
||||
String pinyin = PinyinUtil.getFirstLetter(brxm0, ""); //拼音首字母
|
||||
@ -2052,6 +2086,54 @@ public class LisWorkUtils {
|
||||
return new Result("0", "", labPat);
|
||||
}
|
||||
|
||||
/**
|
||||
* 自动输入模板输入结果
|
||||
* @param yq 仪器
|
||||
* @param ybh 样本号
|
||||
* @return 返回
|
||||
*/
|
||||
public List<LabInputmdl> chkautoinput(String yq, String ybh){
|
||||
|
||||
List<LabInputmdl> labInputmdlList;
|
||||
if("1".equals(commonUtil.getHISOPT("zdsr"))){
|
||||
labInputmdlList=commonUtil.getLabInputmdlzdsr(yq);
|
||||
}else{
|
||||
labInputmdlList=commonUtil.getLabInputmdlzdsrybh(yq,ybh);
|
||||
}
|
||||
return labInputmdlList;
|
||||
}
|
||||
/**
|
||||
* 自动输入模板输入结果
|
||||
* @param jyrq 检验日期
|
||||
* @param yq 仪器
|
||||
* @param ybh 样本号
|
||||
* @param labResultList 结果集合
|
||||
* @Param mbmc 模板名称
|
||||
* @param savefalg 是否保存到数据库,空样本不存数据库,有样本存数据库
|
||||
* @return 返回
|
||||
*/
|
||||
public List<LabResult> batchinput(Date jyrq, String yq, String ybh,List<LabResult> labResultList,String mbmc,boolean savefalg){
|
||||
List<LabInputmdlDetail> labInputmdlDetailList=commonUtil.getLabInputmdlDetail(yq,mbmc);
|
||||
if(labInputmdlDetailList.isEmpty()) return labResultList;
|
||||
for(LabInputmdlDetail labInputmdlDetail:labInputmdlDetailList){
|
||||
List<LabResult> findone=labResultList.stream().filter(s->s.getXmdh().equals(labInputmdlDetail.getXmdh())).collect(Collectors.toList());
|
||||
if(findone.isEmpty()){
|
||||
LabResult labResult=new LabResult();
|
||||
labResult.setJyrq(jyrq);
|
||||
labResult.setYq(yq);
|
||||
labResult.setYbh(ybh);
|
||||
labResult.setXmdh(labInputmdlDetail.getXmdh());
|
||||
labResult.setCsjg(labInputmdlDetail.getMrz());
|
||||
if(!savefalg)labResult.setChangeflag(2);
|
||||
else {
|
||||
labResult.setChangeflag(1);
|
||||
commonUtil.updateLabResult(labResult);
|
||||
}
|
||||
labResultList.add(labResult);
|
||||
}
|
||||
}
|
||||
return labResultList;
|
||||
}
|
||||
public LabPat loaddefault(LabPat labPat) {
|
||||
Date jyrq = labPat.getJyrq();
|
||||
String yq = labPat.getYq();
|
||||
@ -2134,4 +2216,5 @@ public class LisWorkUtils {
|
||||
if (labPat.getJgbz() == null) labPat.setJgbz(LabPatConstants.DEFAULT);
|
||||
return labPat;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
||||
<mapper namespace="com.czlis.interfaceCommon.mapper.LabInputmdlDetailMapper">
|
||||
<select id="getLabInputmdlDetail" resultType="com.czlis.common.core.domain.entity.lis.LabInputmdlDetail">
|
||||
SELECT * FROM lab_inputmdldetail where yq = #{yq} and mbmc=#{mbmc} order by xh asc
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
|
||||
@ -0,0 +1,20 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
||||
<mapper namespace="com.czlis.interfaceCommon.mapper.LabInputmdlMapper">
|
||||
<select id="getLabInputmdl" resultType="com.czlis.common.core.domain.entity.lis.LabInputmdl">
|
||||
SELECT * FROM lab_inputmdl where yq = #{yq}
|
||||
</select>
|
||||
<select id="getLabInputmdlmbmc" resultType="com.czlis.common.core.domain.entity.lis.LabInputmdl">
|
||||
SELECT * FROM lab_inputmdl where yq = #{yq} and mbmc=#{mbmc}
|
||||
</select>
|
||||
<select id="getLabInputmdlzdsrybh" resultType="com.czlis.common.core.domain.entity.lis.LabInputmdl">
|
||||
SELECT * FROM lab_inputmdl where yq = #{yq} AND zdsr = 'Y'
|
||||
AND right(space(20)+#{ybh},20) >= right(space(20)+qsybh,20) AND right(space(20)+jsybh,20) >= right(space(20)+#{ybh},20)
|
||||
</select>
|
||||
<select id="getLabInputmdlzdsr" resultType="com.czlis.common.core.domain.entity.lis.LabInputmdl">
|
||||
SELECT * FROM lab_inputmdl where yq = #{yq} AND zdsr = 'Y'
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
|
||||
@ -94,6 +94,16 @@
|
||||
#{redo_flag,jdbcType=CHAR}, #{sqxmdh,jdbcType=VARCHAR}, #{redo_text,jdbcType=VARCHAR},
|
||||
#{bz3,jdbcType=VARCHAR}, #{textresult,jdbcType=LONGVARCHAR})
|
||||
</insert>
|
||||
<insert id="insertLabResultByBarcode">
|
||||
insert into lab_result (jyrq, yq, ybh,xmdh,csjg,refs,dw,sqxmdh)
|
||||
select distinct #{jyrq},#{yq},#{ybh},a.xmdh,(case ISNULL(a.mrz,'') when '' then '未做' else a.mrz end),
|
||||
b.dyckz,b.dw ,r.sqh from lab_reqdetail r
|
||||
join xm_reqitem_vs_reportitem a on r.sqxmdh=a.sqxmdh and isnull(def,'') !='1'
|
||||
join xm_info b on a.yq=b.yq and a.xmdh=b.xmdh
|
||||
where r.sqh=#{sqh} and a.yq=#{yq}
|
||||
and (select count(1) from lab_result x where x.xmdh=a.xmdh and x.jyrq=#{jyrq} and x.yq=#{yq} and x.ybh=#{ybh})=0
|
||||
</insert>
|
||||
|
||||
<insert id="insertSelective" parameterType="com.czlis.common.core.domain.entity.lis.LabResult">
|
||||
insert into lab_result
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
|
||||
@ -131,7 +131,8 @@ public class LisWorkOperServiceImpl implements LisWorkOperService {
|
||||
labPat.setJyrq(jyrq);
|
||||
labPat.setYq(yq);
|
||||
labPat.setYbh(ybh);
|
||||
return new Result("0", "完成",lisWorkUtils.loaddefault(labPat));
|
||||
labPat=lisWorkUtils.loaddefault(labPat);
|
||||
return new Result("0", "完成",labPat);
|
||||
}
|
||||
/**
|
||||
* 审核报告单全流程
|
||||
|
||||
@ -289,29 +289,42 @@ public class LisWorkServiceImpl implements LisWorkService {
|
||||
labInputcol.setZdts("参考值");
|
||||
labInputcol.setMrz("120");
|
||||
ResultConfig.add(8,labInputcol);
|
||||
// labInputcol=new LabInputcol();
|
||||
// labInputcol.setXh(9);
|
||||
// labInputcol.setYq(yq);
|
||||
// labInputcol.setZdmc("dw");
|
||||
// labInputcol.setKj(showrefsflag);
|
||||
// labInputcol.setKybj("0");
|
||||
// labInputcol.setZdts("单位");
|
||||
// labInputcol.setMrz("80");
|
||||
// ResultConfig.add(9,labInputcol);
|
||||
labInputcol=new LabInputcol();
|
||||
labInputcol.setXh(9);
|
||||
labInputcol.setYq(yq);
|
||||
labInputcol.setZdmc("dw");
|
||||
labInputcol.setKj(showrefsflag);
|
||||
labInputcol.setKybj("0");
|
||||
labInputcol.setZdts("单位");
|
||||
labInputcol.setMrz("80");
|
||||
ResultConfig.add(9,labInputcol);
|
||||
labInputcol=new LabInputcol();
|
||||
labInputcol.setXh(10);
|
||||
labInputcol.setYq(yq);
|
||||
labInputcol.setZdmc("bz1");
|
||||
labInputcol.setKj("1");
|
||||
labInputcol.setKybj("0");
|
||||
labInputcol.setZdts("子模块");
|
||||
labInputcol.setMrz("80");
|
||||
ResultConfig.add(10,labInputcol);
|
||||
ResultConfig.add(9,labInputcol);
|
||||
return ResultConfig;
|
||||
}
|
||||
@Override
|
||||
public Result getresultinfo(Date jyrq, String yq, String ybh){
|
||||
List<LabResult> labResultList=commonUtil.getresultinfo(jyrq,yq,ybh);
|
||||
List<LabResult> labResultList=commonUtil.getLabResultList(jyrq,yq,ybh);
|
||||
if(!labResultList.isEmpty()){
|
||||
List<LabInputmdl> labInputmdlList=lisWorkUtils.chkautoinput(yq,ybh);
|
||||
if(labInputmdlList.isEmpty()) {
|
||||
for (LabInputmdl labInputmdl : labInputmdlList) {
|
||||
labResultList = lisWorkUtils.batchinput(jyrq, yq, ybh, labResultList, labInputmdl.getMbmc(), false);
|
||||
String yblx = labInputmdl.getYblx();
|
||||
if (yblx != null && !yblx.isEmpty()) {
|
||||
// labPat.setYblx(yblx);
|
||||
}
|
||||
}
|
||||
}
|
||||
return new Result("0","成功!",labResultList);
|
||||
}
|
||||
List<LabResultlog> labResultlog=commonUtil.getLabResultlog(jyrq,yq,ybh);
|
||||
if(!labResultList.isEmpty() && !labResultlog.isEmpty()) {
|
||||
for (LabResult labResult : labResultList) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user