Browse Source

# 设备定义无法新增bug解决

zhongwei
haungxing 4 months ago
parent
commit
37d9193799
  1. 8
      hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/controller/EmDefinitionController.java

8
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));
}
/**

Loading…
Cancel
Save