md
This commit is contained in:
parent
a3384e2cac
commit
bb1ea2fa55
@ -132,5 +132,24 @@ public class EmisCommonController extends BaseController
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 预览电子面单打印
|
||||||
|
*/
|
||||||
|
@RequestMapping(value = "/previewBillPrintImage")
|
||||||
|
public AjaxResult previewBillPrintImage(String uuid)
|
||||||
|
{
|
||||||
|
try {
|
||||||
|
return AjaxResult.success("解析成功");
|
||||||
|
}catch (Exception ex){
|
||||||
|
ex.printStackTrace();
|
||||||
|
// 返回子定义异常
|
||||||
|
if(ex instanceof EmisBizError){
|
||||||
|
return AjaxResult.error("("+((EmisBizError)ex).getErrorCode()+")"+ex.getMessage());
|
||||||
|
}
|
||||||
|
|
||||||
|
return AjaxResult.error("服务器异常,联系客服");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -11,9 +11,7 @@
|
|||||||
|
|
||||||
package com.xdadan.erp.web.emis;
|
package com.xdadan.erp.web.emis;
|
||||||
|
|
||||||
import java.io.ByteArrayOutputStream;
|
import java.io.*;
|
||||||
import java.io.OutputStream;
|
|
||||||
import java.io.PrintWriter;
|
|
||||||
import java.nio.charset.Charset;
|
import java.nio.charset.Charset;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
@ -23,13 +21,17 @@ import javax.validation.Valid;
|
|||||||
import com.alibaba.fastjson.JSONArray;
|
import com.alibaba.fastjson.JSONArray;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.xdadan.erp.common.annotation.filter.jackson.JacksonFilter;
|
import com.xdadan.erp.common.annotation.filter.jackson.JacksonFilter;
|
||||||
|
import com.xdadan.erp.common.config.PayConfig;
|
||||||
import com.xdadan.erp.common.utils.DateUtils;
|
import com.xdadan.erp.common.utils.DateUtils;
|
||||||
|
import com.xdadan.erp.common.utils.idgen.UUID;
|
||||||
import com.xdadan.erp.emis.domain.EmisBrand;
|
import com.xdadan.erp.emis.domain.EmisBrand;
|
||||||
import com.xdadan.erp.emis.domain.exception.EmisBizError;
|
import com.xdadan.erp.emis.domain.exception.EmisBizError;
|
||||||
import com.xdadan.erp.emis.domain.vo.*;
|
import com.xdadan.erp.emis.domain.vo.*;
|
||||||
import com.xdadan.erp.emis.service.*;
|
import com.xdadan.erp.emis.service.*;
|
||||||
import com.xdadan.erp.emis.service.print.IXddTplPrint;
|
import com.xdadan.erp.emis.service.print.IXddTplPrint;
|
||||||
import com.xdadan.erp.emis.service.print.tanex.TanexTplPrintImpl;
|
import com.xdadan.erp.emis.service.print.tanex.TanexTplPrintImpl;
|
||||||
|
import com.xdadan.erp.system.domain.SysFileInfo;
|
||||||
|
import com.xdadan.erp.system.service.ISysFileInfoService;
|
||||||
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.http.MediaType;
|
||||||
@ -61,6 +63,9 @@ public class EmisWaybillController extends BaseController
|
|||||||
@Autowired
|
@Autowired
|
||||||
private EmisBaseService emisBaseService;
|
private EmisBaseService emisBaseService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ISysFileInfoService sysFileInfoService;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
@ -234,10 +239,6 @@ public class EmisWaybillController extends BaseController
|
|||||||
return getDataTable(list);
|
return getDataTable(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
// @PreAuthorize("@ss.hasPermi('emis:emisWaybill:list')")
|
|
||||||
// ,"receiveCounty","receiveAddress",
|
|
||||||
// ,"sendCounty","sendAddress",
|
|
||||||
// "sendCity","sendCounty","sendAddress",
|
|
||||||
|
|
||||||
@JacksonFilter(include= {
|
@JacksonFilter(include= {
|
||||||
"id","orderSn","billCode","orderStatus","waybillStatus",
|
"id","orderSn","billCode","orderStatus","waybillStatus",
|
||||||
@ -263,6 +264,21 @@ public class EmisWaybillController extends BaseController
|
|||||||
return getDataTable(list);
|
return getDataTable(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@JacksonFilter(include= {
|
||||||
|
"orderSn","billCode","orderStatus","waybillStatus", "sendDate"
|
||||||
|
},value= EmisWaybill.class,type= JacksonFilter.JscksonFilterType.RESPONSE)
|
||||||
|
@RequestMapping("/queryPrintListSimple")
|
||||||
|
public TableDataInfo queryPrintListSimple(EmisWaybill emisWaybill)
|
||||||
|
{
|
||||||
|
startPage();
|
||||||
|
// emisWaybill.setCreateSite(getLoginUser().getUser().getOwnerSiteCode());
|
||||||
|
List<EmisWaybill> list = emisWaybillService.selectEmisWaybillList(emisWaybill);
|
||||||
|
return getDataTable(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询扫描统计数据
|
* 查询扫描统计数据
|
||||||
@ -361,6 +377,81 @@ public class EmisWaybillController extends BaseController
|
|||||||
return AjaxResult.error("获取失败");
|
return AjaxResult.error("获取失败");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@RequestMapping("/realGetPrintList")
|
||||||
|
public AjaxResult realGetPrintList(String billCode, String billCodeRange, String lang, String printType)
|
||||||
|
{
|
||||||
|
/*
|
||||||
|
, HttpServletRequest request, HttpServletResponse response
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"billCode": "T7080300000206",
|
||||||
|
"result": "success",
|
||||||
|
"message": "打印",
|
||||||
|
"imageUrl": "http://oss-emis.xxx.com/m123213123.png"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
*/
|
||||||
|
|
||||||
|
if(!StringUtils.isEmpty(billCode)){
|
||||||
|
try {
|
||||||
|
JSONArray jArr = new JSONArray();
|
||||||
|
String[] billCodeArr = billCode.split(",");
|
||||||
|
|
||||||
|
for(String billCodeItem:billCodeArr) {
|
||||||
|
Map<String, Object> order = emisBaseService.getWaybillPrintOrder(billCode, billCodeRange, lang, printType);
|
||||||
|
JSONObject printItem = new JSONObject();
|
||||||
|
printItem.put("billCode",billCodeItem);
|
||||||
|
if(order!=null) {
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
String fileId = UUID.fastUUID().toString();
|
||||||
|
String fileUploadDir = PayConfig.getUploadPath();
|
||||||
|
String saveFileName = fileUploadDir+ File.separator+DateUtils.datePath()+"/"+fileId+".png";
|
||||||
|
|
||||||
|
FileOutputStream os = new FileOutputStream(saveFileName);//输出流
|
||||||
|
IXddTplPrint tplPrint = new TanexTplPrintImpl();
|
||||||
|
tplPrint.genPNG(order, os);
|
||||||
|
|
||||||
|
JSONObject jObjRemark = new JSONObject();
|
||||||
|
jObjRemark.put("billCode",billCodeItem);
|
||||||
|
jObjRemark.put("billCodeRange",billCodeRange);
|
||||||
|
jObjRemark.put("lang",lang);
|
||||||
|
jObjRemark.put("printType",printType);
|
||||||
|
|
||||||
|
SysFileInfo sysFileInfo=sysFileInfoService.ossUploadLocalFile(saveFileName,billCodeItem,jObjRemark.toJSONString());
|
||||||
|
String imageUrl = sysFileInfo.getFileRemoteUrl();
|
||||||
|
printItem.put("imageUrl", imageUrl);
|
||||||
|
printItem.put("result","success");
|
||||||
|
printItem.put("message","success");
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
e.printStackTrace();
|
||||||
|
printItem.put("imageUrl", "");
|
||||||
|
printItem.put("result","fail");
|
||||||
|
printItem.put("message","生成图片异常");
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}else{
|
||||||
|
printItem.put("result","fail");
|
||||||
|
printItem.put("message","未获取到数据");
|
||||||
|
}
|
||||||
|
jArr.add(printItem);
|
||||||
|
}
|
||||||
|
|
||||||
|
return AjaxResult.success("获取成功",jArr);
|
||||||
|
}catch (Exception ex){
|
||||||
|
ex.printStackTrace();
|
||||||
|
return AjaxResult.error("获取失败");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return AjaxResult.error("获取失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@RequestMapping("/realGetWaybillPdf")
|
@RequestMapping("/realGetWaybillPdf")
|
||||||
public AjaxResult realGetWaybillPdf(HttpServletRequest request, HttpServletResponse response,String billCode, String billCodeRange, String lang, String printType,String isNeedPdf)
|
public AjaxResult realGetWaybillPdf(HttpServletRequest request, HttpServletResponse response,String billCode, String billCodeRange, String lang, String printType,String isNeedPdf)
|
||||||
@ -428,6 +519,8 @@ public class EmisWaybillController extends BaseController
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private void responseJson(HttpServletResponse response,String text){
|
private void responseJson(HttpServletResponse response,String text){
|
||||||
response.setCharacterEncoding("UTF-8");
|
response.setCharacterEncoding("UTF-8");
|
||||||
response.setContentType("application/json; charset=utf-8");
|
response.setContentType("application/json; charset=utf-8");
|
||||||
|
|||||||
@ -437,6 +437,19 @@
|
|||||||
<if test="remark != null and remark != ''"> and remark like concat('%', #{remark}, '%')</if>
|
<if test="remark != null and remark != ''"> and remark like concat('%', #{remark}, '%')</if>
|
||||||
<if test="createSite != null and createSite != ''"> and create_site like concat('%', #{createSite}, '%')</if>
|
<if test="createSite != null and createSite != ''"> and create_site like concat('%', #{createSite}, '%')</if>
|
||||||
<if test="updateSite != null and updateSite != ''"> and update_site like concat('%', #{updateSite}, '%')</if>
|
<if test="updateSite != null and updateSite != ''"> and update_site like concat('%', #{updateSite}, '%')</if>
|
||||||
|
|
||||||
|
<if test="params.beginSendDate != null and params.beginSendDate != ''">
|
||||||
|
and send_date <![CDATA[ >= ]]> #{params.beginSendDate}
|
||||||
|
</if>
|
||||||
|
<if test="params.endSendDate != null and params.endSendDate != ''">
|
||||||
|
and send_date <![CDATA[ <= ]]> #{params.endSendDate}
|
||||||
|
</if>
|
||||||
|
|
||||||
|
<if test="params.printFlag != null and params.printFlag != ''">
|
||||||
|
and bl_print=#{params.printFlag}
|
||||||
|
</if>
|
||||||
|
|
||||||
|
|
||||||
</where>
|
</where>
|
||||||
order by create_time desc
|
order by create_time desc
|
||||||
</select>
|
</select>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user