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
9b4c1b34
Commit
9b4c1b34
authored
Dec 24, 2023
by
赵啸非
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改上下线通知
parent
1792c075
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
43 deletions
+33
-43
device-manager/src/main/java/com/mortals/xhx/module/device/service/impl/DeviceServiceImpl.java
...als/xhx/module/device/service/impl/DeviceServiceImpl.java
+33
-26
device-manager/src/main/resources/bootstrap.yml
device-manager/src/main/resources/bootstrap.yml
+0
-17
No files found.
device-manager/src/main/java/com/mortals/xhx/module/device/service/impl/DeviceServiceImpl.java
View file @
9b4c1b34
...
@@ -385,33 +385,37 @@ public class DeviceServiceImpl extends AbstractCRUDCacheServiceImpl<DeviceDao, D
...
@@ -385,33 +385,37 @@ public class DeviceServiceImpl extends AbstractCRUDCacheServiceImpl<DeviceDao, D
deviceReq
.
setDeviceInFloor
(
entity
.
getDeviceInFloor
()
==
null
?
0
:
entity
.
getDeviceInFloor
());
deviceReq
.
setDeviceInFloor
(
entity
.
getDeviceInFloor
()
==
null
?
0
:
entity
.
getDeviceInFloor
());
//http://192.168.0.98:8090/inter/device/deviceIn
//http://192.168.0.98:8090/inter/device/deviceIn
//判断是否是php,如果不是 则是java 则内部调用
//判断是否是php,如果不是 则是java 则内部调用
if
(
"smartOffice"
.
equals
(
platformEntity
.
getPlatformSn
()))
{
deviceReq
.
setReceiveMethod
(
update
.
getValue
());
//todo 调用智慧办公系统
Rest
<
String
>
officeRest
=
officeDeviceFeign
.
deviceCall
(
deviceReq
);
log
.
info
(
"office resp ==>{}"
,
JSON
.
toJSONString
(
officeRest
));
}
if
(
"ybxt"
.
equals
(
platformEntity
.
getPlatformSn
()))
{
deviceReq
.
setReceiveMethod
(
update
.
getValue
());
//调用样表系统系统
Rest
<
String
>
sampleRest
=
sampleDeviceFeign
.
deviceCall
(
deviceReq
);
log
.
info
(
"sample resp ==>{}"
,
JSON
.
toJSONString
(
sampleRest
));
}
if
(
"xxgk"
.
equals
(
platformEntity
.
getPlatformSn
()))
{
try
{
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
());
if
(
"smartOffice"
.
equals
(
platformEntity
.
getPlatformSn
()))
{
//调用样表系统系统
deviceReq
.
setReceiveMethod
(
update
.
getValue
());
Rest
<
String
>
fillRest
=
fillDeviceFeign
.
deviceCall
(
deviceReq
);
//todo 调用智慧办公系统
log
.
info
(
"fill resp ==>{}"
,
JSON
.
toJSONString
(
fillRest
));
Rest
<
String
>
officeRest
=
officeDeviceFeign
.
deviceCall
(
deviceReq
);
}
else
{
log
.
info
(
"office resp ==>{}"
,
JSON
.
toJSONString
(
officeRest
));
cacheService
.
lpush
(
RedisKey
.
KEY_DEVICE_THIRDPARTY_QUEUE
,
deviceReq
);
}
if
(
"ybxt"
.
equals
(
platformEntity
.
getPlatformSn
()))
{
deviceReq
.
setReceiveMethod
(
update
.
getValue
());
//调用样表系统系统
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
());
//调用样表系统系统
Rest
<
String
>
fillRest
=
fillDeviceFeign
.
deviceCall
(
deviceReq
);
log
.
info
(
"fill resp ==>{}"
,
JSON
.
toJSONString
(
fillRest
));
}
else
{
cacheService
.
lpush
(
RedisKey
.
KEY_DEVICE_THIRDPARTY_QUEUE
,
deviceReq
);
// log.info("lpush:{}",lpush);
// log.info("lpush:{}",lpush);
// String phpInUrl = GlobalSysInfo.getParamValue(PARAM_SERVER_PHP_IN_HTTP_URL, "http://172.15.28.116:8090");
// String phpInUrl = GlobalSysInfo.getParamValue(PARAM_SERVER_PHP_IN_HTTP_URL, "http://172.15.28.116:8090");
// ApiResp<String> resp = messageService.sendThirdParty(UrlBuilder.of(phpInUrl).addPath(thirdPartyPath).build(), deviceReq);
// ApiResp<String> resp = messageService.sendThirdParty(UrlBuilder.of(phpInUrl).addPath(thirdPartyPath).build(), deviceReq);
...
@@ -422,6 +426,9 @@ public class DeviceServiceImpl extends AbstractCRUDCacheServiceImpl<DeviceDao, D
...
@@ -422,6 +426,9 @@ public class DeviceServiceImpl extends AbstractCRUDCacheServiceImpl<DeviceDao, D
// } else {
// } else {
// return Rest.fail("发送失败");
// return Rest.fail("发送失败");
// }
// }
}
}
catch
(
Exception
e
)
{
log
.
error
(
"feign调用异常!"
);
}
}
return
Rest
.
ok
();
return
Rest
.
ok
();
...
@@ -691,7 +698,7 @@ public class DeviceServiceImpl extends AbstractCRUDCacheServiceImpl<DeviceDao, D
...
@@ -691,7 +698,7 @@ public class DeviceServiceImpl extends AbstractCRUDCacheServiceImpl<DeviceDao, D
@Override
@Override
public
void
downMsg
(
List
<
DeviceMsgReq
>
list
)
{
public
void
downMsg
(
List
<
DeviceMsgReq
>
list
)
{
try
{
try
{
// ArrayList<DeviceLogEntity> deviceLogList = new ArrayList<>();
// ArrayList<DeviceLogEntity> deviceLogList = new ArrayList<>();
List
<
DeviceMsgReq
>
collect
=
list
.
stream
().
sorted
(
Comparator
.
comparing
(
DeviceMsgReq:
:
getTimestamp
)).
collect
(
Collectors
.
toList
());
List
<
DeviceMsgReq
>
collect
=
list
.
stream
().
sorted
(
Comparator
.
comparing
(
DeviceMsgReq:
:
getTimestamp
)).
collect
(
Collectors
.
toList
());
for
(
DeviceMsgReq
item
:
collect
)
{
for
(
DeviceMsgReq
item
:
collect
)
{
...
...
device-manager/src/main/resources/bootstrap.yml
View file @
9b4c1b34
...
@@ -70,23 +70,6 @@ spring:
...
@@ -70,23 +70,6 @@ spring:
url
:
@
profiles.datasource.uri@
url
:
@
profiles.datasource.uri@
username
:
@
profiles.datasource.username@
username
:
@
profiles.datasource.username@
password
:
@
profiles.datasource.password@
password
:
@
profiles.datasource.password@
# 连接池
# hikari:
# #连接池名
# pool-name: DateHikariCP
# #最小空闲连接数
# minimum-idle: 5
# # 空闲连接存活最大时间,默认600000(10分钟)
# idle-timeout: 180000
# # 连接池最大连接数,默认是10
# maximum-pool-size: 15
# # 此属性控制从池返回的连接的默认自动提交行为,默认值:true
# auto-commit: true
# # 此属性控制池中连接的最长生命周期,值0表示无限生命周期,默认1800000即30分钟
# max-lifetime: 1800000
# # 数据库连接超时时间,默认30秒,即30000
# connection-timeout: 30000
# connection-test-query: SELECT 1
mybatis
:
mybatis
:
root-path
:
com.mortals
root-path
:
com.mortals
...
...
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