|
|
|
|
@ -45,9 +45,9 @@ public class ImageUtils {
|
|
|
|
|
}
|
|
|
|
|
inputStream = new ByteArrayInputStream(imageBytes);
|
|
|
|
|
BufferedImage bufferedImage1 = ImageIO.read(inputStream);
|
|
|
|
|
LogUtil.WriteLog_Info("ImageUtils====附件地址urlfileAddress=====" + fileAddress, "FileController");
|
|
|
|
|
LogUtil.WriteLog_Info("ImageUtils====附件地址urlfileAddress=====" + fileAddress, "FileCheckController");
|
|
|
|
|
if (PubTools.isEmpty(bufferedImage1)) {
|
|
|
|
|
LogUtil.WriteLog_Info("ImageUtils====附件不规范==不走水印处理===", "FileController");
|
|
|
|
|
LogUtil.WriteLog_Info("ImageUtils====附件不规范==不走水印处理===", "FileCheckController");
|
|
|
|
|
File fileDir = new File(fileAddress); // 指定上传位置
|
|
|
|
|
if (!fileDir.exists()) {
|
|
|
|
|
fileDir.mkdirs();
|
|
|
|
|
@ -62,9 +62,14 @@ public class ImageUtils {
|
|
|
|
|
// 保存文件
|
|
|
|
|
org.apache.commons.io.FileUtils.writeByteArrayToFile(file, imageBytes);
|
|
|
|
|
|
|
|
|
|
File fileisExist = new File(fileAddress, fileName); // 指定上传位置
|
|
|
|
|
//判断附件是否存在
|
|
|
|
|
if (!fileisExist.exists()) {
|
|
|
|
|
return "-10000";
|
|
|
|
|
}
|
|
|
|
|
//保存到附件服务器上面
|
|
|
|
|
String fileUploadUrl = PropertiesUtil.getValue("fileUploadUrl");
|
|
|
|
|
LogUtil.WriteLog_Info("ImageUtils====附件不规范==不走水印处理======附件上传接口fileUploadUrl=====" + fileUploadUrl, "FileController");
|
|
|
|
|
LogUtil.WriteLog_Info("ImageUtils====附件不规范==不走水印处理======附件上传接口fileUploadUrl=====" + fileUploadUrl, "FileCheckController");
|
|
|
|
|
Map<String, String> map = new HashMap<String, String>();
|
|
|
|
|
JSONArray jsonA = new JSONArray();
|
|
|
|
|
JSONObject mapParam = new JSONObject();
|
|
|
|
|
@ -73,7 +78,7 @@ public class ImageUtils {
|
|
|
|
|
jsonA.add(mapParam);
|
|
|
|
|
map.put("jsonArray", jsonA.toJSONString());
|
|
|
|
|
String s = HttpClientUtil.doPost(fileUploadUrl, map);
|
|
|
|
|
LogUtil.WriteLog_Info("ImageUtils=====附件不规范==不走水印处理===上传结果显示=====" + s, "FileController");
|
|
|
|
|
LogUtil.WriteLog_Info("ImageUtils=====附件不规范==不走水印处理===上传结果显示=====" + s, "FileCheckController");
|
|
|
|
|
return imageBase64;
|
|
|
|
|
}
|
|
|
|
|
int w1 = bufferedImage1.getWidth();
|
|
|
|
|
@ -147,7 +152,10 @@ public class ImageUtils {
|
|
|
|
|
}
|
|
|
|
|
// 保存文件
|
|
|
|
|
org.apache.commons.io.FileUtils.writeByteArrayToFile(file, watermarkedImageBytes);
|
|
|
|
|
|
|
|
|
|
File fileisExists = new File(fileAddress, fileName); // 指定上传位置
|
|
|
|
|
if (!fileisExists.exists()) {
|
|
|
|
|
return "-10000";
|
|
|
|
|
}
|
|
|
|
|
//保存到附件服务器上面
|
|
|
|
|
String fileUploadUrl = PropertiesUtil.getValue("fileUploadUrl");
|
|
|
|
|
LogUtil.WriteLog_Info("ImageUtils====附件上传接口fileUploadUrl=====" + fileUploadUrl, "FileController");
|
|
|
|
|
@ -159,12 +167,10 @@ public class ImageUtils {
|
|
|
|
|
jsonA.add(mapParam);
|
|
|
|
|
map.put("jsonArray", jsonA.toJSONString());
|
|
|
|
|
String[] split = fileUploadUrl.split(",");
|
|
|
|
|
if (split.length > 0) {
|
|
|
|
|
for (String strPath : split) {
|
|
|
|
|
String s = HttpClientUtil.doPost(strPath, map);
|
|
|
|
|
LogUtil.WriteLog_Info("ImageUtils====附件上传结果显示END==" + strPath + "===" + s, "FileController");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return retStr;
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
return "-9999";
|
|
|
|
|
|