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
8a2f800e
Commit
8a2f800e
authored
Mar 30, 2020
by
单奇雲
Browse files
Options
Browse Files
Download
Plain Diff
Merge
parents
595aa6ed
9b5c5017
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
52 additions
and
23 deletions
+52
-23
PlanVisual3dController.java
.../amos/fas/business/controller/PlanVisual3dController.java
+30
-21
PlanVisual3dServiceImpl.java
...os/fas/business/service/impl/PlanVisual3dServiceImpl.java
+19
-0
IPlanVisual3dService.java
...amos/fas/business/service/intfc/IPlanVisual3dService.java
+2
-1
dbTemplate_3d_plan_visual.xml
...rc/main/resources/db/mapper/dbTemplate_3d_plan_visual.xml
+1
-1
No files found.
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/controller/PlanVisual3dController.java
View file @
8a2f800e
package
com
.
yeejoin
.
amos
.
fas
.
business
.
controller
;
package
com
.
yeejoin
.
amos
.
fas
.
business
.
controller
;
import
com.yeejoin.amos.fas.business.service.intfc.IPlanVisual3dService
;
import
com.yeejoin.amos.fas.business.service.intfc.IPlanVisual3dService
;
import
com.yeejoin.amos.fas.core.util.StringUtil
;
import
com.yeejoin.amos.fas.dao.entity.TextPlan
;
import
com.yeejoin.amos.fas.dao.entity.TextPlan
;
import
com.yeejoin.amos.op.core.common.response.CommonResponse
;
import
com.yeejoin.amos.op.core.common.response.CommonResponse
;
import
com.yeejoin.amos.op.core.util.CommonResponseUtil
;
import
com.yeejoin.amos.op.core.util.CommonResponseUtil
;
...
@@ -24,11 +25,7 @@ import org.slf4j.Logger;
...
@@ -24,11 +25,7 @@ import org.slf4j.Logger;
import
org.slf4j.LoggerFactory
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.bind.annotation.RestController
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
...
@@ -109,29 +106,41 @@ public class PlanVisual3dController extends BaseController {
...
@@ -109,29 +106,41 @@ public class PlanVisual3dController extends BaseController {
return
response
;
return
response
;
}
}
/**
/**
* 资源设备信息查询
* 资源设备查询、数据项查询
*
* @param type or type && id
* @return 资源设备 or 数据项
*/
*/
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"资源查询"
,
notes
=
"资源查询"
)
@Authorization
(
ingore
=
true
)
@Authorization
(
ingore
=
true
)
@GetMapping
(
value
=
"/resource/{type}/list"
)
@GetMapping
(
value
=
"resource/common"
)
public
CommonResponse
getResourceList
(
@ApiParam
(
value
=
"资源类型"
,
required
=
true
)
@PathVariable
String
type
)
{
@ApiOperation
(
value
=
"设备、数据项查询"
,
notes
=
"按照资源类型type查询设备,按照资源类型type和设备id查询数据项"
)
return
planVisual3dService
.
getResourceListByType
(
type
);
public
CommonResponse
getResourceCommon
(
@ApiParam
(
value
=
"资源类型"
)
@RequestParam
(
required
=
false
)
String
type
,
@ApiParam
(
value
=
"主键id"
)
@RequestParam
(
required
=
false
)
Long
id
)
{
if
(!
StringUtil
.
isNotEmpty
(
type
)){
return
CommonResponseUtil
.
success
();
}
if
(
StringUtil
.
isNotEmpty
(
type
)
&&
!
StringUtil
.
isNotEmpty
(
id
)){
return
planVisual3dService
.
getResourceListByType
(
type
);
}
if
(
StringUtil
.
isNotEmpty
(
type
)
&&
StringUtil
.
isNotEmpty
(
id
)){
List
<
Map
<
String
,
Object
>>
list
=
planVisual3dService
.
getResourceById
(
type
,
id
);
return
CommonResponseUtil
.
success
(
list
);
}
return
CommonResponseUtil
.
success
();
}
}
/**
/**
* 资源设备数据项查询
* 资源类型查询
*
* @return list
* @param id
* @return
*/
*/
@Authorization
(
ingore
=
true
)
@Authorization
(
ingore
=
true
)
@GetMapping
(
value
=
"/{type}/detail/{id}"
)
@ApiOperation
(
value
=
"资源类型查询"
,
notes
=
"资源类型查询"
)
@ApiOperation
(
value
=
"数据项查询"
,
notes
=
"按照分类及id查询数据项"
)
@GetMapping
(
value
=
"resource/type/list"
)
public
CommonResponse
getResourceDetail
(
public
CommonResponse
getResourceList
(){
@ApiParam
(
value
=
"资源类型"
,
required
=
true
)
@PathVariable
String
type
,
return
CommonResponseUtil
.
success
(
planVisual3dService
.
getResourceTypeList
());
@ApiParam
(
value
=
"主键id"
,
required
=
true
)
@PathVariable
Long
id
)
{
List
<
Map
<
String
,
Object
>>
list
=
planVisual3dService
.
getResourceById
(
type
,
id
);
return
CommonResponseUtil
.
success
(
list
);
}
}
}
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/impl/PlanVisual3dServiceImpl.java
View file @
8a2f800e
...
@@ -2,6 +2,7 @@ package com.yeejoin.amos.fas.business.service.impl;
...
@@ -2,6 +2,7 @@ package com.yeejoin.amos.fas.business.service.impl;
import
com.google.common.collect.Lists
;
import
com.google.common.collect.Lists
;
import
com.yeejoin.amos.fas.business.constants.FasConstant
;
import
com.yeejoin.amos.fas.business.constants.FasConstant
;
import
com.yeejoin.amos.fas.business.dao.mapper.DictMapper
;
import
com.yeejoin.amos.fas.business.dao.mapper.PlanVisual3dMapper
;
import
com.yeejoin.amos.fas.business.dao.mapper.PlanVisual3dMapper
;
import
com.yeejoin.amos.fas.business.dao.repository.ITextPlanDao
;
import
com.yeejoin.amos.fas.business.dao.repository.ITextPlanDao
;
import
com.yeejoin.amos.fas.business.feign.IMaasVisualServer
;
import
com.yeejoin.amos.fas.business.feign.IMaasVisualServer
;
...
@@ -34,6 +35,9 @@ public class PlanVisual3dServiceImpl implements IPlanVisual3dService {
...
@@ -34,6 +35,9 @@ public class PlanVisual3dServiceImpl implements IPlanVisual3dService {
@Autowired
@Autowired
IDictService
dictService
;
IDictService
dictService
;
@Autowired
private
DictMapper
dictMapper
;
@Override
@Override
public
List
<
TreeSubjectVo
>
getPlanTree
()
{
public
List
<
TreeSubjectVo
>
getPlanTree
()
{
...
@@ -174,5 +178,20 @@ public class PlanVisual3dServiceImpl implements IPlanVisual3dService {
...
@@ -174,5 +178,20 @@ public class PlanVisual3dServiceImpl implements IPlanVisual3dService {
return
list
;
return
list
;
}
}
@Override
public
List
<
Map
<
String
,
Object
>>
getResourceTypeList
()
{
Dict
dict
=
new
Dict
();
dict
.
setDictCode
(
FasConstant
.
PLAN_SOURCE_TYPE
);
List
<
Dict
>
dictList
=
dictMapper
.
getDictList
(
dict
);
List
<
Map
<
String
,
Object
>>
list
=
new
ArrayList
<>();
list
=
dictList
.
stream
().
map
(
e
->{
Map
<
String
,
Object
>
newMap
=
new
HashMap
<
String
,
Object
>();
newMap
.
put
(
"key"
,
e
.
getDictValue
());
newMap
.
put
(
"label"
,
e
.
getDictName
());
return
newMap
;
}).
collect
(
Collectors
.
toList
());
return
list
;
}
}
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/intfc/IPlanVisual3dService.java
View file @
8a2f800e
...
@@ -4,7 +4,6 @@ import com.yeejoin.amos.fas.business.vo.TreeSubjectVo;
...
@@ -4,7 +4,6 @@ import com.yeejoin.amos.fas.business.vo.TreeSubjectVo;
import
com.yeejoin.amos.fas.dao.entity.TextPlan
;
import
com.yeejoin.amos.fas.dao.entity.TextPlan
;
import
com.yeejoin.amos.op.core.common.response.CommonResponse
;
import
com.yeejoin.amos.op.core.common.response.CommonResponse
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
...
@@ -35,4 +34,6 @@ public interface IPlanVisual3dService {
...
@@ -35,4 +34,6 @@ public interface IPlanVisual3dService {
CommonResponse
getResourceListByType
(
String
type
);
CommonResponse
getResourceListByType
(
String
type
);
List
<
Map
<
String
,
Object
>>
getResourceById
(
String
type
,
Long
id
);
List
<
Map
<
String
,
Object
>>
getResourceById
(
String
type
,
Long
id
);
List
<
Map
<
String
,
Object
>>
getResourceTypeList
();
}
}
YeeAmosFireAutoSysStart/src/main/resources/db/mapper/dbTemplate_3d_plan_visual.xml
View file @
8a2f800e
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
<!--查询-->
<!--查询-->
<select
id=
"getResourceListByType"
resultType=
"java.util.HashMap"
>
<select
id=
"getResourceListByType"
resultType=
"java.util.HashMap"
>
SELECT
SELECT
rs.id
,rs.name
,rs.code
rs.id
as `key` ,rs.name as label
,rs.code
from
from
<choose>
<choose>
<when
test=
"type=='fireCar'"
>
<when
test=
"type=='fireCar'"
>
...
...
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