java110 лет назад: 6
Родитель
Сommit
fdbb2b7391

+ 10 - 1
CommonService/src/main/java/com/java110/common/smo/impl/FileInnerServiceSMOImpl.java

@@ -13,8 +13,12 @@ import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RestController;
 import org.springframework.web.bind.annotation.RestController;
 import sun.misc.BASE64Encoder;
 import sun.misc.BASE64Encoder;
 
 
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.OutputStream;
 import java.util.ArrayList;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.List;
+import java.util.UUID;
 
 
 @RestController
 @RestController
 public class FileInnerServiceSMOImpl extends BaseServiceSMO implements IFileInnerServiceSMO {
 public class FileInnerServiceSMOImpl extends BaseServiceSMO implements IFileInnerServiceSMO {
@@ -61,7 +65,12 @@ public class FileInnerServiceSMOImpl extends BaseServiceSMO implements IFileInne
         byte[] fileImg = ftpUploadTemplate.downFileByte(ftpPath, fileName, java110Properties.getFtpServer(),
         byte[] fileImg = ftpUploadTemplate.downFileByte(ftpPath, fileName, java110Properties.getFtpServer(),
                 java110Properties.getFtpPort(), java110Properties.getFtpUserName(),
                 java110Properties.getFtpPort(), java110Properties.getFtpUserName(),
                 java110Properties.getFtpUserPassword());
                 java110Properties.getFtpUserPassword());
-
+        try {
+            OutputStream out = new FileOutputStream(new File("/home/hc/img/"+ UUID.randomUUID().toString()+".jpg"));
+            out.write(fileImg);
+        }catch (Exception e){
+            e.printStackTrace();
+        }
        //String context = new BASE64Encoder().encode(fileImg);
        //String context = new BASE64Encoder().encode(fileImg);
         String context = Base64Convert.byteToBase64(fileImg);
         String context = Base64Convert.byteToBase64(fileImg);
 
 

+ 3 - 1
java110-bean/src/main/java/com/java110/dto/file/FileDto.java

@@ -2,7 +2,7 @@ package com.java110.dto.file;
 
 
 import java.io.Serializable;
 import java.io.Serializable;
 
 
-public class FileDto  implements Serializable {
+public class FileDto implements Serializable {
     private String fileId;
     private String fileId;
 
 
     private String fileName;
     private String fileName;
@@ -11,6 +11,7 @@ public class FileDto  implements Serializable {
 
 
     private String context;
     private String context;
 
 
+
     private String statusCd;
     private String statusCd;
 
 
     private String suffix;
     private String suffix;
@@ -72,4 +73,5 @@ public class FileDto  implements Serializable {
     public void setFileSaveName(String fileSaveName) {
     public void setFileSaveName(String fileSaveName) {
         this.fileSaveName = fileSaveName;
         this.fileSaveName = fileSaveName;
     }
     }
+
 }
 }