主程序

This commit is contained in:
tangw 2025-09-30 15:25:44 +08:00
parent 53ec5f5d9e
commit 4950fd5d8f
18 changed files with 2232 additions and 1795 deletions

View File

@ -154,6 +154,66 @@ public class ImageUtils
System.out.println("图片已生成到static目录:" + targetFile.getAbsolutePath()); System.out.println("图片已生成到static目录:" + targetFile.getAbsolutePath());
return targetFile; return targetFile;
} }
/**
* 获取服务的static目录绝对路径(Spring Boot核心:通过ResourceUtils获取)
* @return
*/
public static String getStaticPath(){
File staticDir = null;
try {
// 本地开发环境:target/classes/static(Maven/Gradle构建后路径)
// 生产环境(Jar包部署):Jar包内的static目录(需注意只读问题,下文会说明)
staticDir = new File(ResourceUtils.getURL("classpath:static").getPath());
} catch (FileNotFoundException e) {
// 若Jar包部署时获取不到classpath:static(因Jar包内资源无法直接以File形式访问)
// 改用服务运行目录下的static(需手动创建)
staticDir = new File(System.getProperty("user.dir") + File.separator + "static");
}
return staticDir.getAbsolutePath();
}
/**
* 判断文件是否存在,且是普通文件(非目录)
* @param filePath 文件路径(绝对路径或相对路径)
* @return true:存在且是文件;false:不存在/是目录/路径非法
*/
public static boolean isFileExists(String filePath) {
// 1. 校验路径非空
if (filePath == null || filePath.trim().isEmpty()) {
System.err.println("文件路径不能为空!");
return false;
}
// 2. 创建File对象并判断
File file = new File(filePath);
// exists():判断是否存在;isFile():判断是否为普通文件(排除目录)
boolean exists = file.exists() && file.isFile();
if (!exists) {
System.out.println("文件不存在或不是普通文件,路径:" + filePath);
}
return exists;
}
/**
* 判断目录是否存在(可用于判断static目录、临时目录等)
* @param dirPath 目录路径
* @return true:存在且是目录;false:不存在/是文件/路径非法
*/
public static boolean isDirExists(String dirPath) {
if (dirPath == null || dirPath.trim().isEmpty()) {
System.err.println("目录路径不能为空!");
return false;
}
File dir = new File(dirPath);
boolean exists = dir.exists() && dir.isDirectory();
if (!exists) {
System.out.println("目录不存在或不是目录,路径:" + dirPath);
}
return exists;
}
// 支持的图片格式(文件头标识 + 后缀名映射) // 支持的图片格式(文件头标识 + 后缀名映射)
private enum ImageFormat { private enum ImageFormat {
JPG(new byte[]{(byte) 0xFF, (byte) 0xD8, (byte) 0xFF}, ".jpg"), JPG(new byte[]{(byte) 0xFF, (byte) 0xD8, (byte) 0xFF}, ".jpg"),

View File

@ -40,6 +40,9 @@ public class LabReqmainConstants {
* 作废样本-9 * 作废样本-9
*/ */
public static final String CANCAL = "9"; public static final String CANCAL = "9";
/**
* 打印报告
*/
public static final String REPORT = "5";
} }

View File

@ -7,4 +7,6 @@ import java.util.List;
public interface ComUsrMapper { public interface ComUsrMapper {
List<ComUsr> getComUsrList(@Param("yhdh") String yhdh); List<ComUsr> getComUsrList(@Param("yhdh") String yhdh);
byte[] getComUsrdzqm(String yhdh);
String getComUsrName(String yhdh);
} }

View File

@ -1,4 +1,4 @@
package com.czlis.liswork.mapper.dict; package com.czlis.interfaceCommon.mapper;
import com.czlis.common.core.domain.entity.lis.LabInstrvsreqclass; import com.czlis.common.core.domain.entity.lis.LabInstrvsreqclass;
import com.czlis.common.core.domain.entity.lis.view.VwReqitemclass; import com.czlis.common.core.domain.entity.lis.view.VwReqitemclass;

View File

@ -0,0 +1,25 @@
package com.czlis.interfaceCommon.mapper;
import com.czlis.common.core.domain.entity.lis.LabPat;
import com.czlis.interfaceCommon.pojo.entity.ResultCalcDTO;
import org.apache.ibatis.annotations.Param;
import java.util.Date;
import java.util.List;
import java.util.Map;
public interface LisWorkUtilsMapper {
Long checkReqClass(@Param("sqh") String sqh,@Param("yq") String yq);
String selectSqxmdh(String sqh);
void spSetrefs(Map<String,Object> map);
void updatelabresultsqxmdhall(@Param("jyrq") Date jyrq,@Param("yq") String yq,@Param("ybh") String ybh,@Param("sqxmdh") String sqxmdh);
void updatelabresultsqxmdh(@Param("jyrq") Date jyrq,@Param("yq") String yq,@Param("ybh") String ybh,@Param("sqh") String sqh);
List<ResultCalcDTO> getResultCalc(@Param("jyrq") Date jyrq, @Param("yq") String yq, @Param("ybh") String ybh);
Integer getLimitCount(Map<String,Object> map);
Integer checkresultsqxmdh(@Param("jyrq") Date jyrq,@Param("yq") String yq,@Param("ybh") String ybh,@Param("sqh") String sqh);
String checkresultnosqxmdh(@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 checkyqdublereport(@Param("sqh") String sqh,@Param("yq") String yq, @Param("ybh") String ybh);
Integer getQXZ(String yhdh);
}

View File

@ -22,8 +22,8 @@ public class BarCodeParam {
private String yq; private String yq;
private String ybh; private String ybh;
private String hospitalName; private String hospitalName;
/** /**结果图片数组*/private String[] pic;
* 图片数组 /**检验医生签名*/private String usernopic;
*/ /**审核医生签名*/private String checkerpic;
private String[] pic; /**初审医生签名*/private String checkercbpic;
} }

View File

@ -1,4 +1,4 @@
package com.czlis.liswork.pojo.DTO; package com.czlis.interfaceCommon.pojo.entity;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Data; import lombok.Data;

View File

@ -499,7 +499,9 @@ public class CommonUtil {
private ComOpt getOptCache(String yq, String xxdh) { private ComOpt getOptCache(String yq, String xxdh) {
return ComOptionUtils.getOptCache(yq, xxdh); return ComOptionUtils.getOptCache(yq, xxdh);
} }
public List<ComUsr> getComUsrList(String yhdh) {
return comUsrMapper.getComUsrList(yhdh);
}
public Boolean getUserPower(String yq, String yhdh, int powerIdx) { public Boolean getUserPower(String yq, String yhdh, int powerIdx) {
if ("admin".equals(yhdh)) return true; if ("admin".equals(yhdh)) return true;
if ("LIS".equals(yhdh)) return true; if ("LIS".equals(yhdh)) return true;
@ -513,6 +515,12 @@ public class CommonUtil {
if ("Y".equals(userPower.substring(powerIdx - 1, 1))) return true; if ("Y".equals(userPower.substring(powerIdx - 1, 1))) return true;
return false; return false;
} }
public byte[] getComUsrdzqm(String yhdh) {
return comUsrMapper.getComUsrdzqm(yhdh);
}
public String getComUsrName(String yhdh){
return comUsrMapper.getComUsrName(yhdh);
}
public List<LabReqreportPdffile> getLabReqreportPdffileList(String sqh) { public List<LabReqreportPdffile> getLabReqreportPdffileList(String sqh) {
return labReqreportPdffileMapper.getLabReqreportPdffileList(sqh); return labReqreportPdffileMapper.getLabReqreportPdffileList(sqh);

View File

@ -7,6 +7,7 @@ import cn.hutool.core.util.StrUtil;
import com.czlis.common.config.RuoYiConfig; import com.czlis.common.config.RuoYiConfig;
import com.czlis.common.core.domain.Result; import com.czlis.common.core.domain.Result;
import com.czlis.common.core.domain.entity.lis.LabGraph; import com.czlis.common.core.domain.entity.lis.LabGraph;
import com.czlis.common.core.domain.entity.lis.LabPat;
import com.czlis.common.utils.file.FileUtils; import com.czlis.common.utils.file.FileUtils;
import com.czlis.common.utils.file.ImageUtils; import com.czlis.common.utils.file.ImageUtils;
import com.czlis.common.utils.ip.IpUtils; import com.czlis.common.utils.ip.IpUtils;
@ -114,12 +115,11 @@ 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 outputPath = RuoYiConfig.getProfile() + "/config/static/printPDF/" + UUID.randomUUID().toString() + ".pdf"; // PDF输出路径(多级目录会自动创建) String staticpath=ImageUtils.getStaticPath()+ File.separator;
// log.info("打印输入输出地址:{},{}",path,outputPath); String outputPath = staticpath+ File.separator + "printPDF"+ File.separator + UUID.randomUUID().toString() + ".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();
//JasperReportUtil.generatePdf(templatename,outputPath,stringObjectMap,connection);
JasperReportUtil.exportToPdf(templatename, stringObjectMap, connection, outputPath); JasperReportUtil.exportToPdf(templatename, stringObjectMap, connection, outputPath);
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
@ -132,7 +132,7 @@ public class ReportUtil {
String[] pic = barCodeParam.getPic(); String[] pic = barCodeParam.getPic();
if(pic != null && pic.length > 0){ if(pic != null && pic.length > 0){
for (int i = 0; i < pic.length; i++) { for (int i = 0; i < pic.length; i++) {
String picFilePath = RuoYiConfig.getProfile() + "/config/static/graphs/"+ StrUtil.splitToArray(pic[i], "graphs/")[1]; String picFilePath =staticpath+ File.separator +"graphs"+File.separator + StrUtil.splitToArray(pic[i], "graphs/")[1];
FileUtils.deleteFile(picFilePath); FileUtils.deleteFile(picFilePath);
} }
} }
@ -151,16 +151,8 @@ public class ReportUtil {
} }
public String getPrintURL(String pdfName) { public String getPrintURL(String pdfName) {
String httpPath = ""; return getHttpURL("printPDF")+"/"+pdfName+".pdf";
if (printURL == null || printURL.equals("")) {
httpPath = "http://" + IpUtils.getHostIp() + ":" + port + "/printPDF/" + pdfName + ".pdf";
} else {
httpPath = "http://" + printURL + ":" + port + "/printPDF/" + pdfName + ".pdf";
} }
return httpPath;
}
public String getHttpURL(String pathChild) { public String getHttpURL(String pathChild) {
String httpPath = ""; String httpPath = "";
if (printURL == null || printURL.equals("")) { if (printURL == null || printURL.equals("")) {
@ -168,7 +160,6 @@ public class ReportUtil {
} else { } else {
httpPath = "http://" + printURL + ":" + port + "/" + pathChild; httpPath = "http://" + printURL + ":" + port + "/" + pathChild;
} }
return httpPath; return httpPath;
} }
@ -337,25 +328,26 @@ public class ReportUtil {
} }
} }
public Result printReport(Date jyrq, String yq, String ybh, String sqh) { public Result printReport(Date jyrq, String yq, String ybh) {
String hospitalName = commonUtil.getCompany(commonUtil.getLabInstr(yq).getYljg()); commonUtil.getLabPatOne(jyrq, yq, ybh);
return printReport(commonUtil.getLabPatOne(jyrq, yq, ybh));
}
public Result printReport(LabPat labPat) {
Date jyrq = labPat.getJyrq();
String yq = labPat.getYq();
String ybh = labPat.getYbh();
String yljg=commonUtil.getLabInstr(yq).getYljg();
String hospitalName = commonUtil.getCompany(yljg);
BarCodeParam barCodeParam = new BarCodeParam(); BarCodeParam barCodeParam = new BarCodeParam();
barCodeParam.setJyrq(jyrq); barCodeParam.setJyrq(jyrq);
barCodeParam.setYq(yq); barCodeParam.setYq(yq);
barCodeParam.setYbh(ybh); barCodeParam.setYbh(ybh);
barCodeParam.setSqh(sqh);
barCodeParam.setHospitalName(hospitalName); barCodeParam.setHospitalName(hospitalName);
String[] filename = getReportpic(jyrq, yq, ybh); barCodeParam.setUsernopic(getSignName(labPat.getYhdh()));
if(filename != null && filename.length > 0) { barCodeParam.setCheckerpic(getSignName(labPat.getHdys()));
String httpPath = getHttpURL("graphs"); barCodeParam.setCheckercbpic(getSignName(labPat.getChecker()));
String[] picPath = new String[filename.length]; String[] picPath = getReportpic(jyrq, yq, ybh);
for (int i = 0; i < filename.length; i++) {
//EntityUtils.setItem(barCodeParam, "pic" + (i + 1), httpPath + "/" + filename[i]);
picPath[i] = httpPath + "/" + filename[i];
log.info("传给模板的地址:{}", httpPath + "/" + filename[i]);
}
barCodeParam.setPic(picPath); barCodeParam.setPic(picPath);
}
return printToPdf("report_image2", barCodeParam, UUID.randomUUID().toString(), true); return printToPdf("report_image2", barCodeParam, UUID.randomUUID().toString(), true);
} }
@ -366,6 +358,7 @@ public class ReportUtil {
log.info("labGraphList.size():{}", labGraphList.size()); log.info("labGraphList.size():{}", labGraphList.size());
if (labGraphList.size() <= 0) return null; if (labGraphList.size() <= 0) return null;
String[] filename = new String[labGraphList.size()]; String[] filename = new String[labGraphList.size()];
String httpPath = getHttpURL(filepath);
int filecount = 0; int filecount = 0;
if (labGraphList.size() > 0) { if (labGraphList.size() > 0) {
for (LabGraph labGraph : labGraphList) { for (LabGraph labGraph : labGraphList) {
@ -377,10 +370,29 @@ public class ReportUtil {
} catch (IOException e) { } catch (IOException e) {
throw new RuntimeException(e); throw new RuntimeException(e);
} }
filename[filecount] = txlbmc; filename[filecount] = httpPath + "/" + txlbmc;
filecount++; filecount++;
} }
} }
return filename; return filename;
} }
public String getSignName(String yhdh) {
if(yhdh==null||"".equals(yhdh))return "";
//SELECT zplx INTO :ls_pictype FROM off_staff WHERE rydh = :as_userno ;
String pictype="jpg";//暂时写死是jpg,8.0新版本后期可以考虑用户表增加字段指定类型
String dirpath="signname";
String httpPath = getHttpURL(dirpath);
String txlbmc = yhdh+ "." + pictype.toLowerCase();
String filepath =ImageUtils.getStaticPath()+ File.separator +dirpath+ File.separator +txlbmc;
//如果文件不存在则写入
if(!ImageUtils.isFileExists(filepath)){
byte[] txnr= commonUtil.getComUsrdzqm(yhdh);
try {
ImageUtils.generateToStaticDir(txnr, dirpath, txlbmc);
} catch (IOException e) {
throw new RuntimeException(e);
}
}
return httpPath+"/"+filepath;
}
} }

View File

@ -8,9 +8,13 @@
<if test="yhdh != null and yhdh != ''"> and yhdh = #{yhdh}</if> <if test="yhdh != null and yhdh != ''"> and yhdh = #{yhdh}</if>
</where> </where>
</select> </select>
<select id="getComUsrdzqm" resultType="byte[]">
select dzqm from com_usr where yhdh = #{yhdh}
</select>
<select id="getComUsrName" resultType="String">
select yhxm from com_usr where yhdh = #{yhdh}
</select>

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" ?> <?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd" > "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.czlis.liswork.mapper.dict.LabInstrvsreqclassMapper"> <mapper namespace="com.czlis.interfaceCommon.mapper.LabInstrvsreqclassMapper">
<select id="getLabInstrvsreqclassList" resultType="com.czlis.common.core.domain.entity.lis.LabInstrvsreqclass"> <select id="getLabInstrvsreqclassList" resultType="com.czlis.common.core.domain.entity.lis.LabInstrvsreqclass">
select * from lab_instrvsreqclass select * from lab_instrvsreqclass
<where> <where>

View File

@ -0,0 +1,84 @@
<?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.LisWorkUtilsMapper">
<select id="checkReqClass" resultType="Long">
select COUNT(1) from xm_feeinstr,lab_reqdetail
where lab_reqdetail.sqxmdh=xm_feeinstr.sfxmdh
and lab_reqdetail.sqh=#{sqh} and xm_feeinstr.yq=#{yq};
</select>
<select id="selectSqxmdh" resultType="String">
select sqxmdh from lab_reqdetail where lab_reqdetail.sqh=#{sqh}
</select>
<select id="checkresultsqxmdh" resultType="Integer">
select count(1) from lab_result a join xm_info on a.yq=xm_info.yq and a.xmdh=xm_info.xmdh and xm_info.jsxm != 'Y' AND xm_info.dylx='1'
where a.xmdh not in (select b.xmdh from xm_reqitem_vs_reportitem b ,lab_reqdetail c where b.sqxmdh=c.sqxmdh and b.yq=a.yq and c.sqh=#{sqh})
and a.yq=#{yq} and a.ybh=#{ybh} and a.jyrq=#{jyrq} AND a.xmdh NOT LIKE 'GLU%'
</select>
<select id="checkresultnosqxmdh" resultType="String">
select (select c.xmmc+ ';' from lab_result a join xm_info c on c.yq=a.yq and c.xmdh=a.xmdh and c.dylx !='3'
where a.jyrq=b.jyrq and a.yq=b.yq and a.ybh=b.ybh and isnull(a.sqxmdh,'')='' FOR XML PATH(''))
from lab_pat b join lab_instr on lab_instr.yqdl !='细菌仪' and lab_instr.yq=b.yq
where b.yq =#{yq} And b.jyrq =#{jyrq} And b.ybh =#{ybh} and b.sqh !=''
</select>
<select id="checkresultwxh" resultType="Integer">
select count(1) from lab_result,xm_info
where lab_result.yq = xm_info.yq and lab_result.xmdh = xm_info.xmdh and
lab_result.yq =#{yq} And lab_result.jyrq =#{jyrq} And lab_result.ybh =#{ybh} and (lab_result.csjg='****')
</select>
<select id="checkdublereport" resultType="com.czlis.common.core.domain.entity.lis.LabPat">
select top 1 jyrq,yq,ybh from lab_pat where jgbz='2' and sqh=#{sqh} and ybh !=#{ybh}
</select>
<select id="checkyqdublereport" resultType="com.czlis.common.core.domain.entity.lis.LabPat">
select top 1 jyrq,yq,ybh from lab_pat where jgbz='2' and sqh=#{sqh} and yq=#{yq} and ybh !=#{ybh}
</select>
<update id="updatelabresultsqxmdhall">
update lab_result set sqxmdh=#{sqxmdh} where yq=#{yq} and jyrq=#{jyrq} and ybh=#{ybh};
</update>
<update id="updatelabresultsqxmdh">
<![CDATA[ update a set a.sqxmdh=c.sqxmdh from lab_result a,xm_reqitem_vs_reportitem b ,lab_reqdetail c
where b.sqxmdh=c.sqxmdh and b.xmdh=a.xmdh and b.yq=a.yq and c.sqh=#{sqh} and a.yq=#{yq} and a.ybh=#{ybh} and a.jyrq=#{jyrq} ;
]]>
</update>
<select id="spSetrefs" parameterType="map" statementType="CALLABLE" useCache="false">
{call sp_setrefs(#{jyrq,mode=IN,jdbcType=TIMESTAMP},
#{yq,mode=IN,jdbcType=VARCHAR},
#{ybh,mode=IN,jdbcType=VARCHAR},
#{settype,mode=IN,jdbcType=VARCHAR},
#{retmsg,mode=OUT,jdbcType=VARCHAR},
#{retcode,mode=OUT,jdbcType=INTEGER})
}
</select>
<select id="getResultCalc" resultType="com.czlis.interfaceCommon.pojo.entity.ResultCalcDTO">
SELECT DISTINCT xm_calc.jsxm ,lab_result.xmdh ,lab_result.csjg ,xm_calc.jsgs
FROM lab_result ,xm_calc WHERE ( lab_result.yq = xm_calc.yq ) and
( lab_result.xmdh = xm_calc.xmdh ) and
( ( lab_result.jyrq = #{jyrq} ) And
( lab_result.yq =#{yq}) And
( lab_result.ybh = #{ybh}) )
</select>
<select id="getLimitCount" resultType="Integer">
select COUNT(1) from lab_resultwarning,lab_pat where lab_resultwarning.jyrq=lab_pat.jyrq
and lab_resultwarning.yq=lab_pat.yq and lab_resultwarning.ybh=lab_pat.ybh and
<where>
<if test="xmdh != null and xmdh != ''">lab_resultwarning.xmdh = #{xmdh}</if>
</where>
<where>
<if test="jyrq != null ">and lab_pat.jyrq = #{jyrq}</if>
</where>
<where>
<if test="brdh != null and brdh != ''">and lab_pat.brdh = #{brdh}</if>
</where>
<where>
<if test="brxm != null and brxm != ''">and lab_pat.brdh = #{brxm}</if>
</where>
</select>
<select id="getQXZ" parameterType="String" resultType="Integer">
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>
</mapper>

View File

@ -1,7 +1,7 @@
package com.czlis.liswork.mapper; package com.czlis.liswork.mapper;
import com.czlis.common.core.domain.entity.lis.LabPat; import com.czlis.common.core.domain.entity.lis.LabPat;
import com.czlis.liswork.pojo.DTO.ResultCalcDTO; import com.czlis.interfaceCommon.pojo.entity.ResultCalcDTO;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;

View File

@ -8,7 +8,10 @@ import com.czlis.common.exception.ServiceException;
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;
import com.czlis.interfaceCommon.constants.ComLogConstants;
import com.czlis.interfaceCommon.constants.LabReqmainConstants;
import com.czlis.interfaceCommon.utils.CommonUtil; import com.czlis.interfaceCommon.utils.CommonUtil;
import com.czlis.interfaceCommon.utils.LisWorkUtils;
import com.czlis.interfaceCommon.utils.LoginConfigParamUtil; import com.czlis.interfaceCommon.utils.LoginConfigParamUtil;
import com.czlis.interfaceCommon.utils.ReportUtil; import com.czlis.interfaceCommon.utils.ReportUtil;
import com.czlis.liswork.mapper.LisWorkMapper; import com.czlis.liswork.mapper.LisWorkMapper;
@ -36,7 +39,8 @@ public class LisWorkServiceImpl implements LisWorkService {
LoginConfigParamUtil loginConfigParamUtil; LoginConfigParamUtil loginConfigParamUtil;
@Autowired @Autowired
ReportUtil reportUtil; ReportUtil reportUtil;
@Autowired
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);
@ -53,8 +57,26 @@ public class LisWorkServiceImpl implements LisWorkService {
Date jyrq = labPat.getJyrq(); Date jyrq = labPat.getJyrq();
String yq = labPat.getYq(); String yq = labPat.getYq();
String ybh = labPat.getYbh(); String ybh = labPat.getYbh();
labPat=commonUtil.getLabPatOne(jyrq, yq, ybh);
if(labPat==null) return new Result("-1","未找到报告单,打印失败!");
String jgbz=labPat.getJgbz();
if(jgbz==null||"".equals(jgbz)) return new Result("-1","未找到报告单,打印失败!");
if(!"2".equals(jgbz))return new Result("1","报告单未审核,禁止打印!");
Result res=reportUtil.printReport(labPat);
if(!"1".equals(labPat.getDybz())) {
commonUtil.updateLabPatByColumn(jyrq,yq,ybh,"dybz","1");
}
if(labPat.getDysj()==null) {
String dysj=commonUtil.getDateTimeString(new Date());
commonUtil.updateLabPatByColumn(jyrq,yq,ybh,"dysj",dysj);
}
String yhdh=SecurityUtils.getLoginUser().getUsername();
lisWorkUtils.setComLog(jyrq,yq,ybh,yhdh, ComLogConstants.LG_P,"");
String sqh=labPat.getSqh(); String sqh=labPat.getSqh();
return reportUtil.printReport(jyrq,yq,ybh,sqh); if(sqh!=null&&!"".equals(sqh)){
lisWorkUtils.setlabReqsteplog(sqh, LabReqmainConstants.REPORT,yhdh);
}
return res;
} }
@Override @Override

View File

@ -3,7 +3,7 @@ package com.czlis.liswork.service.impl.xtwh;
import com.czlis.common.core.domain.Result; import com.czlis.common.core.domain.Result;
import com.czlis.common.core.domain.entity.lis.LabInstrvsreqclass; import com.czlis.common.core.domain.entity.lis.LabInstrvsreqclass;
import com.czlis.common.core.domain.entity.lis.view.VwReqitemclass; import com.czlis.common.core.domain.entity.lis.view.VwReqitemclass;
import com.czlis.liswork.mapper.dict.LabInstrvsreqclassMapper; import com.czlis.interfaceCommon.mapper.LabInstrvsreqclassMapper;
import com.czlis.liswork.service.LabInstrvsreqclassService; import com.czlis.liswork.service.LabInstrvsreqclassService;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;

View File

@ -55,7 +55,7 @@
} }
</select> </select>
<select id="getResultCalc" resultType="com.czlis.liswork.pojo.DTO.ResultCalcDTO"> <select id="getResultCalc" resultType="com.czlis.interfaceCommon.pojo.entity.ResultCalcDTO">
SELECT DISTINCT xm_calc.jsxm ,lab_result.xmdh ,lab_result.csjg ,xm_calc.jsgs SELECT DISTINCT xm_calc.jsxm ,lab_result.xmdh ,lab_result.csjg ,xm_calc.jsgs
FROM lab_result ,xm_calc WHERE ( lab_result.yq = xm_calc.yq ) and FROM lab_result ,xm_calc WHERE ( lab_result.yq = xm_calc.yq ) and
( lab_result.xmdh = xm_calc.xmdh ) and ( lab_result.xmdh = xm_calc.xmdh ) and