From 305c31ad4cd93a806ee1a18d9c6bf32fb6711eac Mon Sep 17 00:00:00 2001 From: han0 Date: Mon, 24 Feb 2025 17:02:25 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E6=9D=90=E6=96=99?= =?UTF-8?q?=E5=B1=9E=E6=80=A7=E8=A2=AB=E5=88=A0=E9=99=A4=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/mjkf/xinke/main/model/db/Material.java | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/main/java/mjkf/xinke/main/model/db/Material.java b/src/main/java/mjkf/xinke/main/model/db/Material.java index 1313b5d..0df79f0 100644 --- a/src/main/java/mjkf/xinke/main/model/db/Material.java +++ b/src/main/java/mjkf/xinke/main/model/db/Material.java @@ -1,5 +1,6 @@ package mjkf.xinke.main.model.db; +import cn.hutool.core.util.ObjectUtil; import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableId; @@ -190,21 +191,21 @@ public class Material extends Model { } public void edit(MaterialEditRequest params, SaBaseLoginUser user) { -// this.category1 = params.getCategory1(); -// this.category2 = params.getCategory2(); -// this.category3 = params.getCategory3(); -// this.category4 = params.getCategory4(); this.name = params.getName(); this.unit = params.getUnit(); this.spec = params.getSpec(); this.tax = params.getTax(); this.type = params.getType(); this.sort = params.getSort(); - this.roundBit = params.getRoundBit(); - this.roundMethod = params.getRoundMethod(); this.code = buildCode(category1, category2, category3, category4); this.updateTime = LocalDateTime.now(); this.updateUserName = user.getName(); this.updateUserId = user.getId(); + if (ObjectUtil.isNotEmpty(params.getRoundBit())) { + this.roundBit = params.getRoundBit(); + } + if (ObjectUtil.isNotEmpty(params.getRoundMethod())) { + this.roundMethod = params.getRoundMethod(); + } } }