diff --git a/ruoyi-admin/src/main/java/com/ruoyi/system/controller/SysCustomerController.java b/ruoyi-admin/src/main/java/com/ruoyi/system/controller/SysCustomerController.java index 280a5a33..3f85cf41 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/system/controller/SysCustomerController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/system/controller/SysCustomerController.java @@ -156,16 +156,32 @@ public class SysCustomerController extends BaseController /** - * 导出客户基本信息列表 + * 导出选择的客户基本信息列表 */ @RequiresPermissions("system:customer:export") @Log(title = "客户基本信息", businessType = BusinessType.EXPORT) @PostMapping("/export") @ResponseBody - public AjaxResult export(SysCustomerVo sysCustomer) + public AjaxResult export(@RequestBody String[] enterpriseCodes) { - List list = sysCustomerService.selectSysCustomerList(sysCustomer); + List list = sysCustomerService.selectSysCustomerListByEnterpriseCodes(enterpriseCodes); + ExcelUtil util = new ExcelUtil(SysCustomerVo.class); + return util.exportExcel(list, "客户基本信息数据"); + } + + + /** + * 导出所有客户基本信息列表 + */ + + @RequiresPermissions("system:customer:export") + @Log(title = "客户基本信息", businessType = BusinessType.EXPORT) + @PostMapping("/exportAll") + @ResponseBody + public AjaxResult exportAll(SysCustomerVo sysCustomer) + { + List list = sysCustomerService.selectExportSysCustomerList(sysCustomer); ExcelUtil util = new ExcelUtil(SysCustomerVo.class); return util.exportExcel(list, "客户基本信息数据"); } @@ -427,64 +443,62 @@ public class SysCustomerController extends BaseController List list = sysCustomerOperService.selectSysCustomerOperList(sysCustomerOper); return getDataTable(list); } - @RequiresPermissions("system:customer: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); - - - //获取发票基础信息 - SysCustomer sysCustomer = sysCustomerService.selectSysCustomerById(selectDataList.get(0).getId()); - SysCustomerDto sysCustomerDto = new SysCustomerDto(); - BeanUtils.copyProperties(sysCustomer,sysCustomerDto); - - //填充表格 - response.setCharacterEncoding("utf-8"); - String fileName = URLEncoder.encode("国税发票", "UTF-8").replaceAll("\\+", "%20"); - response.setHeader("Content-disposition", "attachment;filename*=utf-8''" + fileName + ".xlsx"); - String templateFileName = "C:\\exportTemplates\\exportCustomerInfo.xlsx"; - try (ExcelWriter excelWriter = EasyExcel.write(response.getOutputStream()).withTemplate(templateFileName).build()) { - WriteSheet writeSheet = EasyExcel.writerSheet().build(); - Map map = MapUtils.newHashMap(); -// map.put("date", DateTimeFormatter.ofPattern("yyyy/MM/dd").format(LocalDateTime.now())); - map.put("unifiedNumbering", sysCustomerDto.getUnifiedNumbering()); - map.put("enterpriseCode", sysCustomerDto.getEnterpriseCode()); - map.put("enterpriseName", sysCustomerDto.getEnterpriseName()); - map.put("englishName", sysCustomerDto.getEnglishName()); - map.put("customerAddress", sysCustomerDto.getCustomerAddress()); - map.put("postalCode", sysCustomerDto.getPostalCode()); - map.put("contactNumber", sysCustomerDto.getContactNumber()); - map.put("customerFax", sysCustomerDto.getCustomerFax()); - map.put("customerContact", sysCustomerDto.getCustomerContact()); - map.put("deliveryAddress", sysCustomerDto.getDeliveryAddress()); - map.put("paymentTerms", sysCustomerDto.getPaymentTerms()); - map.put("taxRate", sysCustomerDto.getTaxRate()); - - List exportSalesData = sysDictTypeService.selectDictDataByType("sys_export_sales"); - for (int i = 0;i commonCurrencyData = sysDictTypeService.selectDictDataByType("sys_common_currency"); - for (int i = 0;i selectDataList = JSONObject.parseArray(String.valueOf(jsonArray), SysCustomerDto.class); +// +// +// //获取发票基础信息 +// SysCustomer sysCustomer = sysCustomerService.selectSysCustomerById(selectDataList.get(0).getId()); +// SysCustomerDto sysCustomerDto = new SysCustomerDto(); +// BeanUtils.copyProperties(sysCustomer,sysCustomerDto); +// +// //填充表格 +// response.setCharacterEncoding("utf-8"); +// String fileName = URLEncoder.encode("国税发票", "UTF-8").replaceAll("\\+", "%20"); +// response.setHeader("Content-disposition", "attachment;filename*=utf-8''" + fileName + ".xlsx"); +// String templateFileName = "C:\\exportTemplates\\exportCustomerInfo.xlsx"; +// try (ExcelWriter excelWriter = EasyExcel.write(response.getOutputStream()).withTemplate(templateFileName).build()) { +// WriteSheet writeSheet = EasyExcel.writerSheet().build(); +// Map map = MapUtils.newHashMap(); +//// map.put("date", DateTimeFormatter.ofPattern("yyyy/MM/dd").format(LocalDateTime.now())); +// map.put("unifiedNumbering", sysCustomerDto.getUnifiedNumbering()); +// map.put("enterpriseCode", sysCustomerDto.getEnterpriseCode()); +// map.put("enterpriseName", sysCustomerDto.getEnterpriseName()); +// map.put("englishName", sysCustomerDto.getEnglishName()); +// map.put("customerAddress", sysCustomerDto.getCustomerAddress()); +// map.put("postalCode", sysCustomerDto.getPostalCode()); +// map.put("contactNumber", sysCustomerDto.getContactNumber()); +// map.put("customerFax", sysCustomerDto.getCustomerFax()); +// map.put("customerContact", sysCustomerDto.getCustomerContact()); +// map.put("deliveryAddress", sysCustomerDto.getDeliveryAddress()); +// map.put("paymentTerms", sysCustomerDto.getPaymentTerms()); +// map.put("taxRate", sysCustomerDto.getTaxRate()); +// +// List exportSalesData = sysDictTypeService.selectDictDataByType("sys_export_sales"); +// for (int i = 0;i commonCurrencyData = sysDictTypeService.selectDictDataByType("sys_common_currency"); +// for (int i = 0;i sysCustomerQuoteList; - @Excel(name = "客户审核状态表示") //0表示审核中,1标识审核通过,2表示审核拒绝 + @Excel(name = "审核状态",dictType = "auditStatus") //0表示审核中,1标识审核通过,2表示审核拒绝 private String auditStatus; - @Excel(name = "客户的状态") + @Excel(name = "使用状态",dictType = "useStatus") private String useStatus; //1表示潜在客户(仅报价) 2表示 客户(已下单) @@ -789,6 +794,16 @@ public class SysCustomer extends BaseEntity this.allowedCreators = allowedCreators; } + @Override + public Date getCreateTime() { + return createTime; + } + + @Override + public void setCreateTime(Date createTime) { + this.createTime = createTime; + } + @Override public String toString() { return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/system/mapper/SysCustomerMapper.java b/ruoyi-admin/src/main/java/com/ruoyi/system/mapper/SysCustomerMapper.java index 6530d657..36e71526 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/system/mapper/SysCustomerMapper.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/system/mapper/SysCustomerMapper.java @@ -107,4 +107,14 @@ public interface SysCustomerMapper * 通过开票公司名称名称查询客户详情 * */ SysCustomerVo selectSysCustomerByInvoiceCompanyName(String invoicingCompanyName); + + /* + * 通过客户编号数组查询客户基本信息集合 + * */ + List selectSysCustomerListByEnterpriseCodes(String[] enterpriseCodes); + + /* + * 筛选查询导出客户基本信息集合 + * */ + List selectExportSysCustomerList(SysCustomerVo sysCustomer); } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/system/service/ISysCustomerService.java b/ruoyi-admin/src/main/java/com/ruoyi/system/service/ISysCustomerService.java index f8030bef..096759e9 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/system/service/ISysCustomerService.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/system/service/ISysCustomerService.java @@ -132,4 +132,14 @@ public interface ISysCustomerService * 角色过滤数据 * */ Set getAllowedCreators(Set roleKeys); + + /** + * 根据客户编号数组查询客户信息集合 + * */ + List selectSysCustomerListByEnterpriseCodes(String[] enterpriseCodes); + + /** + * 筛选查询导出所有的客户基本信息 + * */ + List selectExportSysCustomerList(SysCustomerVo sysCustomer); } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysCustomerServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysCustomerServiceImpl.java index 52216da5..720fb9bd 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysCustomerServiceImpl.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysCustomerServiceImpl.java @@ -215,6 +215,24 @@ public class SysCustomerServiceImpl implements ISysCustomerService } + /** + * 根据客户编号数组查询客户信息集合 + * */ + @Override + public List selectSysCustomerListByEnterpriseCodes(String[] enterpriseCodes) { + List list = sysCustomerMapper.selectSysCustomerListByEnterpriseCodes(enterpriseCodes); + return list; + } + + /** + * 筛选查询导出所有的客户基本信息 + * */ + @Override + public List selectExportSysCustomerList(SysCustomerVo sysCustomer) { + List list = sysCustomerMapper.selectExportSysCustomerList(sysCustomer); + return list; + } + /** * 角色过滤数据 * */ diff --git a/ruoyi-admin/src/main/resources/mapper/system/SysCustomerMapper.xml b/ruoyi-admin/src/main/resources/mapper/system/SysCustomerMapper.xml index bf12d201..1e548ede 100644 --- a/ruoyi-admin/src/main/resources/mapper/system/SysCustomerMapper.xml +++ b/ruoyi-admin/src/main/resources/mapper/system/SysCustomerMapper.xml @@ -72,7 +72,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" established_time,invoicing_customer_name,invoicing_company_name,invoice_code,deposit_bank,bank_account, common_currency,confirm_tax,tax_rate,integrity_rating,rmb_registered_capital,registered_capital,payment_terms,customs_code, customer_contact_id,customer_contact,customer_office,contact_number,customer_email,customer_fax, - delivery_address_id,delivery_customer_person,delivery_customer_phone, + delivery_address_id,delivery_customer_person,delivery_customer_phone,customer_sign, delivery_address,delivery_customer_postal,delivery_customer_fax,business_members, identifying_people,first_add_time,update_info_time, create_time ,audit_status,use_status,update_by, create_by,update_time,rmb_flag,usd_flag, cancel_remark, apply_user,apply_time , instance_id , instance_type from sys_customer @@ -382,4 +382,30 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and enterprise_name like concat(#{prefix}, '%') escape '\\' + + + + \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/templates/erp/developModifyOrder/developModifyOrder.html b/ruoyi-admin/src/main/resources/templates/erp/developModifyOrder/developModifyOrder.html index 684cad9a..38f8e92c 100644 --- a/ruoyi-admin/src/main/resources/templates/erp/developModifyOrder/developModifyOrder.html +++ b/ruoyi-admin/src/main/resources/templates/erp/developModifyOrder/developModifyOrder.html @@ -65,7 +65,7 @@ 添加 - + 导出 @@ -245,9 +245,9 @@ // 审核状态-审核通过 if(row.auditStatus=="1"){ // 编辑 - actions.push('编辑 '); + actions.push('编辑 '); if (row.purchaseStorageStatus == 7 || row.purchaseStorageStatus == 8){ - actions.push('领料 '); + actions.push('领料 '); } } @@ -258,17 +258,18 @@ var todoUserIdList = row.todoUserId.split(","); if(todoUserIdList.includes(loginName) || loginName == 'admin'){ var nodeName = row.taskName=='驳回调整'?' 调整申请':' 审批'; - actions.push(' '+nodeName+' '); + actions.push(' '+nodeName+' '); } } // 审批历史 - actions.push(' 审批历史 '); + actions.push(' 审批历史 '); // 进度查看 - actions.push(' 进度查看 '); + actions.push(' 进度查看 '); } // 详情 - actions.push('详情 '); - return actions.join(''); + actions.push('详情 '); + var actionLinks = actions.join(''); + return $.table.dropdownToggle(actionLinks); } } ] diff --git a/ruoyi-admin/src/main/resources/templates/system/customer/customer.html b/ruoyi-admin/src/main/resources/templates/system/customer/customer.html index 877ac10e..65f6a14a 100644 --- a/ruoyi-admin/src/main/resources/templates/system/customer/customer.html +++ b/ruoyi-admin/src/main/resources/templates/system/customer/customer.html @@ -84,6 +84,9 @@ 添加 + + 导出 + 添加其他联系人明细 @@ -871,6 +874,63 @@ } } function closeInvoice() {$('#invoiceModal').modal("hide");} + + //导出客户资料 + // 导出 + function exportExcel(formId) { + // $.table.set(); + var enterpriseCodeData = []; + 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 \ No newline at end of file