Merge remote-tracking branch 'lis8.0/master'
This commit is contained in:
commit
5137b0a843
@ -10,6 +10,7 @@ public interface LabReportvsitemMapper {
|
|||||||
int getLabReportvsitemCount(@Param("jyrq") Date jyrq, @Param("yq")String yq, @Param("ybh")String ybh);
|
int getLabReportvsitemCount(@Param("jyrq") Date jyrq, @Param("yq")String yq, @Param("ybh")String ybh);
|
||||||
int getLabReport2(@Param("jyrq") Date jyrq, @Param("yq")String yq, @Param("ybh")String ybh);
|
int getLabReport2(@Param("jyrq") Date jyrq, @Param("yq")String yq, @Param("ybh")String ybh);
|
||||||
int getLabReportCount(@Param("jyrq") Date jyrq, @Param("yq")String yq, @Param("ybh")String ybh);
|
int getLabReportCount(@Param("jyrq") Date jyrq, @Param("yq")String yq, @Param("ybh")String ybh);
|
||||||
|
int getLabReportCountwithitem(@Param("jyrq") Date jyrq, @Param("yq")String yq, @Param("ybh")String ybh,@Param("items")List<String> items);
|
||||||
List<ComReportInstr> getComReportInstrByInstr(String reportYq);
|
List<ComReportInstr> getComReportInstrByInstr(String reportYq);
|
||||||
String getreportCode(Long reportBgdh);
|
String getreportCode(Long reportBgdh);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -22,6 +22,7 @@ public class ReportParam {
|
|||||||
private String yq;
|
private String yq;
|
||||||
private String ybh;
|
private String ybh;
|
||||||
private String hospitalName;
|
private String hospitalName;
|
||||||
|
private Long ReportId;
|
||||||
/**结果图片数组*/private String[] pic;
|
/**结果图片数组*/private String[] pic;
|
||||||
/**检验医生签名*/private String usernopic;
|
/**检验医生签名*/private String usernopic;
|
||||||
/**审核医生签名*/private String checkerpic;
|
/**审核医生签名*/private String checkerpic;
|
||||||
|
|||||||
@ -42,6 +42,7 @@ import java.io.File;
|
|||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.sql.Connection;
|
import java.sql.Connection;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
|
||||||
@Component
|
@Component
|
||||||
@ -356,29 +357,59 @@ public class ReportUtil {
|
|||||||
reportParam.setCheckercbpic(getSignName(labPat.getChecker())); //初审者
|
reportParam.setCheckercbpic(getSignName(labPat.getChecker())); //初审者
|
||||||
String[] picPath = getReportpic(jyrq, yq, ybh);
|
String[] picPath = getReportpic(jyrq, yq, ybh);
|
||||||
reportParam.setPic(picPath);
|
reportParam.setPic(picPath);
|
||||||
return printToPdf("report_image2", reportParam, UUID.randomUUID().toString(), true);
|
ComReportInstr comReportInstr=getReportTemplate(jyrq, yq, ybh);
|
||||||
|
if(comReportInstr==null) {
|
||||||
|
return new Result("-1","未找到打印模板,请检查报告单设置");
|
||||||
|
}
|
||||||
|
reportParam.setReportId(comReportInstr.getReportId());
|
||||||
|
String filename=labReportvsitemMapper.getreportCode(comReportInstr.getReportBgdh());
|
||||||
|
return printToPdf(filename, reportParam, UUID.randomUUID().toString(), true);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取报告单模板
|
* 获取报告单模板
|
||||||
* @param labPat
|
* @param jyrq 检验日期
|
||||||
* @return
|
* @param yq 仪器
|
||||||
|
* @param ybh 样本号
|
||||||
|
* @return 报告单模板
|
||||||
*/
|
*/
|
||||||
public String getReportTemplate(LabPat labPat) {
|
public ComReportInstr getReportTemplate(Date jyrq, String yq, String ybh) {
|
||||||
Date jyrq = labPat.getJyrq();
|
ComReportInstr comReportInstr0=new ComReportInstr();
|
||||||
String yq = labPat.getYq().trim();
|
String yqdl=commonUtil.getYqdl(yq);
|
||||||
String ybh = labPat.getYbh();
|
|
||||||
int rows=labReportvsitemMapper.getLabReportCount(jyrq,yq,ybh);
|
|
||||||
List<ComReportInstr> info=labReportvsitemMapper.getComReportInstrByInstr(yq);
|
List<ComReportInstr> info=labReportvsitemMapper.getComReportInstrByInstr(yq);
|
||||||
for (ComReportInstr comReportInstr : info) {
|
if("细菌仪".equals(yqdl)) {
|
||||||
Long bgdh=comReportInstr.getReportBgdh();
|
String tyep;
|
||||||
|
int med = commonUtil.getLabResultMedCountAll(jyrq, yq, ybh);
|
||||||
|
if (med > 1)tyep="2";
|
||||||
|
else {
|
||||||
|
tyep = "1";
|
||||||
}
|
}
|
||||||
|
List<ComReportInstr> info0 = info.stream().filter(ss -> tyep.equals(ss.getReportType())).collect(Collectors.toList());
|
||||||
|
if(info0.isEmpty()||info0==null)return comReportInstr0;
|
||||||
|
return info0.get(0);
|
||||||
return "";
|
}
|
||||||
|
int rows=labReportvsitemMapper.getLabReportCount(jyrq,yq,ybh);
|
||||||
|
for (ComReportInstr comReportInstr : info) {
|
||||||
|
Long minrows=comReportInstr.getReportMinrows();
|
||||||
|
Long maxrows=comReportInstr.getReportMaxrows();
|
||||||
|
if(minrows!=null&&minrows>0){
|
||||||
|
if(rows<minrows){continue;}
|
||||||
|
}
|
||||||
|
if(maxrows!=null&&maxrows>0){
|
||||||
|
if(rows>maxrows){continue;}
|
||||||
|
}
|
||||||
|
String items=comReportInstr.getReportItems();
|
||||||
|
if(items!=null&&!"".equals(items)) {
|
||||||
|
List<String> itemList = Arrays.asList(items.split(","));
|
||||||
|
int xms=labReportvsitemMapper.getLabReportCountwithitem(jyrq, yq, ybh, itemList);
|
||||||
|
if(xms>0){
|
||||||
|
return comReportInstr;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
comReportInstr0=comReportInstr;
|
||||||
|
}
|
||||||
|
return comReportInstr0;
|
||||||
}
|
}
|
||||||
public String[] getReportpic(Date jyrq, String yq, String ybh) {
|
public String[] getReportpic(Date jyrq, String yq, String ybh) {
|
||||||
List<LabGraph> labGraphList = commonUtil.getLabGraphAll(jyrq, yq, ybh);
|
List<LabGraph> labGraphList = commonUtil.getLabGraphAll(jyrq, yq, ybh);
|
||||||
|
|||||||
@ -41,6 +41,17 @@
|
|||||||
xm_info.yq=lab_result.yq and xm_info.xmdh=lab_result.xmdh and xm_info.dylx !='3' and
|
xm_info.yq=lab_result.yq and xm_info.xmdh=lab_result.xmdh and xm_info.dylx !='3' and
|
||||||
AND ( lab_result.jyrq =#{jyrq} ) AND ( lab_result.yq = #{yq}) AND ( lab_result.ybh = #{ybh} )
|
AND ( lab_result.jyrq =#{jyrq} ) AND ( lab_result.yq = #{yq}) AND ( lab_result.ybh = #{ybh} )
|
||||||
</select>
|
</select>
|
||||||
|
<select id="getLabReportCountwithitem" resultType="int">
|
||||||
|
SELECT count(1) FROM lab_result WHERE jyrq =#{jyrq} AND yq = #{yq} AND ybh = #{ybh}
|
||||||
|
and xmdh in
|
||||||
|
<foreach collection="items"
|
||||||
|
item="itemVal"
|
||||||
|
open="("
|
||||||
|
close=")"
|
||||||
|
separator=",">
|
||||||
|
#{itemVal}
|
||||||
|
</foreach>
|
||||||
|
</select>
|
||||||
<select id="getLabReport2" resultType="int">
|
<select id="getLabReport2" resultType="int">
|
||||||
select count(1) from (SELECT (sum(LEN(refs) - LEN(REPLACE(refs, '|', '')))+count(1)) as sl,count(lab_reportvsitem.xmdh) as bg2xms,count(com_rpt.bgdh) as slbgd
|
select count(1) from (SELECT (sum(LEN(refs) - LEN(REPLACE(refs, '|', '')))+count(1)) as sl,count(lab_reportvsitem.xmdh) as bg2xms,count(com_rpt.bgdh) as slbgd
|
||||||
FROM lab_result join xm_info on xm_info.yq=lab_result.yq and xm_info.xmdh=lab_result.xmdh and xm_info.dylx !='3'
|
FROM lab_result join xm_info on xm_info.yq=lab_result.yq and xm_info.xmdh=lab_result.xmdh and xm_info.dylx !='3'
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user