md
This commit is contained in:
parent
4f30f24f14
commit
e067c68b01
@ -38,6 +38,7 @@ import lombok.extern.slf4j.Slf4j;
|
|||||||
import me.chanjar.weixin.common.error.WxErrorException;
|
import me.chanjar.weixin.common.error.WxErrorException;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.http.MediaType;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
@ -274,6 +275,38 @@ public class Oms2cCommonController extends BaseController
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出底单图片
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Log(title = "底单图片", businessType = BusinessType.EXPORT)
|
||||||
|
@GetMapping("/getGotImage")
|
||||||
|
public void getGotImage(HttpServletResponse servletResponse, String billCode) throws IOException {
|
||||||
|
|
||||||
|
Response response = this.iRpcWaybillSvc.getSendTplImageUrl(billCode,getLoginUser().getUser().getCustomerCode());
|
||||||
|
Response.Body body = response.body();
|
||||||
|
|
||||||
|
servletResponse.setHeader("Content-Disposition", "attachment;fileName=" + billCode + ".png");
|
||||||
|
servletResponse.setContentType(MediaType.IMAGE_PNG_VALUE);
|
||||||
|
|
||||||
|
InputStream inputStream = null;
|
||||||
|
OutputStream outputStream = null;
|
||||||
|
try {
|
||||||
|
inputStream = body.asInputStream();
|
||||||
|
outputStream = servletResponse.getOutputStream();
|
||||||
|
byte[] b = new byte[inputStream.available()];
|
||||||
|
inputStream.read(b);
|
||||||
|
outputStream.write(b);
|
||||||
|
outputStream.flush();
|
||||||
|
} catch (IOException e) {
|
||||||
|
System.out.println("失败了");
|
||||||
|
}finally {
|
||||||
|
inputStream.close();
|
||||||
|
outputStream.close();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 发送小程序通知
|
* 发送小程序通知
|
||||||
*
|
*
|
||||||
|
|||||||
@ -595,36 +595,7 @@ public class Oms2cWaybillController extends BaseController
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 导出底单图片
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@Log(title = "底单图片", businessType = BusinessType.EXPORT)
|
|
||||||
@GetMapping("/getGotImage")
|
|
||||||
public void getGotImage(HttpServletResponse servletResponse, String billCode) throws IOException {
|
|
||||||
|
|
||||||
Response response = this.iRpcWaybillSvc.getSendTplImageUrl(billCode,getLoginUser().getUser().getCustomerCode());
|
|
||||||
Response.Body body = response.body();
|
|
||||||
|
|
||||||
servletResponse.setHeader("Content-Disposition", "attachment;fileName=" + billCode + ".png");
|
|
||||||
servletResponse.setContentType(MediaType.IMAGE_PNG_VALUE);
|
|
||||||
|
|
||||||
InputStream inputStream = null;
|
|
||||||
OutputStream outputStream = null;
|
|
||||||
try {
|
|
||||||
inputStream = body.asInputStream();
|
|
||||||
outputStream = servletResponse.getOutputStream();
|
|
||||||
byte[] b = new byte[inputStream.available()];
|
|
||||||
inputStream.read(b);
|
|
||||||
outputStream.write(b);
|
|
||||||
outputStream.flush();
|
|
||||||
} catch (IOException e) {
|
|
||||||
System.out.println("失败了");
|
|
||||||
}finally {
|
|
||||||
inputStream.close();
|
|
||||||
outputStream.close();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user