|
|
|
|
@ -7,21 +7,19 @@ import com.emr.dao.emrPdfWaterSet.EmrPdfWaterSetMapper;
|
|
|
|
|
import com.emr.entity.EmrComomSet;
|
|
|
|
|
import com.emr.entity.Power_User;
|
|
|
|
|
import com.emr.entity.ResultUtil;
|
|
|
|
|
import com.emr.entity.approve.Emr_Apply_Approve;
|
|
|
|
|
import com.emr.entity.emrPdfWaterSet.EmrPdfWaterSet;
|
|
|
|
|
import com.emr.entity.tScanAssort.T_Scan_Assort;
|
|
|
|
|
import com.emr.service.tScanAssort.T_Scan_AssortService;
|
|
|
|
|
import com.emr.util.DateUtils;
|
|
|
|
|
import com.emr.util.img2PdfUtil;
|
|
|
|
|
import com.emr.vo.User;
|
|
|
|
|
import com.emr.vo.commomSearch.CommomVo;
|
|
|
|
|
import com.sun.media.jai.codec.*;
|
|
|
|
|
import org.apache.commons.io.FilenameUtils;
|
|
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
|
|
import org.apache.http.client.methods.CloseableHttpResponse;
|
|
|
|
|
import org.apache.http.client.methods.HttpGet;
|
|
|
|
|
import org.apache.http.impl.client.HttpClients;
|
|
|
|
|
import org.apache.http.util.EntityUtils;
|
|
|
|
|
import org.springframework.beans.BeanUtils;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
@ -29,6 +27,8 @@ import org.springframework.util.CollectionUtils;
|
|
|
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import javax.media.jai.JAI;
|
|
|
|
|
import javax.media.jai.RenderedOp;
|
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
|
|
import java.io.*;
|
|
|
|
|
@ -469,7 +469,14 @@ public class CommomService {
|
|
|
|
|
if (!new File(waterPicRoot).isDirectory()) {
|
|
|
|
|
new File(waterPicRoot).mkdirs();
|
|
|
|
|
}
|
|
|
|
|
if (srcPath.substring(srcPath.length() - 3).equals("tif")) {
|
|
|
|
|
//组织加水印后图片存放地址
|
|
|
|
|
String waterPicPath = waterPicRoot + nameList[i];
|
|
|
|
|
if (!new File(waterPicPath).exists()) {
|
|
|
|
|
img2PdfUtil.addWatermarkPic1(new File(srcPath), emrPdfWaterSet, waterPicPath);
|
|
|
|
|
//组织输出地址
|
|
|
|
|
}
|
|
|
|
|
outSrc = EMRRECORDJSP + "\\reload\\" + patientId + "\\" + sourceList[i] + "\\" + nameList[i];
|
|
|
|
|
/*if (srcPath.substring(srcPath.length() - 3).equals("tif")) {
|
|
|
|
|
//需要水印
|
|
|
|
|
//组织加水印后图片存放目录
|
|
|
|
|
String waterJpgRoot = WATERTIFTOJPGPATH + patientId + "\\" + sourceList[i] + "\\";
|
|
|
|
|
@ -481,7 +488,7 @@ public class CommomService {
|
|
|
|
|
String filePathPrefix = waterJpgRoot + nameList[i];
|
|
|
|
|
String tifToJpgRoot = filePathPrefix.substring(0, filePathPrefix.lastIndexOf("."))+ ".jpg" ;
|
|
|
|
|
if (!new File(tifToJpgRoot).exists()) {
|
|
|
|
|
//tifToJpg(srcPath, tifToJpgRoot);
|
|
|
|
|
tifToJpg(srcPath, tifToJpgRoot);
|
|
|
|
|
//加水印存放的地址
|
|
|
|
|
String waterPicPath = waterPicRoot + nameList[i].substring(0, nameList[i].lastIndexOf("."))+ ".jpg";
|
|
|
|
|
img2PdfUtil.addWatermarkPic1(new File(tifToJpgRoot), emrPdfWaterSet, waterPicPath);
|
|
|
|
|
@ -495,7 +502,7 @@ public class CommomService {
|
|
|
|
|
//组织输出地址
|
|
|
|
|
}
|
|
|
|
|
outSrc = EMRRECORDJSP + "\\reload\\" + patientId + "\\" + sourceList[i] + "\\" + nameList[i];
|
|
|
|
|
}
|
|
|
|
|
}*/
|
|
|
|
|
} else {
|
|
|
|
|
//不需要水印
|
|
|
|
|
//将原图片地址转换成映射地址
|
|
|
|
|
@ -514,7 +521,7 @@ public class CommomService {
|
|
|
|
|
return outs;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*private static String tifToJpg(String tifUrl, String tifToJpgRoot) {
|
|
|
|
|
private static String tifToJpg(String tifUrl, String tifToJpgRoot) {
|
|
|
|
|
File fileTiff = new File(tifToJpgRoot);
|
|
|
|
|
if (fileTiff.exists()) {
|
|
|
|
|
return tifToJpgRoot;
|
|
|
|
|
@ -535,7 +542,7 @@ public class CommomService {
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
}
|
|
|
|
|
return tifToJpgRoot;
|
|
|
|
|
}*/
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|