From 37d91937990ec4fcee82ed902e30bb83620eac76 Mon Sep 17 00:00:00 2001 From: haungxing <1203316822@qq.com> Date: Wed, 31 Jul 2024 08:24:46 +0800 Subject: [PATCH] =?UTF-8?q?#=20=E8=AE=BE=E5=A4=87=E5=AE=9A=E4=B9=89?= =?UTF-8?q?=E6=97=A0=E6=B3=95=E6=96=B0=E5=A2=9Ebug=E8=A7=A3=E5=86=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../hnac/hzims/equipment/controller/EmDefinitionController.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/controller/EmDefinitionController.java b/hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/controller/EmDefinitionController.java index 3b0cdc6..5f8ec5e 100644 --- a/hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/controller/EmDefinitionController.java +++ b/hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/controller/EmDefinitionController.java @@ -18,7 +18,9 @@ import lombok.AllArgsConstructor; import org.springblade.core.boot.ctrl.BladeController; import org.springblade.core.mp.support.Condition; import org.springblade.core.mp.support.Query; +import org.springblade.core.secure.utils.AuthUtil; import org.springblade.core.tool.api.R; +import org.springblade.core.tool.utils.BeanUtil; import org.springblade.core.tool.utils.Func; import org.springblade.system.user.cache.UserCache; import org.springblade.system.user.entity.User; @@ -89,9 +91,9 @@ public class EmDefinitionController extends BladeController { @ApiOperationSupport(order = 2) @ApiOperation(value = "新增", notes = "传入EmDefinitionDTO") public R save(@Valid @RequestBody EmDefinitionDTO emDefinitionDTO) { - EmDefinitionEntity emDefinition = new EmDefinitionEntity(); - Func.copy(emDefinitionDTO, emDefinition); - return R.data(emDefinitionService.save(emDefinition)); + EmDefinitionEntity definition = BeanUtil.copy(emDefinitionDTO, EmDefinitionEntity.class); + definition.setCreateUser(AuthUtil.getUserId()); + return R.data(emDefinitionService.save(definition)); } /**