From cd97fc698d20c5a72c4adaa6b983908700ed863d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E6=99=93=E8=BF=AA?= <2596750866@qq.com> Date: Thu, 18 Jul 2024 09:37:32 +0800 Subject: [PATCH] =?UTF-8?q?[fix]=E5=A7=94=E5=A4=96=E5=8A=A0=E5=B7=A5=20?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=A7=94=E5=A4=96=E6=8A=A5=E4=BB=B7=E7=BC=96?= =?UTF-8?q?=E8=BE=91=E5=89=8D=E7=AB=AF=E9=A1=B5=E9=9D=A2=E8=A1=A8=E6=A0=BC?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E5=8A=A0=E8=BD=BD=E6=96=B9=E6=B3=95=20?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=89=8D=E7=AB=AF=E9=A1=B5=E9=9D=A2=E6=95=B4?= =?UTF-8?q?=E5=90=88=E6=95=B0=E6=8D=AE=E7=9A=84=E6=96=B9=E6=B3=95=20?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=A7=94=E5=A4=96=E6=8A=A5=E4=BB=B7=E5=AE=9E?= =?UTF-8?q?=E4=BD=93=E7=B1=BB=E5=AD=97=E6=AE=B5=E7=B1=BB=E5=9E=8B=20?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=8E=A5=E6=94=B6=E7=BC=96=E8=BE=91=E4=BF=9D?= =?UTF-8?q?=E5=AD=98=E9=A1=B5=E9=9D=A2=E5=AF=B9=E8=B1=A1=E4=B8=BAOutsource?= =?UTF-8?q?Quote=E7=B1=BB=20[feat]=E5=A7=94=E5=A4=96=E5=8A=A0=E5=B7=A5=20?= =?UTF-8?q?=E5=A7=94=E5=A4=96=E6=8A=A5=E4=BB=B7=20=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E5=89=8D=E7=AB=AF=E9=A1=B5=E9=9D=A2=E8=A1=A8=E6=A0=BC=E5=86=85?= =?UTF-8?q?=E8=BE=93=E5=85=A5=E6=A1=86=E4=B8=8B=E6=8B=89=E6=A1=86=E5=8A=A8?= =?UTF-8?q?=E6=80=81=E6=95=B0=E6=8D=AE=E7=9A=84=E8=8E=B7=E5=8F=96=E6=96=B9?= =?UTF-8?q?=E6=B3=95getunit=E3=80=81getnormb=E3=80=81getrmb=20=E6=96=B0?= =?UTF-8?q?=E5=A2=9Emapper=E6=8C=89=E6=8A=A5=E4=BB=B7=E7=BC=96=E5=8F=B7?= =?UTF-8?q?=E6=89=B9=E9=87=8F=E5=88=A0=E9=99=A4=E5=AD=90=E8=A1=A8=E4=BF=A1?= =?UTF-8?q?=E6=81=AF=E7=9A=84=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/OutsourceQuoteController.java | 20 +- .../ruoyi/system/domain/OutsourceQuote.java | 7 +- .../system/mapper/OutsourceQuoteMapper.java | 14 +- .../impl/OutsourceQuoteServiceImpl.java | 5 +- .../mapper/system/OutsourceQuoteMapper.xml | 8 +- .../system/outsource_quote/edit.html | 478 ++++++++++-------- 6 files changed, 302 insertions(+), 230 deletions(-) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/system/controller/OutsourceQuoteController.java b/ruoyi-admin/src/main/java/com/ruoyi/system/controller/OutsourceQuoteController.java index 97cbaa26..7892798b 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/system/controller/OutsourceQuoteController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/system/controller/OutsourceQuoteController.java @@ -131,22 +131,16 @@ public class OutsourceQuoteController extends BaseController @Log(title = "委外报价", businessType = BusinessType.UPDATE) @PostMapping("/edit") @ResponseBody - public AjaxResult editSave(@RequestBody OutsourceQuoteVO childVO) + public AjaxResult editSave(@RequestBody OutsourceQuote outsourceQuote) { - System.out.println(childVO.toString()); - List children = childVO.getOutsourceQuoteChildList(); + List children = outsourceQuote.getOutsourceQuoteChildList(); for (OutsourceQuoteChild child:children) { - child.setOutsourceQuoteCode(childVO.getOutsourceQuoteCode()); - child.setSupplierCode(childVO.getSupplierQuoteCode()); - child.setSupplierName(childVO.getSupplierName()); - child.setTaxRate(childVO.getTaxRate()); + child.setOutsourceQuoteCode(outsourceQuote.getOutsourceQuoteCode()); + child.setSupplierCode(outsourceQuote.getSupplierQuoteCode()); + child.setSupplierName(outsourceQuote.getSupplierName()); + child.setTaxRate(outsourceQuote.getTaxRate()); } - OutsourceQuote outsourceQuote = new OutsourceQuote(); - outsourceQuote.setPricingDate(childVO.getPricingDate()); - outsourceQuote.setProcessAmount(children.size()); - outsourceQuote.setSupplierQuoteCode(childVO.getSupplierQuoteCode()); - outsourceQuote.setSupplierName(childVO.getSupplierName()); - outsourceQuote.setOutsourceQuoteChildList(children); +// System.out.println(children); return toAjax(outsourceQuoteService.updateOutsourceQuote(outsourceQuote)); } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/system/domain/OutsourceQuote.java b/ruoyi-admin/src/main/java/com/ruoyi/system/domain/OutsourceQuote.java index 466677d6..8d4d4b37 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/system/domain/OutsourceQuote.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/system/domain/OutsourceQuote.java @@ -6,6 +6,7 @@ import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringStyle; import com.ruoyi.common.annotation.Excel; import com.ruoyi.common.core.domain.BaseEntity; +import java.math.BigDecimal; /** * 委外报价对象 outsource_quote @@ -38,7 +39,7 @@ public class OutsourceQuote extends BaseEntity /** 税率 */ @Excel(name = "税率") - private Long taxRate; + private BigDecimal taxRate; /** 定价日期 */ @Excel(name = "定价日期") @@ -102,12 +103,12 @@ public class OutsourceQuote extends BaseEntity return processAmount; } - public void setTaxRate(Long taxRate) + public void setTaxRate(BigDecimal taxRate) { this.taxRate = taxRate; } - public Long getTaxRate() + public BigDecimal getTaxRate() { return taxRate; } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/system/mapper/OutsourceQuoteMapper.java b/ruoyi-admin/src/main/java/com/ruoyi/system/mapper/OutsourceQuoteMapper.java index 9a080884..6a198b65 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/system/mapper/OutsourceQuoteMapper.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/system/mapper/OutsourceQuoteMapper.java @@ -72,11 +72,19 @@ public interface OutsourceQuoteMapper /** * 批量删除委外报价工序信息 * - * @param outsourceQuoteIds 需要删除的数据主键集合 + * @param outsourceProcessCodes 需要删除的数据主键集合 * @return 结果 */ - public int deleteOutsourceQuoteChildByOutsourceProcessCodes(String[] outsourceQuoteIds); - + public int deleteOutsourceQuoteChildByOutsourceProcessCodes(String[] outsourceProcessCodes); + + /** + * 通过委外报价主键删除委外报价工序信息 + * + * @param outsourceQuoteCode 委外报价编号 + * @return 结果 + */ + public int deleteOutsourceQuoteChildByOutsourceQuoteCode(String outsourceQuoteCode); + /** * 批量新增委外报价工序信息 * diff --git a/ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/OutsourceQuoteServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/OutsourceQuoteServiceImpl.java index ad1dbc4e..d85da58e 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/OutsourceQuoteServiceImpl.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/OutsourceQuoteServiceImpl.java @@ -105,7 +105,7 @@ public class OutsourceQuoteServiceImpl implements IOutsourceQuoteService public int updateOutsourceQuote(OutsourceQuote outsourceQuote) { outsourceQuote.setUpdateTime(DateUtils.getNowDate()); - outsourceQuoteMapper.deleteOutsourceQuoteChildByOutsourceProcessCode(outsourceQuote.getOutsourceQuoteId()); + outsourceQuoteMapper.deleteOutsourceQuoteChildByOutsourceQuoteCode(outsourceQuote.getOutsourceQuoteCode()); insertOutsourceQuoteChild(outsourceQuote); return outsourceQuoteMapper.updateOutsourceQuote(outsourceQuote); } @@ -134,7 +134,8 @@ public class OutsourceQuoteServiceImpl implements IOutsourceQuoteService @Override public int deleteOutsourceQuoteByOutsourceQuoteId(Integer outsourceQuoteId) { - outsourceQuoteMapper.deleteOutsourceQuoteChildByOutsourceProcessCode(outsourceQuoteId); + OutsourceQuote outsourceQuote = outsourceQuoteMapper.selectOutsourceQuoteByOutsourceQuoteId(outsourceQuoteId); + outsourceQuoteMapper.deleteOutsourceQuoteChildByOutsourceQuoteCode(outsourceQuote.getOutsourceQuoteCode()); return outsourceQuoteMapper.deleteOutsourceQuoteByOutsourceQuoteId(outsourceQuoteId); } diff --git a/ruoyi-admin/src/main/resources/mapper/system/OutsourceQuoteMapper.xml b/ruoyi-admin/src/main/resources/mapper/system/OutsourceQuoteMapper.xml index 65dd14c8..3230e695 100644 --- a/ruoyi-admin/src/main/resources/mapper/system/OutsourceQuoteMapper.xml +++ b/ruoyi-admin/src/main/resources/mapper/system/OutsourceQuoteMapper.xml @@ -69,7 +69,7 @@ @@ -136,6 +136,8 @@ + + delete from outsource_quote_child where outsource_process_code in @@ -154,9 +156,9 @@ - insert into outsource_quote_child( outsource_quote_child_id, outsource_quote_code, outsource_process_code, outsource_process_no, outsource_process_name, remark, tax_rate, material_rmb, material_noRmb, supplier_code, supplier_name, create_by, create_time, update_by, update_time, audit_status) values + insert into outsource_quote_child( outsource_quote_child_id, outsource_quote_code, outsource_process_code, charge_unit, outsource_process_no, outsource_process_name, remark, tax_rate, material_rmb, material_noRmb, supplier_code, supplier_name, create_by, create_time, update_by, update_time, audit_status) values - ( #{item.outsourceQuoteChildId}, #{item.outsourceQuoteCode}, #{item.outsourceProcessCode}, #{item.outsourceProcessNo}, #{item.outsourceProcessName}, #{item.remark}, #{item.taxRate}, #{item.materialRmb}, #{item.materialNormb}, #{item.supplierCode}, #{item.supplierName}, #{item.createBy}, #{item.createTime}, #{item.updateBy}, #{item.updateTime}, #{item.auditStatus}) + ( #{item.outsourceQuoteChildId}, #{item.outsourceQuoteCode}, #{item.outsourceProcessCode},#{item.chargeUnit}, #{item.outsourceProcessNo}, #{item.outsourceProcessName}, #{item.remark}, #{item.taxRate}, #{item.materialRmb}, #{item.materialNormb}, #{item.supplierCode}, #{item.supplierName}, #{item.createBy}, #{item.createTime}, #{item.updateBy}, #{item.updateTime}, #{item.auditStatus}) diff --git a/ruoyi-admin/src/main/resources/templates/system/outsource_quote/edit.html b/ruoyi-admin/src/main/resources/templates/system/outsource_quote/edit.html index d838b391..aa26eb48 100644 --- a/ruoyi-admin/src/main/resources/templates/system/outsource_quote/edit.html +++ b/ruoyi-admin/src/main/resources/templates/system/outsource_quote/edit.html @@ -4,232 +4,308 @@ -
-
-

委外报价信息

- -
-
- -
- -
+
+ +

委外报价信息

+ +
+
+ +
+
+
-
-
- -
- -
+
+
+ +
+
-
-
- -
- -
+
+
+
+ +
+
-
-
- -
- -
+
+
+
+ +
+
-
-
- -
- -
+
+
+
+ +
+
-
-
- -
- -
+
+
+
+ +
+
-
-
- -
- -
+
+
+
+ +
+
-
-
- -
- -
+
+
+
+ +
+
-

委外报价工序信息

-
-
- -
-
-
+
+

委外报价工序信息

+
+
+ +
+
- -
- - + }); + + \ No newline at end of file