md
This commit is contained in:
parent
32219b4181
commit
e18e439939
@ -241,21 +241,22 @@ public class Oms2cCommonController extends BaseController
|
|||||||
*/
|
*/
|
||||||
@Log(title = "导出进仓单文件", businessType = BusinessType.EXPORT)
|
@Log(title = "导出进仓单文件", businessType = BusinessType.EXPORT)
|
||||||
@RequestMapping("/exportWarehouseInTpl")
|
@RequestMapping("/exportWarehouseInTpl")
|
||||||
public void exportWarehouseInTpl(HttpServletResponse servletResponse, String orderSn) throws IOException {
|
public void exportWarehouseInTpl(HttpServletResponse servletResponse, String orderSn,String fileType) throws IOException {
|
||||||
|
|
||||||
Response response = this.iRpcWarehouseInSvc.exportWarehouseInTpl(orderSn);
|
Response response = this.iRpcWarehouseInSvc.exportWarehouseInTpl(orderSn,fileType);
|
||||||
Response.Body body = response.body();
|
Response.Body body = response.body();
|
||||||
log.error("====>exportWarehouseInTpl==>{}", JSON.toJSONString(response.headers()));
|
log.error("====>exportWarehouseInTpl==>{}", JSON.toJSONString(response.headers()));
|
||||||
// for (Object key : response.headers().keySet()) {
|
// docx
|
||||||
// List<String> kList = (List<String>) response.headers().get(key);
|
if("docx".equals(fileType)){
|
||||||
// for (String val : kList) {
|
servletResponse.setContentType("application/octet-stream;charset=UTF-8");
|
||||||
// servletResponse.setHeader(key.toString(), val);
|
servletResponse.setHeader("Content-Disposition", "attachment;fileName=" + orderSn + ".docx");
|
||||||
// }
|
servletResponse.addHeader("Access-Control-Expose-Headers", "Content-disposition");
|
||||||
// }
|
}
|
||||||
|
// pdf
|
||||||
servletResponse.setHeader("Content-Disposition", "attachment;fileName=" + orderSn + ".pdf");
|
else {
|
||||||
// servletResponse.setContentType("application/octet-stream");
|
servletResponse.setContentType("application/pdf");
|
||||||
servletResponse.setContentType("application/pdf");
|
servletResponse.setHeader("Content-Disposition", "attachment;fileName=" + orderSn + ".pdf");
|
||||||
|
}
|
||||||
|
|
||||||
InputStream inputStream = null;
|
InputStream inputStream = null;
|
||||||
OutputStream outputStream = null;
|
OutputStream outputStream = null;
|
||||||
|
|||||||
@ -33,9 +33,7 @@ import org.springframework.security.access.prepost.PreAuthorize;
|
|||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
import java.io.IOException;
|
import java.io.*;
|
||||||
import java.io.InputStream;
|
|
||||||
import java.io.OutputStream;
|
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@ -125,19 +123,24 @@ public class Oms2cWarehouseInController extends BaseController
|
|||||||
*/
|
*/
|
||||||
@Log(title = "导出进仓单文件", businessType = BusinessType.EXPORT)
|
@Log(title = "导出进仓单文件", businessType = BusinessType.EXPORT)
|
||||||
@RequestMapping("/exportWarehouseInTpl")
|
@RequestMapping("/exportWarehouseInTpl")
|
||||||
public void exportWarehouseInTpl(HttpServletResponse servletResponse, String orderSn) throws IOException {
|
public void exportWarehouseInTpl(HttpServletResponse servletResponse, String orderSn,String fileType) throws IOException {
|
||||||
|
|
||||||
Response response = this.iRpcWarehouseInSvc.exportWarehouseInTpl(orderSn);
|
Response response = this.iRpcWarehouseInSvc.exportWarehouseInTpl(orderSn,fileType);
|
||||||
Response.Body body = response.body();
|
Response.Body body = response.body();
|
||||||
log.error("====>exportWarehouseInTpl==>{}", JSON.toJSONString(response.headers()));
|
log.error("====>exportWarehouseInTpl==>{}", JSON.toJSONString(response.headers()));
|
||||||
// for (Object key : response.headers().keySet()) {
|
|
||||||
// List<String> kList = (List<String>) response.headers().get(key);
|
// docx
|
||||||
// for (String val : kList) {
|
if("docx".equals(fileType)){
|
||||||
// servletResponse.setHeader(key.toString(), val);
|
servletResponse.setContentType("application/octet-stream;charset=UTF-8");
|
||||||
// }
|
servletResponse.setHeader("Content-Disposition", "attachment;fileName=" + orderSn + ".docx");
|
||||||
// }
|
servletResponse.addHeader("Access-Control-Expose-Headers", "Content-disposition");
|
||||||
servletResponse.setContentType("application/octet-stream");
|
}
|
||||||
servletResponse.setHeader("Content-Disposition", "attachment;fileName=" + orderSn + ".pdf");
|
// pdf
|
||||||
|
else {
|
||||||
|
servletResponse.setContentType("application/pdf");
|
||||||
|
servletResponse.setHeader("Content-Disposition", "attachment;fileName=" + orderSn + ".pdf");
|
||||||
|
}
|
||||||
|
|
||||||
InputStream inputStream = null;
|
InputStream inputStream = null;
|
||||||
OutputStream outputStream = null;
|
OutputStream outputStream = null;
|
||||||
try {
|
try {
|
||||||
|
|||||||
@ -41,7 +41,7 @@ public interface IRpcWarehouseInSvc {
|
|||||||
|
|
||||||
|
|
||||||
@PostMapping(value = "/apiweb/emisWarehouseIn/exportWarehouseInTpl")
|
@PostMapping(value = "/apiweb/emisWarehouseIn/exportWarehouseInTpl")
|
||||||
public Response exportWarehouseInTpl(@RequestParam("orderSn") String orderSn);
|
public Response exportWarehouseInTpl(@RequestParam("orderSn") String orderSn,@RequestParam("fileType") String fileType);
|
||||||
|
|
||||||
|
|
||||||
@PostMapping("/apiweb/emisWarehouseIn/cusConfirmWsIn")
|
@PostMapping("/apiweb/emisWarehouseIn/cusConfirmWsIn")
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user