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
97fb9777
Commit
97fb9777
authored
Jan 12, 2022
by
suhuiguang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.装备车辆缓存修改
parent
a2bbd1eb
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
1136 additions
and
1107 deletions
+1136
-1107
CarController.java
...ava/com/yeejoin/equipmanage/controller/CarController.java
+0
-0
EquipmentCategoryController.java
...n/equipmanage/controller/EquipmentCategoryController.java
+19
-0
EquipmentDetailController.java
...oin/equipmanage/controller/EquipmentDetailController.java
+22
-13
EquipmentSpecificController.java
...n/equipmanage/controller/EquipmentSpecificController.java
+20
-1
FireFightingSystemController.java
.../equipmanage/controller/FireFightingSystemController.java
+18
-7
IndustryController.java
...om/yeejoin/equipmanage/controller/IndustryController.java
+7
-6
IFireFightingSystemService.java
...ejoin/equipmanage/service/IFireFightingSystemService.java
+4
-2
ISourceStatistics.java
...va/com/yeejoin/equipmanage/service/ISourceStatistics.java
+7
-0
ApplicationRunnerImpl.java
...ejoin/equipmanage/service/impl/ApplicationRunnerImpl.java
+9
-1
FireFightingSystemServiceImpl.java
...uipmanage/service/impl/FireFightingSystemServiceImpl.java
+1011
-1055
SourcesStatisticsImpl.java
...ejoin/equipmanage/service/impl/SourcesStatisticsImpl.java
+19
-22
No files found.
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/controller/CarController.java
View file @
97fb9777
This source diff could not be displayed because it is too large. You can
view the blob
instead.
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/controller/EquipmentCategoryController.java
View file @
97fb9777
...
@@ -10,10 +10,14 @@ import java.util.Set;
...
@@ -10,10 +10,14 @@ import java.util.Set;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletRequest
;
import
com.yeejoin.equipmanage.common.enums.SourceTypeEnum
;
import
com.yeejoin.equipmanage.common.utils.SpringUtils
;
import
com.yeejoin.equipmanage.service.ISourceStatistics
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
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.http.MediaType
;
import
org.springframework.http.MediaType
;
import
org.springframework.scheduling.annotation.Async
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestBody
;
...
@@ -73,6 +77,9 @@ public class EquipmentCategoryController extends AbstractBaseController {
...
@@ -73,6 +77,9 @@ public class EquipmentCategoryController extends AbstractBaseController {
@Autowired
@Autowired
private
RedisUtils
redisUtils
;
private
RedisUtils
redisUtils
;
@Autowired
ISourceStatistics
iSourceStatistics
;
private
static
final
String
equipmentTreeListAll
=
"equipmentTreeListAll"
;
private
static
final
String
equipmentTreeListAll
=
"equipmentTreeListAll"
;
private
static
final
String
equipmentTreeListIndustry
=
"equipmentTreeListIndustry"
;
private
static
final
String
equipmentTreeListIndustry
=
"equipmentTreeListIndustry"
;
// 装备redis缓存key前缀
// 装备redis缓存key前缀
...
@@ -90,9 +97,17 @@ public class EquipmentCategoryController extends AbstractBaseController {
...
@@ -90,9 +97,17 @@ public class EquipmentCategoryController extends AbstractBaseController {
@RequestBody
EquipmentCategory
equipmentCategory
)
{
@RequestBody
EquipmentCategory
equipmentCategory
)
{
EquipmentCategory
equipmentCategoryInstance
=
iEquipmentCategoryService
EquipmentCategory
equipmentCategoryInstance
=
iEquipmentCategoryService
.
saveEquipmentCategory
(
equipmentCategory
);
.
saveEquipmentCategory
(
equipmentCategory
);
EquipmentCategoryController
controllerProxy
=
SpringUtils
.
getBean
(
EquipmentCategoryController
.
class
);
controllerProxy
.
refreshAllCount
();
return
equipmentCategoryInstance
;
return
equipmentCategoryInstance
;
}
}
@Async
public
void
refreshAllCount
()
{
iSourceStatistics
.
initAllCategoryStatisticsData
(
SourceTypeEnum
.
EQUIPMENT
);
iSourceStatistics
.
initAllCategoryStatisticsData
(
SourceTypeEnum
.
CAR
);
}
/**
/**
* 根据id删除
* 根据id删除
*
*
...
@@ -138,6 +153,8 @@ public class EquipmentCategoryController extends AbstractBaseController {
...
@@ -138,6 +153,8 @@ public class EquipmentCategoryController extends AbstractBaseController {
if
(
removeFlag
)
{
if
(
removeFlag
)
{
// 更新缓存
// 更新缓存
SpringContextHolder
.
publishEvent
(
new
EquipmentTreeListEvent
(
this
,
idSet
,
typeSet
));
SpringContextHolder
.
publishEvent
(
new
EquipmentTreeListEvent
(
this
,
idSet
,
typeSet
));
EquipmentCategoryController
controllerProxy
=
SpringUtils
.
getBean
(
EquipmentCategoryController
.
class
);
controllerProxy
.
refreshAllCount
();
}
}
return
CommonResponseUtil
.
success
(
removeFlag
);
return
CommonResponseUtil
.
success
(
removeFlag
);
}
}
...
@@ -157,6 +174,8 @@ public class EquipmentCategoryController extends AbstractBaseController {
...
@@ -157,6 +174,8 @@ public class EquipmentCategoryController extends AbstractBaseController {
.
eq
(
"group_code"
,
equipmentCategory
.
getCode
()).
set
(
"group_name"
,
equipmentCategory
.
getName
()));
.
eq
(
"group_code"
,
equipmentCategory
.
getCode
()).
set
(
"group_name"
,
equipmentCategory
.
getName
()));
if
(
updateFlag
)
{
if
(
updateFlag
)
{
// 更新缓存
// 更新缓存
EquipmentCategoryController
controllerProxy
=
SpringUtils
.
getBean
(
EquipmentCategoryController
.
class
);
controllerProxy
.
refreshAllCount
();
SpringContextHolder
.
publishEvent
(
new
EquipmentTreeListEvent
(
this
,
equipmentCategory
));
SpringContextHolder
.
publishEvent
(
new
EquipmentTreeListEvent
(
this
,
equipmentCategory
));
}
}
return
updateFlag
;
return
updateFlag
;
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/controller/EquipmentDetailController.java
View file @
97fb9777
...
@@ -8,6 +8,7 @@ import com.yeejoin.amos.boot.biz.common.dto.OrgMenuDto;
...
@@ -8,6 +8,7 @@ import com.yeejoin.amos.boot.biz.common.dto.OrgMenuDto;
import
com.yeejoin.equipmanage.common.entity.*
;
import
com.yeejoin.equipmanage.common.entity.*
;
import
com.yeejoin.equipmanage.common.entity.vo.EquipmentDetailDownloadVO
;
import
com.yeejoin.equipmanage.common.entity.vo.EquipmentDetailDownloadVO
;
import
com.yeejoin.equipmanage.common.enums.ExcelEnums
;
import
com.yeejoin.equipmanage.common.enums.ExcelEnums
;
import
com.yeejoin.equipmanage.common.enums.SourceTypeEnum
;
import
com.yeejoin.equipmanage.common.utils.ExcelUtils
;
import
com.yeejoin.equipmanage.common.utils.ExcelUtils
;
import
com.yeejoin.equipmanage.common.utils.NameUtils
;
import
com.yeejoin.equipmanage.common.utils.NameUtils
;
import
com.yeejoin.equipmanage.common.utils.SpringUtils
;
import
com.yeejoin.equipmanage.common.utils.SpringUtils
;
...
@@ -90,6 +91,9 @@ public class EquipmentDetailController extends AbstractBaseController {
...
@@ -90,6 +91,9 @@ public class EquipmentDetailController extends AbstractBaseController {
@Autowired
@Autowired
FireFightingSystemServiceImpl
fireFightingSystemServiceImpl
;
FireFightingSystemServiceImpl
fireFightingSystemServiceImpl
;
@Autowired
ISourceStatistics
iSourceStatistics
;
/**
/**
* 新增
* 新增
*
*
...
@@ -99,7 +103,7 @@ public class EquipmentDetailController extends AbstractBaseController {
...
@@ -99,7 +103,7 @@ public class EquipmentDetailController extends AbstractBaseController {
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"新增"
,
notes
=
"新增"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"新增"
,
notes
=
"新增"
)
public
EquipmentDetail
saveEquipmentDetail
(
HttpServletRequest
request
,
@RequestBody
EquipmentDetail
equipmentDetail
)
{
public
EquipmentDetail
saveEquipmentDetail
(
HttpServletRequest
request
,
@RequestBody
EquipmentDetail
equipmentDetail
)
{
EquipmentDetail
detail
=
iEquipmentDetailService
.
saveOne
(
equipmentDetail
);
EquipmentDetail
detail
=
iEquipmentDetailService
.
saveOne
(
equipmentDetail
);
return
detail
;
return
detail
;
}
}
...
@@ -110,7 +114,6 @@ public class EquipmentDetailController extends AbstractBaseController {
...
@@ -110,7 +114,6 @@ public class EquipmentDetailController extends AbstractBaseController {
fireFightingSystemServiceImpl
.
refreshEquipmentTypeAndCount
(
bizOrgCode
);
fireFightingSystemServiceImpl
.
refreshEquipmentTypeAndCount
(
bizOrgCode
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
}
}
}
}
/**
/**
...
@@ -120,7 +123,7 @@ public class EquipmentDetailController extends AbstractBaseController {
...
@@ -120,7 +123,7 @@ public class EquipmentDetailController extends AbstractBaseController {
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"新增"
,
notes
=
"新增"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"新增"
,
notes
=
"新增"
)
public
EquipmentDate
saveEquipmentDetail
(
@RequestBody
EquipmentDate
equipmentDate
)
{
public
EquipmentDate
saveEquipmentDetail
(
@RequestBody
EquipmentDate
equipmentDate
)
{
if
(
equipmentDate
.
getEquipmentSpecific
().
getSingle
()
==
null
)
{
if
(
equipmentDate
.
getEquipmentSpecific
().
getSingle
()
==
null
)
{
throw
new
BadRequest
(
"管理方式未输入"
);
throw
new
BadRequest
(
"管理方式未输入"
);
}
}
...
@@ -222,7 +225,7 @@ public class EquipmentDetailController extends AbstractBaseController {
...
@@ -222,7 +225,7 @@ public class EquipmentDetailController extends AbstractBaseController {
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"PUT"
,
value
=
"修改"
,
notes
=
"修改"
)
@ApiOperation
(
httpMethod
=
"PUT"
,
value
=
"修改"
,
notes
=
"修改"
)
public
EquipmentDate
updateByIdEquipmentDetail
(
HttpServletRequest
request
,
@RequestBody
EquipmentDate
equipmentDate
)
{
public
EquipmentDate
updateByIdEquipmentDetail
(
HttpServletRequest
request
,
@RequestBody
EquipmentDate
equipmentDate
)
{
EquipmentSpecific
vo
=
equipmentDate
.
getEquipmentSpecific
();
EquipmentSpecific
vo
=
equipmentDate
.
getEquipmentSpecific
();
String
sysCode
=
vo
.
getCode
();
String
sysCode
=
vo
.
getCode
();
if
(
StringUtils
.
isNotEmpty
(
sysCode
)
&&
StringUtils
.
isNotEmpty
(
sysCode
.
trim
()))
{
if
(
StringUtils
.
isNotEmpty
(
sysCode
)
&&
StringUtils
.
isNotEmpty
(
sysCode
.
trim
()))
{
...
@@ -281,20 +284,20 @@ public class EquipmentDetailController extends AbstractBaseController {
...
@@ -281,20 +284,20 @@ public class EquipmentDetailController extends AbstractBaseController {
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"DELETE"
,
value
=
"根据id删除"
,
notes
=
"根据id删除"
)
@ApiOperation
(
httpMethod
=
"DELETE"
,
value
=
"根据id删除"
,
notes
=
"根据id删除"
)
public
boolean
deleteById
(
HttpServletRequest
request
,
@PathVariable
Long
id
)
{
public
boolean
deleteById
(
HttpServletRequest
request
,
@PathVariable
Long
id
)
{
boolean
falg
=
iEquipmentDetailService
.
removeOneById
(
id
);
boolean
falg
=
iEquipmentDetailService
.
removeOneById
(
id
);
if
(
falg
)
{
if
(
falg
)
{
equipmentSpecificSerivce
.
refreshStaData
();
equipmentSpecificSerivce
.
refreshStaData
();
}
}
return
falg
;
return
falg
;
}
}
@RequestMapping
(
value
=
"/updatequota"
,
method
=
RequestMethod
.
PUT
)
@RequestMapping
(
value
=
"/updatequota"
,
method
=
RequestMethod
.
PUT
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"PUT"
,
value
=
"修改"
,
notes
=
"修改"
)
@ApiOperation
(
httpMethod
=
"PUT"
,
value
=
"修改"
,
notes
=
"修改"
)
public
boolean
quotaUpdate
(
HttpServletRequest
request
,
@RequestBody
List
<
EquProperty
>
e
)
{
public
boolean
quotaUpdate
(
HttpServletRequest
request
,
@RequestBody
List
<
EquProperty
>
e
)
{
boolean
falg
=
iEquipmentDetailService
.
quotaUpdate
(
e
);
boolean
falg
=
iEquipmentDetailService
.
quotaUpdate
(
e
);
if
(
falg
)
{
if
(
falg
)
{
equipmentSpecificSerivce
.
refreshStaData
();
equipmentSpecificSerivce
.
refreshStaData
();
}
}
return
falg
;
return
falg
;
}
}
...
@@ -558,10 +561,16 @@ public class EquipmentDetailController extends AbstractBaseController {
...
@@ -558,10 +561,16 @@ public class EquipmentDetailController extends AbstractBaseController {
ExcelDto
excelDto
=
new
ExcelDto
(
excelEnums
.
getFileName
(),
excelEnums
.
getSheetName
(),
excelEnums
.
getClassUrl
(),
excelEnums
.
getType
());
ExcelDto
excelDto
=
new
ExcelDto
(
excelEnums
.
getFileName
(),
excelEnums
.
getSheetName
(),
excelEnums
.
getClassUrl
(),
excelEnums
.
getType
());
excelService
.
commonUpload
(
file
,
excelDto
,
getSelectedOrgInfo
(),
getUserInfo
());
excelService
.
commonUpload
(
file
,
excelDto
,
getSelectedOrgInfo
(),
getUserInfo
());
// return iStockService.uploadListByTemplate(equipmentDetailDownloadS, getSelectedOrgInfo(), getUserInfo());
EquipmentDetailController
controllerProxy
=
SpringUtils
.
getBean
(
EquipmentDetailController
.
class
);
controllerProxy
.
refreshAllCount
();
return
ResponseHelper
.
buildResponse
(
null
);
return
ResponseHelper
.
buildResponse
(
null
);
}
}
@Async
public
void
refreshAllCount
()
{
iSourceStatistics
.
initAllCategoryStatisticsData
(
SourceTypeEnum
.
EQUIPMENT
);
}
/**
/**
* 设备信息导入
* 设备信息导入
*
*
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/controller/EquipmentSpecificController.java
View file @
97fb9777
...
@@ -6,6 +6,8 @@ import java.util.List;
...
@@ -6,6 +6,8 @@ import java.util.List;
import
java.util.Map
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
import
com.yeejoin.equipmanage.common.utils.SpringUtils
;
import
lombok.extern.slf4j.Slf4j
;
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.scheduling.annotation.Async
;
import
org.springframework.scheduling.annotation.Async
;
...
@@ -46,6 +48,7 @@ import io.swagger.annotations.ApiOperation;
...
@@ -46,6 +48,7 @@ import io.swagger.annotations.ApiOperation;
* @date 2020/10/29 14:26
* @date 2020/10/29 14:26
* @since v2.0
* @since v2.0
*/
*/
@Slf4j
@RestController
@RestController
@Api
(
tags
=
"单个设备管理"
)
@Api
(
tags
=
"单个设备管理"
)
@RequestMapping
(
value
=
"/equipSpecific"
)
@RequestMapping
(
value
=
"/equipSpecific"
)
...
@@ -63,6 +66,9 @@ public class EquipmentSpecificController extends AbstractBaseController {
...
@@ -63,6 +66,9 @@ public class EquipmentSpecificController extends AbstractBaseController {
@Value
(
"${systemctl.sync.switch}"
)
@Value
(
"${systemctl.sync.switch}"
)
private
Boolean
syncSwitch
;
private
Boolean
syncSwitch
;
@Autowired
FireFightingSystemServiceImpl
fireFightingSystemServiceImpl
;
/**
/**
* 补码页面分页
* 补码页面分页
*
*
...
@@ -247,7 +253,20 @@ public class EquipmentSpecificController extends AbstractBaseController {
...
@@ -247,7 +253,20 @@ public class EquipmentSpecificController extends AbstractBaseController {
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"删除装备相关所有数据"
,
notes
=
"删除装备相关所有数据"
)
@ApiOperation
(
value
=
"删除装备相关所有数据"
,
notes
=
"删除装备相关所有数据"
)
public
ResponseModel
delEquipmentBySpecificId
(
@RequestParam
Long
specificId
)
{
public
ResponseModel
delEquipmentBySpecificId
(
@RequestParam
Long
specificId
)
{
return
CommonResponseUtil
.
success
(
equipmentSpecificSerivce
.
delEquipmentBySpecificId
(
specificId
));
EquipmentSpecific
equipmentSpecific
=
equipmentSpecificSerivce
.
getById
(
specificId
);
Boolean
result
=
equipmentSpecificSerivce
.
delEquipmentSpecific
(
specificId
);
// 同步刷新,不在异步,原因速度3秒左右
this
.
refreshCount
(
equipmentSpecific
.
getBizOrgCode
());
return
CommonResponseUtil
.
success
(
result
);
}
private
void
refreshCount
(
String
bizOrgCode
)
{
try
{
equipmentSpecificSerivce
.
refreshStaData
();
fireFightingSystemServiceImpl
.
refreshEquipmentTypeAndCount
(
bizOrgCode
);
}
catch
(
Exception
e
)
{
log
.
error
(
"刷新装备分类树缓存失败"
+
e
.
getMessage
());
}
}
}
/**
/**
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/controller/FireFightingSystemController.java
View file @
97fb9777
...
@@ -7,9 +7,12 @@ import java.util.List;
...
@@ -7,9 +7,12 @@ import java.util.List;
import
java.util.Map
;
import
java.util.Map
;
import
java.util.concurrent.ConcurrentHashMap
;
import
java.util.concurrent.ConcurrentHashMap
;
import
com.yeejoin.equipmanage.common.entity.*
;
import
com.yeejoin.equipmanage.common.utils.SpringUtils
;
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.http.MediaType
;
import
org.springframework.http.MediaType
;
import
org.springframework.scheduling.annotation.Async
;
import
org.springframework.web.bind.annotation.DeleteMapping
;
import
org.springframework.web.bind.annotation.DeleteMapping
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.PathVariable
;
...
@@ -33,12 +36,6 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
...
@@ -33,12 +36,6 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import
com.yeejoin.amos.boot.biz.common.bo.ReginParams
;
import
com.yeejoin.amos.boot.biz.common.bo.ReginParams
;
import
com.yeejoin.amos.boot.biz.common.dto.OrgMenuDto
;
import
com.yeejoin.amos.boot.biz.common.dto.OrgMenuDto
;
import
com.yeejoin.amos.feign.morphic.model.ResourceDTO
;
import
com.yeejoin.amos.feign.morphic.model.ResourceDTO
;
import
com.yeejoin.equipmanage.common.entity.EquProperty
;
import
com.yeejoin.equipmanage.common.entity.Equipment
;
import
com.yeejoin.equipmanage.common.entity.EquipmentCategory
;
import
com.yeejoin.equipmanage.common.entity.EquipmentIndex
;
import
com.yeejoin.equipmanage.common.entity.FireFightingSystemEntity
;
import
com.yeejoin.equipmanage.common.entity.ManufacturerInfo
;
import
com.yeejoin.equipmanage.common.entity.dto.EquipTypeAmountPageDTO
;
import
com.yeejoin.equipmanage.common.entity.dto.EquipTypeAmountPageDTO
;
import
com.yeejoin.equipmanage.common.entity.vo.EquipCountBySystemVO
;
import
com.yeejoin.equipmanage.common.entity.vo.EquipCountBySystemVO
;
import
com.yeejoin.equipmanage.common.entity.vo.EquipTypeImgAmountVO
;
import
com.yeejoin.equipmanage.common.entity.vo.EquipTypeImgAmountVO
;
...
@@ -170,7 +167,21 @@ public class FireFightingSystemController extends AbstractBaseController {
...
@@ -170,7 +167,21 @@ public class FireFightingSystemController extends AbstractBaseController {
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"DELETE"
,
value
=
"装备卡片删除"
)
@ApiOperation
(
httpMethod
=
"DELETE"
,
value
=
"装备卡片删除"
)
public
Boolean
delEquipmentSpecific
(
Long
id
)
{
public
Boolean
delEquipmentSpecific
(
Long
id
)
{
return
equipmentSpecificSerivce
.
delEquipmentSpecific
(
id
);
EquipmentSpecific
equipmentSpecific
=
equipmentSpecificSerivce
.
getById
(
id
);
Boolean
result
=
equipmentSpecificSerivce
.
delEquipmentSpecific
(
id
);
// 同步刷新,不在异步,原因速度3秒左右
this
.
refreshCount
(
equipmentSpecific
.
getBizOrgCode
());
return
result
;
}
private
void
refreshCount
(
String
bizOrgCode
)
{
equipmentSpecificSerivce
.
refreshStaData
();
try
{
fireFightingSystemService
.
refreshEquipmentTypeAndCount
(
bizOrgCode
);
}
catch
(
Exception
e
)
{
log
.
error
(
"刷新装备分类树缓存失败"
+
e
.
getMessage
());
}
}
}
/**
/**
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/controller/IndustryController.java
View file @
97fb9777
package
com
.
yeejoin
.
equipmanage
.
controller
;
package
com
.
yeejoin
.
equipmanage
.
controller
;
import
java.util.List
;
import
com.yeejoin.equipmanage.common.entity.Industry
;
import
com.yeejoin.equipmanage.service.IIndustryService
;
import
io.swagger.annotations.Api
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.GetMapping
;
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
org.typroject.tyboot.core.foundation.enumeration.UserType
;
import
org.typroject.tyboot.core.restful.doc.TycloudOperation
;
import
com.yeejoin.equipmanage.common.entity.Industry
;
import
java.util.List
;
import
com.yeejoin.equipmanage.service.IIndustryService
;
import
io.swagger.annotations.Api
;
@RestController
@RestController
@Api
(
tags
=
"行业分类Industry"
)
@Api
(
tags
=
"行业分类Industry"
)
...
@@ -19,6 +19,7 @@ public class IndustryController {
...
@@ -19,6 +19,7 @@ public class IndustryController {
@Autowired
@Autowired
IIndustryService
industryService
;
IIndustryService
industryService
;
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@GetMapping
(
value
=
"/list"
)
@GetMapping
(
value
=
"/list"
)
public
List
<
Industry
>
listAll
()
{
public
List
<
Industry
>
listAll
()
{
return
industryService
.
list
();
return
industryService
.
list
();
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/IFireFightingSystemService.java
View file @
97fb9777
...
@@ -222,7 +222,9 @@ public interface IFireFightingSystemService extends IService<FireFightingSystemE
...
@@ -222,7 +222,9 @@ public interface IFireFightingSystemService extends IService<FireFightingSystemE
*/
*/
Object
getCarTypeAndCount
(
String
bizOrgCode
)
throws
Exception
;
Object
getCarTypeAndCount
(
String
bizOrgCode
)
throws
Exception
;
public
Object
refreshEquipmentTypeAndCount
(
String
bizOrgCode
)
throws
Exception
;
Object
refreshEquipmentTypeAndCount
(
String
bizOrgCode
)
throws
Exception
;
public
Object
refreshCarTypeAndCount
(
String
bizOrgCode
)
throws
Exception
;
Object
refreshCarTypeAndCount
(
String
bizOrgCode
)
throws
Exception
;
}
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/ISourceStatistics.java
View file @
97fb9777
...
@@ -13,4 +13,11 @@ public interface ISourceStatistics {
...
@@ -13,4 +13,11 @@ public interface ISourceStatistics {
* @return int 数量
* @return int 数量
*/
*/
int
equipCategoryStatistics
(
String
bizOrgCode
,
SourceTypeEnum
sourceType
,
String
categoryCode
);
int
equipCategoryStatistics
(
String
bizOrgCode
,
SourceTypeEnum
sourceType
,
String
categoryCode
);
/**
* 初始化所有有分类数据(装备、车辆),bizOrgCode + "_" + sourceType.getCode() + "_" + categoryCode
* * 消防装备、消防车辆页面右侧构建分类树,统计装备和车辆数量使用
* * @param sourceType sourceType
*/
void
initAllCategoryStatisticsData
(
SourceTypeEnum
sourceType
);
}
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/impl/ApplicationRunnerImpl.java
View file @
97fb9777
...
@@ -2,8 +2,10 @@ package com.yeejoin.equipmanage.service.impl;
...
@@ -2,8 +2,10 @@ package com.yeejoin.equipmanage.service.impl;
import
com.yeejoin.amos.boot.biz.common.utils.RedisUtils
;
import
com.yeejoin.amos.boot.biz.common.utils.RedisUtils
;
import
com.yeejoin.equipmanage.common.enums.ConfigPageTopicEnum
;
import
com.yeejoin.equipmanage.common.enums.ConfigPageTopicEnum
;
import
com.yeejoin.equipmanage.common.enums.SourceTypeEnum
;
import
com.yeejoin.equipmanage.listener.IntegratePageDataListener
;
import
com.yeejoin.equipmanage.listener.IntegratePageDataListener
;
import
com.yeejoin.equipmanage.service.IMaintenanceResourceDataService
;
import
com.yeejoin.equipmanage.service.IMaintenanceResourceDataService
;
import
com.yeejoin.equipmanage.service.ISourceStatistics
;
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.boot.ApplicationArguments
;
import
org.springframework.boot.ApplicationArguments
;
...
@@ -40,14 +42,20 @@ public class ApplicationRunnerImpl implements ApplicationRunner {
...
@@ -40,14 +42,20 @@ public class ApplicationRunnerImpl implements ApplicationRunner {
@Value
(
"${redis_equip_type_count}"
)
@Value
(
"${redis_equip_type_count}"
)
private
String
equipTypeAndCount
;
private
String
equipTypeAndCount
;
@Autowired
ISourceStatistics
iSourceStatistics
;
@Override
@Override
public
void
run
(
ApplicationArguments
args
)
throws
Exception
{
public
void
run
(
ApplicationArguments
args
)
throws
Exception
{
// 清空装备分类树缓存
// 清空
单位
装备分类树缓存
redisUtils
.
getAndDeletePatternKeys
(
carTypeAndCount
+
"*"
);
redisUtils
.
getAndDeletePatternKeys
(
carTypeAndCount
+
"*"
);
// 清空车辆分类树缓存
// 清空车辆分类树缓存
redisUtils
.
getAndDeletePatternKeys
(
equipTypeAndCount
+
"*"
);
redisUtils
.
getAndDeletePatternKeys
(
equipTypeAndCount
+
"*"
);
// 清空单位分类数量统计缓存
// 清空单位分类数量统计缓存
redisUtils
.
getAndDeletePatternKeys
(
SourcesStatisticsImpl
.
PREFIX_CATEGORY_COUNT
+
"*"
);
redisUtils
.
getAndDeletePatternKeys
(
SourcesStatisticsImpl
.
PREFIX_CATEGORY_COUNT
+
"*"
);
// 刷新单位分类数量统计
iSourceStatistics
.
initAllCategoryStatisticsData
(
SourceTypeEnum
.
EQUIPMENT
);
iSourceStatistics
.
initAllCategoryStatisticsData
(
SourceTypeEnum
.
CAR
);
maintenanceResourceDataService
.
subscribeTopic
();
maintenanceResourceDataService
.
subscribeTopic
();
emqKeeper
.
getMqttClient
().
subscribe
(
ConfigPageTopicEnum
.
INTEGRATE
.
getTopic
(),
2
,
integratePageDataListener
);
emqKeeper
.
getMqttClient
().
subscribe
(
ConfigPageTopicEnum
.
INTEGRATE
.
getTopic
(),
2
,
integratePageDataListener
);
}
}
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/impl/FireFightingSystemServiceImpl.java
View file @
97fb9777
package
com
.
yeejoin
.
equipmanage
.
service
.
impl
;
package
com
.
yeejoin
.
equipmanage
.
service
.
impl
;
import
java.net.Inet4Address
;
import
java.net.InetAddress
;
import
java.net.NetworkInterface
;
import
java.net.SocketException
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.Collections
;
import
java.util.Enumeration
;
import
java.util.HashMap
;
import
java.util.HashSet
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Optional
;
import
java.util.Set
;
import
java.util.stream.Collectors
;
import
org.apache.commons.beanutils.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.context.annotation.Lazy
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.util.CollectionUtils
;
import
org.springframework.util.ObjectUtils
;
import
org.springframework.util.StringUtils
;
import
org.typroject.tyboot.core.restful.exception.instance.BadRequest
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
...
@@ -36,7 +9,6 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
...
@@ -36,7 +9,6 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.google.common.base.Joiner
;
import
com.google.common.base.Joiner
;
import
com.google.common.collect.Lists
;
import
com.google.common.collect.Lists
;
import
com.google.gson.JsonArray
;
import
com.yeejoin.amos.boot.biz.common.dto.OrgMenuDto
;
import
com.yeejoin.amos.boot.biz.common.dto.OrgMenuDto
;
import
com.yeejoin.amos.boot.biz.common.utils.RedisUtils
;
import
com.yeejoin.amos.boot.biz.common.utils.RedisUtils
;
import
com.yeejoin.amos.component.feign.model.FeignClientResult
;
import
com.yeejoin.amos.component.feign.model.FeignClientResult
;
...
@@ -49,380 +21,363 @@ import com.yeejoin.amos.feign.systemctl.Systemctl;
...
@@ -49,380 +21,363 @@ import com.yeejoin.amos.feign.systemctl.Systemctl;
import
com.yeejoin.amos.feign.systemctl.model.DictionarieValueModel
;
import
com.yeejoin.amos.feign.systemctl.model.DictionarieValueModel
;
import
com.yeejoin.equipmanage.common.datasync.entity.FireFightingSystem
;
import
com.yeejoin.equipmanage.common.datasync.entity.FireFightingSystem
;
import
com.yeejoin.equipmanage.common.dto.OrgUsrDto
;
import
com.yeejoin.equipmanage.common.dto.OrgUsrDto
;
import
com.yeejoin.equipmanage.common.entity.DynamicFormGroup
;
import
com.yeejoin.equipmanage.common.entity.*
;
import
com.yeejoin.equipmanage.common.entity.DynamicFormInstance
;
import
com.yeejoin.equipmanage.common.entity.EquipmentCategory
;
import
com.yeejoin.equipmanage.common.entity.EquipmentSpecific
;
import
com.yeejoin.equipmanage.common.entity.FireFightingSystemEntity
;
import
com.yeejoin.equipmanage.common.entity.SourceScene
;
import
com.yeejoin.equipmanage.common.entity.dto.EquipTypeAmountPageDTO
;
import
com.yeejoin.equipmanage.common.entity.dto.EquipTypeAmountPageDTO
;
import
com.yeejoin.equipmanage.common.entity.vo.EquipCountBySystemVO
;
import
com.yeejoin.equipmanage.common.entity.vo.*
;
import
com.yeejoin.equipmanage.common.entity.vo.EquipTypeImgAmountVO
;
import
com.yeejoin.equipmanage.common.enums.*
;
import
com.yeejoin.equipmanage.common.entity.vo.EquiplistSpecificBySystemVO
;
import
com.yeejoin.equipmanage.common.entity.vo.EquipmentAlarmBySystemIdOrSourceIdVO
;
import
com.yeejoin.equipmanage.common.entity.vo.PointTreeVo
;
import
com.yeejoin.equipmanage.common.enums.EquipmentRiskTypeEnum
;
import
com.yeejoin.equipmanage.common.enums.EquipmentSpeIndexEnum
;
import
com.yeejoin.equipmanage.common.enums.SourceTypeEnum
;
import
com.yeejoin.equipmanage.common.enums.SystemTypeEnum
;
import
com.yeejoin.equipmanage.common.enums.TrueOrFalseEnum
;
import
com.yeejoin.equipmanage.common.utils.StringUtil
;
import
com.yeejoin.equipmanage.common.utils.StringUtil
;
import
com.yeejoin.equipmanage.common.vo.AlarmDataVO
;
import
com.yeejoin.equipmanage.common.vo.*
;
import
com.yeejoin.equipmanage.common.vo.EquipmentManageVo
;
import
com.yeejoin.equipmanage.mapper.*
;
import
com.yeejoin.equipmanage.common.vo.FileUploadVo
;
import
com.yeejoin.equipmanage.common.vo.FireFightingSystem3dVo
;
import
com.yeejoin.equipmanage.common.vo.FireFightingSystemTreeVo
;
import
com.yeejoin.equipmanage.common.vo.FireFightingSystemTypeTreeVo
;
import
com.yeejoin.equipmanage.common.vo.FireFightingSystemVo
;
import
com.yeejoin.equipmanage.common.vo.SpeIndexVo
;
import
com.yeejoin.equipmanage.mapper.BuildingMapper
;
import
com.yeejoin.equipmanage.mapper.EquipmentManageMapper
;
import
com.yeejoin.equipmanage.mapper.FireFightingSystemMapper
;
import
com.yeejoin.equipmanage.mapper.FormInstanceMapper
;
import
com.yeejoin.equipmanage.mapper.SourceSceneMapper
;
import
com.yeejoin.equipmanage.remote.RemoteSecurityService
;
import
com.yeejoin.equipmanage.remote.RemoteSecurityService
;
import
com.yeejoin.equipmanage.service.EquipmentManageService
;
import
com.yeejoin.equipmanage.service.*
;
import
com.yeejoin.equipmanage.service.IEqDynamicFormGroupService
;
import
org.apache.commons.beanutils.BeanUtils
;
import
com.yeejoin.equipmanage.service.IEqDynamicFormInstanceService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
com.yeejoin.equipmanage.service.IEquipmentCategoryService
;
import
org.springframework.beans.factory.annotation.Value
;
import
com.yeejoin.equipmanage.service.IEquipmentSpecificSerivce
;
import
org.springframework.context.annotation.Lazy
;
import
com.yeejoin.equipmanage.service.IFireFightingSystemService
;
import
org.springframework.stereotype.Service
;
import
com.yeejoin.equipmanage.service.IRiskSourceSceneService
;
import
org.springframework.transaction.annotation.Transactional
;
import
com.yeejoin.equipmanage.service.ISourceSceneService
;
import
org.springframework.util.CollectionUtils
;
import
com.yeejoin.equipmanage.service.ISourceStatistics
;
import
org.springframework.util.ObjectUtils
;
import
com.yeejoin.equipmanage.service.ISyncDataService
;
import
org.springframework.util.StringUtils
;
import
com.yeejoin.equipmanage.service.MqttSendGateway
;
import
org.typroject.tyboot.core.restful.exception.instance.BadRequest
;
import
java.net.Inet4Address
;
import
java.net.InetAddress
;
import
java.net.NetworkInterface
;
import
java.net.SocketException
;
import
java.util.*
;
import
java.util.stream.Collectors
;
@Service
@Service
public
class
FireFightingSystemServiceImpl
extends
ServiceImpl
<
FireFightingSystemMapper
,
FireFightingSystemEntity
>
public
class
FireFightingSystemServiceImpl
extends
ServiceImpl
<
FireFightingSystemMapper
,
FireFightingSystemEntity
>
implements
IFireFightingSystemService
{
implements
IFireFightingSystemService
{
@Autowired
@Autowired
FireFightingSystemMapper
fireFightingSystemMapper
;
FireFightingSystemMapper
fireFightingSystemMapper
;
@Autowired
@Autowired
IRiskSourceSceneService
iRiskSourceSceneService
;
IRiskSourceSceneService
iRiskSourceSceneService
;
@Autowired
@Autowired
private
RemoteSecurityService
remoteSecurityService
;
private
RemoteSecurityService
remoteSecurityService
;
@Autowired
@Autowired
private
EquipmentManageMapper
equipmentManageMapper
;
private
EquipmentManageMapper
equipmentManageMapper
;
@Autowired
@Autowired
private
EquipmentManageService
equipmentManageService
;
private
EquipmentManageService
equipmentManageService
;
@Autowired
@Autowired
private
BuildingMapper
buildingMapper
;
private
BuildingMapper
buildingMapper
;
@Autowired
@Autowired
private
FormInstanceMapper
formInstanceMapper
;
private
FormInstanceMapper
formInstanceMapper
;
@Autowired
@Autowired
private
SourceSceneMapper
sourceSceneMapper
;
private
SourceSceneMapper
sourceSceneMapper
;
@Value
(
"${equipment.fire.systemid}"
)
@Value
(
"${equipment.fire.systemid}"
)
private
String
fireSystemId
;
private
String
fireSystemId
;
@Value
(
"${morphic.projectSeq}"
)
@Value
(
"${morphic.projectSeq}"
)
private
Long
projectSeq
;
private
Long
projectSeq
;
@Value
(
"${mqtt.scene.host}"
)
@Value
(
"${mqtt.scene.host}"
)
private
String
sceneUrl
;
private
String
sceneUrl
;
@Value
(
"${equip.point.equipmentdata.topic}"
)
@Value
(
"${equip.point.equipmentdata.topic}"
)
private
String
wsTopic
;
private
String
wsTopic
;
@Value
(
"${equip.point.speindex.url}"
)
@Value
(
"${equip.point.speindex.url}"
)
private
String
speindexUrl
;
private
String
speindexUrl
;
@Value
(
"${equip.point.equipmentDetail.url}"
)
@Value
(
"${equip.point.equipmentDetail.url}"
)
private
String
equipmentDetailUrl
;
private
String
equipmentDetailUrl
;
@Value
(
"${systemctl.dict.iot-core-param}"
)
@Value
(
"${systemctl.dict.iot-core-param}"
)
private
String
iotCoreParam
;
private
String
iotCoreParam
;
@Autowired
@Autowired
private
IEqDynamicFormGroupService
iEqDynamicFormGroupService
;
private
IEqDynamicFormGroupService
iEqDynamicFormGroupService
;
@Autowired
@Autowired
private
IEqDynamicFormInstanceService
instanceService
;
private
IEqDynamicFormInstanceService
instanceService
;
@Autowired
@Autowired
@Lazy
@Lazy
private
IEquipmentSpecificSerivce
equipmentSpecificSerivce
;
private
IEquipmentSpecificSerivce
equipmentSpecificSerivce
;
@Autowired
@Autowired
private
ISourceSceneService
iSourceSceneService
;
private
ISourceSceneService
iSourceSceneService
;
@Autowired
@Autowired
private
ISyncDataService
syncDataService
;
private
ISyncDataService
syncDataService
;
@Autowired
@Autowired
private
RedisUtils
redisUtils
;
private
RedisUtils
redisUtils
;
@Autowired
@Autowired
MqttSendGateway
mqttSendGateway
;
MqttSendGateway
mqttSendGateway
;
@Autowired
@Autowired
private
JCSRemoteService
jcsRemoteService
;
private
JCSRemoteService
jcsRemoteService
;
@Value
(
"${systemctl.sync.switch}"
)
@Value
(
"${systemctl.sync.switch}"
)
private
Boolean
syncSwitch
;
private
Boolean
syncSwitch
;
@Value
(
"${auth-key-fire-system:fire_system_info}"
)
@Value
(
"${auth-key-fire-system:fire_system_info}"
)
private
String
authKey
;
private
String
authKey
;
@Value
(
"${equipment.type}"
)
@Value
(
"${equipment.type}"
)
String
equipmentCategoryLeftTypeCode
;
String
equipmentCategoryLeftTypeCode
;
@Autowired
@Autowired
IEquipmentCategoryService
iEquipmentCategoryService
;
IEquipmentCategoryService
iEquipmentCategoryService
;
@Autowired
@Autowired
ISourceStatistics
sourceStatistics
;
ISourceStatistics
sourceStatistics
;
@Value
(
"${redis_car_type_count}"
)
@Value
(
"${redis_car_type_count}"
)
private
String
carTypeAndCount
;
private
String
carTypeAndCount
;
@Value
(
"${redis_equip_type_count}"
)
@Value
(
"${redis_equip_type_count}"
)
private
String
equipTypeAndCount
;
private
String
equipTypeAndCount
;
@Override
@Override
public
List
<
EquipCountBySystemVO
>
getEquipCountBySystemId
(
Long
systemId
)
{
public
List
<
EquipCountBySystemVO
>
getEquipCountBySystemId
(
Long
systemId
)
{
return
this
.
baseMapper
.
getEquipCountBySystemId
(
systemId
);
return
this
.
baseMapper
.
getEquipCountBySystemId
(
systemId
);
}
}
@Override
@Override
public
List
<
EquiplistSpecificBySystemVO
>
getEquiplistBySystemId
(
Long
systemId
)
{
public
List
<
EquiplistSpecificBySystemVO
>
getEquiplistBySystemId
(
Long
systemId
)
{
return
this
.
baseMapper
.
getEquiplistBySystemId
(
systemId
);
return
this
.
baseMapper
.
getEquiplistBySystemId
(
systemId
);
}
}
@Override
@Override
public
Map
<
String
,
Object
>
queryEquipmenInfoAndCount
(
String
equimentName
,
String
equimentCode
,
String
construction
,
public
Map
<
String
,
Object
>
queryEquipmenInfoAndCount
(
String
equimentName
,
String
equimentCode
,
String
construction
,
String
maintenance
,
String
bizOrgCode
,
String
formGroupId
,
int
current
,
int
pageSize
)
{
String
maintenance
,
String
bizOrgCode
,
String
formGroupId
,
int
current
,
int
pageSize
)
{
Map
<
String
,
Object
>
map
=
equipmentManageService
.
queryEquipmenInfoAndCount
(
equimentName
,
equimentCode
,
Map
<
String
,
Object
>
map
=
equipmentManageService
.
queryEquipmenInfoAndCount
(
equimentName
,
equimentCode
,
construction
,
maintenance
,
bizOrgCode
,
formGroupId
,
current
,
pageSize
);
construction
,
maintenance
,
bizOrgCode
,
formGroupId
,
current
,
pageSize
);
List
<
EquipmentManageVo
>
dataList
=
(
List
<
EquipmentManageVo
>)
map
.
get
(
"dataList"
);
List
<
EquipmentManageVo
>
dataList
=
(
List
<
EquipmentManageVo
>)
map
.
get
(
"dataList"
);
StringBuilder
stb
=
new
StringBuilder
();
StringBuilder
stb
=
new
StringBuilder
();
dataList
.
forEach
(
y
->
{
dataList
.
forEach
(
y
->
{
if
(
StringUtil
.
isNotEmpty
(
String
.
valueOf
(
stb
)))
{
if
(
StringUtil
.
isNotEmpty
(
String
.
valueOf
(
stb
)))
{
stb
.
append
(
","
+
y
.
getChargePerson
());
stb
.
append
(
","
+
y
.
getChargePerson
());
}
else
{
}
else
{
stb
.
append
(
y
.
getChargePerson
());
stb
.
append
(
y
.
getChargePerson
());
}
}
});
});
Map
<
String
,
String
>
userMap
=
new
HashMap
<>();
Map
<
String
,
String
>
userMap
=
new
HashMap
<>();
if
(
StringUtil
.
isNotEmpty
(
stb
))
{
if
(
StringUtil
.
isNotEmpty
(
stb
))
{
List
<
AgencyUserModel
>
agencyUserModels
=
remoteSecurityService
.
listUserByUserIds
(
stb
.
toString
());
List
<
AgencyUserModel
>
agencyUserModels
=
remoteSecurityService
.
listUserByUserIds
(
stb
.
toString
());
agencyUserModels
.
forEach
(
z
->
{
agencyUserModels
.
forEach
(
z
->
{
userMap
.
put
(
z
.
getUserId
(),
z
.
getRealName
());
userMap
.
put
(
z
.
getUserId
(),
z
.
getRealName
());
});
});
}
}
dataList
.
forEach
(
x
->
{
dataList
.
forEach
(
x
->
{
x
.
setChargePerson
(
userMap
.
get
(
x
.
getChargePerson
()));
x
.
setChargePerson
(
userMap
.
get
(
x
.
getChargePerson
()));
x
.
setSystemimg
(
equipmentManageMapper
.
getFiles
(
String
.
valueOf
(
x
.
getId
()),
"face"
));
x
.
setSystemimg
(
equipmentManageMapper
.
getFiles
(
String
.
valueOf
(
x
.
getId
()),
"face"
));
});
});
map
.
put
(
"dataList"
,
dataList
);
map
.
put
(
"dataList"
,
dataList
);
return
map
;
return
map
;
}
}
@Override
@Override
public
FireFightingSystemEntity
getOneById
(
Long
id
)
{
public
FireFightingSystemEntity
getOneById
(
Long
id
)
{
FireFightingSystemEntity
fireFightingSystemEntity
=
this
.
baseMapper
.
selectById
(
id
);
FireFightingSystemEntity
fireFightingSystemEntity
=
this
.
baseMapper
.
selectById
(
id
);
return
fireFightingSystemEntity
;
return
fireFightingSystemEntity
;
}
}
@Override
@Override
public
String
save
(
FireFightingSystemVo
vo
)
{
public
String
save
(
FireFightingSystemVo
vo
)
{
if
(!
systemCodeCheck
(
vo
))
{
if
(!
systemCodeCheck
(
vo
))
{
throw
new
BadRequest
(
"系统编号已存在,请重新输入"
);
throw
new
BadRequest
(
"系统编号已存在,请重新输入"
);
}
}
List
<
DynamicFormInstance
>
formInstance
=
vo
.
getFormInstances
();
List
<
DynamicFormInstance
>
formInstance
=
vo
.
getFormInstances
();
// 验证必填项 BUG 2725 by kongfm 2021-09-09
// 验证必填项 BUG 2725 by kongfm 2021-09-09
formInstance
.
stream
().
forEach
(
item
->
{
formInstance
.
stream
().
forEach
(
item
->
{
if
(
item
.
getNotNull
()
==
true
&&
StringUtils
.
isEmpty
(
item
.
getFieldValue
()))
{
if
(
item
.
getNotNull
()
==
true
&&
StringUtils
.
isEmpty
(
item
.
getFieldValue
()))
{
throw
new
BadRequest
(
item
.
getFieldLabel
()
+
"为必填项,请确认"
);
throw
new
BadRequest
(
item
.
getFieldLabel
()
+
"为必填项,请确认"
);
}
}
});
});
String
userId
=
remoteSecurityService
.
getAgencyUser
().
getUserId
();
String
userId
=
remoteSecurityService
.
getAgencyUser
().
getUserId
();
// 冗余名称,数据同步使用
// 冗余名称,数据同步使用
this
.
setChargePersonName
(
vo
);
this
.
setChargePersonName
(
vo
);
String
s
=
String
.
valueOf
(
System
.
currentTimeMillis
());
String
s
=
String
.
valueOf
(
System
.
currentTimeMillis
());
vo
.
setId
(
s
);
vo
.
setId
(
s
);
vo
.
setRecUserId
(
userId
);
vo
.
setRecUserId
(
userId
);
vo
.
setSort
(
s
);
vo
.
setSort
(
s
);
DynamicFormGroup
dynamicFormGroup
=
iEqDynamicFormGroupService
.
getById
(
vo
.
getFormGroupId
());
DynamicFormGroup
dynamicFormGroup
=
iEqDynamicFormGroupService
.
getById
(
vo
.
getFormGroupId
());
vo
.
setSystemType
(
dynamicFormGroup
.
getRelationId
()
!=
null
?
dynamicFormGroup
.
getRelationId
().
toString
()
:
""
);
vo
.
setSystemType
(
dynamicFormGroup
.
getRelationId
()
!=
null
?
dynamicFormGroup
.
getRelationId
().
toString
()
:
""
);
// fireSystemId 为字典表火灾系统id 以此确保第一个生成的火灾报警系统排序为1
// fireSystemId 为字典表火灾系统id 以此确保第一个生成的火灾报警系统排序为1
if
(
vo
.
getSystemType
().
equals
(
fireSystemId
))
{
if
(
vo
.
getSystemType
().
equals
(
fireSystemId
))
{
vo
.
setSort
(
"1"
);
vo
.
setSort
(
"1"
);
}
}
if
(
""
.
equals
(
vo
.
getInstallDate
()))
{
if
(
""
.
equals
(
vo
.
getInstallDate
()))
{
vo
.
setInstallDate
(
null
);
vo
.
setInstallDate
(
null
);
}
}
if
(
""
.
equals
(
vo
.
getFirstMaintenanceDate
()))
{
if
(
""
.
equals
(
vo
.
getFirstMaintenanceDate
()))
{
vo
.
setFirstMaintenanceDate
(
null
);
vo
.
setFirstMaintenanceDate
(
null
);
}
}
// 1.保存动态表单数据
// 1.保存动态表单数据
if
(
vo
.
getFormInstances
()
!=
null
&&
vo
.
getFormInstances
().
size
()
>
0
)
{
if
(
vo
.
getFormInstances
()
!=
null
&&
vo
.
getFormInstances
().
size
()
>
0
)
{
Long
instanceId
=
instanceService
.
saveInstanceBatch
(
vo
.
getFormInstances
());
Long
instanceId
=
instanceService
.
saveInstanceBatch
(
vo
.
getFormInstances
());
vo
.
setInstanceId
(
instanceId
);
vo
.
setInstanceId
(
instanceId
);
s
=
s
+
","
+
instanceId
;
s
=
s
+
","
+
instanceId
;
}
}
// 2.保存消防系统数据
// 2.保存消防系统数据
int
save
=
fireFightingSystemMapper
.
save
(
vo
);
int
save
=
fireFightingSystemMapper
.
save
(
vo
);
if
(
save
>
0
&&
syncSwitch
)
{
if
(
save
>
0
&&
syncSwitch
)
{
// AST数据同步
// AST数据同步
List
<
FireFightingSystem
>
fireFightingSystemDetail
=
getFireFightingSystemDetail
(
vo
);
List
<
FireFightingSystem
>
fireFightingSystemDetail
=
getFireFightingSystemDetail
(
vo
);
syncDataService
.
syncCreatedFireFightingSystem
(
fireFightingSystemDetail
);
syncDataService
.
syncCreatedFireFightingSystem
(
fireFightingSystemDetail
);
}
else
{
}
else
{
return
s
;
return
s
;
}
}
// 3.保存图片数据
// 3.保存图片数据
this
.
insertFiles
(
vo
);
this
.
insertFiles
(
vo
);
return
s
;
return
s
;
}
}
@Override
@Override
public
String
update
(
FireFightingSystemVo
vo
)
{
public
String
update
(
FireFightingSystemVo
vo
)
{
if
(!
systemCodeCheck
(
vo
))
{
if
(!
systemCodeCheck
(
vo
))
{
throw
new
BadRequest
(
"系统编号已存在,请重新输入"
);
throw
new
BadRequest
(
"系统编号已存在,请重新输入"
);
}
}
// 验证必填项 BUG 2725 by kongfm 2021-09-09
// 验证必填项 BUG 2725 by kongfm 2021-09-09
List
<
DynamicFormInstance
>
formInstance
=
vo
.
getFormInstances
();
List
<
DynamicFormInstance
>
formInstance
=
vo
.
getFormInstances
();
formInstance
.
stream
().
forEach
(
item
->
{
formInstance
.
stream
().
forEach
(
item
->
{
if
(
item
.
getNotNull
()
==
true
&&
StringUtils
.
isEmpty
(
item
.
getFieldValue
()))
{
if
(
item
.
getNotNull
()
==
true
&&
StringUtils
.
isEmpty
(
item
.
getFieldValue
()))
{
throw
new
BadRequest
(
item
.
getFieldLabel
()
+
"为必填项,请确认"
);
throw
new
BadRequest
(
item
.
getFieldLabel
()
+
"为必填项,请确认"
);
}
}
});
});
String
userId
=
remoteSecurityService
.
getAgencyUser
().
getUserId
();
String
userId
=
remoteSecurityService
.
getAgencyUser
().
getUserId
();
vo
.
setRecUserId
(
userId
);
vo
.
setRecUserId
(
userId
);
// 冗余名称,数据同步使用
// 冗余名称,数据同步使用
this
.
setChargePersonName
(
vo
);
this
.
setChargePersonName
(
vo
);
if
(
""
.
equals
(
vo
.
getInstallDate
()))
{
if
(
""
.
equals
(
vo
.
getInstallDate
()))
{
vo
.
setInstallDate
(
null
);
vo
.
setInstallDate
(
null
);
}
}
if
(
""
.
equals
(
vo
.
getFirstMaintenanceDate
()))
{
if
(
""
.
equals
(
vo
.
getFirstMaintenanceDate
()))
{
vo
.
setFirstMaintenanceDate
(
null
);
vo
.
setFirstMaintenanceDate
(
null
);
}
}
int
update
=
fireFightingSystemMapper
.
update
(
vo
);
int
update
=
fireFightingSystemMapper
.
update
(
vo
);
if
(
update
>
0
&&
syncSwitch
)
{
if
(
update
>
0
&&
syncSwitch
)
{
// AST数据同步
// AST数据同步
List
<
FireFightingSystem
>
fireFightingSystemDetail
=
getFireFightingSystemDetail
(
vo
);
List
<
FireFightingSystem
>
fireFightingSystemDetail
=
getFireFightingSystemDetail
(
vo
);
syncDataService
.
syncCreatedFireFightingSystem
(
fireFightingSystemDetail
);
syncDataService
.
syncCreatedFireFightingSystem
(
fireFightingSystemDetail
);
}
else
{
}
else
{
return
null
;
return
null
;
}
}
// 1.更新消防系统数据
// 1.更新消防系统数据
String
sequenceNbr
=
vo
.
getId
();
String
sequenceNbr
=
vo
.
getId
();
fireFightingSystemMapper
.
deleteFilre
(
sequenceNbr
);
fireFightingSystemMapper
.
deleteFilre
(
sequenceNbr
);
// 2.更新动态表单数据
// 2.更新动态表单数据
if
(
vo
.
getInstanceId
()
!=
null
&&
vo
.
getFormInstances
().
size
()
>
0
)
{
if
(
vo
.
getInstanceId
()
!=
null
&&
vo
.
getFormInstances
().
size
()
>
0
)
{
instanceService
.
updateInstanceBatch
(
vo
.
getInstanceId
(),
vo
.
getFormInstances
());
instanceService
.
updateInstanceBatch
(
vo
.
getInstanceId
(),
vo
.
getFormInstances
());
}
}
// 3.更新图片数据
// 3.更新图片数据
this
.
insertFiles
(
vo
);
this
.
insertFiles
(
vo
);
return
vo
.
getId
();
return
vo
.
getId
();
}
}
private
void
setChargePersonName
(
FireFightingSystemVo
vo
)
{
private
void
setChargePersonName
(
FireFightingSystemVo
vo
)
{
if
(
StringUtil
.
isNotEmpty
(
vo
.
getChargePerson
()))
{
if
(
StringUtil
.
isNotEmpty
(
vo
.
getChargePerson
()))
{
FeignClientResult
<
AgencyUserModel
>
result
=
Privilege
.
agencyUserClient
.
queryByUserId
(
vo
.
getChargePerson
());
FeignClientResult
<
AgencyUserModel
>
result
=
Privilege
.
agencyUserClient
.
queryByUserId
(
vo
.
getChargePerson
());
AgencyUserModel
userModel
=
result
==
null
?
new
AgencyUserModel
()
:
result
.
getResult
();
AgencyUserModel
userModel
=
result
==
null
?
new
AgencyUserModel
()
:
result
.
getResult
();
vo
.
setChargePersonName
(
userModel
.
getRealName
());
vo
.
setChargePersonName
(
userModel
.
getRealName
());
}
}
}
}
private
boolean
systemCodeCheck
(
FireFightingSystemVo
systemVo
)
{
private
boolean
systemCodeCheck
(
FireFightingSystemVo
systemVo
)
{
if
(
StringUtils
.
isEmpty
(
systemVo
.
getId
()))
{
if
(
StringUtils
.
isEmpty
(
systemVo
.
getId
()))
{
// 新建系统时
// 新建系统时
int
count
=
this
.
baseMapper
.
selectCount
(
new
LambdaQueryWrapper
<
FireFightingSystemEntity
>()
int
count
=
this
.
baseMapper
.
selectCount
(
new
LambdaQueryWrapper
<
FireFightingSystemEntity
>()
.
eq
(
FireFightingSystemEntity:
:
getCode
,
systemVo
.
getCode
()));
.
eq
(
FireFightingSystemEntity:
:
getCode
,
systemVo
.
getCode
()));
return
count
<
1
;
return
count
<
1
;
}
else
{
}
else
{
int
count
=
this
.
baseMapper
.
selectCount
(
new
LambdaQueryWrapper
<
FireFightingSystemEntity
>()
int
count
=
this
.
baseMapper
.
selectCount
(
new
LambdaQueryWrapper
<
FireFightingSystemEntity
>()
.
eq
(
FireFightingSystemEntity:
:
getCode
,
systemVo
.
getCode
())
.
eq
(
FireFightingSystemEntity:
:
getCode
,
systemVo
.
getCode
())
.
ne
(
FireFightingSystemEntity:
:
getId
,
systemVo
.
getId
()));
.
ne
(
FireFightingSystemEntity:
:
getId
,
systemVo
.
getId
()));
return
count
<
1
;
return
count
<
1
;
}
}
}
}
@Override
@Override
public
FireFightingSystemVo
createMorphic
(
FireFightingSystemVo
model
)
{
public
FireFightingSystemVo
createMorphic
(
FireFightingSystemVo
model
)
{
ResourceDTO
resourceDTO
=
new
ResourceDTO
();
ResourceDTO
resourceDTO
=
new
ResourceDTO
();
resourceDTO
.
setSubjectId
(
projectSeq
);
resourceDTO
.
setSubjectId
(
projectSeq
);
resourceDTO
.
setSubjectid
(
projectSeq
);
resourceDTO
.
setSubjectid
(
projectSeq
);
resourceDTO
.
setName
(
model
.
getName
());
resourceDTO
.
setName
(
model
.
getName
());
// 为首次 添加的画布添加mqtt 相关数据
// 为首次 添加的画布添加mqtt 相关数据
String
content
=
"{\"layout\":\"\",\"boardConfig\":{\"modeType\":\"custom\",\"orientation\":\"lengthways\",\"autoRefresh\":true,\"name\":\"1\",\"showMode\":\"actual\",\"paperSize\":\"1280X900\"},\"boardStyle\":{\"backgroundImage\":\"\"},\"dataConfig\":{}}"
;
String
content
=
"{\"layout\":\"\",\"boardConfig\":{\"modeType\":\"custom\",\"orientation\":\"lengthways\",\"autoRefresh\":true,\"name\":\"1\",\"showMode\":\"actual\",\"paperSize\":\"1280X900\"},\"boardStyle\":{\"backgroundImage\":\"\"},\"dataConfig\":{}}"
;
Map
parse
=
(
Map
)
JSON
.
parse
(
content
);
Map
parse
=
(
Map
)
JSON
.
parse
(
content
);
Map
<
String
,
Object
>
dataConfig
=
new
HashMap
<>();
Map
<
String
,
Object
>
dataConfig
=
new
HashMap
<>();
dataConfig
.
put
(
"msgType"
,
"mqtt"
);
dataConfig
.
put
(
"msgType"
,
"mqtt"
);
dataConfig
.
put
(
"wsUrl"
,
sceneUrl
);
dataConfig
.
put
(
"wsUrl"
,
sceneUrl
);
parse
.
put
(
"dataConfig"
,
dataConfig
);
parse
.
put
(
"dataConfig"
,
dataConfig
);
content
=
JSONObject
.
toJSONString
(
parse
);
content
=
JSONObject
.
toJSONString
(
parse
);
dataConfig
.
put
(
"wsTopic"
,
wsTopic
);
dataConfig
.
put
(
"wsTopic"
,
wsTopic
);
resourceDTO
.
setContent
(
content
);
resourceDTO
.
setContent
(
content
);
ResourceDTO
morphic
=
Morphic
.
morphicSubjectClient
.
create
(
resourceDTO
).
getResult
();
ResourceDTO
morphic
=
Morphic
.
morphicSubjectClient
.
create
(
resourceDTO
).
getResult
();
model
.
setSceneId
(
morphic
.
getId
());
model
.
setSceneId
(
morphic
.
getId
());
// fireFightingSystemMapper.setSceneId(model);
// fireFightingSystemMapper.setSceneId(model);
return
model
;
return
model
;
}
}
@Override
@Override
@Transactional
@Transactional
public
ResourceDTO
updateMorphic
(
ResourceDTO
resourceDTO
)
{
public
ResourceDTO
updateMorphic
(
ResourceDTO
resourceDTO
)
{
try
{
try
{
// 1.更新画布信息
// 1.更新画布信息
resourceDTO
.
setSubjectId
(
projectSeq
);
resourceDTO
.
setSubjectId
(
projectSeq
);
resourceDTO
.
setSubjectid
(
projectSeq
);
resourceDTO
.
setSubjectid
(
projectSeq
);
String
content
=
resourceDTO
.
getContent
();
String
content
=
resourceDTO
.
getContent
();
Map
parse
=
(
Map
)
JSON
.
parse
(
content
);
Map
parse
=
(
Map
)
JSON
.
parse
(
content
);
Map
<
String
,
Object
>
dataConfig
=
new
HashMap
<>();
Map
<
String
,
Object
>
dataConfig
=
new
HashMap
<>();
dataConfig
.
put
(
"msgType"
,
"mqtt"
);
dataConfig
.
put
(
"msgType"
,
"mqtt"
);
dataConfig
.
put
(
"wsUrl"
,
sceneUrl
);
dataConfig
.
put
(
"wsUrl"
,
sceneUrl
);
dataConfig
.
put
(
"wsTopic"
,
wsTopic
);
dataConfig
.
put
(
"wsTopic"
,
wsTopic
);
parse
.
put
(
"dataConfig"
,
dataConfig
);
parse
.
put
(
"dataConfig"
,
dataConfig
);
content
=
JSONObject
.
toJSONString
(
parse
);
content
=
JSONObject
.
toJSONString
(
parse
);
resourceDTO
.
setContent
(
content
);
resourceDTO
.
setContent
(
content
);
FeignUtil
.
remoteCall
(()
->
Morphic
.
morphicSubjectClient
.
update
(
resourceDTO
));
FeignUtil
.
remoteCall
(()
->
Morphic
.
morphicSubjectClient
.
update
(
resourceDTO
));
// 2.更新业务关联的画布id
// 2.更新业务关联的画布id
Long
systemId
=
Long
.
valueOf
(
resourceDTO
.
getCode
());
Long
systemId
=
Long
.
valueOf
(
resourceDTO
.
getCode
());
FireFightingSystemVo
systemVo
=
new
FireFightingSystemVo
();
FireFightingSystemVo
systemVo
=
new
FireFightingSystemVo
();
systemVo
.
setId
(
String
.
valueOf
(
systemId
));
systemVo
.
setId
(
String
.
valueOf
(
systemId
));
systemVo
.
setSceneId
(
resourceDTO
.
getId
());
systemVo
.
setSceneId
(
resourceDTO
.
getId
());
fireFightingSystemMapper
.
setSceneId
(
systemVo
);
fireFightingSystemMapper
.
setSceneId
(
systemVo
);
// 3.保存场景关联信息表
// 3.保存场景关联信息表
SourceScene
sourceScene
=
sourceSceneMapper
SourceScene
sourceScene
=
sourceSceneMapper
.
selectOne
(
new
LambdaQueryWrapper
<
SourceScene
>().
eq
(
SourceScene:
:
getSceneId
,
resourceDTO
.
getId
()));
.
selectOne
(
new
LambdaQueryWrapper
<
SourceScene
>().
eq
(
SourceScene:
:
getSceneId
,
resourceDTO
.
getId
()));
if
(
sourceScene
==
null
)
{
if
(
sourceScene
==
null
)
{
sourceScene
=
new
SourceScene
();
sourceScene
=
new
SourceScene
();
sourceScene
.
setProjectId
(
String
.
valueOf
(
projectSeq
));
sourceScene
.
setProjectId
(
String
.
valueOf
(
projectSeq
));
sourceScene
.
setSourceId
(
systemId
);
sourceScene
.
setSourceId
(
systemId
);
sourceScene
.
setSourceName
(
resourceDTO
.
getName
());
sourceScene
.
setSourceName
(
resourceDTO
.
getName
());
sourceScene
.
setSceneId
(
resourceDTO
.
getId
());
sourceScene
.
setSceneId
(
resourceDTO
.
getId
());
}
}
// TODO 获取画布下 绑定的装备点、摄像头,目前消防系统只能绑定装备,不能绑定摄像头(树未返回摄像头)
// TODO 获取画布下 绑定的装备点、摄像头,目前消防系统只能绑定装备,不能绑定摄像头(树未返回摄像头)
List
<
Map
>
children
=
(
List
<
Map
>)
parse
.
get
(
"children"
);
List
<
Map
>
children
=
(
List
<
Map
>)
parse
.
get
(
"children"
);
String
pointInScene
=
""
;
String
pointInScene
=
""
;
String
videoInScene
=
""
;
String
videoInScene
=
""
;
if
(!
CollectionUtils
.
isEmpty
(
children
))
{
if
(!
CollectionUtils
.
isEmpty
(
children
))
{
for
(
Map
<
String
,
String
>
map
:
children
)
{
for
(
Map
<
String
,
String
>
map
:
children
)
{
String
key
=
map
.
get
(
"key"
);
String
key
=
map
.
get
(
"key"
);
if
(!
""
.
equals
(
key
)
&&
"equipment"
.
equals
(
key
))
{
if
(!
""
.
equals
(
key
)
&&
"equipment"
.
equals
(
key
))
{
pointInScene
=
""
.
equals
(
pointInScene
)
?
map
.
get
(
"sequenceNbr"
)
pointInScene
=
""
.
equals
(
pointInScene
)
?
map
.
get
(
"sequenceNbr"
)
:
pointInScene
+
","
+
map
.
get
(
"sequenceNbr"
);
:
pointInScene
+
","
+
map
.
get
(
"sequenceNbr"
);
}
}
if
(!
""
.
equals
(
key
)
&&
"video"
.
equals
(
key
))
{
if
(!
""
.
equals
(
key
)
&&
"video"
.
equals
(
key
))
{
videoInScene
=
""
.
equals
(
videoInScene
)
?
map
.
get
(
"sequenceNbr"
)
videoInScene
=
""
.
equals
(
videoInScene
)
?
map
.
get
(
"sequenceNbr"
)
:
videoInScene
+
","
+
map
.
get
(
"sequenceNbr"
);
:
videoInScene
+
","
+
map
.
get
(
"sequenceNbr"
);
}
}
}
}
}
}
sourceScene
.
setPointInScene
(
pointInScene
);
sourceScene
.
setPointInScene
(
pointInScene
);
sourceScene
.
setVideoInScene
(
videoInScene
);
sourceScene
.
setVideoInScene
(
videoInScene
);
iSourceSceneService
.
saveOrUpdate
(
sourceScene
);
iSourceSceneService
.
saveOrUpdate
(
sourceScene
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
log
.
error
(
e
.
getMessage
(),
e
);
log
.
error
(
e
.
getMessage
(),
e
);
throw
new
BadRequest
(
"保存画布失败"
);
throw
new
BadRequest
(
"保存画布失败"
);
}
}
return
resourceDTO
;
return
resourceDTO
;
}
}
@Override
@Override
public
List
<
PointTreeVo
>
getPointTree
(
String
id
,
String
orgCode
)
{
public
List
<
PointTreeVo
>
getPointTree
(
String
id
,
String
orgCode
)
{
// CommonResponse se = riskModelFeign.getRiskSourceList(orgCode);
// CommonResponse se = riskModelFeign.getRiskSourceList(orgCode);
// List<Map<String, Object>> list = (List<Map<String, Object>>) se.getDataList();
// List<Map<String, Object>> list = (List<Map<String, Object>>) se.getDataList();
// List<PointTreeVo> responses = new ArrayList<>();
// List<PointTreeVo> responses = new ArrayList<>();
...
@@ -437,234 +392,234 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
...
@@ -437,234 +392,234 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
// responses.add(p);
// responses.add(p);
// });
// });
// List<PointTreeVo> regionList = responses.stream().filter(r -> "TRUE".equals(r.getIsRegion())).collect(Collectors.toList());
// List<PointTreeVo> regionList = responses.stream().filter(r -> "TRUE".equals(r.getIsRegion())).collect(Collectors.toList());
List
<
PointTreeVo
>
buildList
=
buildingMapper
.
getBuildList
(
orgCode
);
List
<
PointTreeVo
>
buildList
=
buildingMapper
.
getBuildList
(
orgCode
);
return
transferListToPointTree
(
buildList
,
id
);
return
transferListToPointTree
(
buildList
,
id
);
}
}
@Override
@Override
public
List
<
SpeIndexVo
>
getSpeIndex
(
Long
id
)
{
public
List
<
SpeIndexVo
>
getSpeIndex
(
Long
id
)
{
return
makeStatus
(
fireFightingSystemMapper
.
getSpeIndex
(
id
));
return
makeStatus
(
fireFightingSystemMapper
.
getSpeIndex
(
id
));
}
}
private
void
insertFiles
(
FireFightingSystemVo
vo
)
{
private
void
insertFiles
(
FireFightingSystemVo
vo
)
{
List
<
FileUploadVo
>
video
=
vo
.
getVideo
();
List
<
FileUploadVo
>
video
=
vo
.
getVideo
();
if
(
video
.
size
()
>
0
)
{
if
(
video
.
size
()
>
0
)
{
for
(
FileUploadVo
f
:
video
)
{
for
(
FileUploadVo
f
:
video
)
{
f
.
setId
(
String
.
valueOf
(
System
.
currentTimeMillis
()));
f
.
setId
(
String
.
valueOf
(
System
.
currentTimeMillis
()));
f
.
setUserId
(
vo
.
getRecUserId
());
f
.
setUserId
(
vo
.
getRecUserId
());
f
.
setFileType
(
"video"
);
f
.
setFileType
(
"video"
);
f
.
setObjectId
(
vo
.
getId
());
f
.
setObjectId
(
vo
.
getId
());
fireFightingSystemMapper
.
insertFile
(
f
);
fireFightingSystemMapper
.
insertFile
(
f
);
}
}
}
}
List
<
FileUploadVo
>
faceimg
=
vo
.
getFaceimg
();
List
<
FileUploadVo
>
faceimg
=
vo
.
getFaceimg
();
if
(
faceimg
.
size
()
>
0
)
{
if
(
faceimg
.
size
()
>
0
)
{
for
(
FileUploadVo
f
:
faceimg
)
{
for
(
FileUploadVo
f
:
faceimg
)
{
f
.
setId
(
String
.
valueOf
(
System
.
currentTimeMillis
()));
f
.
setId
(
String
.
valueOf
(
System
.
currentTimeMillis
()));
f
.
setUserId
(
vo
.
getRecUserId
());
f
.
setUserId
(
vo
.
getRecUserId
());
f
.
setFileType
(
"face"
);
f
.
setFileType
(
"face"
);
f
.
setObjectId
(
vo
.
getId
());
f
.
setObjectId
(
vo
.
getId
());
fireFightingSystemMapper
.
insertFile
(
f
);
fireFightingSystemMapper
.
insertFile
(
f
);
}
}
}
}
List
<
FileUploadVo
>
instruction
=
vo
.
getInstruction
();
List
<
FileUploadVo
>
instruction
=
vo
.
getInstruction
();
if
(
instruction
.
size
()
>
0
)
{
if
(
instruction
.
size
()
>
0
)
{
for
(
FileUploadVo
f
:
instruction
)
{
for
(
FileUploadVo
f
:
instruction
)
{
f
.
setId
(
String
.
valueOf
(
System
.
currentTimeMillis
()));
f
.
setId
(
String
.
valueOf
(
System
.
currentTimeMillis
()));
f
.
setUserId
(
vo
.
getRecUserId
());
f
.
setUserId
(
vo
.
getRecUserId
());
f
.
setFileType
(
"instruction"
);
f
.
setFileType
(
"instruction"
);
f
.
setObjectId
(
vo
.
getId
());
f
.
setObjectId
(
vo
.
getId
());
fireFightingSystemMapper
.
insertFile
(
f
);
fireFightingSystemMapper
.
insertFile
(
f
);
}
}
}
}
List
<
FileUploadVo
>
asser
=
vo
.
getAsser
();
List
<
FileUploadVo
>
asser
=
vo
.
getAsser
();
if
(
asser
.
size
()
>
0
)
{
if
(
asser
.
size
()
>
0
)
{
for
(
FileUploadVo
f
:
asser
)
{
for
(
FileUploadVo
f
:
asser
)
{
f
.
setId
(
String
.
valueOf
(
System
.
currentTimeMillis
()));
f
.
setId
(
String
.
valueOf
(
System
.
currentTimeMillis
()));
f
.
setUserId
(
vo
.
getRecUserId
());
f
.
setUserId
(
vo
.
getRecUserId
());
f
.
setFileType
(
"certificate"
);
f
.
setFileType
(
"certificate"
);
f
.
setObjectId
(
vo
.
getId
());
f
.
setObjectId
(
vo
.
getId
());
fireFightingSystemMapper
.
insertFile
(
f
);
fireFightingSystemMapper
.
insertFile
(
f
);
}
}
}
}
List
<
FileUploadVo
>
spotimg
=
vo
.
getSpotimg
();
List
<
FileUploadVo
>
spotimg
=
vo
.
getSpotimg
();
if
(
spotimg
.
size
()
>
0
)
{
if
(
spotimg
.
size
()
>
0
)
{
for
(
FileUploadVo
f
:
spotimg
)
{
for
(
FileUploadVo
f
:
spotimg
)
{
f
.
setId
(
String
.
valueOf
(
System
.
currentTimeMillis
()));
f
.
setId
(
String
.
valueOf
(
System
.
currentTimeMillis
()));
f
.
setUserId
(
vo
.
getRecUserId
());
f
.
setUserId
(
vo
.
getRecUserId
());
f
.
setFileType
(
"spotimg"
);
f
.
setFileType
(
"spotimg"
);
f
.
setObjectId
(
vo
.
getId
());
f
.
setObjectId
(
vo
.
getId
());
fireFightingSystemMapper
.
insertFile
(
f
);
fireFightingSystemMapper
.
insertFile
(
f
);
}
}
}
}
List
<
FileUploadVo
>
tdmod
=
vo
.
getTdmod
();
List
<
FileUploadVo
>
tdmod
=
vo
.
getTdmod
();
if
(
tdmod
.
size
()
>
0
)
{
if
(
tdmod
.
size
()
>
0
)
{
for
(
FileUploadVo
f
:
tdmod
)
{
for
(
FileUploadVo
f
:
tdmod
)
{
f
.
setId
(
String
.
valueOf
(
System
.
currentTimeMillis
()));
f
.
setId
(
String
.
valueOf
(
System
.
currentTimeMillis
()));
f
.
setUserId
(
vo
.
getRecUserId
());
f
.
setUserId
(
vo
.
getRecUserId
());
f
.
setFileType
(
"tdmod"
);
f
.
setFileType
(
"tdmod"
);
f
.
setObjectId
(
vo
.
getId
());
f
.
setObjectId
(
vo
.
getId
());
fireFightingSystemMapper
.
insertFile
(
f
);
fireFightingSystemMapper
.
insertFile
(
f
);
}
}
}
}
}
}
/**
/**
* 生成树结构
* 生成树结构
*
*
* @param allRiskSource
* @param allRiskSource
* @param id
* @param id
* @return
* @return
*/
*/
public
List
<
PointTreeVo
>
transferListToPointTree
(
List
<
PointTreeVo
>
allRiskSource
,
String
id
)
{
public
List
<
PointTreeVo
>
transferListToPointTree
(
List
<
PointTreeVo
>
allRiskSource
,
String
id
)
{
List
<
PointTreeVo
>
treeList
=
new
ArrayList
<>();
List
<
PointTreeVo
>
treeList
=
new
ArrayList
<>();
// TODO id为空,为消防建筑使用;id不为空,为点位图使用
// TODO id为空,为消防建筑使用;id不为空,为点位图使用
List
<
PointTreeVo
>
pointData
=
fireFightingSystemMapper
.
getPointData
(
id
);
List
<
PointTreeVo
>
pointData
=
fireFightingSystemMapper
.
getPointData
(
id
);
if
(!
CollectionUtils
.
isEmpty
(
pointData
))
{
if
(!
CollectionUtils
.
isEmpty
(
pointData
))
{
List
<
Long
>
idList
=
pointData
.
stream
().
map
(
PointTreeVo:
:
getSequenceNbr
).
collect
(
Collectors
.
toList
());
List
<
Long
>
idList
=
pointData
.
stream
().
map
(
PointTreeVo:
:
getSequenceNbr
).
collect
(
Collectors
.
toList
());
List
<
SpeIndexVo
>
indexVoList
=
fireFightingSystemMapper
.
getSpeIndexIn
(
idList
);
List
<
SpeIndexVo
>
indexVoList
=
fireFightingSystemMapper
.
getSpeIndexIn
(
idList
);
if
(!
CollectionUtils
.
isEmpty
(
indexVoList
))
{
if
(!
CollectionUtils
.
isEmpty
(
indexVoList
))
{
Map
<
Long
,
List
<
SpeIndexVo
>>
indexMap
=
indexVoList
.
stream
()
Map
<
Long
,
List
<
SpeIndexVo
>>
indexMap
=
indexVoList
.
stream
()
.
collect
(
Collectors
.
groupingBy
(
SpeIndexVo:
:
getEquipmentSpecificId
));
.
collect
(
Collectors
.
groupingBy
(
SpeIndexVo:
:
getEquipmentSpecificId
));
pointData
.
stream
().
forEach
(
p
->
{
pointData
.
stream
().
forEach
(
p
->
{
Map
map
=
new
HashMap
();
Map
map
=
new
HashMap
();
map
.
put
(
"imgPath"
,
p
.
getImgPath
());
map
.
put
(
"imgPath"
,
p
.
getImgPath
());
map
.
put
(
"equipCode"
,
p
.
getEquipCode
());
map
.
put
(
"equipCode"
,
p
.
getEquipCode
());
map
.
put
(
"equipSyetemId"
,
p
.
getEquipSyetemId
());
map
.
put
(
"equipSyetemId"
,
p
.
getEquipSyetemId
());
map
.
put
(
"equipTypeId"
,
p
.
getEquipId
());
map
.
put
(
"equipTypeId"
,
p
.
getEquipId
());
map
.
put
(
"speindexList"
,
makeStatus
(
indexMap
.
get
(
p
.
getSequenceNbr
())));
map
.
put
(
"speindexList"
,
makeStatus
(
indexMap
.
get
(
p
.
getSequenceNbr
())));
map
.
put
(
"speindexApi"
,
speindexUrl
+
p
.
getSequenceNbr
());
map
.
put
(
"speindexApi"
,
speindexUrl
+
p
.
getSequenceNbr
());
map
.
put
(
"detailInfoApi"
,
equipmentDetailUrl
+
p
.
getSequenceNbr
());
map
.
put
(
"detailInfoApi"
,
equipmentDetailUrl
+
p
.
getSequenceNbr
());
map
.
put
(
"detailApi"
,
equipmentDetailUrl
+
p
.
getSequenceNbr
());
map
.
put
(
"detailApi"
,
equipmentDetailUrl
+
p
.
getSequenceNbr
());
p
.
setDataConfig
(
map
);
p
.
setDataConfig
(
map
);
});
});
}
}
}
}
allRiskSource
.
addAll
(
pointData
);
allRiskSource
.
addAll
(
pointData
);
for
(
PointTreeVo
tree
:
allRiskSource
)
{
for
(
PointTreeVo
tree
:
allRiskSource
)
{
if
(
tree
.
getParentId
()
==
null
||
tree
.
getParentId
()
==
-
1
)
{
if
(
tree
.
getParentId
()
==
null
||
tree
.
getParentId
()
==
-
1
)
{
treeList
.
add
(
tree
);
treeList
.
add
(
tree
);
}
}
for
(
PointTreeVo
treeNode
:
allRiskSource
)
{
for
(
PointTreeVo
treeNode
:
allRiskSource
)
{
if
(
tree
.
getSequenceNbr
().
equals
(
treeNode
.
getParentId
()))
{
if
(
tree
.
getSequenceNbr
().
equals
(
treeNode
.
getParentId
()))
{
if
(
tree
.
getChildren
()
==
null
)
{
if
(
tree
.
getChildren
()
==
null
)
{
tree
.
setChildren
(
new
ArrayList
<>());
tree
.
setChildren
(
new
ArrayList
<>());
}
}
tree
.
getChildren
().
add
(
treeNode
);
tree
.
getChildren
().
add
(
treeNode
);
}
}
}
}
}
}
return
treeList
;
return
treeList
;
}
}
/**
/**
* 生成树结构
* 生成树结构
*
*
* @param allRiskSource
* @param allRiskSource
* @return
* @return
*/
*/
public
List
<
PointTreeVo
>
transferListTo3dPointTree
(
List
<
PointTreeVo
>
allRiskSource
)
{
public
List
<
PointTreeVo
>
transferListTo3dPointTree
(
List
<
PointTreeVo
>
allRiskSource
)
{
List
<
PointTreeVo
>
treeList
=
new
ArrayList
<>();
List
<
PointTreeVo
>
treeList
=
new
ArrayList
<>();
List
<
PointTreeVo
>
pointData
=
fireFightingSystemMapper
.
get3dPointData
();
List
<
PointTreeVo
>
pointData
=
fireFightingSystemMapper
.
get3dPointData
();
if
(!
CollectionUtils
.
isEmpty
(
pointData
))
{
if
(!
CollectionUtils
.
isEmpty
(
pointData
))
{
allRiskSource
.
addAll
(
pointData
);
allRiskSource
.
addAll
(
pointData
);
for
(
PointTreeVo
tree
:
allRiskSource
)
{
for
(
PointTreeVo
tree
:
allRiskSource
)
{
if
(
tree
.
getParentId
()
==
null
||
tree
.
getParentId
()
==
-
1
)
{
if
(
tree
.
getParentId
()
==
null
||
tree
.
getParentId
()
==
-
1
)
{
treeList
.
add
(
tree
);
treeList
.
add
(
tree
);
}
}
for
(
PointTreeVo
treeNode
:
allRiskSource
)
{
for
(
PointTreeVo
treeNode
:
allRiskSource
)
{
if
(
tree
.
getSequenceNbr
().
equals
(
treeNode
.
getParentId
()))
{
if
(
tree
.
getSequenceNbr
().
equals
(
treeNode
.
getParentId
()))
{
if
(
tree
.
getChildren
()
==
null
)
{
if
(
tree
.
getChildren
()
==
null
)
{
tree
.
setChildren
(
new
ArrayList
<>());
tree
.
setChildren
(
new
ArrayList
<>());
}
}
tree
.
getChildren
().
add
(
treeNode
);
tree
.
getChildren
().
add
(
treeNode
);
}
}
}
}
}
}
return
treeList
;
return
treeList
;
}
}
return
Lists
.
newArrayList
();
return
Lists
.
newArrayList
();
}
}
private
static
<
T
>
void
mapToBean
(
Map
<
String
,
Object
>
map
,
T
bean
)
{
private
static
<
T
>
void
mapToBean
(
Map
<
String
,
Object
>
map
,
T
bean
)
{
try
{
try
{
BeanUtils
.
populate
(
bean
,
map
);
BeanUtils
.
populate
(
bean
,
map
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
throw
new
RuntimeException
(
e
);
throw
new
RuntimeException
(
e
);
}
}
Set
<?>
set
=
new
HashSet
<>();
Set
<?>
set
=
new
HashSet
<>();
}
}
/**
/**
* 生成 性能指标数据
* 生成 性能指标数据
*
*
* @param list
* @param list
* @return
* @return
*/
*/
private
List
<
SpeIndexVo
>
makeStatus
(
List
<
SpeIndexVo
>
list
)
{
private
List
<
SpeIndexVo
>
makeStatus
(
List
<
SpeIndexVo
>
list
)
{
if
(
list
==
null
||
list
.
size
()
==
0
)
{
if
(
list
==
null
||
list
.
size
()
==
0
)
{
return
new
ArrayList
<>();
return
new
ArrayList
<>();
}
}
List
<
SpeIndexVo
>
newList
=
new
ArrayList
<>();
List
<
SpeIndexVo
>
newList
=
new
ArrayList
<>();
List
<
SpeIndexVo
>
statusList
=
new
ArrayList
<>();
List
<
SpeIndexVo
>
statusList
=
new
ArrayList
<>();
for
(
SpeIndexVo
vo
:
list
)
{
for
(
SpeIndexVo
vo
:
list
)
{
String
k
=
vo
.
getTypeCode
();
String
k
=
vo
.
getTypeCode
();
if
(
EquipmentRiskTypeEnum
.
GZ
.
getCode
().
equals
(
k
)
||
EquipmentRiskTypeEnum
.
HZGJ
.
getCode
().
equals
(
k
)
if
(
EquipmentRiskTypeEnum
.
GZ
.
getCode
().
equals
(
k
)
||
EquipmentRiskTypeEnum
.
HZGJ
.
getCode
().
equals
(
k
)
||
EquipmentRiskTypeEnum
.
YXZT
.
getCode
().
equals
(
k
)
||
EquipmentRiskTypeEnum
.
PB
.
getCode
().
equals
(
k
))
{
||
EquipmentRiskTypeEnum
.
YXZT
.
getCode
().
equals
(
k
)
||
EquipmentRiskTypeEnum
.
PB
.
getCode
().
equals
(
k
))
{
statusList
.
add
(
vo
);
statusList
.
add
(
vo
);
}
}
newList
.
add
(
vo
);
newList
.
add
(
vo
);
}
}
if
(
statusList
.
size
()
==
0
)
{
if
(
statusList
.
size
()
==
0
)
{
return
newList
;
return
newList
;
}
}
SpeIndexVo
spe
=
new
SpeIndexVo
();
SpeIndexVo
spe
=
new
SpeIndexVo
();
spe
.
setKey
(
EquipmentSpeIndexEnum
.
YXZT
.
getCode
());
spe
.
setKey
(
EquipmentSpeIndexEnum
.
YXZT
.
getCode
());
spe
.
setName
(
"当前状态"
);
spe
.
setName
(
"当前状态"
);
spe
.
setValue
(
getStatus
(
statusList
));
spe
.
setValue
(
getStatus
(
statusList
));
statusList
.
clear
();
statusList
.
clear
();
statusList
.
add
(
spe
);
statusList
.
add
(
spe
);
statusList
.
addAll
(
newList
);
statusList
.
addAll
(
newList
);
return
statusList
;
return
statusList
;
}
}
/**
/**
* 判断 装备状态
* 判断 装备状态
*
*
* @param statusList
* @param statusList
* @return
* @return
*/
*/
private
String
getStatus
(
List
<
SpeIndexVo
>
statusList
)
{
private
String
getStatus
(
List
<
SpeIndexVo
>
statusList
)
{
SpeIndexVo
indexVo
=
statusList
.
get
(
0
);
SpeIndexVo
indexVo
=
statusList
.
get
(
0
);
if
(
EquipmentRiskTypeEnum
.
HZGJ
.
getCode
().
equals
(
indexVo
.
getTypeCode
())
if
(
EquipmentRiskTypeEnum
.
HZGJ
.
getCode
().
equals
(
indexVo
.
getTypeCode
())
&&
TrueOrFalseEnum
.
real
.
value
.
equals
(
indexVo
.
getValue
()))
{
&&
TrueOrFalseEnum
.
real
.
value
.
equals
(
indexVo
.
getValue
()))
{
return
"报警"
;
return
"报警"
;
}
}
if
(
EquipmentRiskTypeEnum
.
GZ
.
getCode
().
equals
(
indexVo
.
getTypeCode
())
if
(
EquipmentRiskTypeEnum
.
GZ
.
getCode
().
equals
(
indexVo
.
getTypeCode
())
&&
TrueOrFalseEnum
.
real
.
value
.
equals
(
indexVo
.
getValue
()))
{
&&
TrueOrFalseEnum
.
real
.
value
.
equals
(
indexVo
.
getValue
()))
{
return
"故障"
;
return
"故障"
;
}
}
if
(
EquipmentRiskTypeEnum
.
PB
.
getCode
().
equals
(
indexVo
.
getTypeCode
())
if
(
EquipmentRiskTypeEnum
.
PB
.
getCode
().
equals
(
indexVo
.
getTypeCode
())
&&
TrueOrFalseEnum
.
real
.
value
.
equals
(
indexVo
.
getValue
()))
{
&&
TrueOrFalseEnum
.
real
.
value
.
equals
(
indexVo
.
getValue
()))
{
return
"屏蔽"
;
return
"屏蔽"
;
}
}
if
(
EquipmentRiskTypeEnum
.
YXZT
.
getCode
().
equals
(
indexVo
.
getTypeCode
())
if
(
EquipmentRiskTypeEnum
.
YXZT
.
getCode
().
equals
(
indexVo
.
getTypeCode
())
&&
TrueOrFalseEnum
.
fake
.
value
.
equals
(
indexVo
.
getValue
()))
{
&&
TrueOrFalseEnum
.
fake
.
value
.
equals
(
indexVo
.
getValue
()))
{
return
"停运"
;
return
"停运"
;
}
}
return
"运行"
;
return
"运行"
;
}
}
@Override
@Override
public
List
<
FireFightingSystemEntity
>
getList
()
{
public
List
<
FireFightingSystemEntity
>
getList
()
{
return
this
.
list
();
return
this
.
list
();
}
}
@Override
@Override
public
Boolean
deleteSystem
(
Long
id
)
{
public
Boolean
deleteSystem
(
Long
id
)
{
// QueryWrapper<FormInstance> fqw = new QueryWrapper<>();
// QueryWrapper<FormInstance> fqw = new QueryWrapper<>();
// fqw.eq("field_value",id);
// fqw.eq("field_value",id);
// fqw.groupBy("instance_id");
// fqw.groupBy("instance_id");
...
@@ -678,436 +633,437 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
...
@@ -678,436 +633,437 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
// String name = formInstance.getFieldValue();
// String name = formInstance.getFieldValue();
// throw new BadRequest(name+"建筑与该系统存在绑定关系,请清除后再进行删除!");
// throw new BadRequest(name+"建筑与该系统存在绑定关系,请清除后再进行删除!");
// }
// }
FireFightingSystemEntity
entity
=
baseMapper
.
selectById
(
id
);
FireFightingSystemEntity
entity
=
baseMapper
.
selectById
(
id
);
if
(
entity
.
getSceneId
()
!=
null
)
{
if
(
entity
.
getSceneId
()
!=
null
)
{
FeignUtil
.
remoteCall
(()
->
Morphic
.
morphicSubjectClient
.
delete
(
entity
.
getSceneId
()));
FeignUtil
.
remoteCall
(()
->
Morphic
.
morphicSubjectClient
.
delete
(
entity
.
getSceneId
()));
}
}
formInstanceMapper
.
clearSystemId
(
id
);
formInstanceMapper
.
clearSystemId
(
id
);
// 解除装备与消防系统关系
// 解除装备与消防系统关系
this
.
removeBondSystemId
(
id
);
this
.
removeBondSystemId
(
id
);
this
.
baseMapper
.
deleteFilre
(
String
.
valueOf
(
id
));
this
.
baseMapper
.
deleteFilre
(
String
.
valueOf
(
id
));
int
i
=
this
.
baseMapper
.
deleteById
(
id
);
int
i
=
this
.
baseMapper
.
deleteById
(
id
);
if
(
i
>
0
&&
syncSwitch
)
{
if
(
i
>
0
&&
syncSwitch
)
{
syncDataService
.
syncDeletedFireFightingSystem
(
Arrays
.
asList
(
id
));
syncDataService
.
syncDeletedFireFightingSystem
(
Arrays
.
asList
(
id
));
}
}
// 删除动态关联表单实例数据
// 删除动态关联表单实例数据
if
(
entity
.
getInstanceId
()
!=
null
)
{
if
(
entity
.
getInstanceId
()
!=
null
)
{
instanceService
.
remove
(
new
LambdaQueryWrapper
<
DynamicFormInstance
>().
eq
(
DynamicFormInstance:
:
getInstanceId
,
instanceService
.
remove
(
new
LambdaQueryWrapper
<
DynamicFormInstance
>().
eq
(
DynamicFormInstance:
:
getInstanceId
,
entity
.
getInstanceId
()));
entity
.
getInstanceId
()));
}
}
return
i
>
0
;
return
i
>
0
;
}
}
private
void
removeBondSystemId
(
Long
id
)
{
private
void
removeBondSystemId
(
Long
id
)
{
List
<
EquipmentSpecific
>
equipmentSpecifics
=
equipmentSpecificSerivce
List
<
EquipmentSpecific
>
equipmentSpecifics
=
equipmentSpecificSerivce
.
list
(
new
LambdaQueryWrapper
<
EquipmentSpecific
>().
like
(
EquipmentSpecific:
:
getSystemId
,
id
));
.
list
(
new
LambdaQueryWrapper
<
EquipmentSpecific
>().
like
(
EquipmentSpecific:
:
getSystemId
,
id
));
equipmentSpecifics
.
forEach
(
equipmentSpecific
->
{
equipmentSpecifics
.
forEach
(
equipmentSpecific
->
{
List
<
String
>
ids
=
new
ArrayList
<>();
List
<
String
>
ids
=
new
ArrayList
<>();
if
(
StringUtil
.
isNotEmpty
(
equipmentSpecific
.
getSystemId
()))
{
if
(
StringUtil
.
isNotEmpty
(
equipmentSpecific
.
getSystemId
()))
{
ids
=
Arrays
.
asList
(
equipmentSpecific
.
getSystemId
().
split
(
","
));
ids
=
Arrays
.
asList
(
equipmentSpecific
.
getSystemId
().
split
(
","
));
ids
=
new
ArrayList
<>(
ids
);
ids
=
new
ArrayList
<>(
ids
);
ids
.
remove
(
id
.
toString
());
ids
.
remove
(
id
.
toString
());
}
}
equipmentSpecific
.
setSystemId
(
Joiner
.
on
(
","
).
join
(
ids
));
equipmentSpecific
.
setSystemId
(
Joiner
.
on
(
","
).
join
(
ids
));
});
});
if
(!
equipmentSpecifics
.
isEmpty
())
{
if
(!
equipmentSpecifics
.
isEmpty
())
{
equipmentSpecificSerivce
.
saveOrUpdateBatch
(
equipmentSpecifics
);
equipmentSpecificSerivce
.
saveOrUpdateBatch
(
equipmentSpecifics
);
}
}
}
}
@Override
@Override
public
Boolean
isDeleteCanvas
(
Long
id
)
{
public
Boolean
isDeleteCanvas
(
Long
id
)
{
FireFightingSystemEntity
system
=
baseMapper
FireFightingSystemEntity
system
=
baseMapper
.
selectOne
(
new
QueryWrapper
<
FireFightingSystemEntity
>().
eq
(
"scene_id"
,
id
));
.
selectOne
(
new
QueryWrapper
<
FireFightingSystemEntity
>().
eq
(
"scene_id"
,
id
));
if
(
system
!=
null
)
{
if
(
system
!=
null
)
{
return
true
;
return
true
;
}
else
{
}
else
{
FeignUtil
.
remoteCall
(()
->
Morphic
.
morphicSubjectClient
.
delete
(
id
));
FeignUtil
.
remoteCall
(()
->
Morphic
.
morphicSubjectClient
.
delete
(
id
));
return
false
;
return
false
;
}
}
}
}
@Override
@Override
public
IPage
<
EquipTypeImgAmountVO
>
getColaCategoryAmountList
(
int
hierarchy
,
String
codeHead
,
public
IPage
<
EquipTypeImgAmountVO
>
getColaCategoryAmountList
(
int
hierarchy
,
String
codeHead
,
EquipTypeAmountPageDTO
equipTypeAmountPage
)
{
EquipTypeAmountPageDTO
equipTypeAmountPage
)
{
String
type
=
equipTypeAmountPage
.
getType
();
String
type
=
equipTypeAmountPage
.
getType
();
if
(!
""
.
equals
(
type
)
&&
"car"
.
equals
(
type
))
{
if
(!
""
.
equals
(
type
)
&&
"car"
.
equals
(
type
))
{
equipTypeAmountPage
.
setSystemId
(
null
);
equipTypeAmountPage
.
setSystemId
(
null
);
equipTypeAmountPage
.
setStatus
(
null
);
equipTypeAmountPage
.
setStatus
(
null
);
}
}
IPage
<
EquipTypeImgAmountVO
>
list
=
fireFightingSystemMapper
IPage
<
EquipTypeImgAmountVO
>
list
=
fireFightingSystemMapper
.
getColaCategoryAmountList
(
equipTypeAmountPage
.
getPage
(),
hierarchy
,
codeHead
,
equipTypeAmountPage
);
.
getColaCategoryAmountList
(
equipTypeAmountPage
.
getPage
(),
hierarchy
,
codeHead
,
equipTypeAmountPage
);
list
.
getRecords
().
forEach
(
x
->
{
list
.
getRecords
().
forEach
(
x
->
{
if
(!
x
.
getEqtype
().
startsWith
(
"4"
)
&&
StringUtil
.
isNotEmpty
(
x
.
getAmount
()))
{
if
(!
x
.
getEqtype
().
startsWith
(
"4"
)
&&
StringUtil
.
isNotEmpty
(
x
.
getAmount
()))
{
x
.
setAmount
(
x
.
getAmount
().
split
(
"\\."
)[
0
]);
x
.
setAmount
(
x
.
getAmount
().
split
(
"\\."
)[
0
]);
}
}
});
});
return
list
;
return
list
;
}
}
@Override
@Override
public
IPage
<
EquipTypeImgAmountVO
>
getColaCategoryAmountCarList
(
int
hierarchy
,
String
codeHead
,
public
IPage
<
EquipTypeImgAmountVO
>
getColaCategoryAmountCarList
(
int
hierarchy
,
String
codeHead
,
EquipTypeAmountPageDTO
equipTypeAmountPage
)
{
EquipTypeAmountPageDTO
equipTypeAmountPage
)
{
String
type
=
equipTypeAmountPage
.
getType
();
String
type
=
equipTypeAmountPage
.
getType
();
if
(!
""
.
equals
(
type
)
&&
"car"
.
equals
(
type
))
{
if
(!
""
.
equals
(
type
)
&&
"car"
.
equals
(
type
))
{
equipTypeAmountPage
.
setSystemId
(
null
);
equipTypeAmountPage
.
setSystemId
(
null
);
equipTypeAmountPage
.
setStatus
(
null
);
equipTypeAmountPage
.
setStatus
(
null
);
}
}
IPage
<
EquipTypeImgAmountVO
>
list
=
fireFightingSystemMapper
IPage
<
EquipTypeImgAmountVO
>
list
=
fireFightingSystemMapper
.
getColaCategoryAmountCarList
(
equipTypeAmountPage
.
getPage
(),
hierarchy
,
codeHead
,
equipTypeAmountPage
);
.
getColaCategoryAmountCarList
(
equipTypeAmountPage
.
getPage
(),
hierarchy
,
codeHead
,
equipTypeAmountPage
);
list
.
getRecords
().
forEach
(
x
->
{
list
.
getRecords
().
forEach
(
x
->
{
if
(!
x
.
getEqtype
().
startsWith
(
"4"
)
&&
StringUtil
.
isNotEmpty
(
x
.
getAmount
()))
{
if
(!
x
.
getEqtype
().
startsWith
(
"4"
)
&&
StringUtil
.
isNotEmpty
(
x
.
getAmount
()))
{
x
.
setAmount
(
x
.
getAmount
().
split
(
"\\."
)[
0
]);
x
.
setAmount
(
x
.
getAmount
().
split
(
"\\."
)[
0
]);
}
}
});
});
return
list
;
return
list
;
}
}
@Override
@Override
public
IPage
<
EquipTypeImgAmountVO
>
getColaCategoryAmountEquList
(
int
hierarchy
,
String
codeHead
,
public
IPage
<
EquipTypeImgAmountVO
>
getColaCategoryAmountEquList
(
int
hierarchy
,
String
codeHead
,
EquipTypeAmountPageDTO
equipTypeAmountPage
)
{
EquipTypeAmountPageDTO
equipTypeAmountPage
)
{
String
type
=
equipTypeAmountPage
.
getType
();
String
type
=
equipTypeAmountPage
.
getType
();
if
(!
""
.
equals
(
type
)
&&
"car"
.
equals
(
type
))
{
if
(!
""
.
equals
(
type
)
&&
"car"
.
equals
(
type
))
{
equipTypeAmountPage
.
setSystemId
(
null
);
equipTypeAmountPage
.
setSystemId
(
null
);
equipTypeAmountPage
.
setStatus
(
null
);
equipTypeAmountPage
.
setStatus
(
null
);
}
}
IPage
<
EquipTypeImgAmountVO
>
list
=
fireFightingSystemMapper
IPage
<
EquipTypeImgAmountVO
>
list
=
fireFightingSystemMapper
.
getColaCategoryAmountEquList
(
equipTypeAmountPage
.
getPage
(),
hierarchy
,
codeHead
,
equipTypeAmountPage
);
.
getColaCategoryAmountEquList
(
equipTypeAmountPage
.
getPage
(),
hierarchy
,
codeHead
,
equipTypeAmountPage
);
list
.
getRecords
().
forEach
(
x
->
{
list
.
getRecords
().
forEach
(
x
->
{
if
(!
x
.
getEqtype
().
startsWith
(
"4"
)
&&
StringUtil
.
isNotEmpty
(
x
.
getAmount
()))
{
if
(!
x
.
getEqtype
().
startsWith
(
"4"
)
&&
StringUtil
.
isNotEmpty
(
x
.
getAmount
()))
{
x
.
setAmount
(
x
.
getAmount
().
split
(
"\\."
)[
0
]);
x
.
setAmount
(
x
.
getAmount
().
split
(
"\\."
)[
0
]);
}
}
});
});
return
list
;
return
list
;
}
}
@Override
@Override
public
List
<
EquipmentManageVo
>
getSystemCategory
()
{
public
List
<
EquipmentManageVo
>
getSystemCategory
()
{
return
equipmentManageMapper
.
getSystemList
();
return
equipmentManageMapper
.
getSystemList
();
}
}
@Override
@Override
public
List
<
FireFightingSystem
>
getFireFightingSystemDetail
(
FireFightingSystemVo
fireFightingSystemVo
)
{
public
List
<
FireFightingSystem
>
getFireFightingSystemDetail
(
FireFightingSystemVo
fireFightingSystemVo
)
{
return
fireFightingSystemMapper
.
getFireFightingSystemDetail
(
fireFightingSystemVo
);
return
fireFightingSystemMapper
.
getFireFightingSystemDetail
(
fireFightingSystemVo
);
}
}
@Override
@Override
public
List
<
FireFightingSystemEntity
>
getFightingSysByCodes
(
String
[]
idsArr
)
{
public
List
<
FireFightingSystemEntity
>
getFightingSysByCodes
(
String
[]
idsArr
)
{
List
<
FireFightingSystemEntity
>
fightingSystemList
=
fireFightingSystemMapper
.
getFightingSysByCodes
(
idsArr
);
List
<
FireFightingSystemEntity
>
fightingSystemList
=
fireFightingSystemMapper
.
getFightingSysByCodes
(
idsArr
);
if
(
fightingSystemList
!=
null
&&
!
fightingSystemList
.
isEmpty
())
{
if
(
fightingSystemList
!=
null
&&
!
fightingSystemList
.
isEmpty
())
{
return
fightingSystemList
;
return
fightingSystemList
;
}
}
return
Lists
.
newArrayList
();
return
Lists
.
newArrayList
();
}
}
@Override
@Override
public
List
<
FireFightingSystem3dVo
>
get3dFightingSystemList
()
{
public
List
<
FireFightingSystem3dVo
>
get3dFightingSystemList
()
{
FeignClientResult
<
List
<
DictionarieValueModel
>>
dictValues
=
Systemctl
.
dictionarieClient
FeignClientResult
<
List
<
DictionarieValueModel
>>
dictValues
=
Systemctl
.
dictionarieClient
.
dictValues
(
iotCoreParam
);
.
dictValues
(
iotCoreParam
);
Optional
.
ofNullable
(
dictValues
).
orElseThrow
(()
->
new
BadRequest
(
"查询字段数据为空"
));
Optional
.
ofNullable
(
dictValues
).
orElseThrow
(()
->
new
BadRequest
(
"查询字段数据为空"
));
List
<
DictionarieValueModel
>
values
=
dictValues
.
getResult
();
List
<
DictionarieValueModel
>
values
=
dictValues
.
getResult
();
if
(!
CollectionUtils
.
isEmpty
(
values
))
{
if
(!
CollectionUtils
.
isEmpty
(
values
))
{
List
<
String
>
collect
=
values
.
stream
().
map
(
DictionarieValueModel:
:
getDictDataKey
)
List
<
String
>
collect
=
values
.
stream
().
map
(
DictionarieValueModel:
:
getDictDataKey
)
.
collect
(
Collectors
.
toList
());
.
collect
(
Collectors
.
toList
());
List
<
FireFightingSystem3dVo
>
list
=
fireFightingSystemMapper
.
get3dFightingSystemList
(
collect
);
List
<
FireFightingSystem3dVo
>
list
=
fireFightingSystemMapper
.
get3dFightingSystemList
(
collect
);
if
(!
CollectionUtils
.
isEmpty
(
list
))
{
if
(!
CollectionUtils
.
isEmpty
(
list
))
{
return
list
;
return
list
;
}
}
}
}
return
Lists
.
newArrayList
();
return
Lists
.
newArrayList
();
}
}
@Override
@Override
public
FireFightingSystemEntity
getDetailByCode
(
String
systemCode
)
{
public
FireFightingSystemEntity
getDetailByCode
(
String
systemCode
)
{
LambdaQueryWrapper
<
FireFightingSystemEntity
>
wrapper
=
new
LambdaQueryWrapper
<>();
LambdaQueryWrapper
<
FireFightingSystemEntity
>
wrapper
=
new
LambdaQueryWrapper
<>();
wrapper
.
eq
(
FireFightingSystemEntity:
:
getCode
,
systemCode
);
wrapper
.
eq
(
FireFightingSystemEntity:
:
getCode
,
systemCode
);
List
<
FireFightingSystemEntity
>
systemEntities
=
this
.
list
(
wrapper
);
List
<
FireFightingSystemEntity
>
systemEntities
=
this
.
list
(
wrapper
);
if
(
systemEntities
.
isEmpty
())
{
if
(
systemEntities
.
isEmpty
())
{
throw
new
RuntimeException
(
"code"
+
systemCode
+
"不存在"
);
throw
new
RuntimeException
(
"code"
+
systemCode
+
"不存在"
);
}
}
return
systemEntities
.
get
(
0
);
return
systemEntities
.
get
(
0
);
}
}
@Override
@Override
public
List
<
AlarmDataVO
>
getSystemById
(
Long
id
)
{
public
List
<
AlarmDataVO
>
getSystemById
(
Long
id
)
{
return
this
.
baseMapper
.
getSystemById
(
id
);
return
this
.
baseMapper
.
getSystemById
(
id
);
}
}
@Override
@Override
public
IPage
<
EquipmentAlarmBySystemIdOrSourceIdVO
>
getEquipmentAlarmBySystemIdOrSourceIdVO
(
public
IPage
<
EquipmentAlarmBySystemIdOrSourceIdVO
>
getEquipmentAlarmBySystemIdOrSourceIdVO
(
IPage
<
EquipmentAlarmBySystemIdOrSourceIdVO
>
page
,
Long
sourceId
,
Long
systemId
,
Integer
confirmType
,
IPage
<
EquipmentAlarmBySystemIdOrSourceIdVO
>
page
,
Long
sourceId
,
Long
systemId
,
Integer
confirmType
,
String
createDate
,
String
type
)
{
String
createDate
,
String
type
)
{
return
this
.
baseMapper
.
getEquipmentAlarmBySystemIdOrSourceIdVO
(
page
,
sourceId
,
systemId
,
confirmType
,
return
this
.
baseMapper
.
getEquipmentAlarmBySystemIdOrSourceIdVO
(
page
,
sourceId
,
systemId
,
confirmType
,
createDate
,
type
);
createDate
,
type
);
}
}
private
static
String
getInet4Address
()
{
private
static
String
getInet4Address
()
{
Enumeration
<
NetworkInterface
>
nis
;
Enumeration
<
NetworkInterface
>
nis
;
String
ip
=
null
;
String
ip
=
null
;
try
{
try
{
nis
=
NetworkInterface
.
getNetworkInterfaces
();
nis
=
NetworkInterface
.
getNetworkInterfaces
();
for
(;
nis
.
hasMoreElements
();)
{
for
(;
nis
.
hasMoreElements
();
)
{
NetworkInterface
ni
=
nis
.
nextElement
();
NetworkInterface
ni
=
nis
.
nextElement
();
Enumeration
<
InetAddress
>
ias
=
ni
.
getInetAddresses
();
Enumeration
<
InetAddress
>
ias
=
ni
.
getInetAddresses
();
for
(;
ias
.
hasMoreElements
();)
{
for
(;
ias
.
hasMoreElements
();
)
{
InetAddress
ia
=
ias
.
nextElement
();
InetAddress
ia
=
ias
.
nextElement
();
if
(
ia
instanceof
Inet4Address
&&
!
ia
.
getHostAddress
().
equals
(
"127.0.0.1"
))
{
if
(
ia
instanceof
Inet4Address
&&
!
ia
.
getHostAddress
().
equals
(
"127.0.0.1"
))
{
ip
=
ia
.
getHostAddress
();
ip
=
ia
.
getHostAddress
();
}
}
}
}
}
}
}
catch
(
SocketException
e
)
{
}
catch
(
SocketException
e
)
{
e
.
printStackTrace
();
e
.
printStackTrace
();
}
}
return
ip
;
return
ip
;
}
}
@Override
@Override
public
Map
<
String
,
Object
>
integrationPageSysData
(
String
systemCode
,
Boolean
isUpdate
)
{
public
Map
<
String
,
Object
>
integrationPageSysData
(
String
systemCode
,
Boolean
isUpdate
)
{
// TODO Auto-generated method stub
// TODO Auto-generated method stub
if
(!
StringUtil
.
isNotEmpty
(
SystemTypeEnum
.
getEnum
(
systemCode
)))
{
if
(!
StringUtil
.
isNotEmpty
(
SystemTypeEnum
.
getEnum
(
systemCode
)))
{
return
null
;
return
null
;
}
}
Map
<
String
,
Object
>
data
=
null
;
Map
<
String
,
Object
>
data
=
null
;
if
(
isUpdate
)
{
if
(
isUpdate
)
{
data
=
saveIntegrationPageSysData
(
systemCode
);
data
=
saveIntegrationPageSysData
(
systemCode
);
}
else
{
}
else
{
if
(
redisUtils
.
hasKey
(
systemCode
))
{
if
(
redisUtils
.
hasKey
(
systemCode
))
{
data
=
JSONObject
.
parseObject
(
redisUtils
.
get
(
systemCode
).
toString
(),
Map
.
class
);
data
=
JSONObject
.
parseObject
(
redisUtils
.
get
(
systemCode
).
toString
(),
Map
.
class
);
}
else
{
}
else
{
data
=
saveIntegrationPageSysData
(
systemCode
);
data
=
saveIntegrationPageSysData
(
systemCode
);
}
}
}
}
if
(!
ObjectUtils
.
isEmpty
(
data
))
{
if
(!
ObjectUtils
.
isEmpty
(
data
))
{
mqttSendGateway
.
sendToMqtt
(
String
.
format
(
"%s%s"
,
"INTEGRATE_TOPIC/"
,
systemCode
),
JSON
.
toJSONString
(
data
));
mqttSendGateway
.
sendToMqtt
(
String
.
format
(
"%s%s"
,
"INTEGRATE_TOPIC/"
,
systemCode
),
JSON
.
toJSONString
(
data
));
}
}
return
null
;
return
null
;
}
}
public
Map
<
String
,
Object
>
saveIntegrationPageSysData
(
String
systemCode
)
{
public
Map
<
String
,
Object
>
saveIntegrationPageSysData
(
String
systemCode
)
{
Map
<
String
,
Object
>
data
=
null
;
Map
<
String
,
Object
>
data
=
null
;
if
(
SystemTypeEnum
.
fireAlarmSys
.
getCode
().
equals
(
systemCode
))
{
if
(
SystemTypeEnum
.
fireAlarmSys
.
getCode
().
equals
(
systemCode
))
{
data
=
fireFightingSystemMapper
.
fireAlarmSysEquipmentNumber
();
data
=
fireFightingSystemMapper
.
fireAlarmSysEquipmentNumber
();
this
.
putAll
(
data
,
fireFightingSystemMapper
.
fireAlarmSysIndexNumber
());
this
.
putAll
(
data
,
fireFightingSystemMapper
.
fireAlarmSysIndexNumber
());
this
.
putAll
(
data
,
fireFightingSystemMapper
.
fireWaterSysHydrant
());
this
.
putAll
(
data
,
fireFightingSystemMapper
.
fireWaterSysHydrant
());
}
else
if
(
SystemTypeEnum
.
fireCAFSSys
.
getCode
().
equals
(
systemCode
))
{
}
else
if
(
SystemTypeEnum
.
fireCAFSSys
.
getCode
().
equals
(
systemCode
))
{
data
=
fireFightingSystemMapper
.
getFireCafsSystem
();
data
=
fireFightingSystemMapper
.
getFireCafsSystem
();
}
else
if
(
SystemTypeEnum
.
fireONLSys
.
getCode
().
equals
(
systemCode
))
{
}
else
if
(
SystemTypeEnum
.
fireONLSys
.
getCode
().
equals
(
systemCode
))
{
data
=
fireFightingSystemMapper
.
getFireOnlSystem
();
data
=
fireFightingSystemMapper
.
getFireOnlSystem
();
this
.
putAll
(
data
,
fireFightingSystemMapper
.
getFireOnlSystemThreeSmall
());
this
.
putAll
(
data
,
fireFightingSystemMapper
.
getFireOnlSystemThreeSmall
());
}
else
if
(
SystemTypeEnum
.
fireFoamSys
.
getCode
().
equals
(
systemCode
))
{
}
else
if
(
SystemTypeEnum
.
fireFoamSys
.
getCode
().
equals
(
systemCode
))
{
data
=
fireFightingSystemMapper
.
fireFoamSysEquipmentIndexNumber
();
data
=
fireFightingSystemMapper
.
fireFoamSysEquipmentIndexNumber
();
}
else
if
(
SystemTypeEnum
.
fireFoamMistSys
.
getCode
().
equals
(
systemCode
)
}
else
if
(
SystemTypeEnum
.
fireFoamMistSys
.
getCode
().
equals
(
systemCode
)
||
SystemTypeEnum
.
envMonitoringSys
.
getCode
().
equals
(
systemCode
))
{
||
SystemTypeEnum
.
envMonitoringSys
.
getCode
().
equals
(
systemCode
))
{
// TODO 灯泡及门状态,实时数据库刷新,存放数据,套用后续逻辑进行数据的发送
// TODO 灯泡及门状态,实时数据库刷新,存放数据,套用后续逻辑进行数据的发送
data
=
new
HashMap
<>();
data
=
new
HashMap
<>();
data
.
put
(
"waitRefresh"
,
true
);
data
.
put
(
"waitRefresh"
,
true
);
}
else
if
(
SystemTypeEnum
.
fireWaterSys
.
getCode
().
equals
(
systemCode
))
{
}
else
if
(
SystemTypeEnum
.
fireWaterSys
.
getCode
().
equals
(
systemCode
))
{
data
=
fireFightingSystemMapper
.
fireWaterSysCollectingDevice
();
data
=
fireFightingSystemMapper
.
fireWaterSysCollectingDevice
();
this
.
putAll
(
data
,
fireFightingSystemMapper
.
fireWaterSysPool
());
this
.
putAll
(
data
,
fireFightingSystemMapper
.
fireWaterSysPool
());
this
.
putAll
(
data
,
fireFightingSystemMapper
.
fireWaterSysWaterPump
());
this
.
putAll
(
data
,
fireFightingSystemMapper
.
fireWaterSysWaterPump
());
}
else
{
}
else
{
data
=
fireFightingSystemMapper
.
otherSysIndexNumAndTotal
();
data
=
fireFightingSystemMapper
.
otherSysIndexNumAndTotal
();
}
}
if
(!
ObjectUtils
.
isEmpty
(
data
))
{
if
(!
ObjectUtils
.
isEmpty
(
data
))
{
redisUtils
.
set
(
systemCode
,
JSONObject
.
toJSONString
(
data
));
redisUtils
.
set
(
systemCode
,
JSONObject
.
toJSONString
(
data
));
}
}
return
data
;
return
data
;
}
}
private
void
putAll
(
Map
<
String
,
Object
>
data
,
Map
<
String
,
Object
>
addMap
)
{
private
void
putAll
(
Map
<
String
,
Object
>
data
,
Map
<
String
,
Object
>
addMap
)
{
if
(!
CollectionUtils
.
isEmpty
(
addMap
))
{
if
(!
CollectionUtils
.
isEmpty
(
addMap
))
{
data
.
putAll
(
addMap
);
data
.
putAll
(
addMap
);
}
}
}
}
@Override
@Override
public
List
<
FireFightingSystemTreeVo
>
getSystemTreeByOrgCode
(
String
bizOrgCode
)
{
public
List
<
FireFightingSystemTreeVo
>
getSystemTreeByOrgCode
(
String
bizOrgCode
)
{
// 获取公司部门list
// 获取公司部门list
List
<
OrgUsrDto
>
orgUsrLists
=
jcsRemoteService
.
getCompanyDeptListWithAuth
(
"COMPANY,DEPARTMENT"
,
bizOrgCode
);
List
<
OrgUsrDto
>
orgUsrLists
=
jcsRemoteService
.
getCompanyDeptListWithAuth
(
"COMPANY,DEPARTMENT"
,
bizOrgCode
);
List
<
FireFightingSystemTreeVo
>
fireFightingSystemTreeList
=
orgUsrLists
.
stream
().
map
(
key
->
{
List
<
FireFightingSystemTreeVo
>
fireFightingSystemTreeList
=
orgUsrLists
.
stream
().
map
(
key
->
{
FireFightingSystemTreeVo
vo
=
new
FireFightingSystemTreeVo
();
FireFightingSystemTreeVo
vo
=
new
FireFightingSystemTreeVo
();
vo
.
setId
(
String
.
valueOf
(
key
.
getSequenceNbr
()));
vo
.
setId
(
String
.
valueOf
(
key
.
getSequenceNbr
()));
vo
.
setName
(
key
.
getBizOrgName
());
vo
.
setName
(
key
.
getBizOrgName
());
vo
.
setType
(
key
.
getBizOrgType
());
vo
.
setType
(
key
.
getBizOrgType
());
vo
.
setBizOrgCode
(
key
.
getBizOrgCode
());
vo
.
setBizOrgCode
(
key
.
getBizOrgCode
());
vo
.
setParentId
(
key
.
getParentId
());
vo
.
setParentId
(
key
.
getParentId
());
return
vo
;
return
vo
;
}).
collect
(
Collectors
.
toList
());
}).
collect
(
Collectors
.
toList
());
// 根据bizOrgCode获取系统list
// 根据bizOrgCode获取系统list
List
<
String
>
bizOrgCodes
=
fireFightingSystemTreeList
.
stream
().
map
(
FireFightingSystemTreeVo:
:
getBizOrgCode
)
List
<
String
>
bizOrgCodes
=
fireFightingSystemTreeList
.
stream
().
map
(
FireFightingSystemTreeVo:
:
getBizOrgCode
)
.
collect
(
Collectors
.
toList
());
.
collect
(
Collectors
.
toList
());
LambdaQueryWrapper
<
FireFightingSystemEntity
>
wrapper
=
new
LambdaQueryWrapper
<>();
LambdaQueryWrapper
<
FireFightingSystemEntity
>
wrapper
=
new
LambdaQueryWrapper
<>();
wrapper
.
in
(
FireFightingSystemEntity:
:
getBizOrgCode
,
bizOrgCodes
);
wrapper
.
in
(
FireFightingSystemEntity:
:
getBizOrgCode
,
bizOrgCodes
);
List
<
FireFightingSystemEntity
>
fireFightingSystemEntityList
=
this
.
baseMapper
.
selectList
(
wrapper
);
List
<
FireFightingSystemEntity
>
fireFightingSystemEntityList
=
this
.
baseMapper
.
selectList
(
wrapper
);
List
<
FireFightingSystemTreeVo
>
systemList
=
fireFightingSystemEntityList
.
stream
().
map
(
key
->
{
List
<
FireFightingSystemTreeVo
>
systemList
=
fireFightingSystemEntityList
.
stream
().
map
(
key
->
{
FireFightingSystemTreeVo
vo
=
new
FireFightingSystemTreeVo
();
FireFightingSystemTreeVo
vo
=
new
FireFightingSystemTreeVo
();
vo
.
setId
(
String
.
valueOf
(
key
.
getId
()));
vo
.
setId
(
String
.
valueOf
(
key
.
getId
()));
vo
.
setName
(
key
.
getName
());
vo
.
setName
(
key
.
getName
());
vo
.
setType
(
"system"
);
vo
.
setType
(
"system"
);
vo
.
setBizOrgCode
(
key
.
getBizOrgCode
());
vo
.
setBizOrgCode
(
key
.
getBizOrgCode
());
return
vo
;
return
vo
;
}).
collect
(
Collectors
.
toList
());
}).
collect
(
Collectors
.
toList
());
// 组装公司部门树
// 组装公司部门树
fireFightingSystemTreeList
.
addAll
(
systemList
);
fireFightingSystemTreeList
.
addAll
(
systemList
);
return
fireFightingSystemTreeList
.
stream
().
filter
(
d
->
!
"system"
.
equals
(
d
.
getType
()))
return
fireFightingSystemTreeList
.
stream
().
filter
(
d
->
!
"system"
.
equals
(
d
.
getType
()))
.
peek
((
m
)
->
m
.
setChildren
(
getChildren
(
m
,
fireFightingSystemTreeList
))).
collect
(
Collectors
.
toList
());
.
peek
((
m
)
->
m
.
setChildren
(
getChildren
(
m
,
fireFightingSystemTreeList
))).
collect
(
Collectors
.
toList
());
}
}
private
List
<
FireFightingSystemTreeVo
>
getChildren
(
FireFightingSystemTreeVo
root
,
private
List
<
FireFightingSystemTreeVo
>
getChildren
(
FireFightingSystemTreeVo
root
,
List
<
FireFightingSystemTreeVo
>
all
)
{
List
<
FireFightingSystemTreeVo
>
all
)
{
return
all
.
stream
()
return
all
.
stream
()
.
filter
(
d
->
StringUtil
.
isNotEmpty
(
d
.
getParentId
())
&&
d
.
getParentId
().
equals
(
root
.
getId
())
.
filter
(
d
->
StringUtil
.
isNotEmpty
(
d
.
getParentId
())
&&
d
.
getParentId
().
equals
(
root
.
getId
())
||
(
StringUtil
.
isNotEmpty
(
d
.
getBizOrgCode
())
&&
d
.
getBizOrgCode
().
equals
(
root
.
getBizOrgCode
())
||
(
StringUtil
.
isNotEmpty
(
d
.
getBizOrgCode
())
&&
d
.
getBizOrgCode
().
equals
(
root
.
getBizOrgCode
())
&&
!
"system"
.
equals
(
root
.
getType
())
&&
!
d
.
getId
().
equals
(
root
.
getId
())))
&&
!
"system"
.
equals
(
root
.
getType
())
&&
!
d
.
getId
().
equals
(
root
.
getId
())))
.
peek
(
m
->
m
.
setChildren
(
getChildren
(
m
,
all
))).
collect
(
Collectors
.
toList
());
.
peek
(
m
->
m
.
setChildren
(
getChildren
(
m
,
all
))).
collect
(
Collectors
.
toList
());
}
}
@Override
@Override
public
List
<
OrgMenuDto
>
companyTreeByUserAndType
(
String
type
)
{
public
List
<
OrgMenuDto
>
companyTreeByUserAndType
(
String
type
)
{
return
jcsRemoteService
.
getCompanyDeptTreeWithAuth
(
authKey
,
type
);
return
jcsRemoteService
.
getCompanyDeptTreeWithAuth
(
authKey
,
type
);
}
}
@Override
@Override
public
List
<
FireFightingSystemTypeTreeVo
>
systemTypeTree
(
String
bizOrgCode
)
{
public
List
<
FireFightingSystemTypeTreeVo
>
systemTypeTree
(
String
bizOrgCode
)
{
// 获取所有系统分类list
// 获取所有系统分类list
LambdaQueryWrapper
<
DynamicFormGroup
>
wrapper
=
new
LambdaQueryWrapper
<>();
LambdaQueryWrapper
<
DynamicFormGroup
>
wrapper
=
new
LambdaQueryWrapper
<>();
wrapper
.
eq
(
DynamicFormGroup:
:
getGroupType
,
"fireSystem"
);
wrapper
.
eq
(
DynamicFormGroup:
:
getGroupType
,
"fireSystem"
);
wrapper
.
eq
(
DynamicFormGroup:
:
getParentId
,
0
);
wrapper
.
eq
(
DynamicFormGroup:
:
getParentId
,
0
);
List
<
DynamicFormGroup
>
list
=
iEqDynamicFormGroupService
.
list
(
wrapper
);
List
<
DynamicFormGroup
>
list
=
iEqDynamicFormGroupService
.
list
(
wrapper
);
List
<
Map
<
String
,
Object
>>
typeList
=
fireFightingSystemMapper
.
listByBizOrgCode
(
bizOrgCode
);
List
<
Map
<
String
,
Object
>>
typeList
=
fireFightingSystemMapper
.
listByBizOrgCode
(
bizOrgCode
);
List
<
FireFightingSystemTypeTreeVo
>
childrenList
=
list
.
stream
().
map
(
item
->
{
List
<
FireFightingSystemTypeTreeVo
>
childrenList
=
list
.
stream
().
map
(
item
->
{
FireFightingSystemTypeTreeVo
vo
=
new
FireFightingSystemTypeTreeVo
();
FireFightingSystemTypeTreeVo
vo
=
new
FireFightingSystemTypeTreeVo
();
vo
.
setName
(
item
.
getGroupName
());
vo
.
setName
(
item
.
getGroupName
());
typeList
.
forEach
(
obj
->
{
typeList
.
forEach
(
obj
->
{
if
(
item
.
getId
().
equals
(
Long
.
valueOf
(
obj
.
get
(
"typeId"
).
toString
())))
{
if
(
item
.
getId
().
equals
(
Long
.
valueOf
(
obj
.
get
(
"typeId"
).
toString
())))
{
vo
.
setTotal
(
obj
.
get
(
"total"
).
toString
());
vo
.
setTotal
(
obj
.
get
(
"total"
).
toString
());
}
}
});
});
vo
.
setType
(
item
.
getGroupType
());
vo
.
setType
(
item
.
getGroupType
());
vo
.
setId
(
String
.
valueOf
(
item
.
getId
()));
vo
.
setId
(
String
.
valueOf
(
item
.
getId
()));
return
vo
;
return
vo
;
}).
collect
(
Collectors
.
toList
());
}).
collect
(
Collectors
.
toList
());
// 计算总数
// 计算总数
long
total
=
typeList
.
stream
().
mapToLong
(
o
->
{
long
total
=
typeList
.
stream
().
mapToLong
(
o
->
{
if
(!
ObjectUtils
.
isEmpty
(
o
.
get
(
"total"
)))
{
if
(!
ObjectUtils
.
isEmpty
(
o
.
get
(
"total"
)))
{
return
(
long
)
o
.
get
(
"total"
);
return
(
long
)
o
.
get
(
"total"
);
}
}
return
0
;
return
0
;
}).
sum
();
}).
sum
();
// 自定义根节点返回树
// 自定义根节点返回树
FireFightingSystemTypeTreeVo
parentNode
=
new
FireFightingSystemTypeTreeVo
();
FireFightingSystemTypeTreeVo
parentNode
=
new
FireFightingSystemTypeTreeVo
();
parentNode
.
setType
(
"all"
);
parentNode
.
setType
(
"all"
);
parentNode
.
setName
(
"全部分类"
);
parentNode
.
setName
(
"全部分类"
);
parentNode
.
setId
(
"-1"
);
parentNode
.
setId
(
"-1"
);
parentNode
.
setParentId
(
"-1"
);
parentNode
.
setParentId
(
"-1"
);
parentNode
.
setTotal
(
String
.
valueOf
(
total
));
parentNode
.
setTotal
(
String
.
valueOf
(
total
));
parentNode
.
setChildren
(
childrenList
);
parentNode
.
setChildren
(
childrenList
);
return
Collections
.
singletonList
(
parentNode
);
return
Collections
.
singletonList
(
parentNode
);
}
}
@Override
@Override
public
Object
getEquipmentTypeAndCount
(
String
bizOrgCode
)
{
public
Object
getEquipmentTypeAndCount
(
String
bizOrgCode
)
{
if
(
redisUtils
.
hasKey
(
equipTypeAndCount
+
bizOrgCode
))
{
if
(
redisUtils
.
hasKey
(
equipTypeAndCount
+
bizOrgCode
))
{
return
JSONArray
.
parseArray
(
return
JSONArray
.
parseArray
(
JSONArray
.
toJSONString
(
redisUtils
.
get
(
equipTypeAndCount
+
bizOrgCode
)),
EquipmentCategory
.
class
);
JSONArray
.
toJSONString
(
redisUtils
.
get
(
equipTypeAndCount
+
bizOrgCode
)),
EquipmentCategory
.
class
);
}
else
{
}
else
{
return
refreshEquipmentTypeAndCount
(
bizOrgCode
);
return
refreshEquipmentTypeAndCount
(
bizOrgCode
);
}
}
}
}
@Override
public
Object
refreshEquipmentTypeAndCount
(
String
bizOrgCode
)
{
List
<
EquipmentCategory
>
responseList
=
this
.
typeList
();
@Override
if
(
responseList
==
null
||
responseList
.
size
()
<
1
)
{
public
Object
refreshEquipmentTypeAndCount
(
String
bizOrgCode
)
{
return
null
;
List
<
EquipmentCategory
>
responseList
=
this
.
typeList
();
}
if
(
responseList
==
null
||
responseList
.
size
()
<
1
)
{
List
<
EquipmentCategory
>
equipmentTypeList
=
responseList
.
stream
()
return
null
;
.
filter
(
i
->
!
i
.
getCode
().
startsWith
(
"2"
)
&&
"2"
.
equals
(
i
.
getIndustryCode
()))
}
.
collect
(
Collectors
.
toList
());
List
<
EquipmentCategory
>
equipmentTypeList
=
responseList
.
stream
()
List
<
EquipmentCategory
>
list
=
typeListTree
(
equipmentTypeList
,
bizOrgCode
,
SourceTypeEnum
.
EQUIPMENT
);
.
filter
(
i
->
!
i
.
getCode
().
startsWith
(
"2"
)
&&
"2"
.
equals
(
i
.
getIndustryCode
()))
redisUtils
.
set
(
equipTypeAndCount
+
bizOrgCode
,
list
,
86400
);
.
collect
(
Collectors
.
toList
());
return
list
;
List
<
EquipmentCategory
>
list
=
typeListTree
(
equipmentTypeList
,
bizOrgCode
,
SourceTypeEnum
.
EQUIPMENT
);
}
redisUtils
.
set
(
equipTypeAndCount
+
bizOrgCode
,
list
,
86400
);
return
list
;
@Override
}
public
Object
getCarTypeAndCount
(
String
bizOrgCode
)
{
if
(
redisUtils
.
hasKey
(
carTypeAndCount
+
bizOrgCode
))
{
@Override
List
<
EquipmentCategory
>
typeList
=
JSONArray
.
parseArray
(
public
Object
getCarTypeAndCount
(
String
bizOrgCode
)
{
JSONArray
.
toJSONString
(
redisUtils
.
get
(
carTypeAndCount
+
bizOrgCode
)),
EquipmentCategory
.
class
);
if
(
redisUtils
.
hasKey
(
carTypeAndCount
+
bizOrgCode
))
{
return
typeList
;
List
<
EquipmentCategory
>
typeList
=
JSONArray
.
parseArray
(
}
else
{
JSONArray
.
toJSONString
(
redisUtils
.
get
(
carTypeAndCount
+
bizOrgCode
)),
EquipmentCategory
.
class
);
return
refreshCarTypeAndCount
(
bizOrgCode
);
return
typeList
;
}
}
else
{
}
return
refreshCarTypeAndCount
(
bizOrgCode
);
@Override
}
public
Object
refreshCarTypeAndCount
(
String
bizOrgCode
)
{
}
List
<
EquipmentCategory
>
responseList
=
this
.
typeList
();
if
(
responseList
==
null
||
responseList
.
size
()
<
1
)
{
@Override
return
null
;
public
Object
refreshCarTypeAndCount
(
String
bizOrgCode
)
{
}
List
<
EquipmentCategory
>
responseList
=
this
.
typeList
();
List
<
EquipmentCategory
>
equipmentTypeList
=
responseList
.
stream
()
if
(
responseList
==
null
||
responseList
.
size
()
<
1
)
{
.
filter
(
i
->
i
.
getCode
().
startsWith
(
"2"
)
&&
"2"
.
equals
(
i
.
getIndustryCode
()))
return
null
;
.
collect
(
Collectors
.
toList
());
}
List
<
EquipmentCategory
>
list
=
typeListTree
(
equipmentTypeList
,
bizOrgCode
,
SourceTypeEnum
.
CAR
);
List
<
EquipmentCategory
>
equipmentTypeList
=
responseList
.
stream
()
redisUtils
.
set
(
carTypeAndCount
+
bizOrgCode
,
list
);
.
filter
(
i
->
i
.
getCode
().
startsWith
(
"2"
)
&&
"2"
.
equals
(
i
.
getIndustryCode
()))
return
list
;
.
collect
(
Collectors
.
toList
());
}
List
<
EquipmentCategory
>
list
=
typeListTree
(
equipmentTypeList
,
bizOrgCode
,
SourceTypeEnum
.
CAR
);
redisUtils
.
set
(
carTypeAndCount
+
bizOrgCode
,
list
);
return
list
;
}
public
List
<
EquipmentCategory
>
typeList
()
{
List
<
EquipmentCategory
>
equipmentCategorys
=
this
.
iEquipmentCategoryService
public
List
<
EquipmentCategory
>
typeList
()
{
.
getEquipmentCategoryList
(
Integer
.
valueOf
(
equipmentCategoryLeftTypeCode
));
List
<
EquipmentCategory
>
equipmentCategorys
=
this
.
iEquipmentCategoryService
return
equipmentCategorys
;
.
getEquipmentCategoryList
(
Integer
.
valueOf
(
equipmentCategoryLeftTypeCode
));
}
return
equipmentCategorys
;
}
public
List
<
EquipmentCategory
>
typeListTree
(
List
<
EquipmentCategory
>
equipmentCategorys
,
String
bizOrgCode
,
SourceTypeEnum
sourceTypeEnum
)
{
public
List
<
EquipmentCategory
>
typeListTree
(
List
<
EquipmentCategory
>
equipmentCategorys
,
String
bizOrgCode
,
List
<
EquipmentCategory
>
list
=
new
ArrayList
<>();
SourceTypeEnum
sourceTypeEnum
)
{
Map
<
String
,
List
<
EquipmentCategory
>>
tmpMap
=
new
HashMap
<
String
,
List
<
EquipmentCategory
>>();
List
<
EquipmentCategory
>
list
=
new
ArrayList
<>();
equipmentCategorys
.
forEach
(
action
->
{
Map
<
String
,
List
<
EquipmentCategory
>>
tmpMap
=
new
HashMap
<
String
,
List
<
EquipmentCategory
>>();
int
num
=
sourceStatistics
.
equipCategoryStatistics
(
bizOrgCode
,
sourceTypeEnum
,
action
.
getCode
());
equipmentCategorys
.
forEach
(
action
->
{
action
.
setCount
(
Double
.
parseDouble
(
num
+
""
));
int
num
=
sourceStatistics
.
equipCategoryStatistics
(
bizOrgCode
,
sourceTypeEnum
,
action
.
getCode
());
if
(
action
.
getParentId
()
==
null
)
{
action
.
setCount
(
Double
.
parseDouble
(
num
+
""
));
list
.
add
(
action
);
if
(
action
.
getParentId
()
==
null
)
{
}
else
{
list
.
add
(
action
);
if
(
tmpMap
.
get
(
action
.
getParentId
().
toString
())
==
null
)
{
}
else
{
ArrayList
<
EquipmentCategory
>
tmplist
=
new
ArrayList
<
EquipmentCategory
>();
if
(
tmpMap
.
get
(
action
.
getParentId
().
toString
())
==
null
)
{
tmplist
.
add
(
action
);
ArrayList
<
EquipmentCategory
>
tmplist
=
new
ArrayList
<
EquipmentCategory
>();
tmpMap
.
put
(
action
.
getParentId
().
toString
(),
tmplist
);
tmplist
.
add
(
action
);
}
else
{
tmpMap
.
put
(
action
.
getParentId
().
toString
(),
tmplist
);
if
(!
tmpMap
.
get
(
action
.
getParentId
().
toString
()).
contains
(
action
))
{
}
else
{
tmpMap
.
get
(
action
.
getParentId
().
toString
()).
add
(
action
);
if
(!
tmpMap
.
get
(
action
.
getParentId
().
toString
()).
contains
(
action
))
{
}
tmpMap
.
get
(
action
.
getParentId
().
toString
()).
add
(
action
);
}
}
}
}
});
}
getChildren
(
list
,
tmpMap
);
});
return
list
;
getChildren
(
list
,
tmpMap
);
}
return
list
;
}
private
void
getChildren
(
List
<
EquipmentCategory
>
list
,
Map
<
String
,
List
<
EquipmentCategory
>>
tmpMap
)
{
for
(
EquipmentCategory
equipmentCategory
:
list
)
{
private
void
getChildren
(
List
<
EquipmentCategory
>
list
,
Map
<
String
,
List
<
EquipmentCategory
>>
tmpMap
)
{
if
(
tmpMap
.
get
(
equipmentCategory
.
getId
().
toString
())
!=
null
for
(
EquipmentCategory
equipmentCategory
:
list
)
{
&&
tmpMap
.
get
(
equipmentCategory
.
getId
().
toString
()).
size
()
>
0
)
{
if
(
tmpMap
.
get
(
equipmentCategory
.
getId
().
toString
())
!=
null
List
<
EquipmentCategory
>
equipcliss
=
tmpMap
.
get
(
equipmentCategory
.
getId
().
toString
());
&&
tmpMap
.
get
(
equipmentCategory
.
getId
().
toString
()).
size
()
>
0
)
{
equipmentCategory
.
setHasLowerClassification
(
true
);
List
<
EquipmentCategory
>
equipcliss
=
tmpMap
.
get
(
equipmentCategory
.
getId
().
toString
());
equipmentCategory
.
setChildren
(
equipcliss
);
equipmentCategory
.
setHasLowerClassification
(
true
);
getChildren
(
equipcliss
,
tmpMap
);
equipmentCategory
.
setChildren
(
equipcliss
);
}
getChildren
(
equipcliss
,
tmpMap
);
}
}
}
}
}
@Override
public
List
<
FireFightingSystemEntity
>
systemListByBziOrgCode
(
String
bizOrgCode
)
{
@Override
LambdaQueryWrapper
<
FireFightingSystemEntity
>
wrapper
=
new
LambdaQueryWrapper
<>();
public
List
<
FireFightingSystemEntity
>
systemListByBziOrgCode
(
String
bizOrgCode
)
{
if
(
StringUtil
.
isNotEmpty
(
bizOrgCode
))
{
LambdaQueryWrapper
<
FireFightingSystemEntity
>
wrapper
=
new
LambdaQueryWrapper
<>();
wrapper
.
likeRight
(
FireFightingSystemEntity:
:
getBizOrgCode
,
bizOrgCode
);
if
(
StringUtil
.
isNotEmpty
(
bizOrgCode
))
{
}
wrapper
.
likeRight
(
FireFightingSystemEntity:
:
getBizOrgCode
,
bizOrgCode
);
return
this
.
baseMapper
.
selectList
(
wrapper
);
}
}
return
this
.
baseMapper
.
selectList
(
wrapper
);
}
}
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/impl/SourcesStatisticsImpl.java
View file @
97fb9777
...
@@ -19,7 +19,7 @@ public class SourcesStatisticsImpl implements ISourceStatistics {
...
@@ -19,7 +19,7 @@ public class SourcesStatisticsImpl implements ISourceStatistics {
@Autowired
@Autowired
private
RedisUtils
redisUtil
;
private
RedisUtils
redisUtil
;
public
static
String
PREFIX_CATEGORY_COUNT
=
"CATEGORY_COUNT_"
;
static
String
PREFIX_CATEGORY_COUNT
=
"CATEGORY_COUNT_"
;
@Override
@Override
...
@@ -31,28 +31,28 @@ public class SourcesStatisticsImpl implements ISourceStatistics {
...
@@ -31,28 +31,28 @@ public class SourcesStatisticsImpl implements ISourceStatistics {
//求和
//求和
return
this
.
sumNumber
(
keys
);
return
this
.
sumNumber
(
keys
);
}
else
{
}
else
{
//按照类型插入缓存
return
0
;
Object
bean
=
SpringContextHelper
.
getBean
(
sourceType
.
getBeanName
());
Method
[]
methods
=
bean
.
getClass
().
getDeclaredMethods
();
for
(
Method
method
:
methods
)
{
if
(
method
.
getName
().
equals
(
sourceType
.
getMethodName
()))
{
try
{
method
.
invoke
(
bean
);
}
catch
(
Exception
e
)
{
throw
new
RuntimeException
(
"更新redis数据失败"
+
e
.
getMessage
());
}
}
}
return
this
.
sumNumberAndInitRedis
(
bizOrgCode
,
sourceType
,
treeCode
,
keys
);
}
}
}
}
private
int
sumNumberAndInitRedis
(
String
bizOrgCode
,
SourceTypeEnum
sourceType
,
String
treeCode
,
Set
<
String
>
keys
)
{
/**
int
result
=
this
.
sumNumber
(
keys
);
* 系统初始化时调用刷新缓存
if
(
result
==
0
){
* @param sourceType 缓存类型
redisUtil
.
set
(
buildKey
(
bizOrgCode
,
sourceType
.
getCode
(),
treeCode
),
0
,
86400
);
*/
@Override
public
void
initAllCategoryStatisticsData
(
SourceTypeEnum
sourceType
)
{
//按照类型插入缓存
Object
bean
=
SpringContextHelper
.
getBean
(
sourceType
.
getBeanName
());
Method
[]
methods
=
bean
.
getClass
().
getDeclaredMethods
();
for
(
Method
method
:
methods
)
{
if
(
method
.
getName
().
equals
(
sourceType
.
getMethodName
()))
{
try
{
method
.
invoke
(
bean
);
}
catch
(
Exception
e
)
{
throw
new
RuntimeException
(
"更新redis数据失败"
+
e
.
getMessage
());
}
}
}
}
return
result
;
}
}
private
int
sumNumber
(
Set
<
String
>
keys
)
{
private
int
sumNumber
(
Set
<
String
>
keys
)
{
...
@@ -69,7 +69,4 @@ public class SourcesStatisticsImpl implements ISourceStatistics {
...
@@ -69,7 +69,4 @@ public class SourcesStatisticsImpl implements ISourceStatistics {
return
PREFIX_CATEGORY_COUNT
+
bizOrgCode
+
"*_"
+
sourceType
+
"_"
+
treeCode
+
"*"
;
return
PREFIX_CATEGORY_COUNT
+
bizOrgCode
+
"*_"
+
sourceType
+
"_"
+
treeCode
+
"*"
;
}
}
private
String
buildKey
(
String
bizOrgCode
,
String
sourceType
,
String
treeCode
)
{
return
PREFIX_CATEGORY_COUNT
+
bizOrgCode
+
"_"
+
sourceType
+
"_"
+
treeCode
;
}
}
}
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