Commit ce44d038 authored by 吴琼's avatar 吴琼

交易凭证

parent fabd338e
......@@ -16,6 +16,7 @@ import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
......@@ -145,9 +146,9 @@ public class TransactionReceiptRecordRest {
//导出压缩包
@RequestMapping("/orderQuery/exportTransactionZipFile")
@ResponseBody
public JsonResult exportTransactionZipFile(HttpServletRequest request) {
public JsonResult exportTransactionZipFile(HttpServletRequest request, HttpServletResponse response) {
try{
return transactionReceiptRecordService.exportZipFile(request);
return transactionReceiptRecordService.exportZipFile(request,response);
}catch(Exception e){
e.printStackTrace();
return JsonResult.buildErrorStateResult("导出文件出现错误");
......
......@@ -6,6 +6,7 @@ import cn.quantgroup.customer.rest.vo.transaction.TransactionReceiptVO;
import org.springframework.data.domain.Page;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;
......@@ -15,7 +16,7 @@ public interface ITransactionReceiptRecordService {
JsonResult importTransactionReceiptRecord(MultipartFile file) throws IOException;
JsonResult exportZipFile(HttpServletRequest request) throws Exception;
JsonResult exportZipFile(HttpServletRequest request, HttpServletResponse response) throws Exception;
JsonResult checkCanExport();
......
......@@ -7,11 +7,8 @@ import com.jcraft.jsch.JSchException;
import com.jcraft.jsch.Session;
import com.jcraft.jsch.SftpATTRS;
import com.jcraft.jsch.SftpException;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.*;
import java.util.Properties;
import java.util.Vector;
import org.slf4j.Logger;
......@@ -109,8 +106,7 @@ public class SFTPUtil {
}
}
this.sftp.put(input, sftpFileName + ".tmp");
this.sftp.rename(sftpFileName + ".tmp", sftpFileName);
this.sftp.put(input, sftpFileName);
}
public void download(String directory, String downloadFile, String saveDirectory, String saveFile) throws SftpException, FileNotFoundException {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment