主业务添加代码
This commit is contained in:
parent
b104348c2c
commit
6d6ac60646
@ -43,4 +43,5 @@ public class LabResult extends BaseEntity {
|
|||||||
private String ygzd;
|
private String ygzd;
|
||||||
private String ygzq;
|
private String ygzq;
|
||||||
private Integer xsws;
|
private Integer xsws;
|
||||||
|
private Integer changeflag;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -13,8 +13,11 @@ public interface LabPatMapper {
|
|||||||
List<LabPat> getSampleList(@Param("jyrq") Date jyrq, @Param("yq") String yq);
|
List<LabPat> getSampleList(@Param("jyrq") Date jyrq, @Param("yq") String yq);
|
||||||
List<LabPat> getSampleListday(@Param("yq") String yq,@Param("days")Long days);
|
List<LabPat> getSampleListday(@Param("yq") String yq,@Param("days")Long days);
|
||||||
List<LabPat> getLabPat(LabPat labPat);
|
List<LabPat> getLabPat(LabPat labPat);
|
||||||
|
String getLabPatJgbz(@Param("jyrq")Date jyrq,@Param("yq") String yq,@Param("ybh") String ybh);
|
||||||
int delLabPat(@Param("jyrq") Date jyrq, @Param("yq") String yq,@Param("ybh") String ybh);
|
int delLabPat(@Param("jyrq") Date jyrq, @Param("yq") String yq,@Param("ybh") String ybh);
|
||||||
int updateLabPat(LabPat labPat);
|
int updateLabPat(LabPat labPat);
|
||||||
|
int updateLabPatJgbz(@Param("jyrq") Date jyrq, @Param("yq") String yq,@Param("ybh") String ybh,@Param("jgbz") String jgbz);
|
||||||
|
int updateLabPatByColumn(@Param("jyrq") Date jyrq, @Param("yq") String yq,@Param("ybh") String ybh,@Param("column") String column,@Param("value") String value);
|
||||||
//根据主键判断是否存在数据
|
//根据主键判断是否存在数据
|
||||||
int getCountByKey(@Param("jyrq") Date jyrq, @Param("yq") String yq,@Param("ybh") String ybh) ;
|
int getCountByKey(@Param("jyrq") Date jyrq, @Param("yq") String yq,@Param("ybh") String ybh) ;
|
||||||
//根据编号查sqh
|
//根据编号查sqh
|
||||||
|
|||||||
@ -63,7 +63,10 @@ public class CommonUtil {
|
|||||||
XmCalcMapper xmCalcMapper;
|
XmCalcMapper xmCalcMapper;
|
||||||
@Autowired
|
@Autowired
|
||||||
LisPatlogMapper lisPatlogMapper;
|
LisPatlogMapper lisPatlogMapper;
|
||||||
|
@Autowired
|
||||||
|
LabResultlogMapper labResultlogMapper;
|
||||||
|
@Autowired
|
||||||
|
LabPatlogMapper labPatlogMapper;
|
||||||
//====检验主表操作方法集合===
|
//====检验主表操作方法集合===
|
||||||
public LabPat getLabPatOne(Date jyrq, String yq, String ybh) {
|
public LabPat getLabPatOne(Date jyrq, String yq, String ybh) {
|
||||||
return labPatMapper.getLabPatOne(jyrq, yq, ybh);
|
return labPatMapper.getLabPatOne(jyrq, yq, ybh);
|
||||||
@ -91,11 +94,16 @@ public class CommonUtil {
|
|||||||
public int updateLabPat(LabPat labPat) {
|
public int updateLabPat(LabPat labPat) {
|
||||||
return labPatMapper.updateLabPat(labPat);
|
return labPatMapper.updateLabPat(labPat);
|
||||||
}
|
}
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public int updateLabPatJgbz(Date jyrq, String yq, String ybh,String jgbz){return updateLabPatByColumn(jyrq,yq,ybh,"jgbz",jgbz);}
|
||||||
|
public int updateLabPatByColumn(Date jyrq, String yq, String ybh,String column,String jgbz){return labPatMapper.updateLabPatByColumn(jyrq,yq,ybh,column,jgbz);}
|
||||||
|
|
||||||
public int getCountByKey(Date jyrq, String yq, String ybh) {
|
public int getCountByKey(Date jyrq, String yq, String ybh) {
|
||||||
return labPatMapper.getCountByKey(jyrq, yq, ybh);
|
return labPatMapper.getCountByKey(jyrq, yq, ybh);
|
||||||
}
|
}
|
||||||
|
public String getLabPatJgbz(Date jyrq, String yq, String ybh){
|
||||||
|
return labPatMapper.getLabPatJgbz(jyrq, yq, ybh);
|
||||||
|
}
|
||||||
public String getSqhByKey(Date jyrq, String yq, String ybh) {
|
public String getSqhByKey(Date jyrq, String yq, String ybh) {
|
||||||
return labPatMapper.getSqhByKey(jyrq, yq, ybh);
|
return labPatMapper.getSqhByKey(jyrq, yq, ybh);
|
||||||
}
|
}
|
||||||
@ -120,7 +128,13 @@ public class CommonUtil {
|
|||||||
public List<LabReqsteplog> getLabReqsteplog(String sqh) {
|
public List<LabReqsteplog> getLabReqsteplog(String sqh) {
|
||||||
return labReqsteplogMapper.getLabReqsteplog(sqh);
|
return labReqsteplogMapper.getLabReqsteplog(sqh);
|
||||||
}
|
}
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public int insertLabReqsteplog(LabReqsteplog labReqsteplog) {
|
||||||
|
return labReqsteplogMapper.insertLabReqsteplog(labReqsteplog);
|
||||||
|
}
|
||||||
|
public int getLabReqsteplogMax(String sqh) {
|
||||||
|
return labReqsteplogMapper.getLabReqsteplogMax(sqh);
|
||||||
|
}
|
||||||
public List<LabRefused> getLabRefusedList(LabRefused labRefused) {
|
public List<LabRefused> getLabRefusedList(LabRefused labRefused) {
|
||||||
return labRefusedMapper.getLabRefusedList(labRefused);
|
return labRefusedMapper.getLabRefusedList(labRefused);
|
||||||
}
|
}
|
||||||
@ -190,7 +204,14 @@ public class CommonUtil {
|
|||||||
public void deleteLabResultwarning(Date jyrq, String yq, String ybh) {
|
public void deleteLabResultwarning(Date jyrq, String yq, String ybh) {
|
||||||
labResultwarningMapper.deleteLabResultwarning(jyrq, yq, ybh);
|
labResultwarningMapper.deleteLabResultwarning(jyrq, yq, ybh);
|
||||||
}
|
}
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public void insertLabResultlog(Date jyrq, String yq, String ybh,Date xgrq,String xgyhdh,String ip) {
|
||||||
|
labResultlogMapper.insertLabResultlog(jyrq, yq, ybh,xgrq,xgyhdh,ip);
|
||||||
|
}
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public void insertLabPatlog(Date jyrq, String yq, String ybh,Date xgrq,String xgyhdh,String ip) {
|
||||||
|
labPatlogMapper.insertLabPatlog(jyrq, yq, ybh,xgrq,xgyhdh,ip);
|
||||||
|
}
|
||||||
|
|
||||||
//=====项目字典查询=========
|
//=====项目字典查询=========
|
||||||
public List<XmInfo> getXmInfoList(String yq) {
|
public List<XmInfo> getXmInfoList(String yq) {
|
||||||
@ -233,7 +254,9 @@ public class CommonUtil {
|
|||||||
public List<XmCalc> getXmCalcList(String yq) {
|
public List<XmCalc> getXmCalcList(String yq) {
|
||||||
return xmCalcMapper.getXmCalcList(yq);
|
return xmCalcMapper.getXmCalcList(yq);
|
||||||
}
|
}
|
||||||
|
public List<XmCalc> getXmCalcbyxmdh(String yq,String xmdh) {
|
||||||
|
return xmCalcMapper.getXmCalcbyxmdh(yq,xmdh);
|
||||||
|
}
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public Integer insertComLog(ComLog comLog) {
|
public Integer insertComLog(ComLog comLog) {
|
||||||
return comLogMapper.insertComLog(comLog);
|
return comLogMapper.insertComLog(comLog);
|
||||||
|
|||||||
@ -32,7 +32,9 @@
|
|||||||
<select id="getSqhByKey" resultType="String">
|
<select id="getSqhByKey" resultType="String">
|
||||||
select sqh from lab_pat where yq = #{yq} and jyrq = #{jyrq} and ybh = #{ybh}
|
select sqh from lab_pat where yq = #{yq} and jyrq = #{jyrq} and ybh = #{ybh}
|
||||||
</select>
|
</select>
|
||||||
|
<select id="getLabPatJgbz" resultType="String">
|
||||||
|
select jgbz from lab_pat where yq = #{yq} and jyrq = #{jyrq} and ybh = #{ybh}
|
||||||
|
</select>
|
||||||
<insert id="insertLabPat">
|
<insert id="insertLabPat">
|
||||||
insert into lab_pat (
|
insert into lab_pat (
|
||||||
<if test="wyh != null and wyh !=''">wyh,</if>
|
<if test="wyh != null and wyh !=''">wyh,</if>
|
||||||
@ -171,6 +173,12 @@
|
|||||||
<delete id="delLabPat" parameterType="com.czlis.common.core.domain.entity.lis.LabPat">
|
<delete id="delLabPat" parameterType="com.czlis.common.core.domain.entity.lis.LabPat">
|
||||||
delete from lab_pat where yq = #{yq} and jyrq = #{jyrq} and ybh = #{ybh}
|
delete from lab_pat where yq = #{yq} and jyrq = #{jyrq} and ybh = #{ybh}
|
||||||
</delete>
|
</delete>
|
||||||
|
<update id="updateLabPatJgbz">
|
||||||
|
update lab_pat set jgbz=#{jgbz} where jyrq = #{jyrq} and yq = #{yq} and ybh = #{ybh}
|
||||||
|
</update>
|
||||||
|
<update id="updateLabPatByColumn">
|
||||||
|
update lab_pat set ${column}=#{value} where jyrq = #{jyrq} and yq = #{yq} and ybh = #{ybh}
|
||||||
|
</update>
|
||||||
<update id="updateLabPat" parameterType="com.czlis.common.core.domain.entity.lis.LabPat">
|
<update id="updateLabPat" parameterType="com.czlis.common.core.domain.entity.lis.LabPat">
|
||||||
update lab_pat
|
update lab_pat
|
||||||
<set>
|
<set>
|
||||||
@ -359,8 +367,8 @@
|
|||||||
</if>
|
</if>
|
||||||
</set>
|
</set>
|
||||||
where jyrq = #{jyrq}
|
where jyrq = #{jyrq}
|
||||||
and yq = #{yq,jdbcType=CHAR}
|
and yq = #{yq}
|
||||||
and ybh = #{ybh,jdbcType=VARCHAR}
|
and ybh = #{ybh}
|
||||||
</update>
|
</update>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -10,7 +10,6 @@
|
|||||||
SELECT * FROM xm_calc WHERE yq=#{yq} and jsxm=#{jsxm}
|
SELECT * FROM xm_calc WHERE yq=#{yq} and jsxm=#{jsxm}
|
||||||
</select>
|
</select>
|
||||||
<select id="getXmCalcbyxmdh" resultType="com.czlis.common.core.domain.entity.lis.XmCalc">
|
<select id="getXmCalcbyxmdh" resultType="com.czlis.common.core.domain.entity.lis.XmCalc">
|
||||||
SELECT * FROM xm_calc WHERE yq=#{yq}
|
select * from xm_calc where yq=#{yq} and xmdh=#{xmdh}
|
||||||
and jsxm=(select jsxm from xm_calc a where a.yq=#{yq} and a.xmdh=#{xmdh})
|
|
||||||
</select>
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|||||||
@ -1,8 +1,10 @@
|
|||||||
package com.czlis.liswork.controller.work;
|
package com.czlis.liswork.controller.work;
|
||||||
|
|
||||||
|
import cn.hutool.core.bean.BeanUtil;
|
||||||
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.lis.LabPat;
|
import com.czlis.common.core.domain.entity.lis.LabPat;
|
||||||
|
import com.czlis.common.core.domain.entity.lis.LabResult;
|
||||||
import com.czlis.common.utils.ServletUtils;
|
import com.czlis.common.utils.ServletUtils;
|
||||||
import com.czlis.liswork.service.LisWorkOperService;
|
import com.czlis.liswork.service.LisWorkOperService;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
@ -14,6 +16,7 @@ import org.springframework.web.bind.annotation.*;
|
|||||||
import java.text.ParseException;
|
import java.text.ParseException;
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@RestController
|
@RestController
|
||||||
@ -33,14 +36,28 @@ public class LisWorkOperController extends BaseController {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改病人信息
|
* 修改病人信息
|
||||||
* @param labPat
|
* @param
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@ApiOperation("修改病人信息")
|
@ApiOperation("修改病人信息")
|
||||||
@PostMapping("/changepat")
|
@PostMapping("/changepat")
|
||||||
public Result changePat(LabPat labPat){
|
public Result changePat(@RequestBody LabPat labPat){
|
||||||
|
if(labPat==null){return new Result("-1","入参为空,修改失败");}
|
||||||
|
if(labPat.getYq()==null){return new Result("-1","入参为空,修改失败");}
|
||||||
return lisWorkOperService.changePat(labPat);
|
return lisWorkOperService.changePat(labPat);
|
||||||
}
|
}
|
||||||
|
@GetMapping("/changepatcolumn")
|
||||||
|
public Result changepatcolumn(Date jyrq,String yq, String ybh,String column,String value){
|
||||||
|
if(column==null){return new Result("-1","入参为空,修改失败");}
|
||||||
|
if(yq==null){return new Result("-1","入参为空,修改失败");}
|
||||||
|
if(ybh==null){return new Result("-1","入参为空,修改失败");}
|
||||||
|
return lisWorkOperService.changePatColumn(jyrq, yq,ybh,column,value);
|
||||||
|
}
|
||||||
|
@ApiOperation("修改病人结果")
|
||||||
|
@PostMapping("/changeresult")
|
||||||
|
public Result changeresult(@RequestBody LabResult labResult){
|
||||||
|
return lisWorkOperService.changeresult(labResult);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 审核报告
|
* 审核报告
|
||||||
|
|||||||
@ -20,4 +20,5 @@ public interface LisWorkOperMapper {
|
|||||||
Integer checkresultwxh(@Param("jyrq") Date jyrq, @Param("yq") String yq, @Param("ybh") String ybh);
|
Integer checkresultwxh(@Param("jyrq") Date jyrq, @Param("yq") String yq, @Param("ybh") String ybh);
|
||||||
LabPat checkdublereport(@Param("sqh") String sqh, @Param("ybh") String ybh);
|
LabPat checkdublereport(@Param("sqh") String sqh, @Param("ybh") String ybh);
|
||||||
LabPat checkyqdublereport(@Param("sqh") String sqh,@Param("yq") String yq, @Param("ybh") String ybh);
|
LabPat checkyqdublereport(@Param("sqh") String sqh,@Param("yq") String yq, @Param("ybh") String ybh);
|
||||||
|
Integer getQXZ(String yhdh);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,6 +2,7 @@ package com.czlis.liswork.service;
|
|||||||
|
|
||||||
import com.czlis.common.core.domain.Result;
|
import com.czlis.common.core.domain.Result;
|
||||||
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 java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
@ -9,7 +10,8 @@ public interface LisWorkOperService {
|
|||||||
Result newPatInfo(Date jyrq, String ybh, String sqh, String yq, Long userId);
|
Result newPatInfo(Date jyrq, String ybh, String sqh, String yq, Long userId);
|
||||||
|
|
||||||
Result changePat(LabPat labPat);
|
Result changePat(LabPat labPat);
|
||||||
|
Result changePatColumn(Date jyrq, String yq, String ybh,String column,String value);
|
||||||
|
Result changeresult(LabResult labResult);
|
||||||
/**
|
/**
|
||||||
* 保存所有结果的修正值,涉及:空结果清除,计算项目添加,添加单位,添加申请项目编码,参考值重新计算更新,结果标志重新计算更新,危急值标志计算更新
|
* 保存所有结果的修正值,涉及:空结果清除,计算项目添加,添加单位,添加申请项目编码,参考值重新计算更新,结果标志重新计算更新,危急值标志计算更新
|
||||||
*
|
*
|
||||||
|
|||||||
@ -116,9 +116,88 @@ public class LisWorkOperServiceImpl implements LisWorkOperService {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Result changePat(LabPat labPat) {
|
public Result changePat(LabPat labPat) {
|
||||||
return null;
|
if("2".equals(labPat.getJgbz())) return new Result("-1", "结果已审核禁止修改!");
|
||||||
|
if("5".equals(labPat.getJgbz())) return new Result("-1", "结果已锁定禁止修改!");
|
||||||
|
if("1".equals(labPat.getJgbz())) return new Result("-1", "结果已初审禁止修改!");
|
||||||
|
commonUtil.updateLabPat(labPat);
|
||||||
|
saveallresult(labPat.getJyrq(),labPat.getYq(),labPat.getYbh());
|
||||||
|
return new Result("0", "保存成功");
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
public Result changePatColumn(Date jyrq,String yq, String ybh,String column,String value) {
|
||||||
|
String jgbz=commonUtil.getLabPatJgbz(jyrq,yq,ybh);
|
||||||
|
if("2".equals(jgbz)) return new Result("-1", "结果已审核禁止修改!");
|
||||||
|
if("5".equals(jgbz)) return new Result("-1", "结果已锁定禁止修改!");
|
||||||
|
if("1".equals(jgbz)) return new Result("-1", "结果已初审禁止修改!");
|
||||||
|
commonUtil.updateLabPatByColumn(jyrq,yq,ybh,column,value);
|
||||||
|
Boolean setcalc=false;
|
||||||
|
List<XmCalc> xmCalcList=null;
|
||||||
|
switch(column){
|
||||||
|
case "brxb":
|
||||||
|
xmCalcList = commonUtil.getXmCalcbyxmdh(yq,"SEX");
|
||||||
|
if(xmCalcList.size()>0) setcalc=true;
|
||||||
|
break;
|
||||||
|
case "nl":
|
||||||
|
case "nldw":
|
||||||
|
xmCalcList = commonUtil.getXmCalcbyxmdh(yq,"AGE");
|
||||||
|
if(xmCalcList.size()>0) setcalc=true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if(setcalc) {
|
||||||
|
List<LabResult> labResultList = commonUtil.getLabResultList(jyrq, yq, ybh);
|
||||||
|
LabPat labPat = commonUtil.getLabPatOne(jyrq, yq, ybh);
|
||||||
|
boolean nowjz=checknowjz(labPat);
|
||||||
|
labResultList = calcsample(labPat, labResultList, xmCalcList);
|
||||||
|
List<LabResult> labResultList1 = labResultList.stream().filter(labR -> labR.getChangeflag() == 1).collect(Collectors.toList());
|
||||||
|
if (labResultList1.size() > 0) {
|
||||||
|
for (LabResult labResult0 : labResultList1) {
|
||||||
|
changeresultf(labPat, labResult0, nowjz);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
setComLog(jyrq, yq, ybh,SecurityUtils.getLoginUser().getUsername(),ComLogConstants.LG_M,column+":"+value);
|
||||||
|
return new Result("0", "保存成功");
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
public Result changeresult(LabResult labResult){
|
||||||
|
String yq=labResult.getYq();
|
||||||
|
Date jyrq=labResult.getJyrq();
|
||||||
|
String ybh=labResult.getYbh();
|
||||||
|
LabPat labPat = commonUtil.getLabPatOne(jyrq, yq, ybh);
|
||||||
|
boolean nowjz=checknowjz(labPat);
|
||||||
|
changeresultf(labPat, labResult, nowjz);
|
||||||
|
return new Result("0", "保存成功");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 递归处理有计算项目关联其他项目都产生变化的联动处理
|
||||||
|
* @param labPat
|
||||||
|
* @param labResult
|
||||||
|
* @param nowjz
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
private int changeresultf(LabPat labPat,LabResult labResult,Boolean nowjz){
|
||||||
|
String yq=labResult.getYq();
|
||||||
|
String xmdh=labResult.getXmdh();
|
||||||
|
Date jyrq=labResult.getJyrq();
|
||||||
|
String ybh=labResult.getYbh();
|
||||||
|
XmInfo xmInfo=commonUtil.getXmInfo(yq,xmdh);
|
||||||
|
List<XmAlarmdetail> getXmAlarmdetail=commonUtil.getXmAlarmdetail(yq,xmdh);
|
||||||
|
labResult=setxmdhrefs(labPat,labResult,xmInfo, getXmAlarmdetail,nowjz);
|
||||||
|
commonUtil.updateLabResult(labResult);
|
||||||
|
List<XmCalc> xmCalcList = commonUtil.getXmCalcbyxmdh(yq,xmdh);
|
||||||
|
if(xmCalcList.size()>0) {
|
||||||
|
List<LabResult> labResultList = commonUtil.getLabResultList(jyrq, yq, ybh);
|
||||||
|
labResultList = calcsample(labPat, labResultList,xmCalcList);
|
||||||
|
List<LabResult> labResultList1=labResultList.stream().filter(labR-> labR.getChangeflag()==1).collect(Collectors.toList());
|
||||||
|
if(labResultList1.size()>0) {
|
||||||
|
for(LabResult labResult0:labResultList1) {
|
||||||
|
changeresultf(labPat, labResult0, nowjz);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
private Result checkZT(String sqh, String yq, String zt) {
|
private Result checkZT(String sqh, String yq, String zt) {
|
||||||
if (zt.equals("9")) return new Result("-1", "当前条码已经作废,不允许上机!");
|
if (zt.equals("9")) return new Result("-1", "当前条码已经作废,不允许上机!");
|
||||||
String SP_GETTOWREQOK = commonUtil.getHISOPT("SP_GETTOWREQOK"); //申请单禁止重复上机
|
String SP_GETTOWREQOK = commonUtil.getHISOPT("SP_GETTOWREQOK"); //申请单禁止重复上机
|
||||||
@ -277,6 +356,10 @@ public class LisWorkOperServiceImpl implements LisWorkOperService {
|
|||||||
Result result1 = afterconfirm(labPat, problemId);
|
Result result1 = afterconfirm(labPat, problemId);
|
||||||
if (!"0".equals(result1.getCode())) return result1;
|
if (!"0".equals(result1.getCode())) return result1;
|
||||||
setComLog(jyrq, yq, ybh,hdys, ComLogConstants.LG_CK,"");
|
setComLog(jyrq, yq, ybh,hdys, ComLogConstants.LG_CK,"");
|
||||||
|
String sqh=labPat.getSqh();
|
||||||
|
if(sqh!=null){
|
||||||
|
setlabReqsteplog(sqh,SampleStatusConstants.CONFIRM,hdys);
|
||||||
|
}
|
||||||
return new Result("3", "审核成功!");
|
return new Result("3", "审核成功!");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -690,11 +773,10 @@ public class LisWorkOperServiceImpl implements LisWorkOperService {
|
|||||||
String alarmflag = labPat.getAlarmflag();
|
String alarmflag = labPat.getAlarmflag();
|
||||||
if (("1".equals(alarmflag) && !wjz)) {
|
if (("1".equals(alarmflag) && !wjz)) {
|
||||||
labPat.setAlarmflag("");
|
labPat.setAlarmflag("");
|
||||||
commonUtil.updateLabPat(labPat);
|
|
||||||
} else if (("".equals(alarmflag.trim()) || alarmflag == null) && wjz) {
|
} else if (("".equals(alarmflag.trim()) || alarmflag == null) && wjz) {
|
||||||
labPat.setAlarmflag("1");
|
labPat.setAlarmflag("1");
|
||||||
commonUtil.updateLabPat(labPat);
|
|
||||||
}
|
}
|
||||||
|
commonUtil.updateLabPat(labPat);
|
||||||
return new Result("0", "保存成功!");
|
return new Result("0", "保存成功!");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -709,7 +791,10 @@ public class LisWorkOperServiceImpl implements LisWorkOperService {
|
|||||||
commonUtil.delNullLabResult(jyrq, yq, ybh);
|
commonUtil.delNullLabResult(jyrq, yq, ybh);
|
||||||
}
|
}
|
||||||
//计算项目更新
|
//计算项目更新
|
||||||
labResultList = calcsample(labPat, labResultList);
|
List<XmCalc> xmCalcList = commonUtil.getXmCalcList(yq);
|
||||||
|
if(xmCalcList.size()>0) {
|
||||||
|
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 && !"".equals(sqh)) setItemSqxmdh(jyrq, yq, ybh, sqh);
|
||||||
@ -758,16 +843,18 @@ public class LisWorkOperServiceImpl implements LisWorkOperService {
|
|||||||
public Result calcsample(Date jyrq, String yq, String ybh) {
|
public Result calcsample(Date jyrq, String yq, String ybh) {
|
||||||
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);
|
||||||
calcsample(labPat, labResultList);
|
List<XmCalc> xmCalcList = commonUtil.getXmCalcList(yq);
|
||||||
|
if(xmCalcList.size()>0) {
|
||||||
|
calcsample(labPat, labResultList, xmCalcList);
|
||||||
|
}
|
||||||
return new Result("0", "保存成功!");
|
return new Result("0", "保存成功!");
|
||||||
}
|
}
|
||||||
|
|
||||||
private List<LabResult> calcsample(LabPat labPat, List<LabResult> labResultList) {
|
private List<LabResult> calcsample(LabPat labPat, List<LabResult> labResultList,List<XmCalc> xmCalcList) {
|
||||||
Date jyrq = labPat.getJyrq();
|
Date jyrq = labPat.getJyrq();
|
||||||
String yq = labPat.getYq();
|
String yq = labPat.getYq();
|
||||||
String ybh = labPat.getYbh();
|
String ybh = labPat.getYbh();
|
||||||
String jsxmold = "";
|
String jsxmold = "";
|
||||||
List<XmCalc> xmCalcList = commonUtil.getXmCalcList(yq);
|
|
||||||
for (XmCalc xmCalc : xmCalcList) {
|
for (XmCalc xmCalc : xmCalcList) {
|
||||||
String jsxm = xmCalc.getJsxm();
|
String jsxm = xmCalc.getJsxm();
|
||||||
if (!jsxmold.equals(jsxm)) {
|
if (!jsxmold.equals(jsxm)) {
|
||||||
@ -817,6 +904,8 @@ public class LisWorkOperServiceImpl implements LisWorkOperService {
|
|||||||
String finalResult = result;
|
String finalResult = result;
|
||||||
collect0.ifPresent(labR -> labR.setCsjg(finalResult));
|
collect0.ifPresent(labR -> labR.setCsjg(finalResult));
|
||||||
commonUtil.updateLabResult(labResult);
|
commonUtil.updateLabResult(labResult);
|
||||||
|
labResult.setChangeflag(1);
|
||||||
|
collect0.ifPresent(labR -> labR.setChangeflag(1));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
XmInfo xmInfo = commonUtil.getXmInfo(yq, jsxm);
|
XmInfo xmInfo = commonUtil.getXmInfo(yq, jsxm);
|
||||||
@ -835,6 +924,7 @@ public class LisWorkOperServiceImpl implements LisWorkOperService {
|
|||||||
labResult.setYgzd(xmInfo.getYgzd());
|
labResult.setYgzd(xmInfo.getYgzd());
|
||||||
labResult.setYgzq(xmInfo.getYgzq());
|
labResult.setYgzq(xmInfo.getYgzq());
|
||||||
labResult.setXmmc(xmInfo.getXmmc());
|
labResult.setXmmc(xmInfo.getXmmc());
|
||||||
|
labResult.setChangeflag(1);
|
||||||
labResultList.add(labResult);
|
labResultList.add(labResult);
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -869,19 +959,8 @@ public class LisWorkOperServiceImpl implements LisWorkOperService {
|
|||||||
return new Result("0", "保存成功!");
|
return new Result("0", "保存成功!");
|
||||||
}
|
}
|
||||||
//内部使用
|
//内部使用
|
||||||
|
private boolean checknowjz(LabPat labPat){
|
||||||
/**
|
boolean nowjz = false;
|
||||||
* 计算项目参考值结果异常标志(内部使用)
|
|
||||||
*
|
|
||||||
* @param labPat
|
|
||||||
* @return 返回值0正常, 1有危急值明细存在
|
|
||||||
*/
|
|
||||||
private List<LabResult> saverefs(LabPat labPat) {
|
|
||||||
Date jyrq = labPat.getJyrq();
|
|
||||||
String yq = labPat.getYq();
|
|
||||||
String ybh = labPat.getYbh();
|
|
||||||
String yqdl = commonUtil.getYqdl(yq);
|
|
||||||
boolean lb_setbj = true, nowjz = false;
|
|
||||||
//危急值标识去除原则 nowjz = true 不能算做危急值
|
//危急值标识去除原则 nowjz = true 不能算做危急值
|
||||||
String brxm = labPat.getBrxm();
|
String brxm = labPat.getBrxm();
|
||||||
if (brxm != null) {
|
if (brxm != null) {
|
||||||
@ -895,6 +974,21 @@ public class LisWorkOperServiceImpl implements LisWorkOperService {
|
|||||||
String ksdh = labPat.getKsdh();
|
String ksdh = labPat.getKsdh();
|
||||||
if (ksdh != null) ksdh = commonUtil.getComDictNameById("DP", ksdh);
|
if (ksdh != null) ksdh = commonUtil.getComDictNameById("DP", ksdh);
|
||||||
if (ksdh != null) if (ksdh.contains("检验科")) nowjz = true;
|
if (ksdh != null) if (ksdh.contains("检验科")) nowjz = true;
|
||||||
|
return nowjz;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 计算项目参考值结果异常标志(内部使用)
|
||||||
|
*
|
||||||
|
* @param labPat
|
||||||
|
* @return 返回值0正常, 1有危急值明细存在
|
||||||
|
*/
|
||||||
|
private List<LabResult> saverefs(LabPat labPat) {
|
||||||
|
Date jyrq = labPat.getJyrq();
|
||||||
|
String yq = labPat.getYq();
|
||||||
|
String ybh = labPat.getYbh();
|
||||||
|
String yqdl = commonUtil.getYqdl(yq);
|
||||||
|
boolean lb_setbj = true;
|
||||||
|
boolean nowjz=checknowjz(labPat);
|
||||||
List<LabResult> labResultList = null;
|
List<LabResult> labResultList = null;
|
||||||
if (!"细菌仪".equals(yqdl)) {
|
if (!"细菌仪".equals(yqdl)) {
|
||||||
Map<String, Object> map = new HashMap<>();
|
Map<String, Object> map = new HashMap<>();
|
||||||
@ -1353,8 +1447,6 @@ public class LisWorkOperServiceImpl implements LisWorkOperService {
|
|||||||
@Override
|
@Override
|
||||||
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 || "".equals(yhdh)) return new Result("-1", "操作者为空,无法解除审核!");
|
||||||
//入参通过GET推送时使用ServletUtils.getParameterToInt获取
|
|
||||||
//入参通过POSTJSON时使用JsonParamUtils.getParameterToInt获取
|
|
||||||
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) {
|
||||||
@ -1417,11 +1509,16 @@ public class LisWorkOperServiceImpl implements LisWorkOperService {
|
|||||||
Date tzsj = labPatwarning.getTzsj();
|
Date tzsj = labPatwarning.getTzsj();
|
||||||
long sjc = LisUtil.relativeMinute(tzsj);
|
long sjc = LisUtil.relativeMinute(tzsj);
|
||||||
if (sjc > 10) {
|
if (sjc > 10) {
|
||||||
return new Result("4", "此报告已发布危急值结果,并且时间超过10分钟了!", 6);
|
return new Result("4", "此报告已发布危急值结果,并且时间超过10分钟了!"+LisUtil.LINE_SEPARATOR+"请输入撤回报告组长代号和密码", 6);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//权限不足,撤回报告失败组长权限单独接口校验,略.................
|
//权限不足,撤回报告失败组长权限单独接口校验
|
||||||
|
if(problemId==6) {
|
||||||
|
int ll_qxz =lisWorkOperMapper.getQXZ(yhdh);
|
||||||
|
if(ll_qxz<=0) {
|
||||||
|
return new Result("-1", "权限不足,撤回报告失败!");
|
||||||
|
}
|
||||||
|
}
|
||||||
commonUtil.deleteLabPatwarning(jyrq, yq, ybh);
|
commonUtil.deleteLabPatwarning(jyrq, yq, ybh);
|
||||||
commonUtil.deleteLabResultwarning(jyrq, yq, ybh);
|
commonUtil.deleteLabResultwarning(jyrq, yq, ybh);
|
||||||
}
|
}
|
||||||
@ -1432,8 +1529,22 @@ public class LisWorkOperServiceImpl implements LisWorkOperService {
|
|||||||
commonUtil.updateLabPat(labPat);
|
commonUtil.updateLabPat(labPat);
|
||||||
String logdata=commonUtil.getLisPatlogbz(jyrq, yq, ybh);
|
String logdata=commonUtil.getLisPatlogbz(jyrq, yq, ybh);
|
||||||
setComLog(jyrq, yq, ybh,yhdh, ComLogConstants.LG_UCK,logdata);
|
setComLog(jyrq, yq, ybh,yhdh, ComLogConstants.LG_UCK,logdata);
|
||||||
|
setpatLog(jyrq, yq, ybh,yhdh);
|
||||||
|
if(sqh!=null){
|
||||||
|
setlabReqsteplog(sqh,SampleStatusConstants.START,yhdh);
|
||||||
|
}
|
||||||
return new Result("3", msg);
|
return new Result("3", msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 操作记录日志
|
||||||
|
* @param jyrq
|
||||||
|
* @param yq
|
||||||
|
* @param ybh
|
||||||
|
* @param yhdh
|
||||||
|
* @param logtype
|
||||||
|
* @param logdata
|
||||||
|
*/
|
||||||
public void setComLog(Date jyrq, String yq, String ybh, String yhdh,String logtype,String logdata){
|
public void setComLog(Date jyrq, String yq, String ybh, String yhdh,String logtype,String logdata){
|
||||||
ComLog comLog = new ComLog();
|
ComLog comLog = new ComLog();
|
||||||
comLog.setJyrq(jyrq);
|
comLog.setJyrq(jyrq);
|
||||||
@ -1447,6 +1558,50 @@ public class LisWorkOperServiceImpl implements LisWorkOperService {
|
|||||||
commonUtil.insertComLog(comLog);
|
commonUtil.insertComLog(comLog);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 报告修改记录,撤回报告需要记录
|
||||||
|
* @param jyrq
|
||||||
|
* @param yq
|
||||||
|
* @param ybh
|
||||||
|
* @param yhdh
|
||||||
|
*/
|
||||||
|
public void setpatLog(Date jyrq, String yq, String ybh, String yhdh){
|
||||||
|
Date xgrq=new Date();
|
||||||
|
String ip=IpUtils.getIpAddr();
|
||||||
|
commonUtil.insertLabPatlog(jyrq,yq,ybh,xgrq,yhdh,ip);
|
||||||
|
commonUtil.insertLabResultlog(jyrq,yq,ybh,xgrq,yhdh,ip);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 申请单操作记录
|
||||||
|
* @param sqh
|
||||||
|
* @param zt
|
||||||
|
* @param yhdh
|
||||||
|
*/
|
||||||
|
public void setlabReqsteplog(String sqh,String zt,String yhdh){
|
||||||
|
int xh= commonUtil.getLabReqsteplogMax(sqh);
|
||||||
|
xh=xh+1;
|
||||||
|
LabReqsteplog labReqsteplog = new LabReqsteplog();
|
||||||
|
labReqsteplog.setSqh(sqh);
|
||||||
|
labReqsteplog.setZt(zt);
|
||||||
|
labReqsteplog.setUserid(yhdh);
|
||||||
|
labReqsteplog.setChangedate(new Date());
|
||||||
|
String ip=IpUtils.getIpAddr();
|
||||||
|
labReqsteplog.setComip(ip);
|
||||||
|
commonUtil.insertLabReqsteplog(labReqsteplog);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 登记危急值记录
|
||||||
|
* @param jyrq
|
||||||
|
* @param yq
|
||||||
|
* @param ybh
|
||||||
|
* @param yhdh
|
||||||
|
* @param qrr
|
||||||
|
* @param phone
|
||||||
|
* @param tzfs
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Result reglimit( Date jyrq, String yq, String ybh, String yhdh,String qrr,String phone,String tzfs){
|
public Result reglimit( Date jyrq, String yq, String ybh, String yhdh,String qrr,String phone,String tzfs){
|
||||||
log.info("登记危急值{}",tzfs);
|
log.info("登记危急值{}",tzfs);
|
||||||
|
|||||||
@ -79,7 +79,7 @@
|
|||||||
<if test="brxm != null and brxm != ''">and lab_pat.brdh = #{brxm}</if>
|
<if test="brxm != null and brxm != ''">and lab_pat.brdh = #{brxm}</if>
|
||||||
</where>
|
</where>
|
||||||
</select>
|
</select>
|
||||||
<select id="getxsws" resultType="Integer">
|
<select id="getQXZ" parameterType="String" resultType="Integer">
|
||||||
select xsws from xm_info where yq=#{yq} and xmdh=#{xmdh}
|
SELECT count(1) FROM com_dict WHERE zdlb = 'QXMX' AND bz in(select zddh from com_dict WHERE zdlb = 'qxz' AND bz IN('A','B')) and zdmc=#{yhdh}
|
||||||
</select>
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user