主程序

This commit is contained in:
tangw 2025-10-31 16:55:06 +08:00
parent e7e397545b
commit 71e7c264e2
5 changed files with 99 additions and 27 deletions

View File

@ -1,16 +1,14 @@
package com.czlis.interfaceCommon.mapper;
import com.czlis.common.core.domain.entity.lis.LabResultMed;
import org.apache.ibatis.annotations.Param;
import java.util.Date;
import java.util.List;
public interface LabResultMedMapper {
List<LabResultMed> getLabResultMed(@Param("jyrq")Date jyrq, @Param("yq")String yq, @Param("ybh")String ybh, @Param("xmdh")String xmdh);
int getLabResultMedCount(@Param("jyrq")Date jyrq, @Param("yq")String yq, @Param("ybh")String ybh);
int delLabResultMed(@Param("jyrq")Date jyrq, @Param("yq")String yq, @Param("ybh")String ybh,@Param("xmdh")String xmdh);
int delLabResultMedAll(@Param("jyrq")Date jyrq, @Param("yq")String yq, @Param("ybh")String ybh);
List<LabResultMed> getLabResultMed(LabResultMed labResultMed);
int getLabResultMedCount(LabResultMed labResultMed);
int delLabResultMed(LabResultMed labResultMed);
int insertLabResultMed(LabResultMed labResultMed);
int insertLabResultMedAll(List<LabResultMed> labResultMedList);
int updateLabResultMed(LabResultMed labResultMed);
}

View File

@ -328,19 +328,30 @@ public class CommonUtil {
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) {
return labResultMedMapper.getLabResultMedCount(jyrq, yq, ybh);
public int getLabResultMedCount(LabResultMed labResultMed) {
return labResultMedMapper.getLabResultMedCount(labResultMed);
}
public List<LabResultMed> getLabResultMed(Date jyrq, String yq, String ybh,String xmdh){
return labResultMedMapper.getLabResultMed(jyrq, yq, ybh,xmdh);
public int getLabResultMedCountAll(Date jyrq, String yq, String ybh) {
LabResultMed labResultMed=new LabResultMed();
labResultMed.setJyrq(jyrq);
labResultMed.setYq(yq);
labResultMed.setYbh(ybh);
return labResultMedMapper.getLabResultMedCount(labResultMed);
}
public List<LabResultMed> getLabResultMed(LabResultMed labResultMed){
return labResultMedMapper.getLabResultMed(labResultMed);
}
@Transactional(rollbackFor = Exception.class)
public void delLabResultMed(Date jyrq, String yq, String ybh,String xmdh) {
labResultMedMapper.delLabResultMed(jyrq, yq, ybh,xmdh);
public void delLabResultMed(LabResultMed labResultMed) {
labResultMedMapper.delLabResultMed( labResultMed);
}
@Transactional(rollbackFor = Exception.class)
public void delLabResultMedAll(Date jyrq, String yq, String ybh) {
labResultMedMapper.delLabResultMedAll(jyrq, yq, ybh);
LabResultMed labResultMed=new LabResultMed();
labResultMed.setJyrq(jyrq);
labResultMed.setYq(yq);
labResultMed.setYbh(ybh);
labResultMedMapper.delLabResultMed( labResultMed);
}
@Transactional(rollbackFor = Exception.class)
public int insertLabResultMed(LabResultMed labResultMed){
@ -350,6 +361,10 @@ public class CommonUtil {
public int insertLabResultMedAll(List<LabResultMed> labResultMedList){
return labResultMedMapper.insertLabResultMedAll(labResultMedList);
}
@Transactional(rollbackFor = Exception.class)
public int updateLabResultMed(LabResultMed labResultMed){
return labResultMedMapper.updateLabResultMed(labResultMed);
}
//封箱
public List<LabReqpack> getLabReqpack(String packno){
return labReqpackMapper.getLabReqpack(packno);

View File

@ -194,7 +194,7 @@ public class ReportUtil {
//判断细菌仪使用的报告单模板
String yqdl = commonUtil.getYqdl(yq);
if ("细菌仪".equals(yqdl)) {
int ym = commonUtil.getLabResultMedCount(jyrq, yq, ybh);
int ym = commonUtil.getLabResultMedCountAll(jyrq, yq, ybh);
if (ym > 1) {
if ("2".equals(NOBOTH)) {
return "A4";

View File

@ -18,8 +18,12 @@
<if test="xmdh != null and xmdh != ''">
and xmdh = #{xmdh}
</if>
<if test="ywdh != null and ywdh != ''">
and ywdh = #{ywdh}
</if>
</where>
</select>
<select id="getLabResultMedCount" resultType="int">
select count(1)
from lab_resultmed
@ -33,20 +37,33 @@
<if test="ybh != null and ybh != ''">
and ybh = #{ybh}
</if>
<if test="xmdh != null and xmdh != ''">
and xmdh = #{xmdh}
</if>
<if test="ywdh != null and ywdh != ''">
and ywdh = #{ywdh}
</if>
</where>
</select>
<delete id="delLabResultMed" >
delete from lab_resultmed
where jyrq = #{jyrq}
and yq = #{yq}
and ybh = #{ybh}
and xmdh = #{xmdh}
</delete>
<delete id="delLabResultMedAll" >
delete from lab_resultmed
where jyrq = #{jyrq}
and yq = #{yq}
and ybh = #{ybh}
<where>
<if test="jyrq != null ">
and jyrq = #{jyrq}
</if>
<if test="yq != null and yq != ''">
and yq = #{yq}
</if>
<if test="ybh != null and ybh != ''">
and ybh = #{ybh}
</if>
<if test="xmdh != null and xmdh != ''">
and xmdh = #{xmdh}
</if>
<if test="ywdh != null and ywdh != ''">
and ywdh = #{ywdh}
</if>
</where>
</delete>
<insert id="insertLabResultMed" parameterType="com.czlis.common.core.domain.entity.lis.LabResultMed">
insert into lab_resultmed (jyrq, yq, ybh,
@ -69,6 +86,27 @@
</foreach>
) AS temp
</insert>
<update id="updateLabResultMed" parameterType="com.czlis.common.core.domain.entity.lis.LabResultMed">
update lab_resultmed
set xh=#{xh},ywdh=#{ywdh}, mic=#{mic},rad=#{rad}, csjg=#{csjg},
jgbz=#{jgbz},bz=#{bz},txtresult=#{txtresult}
<where>
<if test="jyrq != null ">
and jyrq = #{jyrq}
</if>
<if test="yq != null and yq != ''">
and yq = #{yq}
</if>
<if test="ybh != null and ybh != ''">
and ybh = #{ybh}
</if>
<if test="xmdh != null and xmdh != ''">
and xmdh = #{xmdh}
</if>
<if test="ywdh != null and ywdh != ''">
and ywdh = #{ywdh}
</if>
</where>
</update>
</mapper>

View File

@ -156,7 +156,22 @@ public class LisWorkGermServiceImpl implements LisWorkGermService {
}
@Override
public Result savemedresult(LabResultMed labResultmed) {
commonUtil.insertLabResultMed(labResultmed);
Date jyrq=labResultmed.getJyrq();
if(jyrq==null)return new Result("-1","检验日期不允许为空");
String yq=labResultmed.getYq();
if(yq==null||"".equals(yq))return new Result("-1","仪器不允许为空");
String ybh=labResultmed.getYbh();
if(ybh==null||"".equals(ybh))return new Result("-1","样本号不允许为空");
String xmdh=labResultmed.getXmdh();
if(xmdh==null||"".equals(xmdh))return new Result("-1","细菌代码不允许为空");
String ywdh=labResultmed.getYwdh();
if(ywdh==null||"".equals(ywdh))return new Result("-1","药物代码不允许为空");
int sl=commonUtil.getLabResultMedCount(labResultmed);
if(sl==0) {
commonUtil.insertLabResultMed(labResultmed);
}else{
commonUtil.updateLabResultMed(labResultmed);
}
return new Result("0","成功");
}
@Override
@ -167,10 +182,16 @@ public class LisWorkGermServiceImpl implements LisWorkGermService {
@Override
public Result deletemedresult(LabResultMed labResultmed) {
Date jyrq=labResultmed.getJyrq();
if(jyrq==null)return new Result("-1","检验日期不允许为空");
String yq=labResultmed.getYq();
if(yq==null||"".equals(yq))return new Result("-1","仪器不允许为空");
String ybh=labResultmed.getYbh();
if(ybh==null||"".equals(ybh))return new Result("-1","样本号不允许为空");
String xmdh=labResultmed.getXmdh();
commonUtil.delLabResultMed(jyrq,yq,ybh,xmdh);
if(xmdh==null||"".equals(xmdh))return new Result("-1","细菌代码不允许为空");
String ywdh=labResultmed.getYwdh();
if(ywdh==null||"".equals(ywdh))return new Result("-1","药物代码不允许为空");
commonUtil.delLabResultMed(labResultmed);
return new Result("0","成功");
}
}