From 7faf64dba259117a6e4b27044f60149247ad534d Mon Sep 17 00:00:00 2001 From: suncz Date: Fri, 31 May 2024 12:58:24 +0800 Subject: [PATCH] =?UTF-8?q?=E7=AE=A1=E9=81=93=E8=AF=B7=E8=B4=AD=E5=8D=95?= =?UTF-8?q?=E5=88=97=E8=A1=A8,=E5=AF=BC=E5=87=BA=E5=8F=8A=E5=8F=91?= =?UTF-8?q?=E9=80=81=E6=8A=A5=E4=BB=B7=E5=8D=95=E5=8E=BB=E9=99=A4=E4=B8=8D?= =?UTF-8?q?=E9=87=87=E8=B4=AD=E7=89=A9=E5=93=81=EF=BC=8C=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E6=9F=A5=E7=9C=8B=E8=AF=B7=E8=B4=AD=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../admin/PurchaseApplyOrderController.java | 8 +++---- .../service/PurchaseApplyOrderService.java | 13 +++++++----- .../purchaseApplyOrder/conduit/list.html | 21 +++++++++++++++++-- 3 files changed, 31 insertions(+), 11 deletions(-) diff --git a/src/main/java/com/vverp/controller/admin/PurchaseApplyOrderController.java b/src/main/java/com/vverp/controller/admin/PurchaseApplyOrderController.java index f219eaa..c155318 100644 --- a/src/main/java/com/vverp/controller/admin/PurchaseApplyOrderController.java +++ b/src/main/java/com/vverp/controller/admin/PurchaseApplyOrderController.java @@ -258,17 +258,17 @@ public class PurchaseApplyOrderController extends BaseController { //批量导出报价单 @RequestMapping("/exportSupplierSingleAll") - public void exportSupplierSingleAll(HttpServletResponse response, Long[] ids) throws Exception { + public void exportSupplierSingleAll(HttpServletResponse response, Long[] ids ,String type) throws Exception { // purchaseApplyOrderService.exportSupplier(response, id); - purchaseApplyOrderService.exportSupplierSingleAll(response, ids); + purchaseApplyOrderService.exportSupplierSingleAll(response, ids, type); } //批量发送报价单 @RequestMapping("/sendSupplierAll") @ResponseBody - public Message sendSupplierAll( Long[] ids) throws Exception { + public Message sendSupplierAll( Long[] ids, String type) throws Exception { try { - purchaseApplyOrderService.sendSupplierAll(ids); + purchaseApplyOrderService.sendSupplierAll(ids, type); return Message.success("发送成功"); }catch (Exception e){ e.printStackTrace(); diff --git a/src/main/java/com/vverp/service/PurchaseApplyOrderService.java b/src/main/java/com/vverp/service/PurchaseApplyOrderService.java index f41f922..22f39c9 100644 --- a/src/main/java/com/vverp/service/PurchaseApplyOrderService.java +++ b/src/main/java/com/vverp/service/PurchaseApplyOrderService.java @@ -536,7 +536,7 @@ public class PurchaseApplyOrderService extends BaseOrderService exportSupplierSingleAllWorkbook(Long[] ids) { + public Map exportSupplierSingleAllWorkbook(Long[] ids,String type) { Map workbookMap = new LinkedHashMap<>(); @@ -553,6 +553,9 @@ public class PurchaseApplyOrderService extends BaseOrderService> listMap = new ArrayList<>(); List purchaseApplyOrderItemList = purchaseApplyOrderItemService.findByVersionNum(purchaseApplyOrder.getVersionNum(),id); for (PurchaseApplyOrderItem item : purchaseApplyOrderItemList) { + if (type.equals("export") && item.getCount().compareTo(BigDecimal.ZERO)<=0){ + continue; + } Map lm = new HashMap<>(); lm.put("id", item.getMaterialOrderItemId()); lm.put("name", item.getName()); @@ -600,7 +603,7 @@ public class PurchaseApplyOrderService extends BaseOrderService en : exportSupplierSingleAllWorkbook(ids).entrySet()) { + for (Map.Entry en : exportSupplierSingleAllWorkbook(ids, type).entrySet()) { //导出的文件名称 String entryName = en.getKey(); ZipEntry entry = new ZipEntry(entryName); @@ -1101,7 +1104,7 @@ public class PurchaseApplyOrderService extends BaseOrderService supplierList = new ArrayList<>(); Map> map = new HashMap<>(); @@ -1115,7 +1118,7 @@ public class PurchaseApplyOrderService extends BaseOrderService workbookMap = exportSupplierSingleAllWorkbook(new Long[]{id}); + Map workbookMap = exportSupplierSingleAllWorkbook(new Long[]{id},type); for (Map.Entry entry : workbookMap.entrySet()) { file = new File(resFileDir + "/" + entry.getKey()); FileOutputStream fos = new FileOutputStream(file); diff --git a/src/main/webapp/WEB-INF/template/purchaseApplyOrder/conduit/list.html b/src/main/webapp/WEB-INF/template/purchaseApplyOrder/conduit/list.html index 864a667..f9473f3 100644 --- a/src/main/webapp/WEB-INF/template/purchaseApplyOrder/conduit/list.html +++ b/src/main/webapp/WEB-INF/template/purchaseApplyOrder/conduit/list.html @@ -27,6 +27,9 @@ 导出 + 批量查看请购单 + 批量导出报价单 @@ -279,6 +282,20 @@ }); } + function checkAll() { + var selectedIds = $(".tableWrap").selectedIds(); + if (selectedIds.length < 1) { + Dialog.error("至少勾选1项"); + return + } + var ids = "" + for (var i = 0; i < selectedIds.length; i++) { + ids += Number(selectedIds[i]) + "," + } + ids.substring(0, ids.length - 1) + window.open("/admin/purchaseApplyOrder/exportSupplierSingleAll.html?ids=" + ids + "&type=check") + } + function exportAll() { var selectedIds = $(".tableWrap").selectedIds(); if (selectedIds.length < 1) { @@ -290,7 +307,7 @@ ids += Number(selectedIds[i]) + "," } ids.substring(0, ids.length - 1) - window.open("/admin/purchaseApplyOrder/exportSupplierSingleAll.html?ids=" + ids) + window.open("/admin/purchaseApplyOrder/exportSupplierSingleAll.html?ids=" + ids + "&type=export") } function sendAll() { @@ -307,7 +324,7 @@ Dialog.waiting("发送中,请稍等"); $.ajax({ type: "POST", - url: "purchaseApplyOrder/sendSupplierAll.html", + url: "purchaseApplyOrder/sendSupplierAll.html?type=export", data: { ids: ids },