Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
YeeAmosFireAutoSysRoot
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
station
YeeAmosFireAutoSysRoot
Commits
cc82472f
Commit
cc82472f
authored
Apr 15, 2020
by
单奇雲
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改预案文件查看接口,新增liqubase脚本
parent
db3cdd14
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
123 additions
and
63 deletions
+123
-63
FileController.java
.../yeejoin/amos/fas/business/controller/FileController.java
+1
-1
TopographyController.java
...in/amos/fas/business/controller/TopographyController.java
+66
-62
fas-1.0.2.xml
...utoSysStart/src/main/resources/db/changelog/fas-1.0.2.xml
+56
-0
No files found.
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/controller/FileController.java
View file @
cc82472f
...
...
@@ -213,7 +213,7 @@ public class FileController extends BaseController {
return
new
CommonResponse
(
SUCCESS
,
"访问的文件不存在!"
,
"查询成功"
);
}
if
(
fileName
.
endsWith
(
".doc"
)
||
fileName
.
endsWith
(
".docx"
))
{
String
htmlFileName
=
fileName
.
substring
(
0
,
fileName
.
i
ndexOf
(
"."
))
+
".html"
;
String
htmlFileName
=
fileName
.
substring
(
0
,
fileName
.
lastI
ndexOf
(
"."
))
+
".html"
;
File
htmlFile
=
new
File
(
htmlFileName
);
String
data
=
WordConverterUtils
.
wordToHtmlString
(
fileName
,
readUrl
);
Map
<
String
,
Object
>
processData
=
null
;
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/controller/TopographyController.java
View file @
cc82472f
...
...
@@ -72,69 +72,73 @@ public class TopographyController {
@PostMapping
(
value
=
"/updateTopo"
,
produces
=
"application/json;charset=UTF-8"
)
@ApiOperation
(
value
=
"保存拓扑图"
,
notes
=
"保存拓扑图"
)
public
CommonResponse
savedonghuanNodes
(
@ApiParam
(
value
=
""
,
required
=
false
)
@RequestBody
JSONObject
topographyParam
)
{
String
appId
=
topographyParam
.
getString
(
"appId"
)
!=
null
?
topographyParam
.
getString
(
"appId"
)
:
null
;
String
type
=
topographyParam
.
getString
(
"type"
);
//节点
JSONArray
nodes
=
topographyParam
.
getJSONArray
(
"nodeData"
);
List
<
TopographyNode
>
nodeData
=
JSON
.
parseArray
(
JSON
.
toJSONString
(
nodes
),
TopographyNode
.
class
);
HashMap
<
String
,
String
>
convertKeyMap
=
new
HashMap
<>();
int
curSize
=
nodeService
.
queryMaxKeyByAppIdAndType
(
appId
,
type
);
for
(
TopographyNode
e:
nodeData
){
if
(
Integer
.
valueOf
(
e
.
getKey
())
<
0
)
{
curSize
=
curSize
+
1
;
String
newKey
=
String
.
format
(
"%05d"
,
curSize
);
convertKeyMap
.
put
(
e
.
getKey
(),
newKey
);
e
.
setKey
(
newKey
);
e
.
setType
(
type
);
e
.
setAppId
(
appId
);
if
(
e
.
getGroup
()
==
null
)
{
e
.
setGroup
(
""
);
}
else
if
(
Integer
.
valueOf
(
e
.
getGroup
())
<
0
){
//修改新节点组
e
.
setGroup
(
convertKeyMap
.
get
(
e
.
getGroup
()));
}
}
};
//线
JSONArray
links
=
topographyParam
.
getJSONArray
(
"linkData"
);
List
<
TopographyLine
>
lineData
=
JSON
.
parseArray
(
JSON
.
toJSONString
(
links
),
TopographyLine
.
class
);
lineData
.
forEach
(
l
->
{
//修改新增节点之间线的连接
if
(
Integer
.
parseInt
(
l
.
getFrom
())
<
0
)
{
l
.
setFrom
(
convertKeyMap
.
get
(
l
.
getFrom
()));
}
if
(
Integer
.
parseInt
(
l
.
getTo
())
<
0
)
{
l
.
setTo
(
convertKeyMap
.
get
(
l
.
getTo
()));
}
if
(
l
.
getCategory
()
==
null
)
{
l
.
setCategory
(
""
);
}
if
(
l
.
getAppId
()
==
null
)
{
l
.
setAppId
(
appId
);
l
.
setType
(
type
);
}
});
nodeService
.
saveNodes
(
nodeData
);
lineService
.
saveLines
(
lineData
);
//节点详情
JSONObject
nodeDetailJson
=
topographyParam
.
getJSONObject
(
"nodeDetail"
);
if
(
nodeDetailJson
!=
null
)
{
TopographyNodeDetail
nodeDetail
=
JSON
.
parseObject
(
JSON
.
toJSONString
(
nodeDetailJson
),
TopographyNodeDetail
.
class
);
String
nodekey
=
nodeDetail
.
getNodekey
();
if
(
nodekey
!=
null
&&
Integer
.
parseInt
(
nodekey
)
<
0
)
{
TopographyNode
node
=
nodeService
.
queryByKeyAndAppIdAndType
(
convertKeyMap
.
get
(
nodekey
),
appId
,
type
);
nodeDetail
.
setNodeid
(
node
.
getId
());
}
nodeService
.
saveNodeDetail
(
nodeDetail
);
synchronized
(
TopographyController
.
class
)
{
String
appId
=
topographyParam
.
getString
(
"appId"
)
!=
null
?
topographyParam
.
getString
(
"appId"
)
:
null
;
String
type
=
topographyParam
.
getString
(
"type"
);
//节点
JSONArray
nodes
=
topographyParam
.
getJSONArray
(
"nodeData"
);
List
<
TopographyNode
>
nodeData
=
JSON
.
parseArray
(
JSON
.
toJSONString
(
nodes
),
TopographyNode
.
class
);
HashMap
<
String
,
String
>
convertKeyMap
=
new
HashMap
<>();
int
curSize
=
nodeService
.
queryMaxKeyByAppIdAndType
(
appId
,
type
);
for
(
TopographyNode
e:
nodeData
){
if
(
Integer
.
valueOf
(
e
.
getKey
())
<
0
)
{
curSize
=
curSize
+
1
;
String
newKey
=
String
.
format
(
"%05d"
,
curSize
);
convertKeyMap
.
put
(
e
.
getKey
(),
newKey
);
e
.
setKey
(
newKey
);
e
.
setType
(
type
);
e
.
setAppId
(
appId
);
if
(
e
.
getGroup
()
==
null
)
{
e
.
setGroup
(
""
);
}
else
if
(
Integer
.
valueOf
(
e
.
getGroup
())
<
0
){
//修改新节点组
e
.
setGroup
(
convertKeyMap
.
get
(
e
.
getGroup
()));
}
}
};
//线
JSONArray
links
=
topographyParam
.
getJSONArray
(
"linkData"
);
List
<
TopographyLine
>
lineData
=
JSON
.
parseArray
(
JSON
.
toJSONString
(
links
),
TopographyLine
.
class
);
lineData
.
forEach
(
l
->
{
//修改新增节点之间线的连接
if
(
Integer
.
parseInt
(
l
.
getFrom
())
<
0
)
{
l
.
setFrom
(
convertKeyMap
.
get
(
l
.
getFrom
()));
}
if
(
Integer
.
parseInt
(
l
.
getTo
())
<
0
)
{
l
.
setTo
(
convertKeyMap
.
get
(
l
.
getTo
()));
}
if
(
l
.
getCategory
()
==
null
)
{
l
.
setCategory
(
""
);
}
if
(
l
.
getAppId
()
==
null
)
{
l
.
setAppId
(
appId
);
l
.
setType
(
type
);
}
});
nodeService
.
saveNodes
(
nodeData
);
lineService
.
saveLines
(
lineData
);
//节点详情
JSONObject
nodeDetailJson
=
topographyParam
.
getJSONObject
(
"nodeDetail"
);
if
(
nodeDetailJson
!=
null
)
{
TopographyNodeDetail
nodeDetail
=
JSON
.
parseObject
(
JSON
.
toJSONString
(
nodeDetailJson
),
TopographyNodeDetail
.
class
);
String
nodekey
=
nodeDetail
.
getNodekey
();
if
(
nodekey
!=
null
&&
Integer
.
parseInt
(
nodekey
)
<
0
)
{
TopographyNode
node
=
nodeService
.
queryByKeyAndAppIdAndType
(
convertKeyMap
.
get
(
nodekey
),
appId
,
type
);
nodeDetail
.
setNodeid
(
node
.
getId
());
}
nodeService
.
saveNodeDetail
(
nodeDetail
);
}
//返回保存后的数据
List
<
TopographyNode
>
newNodes
=
nodeService
.
getNodesByAppIdAndType
(
appId
,
type
);
List
<
TopographyLine
>
newLinks
=
lineService
.
getLinesByAppIdAndType
(
appId
,
type
);
Map
<
String
,
Object
>
results
=
new
HashMap
<>();
results
.
put
(
"nodeData"
,
newNodes
);
results
.
put
(
"linkData"
,
newLinks
);
return
CommonResponseUtil
.
success
(
results
);
}
//返回保存后的数据
List
<
TopographyNode
>
newNodes
=
nodeService
.
getNodesByAppIdAndType
(
appId
,
type
);
List
<
TopographyLine
>
newLinks
=
lineService
.
getLinesByAppIdAndType
(
appId
,
type
);
Map
<
String
,
Object
>
results
=
new
HashMap
<>();
results
.
put
(
"nodeData"
,
newNodes
);
results
.
put
(
"linkData"
,
newLinks
);
return
CommonResponseUtil
.
success
(
results
);
}
@ApiOperation
(
value
=
"根据nodeid查询节点详情"
,
notes
=
"根据nodeid查询节点详情"
)
...
...
YeeAmosFireAutoSysStart/src/main/resources/db/changelog/fas-1.0.2.xml
View file @
cc82472f
...
...
@@ -313,5 +313,60 @@
ALTER TABLE `f_topography_line` ADD COLUMN `category` varchar(32) DEFAULT '' COMMENT '类别';
</sql>
</changeSet>
<changeSet
author=
"shanqiyun"
id=
"1586742391611-1"
>
<preConditions
onFail=
"MARK_RAN"
>
<not>
<tableExists
tableName=
"f_text_plan"
/>
</not>
</preConditions>
<comment>
create f_text_plan
</comment>
<sql>
CREATE TABLE `f_text_plan` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
`app_id` varchar(255) NOT NULL COMMENT '预案id',
`text_name` varchar(255) NOT NULL DEFAULT '' COMMENT '文本预案名称',
`file_path` varchar(255) NOT NULL COMMENT '预案路径',
`remark` varchar(500) DEFAULT NULL COMMENT '备注',
`create_date` datetime DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=101 DEFAULT CHARSET=utf8mb4 COMMENT='文本预案';
</sql>
</changeSet>
<changeSet
author=
"shanqiyun"
id=
"1586742391611-2"
>
<preConditions
onFail=
"MARK_RAN"
>
<not>
<columnExists
tableName=
"f_topography_line"
columnName=
"from_port"
/>
</not>
</preConditions>
<comment>
f_topography_line add column from_port
</comment>
<sql>
ALTER TABLE `f_topography_line` ADD COLUMN `from_port` varchar(32) DEFAULT NULL;
</sql>
</changeSet>
<changeSet
author=
"shanqiyun"
id=
"1586742391611-3"
>
<preConditions
onFail=
"MARK_RAN"
>
<not>
<columnExists
tableName=
"f_topography_line"
columnName=
"to_port"
/>
</not>
</preConditions>
<comment>
f_topography_line add column to_port
</comment>
<sql>
ALTER TABLE `f_topography_line` ADD COLUMN `to_port` varchar(32) DEFAULT NULL;
</sql>
</changeSet>
<changeSet
author=
"shanqiyun"
id=
"1586742391611-4"
>
<preConditions
onFail=
"MARK_RAN"
>
<columnExists
tableName=
"f_topography_node_detail "
columnName=
"nodeid"
/>
</preConditions>
<comment>
"f_topography_node_detail " change column nodeid
</comment>
<sql>
ALTER TABLE `f_topography_node_detail`
MODIFY COLUMN `nodeid` varchar(36) DEFAULT NULL;
</sql>
</changeSet>
</databaseChangeLog>
\ No newline at end of file
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