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/erp/material/material.html b/ruoyi-admin/src/main/resources/templates/erp/material/material.html index 785eb4de..ff1c24f4 100644 --- a/ruoyi-admin/src/main/resources/templates/erp/material/material.html +++ b/ruoyi-admin/src/main/resources/templates/erp/material/material.html @@ -190,10 +190,10 @@ }, {title: '料号',field: 'materialNo',align: 'center'}, {title: '物料名称',field: 'materialName',align: 'center'}, - {title: '描述',field: 'describe',align: 'center', - formatter: function(value, row, index) { - return $.table.tooltip(value, 10, "open"); - } + {title: '描述',field: 'describe',align: 'center' + // formatter: function(value, row, index) { + // return $.table.tooltip(value, 10, "open"); + // } }, {title: '型号',field: 'materialModel',align: 'center', // formatter: function(value, row, index) { 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 @@
- + + + +
- +
- +
-
+ +
- - +
- -
- -
-
-
- +
- +
-
- -
-
- - % -
-
-
- - + +
-
- +
+
+