Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
liuhui
/
sinobase-homepage
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
dc2e4ce4
authored
Apr 30, 2021
by
liuhui
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
首页微服务后台拆分
parent
764704c5
Hide whitespace changes
Inline
Side-by-side
Showing
32 changed files
with
3283 additions
and
101 deletions
.externalToolBuilders/org.eclipse.wst.common.project.facet.core.builder.launch
.externalToolBuilders/org.eclipse.wst.validation.validationbuilder.launch
pom.xml
src/main/java/com/sinobase/EmptyApplication.java → src/main/java/com/sinobase/HomePageApplication.java
src/main/java/com/sinobase/EmptyServletInitializer.java → src/main/java/com/sinobase/HomePageServletInitializer.java
src/main/java/com/sinobase/common/bean/User.java
src/main/java/com/sinobase/common/util/CommonContent.java
src/main/java/com/sinobase/common/utils/ServletUtils.java
src/main/java/com/sinobase/common/utils/TreeUtils.java
src/main/java/com/sinobase/common/utils/bean/BeanUtils.java
src/main/java/com/sinobase/common/utils/security/ShiroUtils.java
src/main/java/com/sinobase/framework/config/SinoBaseConfig.java
src/main/java/com/sinobase/framework/service/PlatformService.java
src/main/java/com/sinobase/framework/shiro/realm/UserRealm.java
src/main/java/com/sinobase/framework/web/controller/BaseController.java
src/main/java/com/sinobase/framework/web/domain/AjaxResult.java
src/main/java/com/sinobase/framework/web/domain/BaseEntity.java
src/main/java/com/sinobase/framework/web/domain/FlowBaseEntity.java
src/main/java/com/sinobase/framework/web/domain/Ztree.java
src/main/java/com/sinobase/project/system/dept/domain/Dept.java
src/main/java/com/sinobase/project/system/menu/domain/Menu.java
src/main/java/com/sinobase/project/system/portal/domain/Shortcut.java
src/main/java/com/sinobase/project/system/portal/service/IWorkbenchService.java
src/main/java/com/sinobase/project/system/role/domain/Role.java
src/main/java/com/sinobase/project/system/user/controller/IndexController.java
src/main/java/com/sinobase/project/system/user/domain/User.java
src/main/java/com/sinobase/project/system/user/mapper/LoginHistoryLogMapper.java
src/main/java/com/sinobase/project/system/user/service/ILoginHistoryLogService.java
src/main/java/com/sinobase/project/system/user/service/LoginHistoryLogServiceImpl.java
src/main/resources/application-dev.yml
src/main/resources/application.yml
src/main/resources/mybatis/system/LoginHistoryLogMapper.xml
.externalToolBuilders/org.eclipse.wst.common.project.facet.core.builder.launch
0 → 100644
View file @
dc2e4ce4
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<launchConfiguration
type=
"org.eclipse.ant.AntBuilderLaunchConfigurationType"
>
<booleanAttribute
key=
"org.eclipse.ui.externaltools.ATTR_BUILDER_ENABLED"
value=
"false"
/>
<stringAttribute
key=
"org.eclipse.ui.externaltools.ATTR_DISABLED_BUILDER"
value=
"org.eclipse.wst.common.project.facet.core.builder"
/>
<mapAttribute
key=
"org.eclipse.ui.externaltools.ATTR_TOOL_ARGUMENTS"
/>
<booleanAttribute
key=
"org.eclipse.ui.externaltools.ATTR_TRIGGERS_CONFIGURED"
value=
"true"
/>
</launchConfiguration>
.externalToolBuilders/org.eclipse.wst.validation.validationbuilder.launch
0 → 100644
View file @
dc2e4ce4
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<launchConfiguration
type=
"org.eclipse.ant.AntBuilderLaunchConfigurationType"
>
<booleanAttribute
key=
"org.eclipse.ui.externaltools.ATTR_BUILDER_ENABLED"
value=
"false"
/>
<stringAttribute
key=
"org.eclipse.ui.externaltools.ATTR_DISABLED_BUILDER"
value=
"org.eclipse.wst.validation.validationbuilder"
/>
<mapAttribute
key=
"org.eclipse.ui.externaltools.ATTR_TOOL_ARGUMENTS"
/>
<booleanAttribute
key=
"org.eclipse.ui.externaltools.ATTR_TRIGGERS_CONFIGURED"
value=
"true"
/>
</launchConfiguration>
pom.xml
View file @
dc2e4ce4
...
...
@@ -4,18 +4,45 @@
<modelVersion>
4.0.0
</modelVersion>
<groupId>
com.sinobase
</groupId>
<artifactId>
sinobase-
empty
</artifactId>
<artifactId>
sinobase-
homepage
</artifactId>
<version>
0.0.1-SNAPSHOT
</version>
<packaging>
war
</packaging>
<name>
sinobase-homepage
</name>
<description>
示例子工程(空)
</description>
<properties>
<java.version>
1.8
</java.version>
<spring-cloud.version>
Greenwich.SR2
</spring-cloud.version>
<spring-boot.version>
2.1.1.RELEASE
</spring-boot.version>
<spring.cloud.alibaba.version>
2.1.0.RELEASE
</spring.cloud.alibaba.version>
</properties>
<parent>
<groupId>
com.sinobase
</groupId>
<artifactId>
sinobase
</artifactId>
<version>
0.0.1-SNAPSHOT
</version>
</parent>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>
org.springframework.cloud
</groupId>
<artifactId>
spring-cloud-dependencies
</artifactId>
<version>
${spring-cloud.version}
</version>
<type>
pom
</type>
<scope>
import
</scope>
</dependency>
<!--阿里数据库连接池 -->
<dependency>
<groupId>
com.alibaba.cloud
</groupId>
<artifactId>
spring-cloud-alibaba-dependencies
</artifactId>
<version>
${spring.cloud.alibaba.version}
</version>
<type>
pom
</type>
<scope>
import
</scope>
</dependency>
</dependencies>
</dependencyManagement>
<profiles>
<profile>
...
...
@@ -36,6 +63,10 @@
</profiles>
<dependencies>
<dependency>
<groupId>
com.alibaba.cloud
</groupId>
<artifactId>
spring-cloud-starter-alibaba-nacos-discovery
</artifactId>
</dependency>
<!-- SpringBoot 核心包 -->
<dependency>
<groupId>
org.springframework.boot
</groupId>
...
...
src/main/java/com/sinobase/
Empty
Application.java
→
src/main/java/com/sinobase/
HomePage
Application.java
View file @
dc2e4ce4
...
...
@@ -4,15 +4,17 @@ import org.mybatis.spring.annotation.MapperScan;
import
org.springframework.boot.SpringApplication
;
import
org.springframework.boot.autoconfigure.SpringBootApplication
;
import
org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration
;
import
org.springframework.cloud.client.discovery.EnableDiscoveryClient
;
import
org.springframework.context.annotation.ImportResource
;
@SpringBootApplication
(
exclude
=
{
DataSourceAutoConfiguration
.
class
})
@MapperScan
({
"com.sinobase.empty.*.mapper"
})
@ImportResource
(
value
=
{
"classpath:dubbo.xml"
})
public
class
EmptyApplication
{
@EnableDiscoveryClient
public
class
HomePageApplication
{
public
static
void
main
(
String
[]
args
){
SpringApplication
.
run
(
Empty
Application
.
class
,
args
);
SpringApplication
.
run
(
HomePage
Application
.
class
,
args
);
}
}
src/main/java/com/sinobase/
Empty
ServletInitializer.java
→
src/main/java/com/sinobase/
HomePage
ServletInitializer.java
View file @
dc2e4ce4
...
...
@@ -3,11 +3,11 @@ package com.sinobase;
import
org.springframework.boot.builder.SpringApplicationBuilder
;
import
org.springframework.boot.web.servlet.support.SpringBootServletInitializer
;
public
class
Empty
ServletInitializer
extends
SpringBootServletInitializer
{
public
class
HomePage
ServletInitializer
extends
SpringBootServletInitializer
{
@Override
protected
SpringApplicationBuilder
configure
(
SpringApplicationBuilder
application
)
{
return
application
.
sources
(
Empty
Application
.
class
);
return
application
.
sources
(
HomePage
Application
.
class
);
}
}
src/main/java/com/sinobase/common/bean/User.java
deleted
100644 → 0
View file @
764704c5
package
com
.
sinobase
.
common
.
bean
;
import
java.io.Serializable
;
import
java.util.LinkedHashMap
;
public
class
User
implements
Serializable
{
private
String
id
;
//用户Id
private
String
loginName
;
//登录名
private
String
userName
;
//用户名
private
String
gender
;
//性别
private
LinkedHashMap
<
String
,
String
>
dept
;
//所在部门(第一个是当前登录时所在的部门)
public
String
getId
()
{
return
id
;
}
public
void
setId
(
String
id
)
{
this
.
id
=
id
;
}
public
String
getLoginName
()
{
return
loginName
;
}
public
void
setLoginName
(
String
loginName
)
{
this
.
loginName
=
loginName
;
}
public
String
getUserName
()
{
return
userName
;
}
public
void
setUserName
(
String
userName
)
{
this
.
userName
=
userName
;
}
public
String
getGender
()
{
return
gender
;
}
public
void
setGender
(
String
gender
)
{
this
.
gender
=
gender
;
}
public
LinkedHashMap
<
String
,
String
>
getDept
()
{
return
dept
;
}
public
void
setDept
(
LinkedHashMap
<
String
,
String
>
dept
)
{
this
.
dept
=
dept
;
}
}
src/main/java/com/sinobase/common/util/CommonContent.java
0 → 100644
View file @
dc2e4ce4
package
com
.
sinobase
.
common
.
util
;
/**
* 常量专用类
*
* @author liuhui001
*
*/
public
class
CommonContent
{
/**
* 国投智能外部单位
*
*/
public
static
String
COMPANY_EXTEND
=
"231560"
;
}
src/main/java/com/sinobase/common/utils/ServletUtils.java
0 → 100644
View file @
dc2e4ce4
package
com
.
sinobase
.
common
.
utils
;
import
java.io.IOException
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletResponse
;
import
javax.servlet.http.HttpSession
;
import
org.springframework.web.context.request.RequestAttributes
;
import
org.springframework.web.context.request.RequestContextHolder
;
import
org.springframework.web.context.request.ServletRequestAttributes
;
import
com.sinobase.common.support.Convert
;
/**
* 客户端工具类
*
* @author sinobase
*/
public
class
ServletUtils
{
public
static
String
[]
getParameters
(
String
name
)
{
return
getRequest
().
getParameterValues
(
name
);
}
/**
* 获取String参数
*/
public
static
String
getParameter
(
String
name
)
{
return
Convert
.
toStr
(
getRequest
().
getParameter
(
name
),
""
);
}
/**
* 获取String参数
*/
public
static
String
getParameter
(
String
name
,
String
defaultValue
)
{
return
Convert
.
toStr
(
getRequest
().
getParameter
(
name
),
defaultValue
);
}
/**
* 获取Integer参数
*/
public
static
Integer
getParameterToInt
(
String
name
)
{
return
Convert
.
toInt
(
getRequest
().
getParameter
(
name
));
}
/**
* 获取Integer参数
*/
public
static
Integer
getParameterToInt
(
String
name
,
Integer
defaultValue
)
{
return
Convert
.
toInt
(
getRequest
().
getParameter
(
name
),
defaultValue
);
}
/**
* 获取Boolean参数
* @return
*/
public
static
Boolean
getParameterToBoolean
(
String
name
)
{
return
Convert
.
toBool
(
getRequest
().
getParameter
(
name
));
}
/**
* 获取request
*/
public
static
HttpServletRequest
getRequest
()
{
return
getRequestAttributes
().
getRequest
();
}
/**
* 获取response
*/
public
static
HttpServletResponse
getResponse
()
{
return
getRequestAttributes
().
getResponse
();
}
/**
* 获取session
*/
public
static
HttpSession
getSession
()
{
return
getRequest
().
getSession
();
}
public
static
ServletRequestAttributes
getRequestAttributes
()
{
RequestAttributes
attributes
=
RequestContextHolder
.
getRequestAttributes
();
return
(
ServletRequestAttributes
)
attributes
;
}
/**
* 将字符串渲染到客户端
*
* @param response 渲染对象
* @param string 待渲染的字符串
* @return null
*/
public
static
String
renderString
(
HttpServletResponse
response
,
String
string
)
{
try
{
response
.
setContentType
(
"application/json"
);
response
.
setCharacterEncoding
(
"utf-8"
);
response
.
getWriter
().
print
(
string
);
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
return
null
;
}
/**
* 是否是Ajax异步请求
*
* @param request
*/
public
static
boolean
isAjaxRequest
(
HttpServletRequest
request
)
{
String
accept
=
request
.
getHeader
(
"accept"
);
if
(
accept
!=
null
&&
accept
.
indexOf
(
"application/json"
)
!=
-
1
)
{
return
true
;
}
String
xRequestedWith
=
request
.
getHeader
(
"X-Requested-With"
);
if
(
xRequestedWith
!=
null
&&
xRequestedWith
.
indexOf
(
"XMLHttpRequest"
)
!=
-
1
)
{
return
true
;
}
String
uri
=
request
.
getRequestURI
();
if
(
StringUtils
.
inStringIgnoreCase
(
uri
,
".json"
,
".xml"
))
{
return
true
;
}
String
ajax
=
request
.
getParameter
(
"__ajax"
);
if
(
StringUtils
.
inStringIgnoreCase
(
ajax
,
"json"
,
"xml"
))
{
return
true
;
}
return
false
;
}
}
src/main/java/com/sinobase/common/utils/TreeUtils.java
0 → 100644
View file @
dc2e4ce4
package
com
.
sinobase
.
common
.
utils
;
import
java.util.ArrayList
;
import
java.util.Iterator
;
import
java.util.List
;
import
com.sinobase.project.system.menu.domain.Menu
;
/**
* 权限数据处理
*
* @author sinobase
*/
public
class
TreeUtils
{
/**
* 根据父节点的ID获取所有子节点
*
* @param list 分类表
* @param parentId 传入的父节点ID
* @return String
*/
public
static
List
<
Menu
>
getChildPerms
(
List
<
Menu
>
list
,
String
parentId
)
{
List
<
Menu
>
returnList
=
new
ArrayList
<
Menu
>();
for
(
Iterator
<
Menu
>
iterator
=
list
.
iterator
();
iterator
.
hasNext
();)
{
Menu
t
=
(
Menu
)
iterator
.
next
();
// 一、根据传入的某个父节点ID,遍历该父节点的所有子节点
if
(
t
.
getParentId
().
equals
(
parentId
))
{
//System.out.println((t.getUrl().indexOf("parse_tab") > -1)+"------------"+ t.getMenuName()+"--------"+ t.getUrl());
if
(
t
.
getUrl
().
indexOf
(
"parse_tab"
)
<
0
){
recursionFn
(
list
,
t
);
}
returnList
.
add
(
t
);
}
}
return
returnList
;
}
/**
* 递归列表
*
* @param list
* @param t
*/
private
static
void
recursionFn
(
List
<
Menu
>
list
,
Menu
t
)
{
// 得到子节点列表
List
<
Menu
>
childList
=
getChildList
(
list
,
t
);
t
.
setChildren
(
childList
);
for
(
Menu
tChild
:
childList
)
{
if
(
hasChild
(
list
,
tChild
))
{
// 判断是否有子节点
Iterator
<
Menu
>
it
=
childList
.
iterator
();
while
(
it
.
hasNext
())
{
Menu
n
=
(
Menu
)
it
.
next
();
recursionFn
(
list
,
n
);
}
}
}
}
/**
* 得到子节点列表
*/
private
static
List
<
Menu
>
getChildList
(
List
<
Menu
>
list
,
Menu
t
)
{
List
<
Menu
>
tlist
=
new
ArrayList
<
Menu
>();
//20200103 LoubBin 添加 模块设置 标签页面功能无效BUG
if
(
t
.
getUrl
().
indexOf
(
"parse_tab"
)
<
0
&&
!
t
.
getMenuType
().
equals
(
"C"
)){
//System.out.println(t.getMenuName() + "------------"+t.getUrl());
Iterator
<
Menu
>
it
=
list
.
iterator
();
while
(
it
.
hasNext
())
{
Menu
n
=
(
Menu
)
it
.
next
();
if
(
n
.
getParentId
().
equals
(
t
.
getMenuId
()))
{
tlist
.
add
(
n
);
}
}
}
return
tlist
;
}
List
<
Menu
>
returnList
=
new
ArrayList
<
Menu
>();
/**
* 根据父节点的ID获取所有子节点
*
* @param list 分类表
* @param typeId 传入的父节点ID
* @param prefix 子节点前缀
*/
public
List
<
Menu
>
getChildPerms
(
List
<
Menu
>
list
,
int
typeId
,
String
prefix
)
{
if
(
list
==
null
)
{
return
null
;
}
for
(
Iterator
<
Menu
>
iterator
=
list
.
iterator
();
iterator
.
hasNext
();)
{
Menu
node
=
(
Menu
)
iterator
.
next
();
// 一、根据传入的某个父节点ID,遍历该父节点的所有子节点
if
(
node
.
getParentId
().
equals
(
typeId
))
{
recursionFn
(
list
,
node
,
prefix
);
}
// 二、遍历所有的父节点下的所有子节点
/*
* if (node.getParentId()==0) { recursionFn(list, node); }
*/
}
return
returnList
;
}
private
void
recursionFn
(
List
<
Menu
>
list
,
Menu
node
,
String
p
)
{
// 得到子节点列表
List
<
Menu
>
childList
=
getChildList
(
list
,
node
);
if
(
hasChild
(
list
,
node
))
{
// 判断是否有子节点
returnList
.
add
(
node
);
Iterator
<
Menu
>
it
=
childList
.
iterator
();
while
(
it
.
hasNext
())
{
Menu
n
=
(
Menu
)
it
.
next
();
n
.
setMenuName
(
p
+
n
.
getMenuName
());
recursionFn
(
list
,
n
,
p
+
p
);
}
}
else
{
returnList
.
add
(
node
);
}
}
/**
* 判断是否有子节点
*/
private
static
boolean
hasChild
(
List
<
Menu
>
list
,
Menu
t
)
{
return
getChildList
(
list
,
t
).
size
()
>
0
?
true
:
false
;
}
}
src/main/java/com/sinobase/common/utils/bean/BeanUtils.java
0 → 100644
View file @
dc2e4ce4
package
com
.
sinobase
.
common
.
utils
.
bean
;
import
java.lang.reflect.Method
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.regex.Matcher
;
import
java.util.regex.Pattern
;
/**
* Bean 工具类
*
* @author sinobase
*/
public
class
BeanUtils
{
/** Bean方法名中属性名开始的下标 */
private
static
final
int
BEAN_METHOD_PROP_INDEX
=
3
;
/** * 匹配getter方法的正则表达式 */
private
static
final
Pattern
GET_PATTERN
=
Pattern
.
compile
(
"get(\\p{javaUpperCase}\\w*)"
);
/** * 匹配setter方法的正则表达式 */
private
static
final
Pattern
SET_PATTERN
=
Pattern
.
compile
(
"set(\\p{javaUpperCase}\\w*)"
);
/**
* Bean属性复制工具方法。
*
* @param dest 目标对象
* @param src 源对象
*/
public
static
void
copyBeanProp
(
Object
dest
,
Object
src
)
{
List
<
Method
>
destSetters
=
getSetterMethods
(
dest
);
List
<
Method
>
srcGetters
=
getGetterMethods
(
src
);
try
{
for
(
Method
setter
:
destSetters
)
{
for
(
Method
getter
:
srcGetters
)
{
if
(
isMethodPropEquals
(
setter
.
getName
(),
getter
.
getName
())
&&
setter
.
getParameterTypes
()[
0
].
equals
(
getter
.
getReturnType
()))
{
setter
.
invoke
(
dest
,
getter
.
invoke
(
src
));
}
}
}
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
}
/**
* 获取对象的setter方法。
*
* @param obj 对象
* @return 对象的setter方法列表
*/
public
static
List
<
Method
>
getSetterMethods
(
Object
obj
)
{
// setter方法列表
List
<
Method
>
setterMethods
=
new
ArrayList
<
Method
>();
// 获取所有方法
Method
[]
methods
=
obj
.
getClass
().
getMethods
();
// 查找setter方法
for
(
Method
method
:
methods
)
{
Matcher
m
=
SET_PATTERN
.
matcher
(
method
.
getName
());
if
(
m
.
matches
()
&&
(
method
.
getParameterTypes
().
length
==
1
))
{
setterMethods
.
add
(
method
);
}
}
// 返回setter方法列表
return
setterMethods
;
}
/**
* 获取对象的getter方法。
*
* @param obj 对象
* @return 对象的getter方法列表
*/
public
static
List
<
Method
>
getGetterMethods
(
Object
obj
)
{
// getter方法列表
List
<
Method
>
getterMethods
=
new
ArrayList
<
Method
>();
// 获取所有方法
Method
[]
methods
=
obj
.
getClass
().
getMethods
();
// 查找getter方法
for
(
Method
method
:
methods
)
{
Matcher
m
=
GET_PATTERN
.
matcher
(
method
.
getName
());
if
(
m
.
matches
()
&&
(
method
.
getParameterTypes
().
length
==
0
))
{
getterMethods
.
add
(
method
);
}
}
// 返回getter方法列表
return
getterMethods
;
}
/**
* 检查Bean方法名中的属性名是否相等。<br>
* 如getName()和setName()属性名一样,getName()和setAge()属性名不一样。
*
* @param m1 方法名1
* @param m2 方法名2
* @return 属性名一样返回true,否则返回false
*/
public
static
boolean
isMethodPropEquals
(
String
m1
,
String
m2
)
{
return
m1
.
substring
(
BEAN_METHOD_PROP_INDEX
).
equals
(
m2
.
substring
(
BEAN_METHOD_PROP_INDEX
));
}
}
src/main/java/com/sinobase/common/utils/security/ShiroUtils.java
0 → 100644
View file @
dc2e4ce4
package
com
.
sinobase
.
common
.
utils
.
security
;
import
org.apache.shiro.SecurityUtils
;
import
org.apache.shiro.mgt.RealmSecurityManager
;
import
org.apache.shiro.session.Session
;
import
org.apache.shiro.subject.Subject
;
import
org.apache.shiro.subject.PrincipalCollection
;
import
org.apache.shiro.subject.SimplePrincipalCollection
;
import
com.sinobase.common.utils.StringUtils
;
import
com.sinobase.common.utils.bean.BeanUtils
;
import
com.sinobase.framework.shiro.realm.UserRealm
;
import
com.sinobase.project.system.user.domain.User
;
/**
* shiro 工具类
*
* @author sinobase
*/
public
class
ShiroUtils
{
public
static
Subject
getSubject
()
{
return
SecurityUtils
.
getSubject
();
}
public
static
Session
getSession
()
{
return
SecurityUtils
.
getSubject
().
getSession
();
}
public
static
void
logout
()
{
getSubject
().
logout
();
}
public
static
User
getSysUser
()
{
User
user
=
null
;
Object
obj
=
getSubject
().
getPrincipal
();
if
(
StringUtils
.
isNotNull
(
obj
))
{
user
=
new
User
();
BeanUtils
.
copyBeanProp
(
user
,
obj
);
}
return
user
;
}
public
static
void
setSysUser
(
User
user
)
{
Subject
subject
=
getSubject
();
PrincipalCollection
principalCollection
=
subject
.
getPrincipals
();
String
realmName
=
principalCollection
.
getRealmNames
().
iterator
().
next
();
PrincipalCollection
newPrincipalCollection
=
new
SimplePrincipalCollection
(
user
,
realmName
);
// 重新加载Principal
subject
.
runAs
(
newPrincipalCollection
);
}
public
static
void
clearCachedAuthorizationInfo
()
{
RealmSecurityManager
rsm
=
(
RealmSecurityManager
)
SecurityUtils
.
getSecurityManager
();
UserRealm
realm
=
(
UserRealm
)
rsm
.
getRealms
().
iterator
().
next
();
realm
.
clearCachedAuthorizationInfo
();
}
public
static
String
getUserId
()
{
return
getSysUser
().
getUserId
();
}
public
static
String
getLoginName
()
{
return
getSysUser
().
getLoginName
();
}
public
static
String
getIp
()
{
return
getSubject
().
getSession
().
getHost
();
}
public
static
String
getSessionId
()
{
return
String
.
valueOf
(
getSubject
().
getSession
().
getId
());
}
}
src/main/java/com/sinobase/framework/config/SinoBaseConfig.java
0 → 100644
View file @
dc2e4ce4
package
com
.
sinobase
.
framework
.
config
;
import
org.springframework.boot.context.properties.ConfigurationProperties
;
import
org.springframework.stereotype.Component
;
import
java.io.File
;
/**
* 读取项目相关配置
*
* @author sinobase
*/
@Component
(
"sinoBaseConfig"
)
@ConfigurationProperties
(
prefix
=
"sinobase"
)
public
class
SinoBaseConfig
{
/**
* 项目名称
*/
private
String
name
;
/**
* 版本
*/
private
String
version
;
/**
* 版权年份
*/
private
String
copyrightYear
;
/**
* 上传路径
*/
private
static
String
profile
;
/**
* 获取地址开关
*/
private
static
boolean
addressEnabled
;
/**
* 文件服务地址<上传 /upload,下载 /get/{id},删除/delete/{id}
*/
private
static
String
fileServer
;
/**
* 映射路径
*/
private
static
String
mappingUrl
;
/**
* 是否集成公司的微服务平台
*/
private
static
boolean
isPlatform
;
private
String
templatePath
;
/** 获取流程图JSON的IP地址 **/
private
static
String
flowChartIp
;
public
String
getName
()
{
return
name
;
}
public
void
setName
(
String
name
)
{
this
.
name
=
name
;
}
public
String
getVersion
()
{
return
version
;
}
public
void
setVersion
(
String
version
)
{
this
.
version
=
version
;
}
public
String
getCopyrightYear
()
{
return
copyrightYear
;
}
public
void
setCopyrightYear
(
String
copyrightYear
)
{
this
.
copyrightYear
=
copyrightYear
;
}
public
static
String
getProfile
()
{
return
profile
;
}
public
void
setProfile
(
String
profile
)
{
SinoBaseConfig
.
profile
=
profile
;
}
public
static
boolean
isAddressEnabled
()
{
return
addressEnabled
;
}
public
void
setAddressEnabled
(
boolean
addressEnabled
)
{
SinoBaseConfig
.
addressEnabled
=
addressEnabled
;
}
public
static
String
getAvatarPath
()
{
return
profile
+
"avatar"
+
File
.
separator
;
}
public
static
String
getDownloadPath
()
{
return
profile
+
"download"
+
File
.
separator
;
}
public
void
setIsPlatform
(
boolean
isPlatform
)
{
SinoBaseConfig
.
isPlatform
=
isPlatform
;
}
public
static
String
getUploadPath
()
{
return
profile
+
"upload"
+
File
.
separator
;
}
/**
* 文件上传服务地址
*/
public
static
String
getFileServer
()
{
return
fileServer
;
}
public
void
setFileServer
(
String
fileServer
)
{
SinoBaseConfig
.
fileServer
=
fileServer
;
}
public
static
String
getMappingUrl
()
{
return
mappingUrl
;
}
public
void
setMappingUrl
(
String
mappingUrl
)
{
SinoBaseConfig
.
mappingUrl
=
mappingUrl
;
}
/**
* 是否集成公司的微服务平台
*
* @return
*/
public
static
boolean
isPlatform
()
{
return
isPlatform
;
}
public
String
getTemplatePath
()
{
return
templatePath
;
}
public
void
setTemplatePath
(
String
templatePath
)
{
this
.
templatePath
=
templatePath
;
}
public
static
String
getFlowChartIp
()
{
return
flowChartIp
;
}
public
void
setFlowChartIp
(
String
flowChartIp
)
{
SinoBaseConfig
.
flowChartIp
=
flowChartIp
;
}
}
src/main/java/com/sinobase/framework/service/PlatformService.java
View file @
dc2e4ce4
package
com
.
sinobase
.
framework
.
service
;
import
java.util.
LinkedHashMap
;
import
java.util.
ArrayList
;
import
java.util.List
;
import
java.util.Map
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Service
;
import
com.sinobase.common.bean.User
;
import
com.sinobase.common.utils.StringUtils
;
import
com.sinobase.common.utils.TreeUtils
;
import
com.sinobase.project.system.dept.domain.Dept
;
import
com.sinobase.project.system.menu.domain.Menu
;
import
com.sinobase.project.system.role.domain.Role
;
import
com.sinobase.project.system.user.domain.User
;
import
com.sinobase.transfer.service.ResourceService
;
import
com.sinobase.transfer.service.WorkflowService
;
@Service
public
class
PlatformService
{
...
...
@@ -20,23 +27,91 @@ public class PlatformService {
@Autowired
private
ResourceService
resource
;
@Autowired
private
WorkflowService
workflowService
;
/**
* 在平台上业务系统的注册 ID
*/
@Value
(
"${sinobase.system_id}"
)
private
String
SYSTEM_ID
;
@SuppressWarnings
(
"unchecked"
)
public
User
getUserByLoginname
(
String
loginName
)
{
Map
<
String
,
Object
>
userMap
=
resource
.
getUserInfo
(
loginName
,
""
);
User
user
=
new
User
();
user
.
setLoginName
(
loginName
);
user
.
setId
(
getStr
(
userMap
,
"userId"
));
user
.
setUserName
(
getStr
(
userMap
,
"userFullName"
));
user
.
setGender
(
getStr
(
userMap
,
"userSex"
));
Map
<
String
,
Object
>
userMap
=
resource
.
getUserInfo
(
loginName
,
SYSTEM_ID
);
User
user
=
new
User
();
user
.
setUserId
(
getStr
(
userMap
,
"userId"
));
user
.
setHistoryId
(
getStr
(
userMap
,
"historyId"
));
user
.
setLoginName
(
getStr
(
userMap
,
"userName"
));
user
.
setUserName
(
getStr
(
userMap
,
"userFullName"
));
user
.
setSex
(
getStr
(
userMap
,
"userSex"
));
user
.
setPhonenumber
(
getStr
(
userMap
,
"phone"
));
user
.
setEmail
(
getStr
(
userMap
,
"email"
));
user
.
setIdcNumber
(
getStr
(
userMap
,
"idCard"
));
user
.
setPassword
(
getStr
(
userMap
,
"password"
));
List
<
Map
<
String
,
String
>>
deptInfo
=
(
List
<
Map
<
String
,
String
>>)
userMap
.
get
(
"deptInfo"
);
LinkedHashMap
<
String
,
String
>
deptMap
=
new
LinkedHashMap
<
String
,
String
>();
for
(
Map
<
String
,
String
>
map
:
deptInfo
)
{
deptMap
.
put
(
map
.
get
(
"deptId"
),
map
.
get
(
"deptName"
));
}
user
.
setDept
(
deptMap
);
List
<
Dept
>
deptList
=
new
ArrayList
<
Dept
>();
int
deptCount
=
1
;
for
(
Map
<
String
,
String
>
map
:
deptInfo
)
{
//平台返回的部门信息不全,根据平台返回的部门id,查询业务库部门信息
Dept
dept
=
new
Dept
();
dept
.
setDeptId
(
getStr
(
map
,
"deptId"
));
dept
.
setDeptName
(
getStr
(
map
,
"deptName"
));
dept
.
setDeptShort
(
getStr
(
map
,
"abbreviation"
));
dept
.
setParentId
(
getStr
(
map
,
"superId"
));
dept
.
setHistoryId
(
getStr
(
map
,
"historyId"
));
dept
.
setUnitType
(
getStr
(
map
,
"unitType"
));
//父级相关信息
Map
<
String
,
Object
>
supermap
=
resource
.
getSuperDepMessage
(
getStr
(
map
,
"superId"
));
dept
.
setHistoryCompanyId
(
getStr
(
supermap
,
"historyId"
));
dept
.
setCompanyShortNameDept
(
getStr
(
supermap
,
"abbreviation"
));
dept
.
setCompanyIdDept
(
getStr
(
supermap
,
"deptId"
));
dept
.
setCompanyNameDept
(
getStr
(
supermap
,
"deptName"
));
//单个主部门
if
((
"true"
.
equals
(
map
.
get
(
"isDefault"
)
+
""
)
&&
StringUtils
.
isEmpty
(
user
.
getDeptId
())))
{
setDeptInfo
(
user
,
dept
);
}
else
if
(
deptCount
==
deptInfo
.
size
()
&&
StringUtils
.
isEmpty
(
user
.
getDeptId
()))
{
setDeptInfo
(
user
,
dept
);
}
deptCount
++;
deptList
.
add
(
dept
);
}
user
.
setDepts
(
deptList
);
//部门集合
//用户权限
ArrayList
<
Role
>
userRoles
=
new
ArrayList
<
Role
>();
List
<
Map
<
String
,
String
>>
rolsMap
=
(
List
<
Map
<
String
,
String
>>)
userMap
.
get
(
"sysRoles"
);
for
(
Map
<
String
,
String
>
map
:
rolsMap
)
{
Role
role
=
new
Role
();
role
.
setRoleId
(
getStr
(
map
,
"roleId"
));
role
.
setRoleName
(
getStr
(
map
,
"roleName"
));
userRoles
.
add
(
role
);
}
user
.
setRoles
(
userRoles
);
user
.
setRoleIds
(
getStr
(
userMap
,
"sysRoleIds"
));
List
<
Map
<
String
,
String
>>
flowRoles
=
(
List
<
Map
<
String
,
String
>>)
userMap
.
get
(
"flowRoles"
);
user
.
setFlowRoles
(
flowRoles
);
user
.
setFlowRoleIds
(
getStr
(
userMap
,
"flowRoleIds"
));
return
user
;
}
private
void
setDeptInfo
(
User
user
,
Dept
dept
)
{
user
.
setDept
(
dept
);
user
.
setDeptId
(
dept
.
getDeptId
());
user
.
setDeptName
(
dept
.
getDeptName
());
user
.
setCompanyId
(
dept
.
getCompanyId
());
user
.
setCompanyName
(
dept
.
getCompanyName
());
}
private
String
getStr
(
Map
map
,
String
key
)
{
if
(
map
==
null
||
map
.
get
(
key
)
==
null
)
{
return
""
;
...
...
@@ -44,4 +119,35 @@ public class PlatformService {
return
map
.
get
(
key
)
+
""
;
}
public
WorkflowService
getWorkflowService
()
{
return
workflowService
;
}
public
void
setWorkflowService
(
WorkflowService
workflowService
)
{
this
.
workflowService
=
workflowService
;
}
/**
* 获取资源目录
*
* @param list 当前用户的所有资源
* @return
*/
public
List
<
Menu
>
getMenus
(
List
<
Menu
>
list
)
{
List
<
Menu
>
rList
=
new
ArrayList
<
Menu
>();
if
(
list
==
null
)
{
return
rList
;
}
for
(
Menu
menu
:
list
)
{
if
(
menu
.
getMenuType
().
equals
(
"M"
)
||
"C"
.
equals
(
menu
.
getMenuType
()))
{
rList
.
add
(
menu
);
}
}
return
TreeUtils
.
getChildPerms
(
list
,
"0"
);
}
}
src/main/java/com/sinobase/framework/shiro/realm/UserRealm.java
View file @
dc2e4ce4
package
com
.
sinobase
.
framework
.
shiro
.
realm
;
import
org.apache.shiro.SecurityUtils
;
import
org.apache.shiro.authc.AuthenticationException
;
import
org.apache.shiro.authc.AuthenticationInfo
;
import
org.apache.shiro.authc.AuthenticationToken
;
...
...
@@ -12,8 +13,8 @@ import org.slf4j.Logger;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
com.sinobase.common.bean.User
;
import
com.sinobase.framework.service.PlatformService
;
import
com.sinobase.project.system.user.domain.User
;
public
class
UserRealm
extends
AuthorizingRealm
{
...
...
@@ -49,5 +50,12 @@ public class UserRealm extends AuthorizingRealm {
}
return
null
;
}
/**
* 清理缓存权限
*/
public
void
clearCachedAuthorizationInfo
()
{
this
.
clearCachedAuthorizationInfo
(
SecurityUtils
.
getSubject
().
getPrincipals
());
}
}
src/main/java/com/sinobase/framework/web/controller/BaseController.java
0 → 100644
View file @
dc2e4ce4
package
com
.
sinobase
.
framework
.
web
.
controller
;
import
java.util.Map
;
import
com.baomidou.mybatisplus.core.toolkit.ObjectUtils
;
import
com.sinobase.common.utils.StringUtils
;
import
com.sinobase.common.utils.security.ShiroUtils
;
import
com.sinobase.framework.web.domain.AjaxResult
;
import
com.sinobase.project.system.user.domain.User
;
/**
* web层通用数据处理
*
* @author sinobase
*/
public
class
BaseController
{
/**
* 响应返回结果
*
* @param rows
* 影响行数
* @return 操作结果
*/
protected
AjaxResult
toAjax
(
int
rows
)
{
return
rows
>
0
?
success
()
:
error
();
}
/**
* 响应返回结果
*
* @param result 结果
* @return 操作结果
*/
protected
AjaxResult
toAjax
(
boolean
result
)
{
return
result
?
success
()
:
error
();
}
/**
* 响应返回结果
* @param result 结果<br/>message:返回消息, map:返回对象
* @return 操作结果
*/
protected
AjaxResult
toAjax
(
boolean
result
,
String
message
,
Map
<
String
,
Object
>
map
)
{
return
result
?
success
(
message
,
map
)
:
error
(
message
);
}
/**
* 返回成功
*/
public
AjaxResult
success
()
{
return
AjaxResult
.
success
();
}
/**
* 返回成功
*/
public
AjaxResult
success
(
Map
<
String
,
Object
>
map
)
{
return
AjaxResult
.
success
(
"操作成功"
,
map
);
}
/**
* 返回失败消息
*/
public
AjaxResult
error
()
{
return
AjaxResult
.
error
();
}
/**
* 返回成功消息
*/
public
AjaxResult
success
(
String
message
,
Map
<
String
,
Object
>
map
)
{
return
AjaxResult
.
success
(
message
,
map
);
}
/**
* 返回成功消息
*/
public
AjaxResult
success
(
String
message
)
{
return
AjaxResult
.
success
(
message
);
}
/**
* 返回失败消息
*/
public
AjaxResult
error
(
String
message
)
{
return
AjaxResult
.
error
(
message
);
}
/**
* 返回错误码消息
*/
public
AjaxResult
error
(
int
code
,
String
message
)
{
return
AjaxResult
.
error
(
code
,
message
);
}
/**
* 页面跳转
*/
public
String
redirect
(
String
url
)
{
return
StringUtils
.
format
(
"redirect:{}"
,
url
);
}
public
User
getSysUser
()
{
return
ShiroUtils
.
getSysUser
();
}
public
void
setSysUser
(
User
user
)
{
ShiroUtils
.
setSysUser
(
user
);
}
public
String
getUserId
()
{
return
getSysUser
().
getUserId
();
}
public
String
getLoginName
()
{
return
getSysUser
().
getLoginName
();
}
/**
* 去除特殊符号
* @param obj
* @return
*/
public
Object
clearSpecialSymbols
(
Object
obj
){
//去除换行及空格
if
(
ObjectUtils
.
isNotEmpty
(
obj
)){
obj
=
obj
.
toString
().
replaceAll
(
"\\r\\n"
,
""
).
trim
();
}
return
obj
;
}
}
src/main/java/com/sinobase/framework/web/domain/AjaxResult.java
0 → 100644
View file @
dc2e4ce4
package
com
.
sinobase
.
framework
.
web
.
domain
;
import
java.util.HashMap
;
import
java.util.Map
;
import
com.sinobase.common.utils.StringUtils
;
/**
* 操作消息提醒
*/
public
class
AjaxResult
extends
HashMap
<
String
,
Object
>
{
private
static
final
long
serialVersionUID
=
1L
;
public
static
final
String
CODE_TAG
=
"code"
;
public
static
final
String
MSG_TAG
=
"msg"
;
public
static
final
String
DATA_TAG
=
"data"
;
/**
* 状态类型
*/
public
enum
Type
{
/** 成功 */
SUCCESS
(
0
),
/** 警告 */
WARN
(
301
),
/** 错误 */
ERROR
(
500
);
private
final
int
value
;
Type
(
int
value
)
{
this
.
value
=
value
;
}
public
int
value
()
{
return
this
.
value
;
}
}
/** 状态类型 */
private
Type
type
;
/** 状态码 */
private
int
code
;
/** 返回内容 */
private
String
msg
;
/** 数据对象 */
private
Object
data
;
/**
* 初始化一个新创建的 AjaxResult 对象,使其表示一个空消息。
*/
public
AjaxResult
()
{
}
/**
* 初始化一个新创建的 AjaxResult 对象
*
* @param type 状态类型
* @param msg 返回内容
*/
public
AjaxResult
(
Type
type
,
String
msg
)
{
super
.
put
(
CODE_TAG
,
type
.
value
);
super
.
put
(
MSG_TAG
,
msg
);
}
/**
* 初始化一个新创建的 AjaxResult 对象
*
* @param type 状态类型
* @param msg 返回内容
* @param data 数据对象
*/
public
AjaxResult
(
Type
type
,
String
msg
,
Object
data
)
{
super
.
put
(
CODE_TAG
,
type
.
value
);
super
.
put
(
MSG_TAG
,
msg
);
if
(
StringUtils
.
isNotNull
(
data
))
{
super
.
put
(
DATA_TAG
,
data
);
}
}
/**
* 返回错误消息
*
* @return 错误消息
*/
public
static
AjaxResult
error
()
{
return
error
(
1
,
"操作失败"
);
}
/**
* 返回错误消息
*
* @param msg 内容
* @return 错误消息
*/
public
static
AjaxResult
error
(
String
msg
)
{
return
error
(
500
,
msg
);
}
/**
* 返回错误消息
*
* @param code 错误码
* @param msg 内容
* @return 错误消息
*/
public
static
AjaxResult
error
(
int
code
,
String
msg
)
{
AjaxResult
json
=
new
AjaxResult
();
json
.
put
(
"code"
,
code
);
json
.
put
(
"msg"
,
msg
);
return
json
;
}
/**
* 返回成功数据
* @return 成功消息
*/
public
static
AjaxResult
success
(
Object
data
)
{
return
AjaxResult
.
success
(
"操作成功"
,
data
);
}
/**
* 返回成功消息
* @param msg 内容
* @return 成功消息
*/
public
static
AjaxResult
success
(
String
msg
)
{
AjaxResult
json
=
new
AjaxResult
();
json
.
put
(
"msg"
,
msg
);
json
.
put
(
"code"
,
0
);
return
json
;
}
/**
* 返回成功消息
*
* @param msg 内容
* @param map 返回的数据对象
* @return 成功消息 + data
*/
public
static
AjaxResult
success
(
String
msg
,
Map
<
String
,
Object
>
map
)
{
AjaxResult
json
=
new
AjaxResult
();
json
.
put
(
"msg"
,
msg
);
json
.
put
(
"code"
,
0
);
json
.
put
(
"data"
,
map
);
return
json
;
}
/**
* 返回成功消息
*
* @param msg 返回内容
* @param data 数据对象
* @return 成功消息
*/
public
static
AjaxResult
success
(
String
msg
,
Object
data
)
{
return
new
AjaxResult
(
Type
.
SUCCESS
,
msg
,
data
);
}
/**
* 返回成功消息
*
* @return 成功消息
*/
public
static
AjaxResult
success
()
{
return
AjaxResult
.
success
(
"操作成功"
);
}
/**
* 返回成功消息
*
* @param key 键值
* @param value 内容
* @return 成功消息
*/
@Override
public
AjaxResult
put
(
String
key
,
Object
value
)
{
super
.
put
(
key
,
value
);
return
this
;
}
public
Type
getType
()
{
return
type
;
}
public
void
setType
(
Type
type
)
{
this
.
type
=
type
;
}
public
int
getCode
()
{
return
code
;
}
public
void
setCode
(
int
code
)
{
this
.
code
=
code
;
}
public
String
getMsg
()
{
return
msg
;
}
public
void
setMsg
(
String
msg
)
{
this
.
msg
=
msg
;
}
public
Object
getData
()
{
return
data
;
}
public
void
setData
(
Object
data
)
{
this
.
data
=
data
;
}
}
src/main/java/com/sinobase/framework/web/domain/BaseEntity.java
0 → 100644
View file @
dc2e4ce4
package
com
.
sinobase
.
framework
.
web
.
domain
;
import
java.io.Serializable
;
import
java.util.Date
;
import
java.util.Map
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
com.google.common.collect.Maps
;
/**
* Entity基类
*/
public
class
BaseEntity
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
/** 搜索值 */
@TableField
(
exist
=
false
)
private
String
searchValue
;
/** 创建者 */
@TableField
(
exist
=
false
)
private
String
createBy
;
/** 创建时间 */
@TableField
(
exist
=
false
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
private
Date
createTime
;
/** 更新者 */
@TableField
(
exist
=
false
)
private
String
updateBy
;
/** 更新时间 */
@TableField
(
exist
=
false
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
timezone
=
"GMT+8"
)
//因为我们是东八区(北京时间),所以在格式化的时候要指定时区(timezone )
private
Date
updateTime
;
/** 备注 */
@TableField
(
exist
=
false
)
private
String
remark
;
/** 请求参数 */
@TableField
(
exist
=
false
)
private
Map
<
String
,
Object
>
params
;
/**请求类型*/
@TableField
(
exist
=
false
)
private
String
requestType
;
public
String
getSearchValue
()
{
return
searchValue
;
}
public
void
setSearchValue
(
String
searchValue
)
{
this
.
searchValue
=
searchValue
;
}
public
String
getCreateBy
()
{
return
createBy
;
}
public
void
setCreateBy
(
String
createBy
)
{
this
.
createBy
=
createBy
;
}
public
Date
getCreateTime
()
{
return
createTime
;
}
public
void
setCreateTime
(
Date
createTime
)
{
this
.
createTime
=
createTime
;
}
public
String
getUpdateBy
()
{
return
updateBy
;
}
public
void
setUpdateBy
(
String
updateBy
)
{
this
.
updateBy
=
updateBy
;
}
public
Date
getUpdateTime
()
{
return
updateTime
;
}
public
void
setUpdateTime
(
Date
updateTime
)
{
this
.
updateTime
=
updateTime
;
}
public
String
getRemark
()
{
return
remark
;
}
public
void
setRemark
(
String
remark
)
{
this
.
remark
=
remark
;
}
public
Map
<
String
,
Object
>
getParams
()
{
if
(
params
==
null
)
{
params
=
Maps
.
newHashMap
();
}
return
params
;
}
public
void
setParams
(
Map
<
String
,
Object
>
params
)
{
this
.
params
=
params
;
}
public
String
getRequestType
()
{
return
requestType
;
}
public
void
setRequestType
(
String
requestType
)
{
this
.
requestType
=
requestType
;
}
}
src/main/java/com/sinobase/framework/web/domain/FlowBaseEntity.java
0 → 100644
View file @
dc2e4ce4
package
com
.
sinobase
.
framework
.
web
.
domain
;
import
java.util.Date
;
public
class
FlowBaseEntity
{
/** 创建人 */
private
String
creUserId
;
/** 创建人名称 */
private
String
creUserName
;
/** 创建部门id */
private
String
creDeptId
;
/** 创建部门名称 */
private
String
creDeptName
;
/** 创建日志 */
private
Date
creDate
;
/** 流程标识 */
private
String
subflag
;
/** 流程类型 */
private
String
flowType
;
public
void
setCreUserId
(
String
creUserId
){
this
.
creUserId
=
creUserId
;
}
public
String
getCreUserId
(){
return
creUserId
;
}
public
void
setCreUserName
(
String
creUserName
){
this
.
creUserName
=
creUserName
;
}
public
String
getCreUserName
(){
return
creUserName
;
}
public
void
setCreDeptId
(
String
creDeptId
){
this
.
creDeptId
=
creDeptId
;
}
public
String
getCreDeptId
(){
return
creDeptId
;
}
public
void
setCreDeptName
(
String
creDeptName
){
this
.
creDeptName
=
creDeptName
;
}
public
String
getCreDeptName
(){
return
creDeptName
;
}
public
void
setCreDate
(
Date
creDate
){
this
.
creDate
=
creDate
;
}
public
Date
getCreDate
(){
return
creDate
;
}
public
void
setSubflag
(
String
subflag
){
this
.
subflag
=
subflag
;
}
public
String
getSubflag
(){
return
subflag
;
}
public
String
getFlowType
()
{
return
flowType
;
}
public
void
setFlowType
(
String
flowType
)
{
this
.
flowType
=
flowType
;
}
}
src/main/java/com/sinobase/framework/web/domain/Ztree.java
0 → 100644
View file @
dc2e4ce4
package
com
.
sinobase
.
framework
.
web
.
domain
;
import
java.io.Serializable
;
/**
* Ztree树结构实体类
*/
public
class
Ztree
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
/** 节点ID */
private
Long
id
;
/** 节点父ID */
private
Long
pId
;
/** 节点名称 */
private
String
name
;
/** 节点标题 */
private
String
title
;
/** 是否勾选 */
private
boolean
checked
=
false
;
/** 是否展开 */
private
boolean
open
=
false
;
/** 是否能勾选 */
private
boolean
nocheck
=
false
;
public
Long
getId
()
{
return
id
;
}
public
void
setId
(
Long
id
)
{
this
.
id
=
id
;
}
public
Long
getpId
()
{
return
pId
;
}
public
void
setpId
(
Long
pId
)
{
this
.
pId
=
pId
;
}
public
String
getName
()
{
return
name
;
}
public
void
setName
(
String
name
)
{
this
.
name
=
name
;
}
public
String
getTitle
()
{
return
title
;
}
public
void
setTitle
(
String
title
)
{
this
.
title
=
title
;
}
public
boolean
isChecked
()
{
return
checked
;
}
public
void
setChecked
(
boolean
checked
)
{
this
.
checked
=
checked
;
}
public
boolean
isOpen
()
{
return
open
;
}
public
void
setOpen
(
boolean
open
)
{
this
.
open
=
open
;
}
public
boolean
isNocheck
()
{
return
nocheck
;
}
public
void
setNocheck
(
boolean
nocheck
)
{
this
.
nocheck
=
nocheck
;
}
}
src/main/java/com/sinobase/project/system/dept/domain/Dept.java
0 → 100644
View file @
dc2e4ce4
package
com
.
sinobase
.
project
.
system
.
dept
.
domain
;
import
org.apache.commons.lang3.builder.ToStringBuilder
;
import
org.apache.commons.lang3.builder.ToStringStyle
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.sinobase.framework.web.domain.BaseEntity
;
/**
* 部门表 sys_dept
*
* @author sinobase
*/
public
class
Dept
extends
BaseEntity
{
private
static
final
long
serialVersionUID
=
1L
;
/**
* 职能部门
*/
public
static
String
DEPT_UNIT_TYPE_01
=
"01"
;
//集团
/**
* 职能部门
*/
public
static
String
DEPT_UNIT_TYPE_02
=
"02"
;
//职能部门
/**
* 二级公司
*/
public
static
String
DEPT_UNIT_TYPE_03
=
"03"
;
//二级公司
/**
* 三级公司
*/
public
static
String
DEPT_UNIT_TYPE_04
=
"04"
;
//三级公司
/**
* 四级公司
*/
public
static
String
DEPT_UNIT_TYPE_05
=
"05"
;
//四级公司
/**
* 公司类型字符串Company
*/
public
static
String
DEPT_UNIT_TYPE_COMPANY
=
"03,04,05"
;
//公司类型字符串
/** 部门ID */
private
String
deptId
;
/** 父部门ID */
private
String
parentId
;
/** 祖级列表 */
private
String
ancestors
;
/** 部门名称 */
private
String
deptName
;
/** 显示顺序 */
private
Long
orderNum
;
/** 负责人 */
private
String
leader
;
/** 联系电话 */
private
String
phone
;
/** 邮箱 */
private
String
email
;
/** 部门状态:1正常,0停用 */
private
String
status
;
/** 删除标志(0代表存在 2代表删除) */
private
String
delFlag
;
/** 父部门名称 */
private
String
parentName
;
/**
* fromUnit 类别(公司或部门)
* @return
*/
private
String
fromUnit
;
/**
* 部门编号
* @return
*/
private
String
deptNumber
;
/** 备注 */
private
String
note
;
/**
* 国泰历史数据ID
* @return
*/
private
String
historyId
;
/**
* 历史公司ID
*/
private
String
historyCompanyId
;
/**
* 用户所在老OA大部门id,主要指老OA集团的职能部门
*/
private
String
historyCompanyIdDept
;
/** 国泰历史数据编码 */
private
String
historyCode
;
/** 单元类型 */
private
String
unitType
;
/** 是否为领导部门 */
private
String
isZhc
;
/**
* 所在公司id
*/
private
String
companyId
;
/**
* 所在公司名称
*/
private
String
companyName
;
/**
* 公司简称
*/
@TableField
(
exist
=
false
)
private
String
companyShortName
;
/**
* 主数据部门编码
*/
private
String
deptcode
;
/**
* 主数据公司编码
*/
private
String
companycode
;
/**
* 主数据父部门编码
*/
private
String
supercode
;
/**
* 部门树的显示状态,0任何树都显示,其他表示根据实际情况判断是否在树结构上显示
*/
private
String
isShow
;
/**
* 单位属性:全资,控股等
*/
private
String
deptProperty
;
/**
* 部门简称,树结构一般显示简称
*/
private
String
deptShort
;
/**
* 部门层级
*/
private
String
deptLevel
;
/**
* 用户所在大部门id,主要指集团的职能部门
*/
private
String
companyIdDept
;
/**
*用户所在大部门名称
*/
private
String
companyNameDept
;
/**
*用户所在大部门简称
*/
@TableField
(
exist
=
false
)
private
String
companyShortNameDept
;
private
String
hasChildren
;
/**
* 子部门集合
*/
@TableField
(
exist
=
false
)
private
String
childDeptIds
;
public
String
getHasChildren
()
{
return
hasChildren
;
}
public
void
setHasChildren
(
String
hasChildren
)
{
this
.
hasChildren
=
hasChildren
;
}
public
String
getDeptcode
()
{
return
deptcode
;
}
public
void
setDeptcode
(
String
deptcode
)
{
this
.
deptcode
=
deptcode
;
}
public
String
getCompanycode
()
{
return
companycode
;
}
public
void
setCompanycode
(
String
companycode
)
{
this
.
companycode
=
companycode
;
}
public
String
getSupercode
()
{
return
supercode
;
}
public
void
setSupercode
(
String
supercode
)
{
this
.
supercode
=
supercode
;
}
public
String
getIsShow
()
{
return
isShow
;
}
public
void
setIsShow
(
String
isShow
)
{
this
.
isShow
=
isShow
;
}
public
String
getDeptProperty
()
{
return
deptProperty
;
}
public
void
setDeptProperty
(
String
deptProperty
)
{
this
.
deptProperty
=
deptProperty
;
}
public
String
getDeptShort
()
{
return
deptShort
;
}
public
void
setDeptShort
(
String
deptShort
)
{
this
.
deptShort
=
deptShort
;
}
public
String
getDeptLevel
()
{
return
deptLevel
;
}
public
void
setDeptLevel
(
String
deptLevel
)
{
this
.
deptLevel
=
deptLevel
;
}
public
String
getCompanyId
()
{
return
companyId
;
}
public
void
setCompanyId
(
String
companyId
)
{
this
.
companyId
=
companyId
;
}
public
String
getCompanyName
()
{
return
companyName
;
}
public
void
setCompanyName
(
String
companyName
)
{
this
.
companyName
=
companyName
;
}
public
String
getIsZhc
()
{
return
isZhc
;
}
public
void
setIsZhc
(
String
isZhc
)
{
this
.
isZhc
=
isZhc
;
}
public
String
getDeptId
()
{
return
deptId
;
}
public
void
setDeptId
(
String
deptId
)
{
this
.
deptId
=
deptId
;
}
public
String
getParentId
()
{
return
parentId
;
}
public
void
setParentId
(
String
parentId
)
{
this
.
parentId
=
parentId
;
}
public
String
getAncestors
()
{
return
ancestors
;
}
public
void
setAncestors
(
String
ancestors
)
{
this
.
ancestors
=
ancestors
;
}
public
String
getDeptName
()
{
return
deptName
;
}
public
void
setDeptName
(
String
deptName
)
{
this
.
deptName
=
deptName
;
}
public
Long
getOrderNum
()
{
return
orderNum
;
}
public
void
setOrderNum
(
Long
orderNum
)
{
this
.
orderNum
=
orderNum
;
}
public
String
getLeader
()
{
return
leader
;
}
public
void
setLeader
(
String
leader
)
{
this
.
leader
=
leader
;
}
public
String
getPhone
()
{
return
phone
;
}
public
void
setPhone
(
String
phone
)
{
this
.
phone
=
phone
;
}
public
String
getEmail
()
{
return
email
;
}
public
void
setEmail
(
String
email
)
{
this
.
email
=
email
;
}
public
String
getStatus
()
{
return
status
;
}
public
void
setStatus
(
String
status
)
{
this
.
status
=
status
;
}
public
String
getDelFlag
()
{
return
delFlag
;
}
public
void
setDelFlag
(
String
delFlag
)
{
this
.
delFlag
=
delFlag
;
}
public
String
getParentName
()
{
return
parentName
;
}
public
void
setParentName
(
String
parentName
)
{
this
.
parentName
=
parentName
;
}
public
static
long
getSerialVersionUID
()
{
return
serialVersionUID
;
}
public
String
getFromUnit
()
{
return
fromUnit
;
}
public
void
setFromUnit
(
String
fromUnit
)
{
this
.
fromUnit
=
fromUnit
;
}
public
String
getDeptNumber
()
{
return
deptNumber
;
}
public
void
setDeptNumber
(
String
deptNumber
)
{
this
.
deptNumber
=
deptNumber
;
}
public
String
getNote
()
{
return
note
;
}
public
void
setNote
(
String
note
)
{
this
.
note
=
note
;
}
public
String
getHistoryId
()
{
return
historyId
;
}
public
void
setHistoryId
(
String
historyId
)
{
this
.
historyId
=
historyId
;
}
public
String
getHistoryCompanyId
()
{
return
historyCompanyId
;
}
public
void
setHistoryCompanyId
(
String
historyCompanyId
)
{
this
.
historyCompanyId
=
historyCompanyId
;
}
public
String
getHistoryCompanyIdDept
()
{
return
historyCompanyIdDept
;
}
public
void
setHistoryCompanyIdDept
(
String
historyCompanyIdDept
)
{
this
.
historyCompanyIdDept
=
historyCompanyIdDept
;
}
public
String
getHistoryCode
()
{
return
historyCode
;
}
public
void
setHistoryCode
(
String
historyCode
)
{
this
.
historyCode
=
historyCode
;
}
public
String
getUnitType
()
{
return
unitType
;
}
public
void
setUnitType
(
String
unitType
)
{
this
.
unitType
=
unitType
;
}
public
String
getCompanyIdDept
()
{
return
companyIdDept
;
}
public
void
setCompanyIdDept
(
String
companyIdDept
)
{
this
.
companyIdDept
=
companyIdDept
;
}
public
String
getCompanyNameDept
()
{
return
companyNameDept
;
}
public
void
setCompanyNameDept
(
String
companyNameDept
)
{
this
.
companyNameDept
=
companyNameDept
;
}
public
String
getCompanyShortName
()
{
return
companyShortName
;
}
public
void
setCompanyShortName
(
String
companyShortName
)
{
this
.
companyShortName
=
companyShortName
;
}
public
String
getCompanyShortNameDept
()
{
return
companyShortNameDept
;
}
public
void
setCompanyShortNameDept
(
String
companyShortNameDept
)
{
this
.
companyShortNameDept
=
companyShortNameDept
;
}
public
String
getChildDeptIds
()
{
return
childDeptIds
;
}
public
void
setChildDeptIds
(
String
childDeptIds
)
{
this
.
childDeptIds
=
childDeptIds
;
}
@Override
public
String
toString
()
{
return
new
ToStringBuilder
(
this
,
ToStringStyle
.
MULTI_LINE_STYLE
).
append
(
"deptId"
,
getDeptId
()).
append
(
"parentId"
,
getParentId
()).
append
(
"ancestors"
,
getAncestors
())
.
append
(
"deptName"
,
getDeptName
()).
append
(
"orderNum"
,
getOrderNum
()).
append
(
"leader"
,
getLeader
()).
append
(
"phone"
,
getPhone
()).
append
(
"email"
,
getEmail
()).
append
(
"status"
,
getStatus
())
.
append
(
"delFlag"
,
getDelFlag
()).
append
(
"createBy"
,
getCreateBy
()).
append
(
"createTime"
,
getCreateTime
()).
append
(
"updateBy"
,
getUpdateBy
()).
append
(
"updateTime"
,
getUpdateTime
())
.
append
(
"fromUnit"
,
getFromUnit
()).
append
(
"note"
,
getNote
()).
append
(
"historyId"
,
getHistoryId
()).
append
(
"deptNumber"
,
getDeptNumber
()).
append
(
"historyCode"
,
getHistoryCode
())
.
append
(
"deptcode"
,
getDeptcode
()).
append
(
"companyId"
,
getCompanyId
()).
append
(
"companycode"
,
getCompanycode
()).
append
(
"supercode"
,
getSupercode
()).
append
(
"isShow"
,
getIsShow
())
.
append
(
"deptProperty"
,
getDeptProperty
()).
append
(
"deptShort"
,
getDeptShort
()).
append
(
"deptLevel"
,
getDeptLevel
()).
append
(
"companyName"
,
getCompanyName
())
.
append
(
"unitType"
,
getUnitType
()).
append
(
"isZhc"
,
getIsZhc
()).
toString
();
}
}
src/main/java/com/sinobase/project/system/menu/domain/Menu.java
0 → 100644
View file @
dc2e4ce4
package
com
.
sinobase
.
project
.
system
.
menu
.
domain
;
import
java.util.ArrayList
;
import
java.util.List
;
import
org.apache.commons.lang3.builder.ToStringBuilder
;
import
org.apache.commons.lang3.builder.ToStringStyle
;
import
com.sinobase.framework.web.domain.BaseEntity
;
/**
* 菜单权限表 sys_menu
* @author sinobase
*/
public
class
Menu
extends
BaseEntity
{
private
static
final
long
serialVersionUID
=
1L
;
/**
* 资源类型:标签解析页
*/
public
static
final
String
TYPE_TAB
=
"C"
;
/**
* 资源类型:标签解析页
*/
public
static
final
String
TYPE_MODULE
=
"M"
;
/**
* 资源类型:独立的首页
*/
public
static
final
String
TYPE_INDEX
=
"I"
;
/**
* 资源类型:按钮
*/
public
static
final
String
TYPE_BUTTON
=
"F"
;
/** 菜单ID */
private
String
menuId
;
/** 菜单名称 */
private
String
menuName
;
/** 父菜单名称 */
private
String
parentName
;
/** 父菜单ID */
private
String
parentId
;
/** 显示顺序 */
private
String
orderNum
;
/** 菜单URL */
private
String
url
;
/** 类型:0目录,1菜单,2按钮 <2019-3-21 loubin ,修改:菜单类型<M:模块,C:标签,F:按钮>> */
private
String
menuType
;
/** 菜单状态:0显示,1隐藏 */
private
String
visible
;
/** 权限字符串 */
private
String
perms
;
/** 菜单图标 */
private
String
icon
;
/** 子菜单 */
private
List
<
Menu
>
children
=
new
ArrayList
<
Menu
>();
public
String
getMenuId
()
{
return
menuId
;
}
public
void
setMenuId
(
String
menuId
)
{
this
.
menuId
=
menuId
;
}
public
String
getMenuName
()
{
return
menuName
;
}
public
void
setMenuName
(
String
menuName
)
{
this
.
menuName
=
menuName
;
}
public
String
getParentName
()
{
return
parentName
;
}
public
void
setParentName
(
String
parentName
)
{
this
.
parentName
=
parentName
;
}
public
String
getParentId
()
{
return
parentId
;
}
public
void
setParentId
(
String
parentId
)
{
this
.
parentId
=
parentId
;
}
public
String
getOrderNum
()
{
return
orderNum
;
}
public
void
setOrderNum
(
String
orderNum
)
{
this
.
orderNum
=
orderNum
;
}
public
String
getUrl
()
{
return
url
;
}
public
void
setUrl
(
String
url
)
{
this
.
url
=
url
;
}
public
String
getMenuType
()
{
return
menuType
;
}
public
void
setMenuType
(
String
menuType
)
{
this
.
menuType
=
menuType
;
}
public
String
getVisible
()
{
return
visible
;
}
public
void
setVisible
(
String
visible
)
{
this
.
visible
=
visible
;
}
public
String
getPerms
()
{
return
perms
;
}
public
void
setPerms
(
String
perms
)
{
this
.
perms
=
perms
;
}
public
String
getIcon
()
{
return
icon
;
}
public
void
setIcon
(
String
icon
)
{
this
.
icon
=
icon
;
}
public
List
<
Menu
>
getChildren
()
{
return
children
;
}
public
void
setChildren
(
List
<
Menu
>
children
)
{
this
.
children
=
children
;
}
@Override
public
String
toString
()
{
return
new
ToStringBuilder
(
this
,
ToStringStyle
.
MULTI_LINE_STYLE
).
append
(
"menuId"
,
getMenuId
())
.
append
(
"menuName"
,
getMenuName
()).
append
(
"parentId"
,
getParentId
()).
append
(
"orderNum"
,
getOrderNum
())
.
append
(
"url"
,
getUrl
()).
append
(
"menuType"
,
getMenuType
()).
append
(
"visible"
,
getVisible
())
.
append
(
"perms"
,
getPerms
()).
append
(
"icon"
,
getIcon
()).
append
(
"createBy"
,
getCreateBy
())
.
append
(
"createTime"
,
getCreateTime
()).
append
(
"updateBy"
,
getUpdateBy
())
.
append
(
"updateTime"
,
getUpdateTime
()).
append
(
"remark"
,
getRemark
()).
toString
();
}
}
src/main/java/com/sinobase/project/system/portal/domain/Shortcut.java
0 → 100644
View file @
dc2e4ce4
package
com
.
sinobase
.
project
.
system
.
portal
.
domain
;
import
java.util.LinkedHashMap
;
import
java.util.Map
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.baomidou.mybatisplus.annotation.TableName
;
/**
* 快捷方式
* @author LouBin
*/
@TableName
(
value
=
"sys_shortcut"
)
public
class
Shortcut
{
/**
* 类别:OA系统
*/
@TableField
(
exist
=
false
)
public
static
String
CATEGORY_OA
=
"OA"
;
/**
* 类别:第三方系统
*/
@TableField
(
exist
=
false
)
public
static
String
CATEGORY_THIRDPARTY
=
"THIRDPARTY"
;
/**
* 类别:个人配置
*/
@TableField
(
exist
=
false
)
public
static
String
CATEGORY_PERSON
=
"PERSON"
;
@TableField
(
exist
=
false
)
public
static
Map
<
String
,
String
>
TYPE_ARRAY
=
new
LinkedHashMap
<
String
,
String
>();
static
{
TYPE_ARRAY
.
put
(
"SC-QB"
,
"签报"
);
TYPE_ARRAY
.
put
(
"SC-SF"
,
"收发文"
);
TYPE_ARRAY
.
put
(
"SC-HYJY"
,
"会议纪要"
);
TYPE_ARRAY
.
put
(
"SC-DAILY"
,
"日常"
);
TYPE_ARRAY
.
put
(
"SC-OTHER"
,
"其他"
);
}
private
String
id
;
private
String
name
;
private
String
url
;
private
String
ico
;
private
String
type
;
private
String
category
;
private
String
status
;
private
int
orderNum
;
private
String
companyId
;
private
String
remark
;
public
String
getId
()
{
return
id
;
}
public
void
setId
(
String
id
)
{
this
.
id
=
id
;
}
public
int
getOrderNum
()
{
return
orderNum
;
}
public
String
getCategory
()
{
return
category
;
}
public
void
setCategory
(
String
category
)
{
this
.
category
=
category
;
}
public
void
setOrderNum
(
int
orderNum
)
{
this
.
orderNum
=
orderNum
;
}
public
String
getStatus
()
{
return
status
;
}
public
void
setStatus
(
String
status
)
{
this
.
status
=
status
;
}
public
String
getName
()
{
return
name
;
}
public
void
setName
(
String
name
)
{
this
.
name
=
name
;
}
public
String
getRemark
()
{
return
remark
;
}
public
void
setRemark
(
String
remark
)
{
this
.
remark
=
remark
;
}
public
String
getUrl
()
{
return
url
;
}
public
void
setUrl
(
String
url
)
{
this
.
url
=
url
;
}
public
String
getIco
()
{
return
ico
;
}
public
void
setIco
(
String
ico
)
{
this
.
ico
=
ico
;
}
public
String
getType
()
{
return
type
;
}
public
void
setType
(
String
type
)
{
this
.
type
=
type
;
}
public
String
getCompanyId
()
{
return
companyId
;
}
public
void
setCompanyId
(
String
companyId
)
{
this
.
companyId
=
companyId
;
}
}
src/main/java/com/sinobase/project/system/portal/service/IWorkbenchService.java
0 → 100644
View file @
dc2e4ce4
package
com
.
sinobase
.
project
.
system
.
portal
.
service
;
import
java.util.List
;
import
java.util.Map
;
import
com.sinobase.project.system.portal.domain.Shortcut
;
/**
* 个人工作台服务类
* @author LouBin
*/
public
interface
IWorkbenchService
{
/**
* 返回快捷方式列表
* @param shortcut
* @return
*/
public
List
<
Shortcut
>
listShortcut
(
Shortcut
shortcut
);
/**
* 获取快捷方式
* @param id
* @return
*/
public
Shortcut
shortcut
(
String
id
);
/**
* 快捷方式保存
* @param shortcut
* @return
*/
public
Shortcut
saveShortcut
(
Shortcut
shortcut
);
/**
* 快捷方式删除
* @param id
* @return
*/
public
int
delShortcut
(
String
id
);
/**
* 我的快捷方式
* @param userId
* @param moduleType
* @return
*/
public
List
<
Shortcut
>
myShortcut
(
String
userId
,
String
moduleType
);
/**
* 我的快捷方式保存
* @param shortcutIds
* @return
*/
public
boolean
myShortcutSave
(
String
moduleType
,
String
shortcuts
);
/**
* 导入OA系统启动资源
* @return
*/
public
int
importRes
();
/**
* 获取OA系统的起草地址
* @return
*/
public
List
<
Map
<
String
,
Object
>>
getOaDraftList
(
String
moduleType
);
/**
*
* 获取当前人是否又多身份
* @param loginname
* @return
*/
boolean
ishasAccount
(
String
loginname
);
}
src/main/java/com/sinobase/project/system/role/domain/Role.java
0 → 100644
View file @
dc2e4ce4
package
com
.
sinobase
.
project
.
system
.
role
.
domain
;
import
org.apache.commons.lang3.builder.ToStringBuilder
;
import
org.apache.commons.lang3.builder.ToStringStyle
;
import
com.sinobase.framework.web.domain.BaseEntity
;
/**
* 角色表 sys_role
*
* @author ruoyi
*/
public
class
Role
extends
BaseEntity
{
private
static
final
long
serialVersionUID
=
1L
;
/** 角色ID */
private
String
roleId
;
/** 角色名称 */
private
String
roleName
;
/** 角色权限 */
private
String
roleKey
;
/** 角色排序 */
private
String
roleSort
;
/** 数据范围(1:所有数据权限;2:自定义数据权限) */
private
String
dataScope
;
/** 角色状态(0正常 1停用) */
private
String
status
;
/** 删除标志(0代表存在 2代表删除) */
private
String
delFlag
;
/** 用户是否存在此角色标识 默认不存在 */
private
boolean
flag
=
false
;
/** 菜单组 */
private
String
[]
menuIds
;
/** 部门组(数据权限) */
private
String
[]
deptIds
;
public
String
getRoleId
()
{
return
roleId
;
}
public
void
setRoleId
(
String
roleId
)
{
this
.
roleId
=
roleId
;
}
public
String
getDataScope
()
{
return
dataScope
;
}
public
void
setDataScope
(
String
dataScope
)
{
this
.
dataScope
=
dataScope
;
}
public
String
getRoleName
()
{
return
roleName
;
}
public
void
setRoleName
(
String
roleName
)
{
this
.
roleName
=
roleName
;
}
public
String
getRoleKey
()
{
return
roleKey
;
}
public
void
setRoleKey
(
String
roleKey
)
{
this
.
roleKey
=
roleKey
;
}
public
String
getRoleSort
()
{
return
roleSort
;
}
public
void
setRoleSort
(
String
roleSort
)
{
this
.
roleSort
=
roleSort
;
}
public
String
getStatus
()
{
return
status
;
}
public
String
getDelFlag
()
{
return
delFlag
;
}
public
void
setDelFlag
(
String
delFlag
)
{
this
.
delFlag
=
delFlag
;
}
public
void
setStatus
(
String
status
)
{
this
.
status
=
status
;
}
public
boolean
isFlag
()
{
return
flag
;
}
public
void
setFlag
(
boolean
flag
)
{
this
.
flag
=
flag
;
}
public
String
[]
getMenuIds
()
{
return
menuIds
;
}
public
void
setMenuIds
(
String
[]
menuIds
)
{
this
.
menuIds
=
menuIds
;
}
public
String
[]
getDeptIds
()
{
return
deptIds
;
}
public
void
setDeptIds
(
String
[]
deptIds
)
{
this
.
deptIds
=
deptIds
;
}
@Override
public
String
toString
()
{
return
new
ToStringBuilder
(
this
,
ToStringStyle
.
MULTI_LINE_STYLE
).
append
(
"roleId"
,
getRoleId
())
.
append
(
"roleName"
,
getRoleName
()).
append
(
"roleKey"
,
getRoleKey
()).
append
(
"roleSort"
,
getRoleSort
())
.
append
(
"dataScope"
,
getDataScope
()).
append
(
"status"
,
getStatus
()).
append
(
"delFlag"
,
getDelFlag
())
.
append
(
"createBy"
,
getCreateBy
()).
append
(
"createTime"
,
getCreateTime
())
.
append
(
"updateBy"
,
getUpdateBy
()).
append
(
"updateTime"
,
getUpdateTime
()).
append
(
"remark"
,
getRemark
())
.
toString
();
}
}
src/main/java/com/sinobase/project/system/user/controller/IndexController.java
0 → 100644
View file @
dc2e4ce4
package
com
.
sinobase
.
project
.
system
.
user
.
controller
;
import
java.text.SimpleDateFormat
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.stream.Collectors
;
import
javax.servlet.http.HttpServletRequest
;
import
org.apache.shiro.session.mgt.eis.SessionDAO
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.ui.ModelMap
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.ResponseBody
;
import
org.springframework.web.servlet.ModelAndView
;
import
com.sinobase.common.util.CommonContent
;
import
com.sinobase.common.utils.ServletUtils
;
import
com.sinobase.common.utils.security.ShiroUtils
;
import
com.sinobase.framework.config.SinoBaseConfig
;
import
com.sinobase.framework.service.PlatformService
;
import
com.sinobase.framework.web.controller.BaseController
;
import
com.sinobase.oldoa.util.JdbcProperties
;
import
com.sinobase.oldoa.util.ManagerOldOADate
;
import
com.sinobase.project.system.menu.domain.Menu
;
import
com.sinobase.project.system.portal.service.IWorkbenchService
;
import
com.sinobase.project.system.user.domain.User
;
import
com.sinobase.project.system.user.service.ILoginHistoryLogService
;
/**
* 首页 业务处理
*
* @author sinobase
*/
@Controller
public
class
IndexController
extends
BaseController
{
@Value
(
"${sinobase.isIntranet}"
)
private
boolean
isIntranet
;
@Value
(
"${environment}"
)
private
String
environment
;
@Autowired
private
ILoginHistoryLogService
loginHistoryService
;
@Autowired
private
SessionDAO
sessionDao
;
@Autowired
private
PlatformService
platformService
;
//集成公司平台时用
@Autowired
private
SinoBaseConfig
sinoBaseConfig
;
@Autowired
private
IWorkbenchService
workbench
;
JdbcProperties
jdbc
=
new
JdbcProperties
();
private
final
String
IP
=
jdbc
.
get
(
"IP"
);
@Value
(
"${sinobase.isextendnet}"
)
private
boolean
isextendnet
;
// 系统首页
@GetMapping
(
"/workbench"
)
public
String
index
(
ModelMap
mmap
)
{
String
type
=
ServletUtils
.
getParameter
(
"_type"
,
"oa"
);
User
user
=
ShiroUtils
.
getSysUser
();
if
(
user
!=
null
)
{
mmap
.
put
(
"onlineTime"
,
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
).
format
(
user
.
getLoginDate
()));
}
else
{
mmap
.
put
(
"onlineTime"
,
"未知时间"
);
}
// 取身份信息
List
<
Menu
>
menus
=
new
ArrayList
<
Menu
>();
if
(
SinoBaseConfig
.
isPlatform
())
{
menus
=
platformService
.
getMenus
(
user
.
getMenus
());
}
else
{
}
if
(
"law"
.
equals
(
type
))
{
//只保留法律模块
menus
=
menus
.
stream
().
filter
(
m
->
m
.
getMenuType
().
equals
(
"OLDOA-LAW"
)).
collect
(
Collectors
.
toList
()).
get
(
0
).
getChildren
();
}
else
if
(
"db"
.
equals
(
type
)){
//只保留督办模块
menus
=
menus
.
stream
().
filter
(
m
->
m
.
getMenuType
().
equals
(
"OLDOA-DB"
)).
collect
(
Collectors
.
toList
()).
get
(
0
).
getChildren
();
}
else
if
(
"bf"
.
equals
(
type
)){
//只保留督办模块
menus
=
menus
.
stream
().
filter
(
m
->
m
.
getMenuType
().
equals
(
"OLDOA-BF"
)).
collect
(
Collectors
.
toList
()).
get
(
0
).
getChildren
();
}
else
{
//过滤掉法律模块和督办模块
menus
=
menus
.
stream
().
filter
(
m
->
(!
m
.
getMenuType
().
equals
(
"OLDOA-BF"
)&&!
m
.
getMenuType
().
equals
(
"OLDOA-LAW"
)&&!
m
.
getMenuType
().
equals
(
"OLDOA-DB"
))).
collect
(
Collectors
.
toList
());
}
mmap
.
put
(
"_type"
,
type
);
mmap
.
put
(
"ip"
,
IP
);
mmap
.
put
(
"user"
,
user
);
mmap
.
put
(
"deptHistoryId"
,
user
.
getDept
().
getHistoryId
());
mmap
.
put
(
"loginName"
,
user
.
getLoginName
());
mmap
.
put
(
"password"
,
user
.
getPassword
());
if
(
SinoBaseConfig
.
isPlatform
())
{
mmap
.
put
(
"oldUserId"
,
user
.
getHistoryId
());
}
else
{
mmap
.
put
(
"oldUserId"
,
""
);
}
mmap
.
put
(
"isextendnet"
,
isextendnet
);
//项目组登录oa,只能看到项目组使用的单独模块,同事设置成外网模式,不需要看到法律,督办等模块
if
(
CommonContent
.
COMPANY_EXTEND
.
equals
(
user
.
getDept
().
getParentId
()))
{
menus
=
menus
.
stream
().
filter
(
m
->
m
.
getMenuType
().
equals
(
"OLDOA-EXTEND"
)).
collect
(
Collectors
.
toList
()).
get
(
0
).
getChildren
();
mmap
.
put
(
"isextendnet"
,
true
);
}
mmap
.
put
(
"menus"
,
menus
);
//系统消息
mmap
.
put
(
"copyrightYear"
,
sinoBaseConfig
.
getCopyrightYear
());
mmap
.
put
(
"location"
,
"location"
);
mmap
.
put
(
"ishasAccount"
,
workbench
.
ishasAccount
(
user
.
getLoginName
())+
""
);
mmap
.
put
(
"environment"
,
environment
);
return
"index"
;
// return "workbench";
}
//获取法律模块导航
@GetMapping
(
"/workbench/changetype/{type}"
)
@ResponseBody
public
List
<
Menu
>
getlawurl
(
@PathVariable
(
"type"
)
String
type
){
User
user
=
ShiroUtils
.
getSysUser
();
List
<
Menu
>
menus
=
new
ArrayList
<
Menu
>();
if
(
SinoBaseConfig
.
isPlatform
())
{
menus
=
platformService
.
getMenus
(
user
.
getMenus
());
}
else
{
}
if
(
"law"
.
equals
(
type
))
{
//法律导航特殊判断,只显示法律相关模块
for
(
Menu
menu
:
menus
)
{
if
(
"OLDOA-LAW"
.
equals
(
menu
.
getMenuType
()))
{
menus
=
menu
.
getChildren
();
}
}
}
else
if
(
"db"
.
equals
(
type
)){
for
(
Menu
menu
:
menus
)
{
if
(
"OLDOA-DB"
.
equals
(
menu
.
getMenuType
()))
{
menus
=
menu
.
getChildren
();
}
}
}
else
if
(
"act"
.
equals
(
type
)){
for
(
Menu
menu
:
menus
)
{
if
(
"OLDOA-ACT"
.
equals
(
menu
.
getMenuType
()))
{
menus
=
menu
.
getChildren
();
}
}
}
else
if
(
"bf"
.
equals
(
type
)){
for
(
Menu
menu
:
menus
)
{
if
(
"OLDOA-BF"
.
equals
(
menu
.
getMenuType
()))
{
menus
=
menu
.
getChildren
();
}
}
}
else
{
//过滤掉法律模块
menus
=
menus
.
stream
().
filter
(
m
->
(!
m
.
getMenuType
().
equals
(
"OLDOA-BF"
)&&!
m
.
getMenuType
().
equals
(
"OLDOA-LAW"
)&&!
m
.
getMenuType
().
equals
(
"OLDOA-DB"
))).
collect
(
Collectors
.
toList
());
}
return
menus
;
}
@GetMapping
(
"/workbench/index"
)
public
String
workbench
(
ModelMap
mmap
)
{
if
(
SinoBaseConfig
.
isPlatform
()){
User
user
=
ShiroUtils
.
getSysUser
();
mmap
.
put
(
"user"
,
user
);
ManagerOldOADate
man
=
new
ManagerOldOADate
();
/*man.listOldOAWorkFlowRead(user.getUserId(),null)*/
mmap
.
put
(
"oldUserId"
,
user
.
getHistoryId
());
mmap
.
put
(
"ip"
,
IP
);
mmap
.
put
(
"deptHistoryId"
,
user
.
getDept
().
getHistoryId
());
mmap
.
put
(
"isextendnet"
,
isextendnet
);
/*
* 系统当前在线人数信息,系统今日登录人数,系统总登录人数次数
*/
int
size
=
sessionDao
.
getActiveSessions
().
size
();
//当前在线人数
long
loginTimesToday
=
0
;
//系统当天登录次数(所有人)
long
loginTimesAll
=
0
;
//系统总登录次数(所有人)
mmap
.
put
(
"onlineNow"
,
size
);
if
(
isIntranet
)
{
loginTimesToday
=
loginHistoryService
.
getLoginTimesToday
();
loginTimesAll
=
loginHistoryService
.
getLoginTimesAll
();
}
mmap
.
put
(
"loginTimesToday"
,
loginTimesToday
);
mmap
.
put
(
"loginTimesAll"
,
loginTimesAll
);
return
"/workbench/index"
;
}
else
{
return
"/workbench/singleIndex"
;
}
}
@GetMapping
(
"/system/tip"
)
public
String
tip
()
{
return
"tip"
;
}
@GetMapping
(
"/demo"
)
public
String
demo
()
{
return
"/demo/demo"
;
}
// 系统介绍
@GetMapping
(
"/system/main"
)
public
String
main
(
ModelMap
mmap
)
{
mmap
.
put
(
"version"
,
sinoBaseConfig
.
getVersion
());
return
"main"
;
}
@ResponseBody
@RequestMapping
(
value
=
"/workbench/gotoOtherdb"
)
public
ModelAndView
submitworkflow
(
HttpServletRequest
request
)
throws
Exception
{
String
url
=
request
.
getParameter
(
"url"
);
if
(
url
!=
null
&&
url
.
indexOf
(
"-|-"
)>-
1
){
url
=
url
.
replace
(
"-|-"
,
"&"
);
}
ModelAndView
mv
=
new
ModelAndView
(
"/workbench/gotoOtherdb"
);
mv
.
addObject
(
"urlValue"
,
url
);
return
mv
;
}
// @GetMapping("/workbench/refresh_page/{methodName}/{recordid}")
// public ModelAndView convert(@PathVariable("methodName") String methodName,@PathVariable("recordid") String recordid) {
// ModelAndView mv = new ModelAndView("/workbench/convert");
// mv.addObject("methodName", methodName);
// mv.addObject("recordid", recordid);
// return mv;
// }
}
src/main/java/com/sinobase/project/system/user/domain/User.java
0 → 100644
View file @
dc2e4ce4
package
com
.
sinobase
.
project
.
system
.
user
.
domain
;
import
com.sinobase.framework.web.domain.BaseEntity
;
import
com.sinobase.project.system.dept.domain.Dept
;
import
com.sinobase.project.system.menu.domain.Menu
;
import
com.sinobase.project.system.role.domain.Role
;
import
org.apache.shiro.crypto.SecureRandomNumberGenerator
;
import
java.util.Arrays
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.Map
;
/**
* 用户对象 sys_user
* @author sinobase
*/
public
class
User
extends
BaseEntity
{
private
static
final
long
serialVersionUID
=
1L
;
//------ 单体应用用开始 ------------
/** 角色ID */
private
String
roleId
;
//------ 单体应用用结束 ------------
/** 所在公司id **/
private
String
companyId
;
/** 所在公司名称 **/
private
String
companyName
;
/** 个人快捷方式 **/
private
String
shortcut
;
/** 身份证号码 **/
private
String
idNo
;
/** 用户ID */
private
String
userId
;
/** 部门ID */
private
String
deptId
;
/** 部门名称 */
private
String
deptName
;
/** 登录名称 */
private
String
loginName
;
/** 用户名称 */
private
String
userName
;
/** 用户邮箱 */
private
String
email
;
/** 手机号码 */
private
String
phonenumber
;
//用户座机号码
private
String
tel
;
/** 用户性别 */
private
String
sex
;
/** 用户头像 */
private
String
avatar
;
/** 密码 */
private
String
password
;
/** 盐加密 */
private
String
salt
;
/** 帐号状态(0正常 1停用) */
private
String
status
;
/** 删除标志(0代表存在 2代表删除) */
private
String
delFlag
;
/** 最后登陆IP */
private
String
loginIp
;
/** 最后登陆时间 */
private
Date
loginDate
;
/** 部门对象 */
private
Dept
dept
;
/** 国泰历史用户数据id */
private
String
historyId
;
/** 用户身份 */
private
String
userStatus
;
/**手机imei码*/
private
String
phoneImei
;
/**组织编码*/
private
String
masterCode
;
/**部门对象*/
private
List
<
Dept
>
depts
;
/**
*员工编号,统一认证后可能需要员工编号进行登录
*/
private
String
userCode
;
/**
* 身份证
*/
private
String
idcNumber
;
/** 角色集合 */
private
List
<
Role
>
roles
;
/** 系统角色组,以","号分割 */
private
String
roleIds
;
/** 岗位组 */
private
Long
[]
postIds
;
/** 业务角色集合 */
private
List
<
Map
<
String
,
String
>>
flowRoles
;
/** 系统角色组,以","号分割 */
private
String
flowRoleIds
;
/** 资源集合(从平台获取的资源存放在这个属性中) */
private
List
<
Menu
>
menus
;
public
String
getUserCode
()
{
return
userCode
;
}
public
void
setUserCode
(
String
userCode
)
{
this
.
userCode
=
userCode
;
}
public
String
getIdcNumber
()
{
return
idcNumber
;
}
public
void
setIdcNumber
(
String
idcNumber
)
{
this
.
idcNumber
=
idcNumber
;
}
public
List
<
Dept
>
getDepts
()
{
return
depts
;
}
public
void
setDepts
(
List
<
Dept
>
depts
)
{
this
.
depts
=
depts
;
}
public
String
getCompanyId
()
{
return
companyId
;
}
public
void
setCompanyId
(
String
companyId
)
{
this
.
companyId
=
companyId
;
}
public
String
getCompanyName
()
{
return
companyName
;
}
public
void
setCompanyName
(
String
companyName
)
{
this
.
companyName
=
companyName
;
}
public
String
getIdNo
()
{
return
idNo
;
}
public
void
setIdNo
(
String
idNo
)
{
this
.
idNo
=
idNo
;
}
public
List
<
Menu
>
getMenus
()
{
return
menus
;
}
public
void
setMenus
(
List
<
Menu
>
menus
)
{
this
.
menus
=
menus
;
}
public
String
getHistoryId
()
{
return
historyId
;
}
public
void
setHistoryId
(
String
historyId
)
{
this
.
historyId
=
historyId
;
}
public
String
getUserStatus
()
{
return
userStatus
;
}
public
void
setUserStatus
(
String
userStatus
)
{
this
.
userStatus
=
userStatus
;
}
public
String
getPhoneImei
()
{
return
phoneImei
;
}
public
void
setPhoneImei
(
String
phoneImei
)
{
this
.
phoneImei
=
phoneImei
;
}
public
String
getMasterCode
()
{
return
masterCode
;
}
public
void
setMasterCode
(
String
masterCode
)
{
this
.
masterCode
=
masterCode
;
}
public
String
getUserId
()
{
return
userId
;
}
public
void
setUserId
(
String
userId
)
{
this
.
userId
=
userId
;
}
public
boolean
isAdmin
()
{
return
isAdmin
(
this
.
userId
);
}
public
static
boolean
isAdmin
(
String
userId
)
{
return
userId
!=
null
&&
userId
.
equals
(
"1"
.
toString
());
}
public
String
getDeptId
()
{
return
deptId
;
}
public
void
setDeptId
(
String
deptId
)
{
this
.
deptId
=
deptId
;
}
public
String
getDeptName
()
{
return
deptName
;
}
public
void
setDeptName
(
String
deptName
)
{
this
.
deptName
=
deptName
;
}
public
String
getLoginName
()
{
return
loginName
;
}
public
void
setLoginName
(
String
loginName
)
{
this
.
loginName
=
loginName
;
}
public
String
getUserName
()
{
return
userName
;
}
public
void
setUserName
(
String
userName
)
{
this
.
userName
=
userName
;
}
public
String
getEmail
()
{
return
email
;
}
public
void
setEmail
(
String
email
)
{
this
.
email
=
email
;
}
public
String
getPhonenumber
()
{
return
phonenumber
;
}
public
void
setPhonenumber
(
String
phonenumber
)
{
this
.
phonenumber
=
phonenumber
;
}
public
String
getSex
()
{
return
sex
;
}
public
void
setSex
(
String
sex
)
{
this
.
sex
=
sex
;
}
public
String
getAvatar
()
{
return
avatar
;
}
public
void
setAvatar
(
String
avatar
)
{
this
.
avatar
=
avatar
;
}
public
String
getPassword
()
{
return
password
;
}
public
void
setPassword
(
String
password
)
{
this
.
password
=
password
;
}
public
String
getSalt
()
{
return
salt
;
}
public
void
setSalt
(
String
salt
)
{
this
.
salt
=
salt
;
}
/**
* 生成随机盐
*/
public
void
randomSalt
()
{
// 一个Byte占两个字节,此处生成的3字节,字符串长度为6
SecureRandomNumberGenerator
secureRandom
=
new
SecureRandomNumberGenerator
();
String
hex
=
secureRandom
.
nextBytes
(
3
).
toHex
();
setSalt
(
hex
);
}
public
String
getStatus
()
{
return
status
;
}
public
void
setStatus
(
String
status
)
{
this
.
status
=
status
;
}
public
String
getDelFlag
()
{
return
delFlag
;
}
public
void
setDelFlag
(
String
delFlag
)
{
this
.
delFlag
=
delFlag
;
}
public
String
getLoginIp
()
{
return
loginIp
;
}
public
void
setLoginIp
(
String
loginIp
)
{
this
.
loginIp
=
loginIp
;
}
public
Date
getLoginDate
()
{
return
loginDate
;
}
public
void
setLoginDate
(
Date
loginDate
)
{
this
.
loginDate
=
loginDate
;
}
public
Dept
getDept
()
{
return
dept
;
}
public
void
setDept
(
Dept
dept
)
{
this
.
dept
=
dept
;
}
public
List
<
Role
>
getRoles
()
{
return
roles
;
}
public
void
setRoles
(
List
<
Role
>
roles
)
{
this
.
roles
=
roles
;
}
public
String
getRoleIds
()
{
return
roleIds
;
}
public
void
setRoleIds
(
String
roleIds
)
{
this
.
roleIds
=
roleIds
;
}
public
Long
[]
getPostIds
()
{
return
postIds
;
}
public
void
setPostIds
(
Long
[]
postIds
)
{
this
.
postIds
=
postIds
;
}
public
List
<
Map
<
String
,
String
>>
getFlowRoles
()
{
return
flowRoles
;
}
public
void
setFlowRoles
(
List
<
Map
<
String
,
String
>>
flowRoles
)
{
this
.
flowRoles
=
flowRoles
;
}
public
String
getFlowRoleIds
()
{
return
flowRoleIds
;
}
public
void
setFlowRoleIds
(
String
flowRoleIds
)
{
this
.
flowRoleIds
=
flowRoleIds
;
}
public
String
getShortcut
()
{
return
shortcut
;
}
public
void
setShortcut
(
String
shortcut
)
{
this
.
shortcut
=
shortcut
;
}
@Override
public
String
toString
()
{
return
"User{"
+
"userId='"
+
userId
+
'\''
+
", deptId='"
+
deptId
+
'\''
+
", deptName='"
+
deptName
+
'\''
+
", loginName='"
+
loginName
+
'\''
+
", userName='"
+
userName
+
'\''
+
", email='"
+
email
+
'\''
+
", phonenumber='"
+
phonenumber
+
'\''
+
", sex='"
+
sex
+
'\''
+
", avatar='"
+
avatar
+
'\''
+
", password='"
+
password
+
'\''
+
", salt='"
+
salt
+
'\''
+
", status='"
+
status
+
'\''
+
", delFlag='"
+
delFlag
+
'\''
+
", loginIp='"
+
loginIp
+
'\''
+
", loginDate="
+
loginDate
+
", dept="
+
dept
+
", historyId='"
+
historyId
+
'\''
+
", userStatus='"
+
userStatus
+
'\''
+
", phoneImei='"
+
phoneImei
+
'\''
+
", masterCode='"
+
masterCode
+
'\''
+
", depts="
+
depts
+
", roles="
+
roles
+
", roleIds='"
+
roleIds
+
'\''
+
", postIds="
+
Arrays
.
toString
(
postIds
)
+
", menus="
+
menus
+
", userCode="
+
userCode
+
", idcNumber="
+
idcNumber
+
'}'
;
}
public
String
getRoleId
()
{
return
roleId
;
}
public
void
setRoleId
(
String
roleId
)
{
this
.
roleId
=
roleId
;
}
public
String
getTel
()
{
return
tel
;
}
public
void
setTel
(
String
tel
)
{
this
.
tel
=
tel
;
}
}
src/main/java/com/sinobase/project/system/user/mapper/LoginHistoryLogMapper.java
0 → 100644
View file @
dc2e4ce4
package
com
.
sinobase
.
project
.
system
.
user
.
mapper
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Param
;
@Mapper
public
interface
LoginHistoryLogMapper
{
/**
* 获取所有的登录次数
* @return 表中数据的条数,每登录一次就会产生一条记录。
*/
public
long
getLoginTimesAll
();
/**
* 获取某天的登录次数,yyyy-MM-dd
* @return 根据时间获取某天的登录条数
*/
public
long
getLoginTimesOfday
(
@Param
(
"date"
)
String
date
);
}
src/main/java/com/sinobase/project/system/user/service/ILoginHistoryLogService.java
0 → 100644
View file @
dc2e4ce4
package
com
.
sinobase
.
project
.
system
.
user
.
service
;
public
interface
ILoginHistoryLogService
{
public
long
getLoginTimesAll
();
public
long
getLoginTimesToday
();
}
src/main/java/com/sinobase/project/system/user/service/LoginHistoryLogServiceImpl.java
0 → 100644
View file @
dc2e4ce4
package
com
.
sinobase
.
project
.
system
.
user
.
service
;
import
java.text.SimpleDateFormat
;
import
java.util.Date
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
com.sinobase.datasource.aspectj.lang.annotation.DataSource
;
import
com.sinobase.datasource.aspectj.lang.enums.DataSourceType
;
import
com.sinobase.project.system.user.mapper.LoginHistoryLogMapper
;
@Service
@DataSource
(
DataSourceType
.
ORACLE
)
public
class
LoginHistoryLogServiceImpl
implements
ILoginHistoryLogService
{
@Autowired
private
LoginHistoryLogMapper
loginHistoryMapper
;
@Override
public
long
getLoginTimesAll
()
{
return
loginHistoryMapper
.
getLoginTimesAll
();
}
@Override
public
long
getLoginTimesToday
()
{
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
"yyyy-MM-dd"
);
String
date
=
sdf
.
format
(
new
Date
());
// date = "2017-07-03"; //测试数据,因为互联网开发环境没有数据
return
loginHistoryMapper
.
getLoginTimesOfday
(
date
);
}
}
src/main/resources/application-dev.yml
View file @
dc2e4ce4
...
...
@@ -15,42 +15,46 @@ spring:
database
:
0
datasource
:
type
:
com.alibaba.druid.pool.DruidDataSource
publicKey
:
MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBAKDtJnmwIAqtrpHN4IFaUqdCxcweVXMuKTQHRdH3bABiaCAHSvY4cqz/OoDEexzAwGc8ygz8gmp90b14njhZJwkCAwEAAQ==
druid
:
master
:
driver-class-name
:
com.mysql.cj.jdbc.Driver
url
:
jdbc:mysql://152.136.74.6:3306/sinooa?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&allowMultiQueries=true
username
:
root
password
:
bug48625
# 初始连接数
url
:
jdbc:mysql://172.30.13.55:3306/sinooa?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&serverTimezone=GMT%2B8&allowMultiQueries=true&allowPublicKeyRetrieval=true
username
:
developer
password
:
123456
initial-size
:
2
# 最大连接池数量
max-active
:
100
# 最小连接池数量
min-idle
:
2
#passwordCallbackClassName: com.sinobase.framework.config.DbPasswordCallback
#connection-properties: config.decrypt=true;publicKey=${spring.datasource.publicKey};password=${spring.datasource.druid.master.password}
# 从库数据源
slave
:
driver-class-name
:
com.mysql.cj.jdbc.Driver
enabled
:
false
url
:
jdbc:mysql://152.136.74.6:3306/davehan?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&allowMultiQueries=
true
u
sername
:
davehan
password
:
bug48625
# 初始连接数
# 从数据源开关/默认关闭
enabled
:
true
u
rl
:
jdbc:mysql://172.30.13.55:3306/sinooa?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&serverTimezone=GMT%2B8&allowMultiQueries=true&allowPublicKeyRetrieval=true
username
:
developer
password
:
123456
initial-size
:
2
# 最大连接池数量
max-active
:
100
# 最小连接池数量
min-idle
:
2
#passwordCallbackClassName: com.sinobase.framework.config.DbPasswordCallback
#connection-properties: config.decrypt=true;publicKey=${spring.datasource.publicKey};password=${spring.datasource.druid.slave.password}
oracle
:
driver-class-name
:
oracle.jdbc.OracleDriver
driver-class-name
:
oracle.jdbc.
driver.
OracleDriver
enabled
:
true
url
:
jdbc:oracle:thin:@111.204.29.117:1521:orcl
username
:
sysfw
password
:
sysfw
# 初始连接数
url
:
jdbc:oracle:thin:@172.30.13.55:1521/sinoepuias
username
:
sdicoa
password
:
09544cb8b95eac2859ea81c4a77c7e86
initial-size
:
2
# 最大连接池数量
max-active
:
100
# 最小连接池数量
min-idle
:
2
passwordCallbackClassName
:
com.sinobase.framework.config.DbPasswordCallback
connection-properties
:
config.decrypt=true;publicKey=${spring.datasource.publicKey};password=${spring.datasource.druid.oracle.password}
initialSize
:
20
maxActive
:
100
# 最小连接池数量
minIdle
:
2
# 配置获取连接等待超时的时间
maxWait
:
60000
# 打开PSCache,并且指定每个连接上PSCache的大小
...
...
@@ -83,13 +87,40 @@ shiro:
user
:
unauthorizedUrl
:
/failed
session
:
expireTime
:
3
0
expireTime
:
12
0
sso
:
loginPageURL
:
"
http://1
11.204.29.117:850
0/sso"
validateURL
:
"
http://1
11.204.29.117:850
0/sso/ticket"
loginPageURL
:
"
http://1
72.30.13.53:808
0/sso"
validateURL
:
"
http://1
72.30.13.53:808
0/sso/ticket"
setCookie
:
/setCookie
location
:
"
http://172.30.13.53:8080/"
oldOaPath
:
"
http://172.30.15.73:7001/"
budgetlocation
:
"
http://localhost:8400/"
esbPath
:
"
http://172.30.15.90:9099"
notice
:
shortmessage
:
"
http://192.168.100.100:8080"
open
:
false
# app推送通知
pushOpen
:
false
sinobase
:
# 文件上传服务地址(本地地址:/file/upload)
fileServer
:
http://172.30.13.53:8501/
# 映射路径 mappingUrl: http://10.0.191.70/getFile/,10.0.191.70为服务器地址,getFile在FileConfig中进行资源映射
mappingUrl
:
http://172.30.13.53:8501/getFile/
# 文件上传路径(window路径:d:/)
profile
:
D:/uploadTemp/dev/
#导出文件模板
#templatePath: D:/work/java/SinoBase/sinobase-web/src/main/resources/static/file
templatePath
:
/home/webapp/WEB-INF/classes/static/file
#获取流程图JSON的IP地址
flowChartIp
:
http://172.30.13.54:18003
#是否为内网
isIntranet
:
false
#是否为外网
isextendnet
:
false
#是否为手机端
isphone
:
false
workflow
:
# 旧平台远程工作流提交
workflowurl
:
http://111.204.29.117:7001/workflow/workflow-convert.jsp
flowChartIp
:
http://111.204.29.117:18003
workflowMobileIP
:
http://111.204.29.117:7001
\ No newline at end of file
workflowurl
:
http://172.30.15.73:7001/workflow/workflow-convert.jsp
flowChartIp
:
http://172.30.15.73:18003
workflowMobileIP
:
http://172.30.15.73:7001
\ No newline at end of file
src/main/resources/application.yml
View file @
dc2e4ce4
...
...
@@ -2,6 +2,8 @@
sinobase
:
# 是否集成公司的微服务平台
isPlatform
:
true
# 在公司微服务平台上的注册系统ID
system_id
:
97465
# 开发环境配置
server
:
...
...
@@ -9,7 +11,7 @@ server:
port
:
8400
servlet
:
# 项目contextPath
context-path
:
/
empty
context-path
:
/
homepage
spring
:
profiles
:
...
...
@@ -21,6 +23,12 @@ spring:
encoding
:
UTF-8
content-type
:
text/html
cache
:
false
application
:
name
:
homepage-server
cloud
:
nacos
:
discovery
:
server-addr
:
http://172.30.13.54:8848/
mybatis-plus
:
mapper-location
:
classpath*:mybatis/**/*Mapper.xml
##默认是mapper-locations,这里是自定义的属性,在DruidConfig中读取
...
...
src/main/resources/mybatis/system/LoginHistoryLogMapper.xml
0 → 100644
View file @
dc2e4ce4
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.sinobase.project.system.user.mapper.LoginHistoryLogMapper"
>
<select
id=
"getLoginTimesAll"
resultType=
"java.lang.Long"
>
select count(1) from login_history_log
</select>
<select
id=
"getLoginTimesOfday"
resultType=
"java.lang.Long"
parameterType=
"java.lang.String"
>
<bind
name=
"_date"
value=
"date + '%'"
/>
select count(1) from login_history_log where login_time like #{_date, jdbcType=VARCHAR}
</select>
</mapper>
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment