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
6f7e8a74
Commit
6f7e8a74
authored
Jun 09, 2022
by
KeYong
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/develop_dl_plan6' into develop_dl_plan6
parents
664b47df
98859d13
Hide whitespace changes
Inline
Side-by-side
Showing
27 changed files
with
746 additions
and
188 deletions
+746
-188
FirefightersMapper.xml
...mmon-api/src/main/resources/mapper/FirefightersMapper.xml
+10
-1
OrgUsrMapper.xml
...ule-common-api/src/main/resources/mapper/OrgUsrMapper.xml
+12
-3
FireEquipmentVO.java
...ejoin/equipmanage/common/datasync/vo/FireEquipmentVO.java
+26
-0
EquipmentSpecificAlarmLog.java
.../equipmanage/common/entity/EquipmentSpecificAlarmLog.java
+3
-0
VideoDownloadVO.java
...yeejoin/equipmanage/common/entity/vo/VideoDownloadVO.java
+2
-2
WordTemplateTypeEum.java
...yeejoin/equipmanage/common/enums/WordTemplateTypeEum.java
+9
-2
MaintenanceResourceDataVo.java
...join/equipmanage/common/vo/MaintenanceResourceDataVo.java
+6
-0
MaintenanceCompanyServiceImpl.java
...ommon/biz/service/impl/MaintenanceCompanyServiceImpl.java
+1
-0
CarController.java
...ava/com/yeejoin/equipmanage/controller/CarController.java
+0
-50
EquipmentSpecificController.java
...n/equipmanage/controller/EquipmentSpecificController.java
+17
-4
FireAutoSysManageReportController.java
...pmanage/controller/FireAutoSysManageReportController.java
+70
-0
EquipmentSpecificAlarmLogMapper.java
...n/equipmanage/mapper/EquipmentSpecificAlarmLogMapper.java
+3
-1
EquipmentSpecificMapper.java
...m/yeejoin/equipmanage/mapper/EquipmentSpecificMapper.java
+3
-0
IEquipmentSpecificSerivce.java
...eejoin/equipmanage/service/IEquipmentSpecificSerivce.java
+9
-0
IFireAutoSysManageReportService.java
.../equipmanage/service/IFireAutoSysManageReportService.java
+19
-0
BuildingServiceImpl.java
...yeejoin/equipmanage/service/impl/BuildingServiceImpl.java
+2
-4
ConfirmAlarmServiceImpl.java
...oin/equipmanage/service/impl/ConfirmAlarmServiceImpl.java
+3
-3
EquipmentSpecificSerivceImpl.java
...quipmanage/service/impl/EquipmentSpecificSerivceImpl.java
+144
-83
FireAutoSysManageReportServiceImpl.java
...nage/service/impl/FireAutoSysManageReportServiceImpl.java
+290
-0
StockServiceImpl.java
...om/yeejoin/equipmanage/service/impl/StockServiceImpl.java
+30
-14
VideoServiceImpl.java
...om/yeejoin/equipmanage/service/impl/VideoServiceImpl.java
+30
-4
PlanTaskController.java
...s/maintenance/business/controller/PlanTaskController.java
+11
-0
PlanTaskServiceImpl.java
...aintenance/business/service/impl/PlanTaskServiceImpl.java
+17
-17
PlanTaskServiceImpl.java
...upervision/business/service/impl/PlanTaskServiceImpl.java
+4
-0
fireAutoSysManageReport.ftl
...-equip/src/main/resources/ftl/fireAutoSysManageReport.ftl
+0
-0
ConfirmAlarmMapper.xml
...em-equip/src/main/resources/mapper/ConfirmAlarmMapper.xml
+10
-0
EquipmentSpecificMapper.xml
...uip/src/main/resources/mapper/EquipmentSpecificMapper.xml
+15
-0
No files found.
amos-boot-module/amos-boot-module-api/amos-boot-module-common-api/src/main/resources/mapper/FirefightersMapper.xml
View file @
6f7e8a74
...
...
@@ -394,6 +394,15 @@ LEFT JOIN cb_fire_team cft ON cff.fire_team_id = cft.sequence_nbr
CODE = b.certificatesTypeCode
AND type = 'RYZJLX'
) AS certificatesTypeCode,
(
SELECT
NAME
FROM
cb_data_dictionary
WHERE
CODE = b.stateCode
AND type = 'RYZT'
) AS stateCode,
fp.employee_hierarchy,
cast(b.birthdayTime as datetime) as birthdayTime,
b.*,
...
...
@@ -411,7 +420,7 @@ LEFT JOIN cb_fire_team cft ON cff.fire_team_id = cft.sequence_nbr
max(case field_code when 'personNumber' then field_value end) personNumber,
max(case field_code when 'positionType' then field_value_label end) positionType,
max(case field_code when 'safetyTraining' then field_value end) safetyTraining,
max(case field_code when 'stateCode' then field_value
_label
end) stateCode,
max(case field_code when 'stateCode' then field_value end) stateCode,
max(case field_code when 'telephone' then field_value end) telephone,
max(case field_code when 'peopleType' then field_value end) peopleType,
max(case field_code when 'nation' then field_value end) nation,
...
...
amos-boot-module/amos-boot-module-api/amos-boot-module-common-api/src/main/resources/mapper/OrgUsrMapper.xml
View file @
6f7e8a74
...
...
@@ -658,6 +658,15 @@ GROUP BY
CODE = b.certificatesTypeCode
AND type = 'RYZJLX'
) AS certificatesTypeCode,
(
SELECT
NAME
FROM
cb_data_dictionary
WHERE
CODE = b.stateCode
AND type = 'RYZT'
) AS stateCode,
fc.emergency_contact,
fc.emergency_contact_phone,
fp.employee_hierarchy employeeHierarchy,
...
...
@@ -677,16 +686,16 @@ GROUP BY
max(case field_code when 'personNumber' then field_value end) personNumber,
max(case field_code when 'positionType' then field_value_label end) positionType,
max(case field_code when 'safetyTraining' then field_value end) safetyTraining,
max(case field_code when 'stateCode' then field_value
_label
end) stateCode,
max(case field_code when 'stateCode' then field_value end) stateCode,
max(case field_code when 'telephone' then field_value end) telephone,
max(case field_code when 'peopleType' then field_value end) peopleType,
max(case field_code when 'nation' then field_value end) nation,
max(case field_code when 'birthdayTime' then field_value end) birthdayTime,
max(case field_code when 'maritalStatus' then field_value end) maritalStatus,
max(case field_code when 'nativePlace' then field_value end) nativePlace,
max(case field_code when 'nativePlaceVal' then field_value end) nativePlaceVal,
max(case field_code when 'nativePlaceVal' then field_value
_label
end) nativePlaceVal,
max(case field_code when 'politicalOutlook' then field_value end) politicalOutlook,
max(case field_code when 'residenceDetails' then field_value end) residenceDetails,
max(case field_code when 'residenceDetails' then field_value
_label
end) residenceDetails,
max(case field_code when 'residenceDetailVal' then field_value end) residenceDetailVal,
max(case field_code when 'airportAccommodation' then field_value end) airportAccommodation
FROM cb_dynamic_form_instance GROUP BY instance_id) b
...
...
amos-boot-module/amos-boot-module-api/amos-boot-module-equip-api/src/main/java/com/yeejoin/equipmanage/common/datasync/vo/FireEquipmentVO.java
0 → 100644
View file @
6f7e8a74
package
com
.
yeejoin
.
equipmanage
.
common
.
datasync
.
vo
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.io.Serializable
;
import
java.time.LocalDateTime
;
import
java.util.Date
;
@Data
@ApiModel
(
value
=
"详情返回数据"
,
description
=
"设备数据"
)
public
class
FireEquipmentVO
implements
Serializable
{
@ApiModelProperty
(
value
=
"所在建筑ID"
)
@TableField
(
"buildid"
)
private
String
buildId
;
private
String
parentId
;
private
String
instanceId
;
private
String
bizOrgCode
;
}
amos-boot-module/amos-boot-module-api/amos-boot-module-equip-api/src/main/java/com/yeejoin/equipmanage/common/entity/EquipmentSpecificAlarmLog.java
View file @
6f7e8a74
...
...
@@ -196,6 +196,9 @@ public class EquipmentSpecificAlarmLog extends BaseEntity {
@TableField
(
exist
=
false
)
private
String
jcsConfirmUserName
;
@ApiModelProperty
(
value
=
"画布中建筑ID"
,
notes
=
"告警详情 配置点位里用"
)
@TableField
(
exist
=
false
)
private
String
sourceId
;
/**
* 颜色
*/
...
...
amos-boot-module/amos-boot-module-api/amos-boot-module-equip-api/src/main/java/com/yeejoin/equipmanage/common/entity/vo/VideoDownloadVO.java
View file @
6f7e8a74
...
...
@@ -25,10 +25,10 @@ public class VideoDownloadVO implements Serializable {
@ExcelProperty
(
value
=
"token"
,
index
=
3
)
private
String
token
;
@ExcelProperty
(
value
=
"机构编码"
,
index
=
4
)
@ExcelProperty
(
value
=
"机构编码
(必填)
"
,
index
=
4
)
private
String
bizOrgCode
;
@ExcelProperty
(
value
=
"机构/部门名称"
,
index
=
5
)
@ExcelProperty
(
value
=
"机构/部门名称
(必填)
"
,
index
=
5
)
private
String
bizOrgName
;
@ExcelProperty
(
value
=
"所属建筑编码"
,
index
=
6
)
...
...
amos-boot-module/amos-boot-module-api/amos-boot-module-equip-api/src/main/java/com/yeejoin/equipmanage/common/enums/WordTemplateTypeEum.java
View file @
6f7e8a74
...
...
@@ -6,8 +6,15 @@ package com.yeejoin.equipmanage.common.enums;
*
*/
public
enum
WordTemplateTypeEum
{
resume
(
"简历"
,
"jianli.ftl"
),
firePatrolReport
(
"消防巡查报表"
,
"FirePatrolReport.ftl"
);
/**
* 模板分类
*/
resume
(
"简历"
,
"jianli.ftl"
),
firePatrolReport
(
"消防巡查报表"
,
"FirePatrolReport.ftl"
),
fireAutoSysManageReport
(
"消防自动化综合管理报表"
,
"fireAutoSysManageReport.ftl"
);
private
String
label
;
private
String
templateFile
;
...
...
amos-boot-module/amos-boot-module-api/amos-boot-module-equip-api/src/main/java/com/yeejoin/equipmanage/common/vo/MaintenanceResourceDataVo.java
View file @
6f7e8a74
...
...
@@ -3,6 +3,9 @@ package com.yeejoin.equipmanage.common.vo;
import
cn.afterturn.easypoi.excel.annotation.Excel
;
import
com.alibaba.excel.annotation.ExcelIgnore
;
import
com.alibaba.excel.annotation.ExcelProperty
;
import
com.alibaba.excel.annotation.write.style.ColumnWidth
;
import
com.alibaba.excel.annotation.write.style.ContentRowHeight
;
import
com.alibaba.excel.annotation.write.style.HeadRowHeight
;
import
com.alibaba.excel.metadata.BaseRowModel
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
io.swagger.annotations.ApiModel
;
...
...
@@ -18,6 +21,9 @@ import java.util.List;
* @date 2021-07-16
*/
@Data
@HeadRowHeight
(
30
)
@ContentRowHeight
(
23
)
@ColumnWidth
(
24
)
@ApiModel
(
value
=
"MaintenanceResourceDataVo"
,
description
=
"维保设施资源数据Vo"
)
public
class
MaintenanceResourceDataVo
extends
BaseRowModel
{
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-common-biz/src/main/java/com/yeejoin/amos/boot/module/common/biz/service/impl/MaintenanceCompanyServiceImpl.java
View file @
6f7e8a74
...
...
@@ -354,6 +354,7 @@ public class MaintenanceCompanyServiceImpl
LambdaQueryWrapper
<
MaintenanceCompany
>
queryWrapper
=
new
LambdaQueryWrapper
<>();
queryWrapper
.
eq
(
MaintenanceCompany:
:
getType
,
code
);
queryWrapper
.
eq
(
MaintenanceCompany:
:
getAmosId
,
userId
);
queryWrapper
.
eq
(
MaintenanceCompany:
:
getIsDelete
,
false
);
return
this
.
baseMapper
.
selectList
(
queryWrapper
);
}
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/controller/CarController.java
View file @
6f7e8a74
...
...
@@ -94,8 +94,6 @@ public class CarController extends AbstractBaseController {
EquipmentQrcodeMapper
equipmentQrcodeMapper
;
@Resource
(
name
=
"productionQRCodeFactoryMap"
)
private
Map
<
String
,
ProductionQRCode
>
messageHandMap
;
@Autowired
EquipmentIotMqttReceiveConfig
equipmentIotMqttReceiveConfig
;
@Autowired
ICarLonAndLatDataService
iCarLonAndLatDataService
;
...
...
@@ -183,7 +181,6 @@ public class CarController extends AbstractBaseController {
EquipmentSpecificSerivceImpl
.
registerMqttTopic
(
car
.
getIotCode
(),
equipmentIotMqttReceiveConfig
);
car
.
setQrCode
(
QRCodeUtil
.
generateQRCode
());
List
<
CarProperty
>
carPropertyList
=
car
.
getCarPropertyList
();
if
(
carPropertyList
.
size
()
>
0
)
{
...
...
@@ -330,7 +327,6 @@ public class CarController extends AbstractBaseController {
//用来解绑车辆
jcsFeign
.
getUserCar
(
car
.
getId
(),
car
.
getTeamId
());
EquipmentSpecificSerivceImpl
.
registerMqttTopic
(
car
.
getIotCode
(),
equipmentIotMqttReceiveConfig
);
Car
oldCar
=
iCarService
.
getById
(
car
.
getId
());
Car
car1
=
iCarService
.
updateOneById
(
car
);
CarController
controllerProxy
=
SpringUtils
.
getBean
(
CarController
.
class
);
...
...
@@ -363,30 +359,6 @@ public class CarController extends AbstractBaseController {
syncDataService
.
syncDeletedFireVehicle
(
carIds
);
iCarService
.
dataSyncDeletedIds
(
carIds
);
}
String
[]
topics
=
equipmentIotMqttReceiveConfig
.
adapter
.
getTopic
();
boolean
flag
=
false
;
for
(
String
id
:
idStrings
)
{
String
iotCode
=
iCarService
.
getById
(
id
).
getIotCode
();
if
(
StringUtil
.
isNotEmpty
(
iotCode
))
{
String
prefix
=
iotCode
.
substring
(
0
,
8
);
String
suffix
=
iotCode
.
substring
(
8
);
String
oldTopic
=
prefix
+
"/"
+
suffix
+
"/property"
;
for
(
String
topic
:
topics
)
{
if
(
topic
.
equals
(
oldTopic
))
{
flag
=
true
;
break
;
}
}
if
(
flag
)
{
try
{
equipmentIotMqttReceiveConfig
.
adapter
.
removeTopic
(
prefix
+
"/"
+
suffix
+
"/property"
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
}
}
}
CarController
controllerProxy
=
SpringUtils
.
getBean
(
CarController
.
class
);
controllerProxy
.
refreshAllCount
();
return
new
CommonResponse
(
SUCCESS
);
...
...
@@ -1099,33 +1071,11 @@ public class CarController extends AbstractBaseController {
public
boolean
delete
(
HttpServletRequest
request
,
@RequestBody
List
<
Long
>
idList
)
throws
Exception
{
List
<
Car
>
cars
=
iCarService
.
list
(
new
QueryWrapper
<
Car
>().
in
(
"id"
,
idList
));
String
[]
topics
=
equipmentIotMqttReceiveConfig
.
adapter
.
getTopic
();
cars
.
forEach
(
car
->
{
List
<
EquipmentOnCarAppVO
>
equipmentOnCarAppVOS
=
carMapper
.
selectEquipmentOnCarAppList
(
car
.
getId
());
if
(
equipmentOnCarAppVOS
.
size
()
>
0
)
{
throw
new
BadRequest
(
"有车载装备的车辆不能删除,请先卸载装备!"
);
}
boolean
flag
=
false
;
String
iotCode
=
car
.
getIotCode
();
if
(
StringUtil
.
isNotEmpty
(
car
.
getIotCode
())
&&
iotCode
.
length
()
>
8
)
{
String
prefix
=
iotCode
.
substring
(
0
,
8
);
String
suffix
=
iotCode
.
substring
(
8
);
String
oldTopic
=
prefix
+
"/"
+
suffix
+
"/property"
;
for
(
String
topic
:
topics
)
{
if
(
topic
.
equals
(
oldTopic
))
{
flag
=
true
;
break
;
}
}
if
(
flag
)
{
try
{
equipmentIotMqttReceiveConfig
.
adapter
.
removeTopic
(
prefix
+
"/"
+
suffix
+
"/property"
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
}
}
});
boolean
flag
=
iCarService
.
removeOneByIds
(
idList
);
if
(
flag
)
{
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/controller/EquipmentSpecificController.java
View file @
6f7e8a74
package
com
.
yeejoin
.
equipmanage
.
controller
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.*
;
import
java.util.stream.Collectors
;
import
com.yeejoin.equipmanage.common.entity.vo.EquiplistSpecificBySystemVO
;
...
...
@@ -226,6 +223,22 @@ public class EquipmentSpecificController extends AbstractBaseController {
}
/**
* 获取instanceId和orgCode
*
* @param sourceId
* @return
*/
@RequestMapping
(
value
=
"/getInstanceIdAndOrgCode"
,
method
=
RequestMethod
.
GET
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"获取instanceId和orgCode"
,
notes
=
"获取instanceId和orgCode"
)
public
ResponseModel
getInstanceIdAndOrgCode
(
@RequestParam
Long
sourceId
)
{
if
(
Objects
.
isNull
(
sourceId
))
{
return
CommonResponseUtil
.
success
(
null
);
}
return
CommonResponseUtil
.
success
(
equipmentSpecificSerivce
.
getInstanceIdAndOrgCode
(
sourceId
));
}
/**
* @param like 设备名称或编码code
* @param notLike wl_equipment_category,code不包含(右%),多个用英文逗号隔开
* @param status wl_stock_detail.status
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/controller/FireAutoSysManageReportController.java
0 → 100644
View file @
6f7e8a74
package
com
.
yeejoin
.
equipmanage
.
controller
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.boot.biz.common.controller.BaseController
;
import
com.yeejoin.equipmanage.common.dto.AnalysisReportLogDto
;
import
com.yeejoin.equipmanage.service.IFireAutoSysManageReportService
;
import
com.yeejoin.equipmanage.service.IFirePatrolReportService
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiParam
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.format.annotation.DateTimeFormat
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.typroject.tyboot.core.foundation.enumeration.UserType
;
import
org.typroject.tyboot.core.restful.doc.TycloudOperation
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletResponse
;
import
java.util.Date
;
/**
* @author shg
* @date 2022-04-28
*/
@RestController
@Api
(
tags
=
"消防自动化综合管理报表Api"
)
@RequestMapping
(
value
=
"/fire-manage-report"
)
@Slf4j
public
class
FireAutoSysManageReportController
extends
BaseController
{
@Autowired
IFireAutoSysManageReportService
iFireAutoSysManageReportService
;
@ApiOperation
(
value
=
"下载报表"
,
notes
=
"下载报表"
)
@GetMapping
(
value
=
"/download"
)
@TycloudOperation
(
ApiLevel
=
UserType
.
PUBLIC
,
needAuth
=
false
)
public
void
download
(
HttpServletRequest
request
,
HttpServletResponse
response
,
@ApiParam
(
value
=
"换流站编码"
,
required
=
true
)
@RequestParam
String
stationCode
,
@ApiParam
(
value
=
"开始日期"
,
required
=
true
)
@RequestParam
@DateTimeFormat
(
pattern
=
"yyyy-MM-dd"
)
Date
startDate
,
@ApiParam
(
value
=
"结束日期"
,
required
=
true
)
@RequestParam
@DateTimeFormat
(
pattern
=
"yyyy-MM-dd"
)
Date
endDate
)
{
iFireAutoSysManageReportService
.
download
(
request
,
response
,
stationCode
,
startDate
,
endDate
);
}
@ApiOperation
(
value
=
"预览报表"
,
notes
=
"预览报表"
)
@GetMapping
(
value
=
"/preview"
)
@TycloudOperation
(
ApiLevel
=
UserType
.
PUBLIC
)
public
String
preview
(
@ApiParam
(
value
=
"换流站编码"
,
required
=
true
)
@RequestParam
String
stationCode
,
@ApiParam
(
value
=
"开始日期"
,
required
=
true
)
@RequestParam
@DateTimeFormat
(
pattern
=
"yyyy-MM-dd"
)
Date
startDate
,
@ApiParam
(
value
=
"结束日期"
,
required
=
true
)
@RequestParam
@DateTimeFormat
(
pattern
=
"yyyy-MM-dd"
)
Date
endDate
)
{
return
iFireAutoSysManageReportService
.
preview
(
stationCode
,
startDate
,
endDate
);
}
@SuppressWarnings
(
"unchecked"
)
@ApiOperation
(
value
=
"所有站查询列表"
,
notes
=
"所有站查询列表"
)
@GetMapping
(
value
=
"/allPage"
)
@TycloudOperation
(
ApiLevel
=
UserType
.
PUBLIC
)
public
IPage
<
AnalysisReportLogDto
>
allPage
(
Page
page
,
@RequestParam
Integer
reportType
,
@ApiParam
(
value
=
"开始日期"
)
@RequestParam
(
required
=
false
)
@DateTimeFormat
(
pattern
=
"yyyy-MM-dd"
)
Date
startDate
,
@ApiParam
(
value
=
"结束日期"
)
@RequestParam
(
required
=
false
)
@DateTimeFormat
(
pattern
=
"yyyy-MM-dd"
)
Date
endDate
,
@ApiParam
(
value
=
"换流站编码"
)
@RequestParam
(
required
=
false
)
String
stationCode
)
{
return
iFireAutoSysManageReportService
.
allPage
(
page
,
reportType
,
startDate
,
endDate
,
stationCode
);
}
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/mapper/EquipmentSpecificAlarmLogMapper.java
View file @
6f7e8a74
...
...
@@ -30,7 +30,9 @@ public interface EquipmentSpecificAlarmLogMapper extends BaseMapper<EquipmentSpe
List
<
AppAlarmExtVo
>
findByIdListNoBuildId
(
@Param
(
"list"
)
List
<
Long
>
idBNullList
);
List
<
EquipmentSpecificAlarmLog
>
getIsConfirmByAlarmId
(
@Param
(
"equipmentSpecificId"
)
Long
equipmentSpecificId
,
@Param
(
"equipmentSpecificIndexKey"
)
String
equipmentSpecificIndexKey
,
@Param
(
"isConfirm"
)
String
isConfirm
);
List
<
EquipmentSpecificAlarmLog
>
getIsConfirmByAlarmId
(
@Param
(
"equipmentSpecificId"
)
Long
equipmentSpecificId
,
@Param
(
"equipmentSpecificIndexKey"
)
String
equipmentSpecificIndexKey
,
@Param
(
"isConfirm"
)
String
isConfirm
);
List
<
FireEquipmentFireAlarm
>
getFireEquipAlarmLogDetailsById
(
@Param
(
"list"
)
List
<
Long
>
ids
);
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/mapper/EquipmentSpecificMapper.java
View file @
6f7e8a74
...
...
@@ -5,6 +5,7 @@ import java.util.LinkedHashMap;
import
java.util.List
;
import
java.util.Map
;
import
com.yeejoin.equipmanage.common.datasync.vo.FireEquipmentVO
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Param
;
...
...
@@ -121,6 +122,8 @@ public interface EquipmentSpecificMapper extends BaseMapper<EquipmentSpecific> {
FireEquipment
getEquipSpecificDetail
(
Long
id
);
FireEquipmentVO
getEquipSpecificDetail2
(
Long
id
);
List
<
EquipmentCategory
>
getEquipSpeTypeByQrcode
(
@Param
(
"qrCode"
)
String
qrCode
);
List
<
FireEquipment
>
getEquipSpecificDetailsByEquipmentId
(
Long
equipmentId
);
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/IEquipmentSpecificSerivce.java
View file @
6f7e8a74
...
...
@@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
import
com.yeejoin.amos.boot.biz.common.bo.ReginParams
;
import
com.yeejoin.amos.feign.privilege.model.AgencyUserModel
;
import
com.yeejoin.equipmanage.common.datasync.entity.FireEquipment
;
import
com.yeejoin.equipmanage.common.datasync.vo.FireEquipmentVO
;
import
com.yeejoin.equipmanage.common.dto.EquipmentSpecificDto
;
import
com.yeejoin.equipmanage.common.dto.UserDto
;
import
com.yeejoin.equipmanage.common.entity.EquipmentSpecific
;
...
...
@@ -115,6 +116,14 @@ public interface IEquipmentSpecificSerivce extends IService<EquipmentSpecific> {
*/
FireEquipment
getEquipSpecificDetail
(
EquipmentSpecific
equipmentSpecific
);
/**
* 获取instanceId和orgCode
*
* @param sourceId
* @return
*/
FireEquipmentVO
getInstanceIdAndOrgCode
(
Long
sourceId
);
void
equipSpecificDataSync
(
Long
equipmentId
);
List
<
FireEquipment
>
getEquipSpecificDetailsByEquipmentId
(
Long
equipmentId
);
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/IFireAutoSysManageReportService.java
0 → 100644
View file @
6f7e8a74
package
com
.
yeejoin
.
equipmanage
.
service
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.equipmanage.common.dto.AnalysisReportLogDto
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletResponse
;
import
java.util.Date
;
public
interface
IFireAutoSysManageReportService
{
void
download
(
HttpServletRequest
request
,
HttpServletResponse
response
,
String
code
,
Date
startDate
,
Date
endDate
);
String
preview
(
String
code
,
Date
startDate
,
Date
endDate
);
IPage
<
AnalysisReportLogDto
>
allPage
(
Page
<
AnalysisReportLogDto
>
page
,
Integer
reportType
,
Date
startDate
,
Date
endDate
,
String
stationCode
);
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/impl/BuildingServiceImpl.java
View file @
6f7e8a74
...
...
@@ -34,7 +34,6 @@ import com.yeejoin.equipmanage.operation.SyncRiskOperator;
import
com.yeejoin.equipmanage.operation.factory.PageOperatorFactory
;
import
com.yeejoin.equipmanage.remote.RemoteSecurityService
;
import
com.yeejoin.equipmanage.service.*
;
import
liquibase.pro.packaged.S
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -48,7 +47,6 @@ import org.typroject.tyboot.core.foundation.exception.BaseException;
import
org.typroject.tyboot.core.foundation.utils.Bean
;
import
org.typroject.tyboot.core.foundation.utils.ValidationUtil
;
import
org.typroject.tyboot.core.restful.exception.instance.BadRequest
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
java.math.BigDecimal
;
import
java.text.SimpleDateFormat
;
...
...
@@ -553,8 +551,8 @@ public class BuildingServiceImpl extends ServiceImpl<BuildingMapper, Building> i
return
fireFightingSystemService
.
transferListToPointTree
(
responses
,
null
,
instanceId
);
}
public
List
<
PointTreeVo
>
getEquipTree
(
String
bizOrgCode
,
String
instanceId
,
String
displayName
)
{
@Override
public
List
<
PointTreeVo
>
getEquipTree
(
String
bizOrgCode
,
String
instanceId
,
String
displayName
)
{
//根据关键字筛选建筑树
List
<
PointTreeVo
>
responses
=
this
.
baseMapper
.
getBuildAll
(
displayName
);
if
(
ValidationUtil
.
isEmpty
(
bizOrgCode
)
&&
ValidationUtil
.
isEmpty
(
instanceId
)
&&
ValidationUtil
.
isEmpty
(
displayName
)
){
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/impl/ConfirmAlarmServiceImpl.java
View file @
6f7e8a74
...
...
@@ -203,9 +203,9 @@ public class ConfirmAlarmServiceImpl extends ServiceImpl<ConfirmAlarmMapper, Equ
i
=
equipmentSpecificAlarmLogMapper
.
updateById
(
ent
);
}
else
{
LambdaUpdateWrapper
<
EquipmentSpecificAlarmLog
>
updateWrapper
=
new
LambdaUpdateWrapper
<
EquipmentSpecificAlarmLog
>().
set
(
EquipmentSpecificAlarmLog:
:
getEquipmentSpecificId
,
ent
.
getEquipmentSpecificId
()).
set
(
EquipmentSpecificAlarmLog:
:
getConfirmDate
,
null
).
eq
(
EquipmentSpecificAlarmLog:
:
getEquipmentSpecificIndexKey
,
ent
.
getEquipmentSpecificIndexKey
()
);
eq
(
EquipmentSpecificAlarmLog:
:
getEquipmentSpecificId
,
ent
.
getEquipmentSpecificId
()).
eq
(
EquipmentSpecificAlarmLog:
:
getEquipmentSpecificIndexKey
,
ent
.
getEquipmentSpecificIndexKey
())
.
isNull
(
EquipmentSpecificAlarmLog:
:
getConfirmDate
);
i
=
equipmentSpecificAlarmLogMapper
.
update
(
ent
,
updateWrapper
);
}
//int i = confirmAlarmMapper.confirmAlam(ent);
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/impl/EquipmentSpecificSerivceImpl.java
View file @
6f7e8a74
package
com
.
yeejoin
.
equipmanage
.
service
.
impl
;
import
java.text.ParseException
;
import
java.text.SimpleDateFormat
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.Collections
;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.LinkedHashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
import
org.apache.commons.lang.StringUtils
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.context.annotation.Lazy
;
import
org.springframework.scheduling.annotation.Async
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.util.CollectionUtils
;
import
org.springframework.util.ObjectUtils
;
import
org.typroject.tyboot.core.foundation.utils.Bean
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
...
...
@@ -14,37 +38,98 @@ import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import
com.yeejoin.amos.boot.biz.common.utils.RedisUtils
;
import
com.yeejoin.amos.feign.privilege.model.AgencyUserModel
;
import
com.yeejoin.equipmanage.common.datasync.entity.FireEquipment
;
import
com.yeejoin.equipmanage.common.datasync.vo.FireEquipmentVO
;
import
com.yeejoin.equipmanage.common.dto.EquipmentSpecificDto
;
import
com.yeejoin.equipmanage.common.dto.UserDto
;
import
com.yeejoin.equipmanage.common.entity.*
;
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.EquipmentDetail
;
import
com.yeejoin.equipmanage.common.entity.EquipmentIndex
;
import
com.yeejoin.equipmanage.common.entity.EquipmentSpecific
;
import
com.yeejoin.equipmanage.common.entity.EquipmentSpecificAlarm
;
import
com.yeejoin.equipmanage.common.entity.EquipmentSpecificIndex
;
import
com.yeejoin.equipmanage.common.entity.EquipmentSystemSourceStatistics
;
import
com.yeejoin.equipmanage.common.entity.FireFightingSystemEntity
;
import
com.yeejoin.equipmanage.common.entity.FormInstance
;
import
com.yeejoin.equipmanage.common.entity.Stock
;
import
com.yeejoin.equipmanage.common.entity.StockBill
;
import
com.yeejoin.equipmanage.common.entity.StockBillDetail
;
import
com.yeejoin.equipmanage.common.entity.StockDetail
;
import
com.yeejoin.equipmanage.common.entity.UploadFile
;
import
com.yeejoin.equipmanage.common.entity.Video
;
import
com.yeejoin.equipmanage.common.entity.VideoEquipmentSpecific
;
import
com.yeejoin.equipmanage.common.entity.Warehouse
;
import
com.yeejoin.equipmanage.common.entity.WarehouseStructure
;
import
com.yeejoin.equipmanage.common.entity.dto.EquipmentSpecificDTO
;
import
com.yeejoin.equipmanage.common.entity.vo.*
;
import
com.yeejoin.equipmanage.common.enums.*
;
import
com.yeejoin.equipmanage.common.entity.vo.AlamVideoVO
;
import
com.yeejoin.equipmanage.common.entity.vo.AlarmInfoVO
;
import
com.yeejoin.equipmanage.common.entity.vo.AlarmVO
;
import
com.yeejoin.equipmanage.common.entity.vo.ComplementCodeVO
;
import
com.yeejoin.equipmanage.common.entity.vo.CurrAlaramVO
;
import
com.yeejoin.equipmanage.common.entity.vo.DetailPaneVO
;
import
com.yeejoin.equipmanage.common.entity.vo.DevInfoVO
;
import
com.yeejoin.equipmanage.common.entity.vo.DevOverviewVO
;
import
com.yeejoin.equipmanage.common.entity.vo.EquipmentIndexVO
;
import
com.yeejoin.equipmanage.common.entity.vo.EquipmentSecificDetailVO
;
import
com.yeejoin.equipmanage.common.entity.vo.EquipmentSpecificVo
;
import
com.yeejoin.equipmanage.common.entity.vo.ManufacturerVO
;
import
com.yeejoin.equipmanage.common.entity.vo.PartDetailVO
;
import
com.yeejoin.equipmanage.common.entity.vo.ProductInfoVO
;
import
com.yeejoin.equipmanage.common.entity.vo.SourceNameByEquipSpeIdVO
;
import
com.yeejoin.equipmanage.common.entity.vo.SurrVideoVO
;
import
com.yeejoin.equipmanage.common.entity.vo.TechInfoListVO
;
import
com.yeejoin.equipmanage.common.entity.vo.TechInfoVO
;
import
com.yeejoin.equipmanage.common.entity.vo.VideoVO
;
import
com.yeejoin.equipmanage.common.enums.AlarmStatusEnum
;
import
com.yeejoin.equipmanage.common.enums.BillContentEnum
;
import
com.yeejoin.equipmanage.common.enums.BitmapEnum
;
import
com.yeejoin.equipmanage.common.enums.EquipmentRiskTypeEnum
;
import
com.yeejoin.equipmanage.common.enums.FileTypeEnum
;
import
com.yeejoin.equipmanage.common.enums.SourceTypeEnum
;
import
com.yeejoin.equipmanage.common.enums.StockBillTypeEnum
;
import
com.yeejoin.equipmanage.common.exception.BaseException
;
import
com.yeejoin.equipmanage.common.utils.DateUtils
;
import
com.yeejoin.equipmanage.common.utils.QRCodeUtil
;
import
com.yeejoin.equipmanage.common.utils.StringUtil
;
import
com.yeejoin.equipmanage.common.vo.*
;
import
com.yeejoin.equipmanage.config.EquipmentIotMqttReceiveConfig
;
import
com.yeejoin.equipmanage.mapper.*
;
import
com.yeejoin.equipmanage.service.*
;
import
com.yeejoin.equipmanage.common.vo.EquipFor3DVO
;
import
com.yeejoin.equipmanage.common.vo.EquipmentDate
;
import
com.yeejoin.equipmanage.common.vo.EquipmentDetailVo
;
import
com.yeejoin.equipmanage.common.vo.EquipmentOnCarVo
;
import
com.yeejoin.equipmanage.common.vo.EquipmentSpecific3dVo
;
import
com.yeejoin.equipmanage.common.vo.VideoOnEquipmentSpecificVo
;
import
com.yeejoin.equipmanage.mapper.EquipmentIndexMapper
;
import
com.yeejoin.equipmanage.mapper.EquipmentSpecificAlarmMapper
;
import
com.yeejoin.equipmanage.mapper.EquipmentSpecificMapper
;
import
com.yeejoin.equipmanage.mapper.FireFightingSystemMapper
;
import
com.yeejoin.equipmanage.mapper.FormInstanceMapper
;
import
com.yeejoin.equipmanage.mapper.SignalClassifyMapper
;
import
com.yeejoin.equipmanage.mapper.UploadFileMapper
;
import
com.yeejoin.equipmanage.mapper.VideoMapper
;
import
com.yeejoin.equipmanage.mapper.WarehouseStructureMapper
;
import
com.yeejoin.equipmanage.service.ICarService
;
import
com.yeejoin.equipmanage.service.IEquPropertyService
;
import
com.yeejoin.equipmanage.service.IEquipmentCategoryService
;
import
com.yeejoin.equipmanage.service.IEquipmentDetailService
;
import
com.yeejoin.equipmanage.service.IEquipmentIndexService
;
import
com.yeejoin.equipmanage.service.IEquipmentService
;
import
com.yeejoin.equipmanage.service.IEquipmentSpecificAlarmService
;
import
com.yeejoin.equipmanage.service.IEquipmentSpecificIndexSerivce
;
import
com.yeejoin.equipmanage.service.IEquipmentSpecificSerivce
;
import
com.yeejoin.equipmanage.service.IEquipmentSystemSourceStatisticsService
;
import
com.yeejoin.equipmanage.service.IFireFightingSystemService
;
import
com.yeejoin.equipmanage.service.IStockBillDetailService
;
import
com.yeejoin.equipmanage.service.IStockBillService
;
import
com.yeejoin.equipmanage.service.IStockDetailService
;
import
com.yeejoin.equipmanage.service.IStockService
;
import
com.yeejoin.equipmanage.service.ISyncDataService
;
import
com.yeejoin.equipmanage.service.ISystemDicService
;
import
com.yeejoin.equipmanage.service.IUploadFileService
;
import
com.yeejoin.equipmanage.service.IVideoEquipmentSpecificService
;
import
com.yeejoin.equipmanage.service.IVideoService
;
import
com.yeejoin.equipmanage.service.IWarehouseService
;
import
com.yeejoin.equipmanage.service.IWarehouseStructureService
;
import
com.yeejoin.equipmanage.utils.RelationRedisUtil
;
import
org.apache.commons.lang.StringUtils
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.context.annotation.Lazy
;
import
org.springframework.scheduling.annotation.Async
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.util.CollectionUtils
;
import
org.springframework.util.ObjectUtils
;
import
org.typroject.tyboot.core.foundation.utils.Bean
;
import
java.text.ParseException
;
import
java.text.SimpleDateFormat
;
import
java.util.*
;
import
java.util.stream.Collectors
;
/**
* @author ZeHua Li
...
...
@@ -69,8 +154,7 @@ public class EquipmentSpecificSerivceImpl extends ServiceImpl<EquipmentSpecificM
IStockBillDetailService
stockBillDetailService
;
@Autowired
IStockBillService
stockBillService
;
@Autowired
EquipmentIotMqttReceiveConfig
equipmentIotMqttReceiveConfig
;
@Autowired
EquipmentSpecificAlarmMapper
equipmentSpecificAlarmMapper
;
@Autowired
...
...
@@ -150,6 +234,12 @@ public class EquipmentSpecificSerivceImpl extends ServiceImpl<EquipmentSpecificM
@Lazy
IEquipmentSpecificAlarmService
equipmentSpecificAlarmService
;
@Autowired
WarehouseStructureMapper
warehouseStructureMapper
;
@Autowired
FormInstanceMapper
formInstanceMapper
;
@Value
(
"${systemctl.sync.switch}"
)
private
Boolean
syncSwitch
;
...
...
@@ -501,38 +591,10 @@ public class EquipmentSpecificSerivceImpl extends ServiceImpl<EquipmentSpecificM
stockBillDetailService
.
save
(
stockBillDetail
);
}
}
registerMqttTopic
(
equipmentSpecific
.
getIotCode
(),
equipmentIotMqttReceiveConfig
);
return
equipmentSpecific
;
}
public
static
void
registerMqttTopic
(
String
iotCode
,
EquipmentIotMqttReceiveConfig
equipmentIotMqttReceiveConfig
)
{
regEquipMqttTopic
(
iotCode
,
equipmentIotMqttReceiveConfig
);
}
private
static
void
regEquipMqttTopic
(
String
iotCode
,
EquipmentIotMqttReceiveConfig
equipmentIotMqttReceiveConfig
)
{
if
(
StringUtil
.
isNotEmpty
(
iotCode
))
{
String
[]
topics
=
equipmentIotMqttReceiveConfig
.
adapter
.
getTopic
();
if
(
8
<
iotCode
.
length
())
{
String
prefix
=
iotCode
.
substring
(
0
,
8
);
String
suffix
=
iotCode
.
substring
(
8
);
String
newTopic
=
prefix
+
"/"
+
suffix
+
"/property"
;
boolean
flag
=
false
;
for
(
String
topic
:
topics
)
{
if
(
topic
.
equals
(
newTopic
))
{
flag
=
true
;
break
;
}
}
if
(!
flag
)
{
try
{
equipmentIotMqttReceiveConfig
.
adapter
.
addTopic
(
prefix
+
"/"
+
suffix
+
"/property"
,
1
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
}
}
}
}
@Override
public
Map
<
String
,
Object
>
getAll
(
Long
id
)
{
...
...
@@ -988,27 +1050,6 @@ public class EquipmentSpecificSerivceImpl extends ServiceImpl<EquipmentSpecificM
equipmentDetailService
.
removeById
(
equipmentSpecific
.
getEquipmentDetailId
());
}
if
(
res
>
0
)
{
String
iotCode
=
equipmentSpecific
.
getIotCode
();
if
(
StringUtil
.
isNotEmpty
(
iotCode
))
{
String
[]
topics
=
equipmentIotMqttReceiveConfig
.
adapter
.
getTopic
();
String
prefix
=
iotCode
.
substring
(
0
,
8
);
String
suffix
=
iotCode
.
substring
(
8
);
String
oldTopic
=
prefix
+
"/"
+
suffix
+
"/property"
;
boolean
flag
=
false
;
for
(
String
topic
:
topics
)
{
if
(
topic
.
equals
(
oldTopic
))
{
flag
=
true
;
break
;
}
}
if
(
flag
)
{
try
{
equipmentIotMqttReceiveConfig
.
adapter
.
removeTopic
(
prefix
+
"/"
+
suffix
+
"/property"
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
}
}
return
true
;
}
else
{
return
false
;
...
...
@@ -1467,12 +1508,6 @@ public class EquipmentSpecificSerivceImpl extends ServiceImpl<EquipmentSpecificM
//装备实例对应的性能指标保存
equipmentSpecificIndexSave
(
equipmentData
,
equipmentSpecific
);
}
//公共:非批量管理,注册物理监听主题
equipmentSpecifics
.
forEach
(
e
->
{
if
(
StringUtil
.
isNotEmpty
(
e
.
getIotCode
()))
{
registerTopic
(
e
.
getIotCode
());
}
});
}
relationRedisUtil
.
delSysRedisKey
(
fireFightSysIdsBuffer
.
toString
());
return
equipmentData
;
...
...
@@ -1484,6 +1519,35 @@ public class EquipmentSpecificSerivceImpl extends ServiceImpl<EquipmentSpecificM
}
@Override
public
FireEquipmentVO
getInstanceIdAndOrgCode
(
Long
sourceId
)
{
FireEquipmentVO
finalVo
=
new
FireEquipmentVO
();
WarehouseStructure
warehouseStructure
=
warehouseStructureMapper
.
selectById
(
sourceId
);
if
(
0
==
warehouseStructure
.
getParentId
())
{
finalVo
.
setInstanceId
(
String
.
valueOf
(
warehouseStructure
.
getSourceId
()));
finalVo
.
setBizOrgCode
(
warehouseStructure
.
getBizOrgCode
());
}
else
{
warehouseStructure
=
getWarehouseStructure
(
warehouseStructureMapper
.
selectById
(
warehouseStructure
.
getParentId
()));
finalVo
.
setInstanceId
(
String
.
valueOf
(
warehouseStructure
.
getSourceId
()));
finalVo
.
setBizOrgCode
(
warehouseStructure
.
getBizOrgCode
());
}
QueryWrapper
<
FormInstance
>
qw
=
new
QueryWrapper
<>();
qw
.
lambda
().
eq
(
FormInstance:
:
getInstanceId
,
sourceId
)
.
eq
(
FormInstance:
:
getFieldName
,
"bizOrgCode"
);
FormInstance
formInstance
=
formInstanceMapper
.
selectOne
(
qw
);
finalVo
.
setBizOrgCode
(
formInstance
.
getFieldValue
());
return
finalVo
;
}
public
WarehouseStructure
getWarehouseStructure
(
WarehouseStructure
warehouseStructure
)
{
if
(
0
==
warehouseStructure
.
getParentId
())
{
return
warehouseStructure
;
}
else
{
warehouseStructure
=
warehouseStructureMapper
.
selectById
(
warehouseStructure
.
getParentId
());
return
getWarehouseStructure
(
warehouseStructure
);
}
}
@Override
public
String
getEquipSpeTypeByQrcode
(
String
qrCode
)
{
List
<
EquipmentCategory
>
list
=
this
.
baseMapper
.
getEquipSpeTypeByQrcode
(
qrCode
);
if
(
list
!=
null
&&
list
.
size
()
>
0
)
{
...
...
@@ -1568,9 +1632,6 @@ public class EquipmentSpecificSerivceImpl extends ServiceImpl<EquipmentSpecificM
equipmentSystemSourceStatisticsService
.
saveBatch
(
list
);
}
private
void
registerTopic
(
String
iotCode
)
{
regEquipMqttTopic
(
iotCode
,
equipmentIotMqttReceiveConfig
);
}
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/impl/FireAutoSysManageReportServiceImpl.java
0 → 100644
View file @
6f7e8a74
package
com
.
yeejoin
.
equipmanage
.
service
.
impl
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.component.feign.model.FeignClientResult
;
import
com.yeejoin.amos.feign.systemctl.Systemctl
;
import
com.yeejoin.equipmanage.common.dto.AnalysisReportLogDto
;
import
com.yeejoin.equipmanage.common.entity.MyByteArrayMultipartFile
;
import
com.yeejoin.equipmanage.common.enums.WordTemplateTypeEum
;
import
com.yeejoin.equipmanage.common.exception.CommonException
;
import
com.yeejoin.equipmanage.common.utils.WordTemplateUtils
;
import
com.yeejoin.equipmanage.mapper.AnalysisReportLogMapper
;
import
com.yeejoin.equipmanage.service.IFireAutoSysManageReportService
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.web.multipart.MultipartFile
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletResponse
;
import
java.io.File
;
import
java.io.FileInputStream
;
import
java.io.IOException
;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.Map
;
@Slf4j
@Service
public
class
FireAutoSysManageReportServiceImpl
implements
IFireAutoSysManageReportService
{
@Autowired
AnalysisReportLogMapper
analysisReportLogMapper
;
@Override
public
void
download
(
HttpServletRequest
request
,
HttpServletResponse
response
,
String
code
,
Date
startDate
,
Date
endDate
)
{
WordTemplateUtils
instance
=
WordTemplateUtils
.
getInstance
();
Map
<
String
,
Object
>
map
=
getWordMap
(
code
,
startDate
,
endDate
);
try
{
instance
.
exportMillCertificateWord
(
request
,
response
,
map
,
(
String
)
map
.
get
(
"document_name"
),
WordTemplateTypeEum
.
firePatrolReport
.
getTemplateFile
());
}
catch
(
IOException
e
)
{
throw
new
CommonException
(
0
,
"下载消防自动化综合管理报表 失败"
);
}
}
private
Map
<
String
,
Object
>
getWordMap
(
String
code
,
Date
startDate
,
Date
endDate
)
{
Map
<
String
,
Object
>
map
=
new
HashMap
<
String
,
Object
>();
// // 查询换流站
// Map<String, Object> station = analysisReportLogMapper.getStation(code);
// if(station==null||station.isEmpty())
// {
// throw new BaseException("换流站编码不存在");
// }
// AnalysisReportLogDto analysisReportLog = new AnalysisReportLogDto();
// analysisReportLog.setStationCode(code);
// analysisReportLog.setStartDate(startDate);
// analysisReportLog.setEndDate(endDate);
// Map<String, Object> report = analysisReportLogMapper.getReport(analysisReportLog);
// SimpleDateFormat dateStat = new SimpleDateFormat("yyyy年MM月dd日");
// // 文档编号
// String timeStr1 = LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyyMMddHHmmss"));
// String documentNumber = "ZD-XFSBXC" + timeStr1;
// String documentNameTime = dateStat.format(startDate);
// map.put("document_number", documentNumber);
// // 设置文档文件名
// map.put("document_name", "消防巡查报表" + documentNameTime);
// // 换流站名称
// String stationName=(String) station.get("biz_org_name");
// map.put("station_name", stationName);
// // 统计时间
// String statisticalTime = dateStat.format(startDate) + "-" + dateStat.format(endDate);
// if (statisticalTime.contains("年0")) {
// statisticalTime = statisticalTime.replaceAll("年0", "年");
// }
// map.put("statistical_time", statisticalTime);
// // 生成日期
// String timeStr2 = LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy年MM月dd日"));
// if (timeStr2.contains("年0")) {
// timeStr2 = timeStr2.replaceAll("年0", "年");
// }
// NumberFormat nf = NumberFormat.getNumberInstance();
// nf.setMaximumFractionDigits(0);
// SimpleDateFormat dateFm = new SimpleDateFormat("EEEE", Locale.SIMPLIFIED_CHINESE);
// String currSun = dateFm.format(new Date());
// map.put("create_date", timeStr2 + currSun);
// map.put("create_date2", timeStr2);
// // 统计时间2
// map.put("statistical_time2", statisticalTime.replaceAll("-", "至"));
// // 合格数
// int qualified = 0;
// // 未合格数
// int no_qualified = 0;
// // 巡查任务数
// int task_count = ((BigDecimal) report.get("task_count")).intValue();
// map.put("task_count", task_count);
// // 完成任务数
// int complete_task_count = ((BigDecimal) report.get("complete_task_count")).intValue();
// map.put("complete_task_count", complete_task_count);
// int uncomplete_task_count = task_count - complete_task_count;
// // 未完成任务数
// map.put("uncomplete_task_count", uncomplete_task_count);
// double complete_task_percent;
// if (0 == task_count) {
// complete_task_percent = 0.0;
// log.error("-----------------------------当天巡检计划总数是 0,请检查同步服务!-----------------------------");
// } else {
// complete_task_percent = (complete_task_count/task_count)*100;
// }
// // 任务完成率
// map.put("complete_task_percent", nf.format(complete_task_percent)+"%");
// // 任务合格
// map.put("task_qualified", uncomplete_task_count!=0?"不合格":"合格");
// if(uncomplete_task_count!=0)
// {
// no_qualified++;
// }else
// {
// qualified++;
// }
// // 任务完成率合格
// map.put("task_percent_qualified", complete_task_percent!=100?"不合格":"合格");
// if(complete_task_percent!=100 )
// {
// no_qualified++;
// }else
// {
// qualified++;
// }
// // 巡查人员数
// int person_count = ((BigDecimal) report.get("person_count")).intValue();
// map.put("person_count", person_count);
// int certified_person_count = ((BigDecimal) report.get("certified_person_count")).intValue();
// // 持证人员数
// map.put("certified_person_count", certified_person_count);
//
// double certified_percent;
// if (0 == person_count) {
// certified_percent = 0.0;
// log.error("-----------------------------人员总数是 0,请检查同步服务!-----------------------------");
// } else {
// certified_percent = (certified_person_count/person_count)*100;
// }
// // 持证率
// map.put("certified_percent", nf.format(certified_percent)+"%");
// // 人员合格
// map.put("person_qualified", certified_percent!=100?"不合格":"合格");
// if(certified_percent!=100 )
// {
// no_qualified++;
// }else
// {
// qualified++;
// }
// // 应巡查设备总数
// int equipment_count = ((BigDecimal) report.get("equipment_count")).intValue();
// map.put("equipment_count", equipment_count);
// int checked_equipment_count = ((BigDecimal) report.get("checked_equipment_count")).intValue();
// // 实际巡查设备总数
// map.put("checked_equipment_count", checked_equipment_count);
// // 实际巡查设备总数-合格
// map.put("checked_equipment_qualified", checked_equipment_count!=equipment_count?"不合格":"合格");
// if(checked_equipment_count!=equipment_count )
// {
// no_qualified++;
// }else
// {
// qualified++;
// }
// // 漏查设备总数
// int unchecked_equipment_count = ((BigDecimal) report.get("unchecked_equipment_count")).intValue();
// map.put("unchecked_equipment_count", unchecked_equipment_count);
// // 漏查设备总数-合格
// map.put("unchecked_equipment_qualified", unchecked_equipment_count>0?"不合格":"合格");
// if(unchecked_equipment_count>0)
// {
// no_qualified++;
// }else
// {
// qualified++;
// }
// // 发现问题总数
// int problem_count = ((BigDecimal) report.get("problem_count")).intValue();
// map.put("problem_count", problem_count);
// // 修复问题总数
// int fixed_problem_count = ((BigDecimal) report.get("fixed_problem_count")).intValue();
// map.put("fixed_problem_count", fixed_problem_count);
// // 未修复问题总数
// int unfixed_problem_count = problem_count-fixed_problem_count;
// map.put("unfixed_problem_count", unfixed_problem_count);
// // 巡查点位数
// int checked_point_count = ((BigDecimal) report.get("checked_point_count")).intValue();
// map.put("checked_point_count", checked_point_count);
// // 合格饼图
// DefaultPieDataset pds = new DefaultPieDataset();
// pds.setValue("合格", qualified);
// pds.setValue("不合格", no_qualified);
// String qualified_pie_chart = getChartString(pds, "合格情况占比");
// map.put("qualified_pie_chart", qualified_pie_chart);
// // 设备巡查饼图
// if (!(checked_equipment_count == 0 && unchecked_equipment_count == 0)) {
// DefaultPieDataset pds2 = new DefaultPieDataset();
// pds2.setValue("已查询设备", checked_equipment_count);
// pds2.setValue("漏查设备", unchecked_equipment_count);
// String equip_pie_chart = getChartString(pds2, "设备巡查占比");
// map.put("equip_pie_chart", equip_pie_chart);
// }
// // 业务主题
// map.put("business_title", "消防巡查");
// // 缺陷清单
// List<Map<String, Object>> defect_list = analysisReportLogMapper.getDefect(analysisReportLog);
// // 缺陷总数
// map.put("defect_count", defect_list.size());
// defect_list.forEach(i->{
// i.put("defect_location", i.get("danger_position"));
// i.put("defect_description", i.get("problem_description"));
// i.put("rectified_progress", i.get("danger_state"));
// i.put("remark", i.get("remark"));
// });
//// Map<String, Object> defectMap = new HashMap<>();
//// defectMap.put("defect_location", "主控楼一层");
//// defectMap.put("defect_description", "仅有一条疏散通道,存在重大火灾隐患,不满足规范要求。");
//// defectMap.put("rectified_progress", "待评审");
//// defectMap.put("remark", "无法整改");
//// defect_list.add(defectMap);
//// Map<String, Object> defectMap2 = new HashMap<>();
//// defectMap2.put("defect_location", "主控楼一层");
//// defectMap2.put("defect_description", "防火卷帘门故障;11个水泵接合器存在问题;");
//// defectMap2.put("rectified_progress", "待治理");
//// defectMap2.put("remark", "防火卷帘已完成维修,水泵接合器未整改");
//// defect_list.add(defectMap2);
//// Map<String, Object> defectMap3 = new HashMap<>();
//// defectMap3.put("defect_location", "主控楼一层库房区域");
//// defectMap3.put("defect_description", "将办公用房作为库房使用,使用性质与原设计不符,耐火等级和相应消防设施不满足规范要求。");
//// defectMap3.put("rectified_progress", "治理完毕");
//// defectMap3.put("remark", "");
//// defect_list.add(defectMap3);
// map.put("defect_list", defect_list);
return
map
;
}
@Override
public
IPage
<
AnalysisReportLogDto
>
allPage
(
Page
<
AnalysisReportLogDto
>
page
,
Integer
reportType
,
Date
startDate
,
Date
endDate
,
String
stationCode
)
{
AnalysisReportLogDto
analysisReportLog
=
new
AnalysisReportLogDto
();
analysisReportLog
.
setStartDate
(
startDate
);
analysisReportLog
.
setEndDate
(
endDate
);
analysisReportLog
.
setReportType
(
reportType
);
analysisReportLog
.
setStationCode
(
stationCode
);
Long
rootParentId
=
Long
.
valueOf
(
String
.
valueOf
(
analysisReportLogMapper
.
getRootOrgUsr
().
get
(
"sequence_nbr"
)));
return
analysisReportLogMapper
.
allPage
(
page
,
analysisReportLog
,
rootParentId
);
}
@Override
public
String
preview
(
String
code
,
Date
startDate
,
Date
endDate
)
{
WordTemplateUtils
instance
=
WordTemplateUtils
.
getInstance
();
Map
<
String
,
Object
>
map
=
getWordMap
(
code
,
startDate
,
endDate
);
String
urlString
=
""
;
try
{
File
filePdf
=
instance
.
getWordFileItem
(
map
,
(
String
)
map
.
get
(
"document_number"
),
WordTemplateTypeEum
.
fireAutoSysManageReport
.
getTemplateFile
());
MultipartFile
multipartFile
=
new
MyByteArrayMultipartFile
(
"file"
,
"file.pdf"
,
"application/pdf"
,
file2byte
(
filePdf
));
FeignClientResult
<
Map
<
String
,
String
>>
result
=
Systemctl
.
fileStorageClient
.
updateCommonFile
(
multipartFile
);
if
(
result
!=
null
)
{
for
(
String
s
:
result
.
getResult
().
keySet
())
{
urlString
=
s
;
}
}
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
return
urlString
;
}
public
static
byte
[]
file2byte
(
File
file
)
{
try
{
FileInputStream
in
=
new
FileInputStream
(
file
);
//当文件没有结束时,每次读取一个字节显示
byte
[]
data
=
new
byte
[
in
.
available
()];
in
.
read
(
data
);
in
.
close
();
return
data
;
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
return
null
;
}
}
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/impl/StockServiceImpl.java
View file @
6f7e8a74
package
com
.
yeejoin
.
equipmanage
.
service
.
impl
;
import
java.text.SimpleDateFormat
;
import
java.util.*
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.concurrent.atomic.AtomicReference
;
import
java.util.stream.Collectors
;
import
javax.annotation.Resource
;
import
com.sun.org.apache.bcel.internal.generic.RETURN
;
import
com.yeejoin.equipmanage.common.entity.*
;
import
com.yeejoin.equipmanage.common.utils.SpringUtils
;
import
com.alibaba.fastjson.JSONObject
;
import
com.yeejoin.amos.boot.biz.common.utils.RedisUtils
;
import
com.yeejoin.equipmanage.common.entity.vo.EquipmentSpecificVo
;
import
com.yeejoin.equipmanage.common.enums.*
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.context.annotation.Lazy
;
...
...
@@ -27,18 +24,41 @@ import org.springframework.transaction.support.TransactionSynchronization;
import
org.springframework.transaction.support.TransactionSynchronizationManager
;
import
org.typroject.tyboot.core.restful.exception.instance.BadRequest
;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.yeejoin.amos.boot.biz.common.bo.ReginParams
;
import
com.yeejoin.amos.boot.biz.common.utils.RedisUtils
;
import
com.yeejoin.amos.feign.privilege.model.AgencyUserModel
;
import
com.yeejoin.equipmanage.common.entity.Equipment
;
import
com.yeejoin.equipmanage.common.entity.EquipmentDetail
;
import
com.yeejoin.equipmanage.common.entity.EquipmentIndex
;
import
com.yeejoin.equipmanage.common.entity.EquipmentManageEntity
;
import
com.yeejoin.equipmanage.common.entity.EquipmentSpecific
;
import
com.yeejoin.equipmanage.common.entity.EquipmentSpecificIndex
;
import
com.yeejoin.equipmanage.common.entity.EquipmentSystemSourceStatistics
;
import
com.yeejoin.equipmanage.common.entity.FireFightingSystemEntity
;
import
com.yeejoin.equipmanage.common.entity.Journal
;
import
com.yeejoin.equipmanage.common.entity.ManufacturerInfo
;
import
com.yeejoin.equipmanage.common.entity.Stock
;
import
com.yeejoin.equipmanage.common.entity.StockBill
;
import
com.yeejoin.equipmanage.common.entity.StockBillDetail
;
import
com.yeejoin.equipmanage.common.entity.StockDetail
;
import
com.yeejoin.equipmanage.common.entity.WarehouseStructure
;
import
com.yeejoin.equipmanage.common.entity.vo.EquipmentDetailDownloadVO
;
import
com.yeejoin.equipmanage.common.entity.vo.EquipmentSpecificVo
;
import
com.yeejoin.equipmanage.common.enums.BillContentEnum
;
import
com.yeejoin.equipmanage.common.enums.EquipStatusEnum
;
import
com.yeejoin.equipmanage.common.enums.JournalTypeEnum
;
import
com.yeejoin.equipmanage.common.enums.NoticeEnum
;
import
com.yeejoin.equipmanage.common.enums.StockBillTypeEnum
;
import
com.yeejoin.equipmanage.common.utils.ExcelUtils
;
import
com.yeejoin.equipmanage.common.utils.QRCodeUtil
;
import
com.yeejoin.equipmanage.common.utils.SpringUtils
;
import
com.yeejoin.equipmanage.common.utils.StringUtil
;
import
com.yeejoin.equipmanage.common.vo.StockDataVO
;
import
com.yeejoin.equipmanage.config.EquipmentIotMqttReceiveConfig
;
import
com.yeejoin.equipmanage.dto.EquipmentDetailDownloadTemplateDto
;
import
com.yeejoin.equipmanage.mapper.EquipmentDetailMapper
;
import
com.yeejoin.equipmanage.mapper.EquipmentMapper
;
...
...
@@ -96,8 +116,7 @@ public class StockServiceImpl extends ServiceImpl<StockMapper, Stock> implements
private
ProductionQRCode
equipmentProductionQRCode
;
@Autowired
private
IEquipmentSpecificIndexSerivce
iEquipmentSpecificIndexSerivce
;
@Autowired
EquipmentIotMqttReceiveConfig
equipmentIotMqttReceiveConfig
;
@Autowired
IManufacturerInfoService
manufacturerInfoService
;
...
...
@@ -746,9 +765,6 @@ public class StockServiceImpl extends ServiceImpl<StockMapper, Stock> implements
}).
collect
(
Collectors
.
toList
());
if
(!
equipmentSpecificIndices
.
isEmpty
())
{
iEquipmentSpecificIndexSerivce
.
saveBatch
(
equipmentSpecificIndices
);
}
if
(
equipmentSpecific
.
getSingle
()
&&
StringUtil
.
isNotEmpty
(
equipmentSpecific
.
getIotCode
()))
{
EquipmentSpecificSerivceImpl
.
registerMqttTopic
(
equipmentSpecific
.
getIotCode
(),
equipmentIotMqttReceiveConfig
);
}
}
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/impl/VideoServiceImpl.java
View file @
6f7e8a74
...
...
@@ -4,11 +4,15 @@ import com.alibaba.fastjson.JSONObject;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.google.common.base.Joiner
;
import
com.google.common.collect.Lists
;
import
com.google.common.collect.Maps
;
import
com.yeejoin.amos.boot.biz.common.dto.OrgMenuDto
;
import
com.yeejoin.equipmanage.common.dto.OrgUsrDto
;
import
com.yeejoin.equipmanage.common.entity.*
;
import
com.yeejoin.equipmanage.common.entity.dto.VideoDTO
;
import
com.yeejoin.equipmanage.common.entity.dto.VideoSaveDto
;
import
com.yeejoin.equipmanage.common.entity.publics.BaseEntity
;
import
com.yeejoin.equipmanage.common.entity.vo.*
;
import
com.yeejoin.equipmanage.common.enums.EquipmentSpeIndexEnum
;
import
com.yeejoin.equipmanage.common.enums.IndustryEnum
;
...
...
@@ -361,6 +365,16 @@ public class VideoServiceImpl extends ServiceImpl<VideoMapper, Video> implements
static
final
Pattern
urlPattern
=
Pattern
.
compile
(
"^(((http)|(https)):\\/\\/)?([0-9]{1,3}.){3}[0-9]{1,3}(:[1-3]?[0-9]{1,4})?$"
);
private
List
<
Long
>
getParents
(
Map
<
Long
,
Long
>
allMap
,
Long
wsId
)
{
List
<
Long
>
parents
=
Lists
.
newLinkedList
();
if
(
wsId
!=
null
&&
wsId
!=
0
)
{
parents
.
add
(
wsId
);
parents
.
addAll
(
getParents
(
allMap
,
allMap
.
get
(
wsId
)));
}
parents
.
remove
(
0L
);
return
parents
;
}
@Override
@Transactional
(
rollbackFor
=
{
Exception
.
class
})
public
List
<
Video
>
videoUpload
(
List
<
VideoDownloadVO
>
videoDownloadVOS
)
{
...
...
@@ -374,8 +388,19 @@ public class VideoServiceImpl extends ServiceImpl<VideoMapper, Video> implements
// 获取所有的视频设备编号
Set
<
String
>
videoCodeSet
=
new
HashSet
(
Bean
.
listToMap
(
this
.
baseMapper
.
selectList
(
new
QueryWrapper
<>()),
"code"
,
Video
.
class
).
keySet
());
// 所有建筑列表
List
<
WarehouseStructure
>
allWarehouseStructureList
=
warehouseStructureService
.
list
().
stream
().
filter
(
z
->
StringUtil
.
isNotEmpty
(
z
.
getCode
())).
collect
(
Collectors
.
toList
());
// 建筑对应父级建筑map
Map
<
Long
,
String
>
withParentMap
=
Maps
.
newHashMap
();
if
(!
ValidationUtil
.
isEmpty
(
allWarehouseStructureList
))
{
Map
<
Long
,
Long
>
allMap
=
allWarehouseStructureList
.
stream
().
collect
(
Collectors
.
toMap
(
BaseEntity:
:
getId
,
WarehouseStructure:
:
getParentId
));
allWarehouseStructureList
.
forEach
(
ws
->
withParentMap
.
put
(
ws
.
getId
(),
Joiner
.
on
(
","
).
join
(
getParents
(
allMap
,
ws
.
getId
()))));
}
// 获取所有的建筑code与id对应关系
Map
<
String
,
Long
>
buildingMap
=
new
HashMap
(
Bean
.
listToMap
(
warehouseStructureService
.
list
().
stream
().
filter
(
z
->
StringUtil
.
isNotEmpty
(
z
.
getCode
())).
collect
(
Collectors
.
toList
())
,
"code"
,
"id"
,
WarehouseStructure
.
class
));
Map
<
String
,
Long
>
buildingMap
=
new
HashMap
(
Bean
.
listToMap
(
allWarehouseStructureList
,
"code"
,
"id"
,
WarehouseStructure
.
class
));
// 获取所有的装备code与id对应关系
Map
<
String
,
Long
>
equipMap
=
new
HashMap
(
Bean
.
listToMap
(
equipmentSpecificSerivce
.
list
().
stream
().
filter
(
z
->
StringUtil
.
isNotEmpty
(
z
.
getCode
())).
collect
(
Collectors
.
toList
()),
"code"
,
"id"
,
EquipmentSpecific
.
class
));
// 获取所有重点设备code与id对应关系
...
...
@@ -398,13 +423,13 @@ public class VideoServiceImpl extends ServiceImpl<VideoMapper, Video> implements
throw
new
RuntimeException
(
"错误行"
+
rowNum
+
":视频地址不能为空"
);
}
if
(
ValidationUtil
.
isEmpty
(
x
.
getType
()))
{
throw
new
RuntimeException
(
"
机构/部门编码
不能为空,请修改后上传!"
);
throw
new
RuntimeException
(
"
视频类型(枪机/球机)
不能为空,请修改后上传!"
);
}
if
(
ValidationUtil
.
isEmpty
(
x
.
getBizOrgCode
()))
{
throw
new
RuntimeException
(
"机构
/部门名称
不能为空,请修改后上传!"
);
throw
new
RuntimeException
(
"机构
编码
不能为空,请修改后上传!"
);
}
if
(
ValidationUtil
.
isEmpty
(
x
.
getBizOrgName
()))
{
throw
new
RuntimeException
(
"
视频类型为必填字段
,请修改后上传!"
);
throw
new
RuntimeException
(
"
机构/部门名称不能为空
,请修改后上传!"
);
}
// if (!urlPattern.matcher(x.getUrl().trim()).matches()) {
// throw new RuntimeException("错误行" + rowNum + ":视频地址格式有误,仅支持协议+ip+端口的格式");
...
...
@@ -432,6 +457,7 @@ public class VideoServiceImpl extends ServiceImpl<VideoMapper, Video> implements
VideoSource
videoSource
=
new
VideoSource
();
videoSource
.
setVideoId
(
video
.
getId
());
videoSource
.
setSourceId
(
buildingMap
.
get
(
x
.
getBuildingCodes
().
trim
()));
videoSource
.
setParentSourceIds
(
withParentMap
.
get
(
buildingMap
.
get
(
x
.
getBuildingCodes
().
trim
())));
videoSources
.
add
(
videoSource
);
}
// 处理监控和多个装备关系(1个摄像头对多个装备)
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-maintenance-biz/src/main/java/com/yeejoin/amos/maintenance/business/controller/PlanTaskController.java
View file @
6f7e8a74
package
com
.
yeejoin
.
amos
.
maintenance
.
business
.
controller
;
import
com.yeejoin.amos.boot.biz.common.bo.ReginParams
;
import
com.yeejoin.amos.maintenance.business.feign.JCSFeignClient
;
import
com.yeejoin.amos.maintenance.business.param.PlanTaskPageParam
;
import
com.yeejoin.amos.maintenance.business.service.intfc.IPlanTaskService
;
import
com.yeejoin.amos.maintenance.business.service.intfc.IPointService
;
...
...
@@ -15,6 +16,7 @@ import com.yeejoin.amos.maintenance.common.enums.PlanTaskOrderByEnum;
import
com.yeejoin.amos.maintenance.core.common.request.CommonPageable
;
import
com.yeejoin.amos.maintenance.core.common.request.CommonRequest
;
import
com.yeejoin.amos.maintenance.core.framework.PersonIdentify
;
import
com.yeejoin.amos.maintenance.core.util.StringUtil
;
import
com.yeejoin.amos.maintenance.exception.YeeException
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
...
...
@@ -51,6 +53,9 @@ public class PlanTaskController extends AbstractBaseController {
@Autowired
IPointService
pointService
;
@Autowired
JCSFeignClient
jcsFeignClient
;
/**
* 计划执行查询
*
...
...
@@ -203,6 +208,12 @@ public class PlanTaskController extends AbstractBaseController {
params
.
put
(
"companyId"
,
companyId
);
params
.
put
(
"orgCode"
,
loginOrgCode
);
params
.
put
(
"userId"
,
userId
);
if
(
StringUtil
.
isNotEmpty
(
userId
))
{
ResponseModel
<
String
>
idByAmosOrgId
=
jcsFeignClient
.
getIdByAmosOrgId
(
String
.
valueOf
(
userId
));
if
(
StringUtil
.
isNotEmpty
(
idByAmosOrgId
.
getResult
()))
{
params
.
put
(
"userId"
,
idByAmosOrgId
.
getResult
());
}
}
params
.
put
(
"startTime"
,
startTime
);
params
.
put
(
"endTime"
,
endTime
);
params
.
put
(
"finishStatus"
,
finishStatus
);
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-maintenance-biz/src/main/java/com/yeejoin/amos/maintenance/business/service/impl/PlanTaskServiceImpl.java
View file @
6f7e8a74
...
...
@@ -273,23 +273,23 @@ public class PlanTaskServiceImpl implements IPlanTaskService {
log
.
info
(
strDate
+
" "
+
" 暂无待生成执行数据的计划"
);
return
;
}
//bug 5980 待办任务消息应只触发执行中的任务,漏检的任务和未开始的任务不需要触发待办任务消息.
List
<
Plan
>
planListTwo
=
new
ArrayList
<>();
//将日期格式化
SimpleDateFormat
simpleDateFormat
=
new
SimpleDateFormat
(
"HH:mm:ss"
);
LocalTime
nowTime
=
LocalTime
.
parse
(
simpleDateFormat
.
format
(
new
Date
()));
for
(
Plan
plan
:
planList
)
{
LocalTime
dayTime
=
LocalTime
.
parse
(
plan
.
getDayTime
());
// LocalTime plusHoursTime = dayTime.plusHours(1);
if
(
getTimeDifference
(
nowTime
,
dayTime
))
{
planListTwo
.
add
(
plan
);
}
}
if
(
planListTwo
==
null
||
planListTwo
.
size
()
<=
0
)
{
log
.
info
(
strDate
+
" "
+
" 暂无待生成执行数据的计划 (更改后,只执行进行中的数据)"
);
return
;
}
planList
=
planListTwo
;
//
//bug 5980 待办任务消息应只触发执行中的任务,漏检的任务和未开始的任务不需要触发待办任务消息.
//
List<Plan> planListTwo = new ArrayList<>();
//
//将日期格式化
//
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("HH:mm:ss");
//
LocalTime nowTime = LocalTime.parse(simpleDateFormat.format(new Date()));
//
for (Plan plan : planList) {
//
LocalTime dayTime = LocalTime.parse(plan.getDayTime());
//
//
LocalTime plusHoursTime = dayTime.plusHours(1);
//
if (getTimeDifference(nowTime, dayTime)) {
//
planListTwo.add(plan);
//
}
//
}
//
if (planListTwo == null || planListTwo.size() <= 0) {
//
log.info(strDate + " " + " 暂无待生成执行数据的计划 (更改后,只执行进行中的数据)");
//
return;
//
}
//
planList = planListTwo;
//2.循环遍历执行
HashMap
<
String
,
Object
>
paramMap
=
new
HashMap
<
String
,
Object
>();
for
(
Plan
plan
:
planList
)
{
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-supervision-biz/src/main/java/com/yeejoin/amos/supervision/business/service/impl/PlanTaskServiceImpl.java
View file @
6f7e8a74
...
...
@@ -801,6 +801,10 @@ public class PlanTaskServiceImpl implements IPlanTaskService {
}
public
void
sendMessage
(
Plan
plan
)
throws
Exception
{
Toke
toke
=
remoteSecurityService
.
getServerToken
();
RequestContext
.
setToken
(
toke
.
getToke
());
RequestContext
.
setProduct
(
toke
.
getProduct
());
RequestContext
.
setAppKey
(
toke
.
getAppKey
());
// 查询检查对象对应防火监督负责人id
List
<
String
>
extraUserIds
=
Lists
.
newArrayList
();
List
<
Point
>
pointList
=
pointMapper
.
getPointByPlanId
(
String
.
valueOf
(
plan
.
getId
()));
...
...
amos-boot-system-equip/src/main/resources/ftl/fireAutoSysManageReport.ftl
0 → 100644
View file @
6f7e8a74
This source diff could not be displayed because it is too large. You can
view the blob
instead.
amos-boot-system-equip/src/main/resources/mapper/ConfirmAlarmMapper.xml
View file @
6f7e8a74
...
...
@@ -14,6 +14,16 @@
and EXISTS (SELECT distinct fi.instance_id from wl_form_instance fi where fi.instance_id = sou.source_id)
limit 1
) AS sceneId,
(
SELECT
sou.source_id
FROM
wl_source_scene sou
WHERE
find_in_set(ala.equipment_specific_id,sou.point_in_scene)>0
and EXISTS (SELECT distinct fi.instance_id from wl_form_instance fi where fi.instance_id = sou.source_id)
limit 1
) AS sourceId,
ala.equipment_specific_id,
spe.code AS equipmentSpecificCode,
ala.equipment_specific_index_name,
...
...
amos-boot-system-equip/src/main/resources/mapper/EquipmentSpecificMapper.xml
View file @
6f7e8a74
...
...
@@ -777,6 +777,21 @@
WHERE
es.id = #{id}
</select>
<select
id=
"getEquipSpecificDetail2"
resultType=
"com.yeejoin.equipmanage.common.datasync.vo.FireEquipmentVO"
>
SELECT
ws.source_id AS buildid,
ws.parent_id AS parentId,
ws.biz_org_code AS bizOrgCode
FROM
wl_equipment_specific es
LEFT JOIN wl_stock_detail sd ON sd.equipment_specific_id = es.id
LEFT JOIN wl_warehouse_structure ws ON ws.id = sd.warehouse_structure_id
WHERE
es.id = #{id}
</select>
<select
id=
"getEquipSpecificDetailsByEquipmentId"
resultType=
"com.yeejoin.equipmanage.common.datasync.entity.FireEquipment"
>
SELECT
...
...
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