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
568a26b2
Commit
568a26b2
authored
Feb 02, 2023
by
赵啸非
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加批量激活设备
parent
5b690a13
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
8 deletions
+10
-8
device-manager-ui/admin/src/views/app/publish/dialogshow.vue
device-manager-ui/admin/src/views/app/publish/dialogshow.vue
+1
-1
device-manager/src/main/java/com/mortals/xhx/module/app/service/impl/AppPublishServiceImpl.java
...ls/xhx/module/app/service/impl/AppPublishServiceImpl.java
+9
-7
No files found.
device-manager-ui/admin/src/views/app/publish/dialogshow.vue
View file @
568a26b2
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
<el-form
ref=
"form"
:model=
"form"
:rules=
"rules"
label-width=
"120px"
>
<el-form
ref=
"form"
:model=
"form"
:rules=
"rules"
label-width=
"120px"
>
<el-row>
<el-row>
<Field
label=
"应用名称"
:span=
"20"
prop=
"app
Name"
type=
"select"
:enumData=
"dict.appPublish"
v-model=
"form.appNam
e"
placeholder=
"请选择应用"
/>
<Field
label=
"应用名称"
:span=
"20"
prop=
"app
Code"
type=
"select"
:enumData=
"dict.appPublish"
v-model=
"form.appCod
e"
placeholder=
"请选择应用"
/>
<Field
:span=
"20"
label=
"文件路径地址"
><fileUpload
v-model=
"form.filePath"
prePath=
"/file/uploadfile"
/></Field>
<Field
:span=
"20"
label=
"文件路径地址"
><fileUpload
v-model=
"form.filePath"
prePath=
"/file/uploadfile"
/></Field>
...
...
device-manager/src/main/java/com/mortals/xhx/module/app/service/impl/AppPublishServiceImpl.java
View file @
568a26b2
...
@@ -37,6 +37,9 @@ public class AppPublishServiceImpl extends AbstractCRUDServiceImpl<AppPublishDao
...
@@ -37,6 +37,9 @@ public class AppPublishServiceImpl extends AbstractCRUDServiceImpl<AppPublishDao
@Override
@Override
protected
void
saveBefore
(
AppPublishEntity
entity
,
Context
context
)
throws
AppException
{
protected
void
saveBefore
(
AppPublishEntity
entity
,
Context
context
)
throws
AppException
{
Map
<
String
,
String
>
appPublish
=
paramService
.
getParamByFirstOrganize
(
"appPublish"
);
String
appName
=
appPublish
.
get
(
entity
.
getAppCode
());
entity
.
setAppName
(
appName
);
String
targetPath
=
"/home/mortals/apps/"
;
String
targetPath
=
"/home/mortals/apps/"
;
String
fileNewName
=
entity
.
getAppCode
()
+
"-"
+
entity
.
getVersion
()+
"."
+
FileUtil
.
getSuffix
(
entity
.
getFilePath
());
String
fileNewName
=
entity
.
getAppCode
()
+
"-"
+
entity
.
getVersion
()+
"."
+
FileUtil
.
getSuffix
(
entity
.
getFilePath
());
...
@@ -55,10 +58,7 @@ public class AppPublishServiceImpl extends AbstractCRUDServiceImpl<AppPublishDao
...
@@ -55,10 +58,7 @@ public class AppPublishServiceImpl extends AbstractCRUDServiceImpl<AppPublishDao
entity
.
setFilePath
(
targetPath
+
fileNewName
);
entity
.
setFilePath
(
targetPath
+
fileNewName
);
Map
<
String
,
String
>
appPublish
=
paramService
.
getParamByFirstOrganize
(
"appPublish"
);
String
appCode
=
appPublish
.
get
(
entity
.
getAppName
());
entity
.
setAppCode
(
appCode
);
super
.
saveBefore
(
entity
,
context
);
super
.
saveBefore
(
entity
,
context
);
}
}
...
@@ -68,6 +68,12 @@ public class AppPublishServiceImpl extends AbstractCRUDServiceImpl<AppPublishDao
...
@@ -68,6 +68,12 @@ public class AppPublishServiceImpl extends AbstractCRUDServiceImpl<AppPublishDao
super
.
updateBefore
(
entity
,
context
);
super
.
updateBefore
(
entity
,
context
);
AppPublishEntity
appPublishEntity
=
this
.
get
(
entity
.
getId
());
AppPublishEntity
appPublishEntity
=
this
.
get
(
entity
.
getId
());
if
(
entity
.
getFilePath
().
equals
(
appPublishEntity
.
getFilePath
()))
{
if
(
entity
.
getFilePath
().
equals
(
appPublishEntity
.
getFilePath
()))
{
Map
<
String
,
String
>
appPublish
=
paramService
.
getParamByFirstOrganize
(
"appPublish"
);
String
appName
=
appPublish
.
get
(
entity
.
getAppCode
());
entity
.
setAppName
(
appName
);
String
targetPath
=
"/home/mortals/apps/"
;
String
targetPath
=
"/home/mortals/apps/"
;
String
fileNewName
=
entity
.
getAppCode
()
+
"-"
+
entity
.
getVersion
()+
"."
+
FileUtil
.
getSuffix
(
entity
.
getFilePath
());
String
fileNewName
=
entity
.
getAppCode
()
+
"-"
+
entity
.
getVersion
()+
"."
+
FileUtil
.
getSuffix
(
entity
.
getFilePath
());
//将zip包移动到指定目录 并更改名称
//将zip包移动到指定目录 并更改名称
...
@@ -83,10 +89,6 @@ public class AppPublishServiceImpl extends AbstractCRUDServiceImpl<AppPublishDao
...
@@ -83,10 +89,6 @@ public class AppPublishServiceImpl extends AbstractCRUDServiceImpl<AppPublishDao
//移动文件并重命名
//移动文件并重命名
FileUtil
.
move
(
new
File
(
realFilePath
),
new
File
(
targetPath
+
fileNewName
),
true
);
FileUtil
.
move
(
new
File
(
realFilePath
),
new
File
(
targetPath
+
fileNewName
),
true
);
entity
.
setFilePath
(
targetPath
+
fileNewName
);
entity
.
setFilePath
(
targetPath
+
fileNewName
);
Map
<
String
,
String
>
appPublish
=
paramService
.
getParamByFirstOrganize
(
"appPublish"
);
String
appCode
=
appPublish
.
get
(
entity
.
getAppName
());
entity
.
setAppCode
(
appCode
);
}
}
...
...
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