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
e31e2595
Commit
e31e2595
authored
Feb 21, 2020
by
suhuiguang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.电子预案按照类型查询资源
parent
5fd83797
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
125 additions
and
14 deletions
+125
-14
FasConstant.java
.../com/yeejoin/amos/fas/business/constants/FasConstant.java
+1
-0
FileController.java
.../yeejoin/amos/fas/business/controller/FileController.java
+2
-2
PlanVisual3dController.java
.../amos/fas/business/controller/PlanVisual3dController.java
+25
-6
PlanVisual3dMapper.java
...join/amos/fas/business/dao/mapper/PlanVisual3dMapper.java
+12
-0
PlanVisual3dServiceImpl.java
...os/fas/business/service/impl/PlanVisual3dServiceImpl.java
+29
-3
IPlanVisual3dService.java
...amos/fas/business/service/intfc/IPlanVisual3dService.java
+5
-1
dbTemplate_3d_plan_visual.xml
...rc/main/resources/db/mapper/dbTemplate_3d_plan_visual.xml
+47
-0
dbTemplate_dict.xml
...SysStart/src/main/resources/db/mapper/dbTemplate_dict.xml
+4
-2
No files found.
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/constants/FasConstant.java
View file @
e31e2595
...
@@ -43,4 +43,5 @@ public class FasConstant {
...
@@ -43,4 +43,5 @@ public class FasConstant {
public
static
final
String
RISK_SOURCE_STATUS_NORMAL
=
"NORMAL"
;
//风险点状态-正常
public
static
final
String
RISK_SOURCE_STATUS_NORMAL
=
"NORMAL"
;
//风险点状态-正常
public
static
final
String
RISK_SOURCE_STATUS_ANOMALY
=
"ANOMALY"
;
//风险点状态-正常
public
static
final
String
RISK_SOURCE_STATUS_ANOMALY
=
"ANOMALY"
;
//风险点状态-正常
public
static
final
String
PLAN_SOURCE_TYPE
=
"plan_source_type"
;
//预案资源类型
}
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/controller/FileController.java
View file @
e31e2595
package
com
.
yeejoin
.
amos
.
fas
.
business
.
controller
;
package
com
.
yeejoin
.
amos
.
fas
.
business
.
controller
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
import
com.yeejoin.amos.fas.business.service.intfc.I
MaasVisual
Service
;
import
com.yeejoin.amos.fas.business.service.intfc.I
PlanVisual3d
Service
;
import
com.yeejoin.amos.fas.core.util.*
;
import
com.yeejoin.amos.fas.core.util.*
;
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
;
...
@@ -45,7 +45,7 @@ public class FileController extends BaseController {
...
@@ -45,7 +45,7 @@ public class FileController extends BaseController {
private
String
readUrl
;
private
String
readUrl
;
@Autowired
@Autowired
private
I
MaasVisual
Service
iMaasVisualService
;
private
I
PlanVisual3d
Service
iMaasVisualService
;
//文件上传
//文件上传
@RequestMapping
(
value
=
"/uploadfile"
,
method
=
RequestMethod
.
POST
)
@RequestMapping
(
value
=
"/uploadfile"
,
method
=
RequestMethod
.
POST
)
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/controller/
MaasVisual
Controller.java
→
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/controller/
PlanVisual3d
Controller.java
View file @
e31e2595
package
com
.
yeejoin
.
amos
.
fas
.
business
.
controller
;
package
com
.
yeejoin
.
amos
.
fas
.
business
.
controller
;
import
com.yeejoin.amos.fas.business.service.intfc.IMaasVisualService
;
import
com.yeejoin.amos.fas.business.dao.repository.IDictDao
;
import
com.yeejoin.amos.fas.business.service.intfc.IDictService
;
import
com.yeejoin.amos.fas.business.service.intfc.IPlanVisual3dService
;
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
;
import
com.yeejoin.amos.security.authorization.Authorization
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiParam
;
import
org.slf4j.Logger
;
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
;
...
@@ -13,25 +17,40 @@ import org.springframework.web.bind.annotation.PathVariable;
...
@@ -13,25 +17,40 @@ import org.springframework.web.bind.annotation.PathVariable;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.bind.annotation.RestController
;
import
java.util.HashMap
;
import
java.util.List
;
@RestController
@RestController
@RequestMapping
(
value
=
"/api/visual"
)
@RequestMapping
(
value
=
"/api/visual"
)
@Api
(
tags
=
"预案可视化API"
)
@Api
(
tags
=
"预案可视化API"
)
public
class
MaasVisual
Controller
extends
BaseController
{
public
class
PlanVisual3d
Controller
extends
BaseController
{
private
final
Logger
log
=
LoggerFactory
.
getLogger
(
MaasVisual
Controller
.
class
);
private
final
Logger
log
=
LoggerFactory
.
getLogger
(
PlanVisual3d
Controller
.
class
);
@Autowired
@Autowired
private
IMaasVisualService
maasVisualService
;
private
IPlanVisual3dService
planVisual3dService
;
@Autowired
private
IDictService
dictService
;
@ApiOperation
(
value
=
"预案应用树"
,
notes
=
"预案应用树"
)
@ApiOperation
(
value
=
"预案应用树"
,
notes
=
"预案应用树"
)
@GetMapping
(
value
=
"/plan/tree"
)
@GetMapping
(
value
=
"/plan/tree"
)
public
CommonResponse
getPlanTree
()
{
public
CommonResponse
getPlanTree
()
{
return
CommonResponseUtil
.
success
(
maasVisual
Service
.
getPlanTree
());
return
CommonResponseUtil
.
success
(
planVisual3d
Service
.
getPlanTree
());
}
}
@ApiOperation
(
value
=
"根据ID获取文字预案"
,
notes
=
"根据ID获取文字预案"
)
@ApiOperation
(
value
=
"根据ID获取文字预案"
,
notes
=
"根据ID获取文字预案"
)
@GetMapping
(
value
=
"/plan/text/{id}"
)
@GetMapping
(
value
=
"/plan/text/{id}"
)
public
CommonResponse
getTextPlanById
(
@PathVariable
(
value
=
"id"
)
Long
id
)
{
public
CommonResponse
getTextPlanById
(
@PathVariable
(
value
=
"id"
)
Long
id
)
{
return
CommonResponseUtil
.
success
(
maasVisualService
.
getTextPlanInfoById
(
id
));
return
CommonResponseUtil
.
success
(
planVisual3dService
.
getTextPlanInfoById
(
id
));
}
/**
* 资源设备信息查询
*/
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"资源查询"
,
notes
=
"资源查询"
)
@Authorization
(
ingore
=
true
)
@RequestMapping
(
value
=
"/resource/{type}/list"
)
public
CommonResponse
getResourceList
(
@ApiParam
(
value
=
"资源类型"
,
required
=
true
)
@PathVariable
String
type
){
return
planVisual3dService
.
getResourceListByType
(
type
);
}
}
}
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/dao/mapper/PlanVisual3dMapper.java
0 → 100644
View file @
e31e2595
package
com
.
yeejoin
.
amos
.
fas
.
business
.
dao
.
mapper
;
import
javafx.application.Application
;
import
javafx.stage.Stage
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.HashMap
;
import
java.util.List
;
public
interface
PlanVisual3dMapper
extends
BaseMapper
{
List
<
HashMap
<
String
,
String
>>
getResourceListByType
(
@Param
(
"type"
)
String
type
);
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/impl/
MaasVisual
ServiceImpl.java
→
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/impl/
PlanVisual3d
ServiceImpl.java
View file @
e31e2595
package
com
.
yeejoin
.
amos
.
fas
.
business
.
service
.
impl
;
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.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
;
import
com.yeejoin.amos.fas.business.service.intfc.IMaasVisualService
;
import
com.yeejoin.amos.fas.business.service.intfc.IDictService
;
import
com.yeejoin.amos.fas.business.service.intfc.IPlanVisual3dService
;
import
com.yeejoin.amos.fas.business.vo.TreeSubjectVo
;
import
com.yeejoin.amos.fas.business.vo.TreeSubjectVo
;
import
com.yeejoin.amos.fas.dao.entity.Dict
;
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
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.CollectionUtils
;
import
org.springframework.util.CollectionUtils
;
import
java.util.HashMap
;
import
java.util.LinkedHashMap
;
import
java.util.LinkedHashMap
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
@Service
(
"
maasVisual
Service"
)
@Service
(
"
planVisual3d
Service"
)
public
class
MaasVisualServiceImpl
implements
IMaasVisual
Service
{
public
class
PlanVisual3dServiceImpl
implements
IPlanVisual3d
Service
{
@Autowired
@Autowired
IMaasVisualServer
maasVisualServer
;
IMaasVisualServer
maasVisualServer
;
...
@@ -24,6 +30,12 @@ public class MaasVisualServiceImpl implements IMaasVisualService {
...
@@ -24,6 +30,12 @@ public class MaasVisualServiceImpl implements IMaasVisualService {
@Autowired
@Autowired
ITextPlanDao
iTextPlanDao
;
ITextPlanDao
iTextPlanDao
;
@Autowired
PlanVisual3dMapper
planVisual3dMapper
;
@Autowired
IDictService
dictService
;
@Override
@Override
public
List
<
TreeSubjectVo
>
getPlanTree
()
{
public
List
<
TreeSubjectVo
>
getPlanTree
()
{
...
@@ -115,4 +127,18 @@ public class MaasVisualServiceImpl implements IMaasVisualService {
...
@@ -115,4 +127,18 @@ public class MaasVisualServiceImpl implements IMaasVisualService {
return
treeSubjectVos
;
return
treeSubjectVos
;
}
}
@Override
public
CommonResponse
getResourceListByType
(
String
type
)
{
//1.校验是否是约定的字典,不存在则提示失败
Dict
dict
=
new
Dict
();
dict
.
setDictCode
(
FasConstant
.
PLAN_SOURCE_TYPE
);
dict
.
setDictValue
(
type
);
List
<
Dict
>
dictList
=
dictService
.
getDictList
(
dict
);
if
(
CollectionUtils
.
isEmpty
(
dictList
)){
return
CommonResponseUtil
.
failure
(
type
+
"字典类型不存在"
);
}
//2.返回存在的数据
return
CommonResponseUtil
.
success
(
planVisual3dMapper
.
getResourceListByType
(
type
));
}
}
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/intfc/I
MaasVisual
Service.java
→
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/intfc/I
PlanVisual3d
Service.java
View file @
e31e2595
...
@@ -2,11 +2,13 @@ package com.yeejoin.amos.fas.business.service.intfc;
...
@@ -2,11 +2,13 @@ package com.yeejoin.amos.fas.business.service.intfc;
import
com.yeejoin.amos.fas.business.vo.TreeSubjectVo
;
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
java.util.HashMap
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
public
interface
I
MaasVisual
Service
{
public
interface
I
PlanVisual3d
Service
{
/**
/**
* 获取预案树
* 获取预案树
...
@@ -29,4 +31,6 @@ public interface IMaasVisualService {
...
@@ -29,4 +31,6 @@ public interface IMaasVisualService {
* @return
* @return
*/
*/
TextPlan
getTextPlanInfoById
(
Long
id
);
TextPlan
getTextPlanInfoById
(
Long
id
);
CommonResponse
getResourceListByType
(
String
type
);
}
}
YeeAmosFireAutoSysStart/src/main/resources/db/mapper/dbTemplate_3d_plan_visual.xml
0 → 100644
View file @
e31e2595
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.yeejoin.amos.fas.business.dao.mapper.PlanVisual3dMapper"
>
<!--查询-->
<select
id=
"getResourceListByType"
resultType=
"java.util.HashMap"
>
SELECT
rs.id,rs.name,rs.code
from
<choose>
<when
test=
"type=='fireCar'"
>
(SELECT a.id,a.name,a.car_num as code FROM `f_fire_car` a) as rs
</when>
<when
test=
"type=='monitorEquipment'"
>
(select a.id,a.name,a.code from f_fire_equipment a where a.equip_classify = 0) as rs
</when>
<when
test=
"type=='fireConsumables'"
>
(select a.id,a.name,a.code from f_fire_equipment a where a.equip_classify = 1) as rs
</when>
<when
test=
"type=='video'"
>
(select a.id,a.name,a.code from f_fire_equipment a where a.equip_classify = 2) as rs
</when>
<when
test=
"type=='fireEquipment'"
>
(select a.id,a.name,a.code from f_fire_equipment a where a.equip_classify = 3) as rs
</when>
<when
test=
"type=='impEquipment'"
>
(select a.id,a.`name`,a.`code` from f_equipment a) as rs
</when>
<when
test=
"type=='fireStrength'"
>
(select a.id,a.`name`,a.`code` from f_equipment a) as rs
</when>
<when
test=
"type=='fireChamber'"
>
(select a.id,a.`name`,a.`code` from f_fire_station a where a.type = '1') as rs
</when>
<when
test=
"type=='fireFoamRoom'"
>
(select a.id,a.`name`,a.`code` from f_fire_station a where a.type = '2') as rs
</when>
<when
test=
"type=='hydrant'"
>
(SELECT a.id,a.`name`,a.code FROM `f_water_resource` a where a.type = '1') as rs
</when>
<when
test=
"type=='pool'"
>
(SELECT a.id,a.`name`,a.code FROM `f_water_resource` a where a.type = '2') as rs
</when>
</choose>
</select>
</mapper>
\ No newline at end of file
YeeAmosFireAutoSysStart/src/main/resources/db/mapper/dbTemplate_dict.xml
View file @
e31e2595
...
@@ -25,8 +25,9 @@
...
@@ -25,8 +25,9 @@
select fd.dict_name, fd.dict_value, fd.dict_code, fd.id, fd.parent_id, fd.remark, fd.dict_order from f_dict fd
select fd.dict_name, fd.dict_value, fd.dict_code, fd.id, fd.parent_id, fd.remark, fd.dict_order from f_dict fd
<where>
<where>
<if
test=
"dictName != null"
>
fd.dict_name like concat('%', #{dict.dictName}, '%')
</if>
<if
test=
"dictName != null"
>
fd.dict_name like concat('%', #{dict.dictName}, '%')
</if>
<if
test=
"dictCode != null"
>
fd.dict_code = #{dictCode}
</if>
<if
test=
"dictCode != null"
>
and fd.dict_code = #{dictCode}
</if>
<if
test=
"parentId != null and parentId > 0 "
>
fd.parent_id = #{parentId}
</if>
<if
test=
"dictValue !=null"
>
and fd.dict_value = #{dictValue}
</if>
<if
test=
"parentId != null and parentId > 0 "
>
and fd.parent_id = #{parentId}
</if>
</where>
</where>
</select>
</select>
</mapper>
</mapper>
\ 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