From 1c2570d63ddd3f2796bfa19f58a75b75947a1020 Mon Sep 17 00:00:00 2001 From: luxiaotao1123 <t1341870251@163.com> Date: 星期六, 17 二月 2024 10:18:50 +0800 Subject: [PATCH] # --- zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/sys/controller/BaseController.java | 19 +++++++++++++++++++ 1 files changed, 19 insertions(+), 0 deletions(-) diff --git a/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/sys/controller/BaseController.java b/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/sys/controller/BaseController.java index 4bbfd32..c92bde7 100644 --- a/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/sys/controller/BaseController.java +++ b/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/sys/controller/BaseController.java @@ -1,8 +1,11 @@ package com.zy.asrs.wcs.sys.controller; +import com.zy.asrs.wcs.common.domain.BaseParam; import com.zy.asrs.wcs.sys.entity.User; import org.springframework.security.core.Authentication; import org.springframework.security.core.context.SecurityContextHolder; + +import java.util.Map; /** * Created by vincent on 1/30/2024 @@ -29,4 +32,20 @@ return loginUser == null ? null : loginUser.getId(); } + public Long getHostId() { + User loginUser = getLoginUser(); + return loginUser == null ? null : loginUser.getHostId(); + } + + public <T extends BaseParam> T buildParam(Map<String, Object> map, Class<T> clz) { + T t = null; + try { + t = clz.getDeclaredConstructor().newInstance(); + t.syncMap(map); + } catch (Exception e) { + e.printStackTrace(); + } + return t; + } + } -- Gitblit v1.9.1