|
|
|
|
@ -610,7 +610,7 @@ public class CommomService {
|
|
|
|
|
* @param sources
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
public List<String> selectPrintPic(HttpServletResponse response, String patientId, String rootPaths, String names, String sources, String mapKey) {
|
|
|
|
|
public List<String> selectPrintPic(HttpServletResponse response, String patientId, String rootPaths, String names, String sources, String mapKey) throws IOException {
|
|
|
|
|
//获取登录用户信息
|
|
|
|
|
HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
|
|
|
|
|
// 从session获取用户名
|
|
|
|
|
@ -662,10 +662,12 @@ public class CommomService {
|
|
|
|
|
//需要水印
|
|
|
|
|
//组织加水印后图片存放目录
|
|
|
|
|
String waterPicRoot = WATERPICPATH + patientId + File.separator + sourceList[i] + File.separator;//D:/jiashi/reload/patientId/1/
|
|
|
|
|
|
|
|
|
|
//目录不存在则创建
|
|
|
|
|
if (!new File(waterPicRoot).isDirectory()) {
|
|
|
|
|
new File(waterPicRoot).mkdirs();
|
|
|
|
|
}else{
|
|
|
|
|
FileUtils.deleteDirectory(new File(WATERPICPATH));
|
|
|
|
|
new File(waterPicRoot).mkdirs();
|
|
|
|
|
}
|
|
|
|
|
//组织加水印后图片存放地址
|
|
|
|
|
String waterPicPath = waterPicRoot + nameList[i];
|
|
|
|
|
@ -681,7 +683,6 @@ public class CommomService {
|
|
|
|
|
//组织输出地址
|
|
|
|
|
String root = selectRootByNotWater(WATERPICPATH);
|
|
|
|
|
outSrc = EMRRECORDJSP + File.separator + root + "/jiashi/reload/" + patientId + File.separator + sourceList[i] + File.separator + nameList[i];
|
|
|
|
|
//http://192.168.199.124:8080/emr_record/reloadD\/jiashi/reload/patientId/1/
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
//不需要水印
|
|
|
|
|
@ -693,6 +694,9 @@ public class CommomService {
|
|
|
|
|
//保存目录不存在新增
|
|
|
|
|
if (!new File(WATERTIFTOJPGPATH).isDirectory()) {
|
|
|
|
|
new File(WATERTIFTOJPGPATH).mkdirs();
|
|
|
|
|
}else{
|
|
|
|
|
FileUtils.deleteDirectory(new File(WATERPICPATH));
|
|
|
|
|
new File(WATERTIFTOJPGPATH).mkdirs();
|
|
|
|
|
}
|
|
|
|
|
Date date = new Date();
|
|
|
|
|
SimpleDateFormat format = new SimpleDateFormat("yyyyMMddHHmmssSSS");
|
|
|
|
|
@ -707,14 +711,18 @@ public class CommomService {
|
|
|
|
|
root = selectRootByNotWater(WATERTIFTOJPGPATH);
|
|
|
|
|
outSrc = EMRRECORDJSP + File.separator + root + "/jiashi/tifToJpgLoad/" + format1 + ".jpg";
|
|
|
|
|
} else {
|
|
|
|
|
srcPath = srcPath.replaceAll("\\\\","/");
|
|
|
|
|
//截取字符串为磁盘路径
|
|
|
|
|
int thirdBackslashIndex = srcPath.indexOf('/', srcPath.indexOf('/', srcPath.indexOf('/') + 1) + 1);
|
|
|
|
|
if (thirdBackslashIndex != -1) {
|
|
|
|
|
srcPath = srcPath.substring(thirdBackslashIndex+1);
|
|
|
|
|
}
|
|
|
|
|
//将原图片地址转换成映射地址
|
|
|
|
|
//获取盘符并转换映射地址的头部地址
|
|
|
|
|
//root = selectRootByNotWater(srcPath);
|
|
|
|
|
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;
|
|
|
|
|
outSrc = "\\"+ picPath;
|
|
|
|
|
picPath = srcPath.substring(srcPath.indexOf('/'));
|
|
|
|
|
outSrc = EMRRECORDJSP + File.separator + root + File.separator + picPath;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
outs.add(outSrc);
|
|
|
|
|
|