From 97eaf1b70826b54ee203ecc4eb390fd24221ae06 Mon Sep 17 00:00:00 2001 From: liuxiaoxu <1793812695@qq.com> Date: Mon, 2 Sep 2024 14:42:28 +0800 Subject: [PATCH] =?UTF-8?q?[feat]=20=E9=94=80=E5=94=AE=E7=AE=A1=E7=90=86?= =?UTF-8?q?=20=E5=8E=BB=E6=8E=89ry-ui.js=E5=AF=B9table=E7=9A=84=E9=AB=98?= =?UTF-8?q?=E5=BA=A6=E7=9A=84=E7=BB=9F=E4=B8=80=E8=B0=83=E6=95=B4=20?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=E9=94=80=E5=94=AE=E5=87=BA=E8=B4=A7=E8=B5=84?= =?UTF-8?q?=E6=96=99=E7=9A=84=E5=88=97=E8=A1=A8=E6=95=B0=E6=8D=AE=E5=AF=BC?= =?UTF-8?q?=E5=87=BA=E5=90=8E=E7=AB=AF=E6=8E=A5=E5=8F=A3=20=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E9=94=80=E5=94=AE=E5=87=BA=E8=B4=A7=E8=B5=84=E6=96=99?= =?UTF-8?q?=E5=AE=9E=E4=BD=93=E7=B1=BB=E4=B8=AD@Excel=E6=B3=A8=E8=A7=A3?= =?UTF-8?q?=EF=BC=8C=E6=AD=A3=E7=A1=AE=E4=BD=BF=E7=94=A8=E4=B8=8D=E5=90=8C?= =?UTF-8?q?=E7=B1=BB=E5=9E=8B=E7=9A=84=E5=AD=97=E6=AE=B5=20=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=20=E9=80=9A=E8=BF=87=E5=87=BA=E8=B4=A7=E8=B5=84?= =?UTF-8?q?=E6=96=99=E5=8D=95=E5=8F=B7=E6=95=B0=E7=BB=84=E6=9F=A5=E8=AF=A2?= =?UTF-8?q?=E9=94=80=E5=94=AE=E5=87=BA=E8=B4=A7=E8=B5=84=E6=96=99=E9=9B=86?= =?UTF-8?q?=E5=90=88=E5=90=8E=E7=AB=AF=E6=96=B9=E6=B3=95=20=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=E5=AF=BC=E5=87=BA=E5=89=8D=E7=AB=AFjs=E6=96=B9?= =?UTF-8?q?=E6=B3=95=EF=BC=8C=E5=AE=9E=E7=8E=B0=E5=8F=AF=E9=80=89=E6=8B=A9?= =?UTF-8?q?=E4=B8=80=E6=9D=A1=E6=88=96=E8=80=85=E5=A4=9A=E6=9D=A1=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E5=AF=BC=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../SalesShippingInformationController.java | 11 ++-- .../domain/SalesShippingInformation.java | 42 ++++++------- .../SalesShippingInformationMapper.java | 5 ++ .../ISalesShippingInformationService.java | 5 ++ .../SalesShippingInformationServiceImpl.java | 10 +++ .../SysSalesShippingInformServiceImpl.java | 3 +- .../sales/SalesShippingInformationMapper.xml | 10 ++- .../main/resources/static/ruoyi/js/ry-ui.js | 2 +- .../salesShippingInformation.html | 63 +++++++++++++++++-- 9 files changed, 113 insertions(+), 38 deletions(-) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/sales/controller/SalesShippingInformationController.java b/ruoyi-admin/src/main/java/com/ruoyi/sales/controller/SalesShippingInformationController.java index b73a7f4e..18476f00 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/sales/controller/SalesShippingInformationController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/sales/controller/SalesShippingInformationController.java @@ -5,11 +5,7 @@ import org.apache.shiro.authz.annotation.RequiresPermissions; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.ui.ModelMap; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.ResponseBody; +import org.springframework.web.bind.annotation.*; import com.ruoyi.common.annotation.Log; import com.ruoyi.common.enums.BusinessType; import com.ruoyi.sales.domain.SalesShippingInformation; @@ -61,13 +57,14 @@ public class SalesShippingInformationController extends BaseController @Log(title = "销售出货资料", businessType = BusinessType.EXPORT) @PostMapping("/export") @ResponseBody - public AjaxResult export(SalesShippingInformation salesShippingInformation) + public AjaxResult export(@RequestBody String[] shippingInformationCodes) { - List list = salesShippingInformationService.selectSalesShippingInformationList(salesShippingInformation); + List list = salesShippingInformationService.selectShippingInformationListByCodes(shippingInformationCodes); ExcelUtil util = new ExcelUtil(SalesShippingInformation.class); return util.exportExcel(list, "销售出货资料数据"); } + /** * 新增销售出货资料 */ diff --git a/ruoyi-admin/src/main/java/com/ruoyi/sales/domain/SalesShippingInformation.java b/ruoyi-admin/src/main/java/com/ruoyi/sales/domain/SalesShippingInformation.java index be5954f6..d182e180 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/sales/domain/SalesShippingInformation.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/sales/domain/SalesShippingInformation.java @@ -34,7 +34,7 @@ public class SalesShippingInformation extends BaseEntity private String outOrderCode; /** 出货资料类型(0出货箱单、1出货发票、2销售出货单、3出货通知单) */ - @Excel(name = "出货资料类型(0出货箱单、1出货发票、2销售出货单、3出货通知单)") + @Excel(name = "出货资料类型",dictType = "shipping_information_type") private String shippingInformationType; /** 模板类型 */ @@ -42,11 +42,11 @@ public class SalesShippingInformation extends BaseEntity private String shippingTemplateType; /** 出库订单类型(0销售订单、1生产订单、2请购订单、3委外订单、4退换货订单、5开发修改单) */ - @Excel(name = "出库订单类型", readConverterExp = "0=销售订单、1生产订单、2请购订单、3委外订单、4退换货订单、5开发修改单") + @Excel(name = "出库订单类型", dictType = "warehouse_order_type") private String warehouseOrderType; /** 出库类型(0销售出库、1生产领料、2员工领料、3委外领料、4公司退货、5工程领料) */ - @Excel(name = "出库类型", readConverterExp = "0=销售出库、1生产领料、2员工领料、3委外领料、4公司退货、5工程领料") + @Excel(name = "出库类型", dictType = "warehouse_out_type") private String warehouseOutType; /** 业务人员 */ @@ -54,7 +54,7 @@ public class SalesShippingInformation extends BaseEntity private String businessMembers; /** 客户代码/id */ - @Excel(name = "客户代码/id") + @Excel(name = "客户ID") private String customerId; /** 客户名称 */ @@ -68,22 +68,22 @@ public class SalesShippingInformation extends BaseEntity /** 物料合计 */ @Excel(name = "物料合计") - private Long materialSum; + private Integer materialSum; /** 数量合计 */ @Excel(name = "数量合计") - private Long enterpriseSum; + private Integer enterpriseSum; /** 不含税总价(RMB) */ - @Excel(name = "不含税总价", readConverterExp = "R=MB") + @Excel(name = "不含税总价") private BigDecimal allPriceExcludingTaxRmb; /** 不含税总价(美元) */ - @Excel(name = "不含税总价", readConverterExp = "美=元") + @Excel(name = "不含税总价") private BigDecimal allPriceExcludingTaxDollar; /** 含税总价(RMB) */ - @Excel(name = "含税总价", readConverterExp = "R=MB") + @Excel(name = "含税总价") private BigDecimal allPriceIncludesTax; /** 计划交付时间 */ @@ -134,7 +134,6 @@ public class SalesShippingInformation extends BaseEntity private String contactAddressBillto; /** 备注 */ - @Excel(name = "备注") private String remarks; public void setShippingInformationId(Long shippingInformationId) @@ -246,25 +245,24 @@ public class SalesShippingInformation extends BaseEntity return salesOrderNumber; } - public void setMaterialSum(Long materialSum) - { - this.materialSum = materialSum; - } - public Long getMaterialSum() - { + public Integer getMaterialSum() { return materialSum; } - public void setEnterpriseSum(Long enterpriseSum) - { - this.enterpriseSum = enterpriseSum; + + public void setMaterialSum(Integer materialSum) { + this.materialSum = materialSum; } - public Long getEnterpriseSum() - { + public Integer getEnterpriseSum() { return enterpriseSum; } - public void setAllPriceExcludingTaxRmb(BigDecimal allPriceExcludingTaxRmb) + + public void setEnterpriseSum(Integer enterpriseSum) { + this.enterpriseSum = enterpriseSum; + } + + public void setAllPriceExcludingTaxRmb(BigDecimal allPriceExcludingTaxRmb) { this.allPriceExcludingTaxRmb = allPriceExcludingTaxRmb; } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/sales/mapper/SalesShippingInformationMapper.java b/ruoyi-admin/src/main/java/com/ruoyi/sales/mapper/SalesShippingInformationMapper.java index e17ff744..aef4a4bc 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/sales/mapper/SalesShippingInformationMapper.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/sales/mapper/SalesShippingInformationMapper.java @@ -74,4 +74,9 @@ public interface SalesShippingInformationMapper * @return 结果 */ public int restoreSalesShippingInformationById(Long shippingInformationId); + + /** + * 通过出货资料单号数组查询销售出货资料集合 + * */ + List selectShippingInformationListByCodes(String[] shippingInformationCodes); } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/sales/service/ISalesShippingInformationService.java b/ruoyi-admin/src/main/java/com/ruoyi/sales/service/ISalesShippingInformationService.java index b9e46b65..58e26513 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/sales/service/ISalesShippingInformationService.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/sales/service/ISalesShippingInformationService.java @@ -72,4 +72,9 @@ public interface ISalesShippingInformationService * @return */ int restoreSalesShippingInformationById(Long shippingInformationId); + + /** + * 通过出货资料单号数组查询销售出货资料集合 + * */ + List selectShippingInformationListByCodes(String[] shippingInformationCodes); } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/sales/service/impl/SalesShippingInformationServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/sales/service/impl/SalesShippingInformationServiceImpl.java index 48b79ef1..17cfbc97 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/sales/service/impl/SalesShippingInformationServiceImpl.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/sales/service/impl/SalesShippingInformationServiceImpl.java @@ -46,6 +46,16 @@ public class SalesShippingInformationServiceImpl implements ISalesShippingInform return salesShippingInformationMapper.selectSalesShippingInformationList(salesShippingInformation); } + + /** + * 通过出货资料单号数组查询销售出货资料集合 + * */ + @Override + public List selectShippingInformationListByCodes(String[] shippingInformationCodes) { + return salesShippingInformationMapper.selectShippingInformationListByCodes(shippingInformationCodes); + + } + /** * 新增销售出货资料 * diff --git a/ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysSalesShippingInformServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysSalesShippingInformServiceImpl.java index 2f36f19b..eea0ede6 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysSalesShippingInformServiceImpl.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysSalesShippingInformServiceImpl.java @@ -972,7 +972,6 @@ public class SysSalesShippingInformServiceImpl implements ISysSalesShippingInfor shippingInformation.setCreateTime(new Date()); shippingInformation.setBusinessMembers(salesShippingInform.getBusinessMembers()); shippingInformation.setCustomerId(salesShippingInform.getCustomerId()); - shippingInformation.setAcceptanceTime(salesShippingInform.getAcceptanceTime()); shippingInformation.setAllPriceExcludingTaxRmb(salesShippingInform.getAllPriceExcludingTaxRmb()); shippingInformation.setAllPriceExcludingTaxDollar(salesShippingInform.getAllPriceExcludingTaxDollar()); @@ -991,6 +990,8 @@ public class SysSalesShippingInformServiceImpl implements ISysSalesShippingInfor shippingInformation.setRemark(salesShippingInform.getRemark()); shippingInformation.setWarehouseOutType(salesShippingInform.getWarehouseOutType()); shippingInformation.setWarehouseOrderType(salesShippingInform.getWarehouseOrderType()); + shippingInformation.setEnterpriseSum(salesShippingInform.getEnterpriseSum()); + shippingInformation.setMaterialSum(salesShippingInform.getMaterialSum()); int result = salesShippingInformationMapper.insertSalesShippingInformation(shippingInformation); if (result<=0){ throw new BusinessException("插入销售出货资料单失败"); diff --git a/ruoyi-admin/src/main/resources/mapper/sales/SalesShippingInformationMapper.xml b/ruoyi-admin/src/main/resources/mapper/sales/SalesShippingInformationMapper.xml index bc49fc80..ab7bb871 100644 --- a/ruoyi-admin/src/main/resources/mapper/sales/SalesShippingInformationMapper.xml +++ b/ruoyi-admin/src/main/resources/mapper/sales/SalesShippingInformationMapper.xml @@ -62,7 +62,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" where shipping_information_id = #{shippingInformationId} - + + + insert into sales_shipping_information diff --git a/ruoyi-admin/src/main/resources/static/ruoyi/js/ry-ui.js b/ruoyi-admin/src/main/resources/static/ruoyi/js/ry-ui.js index d9aeffbc..1e6bb9f4 100644 --- a/ruoyi-admin/src/main/resources/static/ruoyi/js/ry-ui.js +++ b/ruoyi-admin/src/main/resources/static/ruoyi/js/ry-ui.js @@ -71,7 +71,7 @@ var table = { rightFixedColumns: false, fixedRightNumber: 0, queryParams: $.table.queryParams, - height: $(window).height() - 100, + // height: $(window).height() - 100, rowStyle: {}, }; var options = $.extend(defaults, options); diff --git a/ruoyi-admin/src/main/resources/templates/sales/salesShippingInformation/salesShippingInformation.html b/ruoyi-admin/src/main/resources/templates/sales/salesShippingInformation/salesShippingInformation.html index df5b3cfc..19fa20bd 100644 --- a/ruoyi-admin/src/main/resources/templates/sales/salesShippingInformation/salesShippingInformation.html +++ b/ruoyi-admin/src/main/resources/templates/sales/salesShippingInformation/salesShippingInformation.html @@ -63,12 +63,12 @@
-
+
@@ -213,10 +213,6 @@ title: '收货地址(Bill to)', field: 'contactAddressBillto', }, - { - title: '备注', - field: 'remarks', - }, { title: '录入时间', field: 'createTime', @@ -236,6 +232,61 @@ }; $.table.init(options); }); + + // 导出 + function exportExcel(formId) { + // $.table.set(); + var shippingInformationCodeData = []; + 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