From 4cde3d6d517f779a7166a175366498a6035adb0e Mon Sep 17 00:00:00 2001 From: liuxiaoxu <1793812695@qq.com> Date: Fri, 30 Aug 2024 16:41:17 +0800 Subject: [PATCH] =?UTF-8?q?[feat]=20=E5=AE=A2=E6=88=B7=E6=8A=A5=E4=BB=B7?= =?UTF-8?q?=20=E6=96=B0=E5=A2=9E=E5=AE=A2=E6=88=B7=E6=8A=A5=E4=BB=B7?= =?UTF-8?q?=E5=AF=BC=E5=87=BA=E6=8C=89=E9=92=AE=EF=BC=9A=E5=8F=AF=E9=80=89?= =?UTF-8?q?=E6=8B=A9=E5=8D=95=E8=A1=8C=E6=95=B0=E6=8D=AE=E6=88=96=E8=80=85?= =?UTF-8?q?=E6=98=AF=E5=A4=9A=E8=A1=8C=E6=95=B0=E6=8D=AE=E5=AF=BC=E5=87=BA?= =?UTF-8?q?=20=E6=96=B0=E5=A2=9E=E5=AE=A2=E6=88=B7=E6=8A=A5=E4=BB=B7?= =?UTF-8?q?=E5=AF=BC=E5=87=BA=20=E5=90=8E=E7=AB=AF=E6=8E=A5=E5=8F=A3=20?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=20=E6=A0=B9=E6=8D=AE=E4=BE=9B=E5=BA=94?= =?UTF-8?q?=E5=95=86=E7=BC=96=E7=A0=81=E6=95=B0=E7=BB=84=E6=9F=A5=E8=AF=A2?= =?UTF-8?q?=E5=AE=A2=E6=88=B7=E6=8A=A5=E4=BB=B7=E4=BF=A1=E6=81=AF=E9=9B=86?= =?UTF-8?q?=E5=90=88=E5=90=8E=E7=AB=AF=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../SysCustomerQuoteController.java | 28 +++++---- .../system/mapper/SysCustomerQuoteMapper.java | 5 ++ .../service/ISysCustomerQuoteService.java | 5 ++ .../impl/SysCustomerQuoteServiceImpl.java | 8 +++ .../mapper/system/SysCustomerQuoteMapper.xml | 8 +++ .../system/customerQuote/customerQuote.html | 59 ++++++++++++++++++- 6 files changed, 100 insertions(+), 13 deletions(-) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/system/controller/SysCustomerQuoteController.java b/ruoyi-admin/src/main/java/com/ruoyi/system/controller/SysCustomerQuoteController.java index 0bace43c..5f386507 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/system/controller/SysCustomerQuoteController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/system/controller/SysCustomerQuoteController.java @@ -11,6 +11,7 @@ import com.ruoyi.common.core.domain.entity.SysUser; import com.ruoyi.common.core.page.TableDataInfo; import com.ruoyi.common.enums.BusinessType; import com.ruoyi.common.utils.ShiroUtils; +import com.ruoyi.common.utils.poi.ExcelUtil; import com.ruoyi.erp.domain.ErpMaterialVo; import com.ruoyi.process.general.service.IProcessService; import com.ruoyi.remind.service.RemindService; @@ -215,16 +216,7 @@ public class SysCustomerQuoteController extends BaseController return list; } - @RequiresPermissions("system:customerQuote:export") - @Log(title = "客户报价信息", businessType = BusinessType.EXPORT) - @RequestMapping("/exportCustomerInfo") - @ResponseBody - public void exportCustomerInfo(@RequestBody String selectData, HttpServletResponse response) throws IOException { - //数据处理 - JSONObject jsonObject = (JSONObject) JSONObject.parse(selectData); - JSONArray jsonArray = jsonObject.getJSONArray("selectData"); - List selectDataList = JSONObject.parseArray(String.valueOf(jsonArray), SysCustomerDto.class); - } + /** * 获取客户报价编号 */ @@ -335,6 +327,22 @@ public class SysCustomerQuoteController extends BaseController } + + /** + * 导出客户报价列表 + */ + @RequiresPermissions("system:customerQuote:export") + @Log(title = "客户报价信息", businessType = BusinessType.EXPORT) + @PostMapping("/export") + @ResponseBody + public AjaxResult export(@RequestBody String[] supplierCodes) + { + List list = sysCustomerQuoteService.selectCustomerQuoteOneBySupplierCodes(supplierCodes); + ExcelUtil util = new ExcelUtil(SysCustomerQuote.class); + return util.exportExcel(list, "销售客户报价数据"); + } + + /** * 导出客户报价模板1 * */ diff --git a/ruoyi-admin/src/main/java/com/ruoyi/system/mapper/SysCustomerQuoteMapper.java b/ruoyi-admin/src/main/java/com/ruoyi/system/mapper/SysCustomerQuoteMapper.java index d49078b9..fc838c30 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/system/mapper/SysCustomerQuoteMapper.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/system/mapper/SysCustomerQuoteMapper.java @@ -105,4 +105,9 @@ public interface SysCustomerQuoteMapper public int restoreSysCustomerQuoteById(Long id); int insertSysCustomerQuote(SysCustomerQuoteVo sysCustomerQuote); + + /** + * 根据供应商编码数组查询客户报价信息集合 + * */ + List selectCustomerQuoteOneBySupplierCodes(String[] supplierCodes); } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/system/service/ISysCustomerQuoteService.java b/ruoyi-admin/src/main/java/com/ruoyi/system/service/ISysCustomerQuoteService.java index 36dd5669..64f847d4 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/system/service/ISysCustomerQuoteService.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/system/service/ISysCustomerQuoteService.java @@ -107,4 +107,9 @@ public interface ISysCustomerQuoteService * 导出客户报价模板4 * */ void exportCustomerQuoteFour(String supplierCode, HttpServletResponse response); + + /** + * 根据供应商编码数组查询客户报价信息集合 + * */ + List selectCustomerQuoteOneBySupplierCodes(String[] supplierCodes); } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysCustomerQuoteServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysCustomerQuoteServiceImpl.java index a330b5e1..7e72ff55 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysCustomerQuoteServiceImpl.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysCustomerQuoteServiceImpl.java @@ -92,6 +92,14 @@ public class SysCustomerQuoteServiceImpl implements ISysCustomerQuoteService { return null; } + /** + * 根据供应商编码数组查询客户报价信息集合 + * */ + @Override + public List selectCustomerQuoteOneBySupplierCodes(String[] supplierCodes) { + List list = sysCustomerQuoteMapper.selectCustomerQuoteOneBySupplierCodes(supplierCodes); + return list; + } @Override public List selectSysCustomerQuoteList(SysCustomerQuoteVo sysCustomerQuoteVo) diff --git a/ruoyi-admin/src/main/resources/mapper/system/SysCustomerQuoteMapper.xml b/ruoyi-admin/src/main/resources/mapper/system/SysCustomerQuoteMapper.xml index e4ed55b5..486d6d65 100644 --- a/ruoyi-admin/src/main/resources/mapper/system/SysCustomerQuoteMapper.xml +++ b/ruoyi-admin/src/main/resources/mapper/system/SysCustomerQuoteMapper.xml @@ -115,6 +115,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" where customerCode = #{cusotomerCode} + + insert into sys_customer_quote diff --git a/ruoyi-admin/src/main/resources/templates/system/customerQuote/customerQuote.html b/ruoyi-admin/src/main/resources/templates/system/customerQuote/customerQuote.html index b0a39343..dfdeb624 100644 --- a/ruoyi-admin/src/main/resources/templates/system/customerQuote/customerQuote.html +++ b/ruoyi-admin/src/main/resources/templates/system/customerQuote/customerQuote.html @@ -67,7 +67,7 @@ 添加 - + 导出 @@ -83,7 +83,6 @@ 导出客户报价4 -
@@ -131,7 +130,6 @@ restoreUrl: prefix + "/restore/{id}", detailUrl: prefix + "/detail/{id}", exportUrl: prefix + "/export", - pageList: [5, 10, 25, 50], modalName: "客户报价表", fixedColumns:true, fixedRightNumber:1, @@ -223,6 +221,61 @@ + // 导出 + function exportExcel(formId) { + // $.table.set(); + var supplierCodeData = []; + var selections = $("#bootstrap-table").bootstrapTable("getSelections"); + if(selections.length === 0){ + $.modal.confirm("确定导出所有的客户报价吗?", function() { + var currentId = $.common.isEmpty(formId) ? $('form').attr('id') : formId; + var params = $("#bootstrap-table").bootstrapTable('getOptions'); + var dataParam = $("#" + currentId).serializeArray(); + dataParam.push({ "name": "orderByColumn", "value": params.sortName }); + dataParam.push({ "name": "isAsc", "value": params.sortOrder }); + $.modal.loading("正在导出数据,请稍后..."); + $.post(prefix + '/exportAll', dataParam, function(result) { + if (result.code == web_status.SUCCESS) { + window.location.href = ctx + "common/download?fileName=" + encodeURI(result.msg) + "&delete=" + true; + } else if (result.code == web_status.WARNING) { + $.modal.alertWarning(result.msg) + } else { + $.modal.alertError(result.msg); + } + $.modal.closeLoading(); + }); + }); + }else { + $.modal.confirm("确定导出选中的所有客户报价吗?", function () { + //·拼接单号 + for(let i=0;i