Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
smart_gov_platform
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
赵啸非
smart_gov_platform
Commits
5fe78d99
Commit
5fe78d99
authored
Oct 20, 2022
by
赵啸非
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加初始化数据库脚本
parent
afcdc30e
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
71 additions
and
41 deletions
+71
-41
base-manager/src/main/java/com/mortals/xhx/base/system/oper/service/OperLogService.java
.../mortals/xhx/base/system/oper/service/OperLogService.java
+2
-1
base-manager/src/main/java/com/mortals/xhx/base/system/resource/service/ResourceService.java
...als/xhx/base/system/resource/service/ResourceService.java
+3
-0
base-manager/src/main/java/com/mortals/xhx/base/system/resource/service/impl/ResourceServiceImpl.java
...ase/system/resource/service/impl/ResourceServiceImpl.java
+55
-1
base-manager/src/main/java/com/mortals/xhx/base/system/user/service/UserService.java
...com/mortals/xhx/base/system/user/service/UserService.java
+1
-2
base-manager/src/main/java/com/mortals/xhx/base/system/user/service/impl/UserServiceImpl.java
...ls/xhx/base/system/user/service/impl/UserServiceImpl.java
+3
-34
base-manager/src/main/java/com/mortals/xhx/module/site/service/impl/SiteServiceImpl.java
...mortals/xhx/module/site/service/impl/SiteServiceImpl.java
+7
-3
No files found.
base-manager/src/main/java/com/mortals/xhx/base/system/oper/service/OperLogService.java
View file @
5fe78d99
...
@@ -77,4 +77,5 @@ public interface OperLogService extends ICRUDService<OperLogEntity,Long> {
...
@@ -77,4 +77,5 @@ public interface OperLogService extends ICRUDService<OperLogEntity,Long> {
void
insertOperLog
(
String
ip
,
String
requestUrl
,
Long
userId
,
String
userName
,
String
loginName
,
String
content
);
void
insertOperLog
(
String
ip
,
String
requestUrl
,
Long
userId
,
String
userName
,
String
loginName
,
String
content
);
}
}
\ No newline at end of file
base-manager/src/main/java/com/mortals/xhx/base/system/resource/service/ResourceService.java
View file @
5fe78d99
...
@@ -63,4 +63,7 @@ public interface ResourceService extends ICRUDService<ResourceEntity,Long> {
...
@@ -63,4 +63,7 @@ public interface ResourceService extends ICRUDService<ResourceEntity,Long> {
* @param userType
* @param userType
*/
*/
List
<
ResourceEntity
>
findAll
(
int
userType
);
List
<
ResourceEntity
>
findAll
(
int
userType
);
void
updateUserList
();
}
}
\ No newline at end of file
base-manager/src/main/java/com/mortals/xhx/base/system/resource/service/impl/ResourceServiceImpl.java
View file @
5fe78d99
...
@@ -8,15 +8,30 @@
...
@@ -8,15 +8,30 @@
package
com.mortals.xhx.base.system.resource.service.impl
;
package
com.mortals.xhx.base.system.resource.service.impl
;
import
com.mortals.framework.common.Rest
;
import
com.mortals.framework.exception.AppException
;
import
com.mortals.framework.exception.AppException
;
import
com.mortals.framework.model.Context
;
import
com.mortals.framework.service.impl.AbstractCRUDServiceImpl
;
import
com.mortals.framework.service.impl.AbstractCRUDServiceImpl
;
import
com.mortals.framework.util.StringUtils
;
import
com.mortals.framework.util.StringUtils
;
import
com.mortals.framework.util.ThreadPool
;
import
com.mortals.xhx.base.system.resource.dao.ResourceDao
;
import
com.mortals.xhx.base.system.resource.dao.ResourceDao
;
import
com.mortals.xhx.base.system.resource.model.ResourceEntity
;
import
com.mortals.xhx.base.system.resource.model.ResourceEntity
;
import
com.mortals.xhx.base.system.resource.model.ResourceQuery
;
import
com.mortals.xhx.base.system.resource.model.ResourceQuery
;
import
com.mortals.xhx.base.system.resource.service.ResourceService
;
import
com.mortals.xhx.base.system.resource.service.ResourceService
;
import
com.mortals.xhx.base.system.user.model.UserEntity
;
import
com.mortals.xhx.base.system.user.model.UserQuery
;
import
com.mortals.xhx.base.system.user.service.UserService
;
import
com.mortals.xhx.common.pdu.RespData
;
import
com.mortals.xhx.common.pdu.user.UserPdu
;
import
com.mortals.xhx.common.utils.BeanUtil
;
import
com.mortals.xhx.common.utils.SyncTreeSiteThread
;
import
com.mortals.xhx.feign.user.IUserFeign
;
import
com.mortals.xhx.module.site.service.SiteService
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.ObjectUtils
;
import
java.util.HashSet
;
import
java.util.HashSet
;
import
java.util.List
;
import
java.util.List
;
...
@@ -33,6 +48,13 @@ import java.util.Set;
...
@@ -33,6 +48,13 @@ import java.util.Set;
@Service
(
"resourceService"
)
@Service
(
"resourceService"
)
public
class
ResourceServiceImpl
extends
AbstractCRUDServiceImpl
<
ResourceDao
,
ResourceEntity
,
Long
>
implements
ResourceService
{
public
class
ResourceServiceImpl
extends
AbstractCRUDServiceImpl
<
ResourceDao
,
ResourceEntity
,
Long
>
implements
ResourceService
{
@Autowired
private
IUserFeign
userFeign
;
@Autowired
private
SiteService
siteService
;
@Autowired
private
UserService
userService
;
@Override
@Override
public
List
<
ResourceEntity
>
findAllEnable
()
throws
AppException
{
public
List
<
ResourceEntity
>
findAllEnable
()
throws
AppException
{
ResourceQuery
params
=
new
ResourceQuery
();
ResourceQuery
params
=
new
ResourceQuery
();
...
@@ -70,4 +92,36 @@ public class ResourceServiceImpl extends AbstractCRUDServiceImpl<ResourceDao,Res
...
@@ -70,4 +92,36 @@ public class ResourceServiceImpl extends AbstractCRUDServiceImpl<ResourceDao,Res
return
dao
.
getAll
(
userType
);
return
dao
.
getAll
(
userType
);
}
}
@Override
public
void
updateUserList
()
{
UserPdu
userPdu
=
new
UserPdu
();
userPdu
.
setPage
(
1
);
userPdu
.
setSize
(-
1
);
Rest
<
RespData
<
List
<
UserPdu
>>>
list
=
userFeign
.
list
(
userPdu
);
//更新本地用户信息,并且更新用户站点树
list
.
getData
().
getData
().
forEach
(
user
->
{
UserEntity
tempUserEntity
=
userService
.
selectOne
(
new
UserQuery
().
loginName
(
user
.
getLoginName
()));
if
(
ObjectUtils
.
isEmpty
(
tempUserEntity
))
{
//新增
UserEntity
entity
=
new
UserEntity
();
entity
.
initAttrValue
();
BeanUtils
.
copyProperties
(
user
,
entity
,
BeanUtil
.
getNullPropertyNames
(
user
));
userService
.
save
(
entity
);
Context
context
=
new
Context
();
context
.
setUser
(
entity
);
ThreadPool
.
getInstance
().
execute
(
new
SyncTreeSiteThread
(
siteService
,
context
));
}
else
{
//更新
UserEntity
userEntity
=
new
UserEntity
();
BeanUtils
.
copyProperties
(
user
,
userEntity
,
new
String
[]{
"loginPwd"
,
"userType"
,
"status"
,
"lastLoginTime"
,
"lastLoginAddress"
});
userService
.
updateWidthDao
(
userEntity
);
Context
context
=
new
Context
();
context
.
setUser
(
userEntity
);
ThreadPool
.
getInstance
().
execute
(
new
SyncTreeSiteThread
(
siteService
,
context
));
}
});
}
}
}
\ No newline at end of file
base-manager/src/main/java/com/mortals/xhx/base/system/user/service/UserService.java
View file @
5fe78d99
...
@@ -115,6 +115,5 @@ public interface UserService extends ICRUDService<UserEntity,Long> {
...
@@ -115,6 +115,5 @@ public interface UserService extends ICRUDService<UserEntity,Long> {
void
updateUserList
();
void
updateWidthDao
(
UserEntity
userEntity
);
}
}
\ No newline at end of file
base-manager/src/main/java/com/mortals/xhx/base/system/user/service/impl/UserServiceImpl.java
View file @
5fe78d99
...
@@ -65,10 +65,7 @@ public class UserServiceImpl extends AbstractCRUDServiceImpl<UserDao, UserEntity
...
@@ -65,10 +65,7 @@ public class UserServiceImpl extends AbstractCRUDServiceImpl<UserDao, UserEntity
private
MenuService
menuService
;
private
MenuService
menuService
;
@Autowired
@Autowired
private
ResourceService
resourceService
;
private
ResourceService
resourceService
;
@Autowired
private
IUserFeign
userFeign
;
@Autowired
private
SiteService
siteService
;
private
void
doHandlerUser
(
UserEntity
entity
)
throws
AppException
{
private
void
doHandlerUser
(
UserEntity
entity
)
throws
AppException
{
if
(
StringUtils
.
isNotEmpty
(
entity
.
getLoginPwd
()))
{
if
(
StringUtils
.
isNotEmpty
(
entity
.
getLoginPwd
()))
{
...
@@ -293,36 +290,8 @@ public class UserServiceImpl extends AbstractCRUDServiceImpl<UserDao, UserEntity
...
@@ -293,36 +290,8 @@ public class UserServiceImpl extends AbstractCRUDServiceImpl<UserDao, UserEntity
}
}
@Override
@Override
public
void
updateUserList
()
{
public
void
updateWidthDao
(
UserEntity
userEntity
)
{
UserPdu
userPdu
=
new
UserPdu
();
userPdu
.
setPage
(
1
);
userPdu
.
setSize
(-
1
);
Rest
<
RespData
<
List
<
UserPdu
>>>
list
=
userFeign
.
list
(
userPdu
);
//更新本地用户信息,并且更新用户站点树
list
.
getData
().
getData
().
forEach
(
user
->
{
UserEntity
tempUserEntity
=
this
.
selectOne
(
new
UserQuery
().
loginName
(
user
.
getLoginName
()));
if
(
ObjectUtils
.
isEmpty
(
tempUserEntity
))
{
//新增
UserEntity
entity
=
new
UserEntity
();
entity
.
initAttrValue
();
BeanUtils
.
copyProperties
(
user
,
entity
,
BeanUtil
.
getNullPropertyNames
(
user
));
this
.
save
(
entity
);
Context
context
=
new
Context
();
context
.
setUser
(
entity
);
ThreadPool
.
getInstance
().
execute
(
new
SyncTreeSiteThread
(
siteService
,
context
));
}
else
{
//更新
UserEntity
userEntity
=
new
UserEntity
();
BeanUtils
.
copyProperties
(
user
,
userEntity
,
new
String
[]{
"loginPwd"
,
"userType"
,
"status"
,
"lastLoginTime"
,
"lastLoginAddress"
});
dao
.
update
(
userEntity
);
dao
.
update
(
userEntity
);
Context
context
=
new
Context
();
context
.
setUser
(
userEntity
);
ThreadPool
.
getInstance
().
execute
(
new
SyncTreeSiteThread
(
siteService
,
context
));
}
});
}
}
...
...
base-manager/src/main/java/com/mortals/xhx/module/site/service/impl/SiteServiceImpl.java
View file @
5fe78d99
...
@@ -13,6 +13,7 @@ import com.mortals.framework.service.impl.AbstractCRUDCacheServiceImpl;
...
@@ -13,6 +13,7 @@ import com.mortals.framework.service.impl.AbstractCRUDCacheServiceImpl;
import
com.mortals.framework.util.DataUtil
;
import
com.mortals.framework.util.DataUtil
;
import
com.mortals.framework.util.StringUtils
;
import
com.mortals.framework.util.StringUtils
;
import
com.mortals.framework.util.ThreadPool
;
import
com.mortals.framework.util.ThreadPool
;
import
com.mortals.xhx.base.system.resource.service.ResourceService
;
import
com.mortals.xhx.base.system.user.service.UserService
;
import
com.mortals.xhx.base.system.user.service.UserService
;
import
com.mortals.xhx.common.code.YesNoEnum
;
import
com.mortals.xhx.common.code.YesNoEnum
;
import
com.mortals.xhx.common.key.Constant
;
import
com.mortals.xhx.common.key.Constant
;
...
@@ -31,6 +32,7 @@ import com.mortals.xhx.module.site.model.SiteTreeSelect;
...
@@ -31,6 +32,7 @@ import com.mortals.xhx.module.site.model.SiteTreeSelect;
import
com.mortals.xhx.module.site.service.SiteService
;
import
com.mortals.xhx.module.site.service.SiteService
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.checkerframework.checker.units.qual.A
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.ObjectUtils
;
import
org.springframework.util.ObjectUtils
;
...
@@ -65,6 +67,8 @@ public class SiteServiceImpl extends AbstractCRUDCacheServiceImpl<SiteDao, SiteE
...
@@ -65,6 +67,8 @@ public class SiteServiceImpl extends AbstractCRUDCacheServiceImpl<SiteDao, SiteE
private
IUserFeign
userFeign
;
private
IUserFeign
userFeign
;
@Autowired
@Autowired
private
UserService
userService
;
private
UserService
userService
;
@Autowired
private
ResourceService
resourceService
;
@Override
@Override
protected
void
validData
(
SiteEntity
entity
,
Context
context
)
throws
AppException
{
protected
void
validData
(
SiteEntity
entity
,
Context
context
)
throws
AppException
{
...
@@ -194,7 +198,7 @@ public class SiteServiceImpl extends AbstractCRUDCacheServiceImpl<SiteDao, SiteE
...
@@ -194,7 +198,7 @@ public class SiteServiceImpl extends AbstractCRUDCacheServiceImpl<SiteDao, SiteE
Rest
<
String
>
rest
=
userFeign
.
synchSiteAuth
();
Rest
<
String
>
rest
=
userFeign
.
synchSiteAuth
();
if
(
rest
.
getCode
().
equals
(
YesNoEnum
.
YES
.
getValue
())){
if
(
rest
.
getCode
().
equals
(
YesNoEnum
.
YES
.
getValue
())){
//更新用户站点id,并更新站点树
//更新用户站点id,并更新站点树
user
Service
.
updateUserList
();
resource
Service
.
updateUserList
();
}
}
super
.
updateAfter
(
entity
,
context
);
super
.
updateAfter
(
entity
,
context
);
}
}
...
@@ -207,7 +211,7 @@ public class SiteServiceImpl extends AbstractCRUDCacheServiceImpl<SiteDao, SiteE
...
@@ -207,7 +211,7 @@ public class SiteServiceImpl extends AbstractCRUDCacheServiceImpl<SiteDao, SiteE
Rest
<
String
>
rest
=
userFeign
.
synchSiteAuth
();
Rest
<
String
>
rest
=
userFeign
.
synchSiteAuth
();
if
(
rest
.
getCode
().
equals
(
YesNoEnum
.
YES
.
getValue
())){
if
(
rest
.
getCode
().
equals
(
YesNoEnum
.
YES
.
getValue
())){
//更新用户站点id,并更新站点树
//更新用户站点id,并更新站点树
user
Service
.
updateUserList
();
resource
Service
.
updateUserList
();
}
}
super
.
saveAfter
(
entity
,
context
);
super
.
saveAfter
(
entity
,
context
);
...
@@ -220,7 +224,7 @@ public class SiteServiceImpl extends AbstractCRUDCacheServiceImpl<SiteDao, SiteE
...
@@ -220,7 +224,7 @@ public class SiteServiceImpl extends AbstractCRUDCacheServiceImpl<SiteDao, SiteE
Rest
<
String
>
rest
=
userFeign
.
synchSiteAuth
();
Rest
<
String
>
rest
=
userFeign
.
synchSiteAuth
();
if
(
rest
.
getCode
().
equals
(
YesNoEnum
.
YES
.
getValue
())){
if
(
rest
.
getCode
().
equals
(
YesNoEnum
.
YES
.
getValue
())){
//更新用户站点id,并更新站点树
//更新用户站点id,并更新站点树
user
Service
.
updateUserList
();
resource
Service
.
updateUserList
();
}
}
super
.
removeAfter
(
ids
,
context
,
result
);
super
.
removeAfter
(
ids
,
context
,
result
);
}
}
...
...
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