Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
device-new-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
赵啸非
device-new-platform
Commits
4f7d1e83
Commit
4f7d1e83
authored
1 year ago
by
赵啸非
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加信息公开平台通知
parent
be11b579
master
reg
2 merge requests
!2
Master
,
!1
WIP: Master
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
67 additions
and
0 deletions
+67
-0
common-lib/src/main/java/com/mortals/xhx/feign/IInfoPublishDeviceFeign.java
...n/java/com/mortals/xhx/feign/IInfoPublishDeviceFeign.java
+55
-0
device-manager/src/main/java/com/mortals/xhx/module/device/service/impl/DeviceServiceImpl.java
...als/xhx/module/device/service/impl/DeviceServiceImpl.java
+12
-0
No files found.
common-lib/src/main/java/com/mortals/xhx/feign/IInfoPublishDeviceFeign.java
0 → 100644
View file @
4f7d1e83
package
com.mortals.xhx.feign
;
import
com.mortals.framework.common.Rest
;
import
com.mortals.xhx.common.pdu.DeviceReq
;
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
;
import
org.springframework.web.bind.annotation.RequestBody
;
/**
* 设备 Feign接口
*
* @author zxfei
* @date 2023-02-25
*/
@FeignClient
(
name
=
"info-publish-manager"
,
path
=
"/infopublish"
,
fallbackFactory
=
InfoDeviceFeignFallbackFactory
.
class
)
public
interface
IInfoPublishDeviceFeign
extends
IFeign
{
/**
* 设备回调
*
* @param deviceReq
* @return
*/
@PostMapping
(
value
=
"/api/device/callback"
)
Rest
<
String
>
deviceCall
(
@RequestBody
DeviceReq
deviceReq
);
}
@Slf4j
@Component
class
InfoDeviceFeignFallbackFactory
implements
FallbackFactory
<
IInfoPublishDeviceFeign
>
{
@Override
public
IInfoPublishDeviceFeign
create
(
Throwable
t
)
{
return
new
IInfoPublishDeviceFeign
()
{
@Override
public
Rest
<
String
>
deviceCall
(
DeviceReq
deviceReq
)
{
return
Rest
.
fail
();
}
};
}
}
This diff is collapsed.
Click to expand it.
device-manager/src/main/java/com/mortals/xhx/module/device/service/impl/DeviceServiceImpl.java
View file @
4f7d1e83
...
...
@@ -23,6 +23,7 @@ import com.mortals.xhx.common.pdu.DeviceReq;
import
com.mortals.xhx.common.pdu.site.SitePdu
;
import
com.mortals.xhx.common.utils.BeanUtil
;
import
com.mortals.xhx.feign.IFillDeviceFeign
;
import
com.mortals.xhx.feign.IInfoPublishDeviceFeign
;
import
com.mortals.xhx.feign.IOfficeDeviceFeign
;
import
com.mortals.xhx.feign.ISampleDeviceFeign
;
import
com.mortals.xhx.feign.site.ISiteFeign
;
...
...
@@ -92,6 +93,9 @@ public class DeviceServiceImpl extends AbstractCRUDCacheServiceImpl<DeviceDao, D
@Autowired
private
IFillDeviceFeign
fillDeviceFeign
;
@Autowired
private
IInfoPublishDeviceFeign
infoPublishDeviceFeign
;
@Value
(
"${thirdPartyPath:/inter/device/deviceIn}"
)
private
String
thirdPartyPath
;
...
...
@@ -391,6 +395,14 @@ public class DeviceServiceImpl extends AbstractCRUDCacheServiceImpl<DeviceDao, D
Rest
<
String
>
sampleRest
=
sampleDeviceFeign
.
deviceCall
(
deviceReq
);
log
.
info
(
"sample resp ==>{}"
,
JSON
.
toJSONString
(
sampleRest
));
}
if
(
"xxgk"
.
equals
(
platformEntity
.
getPlatformSn
()))
{
deviceReq
.
setReceiveMethod
(
update
.
getValue
());
//调用样表系统系统
Rest
<
String
>
sampleRest
=
infoPublishDeviceFeign
.
deviceCall
(
deviceReq
);
log
.
info
(
"info publish resp ==>{}"
,
JSON
.
toJSONString
(
sampleRest
));
}
if
(
"tdxt"
.
equals
(
platformEntity
.
getPlatformSn
()))
{
deviceReq
.
setReceiveMethod
(
update
.
getValue
());
//调用样表系统系统
...
...
This diff is collapsed.
Click to expand it.
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