|
@@ -534,6 +534,7 @@ public class LingmingguangziServiceImpl implements LingmingguangziService {
|
|
|
List<Map> fileList = (List<Map>) JSONArray.parse(String.valueOf(map1.get("attachmentField_ly8fxusz")));
|
|
|
String ydDownloadUrl = fileList.get(0).get("downloadUrl").toString();
|
|
|
String fileName = fileList.get(0).get("name").toString();
|
|
|
+ fileName = convertChineseToUtf8Hex(fileName);
|
|
|
if ("深圳".equals(type)){
|
|
|
//将downloadurl下载到本地
|
|
|
try {
|
|
@@ -621,7 +622,7 @@ public class LingmingguangziServiceImpl implements LingmingguangziService {
|
|
|
mcBody.put("fileName",fileName);
|
|
|
mcBody.put("downloadPath","/home/mc/mjs/lingmingguangzi/");
|
|
|
|
|
|
- fileURL = UtilHttp.doPost("https://mc.cloudpure.cn/mc/api/request/downloadFile",null,null,mcBody);
|
|
|
+ fileURL = UtilHttp.doPost("https://mc.cloudpure.cn/api/mc/request/downloadFile",null,null,mcBody);
|
|
|
|
|
|
// fileURL = ((DDR_New) UtilHttp.doGet("https://api.dingtalk.com/v1.0/yida/apps/temporaryUrls/" + ydConf.getAppType(), ddClient.initTokenHeader(), param, DDR_New.class)).getResult().toString();
|
|
|
|
|
@@ -632,7 +633,7 @@ public class LingmingguangziServiceImpl implements LingmingguangziService {
|
|
|
// 检查HTTP响应代码是否为200
|
|
|
if (responseCode == HttpURLConnection.HTTP_OK) {
|
|
|
InputStream inputStream = httpConn.getInputStream();
|
|
|
- FileOutputStream outputStream = new FileOutputStream(savePath);
|
|
|
+ FileOutputStream outputStream = new FileOutputStream(savePath + fileName);
|
|
|
|
|
|
byte[] buffer = new byte[4096];
|
|
|
int bytesRead = -1;
|
|
@@ -931,9 +932,9 @@ public class LingmingguangziServiceImpl implements LingmingguangziService {
|
|
|
MultipartEntityBuilder builder = MultipartEntityBuilder.create();
|
|
|
|
|
|
//如果fileUrl中包含中文,则需要对其进行编码
|
|
|
- String encodeFileName = convertChineseToUtf8Hex(file.getName());
|
|
|
+// String encodeFileName = convertChineseToUtf8Hex(file.getName());
|
|
|
|
|
|
- builder.addBinaryBody("file", file, ContentType.DEFAULT_BINARY, encodeFileName);
|
|
|
+ builder.addBinaryBody("file", file, ContentType.DEFAULT_BINARY, file.getName());
|
|
|
|
|
|
// 设置请求体
|
|
|
HttpEntity multipart = builder.build();
|