From a9cde613d91839e52f399d9c655eb67b44841262 Mon Sep 17 00:00:00 2001 From: huangdeliang Date: Wed, 3 Feb 2021 17:28:45 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=80=9A=E4=BF=97=E8=AE=A1?= =?UTF-8?q?=E9=87=8F=E6=96=B9=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../custom/domain/SysDishesIngredient.java | 64 ++----------------- .../mapper/custom/SysDishesMapper.xml | 7 +- stdiet-ui/src/views/custom/dishes/index.vue | 25 ++++++-- 3 files changed, 29 insertions(+), 67 deletions(-) diff --git a/stdiet-custom/src/main/java/com/stdiet/custom/domain/SysDishesIngredient.java b/stdiet-custom/src/main/java/com/stdiet/custom/domain/SysDishesIngredient.java index a65eedd56..af03ca135 100644 --- a/stdiet-custom/src/main/java/com/stdiet/custom/domain/SysDishesIngredient.java +++ b/stdiet-custom/src/main/java/com/stdiet/custom/domain/SysDishesIngredient.java @@ -1,5 +1,6 @@ package com.stdiet.custom.domain; +import lombok.Data; import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringStyle; @@ -11,6 +12,7 @@ import java.math.BigDecimal; * @author wonder * @date 2020-12-28 */ +@Data public class SysDishesIngredient extends SysIngredient { private Long ingredientId; @@ -21,68 +23,10 @@ public class SysDishesIngredient extends SysIngredient { private BigDecimal cusWeight; + private Integer cusWei; + private BigDecimal weight; private String remark; - @Override - public void setRemark(String remark) { - this.remark = remark; - } - - @Override - public String getRemark() { - return remark; - } - - public Long getIngredientId() { - return ingredientId; - } - - public void setIngredientId(Long ingredientId) { - this.ingredientId = ingredientId; - } - - public Long getDishesId() { - return dishesId; - } - - public void setDishesId(Long dishesId) { - this.dishesId = dishesId; - } - - public BigDecimal getWeight() { - return weight; - } - - public void setWeight(BigDecimal weight) { - this.weight = weight; - } - - public BigDecimal getCusWeight() { - return cusWeight; - } - - public void setCusWeight(BigDecimal cusWeight) { - this.cusWeight = cusWeight; - } - - public Long getCusUnit() { - return cusUnit; - } - - public void setCusUnit(Long cusUnit) { - this.cusUnit = cusUnit; - } - - @Override - public String toString() { - return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) - .append("ingredientId", getIngredientId()) - .append("dishesId", getDishesId()) - .append("weight", getWeight()) - .append("cusWeight", getCusWeight()) - .append("cusUnit", getCusUnit()) - .toString(); - } } \ No newline at end of file diff --git a/stdiet-custom/src/main/resources/mapper/custom/SysDishesMapper.xml b/stdiet-custom/src/main/resources/mapper/custom/SysDishesMapper.xml index a79ab03a5..9fd7b6fa6 100644 --- a/stdiet-custom/src/main/resources/mapper/custom/SysDishesMapper.xml +++ b/stdiet-custom/src/main/resources/mapper/custom/SysDishesMapper.xml @@ -28,6 +28,7 @@ + @@ -48,7 +49,7 @@ SELECT * FROM( - SELECT ingredient_id AS id, ingredient_weight AS weight, cus_weight, cus_unit, remark + SELECT ingredient_id AS id, ingredient_weight AS weight, cus_weight, cus_wei, cus_unit, remark FROM sys_dishes_ingredient WHERE dishes_id = #{id} ) dishes @@ -148,9 +149,9 @@ - insert into sys_dishes_ingredient(dishes_id, ingredient_id, ingredient_weight, cus_unit, cus_weight, remark) values + insert into sys_dishes_ingredient(dishes_id, ingredient_id, ingredient_weight, cus_unit, cus_wei, remark) values - (#{item.dishesId}, #{item.ingredientId}, #{item.weight}, #{item.cusUnit}, #{item.cusWeight}, #{item.remark}) + (#{item.dishesId}, #{item.ingredientId}, #{item.weight}, #{item.cusUnit}, #{item.cusWei}, #{item.remark}) diff --git a/stdiet-ui/src/views/custom/dishes/index.vue b/stdiet-ui/src/views/custom/dishes/index.vue index 657490bde..9cf416028 100644 --- a/stdiet-ui/src/views/custom/dishes/index.vue +++ b/stdiet-ui/src/views/custom/dishes/index.vue @@ -251,13 +251,21 @@