Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
amos-boot-biz
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
项目统一框架
amos-boot-biz
Commits
c403cf5a
Commit
c403cf5a
authored
May 21, 2024
by
李秀明
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 设备平台-消防系统配置-系统分组接口开发
parent
3b807bba
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
264 additions
and
33 deletions
+264
-33
FireFightingSystemGroupEntity.java
...ipmanage/common/entity/FireFightingSystemGroupEntity.java
+1
-1
CoreEquipmentsDto.java
...join/equipmanage/common/entity/dto/CoreEquipmentsDto.java
+22
-0
FireFightingSystemGroupModalDto.java
...ge/common/entity/dto/FireFightingSystemGroupModalDto.java
+34
-0
SystemEquipmentsDto.java
...in/equipmanage/common/entity/dto/SystemEquipmentsDto.java
+24
-0
EquipCountBySystemVO.java
...in/equipmanage/common/entity/vo/EquipCountBySystemVO.java
+2
-0
FireFightingSystemController.java
.../equipmanage/controller/FireFightingSystemController.java
+30
-0
FireFightingSystemGroupController.java
...pmanage/controller/FireFightingSystemGroupController.java
+41
-20
EquipmentSpecificMapper.java
...m/yeejoin/equipmanage/mapper/EquipmentSpecificMapper.java
+2
-1
FireFightingSystemMapper.java
.../yeejoin/equipmanage/mapper/FireFightingSystemMapper.java
+2
-0
FireFightingSystemGroupService.java
...n/equipmanage/service/FireFightingSystemGroupService.java
+12
-3
IFireFightingSystemService.java
...ejoin/equipmanage/service/IFireFightingSystemService.java
+8
-0
FireFightingSystemGroupServiceImpl.java
...nage/service/impl/FireFightingSystemGroupServiceImpl.java
+0
-0
FireFightingSystemServiceImpl.java
...uipmanage/service/impl/FireFightingSystemServiceImpl.java
+25
-1
EquipmentSpecificMapper.xml
...uip/src/main/resources/mapper/EquipmentSpecificMapper.xml
+30
-6
FireFightingSystemMapper.xml
...ip/src/main/resources/mapper/FireFightingSystemMapper.xml
+31
-1
No files found.
amos-boot-module/amos-boot-module-api/amos-boot-module-equip-api/src/main/java/com/yeejoin/equipmanage/common/entity/FireFightingSystemGroupEntity.java
View file @
c403cf5a
...
...
@@ -24,7 +24,7 @@ public class FireFightingSystemGroupEntity extends BaseEntity {
private
String
groupCode
;
@ApiModelProperty
(
value
=
"展示类型:0-系统部件 1-安措"
)
private
Integer
show
Type
;
private
Integer
display
Type
;
@ApiModelProperty
(
value
=
"系统ID"
)
private
String
systemIds
;
...
...
amos-boot-module/amos-boot-module-api/amos-boot-module-equip-api/src/main/java/com/yeejoin/equipmanage/common/entity/dto/CoreEquipmentsDto.java
0 → 100644
View file @
c403cf5a
package
com
.
yeejoin
.
equipmanage
.
common
.
entity
.
dto
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.experimental.Accessors
;
@Data
@Accessors
(
chain
=
true
)
public
class
CoreEquipmentsDto
{
@ApiModelProperty
(
value
=
"装备ID"
)
private
String
id
;
@ApiModelProperty
(
value
=
"装备名称"
)
private
String
name
;
@ApiModelProperty
(
value
=
"装备排序"
)
private
Integer
sort
;
@ApiModelProperty
(
value
=
"所属类型"
)
private
Integer
type
;
}
amos-boot-module/amos-boot-module-api/amos-boot-module-equip-api/src/main/java/com/yeejoin/equipmanage/common/entity/dto/FireFightingSystemGroupModalDto.java
0 → 100644
View file @
c403cf5a
package
com
.
yeejoin
.
equipmanage
.
common
.
entity
.
dto
;
import
com.yeejoin.equipmanage.common.entity.FireFightingSystemGroupEntity
;
import
com.yeejoin.equipmanage.common.entity.publics.BaseDTO
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
lombok.experimental.Accessors
;
import
java.util.List
;
@Data
@Accessors
(
chain
=
true
)
@EqualsAndHashCode
(
callSuper
=
true
)
public
class
FireFightingSystemGroupModalDto
extends
BaseDTO
<
FireFightingSystemGroupEntity
>
{
@ApiModelProperty
(
value
=
"分组名称"
)
private
String
groupName
;
@ApiModelProperty
(
value
=
"展示类型:0-安措 1-保护区域"
)
private
Integer
displayType
;
@ApiModelProperty
(
value
=
"分组排序"
)
private
Integer
sort
;
@ApiModelProperty
(
value
=
"系统装备列表"
)
private
List
<
SystemEquipmentsDto
>
systems
;
@ApiModelProperty
(
value
=
"业务组织编码"
)
private
String
bizOrgCode
;
@ApiModelProperty
(
value
=
"业务组织名称"
)
private
String
bizOrgName
;
}
amos-boot-module/amos-boot-module-api/amos-boot-module-equip-api/src/main/java/com/yeejoin/equipmanage/common/entity/dto/SystemEquipmentsDto.java
0 → 100644
View file @
c403cf5a
package
com
.
yeejoin
.
equipmanage
.
common
.
entity
.
dto
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.experimental.Accessors
;
import
java.util.List
;
@Data
@Accessors
(
chain
=
true
)
public
class
SystemEquipmentsDto
{
@ApiModelProperty
(
value
=
"系统ID"
)
private
String
id
;
@ApiModelProperty
(
value
=
"系统名称"
)
private
String
name
;
@ApiModelProperty
(
value
=
"系统排序"
)
private
Integer
sort
;
@ApiModelProperty
(
value
=
"装备列表"
)
private
List
<
CoreEquipmentsDto
>
equipments
;
}
amos-boot-module/amos-boot-module-api/amos-boot-module-equip-api/src/main/java/com/yeejoin/equipmanage/common/entity/vo/EquipCountBySystemVO.java
View file @
c403cf5a
...
...
@@ -22,4 +22,6 @@ public class EquipCountBySystemVO {
private
Integer
equipmentNum
;
@ApiModelProperty
(
value
=
"单位"
)
private
String
unitName
;
@ApiModelProperty
(
value
=
"图标"
)
private
String
img
;
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/controller/FireFightingSystemController.java
View file @
c403cf5a
package
com
.
yeejoin
.
equipmanage
.
controller
;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.core.conditions.Wrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.google.common.collect.Lists
;
import
com.yeejoin.amos.boot.biz.common.bo.ReginParams
;
...
...
@@ -132,6 +134,16 @@ public class FireFightingSystemController extends AbstractBaseController {
return
fireFightingSystemService
.
getEquipCountBySystemId
(
systemId
);
}
@RequestMapping
(
value
=
"/getEquipCountPageBySystemId"
,
method
=
RequestMethod
.
GET
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
"根据系统id查询分组设备数量"
)
public
Page
<
EquipCountBySystemVO
>
getEquipCountPageBySystemId
(
@RequestParam
(
"systemId"
)
Long
systemId
,
@RequestParam
(
value
=
"pageNumber"
,
required
=
false
)
Integer
pageNumber
,
@RequestParam
(
value
=
"pageSize"
,
required
=
false
)
Integer
pageSize
)
{
return
fireFightingSystemService
.
getEquipCountPageBySystemId
(
systemId
,
pageNumber
,
pageSize
);
}
@RequestMapping
(
value
=
"/getOneById"
,
method
=
RequestMethod
.
GET
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
"通过id查询消防系统信息"
)
...
...
@@ -855,6 +867,24 @@ public class FireFightingSystemController extends AbstractBaseController {
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"消防系统列表查询(不分页)"
,
notes
=
"下拉使用"
)
@GetMapping
(
value
=
"/systems"
)
public
List
<
FireFightingSystemEntity
>
systems
(
@RequestParam
(
value
=
"bizOrgCode"
,
required
=
false
)
String
bizOrgCode
)
{
if
(
StringUtils
.
isEmpty
(
bizOrgCode
))
{
ReginParams
reginParams
=
getSelectedOrgInfo
();
ReginParams
.
PersonIdentity
personIdentity
=
reginParams
.
getPersonIdentity
();
if
(!
ValidationUtil
.
isEmpty
(
personIdentity
))
{
bizOrgCode
=
personIdentity
.
getBizOrgCode
();
}
}
Wrapper
<
FireFightingSystemEntity
>
wrapper
=
Wrappers
.<
FireFightingSystemEntity
>
lambdaQuery
()
.
likeRight
(
FireFightingSystemEntity:
:
getBizOrgCode
,
bizOrgCode
)
.
isNotNull
(
FireFightingSystemEntity:
:
getName
)
.
isNotNull
(
FireFightingSystemEntity:
:
getSystemType
);
return
fireFightingSystemService
.
list
(
wrapper
);
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"消防系统树和消防建筑树"
,
notes
=
"树菜单"
)
@GetMapping
(
value
=
"/getBuildingTreeAndSystemTree"
)
public
Map
<
String
,
List
>
getBuildingTreeAndSystemTree
(
RequestBaseDto
dto
)
{
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/controller/FireFightingSystemGroupController.java
View file @
c403cf5a
package
com
.
yeejoin
.
equipmanage
.
controller
;
import
com.alibaba.fastjson.JSONArray
;
import
com.baomidou.mybatisplus.core.conditions.Wrapper
;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
com.yeejoin.amos.boot.biz.common.bo.ReginParams
;
import
com.yeejoin.amos.boot.biz.common.controller.BaseController
;
import
com.yeejoin.equipmanage.common.dto.FireFightingSystemGroupDto
;
import
com.yeejoin.equipmanage.common.entity.FireFightingSystemEntity
;
import
com.yeejoin.equipmanage.common.entity.dto.FireFightingSystemGroupModalDto
;
import
com.yeejoin.equipmanage.common.utils.CommonResponseUtil
;
import
com.yeejoin.equipmanage.service.FireFightingSystemGroupService
;
import
com.yeejoin.equipmanage.service.IFireFightingSystemService
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
lombok.extern.slf4j.Slf4j
;
...
...
@@ -16,49 +21,56 @@ import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import
org.typroject.tyboot.core.restful.doc.TycloudOperation
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
java.util.Arrays
;
import
java.util.List
;
import
java.util.Objects
;
import
java.util.stream.Collectors
;
@Slf4j
@RestController
@Api
(
tags
=
"消防系统分组"
)
@RequestMapping
(
value
=
"/fire-fighting-system"
)
@RequestMapping
(
value
=
"/fire-fighting-system
-group
"
)
public
class
FireFightingSystemGroupController
extends
BaseController
{
@Autowired
private
FireFightingSystemGroupService
fireFightingSystemGroupService
;
@
PutMapping
(
value
=
"/save
"
)
@
ApiOperation
(
value
=
"消防系统列表查询(未绑定分组的系统)"
,
notes
=
"下拉使用
"
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"PUT"
,
value
=
"添加分组"
,
notes
=
"添加分组"
)
public
ResponseModel
save
(
@RequestBody
FireFightingSystemGroupDto
dto
)
{
if
(!(
Objects
.
nonNull
(
dto
.
getGroupName
())
&&
Objects
.
nonNull
(
dto
.
getShowType
())
&&
Objects
.
nonNull
(
dto
.
getSystemIds
())
&&
!
dto
.
getSystemEquipmentRelations
().
isEmpty
()))
{
return
CommonResponseUtil
.
failure
(
"非法参数"
);
@GetMapping
(
value
=
"/systems"
)
public
ResponseModel
systems
(
@RequestParam
(
value
=
"bizOrgCode"
,
required
=
false
)
String
bizOrgCode
)
{
if
(
StringUtils
.
isEmpty
(
bizOrgCode
))
{
ReginParams
reginParams
=
getSelectedOrgInfo
();
ReginParams
.
PersonIdentity
personIdentity
=
reginParams
.
getPersonIdentity
();
if
(!
ValidationUtil
.
isEmpty
(
personIdentity
))
{
bizOrgCode
=
personIdentity
.
getBizOrgCode
();
}
}
ReginParams
reginParams
=
getSelectedOrgInfo
();
dto
.
setBizOrgCode
(
reginParams
.
getCompany
().
getOrgCode
());
dto
.
setBizOrgCode
(
reginParams
.
getCompany
().
getCompanyName
());
return
CommonResponseUtil
.
success
(
fireFightingSystemGroupService
.
saveOrUpdate
(
dto
));
return
CommonResponseUtil
.
success
(
fireFightingSystemGroupService
.
selectUnboundSystems
(
bizOrgCode
));
}
@
PostMapping
(
value
=
"/update"
)
@
RequestMapping
(
value
=
"/save-or-update"
,
method
=
{
RequestMethod
.
PUT
,
RequestMethod
.
POST
}
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"P
OST"
,
value
=
"更新分组"
,
notes
=
"
更新分组"
)
public
ResponseModel
update
(
@RequestBody
FireFightingSystemGroup
Dto
dto
)
{
if
(!(
Objects
.
nonNull
(
dto
.
get
Id
())
&&
Objects
.
nonNull
(
dto
.
getGroupName
())
&&
Objects
.
nonNull
(
dto
.
getShowType
())
&&
Objects
.
nonNull
(
dto
.
getSystemIds
())
&&
!
dto
.
getSystemEquipmentRelations
().
isEmpty
(
)))
{
@ApiOperation
(
httpMethod
=
"P
UT"
,
value
=
"添加/更新分组"
,
notes
=
"添加/
更新分组"
)
public
ResponseModel
save
(
@RequestBody
FireFightingSystemGroupModal
Dto
dto
)
{
if
(!(
Objects
.
nonNull
(
dto
.
get
GroupName
())
&&
Objects
.
nonNull
(
dto
.
getDisplayType
())
&&
Objects
.
nonNull
(
dto
.
getSystems
()
)))
{
return
CommonResponseUtil
.
failure
(
"非法参数"
);
}
ReginParams
reginParams
=
getSelectedOrgInfo
();
dto
.
setBizOrgCode
(
reginParams
.
getPersonIdentity
().
getCompanyBizOrgCode
());
dto
.
setBizOrgName
(
reginParams
.
getPersonIdentity
().
getCompanyName
());
return
CommonResponseUtil
.
success
(
fireFightingSystemGroupService
.
saveOrUpdate
(
dto
));
}
@P
os
tMapping
(
value
=
"/update-group-sort"
)
@P
u
tMapping
(
value
=
"/update-group-sort"
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"P
OS
T"
,
value
=
"更新分组展示顺序"
,
notes
=
"更新分组展示顺序"
)
public
ResponseModel
updateGroupSort
(
@Request
Body
List
<
Long
>
groupIds
)
{
@ApiOperation
(
httpMethod
=
"P
U
T"
,
value
=
"更新分组展示顺序"
,
notes
=
"更新分组展示顺序"
)
public
ResponseModel
updateGroupSort
(
@Request
Param
(
"groupIds"
)
String
groupIds
)
{
if
(
Objects
.
isNull
(
groupIds
)
||
groupIds
.
isEmpty
())
{
return
CommonResponseUtil
.
failure
(
"非法参数"
);
}
fireFightingSystemGroupService
.
updateGroupSort
(
groupIds
);
List
<
Long
>
ids
=
Arrays
.
stream
(
groupIds
.
split
(
","
)).
map
(
Long:
:
valueOf
).
mapToLong
(
Long:
:
longValue
).
boxed
().
collect
(
Collectors
.
toList
());
fireFightingSystemGroupService
.
updateGroupSort
(
ids
);
return
CommonResponseUtil
.
success
();
}
...
...
@@ -78,8 +90,17 @@ public class FireFightingSystemGroupController extends BaseController {
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"查询分组列表"
,
notes
=
"查询分组列表"
)
public
ResponseModel
list
(
@RequestParam
(
required
=
false
)
String
bizOrgCode
)
{
if
(
StringUtils
.
isEmpty
(
bizOrgCode
))
{
bizOrgCode
=
getOrgCode
();
ReginParams
reginParams
=
getSelectedOrgInfo
();
bizOrgCode
=
reginParams
.
getPersonIdentity
().
getCompanyBizOrgCode
();
}
return
CommonResponseUtil
.
success
(
fireFightingSystemGroupService
.
listGroup
(
bizOrgCode
));
}
@DeleteMapping
(
value
=
"/{id}"
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"DELETE"
,
value
=
"删除分组"
,
notes
=
"删除分组"
)
public
ResponseModel
deteleGroup
(
@PathVariable
(
"id"
)
Long
id
)
{
fireFightingSystemGroupService
.
deleteGroup
(
id
);
return
CommonResponseUtil
.
success
();
}
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/mapper/EquipmentSpecificMapper.java
View file @
c403cf5a
...
...
@@ -29,7 +29,7 @@ public interface EquipmentSpecificMapper extends BaseMapper<EquipmentSpecific> {
int
getEquipmentSpeCount
(
Map
<
String
,
Object
>
map
);
List
<
Map
<
String
,
Object
>>
getEquipment
Specific
Count
(
@Param
(
"bizOrgCode"
)
String
bizOrgCode
);
List
<
Map
<
String
,
Object
>>
getEquipmentCount
(
@Param
(
"bizOrgCode"
)
String
bizOrgCode
);
IPage
<
ComplementCodeVO
>
selectEquipmentSpecific
(
Page
page
,
EquipmentSpecificDTO
equipmentSpecificDTO
);
...
...
@@ -336,4 +336,5 @@ public interface EquipmentSpecificMapper extends BaseMapper<EquipmentSpecific> {
List
<
Map
<
String
,
Object
>>
selectZJEquipmentSpecificWWXByIds
(
String
bussIds
);
Integer
selectEquipmentCountBySystemId
(
@Param
(
"systemId"
)
Long
systemId
);
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/mapper/FireFightingSystemMapper.java
View file @
c403cf5a
...
...
@@ -53,6 +53,8 @@ public interface FireFightingSystemMapper extends BaseMapper<FireFightingSystemE
*/
List
<
EquipCountBySystemVO
>
getEquipCountBySystemId
(
Long
systemId
);
Page
<
EquipCountBySystemVO
>
getEquipCountPageBySystemId
(
@Param
(
"page"
)
Page
<
Object
>
page
,
@Param
(
"systemId"
)
Long
systemId
);
/**
* 保存
*
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/FireFightingSystemGroupService.java
View file @
c403cf5a
...
...
@@ -2,19 +2,23 @@ package com.yeejoin.equipmanage.service;
import
com.alibaba.fastjson.JSONArray
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.yeejoin.equipmanage.common.dto.FireFightingSystemGroupDto
;
import
com.yeejoin.equipmanage.common.entity.FireFightingSystemGroupEntity
;
import
com.yeejoin.equipmanage.common.entity.dto.FireFightingSystemGroupModalDto
;
import
java.util.List
;
public
interface
FireFightingSystemGroupService
extends
IService
<
FireFightingSystemGroupEntity
>
{
/**
* 获取未绑定分组的系统列表
*/
JSONArray
selectUnboundSystems
(
String
bizOrgCode
);
/**
* 保存分组
*
* @param fireFightingSystemGroupDto 分组信息
* @param fireFightingSystemGroup
Modal
Dto 分组信息
*/
Boolean
saveOrUpdate
(
FireFightingSystemGroup
Dto
fireFightingSystemGroup
Dto
);
Boolean
saveOrUpdate
(
FireFightingSystemGroup
ModalDto
fireFightingSystemGroupModal
Dto
);
/**
* 更新分组排序
...
...
@@ -33,4 +37,9 @@ public interface FireFightingSystemGroupService extends IService<FireFightingSys
* @return 分组列表
*/
JSONArray
listGroup
(
String
bizOrgCode
);
/**
* 删除分组
*/
void
deleteGroup
(
Long
groupId
);
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/IFireFightingSystemService.java
View file @
c403cf5a
...
...
@@ -60,6 +60,14 @@ public interface IFireFightingSystemService extends IService<FireFightingSystemE
List
<
EquipCountBySystemVO
>
getEquipCountBySystemId
(
Long
systemId
);
/**
* 根据系统id查询分组设备数量
*
* @param systemId
* @return
*/
Page
<
EquipCountBySystemVO
>
getEquipCountPageBySystemId
(
Long
systemId
,
Integer
pageNumber
,
Integer
pageSize
);
/**
* 保存
*
* @param vo
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/impl/FireFightingSystemGroupServiceImpl.java
View file @
c403cf5a
This diff is collapsed.
Click to expand it.
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/impl/FireFightingSystemServiceImpl.java
View file @
c403cf5a
...
...
@@ -6,6 +6,7 @@ import com.alibaba.fastjson.JSONObject;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.google.common.base.Joiner
;
...
...
@@ -63,6 +64,7 @@ import java.net.NetworkInterface;
import
java.net.SocketException
;
import
java.nio.charset.StandardCharsets
;
import
java.text.SimpleDateFormat
;
import
java.time.LocalDate
;
import
java.util.*
;
import
java.util.stream.Collectors
;
import
java.util.stream.Stream
;
...
...
@@ -94,6 +96,8 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
@Autowired
EquipmentSpecificAlarmMapper
equipmentSpecificAlarmMapper
;
@Autowired
EquipmentSpecificAlarmLogMapper
equipmentSpecificAlarmLogMapper
;
@Autowired
private
SourceSceneMapper
sourceSceneMapper
;
@Value
(
"${equipment.fire.systemid}"
)
private
String
fireSystemId
;
...
...
@@ -182,6 +186,12 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
}
@Override
public
Page
<
EquipCountBySystemVO
>
getEquipCountPageBySystemId
(
Long
systemId
,
Integer
pageNumber
,
Integer
pageSize
)
{
return
this
.
baseMapper
.
getEquipCountPageBySystemId
(
new
Page
(
pageNumber
,
pageSize
),
systemId
);
}
@Override
public
List
<
EquiplistSpecificBySystemVO
>
getEquiplistBySystemId
(
Long
systemId
)
{
return
this
.
baseMapper
.
getEquiplistBySystemId
(
systemId
);
...
...
@@ -1114,7 +1124,21 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
@Override
public
List
<
AlarmDataVO
>
getSystemById
(
Long
id
)
{
return
this
.
baseMapper
.
getSystemById
(
id
);
List
<
AlarmDataVO
>
list
=
this
.
baseMapper
.
getSystemById
(
id
);
// 部件总数
Integer
equipmentCount
=
equipmentSpecificMapper
.
selectCount
(
Wrappers
.<
EquipmentSpecific
>
lambdaQuery
().
eq
(
EquipmentSpecific:
:
getSystemId
,
id
)
);
// 今日报警次数
Integer
alarmCount
=
equipmentSpecificAlarmLogMapper
.
selectCount
(
Wrappers
.<
EquipmentSpecificAlarmLog
>
lambdaQuery
()
.
like
(
EquipmentSpecificAlarmLog:
:
getSystemIds
,
id
)
.
eq
(
EquipmentSpecificAlarmLog:
:
getStatus
,
"1"
)
.
likeRight
(
EquipmentSpecificAlarmLog:
:
getCreateDate
,
LocalDate
.
now
().
toString
())
);
list
.
add
(
new
AlarmDataVO
(
"部件总数"
,
equipmentCount
+
" 个"
,
false
));
list
.
add
(
new
AlarmDataVO
(
"今日报警次数"
,
alarmCount
+
" 次"
,
false
));
return
list
;
}
@Override
...
...
amos-boot-system-equip/src/main/resources/mapper/EquipmentSpecificMapper.xml
View file @
c403cf5a
...
...
@@ -109,18 +109,21 @@
AND code like CONCAT('%',#{code},'%')
</if>
</select>
<select
id=
"getEquipment
Specific
Count"
resultType=
"Map"
>
<select
id=
"getEquipmentCount"
resultType=
"Map"
>
SELECT
we.id as id,
we.name as equipmentName,
count(1) as count
we.id AS equipmentId,
we.name AS equipmentName,
count(1) AS count,
u.name AS unit
FROM
wl_equipment_specific wesp
LEFT JOIN wl_equipment_detail wsd ON wesp.equipment_detail_id = wsd.id
LEFT JOIN wl_equipment we ON wsd.equipment_id = we.id
LEFT JOIN wl_unit u on u.id = we.unit_id
<where>
we.id IS NOT NULL
<if
test=
"bizOrgCode != null and bizOrgCode != ''"
>
AND wesp.biz_org_code
=
concat(#{bizOrgCode},'%')
AND wesp.biz_org_code
like
concat(#{bizOrgCode},'%')
</if>
</where>
GROUP BY
...
...
@@ -2898,6 +2901,26 @@
</if>
</select>
<select
id=
"selectEquipmentCountBySystemId"
resultType=
"int"
>
SELECT
es.id,
es.name,
es.biz_org_name bizOrgName,
es.code,
es.position,
ed.standard,
DATEDIFF( DATE_ADD( DATE_FORMAT( ed.production_date, '%Y-%m-%d' ), INTERVAL e.expiry_date YEAR ), CURRENT_DATE ) AS dayNum
FROM
wl_equipment_specific es
LEFT JOIN wl_equipment_detail ed ON ed.id = es.equipment_detail_id
LEFT JOIN wl_equipment e ON ed.equipment_id = e.id
LEFT JOIN wl_stock_detail sd ON sd.equipment_detail_id = ed.id
WHERE
ed.production_date IS NOT NULL
AND e.expiry_date IS NOT NULL
<if
test=
"bussIds != null and bussIds != ''"
>
And find_in_set(es.id, #{bussIds}) > 0
</if>
</select>
</mapper>
\ No newline at end of file
amos-boot-system-equip/src/main/resources/mapper/FireFightingSystemMapper.xml
View file @
c403cf5a
...
...
@@ -14,6 +14,7 @@
<result
property=
"equipmentName"
column=
"equipment_name"
></result>
<result
property=
"equipmentNum"
column=
"num"
></result>
<result
property=
"unitName"
column=
"unit_name"
></result>
<result
property=
"img"
column=
"img"
></result>
</resultMap>
<resultMap
id=
"CategoryAmountList"
type=
"com.yeejoin.equipmanage.common.entity.vo.EquipTypeImgAmountVO"
>
<result
column=
"id"
property=
"id"
></result>
...
...
@@ -98,6 +99,7 @@
det.NAME equipment_name,
count(spe.id) num,
unit.name unit_name,
wle.img,
cate.NAME AS equipmentCateGoryName
FROM
wl_equipment_specific AS spe
...
...
@@ -109,6 +111,24 @@
find_in_set(#{systemId},spe.system_id) and spe.single = true
group by wle.id
</select>
<select
id=
"getEquipCountPageBySystemId"
resultMap=
"EquipCountBySystemId"
>
SELECT
wle.id equipment_id,
det.NAME equipment_name,
count(spe.id) num,
unit.name unit_name,
wle.img,
cate.NAME AS equipmentCateGoryName
FROM
wl_equipment_specific AS spe
LEFT JOIN wl_equipment_detail AS det ON spe.equipment_detail_id = det.id
LEFT JOIN wl_equipment AS wle ON wle.id = det.equipment_id
LEFT JOIN wl_equipment_category cate ON cate.id = wle.category_id
LEFT JOIN wl_unit as unit ON wle.unit_id = unit.id
where
find_in_set(#{systemId},spe.system_id) and spe.single = true
group by wle.id
</select>
<insert
id=
"save"
>
INSERT INTO
f_fire_fighting_system
...
...
@@ -719,7 +739,17 @@
f_fire_fighting_system fffs
LEFT JOIN wl_equipment_category wlec ON fffs.system_type = wlec.id
left join wl_manufacturer_info wlmi on wlmi.id=fffs.maintenance_unit
left join wl_manufacturer_info wlmi1 on wlmi1.id=fffs.construction_unit) a where a.id=#{id} order by sort
left join wl_manufacturer_info wlmi1 on wlmi1.id=fffs.construction_unit
UNION ALL
SELECT
fffs.id,
'保护区域' AS `key`,
pro_object AS value,
false as isHref,
9 as sort
FROM
f_fire_fighting_system fffs
) a where a.id=#{id} order by sort
</select>
<select
id=
"getEquipmentAlarmBySystemIdOrSourceIdVO"
resultType=
"com.yeejoin.equipmanage.common.entity.vo.EquipmentAlarmBySystemIdOrSourceIdVO"
>
...
...
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