Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
setup-manager
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
赵啸非
setup-manager
Commits
b6217388
Commit
b6217388
authored
Nov 04, 2024
by
赵啸非
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加区域树
parent
5d65fc88
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
4 deletions
+34
-4
setup-project-manager/src/main/java/com/mortals/xhx/module/setup/web/SetupProjectController.java
.../mortals/xhx/module/setup/web/SetupProjectController.java
+34
-4
No files found.
setup-project-manager/src/main/java/com/mortals/xhx/module/setup/web/SetupProjectController.java
View file @
b6217388
...
...
@@ -25,17 +25,22 @@ import com.mortals.xhx.module.setup.service.SetupDbService;
import
com.mortals.xhx.module.setup.service.SetupProjectService
;
import
io.swagger.annotations.ApiOperation
;
import
lombok.extern.slf4j.Slf4j
;
import
org.codehaus.plexus.archiver.tar.TarGZipUnArchiver
;
import
org.codehaus.plexus.logging.console.ConsoleLoggerManager
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.util.ObjectUtils
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.multipart.MultipartFile
;
import
java.io.File
;
import
java.util.Arrays
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
static
com
.
mortals
.
xhx
.
common
.
code
.
ProductDisEnum
.
基础服务
;
/**
* 项目工程信息
*
...
...
@@ -266,8 +271,6 @@ public class SetupProjectController extends BaseCRUDJsonBodyMappingController<Se
if
(
YesNoEnum
.
YES
.
getValue
()
==
siteAddRest
.
getCode
())
{
//更新所有项目的站点编码与名称
this
.
service
.
find
(
new
SetupProjectQuery
()).
forEach
(
setupProjectEntity
->{
setupProjectEntity
.
setSiteName
(
siteAddRest
.
getData
().
getSiteName
());
setupProjectEntity
.
setSiteCode
(
siteAddRest
.
getData
().
getSiteCode
());
...
...
@@ -277,9 +280,30 @@ public class SetupProjectController extends BaseCRUDJsonBodyMappingController<Se
this
.
service
.
update
(
setupProjectEntity
);
});
//todo 更加站点编码生成基础服务应用,并部署到/home/publish/app/ 目录下
//todo 在/home/publish/app/ 目录下 创建自助服务应用
String
projectPath
=
this
.
publishPath
+
"/app/"
+
siteEntity
.
getSiteCode
();
//解压资源文件
String
sourcePath
=
this
.
publishPath
+
"/temp/project/"
+
基础服务
.
getValue
()
+
"/app.tar.gz"
;
File
file
=
new
File
(
sourcePath
);
log
.
info
(
"文件存在:{} ,文件地址:{}"
,
file
.
exists
(),
sourcePath
);
File
destDir
=
new
File
(
projectPath
);
if
(!
file
.
exists
())
{
throw
new
AppException
(
"请上传项目工程文件!"
);
}
final
TarGZipUnArchiver
ua
=
new
TarGZipUnArchiver
();
ConsoleLoggerManager
manager
=
new
ConsoleLoggerManager
();
manager
.
initialize
();
ua
.
enableLogging
(
manager
.
getLoggerForComponent
(
"bla"
));
ua
.
setSourceFile
(
file
);
destDir
.
mkdirs
();
ua
.
setDestDirectory
(
destDir
);
ua
.
extract
();
//todo 更新门户站点信息,用户站点树等
//todo 更加站点编码生成基础服务应用,并部署
}
else
{
throw
new
AppException
(
"站点添加失败! "
+
rest
.
getMsg
());
...
...
@@ -316,6 +340,12 @@ public class SetupProjectController extends BaseCRUDJsonBodyMappingController<Se
try
{
//todo 在/home/publish/app/ 目录下 创建自助服务应用
String
projectPath
=
this
.
publishPath
+
"/app/"
+
siteEntity
.
getSiteCode
();
boolean
exist
=
FileUtil
.
exist
(
projectPath
);
if
(!
exist
)
{
FileUtil
.
mkdir
(
projectPath
);
}
//解压
ret
.
put
(
KEY_RESULT_MSG
,
"子区域更新失败"
);
}
catch
(
Exception
e
)
{
...
...
@@ -421,7 +451,7 @@ public class SetupProjectController extends BaseCRUDJsonBodyMappingController<Se
try
{
//todo 检测是否初始安装,是否已经安装了base-manager,如果没有则进入引导界面进行安装
SetupProjectQuery
setupProjectQuery
=
new
SetupProjectQuery
();
setupProjectQuery
.
setProjectCode
(
ProductDisEnum
.
基础服务
.
getValue
());
setupProjectQuery
.
setProjectCode
(
基础服务
.
getValue
());
SetupProjectEntity
setupProjectEntity
=
this
.
service
.
selectOne
(
setupProjectQuery
);
if
(
ObjectUtils
.
isEmpty
(
setupProjectEntity
))
throw
new
AppException
(
"基础服务不存在"
);
//判断资源文件是否已经上传
...
...
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