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)
@ResponseBody
public void downloadBloodZip(HttpServletResponse response, String patientIds, String flag) {
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)){
Set<ScanPathForPatientListVo> list = new LinkedHashSet<>();
Set<String> patientIdSet = new LinkedHashSet<>();
//批量添加下载记录
printOrDownLoadInfoService.SimpleInsert(scanPathVos, null, Short.valueOf("2"));
for (ScanPathVo scanPathVo : scanPathVos) {
patientIdSet.add(scanPathVo.getPatientId());
}
for (String patinetId : patientIdSet) {
ScanPathForPatientListVo vo = new ScanPathForPatientListVo();
List<String> filePaths = new ArrayList<>();
for (ScanPathVo scanPathVo : scanPathVos) {
if (scanPathVo.getPatientId().equals(patinetId)) {
vo.setName(scanPathVo.getName());
vo.setInpatientNo(scanPathVo.getInpatientNo());
String disDate = scanPathVo.getDisDate();
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
vo.setDisDate(sdf.parse(disDate));
String fileRealPath = scanPathVo.getFileRealPath();
if (StringUtils.isNoneBlank(fileRealPath) && new File(fileRealPath).exists()) {
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();
if (!filePaths.isEmpty()) {
vo.setScanPathList(filePaths);
list.add(vo);
}
}
String zipName = "档案pdf压缩包";
downloadPdfZip(response, zipName, list);
}
} catch (Exception e) {
ExceptionPrintUtil.printException(e);
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) {
@ -1277,7 +1319,7 @@ public class TemplateSearchController {
response.setContentType("application/vnd.ms-excel;charset=UTF-8");
ZipOutputStream zos = null;
BufferedOutputStream bos = null;
ByteArrayOutputStream out = new ByteArrayOutputStream();
ByteArrayOutputStream out = null;
BufferedInputStream bis = null;
try {
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());
zos.putNextEntry(new ZipEntry(fileName + ".pdf"));
//合成pdf
out = new ByteArrayOutputStream();
img2PdfUtil.imageToPdfToBuffOut(out, scanPathList, emrPdfWaterSet);
byte[] file = out.toByteArray(); //这个zip文件的字节
bis = new BufferedInputStream(new ByteArrayInputStream(file));
//输出
int len = 0;
byte[] buf = new byte[10 * 1024];
byte[] buf = new byte[1024 * 1024];
while ((len = bis.read(buf, 0, buf.length)) != -1) {
bos.write(buf, 0, len);
}

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

@ -215,13 +215,13 @@
</div>
<!--表格头-->
<input type="hidden" id="tableThNames"
value="病案号,ID号,住院次数,姓名,性别,年龄_岁,年龄_月,入院日期,出院日期,出院科室,联系地址,主诊ICD码,主诊名称,主诊转归,住院天数,主治医生,其他诊断,病理诊断,损伤中毒,是否有手术,病案备注,盘号">
value="盘号,病案号,ID号,住院次数,姓名,性别,年龄_岁,年龄_月,入院日期,出院日期,出院科室,联系地址,主诊ICD码,主诊名称,主诊转归,住院天数,主治医生,其他诊断,病理诊断,损伤中毒,是否有手术,病案备注">
<!--查询字段-->
<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">
<!--数据字段-->
<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">
<!--查询总行数-->

@ -265,6 +265,6 @@
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/pdfjs/web/viewer2.js"></script>
src="${path}/static/pdfjs/web/viewer2.js"></script>
</body>
</html>

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

@ -338,7 +338,14 @@ function exportExcel() {
checks = checks.substring(0, checks.length - 1);
var whereSql = ' WHERE ' + commomtable + '.patient_id IN (' + checks + ')';
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 {
Common.confirm({
title: "提示",
@ -346,7 +353,14 @@ function exportExcel() {
operate: function (reselt) {
if (reselt) {
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 = {
init: function () {
var content = this.getStyle() + this.getHtml();
console.log("------------------------------32131232132132131------------------------------", this.getHtml())
this.writeIframe(content);
},
extend: function (obj, obj2) {

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

Loading…
Cancel
Save