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
bdd05720
Commit
bdd05720
authored
Feb 02, 2023
by
赵啸非
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加批量激活设备
parent
e15acf2e
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
11 deletions
+14
-11
device-manager/src/main/java/com/mortals/xhx/module/app/service/impl/AppPublishServiceImpl.java
...ls/xhx/module/app/service/impl/AppPublishServiceImpl.java
+2
-9
device-manager/src/main/java/com/mortals/xhx/module/device/service/impl/DeviceModuleDistributeServiceImpl.java
...evice/service/impl/DeviceModuleDistributeServiceImpl.java
+0
-1
device-manager/src/main/java/com/mortals/xhx/module/device/web/DeviceModuleDistributeController.java
...x/module/device/web/DeviceModuleDistributeController.java
+12
-1
No files found.
device-manager/src/main/java/com/mortals/xhx/module/app/service/impl/AppPublishServiceImpl.java
View file @
bdd05720
...
@@ -51,18 +51,13 @@ public class AppPublishServiceImpl extends AbstractCRUDServiceImpl<AppPublishDao
...
@@ -51,18 +51,13 @@ public class AppPublishServiceImpl extends AbstractCRUDServiceImpl<AppPublishDao
@Override
@Override
public
void
active
(
AppPublishEntity
appPublishEntity
,
Context
context
)
{
public
void
active
(
AppPublishEntity
appPublishEntity
,
Context
context
)
{
if
(
AppTypeEnum
.
前端
.
getValue
()==
appPublishEntity
.
getAppType
()){
if
(
AppTypeEnum
.
前端
.
getValue
()==
appPublishEntity
.
getAppType
()){
String
targetFilePath
=
uploadService
.
getFilePath
(
appPublishEntity
.
getFilePath
());
String
targetFilePath
=
uploadService
.
getFilePath
(
appPublishEntity
.
getFilePath
());
String
disPath
=
"/home/publish/"
+
appPublishEntity
.
getAppCode
();
String
disPath
=
"/"
;
boolean
directory
=
FileUtil
.
isDirectory
(
new
File
(
disPath
));
boolean
directory
=
FileUtil
.
isDirectory
(
new
File
(
disPath
));
if
(
directory
){
if
(
directory
){
FileUtil
.
del
(
new
File
(
disPath
));
FileUtil
.
del
(
new
File
(
disPath
));
}
}
String
fileEncode
=
"UTF-8"
;
String
fileEncode
=
"UTF-8"
;
try
{
try
{
fileEncode
=
EncodeUtil
.
getEncode
(
targetFilePath
,
true
);
fileEncode
=
EncodeUtil
.
getEncode
(
targetFilePath
,
true
);
...
@@ -70,10 +65,8 @@ public class AppPublishServiceImpl extends AbstractCRUDServiceImpl<AppPublishDao
...
@@ -70,10 +65,8 @@ public class AppPublishServiceImpl extends AbstractCRUDServiceImpl<AppPublishDao
log
.
error
(
"异常"
,
e
);
log
.
error
(
"异常"
,
e
);
}
}
ZipUtil
.
unzip
(
targetFilePath
,
disPath
,
Charset
.
forName
(
fileEncode
));
ZipUtil
.
unzip
(
targetFilePath
,
disPath
,
Charset
.
forName
(
fileEncode
));
}
else
{
}
else
{
//后端部署 执行sh 脚本程序部署
}
}
...
...
device-manager/src/main/java/com/mortals/xhx/module/device/service/impl/DeviceModuleDistributeServiceImpl.java
View file @
bdd05720
...
@@ -90,7 +90,6 @@ public class DeviceModuleDistributeServiceImpl extends AbstractCRUDServiceImpl<D
...
@@ -90,7 +90,6 @@ public class DeviceModuleDistributeServiceImpl extends AbstractCRUDServiceImpl<D
log
.
error
(
"异常"
,
e
);
log
.
error
(
"异常"
,
e
);
}
}
ZipUtil
.
unzip
(
targetFilePath
,
disPath
,
Charset
.
forName
(
fileEncode
));
ZipUtil
.
unzip
(
targetFilePath
,
disPath
,
Charset
.
forName
(
fileEncode
));
//更新
//更新
distributeEntity
.
setDistributeFilePath
(
disPath
);
distributeEntity
.
setDistributeFilePath
(
disPath
);
distributeEntity
.
setDistribute
(
YesNoEnum
.
YES
.
getValue
());
distributeEntity
.
setDistribute
(
YesNoEnum
.
YES
.
getValue
());
...
...
device-manager/src/main/java/com/mortals/xhx/module/device/web/DeviceModuleDistributeController.java
View file @
bdd05720
...
@@ -9,6 +9,7 @@ import com.mortals.framework.web.BaseCRUDJsonBodyMappingController;
...
@@ -9,6 +9,7 @@ import com.mortals.framework.web.BaseCRUDJsonBodyMappingController;
import
com.mortals.xhx.base.system.param.service.ParamService
;
import
com.mortals.xhx.base.system.param.service.ParamService
;
import
com.mortals.xhx.common.code.ImageReEnum
;
import
com.mortals.xhx.common.code.ImageReEnum
;
import
com.mortals.xhx.common.code.YesNoEnum
;
import
com.mortals.xhx.common.code.YesNoEnum
;
import
com.mortals.xhx.feign.skin.ISkinBaseFeign
;
import
com.mortals.xhx.module.device.model.DeviceModuleDistributeEntity
;
import
com.mortals.xhx.module.device.model.DeviceModuleDistributeEntity
;
import
com.mortals.xhx.module.device.service.DeviceModuleDistributeService
;
import
com.mortals.xhx.module.device.service.DeviceModuleDistributeService
;
import
com.mortals.xhx.module.product.model.ProductEntity
;
import
com.mortals.xhx.module.product.model.ProductEntity
;
...
@@ -41,6 +42,9 @@ public class DeviceModuleDistributeController extends BaseCRUDJsonBodyMappingCon
...
@@ -41,6 +42,9 @@ public class DeviceModuleDistributeController extends BaseCRUDJsonBodyMappingCon
@Autowired
@Autowired
private
ProductService
productService
;
private
ProductService
productService
;
@Autowired
private
ISkinBaseFeign
skinBaseFeign
;
public
DeviceModuleDistributeController
(){
public
DeviceModuleDistributeController
(){
super
.
setModuleDesc
(
"设备前端模块部署"
);
super
.
setModuleDesc
(
"设备前端模块部署"
);
}
}
...
@@ -49,6 +53,13 @@ public class DeviceModuleDistributeController extends BaseCRUDJsonBodyMappingCon
...
@@ -49,6 +53,13 @@ public class DeviceModuleDistributeController extends BaseCRUDJsonBodyMappingCon
protected
void
init
(
Map
<
String
,
Object
>
model
,
Context
context
)
{
protected
void
init
(
Map
<
String
,
Object
>
model
,
Context
context
)
{
this
.
addDict
(
model
,
"distribute"
,
YesNoEnum
.
getEnumMap
());
this
.
addDict
(
model
,
"distribute"
,
YesNoEnum
.
getEnumMap
());
this
.
addDict
(
model
,
"productId"
,
productService
.
find
(
new
ProductEntity
()).
stream
().
collect
(
Collectors
.
toMap
(
x
->
x
.
getId
().
toString
(),
y
->
y
.
getProductName
())));
this
.
addDict
(
model
,
"productId"
,
productService
.
find
(
new
ProductEntity
()).
stream
().
collect
(
Collectors
.
toMap
(
x
->
x
.
getId
().
toString
(),
y
->
y
.
getProductName
())));
/* Rest<RespData<List<SkinBasePdu>>> resp = skinBaseFeign.list(new SkinBasePdu());
if (resp.getCode() == YesNoEnum.YES.getValue()) {
Map<String, Map<String, String>> skinProductCodeMap = resp.getData().getData().stream().collect(Collectors.groupingBy(x -> x.getProductCode(), Collectors.toMap(a -> a.getImageResolution() == null ? "" : a.getImageResolution()+"", b -> b.getImageResolutionValue() == null ? "" : b.getImageResolutionValue(), (o, n) -> n)));
this.addDict(model, "imageResolution", skinProductCodeMap);
}*/
this
.
addDict
(
model
,
"imageResolution"
,
ImageReEnum
.
getEnumMap
());
this
.
addDict
(
model
,
"imageResolution"
,
ImageReEnum
.
getEnumMap
());
super
.
init
(
model
,
context
);
super
.
init
(
model
,
context
);
}
}
...
@@ -82,7 +93,7 @@ public class DeviceModuleDistributeController extends BaseCRUDJsonBodyMappingCon
...
@@ -82,7 +93,7 @@ public class DeviceModuleDistributeController extends BaseCRUDJsonBodyMappingCon
String
domain
=
GlobalSysInfo
.
getParamValue
(
PARAM_SERVER_HTTP_URL
,
"http://192.168.0.98:11078"
);
String
domain
=
GlobalSysInfo
.
getParamValue
(
PARAM_SERVER_HTTP_URL
,
"http://192.168.0.98:11078"
);
//String temp=domain+"/"+homeUrl;
//String temp=domain+"/"+homeUrl;
entity
.
setFilePath
(
UrlBuilder
.
of
(
domain
).
addPath
(
homeUrl
).
toString
());
entity
.
setFilePath
(
UrlBuilder
.
of
(
domain
).
addPath
(
homeUrl
).
build
());
// entity.setFilePath(temp);
// entity.setFilePath(temp);
return
super
.
viewAfter
(
id
,
model
,
entity
,
context
);
return
super
.
viewAfter
(
id
,
model
,
entity
,
context
);
}
}
...
...
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