|
@@ -52,8 +52,32 @@ public class CurrUserUtil {
|
|
|
*/
|
|
|
public static int getUserId() {
|
|
|
UmsAdmin umsAdmin = getUmsAdmin();
|
|
|
+ if (StringUtils.isEmpty(umsAdmin.getId())){
|
|
|
+ throw new GlobalException(1,"请登录!");
|
|
|
+ }
|
|
|
long userId = umsAdmin.getId();
|
|
|
return (int) userId;
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获取用户绑定供应商id
|
|
|
+ */
|
|
|
+ public static long getCompId() {
|
|
|
+ UmsAdmin umsAdmin = getUmsAdmin();
|
|
|
+ if (StringUtils.isEmpty(umsAdmin.getCompId())){
|
|
|
+ throw new GlobalException(1,"用户未绑定供应商!");
|
|
|
+ }
|
|
|
+ long compId = umsAdmin.getCompId();
|
|
|
+ return compId;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获取用户绑定供应商名称
|
|
|
+ */
|
|
|
+ public static String getCompName() {
|
|
|
+ UmsAdmin umsAdmin = getUmsAdmin();
|
|
|
+ String compName = umsAdmin.getCompName();
|
|
|
+ return compName;
|
|
|
+ }
|
|
|
}
|
|
|
|