This commit is contained in:
linfso 2024-12-27 04:08:17 +08:00
parent 6a9fe978e7
commit ded882e2ae
2 changed files with 39 additions and 1 deletions

View File

@ -18,6 +18,7 @@ import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid;
import cn.hutool.core.collection.CollectionUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.xdadan.erp.oms.common.annotation.filter.jackson.JacksonFilter;
import com.xdadan.erp.oms.common.core.domain.entity.SysOmsUser;
@ -44,6 +45,7 @@ import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.dao.DuplicateKeyException;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.*;
import com.xdadan.erp.oms.common.annotation.Log;
@ -170,7 +172,6 @@ public class Oms2cWaybillController extends BaseController
return this.iRpcWaybillSvc.calcSetteldWeight(waybillOrder);
}
@GetMapping("/list")
public TableDataInfo list(EmisWaybill emisWaybill)
{
@ -594,6 +595,38 @@ public class Oms2cWaybillController extends BaseController
}
/**
* 导出底单图片
* @return
*/
@Log(title = "导出底单图片", businessType = BusinessType.EXPORT)
@GetMapping("/getSendTplImageUrl")
public void getSendTplImageUrl(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();
}
}

View File

@ -11,6 +11,7 @@ import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@FeignClient(name = "IRpcWaybillSvc",url = "${service.provider.url}",configuration = {FeignErrorDecoder.class})
@ -79,6 +80,10 @@ public interface IRpcWaybillSvc {
public AjaxResult getWaybillDetailByOms(@RequestParam("billCode")String billCode,@RequestParam("orderSn") String orderSn);
@GetMapping(value = "/apiweb/emisWaybill/getSendTplImageUrl")
public Response getSendTplImageUrl(@RequestParam("billCode")String billCode,@RequestParam("customerCode") String customerCode);
/**
* oms批量下单
* @param emisWaybillSave