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
42e907a1
Commit
42e907a1
authored
Dec 20, 2023
by
赵啸非
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改离线消息
parent
6e97a903
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
23 deletions
+8
-23
device-manager/src/main/java/com/mortals/xhx/busiz/web/DeviceApiController.java
...n/java/com/mortals/xhx/busiz/web/DeviceApiController.java
+8
-23
No files found.
device-manager/src/main/java/com/mortals/xhx/busiz/web/DeviceApiController.java
View file @
42e907a1
...
@@ -36,10 +36,7 @@ import com.mortals.xhx.common.model.MessageHeader;
...
@@ -36,10 +36,7 @@ import com.mortals.xhx.common.model.MessageHeader;
import
com.mortals.xhx.common.pdu.DeviceReq
;
import
com.mortals.xhx.common.pdu.DeviceReq
;
import
com.mortals.xhx.common.pdu.RespData
;
import
com.mortals.xhx.common.pdu.RespData
;
import
com.mortals.xhx.common.pdu.site.SitePdu
;
import
com.mortals.xhx.common.pdu.site.SitePdu
;
import
com.mortals.xhx.common.utils.BeanUtil
;
import
com.mortals.xhx.common.utils.*
;
import
com.mortals.xhx.common.utils.DownMsgTask
;
import
com.mortals.xhx.common.utils.EncryptUtil
;
import
com.mortals.xhx.common.utils.SendTaskThreadPool
;
import
com.mortals.xhx.feign.site.ISiteFeign
;
import
com.mortals.xhx.feign.site.ISiteFeign
;
import
com.mortals.xhx.module.device.model.DeviceEntity
;
import
com.mortals.xhx.module.device.model.DeviceEntity
;
import
com.mortals.xhx.module.device.model.DeviceModuleDistributeEntity
;
import
com.mortals.xhx.module.device.model.DeviceModuleDistributeEntity
;
...
@@ -246,17 +243,17 @@ public class DeviceApiController {
...
@@ -246,17 +243,17 @@ public class DeviceApiController {
deviceEntity
.
setDeviceStatus
(
DeviceStatusEnum
.
在线
.
getValue
());
deviceEntity
.
setDeviceStatus
(
DeviceStatusEnum
.
在线
.
getValue
());
deviceEntity
.
setDeviceVersion
(
req
.
getDeviceVersion
()
==
null
?
""
:
req
.
getDeviceVersion
());
deviceEntity
.
setDeviceVersion
(
req
.
getDeviceVersion
()
==
null
?
""
:
req
.
getDeviceVersion
());
/*
if(deviceEntity.getDeviceStatus()== DeviceStatusEnum.离线.getValue()){
/*
if(deviceEntity.getDeviceStatus()== DeviceStatusEnum.离线.getValue()){
DeviceEntity entity = new DeviceEntity();
DeviceEntity entity = new DeviceEntity();
entity.setId(deviceEntity.getId());
entity.setId(deviceEntity.getId());
entity.setOnlineTime(new Date());
entity.setOnlineTime(new Date());
entity.setDeviceStatus(DeviceStatusEnum.在线.getValue());
entity.setDeviceStatus(DeviceStatusEnum.在线.getValue());
cacheService.lpush(RedisKey.KEY_DEVICE_THIRDPARTY_QUEUE, entity);
cacheService.lpush(RedisKey.KEY_DEVICE_THIRDPARTY_QUEUE, entity);
}*/
}*/
//
deviceService.getDeviceDao().update(deviceEntity);
deviceService
.
getDeviceDao
().
update
(
deviceEntity
);
rsp
.
setData
(
deviceResp
);
rsp
.
setData
(
deviceResp
);
/*
SendThirdPartyTask sendThirdPartyTask = new SendThirdPartyTask(deviceEntity, productEntity, platformEntity, deviceService);
SendThirdPartyTask
sendThirdPartyTask
=
new
SendThirdPartyTask
(
deviceEntity
,
productEntity
,
platformEntity
,
deviceService
);
sendTaskThreadPool.execute(sendThirdPartyTask);
*/
sendTaskThreadPool
.
execute
(
sendThirdPartyTask
);
}
catch
(
AppException
e
)
{
}
catch
(
AppException
e
)
{
//log.error("接收数据失败", e);
//log.error("接收数据失败", e);
rsp
.
setCode
(
e
.
getCode
());
rsp
.
setCode
(
e
.
getCode
());
...
@@ -859,12 +856,10 @@ public class DeviceApiController {
...
@@ -859,12 +856,10 @@ public class DeviceApiController {
if
(!
ObjectUtils
.
isEmpty
(
deviceEntity
))
{
if
(!
ObjectUtils
.
isEmpty
(
deviceEntity
))
{
throw
new
AppException
(
DEVICE_CODE_IS_EXIST
,
DEVICE_CODE_IS_EXIST_CONTENT
);
throw
new
AppException
(
DEVICE_CODE_IS_EXIST
,
DEVICE_CODE_IS_EXIST_CONTENT
);
}
}
ProductEntity
productEntity
=
productService
.
selectOne
(
new
ProductQuery
().
productCode
(
req
.
getProductCode
()));
ProductEntity
productEntity
=
productService
.
selectOne
(
new
ProductQuery
().
productCode
(
req
.
getProductCode
()));
if
(
ObjectUtils
.
isEmpty
(
productEntity
))
{
if
(
ObjectUtils
.
isEmpty
(
productEntity
))
{
throw
new
AppException
(
PRODUCT_IS_EMPTY
,
PRODUCT_IS_EMPTY_CONTENT
);
throw
new
AppException
(
PRODUCT_IS_EMPTY
,
PRODUCT_IS_EMPTY_CONTENT
);
}
}
PlatformEntity
platformEntity
=
platformService
.
getCache
(
productEntity
.
getPlatformId
().
toString
());
PlatformEntity
platformEntity
=
platformService
.
getCache
(
productEntity
.
getPlatformId
().
toString
());
if
(
ObjectUtils
.
isEmpty
(
platformEntity
))
{
if
(
ObjectUtils
.
isEmpty
(
platformEntity
))
{
throw
new
AppException
(
PLATFORM_IS_EMPTY
,
PLATFORM_IS_EMPTY_CONTENT
);
throw
new
AppException
(
PLATFORM_IS_EMPTY
,
PLATFORM_IS_EMPTY_CONTENT
);
...
@@ -904,8 +899,8 @@ public class DeviceApiController {
...
@@ -904,8 +899,8 @@ public class DeviceApiController {
if
(
ObjectUtils
.
isEmpty
(
deviceEntity
))
{
if
(
ObjectUtils
.
isEmpty
(
deviceEntity
))
{
throw
new
AppException
(
DEVICE_CODE_IS_EMPTY
,
DEVICE_CODE_IS_EMPTY_CONTENT
);
throw
new
AppException
(
DEVICE_CODE_IS_EMPTY
,
DEVICE_CODE_IS_EMPTY_CONTENT
);
}
}
ProductEntity
productEntity
=
productService
.
getExtCache
(
req
.
getProductCode
());
//
ProductEntity productEntity = productService.selectOne(new ProductQuery().productCode(req.getProductCode()));
ProductEntity
productEntity
=
productService
.
selectOne
(
new
ProductQuery
().
productCode
(
req
.
getProductCode
()));
if
(
ObjectUtils
.
isEmpty
(
productEntity
))
{
if
(
ObjectUtils
.
isEmpty
(
productEntity
))
{
throw
new
AppException
(
PRODUCT_IS_EMPTY
,
PRODUCT_IS_EMPTY_CONTENT
);
throw
new
AppException
(
PRODUCT_IS_EMPTY
,
PRODUCT_IS_EMPTY_CONTENT
);
}
}
...
@@ -1040,15 +1035,7 @@ public class DeviceApiController {
...
@@ -1040,15 +1035,7 @@ public class DeviceApiController {
String
scheme
=
serverInfo
.
getScheme
();
String
scheme
=
serverInfo
.
getScheme
();
String
homeUrl
=
""
;
String
homeUrl
=
""
;
//根据站点与资源部署来生成homeurl
//根据站点与资源部署来生成homeurl
DeviceModuleDistributeQuery
query
=
new
DeviceModuleDistributeQuery
();
/*
List<DeviceModuleDistributeEntity> cacheList = deviceModuleDistributeService.getCacheList();
Map<String, List<DeviceModuleDistributeEntity>> collect = cacheList.stream().collect(Collectors.groupingBy(x -> x.getSiteId() + "#" + x.getProductId()));
List<DeviceModuleDistributeEntity> list = collect.getOrDefault(deviceEntity.getSiteId() + "#" + productEntity.getId(), new ArrayList<>());
DeviceModuleDistributeEntity deviceModuleDistributeEntity = list.stream().filter(f -> f.getSelected() == YesNoEnum.YES.getValue()).findFirst().orElseGet(() -> null);
*/
DeviceModuleDistributeQuery
query
=
new
DeviceModuleDistributeQuery
();
query
.
setSiteId
(
deviceEntity
.
getSiteId
());
query
.
setSiteId
(
deviceEntity
.
getSiteId
());
query
.
setProductId
(
productEntity
.
getId
());
query
.
setProductId
(
productEntity
.
getId
());
query
.
setSelected
(
YesNoEnum
.
YES
.
getValue
());
query
.
setSelected
(
YesNoEnum
.
YES
.
getValue
());
...
@@ -1060,8 +1047,6 @@ public class DeviceApiController {
...
@@ -1060,8 +1047,6 @@ public class DeviceApiController {
query
.
setProductId
(
productEntity
.
getId
());
query
.
setProductId
(
productEntity
.
getId
());
query
.
setSelected
(
YesNoEnum
.
NO
.
getValue
());
query
.
setSelected
(
YesNoEnum
.
NO
.
getValue
());
deviceModuleDistributeEntity
=
deviceModuleDistributeService
.
selectOne
(
query
);
deviceModuleDistributeEntity
=
deviceModuleDistributeService
.
selectOne
(
query
);
//deviceModuleDistributeEntity = list.stream().filter(f -> f.getSelected() == YesNoEnum.NO.getValue()).findFirst().orElseGet(() -> null);
if
(!
ObjectUtils
.
isEmpty
(
deviceModuleDistributeEntity
))
{
if
(!
ObjectUtils
.
isEmpty
(
deviceModuleDistributeEntity
))
{
//deviceModuleDistributeService.active(deviceModuleDistributeEntity, null);
//deviceModuleDistributeService.active(deviceModuleDistributeEntity, null);
homeUrl
=
String
.
format
(
"/homeDeviceUrl/%s/%s/%s"
,
deviceModuleDistributeEntity
.
getSiteId
(),
deviceModuleDistributeEntity
.
getProductCode
(),
deviceModuleDistributeEntity
.
getImageResolutionValue
());
homeUrl
=
String
.
format
(
"/homeDeviceUrl/%s/%s/%s"
,
deviceModuleDistributeEntity
.
getSiteId
(),
deviceModuleDistributeEntity
.
getProductCode
(),
deviceModuleDistributeEntity
.
getImageResolutionValue
());
...
...
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