查看pdf修改

master
ALW 3 years ago
parent 3d0ea8a568
commit 2bd840766e

@ -20,6 +20,7 @@ import com.emr.service.recordType.EmrTypeRelatedService;
import com.emr.service.recordType.EmrTypeService;
import com.emr.service.tScanAssort.T_Scan_AssortService;
import com.emr.util.ExceptionPrintUtil;
import com.emr.util.Jpg2PdfUtil;
import com.emr.util.img2PdfUtil;
import com.emr.vo.EmrPrintOrDownLoadInfo.EmrPrintOrDownLoadInfoVo;
import com.emr.vo.FontVo.ScanAssortVo;
@ -38,6 +39,7 @@ import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import java.net.InetAddress;
import java.net.UnknownHostException;
import java.text.SimpleDateFormat;
@ -63,6 +65,8 @@ public class CommomSearchController {
@Autowired
private CommomMapper commomMapper;
@Autowired
private Archive_DetailMapper archiveDetailMapper;
@Autowired
private EmrTypeRelatedService typeRelatedService;
@Autowired
private T_Scan_AssortService scanAssortService;
@ -434,6 +438,7 @@ public class CommomSearchController {
/**
* 访
*
* @param userName
* @param flag
* @param model
@ -557,6 +562,7 @@ public class CommomSearchController {
if (typeId != null) {
typeRelateds = typeRelatedService.selectAssortIdsByTypeId(typeId);
}
if (commomVos.size() > 0) {
//第一级:全部影像资料
CommomTree tree1 = new CommomTree();
Integer id = 1;
@ -645,6 +651,102 @@ public class CommomSearchController {
treeList.add(tree2);
}
}
}
List<Archive_Detail> archiveDetails = new ArrayList<>();
if (commomVos.size() == 0) {
List<CommomTree> archiveDetail = archiveDetailMapper.selectPdfPathByPatient2(patientId);
//第一级:全部影像资料
CommomTree tree1 = new CommomTree();
Integer id = 1;
tree1.setId(id);
tree1.setNewName("全部影像资料");
if (null != archiveDetail && !archiveDetail.isEmpty()) {
//去重,取出不重复的分类集合
Map<String, CommomTree> assortMap = new LinkedHashMap<>();
for (CommomTree commomVo1 : archiveDetail) {
assortMap.put(commomVo1.getAssortId(), commomVo1);
}
//判断分类是否全选,全选,父类跟着全选
if (null != typeRelateds && !typeRelateds.isEmpty()) {
boolean checkedFlag = true;
for (Map.Entry<String, CommomTree> map : assortMap.entrySet()) {
//定义是否存在
boolean flag = false;
for (Emr_Type_Related typeRelated : typeRelateds) {
if (typeRelated.getAssortId().equals(map.getKey())) {
flag = true;
break;
}
}
if (!flag) {
checkedFlag = false;
break;
}
}
if (checkedFlag) {
tree1.setChecked("true");
}
} else {
tree1.setChecked("true");
}
treeList.add(tree1);
int oneId = 0;
for (Map.Entry<String, CommomTree> map : assortMap.entrySet()) {
id++;
oneId = id;
String assortId = map.getValue().getAssortId();
CommomTree tree2 = new CommomTree();
tree2.setId(id);
tree2.setParentId(1);
tree2.setAssortId(map.getValue().getAssortId());
//判断选中
boolean checkFlag = false;
if (null != typeRelateds && !typeRelateds.isEmpty()) {
for (Emr_Type_Related typeRelated : typeRelateds) {
if (StringUtils.isNotBlank(assortId) && assortId.equals(typeRelated.getAssortId())) {
tree2.setChecked("true");
checkFlag = true;
break;
}
}
} else {
checkFlag = true;
tree2.setChecked("true");
}
//定义该类影像图片数量
int scanPathCount = 0;
//第二层 图片
int scanPathCountNum = 0;
for (CommomTree commomVo : archiveDetail) {
if (StringUtils.isNotBlank(assortId) && StringUtils.isNotBlank(commomVo.getAssortId()) &&
assortId.equals(commomVo.getAssortId())) {
id++;
CommomTree tree3 = new CommomTree();
tree3.setId(id);
tree3.setParentId(oneId);
tree3.setAssortId(assortId);
if (checkFlag) {
tree3.setChecked("true");
}
scanPathCount++;
//图片名称
String name = commomVo.getScanPage();
tree3.setAssortName(name);
//设置树图片节点的名称
tree3.setNewName(commomVo.getTitle());
tree3.setSource(commomVo.getSource());
//存储水印图片
treeList.add(tree3);
scanPathCountNum = commomVo.getPageCount();
}
}
tree2.setNewName(map.getValue().getAssortName() + "(" + scanPathCountNum + ")");
treeList.add(tree2);
}
}
}
return JSON.toJSONString(treeList);
} catch (Exception e) {
ExceptionPrintUtil.printException(e);
@ -673,6 +775,28 @@ public class CommomSearchController {
return ResultUtil.ok(outs);
}
@RequestMapping(value = "selectPrintPic2", method = RequestMethod.POST)
@ResponseBody
public ResultUtil selectPrintPic2(HttpServletResponse response, String patientId, String rootPaths, String names, String sources, HttpServletRequest request) throws Exception {
//生成加载进度mapKey
Power_User user = (Power_User) request.getSession().getAttribute("CURRENT_USER");
String mapKey = user.getUserName() + "_" + patientId;
List<String> outs = commomService.selectPrintPic2(response, patientId, names, sources, mapKey);
return ResultUtil.ok(outs);
}
// @RequestMapping("showPdf")
// public void showPdf(String patientId, HttpServletRequest request, HttpServletResponse response) {
// EmrPdfWaterSet emrPdfWaterSet = new EmrPdfWaterSet();
// Power_User user = (Power_User) request.getSession().getAttribute("CURRENT_USER");
// String mapKey = user.getUserName() + "_" + patientId;
// List<String> fileList = (List<String>) request.getSession().getAttribute(mapKey);
// String pdfWater = "儿童医院";
// Jpg2PdfUtil.mulFile2One(response, fileList, pdfWater);
// }
/**
*
*
@ -728,6 +852,8 @@ public class CommomSearchController {
@RequestMapping(value = "getRecordContentBlood")
@ResponseBody
public void getRecordContentBlood(String patientId, HttpServletRequest request, HttpServletResponse response) {
List<CommomTree> commomTrees = archiveDetailMapper.selectPdfPathByPatient2(patientId);
if (commomTrees.size() == 0) {
try {
Power_User user = (Power_User) request.getSession().getAttribute("CURRENT_USER");
String mapKey = user.getUserName() + "_" + patientId;
@ -752,10 +878,18 @@ public class CommomSearchController {
ExceptionPrintUtil.printException(e);
e.printStackTrace();
}
} else {
String pdfWater = "";
Power_User user = (Power_User) request.getSession().getAttribute("CURRENT_USER");
String mapKey = user.getUserName() + "_" + patientId;
List<String> filePaths = (List<String>) request.getSession().getAttribute(mapKey);
Jpg2PdfUtil.mulFile2One(response, filePaths, pdfWater);
}
}
/**
* 访
*
* @param patientId
* @param userName
* @param scanPages

@ -3,6 +3,7 @@ package com.emr.controller.templateSearch;
import com.alibaba.fastjson.JSON;
import com.emr.annotation.OptionalLog;
import com.emr.controller.FormTokenFlagUtil;
import com.emr.dao.Archive_DetailMapper;
import com.emr.dao.CommomMapper;
import com.emr.dao.EmrComomSetMapper;
import com.emr.dao.Emr_DictionaryMapper;
@ -27,6 +28,7 @@ import com.emr.service.emrPrintOrDownLoadInfo.PrintOrDownLoadInfoService;
import com.emr.service.templateSearch.TemplateSearchService;
import com.emr.util.*;
import com.emr.vo.Msg;
import com.emr.vo.commomSearch.CommomTree;
import com.emr.vo.commomSearch.CommomVo;
import com.emr.vo.commomSearch.ScanPathForPatientListVo;
import com.emr.vo.commomSearch.ScanPathVo;
@ -98,6 +100,8 @@ public class TemplateSearchController {
private EmrComomSetMapper emrComomSetMapper;
@Autowired
private CommomService commomService;
@Autowired
private Archive_DetailMapper archiveDetailMapper;
/**
* @MethodName templateList
@ -1323,6 +1327,19 @@ public class TemplateSearchController {
emrPdfWaterSet.setIsImg(emrPdfWaterSet.getDownloadIsImg());
EmrPdfWaterSet emrPdfWaterSet1 = commomService.getEmrPdfWaterSet(emrPdfWaterSet);
img2PdfUtil.imageToPdf(response, filePaths, pdfName, emrPdfWaterSet,emrPdfWaterSet1);
}else {
String fileRealPath=null;
List<CommomTree> commomTrees = archiveDetailMapper.selectPdfPathByPatient3(patientIds, assortIds);
List<String> filePaths = new ArrayList();
for (int i = 0; i < commomTrees.size(); ++i) {
fileRealPath = commomTrees.get(i).getPDFPATH();
if (StringUtils.isNoneBlank(new CharSequence[]{fileRealPath})) {
filePaths.add(fileRealPath);
}
}
SimpleDateFormat fmt = new SimpleDateFormat("yyyyMMdd");
String filename=fmt.format(new Date());
Jpg2PdfUtil.mulFile2One3(response,filePaths,filename);
}
} catch (Exception e) {
ExceptionPrintUtil.printException(e);

@ -1,6 +1,7 @@
package com.emr.dao;
import com.emr.entity.Archive_Detail;
import com.emr.vo.commomSearch.CommomTree;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@ -12,5 +13,10 @@ public interface Archive_DetailMapper {
List<Archive_Detail> selectPdfPathByPatient(@Param("patientId")String patientId,@Param("assortIds")String assortIds);
List<CommomTree> selectPdfPathByPatient2(@Param("patientId")String patientId);
List<CommomTree> selectPdfPathByPatient3(@Param("patientIds")String patientIds,@Param("assortIds")String assortIds);
List<Archive_Detail> selectPdfCountByMasterId(@Param("patientId")String patientId);
}

@ -19,8 +19,19 @@ public class Archive_Detail {
private String flag;
private String sys;
public String getAssortName() {
return assortName;
}
public void setAssortName(String assortName) {
this.assortName = assortName;
}
private String assortName;
public String getId() {
return id;
}

@ -227,7 +227,8 @@ public class CommomService {
if ("1".equals(sourceArr[i])) {
srcStr = root1 + File.separator + scanPageArr[i];
} else {
srcStr = root2 + File.separator + scanPageArr[i];
// srcStr = root2 + File.separator + scanPageArr[i];
srcStr = scanPageArr[i];
}
}
src.add(srcStr);
@ -639,6 +640,62 @@ public class CommomService {
return outs;
}
public List<String> selectPrintPic2(HttpServletResponse response, String patientId,String names, String sources, String mapKey) {
List<String> outs = new LinkedList<>();
if (StringUtils.isNotBlank(names)) {
String[] nameList = names.split(",");
// String[] sourceList = sources.split(",");
//获取水印设置
EmrPdfWaterSet emrPdfWaterSet = pdfWaterSetMapper.selectByPrimaryKey(1);
//获取是否打印文本水印
Short printEffective = emrPdfWaterSet.getPrintEffective();
//获取是否打印图片水印
Short printIsImg = emrPdfWaterSet.getPrintIsImg();
for (int i = 0; i < nameList.length; i++) {
//定义图片根目录地址
String rootPath = "";
//组织原图片地址
//原图片地址
String srcPath = nameList[i];
//定义输出地址
String outSrc = "";
//获取项目上下文地址
//不需要水印
String root = "";
String picPath = "";
//判断是否是tif图片
boolean tifFileFlag = checkTifFile(srcPath);
if(tifFileFlag){
String picSrc = WATERPICPATH + patientId + File.separator ;
//目录不存在则创建
if (!new File(picSrc).isDirectory()) {
new File(picSrc).mkdirs();
}
//组织加水印后图片存放地址
picPath = picSrc + nameList[i];
//转换图片输出
//tifToJpg(srcPath,picPath);
outSrc = EMRRECORDJSP + File.separator + "reload" + File.separator + patientId + File.separator + nameList[i];
}else{
//将原图片地址转换成映射地址
//获取盘符并转换映射地址的头部地址
root = selectRootByNotWater(srcPath);
//获取盘符后面的地址
String str1 = srcPath.substring(0, srcPath.indexOf(File.separator));
picPath = srcPath.substring(str1.length() + 1, srcPath.length());
outSrc = EMRRECORDJSP + File.separator + root + picPath;
outs.add(outSrc);
}
Integer value = Math.round((i + 1) * 100 / nameList.length);
printLoadingMap.put(mapKey, value);
}
}
return outs;
}
/**
* tif
* @param srcPath

@ -5,6 +5,7 @@ import com.lowagie.text.Font;
import com.lowagie.text.Image;
import com.lowagie.text.pdf.*;
import com.lowagie.text.pdf.codec.TiffImage;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@ -14,6 +15,7 @@ import java.io.*;
import java.net.URL;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Iterator;
import java.util.List;
/**
@ -129,6 +131,287 @@ public class Jpg2PdfUtil {
writer.close();
}
}
public static boolean check(String file) {
PdfReader pdfReader = null;
try {
File f = new File(file);
if(f.isFile()){
pdfReader = new PdfReader(file);
if (pdfReader.getNumberOfPages() != 0) {
return true;
}
}
} catch (Exception e) {
}finally {
if(null != pdfReader){
pdfReader.close();
}
}
return false;
}
public static void mulFile2One(HttpServletResponse response,List<String> filePaths,String waterMarkName) {
SimpleDateFormat fmt = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
//遍历删除,除去损坏,文件不存在,抛异常就是空白页
Iterator<String> iterator = filePaths.iterator();
while (iterator.hasNext()) {
String fileStr = iterator.next();
File file = new File(fileStr);
if(file.isFile()){
boolean flag = check(fileStr);
if(!flag){
iterator.remove();
System.out.println(fmt.format(new Date())+":"+file+"文件损坏");
}
}else{
iterator.remove();
System.out.println(fmt.format(new Date())+":"+file+"文件不存在");
}
}
if(!filePaths.isEmpty()){
// pdf合并工具类
Document document = null;
PdfCopy copy = null;
try {
document = new Document(new PdfReader(filePaths.get(0)).getPageSize(1));
copy = new PdfCopy(document,response.getOutputStream());
document.open();
for (String file : filePaths) {
PdfReader reader = new PdfReader(file);
ByteArrayOutputStream bos = new ByteArrayOutputStream();
PdfReader pdfReader = null;
//判断是否加水印
if (StringUtils.isNotBlank(waterMarkName)) {
setWatermark(bos, reader, waterMarkName, null);
pdfReader = new PdfReader(bos.toByteArray());
}
int n = reader.getNumberOfPages();
for (int j = 1; j <= n; j++) {
document.newPage();
PdfImportedPage page = null;
if (StringUtils.isNotBlank(waterMarkName)) {
page = copy.getImportedPage(pdfReader, j);
} else {
page = copy.getImportedPage(reader, j);
}
copy.addPage(page);
}
if(null != pdfReader){
pdfReader.close();
}
reader.close();
try {
bos.flush();
bos.close();
}catch (Exception e){
//e.printStackTrace();
}
}
}catch (Exception e){
//e.printStackTrace();
}finally {
if(null != document){
document.close();
}
}
}
}
public static void setWatermark(ByteArrayOutputStream bos, PdfReader reader, String waterMarkName, String imgPath){
PdfStamper stamper = null;
try {
stamper = new PdfStamper(reader, bos);
int total = reader.getNumberOfPages() + 1;
PdfContentByte content;
BaseFont base = BaseFont.createFont("STSong-Light", "UniGB-UCS2-H", BaseFont.EMBEDDED);
PdfGState gs = new PdfGState();
for (int i = 1; i < total; i++) {
content = stamper.getOverContent(i);// 在内容上方加水印
//加文字水印
if(StringUtils.isNotBlank(waterMarkName)) {
gs.setFillOpacity(0.3f);
gs.setStrokeOpacity(0.3f);
content.setGState(gs);
content.beginText();
content.setColorFill(Color.LIGHT_GRAY);
content.setFontAndSize(base, 50);
content.setTextMatrix(70, 200);
String[] waterMarks = waterMarkName.split("&");
//v:距左 v1:距下 v2:
content.showTextAligned(Element.ALIGN_CENTER, waterMarks[0], 250, 600, 40);
/*content.showTextAligned(Element.ALIGN_CENTER, waterMarks[0], 250, 200, 40);
content.showTextAligned(Element.ALIGN_CENTER, waterMarks[0], 800, 600, 40);
content.showTextAligned(Element.ALIGN_CENTER, waterMarks[0], 800, 200, 40);
content.showTextAligned(Element.ALIGN_CENTER, waterMarks[0], 250, 1100, 40);
content.showTextAligned(Element.ALIGN_CENTER, waterMarks[0], 250, 1500, 40);
content.showTextAligned(Element.ALIGN_CENTER, waterMarks[0], 800, 1100, 40);
content.showTextAligned(Element.ALIGN_CENTER, waterMarks[0], 800, 1500, 40);*/
if(waterMarks.length > 1){
//v:距左 v1:距下 v2:
content.showTextAligned(Element.ALIGN_CENTER, waterMarks[1], 310, 400, 40);
/* content.showTextAligned(Element.ALIGN_CENTER, waterMarks[1], 310, 150, 40);*/
/*content.showTextAligned(Element.ALIGN_CENTER, waterMarks[1], 860, 550, 40);
content.showTextAligned(Element.ALIGN_CENTER, waterMarks[1], 860, 150, 40);*/
/* content.showTextAligned(Element.ALIGN_CENTER, waterMarks[1], 300, 900, 40);
content.showTextAligned(Element.ALIGN_CENTER, waterMarks[1], 300, 1300, 40);
content.showTextAligned(Element.ALIGN_CENTER, waterMarks[1], 800, 900, 40);
content.showTextAligned(Element.ALIGN_CENTER, waterMarks[1], 800, 1300, 40);*/
}
content.endText();
}
if(StringUtils.isNotBlank(imgPath)){
Image image = Image.getInstance(imgPath);
image.setAbsolutePosition(200, 206); // set the first background
image.scaleToFit(200, 200);
content.addImage(image);
}
content.setColorFill(Color.BLACK);
content.setFontAndSize(base, 8);
}
} catch (IOException | DocumentException e) {
e.printStackTrace();
} finally {
try {
assert stamper != null;
stamper.close();
} catch (DocumentException | IOException e) {
e.printStackTrace();
}
}
}
public static void mulFile2One3(HttpServletResponse response,List<String> filePaths,String filename) {
String waterMarkName="";
SimpleDateFormat fmt = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
//遍历删除,除去损坏,文件不存在,抛异常就是空白页
Iterator<String> iterator = filePaths.iterator();
while (iterator.hasNext()) {
String fileStr = iterator.next();
File file = new File(fileStr);
if(file.isFile()){
boolean flag = check(fileStr);
if(!flag){
iterator.remove();
System.out.println(fmt.format(new Date())+":"+file+"文件损坏");
}
}else{
iterator.remove();
System.out.println(fmt.format(new Date())+":"+file+"文件不存在");
}
}
if(!filePaths.isEmpty()){
// pdf合并工具类
Document document = null;
PdfCopy copy = null;
try {
response.reset();
response.setCharacterEncoding("utf-8");
response.setContentType("application/pdf");
response.setHeader("Content-Disposition", "attachment; filename=" + filename + ".pdf");
document = new Document(new PdfReader(filePaths.get(0)).getPageSize(1));
copy = new PdfCopy(document,response.getOutputStream());
document.open();
for (String file : filePaths) {
PdfReader reader = new PdfReader(file);
ByteArrayOutputStream bos = new ByteArrayOutputStream();
PdfReader pdfReader = null;
//判断是否加水印
if (StringUtils.isNotBlank(waterMarkName)) {
setWatermark(bos, reader, waterMarkName, null);
pdfReader = new PdfReader(bos.toByteArray());
}
int n = reader.getNumberOfPages();
for (int j = 1; j <= n; j++) {
document.newPage();
PdfImportedPage page = null;
if (StringUtils.isNotBlank(waterMarkName)) {
page = copy.getImportedPage(pdfReader, j);
} else {
page = copy.getImportedPage(reader, j);
}
copy.addPage(page);
}
if(null != pdfReader){
pdfReader.close();
}
reader.close();
try {
bos.flush();
bos.close();
}catch (Exception e){
//e.printStackTrace();
}
}
}catch (Exception e){
//e.printStackTrace();
}finally {
if(null != document){
document.close();
}
}
}
}
public static void mulFile2One2(HttpServletResponse response,List<String> filePaths) {
SimpleDateFormat fmt = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
//遍历删除,除去损坏,文件不存在,抛异常就是空白页
Iterator<String> iterator = filePaths.iterator();
while (iterator.hasNext()) {
String fileStr = iterator.next();
File file = new File(fileStr);
if(file.isFile()){
boolean flag = check(fileStr);
if(!flag){
iterator.remove();
System.out.println(fmt.format(new Date())+":"+file+"文件损坏");
}
}else{
iterator.remove();
System.out.println(fmt.format(new Date())+":"+file+"文件不存在");
}
}
if(!filePaths.isEmpty()){
// pdf合并工具类
Document document = null;
PdfCopy copy = null;
try {
response.reset();
response.setCharacterEncoding("utf-8");
response.setContentType("application/pdf");
response.setHeader("Content-Disposition", "attachment; "+"pdf");
document = new Document(new PdfReader(filePaths.get(0)).getPageSize(1));
copy = new PdfCopy(document,response.getOutputStream());
document.open();
for (String file : filePaths) {
PdfReader reader = new PdfReader(file);
ByteArrayOutputStream bos = new ByteArrayOutputStream();
PdfReader pdfReader = null;
int n = reader.getNumberOfPages();
if(null != pdfReader){
pdfReader.close();
}
reader.close();
try {
bos.flush();
bos.close();
}catch (Exception e){
//e.printStackTrace();
}
}
}catch (Exception e){
//e.printStackTrace();
}finally {
if(null != document){
document.close();
}
}
}
}
/**
* h>whw>hw=h

@ -3,8 +3,29 @@ package com.emr.vo.commomSearch;
public class CommomTree {
private Integer id;
private String title;
private Integer parentId;
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
private Integer PageCount;
public Integer getPageCount() {
return PageCount;
}
public void setPageCount(Integer pageCount) {
PageCount = pageCount;
}
private String patientId;
private String assortId;
@ -21,6 +42,16 @@ public class CommomTree {
private String source;
private String PDFPATH;
public String getPDFPATH() {
return PDFPATH;
}
public void setPDFPATH(String PDFPATH) {
this.PDFPATH = PDFPATH;
}
public String getSource() {
return source;
}

@ -12,6 +12,8 @@
<result column="Title" property="title" jdbcType="NVARCHAR" />
<result column="flag" property="flag" jdbcType="NVARCHAR" />
<result column="Sys" property="sys" jdbcType="NVARCHAR" />
<result column="assort_name" property="assortName" jdbcType="NVARCHAR" />
</resultMap>
<insert id="insert" parameterType="com.emr.entity.Archive_Detail" >
insert into archive_detail (id, PDF_PATH, MasterID,
@ -103,6 +105,7 @@
AssortID in (${assortIds})
ORDER BY zd_assort.assort_sort,UpLoadDateTime
</select>
<!--查询pdf路径逗号拼接-->
<select id="selectPdfCountByMasterId" resultMap="BaseResultMap">
select AssortID,
@ -112,4 +115,39 @@
from archive_detail c where c.MasterID = #{patientId}
group by c.AssortID
</select>
<select id="selectPdfPathByPatient2" resultType="com.emr.vo.commomSearch.CommomTree"
parameterType="java.lang.String">
SELECT
archive_detail.PDF_PATH,
archive_detail.MasterID as patient_id,
archive_detail.AssortID as assort_id,
zd_assort.assort_name,
archive_detail.PDF_PATH as scan_page,
archive_detail.Source as source,
archive_detail.PageCount,
archive_detail.Title as title
FROM
archive_detail
LEFT JOIN zd_assort
ON archive_detail.AssortID = zd_assort.assort_id
WHERE
MasterID = #{patientId} and flag != 1
ORDER BY zd_assort.assort_sort,UpLoadDateTime
</select>
<select id="selectPdfPathByPatient3" resultType="com.emr.vo.commomSearch.CommomTree">
SELECT
archive_detail.PDF_PATH,
archive_detail.MasterID as patient_id,
archive_detail.AssortID as assort_id,
zd_assort.assort_name,
archive_detail.PDF_PATH as scan_page,
archive_detail.Source as source
FROM
archive_detail
LEFT JOIN zd_assort
ON archive_detail.AssortID = zd_assort.assort_id
WHERE
MasterID = #{patientIds}
ORDER BY zd_assort.assort_sort,UpLoadDateTime
</select>
</mapper>

@ -58,7 +58,7 @@
ON
dbo.zd_assort.assort_id = dbo.t_scan_assort.assort_id
<where>
dbo.commomtable.patient_id in (${patientIds})
dbo.commomtable.patient_id =#{patientIds}
AND t_scan_assort.is_del != 1
<if test="assortIds != null">
AND dbo.t_scan_assort.scan_page in (${assortIds})

@ -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">
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,fileSource">
value="inpatientNo,admissId,admissTimes,name,sex,age,ageMonth,admissDate,disDate,disDept,homeAddr,mainDiagCode,mainDiagName,mainDisThing,admissDays,attending,otherDiagName,pathologyName,poisoningName,isOper,memo,ph">
<!--显示字段-->
<input type="hidden" id="fieldCns">
<!--查询总行数-->

File diff suppressed because one or more lines are too long

@ -137,15 +137,16 @@ function onloadPdf(scanPages, sources) {
success: function (data) {
if (data.code == 0) {
var str = path + "/commom/getRecordContentBlood?patientId=" + patientId;
$("#iframe1").attr("src", path + "/static/pdfjs/web/viewer1.html?file=" + encodeURIComponent(str));
$("#iframe1").attr("src", path + "/static/pdfjs/web/viewer.html?file=" + encodeURIComponent(str))
var rootPaths = parent.$("#rootPaths").val();
//加载的图片
var print = $("#print").val();
if (rootPaths!=",") {
if (scanPages != '' && print == 1) {
selectPrintPic(patientId, rootPaths, scanPages, sources);
}
}
}
}
})
}
/*function onloadPdf(scanPages, sources) {
@ -181,6 +182,62 @@ function selectPrintPic(patientId, rootPaths, scanPages, sources) {
sources: sources
},
datType: 'json',
success: function (data) {
if (data.code == 0) {
var resultList = data.data;
if (null != resultList) {
var img = '';
for (var i = 0; i < resultList.length; i++) {
img += "<img src='" + resultList[i] + "' width='850' height='1190'>";
}
var interval = setInterval(function () {
if ($("#iframeLoad").val() == 1) {
// iframe.contentDocument.getElementById("printContainer1").innerHTML = img;
$("#printPicLoaded").val(1);
// iframe.contentDocument.getElementById("printLoading").style.display = 'none';
// iframe.contentDocument.getElementById("print").style.display = 'block';
clearInterval(interval);
}
}, 200);
}
} else {
toastr.error(data.msg);
}
}
})
//查询进度定时器
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) {
$.ajax({
type: 'post',
url: path + "/commom/selectPrintPic2",
data: {
patientId: patientId,
names: scanPages,
sources: sources
},
datType: 'json',
success: function (data) {
if (data.code == 0) {
var resultList = data.data;
@ -257,7 +314,7 @@ function onloadJpgForPdf() {
message: "确认将左侧树选中的图片下载pdf?",
operate: function (reselt) {
if (reselt) {
var patientId = "'" + $("#patientId").val() + "'";
var patientId = $("#patientId").val();
var assortIds = $("#assortIds").val();
var flag = parent.$("#flag").val();
post(path + '/template/downloadPdfBlood', {

@ -33,13 +33,13 @@ http://sourceforge.net/adobe/cmap/wiki/License/
<!-- This snippet is used in production (included from viewer.html) -->
<link rel="resource" type="application/l10n" href="locale/locale.properties"/>
<link rel="shortcut icon" href="/emr_medical_record/favicon.ico">
<link rel="shortcut icon" href="../../js/favicon.ico">
<script type="text/javascript" src="../../js/jquery-3.3.1.js"></script>
<script type="text/javascript" src="../../bootstrap-3.3.7/bower_components/bootstrap/dist/js/bootstrap.min.js"></script>
<script src="l10n.js"></script>
<script src="../build/pdf.js"></script>
<script src="../build/pdf.js?time=2020-08-21"></script>
<script src="debugger.js"></script>
<script src="viewer.js"></script>
<script src="viewer.js?time=2020-08-27"></script>
<style>
.loading {
@ -224,15 +224,20 @@ http://sourceforge.net/adobe/cmap/wiki/License/
<span data-l10n-id="presentation_mode_label">Presentation Mode</span>
</button>
<button id="print" class="toolbarButton print hiddenMediumView" title="Print" tabindex="33" data-l10n-id="print">
<span data-l10n-id="print_label">Print</span>
</button>
<!--<button id="openFile" class="toolbarButton openFile hiddenLargeView" title="Open File" tabindex="32" data-l10n-id="open_file">
<span data-l10n-id="open_file_label">Open</span>
</button>-->
<!--<button id="print" class="toolbarButton print hiddenMediumView" title="Print" tabindex="33" data-l10n-id="print">
<span data-l10n-id="print_label">Print</span>
</button>
<button id="download" class="toolbarButton download hiddenMediumView" title="Download" tabindex="34" data-l10n-id="download">
<!--<button id="download" class="toolbarButton download hiddenMediumView" title="Download" tabindex="34" data-l10n-id="download">
<span data-l10n-id="download_label">Download</span>
</button>-->
<!-- <a href="#" id="viewBookmark" class="toolbarButton bookmark hiddenSmallView" title="Current view (copy or open in new window)" tabindex="35" data-l10n-id="bookmark">
@ -258,14 +263,14 @@ http://sourceforge.net/adobe/cmap/wiki/License/
</div>
<span id="scaleSelectContainer" class="dropdownToolbarButton">
<select id="scaleSelect" title="Zoom" tabindex="23" data-l10n-id="zoom">
<option id="pageAutoOption" title="" value="auto" selected="selected" data-l10n-id="page_scale_auto">Automatic Zoom</option>
<option id="pageAutoOption" title="" value="auto" data-l10n-id="page_scale_auto">Automatic Zoom</option>
<option id="pageActualOption" title="" value="page-actual" data-l10n-id="page_scale_actual">Actual Size</option>
<option id="pageFitOption" title="" value="page-fit" data-l10n-id="page_scale_fit">Fit Page</option>
<option id="pageWidthOption" title="" value="page-width" data-l10n-id="page_scale_width">Full Width</option>
<option id="customScaleOption" title="" value="custom"></option>
<option title="" value="0.5" data-l10n-id="page_scale_percent" data-l10n-args='{ "scale": 50 }'>50%</option>
<option title="" value="0.75" data-l10n-id="page_scale_percent" data-l10n-args='{ "scale": 75 }'>75%</option>
<option title="" value="1" data-l10n-id="page_scale_percent" data-l10n-args='{ "scale": 100 }'>100%</option>
<option title="" value="1" data-l10n-id="page_scale_percent" data-l10n-args='{ "scale": 100 }' selected="selected">100%</option>
<option title="" value="1.25" data-l10n-id="page_scale_percent" data-l10n-args='{ "scale": 125 }'>125%</option>
<option title="" value="1.5" data-l10n-id="page_scale_percent" data-l10n-args='{ "scale": 150 }'>150%</option>
<option title="" value="2" data-l10n-id="page_scale_percent" data-l10n-args='{ "scale": 200 }'>200%</option>

@ -46,7 +46,7 @@ var mozL10n = document.mozL10n || document.webL10n;
var CSS_UNITS = 96.0 / 72.0;
var DEFAULT_SCALE = 'auto';
var DEFAULT_SCALE = '1';
var UNKNOWN_SCALE = 0;
var MAX_AUTO_SCALE = 1.25;
var SCROLLBAR_PADDING = 40;
@ -682,7 +682,7 @@ Preferences._readFromStorage = function (prefObj) {
// Also intercept Cmd/Ctrl + Shift + P in Chrome and Opera
if (event.keyCode === 80/*P*/ && (event.ctrlKey || event.metaKey) &&
!event.altKey && (!event.shiftKey || window.chrome || window.opera)) {
//window.print();
window.print();
if (hasAttachEvent) {
// Only attachEvent can cancel Ctrl + P dialog in IE <=10
// attachEvent is gone in IE11, so the dialog will re-appear in IE11.
@ -7073,11 +7073,11 @@ function webViewerInitialized() {
/**document.getElementById('openFile').addEventListener('click',
SecondaryToolbar.openFileClick.bind(SecondaryToolbar));*/
/*document.getElementById('print').addEventListener('click',
document.getElementById('print').addEventListener('click',
SecondaryToolbar.printClick.bind(SecondaryToolbar));
document.getElementById('download').addEventListener('click',
SecondaryToolbar.downloadClick.bind(SecondaryToolbar));*/
// document.getElementById('download').addEventListener('click',
// SecondaryToolbar.downloadClick.bind(SecondaryToolbar));
if (file && file.lastIndexOf('file:', 0) === 0) {

Loading…
Cancel
Save