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
6da6770a
Commit
6da6770a
authored
Nov 16, 2023
by
赵啸非
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加线程发送消息
parent
8b0152f2
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
62 additions
and
0 deletions
+62
-0
base-manager/src/main/java/com/mortals/xhx/base/system/user/service/impl/UserServiceImpl.java
...ls/xhx/base/system/user/service/impl/UserServiceImpl.java
+2
-0
common-lib/src/main/java/com/mortals/xhx/feign/smartoffice/ISmartSystemFeign.java
.../com/mortals/xhx/feign/smartoffice/ISmartSystemFeign.java
+55
-0
portal-manager/src/main/java/com/mortals/xhx/common/utils/SendSubSystemTask.java
.../java/com/mortals/xhx/common/utils/SendSubSystemTask.java
+5
-0
No files found.
base-manager/src/main/java/com/mortals/xhx/base/system/user/service/impl/UserServiceImpl.java
View file @
6da6770a
...
@@ -49,6 +49,7 @@ import com.mortals.xhx.module.workman.service.WorkmanService;
...
@@ -49,6 +49,7 @@ import com.mortals.xhx.module.workman.service.WorkmanService;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.context.annotation.Lazy
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.ObjectUtils
;
import
org.springframework.util.ObjectUtils
;
...
@@ -75,6 +76,7 @@ public class UserServiceImpl extends AbstractCRUDCacheServiceImpl<UserDao, UserE
...
@@ -75,6 +76,7 @@ public class UserServiceImpl extends AbstractCRUDCacheServiceImpl<UserDao, UserE
@Autowired
@Autowired
private
RoleUserService
roleUserService
;
private
RoleUserService
roleUserService
;
@Lazy
@Autowired
@Autowired
private
IUserFeign
userFeign
;
private
IUserFeign
userFeign
;
...
...
common-lib/src/main/java/com/mortals/xhx/feign/smartoffice/ISmartSystemFeign.java
0 → 100644
View file @
6da6770a
package
com.mortals.xhx.feign.smartoffice
;
import
com.mortals.framework.common.Rest
;
import
com.mortals.xhx.feign.IFeign
;
import
feign.hystrix.FallbackFactory
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.cloud.openfeign.FeignClient
;
import
org.springframework.stereotype.Component
;
import
org.springframework.web.bind.annotation.PostMapping
;
/**
* 服务系统 Feign接口
*
* @author zxfei
* @date 2022-10-26
*/
@FeignClient
(
name
=
"smart-office-manager"
,
path
=
"/office"
,
fallbackFactory
=
SmartSystemFeignFallbackFactory
.
class
)
public
interface
ISmartSystemFeign
extends
IFeign
{
/**
* 用户刷新通知
*
* @param
* @return
*/
@PostMapping
(
value
=
"/user/refreshUser"
)
Rest
<
Void
>
refreshUser
();
}
@Slf4j
@Component
class
SmartSystemFeignFallbackFactory
implements
FallbackFactory
<
ISmartSystemFeign
>
{
@Override
public
ISmartSystemFeign
create
(
Throwable
t
)
{
return
new
ISmartSystemFeign
()
{
/**
* @return
*/
@Override
public
Rest
<
Void
>
refreshUser
()
{
return
Rest
.
fail
(
"暂时无法通知设备,请稍后再试!"
);
}
};
}
}
portal-manager/src/main/java/com/mortals/xhx/common/utils/SendSubSystemTask.java
View file @
6da6770a
...
@@ -5,6 +5,7 @@ import com.mortals.xhx.feign.device.IDeviceFeign;
...
@@ -5,6 +5,7 @@ import com.mortals.xhx.feign.device.IDeviceFeign;
import
com.mortals.xhx.feign.selfsystem.ISelfSystemFeign
;
import
com.mortals.xhx.feign.selfsystem.ISelfSystemFeign
;
import
com.mortals.xhx.feign.skin.ISkinFillFeign
;
import
com.mortals.xhx.feign.skin.ISkinFillFeign
;
import
com.mortals.xhx.feign.skin.ISkinSampleFeign
;
import
com.mortals.xhx.feign.skin.ISkinSampleFeign
;
import
com.mortals.xhx.feign.smartoffice.ISmartSystemFeign
;
import
com.mortals.xhx.utils.SpringUtils
;
import
com.mortals.xhx.utils.SpringUtils
;
import
lombok.AllArgsConstructor
;
import
lombok.AllArgsConstructor
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
...
@@ -24,6 +25,7 @@ public class SendSubSystemTask implements Runnable {
...
@@ -24,6 +25,7 @@ public class SendSubSystemTask implements Runnable {
private
ISkinSampleFeign
skinSampleFeign
;
private
ISkinSampleFeign
skinSampleFeign
;
private
ISkinFillFeign
skinFillFeign
;
private
ISkinFillFeign
skinFillFeign
;
private
ISelfSystemFeign
selfSystemFeign
;
private
ISelfSystemFeign
selfSystemFeign
;
private
ISmartSystemFeign
smartSystemFeign
;
public
SendSubSystemTask
()
{
public
SendSubSystemTask
()
{
apiAreaFeign
=
SpringUtils
.
getBean
(
IApiAreaFeign
.
class
);
apiAreaFeign
=
SpringUtils
.
getBean
(
IApiAreaFeign
.
class
);
...
@@ -31,6 +33,7 @@ public class SendSubSystemTask implements Runnable {
...
@@ -31,6 +33,7 @@ public class SendSubSystemTask implements Runnable {
skinSampleFeign
=
SpringUtils
.
getBean
(
ISkinSampleFeign
.
class
);
skinSampleFeign
=
SpringUtils
.
getBean
(
ISkinSampleFeign
.
class
);
skinFillFeign
=
SpringUtils
.
getBean
(
ISkinFillFeign
.
class
);
skinFillFeign
=
SpringUtils
.
getBean
(
ISkinFillFeign
.
class
);
selfSystemFeign
=
SpringUtils
.
getBean
(
ISelfSystemFeign
.
class
);
selfSystemFeign
=
SpringUtils
.
getBean
(
ISelfSystemFeign
.
class
);
smartSystemFeign
=
SpringUtils
.
getBean
(
ISmartSystemFeign
.
class
);
}
}
@Override
@Override
...
@@ -46,6 +49,8 @@ public class SendSubSystemTask implements Runnable {
...
@@ -46,6 +49,8 @@ public class SendSubSystemTask implements Runnable {
skinFillFeign
.
refreshUser
();
skinFillFeign
.
refreshUser
();
Thread
.
sleep
(
2000
);
Thread
.
sleep
(
2000
);
selfSystemFeign
.
refreshUser
();
selfSystemFeign
.
refreshUser
();
Thread
.
sleep
(
2000
);
smartSystemFeign
.
refreshUser
();
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
log
.
error
(
"通知异常:"
,
e
);
log
.
error
(
"通知异常:"
,
e
);
}
}
...
...
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