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
c46de4ff
Commit
c46de4ff
authored
Nov 26, 2020
by
lizehua
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
去除报错,以及修改查询数据sql
parent
f01a5c93
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
530 additions
and
536 deletions
+530
-536
FireEquipMapper.java
...yeejoin/amos/fas/business/dao/mapper/FireEquipMapper.java
+0
-2
EquipmentServiceImpl.java
.../amos/fas/business/service/impl/EquipmentServiceImpl.java
+496
-511
IEquipmentService.java
...in/amos/fas/business/service/intfc/IEquipmentService.java
+0
-2
dbTemplate_fire_equip.xml
...rt/src/main/resources/db/mapper/dbTemplate_fire_equip.xml
+0
-19
dbTemplate_view3d.xml
...sStart/src/main/resources/db/mapper/dbTemplate_view3d.xml
+34
-2
No files found.
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/dao/mapper/FireEquipMapper.java
View file @
c46de4ff
...
@@ -57,8 +57,6 @@ public interface FireEquipMapper extends BaseMapper {
...
@@ -57,8 +57,6 @@ public interface FireEquipMapper extends BaseMapper {
EquipDetailsResponse
findEquipDetailsById
(
@Param
(
"id"
)
Long
id
);
EquipDetailsResponse
findEquipDetailsById
(
@Param
(
"id"
)
Long
id
);
List
<
EquipCommunicationData
>
findAllEquipPointInfo
();
EquipCommunicationData
findOneByPointCode
(
@Param
(
"code"
)
String
code
);
EquipCommunicationData
findOneByPointCode
(
@Param
(
"code"
)
String
code
);
void
saveBatch
(
List
<
FireEquipmentParam
>
list
);
void
saveBatch
(
List
<
FireEquipmentParam
>
list
);
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/impl/EquipmentServiceImpl.java
View file @
c46de4ff
package
com
.
yeejoin
.
amos
.
fas
.
business
.
service
.
impl
;
package
com
.
yeejoin
.
amos
.
fas
.
business
.
service
.
impl
;
import
java.io.File
;
import
java.io.File
;
import
java.io.IOException
;
import
java.io.IOException
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
import
java.util.Optional
;
import
java.util.Optional
;
import
javax.annotation.PostConstruct
;
import
javax.annotation.PostConstruct
;
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
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.data.domain.Page
;
import
org.springframework.data.domain.Page
;
import
org.springframework.data.domain.PageImpl
;
import
org.springframework.data.domain.PageImpl
;
import
org.springframework.data.domain.Sort
;
import
org.springframework.data.domain.Sort
;
import
org.springframework.data.domain.Sort.Direction
;
import
org.springframework.data.domain.Sort.Direction
;
import
org.springframework.data.domain.Sort.Order
;
import
org.springframework.data.domain.Sort.Order
;
import
org.springframework.data.mongodb.core.MongoTemplate
;
import
org.springframework.data.mongodb.core.MongoTemplate
;
import
org.springframework.data.mongodb.core.query.Criteria
;
import
org.springframework.data.mongodb.core.query.Criteria
;
import
org.springframework.data.mongodb.core.query.Query
;
import
org.springframework.data.mongodb.core.query.Query
;
import
org.springframework.data.redis.core.RedisTemplate
;
import
org.springframework.data.redis.core.RedisTemplate
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.util.CollectionUtils
;
import
org.springframework.util.CollectionUtils
;
import
org.springframework.util.ObjectUtils
;
import
org.springframework.util.ObjectUtils
;
import
org.springframework.web.multipart.MultipartFile
;
import
org.springframework.web.multipart.MultipartFile
;
import
com.yeejoin.amos.component.feign.model.FeignClientResult
;
import
com.yeejoin.amos.component.feign.model.FeignClientResult
;
import
com.yeejoin.amos.fas.business.constants.FasConstant
;
import
com.yeejoin.amos.fas.business.constants.FasConstant
;
import
com.yeejoin.amos.fas.business.dao.mapper.FireEquipMapper
;
import
com.yeejoin.amos.fas.business.dao.mapper.FireEquipMapper
;
import
com.yeejoin.amos.fas.business.dao.mapper.ImpAndFireEquipMapper
;
import
com.yeejoin.amos.fas.business.dao.mapper.ImpAndFireEquipMapper
;
import
com.yeejoin.amos.fas.business.dao.mapper.ImpEquipMapper
;
import
com.yeejoin.amos.fas.business.dao.mapper.ImpEquipMapper
;
import
com.yeejoin.amos.fas.business.dao.mongo.EquipCommunicationDao
;
import
com.yeejoin.amos.fas.business.dao.mongo.EquipCommunicationDao
;
import
com.yeejoin.amos.fas.business.dao.repository.IEquipmentDao
;
import
com.yeejoin.amos.fas.business.dao.repository.IEquipmentDao
;
import
com.yeejoin.amos.fas.business.dao.repository.IEquipmentFireEquipmentDao
;
import
com.yeejoin.amos.fas.business.dao.repository.IEquipmentFireEquipmentDao
;
import
com.yeejoin.amos.fas.business.dao.repository.IFireEquipmentDao
;
import
com.yeejoin.amos.fas.business.dao.repository.IFireEquipmentDao
;
import
com.yeejoin.amos.fas.business.dao.repository.IFmeaEquipmentPointDao
;
import
com.yeejoin.amos.fas.business.dao.repository.IFmeaEquipmentPointDao
;
import
com.yeejoin.amos.fas.business.dao.repository.IPreplanPictureDao
;
import
com.yeejoin.amos.fas.business.dao.repository.IPreplanPictureDao
;
import
com.yeejoin.amos.fas.business.feign.RemoteSecurityService
;
import
com.yeejoin.amos.fas.business.feign.RemoteSecurityService
;
import
com.yeejoin.amos.fas.business.param.ImgParam
;
import
com.yeejoin.amos.fas.business.param.ImgParam
;
import
com.yeejoin.amos.fas.business.service.intfc.IEquipmentService
;
import
com.yeejoin.amos.fas.business.service.intfc.IEquipmentService
;
import
com.yeejoin.amos.fas.business.vo.EquipCommunicationData
;
import
com.yeejoin.amos.fas.business.vo.EquipCommunicationData
;
import
com.yeejoin.amos.fas.core.common.request.CommonPageable
;
import
com.yeejoin.amos.fas.core.common.request.CommonPageable
;
import
com.yeejoin.amos.fas.core.common.response.EquipDetailsResponse
;
import
com.yeejoin.amos.fas.core.common.response.EquipDetailsResponse
;
import
com.yeejoin.amos.fas.core.util.DaoCriteria
;
import
com.yeejoin.amos.fas.core.util.DaoCriteria
;
import
com.yeejoin.amos.fas.core.util.query.BaseQuerySpecification
;
import
com.yeejoin.amos.fas.core.util.query.BaseQuerySpecification
;
import
com.yeejoin.amos.fas.dao.entity.Equipment
;
import
com.yeejoin.amos.fas.dao.entity.Equipment
;
import
com.yeejoin.amos.fas.dao.entity.EquipmentFireEquipment
;
import
com.yeejoin.amos.fas.dao.entity.EquipmentFireEquipment
;
import
com.yeejoin.amos.fas.dao.entity.FireEquipment
;
import
com.yeejoin.amos.fas.dao.entity.FireEquipment
;
import
com.yeejoin.amos.fas.dao.entity.PreplanPicture
;
import
com.yeejoin.amos.fas.dao.entity.PreplanPicture
;
import
com.yeejoin.amos.fas.exception.YeeException
;
import
com.yeejoin.amos.fas.exception.YeeException
;
import
com.yeejoin.amos.feign.privilege.Privilege
;
import
com.yeejoin.amos.feign.privilege.Privilege
;
import
com.yeejoin.amos.feign.privilege.model.AgencyUserModel
;
import
com.yeejoin.amos.feign.privilege.model.AgencyUserModel
;
import
com.yeejoin.amos.feign.privilege.model.CompanyModel
;
import
com.yeejoin.amos.feign.privilege.model.CompanyModel
;
import
com.yeejoin.amos.feign.privilege.model.DepartmentModel
;
import
com.yeejoin.amos.feign.privilege.model.DepartmentModel
;
@Service
(
"equipService"
)
@Service
(
"equipService"
)
public
class
EquipmentServiceImpl
implements
IEquipmentService
{
public
class
EquipmentServiceImpl
implements
IEquipmentService
{
private
final
Logger
log
=
LoggerFactory
.
getLogger
(
EquipmentServiceImpl
.
class
);
private
final
Logger
log
=
LoggerFactory
.
getLogger
(
EquipmentServiceImpl
.
class
);
@Autowired
@Autowired
ImpEquipMapper
impEquipMapper
;
ImpEquipMapper
impEquipMapper
;
@Autowired
@Autowired
FireEquipMapper
fireEquipMapper
;
FireEquipMapper
fireEquipMapper
;
@Autowired
@Autowired
IEquipmentDao
iEquipmentDao
;
IEquipmentDao
iEquipmentDao
;
@Autowired
@Autowired
IPreplanPictureDao
iPreplanPictureDao
;
IPreplanPictureDao
iPreplanPictureDao
;
@Autowired
@Autowired
IEquipmentFireEquipmentDao
equipmentFireEquipmentDao
;
IEquipmentFireEquipmentDao
equipmentFireEquipmentDao
;
@Autowired
@Autowired
IFireEquipmentDao
iFireEquipmentDao
;
IFireEquipmentDao
iFireEquipmentDao
;
@Autowired
@Autowired
ImpAndFireEquipMapper
impAndFireEquipMapper
;
ImpAndFireEquipMapper
impAndFireEquipMapper
;
@Autowired
@Autowired
private
IPreplanPictureDao
preplanPictureDao
;
private
IPreplanPictureDao
preplanPictureDao
;
@Autowired
@Autowired
private
RedisTemplate
redisTemplate
;
private
RedisTemplate
redisTemplate
;
@Autowired
@Autowired
private
IFmeaEquipmentPointDao
iFmeaEquipmentPointDao
;
private
IFmeaEquipmentPointDao
iFmeaEquipmentPointDao
;
@Autowired
@Autowired
private
MongoTemplate
mongoTemplate
;
private
MongoTemplate
mongoTemplate
;
@Autowired
@Autowired
private
EquipCommunicationDao
equipCommunicationDao
;
private
EquipCommunicationDao
equipCommunicationDao
;
@Value
(
"${windows.img.path}"
)
@Value
(
"${windows.img.path}"
)
private
String
winImgPath
;
private
String
winImgPath
;
@Value
(
"${linux.img.path}"
)
@Value
(
"${linux.img.path}"
)
private
String
linuxImgPath
;
private
String
linuxImgPath
;
@Autowired
@Autowired
private
RemoteSecurityService
remoteSecurityService
;
private
RemoteSecurityService
remoteSecurityService
;
public
Equipment
save
(
Equipment
equipment
)
{
public
Equipment
save
(
Equipment
equipment
)
{
Long
eqId
=
equipment
.
getId
();
Long
eqId
=
equipment
.
getId
();
equipment
=
iEquipmentDao
.
saveAndFlush
(
equipment
);
equipment
=
iEquipmentDao
.
saveAndFlush
(
equipment
);
return
equipment
;
return
equipment
;
}
}
public
Equipment
queryOne
(
Long
id
)
{
public
Equipment
queryOne
(
Long
id
)
{
Optional
<
Equipment
>
dict1
=
iEquipmentDao
.
findById
(
id
);
Optional
<
Equipment
>
dict1
=
iEquipmentDao
.
findById
(
id
);
Equipment
dict
=
null
;
Equipment
dict
=
null
;
if
(
dict1
.
isPresent
()){
if
(
dict1
.
isPresent
()){
dict
=
dict1
.
get
();
dict
=
dict1
.
get
();
}
}
return
dict
;
return
dict
;
}
}
@Override
@Override
@Transactional
@Transactional
public
String
[]
delete
(
String
[]
idArray
)
throws
Exception
{
public
String
[]
delete
(
String
[]
idArray
)
throws
Exception
{
for
(
String
id
:
idArray
)
{
for
(
String
id
:
idArray
)
{
Optional
<
Equipment
>
equipment1
=
iEquipmentDao
.
findById
(
Long
.
parseLong
(
id
));
Optional
<
Equipment
>
equipment1
=
iEquipmentDao
.
findById
(
Long
.
parseLong
(
id
));
Equipment
equipment
=
null
;
Equipment
equipment
=
null
;
if
(
equipment1
.
isPresent
()){
if
(
equipment1
.
isPresent
()){
equipment
=
equipment1
.
get
();
equipment
=
equipment1
.
get
();
}
}
if
(
equipment
!=
null
)
{
if
(
equipment
!=
null
)
{
List
<
EquipmentFireEquipment
>
eqFireEqs
=
equipmentFireEquipmentDao
.
findAllByEquipmentId
(
equipment
.
getId
());
List
<
EquipmentFireEquipment
>
eqFireEqs
=
equipmentFireEquipmentDao
.
findAllByEquipmentId
(
equipment
.
getId
());
if
(!
eqFireEqs
.
isEmpty
()){
if
(!
eqFireEqs
.
isEmpty
()){
equipmentFireEquipmentDao
.
deleteAll
(
eqFireEqs
);
equipmentFireEquipmentDao
.
deleteAll
(
eqFireEqs
);
}
}
this
.
iEquipmentDao
.
deleteById
(
Long
.
parseLong
(
id
));
this
.
iEquipmentDao
.
deleteById
(
Long
.
parseLong
(
id
));
}
else
{
}
else
{
throw
new
Exception
(
"找不到指定的对象:"
+
id
);
throw
new
Exception
(
"找不到指定的对象:"
+
id
);
}
}
//删除重点设备关联关系
//删除重点设备关联关系
equipmentFireEquipmentDao
.
deleteByEquipmentId
(
Long
.
valueOf
(
id
));
equipmentFireEquipmentDao
.
deleteByEquipmentId
(
Long
.
valueOf
(
id
));
}
}
return
idArray
;
return
idArray
;
}
}
@Override
@Override
public
List
<
PreplanPicture
>
queryImgByIdAndType
(
List
<
DaoCriteria
>
criterias
)
{
public
List
<
PreplanPicture
>
queryImgByIdAndType
(
List
<
DaoCriteria
>
criterias
)
{
BaseQuerySpecification
<
PreplanPicture
>
spec
=
new
BaseQuerySpecification
<>(
criterias
);
BaseQuerySpecification
<
PreplanPicture
>
spec
=
new
BaseQuerySpecification
<>(
criterias
);
return
iPreplanPictureDao
.
findAll
(
spec
);
return
iPreplanPictureDao
.
findAll
(
spec
);
}
}
@Override
@Override
public
Page
<
Equipment
>
queryImpEquip
(
List
<
DaoCriteria
>
criterias
,
CommonPageable
commonPageable
)
{
public
Page
<
Equipment
>
queryImpEquip
(
List
<
DaoCriteria
>
criterias
,
CommonPageable
commonPageable
)
{
String
name
=
""
;
String
name
=
""
;
String
id
=
""
;
String
id
=
""
;
for
(
DaoCriteria
criteria
:
criterias
)
{
for
(
DaoCriteria
criteria
:
criterias
)
{
if
(
criteria
.
getPropertyName
().
equals
(
"name"
))
{
if
(
criteria
.
getPropertyName
().
equals
(
"name"
))
{
name
=
String
.
valueOf
(
criteria
.
getValue
()
!=
null
?
criteria
.
getValue
().
toString
()
:
""
);
name
=
String
.
valueOf
(
criteria
.
getValue
()
!=
null
?
criteria
.
getValue
().
toString
()
:
""
);
}
}
if
(
criteria
.
getPropertyName
().
equals
(
"id"
))
{
if
(
criteria
.
getPropertyName
().
equals
(
"id"
))
{
id
=
String
.
valueOf
(
criteria
.
getValue
()
!=
null
?
criteria
.
getValue
().
toString
()
:
""
);
id
=
String
.
valueOf
(
criteria
.
getValue
()
!=
null
?
criteria
.
getValue
().
toString
()
:
""
);
}
}
}
}
Long
total
=
impEquipMapper
.
getEquipPageCount
(
name
,
id
);
Long
total
=
impEquipMapper
.
getEquipPageCount
(
name
,
id
);
List
<
Map
>
content
=
impEquipMapper
.
getEquipPage
(
name
,
id
,
commonPageable
.
getOffset
(),
List
<
Map
>
content
=
impEquipMapper
.
getEquipPage
(
name
,
id
,
commonPageable
.
getOffset
(),
commonPageable
.
getPageSize
());
commonPageable
.
getPageSize
());
Page
result
=
new
PageImpl
(
content
,
commonPageable
,
total
);
Page
result
=
new
PageImpl
(
content
,
commonPageable
,
total
);
return
result
;
return
result
;
}
}
@Override
@Override
public
List
<
Equipment
>
queryEquipNoPage
()
{
public
List
<
Equipment
>
queryEquipNoPage
()
{
return
iEquipmentDao
.
findAll
();
return
iEquipmentDao
.
findAll
();
}
}
/**
/**
* 绑定消防设备
* 绑定消防设备
*
*
* @param list
* @param list
* @return
* @return
* @throws Exception
* @throws Exception
*/
*/
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
List
<
Map
<
String
,
Object
>>
bindFireEqumt
(
Long
equipmentId
,
List
<
EquipmentFireEquipment
>
list
)
throws
Exception
{
public
List
<
Map
<
String
,
Object
>>
bindFireEqumt
(
Long
equipmentId
,
List
<
EquipmentFireEquipment
>
list
)
throws
Exception
{
List
<
Map
<
String
,
Object
>>
resultList
=
new
ArrayList
<>();
List
<
Map
<
String
,
Object
>>
resultList
=
new
ArrayList
<>();
for
(
EquipmentFireEquipment
equipmentFireEquipment
:
list
)
{
for
(
EquipmentFireEquipment
equipmentFireEquipment
:
list
)
{
int
count
=
equipmentFireEquipmentDao
.
findByEqmtIdAndFireEqmtId
(
equipmentId
,
equipmentFireEquipment
.
getFireEquipmentId
());
int
count
=
equipmentFireEquipmentDao
.
findByEqmtIdAndFireEqmtId
(
equipmentId
,
equipmentFireEquipment
.
getFireEquipmentId
());
if
(
count
>
0
)
{
if
(
count
>
0
)
{
continue
;
continue
;
}
}
equipmentFireEquipment
.
setEquipmentId
(
equipmentId
);
equipmentFireEquipment
.
setEquipmentId
(
equipmentId
);
equipmentFireEquipment
.
setCreateDate
(
new
Date
());
equipmentFireEquipment
.
setCreateDate
(
new
Date
());
Map
<
String
,
Object
>
result
=
new
HashMap
<>();
Map
<
String
,
Object
>
result
=
new
HashMap
<>();
result
.
put
(
"exits"
,
false
);
result
.
put
(
"exits"
,
false
);
Equipment
equipment
=
this
.
iEquipmentDao
.
getOne
(
equipmentFireEquipment
.
getEquipmentId
().
longValue
());
Equipment
equipment
=
this
.
iEquipmentDao
.
getOne
(
equipmentFireEquipment
.
getEquipmentId
().
longValue
());
FireEquipment
fireEquipment
=
iFireEquipmentDao
.
getOne
(
equipmentFireEquipment
.
getFireEquipmentId
().
longValue
());
FireEquipment
fireEquipment
=
iFireEquipmentDao
.
getOne
(
equipmentFireEquipment
.
getFireEquipmentId
().
longValue
());
if
(
equipment
==
null
||
fireEquipment
==
null
)
if
(
equipment
==
null
||
fireEquipment
==
null
)
throw
new
Exception
(
"找不到数据"
);
throw
new
Exception
(
"找不到数据"
);
this
.
equipmentFireEquipmentDao
.
save
(
equipmentFireEquipment
);
this
.
equipmentFireEquipmentDao
.
save
(
equipmentFireEquipment
);
//已存在的绑定关系
//已存在的绑定关系
List
<
EquipmentFireEquipment
>
exits
=
impAndFireEquipMapper
.
queryForList
(
String
.
valueOf
(
equipmentFireEquipment
.
getFireEquipmentId
()),
null
);
List
<
EquipmentFireEquipment
>
exits
=
impAndFireEquipMapper
.
queryForList
(
String
.
valueOf
(
equipmentFireEquipment
.
getFireEquipmentId
()),
null
);
if
(!
CollectionUtils
.
isEmpty
(
exits
))
if
(!
CollectionUtils
.
isEmpty
(
exits
))
result
.
put
(
"exits"
,
true
);
result
.
put
(
"exits"
,
true
);
result
.
put
(
"newModel"
,
equipmentFireEquipment
);
result
.
put
(
"newModel"
,
equipmentFireEquipment
);
resultList
.
add
(
result
);
resultList
.
add
(
result
);
}
}
return
resultList
;
return
resultList
;
}
}
@Override
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
List
<
Long
>
removeFireEqmtBind
(
Long
equipmentId
,
String
[]
fireEquipmentIds
)
{
public
List
<
Long
>
removeFireEqmtBind
(
Long
equipmentId
,
String
[]
fireEquipmentIds
)
{
List
<
Long
>
ids
=
new
ArrayList
<>();
List
<
Long
>
ids
=
new
ArrayList
<>();
for
(
String
id
:
fireEquipmentIds
)
{
for
(
String
id
:
fireEquipmentIds
)
{
long
result
=
0
;
long
result
=
0
;
EquipmentFireEquipment
equipmentFireEquipment
=
impAndFireEquipMapper
.
queryForOne
(
String
.
valueOf
(
id
),
String
.
valueOf
(
equipmentId
));
EquipmentFireEquipment
equipmentFireEquipment
=
impAndFireEquipMapper
.
queryForOne
(
String
.
valueOf
(
id
),
String
.
valueOf
(
equipmentId
));
if
(
equipmentFireEquipment
!=
null
)
{
if
(
equipmentFireEquipment
!=
null
)
{
result
=
equipmentFireEquipment
.
getId
();
result
=
equipmentFireEquipment
.
getId
();
this
.
equipmentFireEquipmentDao
.
deleteById
(
equipmentFireEquipment
.
getId
());
this
.
equipmentFireEquipmentDao
.
deleteById
(
equipmentFireEquipment
.
getId
());
fireEquipMapper
.
removeIfmeaPointByFireEquipIdAndEquipId
(
Long
.
valueOf
(
id
),
equipmentId
);
fireEquipMapper
.
removeIfmeaPointByFireEquipIdAndEquipId
(
Long
.
valueOf
(
id
),
equipmentId
);
//iFmeaEquipmentPointDao.removeByFireEquipIdAndEquipId(Long.valueOf(id), equipmentId);
//iFmeaEquipmentPointDao.removeByFireEquipIdAndEquipId(Long.valueOf(id), equipmentId);
}
}
ids
.
add
(
result
);
ids
.
add
(
result
);
}
}
return
ids
;
return
ids
;
}
}
/**
/**
* 查询指定重点设备已经绑定的消防设备
* 查询指定重点设备已经绑定的消防设备
*
*
* @param equipmentId
* @param equipmentId
* @return
* @return
*/
*/
@Override
@Override
public
Page
queryBindFirEqumtList
(
CommonPageable
commonPageable
,
Long
equipmentId
)
{
public
Page
queryBindFirEqumtList
(
CommonPageable
commonPageable
,
Long
equipmentId
)
{
long
start
=
-
1
;
long
start
=
-
1
;
int
length
=
-
1
;
int
length
=
-
1
;
if
(
null
!=
commonPageable
)
{
if
(
null
!=
commonPageable
)
{
start
=
commonPageable
.
getOffset
();
start
=
commonPageable
.
getOffset
();
length
=
commonPageable
.
getPageSize
();
length
=
commonPageable
.
getPageSize
();
}
}
long
total
=
this
.
impAndFireEquipMapper
.
queryBindFirEqumtPageCount
(
String
.
valueOf
(
equipmentId
));
long
total
=
this
.
impAndFireEquipMapper
.
queryBindFirEqumtPageCount
(
String
.
valueOf
(
equipmentId
));
List
<
FireEquipment
>
list
=
this
.
impAndFireEquipMapper
.
queryBindFirEqumtPage
(
start
,
length
,
String
.
valueOf
(
equipmentId
));
List
<
FireEquipment
>
list
=
this
.
impAndFireEquipMapper
.
queryBindFirEqumtPage
(
start
,
length
,
String
.
valueOf
(
equipmentId
));
if
(
commonPageable
==
null
)
if
(
commonPageable
==
null
)
{
{
commonPageable
=
new
CommonPageable
();
commonPageable
=
new
CommonPageable
();
}
}
Page
result
=
new
PageImpl
(
list
,
commonPageable
,
total
);
Page
result
=
new
PageImpl
(
list
,
commonPageable
,
total
);
return
result
;
return
result
;
}
}
@Override
@Override
public
Equipment
saveImg
(
MultipartFile
file
,
Equipment
equipment
,
int
type
,
Long
userId
)
{
public
Equipment
saveImg
(
MultipartFile
file
,
Equipment
equipment
,
int
type
,
Long
userId
)
{
// TODO Auto-generated method stub
// TODO Auto-generated method stub
Long
equipmentId
=
Long
.
valueOf
(
equipment
.
getId
());
Long
equipmentId
=
Long
.
valueOf
(
equipment
.
getId
());
PreplanPicture
pp
=
preplanPictureDao
.
selectOne
(
equipmentId
,
type
);
PreplanPicture
pp
=
preplanPictureDao
.
selectOne
(
equipmentId
,
type
);
if
(
pp
==
null
)
{
if
(
pp
==
null
)
{
pp
=
new
PreplanPicture
();
pp
=
new
PreplanPicture
();
pp
.
setEquipmentId
(
equipmentId
);
pp
.
setEquipmentId
(
equipmentId
);
pp
.
setType
(
type
);
pp
.
setType
(
type
);
pp
.
setCreateDate
(
new
Date
());
pp
.
setCreateDate
(
new
Date
());
pp
.
setCreateBy
(
userId
.
intValue
()+
""
);
pp
.
setCreateBy
(
userId
.
intValue
()+
""
);
}
}
String
path
=
FasConstant
.
UPLOAD_ROOT_PATH
+
File
.
separator
+
FasConstant
.
UPLOAD_EQUIPMENT_PATH
+
File
.
separator
String
path
=
FasConstant
.
UPLOAD_ROOT_PATH
+
File
.
separator
+
FasConstant
.
UPLOAD_EQUIPMENT_PATH
+
File
.
separator
+
equipment
.
getId
();
+
equipment
.
getId
();
String
filePath
=
getRootPath
()
+
path
;
String
filePath
=
getRootPath
()
+
path
;
String
fileType
=
file
.
getOriginalFilename
().
substring
(
file
.
getOriginalFilename
().
lastIndexOf
(
"."
),
String
fileType
=
file
.
getOriginalFilename
().
substring
(
file
.
getOriginalFilename
().
lastIndexOf
(
"."
),
file
.
getOriginalFilename
().
length
());
file
.
getOriginalFilename
().
length
());
String
fileName
=
File
.
separator
+
type
+
fileType
;
String
fileName
=
File
.
separator
+
type
+
fileType
;
try
{
try
{
File
dest
=
new
File
(
filePath
+
File
.
separator
+
fileName
);
File
dest
=
new
File
(
filePath
+
File
.
separator
+
fileName
);
if
(!
dest
.
exists
())
{
if
(!
dest
.
exists
())
{
if
(
dest
.
getParentFile
()
!=
null
&&
!
dest
.
getParentFile
().
exists
())
{
if
(
dest
.
getParentFile
()
!=
null
&&
!
dest
.
getParentFile
().
exists
())
{
dest
.
getParentFile
().
mkdirs
();
dest
.
getParentFile
().
mkdirs
();
}
}
dest
.
createNewFile
();
dest
.
createNewFile
();
}
}
file
.
transferTo
(
dest
);
file
.
transferTo
(
dest
);
}
catch
(
IOException
e
)
{
}
catch
(
IOException
e
)
{
throw
new
YeeException
(
"上传图片失败"
);
throw
new
YeeException
(
"上传图片失败"
);
}
}
String
picture
=
path
+
fileName
;
String
picture
=
path
+
fileName
;
pp
.
setCreateBy
(
userId
.
intValue
()+
""
);
pp
.
setCreateBy
(
userId
.
intValue
()+
""
);
pp
.
setPicture
(
picture
);
pp
.
setPicture
(
picture
);
if
(
equipment
.
getCreateDate
()
==
null
)
{
if
(
equipment
.
getCreateDate
()
==
null
)
{
Optional
<
Equipment
>
date
=
iEquipmentDao
.
findById
(
equipment
.
getId
());
Optional
<
Equipment
>
date
=
iEquipmentDao
.
findById
(
equipment
.
getId
());
Equipment
equipment2
=
null
;
Equipment
equipment2
=
null
;
if
(
date
.
isPresent
()){
if
(
date
.
isPresent
()){
equipment2
=
date
.
get
();
equipment2
=
date
.
get
();
}
}
equipment
.
setCreateDate
(
equipment2
.
getCreateDate
());
equipment
.
setCreateDate
(
equipment2
.
getCreateDate
());
}
}
preplanPictureDao
.
saveAndFlush
(
pp
);
preplanPictureDao
.
saveAndFlush
(
pp
);
equipment
=
iEquipmentDao
.
saveAndFlush
(
equipment
);
equipment
=
iEquipmentDao
.
saveAndFlush
(
equipment
);
return
equipment
;
return
equipment
;
}
}
private
String
getRootPath
()
{
private
String
getRootPath
()
{
String
localPath
=
""
;
String
localPath
=
""
;
if
(
"\\"
.
equals
(
File
.
separator
))
{
if
(
"\\"
.
equals
(
File
.
separator
))
{
localPath
+=
winImgPath
;
localPath
+=
winImgPath
;
}
else
if
(
"/"
.
equals
(
File
.
separator
))
{
}
else
if
(
"/"
.
equals
(
File
.
separator
))
{
localPath
+=
linuxImgPath
;
localPath
+=
linuxImgPath
;
}
}
return
localPath
.
trim
();
return
localPath
.
trim
();
}
}
@Override
@Override
public
Equipment
saveEquipmentAndImg
(
ImgParam
[]
imgs
,
Equipment
equipment
)
{
public
Equipment
saveEquipmentAndImg
(
ImgParam
[]
imgs
,
Equipment
equipment
)
{
// TODO Auto-generated method stub
// TODO Auto-generated method stub
if
(
imgs
==
null
||
imgs
.
length
<
1
)
{
if
(
imgs
==
null
||
imgs
.
length
<
1
)
{
equipment
=
save
(
equipment
);
equipment
=
save
(
equipment
);
if
(
equipment
.
getCreateDate
()
==
null
)
{
if
(
equipment
.
getCreateDate
()
==
null
)
{
Optional
<
Equipment
>
date
=
iEquipmentDao
.
findById
(
equipment
.
getId
());
Optional
<
Equipment
>
date
=
iEquipmentDao
.
findById
(
equipment
.
getId
());
Equipment
equipment2
=
null
;
Equipment
equipment2
=
null
;
if
(
date
.
isPresent
()){
if
(
date
.
isPresent
()){
equipment2
=
date
.
get
();
equipment2
=
date
.
get
();
}
}
equipment
.
setCreateDate
(
equipment2
.
getCreateDate
()
==
null
?
new
Date
()
:
equipment2
.
getCreateDate
());
equipment
.
setCreateDate
(
equipment2
.
getCreateDate
()
==
null
?
new
Date
()
:
equipment2
.
getCreateDate
());
}
}
}
else
{
}
else
{
equipment
=
save
(
equipment
);
equipment
=
save
(
equipment
);
if
(
equipment
.
getCreateDate
()
==
null
)
{
if
(
equipment
.
getCreateDate
()
==
null
)
{
Optional
<
Equipment
>
date
=
iEquipmentDao
.
findById
(
equipment
.
getId
());
Optional
<
Equipment
>
date
=
iEquipmentDao
.
findById
(
equipment
.
getId
());
Equipment
equipment2
=
null
;
Equipment
equipment2
=
null
;
if
(
date
.
isPresent
()){
if
(
date
.
isPresent
()){
equipment2
=
date
.
get
();
equipment2
=
date
.
get
();
}
}
equipment
.
setCreateDate
(
equipment2
.
getCreateDate
()
==
null
?
new
Date
()
:
equipment2
.
getCreateDate
());
equipment
.
setCreateDate
(
equipment2
.
getCreateDate
()
==
null
?
new
Date
()
:
equipment2
.
getCreateDate
());
}
}
Long
equipmentId
=
Long
.
valueOf
(
equipment
.
getId
());
Long
equipmentId
=
Long
.
valueOf
(
equipment
.
getId
());
for
(
int
i
=
0
;
i
<
imgs
.
length
;
i
++)
{
for
(
int
i
=
0
;
i
<
imgs
.
length
;
i
++)
{
MultipartFile
file
=
imgs
[
i
].
getFile
();
MultipartFile
file
=
imgs
[
i
].
getFile
();
if
(
null
!=
file
)
{
if
(
null
!=
file
)
{
int
type
=
imgs
[
i
].
getType
();
int
type
=
imgs
[
i
].
getType
();
PreplanPicture
pp
=
preplanPictureDao
.
selectOne
(
equipmentId
,
type
);
PreplanPicture
pp
=
preplanPictureDao
.
selectOne
(
equipmentId
,
type
);
if
(
pp
==
null
)
{
if
(
pp
==
null
)
{
pp
=
new
PreplanPicture
();
pp
=
new
PreplanPicture
();
pp
.
setEquipmentId
(
equipmentId
);
pp
.
setEquipmentId
(
equipmentId
);
pp
.
setType
(
type
);
pp
.
setType
(
type
);
pp
.
setCreateDate
(
new
Date
());
pp
.
setCreateDate
(
new
Date
());
}
}
String
path
=
FasConstant
.
UPLOAD_ROOT_PATH
+
File
.
separator
+
FasConstant
.
UPLOAD_EQUIPMENT_PATH
String
path
=
FasConstant
.
UPLOAD_ROOT_PATH
+
File
.
separator
+
FasConstant
.
UPLOAD_EQUIPMENT_PATH
+
File
.
separator
+
equipment
.
getId
();
+
File
.
separator
+
equipment
.
getId
();
String
filePath
=
getRootPath
()
+
path
;
String
filePath
=
getRootPath
()
+
path
;
String
fileType
=
file
.
getOriginalFilename
().
substring
(
file
.
getOriginalFilename
().
lastIndexOf
(
"."
),
String
fileType
=
file
.
getOriginalFilename
().
substring
(
file
.
getOriginalFilename
().
lastIndexOf
(
"."
),
file
.
getOriginalFilename
().
length
());
file
.
getOriginalFilename
().
length
());
String
fileName
=
File
.
separator
+
type
+
fileType
;
String
fileName
=
File
.
separator
+
type
+
fileType
;
try
{
try
{
File
dest
=
new
File
(
filePath
+
File
.
separator
+
fileName
);
File
dest
=
new
File
(
filePath
+
File
.
separator
+
fileName
);
if
(!
dest
.
exists
())
{
if
(!
dest
.
exists
())
{
if
(
dest
.
getParentFile
()
!=
null
&&
!
dest
.
getParentFile
().
exists
())
{
if
(
dest
.
getParentFile
()
!=
null
&&
!
dest
.
getParentFile
().
exists
())
{
dest
.
getParentFile
().
mkdirs
();
dest
.
getParentFile
().
mkdirs
();
}
}
dest
.
createNewFile
();
dest
.
createNewFile
();
}
}
file
.
transferTo
(
dest
);
file
.
transferTo
(
dest
);
}
catch
(
IOException
e
)
{
}
catch
(
IOException
e
)
{
log
.
error
(
e
.
getMessage
(),
e
);
log
.
error
(
e
.
getMessage
(),
e
);
throw
new
YeeException
(
"上传图片失败"
);
throw
new
YeeException
(
"上传图片失败"
);
}
}
String
picture
=
path
+
fileName
;
String
picture
=
path
+
fileName
;
pp
.
setPicture
(
picture
);
pp
.
setPicture
(
picture
);
preplanPictureDao
.
saveAndFlush
(
pp
);
preplanPictureDao
.
saveAndFlush
(
pp
);
}
}
}
}
equipment
=
iEquipmentDao
.
saveAndFlush
(
equipment
);
equipment
=
iEquipmentDao
.
saveAndFlush
(
equipment
);
}
}
return
equipment
;
return
equipment
;
}
}
@Override
@Override
public
List
<
Map
<
String
,
Object
>>
findEquipVideoList
()
{
public
List
<
Map
<
String
,
Object
>>
findEquipVideoList
()
{
List
<
Map
<
String
,
Object
>>
list
=
impAndFireEquipMapper
.
findEquipVideo
();
List
<
Map
<
String
,
Object
>>
list
=
impAndFireEquipMapper
.
findEquipVideo
();
Map
<
String
,
Map
<
String
,
Object
>>
tempEquip
=
new
HashMap
<
String
,
Map
<
String
,
Object
>>();
Map
<
String
,
Map
<
String
,
Object
>>
tempEquip
=
new
HashMap
<
String
,
Map
<
String
,
Object
>>();
List
<
Map
<
String
,
Object
>>
result
=
new
ArrayList
<
Map
<
String
,
Object
>>();
List
<
Map
<
String
,
Object
>>
result
=
new
ArrayList
<
Map
<
String
,
Object
>>();
for
(
Map
<
String
,
Object
>
temp
:
list
)
{
for
(
Map
<
String
,
Object
>
temp
:
list
)
{
Map
<
String
,
Object
>
equip
=
new
HashMap
<
String
,
Object
>();
Map
<
String
,
Object
>
equip
=
new
HashMap
<
String
,
Object
>();
Map
<
String
,
Object
>
video
=
new
HashMap
<
String
,
Object
>();
Map
<
String
,
Object
>
video
=
new
HashMap
<
String
,
Object
>();
video
.
put
(
"id"
,
temp
.
get
(
"id"
));
video
.
put
(
"id"
,
temp
.
get
(
"id"
));
video
.
put
(
"code"
,
temp
.
get
(
"code"
));
video
.
put
(
"code"
,
temp
.
get
(
"code"
));
video
.
put
(
"name"
,
temp
.
get
(
"name"
));
video
.
put
(
"name"
,
temp
.
get
(
"name"
));
video
.
put
(
"videoUrl"
,
temp
.
get
(
"url"
));
video
.
put
(
"videoUrl"
,
temp
.
get
(
"url"
));
video
.
put
(
"equipName"
,
temp
.
get
(
"equipName"
));
video
.
put
(
"equipName"
,
temp
.
get
(
"equipName"
));
video
.
put
(
"monitorTime"
,
new
Date
());
video
.
put
(
"monitorTime"
,
new
Date
());
List
<
Map
<
String
,
Object
>>
videoList
=
new
ArrayList
<
Map
<
String
,
Object
>>();
List
<
Map
<
String
,
Object
>>
videoList
=
new
ArrayList
<
Map
<
String
,
Object
>>();
if
(
tempEquip
.
containsKey
(
temp
.
get
(
"equipId"
).
toString
()))
{
if
(
tempEquip
.
containsKey
(
temp
.
get
(
"equipId"
).
toString
()))
{
equip
=
tempEquip
.
get
(
temp
.
get
(
"equipId"
).
toString
());
equip
=
tempEquip
.
get
(
temp
.
get
(
"equipId"
).
toString
());
videoList
=
(
List
<
Map
<
String
,
Object
>>)
equip
.
get
(
"children"
);
videoList
=
(
List
<
Map
<
String
,
Object
>>)
equip
.
get
(
"children"
);
videoList
.
add
(
video
);
videoList
.
add
(
video
);
}
else
{
}
else
{
equip
.
put
(
"equipId"
,
temp
.
get
(
"equipId"
));
equip
.
put
(
"equipId"
,
temp
.
get
(
"equipId"
));
equip
.
put
(
"equipName"
,
temp
.
get
(
"equipName"
));
equip
.
put
(
"equipName"
,
temp
.
get
(
"equipName"
));
equip
.
put
(
"equipCode"
,
temp
.
get
(
"equipCode"
));
equip
.
put
(
"equipCode"
,
temp
.
get
(
"equipCode"
));
videoList
.
add
(
video
);
videoList
.
add
(
video
);
equip
.
put
(
"children"
,
videoList
);
equip
.
put
(
"children"
,
videoList
);
tempEquip
.
put
(
temp
.
get
(
"equipId"
).
toString
(),
equip
);
tempEquip
.
put
(
temp
.
get
(
"equipId"
).
toString
(),
equip
);
result
.
add
(
equip
);
result
.
add
(
equip
);
}
}
}
}
return
result
;
return
result
;
}
}
@Override
@Override
public
EquipDetailsResponse
findEquipDetailsById
(
String
toke
,
String
product
,
String
appKey
,
Long
id
)
{
public
EquipDetailsResponse
findEquipDetailsById
(
String
toke
,
String
product
,
String
appKey
,
Long
id
)
{
EquipDetailsResponse
equipDetailsResponse
=
fireEquipMapper
.
findEquipDetailsById
(
id
);
EquipDetailsResponse
equipDetailsResponse
=
fireEquipMapper
.
findEquipDetailsById
(
id
);
AgencyUserModel
user
=
remoteSecurityService
.
getUserById
(
toke
,
product
,
appKey
,
equipDetailsResponse
.
getUserId
());
AgencyUserModel
user
=
remoteSecurityService
.
getUserById
(
toke
,
product
,
appKey
,
equipDetailsResponse
.
getUserId
());
equipDetailsResponse
.
setUsername
(
user
.
getRealName
());
equipDetailsResponse
.
setUsername
(
user
.
getRealName
());
equipDetailsResponse
.
setTel
(
user
.
getMobile
());
equipDetailsResponse
.
setTel
(
user
.
getMobile
());
if
(
user
.
getCompanys
().
get
(
0
)!=
null
)
if
(
user
.
getCompanys
().
get
(
0
)!=
null
)
{
{
CompanyModel
companyModel
=
user
.
getCompanys
().
get
(
0
);
CompanyModel
companyModel
=
user
.
getCompanys
().
get
(
0
);
if
(
user
.
getCompanyDepartments
().
get
(
companyModel
.
getSequenceNbr
())!=
null
)
if
(
user
.
getCompanyDepartments
().
get
(
companyModel
.
getSequenceNbr
())!=
null
)
{
{
List
<
DepartmentModel
>
departList
=
user
.
getCompanyDepartments
().
get
(
companyModel
.
getSequenceNbr
());
List
<
DepartmentModel
>
departList
=
user
.
getCompanyDepartments
().
get
(
companyModel
.
getSequenceNbr
());
if
(!
departList
.
isEmpty
())
if
(!
departList
.
isEmpty
())
{
{
equipDetailsResponse
.
setDepName
(
departList
.
get
(
0
).
getDepartmentName
());
equipDetailsResponse
.
setDepName
(
departList
.
get
(
0
).
getDepartmentName
());
}
}
}
}
}
}
return
equipDetailsResponse
;
return
equipDetailsResponse
;
}
}
@Override
@Override
public
List
<
Equipment
>
findAll
()
{
public
List
<
Equipment
>
findAll
()
{
return
iEquipmentDao
.
findAll
();
return
iEquipmentDao
.
findAll
();
}
}
@Override
@Override
public
EquipCommunicationData
findFireEquipmentByPointCode
(
String
code
)
{
@PostConstruct
// EquipCommunicationData data = (EquipCommunicationData) redisTemplate.opsForHash().get("fireEquipData", code);
public
void
findAllEquipPointInfo
()
{
// if (ObjectUtils.isEmpty(data)) {
List
<
EquipCommunicationData
>
list
=
fireEquipMapper
.
findAllEquipPointInfo
();
EquipCommunicationData
data
=
fireEquipMapper
.
findOneByPointCode
(
code
);
if
(!
ObjectUtils
.
isEmpty
(
list
))
{
// }
HashMap
<
String
,
EquipCommunicationData
>
map
=
new
HashMap
<>();
return
data
;
list
.
forEach
(
data
->
{
}
map
.
put
(
data
.
getPointCode
(),
data
);
});
@Override
redisTemplate
.
opsForHash
().
putAll
(
"fireEquipData"
,
map
);
public
EquipCommunicationData
findFireEquipDataByPointCode
(
String
code
)
{
}
Query
query
=
new
Query
();
}
query
.
addCriteria
(
Criteria
.
where
(
"pointCode"
).
is
(
code
)).
limit
(
1
);
query
.
with
(
new
Sort
(
new
Order
(
Direction
.
DESC
,
"recDate"
)));
query
.
limit
(
1
);
@Override
List
<
EquipCommunicationData
>
data
=
mongoTemplate
.
find
(
query
,
EquipCommunicationData
.
class
);
public
EquipCommunicationData
findFireEquipmentByPointCode
(
String
code
)
{
if
(
data
.
isEmpty
())
{
// EquipCommunicationData data = (EquipCommunicationData) redisTemplate.opsForHash().get("fireEquipData", code);
return
null
;
// if (ObjectUtils.isEmpty(data)) {
}
EquipCommunicationData
data
=
fireEquipMapper
.
findOneByPointCode
(
code
);
return
data
.
get
(
0
);
// }
}
return
data
;
}
@Override
@Override
public
int
countImpEquipByIds
(
String
[]
idArray
)
{
public
EquipCommunicationData
findFireEquipDataByPointCode
(
String
code
)
{
return
equipmentFireEquipmentDao
.
countImpEquipByIds
(
idArray
);
Query
query
=
new
Query
();
}
query
.
addCriteria
(
Criteria
.
where
(
"pointCode"
).
is
(
code
)).
limit
(
1
);
query
.
with
(
new
Sort
(
new
Order
(
Direction
.
DESC
,
"recDate"
)));
query
.
limit
(
1
);
@Override
List
<
EquipCommunicationData
>
data
=
mongoTemplate
.
find
(
query
,
EquipCommunicationData
.
class
);
public
int
countFemaRelation
(
String
[]
idArray
)
{
if
(
data
.
isEmpty
())
{
return
iEquipmentDao
.
countFemaRelation
(
idArray
);
return
null
;
}
}
return
data
.
get
(
0
);
}
}
@Override
public
int
countImpEquipByIds
(
String
[]
idArray
)
{
return
equipmentFireEquipmentDao
.
countImpEquipByIds
(
idArray
);
}
@Override
public
int
countFemaRelation
(
String
[]
idArray
)
{
return
iEquipmentDao
.
countFemaRelation
(
idArray
);
}
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/intfc/IEquipmentService.java
View file @
c46de4ff
...
@@ -97,8 +97,6 @@ public interface IEquipmentService {
...
@@ -97,8 +97,6 @@ public interface IEquipmentService {
*/
*/
List
<
Equipment
>
findAll
();
List
<
Equipment
>
findAll
();
void
findAllEquipPointInfo
();
EquipCommunicationData
findFireEquipmentByPointCode
(
String
code
);
EquipCommunicationData
findFireEquipmentByPointCode
(
String
code
);
EquipCommunicationData
findFireEquipDataByPointCode
(
String
code
);
EquipCommunicationData
findFireEquipDataByPointCode
(
String
code
);
...
...
YeeAmosFireAutoSysStart/src/main/resources/db/mapper/dbTemplate_fire_equip.xml
View file @
c46de4ff
...
@@ -324,25 +324,6 @@
...
@@ -324,25 +324,6 @@
</where>
</where>
</select>
</select>
<select
id=
"findAllEquipPointInfo"
resultType=
"com.yeejoin.amos.fas.business.vo.EquipCommunicationData"
>
SELECT
p.`code` pointCode,
p.`name` pointName,
f.`name` equimentName,
f.id equimentId,
e.id fireEquipmentId,
e.`name` fireEquipmentName,
e.code fireEquipmentCode,
p.type,
d.dict_value alarmType,
p.unit
FROM
f_fire_equipment_point p
LEFT JOIN f_fire_equipment e ON e.id = p.fire_equipment_id
LEFT JOIN f_equipment_fire_equipment fe ON fe.fire_equipment_id = e.id
LEFT JOIN f_equipment f ON f.id = fe.equipment_id
LEFT JOIN f_dict d on d.id = p.alarm_type
</select>
<select
id=
"findOneByPointCode"
resultType=
"com.yeejoin.amos.fas.business.vo.EquipCommunicationData"
>
<select
id=
"findOneByPointCode"
resultType=
"com.yeejoin.amos.fas.business.vo.EquipCommunicationData"
>
SELECT
SELECT
...
...
YeeAmosFireAutoSysStart/src/main/resources/db/mapper/dbTemplate_view3d.xml
View file @
c46de4ff
...
@@ -974,7 +974,6 @@
...
@@ -974,7 +974,6 @@
fe.is_indoor as inDoor,
fe.is_indoor as inDoor,
case
case
when fe.equip_classify = 0 then CONCAT('monitorEquipment',fe.id)
when fe.equip_classify = 0 then CONCAT('monitorEquipment',fe.id)
when fe.equip_classify = 2 then CONCAT('video',fe.id)
when fe.equip_classify = 3 then CONCAT('fireEquipment',fe.id)
when fe.equip_classify = 3 then CONCAT('fireEquipment',fe.id)
end as `key`,
end as `key`,
fe.name,
fe.name,
...
@@ -1007,7 +1006,6 @@
...
@@ -1007,7 +1006,6 @@
fe.name as title,
fe.name as title,
case
case
when fe.equip_classify = 0 then 'monitorEquipment'
when fe.equip_classify = 0 then 'monitorEquipment'
when fe.equip_classify = 2 then 'video'
when fe.equip_classify = 3 then 'fireEquipment'
when fe.equip_classify = 3 then 'fireEquipment'
end as type,
end as type,
fe.org_code as orgCode,
fe.org_code as orgCode,
...
@@ -1117,6 +1115,40 @@
...
@@ -1117,6 +1115,40 @@
where rs.id is not null
where rs.id is not null
AND s.position3d != '' AND s.position3d is not null
AND s.position3d != '' AND s.position3d is not null
UNION ALL
UNION ALL
SELECT
wlv.CODE,
wlv.id,
'' AS inDoor,
CONCAT( 'video', wlv.id ) AS `key`,
wlv.NAME,
'' AS LEVEL,
'' AS levelStr,
'' AS objKey,
CONCAT(
'{"x":',
substring_index( wlv.position3d, ',', 1 ),
',"y":',
substring_index( substring_index( wlv.position3d, ',', - 2 ), ',', 1 ),
',"z":',
substring_index( wlv.position3d, ',', - 1 ),
'}'
)
as positionDTO,
'{ "x": 0, "y": 0, "z": 0 }' rotationDTO,
'{ "x": 1, "y": 1, "z": 1 }' scaleDTO,
FALSE AS `showInfo`,
wlv.NAME AS title,
'video' AS type,
wlv.org_code AS orgCode,
'' AS riskSourceId,
0 AS frequency,
FALSE AS twinkle
FROM
wl_video wlv
WHERE
wlv.position3d != ''
AND wlv.position3d IS NOT NULL
union all
select
select
w.code,
w.code,
w.id,
w.id,
...
...
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