|
|
|
|
@ -617,6 +617,12 @@ public class CommomService {
|
|
|
|
|
Power_User user = (Power_User) request.getSession().getAttribute("CURRENT_USER");
|
|
|
|
|
List<String> outs = new LinkedList<>();
|
|
|
|
|
if (StringUtils.isNotBlank(names)) {
|
|
|
|
|
if (new File(WATERPICPATH).isDirectory()) {
|
|
|
|
|
FileUtils.deleteDirectory(new File(WATERPICPATH));
|
|
|
|
|
}
|
|
|
|
|
if (!new File(WATERTIFTOJPGPATH).isDirectory()) {
|
|
|
|
|
FileUtils.deleteDirectory(new File(WATERTIFTOJPGPATH));
|
|
|
|
|
}
|
|
|
|
|
String[] rootPathList = rootPaths.split(",");
|
|
|
|
|
String[] nameList = names.split(",");
|
|
|
|
|
String[] sourceList = sources.split(",");
|
|
|
|
|
@ -665,9 +671,6 @@ public class CommomService {
|
|
|
|
|
//目录不存在则创建
|
|
|
|
|
if (!new File(waterPicRoot).isDirectory()) {
|
|
|
|
|
new File(waterPicRoot).mkdirs();
|
|
|
|
|
}else{
|
|
|
|
|
FileUtils.deleteDirectory(new File(WATERPICPATH));
|
|
|
|
|
new File(waterPicRoot).mkdirs();
|
|
|
|
|
}
|
|
|
|
|
//组织加水印后图片存放地址
|
|
|
|
|
String waterPicPath = waterPicRoot + nameList[i];
|
|
|
|
|
@ -694,9 +697,6 @@ 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");
|
|
|
|
|
@ -712,17 +712,25 @@ public class CommomService {
|
|
|
|
|
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);
|
|
|
|
|
if(srcPath.startsWith("/")){
|
|
|
|
|
//截取字符串为磁盘路径
|
|
|
|
|
int thirdBackslashIndex = srcPath.indexOf('/', srcPath.indexOf('/', srcPath.indexOf('/') + 1) + 1);
|
|
|
|
|
if (thirdBackslashIndex != -1) {
|
|
|
|
|
srcPath = srcPath.substring(thirdBackslashIndex+1);
|
|
|
|
|
}
|
|
|
|
|
//将原图片地址转换成映射地址
|
|
|
|
|
//获取盘符并转换映射地址的头部地址
|
|
|
|
|
root = selectRootByNotWater(srcPath);
|
|
|
|
|
//获取盘符后面的地址
|
|
|
|
|
picPath = srcPath.substring(srcPath.indexOf('/'));
|
|
|
|
|
outSrc = EMRRECORDJSP + File.separator + root + File.separator + picPath;
|
|
|
|
|
}else{
|
|
|
|
|
root = selectRootByNotWater(srcPath);
|
|
|
|
|
//获取盘符后面的地址
|
|
|
|
|
String str1 = srcPath.substring(0, srcPath.indexOf("/"));
|
|
|
|
|
picPath = srcPath.substring(str1.length() + 1, srcPath.length());
|
|
|
|
|
outSrc = EMRRECORDJSP + File.separator + root + picPath;
|
|
|
|
|
}
|
|
|
|
|
//将原图片地址转换成映射地址
|
|
|
|
|
//获取盘符并转换映射地址的头部地址
|
|
|
|
|
root = selectRootByNotWater(srcPath);
|
|
|
|
|
//获取盘符后面的地址
|
|
|
|
|
picPath = srcPath.substring(srcPath.indexOf('/'));
|
|
|
|
|
outSrc = EMRRECORDJSP + File.separator + root + File.separator + picPath;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
outs.add(outSrc);
|
|
|
|
|
|