bug:修改pdf打印空白和图像预览界面上新增扫描图像上传报错

bug:查询列表把盘号放病案号前
bug:下载启用文本水印设置为否,但是下载的pdf还是有水印,该设置无效
bug:姓名查询:不能默认模糊查询,需要自选,前中后均可模糊查询
bug:病案信息修改功能:病案号 姓名 次数 出院日期 主要诊断名称需要可修改,修改权限根据权限系统配置
bug:病例图像超过300多页就不能下载成功
master
jian.wang 2 years ago
parent e1c4655c9a
commit eea3a023a8

@ -1110,66 +1110,108 @@ public class TemplateSearchController {
@RequestMapping(value = "downloadBloodZip", produces = {"text/json;charset=UTF-8"}, method = RequestMethod.POST) @RequestMapping(value = "downloadBloodZip", produces = {"text/json;charset=UTF-8"}, method = RequestMethod.POST)
@ResponseBody @ResponseBody
public void downloadBloodZip(HttpServletResponse response, String patientIds, String flag) { public void downloadBloodZip(HttpServletResponse response, String patientIds, String flag) {
if (StringUtils.isNoneBlank(patientIds)) { if (StringUtils.isNoneBlank(patientIds)) {
try { try {
List<ScanPathVo> scanPathVos = scanPathMapper.selectScanFileByBloodPatientIds(patientIds, null, flag); List<ScanPathVo> scanPathVos = scanPathMapper.selectScanFileByBloodPatientIds(patientIds, null, flag);
List<String> filePaths = new ArrayList<>();
// if (null != scanPathVos && !scanPathVos.isEmpty()) {
// for (int i = 0; i < scanPathVos.size(); i++) {
// String fileRealPath = scanPathVos.get(i).getFileRealPath();
// if(StringUtils.isNoneBlank(fileRealPath)){
// filePaths.add(fileRealPath);
// }
// }
// String zipName = "数字病案图片压缩包";
// downloadZip1(response,zipName,filePaths);
// }
if (null != scanPathVos && !scanPathVos.isEmpty()) { if (null != scanPathVos && !scanPathVos.isEmpty()) {
// 创建临时路径,存放压缩文件 Set<ScanPathForPatientListVo> list = new LinkedHashSet<>();
File file = new File("D:/tmp"); Set<String> patientIdSet = new LinkedHashSet<>();
//查询保存文件目录是否存在 //批量添加下载记录
createFile(file); printOrDownLoadInfoService.SimpleInsert(scanPathVos, null, Short.valueOf("2"));
// 压缩输出流,包装流,将临时文件输出流包装成压缩流,将所有文件输出到这里,打成zip包 for (ScanPathVo scanPathVo : scanPathVos) {
ZipOutputStream zipOut = new ZipOutputStream(new FileOutputStream(file)); patientIdSet.add(scanPathVo.getPatientId());
// 循环调用压缩文件方法,将一个一个需要下载的文件打入压缩文件包
for (int i = 0; i < scanPathVos.size(); i++) {
String fileRealPath = scanPathVos.get(i).getFileRealPath();
if(StringUtils.isNoneBlank(fileRealPath)){
filePaths.add(fileRealPath);
}
}
for (String path : filePaths) {
// 该方法在下面定义
fileToZip(path, zipOut);
} }
// 压缩完成后,关闭压缩流 for (String patinetId : patientIdSet) {
zipOut.close(); ScanPathForPatientListVo vo = new ScanPathForPatientListVo();
List<String> filePaths = new ArrayList<>();
//拼接下载默认名称并转为ISO-8859-1格式 for (ScanPathVo scanPathVo : scanPathVos) {
String fileName = new String(("我的压缩文件.zip").getBytes(),"ISO-8859-1"); if (scanPathVo.getPatientId().equals(patinetId)) {
response.setHeader("Content-Disposition", "attchment;filename="+fileName); vo.setName(scanPathVo.getName());
vo.setInpatientNo(scanPathVo.getInpatientNo());
//该流不可以手动关闭,手动关闭下载会出问题,下载完成后会自动关闭 String disDate = scanPathVo.getDisDate();
ServletOutputStream outputStream = response.getOutputStream(); SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
FileInputStream inputStream = new FileInputStream("D:/tmp"); vo.setDisDate(sdf.parse(disDate));
// 如果是SpringBoot框架,在这个路径 String fileRealPath = scanPathVo.getFileRealPath();
// org.apache.tomcat.util.http.fileupload.IOUtils产品 if (StringUtils.isNoneBlank(fileRealPath) && new File(fileRealPath).exists()) {
// 否则需要自主引入apache的 commons-io依赖 filePaths.add(fileRealPath);
// copy方法为文件复制,在这里直接实现了下载效果 }
IOUtils.copy(inputStream, outputStream); }
}
// 关闭输入流 if (!filePaths.isEmpty()) {
inputStream.close(); vo.setScanPathList(filePaths);
list.add(vo);
//下载完成之后删掉这个zip包 }
File fileTempZip = new File("D:/tmp"); }
fileTempZip.delete(); String zipName = "档案pdf压缩包";
downloadPdfZip(response, zipName, list);
} }
} catch (Exception e) { } catch (Exception e) {
ExceptionPrintUtil.printException(e); ExceptionPrintUtil.printException(e);
e.printStackTrace(); e.printStackTrace();
} }
} }
//以前的方法
// if (StringUtils.isNoneBlank(patientIds)) {
// try {
// List<ScanPathVo> scanPathVos = scanPathMapper.selectScanFileByBloodPatientIds(patientIds, null, flag);
// List<String> filePaths = new ArrayList<>();
//// if (null != scanPathVos && !scanPathVos.isEmpty()) {
//// for (int i = 0; i < scanPathVos.size(); i++) {
//// String fileRealPath = scanPathVos.get(i).getFileRealPath();
//// if(StringUtils.isNoneBlank(fileRealPath)){
//// filePaths.add(fileRealPath);
//// }
//// }
//// String zipName = "数字病案图片压缩包";
//// downloadZip1(response,zipName,filePaths);
//// }
// if (null != scanPathVos && !scanPathVos.isEmpty()) {
// // 创建临时路径,存放压缩文件
// File file = new File("D:/tmp");
// //查询保存文件目录是否存在
// createFile(file);
// // 压缩输出流,包装流,将临时文件输出流包装成压缩流,将所有文件输出到这里,打成zip包
// ZipOutputStream zipOut = new ZipOutputStream(new FileOutputStream(file));
// // 循环调用压缩文件方法,将一个一个需要下载的文件打入压缩文件包
// for (int i = 0; i < scanPathVos.size(); i++) {
// String fileRealPath = scanPathVos.get(i).getFileRealPath();
// if(StringUtils.isNoneBlank(fileRealPath)){
// filePaths.add(fileRealPath);
// }
// }
// for (String path : filePaths) {
// // 该方法在下面定义
// fileToZip(path, zipOut);
// }
// // 压缩完成后,关闭压缩流
// zipOut.close();
//
// //拼接下载默认名称并转为ISO-8859-1格式
// String fileName = new String(("我的压缩文件.zip").getBytes(),"ISO-8859-1");
// response.setHeader("Content-Disposition", "attchment;filename="+fileName);
//
// //该流不可以手动关闭,手动关闭下载会出问题,下载完成后会自动关闭
// ServletOutputStream outputStream = response.getOutputStream();
// FileInputStream inputStream = new FileInputStream("D:/tmp");
// // 如果是SpringBoot框架,在这个路径
// // org.apache.tomcat.util.http.fileupload.IOUtils产品
// // 否则需要自主引入apache的 commons-io依赖
// // copy方法为文件复制,在这里直接实现了下载效果
// IOUtils.copy(inputStream, outputStream);
//
// // 关闭输入流
// inputStream.close();
//
// //下载完成之后删掉这个zip包
// File fileTempZip = new File("D:/tmp");
// fileTempZip.delete();
// }
// } catch (Exception e) {
// ExceptionPrintUtil.printException(e);
// e.printStackTrace();
// }
// }
} }
public void createFile(File file) { public void createFile(File file) {
@ -1277,7 +1319,7 @@ public class TemplateSearchController {
response.setContentType("application/vnd.ms-excel;charset=UTF-8"); response.setContentType("application/vnd.ms-excel;charset=UTF-8");
ZipOutputStream zos = null; ZipOutputStream zos = null;
BufferedOutputStream bos = null; BufferedOutputStream bos = null;
ByteArrayOutputStream out = new ByteArrayOutputStream(); ByteArrayOutputStream out = null;
BufferedInputStream bis = null; BufferedInputStream bis = null;
try { try {
zipName = java.net.URLEncoder.encode(zipName, "UTF-8"); zipName = java.net.URLEncoder.encode(zipName, "UTF-8");
@ -1296,12 +1338,13 @@ public class TemplateSearchController {
String fileName = vo.getInpatientNo().trim() + "-" + vo.getName().trim() + "-" + disDate.trim() + "_" + fmt.format(new Date()); String fileName = vo.getInpatientNo().trim() + "-" + vo.getName().trim() + "-" + disDate.trim() + "_" + fmt.format(new Date());
zos.putNextEntry(new ZipEntry(fileName + ".pdf")); zos.putNextEntry(new ZipEntry(fileName + ".pdf"));
//合成pdf //合成pdf
out = new ByteArrayOutputStream();
img2PdfUtil.imageToPdfToBuffOut(out, scanPathList, emrPdfWaterSet); img2PdfUtil.imageToPdfToBuffOut(out, scanPathList, emrPdfWaterSet);
byte[] file = out.toByteArray(); //这个zip文件的字节 byte[] file = out.toByteArray(); //这个zip文件的字节
bis = new BufferedInputStream(new ByteArrayInputStream(file)); bis = new BufferedInputStream(new ByteArrayInputStream(file));
//输出 //输出
int len = 0; int len = 0;
byte[] buf = new byte[10 * 1024]; byte[] buf = new byte[1024 * 1024];
while ((len = bis.read(buf, 0, buf.length)) != -1) { while ((len = bis.read(buf, 0, buf.length)) != -1) {
bos.write(buf, 0, len); bos.write(buf, 0, len);
} }

@ -7,6 +7,7 @@ import com.itextpdf.text.*;
import com.itextpdf.text.pdf.*; import com.itextpdf.text.pdf.*;
import com.twelvemonkeys.imageio.metadata.tiff.IFD; import com.twelvemonkeys.imageio.metadata.tiff.IFD;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.util.ObjectUtils;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.io.ByteArrayOutputStream; import java.io.ByteArrayOutputStream;
@ -85,16 +86,18 @@ public class imgToPdfUtil {
// 添加图片到PDF // 添加图片到PDF
for (int i = 0; i < scanPathVos.size(); i++) { for (int i = 0; i < scanPathVos.size(); i++) {
String assortName = scanPathVos.get(i).getAssortName(); String assortName = scanPathVos.get(i).getAssortName();
if (StringUtils.isNotBlank(lastOutline) && lastOutline.equals(assortName)) { if(!ObjectUtils.isEmpty(assortName)){
outFlag = false; if (StringUtils.isNotBlank(lastOutline) && lastOutline.equals(assortName)) {
} outFlag = false;
if (StringUtils.isBlank(lastOutline)) { }
lastOutline = assortName; if (StringUtils.isBlank(lastOutline)) {
outFlag=true; lastOutline = assortName;
} outFlag=true;
if (!lastOutline.equals(assortName)){ }
lastOutline = assortName; if (!lastOutline.equals(assortName)){
outFlag=true; lastOutline = assortName;
outFlag=true;
}
} }
String imagePath = scanPathVos.get(i).getFileRealPath(); String imagePath = scanPathVos.get(i).getFileRealPath();
Image image = Image.getInstance(imagePath); Image image = Image.getInstance(imagePath);

@ -215,13 +215,13 @@
</div> </div>
<!--表格头--> <!--表格头-->
<input type="hidden" id="tableThNames" <input type="hidden" id="tableThNames"
value="病案号,ID号,住院次数,姓名,性别,年龄_岁,年龄_月,入院日期,出院日期,出院科室,联系地址,主诊ICD码,主诊名称,主诊转归,住院天数,主治医生,其他诊断,病理诊断,损伤中毒,是否有手术,病案备注,盘号"> value="盘号,病案号,ID号,住院次数,姓名,性别,年龄_岁,年龄_月,入院日期,出院日期,出院科室,联系地址,主诊ICD码,主诊名称,主诊转归,住院天数,主治医生,其他诊断,病理诊断,损伤中毒,是否有手术,病案备注">
<!--查询字段--> <!--查询字段-->
<input type="hidden" id="englishFields" <input type="hidden" id="englishFields"
value="commomtable.inpatient_no,commomtable.admiss_id,commomtable.admiss_times,commomtable.name,commomtable.sex,commomtable.age,commomtable.age_month,commomtable.admiss_date,commomtable.dis_date,commomtable.dis_dept,commomtable.home_addr,commomtable.main_diag_code,commomtable.main_diag_name,commomtable.main_dis_thing,commomtable.admiss_days,commomtable.attending,commomtable.other_diag_name,commomtable.pathology_name,commomtable.poisoning_name,commomtable.is_oper,memo,commomtable.file_source,commomtable.ph"> value="commomtable.inpatient_no,commomtable.admiss_id,commomtable.admiss_times,commomtable.name,commomtable.sex,commomtable.age,commomtable.age_month,commomtable.admiss_date,commomtable.dis_date,commomtable.dis_dept,commomtable.home_addr,commomtable.main_diag_code,commomtable.main_diag_name,commomtable.main_dis_thing,commomtable.admiss_days,commomtable.attending,commomtable.other_diag_name,commomtable.pathology_name,commomtable.poisoning_name,commomtable.is_oper,memo,commomtable.file_source,commomtable.ph">
<!--数据字段--> <!--数据字段-->
<input type="hidden" id="fields" <input type="hidden" id="fields"
value="inpatientNo,admissId,admissTimes,name,sex,age,ageMonth,admissDate,disDate,disDept,homeAddr,mainDiagCode,mainDiagName,mainDisThing,admissDays,attending,otherDiagName,pathologyName,poisoningName,isOper,memo,ph"> value="ph,inpatientNo,admissId,admissTimes,name,sex,age,ageMonth,admissDate,disDate,disDept,homeAddr,mainDiagCode,mainDiagName,mainDisThing,admissDays,attending,otherDiagName,pathologyName,poisoningName,isOper,memo">
<!--显示字段--> <!--显示字段-->
<input type="hidden" id="fieldCns"> <input type="hidden" id="fieldCns">
<!--查询总行数--> <!--查询总行数-->

@ -265,6 +265,6 @@
src="${path}/static/js/recordManage/commomSearch/showRecordIframeBloodCommom.js"></script> src="${path}/static/js/recordManage/commomSearch/showRecordIframeBloodCommom.js"></script>
<script type="text/javascript" src="${path}/static/js/commom.js"></script> <script type="text/javascript" src="${path}/static/js/commom.js"></script>
<script type="text/javascript" <script type="text/javascript"
src="${path}/static/js/pdfjs/web/viewer2.js"></script> src="${path}/static/pdfjs/web/viewer2.js"></script>
</body> </body>
</html> </html>

@ -48,6 +48,10 @@ var menu = {
$("#assortIds").val(scanPages); $("#assortIds").val(scanPages);
sources = sources.substring(0, sources.length - 1); sources = sources.substring(0, sources.length - 1);
$("#sources").val(sources); $("#sources").val(sources);
}else{
if(data[1] != undefined ){
scanPages = data[1].assortName;
}
} }
$.fn.zTree.init($("#ztree"), menu.setting, data); $.fn.zTree.init($("#ztree"), menu.setting, data);
zTree = $.fn.zTree.getZTreeObj("ztree"); zTree = $.fn.zTree.getZTreeObj("ztree");
@ -209,26 +213,26 @@ function selectPrintPic(patientId, rootPaths, scanPages, sources) {
} }
}) })
//查询进度定时器 //查询进度定时器
var interval1 = setInterval(function () { // var interval1 = setInterval(function () {
$.ajax({ // $.ajax({
type: 'get', // type: 'get',
url: path + "/commom/getPrintPicLoading", // url: path + "/commom/getPrintPicLoading",
data: {patientId: $("#patientId").val()}, // data: {patientId: $("#patientId").val()},
dataType: 'json', // dataType: 'json',
success: function (data) { // success: function (data) {
if (data.code == 0) { // if (data.code == 0) {
var value = data.data; // var value = data.data;
$("#loading").val(value + "%"); // $("#loading").val(value + "%");
if (value == 100) { // if (value == 100) {
//杀死进度定时器 // //杀死进度定时器
clearInterval(interval1); // clearInterval(interval1);
} // }
} else { // } else {
toastr.error(data.msg); // toastr.error(data.msg);
} // }
} // }
}) // })
}, 100000); // }, 100);
} }
function selectPrintPic2(patientId, scanPages, sources) { function selectPrintPic2(patientId, scanPages, sources) {

@ -338,7 +338,14 @@ function exportExcel() {
checks = checks.substring(0, checks.length - 1); checks = checks.substring(0, checks.length - 1);
var whereSql = ' WHERE ' + commomtable + '.patient_id IN (' + checks + ')'; var whereSql = ' WHERE ' + commomtable + '.patient_id IN (' + checks + ')';
var url = path + "/template/exportExcel"; var url = path + "/template/exportExcel";
post(url, {"selectSql": $("#englishFields").val(),"fromTableSql":$("#fromTableSql").val(),"whereSql":whereSql,"tableThNames": tableThNames,orderBys:$("#orderBys").val(), "fieldCns": fieldCns}); post(url, {
"selectSql": $("#englishFields").val(),
"fromTableSql": $("#fromTableSql").val(),
"whereSql": whereSql,
"tableThNames": tableThNames,
orderBys: $("#orderBys").val(),
"fieldCns": fieldCns
});
} else { } else {
Common.confirm({ Common.confirm({
title: "提示", title: "提示",
@ -346,7 +353,14 @@ function exportExcel() {
operate: function (reselt) { operate: function (reselt) {
if (reselt) { if (reselt) {
var url = path + "/template/exportExcel"; var url = path + "/template/exportExcel";
post(url, {"selectSql": $("#englishFields").val(),"fromTableSql":$("#fromTableSql").val(),"whereSql":$("#whereSql").val(),"orderBys":$("#orderBys").val(),"tableThNames": tableThNames, "fieldCns": fieldCns}); post(url, {
"selectSql": $("#englishFields").val(),
"fromTableSql": $("#fromTableSql").val(),
"whereSql": $("#whereSql").val(),
"orderBys": $("#orderBys").val(),
"tableThNames": tableThNames,
"fieldCns": fieldCns
});
} }
} }
}) })

@ -25,6 +25,7 @@
Print.prototype = { Print.prototype = {
init: function () { init: function () {
var content = this.getStyle() + this.getHtml(); var content = this.getStyle() + this.getHtml();
console.log("------------------------------32131232132132131------------------------------", this.getHtml())
this.writeIframe(content); this.writeIframe(content);
}, },
extend: function (obj, obj2) { extend: function (obj, obj2) {

@ -538,16 +538,17 @@ http://sourceforge.net/adobe/cmap/wiki/License/
$("#printLoading").show(); $("#printLoading").show();
} }
}) })
var getLoadingInterval = setInterval(function () { // var getLoadingInterval = setInterval(function () {
//获取打印预览图片加载进度 // //获取打印预览图片加载进度
var loading = parent.$("#loading").val(); // var loading = parent.$("#loading").val();
$(".progress-bar").css("width",loading); // console.log("获取打印预览图片加载进度",loading)
$("#printLoading p").text(loading); // $(".progress-bar").css("width",loading);
//加载完退出定时 // $("#printLoading p").text(loading);
if(loading == '100%'){ // //加载完退出定时
clearInterval(getLoadingInterval); // if(loading == '100%'){
} // clearInterval(getLoadingInterval);
},100); // }
// },100);
</script> </script>
</html> </html>

Loading…
Cancel
Save