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
32d7a444
Commit
32d7a444
authored
Feb 22, 2023
by
赵啸非
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加批量激活设备
parent
26f53d78
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
29 additions
and
2 deletions
+29
-2
device-manager/db/params.sql
device-manager/db/params.sql
+10
-0
device-manager/src/main/java/com/mortals/xhx/module/device/web/DeviceModuleDistributeController.java
...x/module/device/web/DeviceModuleDistributeController.java
+18
-2
device-manager/src/main/resources/logback-spring.xml
device-manager/src/main/resources/logback-spring.xml
+1
-0
No files found.
device-manager/db/params.sql
View file @
32d7a444
...
...
@@ -75,3 +75,13 @@ INSERT INTO `mortals_xhx_param` VALUES (null, '设备资源部署细致', NULL,
INSERT
INTO
`mortals_xhx_param`
VALUES
(
null
,
'应用发布编码'
,
'appPublish'
,
NULL
,
'information-publish'
,
'信息发布屏'
,
1
,
4
,
0
,
'appPublish'
,
NULL
,
NULL
,
NULL
);
INSERT
INTO
`mortals_xhx_param`
VALUES
(
null
,
'告警类型'
,
'AlarmConfig'
,
'alarmType'
,
'0'
,
'离线'
,
1
,
4
,
0
,
'alarmType'
,
NULL
,
NULL
,
NULL
);
INSERT
INTO
`mortals_xhx_param`
VALUES
(
null
,
'告警级别,'
,
'AlarmConfig'
,
'alarmLevel'
,
'0'
,
'危险'
,
1
,
4
,
0
,
'alarmLevel'
,
NULL
,
NULL
,
NULL
);
INSERT
INTO
`mortals_xhx_param`
VALUES
(
null
,
'告警级别,'
,
'AlarmConfig'
,
'alarmLevel'
,
'1'
,
'次要'
,
1
,
4
,
0
,
'alarmLevel'
,
NULL
,
NULL
,
NULL
);
INSERT
INTO
`mortals_xhx_param`
VALUES
(
null
,
'告警级别,'
,
'AlarmConfig'
,
'alarmLevel'
,
'2'
,
'一般'
,
1
,
4
,
0
,
'alarmLevel'
,
NULL
,
NULL
,
NULL
);
INSERT
INTO
`mortals_xhx_param`
VALUES
(
null
,
'推送方式,'
,
'AlarmConfig'
,
'alarmPusW1ay'
,
'0'
,
'不推送'
,
1
,
4
,
0
,
'alarmPusW1ay'
,
NULL
,
NULL
,
NULL
);
INSERT
INTO
`mortals_xhx_param`
VALUES
(
null
,
'推送方式,'
,
'AlarmConfig'
,
'alarmPusW1ay'
,
'1'
,
'短信'
,
1
,
4
,
0
,
'alarmPusW1ay'
,
NULL
,
NULL
,
NULL
);
INSERT
INTO
`mortals_xhx_param`
VALUES
(
null
,
'是否启用'
,
'AlarmConfig'
,
'enabled'
,
'0'
,
'不启用'
,
1
,
4
,
0
,
'enabled'
,
NULL
,
NULL
,
NULL
);
INSERT
INTO
`mortals_xhx_param`
VALUES
(
null
,
'是否启用'
,
'AlarmConfig'
,
'enabled'
,
'1'
,
'启用'
,
1
,
4
,
0
,
'enabled'
,
NULL
,
NULL
,
NULL
);
\ No newline at end of file
device-manager/src/main/java/com/mortals/xhx/module/device/web/DeviceModuleDistributeController.java
View file @
32d7a444
package
com.mortals.xhx.module.device.web
;
import
cn.hutool.core.lang.Validator
;
import
cn.hutool.core.net.URLDecoder
;
import
cn.hutool.core.net.url.UrlBuilder
;
import
com.mortals.framework.ap.GlobalSysInfo
;
import
com.mortals.framework.common.Rest
;
import
com.mortals.framework.exception.AppException
;
import
com.mortals.framework.model.Context
;
import
com.mortals.framework.util.DataUtil
;
import
com.mortals.framework.web.BaseCRUDJsonBodyMappingController
;
import
com.mortals.xhx.base.system.param.service.ParamService
;
import
com.mortals.xhx.common.code.ImageReEnum
;
...
...
@@ -21,6 +24,7 @@ import org.springframework.web.bind.annotation.RequestBody;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
java.nio.charset.Charset
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
...
...
@@ -85,15 +89,27 @@ public class DeviceModuleDistributeController extends BaseCRUDJsonBodyMappingCon
@Override
protected
int
viewAfter
(
Long
id
,
Map
<
String
,
Object
>
model
,
DeviceModuleDistributeEntity
entity
,
Context
context
)
throws
AppException
{
String
serverName
=
request
.
getHeader
(
"server-name"
);
Integer
serverPort
=
DataUtil
.
converStr2Int
(
request
.
getHeader
(
"server-port"
),
0
);
String
homeUrl
=
""
;
ProductEntity
productEntity
=
productService
.
get
(
entity
.
getProductId
(),
context
);
if
(!
ObjectUtils
.
isEmpty
(
productEntity
.
getHomeUrl
())){
homeUrl
=
productEntity
.
getHomeUrl
();
}
String
domain
=
GlobalSysInfo
.
getParamValue
(
PARAM_SERVER_HTTP_URL
,
"http://192.168.0.98:11078"
);
if
(!
ObjectUtils
.
isEmpty
(
serverName
)&&
Validator
.
isIpv4
(
serverName
)){
String
str
=
UrlBuilder
.
ofHttp
(
serverName
).
setPort
(
serverPort
>
0
?
serverPort:
11078
).
addPath
(
homeUrl
).
build
();
String
decodeStr
=
URLDecoder
.
decode
(
str
,
Charset
.
defaultCharset
());
entity
.
setFilePath
(
decodeStr
);
}
else
{
String
str
=
UrlBuilder
.
of
(
domain
.
trim
()).
addPath
(
homeUrl
).
build
();
String
decodeStr
=
URLDecoder
.
decode
(
str
,
Charset
.
defaultCharset
());
entity
.
setFilePath
(
decodeStr
);
}
//String temp=domain+"/"+homeUrl;
entity
.
setFilePath
(
UrlBuilder
.
of
(
domain
).
addPath
(
homeUrl
).
build
());
//
entity.setFilePath(UrlBuilder.of(domain).addPath(homeUrl).build());
// entity.setFilePath(temp);
return
super
.
viewAfter
(
id
,
model
,
entity
,
context
);
}
...
...
device-manager/src/main/resources/logback-spring.xml
View file @
32d7a444
...
...
@@ -40,6 +40,7 @@
<rollingPolicy
class=
"ch.qos.logback.core.rolling.TimeBasedRollingPolicy"
>
<fileNamePattern>
${logFilePath}/${springApplicationName:-default}/${springApplicationName:-default}-error.log.%d{yyyyMMdd}
</fileNamePattern>
<!--日志文件保留天数-->
<cleanHistoryOnStart>
true
</cleanHistoryOnStart>
<MaxHistory>
15
</MaxHistory>
</rollingPolicy>
</appender>
...
...
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