From 52dfb72782a1ed9cf29ac102b10b7da3b1c863a8 Mon Sep 17 00:00:00 2001 From: liuxiaoxu <1793812695@qq.com> Date: Fri, 13 Dec 2024 14:08:57 +0800 Subject: [PATCH] =?UTF-8?q?[feat]=E9=94=80=E5=94=AE=E7=AE=A1=E7=90=86=20?= =?UTF-8?q?=E5=AE=A2=E6=88=B7=E5=9F=BA=E6=9C=AC=E4=BF=A1=E6=81=AF=E5=88=9B?= =?UTF-8?q?=E5=BB=BA=E6=97=B6=E9=97=B4=E5=8A=A0=E4=B8=8A=E6=97=B6=E9=97=B4?= =?UTF-8?q?=E7=B1=BB=E5=9E=8B=E8=BD=AC=E6=8D=A2=20=E5=AE=A2=E6=88=B7?= =?UTF-8?q?=E6=8A=A5=E4=BB=B7=E5=AE=9E=E4=BD=93=E7=B1=BB=E5=92=8C=E5=AD=90?= =?UTF-8?q?=E8=A1=A8=E5=AE=9E=E4=BD=93=E7=B1=BB=E5=A4=84=E7=90=86=E5=85=B3?= =?UTF-8?q?=E9=94=AE=E5=92=8C=E6=B2=A1=E7=94=A8=E5=AD=97=E6=AE=B5=E7=9A=84?= =?UTF-8?q?@Excel=E6=B3=A8=E8=A7=A3=20=E6=96=B0=E5=A2=9E=E5=AF=BC=E5=87=BA?= =?UTF-8?q?=E5=AE=A2=E6=88=B7=E6=8A=A5=E4=BB=B7=E4=B8=BB=E8=A1=A8=E5=92=8C?= =?UTF-8?q?=E5=AD=90=E8=A1=A8=E7=9A=84=E6=95=B0=E6=8D=AE=E7=9A=84=E5=AE=9E?= =?UTF-8?q?=E4=BD=93=E7=B1=BB=20=E4=BF=AE=E6=94=B9=E5=AE=A2=E6=88=B7?= =?UTF-8?q?=E6=8A=A5=E4=BB=B7=E7=9A=84=E5=AF=BC=E5=87=BA=E6=96=B9=E6=B3=95?= =?UTF-8?q?=EF=BC=8C=E7=8E=B0=E5=9C=A8=E5=AF=BC=E5=87=BA=E7=9A=84=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E7=94=B1=E4=B8=80=E6=9D=A1=E4=B8=BB=E8=A1=A8=E5=AF=B9?= =?UTF-8?q?=E5=BA=94=E4=B8=80=E6=9D=A1=E5=AD=90=E8=A1=A8=E7=BB=84=E6=88=90?= =?UTF-8?q?=20=E5=AE=A2=E6=88=B7=E6=8A=A5=E4=BB=B7=E6=96=B0=E5=A2=9E=20?= =?UTF-8?q?=E5=AF=BC=E5=87=BA=E5=AE=A2=E6=88=B7=E6=8A=A5=E4=BB=B7=E6=98=8E?= =?UTF-8?q?=E7=BB=86=E6=96=B9=E6=B3=95=20=E4=BF=AE=E6=94=B9=20=E6=A0=B9?= =?UTF-8?q?=E6=8D=AE=E4=BE=9B=E5=BA=94=E5=95=86=E7=BC=96=E7=A0=81=E6=95=B0?= =?UTF-8?q?=E7=BB=84=E6=9F=A5=E8=AF=A2=E5=AE=A2=E6=88=B7=E6=8A=A5=E4=BB=B7?= =?UTF-8?q?=E4=BF=A1=E6=81=AF=E9=9B=86=E5=90=88=E6=96=B9=E6=B3=95=E7=9A=84?= =?UTF-8?q?=E8=BF=94=E5=9B=9E=E5=80=BC=20=E5=AE=A2=E6=88=B7=E6=8A=A5?= =?UTF-8?q?=E4=BB=B7=E5=AD=90=E8=A1=A8=E6=96=B0=E5=A2=9E=20=E6=A0=B9?= =?UTF-8?q?=E6=8D=AE=E5=AE=A2=E6=88=B7=E6=8A=A5=E4=BB=B7=E7=BC=96=E7=A0=81?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E4=BE=9B=E5=BA=94=E5=95=86=E6=8A=A5=E4=BB=B7?= =?UTF-8?q?=E5=AD=90=E8=A1=A8=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../SysCustomerQuoteController.java | 20 ++- .../com/ruoyi/system/domain/SysCustomer.java | 2 +- .../ruoyi/system/domain/SysCustomerQuote.java | 19 +- .../system/domain/SysCustomerQuoteChild.java | 79 ++++----- .../Vo/ExportCustomerQuoteDetailVo.java | 167 ++++++++++++++++++ .../mapper/SysCustomerQuoteChildMapper.java | 5 + .../system/mapper/SysCustomerQuoteMapper.java | 2 +- .../service/ISysCustomerQuoteService.java | 8 +- .../impl/SysCustomerQuoteServiceImpl.java | 72 +++++++- .../system/SysCustomerQuoteChildMapper.xml | 12 ++ .../system/customerQuote/customerQuote.html | 146 +++++++-------- 11 files changed, 403 insertions(+), 129 deletions(-) create mode 100644 ruoyi-admin/src/main/java/com/ruoyi/system/domain/Vo/ExportCustomerQuoteDetailVo.java 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 e567c59a..0e9124c1 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 @@ -16,6 +16,7 @@ import com.ruoyi.erp.domain.ErpMaterialVo; import com.ruoyi.process.general.service.IProcessService; import com.ruoyi.remind.service.RemindService; import com.ruoyi.system.domain.*; +import com.ruoyi.system.domain.Vo.ExportCustomerQuoteDetailVo; import com.ruoyi.system.domain.exportDto.SysCustomerDto; import com.ruoyi.system.mapper.SysCustomerQuoteChildMapper; import com.ruoyi.system.service.*; @@ -39,10 +40,8 @@ import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpSession; import java.io.IOException; import java.math.BigDecimal; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; -import java.util.Set; +import java.util.*; +import java.util.function.Function; import java.util.stream.Collectors; /** @@ -382,13 +381,16 @@ public class SysCustomerQuoteController extends BaseController { if (StringUtils.isEmpty(ids)){ List list = sysCustomerQuoteService.exportSysCustomerQuoteList(sysCustomerQuoteVo); - ExcelUtil util = new ExcelUtil(SysCustomerQuoteVo.class); - return util.exportExcel(list, "客户报价数据"); + List exportCustomerQuoteDetailVos = sysCustomerQuoteService.exportCustomerQuoteDetailList(list); + + ExcelUtil util = new ExcelUtil(ExportCustomerQuoteDetailVo.class); + return util.exportExcel(exportCustomerQuoteDetailVos, "客户报价数据"); }else { String[] supplierCodes = ids.split(","); - List list = sysCustomerQuoteService.selectCustomerQuoteOneBySupplierCodes(supplierCodes);//客户报价编号 - ExcelUtil util = new ExcelUtil(SysCustomerQuote.class); - return util.exportExcel(list, ids); + List list = sysCustomerQuoteService.selectCustomerQuoteOneBySupplierCodes(supplierCodes);//客户报价编号 + List exportCustomerQuoteDetailVos = sysCustomerQuoteService.exportCustomerQuoteDetailList(list); + ExcelUtil util = new ExcelUtil(ExportCustomerQuoteDetailVo.class); + return util.exportExcel(exportCustomerQuoteDetailVos, ids); } } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/system/domain/SysCustomer.java b/ruoyi-admin/src/main/java/com/ruoyi/system/domain/SysCustomer.java index ef03b9cf..37f44cc4 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/system/domain/SysCustomer.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/system/domain/SysCustomer.java @@ -219,7 +219,7 @@ public class SysCustomer extends BaseEntity @Excel(name = "修改时间") private String updateInfoTime; - @Excel(name = "录入时间", dateFormat = "yyyy-MM-dd HH:mm:ss",sort = 3) + @Excel(name = "创建时间", dateFormat = "yyyy-MM-dd HH:mm:ss",sort = 3) private Date createTime; /** 备注内容 */ diff --git a/ruoyi-admin/src/main/java/com/ruoyi/system/domain/SysCustomerQuote.java b/ruoyi-admin/src/main/java/com/ruoyi/system/domain/SysCustomerQuote.java index 6caaf7cd..9e1b5c45 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/system/domain/SysCustomerQuote.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/system/domain/SysCustomerQuote.java @@ -26,7 +26,7 @@ public class SysCustomerQuote extends BaseEntity private Long id; /** 客户报价编号 */ - @Excel(name = "客户报价编号") + @Excel(name = "客户报价编号",sort = 1) private String supplierCode; /** 客户的编号 */ @@ -49,7 +49,7 @@ public class SysCustomerQuote extends BaseEntity private Double enterpriseSum; /** 报价币种 */ - @Excel(name = "报价币种") + @Excel(name = "报价币种",dictType = "sys_common_currency") private String commonCurrency; /*是否含税*/ private String confirmTax; @@ -104,6 +104,8 @@ public class SysCustomerQuote extends BaseEntity private String instanceType; private String cancelInstanceId; private String restoreInstanceId; + + @Excel(name = "客户报价详情信息") private List sysCustomerQuoteChildList; @@ -114,6 +116,9 @@ public class SysCustomerQuote extends BaseEntity private String materialName; + @Excel(name = "创建时间", dateFormat = "yyyy-MM-dd HH:mm:ss",sort = 2) + private Date createTime; + public String getConfirmTax() { return confirmTax; } @@ -401,6 +406,16 @@ public class SysCustomerQuote extends BaseEntity this.materialName = materialName; } + @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/domain/SysCustomerQuoteChild.java b/ruoyi-admin/src/main/java/com/ruoyi/system/domain/SysCustomerQuoteChild.java index 5fc915f7..e86c9a2d 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/system/domain/SysCustomerQuoteChild.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/system/domain/SysCustomerQuoteChild.java @@ -21,15 +21,14 @@ public class SysCustomerQuoteChild extends BaseEntity private Long id; /** 主表的中关联的id字段 */ - @Excel(name = "主表的中关联的id字段") + private String quoteId; /** 物料表中的id */ - @Excel(name = "物料表中的id") private Long materialId; /** 物料表中的编号 */ - @Excel(name = "物料表中的编号") + @Excel(name = "物料号") private String materialCode; /** 物料的名称 */ @@ -37,32 +36,32 @@ public class SysCustomerQuoteChild extends BaseEntity private String materialName; /** 物料的类型 */ - @Excel(name = "物料的类型") + @Excel(name = "物料类型") private String materialType; - /** 物料的加工方式 */ - @Excel(name = "物料的加工方式") + /** 物料加工方式 */ + @Excel(name = "物料加工方式") private String processMethod; - /** 物料的型号 */ - @Excel(name = "物料的型号") + /** 物料型号 */ + @Excel(name = "物料型号") private String materialModel; - /** 物料的单位 */ - @Excel(name = "物料的单位") + /** 物料单位 */ + @Excel(name = "物料单位") private String unit; - /** 物料的品牌 */ - @Excel(name = "物料的品牌") + /** 物料品牌 */ + @Excel(name = "物料品牌") private String brand; - /** 物料的图片 */ - @Excel(name = "物料的图片") + /** 物料图片 */ + @Excel(name = "物料图片") private String photoUrl; - /** 物料的描述 */ - @Excel(name = "物料的描述") + /** 物料描述 */ + @Excel(name = "物料描述") private String describe; /** 国内税率 */ @@ -73,56 +72,56 @@ public class SysCustomerQuoteChild extends BaseEntity @Excel(name = "美元汇率") private BigDecimal usdTax; - /** 物料的数量 */ - @Excel(name = "物料的数量") + /** 物料数量 */ + @Excel(name = "物料数量") private BigDecimal materialNum; - @Excel(name = "物料的对外售价") + @Excel(name = "物料对外售价") private BigDecimal materialSole; - @Excel(name = "物料的最新报价(RMB)") + @Excel(name = "物料最新报价(RMB)") private BigDecimal recentQuotationRMB; - @Excel(name = "物料的最新报价(RMB)") + @Excel(name = "物料最新报价(RMB)") private BigDecimal recentQuotationUSD; - /** 物料的含税单价(RMB) */ - @Excel(name = "物料的含税单价(RMB) ") + /** 物料含税单价(RMB) */ + @Excel(name = "物料含税单价(RMB) ") private BigDecimal materialRmb; - /** 物料的不含税单价(RMB) */ - @Excel(name = "物料的不含税单价(RMB)") + /** 物料不含税单价(RMB) */ + @Excel(name = "物料不含税单价(RMB)") private BigDecimal materialNoRmb; - /** 物料的不含税单价(USD) */ - @Excel(name = "物料的不含税单价(USD)") + /** 物料不含税单价(USD) */ + @Excel(name = "物料不含税单价(USD)") private BigDecimal materialNoUsd; - /** 物料的含税单价(USD) */ - @Excel(name = "物料的含税单价(USD)") + /** 物料含税单价(USD) */ + @Excel(name = "物料含税单价(USD)") private BigDecimal materialUsd; - /** 物料的含税总价(USD) */ - @Excel(name = "物料的含税总价(USD)") + /** 物料含税总价(USD) */ + @Excel(name = "物料含税总价(USD)") private BigDecimal materialUsdSum; - /** 物料的不含税总价(USD) */ - @Excel(name = "物料的不含税总价(USD)") + /** 物料不含税总价(USD) */ + @Excel(name = "物料不含税总价(USD)") private BigDecimal materialNoUsdSum; - /** 物料的不含税总价(RMB) */ - @Excel(name = "物料的不含税总价(RMB)") + /** 物料不含税总价(RMB) */ + @Excel(name = "物料不含税总价(RMB)") private BigDecimal materialNoRmbSum; - /** 物料的含税总价(RMB) */ - @Excel(name = "物料的含税总价(RMB)") + /** 物料含税总价(RMB) */ + @Excel(name = "物料含税总价(RMB)") private BigDecimal materialRmbSum; /** 审核状态 */ - @Excel(name = "审核状态") + private String deginFlag; - @Excel(name = "审核状态") + private String auditStatus; - @Excel(name = "删除状态") + private String useStatus; /** 删除标志 */ diff --git a/ruoyi-admin/src/main/java/com/ruoyi/system/domain/Vo/ExportCustomerQuoteDetailVo.java b/ruoyi-admin/src/main/java/com/ruoyi/system/domain/Vo/ExportCustomerQuoteDetailVo.java new file mode 100644 index 00000000..0e367ce4 --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/system/domain/Vo/ExportCustomerQuoteDetailVo.java @@ -0,0 +1,167 @@ +package com.ruoyi.system.domain.Vo; + +import com.ruoyi.common.annotation.Excel; + +import lombok.Data; + +import java.math.BigDecimal; +import java.util.Date; +import java.util.List; + +/** +* 导出客户报价主表和子表的数据 +* */ +@Data +public class ExportCustomerQuoteDetailVo{ + + + + /** 客户报价编号 */ + @Excel(name = "客户报价编号",sort = 1) + private String supplierCode; + + @Excel(name = "创建时间", dateFormat = "yyyy-MM-dd HH:mm:ss",sort = 2) + private Date createTime; + + + /** 客户的编号 */ + @Excel(name = "客户的编号") + private String customerCode; + + /** 客户名称 */ + @Excel(name = "客户名称") + private String customerName; + + /*订价日期*/ + @Excel(name = "订价日期") + private String pricingDate; + /** 物料合计 */ + @Excel(name = "物料合计") + private String enterprise; + + /** 数量合计 */ + @Excel(name = "数量合计") + private Double enterpriseSum; + + /** 报价币种 */ + @Excel(name = "报价币种",dictType = "sys_common_currency") + private String commonCurrency; + /*是否含税*/ + + + + /** 国内汇率 */ + @Excel(name = "国内汇率") + private BigDecimal rmbTax; + + /** 美元汇率 */ + @Excel(name = "美元汇率") + private BigDecimal usdTax; + + /** 不含税总价(RMB) */ + @Excel(name = "不含税总价(RMB)") + private BigDecimal noRmbSum; + @Excel(name = "不含税单价(RMB)") + private BigDecimal noRmb; + @Excel(name = "含税单价(RMB)") + private BigDecimal rmb; + /** 含税总价(RMB) */ + @Excel(name = "含税总价(RMB)") + private BigDecimal rmbSum; + + /** 不含税单价(美元) */ + @Excel(name = "不含税单价(美元)") + private BigDecimal noUsd; + /** 不含税总价(美元) */ + @Excel(name = "不含税总价(美元)") + private BigDecimal noUsdSum; + /** 含税单价(美元) */ + @Excel(name = "含税单价(美元)") + private BigDecimal usd; + /** 含税总价(美元) */ + @Excel(name = "含税总价(美元)") + private BigDecimal usdSum; + + + + /** 物料表中的编号 */ + @Excel(name = "物料号") + private String materialCode; + + /** 物料的名称 */ + @Excel(name = "物料的名称") + private String materialName; + + /** 物料的类型 */ + private String materialType; + + /** 物料加工方式 */ + @Excel(name = "物料加工方式",dictType = "processMethod") + private String processMethod; + + + /** 物料型号 */ + @Excel(name = "物料型号") + private String materialModel; + + /** 物料单位 */ + @Excel(name = "物料单位") + private String unit; + + /** 物料品牌 */ + @Excel(name = "物料品牌") + private String brand; + + /** 物料图片 */ + @Excel(name = "物料图片") + private String photoUrl; + + /** 物料描述 */ + @Excel(name = "物料描述") + private String describe; + + /** 物料数量 */ + @Excel(name = "物料数量") + private BigDecimal materialNum; + @Excel(name = "物料对外售价") + private BigDecimal materialSole; + + @Excel(name = "物料最新报价(RMB)") + private BigDecimal recentQuotationRMB; + + @Excel(name = "物料最新报价(RMB)") + private BigDecimal recentQuotationUSD; + + /** 物料含税单价(RMB) */ + @Excel(name = "物料含税单价(RMB) ") + private BigDecimal materialRmb; + + /** 物料不含税单价(RMB) */ + @Excel(name = "物料不含税单价(RMB)") + private BigDecimal materialNoRmb; + + /** 物料不含税单价(USD) */ + @Excel(name = "物料不含税单价(USD)") + private BigDecimal materialNoUsd; + + /** 物料含税单价(USD) */ + @Excel(name = "物料含税单价(USD)") + private BigDecimal materialUsd; + + /** 物料含税总价(USD) */ + @Excel(name = "物料含税总价(USD)") + private BigDecimal materialUsdSum; + + /** 物料不含税总价(USD) */ + @Excel(name = "物料不含税总价(USD)") + private BigDecimal materialNoUsdSum; + + /** 物料不含税总价(RMB) */ + @Excel(name = "物料不含税总价(RMB)") + private BigDecimal materialNoRmbSum; + + /** 物料含税总价(RMB) */ + @Excel(name = "物料含税总价(RMB)") + private BigDecimal materialRmbSum; + +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/system/mapper/SysCustomerQuoteChildMapper.java b/ruoyi-admin/src/main/java/com/ruoyi/system/mapper/SysCustomerQuoteChildMapper.java index ef6969b7..2e192905 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/system/mapper/SysCustomerQuoteChildMapper.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/system/mapper/SysCustomerQuoteChildMapper.java @@ -24,4 +24,9 @@ public interface SysCustomerQuoteChildMapper { * 检查客户报价子表是否引用了物料 * */ int checkMaterialIsReferencedByCustomerQuoteChild(String materialNo); + + /** + * 根据客户报价编码查询供应商报价子表 + * */ + List selectSysCustomerQuoteChildListByQuoteIdList(List supplierCodeList); } 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 fc838c30..1189d6fc 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 @@ -109,5 +109,5 @@ public interface SysCustomerQuoteMapper /** * 根据供应商编码数组查询客户报价信息集合 * */ - List selectCustomerQuoteOneBySupplierCodes(String[] supplierCodes); + 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 59566254..effb77c2 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 @@ -3,6 +3,7 @@ package com.ruoyi.system.service; import com.ruoyi.erp.domain.ErpMaterial; import com.ruoyi.system.domain.SysCustomerQuote; import com.ruoyi.system.domain.SysCustomerQuoteVo; +import com.ruoyi.system.domain.Vo.ExportCustomerQuoteDetailVo; import org.activiti.engine.runtime.ProcessInstance; import org.springframework.transaction.annotation.Transactional; @@ -111,7 +112,7 @@ public interface ISysCustomerQuoteService /** * 根据供应商编码数组查询客户报价信息集合 * */ - List selectCustomerQuoteOneBySupplierCodes(String[] supplierCodes); + List selectCustomerQuoteOneBySupplierCodes(String[] supplierCodes); /** * 通过用户名找到业务登录名,重新给业务员赋值 @@ -122,4 +123,9 @@ public interface ISysCustomerQuoteService * 根据客户报价对象作废客户报价 * */ int cancelSysCustomerQuoteByObject(SysCustomerQuote sysCustomerQuote); + + /** + * 导出客户报价明细 + * */ + List exportCustomerQuoteDetailList(List list); } 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 dfbae80e..f7236059 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 @@ -20,6 +20,7 @@ import com.ruoyi.process.general.service.IProcessService; import com.ruoyi.process.todoitem.mapper.BizTodoItemMapper; import com.ruoyi.system.domain.*; import com.ruoyi.system.domain.Vo.ExportCustomerQuoteChildVo; +import com.ruoyi.system.domain.Vo.ExportCustomerQuoteDetailVo; import com.ruoyi.system.domain.Vo.ExportSalesOrderChildVo; import com.ruoyi.system.domain.Vo.ExportSalesOrderVo; import com.ruoyi.system.mapper.*; @@ -40,6 +41,8 @@ import java.io.IOException; import java.math.BigDecimal; import java.net.URLEncoder; import java.util.*; +import java.util.function.Function; +import java.util.stream.Collectors; @Slf4j @Service @@ -97,8 +100,8 @@ public class SysCustomerQuoteServiceImpl implements ISysCustomerQuoteService { * 根据供应商编码数组查询客户报价信息集合 * */ @Override - public List selectCustomerQuoteOneBySupplierCodes(String[] supplierCodes) { - List list = sysCustomerQuoteMapper.selectCustomerQuoteOneBySupplierCodes(supplierCodes); + public List selectCustomerQuoteOneBySupplierCodes(String[] supplierCodes) { + List list = sysCustomerQuoteMapper.selectCustomerQuoteOneBySupplierCodes(supplierCodes); return list; } @@ -733,4 +736,69 @@ public class SysCustomerQuoteServiceImpl implements ISysCustomerQuoteService { } + + /** + * 导出客户报价明细 + * */ + @Override + public List exportCustomerQuoteDetailList(List list) { + List exportCustomerQuoteDetailVos = new ArrayList<>(); + List collectSupplierCodes = list.stream().map(SysCustomerQuoteVo::getSupplierCode).collect(Collectors.toList()); + + Map sysCustomerQuoteMap = list.stream().collect(Collectors.toMap(SysCustomerQuote::getSupplierCode, Function.identity())); + List sysCustomerQuoteChildren = sysCustomerQuoteChildMapper.selectSysCustomerQuoteChildListByQuoteIdList(collectSupplierCodes); + + //HashMap sysCustomerQuoteMap = new HashMap<>(); + + for (SysCustomerQuoteChild sysCustomerQuoteChild : sysCustomerQuoteChildren) { + ExportCustomerQuoteDetailVo exportCustomerQuoteDetailVo = new ExportCustomerQuoteDetailVo(); + String quoteId = sysCustomerQuoteChild.getQuoteId(); + SysCustomerQuote tempCustomerQuoteVo = sysCustomerQuoteMap.get(quoteId); + exportCustomerQuoteDetailVo.setCustomerName(tempCustomerQuoteVo.getCustomerName()); + exportCustomerQuoteDetailVo.setCustomerCode(tempCustomerQuoteVo.getCustomerCode()); + exportCustomerQuoteDetailVo.setSupplierCode(tempCustomerQuoteVo.getSupplierCode()); + exportCustomerQuoteDetailVo.setEnterprise(tempCustomerQuoteVo.getEnterprise()); + exportCustomerQuoteDetailVo.setEnterpriseSum(tempCustomerQuoteVo.getEnterpriseSum()); + exportCustomerQuoteDetailVo.setNoRmb(tempCustomerQuoteVo.getNoRmb()); + exportCustomerQuoteDetailVo.setNoUsd(tempCustomerQuoteVo.getNoUsd()); + exportCustomerQuoteDetailVo.setRmb(tempCustomerQuoteVo.getRmb()); + exportCustomerQuoteDetailVo.setUsd(tempCustomerQuoteVo.getUsd()); + + exportCustomerQuoteDetailVo.setRmbSum(tempCustomerQuoteVo.getRmbSum()); + exportCustomerQuoteDetailVo.setUsdSum(tempCustomerQuoteVo.getUsdSum()); + exportCustomerQuoteDetailVo.setNoRmbSum(tempCustomerQuoteVo.getNoRmbSum()); + exportCustomerQuoteDetailVo.setNoUsdSum(tempCustomerQuoteVo.getNoUsdSum()); + exportCustomerQuoteDetailVo.setCreateTime(tempCustomerQuoteVo.getCreateTime()); + exportCustomerQuoteDetailVo.setPricingDate(tempCustomerQuoteVo.getPricingDate()); + exportCustomerQuoteDetailVo.setCommonCurrency(tempCustomerQuoteVo.getCommonCurrency()); + exportCustomerQuoteDetailVo.setRmbTax(tempCustomerQuoteVo.getRmbTax()); + exportCustomerQuoteDetailVo.setUsdTax(tempCustomerQuoteVo.getUsdTax()); + + + exportCustomerQuoteDetailVo.setMaterialCode(sysCustomerQuoteChild.getMaterialCode()); + exportCustomerQuoteDetailVo.setMaterialName(sysCustomerQuoteChild.getMaterialName()); + exportCustomerQuoteDetailVo.setMaterialRmb(sysCustomerQuoteChild.getMaterialRmb()); + exportCustomerQuoteDetailVo.setMaterialNoRmb(sysCustomerQuoteChild.getMaterialNoRmb()); + exportCustomerQuoteDetailVo.setMaterialNoUsd(sysCustomerQuoteChild.getMaterialNoUsd()); + exportCustomerQuoteDetailVo.setMaterialUsd(sysCustomerQuoteChild.getMaterialUsd()); + exportCustomerQuoteDetailVo.setMaterialRmbSum(sysCustomerQuoteChild.getMaterialRmbSum()); + exportCustomerQuoteDetailVo.setMaterialNoRmbSum(sysCustomerQuoteChild.getMaterialNoRmbSum()); + exportCustomerQuoteDetailVo.setMaterialUsdSum(sysCustomerQuoteChild.getMaterialUsdSum()); + exportCustomerQuoteDetailVo.setMaterialNoUsdSum(sysCustomerQuoteChild.getMaterialNoUsdSum()); + exportCustomerQuoteDetailVo.setDescribe(sysCustomerQuoteChild.getDescribe()); + exportCustomerQuoteDetailVo.setMaterialNum(sysCustomerQuoteChild.getMaterialNum()); + exportCustomerQuoteDetailVo.setBrand(sysCustomerQuoteChild.getBrand()); + exportCustomerQuoteDetailVo.setUnit(sysCustomerQuoteChild.getUnit()); + exportCustomerQuoteDetailVo.setMaterialModel(sysCustomerQuoteChild.getMaterialModel()); + exportCustomerQuoteDetailVo.setProcessMethod(sysCustomerQuoteChild.getProcessMethod()); + exportCustomerQuoteDetailVo.setMaterialType(sysCustomerQuoteChild.getMaterialType()); + exportCustomerQuoteDetailVo.setRecentQuotationRMB(sysCustomerQuoteChild.getRecentQuotationRMB()); + exportCustomerQuoteDetailVo.setRecentQuotationUSD(sysCustomerQuoteChild.getRecentQuotationUSD()); + exportCustomerQuoteDetailVo.setMaterialSole(sysCustomerQuoteChild.getMaterialSole()); + + + exportCustomerQuoteDetailVos.add(exportCustomerQuoteDetailVo); + } + return exportCustomerQuoteDetailVos; + } } diff --git a/ruoyi-admin/src/main/resources/mapper/system/SysCustomerQuoteChildMapper.xml b/ruoyi-admin/src/main/resources/mapper/system/SysCustomerQuoteChildMapper.xml index 17f75aae..a135ca1a 100644 --- a/ruoyi-admin/src/main/resources/mapper/system/SysCustomerQuoteChildMapper.xml +++ b/ruoyi-admin/src/main/resources/mapper/system/SysCustomerQuoteChildMapper.xml @@ -69,6 +69,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" select count(1) from sys_customer_quotechild where materialCode = #{materialCode} + + insert into sys_customer_quotechild 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 8dc5c899..c4603220 100644 --- a/ruoyi-admin/src/main/resources/templates/system/customerQuote/customerQuote.html +++ b/ruoyi-admin/src/main/resources/templates/system/customerQuote/customerQuote.html @@ -193,79 +193,79 @@ {title: '国内汇率',field: 'rmbTax',align: 'center'}, {title: '美元汇率',field: 'usdTax',align: 'center'}, - {title: '不含税单价(RMB)',field: 'noRmb',align: 'center', - footerFormatter: function (value) { - var sum = 0; - for (var i in value) { - sum += parseFloat(value[i].noRmb) || 0; - } - return "总不含税单价(RMB): " + sum.toFixed(2); - } - }, - {title: '含税单价(RMB)',field: 'rmb',align: 'center', - footerFormatter: function (value) { - var sum = 0; - for (var i in value) { - sum += parseFloat(value[i].rmb) || 0; - } - return "总含税单价(RMB): " + sum.toFixed(2); - } - }, - {title: '不含税单价($)',field: 'noUsd',align: 'center', - footerFormatter: function (value) { - var sum = 0; - for (var i in value) { - sum += parseFloat(value[i].noUsd) || 0; - } - return "总不含税单价($): " + sum.toFixed(2); - } - }, - {title: '含税单价($)',field: 'usd',align: 'center', - footerFormatter: function (value) { - var sum = 0; - for (var i in value) { - sum += parseFloat(value[i].usd) || 0; - } - return "总含税单价($): " + sum.toFixed(2); - } - }, - - {title: '不含税总价(RMB)',field: 'noRmbSum',align: 'center', - footerFormatter: function (value) { - var sum = 0; - for (var i in value) { - sum += parseFloat(value[i].noRmbSum) || 0; - } - return "总不含税总价(RMB): " + sum.toFixed(2); - } - }, - {title: '含税总价(RMB)',field: 'rmbSum',align: 'center', - footerFormatter: function (value) { - var sum = 0; - for (var i in value) { - sum += parseFloat(value[i].rmbSum) || 0; - } - return "总含税总价(RMB): " + sum.toFixed(2); - } - }, - {title: '不含税总价($)',field: 'noUsdSum',align: 'center', - footerFormatter: function (value) { - var sum = 0; - for (var i in value) { - sum += parseFloat(value[i].noUsdSum) || 0; - } - return "总不含税总价($): " + sum.toFixed(2); - } - }, - {title: '含税总价($)',field: 'usdSum',align: 'center', - footerFormatter: function (value) { - var sum = 0; - for (var i in value) { - sum += parseFloat(value[i].usdSum) || 0; - } - return "总含税总价($): " + sum.toFixed(2); - } - }, + // {title: '不含税单价(RMB)',field: 'noRmb',align: 'center', + // footerFormatter: function (value) { + // var sum = 0; + // for (var i in value) { + // sum += parseFloat(value[i].noRmb) || 0; + // } + // return "总不含税单价(RMB): " + sum.toFixed(2); + // } + // }, + // {title: '含税单价(RMB)',field: 'rmb',align: 'center', + // footerFormatter: function (value) { + // var sum = 0; + // for (var i in value) { + // sum += parseFloat(value[i].rmb) || 0; + // } + // return "总含税单价(RMB): " + sum.toFixed(2); + // } + // }, + // {title: '不含税单价($)',field: 'noUsd',align: 'center', + // footerFormatter: function (value) { + // var sum = 0; + // for (var i in value) { + // sum += parseFloat(value[i].noUsd) || 0; + // } + // return "总不含税单价($): " + sum.toFixed(2); + // } + // }, + // {title: '含税单价($)',field: 'usd',align: 'center', + // footerFormatter: function (value) { + // var sum = 0; + // for (var i in value) { + // sum += parseFloat(value[i].usd) || 0; + // } + // return "总含税单价($): " + sum.toFixed(2); + // } + // }, + // + // {title: '不含税总价(RMB)',field: 'noRmbSum',align: 'center', + // footerFormatter: function (value) { + // var sum = 0; + // for (var i in value) { + // sum += parseFloat(value[i].noRmbSum) || 0; + // } + // return "总不含税总价(RMB): " + sum.toFixed(2); + // } + // }, + // {title: '含税总价(RMB)',field: 'rmbSum',align: 'center', + // footerFormatter: function (value) { + // var sum = 0; + // for (var i in value) { + // sum += parseFloat(value[i].rmbSum) || 0; + // } + // return "总含税总价(RMB): " + sum.toFixed(2); + // } + // }, + // {title: '不含税总价($)',field: 'noUsdSum',align: 'center', + // footerFormatter: function (value) { + // var sum = 0; + // for (var i in value) { + // sum += parseFloat(value[i].noUsdSum) || 0; + // } + // return "总不含税总价($): " + sum.toFixed(2); + // } + // }, + // {title: '含税总价($)',field: 'usdSum',align: 'center', + // footerFormatter: function (value) { + // var sum = 0; + // for (var i in value) { + // sum += parseFloat(value[i].usdSum) || 0; + // } + // return "总含税总价($): " + sum.toFixed(2); + // } + // }, {title: '使用状态',field: 'useStatus',align: 'center', formatter: function (value, row, index) {return $.table.selectDictLabel(useStatusDatas, value);}, },