From f5b7fe4e73cab8a449fce684dfe4c89c5d6675e6 Mon Sep 17 00:00:00 2001 From: liuxiaoxu <1793812695@qq.com> Date: Wed, 1 Jan 2025 16:41:31 +0800 Subject: [PATCH 1/2] =?UTF-8?q?[fix]=20=E9=94=80=E5=94=AE=E7=AE=A1?= =?UTF-8?q?=E7=90=86=20=E4=BF=AE=E6=94=B9=E5=AE=A2=E6=88=B7=E6=8A=A5?= =?UTF-8?q?=E4=BB=B7=E7=9A=84=E5=AE=A1=E6=89=B9=E6=B5=81=E7=A8=8B=EF=BC=8C?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=A9=B3=E5=9B=9E=E8=B0=83=E6=95=B4=E4=B8=8D?= =?UTF-8?q?=E5=8F=AF=E7=94=A8=E7=9A=84=E9=97=AE=E9=A2=98=20=E6=8C=89?= =?UTF-8?q?=E7=85=A7=E6=96=B0=E7=89=88=E7=9A=84=E5=AE=A2=E6=88=B7=E6=8A=A5?= =?UTF-8?q?=E4=BB=B7=E6=96=B0=E5=A2=9E=E9=A1=B5=E9=9D=A2=EF=BC=8C=E9=87=8D?= =?UTF-8?q?=E5=86=99=E5=AE=A2=E6=88=B7=E6=8A=A5=E4=BB=B7=E7=9A=84=E8=AF=A6?= =?UTF-8?q?=E6=83=85=E9=A1=B5=E9=9D=A2=E5=92=8C=E7=BC=96=E8=BE=91=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=20=E4=BF=AE=E6=94=B9=E5=AE=A2=E6=88=B7=E6=8A=A5?= =?UTF-8?q?=E4=BB=B7=E7=9A=84=E6=81=A2=E5=A4=8D=E5=90=8E=E7=AB=AF=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=EF=BC=8C=E4=BF=AE=E5=A4=8D=E6=81=A2=E5=A4=8D=E5=8A=9F?= =?UTF-8?q?=E8=83=BD=E6=8A=A5=E9=94=99=E9=97=AE=E9=A2=98=20=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E5=AE=A2=E6=88=B7=E6=8A=A5=E4=BB=B7=E7=9A=84=E7=9B=B8?= =?UTF-8?q?=E5=85=B3=E4=B8=9A=E5=8A=A1=E7=9A=84=E6=89=80=E6=9C=89=E7=89=A9?= =?UTF-8?q?=E6=96=99=E5=90=88=E8=AE=A1=E7=9A=84=E6=95=B0=E9=87=8F=E5=90=88?= =?UTF-8?q?=E8=AE=A1=E7=9A=84=E6=95=B0=E6=8D=AE=E7=B1=BB=E5=9E=8B=E4=B8=BA?= =?UTF-8?q?Integer=20=E4=BF=AE=E6=94=B9=E5=AE=A2=E6=88=B7=E6=8A=A5?= =?UTF-8?q?=E4=BB=B7=E4=BD=9C=E5=BA=9F=E7=9A=84=E6=8F=90=E7=A4=BA=E6=8F=8F?= =?UTF-8?q?=E8=BF=B0=E4=B8=BA=E9=94=80=E5=94=AE=E8=AE=A2=E5=8D=95=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98=20=E6=96=B0=E5=A2=9E=E5=AE=A1=E6=A0=B8?= =?UTF-8?q?=E7=BC=96=E8=BE=91=E5=AE=A2=E6=88=B7=E6=8A=A5=E4=BB=B7=E5=90=8E?= =?UTF-8?q?=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 | 3 +- .../ruoyi/system/domain/SysCustomerQuote.java | 24 +- .../system/domain/SysCustomerQuoteChild.java | 17 +- .../domain/Vo/ExportCustomerQuoteChildVo.java | 2 +- .../Vo/ExportCustomerQuoteDetailVo.java | 6 +- .../service/ISysCustomerQuoteService.java | 2 +- .../impl/SysCustomerQuoteServiceImpl.java | 35 + .../system/customerQuote/customerQuote.html | 2 +- .../system/customerQuote/detail.html | 838 ++++++++++++++---- .../templates/system/customerQuote/edit.html | 672 ++++++++++---- 10 files changed, 1230 insertions(+), 371 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 0e9124c1..4585871a 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 @@ -357,7 +357,8 @@ public class SysCustomerQuoteController extends BaseController @ResponseBody public AjaxResult restore(@PathVariable("id")Long id) { - return AjaxResult.success(sysCustomerQuoteService.restoreSysCustomerById(id)); + sysCustomerQuoteService.restoreSysCustomerById(id); + return AjaxResult.success(); } @RequestMapping("/getCustomerQuoteSelList") 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 9e1b5c45..8bee4df7 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 @@ -42,11 +42,11 @@ public class SysCustomerQuote extends BaseEntity private String pricingDate; /** 物料合计 */ @Excel(name = "物料合计") - private String enterprise; + private Integer enterprise; /** 数量合计 */ @Excel(name = "数量合计") - private Double enterpriseSum; + private Integer enterpriseSum; /** 报价币种 */ @Excel(name = "报价币种",dictType = "sys_common_currency") @@ -198,12 +198,6 @@ public class SysCustomerQuote extends BaseEntity this.pricingDate = pricingDate; } - public void setEnterprise(String enterprise) - { - this.enterprise = enterprise; - } - - public String getEnterprise() {return enterprise;} public String getCommonCurrency() { return commonCurrency; @@ -213,14 +207,22 @@ public class SysCustomerQuote extends BaseEntity this.commonCurrency = commonCurrency; } - public void setEnterpriseSum(Double enterpriseSum) { - this.enterpriseSum = enterpriseSum; + public Integer getEnterprise() { + return enterprise; } - public Double getEnterpriseSum() { + public void setEnterprise(Integer enterprise) { + this.enterprise = enterprise; + } + + public Integer getEnterpriseSum() { return enterpriseSum; } + public void setEnterpriseSum(Integer enterpriseSum) { + this.enterpriseSum = enterpriseSum; + } + public BigDecimal getRmbTax() { return rmbTax; } 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 e86c9a2d..66d81299 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 @@ -74,7 +74,7 @@ public class SysCustomerQuoteChild extends BaseEntity /** 物料数量 */ @Excel(name = "物料数量") - private BigDecimal materialNum; + private Integer materialNum; @Excel(name = "物料对外售价") private BigDecimal materialSole; @@ -235,16 +235,17 @@ public class SysCustomerQuoteChild extends BaseEntity { return usdTax; } - public void setMaterialNum(BigDecimal materialNum) - { - this.materialNum = materialNum; - } - public BigDecimal getMaterialNum() - { + + public Integer getMaterialNum() { return materialNum; } - public void setMaterialRmb(BigDecimal materialRmb) + + public void setMaterialNum(Integer materialNum) { + this.materialNum = materialNum; + } + + public void setMaterialRmb(BigDecimal materialRmb) { this.materialRmb = materialRmb; } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/system/domain/Vo/ExportCustomerQuoteChildVo.java b/ruoyi-admin/src/main/java/com/ruoyi/system/domain/Vo/ExportCustomerQuoteChildVo.java index 564dee9c..6a08c03f 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/system/domain/Vo/ExportCustomerQuoteChildVo.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/system/domain/Vo/ExportCustomerQuoteChildVo.java @@ -16,7 +16,7 @@ public class ExportCustomerQuoteChildVo { /** 物料的数量 */ - private BigDecimal materialNum; + private Integer materialNum; /** 物料的含税单价 */ 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 index 0e367ce4..d5d9d613 100644 --- 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 @@ -37,11 +37,11 @@ public class ExportCustomerQuoteDetailVo{ private String pricingDate; /** 物料合计 */ @Excel(name = "物料合计") - private String enterprise; + private Integer enterprise; /** 数量合计 */ @Excel(name = "数量合计") - private Double enterpriseSum; + private Integer enterpriseSum; /** 报价币种 */ @Excel(name = "报价币种",dictType = "sys_common_currency") @@ -122,7 +122,7 @@ public class ExportCustomerQuoteDetailVo{ /** 物料数量 */ @Excel(name = "物料数量") - private BigDecimal materialNum; + private Integer materialNum; @Excel(name = "物料对外售价") private BigDecimal materialSole; 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 effb77c2..a48c7acc 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 @@ -83,7 +83,7 @@ public interface ISysCustomerQuoteService @Transactional(rollbackFor = Exception.class) ProcessInstance cancelSysCustomerById(Long id); - @Transactional(rollbackFor = Exception.class) + ProcessInstance restoreSysCustomerById(Long id); public ProcessInstance submitApply(SysCustomerQuote sysCustomerQuote); 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 afcf2ce0..dfbea659 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 @@ -347,6 +347,9 @@ public class SysCustomerQuoteServiceImpl implements ISysCustomerQuoteService { } + + + @Transactional(rollbackFor = Exception.class) @Override public ProcessInstance restoreSysCustomerById(Long id) { SysCustomerQuoteVo sysCustomerVo = sysCustomerQuoteMapper.selectSysCustomerQuoteById(id); @@ -379,6 +382,7 @@ public class SysCustomerQuoteServiceImpl implements ISysCustomerQuoteService { * @param sysCustomerQuote * @return */ + @Transactional(rollbackFor = Exception.class) @Override public ProcessInstance submitApply(SysCustomerQuote sysCustomerQuote) { SysUser user = ShiroUtils.getSysUser(); @@ -386,6 +390,8 @@ public class SysCustomerQuoteServiceImpl implements ISysCustomerQuoteService { sysCustomerQuote.setApplyTime(DateUtils.getNowDate()); if(sysCustomerQuote.getId()==null){ insertSysCustomerQuote(sysCustomerQuote); + }else { + updateAuditSysCustomerQuote(sysCustomerQuote); } // 启动流程 @@ -413,6 +419,35 @@ public class SysCustomerQuoteServiceImpl implements ISysCustomerQuoteService { return processInstance; } + /** + * 审核编辑客户报价 + * */ + private int updateAuditSysCustomerQuote(SysCustomerQuote sysCustomerQuote) { + String loginName = ShiroUtils.getLoginName(); + sysCustomerQuote.setUpdateBy(loginName); + sysCustomerQuote.setUpdateTime(DateUtils.getNowDate()); + List sysCustomerQuoteChild = sysCustomerQuote.getSysCustomerQuoteChildList(); + int s = sysCustomerQuoteChild.size(); + if (s > 0){ + for(SysCustomerQuoteChild sysCustomerQuoteChild1 : sysCustomerQuoteChild){ + if (sysCustomerQuoteChild1.getId() == null || sysCustomerQuoteChild1.getId() == 0L){ + sysCustomerQuoteChild1.setQuoteId(sysCustomerQuote.getSupplierCode()); + sysCustomerQuoteChild1.setCreateBy(loginName); + sysCustomerQuoteChild1.setCreateTime(DateUtils.getNowDate()); + sysCustomerQuoteChildMapper.insertSysCustomerQuoteChild(sysCustomerQuoteChild1); + }else { + sysCustomerQuoteChild1.setUpdateBy(loginName); + sysCustomerQuoteChild1.setUpdateTime(DateUtils.getNowDate()); + sysCustomerQuoteChildMapper.updateSysCustomerQuoteChild(sysCustomerQuoteChild1); + } + } + } + int allMaterialNum = sysCustomerQuoteChild.stream().mapToInt(SysCustomerQuoteChild::getMaterialNum).sum(); + sysCustomerQuote.setEnterpriseSum(allMaterialNum); + int updateResult = sysCustomerQuoteMapper.updateSysCustomerQuote(sysCustomerQuote); + return updateResult; + } + private ProcessInstance startProcessInstance(String applyTitle,String instanceType,SysCustomerQuote sysCustomerQuote, SysUser user) { Long nessKey = sysCustomerQuote.getId(); 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 190bdf52..75a00751 100644 --- a/ruoyi-admin/src/main/resources/templates/system/customerQuote/customerQuote.html +++ b/ruoyi-admin/src/main/resources/templates/system/customerQuote/customerQuote.html @@ -302,7 +302,7 @@ // 作废 function cancel(id) { - $.modal.confirm("确定作废该销售订单吗?", function() { + $.modal.confirm("确定作废该客户报价单吗?", function() { var url = prefix + "/cancel/" + id; $.modal.open("作废", url); }) diff --git a/ruoyi-admin/src/main/resources/templates/system/customerQuote/detail.html b/ruoyi-admin/src/main/resources/templates/system/customerQuote/detail.html index 75d0eb9d..41984ef2 100644 --- a/ruoyi-admin/src/main/resources/templates/system/customerQuote/detail.html +++ b/ruoyi-admin/src/main/resources/templates/system/customerQuote/detail.html @@ -1,13 +1,16 @@ - + + + +
-
+ -
-
@@ -25,110 +26,106 @@
- + + + +
- +
- +
-
+ +
- - +
- -
- -
-
-
- +
- +
-
- -
-
- - % -
-
-
- - + +
-
- +
+
+