md
This commit is contained in:
parent
72502c7f08
commit
076d6ac1f2
@ -993,9 +993,9 @@ public class EmisCommonController extends EmisBaseController
|
||||
*/
|
||||
@Log(title = "导出进仓单", businessType = BusinessType.EXPORT)
|
||||
@RequestMapping("/exportWarehouseInTpl")
|
||||
public void exportWarehouseInTpl(HttpServletResponse response,String orderSn) {
|
||||
public void exportWarehouseInTpl(HttpServletResponse response,String orderSn,String fileType) {
|
||||
try{
|
||||
emisWaybillService.genWarehouseInTplFile(response,orderSn);
|
||||
emisWaybillService.genWarehouseInTplFile(response,orderSn,fileType);
|
||||
}
|
||||
catch(EmisBizError ex){
|
||||
ex.printStackTrace();
|
||||
@ -1066,7 +1066,6 @@ public class EmisCommonController extends EmisBaseController
|
||||
String salesmen=item.getSalesmen();
|
||||
String billMonth=item.getBillMonth();
|
||||
String msg="截止"+DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD,new Date())+"有未回款,尽快联系客户收款,账期:"+billMonth+",待收:"+item.getNoRecdPayMoney()+"元,超期:"+item.getExpiredNoRecdPayMoney()+"元!";
|
||||
|
||||
AjaxResult rst=NoticeUtils.outSendNoticeToInner(msg,msg,"/ruyERj/BillPaybackSumList",salesmen,3);
|
||||
log.error(msg);
|
||||
}
|
||||
|
||||
@ -344,10 +344,10 @@ public class EmisWaybillController extends EmisBaseController
|
||||
*/
|
||||
@Log(title = "导出进仓单", businessType = BusinessType.EXPORT)
|
||||
@RequestMapping("/exportWarehouseInTpl")
|
||||
public void exportWarehouseInTpl(HttpServletResponse response,String orderSn) {
|
||||
public void exportWarehouseInTpl(HttpServletResponse response,String orderSn,String fileType) {
|
||||
|
||||
try{
|
||||
emisWaybillService.genWarehouseInTplFile(response,orderSn);
|
||||
emisWaybillService.genWarehouseInTplFile(response,orderSn,fileType);
|
||||
}
|
||||
catch(EmisBizError ex){
|
||||
ex.printStackTrace();
|
||||
|
||||
@ -215,7 +215,7 @@ public interface IEmisWaybillService extends IDataAuditService
|
||||
public List<EmisWaybill> selectPrintWaybillList(EmisWaybill emisWaybill);
|
||||
|
||||
public void genWarehouseInTplFileByOms(HttpServletResponse response, String orderSn) throws EmisBizError ;
|
||||
public void genWarehouseInTplFile(HttpServletResponse response, String orderSn) throws EmisBizError ;
|
||||
public void genWarehouseInTplFile(HttpServletResponse response, String orderSn,String fileType) throws EmisBizError ;
|
||||
|
||||
public void genWaybillOrigAttach(String billCode);
|
||||
|
||||
|
||||
@ -3770,7 +3770,7 @@ public class EmisWaybillServiceImpl extends EmisBaseService implements IEmisWayb
|
||||
|
||||
|
||||
@Override
|
||||
public void genWarehouseInTplFile(HttpServletResponse response, String orderSn) throws EmisBizError {
|
||||
public void genWarehouseInTplFile(HttpServletResponse response, String orderSn,String fileType) throws EmisBizError {
|
||||
|
||||
if(StringUtils.isEmpty(orderSn)){
|
||||
throw new EmisBizError(EmisBizErrorType.NOT_EXISTS,"订单号为空");
|
||||
@ -3902,17 +3902,25 @@ public class EmisWaybillServiceImpl extends EmisBaseService implements IEmisWayb
|
||||
// 生成模版
|
||||
XWPFTemplate template = XWPFTemplate.compile(fis, config).render(fillMap);
|
||||
|
||||
// response.setContentType("application/octet-stream");
|
||||
response.setContentType("application/pdf");
|
||||
response.setHeader("Content-Disposition", "attachment;fileName=" + fileName + ".pdf");
|
||||
// docx
|
||||
if("docx".equals(fileType)){
|
||||
response.setContentType("application/octet-stream;charset=UTF-8");
|
||||
response.setHeader("Content-Disposition", "attachment;fileName=" + fileName + ".docx");
|
||||
response.addHeader("Access-Control-Expose-Headers", "Content-disposition");
|
||||
template.write(outputStream);
|
||||
}
|
||||
// pdf
|
||||
else {
|
||||
response.setContentType("application/pdf");
|
||||
response.setHeader("Content-Disposition", "attachment;fileName=" + fileName + ".pdf");
|
||||
|
||||
ByteArrayOutputStream bos = new ByteArrayOutputStream();
|
||||
// 写入流
|
||||
template.write(bos);
|
||||
|
||||
ByteArrayInputStream bis = new ByteArrayInputStream(bos.toByteArray());
|
||||
DocUtils.wordToPdf(bis, outputStream);
|
||||
ByteArrayOutputStream bos = new ByteArrayOutputStream();
|
||||
// 写入流
|
||||
template.write(bos);
|
||||
ByteArrayInputStream bis = new ByteArrayInputStream(bos.toByteArray());
|
||||
DocUtils.wordToPdf(bis, outputStream);
|
||||
|
||||
}
|
||||
response.flushBuffer();
|
||||
|
||||
IOUtils.closeQuietly(fis);
|
||||
@ -3928,6 +3936,7 @@ public class EmisWaybillServiceImpl extends EmisBaseService implements IEmisWayb
|
||||
|
||||
|
||||
|
||||
|
||||
public static void main(String[] args) {
|
||||
|
||||
double volumeWeight=0.8 * (1000000 / Double.valueOf(4000));
|
||||
|
||||
Loading…
Reference in New Issue
Block a user