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
851deb5b
Commit
851deb5b
authored
6 months ago
by
赵啸非
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加巴中经开区windows shell
parent
bf12a8da
master
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
775 additions
and
96 deletions
+775
-96
device-manager/db/base.sql
device-manager/db/base.sql
+721
-96
device-manager/src/main/java/com/mortals/xhx/busiz/web/DeviceApiController.java
...n/java/com/mortals/xhx/busiz/web/DeviceApiController.java
+54
-0
No files found.
device-manager/db/base.sql
View file @
851deb5b
This source diff could not be displayed because it is too large. You can
view the blob
instead.
This diff is collapsed.
Click to expand it.
device-manager/src/main/java/com/mortals/xhx/busiz/web/DeviceApiController.java
View file @
851deb5b
...
...
@@ -621,6 +621,60 @@ public class DeviceApiController {
return
JSON
.
toJSONString
(
rsp
);
}
/**
* 检查设备最新版本信息
*
* @param req
* @return
*/
@PostMapping
(
"checkVersionCopy"
)
@UnAuth
public
String
checkVersionCopy
(
HttpServletRequest
request
,
@RequestBody
DeviceReq
req
)
{
String
serverName
=
request
.
getHeader
(
"server-name"
);
Integer
serverPort
=
DataUtil
.
converStr2Int
(
request
.
getHeader
(
"server-port"
),
0
);
// String serverName = request.getServerName();
// int serverPort = request.getServerPort();
log
.
info
(
"【检查设备最新版本信息】【请求体】--> "
+
JSONObject
.
toJSONString
(
req
));
ApiResp
<
DeviceResp
>
rsp
=
new
ApiResp
<>();
rsp
.
setCode
(
ApiRespCodeEnum
.
SUCCESS
.
getValue
());
DeviceResp
deviceResp
=
new
DeviceResp
();
try
{
DeviceEntity
deviceEntity
=
checkDeviceExist
(
req
);
//查找版本号最大的. todo 根据站点来划分
ProductVersionQuery
productVersionQuery
=
new
ProductVersionQuery
();
productVersionQuery
.
setProductId
(
deviceEntity
.
getProductId
());
productVersionQuery
.
setSiteId
(
deviceEntity
.
getSiteId
());
productVersionQuery
.
setOrderColList
(
Arrays
.
asList
(
new
OrderCol
(
"version"
,
OrderCol
.
DESCENDING
)));
/* ProductVersionEntity productVersionEntity = productVersionService.find(productVersionQuery)
.stream()
.filter(item -> StrUtil.endWith(item.getFilePath(), ".apk", true))
.findFirst().orElseGet(() -> null);*/
ProductVersionEntity
productVersionEntity
=
productVersionService
.
selectOne
(
productVersionQuery
);
if
(
ObjectUtils
.
isEmpty
(
productVersionEntity
))
{
throw
new
AppException
(
DEVICE_VERSION_UNEXIST
,
DEVICE_VERSION_UNEXIST_CONTENT
);
}
ProductVersionInfo
productVersionInfo
=
new
ProductVersionInfo
();
BeanUtils
.
copyProperties
(
productVersionEntity
,
productVersionInfo
,
BeanUtil
.
getNullPropertyNames
(
productVersionEntity
));
buildDownloadUrl
(
productVersionEntity
,
productVersionInfo
,
serverName
,
serverPort
);
String
content
=
EncryptUtil
.
myEnscrt
(
JSON
.
toJSONString
(
productVersionInfo
),
9
,
DES_STR
,
ENCRYPT_STR
);
log
.
info
(
"响应【设备版本检查】【响应体】--> "
+
JSONObject
.
toJSONString
(
productVersionInfo
));
deviceResp
.
setContent
(
content
);
rsp
.
setData
(
deviceResp
);
}
catch
(
AppException
e
)
{
rsp
.
setCode
(
e
.
getCode
());
rsp
.
setMsg
(
e
.
getMessage
());
return
JSON
.
toJSONString
(
rsp
);
}
catch
(
Exception
e
)
{
log
.
error
(
"接收数据失败"
,
e
);
rsp
.
setCode
(
ApiRespCodeEnum
.
FAILED
.
getValue
());
rsp
.
setMsg
(
e
.
getMessage
());
return
JSON
.
toJSONString
(
rsp
);
}
return
JSON
.
toJSONString
(
rsp
);
}
/**
* 检查设备最新版本信息
...
...
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