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
997d6888
Commit
997d6888
authored
Jan 13, 2022
by
KeYong
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'develop_ccs' of 172.16.10.76:moa/amos-boot-biz into develop_ccs
parents
fc6d7ea5
ed9c72fe
Show whitespace changes
Inline
Side-by-side
Showing
106 changed files
with
2805 additions
and
671 deletions
+2805
-671
TemplateCellWriteHandlerDate.java
...s/boot/biz/common/excel/TemplateCellWriteHandlerDate.java
+1
-1
PermissionInterceptor.java
...s/boot/biz/common/interceptors/PermissionInterceptor.java
+5
-0
DutyPersonShiftMapper.java
.../boot/module/common/api/mapper/DutyPersonShiftMapper.java
+8
-1
OrgUsrMapper.java
...join/amos/boot/module/common/api/mapper/OrgUsrMapper.java
+0
-1
IDutyCommonService.java
...os/boot/module/common/api/service/IDutyCommonService.java
+8
-1
DutyPersonShiftMapper.xml
...n-api/src/main/resources/mapper/DutyPersonShiftMapper.xml
+71
-2
DynamicFormInstanceMapper.xml
...i/src/main/resources/mapper/DynamicFormInstanceMapper.xml
+2
-0
Equipment.java
...java/com/yeejoin/equipmanage/common/entity/Equipment.java
+6
-0
EquipmentSpecificAlarmLog.java
.../equipmanage/common/entity/EquipmentSpecificAlarmLog.java
+8
-0
AlamVideoVO.java
...com/yeejoin/equipmanage/common/entity/vo/AlamVideoVO.java
+2
-0
BuildingVideoVO.java
...yeejoin/equipmanage/common/entity/vo/BuildingVideoVO.java
+2
-1
EquipmentAlarmBySystemIdOrSourceIdVO.java
...ommon/entity/vo/EquipmentAlarmBySystemIdOrSourceIdVO.java
+2
-0
AlarmCleanTypeEnum.java
.../yeejoin/equipmanage/common/enums/AlarmCleanTypeEnum.java
+23
-0
CommonPageInfoParam.java
...yeejoin/equipmanage/common/utils/CommonPageInfoParam.java
+10
-0
CommonPageParamUtil.java
...yeejoin/equipmanage/common/utils/CommonPageParamUtil.java
+2
-0
AlarmListDataVO.java
...va/com/yeejoin/equipmanage/common/vo/AlarmListDataVO.java
+7
-0
VideoOnEquipmentSpecificVo.java
...oin/equipmanage/common/vo/VideoOnEquipmentSpecificVo.java
+29
-0
AlertSubmittedMapper.xml
...cs-api/src/main/resources/mapper/AlertSubmittedMapper.xml
+2
-2
AuditEnum.java
...com/yeejoin/amos/latentdanger/common/enums/AuditEnum.java
+65
-0
LatentDanger.java
...om/yeejoin/amos/latentdanger/dao/entity/LatentDanger.java
+1
-1
ExecuteStateEnum.java
...om/yeejoin/amos/patrol/common/enums/ExecuteStateEnum.java
+1
-0
LatentDangerExcuteTypeEnum.java
.../amos/patrol/common/enums/LatentDangerExcuteTypeEnum.java
+1
-1
EquipmentUseInfoDto.java
...amos/boot/module/tzs/flc/api/dto/EquipmentUseInfoDto.java
+88
-0
EquipmentUseInfo.java
...amos/boot/module/tzs/flc/api/entity/EquipmentUseInfo.java
+151
-0
EquipmentUseInfoMapper.java
...oot/module/tzs/flc/api/mapper/EquipmentUseInfoMapper.java
+14
-0
IEquipmentAssociatedService.java
...dule/tzs/flc/api/service/IEquipmentAssociatedService.java
+3
-0
IEquipmentUseInfoService.java
.../module/tzs/flc/api/service/IEquipmentUseInfoService.java
+12
-0
EquipmentUseInfoMapper.xml
...-api/src/main/resources/mapper/EquipmentUseInfoMapper.xml
+5
-0
DutyCarController.java
.../boot/module/common/biz/controller/DutyCarController.java
+14
-0
DutyFireFightingController.java
...ule/common/biz/controller/DutyFireFightingController.java
+14
-1
DutyFirstAidController.java
.../module/common/biz/controller/DutyFirstAidController.java
+9
-1
DutyPersonController.java
...ot/module/common/biz/controller/DutyPersonController.java
+22
-2
OrgPersonController.java
...oot/module/common/biz/controller/OrgPersonController.java
+1
-1
OrgUsrController.java
...s/boot/module/common/biz/controller/OrgUsrController.java
+52
-0
ContractServiceImpl.java
...t/module/common/biz/service/impl/ContractServiceImpl.java
+15
-17
DutyCarServiceImpl.java
...ot/module/common/biz/service/impl/DutyCarServiceImpl.java
+13
-35
DutyCommonServiceImpl.java
...module/common/biz/service/impl/DutyCommonServiceImpl.java
+123
-0
DutyFireFightingServiceImpl.java
.../common/biz/service/impl/DutyFireFightingServiceImpl.java
+12
-15
DutyFirstAidServiceImpl.java
...dule/common/biz/service/impl/DutyFirstAidServiceImpl.java
+39
-26
DutyPersonServiceImpl.java
...module/common/biz/service/impl/DutyPersonServiceImpl.java
+42
-1
FailureDetailsServiceImpl.java
...le/common/biz/service/impl/FailureDetailsServiceImpl.java
+1
-0
FailureVerifyServiceImpl.java
...ule/common/biz/service/impl/FailureVerifyServiceImpl.java
+6
-1
MaintenanceCompanyServiceImpl.java
...ommon/biz/service/impl/MaintenanceCompanyServiceImpl.java
+10
-10
OrgUsrServiceImpl.java
...oot/module/common/biz/service/impl/OrgUsrServiceImpl.java
+59
-20
EquipmentAlarmController.java
...join/equipmanage/controller/EquipmentAlarmController.java
+20
-0
EquipmentSpecificController.java
...n/equipmanage/controller/EquipmentSpecificController.java
+29
-6
FireFightingSystemController.java
.../equipmanage/controller/FireFightingSystemController.java
+1
-1
IndustryController.java
...om/yeejoin/equipmanage/controller/IndustryController.java
+2
-2
EquipmentSpecificMapper.java
...m/yeejoin/equipmanage/mapper/EquipmentSpecificMapper.java
+5
-4
VideoEquipmentSpecificMapper.java
...join/equipmanage/mapper/VideoEquipmentSpecificMapper.java
+4
-0
IEquipmentSpecificSerivce.java
...eejoin/equipmanage/service/IEquipmentSpecificSerivce.java
+18
-11
IVideoEquipmentSpecificService.java
...n/equipmanage/service/IVideoEquipmentSpecificService.java
+9
-0
BuildingServiceImpl.java
...yeejoin/equipmanage/service/impl/BuildingServiceImpl.java
+3
-0
CarServiceImpl.java
.../com/yeejoin/equipmanage/service/impl/CarServiceImpl.java
+5
-1
ConfirmAlarmServiceImpl.java
...oin/equipmanage/service/impl/ConfirmAlarmServiceImpl.java
+42
-0
EquipmentDetailServiceImpl.java
.../equipmanage/service/impl/EquipmentDetailServiceImpl.java
+1
-1
EquipmentServiceImpl.java
...eejoin/equipmanage/service/impl/EquipmentServiceImpl.java
+9
-6
EquipmentSpecificAlarmServiceImpl.java
...anage/service/impl/EquipmentSpecificAlarmServiceImpl.java
+3
-0
EquipmentSpecificSerivceImpl.java
...quipmanage/service/impl/EquipmentSpecificSerivceImpl.java
+31
-0
MaintenanceResourceServiceImpl.java
...ipmanage/service/impl/MaintenanceResourceServiceImpl.java
+2
-2
VideoEquipmentSpecificImpl.java
.../equipmanage/service/impl/VideoEquipmentSpecificImpl.java
+10
-0
VideoServiceImpl.java
...om/yeejoin/equipmanage/service/impl/VideoServiceImpl.java
+3
-3
AircraftServiceImpl.java
...boot/module/jcs/biz/service/impl/AircraftServiceImpl.java
+4
-0
AlertCalledServiceImpl.java
...t/module/jcs/biz/service/impl/AlertCalledServiceImpl.java
+12
-4
AlertSubmittedServiceImpl.java
...odule/jcs/biz/service/impl/AlertSubmittedServiceImpl.java
+343
-274
PowerTransferServiceImpl.java
...module/jcs/biz/service/impl/PowerTransferServiceImpl.java
+28
-26
JcsFeignClient.java
...join/amos/latentdanger/business/feign/JcsFeignClient.java
+10
-0
LatentDangerServiceImpl.java
...danger/business/service/impl/LatentDangerServiceImpl.java
+75
-31
RuleDangerService.java
...latentdanger/business/service/impl/RuleDangerService.java
+35
-7
CheckController.java
...amos/supervision/business/controller/CheckController.java
+12
-0
CheckMapper.java
...oin/amos/supervision/business/dao/mapper/CheckMapper.java
+11
-0
JCSFeignClient.java
...ejoin/amos/supervision/business/feign/JCSFeignClient.java
+10
-0
CheckReportServiceImpl.java
...rvision/business/service/impl/CheckReportServiceImpl.java
+19
-9
CheckServiceImpl.java
...s/supervision/business/service/impl/CheckServiceImpl.java
+6
-3
HiddenDangerServiceImpl.java
...vision/business/service/impl/HiddenDangerServiceImpl.java
+14
-14
PlanServiceImpl.java
...os/supervision/business/service/impl/PlanServiceImpl.java
+1
-1
PlanTaskServiceImpl.java
...upervision/business/service/impl/PlanTaskServiceImpl.java
+2
-1
RulePlanService.java
...os/supervision/business/service/impl/RulePlanService.java
+62
-4
ICheckService.java
...mos/supervision/business/service/intfc/ICheckService.java
+2
-0
CheckVo.java
...ava/com/yeejoin/amos/supervision/business/vo/CheckVo.java
+4
-1
JobService.java
.../java/com/yeejoin/amos/supervision/quartz/JobService.java
+8
-0
EquipmentAssociatedController.java
...tzs/flc/biz/controller/EquipmentAssociatedController.java
+60
-0
EquipmentController.java
...ot/module/tzs/flc/biz/controller/EquipmentController.java
+1
-1
EquipmentUseInfoController.java
...le/tzs/flc/biz/controller/EquipmentUseInfoController.java
+116
-0
EquipmentAssociatedServiceImpl.java
.../flc/biz/service/impl/EquipmentAssociatedServiceImpl.java
+7
-0
EquipmentInformServiceImpl.java
.../tzs/flc/biz/service/impl/EquipmentInformServiceImpl.java
+50
-2
EquipmentUseInfoServiceImpl.java
...tzs/flc/biz/service/impl/EquipmentUseInfoServiceImpl.java
+34
-0
application-dev.properties
...ystem-equip/src/main/resources/application-dev.properties
+2
-2
application-docker.properties
...em-equip/src/main/resources/application-docker.properties
+73
-0
application-jcs.properties
...ystem-equip/src/main/resources/application-jcs.properties
+79
-0
application-qa.properties
...system-equip/src/main/resources/application-qa.properties
+73
-0
application-test.properties
...stem-equip/src/main/resources/application-test.properties
+66
-0
view_all.sql
...stem-equip/src/main/resources/changelog/init/view_all.sql
+141
-22
wl-3.0.1.xml
...ot-system-equip/src/main/resources/changelog/wl-3.0.1.xml
+24
-0
ConfirmAlarmMapper.xml
...em-equip/src/main/resources/mapper/ConfirmAlarmMapper.xml
+3
-1
EquipmentSpecificAlarmMapper.xml
...rc/main/resources/mapper/EquipmentSpecificAlarmMapper.xml
+35
-1
EquipmentSpecificMapper.xml
...uip/src/main/resources/mapper/EquipmentSpecificMapper.xml
+11
-0
FireFightingSystemMapper.xml
...ip/src/main/resources/mapper/FireFightingSystemMapper.xml
+12
-3
VideoEquipmentSpecificMapper.xml
...rc/main/resources/mapper/VideoEquipmentSpecificMapper.xml
+23
-0
LatentDangerMapper.xml
...anger/src/main/resources/db/mapper/LatentDangerMapper.xml
+4
-1
mt-1.0.0.xml
...-maintenance/src/main/resources/db/changelog/mt-1.0.0.xml
+12
-0
HiddenDangerMapper.xml
...ision/src/main/resources/db/mapper/HiddenDangerMapper.xml
+2
-2
dbTemplate_check.xml
...rvision/src/main/resources/db/mapper/dbTemplate_check.xml
+108
-83
dbTemplate_plan.xml
...ervision/src/main/resources/db/mapper/dbTemplate_plan.xml
+2
-0
dbTemplate_plan_task.xml
...ion/src/main/resources/db/mapper/dbTemplate_plan_task.xml
+1
-0
tzs-1.0.0.0.xml
...ystem-tzs/src/main/resources/db/changelog/tzs-1.0.0.0.xml
+50
-0
No files found.
amos-boot-biz-common/src/main/java/com/yeejoin/amos/boot/biz/common/excel/TemplateCellWriteHandlerDate.java
View file @
997d6888
...
@@ -67,7 +67,7 @@ public class TemplateCellWriteHandlerDate implements SheetWriteHandler {
...
@@ -67,7 +67,7 @@ public class TemplateCellWriteHandlerDate implements SheetWriteHandler {
// 设置下拉单元格的首行 末行 首列 末列
// 设置下拉单元格的首行 末行 首列 末列
CellRangeAddressList
rangeList
=
new
CellRangeAddressList
(
1
,
65536
,
k
,
k
);
CellRangeAddressList
rangeList
=
new
CellRangeAddressList
(
1
,
65536
,
k
,
k
);
// 如果下拉值总数大于100,则使用一个新sheet存储,避免生成的导入模板下拉值获取不到
// 如果下拉值总数大于100,则使用一个新sheet存储,避免生成的导入模板下拉值获取不到
if
(
v
.
length
>
LIMIT_NUMBER
)
{
if
(
v
.
length
>
0
)
{
//定义sheet的名称
//定义sheet的名称
//1.创建一个隐藏的sheet 名称为 hidden + k
//1.创建一个隐藏的sheet 名称为 hidden + k
String
sheetName
=
"hidden"
+
k
;
String
sheetName
=
"hidden"
+
k
;
...
...
amos-boot-biz-common/src/main/java/com/yeejoin/amos/boot/biz/common/interceptors/PermissionInterceptor.java
View file @
997d6888
...
@@ -104,7 +104,12 @@ public class PermissionInterceptor implements Interceptor {
...
@@ -104,7 +104,12 @@ public class PermissionInterceptor implements Interceptor {
BoundSql
boundSql
=
(
BoundSql
)
metaObject
.
getValue
(
"delegate.boundSql"
);
BoundSql
boundSql
=
(
BoundSql
)
metaObject
.
getValue
(
"delegate.boundSql"
);
String
sql
=
boundSql
.
getSql
();
String
sql
=
boundSql
.
getSql
();
// 将权限规则拼接到原始sql
// 将权限规则拼接到原始sql
try
{
sql
=
processSelectSql
(
sql
,
dataAuthorization
,
reginParam
,
boundSql
);
sql
=
processSelectSql
(
sql
,
dataAuthorization
,
reginParam
,
boundSql
);
}
catch
(
Exception
e
)
{
PermissionInterceptorContext
.
clean
();
logger
.
debug
(
e
.
getMessage
());
}
metaObject
.
setValue
(
"delegate.boundSql.sql"
,
sql
);
metaObject
.
setValue
(
"delegate.boundSql.sql"
,
sql
);
PermissionInterceptorContext
.
clean
();
PermissionInterceptorContext
.
clean
();
return
invocation
.
proceed
();
return
invocation
.
proceed
();
...
...
amos-boot-module/amos-boot-module-api/amos-boot-module-common-api/src/main/java/com/yeejoin/amos/boot/module/common/api/mapper/DutyPersonShiftMapper.java
View file @
997d6888
...
@@ -61,7 +61,10 @@ public interface DutyPersonShiftMapper extends BaseMapper<DutyPersonShift> {
...
@@ -61,7 +61,10 @@ public interface DutyPersonShiftMapper extends BaseMapper<DutyPersonShift> {
@Param
(
"groupCode"
)
String
groupCode
@Param
(
"groupCode"
)
String
groupCode
);
);
List
<
Map
<
String
,
Object
>>
newStationViewData
(
@Param
(
"dutyDate"
)
String
dutyDate
,
@Param
(
"groupCode"
)
String
groupCode
);
/**
/**
* 利用mysql 生成连续时间区间
* 利用mysql 生成连续时间区间
*
*
...
@@ -137,4 +140,8 @@ public interface DutyPersonShiftMapper extends BaseMapper<DutyPersonShift> {
...
@@ -137,4 +140,8 @@ public interface DutyPersonShiftMapper extends BaseMapper<DutyPersonShift> {
List
<
Map
<
String
,
Object
>>
queryByCompanyId
(
@Param
(
value
=
"bizNames"
)
List
<
String
>
bizNames
);
List
<
Map
<
String
,
Object
>>
queryByCompanyId
(
@Param
(
value
=
"bizNames"
)
List
<
String
>
bizNames
);
List
<
Map
<
String
,
Object
>>
queryByCompanyNew
(
String
bizOrgName
);
List
<
Map
<
String
,
Object
>>
queryByCompanyNew
(
String
bizOrgName
);
List
<
Map
<
String
,
Object
>>
getNewEquipmentForSpecifyDate
(
String
dutyDate
,
String
groupCode
,
String
equipmentId
,
String
equipmentName
,
String
groupByName
);
String
getFirstAidCompanyId
();
}
}
amos-boot-module/amos-boot-module-api/amos-boot-module-common-api/src/main/java/com/yeejoin/amos/boot/module/common/api/mapper/OrgUsrMapper.java
View file @
997d6888
package
com
.
yeejoin
.
amos
.
boot
.
module
.
common
.
api
.
mapper
;
package
com
.
yeejoin
.
amos
.
boot
.
module
.
common
.
api
.
mapper
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.oracle.webservices.internal.api.databinding.DatabindingMode
;
import
com.yeejoin.amos.boot.biz.common.annotations.DataAuth
;
import
com.yeejoin.amos.boot.biz.common.annotations.DataAuth
;
import
com.yeejoin.amos.boot.module.common.api.dto.*
;
import
com.yeejoin.amos.boot.module.common.api.dto.*
;
import
com.yeejoin.amos.boot.module.common.api.entity.OrgUsr
;
import
com.yeejoin.amos.boot.module.common.api.entity.OrgUsr
;
...
...
amos-boot-module/amos-boot-module-api/amos-boot-module-common-api/src/main/java/com/yeejoin/amos/boot/module/common/api/service/IDutyCommonService.java
View file @
997d6888
...
@@ -30,7 +30,14 @@ public interface IDutyCommonService {
...
@@ -30,7 +30,14 @@ public interface IDutyCommonService {
* @return ResponseModel
* @return ResponseModel
*/
*/
List
<
Map
<
String
,
Object
>>
statisticsDay
(
String
beginDate
,
String
endDate
)
throws
ParseException
;
List
<
Map
<
String
,
Object
>>
statisticsDay
(
String
beginDate
,
String
endDate
)
throws
ParseException
;
/**
* 新值班月视图
* @param beginDate
* @param endDate
* @return
* @throws ParseException
*/
List
<
Map
<
String
,
Object
>>
newStatisticsDay
(
String
beginDate
,
String
endDate
)
throws
ParseException
;
/**
/**
* 不分页查询
* 不分页查询
*
*
...
...
amos-boot-module/amos-boot-module-api/amos-boot-module-common-api/src/main/resources/mapper/DutyPersonShiftMapper.xml
View file @
997d6888
...
@@ -87,6 +87,21 @@
...
@@ -87,6 +87,21 @@
and i.group_code =#{groupCode}
and i.group_code =#{groupCode}
GROUP BY i.field_value
GROUP BY i.field_value
</select>
</select>
<select
id=
"newStationViewData"
resultType=
"java.util.Map"
>
select
i.field_value as postTypeName,
count(1) as total
from
cb_duty_person_shift s,
cb_dynamic_form_instance i
where
s.instance_id = i.instance_id
and i.field_code = 'postTypeName'
AND s.duty_date = #{dutyDate}
AND s.shift_id is not null
and i.group_code =#{groupCode}
GROUP BY i.field_value
</select>
<select
id=
"genRangeDate"
resultType=
"map"
>
<select
id=
"genRangeDate"
resultType=
"map"
>
SELECT
SELECT
DATE_FORMAT(DATE( DATE_ADD( #{beginDate}, INTERVAL @s DAY )),'%Y-%m-%d') AS date,
DATE_FORMAT(DATE( DATE_ADD( #{beginDate}, INTERVAL @s DAY )),'%Y-%m-%d') AS date,
...
@@ -187,6 +202,50 @@ select * from (
...
@@ -187,6 +202,50 @@ select * from (
group by ${groupByName}
group by ${groupByName}
</if>
</if>
</select>
</select>
<select
id=
'getNewEquipmentForSpecifyDate'
resultType=
'map'
>
select * from (
SELECT
MAX(
CASE
WHEN cd.FIELD_CODE = #{equipmentId} THEN
cd.FIELD_VALUE
END
) AS #{equipmentId},
MAX(
CASE
WHEN cd.FIELD_CODE = 'userName' THEN
cd.FIELD_VALUE
END
) AS 'userName',
MAX(
CASE
WHEN cd.FIELD_CODE = #{equipmentName} THEN
cd.FIELD_VALUE
END
) AS #{equipmentName}
FROM
cb_dynamic_form_instance cd
LEFT JOIN (
SELECT
dp.instance_id,
ds.`name`
FROM
cb_duty_person_shift dp
LEFT JOIN cb_duty_shift ds ON dp.shift_id = ds.sequence_nbr
WHERE
dp.duty_date = #{dutyDate} and dp.is_delete=0
) cds ON cd.instance_id = cds.instance_id
where cd.group_code =#{groupCode} and cds.instance_id is not null and
cd.is_delete=0
group by cd.instance_id
) result
<if
test=
"groupByName != null and groupByName!='' "
>
group by ${groupByName}
</if>
</select>
<select
id=
'getInstanceIdForSpecifyDateAndEquipment'
<select
id=
'getInstanceIdForSpecifyDateAndEquipment'
resultType=
'map'
>
resultType=
'map'
>
SELECT
SELECT
...
@@ -288,7 +347,7 @@ FROM
...
@@ -288,7 +347,7 @@ FROM
GROUP BY
GROUP BY
cd.instance_id
cd.instance_id
) ss
) ss
LEFT JOIN (
<!--
LEFT JOIN (
SELECT
SELECT
dp.instance_id,
dp.instance_id,
ds.`name`
ds.`name`
...
@@ -301,7 +360,7 @@ LEFT JOIN (
...
@@ -301,7 +360,7 @@ LEFT JOIN (
AND NAME IS NOT NULL
AND NAME IS NOT NULL
) cds ON ss.instance_id = cds.instance_id
) cds ON ss.instance_id = cds.instance_id
WHERE
WHERE
cds.NAME =#{duty}
cds.NAME =#{duty}
-->
GROUP BY
GROUP BY
ss.postTypeName
ss.postTypeName
</select>
</select>
...
@@ -331,6 +390,16 @@ WHERE
...
@@ -331,6 +390,16 @@ WHERE
</select>
</select>
<select
id=
'getFirstAidCompanyId'
resultType=
"string"
>
SELECT
sequence_nbr
FROM
cb_org_usr a
WHERE
a.is_delete = 0
AND
a.biz_org_name = '消防救援保障部'
</select>
<select
id=
'getFirstAidForTypeCodeAndCompanyId'
resultType=
"map"
>
<select
id=
'getFirstAidForTypeCodeAndCompanyId'
resultType=
"map"
>
SELECT
SELECT
...
...
amos-boot-module/amos-boot-module-api/amos-boot-module-common-api/src/main/resources/mapper/DynamicFormInstanceMapper.xml
View file @
997d6888
...
@@ -519,7 +519,9 @@ AND instance_id = (
...
@@ -519,7 +519,9 @@ AND instance_id = (
jc_user_car
jc_user_car
WHERE
WHERE
car_id = #{carId}
car_id = #{carId}
and is_delete = 0
)
)
and is_delete = 0
) and field_code='telephone'
) and field_code='telephone'
) ss
) ss
LEFT JOIN cb_org_usr cou ON ss.instance_id = cou.sequence_nbr
LEFT JOIN cb_org_usr cou ON ss.instance_id = cou.sequence_nbr
...
...
amos-boot-module/amos-boot-module-api/amos-boot-module-equip-api/src/main/java/com/yeejoin/equipmanage/common/entity/Equipment.java
View file @
997d6888
...
@@ -101,4 +101,10 @@ public class Equipment extends BaseEntity {
...
@@ -101,4 +101,10 @@ public class Equipment extends BaseEntity {
*/
*/
@TableField
(
value
=
"is_iot"
)
@TableField
(
value
=
"is_iot"
)
private
String
isIot
=
"0"
;
private
String
isIot
=
"0"
;
/**
* 警情消除策略 【0:收到复位信号自动消除;1:警情处理确认后消除】
*/
@TableField
(
value
=
"clean_type"
)
private
String
cleanType
=
"0"
;
}
}
amos-boot-module/amos-boot-module-api/amos-boot-module-equip-api/src/main/java/com/yeejoin/equipmanage/common/entity/EquipmentSpecificAlarmLog.java
View file @
997d6888
...
@@ -180,4 +180,12 @@ public class EquipmentSpecificAlarmLog extends BaseEntity {
...
@@ -180,4 +180,12 @@ public class EquipmentSpecificAlarmLog extends BaseEntity {
@TableField
(
"build_id"
)
@TableField
(
"build_id"
)
@ApiModelProperty
(
value
=
"建筑id"
)
@ApiModelProperty
(
value
=
"建筑id"
)
private
String
buildId
;
private
String
buildId
;
@TableField
(
"clean_time"
)
@ApiModelProperty
(
value
=
"消除时间"
)
private
Date
cleanTime
;
@ApiModelProperty
(
value
=
"消除状态"
)
@TableField
(
exist
=
false
)
private
String
cleanStatus
;
}
}
amos-boot-module/amos-boot-module-api/amos-boot-module-equip-api/src/main/java/com/yeejoin/equipmanage/common/entity/vo/AlamVideoVO.java
View file @
997d6888
...
@@ -23,4 +23,6 @@ public class AlamVideoVO {
...
@@ -23,4 +23,6 @@ public class AlamVideoVO {
private
String
presetPosition
;
private
String
presetPosition
;
private
String
vedioFormat
;
}
}
amos-boot-module/amos-boot-module-api/amos-boot-module-equip-api/src/main/java/com/yeejoin/equipmanage/common/entity/vo/BuildingVideoVO.java
View file @
997d6888
...
@@ -43,5 +43,6 @@ public class BuildingVideoVO {
...
@@ -43,5 +43,6 @@ public class BuildingVideoVO {
@ApiModelProperty
(
"详细地址"
)
@ApiModelProperty
(
"详细地址"
)
private
String
presetPosition
;
private
String
presetPosition
;
@ApiModelProperty
(
"视频转码"
)
private
String
vedioFormat
;
}
}
amos-boot-module/amos-boot-module-api/amos-boot-module-equip-api/src/main/java/com/yeejoin/equipmanage/common/entity/vo/EquipmentAlarmBySystemIdOrSourceIdVO.java
View file @
997d6888
...
@@ -28,4 +28,6 @@ public class EquipmentAlarmBySystemIdOrSourceIdVO {
...
@@ -28,4 +28,6 @@ public class EquipmentAlarmBySystemIdOrSourceIdVO {
* 告警类型
* 告警类型
*/
*/
private
String
type
;
private
String
type
;
private
Integer
cleanStatus
;
}
}
amos-boot-module/amos-boot-module-api/amos-boot-module-equip-api/src/main/java/com/yeejoin/equipmanage/common/enums/AlarmCleanTypeEnum.java
0 → 100644
View file @
997d6888
package
com
.
yeejoin
.
equipmanage
.
common
.
enums
;
import
lombok.AllArgsConstructor
;
import
lombok.Getter
;
/**
* @author keyong
* @title: AlarmCleanTypeEnum
* <pre>
* @description: TODO
* </pre>
* @date 2022/01/05 12:04
*/
@AllArgsConstructor
@Getter
public
enum
AlarmCleanTypeEnum
{
ZDXC
(
"0"
,
"收到复位信号自动消除"
),
QRXC
(
"1"
,
"警情处理确认后消除"
);
private
String
code
;
private
String
name
;
}
amos-boot-module/amos-boot-module-api/amos-boot-module-equip-api/src/main/java/com/yeejoin/equipmanage/common/utils/CommonPageInfoParam.java
View file @
997d6888
...
@@ -111,6 +111,16 @@ public class CommonPageInfoParam extends CommonPageable {
...
@@ -111,6 +111,16 @@ public class CommonPageInfoParam extends CommonPageable {
private
String
status
;
private
String
status
;
public
void
setCleanStatus
(
String
cleanStatus
)
{
this
.
cleanStatus
=
cleanStatus
;
}
public
String
getCleanStatus
()
{
return
cleanStatus
;
}
private
String
cleanStatus
;
public
void
setStatus
(
String
status
)
{
public
void
setStatus
(
String
status
)
{
this
.
status
=
status
;
this
.
status
=
status
;
}
}
...
...
amos-boot-module/amos-boot-module-api/amos-boot-module-equip-api/src/main/java/com/yeejoin/equipmanage/common/utils/CommonPageParamUtil.java
View file @
997d6888
...
@@ -57,6 +57,8 @@ public class CommonPageParamUtil {
...
@@ -57,6 +57,8 @@ public class CommonPageParamUtil {
param
.
setBuildIds
((
List
<
String
>)
queryRequests
.
get
(
i
).
getValue
());
param
.
setBuildIds
((
List
<
String
>)
queryRequests
.
get
(
i
).
getValue
());
}
else
if
(
"status"
.
equals
(
name
)){
}
else
if
(
"status"
.
equals
(
name
)){
param
.
setStatus
(
toString
(
queryRequests
.
get
(
i
).
getValue
()));
param
.
setStatus
(
toString
(
queryRequests
.
get
(
i
).
getValue
()));
}
else
if
(
"cleanStatus"
.
equals
(
name
)){
param
.
setCleanStatus
(
toString
(
queryRequests
.
get
(
i
).
getValue
()));
}
}
}
}
if
(
commonPageable
!=
null
){
if
(
commonPageable
!=
null
){
...
...
amos-boot-module/amos-boot-module-api/amos-boot-module-equip-api/src/main/java/com/yeejoin/equipmanage/common/vo/AlarmListDataVO.java
View file @
997d6888
...
@@ -23,6 +23,8 @@ public class AlarmListDataVO {
...
@@ -23,6 +23,8 @@ public class AlarmListDataVO {
private
String
alarmEquip
;
private
String
alarmEquip
;
private
String
type
;
private
String
alarmType
;
private
String
alarmType
;
private
String
alarmInfo
;
private
String
alarmInfo
;
...
@@ -32,4 +34,8 @@ public class AlarmListDataVO {
...
@@ -32,4 +34,8 @@ public class AlarmListDataVO {
private
Long
alarmId
;
private
Long
alarmId
;
private
String
alarmTypeCode
;
private
String
alarmTypeCode
;
private
String
cleanStatus
;
private
String
cleanStatusVal
;
}
}
\ No newline at end of file
amos-boot-module/amos-boot-module-api/amos-boot-module-equip-api/src/main/java/com/yeejoin/equipmanage/common/vo/VideoOnEquipmentSpecificVo.java
0 → 100644
View file @
997d6888
package
com
.
yeejoin
.
equipmanage
.
common
.
vo
;
import
lombok.Data
;
import
java.util.List
;
/**
* @ProjectName: amos-biz-boot
* @Package: com.yeejoin.equipmanage.common.vo
* @ClassName: VideoOnEquipmentSpecificVo
* @Author: Jianqiang Gao
* @Description: 摄像头绑定设备
* @Date: 2022/1/7 17:35
* @Version: 1.0
*/
@Data
public
class
VideoOnEquipmentSpecificVo
{
/**
* 设备ID
*/
private
Long
equipmentSpecificId
;
/**
* 摄像头Id集合
*/
private
List
<
Long
>
videoIdList
;
}
\ No newline at end of file
amos-boot-module/amos-boot-module-api/amos-boot-module-jcs-api/src/main/resources/mapper/AlertSubmittedMapper.xml
View file @
997d6888
...
@@ -161,9 +161,9 @@
...
@@ -161,9 +161,9 @@
LEFT JOIN jc_power_transfer_company b ON a.sequence_nbr = b.power_transfer_id
LEFT JOIN jc_power_transfer_company b ON a.sequence_nbr = b.power_transfer_id
LEFT JOIN jc_power_transfer_company_resources c ON c.power_transfer_company_id = b.sequence_nbr
LEFT JOIN jc_power_transfer_company_resources c ON c.power_transfer_company_id = b.sequence_nbr
where a.sequence_nbr
=
(select sequence_nbr from jc_power_transfer where alert_called_id
where a.sequence_nbr
in (select sequence_nbr from
(select sequence_nbr from jc_power_transfer where alert_called_id
= #{alertId}
= #{alertId}
order by rec_date asc limit 1,100)
order by rec_date asc limit 1,100)
as t )
</select>
</select>
...
...
amos-boot-module/amos-boot-module-api/amos-boot-module-latentdanger-api/src/main/java/com/yeejoin/amos/latentdanger/common/enums/AuditEnum.java
0 → 100644
View file @
997d6888
package
com
.
yeejoin
.
amos
.
latentdanger
.
common
.
enums
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
public
enum
AuditEnum
{
AUDIT
(
"待审核"
,
"audit"
),
REVIEW
(
"待复核"
,
"review"
);
/**
* 名称,描述
*/
private
String
name
;
/**
* 编码
*/
private
String
code
;
AuditEnum
(
String
name
,
String
code
){
this
.
name
=
name
;
this
.
code
=
code
;
}
public
static
AuditEnum
getEnum
(
String
code
)
{
AuditEnum
auditEnum
=
null
;
for
(
AuditEnum
type:
AuditEnum
.
values
())
{
if
(
type
.
getCode
().
equals
(
code
))
{
auditEnum
=
type
;
break
;
}
}
return
auditEnum
;
}
public
static
List
<
Map
<
String
,
String
>>
getEnumList
()
{
List
<
Map
<
String
,
String
>>
nameList
=
new
ArrayList
<>();
for
(
AuditEnum
c:
AuditEnum
.
values
())
{
Map
<
String
,
String
>
map
=
new
HashMap
<
String
,
String
>();
map
.
put
(
"name"
,
c
.
getName
());
map
.
put
(
"code"
,
c
.
getCode
());
nameList
.
add
(
map
);
}
return
nameList
;
}
public
String
getName
()
{
return
name
;
}
public
void
setName
(
String
name
)
{
this
.
name
=
name
;
}
public
String
getCode
()
{
return
code
;
}
public
void
setCode
(
String
code
)
{
this
.
code
=
code
;
}
}
amos-boot-module/amos-boot-module-api/amos-boot-module-latentdanger-api/src/main/java/com/yeejoin/amos/latentdanger/dao/entity/LatentDanger.java
View file @
997d6888
...
@@ -90,7 +90,7 @@ public class LatentDanger extends BasicEntity {
...
@@ -90,7 +90,7 @@ public class LatentDanger extends BasicEntity {
/**
/**
* 限制时间
* 限制时间
*/
*/
@JsonFormat
(
pattern
=
"yyyy-MM-dd"
,
timezone
=
"GMT+8"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd
HH:mm:ss
"
,
timezone
=
"GMT+8"
)
private
Date
reformLimitDate
;
private
Date
reformLimitDate
;
private
Integer
overtimeState
;
private
Integer
overtimeState
;
...
...
amos-boot-module/amos-boot-module-api/amos-boot-module-patrol-api/src/main/java/com/yeejoin/amos/patrol/common/enums/ExecuteStateEnum.java
View file @
997d6888
...
@@ -5,6 +5,7 @@ public enum ExecuteStateEnum {
...
@@ -5,6 +5,7 @@ public enum ExecuteStateEnum {
未执行
(
"未执行"
,
1
,
""
),
未执行
(
"未执行"
,
1
,
""
),
通过
(
"通过"
,
2
,
"{\"action\": \"complete\",\"variables\": [{\"name\": \"rejected\",\"value\": false}]}"
),
通过
(
"通过"
,
2
,
"{\"action\": \"complete\",\"variables\": [{\"name\": \"rejected\",\"value\": false}]}"
),
完毕
(
"完毕"
,
2
,
"{\"action\": \"complete\",\"variables\": [{\"name\": \"rejected\",\"value\": false}]}"
),
驳回
(
"驳回"
,
3
,
"{\"action\": \"complete\",\"variables\": [{\"name\": \"rejected\",\"value\": true}]}"
),
驳回
(
"驳回"
,
3
,
"{\"action\": \"complete\",\"variables\": [{\"name\": \"rejected\",\"value\": true}]}"
),
已确认
(
"已确认"
,
4
,
""
),
已确认
(
"已确认"
,
4
,
""
),
停止执行
(
"停止执行"
,
5
,
""
),
停止执行
(
"停止执行"
,
5
,
""
),
...
...
amos-boot-module/amos-boot-module-api/amos-boot-module-patrol-api/src/main/java/com/yeejoin/amos/patrol/common/enums/LatentDangerExcuteTypeEnum.java
View file @
997d6888
...
@@ -7,7 +7,7 @@ public enum LatentDangerExcuteTypeEnum {
...
@@ -7,7 +7,7 @@ public enum LatentDangerExcuteTypeEnum {
"{\"reviewResult\": \"通过\"}"
),
"{\"reviewResult\": \"通过\"}"
),
隐患评审拒绝
(
"隐患评审拒绝"
,
3
,
ExecuteStateEnum
.
驳回
,
LatentDangerStateEnum
.
已撤销
,
隐患评审拒绝
(
"隐患评审拒绝"
,
3
,
ExecuteStateEnum
.
驳回
,
LatentDangerStateEnum
.
已撤销
,
"{\"reviewResult\": \"不通过\"}"
),
"{\"reviewResult\": \"不通过\"}"
),
隐患常规治理
(
"隐患常规治理"
,
4
,
ExecuteStateEnum
.
通过
,
LatentDangerStateEnum
.
待验证
,
隐患常规治理
(
"隐患常规治理"
,
4
,
ExecuteStateEnum
.
完毕
,
LatentDangerStateEnum
.
待验证
,
"{\"rectifyResult\": \"常规整改\"}"
),
"{\"rectifyResult\": \"常规整改\"}"
),
隐患安措计划
(
"隐患安措计划"
,
5
,
ExecuteStateEnum
.
通过
,
LatentDangerStateEnum
.
安措计划中
,
隐患安措计划
(
"隐患安措计划"
,
5
,
ExecuteStateEnum
.
通过
,
LatentDangerStateEnum
.
安措计划中
,
"{\"action\": \"complete\",\"variables\": [{\"name\": \"rectification\",\"value\": \"plan\"}]}"
),
"{\"action\": \"complete\",\"variables\": [{\"name\": \"rectification\",\"value\": \"plan\"}]}"
),
...
...
amos-boot-module/amos-boot-module-api/amos-boot-module-tzs-api/src/main/java/com/yeejoin/amos/boot/module/tzs/flc/api/dto/EquipmentUseInfoDto.java
0 → 100644
View file @
997d6888
package
com
.
yeejoin
.
amos
.
boot
.
module
.
tzs
.
flc
.
api
.
dto
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
com.yeejoin.amos.boot.biz.common.dto.BaseDto
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
java.util.Date
;
/**
* 设备使用信息表
*
* @author system_generator
* @date 2022-01-05
*/
@Data
@EqualsAndHashCode
(
callSuper
=
true
)
@ApiModel
(
value
=
"EquipmentUseInfoDto"
,
description
=
"设备使用信息表"
)
public
class
EquipmentUseInfoDto
extends
BaseDto
{
private
static
final
long
serialVersionUID
=
1L
;
@ApiModelProperty
(
value
=
"使用单位名称"
)
private
String
useUnitName
;
@ApiModelProperty
(
value
=
"使用单位id"
)
private
Long
useUnitId
;
@ApiModelProperty
(
value
=
"使用单位统一信用代码"
)
private
String
useOrganizationCode
;
@ApiModelProperty
(
value
=
"产权单位名称"
)
private
String
propertyUnitName
;
@ApiModelProperty
(
value
=
"产权单位id"
)
private
Long
propertyUnitId
;
@ApiModelProperty
(
value
=
"产权统一信用代码"
)
private
String
propertyOrganizationCode
;
@ApiModelProperty
(
value
=
"使用地址"
)
private
String
useAddress
;
@ApiModelProperty
(
value
=
"经度"
)
private
String
longitude
;
@ApiModelProperty
(
value
=
"纬度"
)
private
String
latitude
;
@ApiModelProperty
(
value
=
"使用场所"
)
private
String
useSite
;
@ApiModelProperty
(
value
=
"使用场所编码"
)
private
String
useSiteCode
;
@ApiModelProperty
(
value
=
"特设编码"
)
private
String
specialCode
;
@ApiModelProperty
(
value
=
"设备注册代码"
)
private
String
registerCode
;
@ApiModelProperty
(
value
=
"96333识别码"
)
private
String
rescueCode
;
@ApiModelProperty
(
value
=
"使用登记证编码"
)
private
String
registerLicenceCode
;
@ApiModelProperty
(
value
=
"登记机关"
)
private
String
registerOrg
;
@ApiModelProperty
(
value
=
"登记机关id"
)
private
Long
registerOrgId
;
@ApiModelProperty
(
value
=
"登记日期"
)
private
Date
registerTime
;
@ApiModelProperty
(
value
=
"发证日期"
)
private
Date
issueLicenceTime
;
@ApiModelProperty
(
value
=
"投入使用日期"
)
private
Date
startUseTime
;
@ApiModelProperty
(
value
=
"设备id"
)
private
Long
equipmentId
;
}
amos-boot-module/amos-boot-module-api/amos-boot-module-tzs-api/src/main/java/com/yeejoin/amos/boot/module/tzs/flc/api/entity/EquipmentUseInfo.java
0 → 100644
View file @
997d6888
package
com
.
yeejoin
.
amos
.
boot
.
module
.
tzs
.
flc
.
api
.
entity
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
com.yeejoin.amos.boot.biz.common.entity.BaseEntity
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
lombok.experimental.Accessors
;
import
java.util.Date
;
/**
* 设备使用信息表
*
* @author system_generator
* @date 2022-01-05
*/
@Data
@EqualsAndHashCode
(
callSuper
=
true
)
@Accessors
(
chain
=
true
)
@TableName
(
"tcb_equipment_use_info"
)
public
class
EquipmentUseInfo
extends
BaseEntity
{
private
static
final
long
serialVersionUID
=
1L
;
/**
* 使用单位名称
*/
@TableField
(
"use_unit_name"
)
private
String
useUnitName
;
/**
* 使用单位id
*/
@TableField
(
"use_unit_id"
)
private
Long
useUnitId
;
/**
* 使用单位统一信用代码
*/
@TableField
(
"use_organization_code"
)
private
String
useOrganizationCode
;
/**
* 产权单位名称
*/
@TableField
(
"property_unit_name"
)
private
String
propertyUnitName
;
/**
* 产权单位id
*/
@TableField
(
"property_unit_id"
)
private
Long
propertyUnitId
;
/**
* 产权统一信用代码
*/
@TableField
(
"property_organization_code"
)
private
String
propertyOrganizationCode
;
/**
* 使用地址
*/
@TableField
(
"use_address"
)
private
String
useAddress
;
/**
* 经度
*/
@TableField
(
"longitude"
)
private
String
longitude
;
/**
* 纬度
*/
@TableField
(
"latitude"
)
private
String
latitude
;
/**
* 使用场所
*/
@TableField
(
"use_site"
)
private
String
useSite
;
/**
* 使用场所编码
*/
@TableField
(
"use_site_code"
)
private
String
useSiteCode
;
/**
* 特设编码
*/
@TableField
(
"special_code"
)
private
String
specialCode
;
/**
* 设备注册代码
*/
@TableField
(
"register_code"
)
private
String
registerCode
;
/**
* 96333识别码
*/
@TableField
(
"rescue_code"
)
private
String
rescueCode
;
/**
* 使用登记证编码
*/
@TableField
(
"register_licence_code"
)
private
String
registerLicenceCode
;
/**
* 登记机关
*/
@TableField
(
"register_org"
)
private
String
registerOrg
;
/**
* 登记机关id
*/
@TableField
(
"register_org_id"
)
private
Long
registerOrgId
;
/**
* 登记日期
*/
@TableField
(
"register_time"
)
private
Date
registerTime
;
/**
* 发证日期
*/
@TableField
(
"issue_licence_time"
)
private
Date
issueLicenceTime
;
/**
* 投入使用日期
*/
@TableField
(
"start_use_time"
)
private
Date
startUseTime
;
/**
* 设备id
*/
@TableField
(
"equipment_id"
)
private
Long
equipmentId
;
}
amos-boot-module/amos-boot-module-api/amos-boot-module-tzs-api/src/main/java/com/yeejoin/amos/boot/module/tzs/flc/api/mapper/EquipmentUseInfoMapper.java
0 → 100644
View file @
997d6888
package
com
.
yeejoin
.
amos
.
boot
.
module
.
tzs
.
flc
.
api
.
mapper
;
import
com.yeejoin.amos.boot.module.tzs.flc.api.entity.EquipmentUseInfo
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
/**
* 设备使用信息表 Mapper 接口
*
* @author system_generator
* @date 2022-01-05
*/
public
interface
EquipmentUseInfoMapper
extends
BaseMapper
<
EquipmentUseInfo
>
{
}
amos-boot-module/amos-boot-module-api/amos-boot-module-tzs-api/src/main/java/com/yeejoin/amos/boot/module/tzs/flc/api/service/IEquipmentAssociatedService.java
View file @
997d6888
package
com
.
yeejoin
.
amos
.
boot
.
module
.
tzs
.
flc
.
api
.
service
;
package
com
.
yeejoin
.
amos
.
boot
.
module
.
tzs
.
flc
.
api
.
service
;
import
com.yeejoin.amos.boot.module.tzs.flc.api.dto.EquipmentAssociatedDto
;
/**
/**
* 配套设备/设施/部件接口类
* 配套设备/设施/部件接口类
*
*
...
@@ -9,4 +11,5 @@ package com.yeejoin.amos.boot.module.tzs.flc.api.service;
...
@@ -9,4 +11,5 @@ package com.yeejoin.amos.boot.module.tzs.flc.api.service;
*/
*/
public
interface
IEquipmentAssociatedService
{
public
interface
IEquipmentAssociatedService
{
EquipmentAssociatedDto
updateAssociated
(
EquipmentAssociatedDto
model
);
}
}
amos-boot-module/amos-boot-module-api/amos-boot-module-tzs-api/src/main/java/com/yeejoin/amos/boot/module/tzs/flc/api/service/IEquipmentUseInfoService.java
0 → 100644
View file @
997d6888
package
com
.
yeejoin
.
amos
.
boot
.
module
.
tzs
.
flc
.
api
.
service
;
/**
* 设备使用信息表接口类
*
* @author system_generator
* @date 2022-01-05
*/
public
interface
IEquipmentUseInfoService
{
}
amos-boot-module/amos-boot-module-api/amos-boot-module-tzs-api/src/main/resources/mapper/EquipmentUseInfoMapper.xml
0 → 100644
View file @
997d6888
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.yeejoin.amos.boot.module.tzs.flc.api.mapper.EquipmentUseInfoMapper"
>
</mapper>
amos-boot-module/amos-boot-module-biz/amos-boot-module-common-biz/src/main/java/com/yeejoin/amos/boot/module/common/biz/controller/DutyCarController.java
View file @
997d6888
...
@@ -94,6 +94,20 @@ public class DutyCarController extends BaseController {
...
@@ -94,6 +94,20 @@ public class DutyCarController extends BaseController {
}
}
/**
/**
* 值班月视图
*
* @return ResponseModel
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@GetMapping
(
"/new-statistics-day"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"新值班月视图"
,
notes
=
"新值班月视图"
)
public
ResponseModel
<
List
<
Map
<
String
,
Object
>>>
newDutyDetail
(
@ApiParam
(
value
=
"开始日期"
,
required
=
true
)
@RequestParam
String
beginDate
,
@ApiParam
(
value
=
"结束日期"
,
required
=
true
)
@RequestParam
String
endDate
)
throws
ParseException
{
return
ResponseHelper
.
buildResponse
(
iDutyCarService
.
newStatisticsDay
(
beginDate
,
endDate
));
}
/**
* 调班
* 调班
*
*
* @return ResponseModel
* @return ResponseModel
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-common-biz/src/main/java/com/yeejoin/amos/boot/module/common/biz/controller/DutyFireFightingController.java
View file @
997d6888
...
@@ -92,7 +92,20 @@ public class DutyFireFightingController extends BaseController{
...
@@ -92,7 +92,20 @@ public class DutyFireFightingController extends BaseController{
)
throws
ParseException
{
)
throws
ParseException
{
return
ResponseHelper
.
buildResponse
(
iDutyFireFightingService
.
statisticsDay
(
beginDate
,
endDate
));
return
ResponseHelper
.
buildResponse
(
iDutyFireFightingService
.
statisticsDay
(
beginDate
,
endDate
));
}
}
/**
* 新值班月视图
*
* @return ResponseModel
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@GetMapping
(
"/new-statistics-day"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"新值班月视图"
,
notes
=
"新值班月视图"
)
public
ResponseModel
<
List
<
Map
<
String
,
Object
>>>
newDutyDetail
(
@ApiParam
(
value
=
"开始日期"
,
required
=
true
)
@RequestParam
String
beginDate
,
@ApiParam
(
value
=
"结束日期"
,
required
=
true
)
@RequestParam
String
endDate
)
throws
ParseException
{
return
ResponseHelper
.
buildResponse
(
iDutyFireFightingService
.
newStatisticsDay
(
beginDate
,
endDate
));
}
/**
/**
* 调班
* 调班
*
*
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-common-biz/src/main/java/com/yeejoin/amos/boot/module/common/biz/controller/DutyFirstAidController.java
View file @
997d6888
...
@@ -84,7 +84,15 @@ public class DutyFirstAidController extends BaseController{
...
@@ -84,7 +84,15 @@ public class DutyFirstAidController extends BaseController{
)
throws
ParseException
{
)
throws
ParseException
{
return
ResponseHelper
.
buildResponse
(
iDutyFirstAidService
.
statisticsDay
(
beginDate
,
endDate
));
return
ResponseHelper
.
buildResponse
(
iDutyFirstAidService
.
statisticsDay
(
beginDate
,
endDate
));
}
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@GetMapping
(
"/new-statistics-day"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"新值班月视图"
,
notes
=
"新值班月视图"
)
public
ResponseModel
<
List
<
Map
<
String
,
Object
>>>
newDutyDetail
(
@ApiParam
(
value
=
"开始日期"
,
required
=
true
)
@RequestParam
String
beginDate
,
@ApiParam
(
value
=
"结束日期"
,
required
=
true
)
@RequestParam
String
endDate
)
throws
ParseException
{
return
ResponseHelper
.
buildResponse
(
iDutyFirstAidService
.
newStatisticsDay
(
beginDate
,
endDate
));
}
/**
/**
* 调班
* 调班
*
*
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-common-biz/src/main/java/com/yeejoin/amos/boot/module/common/biz/controller/DutyPersonController.java
View file @
997d6888
...
@@ -93,7 +93,20 @@ public class DutyPersonController extends BaseController {
...
@@ -93,7 +93,20 @@ public class DutyPersonController extends BaseController {
)
throws
ParseException
{
)
throws
ParseException
{
return
ResponseHelper
.
buildResponse
(
iDutyPersonService
.
statisticsDay
(
beginDate
,
endDate
));
return
ResponseHelper
.
buildResponse
(
iDutyPersonService
.
statisticsDay
(
beginDate
,
endDate
));
}
}
/**
* 值班月视图
*
* @return ResponseModel
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@GetMapping
(
"/new-duty-detail"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"新值班月视图"
,
notes
=
"新值班月视图"
)
public
ResponseModel
<
List
<
Map
<
String
,
Object
>>>
newDutyDetail
(
@ApiParam
(
value
=
"开始日期"
,
required
=
true
)
@RequestParam
String
beginDate
,
@ApiParam
(
value
=
"结束日期"
,
required
=
true
)
@RequestParam
String
endDate
)
throws
ParseException
{
return
ResponseHelper
.
buildResponse
(
iDutyPersonService
.
newStatisticsDay
(
beginDate
,
endDate
));
}
/**
/**
* 调班
* 调班
...
@@ -168,7 +181,14 @@ public class DutyPersonController extends BaseController {
...
@@ -168,7 +181,14 @@ public class DutyPersonController extends BaseController {
@ApiParam
(
value
=
"岗位"
)
@RequestParam
(
required
=
false
)
String
postType
)
{
@ApiParam
(
value
=
"岗位"
)
@RequestParam
(
required
=
false
)
String
postType
)
{
return
ResponseHelper
.
buildResponse
(
iDutyPersonService
.
dayDutyPersonList
(
dutyDay
,
shiftId
,
postType
));
return
ResponseHelper
.
buildResponse
(
iDutyPersonService
.
dayDutyPersonList
(
dutyDay
,
shiftId
,
postType
));
}
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
"新查询指定日期值班人信息列表"
)
@GetMapping
(
"/new-person/{dutyDay}/list"
)
public
ResponseModel
newListDutyPerson
(
@ApiParam
(
value
=
"值班日期"
,
required
=
true
)
@PathVariable
String
dutyDay
,
@ApiParam
(
value
=
"班次id"
)
@RequestParam
(
required
=
false
)
Long
shiftId
,
@ApiParam
(
value
=
"岗位"
)
@RequestParam
(
required
=
false
)
String
postType
)
{
return
ResponseHelper
.
buildResponse
(
iDutyPersonService
.
getSchedulingDutyForSpecifyDate
(
dutyDay
,
shiftId
,
postType
));
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
"查询当前值班人信息列表"
)
@ApiOperation
(
"查询当前值班人信息列表"
)
@GetMapping
(
"/person/on_duty/list"
)
@GetMapping
(
"/person/on_duty/list"
)
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-common-biz/src/main/java/com/yeejoin/amos/boot/module/common/biz/controller/OrgPersonController.java
View file @
997d6888
...
@@ -91,7 +91,7 @@ public class OrgPersonController {
...
@@ -91,7 +91,7 @@ public class OrgPersonController {
*/
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@RequestMapping
(
value
=
"/{id}"
,
method
=
RequestMethod
.
PUT
)
@RequestMapping
(
value
=
"/{id}"
,
method
=
RequestMethod
.
PUT
)
@ApiOperation
(
httpMethod
=
"PUT"
,
value
=
"更新
单位数据"
,
notes
=
"更新单位
数据"
)
@ApiOperation
(
httpMethod
=
"PUT"
,
value
=
"更新
人员数据"
,
notes
=
"更新人员
数据"
)
public
ResponseModel
<?>
updateByIdOrgUsr
(
HttpServletRequest
request
,
@RequestBody
OrgPersonDto
OrgPersonVo
,
public
ResponseModel
<?>
updateByIdOrgUsr
(
HttpServletRequest
request
,
@RequestBody
OrgPersonDto
OrgPersonVo
,
@PathVariable
Long
id
)
throws
Exception
{
@PathVariable
Long
id
)
throws
Exception
{
OrgPersonVo
.
setBizOrgType
(
CommonConstant
.
BIZ_ORG_TYPE_PERSON
);
OrgPersonVo
.
setBizOrgType
(
CommonConstant
.
BIZ_ORG_TYPE_PERSON
);
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-common-biz/src/main/java/com/yeejoin/amos/boot/module/common/biz/controller/OrgUsrController.java
View file @
997d6888
...
@@ -257,6 +257,55 @@ public class OrgUsrController extends BaseController {
...
@@ -257,6 +257,55 @@ public class OrgUsrController extends BaseController {
page
=
iOrgUsrService
.
page
(
pageBean
,
orgUsrQueryWrapper
);
page
=
iOrgUsrService
.
page
(
pageBean
,
orgUsrQueryWrapper
);
return
page
;
return
page
;
}
}
/**
* 列表分页查询
*
* @return
*/
@TycloudOperation
(
needAuth
=
false
,
ApiLevel
=
UserType
.
AGENCY
)
@RequestMapping
(
value
=
"/new-list"
,
method
=
RequestMethod
.
GET
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"新列表分页查询---只查询当前登录人本单位下的对应数据信息"
,
notes
=
"新列表分页查询---只查询当前登录人本单位下的对应数据信息"
)
public
IPage
<
OrgUsr
>
newlistPage
(
String
pageNum
,
String
pageSize
,
OrgUsr
orgUsr
)
{
ReginParams
reginParams
=
getSelectedOrgInfo
();
String
companyIdString
=
reginParams
.
getPersonIdentity
().
getCompanyId
();
orgUsr
.
setParentId
(
companyIdString
);
Page
<
OrgUsr
>
pageBean
;
QueryWrapper
<
OrgUsr
>
orgUsrQueryWrapper
=
new
QueryWrapper
<>();
Class
<?
extends
OrgUsr
>
aClass
=
orgUsr
.
getClass
();
Arrays
.
stream
(
aClass
.
getDeclaredFields
()).
forEach
(
field
->
{
try
{
field
.
setAccessible
(
true
);
Object
o
=
field
.
get
(
orgUsr
);
if
(
o
!=
null
)
{
Class
<?>
type
=
field
.
getType
();
String
name
=
NameUtils
.
camel2Underline
(
field
.
getName
());
if
(
type
.
equals
(
Integer
.
class
))
{
Integer
fileValue
=
(
Integer
)
field
.
get
(
orgUsr
);
orgUsrQueryWrapper
.
eq
(
name
,
fileValue
);
}
else
if
(
type
.
equals
(
Long
.
class
))
{
Long
fileValue
=
(
Long
)
field
.
get
(
orgUsr
);
orgUsrQueryWrapper
.
eq
(
name
,
fileValue
);
}
else
if
(
type
.
equals
(
String
.
class
))
{
String
fileValue
=
(
String
)
field
.
get
(
orgUsr
);
orgUsrQueryWrapper
.
eq
(
name
,
fileValue
);
}
else
{
String
fileValue
=
(
String
)
field
.
get
(
orgUsr
);
orgUsrQueryWrapper
.
eq
(
name
,
fileValue
);
}
}
}
catch
(
Exception
e
)
{
}
});
orgUsrQueryWrapper
.
eq
(
"is_delete"
,
0
);
IPage
<
OrgUsr
>
page
;
if
(
StringUtils
.
isBlank
(
pageNum
)
||
StringUtils
.
isBlank
(
pageSize
))
{
pageBean
=
new
Page
<>(
0
,
Long
.
MAX_VALUE
);
}
else
{
pageBean
=
new
Page
<>(
Integer
.
parseInt
(
pageNum
),
Integer
.
parseInt
(
pageSize
));
}
page
=
iOrgUsrService
.
page
(
pageBean
,
orgUsrQueryWrapper
);
return
page
;
}
/**
/**
* 导入部门信息
* 导入部门信息
...
@@ -597,6 +646,7 @@ public class OrgUsrController extends BaseController {
...
@@ -597,6 +646,7 @@ public class OrgUsrController extends BaseController {
return
ResponseHelper
.
buildResponse
(
iOrgUsrService
.
getOrgUserByAmosUserId
(
amosUserId
));
return
ResponseHelper
.
buildResponse
(
iOrgUsrService
.
getOrgUserByAmosUserId
(
amosUserId
));
}
}
/**
/**
* 根据机构类型和登陆人bizOrgCode获取列表不分页
* 根据机构类型和登陆人bizOrgCode获取列表不分页
*
*
...
@@ -645,4 +695,5 @@ public class OrgUsrController extends BaseController {
...
@@ -645,4 +695,5 @@ public class OrgUsrController extends BaseController {
return
ResponseHelper
.
buildResponse
(
menus
);
return
ResponseHelper
.
buildResponse
(
menus
);
}
}
}
}
\ No newline at end of file
amos-boot-module/amos-boot-module-biz/amos-boot-module-common-biz/src/main/java/com/yeejoin/amos/boot/module/common/biz/service/impl/ContractServiceImpl.java
View file @
997d6888
package
com
.
yeejoin
.
amos
.
boot
.
module
.
common
.
biz
.
service
.
impl
;
package
com
.
yeejoin
.
amos
.
boot
.
module
.
common
.
biz
.
service
.
impl
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
java.util.ArrayList
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
java.util.List
;
import
com.yeejoin.amos.boot.module.common.api.dto.ContractDto
;
import
java.util.stream.Collectors
;
import
com.yeejoin.amos.boot.module.common.api.entity.Contract
;
import
com.yeejoin.amos.boot.module.common.api.entity.MaintenanceCompany
;
import
com.yeejoin.amos.boot.module.common.api.entity.SourceFile
;
import
com.yeejoin.amos.boot.module.common.api.mapper.ContractMapper
;
import
com.yeejoin.amos.boot.module.common.api.service.IContractService
;
import
com.yeejoin.amos.component.feign.model.FeignClientResult
;
import
com.yeejoin.amos.feign.systemctl.Systemctl
;
import
com.yeejoin.amos.feign.systemctl.model.FileInfoModel
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.annotation.Transactional
;
...
@@ -23,10 +16,17 @@ import org.typroject.tyboot.core.rdbms.annotation.Operator;
...
@@ -23,10 +16,17 @@ import org.typroject.tyboot.core.rdbms.annotation.Operator;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
import
org.typroject.tyboot.core.restful.exception.instance.DataNotFound
;
import
org.typroject.tyboot.core.restful.exception.instance.DataNotFound
;
import
java.util.ArrayList
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
java.util.Date
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
java.util.List
;
import
com.yeejoin.amos.boot.module.common.api.dto.ContractDto
;
import
java.util.stream.Collectors
;
import
com.yeejoin.amos.boot.module.common.api.entity.Contract
;
import
com.yeejoin.amos.boot.module.common.api.entity.MaintenanceCompany
;
import
com.yeejoin.amos.boot.module.common.api.entity.SourceFile
;
import
com.yeejoin.amos.boot.module.common.api.mapper.ContractMapper
;
import
com.yeejoin.amos.boot.module.common.api.service.IContractService
;
import
com.yeejoin.amos.component.feign.model.FeignClientResult
;
import
com.yeejoin.amos.feign.systemctl.Systemctl
;
import
com.yeejoin.amos.feign.systemctl.model.FileInfoModel
;
/**
/**
* 维保合同服务实现类
* 维保合同服务实现类
...
@@ -53,8 +53,6 @@ public class ContractServiceImpl extends BaseService<ContractDto, Contract, Cont
...
@@ -53,8 +53,6 @@ public class ContractServiceImpl extends BaseService<ContractDto, Contract, Cont
MaintenanceCompany
company
=
maintenanceCompanyService
.
getMaintenanceCompany
(
amosUserId
);
MaintenanceCompany
company
=
maintenanceCompanyService
.
getMaintenanceCompany
(
amosUserId
);
companyId
=
company
.
getSequenceNbr
();
companyId
=
company
.
getSequenceNbr
();
}
}
//
Page
<
ContractDto
>
resultPage
=
queryForContractPageByParam
(
page
,
isDelete
,
companyId
,
signedCompanyId
,
name
,
typeCode
,
Page
<
ContractDto
>
resultPage
=
queryForContractPageByParam
(
page
,
isDelete
,
companyId
,
signedCompanyId
,
name
,
typeCode
,
signedDate
);
signedDate
);
List
<
ContractDto
>
resultContractDtos
=
resultPage
.
getRecords
();
List
<
ContractDto
>
resultContractDtos
=
resultPage
.
getRecords
();
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-common-biz/src/main/java/com/yeejoin/amos/boot/module/common/biz/service/impl/DutyCarServiceImpl.java
View file @
997d6888
...
@@ -170,21 +170,23 @@ public class DutyCarServiceImpl extends DutyCommonServiceImpl implements IDutyCa
...
@@ -170,21 +170,23 @@ public class DutyCarServiceImpl extends DutyCommonServiceImpl implements IDutyCa
if
(
StringUtils
.
isNotBlank
(
instanceId
))
{
if
(
StringUtils
.
isNotBlank
(
instanceId
))
{
String
[]
instanceIds
=
instanceId
.
split
(
","
);
String
[]
instanceIds
=
instanceId
.
split
(
","
);
List
<
Map
<
String
,
Object
>>
dutyList
=
dutyPersonShiftMapper
.
getDutyForSpecifyDate
(
dutyDay
);
//
List<Map<String, Object>> dutyList = dutyPersonShiftMapper.getDutyForSpecifyDate(dutyDay);
if
(
dutyList
!=
null
&&
dutyList
.
size
()>
0
)
{
//
if(dutyList!=null && dutyList.size()>0) {
for
(
Map
<
String
,
Object
>
dutyDetail
:
dutyList
)
{
//
for (Map<String, Object> dutyDetail : dutyList) {
if
(!
dutyDetail
.
containsKey
(
"name"
))
{
//
if(!dutyDetail.containsKey("name")) {
continue
;
//
continue;
}
//
}
// 获取当前装备ID下的排版数据
// 获取当前装备ID下的排版数据
List
<
Map
<
String
,
Object
>>
specifyDateList
=
dutyPersonShiftMapper
.
getPositionStaffDutyForSpecifyDate
(
dutyDay
,
List
<
Map
<
String
,
Object
>>
specifyDateList
=
dutyPersonShiftMapper
.
getPositionStaffDutyForSpecifyDate
(
dutyDay
,
this
.
getGroupCode
(),
instanceIds
,
dutyDetail
.
get
(
"name"
).
toString
()
);
this
.
getGroupCode
(),
instanceIds
,
null
);
if
(
specifyDateList
==
null
||
specifyDateList
.
size
()
<
1
||
specifyDateList
.
get
(
0
)==
null
)
{
if
(
specifyDateList
==
null
||
specifyDateList
.
size
()
<
1
||
specifyDateList
.
get
(
0
)==
null
)
{
continue
;
continue
;
}
}
LinkedHashMap
<
String
,
Object
>
infoMap_1
=
new
LinkedHashMap
<
String
,
Object
>();
LinkedHashMap
<
String
,
Object
>
infoMap_1
=
new
LinkedHashMap
<
String
,
Object
>();
infoMap_1
.
put
(
dutyDetail
.
get
(
"name"
).
toString
(),
""
);
//取消掉班次的显示---2022-01-16 by chenhao ---start
resultList
.
add
(
infoMap_1
);
//infoMap_1.put(dutyDetail.get("name").toString(), "");
//resultList.add(infoMap_1);
//取消掉班次的显示---2022-01-16 by chenhao ---end
for
(
Map
<
String
,
Object
>
specify
:
specifyDateList
)
{
for
(
Map
<
String
,
Object
>
specify
:
specifyDateList
)
{
LinkedHashMap
<
String
,
Object
>
infoMap_2
=
new
LinkedHashMap
<
String
,
Object
>();
LinkedHashMap
<
String
,
Object
>
infoMap_2
=
new
LinkedHashMap
<
String
,
Object
>();
// infoMap_2.put(specify.get("postTypeName").toString(),specify.get("userName").toString());
// infoMap_2.put(specify.get("postTypeName").toString(),specify.get("userName").toString());
...
@@ -194,32 +196,8 @@ public class DutyCarServiceImpl extends DutyCommonServiceImpl implements IDutyCa
...
@@ -194,32 +196,8 @@ public class DutyCarServiceImpl extends DutyCommonServiceImpl implements IDutyCa
resultList
.
add
(
infoMap_2
);
resultList
.
add
(
infoMap_2
);
}
}
}
}
}
// }
}
//}
// 获取当前装备ID下的排版数据
// List<Map<String, Object>> specifyDateList = dutyPersonShiftMapper.getSpecifyDateList(dutyDay,
// this.getGroupCode(), instanceIds,null);
// for (Map<String, Object> specify : specifyDateList) {
//
// if(!specify.containsKey("name") || specify.get("name").toString()==null) {
// continue;
// }
// LinkedHashMap<String, Object> infoMap_1 =new LinkedHashMap<String, Object>();
// infoMap_1.put(specify.get("name").toString(), "");
// resultList.add(infoMap_1);
// Map<String, Object> equipmentOperatorMap = dutyPersonShiftMapper.getEquipmentOperator(dutyDay,
// this.getGroupCode(), instanceIds, "消防车驾驶员", specify.get("name").toString());
// String operator =null;
// if (equipmentOperatorMap!=null && equipmentOperatorMap.containsKey("userName")) {
// operator = equipmentOperatorMap.get("equipmentOperatorMap").toString();
// }
// LinkedHashMap<String, Object> infoMap_2 =new LinkedHashMap<String, Object>();
// infoMap_2.put("驾驶员", operator!=null?operator:"");
// resultList.add(infoMap_2);
// LinkedHashMap<String, Object> infoMap_3 =new LinkedHashMap<String, Object>();
// infoMap_3.put("战斗员",specify.get("value").toString());
// resultList.add(infoMap_3);
// }
}
}
detailList
.
add
(
resultList
);
detailList
.
add
(
resultList
);
}
}
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-common-biz/src/main/java/com/yeejoin/amos/boot/module/common/biz/service/impl/DutyCommonServiceImpl.java
View file @
997d6888
...
@@ -46,6 +46,7 @@ import com.yeejoin.amos.boot.module.common.api.entity.DynamicFormColumn;
...
@@ -46,6 +46,7 @@ import com.yeejoin.amos.boot.module.common.api.entity.DynamicFormColumn;
import
com.yeejoin.amos.boot.module.common.api.entity.DynamicFormInstance
;
import
com.yeejoin.amos.boot.module.common.api.entity.DynamicFormInstance
;
import
com.yeejoin.amos.boot.module.common.api.entity.OrgUsr
;
import
com.yeejoin.amos.boot.module.common.api.entity.OrgUsr
;
import
com.yeejoin.amos.boot.module.common.api.enums.DutyViewTypeEnum
;
import
com.yeejoin.amos.boot.module.common.api.enums.DutyViewTypeEnum
;
import
com.yeejoin.amos.boot.module.common.api.mapper.DutyPersonShiftMapper
;
import
com.yeejoin.amos.boot.module.common.api.service.IDutyCommonService
;
import
com.yeejoin.amos.boot.module.common.api.service.IDutyCommonService
;
/**
/**
...
@@ -76,6 +77,9 @@ public class DutyCommonServiceImpl implements IDutyCommonService {
...
@@ -76,6 +77,9 @@ public class DutyCommonServiceImpl implements IDutyCommonService {
@Autowired
@Autowired
OrgUsrServiceImpl
orgUsrService
;
OrgUsrServiceImpl
orgUsrService
;
@Autowired
DutyPersonShiftMapper
dutyPersonShiftMapper
;
/**
/**
* 每天单个班次执勤人数全部小于等于3人
* 每天单个班次执勤人数全部小于等于3人
*/
*/
...
@@ -214,6 +218,125 @@ public class DutyCommonServiceImpl implements IDutyCommonService {
...
@@ -214,6 +218,125 @@ public class DutyCommonServiceImpl implements IDutyCommonService {
/*bug2468 值班排班,日历视图单班次执勤人数满足≤3且班次≤2时,值班显示方式错误 陈召 结束*/
/*bug2468 值班排班,日历视图单班次执勤人数满足≤3且班次≤2时,值班显示方式错误 陈召 结束*/
}
}
public
List
<
Map
<
String
,
Object
>>
newStatisticsDay
(
String
beginDate
,
String
endDate
)
throws
ParseException
{
Date
dateBegin
=
DateUtils
.
dateParse
(
beginDate
,
DateUtils
.
DATE_PATTERN
);
String
timeStart
=
DateUtils
.
dateTimeToDateString
(
dateBegin
);
Date
dateEnd
=
DateUtils
.
dateParse
(
endDate
,
DateUtils
.
DATE_PATTERN
);
String
timeEnd
=
DateUtils
.
dateTimeToDateString
(
dateEnd
);
List
<
String
>
betweenDate
=
getBetweenDate
(
timeStart
,
timeEnd
);
//拿到每一天的视图展示
String
beginTime
=
null
;
String
endTime
=
null
;
List
<
Map
<
String
,
Object
>>
viewTypeResult
=
new
ArrayList
<>();
for
(
String
time
:
betweenDate
)
{
beginTime
=
time
+
" 00:00:00"
;
endTime
=
time
+
" 23:59:59"
;
Map
<
String
,
Object
>
viewTypeMap
=
new
HashMap
<>();
viewTypeMap
.
put
(
"date"
,
time
);
viewTypeResult
.
add
(
viewTypeMap
);
}
List
<
Map
<
String
,
Object
>>
rangeDate
=
dutyPersonShiftService
.
getBaseMapper
().
genRangeDate
(
beginDate
,
endDate
);
List
<
Map
<
String
,
Object
>>
resultMap
=
new
ArrayList
<>();
for
(
Map
<
String
,
Object
>
stringObjectMap
:
viewTypeResult
)
{
for
(
Map
<
String
,
Object
>
objectMap
:
rangeDate
)
{
if
(
stringObjectMap
.
get
(
"date"
).
equals
(
objectMap
.
get
(
"date"
))){
Map
<
String
,
Object
>
result
=
new
LinkedHashMap
<>();
result
.
put
(
"key"
,
objectMap
.
get
(
"date"
));
String
dateString
=
objectMap
.
get
(
"date"
).
toString
();
if
(
this
.
getGroupCode
().
equals
(
"dutyPerson"
))
{
result
.
put
(
"data"
,
getPersonPostTypeNameAndCount
(
dateString
));
}
else
if
(
this
.
getGroupCode
().
equals
(
"dutyCar"
))
{
result
.
put
(
"data"
,
getCarPostTypeNameAndCount
(
dateString
));
}
else
if
(
this
.
getGroupCode
().
equals
(
"dutyFireFighting"
))
{
result
.
put
(
"data"
,
getFireFightingPostTypeNameAndCount
(
dateString
));
}
else
if
(
this
.
getGroupCode
().
equals
(
"dutyFirstAid"
))
{
result
.
put
(
"data"
,
getFirstAidPostTypeNameAndCount
(
dateString
));
}
resultMap
.
add
(
result
);
}
}
}
return
resultMap
;
}
/**
* 排班值班人员的统计类型为:
* 岗位: 岗位人员数量
* @param dutyDate
* @return
*/
public
Object
getPersonPostTypeNameAndCount
(
String
dutyDate
)
{
return
dutyPersonShiftService
.
getBaseMapper
().
newStationViewData
(
dutyDate
,
this
.
getGroupCode
());
}
/**
* 车辆值班人员左侧的统计: 只有几辆车
* @param dutyDate
* @return
*/
public
Object
getCarPostTypeNameAndCount
(
String
dutyDate
)
{
Map
<
String
,
Object
>
map
=
new
HashMap
<
String
,
Object
>();
int
station
=
0
;
int
person
=
0
;
List
<
Map
<
String
,
Object
>>
equipmentList
=
dutyPersonShiftMapper
.
getEquipmentForSpecifyDate
(
dutyDate
,
this
.
getGroupCode
(),
"carId"
,
"carName"
,
"teamName"
,
"result.carId"
);
if
(
equipmentList
==
null
||
equipmentList
.
size
()<
1
||
equipmentList
.
get
(
0
)==
null
)
{
station
=
0
;
}
else
{
station
=
equipmentList
.
size
();
}
map
.
put
(
"station"
,
station
);
List
<
Map
<
String
,
Object
>>
list
=
dutyPersonShiftService
.
getBaseMapper
().
newStationViewData
(
dutyDate
,
this
.
getGroupCode
());
for
(
Map
<
String
,
Object
>
map2
:
list
)
{
person
=
person
+
Integer
.
parseInt
(
map2
.
get
(
"total"
).
toString
());
}
map
.
put
(
"person"
,
person
);
return
map
;
}
public
Object
getFireFightingPostTypeNameAndCount
(
String
dutyDate
)
{
Map
<
String
,
Object
>
map
=
new
HashMap
<
String
,
Object
>();
int
station
=
0
;
int
person
=
0
;
List
<
Map
<
String
,
Object
>>
equipmentList
=
dutyPersonShiftMapper
.
getEquipmentForSpecifyDate
(
dutyDate
,
this
.
getGroupCode
(),
"fireFightingId"
,
"fireFighting"
,
"teamName"
,
"result.fireFightingId"
);
if
(
equipmentList
==
null
||
equipmentList
.
size
()<
1
||
equipmentList
.
get
(
0
)==
null
)
{
station
=
0
;
}
else
{
station
=
equipmentList
.
size
();
}
map
.
put
(
"station"
,
station
);
List
<
Map
<
String
,
Object
>>
list
=
dutyPersonShiftService
.
getBaseMapper
().
newStationViewData
(
dutyDate
,
this
.
getGroupCode
());
for
(
Map
<
String
,
Object
>
map2
:
list
)
{
person
=
person
+
Integer
.
parseInt
(
map2
.
get
(
"total"
).
toString
());
}
map
.
put
(
"person"
,
person
);
return
map
;
}
public
Object
getFirstAidPostTypeNameAndCount
(
String
dutyDate
)
{
Map
<
String
,
Object
>
map
=
new
HashMap
<
String
,
Object
>();
int
station
=
0
;
int
person
=
0
;
List
<
Map
<
String
,
Object
>>
equipmentList
=
dutyPersonShiftMapper
.
getEquipmentForSpecifyDate
(
dutyDate
,
this
.
getGroupCode
(),
"firstAidId"
,
"firstAid"
,
"teamName"
,
"result.firstAidId"
);
if
(
equipmentList
==
null
||
equipmentList
.
size
()<
1
||
equipmentList
.
get
(
0
)==
null
)
{
station
=
0
;
}
else
{
station
=
equipmentList
.
size
();
}
map
.
put
(
"station"
,
station
);
List
<
Map
<
String
,
Object
>>
list
=
dutyPersonShiftService
.
getBaseMapper
().
newStationViewData
(
dutyDate
,
this
.
getGroupCode
());
for
(
Map
<
String
,
Object
>
map2
:
list
)
{
person
=
person
+
Integer
.
parseInt
(
map2
.
get
(
"total"
).
toString
());
}
map
.
put
(
"person"
,
person
);
return
map
;
}
private
Object
buildViewData
(
DutyViewTypeEnum
viewTypeEnum
,
String
dutyDate
,
String
appKey
)
{
private
Object
buildViewData
(
DutyViewTypeEnum
viewTypeEnum
,
String
dutyDate
,
String
appKey
)
{
List
<
Map
<
String
,
Object
>>
result
=
new
ArrayList
<>();
List
<
Map
<
String
,
Object
>>
result
=
new
ArrayList
<>();
switch
(
viewTypeEnum
)
{
switch
(
viewTypeEnum
)
{
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-common-biz/src/main/java/com/yeejoin/amos/boot/module/common/biz/service/impl/DutyFireFightingServiceImpl.java
View file @
997d6888
package
com
.
yeejoin
.
amos
.
boot
.
module
.
common
.
biz
.
service
.
impl
;
package
com
.
yeejoin
.
amos
.
boot
.
module
.
common
.
biz
.
service
.
impl
;
import
static
org
.
hamcrest
.
CoreMatchers
.
nullValue
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.HashMap
;
import
java.util.LinkedHashMap
;
import
java.util.LinkedHashMap
;
...
@@ -15,7 +13,6 @@ import org.springframework.transaction.annotation.Transactional;
...
@@ -15,7 +13,6 @@ import org.springframework.transaction.annotation.Transactional;
import
org.springframework.util.ObjectUtils
;
import
org.springframework.util.ObjectUtils
;
import
org.typroject.tyboot.core.foundation.utils.Bean
;
import
org.typroject.tyboot.core.foundation.utils.Bean
;
import
com.itextpdf.text.pdf.PdfStructTreeController.returnType
;
import
com.yeejoin.amos.boot.module.common.api.dto.DutyFireFightingDto
;
import
com.yeejoin.amos.boot.module.common.api.dto.DutyFireFightingDto
;
import
com.yeejoin.amos.boot.module.common.api.dto.DynamicFormInstanceDto
;
import
com.yeejoin.amos.boot.module.common.api.dto.DynamicFormInstanceDto
;
import
com.yeejoin.amos.boot.module.common.api.dto.FireStationDto
;
import
com.yeejoin.amos.boot.module.common.api.dto.FireStationDto
;
...
@@ -85,29 +82,29 @@ public class DutyFireFightingServiceImpl extends DutyCommonServiceImpl implement
...
@@ -85,29 +82,29 @@ public class DutyFireFightingServiceImpl extends DutyCommonServiceImpl implement
if
(
StringUtils
.
isNotBlank
(
instanceId
))
{
if
(
StringUtils
.
isNotBlank
(
instanceId
))
{
String
[]
instanceIds
=
instanceId
.
split
(
","
);
String
[]
instanceIds
=
instanceId
.
split
(
","
);
List
<
Map
<
String
,
Object
>>
dutyList
=
dutyPersonShiftMapper
.
getDutyForSpecifyDate
(
dutyDay
);
//
List<Map<String, Object>> dutyList = dutyPersonShiftMapper.getDutyForSpecifyDate(dutyDay);
if
(
dutyList
!=
null
&&
dutyList
.
size
()>
0
)
{
//
if(dutyList!=null && dutyList.size()>0) {
for
(
Map
<
String
,
Object
>
dutyDetail
:
dutyList
)
{
//
for (Map<String, Object> dutyDetail : dutyList) {
if
(!
dutyDetail
.
containsKey
(
"name"
))
{
//
if(!dutyDetail.containsKey("name")) {
continue
;
//
continue;
}
//
}
// 获取当前装备ID下的排版数据
// 获取当前装备ID下的排版数据
List
<
Map
<
String
,
Object
>>
specifyDateList
=
dutyPersonShiftMapper
.
getPositionStaffDutyForSpecifyDate
(
dutyDay
,
List
<
Map
<
String
,
Object
>>
specifyDateList
=
dutyPersonShiftMapper
.
getPositionStaffDutyForSpecifyDate
(
dutyDay
,
this
.
getGroupCode
(),
instanceIds
,
dutyDetail
.
get
(
"name"
).
toString
()
);
this
.
getGroupCode
(),
instanceIds
,
null
);
if
(
specifyDateList
==
null
||
specifyDateList
.
size
()
<
1
||
specifyDateList
.
get
(
0
)==
null
)
{
if
(
specifyDateList
==
null
||
specifyDateList
.
size
()
<
1
||
specifyDateList
.
get
(
0
)==
null
)
{
continue
;
continue
;
}
}
LinkedHashMap
<
String
,
Object
>
infoMap_1
=
new
LinkedHashMap
<
String
,
Object
>();
//
LinkedHashMap<String, Object> infoMap_1 =new LinkedHashMap<String, Object>();
infoMap_1
.
put
(
dutyDetail
.
get
(
"name"
).
toString
(),
""
);
//
infoMap_1.put(dutyDetail.get("name").toString(), "");
resultList
.
add
(
infoMap_1
);
//
resultList.add(infoMap_1);
for
(
Map
<
String
,
Object
>
specify
:
specifyDateList
)
{
for
(
Map
<
String
,
Object
>
specify
:
specifyDateList
)
{
LinkedHashMap
<
String
,
Object
>
infoMap_2
=
new
LinkedHashMap
<
String
,
Object
>();
LinkedHashMap
<
String
,
Object
>
infoMap_2
=
new
LinkedHashMap
<
String
,
Object
>();
if
(
specify
.
containsKey
(
"postTypeName"
)&&
specify
.
get
(
"postTypeName"
)!=
null
&&
specify
.
containsKey
(
"userName"
)&&
specify
.
get
(
"userName"
)!=
null
)
{
if
(
specify
.
containsKey
(
"postTypeName"
)&&
specify
.
get
(
"postTypeName"
)!=
null
&&
specify
.
containsKey
(
"userName"
)&&
specify
.
get
(
"userName"
)!=
null
)
{
infoMap_2
.
put
(
specify
.
get
(
"postTypeName"
).
toString
(),
specify
.
get
(
"userName"
).
toString
());
infoMap_2
.
put
(
specify
.
get
(
"postTypeName"
).
toString
(),
specify
.
get
(
"userName"
).
toString
());
resultList
.
add
(
infoMap_2
);
resultList
.
add
(
infoMap_2
);
}
}
}
//
}
}
//
}
}
}
}
}
detailList
.
add
(
resultList
);
detailList
.
add
(
resultList
);
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-common-biz/src/main/java/com/yeejoin/amos/boot/module/common/biz/service/impl/DutyFirstAidServiceImpl.java
View file @
997d6888
...
@@ -7,6 +7,7 @@ import java.util.List;
...
@@ -7,6 +7,7 @@ import java.util.List;
import
java.util.Map
;
import
java.util.Map
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.velocity.runtime.directive.Break
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.typroject.tyboot.core.foundation.utils.Bean
;
import
org.typroject.tyboot.core.foundation.utils.Bean
;
...
@@ -18,8 +19,6 @@ import com.yeejoin.amos.boot.module.common.api.entity.OrgUsr;
...
@@ -18,8 +19,6 @@ import com.yeejoin.amos.boot.module.common.api.entity.OrgUsr;
import
com.yeejoin.amos.boot.module.common.api.mapper.DutyPersonShiftMapper
;
import
com.yeejoin.amos.boot.module.common.api.mapper.DutyPersonShiftMapper
;
import
com.yeejoin.amos.boot.module.common.api.service.IDutyFirstAidService
;
import
com.yeejoin.amos.boot.module.common.api.service.IDutyFirstAidService
;
import
ch.qos.logback.core.joran.conditional.IfAction
;
@Service
@Service
public
class
DutyFirstAidServiceImpl
extends
DutyCommonServiceImpl
implements
IDutyFirstAidService
{
public
class
DutyFirstAidServiceImpl
extends
DutyCommonServiceImpl
implements
IDutyFirstAidService
{
...
@@ -67,15 +66,15 @@ public class DutyFirstAidServiceImpl extends DutyCommonServiceImpl implements ID
...
@@ -67,15 +66,15 @@ public class DutyFirstAidServiceImpl extends DutyCommonServiceImpl implements ID
}
}
List
<
Object
>
detailList
=
new
ArrayList
<
Object
>();
List
<
Object
>
detailList
=
new
ArrayList
<
Object
>();
for
(
Map
<
String
,
Object
>
map
:
equipmentList
)
{
for
(
Map
<
String
,
Object
>
map
:
equipmentList
)
{
List
<
Map
<
String
,
Object
>>
resultList
=
new
ArrayList
<
Map
<
String
,
Object
>
>();
List
<
Object
>
resultList
=
new
ArrayList
<
Object
>();
LinkedHashMap
<
String
,
Object
>
titleMap_1
=
new
LinkedHashMap
<
String
,
Object
>();
//
LinkedHashMap<String, Object> titleMap_1 = new LinkedHashMap<String, Object>();
titleMap_1
.
put
(
"120急救站"
,
map
.
get
(
"firstAid"
).
toString
());
//
titleMap_1.put("120急救站", map.get("firstAid").toString());
resultList
.
add
(
titleMap_1
);
resultList
.
add
(
map
.
get
(
"firstAid"
).
toString
()
);
LinkedHashMap
<
String
,
Object
>
titleMap_2
=
new
LinkedHashMap
<
String
,
Object
>();
//
LinkedHashMap<String, Object> titleMap_2 = new LinkedHashMap<String, Object>();
if
(
map
.
containsKey
(
"teamName"
)
&&
map
.
get
(
"teamName"
)
!=
null
){
//
if(map.containsKey("teamName") && map.get("teamName") != null){
titleMap_2
.
put
(
"单位/部门"
,
map
.
get
(
"teamName"
).
toString
());
//
titleMap_2.put("单位/部门", map.get("teamName").toString());
}
//
}
resultList
.
add
(
titleMap_2
);
//
resultList.add(titleMap_2);
String
carId
=
map
.
get
(
"firstAidId"
).
toString
();
String
carId
=
map
.
get
(
"firstAidId"
).
toString
();
Map
<
String
,
Object
>
instanceMap
=
dutyPersonShiftMapper
.
getInstanceIdForSpecifyDateAndEquipment
(
dutyDay
,
Map
<
String
,
Object
>
instanceMap
=
dutyPersonShiftMapper
.
getInstanceIdForSpecifyDateAndEquipment
(
dutyDay
,
this
.
getGroupCode
(),
carId
);
this
.
getGroupCode
(),
carId
);
...
@@ -86,22 +85,22 @@ public class DutyFirstAidServiceImpl extends DutyCommonServiceImpl implements ID
...
@@ -86,22 +85,22 @@ public class DutyFirstAidServiceImpl extends DutyCommonServiceImpl implements ID
if
(
StringUtils
.
isNotBlank
(
instanceId
))
{
if
(
StringUtils
.
isNotBlank
(
instanceId
))
{
String
[]
instanceIds
=
instanceId
.
split
(
","
);
String
[]
instanceIds
=
instanceId
.
split
(
","
);
List
<
Map
<
String
,
Object
>>
dutyList
=
dutyPersonShiftMapper
.
getDutyForSpecifyDate
(
dutyDay
);
//
List<Map<String, Object>> dutyList = dutyPersonShiftMapper.getDutyForSpecifyDate(dutyDay);
if
(
dutyList
!=
null
&&
dutyList
.
size
()
>
0
)
{
//
if (dutyList != null && dutyList.size() > 0) {
for
(
Map
<
String
,
Object
>
dutyDetail
:
dutyList
)
{
//
for (Map<String, Object> dutyDetail : dutyList) {
if
(!
dutyDetail
.
containsKey
(
"name"
))
{
//
if (!dutyDetail.containsKey("name")) {
continue
;
//
continue;
}
//
}
// 获取当前装备ID下的排版数据
// 获取当前装备ID下的排版数据
List
<
Map
<
String
,
Object
>>
specifyDateList
=
dutyPersonShiftMapper
List
<
Map
<
String
,
Object
>>
specifyDateList
=
dutyPersonShiftMapper
.
getPositionStaffDutyForSpecifyDate
(
dutyDay
,
this
.
getGroupCode
(),
instanceIds
,
.
getPositionStaffDutyForSpecifyDate
(
dutyDay
,
this
.
getGroupCode
(),
instanceIds
,
dutyDetail
.
get
(
"name"
).
toString
()
);
null
);
if
(
specifyDateList
==
null
||
specifyDateList
.
size
()
<
1
||
specifyDateList
.
get
(
0
)
==
null
)
{
if
(
specifyDateList
==
null
||
specifyDateList
.
size
()
<
1
||
specifyDateList
.
get
(
0
)
==
null
)
{
continue
;
continue
;
}
}
LinkedHashMap
<
String
,
Object
>
infoMap_1
=
new
LinkedHashMap
<
String
,
Object
>();
//
LinkedHashMap<String, Object> infoMap_1 = new LinkedHashMap<String, Object>();
infoMap_1
.
put
(
dutyDetail
.
get
(
"name"
).
toString
(),
""
);
//
infoMap_1.put(dutyDetail.get("name").toString(), "");
resultList
.
add
(
infoMap_1
);
//
resultList.add(infoMap_1);
for
(
Map
<
String
,
Object
>
specify
:
specifyDateList
)
{
for
(
Map
<
String
,
Object
>
specify
:
specifyDateList
)
{
LinkedHashMap
<
String
,
Object
>
infoMap_2
=
new
LinkedHashMap
<
String
,
Object
>();
LinkedHashMap
<
String
,
Object
>
infoMap_2
=
new
LinkedHashMap
<
String
,
Object
>();
// infoMap_2.put(specify.get("postTypeName").toString(), specify.get("userName").toString());
// infoMap_2.put(specify.get("postTypeName").toString(), specify.get("userName").toString());
...
@@ -110,9 +109,9 @@ public class DutyFirstAidServiceImpl extends DutyCommonServiceImpl implements ID
...
@@ -110,9 +109,9 @@ public class DutyFirstAidServiceImpl extends DutyCommonServiceImpl implements ID
infoMap_2
.
put
(
specify
.
get
(
"postTypeName"
).
toString
(),
specify
.
get
(
"userName"
).
toString
());
infoMap_2
.
put
(
specify
.
get
(
"postTypeName"
).
toString
(),
specify
.
get
(
"userName"
).
toString
());
resultList
.
add
(
infoMap_2
);
resultList
.
add
(
infoMap_2
);
}
}
}
//
}
//
}
//
}
}
}
}
}
detailList
.
add
(
resultList
);
detailList
.
add
(
resultList
);
...
@@ -125,6 +124,11 @@ public class DutyFirstAidServiceImpl extends DutyCommonServiceImpl implements ID
...
@@ -125,6 +124,11 @@ public class DutyFirstAidServiceImpl extends DutyCommonServiceImpl implements ID
List
<
Map
<
String
,
Object
>>
result
=
new
ArrayList
<
Map
<
String
,
Object
>>();
List
<
Map
<
String
,
Object
>>
result
=
new
ArrayList
<
Map
<
String
,
Object
>>();
List
<
String
>
userNameList
=
new
ArrayList
<
String
>();
List
<
String
>
userNameList
=
new
ArrayList
<
String
>();
String
firstAidCompanyId
=
dutyPersonShiftMapper
.
getFirstAidCompanyId
();
if
(
firstAidCompanyId
!=
""
&&
firstAidCompanyId
!=
null
){
ids
.
add
(
firstAidCompanyId
);
}
List
<
String
>
firstAidSimpleList
=
new
ArrayList
<
String
>();
List
<
String
>
firstAidSimpleList
=
new
ArrayList
<
String
>();
List
<
String
>
companyNameList
=
new
ArrayList
<
String
>();
List
<
String
>
companyNameList
=
new
ArrayList
<
String
>();
String
typeString
=
"JJZ"
;
String
typeString
=
"JJZ"
;
...
@@ -157,10 +161,19 @@ public class DutyFirstAidServiceImpl extends DutyCommonServiceImpl implements ID
...
@@ -157,10 +161,19 @@ public class DutyFirstAidServiceImpl extends DutyCommonServiceImpl implements ID
});
});
if
(
firstAidSimpleList
!=
null
&&
firstAidSimpleList
.
size
()
>=
1
)
{
if
(
firstAidSimpleList
!=
null
&&
firstAidSimpleList
.
size
()
>=
1
)
{
detailMap
.
put
(
"firstAidName"
,
firstAidSimpleList
);
detailMap
.
put
(
"firstAidName"
,
firstAidSimpleList
);
resultList
.
add
(
detailMap
);
}
}
resultList
.
add
(
detailMap
);
});
});
result
.
add
(
resultList
.
get
(
0
));
for
(
int
i
=
0
;
i
<
resultList
.
size
();
i
++)
{
if
(
resultList
.
get
(
i
).
size
()
==
4
){
result
.
add
(
resultList
.
get
(
i
));
}
if
(
result
.
size
()>
0
){
break
;
}
}
return
result
;
return
result
;
}
}
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-common-biz/src/main/java/com/yeejoin/amos/boot/module/common/biz/service/impl/DutyPersonServiceImpl.java
View file @
997d6888
...
@@ -304,7 +304,48 @@ public Object BuildScheduleDetails(String dutyDay, Long shiftId, String postType
...
@@ -304,7 +304,48 @@ public Object BuildScheduleDetails(String dutyDay, Long shiftId, String postType
}
}
public
Object
getSchedulingDutyForSpecifyDate
(
String
dutyDay
,
Long
shiftId
,
String
postType
)
{
List
<
Map
<
String
,
Object
>>
equipmentList
=
dutyPersonShiftMapper
.
getNewEquipmentForSpecifyDate
(
dutyDay
,
this
.
getGroupCode
(),
"deptId"
,
"deptName"
,
"result.deptId"
);
if
(
equipmentList
==
null
||
equipmentList
.
size
()
<
1
||
equipmentList
.
get
(
0
)
==
null
)
{
return
null
;
}
List
<
Object
>
detailList
=
new
ArrayList
<
Object
>();
for
(
Map
<
String
,
Object
>
map
:
equipmentList
)
{
List
<
Object
>
resultList
=
new
ArrayList
<
Object
>();
LinkedHashMap
<
String
,
Object
>
titleMap_2
=
new
LinkedHashMap
<
String
,
Object
>();
if
(
map
.
containsKey
(
"deptName"
)
&&
map
.
get
(
"deptName"
)
!=
null
){
resultList
.
add
(
map
.
get
(
"deptName"
).
toString
());
}
String
carId
=
map
.
get
(
"deptId"
).
toString
();
Map
<
String
,
Object
>
instanceMap
=
dutyPersonShiftMapper
.
getInstanceIdForSpecifyDateAndEquipment
(
dutyDay
,
this
.
getGroupCode
(),
carId
);
if
(
instanceMap
==
null
)
{
continue
;
}
String
instanceId
=
instanceMap
.
get
(
"instanceIds"
).
toString
();
if
(
StringUtils
.
isNotBlank
(
instanceId
))
{
String
[]
instanceIds
=
instanceId
.
split
(
","
);
// 获取当前装备ID下的排版数据
List
<
Map
<
String
,
Object
>>
specifyDateList
=
dutyPersonShiftMapper
.
getPositionStaffDutyForSpecifyDate
(
dutyDay
,
this
.
getGroupCode
(),
instanceIds
,
null
);
if
(
specifyDateList
==
null
||
specifyDateList
.
size
()
<
1
||
specifyDateList
.
get
(
0
)
==
null
)
{
continue
;
}
for
(
Map
<
String
,
Object
>
specify
:
specifyDateList
)
{
LinkedHashMap
<
String
,
Object
>
infoMap_2
=
new
LinkedHashMap
<
String
,
Object
>();
if
(
specify
.
containsKey
(
"postTypeName"
)&&
specify
.
get
(
"postTypeName"
)!=
null
&&
specify
.
containsKey
(
"userName"
)&&
specify
.
get
(
"userName"
)!=
null
)
{
infoMap_2
.
put
(
specify
.
get
(
"postTypeName"
).
toString
(),
specify
.
get
(
"userName"
).
toString
());
resultList
.
add
(
infoMap_2
);
}
}
}
detailList
.
add
(
resultList
);
}
return
detailList
;
}
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-common-biz/src/main/java/com/yeejoin/amos/boot/module/common/biz/service/impl/FailureDetailsServiceImpl.java
View file @
997d6888
...
@@ -323,6 +323,7 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa
...
@@ -323,6 +323,7 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa
// 发起主表流程 并添加至报修日志
// 发起主表流程 并添加至报修日志
failureDetailsDto
.
setSubmissionTime
(
new
Date
());
failureDetailsDto
.
setSubmissionTime
(
new
Date
());
failureDetailsDto
.
setCurrentStatus
(
FailureStatuEnum
.
WAITING_AUDIT
.
getCode
());
FailureDetailsDto
model
=
this
.
updateWithModel
(
failureDetailsDto
);
FailureDetailsDto
model
=
this
.
updateWithModel
(
failureDetailsDto
);
if
(
ObjectUtils
.
isNotEmpty
(
failureDetailsDto
.
getAttachment
()))
{
if
(
ObjectUtils
.
isNotEmpty
(
failureDetailsDto
.
getAttachment
()))
{
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-common-biz/src/main/java/com/yeejoin/amos/boot/module/common/biz/service/impl/FailureVerifyServiceImpl.java
View file @
997d6888
...
@@ -85,10 +85,15 @@ public class FailureVerifyServiceImpl extends BaseService<FailureVerifyDto, Fail
...
@@ -85,10 +85,15 @@ public class FailureVerifyServiceImpl extends BaseService<FailureVerifyDto, Fail
FailureDetailsDto
failureDetailsDto
=
failureDetailsService
.
queryBySeq
(
model
.
getFaultId
());
FailureDetailsDto
failureDetailsDto
=
failureDetailsService
.
queryBySeq
(
model
.
getFaultId
());
List
<
FailureVerify
>
byfaultId
=
findByfaultId
(
failureDetailsDto
.
getSequenceNbr
());
List
<
FailureVerify
>
byfaultId
=
findByfaultId
(
failureDetailsDto
.
getSequenceNbr
());
if
(
byfaultId
.
size
()
!=
0
)
{
if
(
byfaultId
.
size
()
!=
0
&&
status
.
getCode
().
equals
(
FailureStatuEnum
.
FINISH
.
getCode
())
)
{
failureDetailsDto
.
setCurrentStatus
(
status
.
getCode
());
failureDetailsDto
.
setCurrentStatus
(
status
.
getCode
());
}
}
if
(
condition
==
AuditResultEnum
.
REFUSE
.
getCode
()){
failureDetailsDto
.
setCurrentStatus
(
status
.
getCode
());
}
failureDetailsDto
.
setSequenceNbr
(
model
.
getFaultId
());
failureDetailsDto
.
setSequenceNbr
(
model
.
getFaultId
());
failureDetailsService
.
updateWithModel
(
failureDetailsDto
);
failureDetailsService
.
updateWithModel
(
failureDetailsDto
);
...
...
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 @
997d6888
...
@@ -642,7 +642,7 @@ public class MaintenanceCompanyServiceImpl
...
@@ -642,7 +642,7 @@ public class MaintenanceCompanyServiceImpl
MaintenanceCompany
maintenanceCompany
=
new
MaintenanceCompany
();
MaintenanceCompany
maintenanceCompany
=
new
MaintenanceCompany
();
if
(
ValidationUtil
.
isEmpty
(
seq
))
{
if
(
ValidationUtil
.
isEmpty
(
seq
))
{
maintenanceCompany
=
getMaintenanceCompany
(
amosUserId
);
maintenanceCompany
=
getMaintenanceCompany
(
amosUserId
);
seq
=
maintenanceCompany
.
get
ParentId
();
seq
=
maintenanceCompany
.
get
SequenceNbr
();
}
}
// 机场单位列表基本信息
// 机场单位列表基本信息
if
(
pageNum
==
-
1
||
pageSize
==
-
1
)
{
if
(
pageNum
==
-
1
||
pageSize
==
-
1
)
{
...
@@ -674,11 +674,11 @@ public class MaintenanceCompanyServiceImpl
...
@@ -674,11 +674,11 @@ public class MaintenanceCompanyServiceImpl
LambdaQueryWrapper
<
MaintenanceCompany
>
wrapper
=
new
LambdaQueryWrapper
<
MaintenanceCompany
>();
LambdaQueryWrapper
<
MaintenanceCompany
>
wrapper
=
new
LambdaQueryWrapper
<
MaintenanceCompany
>();
wrapper
.
eq
(
MaintenanceCompany:
:
getIsDelete
,
false
);
wrapper
.
eq
(
MaintenanceCompany:
:
getIsDelete
,
false
);
wrapper
.
eq
(
MaintenanceCompany:
:
getAmosId
,
amosUserId
);
wrapper
.
eq
(
MaintenanceCompany:
:
getAmosId
,
amosUserId
);
MaintenanceCompany
maintenance
Company
=
this
.
baseMapper
.
selectOne
(
wrapper
);
MaintenanceCompany
maintenance
Person
=
this
.
baseMapper
.
selectOne
(
wrapper
);
// DynamicFormInstance dyFormInstance = dynamicFormInstanceService.getOne(
// DynamicFormInstance dyFormInstance = dynamicFormInstanceService.getOne(
// new LambdaQueryWrapper<DynamicFormInstance>().eq(DynamicFormInstance::getFieldCode, "amosAccount")
// new LambdaQueryWrapper<DynamicFormInstance>().eq(DynamicFormInstance::getFieldCode, "amosAccount")
// .eq(DynamicFormInstance::getFieldValue, amosUserId));
// .eq(DynamicFormInstance::getFieldValue, amosUserId));
if
(
ValidationUtil
.
isEmpty
(
maintenance
Company
))
{
if
(
ValidationUtil
.
isEmpty
(
maintenance
Person
))
{
throw
new
BadRequest
(
"维保账号不存在或未关联系统账号."
);
throw
new
BadRequest
(
"维保账号不存在或未关联系统账号."
);
}
}
// MaintenanceCompany person = this.getOne(new LambdaQueryWrapper<MaintenanceCompany>()
// MaintenanceCompany person = this.getOne(new LambdaQueryWrapper<MaintenanceCompany>()
...
@@ -686,11 +686,11 @@ public class MaintenanceCompanyServiceImpl
...
@@ -686,11 +686,11 @@ public class MaintenanceCompanyServiceImpl
// if (ValidationUtil.isEmpty(person)) {
// if (ValidationUtil.isEmpty(person)) {
// throw new BadRequest("维保账号不存在或未关联系统账号.");
// throw new BadRequest("维保账号不存在或未关联系统账号.");
// }
// }
//
maintenanceCompany = this.getOne(new LambdaQueryWrapper<MaintenanceCompany>()
MaintenanceCompany
maintenanceCompany
=
this
.
getOne
(
new
LambdaQueryWrapper
<
MaintenanceCompany
>()
// .eq(MaintenanceCompany::getSequenceNbr, p
erson.getParentId()));
.
eq
(
MaintenanceCompany:
:
getSequenceNbr
,
maintenanceP
erson
.
getParentId
()));
//
if (ValidationUtil.isEmpty(maintenanceCompany)) {
if
(
ValidationUtil
.
isEmpty
(
maintenanceCompany
))
{
// throw new BadRequest("维保账号
不存在或未关联系统账号.");
throw
new
BadRequest
(
"维保公司
不存在或未关联系统账号."
);
//
}
}
return
maintenanceCompany
;
return
maintenanceCompany
;
}
}
...
@@ -817,7 +817,7 @@ public class MaintenanceCompanyServiceImpl
...
@@ -817,7 +817,7 @@ public class MaintenanceCompanyServiceImpl
// 查询公司下人列表
// 查询公司下人列表
List
<
MaintenanceCompany
>
personList
=
list
(
new
LambdaQueryWrapper
<
MaintenanceCompany
>()
List
<
MaintenanceCompany
>
personList
=
list
(
new
LambdaQueryWrapper
<
MaintenanceCompany
>()
.
eq
(
MaintenanceCompany:
:
getIsDelete
,
false
).
eq
(
MaintenanceCompany:
:
getType
,
PERSON
)
.
eq
(
MaintenanceCompany:
:
getIsDelete
,
false
).
eq
(
MaintenanceCompany:
:
getType
,
PERSON
)
.
likeRight
(
MaintenanceCompany:
:
getCode
,
company
.
getCode
()));
.
eq
(
MaintenanceCompany:
:
getParentId
,
company
.
getParentId
()));
List
<
Long
>
instanceIdList
=
Lists
.
transform
(
personList
,
MaintenanceCompany:
:
getInstanceId
);
List
<
Long
>
instanceIdList
=
Lists
.
transform
(
personList
,
MaintenanceCompany:
:
getInstanceId
);
// 查询手机号
// 查询手机号
List
<
DynamicFormInstance
>
dynamicFormInstanceList
=
dynamicFormInstanceService
List
<
DynamicFormInstance
>
dynamicFormInstanceList
=
dynamicFormInstanceService
...
@@ -830,7 +830,7 @@ public class MaintenanceCompanyServiceImpl
...
@@ -830,7 +830,7 @@ public class MaintenanceCompanyServiceImpl
Map
<
String
,
Object
>
map
=
Maps
.
newHashMap
();
Map
<
String
,
Object
>
map
=
Maps
.
newHashMap
();
map
.
put
(
"sequenceNbr"
,
person
.
getSequenceNbr
());
map
.
put
(
"sequenceNbr"
,
person
.
getSequenceNbr
());
map
.
put
(
"name"
,
person
.
getName
());
map
.
put
(
"name"
,
person
.
getName
());
map
.
put
(
"tel"
,
dyMap
.
get
(
person
.
getInstanceId
())
.
get
(
0
).
getFieldValue
()
);
map
.
put
(
"tel"
,
dyMap
.
get
(
person
.
getInstanceId
())
!=
null
?
dyMap
.
get
(
person
.
getInstanceId
()).
get
(
0
).
getFieldValue
()
:
null
);
resultList
.
add
(
map
);
resultList
.
add
(
map
);
});
});
return
resultList
;
return
resultList
;
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-common-biz/src/main/java/com/yeejoin/amos/boot/module/common/biz/service/impl/OrgUsrServiceImpl.java
View file @
997d6888
...
@@ -41,6 +41,8 @@ import org.springframework.beans.factory.annotation.Value;
...
@@ -41,6 +41,8 @@ import org.springframework.beans.factory.annotation.Value;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.ObjectUtils
;
import
org.springframework.util.ObjectUtils
;
import
org.typroject.tyboot.component.emq.EmqKeeper
;
import
org.typroject.tyboot.component.emq.EmqKeeper
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.typroject.tyboot.core.foundation.context.RequestContext
;
import
org.typroject.tyboot.core.foundation.utils.Bean
;
import
org.typroject.tyboot.core.foundation.utils.Bean
;
import
org.typroject.tyboot.core.foundation.utils.ValidationUtil
;
import
org.typroject.tyboot.core.foundation.utils.ValidationUtil
;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
...
@@ -51,7 +53,14 @@ import java.lang.reflect.Method;
...
@@ -51,7 +53,14 @@ import java.lang.reflect.Method;
import
java.text.SimpleDateFormat
;
import
java.text.SimpleDateFormat
;
import
java.util.*
;
import
java.util.*
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
import
java.util.ArrayList
;
import
java.util.Collection
;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.HashSet
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Set
;
/**
/**
* 机构/部门/人员表 服务实现类
* 机构/部门/人员表 服务实现类
...
@@ -495,8 +504,7 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
...
@@ -495,8 +504,7 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
}
}
@Override
@Override
public
OrgUsrDto
saveOrgUsrDynamicFormInstance
(
OrgUsr
orgUsr
,
List
<
DynamicFormInstance
>
alertFromValuelist
)
public
OrgUsrDto
saveOrgUsrDynamicFormInstance
(
OrgUsr
orgUsr
,
List
<
DynamicFormInstance
>
alertFromValuelist
)
{
throws
Exception
{
orgUsr
.
setRecDate
(
new
Date
());
orgUsr
.
setRecDate
(
new
Date
());
AgencyUserModel
user
=
Privilege
.
agencyUserClient
.
getme
().
getResult
();
AgencyUserModel
user
=
Privilege
.
agencyUserClient
.
getme
().
getResult
();
orgUsr
.
setRecUserName
(
user
.
getRealName
());
orgUsr
.
setRecUserName
(
user
.
getRealName
());
...
@@ -517,19 +525,14 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
...
@@ -517,19 +525,14 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
});
});
// 保存动态表单数据
// 保存动态表单数据
alertFormValueServiceImpl
.
saveBatch
(
alertFromValuelist
);
alertFormValueServiceImpl
.
saveBatch
(
alertFromValuelist
);
OrgUsrFormDto
formDto
=
this
.
selectCompanyById
(
orgUsrDto
.
getSequenceNbr
());
if
(
OrgPersonEnum
.
公司
.
getKey
().
equals
(
orgUsrDto
.
getBizOrgType
()))
{
try
{
emqKeeper
.
getMqttClient
().
publish
(
airportAddTopic
,
JSON
.
toJSONString
(
formDto
).
getBytes
(),
2
,
false
);
}
catch
(
Exception
e
)
{
e
.
getMessage
();
}
}
return
model
;
return
model
;
}
}
@Override
@Override
public
void
updateDynamicFormInstance
(
Long
instanceId
,
List
<
DynamicFormInstance
>
fromValueList
)
{
public
void
updateDynamicFormInstance
(
Long
instanceId
,
List
<
DynamicFormInstance
>
fromValueList
)
{
if
(
ValidationUtil
.
isEmpty
(
fromValueList
))
{
return
;
}
// 填充主键
// 填充主键
fromValueList
.
forEach
(
alertFromValue
->
{
fromValueList
.
forEach
(
alertFromValue
->
{
alertFromValue
.
setInstanceId
(
instanceId
);
alertFromValue
.
setInstanceId
(
instanceId
);
...
@@ -679,6 +682,8 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
...
@@ -679,6 +682,8 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
* 同步保存ES
* 同步保存ES
*/
*/
eSOrgUsrService
.
saveAlertCalledToES
(
orgUsr
);
eSOrgUsrService
.
saveAlertCalledToES
(
orgUsr
);
syncCompany2Supervision
(
Lists
.
newArrayList
(
orgUsrDto
.
getSequenceNbr
()));
return
orgUsrDto
;
return
orgUsrDto
;
}
}
...
@@ -720,17 +725,18 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
...
@@ -720,17 +725,18 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
saveOrgUsrDynamicFormInstance
(
orgUsr
,
OrgPersonVo
.
getDynamicFormValue
());
saveOrgUsrDynamicFormInstance
(
orgUsr
,
OrgPersonVo
.
getDynamicFormValue
());
}
}
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Override
@Override
public
OrgUsrDto
updateByIdOrgUsr
(
OrgUsrDto
O
rgUsrVo
,
Long
id
)
throws
Exception
{
public
OrgUsrDto
updateByIdOrgUsr
(
OrgUsrDto
o
rgUsrVo
,
Long
id
)
throws
Exception
{
// 修改单位信息
// 修改单位信息
OrgUsr
orgUsr
=
new
OrgUsr
();
OrgUsr
orgUsr
=
new
OrgUsr
();
OrgUsr
oriOrgUsr
=
getById
(
id
);
OrgUsr
oriOrgUsr
=
getById
(
id
);
BeanUtils
.
copyProperties
(
O
rgUsrVo
,
orgUsr
);
BeanUtils
.
copyProperties
(
o
rgUsrVo
,
orgUsr
);
// 判断是否修改所属单位
// 判断是否修改所属单位
if
(!(
oriOrgUsr
.
getParentId
()
!=
null
?
oriOrgUsr
.
getParentId
()
:
""
).
equals
(
O
rgUsrVo
.
getParentId
()))
{
if
(!(
oriOrgUsr
.
getParentId
()
!=
null
?
oriOrgUsr
.
getParentId
()
:
""
).
equals
(
o
rgUsrVo
.
getParentId
()))
{
/* 单位编辑后 code值也应做出修改 2021-09-09 陈召 开始 */
/* 单位编辑后 code值也应做出修改 2021-09-09 陈召 开始 */
OrgUsr
parent
=
getById
(
O
rgUsrVo
.
getParentId
());
OrgUsr
parent
=
getById
(
o
rgUsrVo
.
getParentId
());
if
(
parent
!=
null
)
{
if
(
parent
!=
null
)
{
orgUsr
.
setBizOrgCode
(
parent
.
getBizOrgCode
()
+
getOrgCodeStr
());
orgUsr
.
setBizOrgCode
(
parent
.
getBizOrgCode
()
+
getOrgCodeStr
());
}
}
...
@@ -752,13 +758,15 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
...
@@ -752,13 +758,15 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
// saveOrgUsr(orgUsr, oriOrgUsr);
// saveOrgUsr(orgUsr, oriOrgUsr);
// 保存动态表单数据
// 保存动态表单数据
updateDynamicFormInstance
(
orgUsr
.
getSequenceNbr
(),
O
rgUsrVo
.
getDynamicFormValue
());
updateDynamicFormInstance
(
orgUsr
.
getSequenceNbr
(),
o
rgUsrVo
.
getDynamicFormValue
());
/**
/**
* 同步保存ES
* 同步保存ES
*/
*/
eSOrgUsrService
.
saveAlertCalledToES
(
orgUsr
);
eSOrgUsrService
.
saveAlertCalledToES
(
orgUsr
);
OrgUsrVo
.
setBizOrgCode
(
orgUsr
.
getBizOrgCode
());
orgUsrVo
.
setBizOrgCode
(
orgUsr
.
getBizOrgCode
());
return
OrgUsrVo
;
syncCompany2Supervision
(
Lists
.
newArrayList
(
orgUsr
.
getSequenceNbr
()));
return
orgUsrVo
;
}
}
@Override
@Override
...
@@ -870,13 +878,16 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
...
@@ -870,13 +878,16 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
}
}
@Override
@Override
public
void
saveCompany
(
List
<
OrgUsrDto
>
OrgUsrVo
)
throws
Exception
{
public
void
saveCompany
(
List
<
OrgUsrDto
>
OrgUsrVo
)
{
List
<
Long
>
companyIdList
=
Lists
.
newArrayList
();
for
(
int
i
=
0
;
i
<
OrgUsrVo
.
size
();
i
++)
{
for
(
int
i
=
0
;
i
<
OrgUsrVo
.
size
();
i
++)
{
OrgUsr
orgUsr
=
new
OrgUsr
();
OrgUsr
orgUsr
=
new
OrgUsr
();
BeanUtils
.
copyProperties
(
OrgUsrVo
.
get
(
i
),
orgUsr
);
BeanUtils
.
copyProperties
(
OrgUsrVo
.
get
(
i
),
orgUsr
);
orgUsr
.
setBizOrgType
(
CommonConstant
.
BIZ_ORG_TYPE_COMPANY
);
orgUsr
.
setBizOrgType
(
CommonConstant
.
BIZ_ORG_TYPE_COMPANY
);
saveOrgUsrDynamicFormInstance
(
orgUsr
,
OrgUsrVo
.
get
(
i
).
getDynamicFormValue
());
OrgUsrDto
orgUsrDto
=
saveOrgUsrDynamicFormInstance
(
orgUsr
,
OrgUsrVo
.
get
(
i
).
getDynamicFormValue
());
companyIdList
.
add
(
orgUsrDto
.
getSequenceNbr
());
}
}
syncCompany2Supervision
(
companyIdList
);
}
}
@Override
@Override
...
@@ -2080,6 +2091,7 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
...
@@ -2080,6 +2091,7 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
}
}
@Override
@Override
public
List
<
OrgUsr
>
getListByBizOrgTypeCode
(
String
orgTypes
,
String
orgCode
)
{
public
List
<
OrgUsr
>
getListByBizOrgTypeCode
(
String
orgTypes
,
String
orgCode
)
{
List
<
String
>
orgTypeList
=
new
ArrayList
<>();
List
<
String
>
orgTypeList
=
new
ArrayList
<>();
...
@@ -2098,4 +2110,31 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
...
@@ -2098,4 +2110,31 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
List
<
OrgUsr
>
list
=
orgUsrMapper
.
companyDeptListWithPersonCount
(
param
);
List
<
OrgUsr
>
list
=
orgUsrMapper
.
companyDeptListWithPersonCount
(
param
);
return
buildTreeParallel
(
list
);
return
buildTreeParallel
(
list
);
}
}
/**
* 同步单位信息到防火监督point表
*
* @param companyIdList
*/
protected
void
syncCompany2Supervision
(
List
<
Long
>
companyIdList
)
{
if
(
ValidationUtil
.
isEmpty
(
companyIdList
))
{
return
;
}
String
token
=
RequestContext
.
getToken
();
String
appKey
=
RequestContext
.
getAppKey
();
String
product
=
RequestContext
.
getProduct
();
new
Thread
(()
->
companyIdList
.
forEach
(
id
->
{
try
{
RequestContext
.
setAppKey
(
appKey
);
RequestContext
.
setToken
(
token
);
RequestContext
.
setProduct
(
product
);
OrgUsrFormDto
formDto
=
this
.
selectCompanyById
(
id
);
if
(!
ValidationUtil
.
isEmpty
(
formDto
)
&&
OrgPersonEnum
.
公司
.
getKey
().
equals
(
formDto
.
getBizOrgType
()))
{
emqKeeper
.
getMqttClient
().
publish
(
airportAddTopic
,
JSON
.
toJSONString
(
formDto
).
getBytes
(),
2
,
false
);
}
}
catch
(
Exception
e
)
{
logger
.
debug
(
"syncCompany2Supervision error:"
,
e
.
getMessage
());
e
.
printStackTrace
();
}
})).
start
();
}
}
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/controller/EquipmentAlarmController.java
View file @
997d6888
...
@@ -94,6 +94,8 @@ public class EquipmentAlarmController extends AbstractBaseController {
...
@@ -94,6 +94,8 @@ public class EquipmentAlarmController extends AbstractBaseController {
@RequestParam
(
value
=
"alarmType"
,
required
=
false
)
String
alarmType
,
@RequestParam
(
value
=
"alarmType"
,
required
=
false
)
String
alarmType
,
@RequestParam
(
value
=
"type"
,
required
=
false
)
String
type
,
@RequestParam
(
value
=
"type"
,
required
=
false
)
String
type
,
@RequestParam
(
value
=
"buildIds"
,
required
=
false
)
List
<
String
>
buildIds
,
@RequestParam
(
value
=
"buildIds"
,
required
=
false
)
List
<
String
>
buildIds
,
@RequestParam
(
value
=
"id"
,
required
=
false
)
String
id
,
@RequestParam
(
value
=
"cleanStatus"
,
required
=
false
)
String
cleanStatus
,
CommonPageable
commonPageable
)
{
CommonPageable
commonPageable
)
{
if
(
commonPageable
.
getPageNumber
()
==
0
)
{
if
(
commonPageable
.
getPageNumber
()
==
0
)
{
commonPageable
.
setPageNumber
(
1
);
commonPageable
.
setPageNumber
(
1
);
...
@@ -139,6 +141,14 @@ public class EquipmentAlarmController extends AbstractBaseController {
...
@@ -139,6 +141,14 @@ public class EquipmentAlarmController extends AbstractBaseController {
request9
.
setName
(
"buildIds"
);
request9
.
setName
(
"buildIds"
);
request9
.
setValue
(
ObjectUtils
.
isEmpty
(
buildIds
)
?
null
:
buildIds
);
request9
.
setValue
(
ObjectUtils
.
isEmpty
(
buildIds
)
?
null
:
buildIds
);
queryRequests
.
add
(
request9
);
queryRequests
.
add
(
request9
);
CommonRequest
request10
=
new
CommonRequest
();
request10
.
setName
(
"id"
);
request10
.
setValue
(
StringUtil
.
isNotEmpty
(
id
)
?
StringUtils
.
trimToNull
(
id
)
:
null
);
queryRequests
.
add
(
request10
);
CommonRequest
request11
=
new
CommonRequest
();
request11
.
setName
(
"cleanStatus"
);
request11
.
setValue
(
StringUtil
.
isNotEmpty
(
cleanStatus
)
?
StringUtils
.
trimToNull
(
cleanStatus
)
:
null
);
queryRequests
.
add
(
request11
);
CommonPageInfoParam
param
=
CommonPageParamUtil
.
fillCommonPageInfoParam
(
queryRequests
,
commonPageable
);
CommonPageInfoParam
param
=
CommonPageParamUtil
.
fillCommonPageInfoParam
(
queryRequests
,
commonPageable
);
Page
<
Map
<
String
,
Object
>>
list
=
iEquipmentSpecificAlarmService
.
listPage
(
param
);
Page
<
Map
<
String
,
Object
>>
list
=
iEquipmentSpecificAlarmService
.
listPage
(
param
);
return
CommonResponseUtil
.
success
(
list
);
return
CommonResponseUtil
.
success
(
list
);
...
@@ -200,6 +210,8 @@ public class EquipmentAlarmController extends AbstractBaseController {
...
@@ -200,6 +210,8 @@ public class EquipmentAlarmController extends AbstractBaseController {
@RequestParam
(
value
=
"systemCode"
,
required
=
false
)
String
systemCode
,
@RequestParam
(
value
=
"systemCode"
,
required
=
false
)
String
systemCode
,
@RequestParam
(
value
=
"buildId"
,
required
=
false
)
String
buildId
,
@RequestParam
(
value
=
"buildId"
,
required
=
false
)
String
buildId
,
// @RequestParam(value = "equipmentCode", required = false) String equipmentCode,
// @RequestParam(value = "equipmentCode", required = false) String equipmentCode,
@RequestParam
(
value
=
"id"
,
required
=
false
)
String
id
,
@RequestParam
(
value
=
"cleanStatus"
,
required
=
false
)
String
cleanStatus
,
CommonPageable
commonPageable
)
{
CommonPageable
commonPageable
)
{
List
<
CommonRequest
>
queryRequests
=
new
ArrayList
<>();
List
<
CommonRequest
>
queryRequests
=
new
ArrayList
<>();
CommonRequest
request
=
new
CommonRequest
();
CommonRequest
request
=
new
CommonRequest
();
...
@@ -235,6 +247,14 @@ public class EquipmentAlarmController extends AbstractBaseController {
...
@@ -235,6 +247,14 @@ public class EquipmentAlarmController extends AbstractBaseController {
request9
.
setName
(
"buildId"
);
request9
.
setName
(
"buildId"
);
request9
.
setValue
(
StringUtil
.
isNotEmpty
(
buildId
)
?
StringUtils
.
trimToNull
(
buildId
)
:
null
);
request9
.
setValue
(
StringUtil
.
isNotEmpty
(
buildId
)
?
StringUtils
.
trimToNull
(
buildId
)
:
null
);
queryRequests
.
add
(
request9
);
queryRequests
.
add
(
request9
);
CommonRequest
request10
=
new
CommonRequest
();
request10
.
setName
(
"id"
);
request10
.
setValue
(
StringUtil
.
isNotEmpty
(
id
)
?
StringUtils
.
trimToNull
(
id
)
:
null
);
queryRequests
.
add
(
request10
);
CommonRequest
request11
=
new
CommonRequest
();
request11
.
setName
(
"cleanStatus"
);
request11
.
setValue
(
StringUtil
.
isNotEmpty
(
cleanStatus
)
?
StringUtils
.
trimToNull
(
cleanStatus
)
:
null
);
queryRequests
.
add
(
request11
);
CommonPageInfoParam
param
=
CommonPageParamUtil
.
fillCommonPageInfoParam
(
queryRequests
,
commonPageable
);
CommonPageInfoParam
param
=
CommonPageParamUtil
.
fillCommonPageInfoParam
(
queryRequests
,
commonPageable
);
org
.
springframework
.
data
.
domain
.
Page
<
AlarmListDataVO
>
list
=
iEquipmentSpecificAlarmService
.
listAlarmsPage
(
param
);
org
.
springframework
.
data
.
domain
.
Page
<
AlarmListDataVO
>
list
=
iEquipmentSpecificAlarmService
.
listAlarmsPage
(
param
);
return
CommonResponseUtil
.
success
(
list
);
return
CommonResponseUtil
.
success
(
list
);
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/controller/EquipmentSpecificController.java
View file @
997d6888
...
@@ -35,6 +35,7 @@ import com.yeejoin.equipmanage.common.entity.vo.ComplementCodeVO;
...
@@ -35,6 +35,7 @@ import com.yeejoin.equipmanage.common.entity.vo.ComplementCodeVO;
import
com.yeejoin.equipmanage.common.entity.vo.SourceNameByEquipSpeIdVO
;
import
com.yeejoin.equipmanage.common.entity.vo.SourceNameByEquipSpeIdVO
;
import
com.yeejoin.equipmanage.common.utils.CommonResponseUtil
;
import
com.yeejoin.equipmanage.common.utils.CommonResponseUtil
;
import
com.yeejoin.equipmanage.common.vo.EquipmentOnCarVo
;
import
com.yeejoin.equipmanage.common.vo.EquipmentOnCarVo
;
import
com.yeejoin.equipmanage.common.vo.VideoOnEquipmentSpecificVo
;
import
com.yeejoin.equipmanage.mapper.EquipmentSpecificMapper
;
import
com.yeejoin.equipmanage.mapper.EquipmentSpecificMapper
;
import
com.yeejoin.equipmanage.service.IEquipmentDetailService
;
import
com.yeejoin.equipmanage.service.IEquipmentDetailService
;
import
com.yeejoin.equipmanage.service.IEquipmentSpecificSerivce
;
import
com.yeejoin.equipmanage.service.IEquipmentSpecificSerivce
;
...
@@ -42,6 +43,19 @@ import com.yeejoin.equipmanage.service.impl.FireFightingSystemServiceImpl;
...
@@ -42,6 +43,19 @@ import com.yeejoin.equipmanage.service.impl.FireFightingSystemServiceImpl;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.util.ObjectUtils
;
import
org.springframework.web.bind.annotation.*
;
import
org.typroject.tyboot.core.foundation.enumeration.UserType
;
import
org.typroject.tyboot.core.restful.doc.TycloudOperation
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
/**
/**
* @author ZeHua Li
* @author ZeHua Li
...
@@ -159,8 +173,8 @@ public class EquipmentSpecificController extends AbstractBaseController {
...
@@ -159,8 +173,8 @@ public class EquipmentSpecificController extends AbstractBaseController {
@RequestMapping
(
value
=
"/getOneCard"
,
method
=
RequestMethod
.
GET
)
@RequestMapping
(
value
=
"/getOneCard"
,
method
=
RequestMethod
.
GET
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"根据id查询"
,
notes
=
"组装组态使用装备卡片数据"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"根据id查询"
,
notes
=
"组装组态使用装备卡片数据"
)
public
Object
getOneCard
(
Long
id
,
String
type
)
{
public
Object
getOneCard
(
Long
id
,
String
type
)
{
return
equipmentSpecificSerivce
.
getOneCard
(
id
,
type
);
return
equipmentSpecificSerivce
.
getOneCard
(
id
,
type
);
}
}
/**
/**
...
@@ -246,12 +260,13 @@ public class EquipmentSpecificController extends AbstractBaseController {
...
@@ -246,12 +260,13 @@ public class EquipmentSpecificController extends AbstractBaseController {
/**
/**
* 根据specificId删除装备相关数据
* 根据specificId删除装备相关数据
*
* @param specificId id
* @param specificId id
* @return ResponseModel
* @return ResponseModel
*/
*/
@DeleteMapping
(
value
=
"/delEquipmentBySpecificId"
)
@DeleteMapping
(
value
=
"/delEquipmentBySpecificId"
)
@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
)
{
EquipmentSpecific
equipmentSpecific
=
equipmentSpecificSerivce
.
getById
(
specificId
);
EquipmentSpecific
equipmentSpecific
=
equipmentSpecificSerivce
.
getById
(
specificId
);
Boolean
result
=
equipmentSpecificSerivce
.
delEquipmentSpecific
(
specificId
);
Boolean
result
=
equipmentSpecificSerivce
.
delEquipmentSpecific
(
specificId
);
...
@@ -271,17 +286,18 @@ public class EquipmentSpecificController extends AbstractBaseController {
...
@@ -271,17 +286,18 @@ public class EquipmentSpecificController extends AbstractBaseController {
/**
/**
* 根据specificIds删除装备相关数据
* 根据specificIds删除装备相关数据
*
* @param specificIds id
* @param specificIds id
* @return ResponseModel
* @return ResponseModel
*/
*/
@DeleteMapping
(
value
=
"/delAllEquipmentBySpecificIds"
)
@DeleteMapping
(
value
=
"/delAllEquipmentBySpecificIds"
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"批量删除装备相关所有数据"
,
notes
=
"批量删除装备相关所有数据"
)
@ApiOperation
(
value
=
"批量删除装备相关所有数据"
,
notes
=
"批量删除装备相关所有数据"
)
public
ResponseModel
delEquipmentBySpecificId
(
@RequestBody
List
<
Long
>
specificIds
)
{
public
ResponseModel
delEquipmentBySpecificId
(
@RequestBody
List
<
Long
>
specificIds
)
{
if
(
ObjectUtils
.
isEmpty
(
specificIds
))
{
if
(
ObjectUtils
.
isEmpty
(
specificIds
))
{
return
CommonResponseUtil
.
failure
(
"参数为空"
);
return
CommonResponseUtil
.
failure
(
"参数为空"
);
}
}
specificIds
.
forEach
(
specificId
->
{
specificIds
.
forEach
(
specificId
->
{
equipmentSpecificSerivce
.
delEquipmentBySpecificId
(
specificId
);
equipmentSpecificSerivce
.
delEquipmentBySpecificId
(
specificId
);
});
});
return
CommonResponseUtil
.
success
();
return
CommonResponseUtil
.
success
();
...
@@ -293,4 +309,11 @@ public class EquipmentSpecificController extends AbstractBaseController {
...
@@ -293,4 +309,11 @@ public class EquipmentSpecificController extends AbstractBaseController {
public
ResponseModel
getFessIndexDetails
()
{
public
ResponseModel
getFessIndexDetails
()
{
return
CommonResponseUtil
.
success
(
equipmentSpecificSerivce
.
getFessIndexDetails
());
return
CommonResponseUtil
.
success
(
equipmentSpecificSerivce
.
getFessIndexDetails
());
}
}
@RequestMapping
(
value
=
"/videoOnEquipmentSpecific"
,
method
=
RequestMethod
.
POST
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"摄像头绑定设备"
,
notes
=
"摄像头绑定设备"
)
public
ResponseModel
videoOnEquipmentSpecific
(
@RequestBody
VideoOnEquipmentSpecificVo
videoOnEquipmentSpecificVo
)
{
return
CommonResponseUtil
.
success
(
equipmentSpecificSerivce
.
videoOnEquipmentSpecific
(
videoOnEquipmentSpecificVo
));
}
}
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/controller/FireFightingSystemController.java
View file @
997d6888
...
@@ -629,7 +629,7 @@ public class FireFightingSystemController extends AbstractBaseController {
...
@@ -629,7 +629,7 @@ public class FireFightingSystemController extends AbstractBaseController {
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"按照组态格式获取系统报警,或者建筑报警列表"
,
notes
=
"按照组态格式获取系统报警,或者建筑报警列表"
)
@ApiOperation
(
value
=
"按照组态格式获取系统报警,或者建筑报警列表"
,
notes
=
"按照组态格式获取系统报警,或者建筑报警列表"
)
@GetMapping
(
value
=
"/getEquipmentAlarmBySystemIdOrSourceIdVO/{Systemtype}/{id}"
)
@GetMapping
(
value
=
"/getEquipmentAlarmBySystemIdOrSourceIdVO/{Systemtype}/{id}"
)
public
IPage
<
EquipmentAlarmBySystemIdOrSourceIdVO
>
getEquipmentAlarmBySystemIdOrSourceIdVO
(
int
pageSize
,
int
current
,
Integer
confirmType
,
String
createDate
,
String
type
,
@PathVariable
String
Systemtype
,
@PathVariable
Long
id
)
{
public
IPage
<
EquipmentAlarmBySystemIdOrSourceIdVO
>
getEquipmentAlarmBySystemIdOrSourceIdVO
(
Integer
pageSize
,
Integer
current
,
Integer
confirmType
,
String
createDate
,
String
type
,
@PathVariable
String
Systemtype
,
@PathVariable
Long
id
)
{
Page
<
EquipmentAlarmBySystemIdOrSourceIdVO
>
page
=
new
Page
();
Page
<
EquipmentAlarmBySystemIdOrSourceIdVO
>
page
=
new
Page
();
page
.
setCurrent
(
current
);
page
.
setCurrent
(
current
);
page
.
setSize
(
pageSize
);
page
.
setSize
(
pageSize
);
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/controller/IndustryController.java
View file @
997d6888
...
@@ -9,9 +9,9 @@ import org.springframework.web.bind.annotation.RequestMapping;
...
@@ -9,9 +9,9 @@ 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.foundation.enumeration.UserType
;
import
org.typroject.tyboot.core.restful.doc.TycloudOperation
;
import
org.typroject.tyboot.core.restful.doc.TycloudOperation
;
import
java.util.List
;
import
java.util.List
;
@RestController
@RestController
@Api
(
tags
=
"行业分类Industry"
)
@Api
(
tags
=
"行业分类Industry"
)
@RequestMapping
(
value
=
"/industry"
)
@RequestMapping
(
value
=
"/industry"
)
...
@@ -19,8 +19,8 @@ public class IndustryController {
...
@@ -19,8 +19,8 @@ public class IndustryController {
@Autowired
@Autowired
IIndustryService
industryService
;
IIndustryService
industryService
;
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@GetMapping
(
value
=
"/list"
)
@GetMapping
(
value
=
"/list"
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
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/mapper/EquipmentSpecificMapper.java
View file @
997d6888
...
@@ -6,10 +6,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
...
@@ -6,10 +6,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import
com.yeejoin.equipmanage.common.datasync.entity.FireEquipment
;
import
com.yeejoin.equipmanage.common.datasync.entity.FireEquipment
;
import
com.yeejoin.equipmanage.common.dto.EquipmentSpecificDto
;
import
com.yeejoin.equipmanage.common.dto.EquipmentSpecificDto
;
import
com.yeejoin.equipmanage.common.dto.UserDto
;
import
com.yeejoin.equipmanage.common.dto.UserDto
;
import
com.yeejoin.equipmanage.common.entity.EquipmentCategory
;
import
com.yeejoin.equipmanage.common.entity.*
;
import
com.yeejoin.equipmanage.common.entity.EquipmentSpecific
;
import
com.yeejoin.equipmanage.common.entity.EquipmentSpecificIndex
;
import
com.yeejoin.equipmanage.common.entity.MaintenanceResourceData
;
import
com.yeejoin.equipmanage.common.entity.dto.EquipmentSpecificDTO
;
import
com.yeejoin.equipmanage.common.entity.dto.EquipmentSpecificDTO
;
import
com.yeejoin.equipmanage.common.entity.vo.ComplementCodeVO
;
import
com.yeejoin.equipmanage.common.entity.vo.ComplementCodeVO
;
import
com.yeejoin.equipmanage.common.entity.vo.EquipmentSpecificVo
;
import
com.yeejoin.equipmanage.common.entity.vo.EquipmentSpecificVo
;
...
@@ -201,9 +198,13 @@ public interface EquipmentSpecificMapper extends BaseMapper<EquipmentSpecific> {
...
@@ -201,9 +198,13 @@ public interface EquipmentSpecificMapper extends BaseMapper<EquipmentSpecific> {
*/
*/
List
<
Map
<
String
,
String
>>
getBoxTropicsIndexDetails
();
List
<
Map
<
String
,
String
>>
getBoxTropicsIndexDetails
();
/**
/**
* 统计数据
* 统计数据
* @return
* @return
*/
*/
List
<
Map
<
String
,
Object
>>
queryCompanyStaData
();
List
<
Map
<
String
,
Object
>>
queryCompanyStaData
();
String
getEquipmentBySpecificId
(
@Param
(
"specificId"
)
Long
specificId
);
}
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/mapper/VideoEquipmentSpecificMapper.java
View file @
997d6888
...
@@ -3,6 +3,9 @@ package com.yeejoin.equipmanage.mapper;
...
@@ -3,6 +3,9 @@ package com.yeejoin.equipmanage.mapper;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.yeejoin.equipmanage.common.entity.VideoEquipmentSpecific
;
import
com.yeejoin.equipmanage.common.entity.VideoEquipmentSpecific
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
/**
/**
* @author ZeHua Li
* @author ZeHua Li
...
@@ -11,4 +14,5 @@ import org.apache.ibatis.annotations.Mapper;
...
@@ -11,4 +14,5 @@ import org.apache.ibatis.annotations.Mapper;
*/
*/
@Mapper
@Mapper
public
interface
VideoEquipmentSpecificMapper
extends
BaseMapper
<
VideoEquipmentSpecific
>
{
public
interface
VideoEquipmentSpecificMapper
extends
BaseMapper
<
VideoEquipmentSpecific
>
{
List
<
VideoEquipmentSpecific
>
findBySpecificIdAndVideoIdIn
(
@Param
(
"equipmentSpecificId"
)
Long
equipmentSpecificId
,
@Param
(
"list"
)
List
<
Long
>
videoIdList
);
}
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/IEquipmentSpecificSerivce.java
View file @
997d6888
package
com
.
yeejoin
.
equipmanage
.
service
;
package
com
.
yeejoin
.
equipmanage
.
service
;
import
java.util.LinkedHashMap
;
import
java.util.List
;
import
java.util.Map
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.baomidou.mybatisplus.extension.service.IService
;
...
@@ -16,14 +12,13 @@ import com.yeejoin.equipmanage.common.entity.EquipmentSpecific;
...
@@ -16,14 +12,13 @@ import com.yeejoin.equipmanage.common.entity.EquipmentSpecific;
import
com.yeejoin.equipmanage.common.entity.EquipmentSpecificIndex
;
import
com.yeejoin.equipmanage.common.entity.EquipmentSpecificIndex
;
import
com.yeejoin.equipmanage.common.entity.dto.EquipmentSpecificDTO
;
import
com.yeejoin.equipmanage.common.entity.dto.EquipmentSpecificDTO
;
import
com.yeejoin.equipmanage.common.entity.vo.ComplementCodeVO
;
import
com.yeejoin.equipmanage.common.entity.vo.ComplementCodeVO
;
import
com.yeejoin.equipmanage.common.entity.vo.DetailPaneVO
;
import
com.yeejoin.equipmanage.common.entity.vo.EquipmentSpecificVo
;
import
com.yeejoin.equipmanage.common.entity.vo.EquipmentSpecificVo
;
import
com.yeejoin.equipmanage.common.entity.vo.SourceNameByEquipSpeIdVO
;
import
com.yeejoin.equipmanage.common.entity.vo.SourceNameByEquipSpeIdVO
;
import
com.yeejoin.equipmanage.common.vo.
EquipFor3DVO
;
import
com.yeejoin.equipmanage.common.vo.
*
;
import
com.yeejoin.equipmanage.common.vo.EquipmentDate
;
import
com.yeejoin.equipmanage.common.vo.EquipmentDetailVo
;
import
java.util.LinkedHashMap
;
import
com.yeejoin.equipmanage.common.vo.EquipmentOnCarVo
;
import
java.util.List
;
import
com.yeejoin.equipmanage.common.vo.EquipmentSpecific3dVo
;
import
java.util.Map
;
/**
/**
* @author ZeHua Li
* @author ZeHua Li
...
@@ -168,6 +163,7 @@ public interface IEquipmentSpecificSerivce extends IService<EquipmentSpecific> {
...
@@ -168,6 +163,7 @@ public interface IEquipmentSpecificSerivce extends IService<EquipmentSpecific> {
/**
/**
* 根据specificId删除相关数据
* 根据specificId删除相关数据
*
* @param specificId specificId
* @param specificId specificId
* @return Boolean
* @return Boolean
*/
*/
...
@@ -175,28 +171,39 @@ public interface IEquipmentSpecificSerivce extends IService<EquipmentSpecific> {
...
@@ -175,28 +171,39 @@ public interface IEquipmentSpecificSerivce extends IService<EquipmentSpecific> {
/**
/**
* 集成页面刷新,发送数据时调用
* 集成页面刷新,发送数据时调用
*
* @param systemTypeCode
* @param systemTypeCode
*/
*/
void
integrationPageSysDataRefresh
(
String
systemTypeCode
);
void
integrationPageSysDataRefresh
(
String
systemTypeCode
);
/**
/**
* 更新设备表实时指标状态
* 更新设备表实时指标状态
*
* @param indexs
* @param indexs
*/
*/
void
updateEquipmentSpecIndexRealtimeData
(
List
<
EquipmentSpecificIndex
>
indexs
);
void
updateEquipmentSpecIndexRealtimeData
(
List
<
EquipmentSpecificIndex
>
indexs
);
List
<
EquipmentSpecificVo
>
getEquipAndCarIotcodeByIotcode
(
String
iotCode
);
List
<
EquipmentSpecificVo
>
getEquipAndCarIotcodeByIotcode
(
String
iotCode
);
/**
/**
* 获取中州环境监测指标详情
* 获取中州环境监测指标详情
*
* @return
* @return
*/
*/
Map
<
String
,
List
<
Map
<
String
,
String
>>>
getFessIndexDetails
();
Map
<
String
,
List
<
Map
<
String
,
String
>>>
getFessIndexDetails
();
/**
/**
* 更新redis 统计数据
* 更新redis 统计数据
*/
*/
void
refreshStaData
();
void
refreshStaData
();
/* 设备绑定摄像头
*
* @param videoOnEquipmentSpecificVo
* @return
*/
Boolean
videoOnEquipmentSpecific
(
VideoOnEquipmentSpecificVo
videoOnEquipmentSpecificVo
);
}
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/IVideoEquipmentSpecificService.java
View file @
997d6888
...
@@ -3,10 +3,19 @@ package com.yeejoin.equipmanage.service;
...
@@ -3,10 +3,19 @@ package com.yeejoin.equipmanage.service;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.yeejoin.equipmanage.common.entity.VideoEquipmentSpecific
;
import
com.yeejoin.equipmanage.common.entity.VideoEquipmentSpecific
;
import
java.util.List
;
/**
/**
* @author ZeHua Li
* @author ZeHua Li
* @date 2020/11/23 15:42
* @date 2020/11/23 15:42
* @since v2.0
* @since v2.0
*/
*/
public
interface
IVideoEquipmentSpecificService
extends
IService
<
VideoEquipmentSpecific
>
{
public
interface
IVideoEquipmentSpecificService
extends
IService
<
VideoEquipmentSpecific
>
{
/**
* 获取设备或摄像头ID绑定集合
* @param equipmentSpecificId
* @param videoIdList
* @return
*/
List
<
VideoEquipmentSpecific
>
findBySpecificIdAndVideoIdIn
(
Long
equipmentSpecificId
,
List
<
Long
>
videoIdList
);
}
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/impl/BuildingServiceImpl.java
View file @
997d6888
...
@@ -126,6 +126,8 @@ public class BuildingServiceImpl extends ServiceImpl<BuildingMapper, Building> i
...
@@ -126,6 +126,8 @@ public class BuildingServiceImpl extends ServiceImpl<BuildingMapper, Building> i
@Autowired
@Autowired
private
JCSRemoteService
jcsRemoteService
;
private
JCSRemoteService
jcsRemoteService
;
@Value
(
"${window.vedioFormat}"
)
private
String
vedioFormat
;
@Autowired
@Autowired
private
SourceSceneMapper
sourceSceneMapper
;
private
SourceSceneMapper
sourceSceneMapper
;
...
@@ -780,6 +782,7 @@ public class BuildingServiceImpl extends ServiceImpl<BuildingMapper, Building> i
...
@@ -780,6 +782,7 @@ public class BuildingServiceImpl extends ServiceImpl<BuildingMapper, Building> i
x
.
setLocation
(
x
.
getAddress
());
x
.
setLocation
(
x
.
getAddress
());
}
}
}
}
x
.
setVedioFormat
(
vedioFormat
);
x
.
setUrl
(
videoService
.
getVideoUrl
(
x
.
getName
(),
x
.
getPresetPosition
(),
x
.
getUrl
(),
x
.
getCode
()));
x
.
setUrl
(
videoService
.
getVideoUrl
(
x
.
getName
(),
x
.
getPresetPosition
(),
x
.
getUrl
(),
x
.
getCode
()));
});
});
}
}
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/impl/CarServiceImpl.java
View file @
997d6888
...
@@ -1164,7 +1164,11 @@ public class CarServiceImpl extends ServiceImpl<CarMapper, Car> implements ICarS
...
@@ -1164,7 +1164,11 @@ public class CarServiceImpl extends ServiceImpl<CarMapper, Car> implements ICarS
carInfoVo
.
setEquipmentName
(
equipment
!=
null
?
equipment
.
getName
()
:
""
);
carInfoVo
.
setEquipmentName
(
equipment
!=
null
?
equipment
.
getName
()
:
""
);
carInfoVo
.
setCategoryId
(
equipment
!=
null
?
equipment
.
getCategoryId
()
:
null
);
carInfoVo
.
setCategoryId
(
equipment
!=
null
?
equipment
.
getCategoryId
()
:
null
);
carInfoVo
.
setCategoryName
(
categoryMap
.
get
(
carInfoVo
.
getCategoryId
()));
carInfoVo
.
setCategoryName
(
categoryMap
.
get
(
carInfoVo
.
getCategoryId
()));
if
(
car
.
getImg
()
!=
null
)
{
carInfoVo
.
setName
(
car
.
getName
()+
"("
+
car
.
getCarNum
()+
")"
);
if
(
car
.
getImg
()
!=
null
){
List
<
String
>
img
=
new
ArrayList
<>();
List
<
String
>
img
=
new
ArrayList
<>();
img
.
add
(
car
.
getImg
().
get
(
0
).
getUrl
());
img
.
add
(
car
.
getImg
().
get
(
0
).
getUrl
());
carInfoVo
.
setImage
(
img
);
carInfoVo
.
setImage
(
img
);
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/impl/ConfirmAlarmServiceImpl.java
View file @
997d6888
...
@@ -2,6 +2,7 @@ package com.yeejoin.equipmanage.service.impl;
...
@@ -2,6 +2,7 @@ package com.yeejoin.equipmanage.service.impl;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.yeejoin.amos.boot.module.jcs.api.dto.IotSystemAlarmRo
;
import
com.yeejoin.amos.boot.module.jcs.api.dto.IotSystemAlarmRo
;
import
com.yeejoin.amos.feign.privilege.model.AgencyUserModel
;
import
com.yeejoin.amos.feign.privilege.model.AgencyUserModel
;
...
@@ -11,16 +12,22 @@ import com.yeejoin.equipmanage.common.entity.EquipmentSpecific;
...
@@ -11,16 +12,22 @@ import com.yeejoin.equipmanage.common.entity.EquipmentSpecific;
import
com.yeejoin.equipmanage.common.entity.EquipmentSpecificAlarm
;
import
com.yeejoin.equipmanage.common.entity.EquipmentSpecificAlarm
;
import
com.yeejoin.equipmanage.common.entity.EquipmentSpecificAlarmLog
;
import
com.yeejoin.equipmanage.common.entity.EquipmentSpecificAlarmLog
;
import
com.yeejoin.equipmanage.common.entity.vo.AlamVideoVO
;
import
com.yeejoin.equipmanage.common.entity.vo.AlamVideoVO
;
import
com.yeejoin.equipmanage.common.enums.AlarmCleanTypeEnum
;
import
com.yeejoin.equipmanage.common.enums.AlarmStatusEnum
;
import
com.yeejoin.equipmanage.common.enums.AlarmTypeEnum
;
import
com.yeejoin.equipmanage.common.enums.AlarmTypeEnum
;
import
com.yeejoin.equipmanage.common.enums.TopicEnum
;
import
com.yeejoin.equipmanage.common.enums.TopicEnum
;
import
com.yeejoin.equipmanage.common.utils.StringUtil
;
import
com.yeejoin.equipmanage.fegin.JcsFeign
;
import
com.yeejoin.equipmanage.fegin.JcsFeign
;
import
com.yeejoin.equipmanage.mapper.ConfirmAlarmMapper
;
import
com.yeejoin.equipmanage.mapper.ConfirmAlarmMapper
;
import
com.yeejoin.equipmanage.mapper.EquipmentSpecificAlarmMapper
;
import
com.yeejoin.equipmanage.mapper.EquipmentSpecificMapper
;
import
com.yeejoin.equipmanage.mapper.VideoMapper
;
import
com.yeejoin.equipmanage.mapper.VideoMapper
;
import
com.yeejoin.equipmanage.remote.RemoteSecurityService
;
import
com.yeejoin.equipmanage.remote.RemoteSecurityService
;
import
com.yeejoin.equipmanage.remote.WebMqttHandler
;
import
com.yeejoin.equipmanage.remote.WebMqttHandler
;
import
com.yeejoin.equipmanage.service.*
;
import
com.yeejoin.equipmanage.service.*
;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.BeanUtils
;
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.stereotype.Service
;
import
org.springframework.stereotype.Service
;
...
@@ -28,6 +35,7 @@ import org.springframework.util.ObjectUtils;
...
@@ -28,6 +35,7 @@ import org.springframework.util.ObjectUtils;
import
org.typroject.tyboot.core.foundation.utils.ValidationUtil
;
import
org.typroject.tyboot.core.foundation.utils.ValidationUtil
;
import
org.typroject.tyboot.core.restful.exception.instance.BadRequest
;
import
org.typroject.tyboot.core.restful.exception.instance.BadRequest
;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
...
@@ -74,9 +82,20 @@ public class ConfirmAlarmServiceImpl extends ServiceImpl<ConfirmAlarmMapper, Equ
...
@@ -74,9 +82,20 @@ public class ConfirmAlarmServiceImpl extends ServiceImpl<ConfirmAlarmMapper, Equ
@Value
(
"${systemctl.jcs.switch}"
)
@Value
(
"${systemctl.jcs.switch}"
)
private
Boolean
jcsSwitch
;
private
Boolean
jcsSwitch
;
@Value
(
"${window.vedioFormat}"
)
String
vedioFormat
;
@Autowired
@Autowired
private
RuleConfirmAlarmService
ruleConfirmAlamService
;
private
RuleConfirmAlarmService
ruleConfirmAlamService
;
@Autowired
private
EquipmentSpecificMapper
equipmentSpecificMapper
;
@Autowired
private
EquipmentSpecificAlarmMapper
equipmentSpecificAlarmMapper
;
@Override
@Override
public
Map
<
String
,
Object
>
getDetailsById
(
Long
alarmId
,
Long
equipId
,
String
type
,
String
area
)
{
public
Map
<
String
,
Object
>
getDetailsById
(
Long
alarmId
,
Long
equipId
,
String
type
,
String
area
)
{
final
String
videoType
=
"video"
;
final
String
videoType
=
"video"
;
...
@@ -85,6 +104,7 @@ public class ConfirmAlarmServiceImpl extends ServiceImpl<ConfirmAlarmMapper, Equ
...
@@ -85,6 +104,7 @@ public class ConfirmAlarmServiceImpl extends ServiceImpl<ConfirmAlarmMapper, Equ
if
(
videoType
.
equals
(
type
))
{
if
(
videoType
.
equals
(
type
))
{
List
<
AlamVideoVO
>
video
=
videoMapper
.
getVideoBySpeId
(
equipId
);
List
<
AlamVideoVO
>
video
=
videoMapper
.
getVideoBySpeId
(
equipId
);
video
.
forEach
(
action
->
{
video
.
forEach
(
action
->
{
action
.
setVedioFormat
(
vedioFormat
);
action
.
setUrl
(
videoService
.
getVideoUrl
(
action
.
getName
(),
action
.
getPresetPosition
(),
action
.
getUrl
(),
action
.
getCode
()));
action
.
setUrl
(
videoService
.
getVideoUrl
(
action
.
getName
(),
action
.
getPresetPosition
(),
action
.
getUrl
(),
action
.
getCode
()));
});
});
res
.
put
(
"video"
,
video
);
res
.
put
(
"video"
,
video
);
...
@@ -103,6 +123,7 @@ public class ConfirmAlarmServiceImpl extends ServiceImpl<ConfirmAlarmMapper, Equ
...
@@ -103,6 +123,7 @@ public class ConfirmAlarmServiceImpl extends ServiceImpl<ConfirmAlarmMapper, Equ
}
}
videoBySpeId
.
forEach
(
action
->
{
videoBySpeId
.
forEach
(
action
->
{
action
.
setVedioFormat
(
vedioFormat
);
action
.
setUrl
(
videoService
.
getVideoUrl
(
action
.
getName
(),
action
.
getPresetPosition
(),
action
.
getUrl
(),
action
.
getCode
()));
action
.
setUrl
(
videoService
.
getVideoUrl
(
action
.
getName
(),
action
.
getPresetPosition
(),
action
.
getUrl
(),
action
.
getCode
()));
});
});
res
.
put
(
"data"
,
specificAlarm
);
res
.
put
(
"data"
,
specificAlarm
);
...
@@ -122,6 +143,27 @@ public class ConfirmAlarmServiceImpl extends ServiceImpl<ConfirmAlarmMapper, Equ
...
@@ -122,6 +143,27 @@ public class ConfirmAlarmServiceImpl extends ServiceImpl<ConfirmAlarmMapper, Equ
if
(!
ObjectUtils
.
isEmpty
(
alarmLog
))
{
if
(!
ObjectUtils
.
isEmpty
(
alarmLog
))
{
Long
equipmentSpecificAlarmId
=
alarmLog
.
getEquipmentSpecificAlarmId
();
Long
equipmentSpecificAlarmId
=
alarmLog
.
getEquipmentSpecificAlarmId
();
ent
.
setEquipmentSpecificAlarmId
(
equipmentSpecificAlarmId
);
ent
.
setEquipmentSpecificAlarmId
(
equipmentSpecificAlarmId
);
String
cleanType
=
equipmentSpecificMapper
.
getEquipmentBySpecificId
(
alarmLog
.
getEquipmentSpecificId
());
if
(
StringUtil
.
isNotEmpty
(
cleanType
)
&&
AlarmCleanTypeEnum
.
QRXC
.
getCode
().
equals
(
cleanType
))
{
EquipmentSpecificAlarm
alarm
=
equipmentSpecificAlarmMapper
.
selectById
(
alarmLog
.
getEquipmentSpecificAlarmId
());
alarm
.
setStatus
(
AlarmStatusEnum
.
HF
.
getCode
());
equipmentSpecificAlarmMapper
.
updateById
(
alarm
);
if
(
isBatch
==
1
)
{
List
<
EquipmentSpecificAlarmLog
>
logs
=
equipmentSpecificAlarmLogService
.
getIsConfirmByAlarmId
(
equipmentSpecificAlarmId
,
"0"
);
logs
=
logs
.
stream
().
map
(
x
->
{
BeanUtils
.
copyProperties
(
ent
,
x
);
x
.
setCleanTime
(
new
Date
());
x
.
setStatus
(
AlarmStatusEnum
.
HF
.
getCode
());
return
x
;
}).
collect
(
Collectors
.
toList
());
equipmentSpecificAlarmLogService
.
updateBatchById
(
logs
);
}
else
{
ent
.
setCleanTime
(
new
Date
());
ent
.
setStatus
(
AlarmStatusEnum
.
HF
.
getCode
());
equipmentSpecificAlarmLogService
.
updateById
(
ent
);
}
return
;
}
// 如果是批量确警,先查询,再确警,用于批量消息推送
// 如果是批量确警,先查询,再确警,用于批量消息推送
isBatch
=
ent
.
getIsBatch
();
isBatch
=
ent
.
getIsBatch
();
if
(
isBatch
==
1
)
{
if
(
isBatch
==
1
)
{
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/impl/EquipmentDetailServiceImpl.java
View file @
997d6888
...
@@ -126,7 +126,7 @@ public class EquipmentDetailServiceImpl extends ServiceImpl<EquipmentDetailMappe
...
@@ -126,7 +126,7 @@ public class EquipmentDetailServiceImpl extends ServiceImpl<EquipmentDetailMappe
equipmentDetail
.
setEquPropertyList
(
equPropertyList
);
equipmentDetail
.
setEquPropertyList
(
equPropertyList
);
ManufacturerInfo
manufacturerInfo
=
manufacturerInfoMapper
.
selectById
(
equipmentDetail
.
getManufacturerId
());
ManufacturerInfo
manufacturerInfo
=
manufacturerInfoMapper
.
selectById
(
equipmentDetail
.
getManufacturerId
());
if
(
manufacturerInfo
!=
null
)
{
if
(
manufacturerInfo
!=
null
)
{
manufacturerInfo
.
setImg
(
fileServer
+
manufacturerInfo
.
getImg
());
manufacturerInfo
.
setImg
(
manufacturerInfo
.
getImg
());
}
}
equipmentDetail
.
setManufacturerInfo
(
manufacturerInfo
);
equipmentDetail
.
setManufacturerInfo
(
manufacturerInfo
);
equipmentDetail
.
setImg
(
getEquipFileList
(
id
,
FileTypeEnum
.
image
.
toString
()));
equipmentDetail
.
setImg
(
getEquipFileList
(
id
,
FileTypeEnum
.
image
.
toString
()));
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/impl/EquipmentServiceImpl.java
View file @
997d6888
...
@@ -126,8 +126,6 @@ public class EquipmentServiceImpl extends ServiceImpl<EquipmentMapper, Equipment
...
@@ -126,8 +126,6 @@ public class EquipmentServiceImpl extends ServiceImpl<EquipmentMapper, Equipment
@Override
@Override
public
boolean
addEquipmentDef
(
Equipment
equipment
)
throws
IllegalArgumentException
{
public
boolean
addEquipmentDef
(
Equipment
equipment
)
throws
IllegalArgumentException
{
try
{
// 查询装备定义名陈是否重复
// 查询装备定义名陈是否重复
nameDuplicate
(
equipment
);
nameDuplicate
(
equipment
);
// 设置code属性
// 设置code属性
...
@@ -138,18 +136,19 @@ public class EquipmentServiceImpl extends ServiceImpl<EquipmentMapper, Equipment
...
@@ -138,18 +136,19 @@ public class EquipmentServiceImpl extends ServiceImpl<EquipmentMapper, Equipment
equipment
.
setCode
(
code
);
equipment
.
setCode
(
code
);
}
}
int
num
=
equipmentMapper
.
insert
(
equipment
);
int
num
=
equipmentMapper
.
insert
(
equipment
);
// saveEquipmentQRCodes(equipment);
// saveEquipmentQRCodes(equipment);
JSONObject
equipRuleParams
=
new
JSONObject
();
JSONObject
equipRuleParams
=
new
JSONObject
();
equipRuleParams
.
put
(
"name"
,
equipment
.
getName
());
equipRuleParams
.
put
(
"name"
,
equipment
.
getName
());
equipRuleParams
.
put
(
"inspectionSpecId"
,
equipment
.
getInspectionSpec
());
equipRuleParams
.
put
(
"inspectionSpecId"
,
equipment
.
getInspectionSpec
());
try
{
patrolFeign
.
getEquipDetail
(
equipRuleParams
.
toJSONString
());
patrolFeign
.
getEquipDetail
(
equipRuleParams
.
toJSONString
());
}
catch
(
Exception
e
)
{
log
.
error
(
"新增装备定义操作中,检测到巡检服务未启动或启动出错!"
);
}
if
(
num
>
0
)
{
if
(
num
>
0
)
{
return
true
;
return
true
;
}
}
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
throw
new
RuntimeException
(
"录入的装备名称重复!"
);
}
return
false
;
return
false
;
}
}
...
@@ -232,7 +231,11 @@ public class EquipmentServiceImpl extends ServiceImpl<EquipmentMapper, Equipment
...
@@ -232,7 +231,11 @@ public class EquipmentServiceImpl extends ServiceImpl<EquipmentMapper, Equipment
JSONObject
equipRuleParams
=
new
JSONObject
();
JSONObject
equipRuleParams
=
new
JSONObject
();
equipRuleParams
.
put
(
"name"
,
equipment1
.
getName
());
equipRuleParams
.
put
(
"name"
,
equipment1
.
getName
());
equipRuleParams
.
put
(
"inspectionSpecId"
,
equipment1
.
getInspectionSpec
());
equipRuleParams
.
put
(
"inspectionSpecId"
,
equipment1
.
getInspectionSpec
());
try
{
patrolFeign
.
getEquipDetail
(
equipRuleParams
.
toJSONString
());
patrolFeign
.
getEquipDetail
(
equipRuleParams
.
toJSONString
());
}
catch
(
Exception
e
)
{
log
.
error
(
"编辑装备定义操作中,检测到巡检服务未启动或启动出错!"
);
}
if
(
savedEquipment
>
0
)
{
if
(
savedEquipment
>
0
)
{
return
true
;
return
true
;
}
}
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/impl/EquipmentSpecificAlarmServiceImpl.java
View file @
997d6888
...
@@ -208,10 +208,13 @@ public class EquipmentSpecificAlarmServiceImpl extends ServiceImpl<EquipmentSpec
...
@@ -208,10 +208,13 @@ public class EquipmentSpecificAlarmServiceImpl extends ServiceImpl<EquipmentSpec
||
AlarmTypeEnum
.
PB
.
getCode
().
equals
(
type
))
{
||
AlarmTypeEnum
.
PB
.
getCode
().
equals
(
type
))
{
dataVO
.
setAlarmType
(
AlarmTypeEnum
.
getTypeByCode
(
String
.
valueOf
(
type
)));
dataVO
.
setAlarmType
(
AlarmTypeEnum
.
getTypeByCode
(
String
.
valueOf
(
type
)));
}
}
dataVO
.
setType
(
String
.
valueOf
(
x
.
get
(
"type"
)));
dataVO
.
setAlarmInfo
(
x
.
get
(
"fireEquipmentName"
)
+
dataVO
.
getAlarmType
());
dataVO
.
setAlarmInfo
(
x
.
get
(
"fireEquipmentName"
)
+
dataVO
.
getAlarmType
());
dataVO
.
setEquipSpeId
(
Long
.
valueOf
(
String
.
valueOf
(
x
.
get
(
"fireEquipmentId"
))));
dataVO
.
setEquipSpeId
(
Long
.
valueOf
(
String
.
valueOf
(
x
.
get
(
"fireEquipmentId"
))));
dataVO
.
setAlarmId
(
Long
.
valueOf
(
String
.
valueOf
(
x
.
get
(
"alarmId"
))));
dataVO
.
setAlarmId
(
Long
.
valueOf
(
String
.
valueOf
(
x
.
get
(
"alarmId"
))));
dataVO
.
setAlarmTypeCode
(
String
.
valueOf
(
x
.
get
(
"fireEquipmentSpecificIndexKey"
)));
dataVO
.
setAlarmTypeCode
(
String
.
valueOf
(
x
.
get
(
"fireEquipmentSpecificIndexKey"
)));
dataVO
.
setCleanStatus
(
String
.
valueOf
(
x
.
get
(
"cleanStatus"
)));
dataVO
.
setCleanStatusVal
(
String
.
valueOf
(
x
.
get
(
"cleanStatusVal"
)));
res
.
add
(
dataVO
);
res
.
add
(
dataVO
);
});
});
}
}
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/impl/EquipmentSpecificSerivceImpl.java
View file @
997d6888
...
@@ -115,6 +115,8 @@ public class EquipmentSpecificSerivceImpl extends ServiceImpl<EquipmentSpecificM
...
@@ -115,6 +115,8 @@ public class EquipmentSpecificSerivceImpl extends ServiceImpl<EquipmentSpecificM
@Autowired
@Autowired
private
ICarService
carService
;
private
ICarService
carService
;
@Autowired
private
IVideoEquipmentSpecificService
videoEquipmentSpecificService
;
@Value
(
"${systemctl.dict.iot-core-param}"
)
@Value
(
"${systemctl.dict.iot-core-param}"
)
private
String
iotCoreParam
;
private
String
iotCoreParam
;
...
@@ -1604,4 +1606,33 @@ public class EquipmentSpecificSerivceImpl extends ServiceImpl<EquipmentSpecificM
...
@@ -1604,4 +1606,33 @@ public class EquipmentSpecificSerivceImpl extends ServiceImpl<EquipmentSpecificM
return
SourcesStatisticsImpl
.
PREFIX_CATEGORY_COUNT
+
row
.
get
(
"bizOrgCode"
).
toString
()
+
"_"
+
SourceTypeEnum
.
EQUIPMENT
.
getCode
()
+
"_"
+
row
.
get
(
"categoryCode"
).
toString
();
return
SourcesStatisticsImpl
.
PREFIX_CATEGORY_COUNT
+
row
.
get
(
"bizOrgCode"
).
toString
()
+
"_"
+
SourceTypeEnum
.
EQUIPMENT
.
getCode
()
+
"_"
+
row
.
get
(
"categoryCode"
).
toString
();
}
}
public
Boolean
videoOnEquipmentSpecific
(
VideoOnEquipmentSpecificVo
videoOnEquipmentSpecificVo
)
{
Long
equipmentSpecificId
=
videoOnEquipmentSpecificVo
.
getEquipmentSpecificId
();
List
<
Long
>
videoIdList
=
videoOnEquipmentSpecificVo
.
getVideoIdList
();
if
(
equipmentSpecificId
!=
null
)
{
EquipmentSpecific
equipmentSpecific
=
this
.
baseMapper
.
selectById
(
equipmentSpecificId
);
if
(!
ObjectUtils
.
isEmpty
(
equipmentSpecific
))
{
QueryWrapper
<
VideoEquipmentSpecific
>
queryWrapper
=
new
QueryWrapper
<>();
queryWrapper
.
eq
(
"equipment_specific_id"
,
equipmentSpecificId
);
boolean
remove
=
videoEquipmentSpecificService
.
remove
(
queryWrapper
);
if
(
remove
)
{
List
<
VideoEquipmentSpecific
>
videoSpecificList
=
new
ArrayList
<>();
videoIdList
.
parallelStream
().
forEach
(
x
->
{
VideoEquipmentSpecific
videoEquipmentSpecific
=
new
VideoEquipmentSpecific
();
videoEquipmentSpecific
.
setVideoId
(
x
);
videoEquipmentSpecific
.
setEquipmentSpecificId
(
equipmentSpecificId
);
videoSpecificList
.
add
(
videoEquipmentSpecific
);
});
videoEquipmentSpecificService
.
saveBatch
(
videoSpecificList
);
return
Boolean
.
TRUE
;
}
else
{
throw
new
RuntimeException
(
"移除设备摄像头绑定关系失败!"
);
}
}
else
{
throw
new
RuntimeException
(
"未获取到此设备!"
);
}
}
else
{
throw
new
RuntimeException
(
"设备ID为空!"
);
}
}
}
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/impl/MaintenanceResourceServiceImpl.java
View file @
997d6888
...
@@ -179,8 +179,8 @@ public class MaintenanceResourceServiceImpl extends ServiceImpl<MaintenanceResou
...
@@ -179,8 +179,8 @@ public class MaintenanceResourceServiceImpl extends ServiceImpl<MaintenanceResou
public
List
<
MaintenanceResourceDto
>
findTreeById
(
Long
id
)
{
public
List
<
MaintenanceResourceDto
>
findTreeById
(
Long
id
)
{
List
<
MaintenanceResourceDto
>
list
=
maintenanceResourceMapper
.
findTreeById
(
id
);
List
<
MaintenanceResourceDto
>
list
=
maintenanceResourceMapper
.
findTreeById
(
id
);
if
(!
CollectionUtils
.
isEmpty
(
list
))
{
if
(!
CollectionUtils
.
isEmpty
(
list
))
{
List
<
MaintenanceResourceDto
>
dtoList
=
TreeNodeUtil
.
assembleTreeNotFilter
(
list
);
List
<
MaintenanceResourceDto
>
dtoList
=
TreeNodeUtil
.
assembleTreeNotFilter
(
list
);
//&& x.getId().equals(Long.toString(id)) 这一段用于生成树之后并没有把树子节点数据从list列表删除造成的脏数据的问题 by chenhao 2022-01-12
List
<
MaintenanceResourceDto
>
collect
=
dtoList
.
stream
().
filter
(
x
->
!
MaintenanceResourceEnum
.
CLASSIFY
.
getValue
().
equals
(
x
.
getType
())).
collect
(
Collectors
.
toList
());
List
<
MaintenanceResourceDto
>
collect
=
dtoList
.
stream
().
filter
(
x
->
!
MaintenanceResourceEnum
.
CLASSIFY
.
getValue
().
equals
(
x
.
getType
())
&&
x
.
getId
().
equals
(
Long
.
toString
(
id
))
).
collect
(
Collectors
.
toList
());
return
collect
;
return
collect
;
}
}
return
Lists
.
newArrayList
();
return
Lists
.
newArrayList
();
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/impl/VideoEquipmentSpecificImpl.java
View file @
997d6888
...
@@ -4,8 +4,11 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
...
@@ -4,8 +4,11 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import
com.yeejoin.equipmanage.common.entity.VideoEquipmentSpecific
;
import
com.yeejoin.equipmanage.common.entity.VideoEquipmentSpecific
;
import
com.yeejoin.equipmanage.mapper.VideoEquipmentSpecificMapper
;
import
com.yeejoin.equipmanage.mapper.VideoEquipmentSpecificMapper
;
import
com.yeejoin.equipmanage.service.IVideoEquipmentSpecificService
;
import
com.yeejoin.equipmanage.service.IVideoEquipmentSpecificService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
java.util.List
;
/**
/**
* @author ZeHua Li
* @author ZeHua Li
* @date 2020/11/23 15:43
* @date 2020/11/23 15:43
...
@@ -13,4 +16,11 @@ import org.springframework.stereotype.Service;
...
@@ -13,4 +16,11 @@ import org.springframework.stereotype.Service;
*/
*/
@Service
@Service
public
class
VideoEquipmentSpecificImpl
extends
ServiceImpl
<
VideoEquipmentSpecificMapper
,
VideoEquipmentSpecific
>
implements
IVideoEquipmentSpecificService
{
public
class
VideoEquipmentSpecificImpl
extends
ServiceImpl
<
VideoEquipmentSpecificMapper
,
VideoEquipmentSpecific
>
implements
IVideoEquipmentSpecificService
{
@Autowired
private
VideoEquipmentSpecificMapper
videoEquipmentSpecificMapper
;
@Override
public
List
<
VideoEquipmentSpecific
>
findBySpecificIdAndVideoIdIn
(
Long
equipmentSpecificId
,
List
<
Long
>
videoIdList
)
{
return
videoEquipmentSpecificMapper
.
findBySpecificIdAndVideoIdIn
(
equipmentSpecificId
,
videoIdList
);
}
}
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/impl/VideoServiceImpl.java
View file @
997d6888
...
@@ -67,8 +67,8 @@ public class VideoServiceImpl extends ServiceImpl<VideoMapper, Video> implements
...
@@ -67,8 +67,8 @@ public class VideoServiceImpl extends ServiceImpl<VideoMapper, Video> implements
@Value
(
"${equip.security.code}"
)
@Value
(
"${equip.security.code}"
)
String
securityMonitorCode
;
String
securityMonitorCode
;
@Value
(
"${
param.isUseVideoTranscoding
}"
)
@Value
(
"${
window.vedioFormat
}"
)
String
isUseVideoTranscoding
;
String
vedioFormat
;
@Autowired
@Autowired
VideoMapper
videoMapper
;
VideoMapper
videoMapper
;
...
@@ -501,7 +501,7 @@ public class VideoServiceImpl extends ServiceImpl<VideoMapper, Video> implements
...
@@ -501,7 +501,7 @@ public class VideoServiceImpl extends ServiceImpl<VideoMapper, Video> implements
@Override
@Override
public
String
getVideoUrl
(
String
videoId
,
String
presetIndex
,
String
defaultUrl
,
String
code
)
{
public
String
getVideoUrl
(
String
videoId
,
String
presetIndex
,
String
defaultUrl
,
String
code
)
{
if
(
"
off"
.
equals
(
isUseVideoTranscoding
))
{
if
(
"
hls"
.
equals
(
vedioFormat
))
{
String
url
=
getVideoUrl
(
code
);
String
url
=
getVideoUrl
(
code
);
return
ObjectUtils
.
isEmpty
(
url
)
?
defaultUrl
:
url
;
return
ObjectUtils
.
isEmpty
(
url
)
?
defaultUrl
:
url
;
}
}
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-jcs-biz/src/main/java/com/yeejoin/amos/boot/module/jcs/biz/service/impl/AircraftServiceImpl.java
View file @
997d6888
...
@@ -121,8 +121,12 @@ public class AircraftServiceImpl extends BaseService<AircraftDto, Aircraft, Airc
...
@@ -121,8 +121,12 @@ public class AircraftServiceImpl extends BaseService<AircraftDto, Aircraft, Airc
String
aircraft
=
""
;
String
aircraft
=
""
;
List
<
AlertFormValue
>
list1
=
list
.
stream
().
filter
(
formValue
->
formValue
.
getFieldCode
().
equals
(
"aircraft"
)
||
formValue
.
getFieldCode
().
equals
(
"aircraftModel"
)).
collect
(
Collectors
.
toList
());
List
<
AlertFormValue
>
list1
=
list
.
stream
().
filter
(
formValue
->
formValue
.
getFieldCode
().
equals
(
"aircraft"
)
||
formValue
.
getFieldCode
().
equals
(
"aircraftModel"
)).
collect
(
Collectors
.
toList
());
if
(
list1
.
size
()
>
0
)
{
if
(
list1
.
size
()
>
0
)
{
if
(!
ValidationUtil
.
isEmpty
(
list1
.
get
(
0
).
getFieldValue
()))
{
aircraft
=
list1
.
get
(
0
).
getFieldValue
();
}
else
{
aircraft
=
list1
.
get
(
0
).
getFieldValueCode
();
aircraft
=
list1
.
get
(
0
).
getFieldValueCode
();
}
}
}
LambdaQueryWrapper
<
Aircraft
>
queryWrapper
=
new
LambdaQueryWrapper
<>();
LambdaQueryWrapper
<
Aircraft
>
queryWrapper
=
new
LambdaQueryWrapper
<>();
queryWrapper
.
eq
(
Aircraft:
:
getAircraftModel
,
aircraft
);
queryWrapper
.
eq
(
Aircraft:
:
getAircraftModel
,
aircraft
);
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-jcs-biz/src/main/java/com/yeejoin/amos/boot/module/jcs/biz/service/impl/AlertCalledServiceImpl.java
View file @
997d6888
...
@@ -640,11 +640,19 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal
...
@@ -640,11 +640,19 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal
/*
/*
* if(null == valueCode) { valueCode = alertFormValue.getFieldValue(); }
* if(null == valueCode) { valueCode = alertFormValue.getFieldValue(); }
*/
*/
// if("flightNumber".equals(alertFormValue.getFieldCode()) || "aircraftModel".equals(alertFormValue.getFieldCode())) {
if
(
"flightNumber"
.
equals
(
alertFormValue
.
getFieldCode
()))
{
// listdate.add(new KeyValueLabel(alertFormValue.getFieldName(), alertFormValue.getFieldCode(), alertFormValue.getFieldValueCode()));
listdate
.
add
(
new
KeyValueLabel
(
alertFormValue
.
getFieldName
(),
alertFormValue
.
getFieldCode
(),
alertFormValue
.
getFieldValueCode
()));
// } else {
}
else
{
if
(
"aircraftModel"
.
equals
(
alertFormValue
.
getFieldCode
()))
{
if
(
ValidationUtil
.
isEmpty
(
valueCode
))
{
listdate
.
add
(
new
KeyValueLabel
(
alertFormValue
.
getFieldName
(),
alertFormValue
.
getFieldCode
(),
alertFormValue
.
getFieldValueCode
()));
}
else
{
listdate
.
add
(
new
KeyValueLabel
(
alertFormValue
.
getFieldName
(),
alertFormValue
.
getFieldCode
(),
valueCode
));
listdate
.
add
(
new
KeyValueLabel
(
alertFormValue
.
getFieldName
(),
alertFormValue
.
getFieldCode
(),
valueCode
));
// }
}
}
else
{
listdate
.
add
(
new
KeyValueLabel
(
alertFormValue
.
getFieldName
(),
alertFormValue
.
getFieldCode
(),
valueCode
));
}
}
});
});
map
.
put
(
"data"
,
listdate
);
map
.
put
(
"data"
,
listdate
);
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-jcs-biz/src/main/java/com/yeejoin/amos/boot/module/jcs/biz/service/impl/AlertSubmittedServiceImpl.java
View file @
997d6888
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jcs
.
biz
.
service
.
impl
;
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jcs
.
biz
.
service
.
impl
;
import
java.io.BufferedOutputStream
;
import
java.io.File
;
import
java.io.FileNotFoundException
;
import
java.io.FileOutputStream
;
import
java.io.IOException
;
import
java.io.InputStream
;
import
java.lang.reflect.Field
;
import
java.text.ParseException
;
import
java.text.SimpleDateFormat
;
import
java.time.LocalDateTime
;
import
java.time.ZoneOffset
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.Collections
;
import
java.util.Comparator
;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.HashSet
;
import
java.util.Iterator
;
import
java.util.LinkedList
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Optional
;
import
java.util.Set
;
import
java.util.function.BiConsumer
;
import
java.util.function.Consumer
;
import
java.util.stream.Collectors
;
import
java.util.stream.IntStream
;
import
org.apache.commons.lang3.ObjectUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.poi.xwpf.usermodel.XWPFTable
;
import
org.apache.poi.xwpf.usermodel.XWPFTableRow
;
import
org.eclipse.paho.client.mqttv3.MqttException
;
import
org.eclipse.paho.client.mqttv3.MqttPersistenceException
;
import
org.openxmlformats.schemas.wordprocessingml.x2006.main.CTTc
;
import
org.openxmlformats.schemas.wordprocessingml.x2006.main.CTTcPr
;
import
org.openxmlformats.schemas.wordprocessingml.x2006.main.STJc.Enum
;
import
org.openxmlformats.schemas.wordprocessingml.x2006.main.STVerticalJc
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.typroject.tyboot.component.emq.EmqKeeper
;
import
org.typroject.tyboot.core.foundation.utils.ValidationUtil
;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONException
;
import
com.alibaba.fastjson.JSONException
;
...
@@ -38,12 +86,39 @@ import com.yeejoin.amos.boot.module.common.api.service.IFireTeamService;
...
@@ -38,12 +86,39 @@ import com.yeejoin.amos.boot.module.common.api.service.IFireTeamService;
import
com.yeejoin.amos.boot.module.common.biz.service.impl.FireTeamServiceImpl
;
import
com.yeejoin.amos.boot.module.common.biz.service.impl.FireTeamServiceImpl
;
import
com.yeejoin.amos.boot.module.common.biz.service.impl.FirefightersServiceImpl
;
import
com.yeejoin.amos.boot.module.common.biz.service.impl.FirefightersServiceImpl
;
import
com.yeejoin.amos.boot.module.common.biz.service.impl.OrgUsrServiceImpl
;
import
com.yeejoin.amos.boot.module.common.biz.service.impl.OrgUsrServiceImpl
;
import
com.yeejoin.amos.boot.module.jcs.api.dto.*
;
import
com.yeejoin.amos.boot.module.jcs.api.dto.AlertCallCommandDto
;
import
com.yeejoin.amos.boot.module.jcs.api.dto.AlertCallePowerTransferRo
;
import
com.yeejoin.amos.boot.module.jcs.api.dto.AlertCalledFormDto
;
import
com.yeejoin.amos.boot.module.jcs.api.dto.AlertCalledMobDto
;
import
com.yeejoin.amos.boot.module.jcs.api.dto.AlertCalledObjsDto
;
import
com.yeejoin.amos.boot.module.jcs.api.dto.AlertCalledPowerInfoDto
;
import
com.yeejoin.amos.boot.module.jcs.api.dto.AlertCalledRo
;
import
com.yeejoin.amos.boot.module.jcs.api.dto.AlertCalledZhDto
;
import
com.yeejoin.amos.boot.module.jcs.api.dto.AlertSubmittedDto
;
import
com.yeejoin.amos.boot.module.jcs.api.dto.AlertSubmittedExtDto
;
import
com.yeejoin.amos.boot.module.jcs.api.dto.AlertSubmittedSMSDto
;
import
com.yeejoin.amos.boot.module.jcs.api.dto.AlertSubmittedZHDto
;
import
com.yeejoin.amos.boot.module.jcs.api.dto.CarStatusInfoDto
;
import
com.yeejoin.amos.boot.module.jcs.api.dto.InstructionsZHDto
;
import
com.yeejoin.amos.boot.module.jcs.api.dto.PowerData
;
import
com.yeejoin.amos.boot.module.jcs.api.dto.PowerTransferCompanyDto
;
import
com.yeejoin.amos.boot.module.jcs.api.dto.PowerTransferCompanyResourcesDto
;
import
com.yeejoin.amos.boot.module.jcs.api.dto.PowerTransferCompanyZHDto
;
import
com.yeejoin.amos.boot.module.jcs.api.dto.PushMessageWebAndAppRo
;
import
com.yeejoin.amos.boot.module.jcs.api.dto.SchedulingReportingDto
;
import
com.yeejoin.amos.boot.module.jcs.api.dto.TemplateDto
;
import
com.yeejoin.amos.boot.module.jcs.api.dto.TemplateExtendDto
;
import
com.yeejoin.amos.boot.module.jcs.api.dto.VoiceRecordFileDto
;
import
com.yeejoin.amos.boot.module.jcs.api.entity.AlertCalled
;
import
com.yeejoin.amos.boot.module.jcs.api.entity.AlertCalled
;
import
com.yeejoin.amos.boot.module.jcs.api.entity.AlertSubmitted
;
import
com.yeejoin.amos.boot.module.jcs.api.entity.AlertSubmitted
;
import
com.yeejoin.amos.boot.module.jcs.api.entity.AlertSubmittedObject
;
import
com.yeejoin.amos.boot.module.jcs.api.entity.AlertSubmittedObject
;
import
com.yeejoin.amos.boot.module.jcs.api.entity.Template
;
import
com.yeejoin.amos.boot.module.jcs.api.entity.Template
;
import
com.yeejoin.amos.boot.module.jcs.api.enums.*
;
import
com.yeejoin.amos.boot.module.jcs.api.enums.AlertBusinessTypeEnum
;
import
com.yeejoin.amos.boot.module.jcs.api.enums.AlertSchedulingTypeEnum
;
import
com.yeejoin.amos.boot.module.jcs.api.enums.AlertStageEnums
;
import
com.yeejoin.amos.boot.module.jcs.api.enums.AlertSubmitTypeEnum
;
import
com.yeejoin.amos.boot.module.jcs.api.enums.FireCarStatusEnum
;
import
com.yeejoin.amos.boot.module.jcs.api.enums.SubmissionMethodEnum
;
import
com.yeejoin.amos.boot.module.jcs.api.mapper.AlertSubmittedMapper
;
import
com.yeejoin.amos.boot.module.jcs.api.mapper.AlertSubmittedMapper
;
import
com.yeejoin.amos.boot.module.jcs.api.mapper.PowerTransferCompanyMapper
;
import
com.yeejoin.amos.boot.module.jcs.api.mapper.PowerTransferCompanyMapper
;
import
com.yeejoin.amos.boot.module.jcs.api.mapper.PowerTransferMapper
;
import
com.yeejoin.amos.boot.module.jcs.api.mapper.PowerTransferMapper
;
...
@@ -54,33 +129,6 @@ import com.yeejoin.amos.component.feign.model.FeignClientResult;
...
@@ -54,33 +129,6 @@ import com.yeejoin.amos.component.feign.model.FeignClientResult;
import
com.yeejoin.amos.component.rule.RuleTrigger
;
import
com.yeejoin.amos.component.rule.RuleTrigger
;
import
com.yeejoin.amos.component.rule.config.RuleConfig
;
import
com.yeejoin.amos.component.rule.config.RuleConfig
;
import
com.yeejoin.amos.feign.systemctl.Systemctl
;
import
com.yeejoin.amos.feign.systemctl.Systemctl
;
import
org.apache.commons.lang3.ObjectUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.poi.xwpf.usermodel.XWPFTable
;
import
org.apache.poi.xwpf.usermodel.XWPFTableRow
;
import
org.eclipse.paho.client.mqttv3.MqttException
;
import
org.eclipse.paho.client.mqttv3.MqttPersistenceException
;
import
org.openxmlformats.schemas.wordprocessingml.x2006.main.STJc.Enum
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.typroject.tyboot.component.emq.EmqKeeper
;
import
org.typroject.tyboot.core.foundation.utils.ValidationUtil
;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
import
java.io.*
;
import
java.lang.reflect.Field
;
import
java.text.ParseException
;
import
java.text.SimpleDateFormat
;
import
java.time.LocalDateTime
;
import
java.time.ZoneOffset
;
import
java.util.*
;
import
java.util.function.BiConsumer
;
import
java.util.function.Consumer
;
import
java.util.stream.Collectors
;
import
java.util.stream.IntStream
;
/**
/**
...
@@ -197,12 +245,12 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
...
@@ -197,12 +245,12 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
TemplateExtendDto
template
=
null
;
TemplateExtendDto
template
=
null
;
Template
templateN
=
null
;
Template
templateN
=
null
;
if
(
AlertBusinessTypeEnum
.
警情初报
.
getName
().
equals
(
alertSubmittedExtDto
.
getBusinessType
()))
{
if
(
AlertBusinessTypeEnum
.
警情初报
.
getName
().
equals
(
alertSubmittedExtDto
.
getBusinessType
()))
{
// 获取任务派发模板
// 获取任务派发模板
templateN
=
templateService
templateN
=
templateService
.
getOne
(
new
QueryWrapper
<
Template
>().
eq
(
"type_code"
,
"JQCB"
).
eq
(
"format"
,
false
));
.
getOne
(
new
QueryWrapper
<
Template
>().
eq
(
"type_code"
,
"JQCB"
).
eq
(
"format"
,
false
));
template
=
new
TemplateExtendDto
();
template
=
new
TemplateExtendDto
();
BeanUtils
.
copyProperties
(
templateN
,
template
);
BeanUtils
.
copyProperties
(
templateN
,
template
);
template
.
setRichContent
(
template
.
getContent
());
template
.
setRichContent
(
template
.
getContent
());
}
else
{
}
else
{
...
@@ -216,39 +264,39 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
...
@@ -216,39 +264,39 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
*/
*/
AlertCalledRo
alertCalledRo
=
new
AlertCalledRo
();
AlertCalledRo
alertCalledRo
=
new
AlertCalledRo
();
String
replaceContent
=
""
;
String
replaceContent
=
""
;
if
(
null
!=
alertCalled
)
{
if
(
null
!=
alertCalled
)
{
replaceContent
=
RuleAlertCalledService
.
init
(
alertCalledRo
,
alertCalledVo
);
replaceContent
=
RuleAlertCalledService
.
init
(
alertCalledRo
,
alertCalledVo
);
}
}
Map
<
String
,
String
>
definitions
=
new
HashMap
<>();
Map
<
String
,
String
>
definitions
=
new
HashMap
<>();
definitions
.
put
(
"$type"
,
alertCalled
.
getAlertType
());
definitions
.
put
(
"$type"
,
alertCalled
.
getAlertType
());
definitions
.
put
(
"$callTime"
,
DateUtils
.
convertDateToString
(
alertCalled
.
getCallTime
(),
DateUtils
.
DATE_TIME_PATTERN
));
definitions
.
put
(
"$callTime"
,
DateUtils
.
convertDateToString
(
alertCalled
.
getCallTime
(),
DateUtils
.
DATE_TIME_PATTERN
));
definitions
.
put
(
"$replaceContent"
,
replaceContent
);
definitions
.
put
(
"$replaceContent"
,
replaceContent
);
definitions
.
put
(
"$address"
,
ValidationUtil
.
isEmpty
(
alertCalled
.
getAddress
())
?
""
:
alertCalled
.
getAddress
());
definitions
.
put
(
"$address"
,
ValidationUtil
.
isEmpty
(
alertCalled
.
getAddress
())
?
""
:
alertCalled
.
getAddress
());
// definitions.put("$recDate",DateUtils.dateTimeToDateString(alertCalled.getUpdateTime()));
// definitions.put("$recDate",DateUtils.dateTimeToDateString(alertCalled.getUpdateTime()));
definitions
.
put
(
"$contactUser"
,
ValidationUtil
.
isEmpty
(
alertCalled
.
getContactUser
())
?
""
:
alertCalled
.
getContactUser
());
definitions
.
put
(
"$contactUser"
,
ValidationUtil
.
isEmpty
(
alertCalled
.
getContactUser
())
?
""
:
alertCalled
.
getContactUser
());
definitions
.
put
(
"$trappedNum"
,
ValidationUtil
.
isEmpty
(
alertCalledRo
.
getTrappedNum
())
?
""
:
String
.
valueOf
(
alertCalled
.
getTrappedNum
()));
definitions
.
put
(
"$trappedNum"
,
ValidationUtil
.
isEmpty
(
alertCalledRo
.
getTrappedNum
())
?
""
:
String
.
valueOf
(
alertCalled
.
getTrappedNum
()));
definitions
.
put
(
"$casualtiesNum"
,
ValidationUtil
.
isEmpty
(
alertCalled
.
getCasualtiesNum
())
?
""
:
String
.
valueOf
(
alertCalled
.
getCasualtiesNum
()));
definitions
.
put
(
"$casualtiesNum"
,
ValidationUtil
.
isEmpty
(
alertCalled
.
getCasualtiesNum
())
?
""
:
String
.
valueOf
(
alertCalled
.
getCasualtiesNum
()));
definitions
.
put
(
"$contactPhone"
,
ValidationUtil
.
isEmpty
(
alertCalled
.
getContactPhone
())
?
""
:
alertCalled
.
getContactPhone
());
definitions
.
put
(
"$contactPhone"
,
ValidationUtil
.
isEmpty
(
alertCalled
.
getContactPhone
())
?
""
:
alertCalled
.
getContactPhone
());
String
companyName
=
JSONObject
.
parseObject
(
alertSubmittedExtDto
.
getSubmissionContent
()).
getString
(
"$companyName"
)
;
String
companyName
=
JSONObject
.
parseObject
(
alertSubmittedExtDto
.
getSubmissionContent
()).
getString
(
"$companyName"
)
;
JSONObject
jsonObject
=
null
;
JSONObject
jsonObject
=
null
;
if
(!
ValidationUtil
.
isEmpty
(
alertCalled
.
getUpdateTime
()))
{
if
(!
ValidationUtil
.
isEmpty
(
alertCalled
.
getUpdateTime
()))
{
jsonObject
=
JSONObject
.
parseObject
(
alertSubmittedExtDto
.
getSubmissionContent
());
jsonObject
=
JSONObject
.
parseObject
(
alertSubmittedExtDto
.
getSubmissionContent
());
jsonObject
.
put
(
"recDate"
,
DateUtils
.
convertDateToString
(
alertCalled
.
getUpdateTime
(),
DateUtils
.
DATE_TIME_PATTERN
));
jsonObject
.
put
(
"recDate"
,
DateUtils
.
convertDateToString
(
alertCalled
.
getUpdateTime
(),
DateUtils
.
DATE_TIME_PATTERN
));
}
}
if
(
jsonObject
!=
null
)
{
if
(
jsonObject
!=
null
)
{
alertSubmittedExtDto
.
setSubmissionContent
(
jsonObject
.
toJSONString
());
alertSubmittedExtDto
.
setSubmissionContent
(
jsonObject
.
toJSONString
());
}
}
definitions
.
put
(
"$companyName"
,
null
==
companyName
?
""
:
companyName
);
definitions
.
put
(
"$companyName"
,
null
==
companyName
?
""
:
companyName
);
String
content
=
getTaskInformation
(
template
.
getRichContent
(),
definitions
);
String
content
=
getTaskInformation
(
template
.
getRichContent
(),
definitions
);
alertSubmittedExtDto
.
setSubmissionContentValue
(
JSONObject
.
parseObject
(
alertSubmittedExtDto
.
getSubmissionContent
()));
alertSubmittedExtDto
.
setSubmissionContentValue
(
JSONObject
.
parseObject
(
alertSubmittedExtDto
.
getSubmissionContent
()));
alertSubmittedExtDto
.
setSubmissionContent
(
content
);
alertSubmittedExtDto
.
setSubmissionContent
(
content
);
...
@@ -268,8 +316,8 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
...
@@ -268,8 +316,8 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
@Override
@Override
public
Boolean
save
(
AlertSubmittedDto
alertSubmittedDto
,
String
userName
)
throws
Exception
{
public
Boolean
save
(
AlertSubmittedDto
alertSubmittedDto
,
String
userName
)
throws
Exception
{
try
{
try
{
String
company
=
ValidationUtil
.
isEmpty
(
alertSubmittedDto
.
getSubmitContent
().
get
(
"companyName"
))
?
""
:
alertSubmittedDto
.
getSubmitContent
().
get
(
"companyName"
).
toString
()
;
String
company
=
ValidationUtil
.
isEmpty
(
alertSubmittedDto
.
getSubmitContent
().
get
(
"companyName"
))
?
""
:
alertSubmittedDto
.
getSubmitContent
().
get
(
"companyName"
).
toString
()
;
Map
<
String
,
String
>
map
=
saveAlertSubmitted
(
alertSubmittedDto
,
userName
);
Map
<
String
,
String
>
map
=
saveAlertSubmitted
(
alertSubmittedDto
,
userName
);
// 组装规则入参
// 组装规则入参
AlertCalled
alertCalled
=
alertCalledService
.
getById
(
alertSubmittedDto
.
getAlertCalledId
());
AlertCalled
alertCalled
=
alertCalledService
.
getById
(
alertSubmittedDto
.
getAlertCalledId
());
alertCalled
.
setCompanyName
(
company
);
alertCalled
.
setCompanyName
(
company
);
...
@@ -282,7 +330,7 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
...
@@ -282,7 +330,7 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
alertCalledVo
.
setAlertCalled
(
alertCalled
);
alertCalledVo
.
setAlertCalled
(
alertCalled
);
// 调用规则
// 调用规则
ruleAlertCalledService
.
fireAlertCalledRule
(
alertCalledVo
,
map
.
get
(
"alertWay"
),
map
.
get
(
"mobiles"
),
map
.
get
(
"usIds"
),
map
.
get
(
"feedBack"
));
ruleAlertCalledService
.
fireAlertCalledRule
(
alertCalledVo
,
map
.
get
(
"alertWay"
),
map
.
get
(
"mobiles"
),
map
.
get
(
"usIds"
),
map
.
get
(
"feedBack"
));
//通知实战指挥页面发送mqtt 默认发送 String 类型 0, 新警情 1 警情状态变化
//通知实战指挥页面发送mqtt 默认发送 String 类型 0, 新警情 1 警情状态变化
emqKeeper
.
getMqttClient
().
publish
(
powertopic
,
"0"
.
getBytes
(),
RuleConfig
.
DEFAULT_QOS
,
true
);
emqKeeper
.
getMqttClient
().
publish
(
powertopic
,
"0"
.
getBytes
(),
RuleConfig
.
DEFAULT_QOS
,
true
);
}
catch
(
MqttException
e
)
{
}
catch
(
MqttException
e
)
{
...
@@ -294,7 +342,7 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
...
@@ -294,7 +342,7 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
/**
/**
* 规则回调
* 规则回调
*/
*/
public
void
ruleCallbackAction
(
String
smsCode
,
List
<
Map
<
String
,
Object
>>
sendIds
,
Object
object
)
throws
Exception
{
public
void
ruleCallbackAction
(
String
smsCode
,
List
<
Map
<
String
,
Object
>>
sendIds
,
Object
object
)
throws
Exception
{
// 获取报送对象列表
// 获取报送对象列表
List
<
AlertSubmittedObject
>
alertSubmittedObjectList
=
Lists
.
newArrayList
();
List
<
AlertSubmittedObject
>
alertSubmittedObjectList
=
Lists
.
newArrayList
();
...
@@ -312,7 +360,7 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
...
@@ -312,7 +360,7 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
String
alertSubmittedId
=
calledRo
.
getAlertSubmittedId
();
String
alertSubmittedId
=
calledRo
.
getAlertSubmittedId
();
alertCalledId
=
calledRo
.
getSequenceNbr
();
alertCalledId
=
calledRo
.
getSequenceNbr
();
AlertCalledObjsDto
alertCalledObjsDto
=
(
AlertCalledObjsDto
)
alertCalledService
.
selectAlertCalledByIdNoRedisNew
(
Long
.
valueOf
(
calledRo
.
getSequenceNbr
()));
AlertCalledObjsDto
alertCalledObjsDto
=
(
AlertCalledObjsDto
)
alertCalledService
.
selectAlertCalledByIdNoRedisNew
(
Long
.
valueOf
(
calledRo
.
getSequenceNbr
()));
alertCalled
=
alertCalledObjsDto
.
getAlertCalled
();
alertCalled
=
alertCalledObjsDto
.
getAlertCalled
();
// AlertCalledRo tempCalledRo = new AlertCalledRo();
// AlertCalledRo tempCalledRo = new AlertCalledRo();
...
@@ -325,80 +373,80 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
...
@@ -325,80 +373,80 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
// 警情续报 警情结案,非警情确认选择人员电话号码
// 警情续报 警情结案,非警情确认选择人员电话号码
String
ids
=
calledRo
.
getIds
();
String
ids
=
calledRo
.
getIds
();
if
(!
ValidationUtil
.
isEmpty
(
ids
))
{
if
(!
ValidationUtil
.
isEmpty
(
ids
))
{
List
<
String
>
ls
=
Arrays
.
asList
(
ids
.
split
(
","
));
List
<
String
>
ls
=
Arrays
.
asList
(
ids
.
split
(
","
));
for
(
String
s
:
ls
for
(
String
s:
ls
)
{
)
{
mobiles
.
add
(
s
);
mobiles
.
add
(
s
);
}
}
}
}
// 获取报送规则
// 获取报送规则
sendIds
.
stream
().
forEach
(
e
->
{
sendIds
.
stream
().
forEach
(
e
->
{
// 一般火灾 // 航空器救援
// 一般火灾 // 航空器救援
if
(
alertTypeCode
.
equals
(
AlertStageEnums
.
YBHZ
.
getCode
())
||
alertTypeCode
.
equals
(
AlertStageEnums
.
HKJY
.
getCode
()))
{
if
(
alertTypeCode
.
equals
(
AlertStageEnums
.
YBHZ
.
getCode
())
||
alertTypeCode
.
equals
(
AlertStageEnums
.
HKJY
.
getCode
()))
{
if
(
e
.
containsKey
(
"onDuty"
))
{
if
(
e
.
containsKey
(
"onDuty"
))
{
// 当日值班人员:获值班表中包括消救部、综合办公室、消防支队、应急指挥科的值班人员。
// 当日值班人员:获值班表中包括消救部、综合办公室、消防支队、应急指挥科的值班人员。
String
[]
arr
=
e
.
get
(
"onDuty"
).
toString
().
split
(
","
);
String
[]
arr
=
e
.
get
(
"onDuty"
).
toString
().
split
(
","
);
List
<
String
>
list
=
Arrays
.
asList
(
arr
);
List
<
String
>
list
=
Arrays
.
asList
(
arr
);
List
<
Map
<
String
,
Object
>>
mapList
=
iDutyPersonService
.
queryByCompanyId
(
list
);
List
<
Map
<
String
,
Object
>>
mapList
=
iDutyPersonService
.
queryByCompanyId
(
list
);
orgUsers
.
addAll
(
mapList
);
orgUsers
.
addAll
(
mapList
);
}
}
if
(
e
.
containsKey
(
"fireBrigade"
))
{
if
(
e
.
containsKey
(
"fireBrigade"
))
{
// 根据人员岗位:班组长、队长、通讯员; 消防队伍--消防人员 中,对应岗位的人员
// 根据人员岗位:班组长、队长、通讯员; 消防队伍--消防人员 中,对应岗位的人员
List
<
FirefightersDto
>
fireBrigade
=
firefightersService
.
queryById
(
e
.
get
(
"fireBrigade"
).
toString
().
split
(
","
),
e
.
get
(
"name"
).
toString
());
List
<
FirefightersDto
>
fireBrigade
=
firefightersService
.
queryById
(
e
.
get
(
"fireBrigade"
).
toString
().
split
(
","
),
e
.
get
(
"name"
).
toString
());
fireBrigade
.
stream
().
forEach
(
f
->
{
fireBrigade
.
stream
().
forEach
(
f
->
{
HashMap
<
String
,
Object
>
map
=
new
HashMap
<>();
HashMap
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"telephone"
,
f
.
getMobilePhone
());
map
.
put
(
"telephone"
,
f
.
getMobilePhone
());
map
.
put
(
"sequenceNbr"
,
f
.
getSequenceNbr
());
map
.
put
(
"sequenceNbr"
,
f
.
getSequenceNbr
());
map
.
put
(
"bizOrgName"
,
f
.
getName
());
map
.
put
(
"bizOrgName"
,
f
.
getName
());
map
.
put
(
"amosUserId"
,
f
.
getAmosUserId
());
map
.
put
(
"amosUserId"
,
f
.
getAmosUserId
());
map
.
put
(
"companyName"
,
e
.
get
(
"name"
).
toString
());
map
.
put
(
"companyName"
,
e
.
get
(
"name"
).
toString
());
orgUsers
.
add
(
map
);
orgUsers
.
add
(
map
);
});
});
}
}
if
(
e
.
containsKey
(
"name"
))
{
if
(
e
.
containsKey
(
"name"
))
{
// 消防救援保障部
// 消防救援保障部
List
<
Map
<
String
,
Object
>>
mapList
=
iOrgUsrService
.
queryCompanyIdNew
(
e
.
get
(
"name"
).
toString
());
List
<
Map
<
String
,
Object
>>
mapList
=
iOrgUsrService
.
queryCompanyIdNew
(
e
.
get
(
"name"
).
toString
());
orgUsers
.
addAll
(
mapList
);
orgUsers
.
addAll
(
mapList
);
}
}
// 安运部
// 安运部
if
(
e
.
get
(
"type"
).
toString
().
equals
(
"AY"
))
{
if
(
e
.
get
(
"type"
).
toString
().
equals
(
"AY"
))
{
if
(
e
.
containsKey
(
"name"
))
{
if
(
e
.
containsKey
(
"name"
))
{
String
[]
arr
=
e
.
get
(
"airportPost"
).
toString
().
split
(
","
);
String
[]
arr
=
e
.
get
(
"airportPost"
).
toString
().
split
(
","
);
List
<
String
>
list
=
Arrays
.
asList
(
arr
);
List
<
String
>
list
=
Arrays
.
asList
(
arr
);
List
<
Map
<
String
,
Object
>>
mapList
=
iOrgUsrService
.
queryCompanyId
(
e
.
get
(
"name"
).
toString
(),
list
);
List
<
Map
<
String
,
Object
>>
mapList
=
iOrgUsrService
.
queryCompanyId
(
e
.
get
(
"name"
).
toString
(),
list
);
orgUsers
.
addAll
(
mapList
);
orgUsers
.
addAll
(
mapList
);
}
}
}
}
// 事发单位
// 事发单位
if
(
e
.
get
(
"type"
).
toString
().
equals
(
"SF"
))
{
if
(
e
.
get
(
"type"
).
toString
().
equals
(
"SF"
))
{
if
(
e
.
containsKey
(
"airportPost"
))
{
if
(
e
.
containsKey
(
"airportPost"
))
{
String
[]
arr
=
e
.
get
(
"airportPost"
).
toString
().
split
(
","
);
String
[]
arr
=
e
.
get
(
"airportPost"
).
toString
().
split
(
","
);
List
<
String
>
list
=
Arrays
.
asList
(
arr
);
List
<
String
>
list
=
Arrays
.
asList
(
arr
);
List
<
Map
<
String
,
Object
>>
mapList
=
iOrgUsrService
.
queryCompanyId
(
unitInvolved
,
list
);
List
<
Map
<
String
,
Object
>>
mapList
=
iOrgUsrService
.
queryCompanyId
(
unitInvolved
,
list
);
orgUsers
.
addAll
(
mapList
);
orgUsers
.
addAll
(
mapList
);
}
}
}
}
}
}
// 突发事件救援 // 漏油现场安全保障 // 专机保障 // 其他
// 突发事件救援 // 漏油现场安全保障 // 专机保障 // 其他
if
(
alertTypeCode
.
equals
(
AlertStageEnums
.
HKJY
.
getCode
())
||
alertTypeCode
.
equals
(
AlertStageEnums
.
LYXC
.
getCode
())
if
(
alertTypeCode
.
equals
(
AlertStageEnums
.
TFSJ
.
getCode
())
||
alertTypeCode
.
equals
(
AlertStageEnums
.
LYXC
.
getCode
())
||
alertTypeCode
.
equals
(
AlertStageEnums
.
ZJBZ
.
getCode
())
||
alertTypeCode
.
equals
(
AlertStageEnums
.
QTJQ
.
getCode
()))
{
||
alertTypeCode
.
equals
(
AlertStageEnums
.
ZJBZ
.
getCode
())
||
alertTypeCode
.
equals
(
AlertStageEnums
.
QTJQ
.
getCode
()))
{
if
(
e
.
containsKey
(
"onDuty"
))
{
if
(
e
.
containsKey
(
"onDuty"
))
{
List
<
Map
<
String
,
Object
>>
mapList
=
iDutyPersonService
.
queryByCompanyNew
(
e
.
get
(
"name"
).
toString
());
List
<
Map
<
String
,
Object
>>
mapList
=
iDutyPersonService
.
queryByCompanyNew
(
e
.
get
(
"name"
).
toString
());
orgUsers
.
addAll
(
mapList
);
orgUsers
.
addAll
(
mapList
);
}
}
}
}
// 120急救
// 120急救
if
(
alertTypeCode
.
equals
(
AlertStageEnums
.
JJJQ
.
getCode
()))
{
if
(
alertTypeCode
.
equals
(
AlertStageEnums
.
JJJQ
.
getCode
()))
{
if
(
e
.
containsKey
(
"name"
))
{
if
(
e
.
containsKey
(
"name"
))
{
List
<
Map
<
String
,
Object
>>
mapList
=
iDutyPersonService
.
queryByCompanyNew
(
e
.
get
(
"name"
).
toString
());
List
<
Map
<
String
,
Object
>>
mapList
=
iDutyPersonService
.
queryByCompanyNew
(
e
.
get
(
"name"
).
toString
());
orgUsers
.
addAll
(
mapList
);
orgUsers
.
addAll
(
mapList
);
...
@@ -416,7 +464,7 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
...
@@ -416,7 +464,7 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
// 保存初报细分类型(一般火灾、航空器救援等)
// 保存初报细分类型(一般火灾、航空器救援等)
alertSubmitted
.
setBusinessTypeCode
(
calledRo
.
getAlertTypeCode
());
alertSubmitted
.
setBusinessTypeCode
(
calledRo
.
getAlertTypeCode
());
// 警情初报 --- 续报 结案
// 警情初报 --- 续报 结案
if
(
alertWay
.
equals
(
AlertBusinessTypeEnum
.
警情初报
.
getCode
()))
{
if
(
alertWay
.
equals
(
AlertBusinessTypeEnum
.
警情初报
.
getCode
()))
{
alertSubmitted
.
setBusinessType
(
AlertBusinessTypeEnum
.
警情初报
.
getName
());
alertSubmitted
.
setBusinessType
(
AlertBusinessTypeEnum
.
警情初报
.
getName
());
Optional
<
SubmissionMethodEnum
>
submissionMethodEnum
=
Optional
.
of
(
SubmissionMethodEnum
.
SMS
);
Optional
<
SubmissionMethodEnum
>
submissionMethodEnum
=
Optional
.
of
(
SubmissionMethodEnum
.
SMS
);
...
@@ -433,10 +481,10 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
...
@@ -433,10 +481,10 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
this
.
baseMapper
.
insert
(
alertSubmitted
);
this
.
baseMapper
.
insert
(
alertSubmitted
);
alertSubmittedId
=
alertSubmitted
.
getSequenceNbr
().
toString
();
alertSubmittedId
=
alertSubmitted
.
getSequenceNbr
().
toString
();
}
else
if
(
alertWay
.
equals
(
AlertBusinessTypeEnum
.
警情续报
.
getCode
()))
{
}
else
if
(
alertWay
.
equals
(
AlertBusinessTypeEnum
.
警情续报
.
getCode
()))
{
alertSubmitted
.
setBusinessType
(
AlertBusinessTypeEnum
.
警情续报
.
getName
());
alertSubmitted
.
setBusinessType
(
AlertBusinessTypeEnum
.
警情续报
.
getName
());
sCode
=
"SMS_JCS_XB"
;
sCode
=
"SMS_JCS_XB"
;
}
else
if
(
alertWay
.
equals
(
AlertBusinessTypeEnum
.
警情结案
.
getCode
()))
{
}
else
if
(
alertWay
.
equals
(
AlertBusinessTypeEnum
.
警情结案
.
getCode
()))
{
alertSubmitted
.
setBusinessType
(
AlertBusinessTypeEnum
.
警情结案
.
getName
());
alertSubmitted
.
setBusinessType
(
AlertBusinessTypeEnum
.
警情结案
.
getName
());
sCode
=
"SMS_JCS_JA"
;
sCode
=
"SMS_JCS_JA"
;
}
else
{
}
else
{
...
@@ -451,14 +499,14 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
...
@@ -451,14 +499,14 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
// smsCode = alertBusinessTypeEnum.get().getSms_code();
// smsCode = alertBusinessTypeEnum.get().getSms_code();
if
(!
alertWay
.
equals
(
AlertBusinessTypeEnum
.
警情初报
.
getCode
()))
{
if
(!
alertWay
.
equals
(
AlertBusinessTypeEnum
.
警情初报
.
getCode
()))
{
LambdaQueryWrapper
<
AlertSubmitted
>
queryWrapper
=
new
LambdaQueryWrapper
<>();
LambdaQueryWrapper
<
AlertSubmitted
>
queryWrapper
=
new
LambdaQueryWrapper
<>();
queryWrapper
.
eq
(
AlertSubmitted:
:
getAlertCalledId
,
alertCalledId
);
queryWrapper
.
eq
(
AlertSubmitted:
:
getAlertCalledId
,
alertCalledId
);
queryWrapper
.
orderByDesc
(
AlertSubmitted:
:
getSequenceNbr
);
queryWrapper
.
orderByDesc
(
AlertSubmitted:
:
getSequenceNbr
);
List
<
AlertSubmitted
>
alertSubmitteds
=
alertSubmittedMapper
.
selectList
(
queryWrapper
);
List
<
AlertSubmitted
>
alertSubmitteds
=
alertSubmittedMapper
.
selectList
(
queryWrapper
);
alertSubmittedNew
=
alertSubmitteds
.
get
(
0
);
alertSubmittedNew
=
alertSubmitteds
.
get
(
0
);
if
(!
ValidationUtil
.
isEmpty
(
calledRo
.
getUsIds
()))
{
if
(!
ValidationUtil
.
isEmpty
(
calledRo
.
getUsIds
()))
{
usIds
.
addAll
(
Arrays
.
asList
(
calledRo
.
getUsIds
().
split
(
","
)));
usIds
.
addAll
(
Arrays
.
asList
(
calledRo
.
getUsIds
().
split
(
","
)));
}
}
}
}
...
@@ -466,7 +514,7 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
...
@@ -466,7 +514,7 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
// 组装人员信息
// 组装人员信息
for
(
Map
<
String
,
Object
>
orgUser
:
orgUsers
)
{
for
(
Map
<
String
,
Object
>
orgUser
:
orgUsers
)
{
AlertSubmittedObject
alertSubmittedObject
=
new
AlertSubmittedObject
();
AlertSubmittedObject
alertSubmittedObject
=
new
AlertSubmittedObject
();
if
(!
alertWay
.
equals
(
AlertBusinessTypeEnum
.
警情初报
.
getCode
()))
{
if
(!
alertWay
.
equals
(
AlertBusinessTypeEnum
.
警情初报
.
getCode
()))
{
alertSubmittedObject
.
setAlertSubmittedId
(
alertSubmittedNew
.
getSequenceNbr
());
alertSubmittedObject
.
setAlertSubmittedId
(
alertSubmittedNew
.
getSequenceNbr
());
}
else
{
}
else
{
alertSubmittedObject
.
setAlertSubmittedId
(
Long
.
parseLong
(
alertSubmittedId
));
alertSubmittedObject
.
setAlertSubmittedId
(
Long
.
parseLong
(
alertSubmittedId
));
...
@@ -493,7 +541,7 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
...
@@ -493,7 +541,7 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
smsParams
.
put
(
"callTimeStr"
,
calledRo
.
getCallTimeStr
());
smsParams
.
put
(
"callTimeStr"
,
calledRo
.
getCallTimeStr
());
smsParams
.
put
(
"address"
,
calledRo
.
getAddress
());
smsParams
.
put
(
"address"
,
calledRo
.
getAddress
());
smsParams
.
put
(
"fireLocation"
,
calledRo
.
getFireLocation
());
smsParams
.
put
(
"fireLocation"
,
calledRo
.
getFireLocation
());
smsParams
.
put
(
"endTimeStr"
,
DateUtils
.
convertDateToString
(
alertCalled
.
getUpdateTime
(),
DateUtils
.
DATE_TIME_PATTERN
));
smsParams
.
put
(
"endTimeStr"
,
DateUtils
.
convertDateToString
(
alertCalled
.
getUpdateTime
(),
DateUtils
.
DATE_TIME_PATTERN
));
smsParams
.
put
(
"burningMaterial"
,
calledRo
.
getBurningMaterial
());
smsParams
.
put
(
"burningMaterial"
,
calledRo
.
getBurningMaterial
());
smsParams
.
put
(
"fireSituation"
,
calledRo
.
getFireSituation
());
smsParams
.
put
(
"fireSituation"
,
calledRo
.
getFireSituation
());
smsParams
.
put
(
"trappedNum"
,
calledRo
.
getTrappedNum
());
smsParams
.
put
(
"trappedNum"
,
calledRo
.
getTrappedNum
());
...
@@ -512,33 +560,36 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
...
@@ -512,33 +560,36 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
// 组织短信内容
// 组织短信内容
// 调用短信发送接口
// 调用短信发送接口
Map
<
String
,
String
>
besidesMap
=
new
HashMap
<>();
Map
<
String
,
String
>
besidesMap
=
new
HashMap
<>();
besidesMap
.
put
(
"alterId"
,
String
.
valueOf
(
alertCalled
.
getSequenceNbr
()));
besidesMap
.
put
(
"alterId"
,
String
.
valueOf
(
alertCalled
.
getSequenceNbr
()));
if
(
alertWay
.
equals
(
AlertBusinessTypeEnum
.
警情初报
.
getCode
()))
{
if
(
alertWay
.
equals
(
AlertBusinessTypeEnum
.
警情初报
.
getCode
()))
{
alertCalledAction
.
sendAlertCalleCmd
(
smsCode
,
mobiles
,
smsParams
);
alertCalledAction
.
sendAlertCalleCmd
(
smsCode
,
mobiles
,
smsParams
);
besidesMap
.
put
(
"sendTime"
,
DateUtils
.
dateFormat
(
alertCalled
.
getCallTime
(),
DateUtils
.
DATE_TIME_PATTERN
));
besidesMap
.
put
(
"sendTime"
,
DateUtils
.
dateFormat
(
alertCalled
.
getCallTime
(),
DateUtils
.
DATE_TIME_PATTERN
));
pushPowerTransferToAppAndWeb
(
AlertBusinessTypeEnum
.
警情初报
.
getCode
(),
besidesMap
,
smsParams
,
usIds
);
pushPowerTransferToAppAndWeb
(
AlertBusinessTypeEnum
.
警情初报
.
getCode
(),
besidesMap
,
smsParams
,
usIds
);
}
else
{
}
else
{
if
(
alertWay
.
equals
(
AlertBusinessTypeEnum
.
警情续报
.
getCode
()))
{
if
(
alertWay
.
equals
(
AlertBusinessTypeEnum
.
警情续报
.
getCode
()))
{
besidesMap
.
put
(
"sendTime"
,
DateUtils
.
dateFormat
(
alertCalled
.
getCallTime
(),
DateUtils
.
DATE_TIME_PATTERN
));
besidesMap
.
put
(
"sendTime"
,
DateUtils
.
dateFormat
(
alertCalled
.
getCallTime
(),
DateUtils
.
DATE_TIME_PATTERN
));
pushPowerTransferToAppAndWeb
(
AlertBusinessTypeEnum
.
警情续报
.
getCode
(),
besidesMap
,
smsParams
,
usIds
);
pushPowerTransferToAppAndWeb
(
AlertBusinessTypeEnum
.
警情续报
.
getCode
(),
besidesMap
,
smsParams
,
usIds
);
}
}
if
(
alertWay
.
equals
(
AlertBusinessTypeEnum
.
警情结案
.
getCode
()))
{
if
(
alertWay
.
equals
(
AlertBusinessTypeEnum
.
警情结案
.
getCode
()))
{
besidesMap
.
put
(
"startTime"
,
DateUtils
.
dateFormat
(
alertCalled
.
getCallTime
(),
DateUtils
.
DATE_TIME_PATTERN
));
besidesMap
.
put
(
"startTime"
,
DateUtils
.
dateFormat
(
alertCalled
.
getCallTime
(),
DateUtils
.
DATE_TIME_PATTERN
));
besidesMap
.
put
(
"endTime"
,
DateUtils
.
dateFormat
(
alertCalled
.
getRecDate
(),
DateUtils
.
DATE_TIME_PATTERN
));
besidesMap
.
put
(
"endTime"
,
DateUtils
.
dateFormat
(
alertCalled
.
getRecDate
(),
DateUtils
.
DATE_TIME_PATTERN
));
pushPowerTransferToAppAndWeb
(
AlertBusinessTypeEnum
.
警情结案
.
getCode
(),
besidesMap
,
smsParams
,
usIds
);
pushPowerTransferToAppAndWeb
(
AlertBusinessTypeEnum
.
警情结案
.
getCode
(),
besidesMap
,
smsParams
,
usIds
);
}
}
if
(
alertWay
.
equals
(
AlertBusinessTypeEnum
.
非警情确认
.
getCode
()))
{
if
(
alertWay
.
equals
(
AlertBusinessTypeEnum
.
非警情确认
.
getCode
()))
{
pushPowerTransferToAppAndWeb
(
AlertBusinessTypeEnum
.
非警情确认
.
getCode
(),
besidesMap
,
smsParams
,
usIds
);
pushPowerTransferToAppAndWeb
(
AlertBusinessTypeEnum
.
非警情确认
.
getCode
(),
besidesMap
,
smsParams
,
usIds
);
}
}
alertCalledAction
.
sendAlertCalleCmd
(
sCode
,
mobiles
,
smsParams
);
alertCalledAction
.
sendAlertCalleCmd
(
sCode
,
mobiles
,
smsParams
);
}
}
emqKeeper
.
getMqttClient
().
publish
(
topic
,
alertCalledId
.
getBytes
(),
RuleConfig
.
DEFAULT_QOS
,
false
);
emqKeeper
.
getMqttClient
().
publish
(
topic
,
alertCalledId
.
getBytes
(),
RuleConfig
.
DEFAULT_QOS
,
false
);
}
}
...
@@ -549,12 +600,11 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
...
@@ -549,12 +600,11 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
* @param userName 用户名
* @param userName 用户名
*/
*/
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
Map
<
String
,
String
>
saveAlertSubmitted
(
AlertSubmittedDto
alertSubmittedDto
,
String
userName
)
{
public
Map
<
String
,
String
>
saveAlertSubmitted
(
AlertSubmittedDto
alertSubmittedDto
,
String
userName
)
{
try
{
try
{
Long
alertSubmittedId
=
alertSubmittedDto
.
getSequenceNbr
();
Long
alertSubmittedId
=
alertSubmittedDto
.
getSequenceNbr
();
String
alertWay
=
""
;
String
alertWay
=
""
;
Date
endDate
=
null
;
Date
endDate
=
null
;
Map
<
String
,
String
>
map
=
new
HashMap
<>();
Map
<
String
,
String
>
map
=
new
HashMap
<>();
Set
<
String
>
mobiles
=
new
HashSet
<>();
Set
<
String
>
mobiles
=
new
HashSet
<>();
List
<
Long
>
userIds
=
new
ArrayList
<>();
List
<
Long
>
userIds
=
new
ArrayList
<>();
if
(
alertSubmittedId
==
null
)
{
if
(
alertSubmittedId
==
null
)
{
...
@@ -584,7 +634,7 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
...
@@ -584,7 +634,7 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
// 任务 4174 日常值班---融合调度----短信模版中的内容用户可以全部删除掉,按照自定义内容重新录入发送内容 by litw 2021年10月27日
// 任务 4174 日常值班---融合调度----短信模版中的内容用户可以全部删除掉,按照自定义内容重新录入发送内容 by litw 2021年10月27日
alertSubmitted
.
setBusinessTypeCode
(
alertSubmittedDto
.
getBusinessTypeCode
());
alertSubmitted
.
setBusinessTypeCode
(
alertSubmittedDto
.
getBusinessTypeCode
());
alertSubmittedDto
.
getSubmitContent
().
get
(
"recDate"
).
toString
();
alertSubmittedDto
.
getSubmitContent
().
get
(
"recDate"
).
toString
();
endDate
=
DateUtils
.
dateParse
(
alertSubmittedDto
.
getSubmitContent
().
get
(
"recDate"
).
toString
(),
DateUtils
.
HOUR_PATTERN
);
endDate
=
DateUtils
.
dateParse
(
alertSubmittedDto
.
getSubmitContent
().
get
(
"recDate"
).
toString
(),
DateUtils
.
HOUR_PATTERN
);
alertSubmitted
.
setSubmissionContent
(
alertSubmittedDto
.
getSubmitContent
().
toJSONString
());
alertSubmitted
.
setSubmissionContent
(
alertSubmittedDto
.
getSubmitContent
().
toJSONString
());
...
@@ -640,20 +690,20 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
...
@@ -640,20 +690,20 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
queryWrapper
.
in
(
true
,
OrgUsr:
:
getSequenceNbr
,
userIds
);
queryWrapper
.
in
(
true
,
OrgUsr:
:
getSequenceNbr
,
userIds
);
List
<
String
>
usIds
=
new
ArrayList
<>();
List
<
String
>
usIds
=
new
ArrayList
<>();
List
<
OrgUsr
>
list
=
orgUsrService
.
getBaseMapper
().
selectList
(
queryWrapper
);
List
<
OrgUsr
>
list
=
orgUsrService
.
getBaseMapper
().
selectList
(
queryWrapper
);
if
(
null
!=
list
&&
list
.
size
()
>
0
)
{
if
(
null
!=
list
&&
list
.
size
()
>
0
)
{
list
.
stream
().
forEach
(
e
->
{
list
.
stream
().
forEach
(
e
->
{
if
(!
ValidationUtil
.
isEmpty
(
e
.
getAmosOrgId
()))
{
if
(!
ValidationUtil
.
isEmpty
(
e
.
getAmosOrgId
()))
{
usIds
.
add
(
e
.
getAmosOrgId
());
usIds
.
add
(
e
.
getAmosOrgId
());
}
}
});
});
map
.
put
(
"usIds"
,
StringUtils
.
join
(
usIds
.
toArray
(
new
String
[
userIds
.
size
()]),
","
));
map
.
put
(
"usIds"
,
StringUtils
.
join
(
usIds
.
toArray
(
new
String
[
userIds
.
size
()]),
","
));
}
else
{
}
else
{
map
.
put
(
"usIds"
,
""
);
map
.
put
(
"usIds"
,
""
);
}
}
// alertSubmittedObjectServiceImpl.saveBatch(alertSubmittedObjectList);
// alertSubmittedObjectServiceImpl.saveBatch(alertSubmittedObjectList);
for
(
AlertSubmittedObject
object
:
alertSubmittedObjectList
)
{
for
(
AlertSubmittedObject
object
:
alertSubmittedObjectList
)
{
alertSubmittedObjectServiceImpl
.
save
(
object
);
alertSubmittedObjectServiceImpl
.
save
(
object
);
}
}
...
@@ -662,16 +712,16 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
...
@@ -662,16 +712,16 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
alertSubmittedDto
.
getBusinessTypeCode
());
alertSubmittedDto
.
getBusinessTypeCode
());
// 警情续报
// 警情续报
if
(
AlertBusinessTypeEnum
.
警情续报
.
getCode
().
equals
(
alertSubmittedDto
.
getBusinessTypeCode
()))
{
if
(
AlertBusinessTypeEnum
.
警情续报
.
getCode
().
equals
(
alertSubmittedDto
.
getBusinessTypeCode
()))
{
alertWay
=
AlertBusinessTypeEnum
.
警情续报
.
getCode
();
alertWay
=
AlertBusinessTypeEnum
.
警情续报
.
getCode
();
}
}
if
(
AlertBusinessTypeEnum
.
警情结案
.
getCode
().
equals
(
alertSubmittedDto
.
getBusinessTypeCode
()))
{
if
(
AlertBusinessTypeEnum
.
警情结案
.
getCode
().
equals
(
alertSubmittedDto
.
getBusinessTypeCode
()))
{
alertWay
=
AlertBusinessTypeEnum
.
警情结案
.
getCode
();
alertWay
=
AlertBusinessTypeEnum
.
警情结案
.
getCode
();
// 警情结案生成模板
// 警情结案生成模板
try
{
try
{
AlertCalledFormDto
alertCalledFormDto
=
(
AlertCalledFormDto
)
alertCalledService
.
selectAlertCalledById
(
alertSubmittedDto
.
getAlertCalledId
());
AlertCalledFormDto
alertCalledFormDto
=
(
AlertCalledFormDto
)
alertCalledService
.
selectAlertCalledById
(
alertSubmittedDto
.
getAlertCalledId
());
AlertCalled
alertCalled
=
alertCalledFormDto
.
getAlertCalled
();
AlertCalled
alertCalled
=
alertCalledFormDto
.
getAlertCalled
();
generateMob
(
alertCalled
);
generateMob
(
alertCalled
);
}
catch
(
FileNotFoundException
e
)
{
}
catch
(
FileNotFoundException
e
)
{
...
@@ -681,11 +731,17 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
...
@@ -681,11 +731,17 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
}
}
}
}
if
(
AlertBusinessTypeEnum
.
非警情确认
.
getCode
().
equals
(
alertSubmittedDto
.
getBusinessTypeCode
()))
{
if
(
AlertBusinessTypeEnum
.
非警情确认
.
getCode
().
equals
(
alertSubmittedDto
.
getBusinessTypeCode
()))
{
alertWay
=
AlertBusinessTypeEnum
.
非警情确认
.
getCode
();
alertWay
=
AlertBusinessTypeEnum
.
非警情确认
.
getCode
();
}
}
if
(
AlertBusinessTypeEnum
.
警情结案
.
getCode
().
equals
(
alertSubmittedDto
.
getBusinessTypeCode
())
if
(
AlertBusinessTypeEnum
.
警情结案
.
getCode
().
equals
(
alertSubmittedDto
.
getBusinessTypeCode
())
||
AlertBusinessTypeEnum
.
非警情确认
.
getCode
().
equals
(
alertSubmittedDto
.
getBusinessTypeCode
()))
{
||
AlertBusinessTypeEnum
.
非警情确认
.
getCode
().
equals
(
alertSubmittedDto
.
getBusinessTypeCode
()))
{
// 查询本次警情调派的车辆
// 查询本次警情调派的车辆
...
@@ -712,25 +768,25 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
...
@@ -712,25 +768,25 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
//警情結案推送
//警情結案推送
if
(
AlertBusinessTypeEnum
.
警情结案
.
getCode
().
equals
(
alertSubmittedDto
.
getBusinessTypeCode
()))
{
if
(
AlertBusinessTypeEnum
.
警情结案
.
getCode
().
equals
(
alertSubmittedDto
.
getBusinessTypeCode
()))
{
//tuisongxinjingqing
//tuisongxinjingqing
RequestData
par
=
new
RequestData
();
RequestData
par
=
new
RequestData
();
par
.
setAlertId
(
alertSubmittedDto
.
getAlertCalledId
());
par
.
setAlertId
(
alertSubmittedDto
.
getAlertCalledId
());
List
<
AlertCalledZhDto
>
list4
=
alertCalledService
.
alertCalledListByAlertStatus
(
null
,
null
,
par
);
List
<
AlertCalledZhDto
>
list4
=
alertCalledService
.
alertCalledListByAlertStatus
(
null
,
null
,
par
);
String
json
=
""
;
String
json
=
""
;
if
(
list
!=
null
&&
list
.
size
()
>
0
)
{
if
(
list
!=
null
&&
list
.
size
()>
0
)
{
AlertCalledZhDto
ll
=
list4
.
get
(
0
);
AlertCalledZhDto
ll
=
list4
.
get
(
0
);
Map
<
String
,
String
>
map1
=
org
.
apache
.
commons
.
beanutils
.
BeanUtils
.
describe
((
Object
)
list4
.
get
(
0
));
Map
<
String
,
String
>
map1
=
org
.
apache
.
commons
.
beanutils
.
BeanUtils
.
describe
((
Object
)
list4
.
get
(
0
));
String
strDateFormat
=
"yyyy-MM-dd HH:mm:ss"
;
String
strDateFormat
=
"yyyy-MM-dd HH:mm:ss"
;
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
strDateFormat
);
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
strDateFormat
);
map1
.
put
(
"callTime"
,
ll
.
getCallTime
()
!=
null
?
sdf
.
format
(
ll
.
getCallTime
())
:
""
);
map1
.
put
(
"callTime"
,
ll
.
getCallTime
()!=
null
?
sdf
.
format
(
ll
.
getCallTime
()):
""
);
map
.
put
(
"sequenceNbr"
,
ll
.
getSequenceNbr
()
+
""
);
map
.
put
(
"sequenceNbr"
,
ll
.
getSequenceNbr
()+
""
);
map1
.
put
(
"updateTime"
,
ll
.
getUpdateTime
()
!=
null
?
sdf
.
format
(
ll
.
getUpdateTime
())
:
""
);
map1
.
put
(
"updateTime"
,
ll
.
getUpdateTime
()!=
null
?
sdf
.
format
(
ll
.
getUpdateTime
()):
""
);
json
=
list
!=
null
&&
list
.
size
()
>
0
?
JSONObject
.
toJSONString
(
map1
,
SerializerFeature
.
PrettyFormat
,
json
=
list
!=
null
&&
list
.
size
()>
0
?
JSONObject
.
toJSONString
(
map1
,
SerializerFeature
.
PrettyFormat
,
SerializerFeature
.
WriteMapNullValue
)
:
""
;
SerializerFeature
.
WriteMapNullValue
):
""
;
}
}
// String json=list4!=null&&list4.size()>0?JSONObject.toJSONString(list4.get(0), SerializerFeature.PrettyFormat, SerializerFeature.WriteMapNullValue):"";
// String json=list4!=null&&list4.size()>0?JSONObject.toJSONString(list4.get(0), SerializerFeature.PrettyFormat, SerializerFeature.WriteMapNullValue):"";
...
@@ -739,20 +795,21 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
...
@@ -739,20 +795,21 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
}
}
// 4.发送任务消息
// 4.发送任务消息
// 4.1组织短信内容 废弃
// 4.1组织短信内容 废弃
JSONObject
submitContent
=
alertSubmittedDto
.
getSubmitContent
();
JSONObject
submitContent
=
alertSubmittedDto
.
getSubmitContent
();
String
feedBack
=
submitContent
.
get
(
"editContent"
)
!=
null
?
submitContent
.
get
(
"editContent"
).
toString
()
:
""
;
String
feedBack
=
submitContent
.
get
(
"editContent"
)
!=
null
?
submitContent
.
get
(
"editContent"
).
toString
()
:
""
;
// 4.2调用短信发送接口 废弃
// 4.2调用短信发送接口 废弃
// alertCalledAction.sendAlertCalleCmd(smsCode, mobiles, smsParams);\
// alertCalledAction.sendAlertCalleCmd(smsCode, mobiles, smsParams);\
map
.
put
(
"feedBack"
,
feedBack
);
map
.
put
(
"feedBack"
,
feedBack
);
map
.
put
(
"alertWay"
,
alertWay
);
map
.
put
(
"alertWay"
,
alertWay
);
map
.
put
(
"mobiles"
,
StringUtils
.
join
(
mobiles
,
","
));
map
.
put
(
"mobiles"
,
StringUtils
.
join
(
mobiles
,
","
));
return
map
;
return
map
;
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
e
.
printStackTrace
();
...
@@ -773,49 +830,49 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
...
@@ -773,49 +830,49 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
report
.
setCallTime
(
ValidationUtil
.
isEmpty
(
alertCalled
.
getCallTime
())
?
""
:
DateUtils
.
convertDateToString
(
alertCalled
.
getCallTime
(),
DateUtils
.
DATE_TIME_PATTERN
));
report
.
setCallTime
(
ValidationUtil
.
isEmpty
(
alertCalled
.
getCallTime
())
?
""
:
DateUtils
.
convertDateToString
(
alertCalled
.
getCallTime
(),
DateUtils
.
DATE_TIME_PATTERN
));
String
urlString
=
""
;
String
urlString
=
""
;
report
.
setEndTime
(
DateUtils
.
convertDateToString
(
new
Date
(),
DateUtils
.
DATE_TIME_PATTERN
));
report
.
setEndTime
(
DateUtils
.
convertDateToString
(
new
Date
(),
DateUtils
.
DATE_TIME_PATTERN
));
// 查询第一次调派
// 查询第一次调派
List
<
Map
<
String
,
Object
>>
first
=
alertSubmittedMapper
.
getFirst
(
alertCalled
.
getSequenceNbr
());
List
<
Map
<
String
,
Object
>>
first
=
alertSubmittedMapper
.
getFirst
(
alertCalled
.
getSequenceNbr
());
// 查询后续调派
// 查询后续调派
List
<
Map
<
String
,
Object
>>
other
=
alertSubmittedMapper
.
get
First
(
alertCalled
.
getSequenceNbr
());
List
<
Map
<
String
,
Object
>>
other
=
alertSubmittedMapper
.
get
Other
(
alertCalled
.
getSequenceNbr
());
LinkedList
<
AlertCalledPowerInfoDto
>
list
=
new
LinkedList
<>();
LinkedList
<
AlertCalledPowerInfoDto
>
list
=
new
LinkedList
<>();
for
(
int
i
=
0
;
i
<
first
.
size
();
i
++)
{
for
(
int
i
=
0
;
i
<
first
.
size
();
i
++)
{
AlertCalledPowerInfoDto
dto
=
new
AlertCalledPowerInfoDto
();
AlertCalledPowerInfoDto
dto
=
new
AlertCalledPowerInfoDto
();
if
(
i
==
0
)
{
if
(
i
==
0
)
{
dto
.
setDisatchNum
(
String
.
valueOf
(
first
.
size
()));
dto
.
setDisatchNum
(
String
.
valueOf
(
first
.
size
()));
}
}
handleFunc
(
dto
,
first
.
get
(
i
));
handleFunc
(
dto
,
first
.
get
(
i
));
LocalDateTime
dateTime
=
(
LocalDateTime
)
first
.
get
(
i
).
get
(
"recDate"
);
LocalDateTime
dateTime
=
(
LocalDateTime
)
first
.
get
(
i
).
get
(
"recDate"
);
Date
date
=
Date
.
from
(
dateTime
.
toInstant
(
ZoneOffset
.
of
(
"+8"
)));
Date
date
=
Date
.
from
(
dateTime
.
toInstant
(
ZoneOffset
.
of
(
"+8"
)));
report
.
setToTime
((
DateUtils
.
dateFormat
(
date
,
DateUtils
.
HOUR_PATTERN
)));
report
.
setToTime
((
DateUtils
.
dateFormat
(
date
,
DateUtils
.
HOUR_PATTERN
)));
report
.
setArriveTime
((
DateUtils
.
dateFormat
(
date
,
DateUtils
.
HOUR_PATTERN
)));
report
.
setArriveTime
((
DateUtils
.
dateFormat
(
date
,
DateUtils
.
HOUR_PATTERN
)));
dto
.
setArriveTime
((
DateUtils
.
dateFormat
(
date
,
DateUtils
.
HOUR_PATTERN
)));
dto
.
setArriveTime
((
DateUtils
.
dateFormat
(
date
,
DateUtils
.
HOUR_PATTERN
)));
list
.
add
(
dto
);
list
.
add
(
dto
);
}
}
for
(
int
i
=
0
;
i
<
other
.
size
();
i
++)
{
for
(
int
i
=
0
;
i
<
other
.
size
();
i
++)
{
AlertCalledPowerInfoDto
dto
=
new
AlertCalledPowerInfoDto
();
AlertCalledPowerInfoDto
dto
=
new
AlertCalledPowerInfoDto
();
handleFunc
(
dto
,
first
.
get
(
i
));
handleFunc
(
dto
,
other
.
get
(
i
));
LocalDateTime
dateTime
=
(
LocalDateTime
)
first
.
get
(
i
).
get
(
"recDate"
);
LocalDateTime
dateTime
=
(
LocalDateTime
)
other
.
get
(
i
).
get
(
"recDate"
);
Date
date
=
Date
.
from
(
dateTime
.
toInstant
(
ZoneOffset
.
of
(
"+8"
)));
Date
date
=
Date
.
from
(
dateTime
.
toInstant
(
ZoneOffset
.
of
(
"+8"
)));
dto
.
setArriveTime
((
DateUtils
.
dateFormat
(
date
,
DateUtils
.
HOUR_PATTERN
)));
dto
.
setArriveTime
((
DateUtils
.
dateFormat
(
date
,
DateUtils
.
HOUR_PATTERN
)));
list
.
add
(
dto
);
list
.
add
(
dto
);
}
}
// 查询应急指挥辅屏值班人员
// 查询应急指挥辅屏值班人员
List
<
Map
<
String
,
Object
>>
mapList
=
iDutyPersonService
.
listOnDutyPerson
();
List
<
Map
<
String
,
Object
>>
mapList
=
iDutyPersonService
.
listOnDutyPerson
();
List
<
AlertCallCommandDto
>
list1
=
new
ArrayList
<>();
List
<
AlertCallCommandDto
>
list1
=
new
ArrayList
<>();
mapList
.
forEach
(
e
->
{
mapList
.
forEach
(
e
->
{
AlertCallCommandDto
dto
=
new
AlertCallCommandDto
();
AlertCallCommandDto
dto
=
new
AlertCallCommandDto
();
dto
.
setName
(
e
.
get
(
"userName"
).
toString
());
dto
.
setName
(
e
.
get
(
"userName"
).
toString
());
dto
.
setDuty
(
e
.
get
(
"postTypeName"
).
toString
());
dto
.
setDuty
(
e
.
get
(
"postTypeName"
).
toString
());
...
@@ -844,17 +901,17 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
...
@@ -844,17 +901,17 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
// String filePath = this.getClass().getClassLoader().getResource("templates").getPath();
// String filePath = this.getClass().getClassLoader().getResource("templates").getPath();
String
filePath
=
""
;
String
filePath
=
""
;
String
fileName
=
""
;
String
fileName
=
""
;
if
(
os
.
toLowerCase
().
startsWith
(
"win"
))
{
if
(
os
.
toLowerCase
().
startsWith
(
"win"
))
{
filePath
=
this
.
getClass
().
getClassLoader
().
getResource
(
"templates"
).
getPath
();
filePath
=
this
.
getClass
().
getClassLoader
().
getResource
(
"templates"
).
getPath
();
fileName
=
filePath
+
"/"
+
System
.
currentTimeMillis
()
+
".docx"
;
fileName
=
filePath
+
"/"
+
System
.
currentTimeMillis
()
+
".docx"
;
}
else
{
}
else
{
// String [] arr = path.split("amos-boot-system-jcs-1.0.0.jar!");
// String [] arr = path.split("amos-boot-system-jcs-1.0.0.jar!");
// System.out.println(arr[0].substring(0,arr[0].lastIndexOf("/")));
// System.out.println(arr[0].substring(0,arr[0].lastIndexOf("/")));
// fileName = arr[0].substring(0,arr[0].lastIndexOf("/")) + "/" + System.currentTimeMillis() + ".docx";
// fileName = arr[0].substring(0,arr[0].lastIndexOf("/")) + "/" + System.currentTimeMillis() + ".docx";
fileName
=
"/opt/file/"
+
System
.
currentTimeMillis
()
+
".docx"
;
fileName
=
"/opt/file/"
+
System
.
currentTimeMillis
()
+
".docx"
;
}
}
String
newFileName
=
""
;
String
newFileName
=
""
;
AlertCalledPowerInfoTablePolicy
calledPowerInfoTablePolicy
=
new
AlertCalledPowerInfoTablePolicy
();
AlertCalledPowerInfoTablePolicy
calledPowerInfoTablePolicy
=
new
AlertCalledPowerInfoTablePolicy
();
AlertCallCommandTablePolicy
alertCallCommandTablePolicy
=
new
AlertCallCommandTablePolicy
();
AlertCallCommandTablePolicy
alertCallCommandTablePolicy
=
new
AlertCallCommandTablePolicy
();
...
@@ -865,12 +922,12 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
...
@@ -865,12 +922,12 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
XWPFTemplate
template
=
XWPFTemplate
.
compile
(
resourceAsStream
,
configureBuilder
.
build
()).
render
(
report
);
XWPFTemplate
template
=
XWPFTemplate
.
compile
(
resourceAsStream
,
configureBuilder
.
build
()).
render
(
report
);
File
file
=
new
File
(
fileName
);
File
file
=
new
File
(
fileName
);
if
(!
file
.
getParentFile
().
exists
())
{
if
(!
file
.
getParentFile
().
exists
())
{
file
.
getParentFile
().
mkdirs
();
file
.
getParentFile
().
mkdirs
();
}
}
if
(!
file
.
exists
())
{
if
(!
file
.
exists
())
{
try
{
try
{
file
.
createNewFile
();
file
.
createNewFile
();
}
catch
(
IOException
e
)
{
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
e
.
printStackTrace
();
}
}
...
@@ -892,17 +949,17 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
...
@@ -892,17 +949,17 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
//拼接完整连接
//拼接完整连接
String
pa1
=
""
;
String
pa1
=
""
;
if
(
os
.
toLowerCase
().
startsWith
(
"win"
))
{
if
(
os
.
toLowerCase
().
startsWith
(
"win"
))
{
String
pa
=
fileName
.
substring
(
1
);
String
pa
=
fileName
.
substring
(
1
);
document
.
loadFromFile
(
pa
);
document
.
loadFromFile
(
pa
);
newFileName
=
System
.
currentTimeMillis
()
+
".doc"
;
newFileName
=
System
.
currentTimeMillis
()
+
".doc"
;
//保存结果文件
//保存结果文件
pa1
=
newFileName
.
substring
(
1
);
pa1
=
newFileName
.
substring
(
1
);
document
.
saveToFile
(
pa1
,
FileFormat
.
Doc
);
document
.
saveToFile
(
pa1
,
FileFormat
.
Doc
);
}
else
{
}
else
{
document
.
loadFromFile
(
fileName
);
document
.
loadFromFile
(
fileName
);
System
.
out
.
println
(
fileName
);
System
.
out
.
println
(
fileName
);
newFileName
=
"/opt/file/"
+
System
.
currentTimeMillis
()
+
".doc"
;
newFileName
=
"/opt/file/"
+
System
.
currentTimeMillis
()+
".doc"
;
System
.
out
.
println
(
newFileName
);
System
.
out
.
println
(
newFileName
);
document
.
saveToFile
(
newFileName
,
FileFormat
.
Doc
);
document
.
saveToFile
(
newFileName
,
FileFormat
.
Doc
);
pa1
=
newFileName
;
pa1
=
newFileName
;
...
@@ -915,7 +972,7 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
...
@@ -915,7 +972,7 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
Map
<
String
,
String
>
map
=
date
.
getResult
();
Map
<
String
,
String
>
map
=
date
.
getResult
();
Iterator
<
String
>
it
=
map
.
keySet
().
iterator
();
Iterator
<
String
>
it
=
map
.
keySet
().
iterator
();
while
(
it
.
hasNext
())
{
while
(
it
.
hasNext
())
{
urlString
=
it
.
next
();
urlString
=
it
.
next
();
}
}
}
}
System
.
out
.
println
(
urlString
);
System
.
out
.
println
(
urlString
);
...
@@ -933,12 +990,12 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
...
@@ -933,12 +990,12 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
template
.
close
();
template
.
close
();
File
file2
=
new
File
(
fileName
);
File
file2
=
new
File
(
fileName
);
if
(
file2
.
exists
())
{
if
(
file2
.
exists
())
{
file2
.
delete
();
file2
.
delete
();
}
}
File
file1
=
new
File
(
newFileName
);
File
file1
=
new
File
(
newFileName
);
if
(
file1
.
exists
())
{
if
(
file1
.
exists
())
{
file1
.
delete
();
file1
.
delete
();
}
}
}
catch
(
IOException
e
)
{
}
catch
(
IOException
e
)
{
...
@@ -947,8 +1004,7 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
...
@@ -947,8 +1004,7 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
}
}
}
}
}
}
void
handleFunc
(
AlertCalledPowerInfoDto
dto
,
Map
<
String
,
Object
>
map
)
{
void
handleFunc
(
AlertCalledPowerInfoDto
dto
,
Map
<
String
,
Object
>
map
)
{
if
(
map
.
containsKey
(
"carName"
))
{
if
(
map
.
containsKey
(
"carName"
))
{
dto
.
setCarName
(
map
.
get
(
"carName"
).
toString
());
dto
.
setCarName
(
map
.
get
(
"carName"
).
toString
());
}
}
...
@@ -993,7 +1049,7 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
...
@@ -993,7 +1049,7 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
List
<
RowRenderData
>
checkDangerList
=
Lists
.
newArrayList
();
List
<
RowRenderData
>
checkDangerList
=
Lists
.
newArrayList
();
reportDto
.
forEach
(
foreachWithIndex
((
report
,
index
)
->
{
reportDto
.
forEach
(
foreachWithIndex
((
report
,
index
)
->
{
RowRenderData
rowRenderData
=
RowRenderData
.
build
(
String
.
valueOf
(
reportDto
.
size
()
-
index
),
RowRenderData
rowRenderData
=
RowRenderData
.
build
(
String
.
valueOf
(
reportDto
.
size
()
-
index
),
report
.
getStation
(),
report
.
getArriveTime
(),
report
.
getCarName
(),
report
.
getPersonNum
(),
report
.
getDisatchNum
(),
report
.
getDryPowder
(),
report
.
getFoam
(),
report
.
getOther
());
report
.
getStation
(),
report
.
getArriveTime
(),
report
.
getCarName
(),
report
.
getPersonNum
(),
report
.
getDisatchNum
(),
report
.
getDryPowder
(),
report
.
getFoam
(),
report
.
getOther
());
checkDangerList
.
add
(
rowRenderData
);
checkDangerList
.
add
(
rowRenderData
);
}));
}));
generateTableData
(
table
,
checkDangerList
);
generateTableData
(
table
,
checkDangerList
);
...
@@ -1034,7 +1090,7 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
...
@@ -1034,7 +1090,7 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
cellRenderData
.
getRenderData
().
setStyle
(
style
);
cellRenderData
.
getRenderData
().
setStyle
(
style
);
});
});
XWPFTableRow
insertNewTableRow
=
table
.
insertNewTableRow
(
dangerListDataStartRowNew
);
XWPFTableRow
insertNewTableRow
=
table
.
insertNewTableRow
(
dangerListDataStartRowNew
);
IntStream
.
range
(
2
,
6
).
forEach
(
j
->
insertNewTableRow
.
createCell
());
IntStream
.
range
(
2
,
6
).
forEach
(
j
->
insertNewTableRow
.
createCell
());
MiniTableRenderPolicy
.
Helper
.
renderRow
(
table
,
dangerListDataStartRowNew
,
reverseList
.
get
(
i
));
MiniTableRenderPolicy
.
Helper
.
renderRow
(
table
,
dangerListDataStartRowNew
,
reverseList
.
get
(
i
));
}
}
...
@@ -1044,10 +1100,11 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
...
@@ -1044,10 +1100,11 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
}
}
public
static
void
generateTableData
(
XWPFTable
table
,
List
<
RowRenderData
>
dangerList
)
{
public
static
void
generateTableData
(
XWPFTable
table
,
List
<
RowRenderData
>
dangerList
)
{
String
firstSize
=
""
;
String
firstSize
=
""
;
if
(!
ValidationUtil
.
isEmpty
(
dangerList
))
{
if
(!
ValidationUtil
.
isEmpty
(
dangerList
))
{
firstSize
=
dangerList
.
get
(
0
).
getCellDatas
().
get
(
5
).
getRenderData
().
getText
();
firstSize
=
dangerList
.
get
(
0
).
getCellDatas
().
get
(
5
).
getRenderData
().
getText
();
int
fSizs
=
Integer
.
parseInt
(
firstSize
);
int
fSizs
=
Integer
.
parseInt
(
firstSize
);
dangerList
.
get
(
0
).
getCellDatas
().
get
(
5
).
getRenderData
().
setText
(
""
);
// 表格渲染和列表数据下标相反,需要翻转一下列表
// 表格渲染和列表数据下标相反,需要翻转一下列表
List
<
RowRenderData
>
reverseList
=
Lists
.
reverse
(
dangerList
);
List
<
RowRenderData
>
reverseList
=
Lists
.
reverse
(
dangerList
);
...
@@ -1055,11 +1112,7 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
...
@@ -1055,11 +1112,7 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
// 循环插入行
// 循环插入行
int
listLength
=
dangerList
.
size
();
int
listLength
=
dangerList
.
size
();
for
(
int
i
=
0
;
i
<
fSizs
;
i
++)
{
for
(
int
i
=
0
;
i
<
fSizs
;
i
++)
{
if
(
i
==
0
)
{
if
(
i
==
0
)
{
TableStyle
tableStyle
=
new
TableStyle
();
tableStyle
.
setAlign
(
Enum
.
forInt
(
2
));
reverseList
.
get
(
i
).
getCellDatas
().
get
(
0
).
setCellStyle
(
tableStyle
);
reverseList
.
get
(
i
).
getCellDatas
().
get
(
0
).
getRenderData
().
setText
(
"增\n援\n力\n量"
);
Style
style
=
new
Style
();
Style
style
=
new
Style
();
style
.
setFontFamily
(
"宋体"
);
style
.
setFontFamily
(
"宋体"
);
style
.
setFontSize
(
12
);
style
.
setFontSize
(
12
);
...
@@ -1075,27 +1128,47 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
...
@@ -1075,27 +1128,47 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
}
}
XWPFTableRow
insertNewTableRow
=
table
.
insertNewTableRow
(
dangerListDataStartRow
);
XWPFTableRow
insertNewTableRow
=
table
.
insertNewTableRow
(
dangerListDataStartRow
);
IntStream
.
range
(
5
,
14
).
forEach
(
j
->
insertNewTableRow
.
createCell
());
IntStream
.
range
(
5
,
14
).
forEach
(
j
->
insertNewTableRow
.
createCell
());
MiniTableRenderPolicy
.
Helper
.
renderRow
(
table
,
dangerListDataStartRow
,
reverseList
.
get
(
i
));
MiniTableRenderPolicy
.
Helper
.
renderRow
(
table
,
dangerListDataStartRow
,
reverseList
.
get
(
i
));
}
}
for
(
int
i
=
fSizs
;
i
<
listLength
;
i
++)
{
reverseList
.
get
(
i
).
getCellDatas
().
forEach
(
cellRenderData
->
{
for
(
int
i
=
fSizs
;
i
<
listLength
;
i
++)
{
TableStyle
tableStyle
=
new
TableStyle
();
tableStyle
.
setAlign
(
Enum
.
forInt
(
2
));
reverseList
.
get
(
i
).
getCellDatas
().
get
(
0
).
setCellStyle
(
tableStyle
);
reverseList
.
get
(
i
).
getCellDatas
().
get
(
0
).
getRenderData
().
setText
(
"增\n援\n力\n量"
);
Style
style
=
new
Style
();
Style
style
=
new
Style
();
style
.
setFontFamily
(
"仿宋
"
);
style
.
setFontFamily
(
"宋体
"
);
style
.
setFontSize
(
12
);
style
.
setFontSize
(
12
);
cellRenderData
.
getRenderData
().
setStyle
(
style
);
style
.
setBold
(
true
);
});
reverseList
.
get
(
i
).
getCellDatas
().
get
(
0
).
getRenderData
().
setStyle
(
style
);
// reverseList.get(i).getCellDatas().forEach(cellRenderData -> {
// Style style = new Style();
// style.setFontFamily("仿宋");
// style.setFontSize(12);
// cellRenderData.getRenderData().setStyle(style);
// });
XWPFTableRow
insertNewTableRow
=
table
.
insertNewTableRow
(
dangerListDataStartRow
);
XWPFTableRow
insertNewTableRow
=
table
.
insertNewTableRow
(
dangerListDataStartRow
);
IntStream
.
range
(
5
,
14
).
forEach
(
j
->
insertNewTableRow
.
createCell
());
IntStream
.
range
(
5
,
14
).
forEach
(
j
->
insertNewTableRow
.
createCell
());
MiniTableRenderPolicy
.
Helper
.
renderRow
(
table
,
dangerListDataStartRow
,
reverseList
.
get
(
i
));
MiniTableRenderPolicy
.
Helper
.
renderRow
(
table
,
dangerListDataStartRow
,
reverseList
.
get
(
i
));
}
}
TableTools
.
mergeCellsVertically
(
table
,
0
,
0
,
fSizs
+
1
);
TableTools
.
mergeCellsVertically
(
table
,
0
,
0
,
fSizs
+
1
);
if
(
listLength
-
fSizs
>
1
)
{
if
(
fSizs
==
1
&&
(
listLength
-
fSizs
>
1
)
)
{
TableTools
.
mergeCellsVertically
(
table
,
0
,
fSizs
+
2
,
listLength
+
1
);
TableTools
.
mergeCellsVertically
(
table
,
0
,
fSizs
+
2
,
fSizs
+
2
+
(
listLength
-
fSizs
-
1
)
);
}
}
if
(
fSizs
>
1
&&
(
listLength
-
fSizs
>
1
))
{
TableTools
.
mergeCellsVertically
(
table
,
0
,
fSizs
+
2
,
fSizs
+
2
+
(
listLength
-
fSizs
-
1
));
}
XWPFTableRow
xwpfTableRow
=
table
.
getRows
().
get
(
fSizs
+
2
);
CTTc
ctTc
=
xwpfTableRow
.
getTableCells
().
get
(
0
).
getCTTc
();
CTTcPr
ctTcPr
=
ctTc
.
addNewTcPr
();
ctTcPr
.
addNewVAlign
().
setVal
(
STVerticalJc
.
CENTER
);
}
}
}
}
...
@@ -1131,7 +1204,7 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
...
@@ -1131,7 +1204,7 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
*/
*/
AlertCalledRo
alertCalledRo
=
new
AlertCalledRo
();
AlertCalledRo
alertCalledRo
=
new
AlertCalledRo
();
String
replaceContent
=
RuleAlertCalledService
.
init
(
alertCalledRo
,
alertCalledVo
);
String
replaceContent
=
RuleAlertCalledService
.
init
(
alertCalledRo
,
alertCalledVo
);
// 获取模板内容
// 获取模板内容
List
<
DataDictionary
>
dataDictionaries
=
List
<
DataDictionary
>
dataDictionaries
=
...
@@ -1141,20 +1214,20 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
...
@@ -1141,20 +1214,20 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
Template
template
=
templateService
.
getOne
(
new
QueryWrapper
<
Template
>().
eq
(
"type_code"
,
Template
template
=
templateService
.
getOne
(
new
QueryWrapper
<
Template
>().
eq
(
"type_code"
,
dataDictionary
.
getCode
()).
eq
(
"format"
,
true
));
dataDictionary
.
getCode
()).
eq
(
"format"
,
true
));
Map
<
String
,
String
>
definitions
=
new
HashMap
<>();
Map
<
String
,
String
>
definitions
=
new
HashMap
<>();
definitions
.
put
(
"$type"
,
alertCalled
.
getAlertType
());
definitions
.
put
(
"$type"
,
alertCalled
.
getAlertType
());
definitions
.
put
(
"$callTime"
,
DateUtils
.
convertDateToString
(
alertCalled
.
getCallTime
(),
DateUtils
.
DATE_TIME_PATTERN
));
definitions
.
put
(
"$callTime"
,
DateUtils
.
convertDateToString
(
alertCalled
.
getCallTime
(),
DateUtils
.
DATE_TIME_PATTERN
));
definitions
.
put
(
"$replaceContent"
,
replaceContent
);
definitions
.
put
(
"$replaceContent"
,
replaceContent
);
definitions
.
put
(
"$address"
,
ValidationUtil
.
isEmpty
(
alertCalled
.
getAddress
())
?
""
:
alertCalled
.
getAddress
()
);
definitions
.
put
(
"$address"
,
ValidationUtil
.
isEmpty
(
alertCalled
.
getAddress
())
?
""
:
alertCalled
.
getAddress
()
);
definitions
.
put
(
"$contactUser"
,
ValidationUtil
.
isEmpty
(
alertCalled
.
getContactUser
())
?
""
:
alertCalled
.
getContactUser
()
);
definitions
.
put
(
"$contactUser"
,
ValidationUtil
.
isEmpty
(
alertCalled
.
getContactUser
())
?
""
:
alertCalled
.
getContactUser
()
);
definitions
.
put
(
"$contactPhone"
,
ValidationUtil
.
isEmpty
(
alertCalled
.
getContactPhone
())
?
""
:
alertCalled
.
getContactPhone
()
);
definitions
.
put
(
"$contactPhone"
,
ValidationUtil
.
isEmpty
(
alertCalled
.
getContactPhone
())
?
""
:
alertCalled
.
getContactPhone
()
);
// definitions.put("$recDate", DateUtils.convertDateToString(new Date(), DateUtils.DATE_TIME_PATTERN));
// definitions.put("$recDate", DateUtils.convertDateToString(new Date(), DateUtils.DATE_TIME_PATTERN));
if
(
alertCalled
.
getAlertStatus
())
{
if
(
alertCalled
.
getAlertStatus
())
{
map
.
put
(
"recDate"
,
DateUtils
.
convertDateToString
(
alertCalled
.
getUpdateTime
(),
DateUtils
.
DATE_TIME_PATTERN
));
map
.
put
(
"recDate"
,
DateUtils
.
convertDateToString
(
alertCalled
.
getUpdateTime
(),
DateUtils
.
DATE_TIME_PATTERN
));
}
else
{
}
else
{
map
.
put
(
"recDate"
,
DateUtils
.
convertDateToString
(
new
Date
(),
DateUtils
.
DATE_TIME_PATTERN
));
map
.
put
(
"recDate"
,
DateUtils
.
convertDateToString
(
new
Date
(),
DateUtils
.
DATE_TIME_PATTERN
));
}
}
String
content
=
getTaskInformation
(
template
.
getContent
(),
definitions
);
String
content
=
getTaskInformation
(
template
.
getContent
(),
definitions
);
template
.
setContent
(
content
);
template
.
setContent
(
content
);
TemplateDto
templateDto
=
new
TemplateDto
();
TemplateDto
templateDto
=
new
TemplateDto
();
BeanUtils
.
copyProperties
(
template
,
templateDto
);
BeanUtils
.
copyProperties
(
template
,
templateDto
);
...
@@ -1183,7 +1256,7 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
...
@@ -1183,7 +1256,7 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
//获取接警录音
//获取接警录音
List
<
VoiceRecordFileDto
>
voiceRecordFileDtos
=
voiceRecordFileService
.
listByAlertId
(
id
);
List
<
VoiceRecordFileDto
>
voiceRecordFileDtos
=
voiceRecordFileService
.
listByAlertId
(
id
);
voiceRecordFileDtos
.
stream
().
forEach
(
voiceRecordFileDto
->
{
voiceRecordFileDtos
.
stream
().
forEach
(
voiceRecordFileDto
->
{
InstructionsZHDto
instruct
=
new
InstructionsZHDto
(
voiceRecordFileDto
.
getSequenceNbr
(),
"接警录音"
,
voiceRecordFileDto
.
getRecDate
(),
voiceRecordFileDto
.
getFilePath
(),
null
);
InstructionsZHDto
instruct
=
new
InstructionsZHDto
(
voiceRecordFileDto
.
getSequenceNbr
(),
"接警录音"
,
voiceRecordFileDto
.
getRecDate
(),
voiceRecordFileDto
.
getFilePath
(),
null
);
listInstructionsZHDto
.
add
(
instruct
);
listInstructionsZHDto
.
add
(
instruct
);
});
});
...
@@ -1234,16 +1307,16 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
...
@@ -1234,16 +1307,16 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
break
;
break
;
}
}
InstructionsZHDto
instruct
=
new
InstructionsZHDto
(
AlertSubmittedZHDto
.
getSequenceNbr
(),
AlertSubmittedZHDto
.
getBusinessType
(),
AlertSubmittedZHDto
.
getSubmissionTime
(),
content
,
null
);
InstructionsZHDto
instruct
=
new
InstructionsZHDto
(
AlertSubmittedZHDto
.
getSequenceNbr
(),
AlertSubmittedZHDto
.
getBusinessType
(),
AlertSubmittedZHDto
.
getSubmissionTime
(),
content
,
null
);
listInstructionsZHDto
.
add
(
instruct
);
listInstructionsZHDto
.
add
(
instruct
);
});
});
// 获取归并得警情信息
// 获取归并得警情信息
LambdaQueryWrapper
<
AlertCalled
>
queryWrapper
=
new
LambdaQueryWrapper
();
LambdaQueryWrapper
<
AlertCalled
>
queryWrapper
=
new
LambdaQueryWrapper
();
queryWrapper
.
eq
(
AlertCalled:
:
getFatherAlert
,
id
);
queryWrapper
.
eq
(
AlertCalled:
:
getFatherAlert
,
id
);
List
<
AlertCalled
>
alertCalleds
=
alertCalledService
.
getBaseMapper
().
selectList
(
queryWrapper
);
List
<
AlertCalled
>
alertCalleds
=
alertCalledService
.
getBaseMapper
().
selectList
(
queryWrapper
);
alertCalleds
.
stream
().
forEach
(
e
->
{
alertCalleds
.
stream
().
forEach
(
e
->
{
AlertSubmittedZHDto
alertSubmittedZHDto
=
new
AlertSubmittedZHDto
();
AlertSubmittedZHDto
alertSubmittedZHDto
=
new
AlertSubmittedZHDto
();
AlertCalledFormDto
alertCalledFormDto
=
(
AlertCalledFormDto
)
alertCalledService
.
selectAlertCalledByIdNoRedis
(
e
.
getSequenceNbr
());
AlertCalledFormDto
alertCalledFormDto
=
(
AlertCalledFormDto
)
alertCalledService
.
selectAlertCalledByIdNoRedis
(
e
.
getSequenceNbr
());
alertSubmittedZHDto
.
setAlertCalledFormDto
(
alertCalledFormDto
);
alertSubmittedZHDto
.
setAlertCalledFormDto
(
alertCalledFormDto
);
...
@@ -1303,6 +1376,7 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
...
@@ -1303,6 +1376,7 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
}
}
@SuppressWarnings
(
"unchecked"
)
@SuppressWarnings
(
"unchecked"
)
public
void
ruleCallbackActionForPowerTransferForCar
(
String
smsCode
,
List
sendIds
,
Object
object
,
List
<
String
>
pList
)
public
void
ruleCallbackActionForPowerTransferForCar
(
String
smsCode
,
List
sendIds
,
Object
object
,
List
<
String
>
pList
)
throws
IllegalAccessException
,
MqttPersistenceException
,
MqttException
{
throws
IllegalAccessException
,
MqttPersistenceException
,
MqttException
{
...
@@ -1330,8 +1404,8 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
...
@@ -1330,8 +1404,8 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
alertCalledId
=
calledRo
.
getSequenceNbr
();
alertCalledId
=
calledRo
.
getSequenceNbr
();
AlertCalled
alertCalled
=
alertCalledService
.
getAlertCalledById
(
Long
.
parseLong
(
alertSubmittedId
));
AlertCalled
alertCalled
=
alertCalledService
.
getAlertCalledById
(
Long
.
parseLong
(
alertSubmittedId
));
//响应级别
//响应级别
String
responseLevelString
=
""
;
String
responseLevelString
=
""
;
if
(
alertCalled
!=
null
&&
alertCalled
.
getResponseLevel
()
!=
null
)
{
if
(
alertCalled
!=
null
&&
alertCalled
.
getResponseLevel
()!=
null
)
{
responseLevelString
=
alertCalled
.
getResponseLevel
();
responseLevelString
=
alertCalled
.
getResponseLevel
();
}
}
//先获取消救部领导、消救部值班人员信息
//先获取消救部领导、消救部值班人员信息
...
@@ -1339,21 +1413,20 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
...
@@ -1339,21 +1413,20 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
JSONObject
jsonObject
=
JSONObject
.
parseObject
(
JSONObject
.
toJSONString
(
e
));
JSONObject
jsonObject
=
JSONObject
.
parseObject
(
JSONObject
.
toJSONString
(
e
));
// 消救部
// 消救部
if
(
jsonObject
.
containsKey
(
"airportUnit"
))
{
if
(
jsonObject
.
containsKey
(
"airportUnit"
))
{
String
departmentName
=
jsonObject
.
getString
(
"name"
);
String
departmentName
=
jsonObject
.
getString
(
"name"
);
if
(
jsonObject
.
containsKey
(
"airportUnit"
))
{
if
(
jsonObject
.
containsKey
(
"airportUnit"
))
{
{
{
List
<
Map
<
String
,
Object
>>
mapList
=
dynamicFormInstanceMapper
.
getFireRescueDepartmentStaff
(
departmentName
,
null
);
List
<
Map
<
String
,
Object
>>
mapList
=
dynamicFormInstanceMapper
.
getFireRescueDepartmentStaff
(
departmentName
,
null
);
userIdList
.
addAll
(
mapList
);
userIdList
.
addAll
(
mapList
);
}
}
if
(
jsonObject
.
containsKey
(
"onDuty"
))
{
if
(
jsonObject
.
containsKey
(
"onDuty"
))
{
List
<
Map
<
String
,
Object
>>
mapList
=
dynamicFormInstanceMapper
.
getDutyPersonByTeamIdAndCarId
(
DateUtils
.
getDateNowShortStr
(),
departmentName
);
List
<
Map
<
String
,
Object
>>
mapList
=
dynamicFormInstanceMapper
.
getDutyPersonByTeamIdAndCarId
(
DateUtils
.
getDateNowShortStr
(),
departmentName
);
userIdList
.
addAll
(
mapList
);
userIdList
.
addAll
(
mapList
);
}
}
}
}
}
}
});
});
List
<
Object
>
companyDetail
=
JSONArray
.
parseArray
(
JSON
.
toJSON
(
calledRo
.
getCompany
()).
toString
(),
Object
.
class
);
List
<
Object
>
companyDetail
=
JSONArray
.
parseArray
(
JSON
.
toJSON
(
calledRo
.
getCompany
()).
toString
(),
Object
.
class
);
for
(
Object
powerTransferCompanyDto
:
companyDetail
)
{
for
(
Object
powerTransferCompanyDto
:
companyDetail
)
{
PowerTransferCompanyDto
powerDto
=
JSONObject
.
parseObject
(
JSON
.
toJSON
(
powerTransferCompanyDto
).
toString
(),
PowerTransferCompanyDto
.
class
);
PowerTransferCompanyDto
powerDto
=
JSONObject
.
parseObject
(
JSON
.
toJSON
(
powerTransferCompanyDto
).
toString
(),
PowerTransferCompanyDto
.
class
);
Long
companyId
=
powerDto
.
getCompanyId
();
Long
companyId
=
powerDto
.
getCompanyId
();
...
@@ -1362,34 +1435,32 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
...
@@ -1362,34 +1435,32 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
Set
<
Map
<
String
,
Object
>>
sendUserIds
=
new
HashSet
<
Map
<
String
,
Object
>>();
Set
<
Map
<
String
,
Object
>>
sendUserIds
=
new
HashSet
<
Map
<
String
,
Object
>>();
//FireTeam fireTeam= fireTeamServiceImpl.getById(companyId);
//FireTeam fireTeam= fireTeamServiceImpl.getById(companyId);
String
alertTypeCode
=
calledRo
.
getAlertTypeCode
();
String
alertTypeCode
=
calledRo
.
getAlertTypeCode
();
FireTeam
fireTeam
=
fireTeamServiceImpl
.
getById
(
companyId
);
FireTeam
fireTeam
=
fireTeamServiceImpl
.
getById
(
companyId
);
sendIds
.
stream
().
forEach
(
e
->
{
sendIds
.
stream
().
forEach
(
e
->
{
JSONObject
jsonObject1
=
JSONObject
.
parseObject
(
JSONObject
.
toJSONString
(
e
));
JSONObject
jsonObject1
=
JSONObject
.
parseObject
(
JSONObject
.
toJSONString
(
e
));
if
(
jsonObject1
.
containsKey
(
"type"
)
&&
(
jsonObject1
.
getString
(
"type"
).
equals
(
AlertStageEnums
.
DD
.
getCode
())))
{
if
(
jsonObject1
.
containsKey
(
"type"
)
&&
(
jsonObject1
.
getString
(
"type"
).
equals
(
AlertStageEnums
.
DD
.
getCode
())))
{
String
[]
groupCode
=
jsonObject1
.
getString
(
"fireBrigade"
).
split
(
","
);
String
[]
groupCode
=
jsonObject1
.
getString
(
"fireBrigade"
).
split
(
","
);
List
<
String
>
positionType
=
Arrays
.
asList
(
groupCode
);
List
<
String
>
positionType
=
Arrays
.
asList
(
groupCode
);
if
(
jsonObject1
.
containsKey
(
"fireBrigade"
))
{
if
(
jsonObject1
.
containsKey
(
"fireBrigade"
))
{
{
{
List
<
Map
<
String
,
Object
>>
mapList
=
dynamicFormInstanceMapper
.
getFireRescueDepartmentStaff
(
fireTeam
.
getCompanyName
(),
positionType
);
List
<
Map
<
String
,
Object
>>
mapList
=
dynamicFormInstanceMapper
.
getFireRescueDepartmentStaff
(
fireTeam
.
getCompanyName
(),
positionType
);
sendUserIds
.
addAll
(
mapList
);
sendUserIds
.
addAll
(
mapList
);
}
}
if
(
jsonObject1
.
containsKey
(
"onDuty"
))
{
if
(
jsonObject1
.
containsKey
(
"onDuty"
))
{
List
<
Map
<
String
,
Object
>>
mapList
=
dynamicFormInstanceMapper
.
getDutyPersonByTeamIdAndCarId
(
DateUtils
.
getDateNowShortStr
(),
fireTeam
.
getCompanyName
());
List
<
Map
<
String
,
Object
>>
mapList
=
dynamicFormInstanceMapper
.
getDutyPersonByTeamIdAndCarId
(
DateUtils
.
getDateNowShortStr
(),
fireTeam
.
getCompanyName
());
sendUserIds
.
addAll
(
mapList
);
sendUserIds
.
addAll
(
mapList
);
}
}
}
}
}
else
if
(
jsonObject1
.
containsKey
(
"type"
)
&&
(
jsonObject1
.
getString
(
"type"
).
equals
(
AlertStageEnums
.
ZD
.
getCode
())))
{
}
else
if
(
jsonObject1
.
containsKey
(
"type"
)
&&
(
jsonObject1
.
getString
(
"type"
).
equals
(
AlertStageEnums
.
ZD
.
getCode
())))
{
String
[]
groupCode
=
jsonObject1
.
get
(
"fireBrigade"
).
toString
().
split
(
","
);
String
[]
groupCode
=
jsonObject1
.
get
(
"fireBrigade"
).
toString
().
split
(
","
);
List
<
String
>
positionType
=
Arrays
.
asList
(
groupCode
);
List
<
String
>
positionType
=
Arrays
.
asList
(
groupCode
);
String
departmentName
=
jsonObject1
.
getString
(
"name"
);
String
departmentName
=
jsonObject1
.
getString
(
"name"
);
if
(
jsonObject1
.
containsKey
(
"fireBrigade"
))
{
if
(
jsonObject1
.
containsKey
(
"fireBrigade"
))
{
{
{
List
<
Map
<
String
,
Object
>>
mapList
=
dynamicFormInstanceMapper
.
getFireRescueDepartmentStaff
(
departmentName
,
positionType
);
List
<
Map
<
String
,
Object
>>
mapList
=
dynamicFormInstanceMapper
.
getFireRescueDepartmentStaff
(
departmentName
,
positionType
);
sendUserIds
.
addAll
(
mapList
);
sendUserIds
.
addAll
(
mapList
);
}
}
if
(
jsonObject1
.
containsKey
(
"onDuty"
))
{
if
(
jsonObject1
.
containsKey
(
"onDuty"
))
{
List
<
Map
<
String
,
Object
>>
mapList
=
dynamicFormInstanceMapper
.
getDutyPersonByTeamIdAndCarId
(
DateUtils
.
getDateNowShortStr
(),
departmentName
);
List
<
Map
<
String
,
Object
>>
mapList
=
dynamicFormInstanceMapper
.
getDutyPersonByTeamIdAndCarId
(
DateUtils
.
getDateNowShortStr
(),
departmentName
);
sendUserIds
.
addAll
(
mapList
);
sendUserIds
.
addAll
(
mapList
);
}
}
}
}
...
@@ -1440,7 +1511,7 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
...
@@ -1440,7 +1511,7 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
if
(
designatedDriver
)
{
if
(
designatedDriver
)
{
// 发送单个车辆的信息数据到客户
// 发送单个车辆的信息数据到客户
smsParams
.
put
(
"resourcesNum"
,
smsParams
.
put
(
"resourcesNum"
,
resourcesNum
.
toString
()
.
substring
(
resourcesNum
.
toString
().
length
()
-
2
)
);
resourcesNum
.
toString
());
List
<
AlertSubmittedObject
>
alertSubmittedObjectListSub
=
Lists
.
newArrayList
();
List
<
AlertSubmittedObject
>
alertSubmittedObjectListSub
=
Lists
.
newArrayList
();
Map
<
String
,
Object
>
map
=
dynamicFormInstanceMapper
Map
<
String
,
Object
>
map
=
dynamicFormInstanceMapper
.
getCurentCarIsUserPhone
(
Long
.
parseLong
(
i
.
getResourcesId
()));
.
getCurentCarIsUserPhone
(
Long
.
parseLong
(
i
.
getResourcesId
()));
...
@@ -1450,23 +1521,23 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
...
@@ -1450,23 +1521,23 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
alertSubmittedObjectSub
.
setCompanyId
(
companyId
);
alertSubmittedObjectSub
.
setCompanyId
(
companyId
);
alertSubmittedObjectSub
.
setCompanyName
(
companyName
);
alertSubmittedObjectSub
.
setCompanyName
(
companyName
);
alertSubmittedObjectSub
.
setType
(
false
);
alertSubmittedObjectSub
.
setType
(
false
);
if
(
map
==
null
||
!
map
.
containsKey
(
"userId"
))
{
if
(
map
==
null
||
!
map
.
containsKey
(
"userId"
))
{
continue
;
continue
;
}
}
alertSubmittedObjectSub
.
setUserId
(
Long
.
parseLong
(
map
.
get
(
"userId"
).
toString
()));
alertSubmittedObjectSub
.
setUserId
(
Long
.
parseLong
(
map
.
get
(
"userId"
).
toString
()));
alertSubmittedObjectSub
.
setTheUser
(
map
.
get
(
"userName"
).
toString
());
alertSubmittedObjectSub
.
setTheUser
(
map
.
get
(
"userName"
).
toString
());
//
//
pList
.
add
(
map
.
get
(
"userName"
).
toString
());
pList
.
add
(
map
.
get
(
"userName"
).
toString
());
Set
<
String
>
mobile
=
null
;
Set
<
String
>
mobile
=
null
;
List
<
String
>
userList
=
null
;
List
<
String
>
userList
=
null
;
if
(!
ValidationUtil
.
isEmpty
(
map
.
get
(
"mobilePhone"
)))
{
if
(!
ValidationUtil
.
isEmpty
(
map
.
get
(
"mobilePhone"
)))
{
mobile
=
new
HashSet
<
String
>()
{
mobile
=
new
HashSet
<
String
>()
{
{
{
add
(
map
.
get
(
"mobilePhone"
).
toString
());
add
(
map
.
get
(
"mobilePhone"
).
toString
());
}
}
};
};
userList
=
new
ArrayList
<
String
>();
userList
=
new
ArrayList
<
String
>();
if
(!
ValidationUtil
.
isEmpty
(
map
.
get
(
"amosId"
)))
{
if
(!
ValidationUtil
.
isEmpty
(
map
.
get
(
"amosId"
)))
{
userList
.
add
(
map
.
get
(
"amosId"
).
toString
());
userList
.
add
(
map
.
get
(
"amosId"
).
toString
());
}
}
alertSubmittedObjectSub
.
setUserPhone
(
map
.
get
(
"mobilePhone"
).
toString
());
alertSubmittedObjectSub
.
setUserPhone
(
map
.
get
(
"mobilePhone"
).
toString
());
...
@@ -1474,12 +1545,12 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
...
@@ -1474,12 +1545,12 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
alertSubmittedObjectListSub
.
add
(
alertSubmittedObjectSub
);
alertSubmittedObjectListSub
.
add
(
alertSubmittedObjectSub
);
// alertSubmittedObjectServiceImpl.saveBatch(alertSubmittedObjectListSub);
// alertSubmittedObjectServiceImpl.saveBatch(alertSubmittedObjectListSub);
// 调用短信发送接口
// 调用短信发送接口
alertCalledAction
.
sendAlertCalleCmd
(
sCode
,
mobile
,
smsParams
);
alertCalledAction
.
sendAlertCalleCmd
(
s
ms
Code
,
mobile
,
smsParams
);
Map
<
String
,
String
>
besidesMap
=
new
HashMap
<
String
,
String
>();
Map
<
String
,
String
>
besidesMap
=
new
HashMap
<
String
,
String
>();
besidesMap
.
put
(
"responseLevelString"
,
responseLevelString
);
besidesMap
.
put
(
"responseLevelString"
,
responseLevelString
);
besidesMap
.
put
(
"alterId"
,
alertCalledId
);
besidesMap
.
put
(
"alterId"
,
alertCalledId
);
if
(
userList
.
size
()
>
0
)
{
if
(
userList
.
size
()>
0
)
{
pushPowerTransferToAppAndWeb
(
AlertBusinessTypeEnum
.
力量调派
.
getCode
(),
besidesMap
,
smsParams
,
userList
);
pushPowerTransferToAppAndWeb
(
AlertBusinessTypeEnum
.
力量调派
.
getCode
(),
besidesMap
,
smsParams
,
userList
);
}
}
emqKeeper
.
getMqttClient
().
publish
(
topic
,
alertCalledId
.
getBytes
(),
RuleConfig
.
DEFAULT_QOS
,
emqKeeper
.
getMqttClient
().
publish
(
topic
,
alertCalledId
.
getBytes
(),
RuleConfig
.
DEFAULT_QOS
,
...
@@ -1488,16 +1559,16 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
...
@@ -1488,16 +1559,16 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
}
}
}
}
String
resourcesNumStr
=
resourcesNum
.
toString
();
String
resourcesNumStr
=
resourcesNum
.
toString
();
List
<
String
>
userList
=
new
ArrayList
<
String
>();
List
<
String
>
userList
=
new
ArrayList
<
String
>();
sendUserIds
.
stream
().
forEach
(
i
->
{
sendUserIds
.
stream
().
forEach
(
i
->
{
if
(
i
.
containsKey
(
"mobilePhone"
))
{
if
(
i
.
containsKey
(
"mobilePhone"
))
{
mobiles
.
add
(
i
.
get
(
"mobilePhone"
).
toString
());
mobiles
.
add
(
i
.
get
(
"mobilePhone"
).
toString
());
}
}
if
(
i
.
containsKey
(
"amosId"
)
&&
!
ValidationUtil
.
isEmpty
(
i
.
get
(
"amosId"
)))
{
if
(
i
.
containsKey
(
"amosId"
)&&
!
ValidationUtil
.
isEmpty
(
i
.
get
(
"amosId"
)))
{
userList
.
add
(
i
.
get
(
"amosId"
).
toString
());
userList
.
add
(
i
.
get
(
"amosId"
).
toString
());
}
}
});
});
smsParams
.
put
(
"resourcesNum"
,
resourcesNumStr
.
substring
(
resourcesNumStr
.
length
()
-
2
)
);
smsParams
.
put
(
"resourcesNum"
,
resourcesNumStr
);
// 短信报送对象
// 短信报送对象
// alertSubmittedObjectServiceImpl.saveBatch(alertSubmittedObjectList);
// alertSubmittedObjectServiceImpl.saveBatch(alertSubmittedObjectList);
// 发送任务消息
// 发送任务消息
...
@@ -1510,8 +1581,8 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
...
@@ -1510,8 +1581,8 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
Map
<
String
,
String
>
besidesMap
=
new
HashMap
<
String
,
String
>();
Map
<
String
,
String
>
besidesMap
=
new
HashMap
<
String
,
String
>();
besidesMap
.
put
(
"responseLevelString"
,
responseLevelString
);
//响应级别
besidesMap
.
put
(
"responseLevelString"
,
responseLevelString
);
//响应级别
besidesMap
.
put
(
"alterId"
,
alertCalledId
);
besidesMap
.
put
(
"alterId"
,
alertCalledId
);
if
(
userList
.
size
()
>
0
)
{
if
(
userList
.
size
()>
0
)
{
pushPowerTransferToAppAndWeb
(
AlertBusinessTypeEnum
.
力量调派
.
getCode
(),
besidesMap
,
smsParams
,
userList
);
pushPowerTransferToAppAndWeb
(
AlertBusinessTypeEnum
.
力量调派
.
getCode
(),
besidesMap
,
smsParams
,
userList
);
}
}
emqKeeper
.
getMqttClient
().
publish
(
topic
,
alertCalledId
.
getBytes
(),
RuleConfig
.
DEFAULT_QOS
,
false
);
emqKeeper
.
getMqttClient
().
publish
(
topic
,
alertCalledId
.
getBytes
(),
RuleConfig
.
DEFAULT_QOS
,
false
);
}
}
...
@@ -1532,18 +1603,17 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
...
@@ -1532,18 +1603,17 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
String
alertSubmittedId
=
calledRo
.
getAlertSubmittedId
();
String
alertSubmittedId
=
calledRo
.
getAlertSubmittedId
();
alertCalledId
=
calledRo
.
getSequenceNbr
();
alertCalledId
=
calledRo
.
getSequenceNbr
();
Set
<
Map
<
String
,
Object
>>
userIds
=
new
HashSet
<
Map
<
String
,
Object
>>();
Set
<
Map
<
String
,
Object
>>
userIds
=
new
HashSet
<
Map
<
String
,
Object
>>();
List
<
Object
>
companyDetail
=
JSONArray
.
parseArray
(
JSON
.
toJSON
(
calledRo
.
getCompany
()).
toString
(),
Object
.
class
);
List
<
Object
>
companyDetail
=
JSONArray
.
parseArray
(
JSON
.
toJSON
(
calledRo
.
getCompany
()).
toString
(),
Object
.
class
);
for
(
Object
e
:
sendIds
)
{
for
(
Object
e:
sendIds
)
{
JSONObject
jsonObject
=
JSONObject
.
parseObject
(
JSONObject
.
toJSONString
(
e
));
JSONObject
jsonObject
=
JSONObject
.
parseObject
(
JSONObject
.
toJSONString
(
e
));
if
(
jsonObject
.
containsKey
(
"type"
)
&&
((
jsonObject
.
getString
(
"type"
).
equals
(
AlertStageEnums
.
ZH
.
getCode
()))
||
jsonObject
.
getString
(
"type"
).
equals
(
AlertStageEnums
.
XJ
.
getCode
())))
{
if
(
jsonObject
.
containsKey
(
"type"
)
&&(
(
jsonObject
.
getString
(
"type"
).
equals
(
AlertStageEnums
.
ZH
.
getCode
()))
||
jsonObject
.
getString
(
"type"
).
equals
(
AlertStageEnums
.
XJ
.
getCode
())))
{
String
departmentName
=
jsonObject
.
getString
(
"name"
);
String
departmentName
=
jsonObject
.
getString
(
"name"
);
if
(
jsonObject
.
containsKey
(
"airportUnit"
))
{
if
(
jsonObject
.
containsKey
(
"airportUnit"
))
{
{
{
List
<
Map
<
String
,
Object
>>
mapList
=
dynamicFormInstanceMapper
.
getFireRescueDepartmentStaff
(
departmentName
,
null
);
List
<
Map
<
String
,
Object
>>
mapList
=
dynamicFormInstanceMapper
.
getFireRescueDepartmentStaff
(
departmentName
,
null
);
userIds
.
addAll
(
mapList
);
userIds
.
addAll
(
mapList
);
}
}
if
(
jsonObject
.
containsKey
(
"onDuty"
))
{
if
(
jsonObject
.
containsKey
(
"onDuty"
))
{
List
<
Map
<
String
,
Object
>>
mapList
=
dynamicFormInstanceMapper
.
getDutyPersonByTeamIdAndCarId
(
DateUtils
.
getDateNowShortStr
(),
departmentName
);
List
<
Map
<
String
,
Object
>>
mapList
=
dynamicFormInstanceMapper
.
getDutyPersonByTeamIdAndCarId
(
DateUtils
.
getDateNowShortStr
(),
departmentName
);
userIds
.
addAll
(
mapList
);
userIds
.
addAll
(
mapList
);
}
}
}
}
...
@@ -1554,19 +1624,18 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
...
@@ -1554,19 +1624,18 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
PowerTransferCompanyDto
powerDto
=
JSONObject
.
parseObject
(
JSON
.
toJSON
(
powerTransferCompanyDto
).
toString
(),
PowerTransferCompanyDto
.
class
);
PowerTransferCompanyDto
powerDto
=
JSONObject
.
parseObject
(
JSON
.
toJSON
(
powerTransferCompanyDto
).
toString
(),
PowerTransferCompanyDto
.
class
);
Long
companyId
=
powerDto
.
getCompanyId
();
Long
companyId
=
powerDto
.
getCompanyId
();
String
companyName
=
powerDto
.
getCompanyName
();
String
companyName
=
powerDto
.
getCompanyName
();
FireTeam
fireTeam
=
fireTeamServiceImpl
.
getById
(
companyId
);
FireTeam
fireTeam
=
fireTeamServiceImpl
.
getById
(
companyId
);
for
(
Object
sendObject
:
sendIds
)
{
for
(
Object
sendObject:
sendIds
)
{
JSONObject
jsonObject1
=
JSONObject
.
parseObject
(
JSONObject
.
toJSONString
(
sendObject
));
JSONObject
jsonObject1
=
JSONObject
.
parseObject
(
JSONObject
.
toJSONString
(
sendObject
));
if
(
jsonObject1
.
containsKey
(
"type"
)
&&
(
jsonObject1
.
getString
(
"type"
).
equals
(
AlertStageEnums
.
监控大队
.
getCode
())))
{
if
(
jsonObject1
.
containsKey
(
"type"
)
&&
(
jsonObject1
.
getString
(
"type"
).
equals
(
AlertStageEnums
.
监控大队
.
getCode
())))
{
if
(
jsonObject1
.
containsKey
(
"onDuty"
))
{
if
(
jsonObject1
.
containsKey
(
"onDuty"
))
{
List
<
Map
<
String
,
Object
>>
dutyList
=
dynamicFormInstanceMapper
.
getDutyPersonByTeamIdAndCarId
(
List
<
Map
<
String
,
Object
>>
dutyList
=
dynamicFormInstanceMapper
.
getDutyPersonByTeamIdAndCarId
(
DateUtils
.
getDateNowShortStr
(),
fireTeam
.
getCompanyName
());
DateUtils
.
getDateNowShortStr
(),
fireTeam
.
getCompanyName
());
sendUserIds
.
addAll
(
dutyList
);
sendUserIds
.
addAll
(
dutyList
);
}
}
if
(
jsonObject1
.
containsKey
(
"airportUnit"
))
{
if
(
jsonObject1
.
containsKey
(
"airportUnit"
))
{
{
{
List
<
Map
<
String
,
Object
>>
mapList
=
dynamicFormInstanceMapper
.
getFireRescueDepartmentStaff
(
fireTeam
.
getCompanyName
(),
null
);
List
<
Map
<
String
,
Object
>>
mapList
=
dynamicFormInstanceMapper
.
getFireRescueDepartmentStaff
(
fireTeam
.
getCompanyName
(),
null
);
sendUserIds
.
addAll
(
mapList
);
sendUserIds
.
addAll
(
mapList
);
}
}
}
}
...
@@ -1603,12 +1672,12 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
...
@@ -1603,12 +1672,12 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
smsParams
.
put
(
"contactPhone"
,
calledRo
.
getContactPhone
());
smsParams
.
put
(
"contactPhone"
,
calledRo
.
getContactPhone
());
smsParams
.
put
(
"alertType"
,
calledRo
.
getAlertType
());
smsParams
.
put
(
"alertType"
,
calledRo
.
getAlertType
());
List
<
String
>
userList
=
new
ArrayList
<
String
>();
List
<
String
>
userList
=
new
ArrayList
<
String
>();
sendUserIds
.
stream
().
forEach
(
i
->
{
sendUserIds
.
stream
().
forEach
(
i
->
{
if
(
i
.
containsKey
(
"mobilePhone"
))
{
if
(
i
.
containsKey
(
"mobilePhone"
))
{
mobiles
.
add
(
i
.
get
(
"mobilePhone"
).
toString
());
mobiles
.
add
(
i
.
get
(
"mobilePhone"
).
toString
());
}
}
if
(
i
.
containsKey
(
"amosId"
)
&&
!
ValidationUtil
.
isEmpty
(
i
.
get
(
"amosId"
)))
{
if
(
i
.
containsKey
(
"amosId"
)&&
!
ValidationUtil
.
isEmpty
(
i
.
get
(
"amosId"
)))
{
userList
.
add
(
i
.
get
(
"amosId"
).
toString
());
userList
.
add
(
i
.
get
(
"amosId"
).
toString
());
}
}
});
});
...
@@ -1620,13 +1689,13 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
...
@@ -1620,13 +1689,13 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
// 调用短信发送接口
// 调用短信发送接口
try
{
try
{
alertCalledAction
.
sendAlertCalleCmd
(
smsCode
,
mobiles
,
smsParams
);
alertCalledAction
.
sendAlertCalleCmd
(
smsCode
,
mobiles
,
smsParams
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
}
}
Map
<
String
,
String
>
besidesMap
=
new
HashMap
<
String
,
String
>();
Map
<
String
,
String
>
besidesMap
=
new
HashMap
<
String
,
String
>();
besidesMap
.
put
(
"alterId"
,
alertCalledId
);
besidesMap
.
put
(
"alterId"
,
alertCalledId
);
if
(
userList
.
size
()
>
0
)
{
if
(
userList
.
size
()>
0
)
{
pushPowerTransferToAppAndWeb
(
AlertBusinessTypeEnum
.
力量调派
.
getCode
(),
besidesMap
,
smsParams
,
userList
);
pushPowerTransferToAppAndWeb
(
AlertBusinessTypeEnum
.
力量调派
.
getCode
(),
besidesMap
,
smsParams
,
userList
);
}
}
emqKeeper
.
getMqttClient
().
publish
(
topic
,
alertCalledId
.
getBytes
(),
RuleConfig
.
DEFAULT_QOS
,
false
);
emqKeeper
.
getMqttClient
().
publish
(
topic
,
alertCalledId
.
getBytes
(),
RuleConfig
.
DEFAULT_QOS
,
false
);
}
}
...
@@ -1634,6 +1703,9 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
...
@@ -1634,6 +1703,9 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
}
}
public
void
ruleCallbackActionForPowerTransferForAid
(
String
smsCode
,
List
sendIds
,
Object
object
,
List
<
String
>
pList
)
throws
MqttPersistenceException
,
MqttException
{
public
void
ruleCallbackActionForPowerTransferForAid
(
String
smsCode
,
List
sendIds
,
Object
object
,
List
<
String
>
pList
)
throws
MqttPersistenceException
,
MqttException
{
List
<
AlertSubmittedObject
>
alertSubmittedObjectList
=
Lists
.
newArrayList
();
List
<
AlertSubmittedObject
>
alertSubmittedObjectList
=
Lists
.
newArrayList
();
...
@@ -1649,20 +1721,19 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
...
@@ -1649,20 +1721,19 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
String
alertSubmittedId
=
calledRo
.
getAlertSubmittedId
();
String
alertSubmittedId
=
calledRo
.
getAlertSubmittedId
();
alertCalledId
=
calledRo
.
getSequenceNbr
();
alertCalledId
=
calledRo
.
getSequenceNbr
();
//List<FireTeam> fireTeamList= new ArrayList<FireTeam>();
//List<FireTeam> fireTeamList= new ArrayList<FireTeam>();
List
<
Object
>
companyDetail
=
JSONArray
.
parseArray
(
JSON
.
toJSON
(
calledRo
.
getCompany
()).
toString
(),
Object
.
class
);
List
<
Object
>
companyDetail
=
JSONArray
.
parseArray
(
JSON
.
toJSON
(
calledRo
.
getCompany
()).
toString
(),
Object
.
class
);
//获取急救科、消救部人员信息
//获取急救科、消救部人员信息
for
(
Object
e
:
sendIds
)
{
for
(
Object
e:
sendIds
)
{
JSONObject
jsonObject
=
JSONObject
.
parseObject
(
JSONObject
.
toJSONString
(
e
));
JSONObject
jsonObject
=
JSONObject
.
parseObject
(
JSONObject
.
toJSONString
(
e
));
if
(
jsonObject
.
containsKey
(
"type"
)
&&
((
jsonObject
.
getString
(
"type"
).
equals
(
AlertStageEnums
.
ZH
.
getCode
()))
||
jsonObject
.
getString
(
"type"
).
equals
(
AlertStageEnums
.
XJ
.
getCode
())))
{
if
(
jsonObject
.
containsKey
(
"type"
)
&&(
(
jsonObject
.
getString
(
"type"
).
equals
(
AlertStageEnums
.
ZH
.
getCode
()))
||
jsonObject
.
getString
(
"type"
).
equals
(
AlertStageEnums
.
XJ
.
getCode
())))
{
String
departmentName
=
jsonObject
.
getString
(
"name"
);
String
departmentName
=
jsonObject
.
getString
(
"name"
);
if
(
jsonObject
.
containsKey
(
"airportUnit"
))
{
if
(
jsonObject
.
containsKey
(
"airportUnit"
))
{
{
{
List
<
Map
<
String
,
Object
>>
mapList
=
dynamicFormInstanceMapper
.
getFireRescueDepartmentStaff
(
departmentName
,
null
);
List
<
Map
<
String
,
Object
>>
mapList
=
dynamicFormInstanceMapper
.
getFireRescueDepartmentStaff
(
departmentName
,
null
);
userIds
.
addAll
(
mapList
);
userIds
.
addAll
(
mapList
);
}
}
if
(
jsonObject
.
containsKey
(
"onDuty"
))
{
if
(
jsonObject
.
containsKey
(
"onDuty"
))
{
List
<
Map
<
String
,
Object
>>
mapList
=
dynamicFormInstanceMapper
.
getDutyPersonByTeamIdAndCarId
(
DateUtils
.
getDateNowShortStr
(),
departmentName
);
List
<
Map
<
String
,
Object
>>
mapList
=
dynamicFormInstanceMapper
.
getDutyPersonByTeamIdAndCarId
(
DateUtils
.
getDateNowShortStr
(),
departmentName
);
userIds
.
addAll
(
mapList
);
userIds
.
addAll
(
mapList
);
}
}
}
}
...
@@ -1674,13 +1745,13 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
...
@@ -1674,13 +1745,13 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
PowerTransferCompanyDto
powerDto
=
JSONObject
.
parseObject
(
JSON
.
toJSON
(
powerTransferCompanyDto
).
toString
(),
PowerTransferCompanyDto
.
class
);
PowerTransferCompanyDto
powerDto
=
JSONObject
.
parseObject
(
JSON
.
toJSON
(
powerTransferCompanyDto
).
toString
(),
PowerTransferCompanyDto
.
class
);
Long
companyId
=
powerDto
.
getCompanyId
();
Long
companyId
=
powerDto
.
getCompanyId
();
String
companyName
=
powerDto
.
getCompanyName
();
String
companyName
=
powerDto
.
getCompanyName
();
FireTeam
fireTeam
=
fireTeamServiceImpl
.
getById
(
companyId
);
//这个公司ID实际上是120急救站的id值
FireTeam
fireTeam
=
fireTeamServiceImpl
.
getById
(
companyId
);
//这个公司ID实际上是120急救站的id值
//fireTeamList.add(fireTeam);
//fireTeamList.add(fireTeam);
for
(
Object
e
:
sendIds
)
{
for
(
Object
e:
sendIds
)
{
JSONObject
jsonObject
=
JSONObject
.
parseObject
(
JSONObject
.
toJSONString
(
e
));
JSONObject
jsonObject
=
JSONObject
.
parseObject
(
JSONObject
.
toJSONString
(
e
));
//获取120急救站的规则
//获取120急救站的规则
if
(
jsonObject
.
containsKey
(
"type"
)
&&
(
jsonObject
.
getString
(
"type"
).
equals
(
AlertStageEnums
.
JJZ
.
getCode
())))
{
if
(
jsonObject
.
containsKey
(
"type"
)
&&
(
jsonObject
.
getString
(
"type"
).
equals
(
AlertStageEnums
.
JJZ
.
getCode
())))
{
if
(!
jsonObject
.
containsKey
(
"onDuty"
))
{
if
(!
jsonObject
.
containsKey
(
"onDuty"
))
{
continue
;
continue
;
}
}
//fireTeamList.stream().forEach(i->{
//fireTeamList.stream().forEach(i->{
...
@@ -1721,12 +1792,12 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
...
@@ -1721,12 +1792,12 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
smsParams
.
put
(
"contactUser"
,
calledRo
.
getContactUser
());
smsParams
.
put
(
"contactUser"
,
calledRo
.
getContactUser
());
smsParams
.
put
(
"contactPhone"
,
calledRo
.
getContactPhone
());
smsParams
.
put
(
"contactPhone"
,
calledRo
.
getContactPhone
());
smsParams
.
put
(
"alertType"
,
calledRo
.
getAlertType
());
smsParams
.
put
(
"alertType"
,
calledRo
.
getAlertType
());
List
<
String
>
userList
=
new
ArrayList
<
String
>();
List
<
String
>
userList
=
new
ArrayList
<
String
>();
sendUserIds
.
stream
().
forEach
(
i
->
{
sendUserIds
.
stream
().
forEach
(
i
->
{
if
(
i
.
containsKey
(
"mobilePhone"
))
{
if
(
i
.
containsKey
(
"mobilePhone"
))
{
mobiles
.
add
(
i
.
get
(
"mobilePhone"
).
toString
());
mobiles
.
add
(
i
.
get
(
"mobilePhone"
).
toString
());
}
}
if
(
i
.
containsKey
(
"amosId"
)
&&
!
ValidationUtil
.
isEmpty
(
i
.
get
(
"amosId"
)))
{
if
(
i
.
containsKey
(
"amosId"
)&&
!
ValidationUtil
.
isEmpty
(
i
.
get
(
"amosId"
)))
{
userList
.
add
(
i
.
get
(
"amosId"
).
toString
());
userList
.
add
(
i
.
get
(
"amosId"
).
toString
());
}
}
});
});
...
@@ -1738,13 +1809,13 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
...
@@ -1738,13 +1809,13 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
// 调用短信发送接口
// 调用短信发送接口
try
{
try
{
alertCalledAction
.
sendAlertCalleCmd
(
smsCode
,
mobiles
,
smsParams
);
alertCalledAction
.
sendAlertCalleCmd
(
smsCode
,
mobiles
,
smsParams
);
}
catch
(
Exception
e
)
{
// TODO: handle exception
}
catch
(
Exception
e
)
{
// TODO: handle exception
}
}
Map
<
String
,
String
>
besidesMap
=
new
HashMap
<
String
,
String
>();
Map
<
String
,
String
>
besidesMap
=
new
HashMap
<
String
,
String
>();
besidesMap
.
put
(
"alterId"
,
alertCalledId
);
besidesMap
.
put
(
"alterId"
,
alertCalledId
);
if
(
userList
.
size
()
>
0
)
{
if
(
userList
.
size
()>
0
)
{
pushPowerTransferToAppAndWeb
(
AlertBusinessTypeEnum
.
力量调派
.
getCode
(),
besidesMap
,
smsParams
,
userList
);
pushPowerTransferToAppAndWeb
(
AlertBusinessTypeEnum
.
力量调派
.
getCode
(),
besidesMap
,
smsParams
,
userList
);
}
}
emqKeeper
.
getMqttClient
().
publish
(
topic
,
alertCalledId
.
getBytes
(),
RuleConfig
.
DEFAULT_QOS
,
false
);
emqKeeper
.
getMqttClient
().
publish
(
topic
,
alertCalledId
.
getBytes
(),
RuleConfig
.
DEFAULT_QOS
,
false
);
...
@@ -1754,12 +1825,11 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
...
@@ -1754,12 +1825,11 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
/**
/**
* app消息web 消息推送
* app消息web 消息推送
*
* @param
* @param
* @throws MqttPersistenceException
* @throws MqttPersistenceException
* @throws MqttException
* @throws MqttException
*/
*/
public
void
pushPowerTransferToAppAndWeb
(
String
type
,
Map
<
String
,
String
>
besidesMap
,
HashMap
<
String
,
String
>
smsParams
,
List
<
String
>
userList
)
{
public
void
pushPowerTransferToAppAndWeb
(
String
type
,
Map
<
String
,
String
>
besidesMap
,
HashMap
<
String
,
String
>
smsParams
,
List
<
String
>
userList
)
{
PushMessageWebAndAppRo
pushMessageWebAndAppRo
=
new
PushMessageWebAndAppRo
();
PushMessageWebAndAppRo
pushMessageWebAndAppRo
=
new
PushMessageWebAndAppRo
();
pushMessageWebAndAppRo
.
setRelationId
(
besidesMap
.
get
(
"alterId"
));
pushMessageWebAndAppRo
.
setRelationId
(
besidesMap
.
get
(
"alterId"
));
...
@@ -1770,24 +1840,24 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
...
@@ -1770,24 +1840,24 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
pushMessageWebAndAppRo
.
setRuleType
(
type
);
pushMessageWebAndAppRo
.
setRuleType
(
type
);
pushMessageWebAndAppRo
.
setMsgType
(
this
.
msgType
);
pushMessageWebAndAppRo
.
setMsgType
(
this
.
msgType
);
pushMessageWebAndAppRo
.
setTerminal
(
RuleConstant
.
APP_WEB
);
pushMessageWebAndAppRo
.
setTerminal
(
RuleConstant
.
APP_WEB
);
Map
<
String
,
String
>
map
=
new
HashMap
<
String
,
String
>();
Map
<
String
,
String
>
map
=
new
HashMap
<
String
,
String
>();
//map.put("url", "disasterPage");
//map.put("url", "disasterPage");
map
.
put
(
"sequenceNbr"
,
besidesMap
.
get
(
"alterId"
));
map
.
put
(
"sequenceNbr"
,
besidesMap
.
get
(
"alterId"
));
if
(
AlertBusinessTypeEnum
.
警情结案
.
getCode
().
equals
(
type
))
{
if
(
AlertBusinessTypeEnum
.
警情结案
.
getCode
().
equals
(
type
))
{
pushMessageWebAndAppRo
.
setName
(
"消息"
);
pushMessageWebAndAppRo
.
setName
(
"消息"
);
pushMessageWebAndAppRo
.
setStartTime
(
besidesMap
.
get
(
"startTime"
));
pushMessageWebAndAppRo
.
setStartTime
(
besidesMap
.
get
(
"startTime"
));
pushMessageWebAndAppRo
.
setEndTime
(
besidesMap
.
get
(
"endTime"
));
pushMessageWebAndAppRo
.
setEndTime
(
besidesMap
.
get
(
"endTime"
));
pushMessageWebAndAppRo
.
setAddress
(
smsParams
.
get
(
"address"
));
pushMessageWebAndAppRo
.
setAddress
(
smsParams
.
get
(
"address"
));
pushMessageWebAndAppRo
.
setRuleType
(
"endAlert"
);
pushMessageWebAndAppRo
.
setRuleType
(
"endAlert"
);
}
}
if
(
AlertBusinessTypeEnum
.
非警情确认
.
getCode
().
equals
(
type
))
{
if
(
AlertBusinessTypeEnum
.
非警情确认
.
getCode
().
equals
(
type
))
{
pushMessageWebAndAppRo
.
setName
(
"消息"
);
pushMessageWebAndAppRo
.
setName
(
"消息"
);
pushMessageWebAndAppRo
.
setSendTime
(
smsParams
.
get
(
"callTimeStr"
));
pushMessageWebAndAppRo
.
setSendTime
(
smsParams
.
get
(
"callTimeStr"
));
pushMessageWebAndAppRo
.
setAddress
(
smsParams
.
get
(
"address"
));
pushMessageWebAndAppRo
.
setAddress
(
smsParams
.
get
(
"address"
));
pushMessageWebAndAppRo
.
setRuleType
(
"notAlert"
);
pushMessageWebAndAppRo
.
setRuleType
(
"notAlert"
);
}
}
if
(
AlertBusinessTypeEnum
.
警情续报
.
getCode
().
equals
(
type
))
{
if
(
AlertBusinessTypeEnum
.
警情续报
.
getCode
().
equals
(
type
))
{
pushMessageWebAndAppRo
.
setName
(
"消息"
);
pushMessageWebAndAppRo
.
setName
(
"消息"
);
pushMessageWebAndAppRo
.
setCompanyName
(
smsParams
.
get
(
"alertType"
));
pushMessageWebAndAppRo
.
setCompanyName
(
smsParams
.
get
(
"alertType"
));
pushMessageWebAndAppRo
.
setAddress
(
smsParams
.
get
(
"address"
));
pushMessageWebAndAppRo
.
setAddress
(
smsParams
.
get
(
"address"
));
...
@@ -1797,20 +1867,20 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
...
@@ -1797,20 +1867,20 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
pushMessageWebAndAppRo
.
setCasualtiesNum
(
smsParams
.
get
(
"casualtiesNum"
));
//伤亡人数
pushMessageWebAndAppRo
.
setCasualtiesNum
(
smsParams
.
get
(
"casualtiesNum"
));
//伤亡人数
pushMessageWebAndAppRo
.
setRuleType
(
"followReportAlert"
);
pushMessageWebAndAppRo
.
setRuleType
(
"followReportAlert"
);
}
}
if
(
AlertBusinessTypeEnum
.
力量调派
.
getCode
().
equals
(
type
))
{
if
(
AlertBusinessTypeEnum
.
力量调派
.
getCode
().
equals
(
type
))
{
//map.put("url", "powerInformationPage");
//map.put("url", "powerInformationPage");
pushMessageWebAndAppRo
.
setName
(
AlertBusinessTypeEnum
.
力量调派
.
getName
());
pushMessageWebAndAppRo
.
setName
(
AlertBusinessTypeEnum
.
力量调派
.
getName
());
pushMessageWebAndAppRo
.
setCompanyName
(
smsParams
.
get
(
"resourcesNum"
));
pushMessageWebAndAppRo
.
setCompanyName
(
smsParams
.
get
(
"resourcesNum"
));
pushMessageWebAndAppRo
.
setAddress
(
smsParams
.
get
(
"address"
));
pushMessageWebAndAppRo
.
setAddress
(
smsParams
.
get
(
"address"
));
pushMessageWebAndAppRo
.
setSendTime
(
smsParams
.
get
(
"callTimeStr"
));
pushMessageWebAndAppRo
.
setSendTime
(
smsParams
.
get
(
"callTimeStr"
));
if
(
StringUtils
.
isNotBlank
(
besidesMap
.
get
(
"transferLocation"
)))
{
if
(
StringUtils
.
isNotBlank
(
besidesMap
.
get
(
"transferLocation"
)))
{
pushMessageWebAndAppRo
.
setTransferLocation
(
besidesMap
.
get
(
"responseLevelString"
));
//响应级别
pushMessageWebAndAppRo
.
setTransferLocation
(
besidesMap
.
get
(
"responseLevelString"
));
//响应级别
pushMessageWebAndAppRo
.
setRuleType
(
"fullTime"
);
pushMessageWebAndAppRo
.
setRuleType
(
"fullTime"
);
}
else
{
}
else
{
pushMessageWebAndAppRo
.
setRuleType
(
"monitor"
);
pushMessageWebAndAppRo
.
setRuleType
(
"monitor"
);
}
}
}
}
if
(
AlertBusinessTypeEnum
.
警情初报
.
getCode
().
equals
(
type
))
{
if
(
AlertBusinessTypeEnum
.
警情初报
.
getCode
().
equals
(
type
))
{
pushMessageWebAndAppRo
.
setRuleType
(
"reportAlert"
);
pushMessageWebAndAppRo
.
setRuleType
(
"reportAlert"
);
pushMessageWebAndAppRo
.
setName
(
AlertBusinessTypeEnum
.
警情初报
.
getName
());
pushMessageWebAndAppRo
.
setName
(
AlertBusinessTypeEnum
.
警情初报
.
getName
());
pushMessageWebAndAppRo
.
setSendTime
(
besidesMap
.
get
(
"sendTime"
));
pushMessageWebAndAppRo
.
setSendTime
(
besidesMap
.
get
(
"sendTime"
));
...
@@ -1820,8 +1890,7 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
...
@@ -1820,8 +1890,7 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
pushMessageWebAndAppRo
.
setTrappedNum
(
smsParams
.
get
(
"trappedNum"
));
//被困人数
pushMessageWebAndAppRo
.
setTrappedNum
(
smsParams
.
get
(
"trappedNum"
));
//被困人数
pushMessageWebAndAppRo
.
setCasualtiesNum
(
smsParams
.
get
(
"casualtiesNum"
));
//伤亡人数
pushMessageWebAndAppRo
.
setCasualtiesNum
(
smsParams
.
get
(
"casualtiesNum"
));
//伤亡人数
}
}
pushMessageWebAndAppRo
.
setExtras
(
map
);
pushMessageWebAndAppRo
.
setExtras
(
map
);;
;
try
{
try
{
ruleTrigger
.
publish
(
pushMessageWebAndAppRo
,
"消息/addAlterMessageCheck"
,
new
String
[
0
]);
ruleTrigger
.
publish
(
pushMessageWebAndAppRo
,
"消息/addAlterMessageCheck"
,
new
String
[
0
]);
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-jcs-biz/src/main/java/com/yeejoin/amos/boot/module/jcs/biz/service/impl/PowerTransferServiceImpl.java
View file @
997d6888
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jcs
.
biz
.
service
.
impl
;
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jcs
.
biz
.
service
.
impl
;
import
java.util.*
;
import
java.util.stream.Collectors
;
import
com.yeejoin.amos.boot.biz.common.entity.BaseEntity
;
import
com.yeejoin.amos.boot.module.common.api.entity.DutyShift
;
import
com.yeejoin.amos.boot.module.common.api.mapper.DutyPersonShiftMapper
;
import
com.yeejoin.amos.boot.module.common.api.mapper.DutyShiftMapper
;
import
org.apache.commons.lang3.ObjectUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.eclipse.paho.client.mqttv3.MqttException
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.util.CollectionUtils
;
import
org.typroject.tyboot.component.emq.EmqKeeper
;
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.rdbms.service.BaseService
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
...
@@ -7,14 +30,10 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
...
@@ -7,14 +30,10 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.google.common.collect.Lists
;
import
com.google.common.collect.Lists
;
import
com.google.common.collect.Maps
;
import
com.google.common.collect.Maps
;
import
com.yeejoin.amos.boot.biz.common.entity.BaseEntity
;
import
com.yeejoin.amos.boot.biz.common.utils.DateUtils
;
import
com.yeejoin.amos.boot.biz.common.utils.DateUtils
;
import
com.yeejoin.amos.boot.module.common.api.dto.FireBrigadeResourceDto
;
import
com.yeejoin.amos.boot.module.common.api.dto.FireBrigadeResourceDto
;
import
com.yeejoin.amos.boot.module.common.api.entity.DutyShift
;
import
com.yeejoin.amos.boot.module.common.api.entity.FireTeam
;
import
com.yeejoin.amos.boot.module.common.api.entity.FireTeam
;
import
com.yeejoin.amos.boot.module.common.api.feign.EquipFeignClient
;
import
com.yeejoin.amos.boot.module.common.api.feign.EquipFeignClient
;
import
com.yeejoin.amos.boot.module.common.api.mapper.DutyPersonShiftMapper
;
import
com.yeejoin.amos.boot.module.common.api.mapper.DutyShiftMapper
;
import
com.yeejoin.amos.boot.module.common.api.mapper.DynamicFormInstanceMapper
;
import
com.yeejoin.amos.boot.module.common.api.mapper.DynamicFormInstanceMapper
;
import
com.yeejoin.amos.boot.module.common.biz.service.impl.DutyCarServiceImpl
;
import
com.yeejoin.amos.boot.module.common.biz.service.impl.DutyCarServiceImpl
;
import
com.yeejoin.amos.boot.module.common.biz.service.impl.FireTeamServiceImpl
;
import
com.yeejoin.amos.boot.module.common.biz.service.impl.FireTeamServiceImpl
;
...
@@ -27,24 +46,7 @@ import com.yeejoin.amos.boot.module.jcs.api.enums.FireCarStatusEnum;
...
@@ -27,24 +46,7 @@ import com.yeejoin.amos.boot.module.jcs.api.enums.FireCarStatusEnum;
import
com.yeejoin.amos.boot.module.jcs.api.mapper.PowerTransferMapper
;
import
com.yeejoin.amos.boot.module.jcs.api.mapper.PowerTransferMapper
;
import
com.yeejoin.amos.boot.module.jcs.api.service.IPowerTransferService
;
import
com.yeejoin.amos.boot.module.jcs.api.service.IPowerTransferService
;
import
com.yeejoin.amos.component.rule.config.RuleConfig
;
import
com.yeejoin.amos.component.rule.config.RuleConfig
;
import
org.apache.commons.lang3.ObjectUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.eclipse.paho.client.mqttv3.MqttException
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.util.CollectionUtils
;
import
org.typroject.tyboot.component.emq.EmqKeeper
;
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.rdbms.service.BaseService
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
java.util.*
;
import
java.util.stream.Collectors
;
/**
/**
* 力量调派 服务实现类
* 力量调派 服务实现类
...
@@ -517,10 +519,10 @@ public class PowerTransferServiceImpl extends BaseService<PowerTransferDto, Powe
...
@@ -517,10 +519,10 @@ public class PowerTransferServiceImpl extends BaseService<PowerTransferDto, Powe
responseLevel
=
list1
.
get
(
0
).
getFieldValue
();
responseLevel
=
list1
.
get
(
0
).
getFieldValue
();
}
}
definitions
.
put
(
"rescueGrid"
,
alertCalled
.
getAddress
());
definitions
.
put
(
"rescueGrid"
,
ValidationUtil
.
isEmpty
(
alertCalled
.
getAddress
()
)
?
""
:
alertCalled
.
getAddress
());
definitions
.
put
(
"type"
,
alertCalled
.
getAlertType
());
definitions
.
put
(
"type"
,
alertCalled
.
getAlertType
());
definitions
.
put
(
"contactUser"
,
alertCalled
.
getContactUser
());
definitions
.
put
(
"contactUser"
,
ValidationUtil
.
isEmpty
(
alertCalled
.
getContactUser
()
)
?
""
:
alertCalled
.
getContactUser
());
definitions
.
put
(
"contactPhone"
,
alertCalled
.
getContactPhone
());
definitions
.
put
(
"contactPhone"
,
ValidationUtil
.
isEmpty
(
alertCalled
.
getContactPhone
()
)
?
""
:
alertCalled
.
getContactPhone
());
definitions
.
put
(
"replaceContent"
,
replaceContent
);
definitions
.
put
(
"replaceContent"
,
replaceContent
);
definitions
.
put
(
"responseLevel"
,
responseLevel
);
definitions
.
put
(
"responseLevel"
,
responseLevel
);
definitions
.
put
(
"callTime"
,
definitions
.
put
(
"callTime"
,
...
@@ -839,13 +841,13 @@ public class PowerTransferServiceImpl extends BaseService<PowerTransferDto, Powe
...
@@ -839,13 +841,13 @@ public class PowerTransferServiceImpl extends BaseService<PowerTransferDto, Powe
double
agentCountAll
=
totalCarList
.
stream
().
mapToDouble
(
double
agentCountAll
=
totalCarList
.
stream
().
mapToDouble
(
car
->
car
.
get
(
"resourceList"
)
!=
null
?
((
List
<
Map
<
String
,
Object
>>)
car
.
get
(
"resourceList"
)).
stream
()
car
->
car
.
get
(
"resourceList"
)
!=
null
?
((
List
<
Map
<
String
,
Object
>>)
car
.
get
(
"resourceList"
)).
stream
()
.
filter
(
res
->
equipType
.
equals
(
res
.
get
(
"equipType"
)))
.
filter
(
res
->
equipType
.
equals
(
res
.
get
(
"equipType"
)))
.
mapToDouble
(
c
->
(
double
)
c
.
get
(
"equipCount"
)).
sum
()
:
0
)
.
mapToDouble
(
c
->
Double
.
parseDouble
(
ValidationUtil
.
isEmpty
(
c
.
get
(
"equipCount"
)
)
?
"0"
:
c
.
get
(
"equipCount"
).
toString
()
)).
sum
()
:
0
)
.
sum
();
.
sum
();
double
agentCountArrived
=
arrivedCarList
.
stream
().
mapToDouble
(
double
agentCountArrived
=
arrivedCarList
.
stream
().
mapToDouble
(
car
->
car
.
get
(
"resourceList"
)
!=
null
?
((
List
<
Map
<
String
,
Object
>>)
car
.
get
(
"resourceList"
)).
stream
()
car
->
car
.
get
(
"resourceList"
)
!=
null
?
((
List
<
Map
<
String
,
Object
>>)
car
.
get
(
"resourceList"
)).
stream
()
.
filter
(
res
->
equipType
.
equals
(
res
.
get
(
"equipType"
)))
.
filter
(
res
->
equipType
.
equals
(
res
.
get
(
"equipType"
)))
.
mapToDouble
(
c
->
(
double
)
c
.
get
(
"equipCount"
)).
sum
()
:
0
)
.
mapToDouble
(
c
->
Double
.
parseDouble
(
ValidationUtil
.
isEmpty
(
c
.
get
(
"equipCount"
)
)
?
"0"
:
c
.
get
(
"equipCount"
).
toString
()
)).
sum
()
:
0
)
.
sum
();
.
sum
();
JSONObject
jsonObject
=
new
JSONObject
();
JSONObject
jsonObject
=
new
JSONObject
();
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-latentdanger-biz/src/main/java/com/yeejoin/amos/latentdanger/business/feign/JcsFeignClient.java
View file @
997d6888
package
com
.
yeejoin
.
amos
.
latentdanger
.
business
.
feign
;
package
com
.
yeejoin
.
amos
.
latentdanger
.
business
.
feign
;
import
com.yeejoin.amos.boot.biz.common.feign.MultipartSupportConfig
;
import
com.yeejoin.amos.boot.biz.common.feign.MultipartSupportConfig
;
import
com.yeejoin.amos.boot.module.common.api.dto.CompanyPerson
;
import
com.yeejoin.amos.component.feign.model.FeignClientResult
;
import
com.yeejoin.amos.component.feign.model.FeignClientResult
;
import
com.yeejoin.amos.feign.privilege.model.AgencyUserModel
;
import
com.yeejoin.amos.feign.privilege.model.AgencyUserModel
;
import
org.springframework.cloud.openfeign.FeignClient
;
import
org.springframework.cloud.openfeign.FeignClient
;
...
@@ -10,6 +11,8 @@ import org.springframework.web.bind.annotation.RequestMapping;
...
@@ -10,6 +11,8 @@ import org.springframework.web.bind.annotation.RequestMapping;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
java.util.List
;
/**
/**
* 机场服务feign
* 机场服务feign
*
*
...
@@ -28,8 +31,15 @@ public interface JcsFeignClient {
...
@@ -28,8 +31,15 @@ public interface JcsFeignClient {
/**
/**
* 查询用户单位信息
* 查询用户单位信息
*
* @return ResponseModel<ReginParams.PersonIdentity>
* @return ResponseModel<ReginParams.PersonIdentity>
*/
*/
@GetMapping
(
value
=
"/org-usr/getLoginUserDetails"
)
@GetMapping
(
value
=
"/org-usr/getLoginUserDetails"
)
FeignClientResult
getJcsUser
();
FeignClientResult
getJcsUser
();
/**
* 根据id获取单位人员列表
*/
@GetMapping
(
value
=
"/company/{ids}/person"
)
FeignClientResult
<
List
<
CompanyPerson
>>
selectCompanyPerson
(
@PathVariable
List
<
Long
>
ids
);
}
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-latentdanger-biz/src/main/java/com/yeejoin/amos/latentdanger/business/service/impl/LatentDangerServiceImpl.java
View file @
997d6888
...
@@ -53,6 +53,7 @@ import com.yeejoin.amos.latentdanger.business.vo.DangerTimeAxisVo;
...
@@ -53,6 +53,7 @@ import com.yeejoin.amos.latentdanger.business.vo.DangerTimeAxisVo;
import
com.yeejoin.amos.latentdanger.business.vo.LatentDangerDetailRiskVo
;
import
com.yeejoin.amos.latentdanger.business.vo.LatentDangerDetailRiskVo
;
import
com.yeejoin.amos.latentdanger.business.vo.LatentDangerDetailVo
;
import
com.yeejoin.amos.latentdanger.business.vo.LatentDangerDetailVo
;
import
com.yeejoin.amos.latentdanger.business.vo.LatentDangerListVo
;
import
com.yeejoin.amos.latentdanger.business.vo.LatentDangerListVo
;
import
com.yeejoin.amos.latentdanger.common.enums.AuditEnum
;
import
com.yeejoin.amos.latentdanger.common.enums.DangerHandleStateEnum
;
import
com.yeejoin.amos.latentdanger.common.enums.DangerHandleStateEnum
;
import
com.yeejoin.amos.latentdanger.common.enums.DictTypeEnum
;
import
com.yeejoin.amos.latentdanger.common.enums.DictTypeEnum
;
import
com.yeejoin.amos.latentdanger.common.enums.ExecuteStateEnum
;
import
com.yeejoin.amos.latentdanger.common.enums.ExecuteStateEnum
;
...
@@ -97,17 +98,7 @@ import org.typroject.tyboot.core.rdbms.service.BaseService;
...
@@ -97,17 +98,7 @@ import org.typroject.tyboot.core.rdbms.service.BaseService;
import
org.typroject.tyboot.core.restful.utils.ResponseHelper
;
import
org.typroject.tyboot.core.restful.utils.ResponseHelper
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
java.util.ArrayList
;
import
java.util.*
;
import
java.util.Arrays
;
import
java.util.Collections
;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.HashSet
;
import
java.util.LinkedList
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Objects
;
import
java.util.Set
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
import
static
com
.
yeejoin
.
amos
.
latentdanger
.
business
.
util
.
RandomUtil
.
buildOrderNo
;
import
static
com
.
yeejoin
.
amos
.
latentdanger
.
business
.
util
.
RandomUtil
.
buildOrderNo
;
...
@@ -251,7 +242,8 @@ public class LatentDangerServiceImpl extends BaseService<LatentDangerBo, LatentD
...
@@ -251,7 +242,8 @@ public class LatentDangerServiceImpl extends BaseService<LatentDangerBo, LatentD
if
(
ValidationUtil
.
isEmpty
(
dangerTypeEnum
))
{
if
(
ValidationUtil
.
isEmpty
(
dangerTypeEnum
))
{
throw
new
Exception
(
"检查类型参数有误"
);
throw
new
Exception
(
"检查类型参数有误"
);
}
}
Date
endTime
=
this
.
GetTargetEndTime
(
param
.
getReformLimitDate
());
param
.
setReformLimitDate
(
endTime
);
// 保存隐患
// 保存隐患
LatentDanger
latentDanger
=
saveLatentDanger
(
param
,
userId
,
departmentId
,
businessKey
,
orgCode
,
LatentDanger
latentDanger
=
saveLatentDanger
(
param
,
userId
,
departmentId
,
businessKey
,
orgCode
,
dangerTypeEnum
);
dangerTypeEnum
);
...
@@ -326,6 +318,16 @@ public class LatentDangerServiceImpl extends BaseService<LatentDangerBo, LatentD
...
@@ -326,6 +318,16 @@ public class LatentDangerServiceImpl extends BaseService<LatentDangerBo, LatentD
// riskFactorMapper.updateControlStatus(riskFactorBo);
// riskFactorMapper.updateControlStatus(riskFactorBo);
// }
// }
public
static
Date
GetTargetEndTime
(
Date
target
)
{
Calendar
calendar
=
Calendar
.
getInstance
();
calendar
.
setTime
(
target
);
calendar
.
set
(
Calendar
.
HOUR_OF_DAY
,
23
);
calendar
.
set
(
Calendar
.
MINUTE
,
59
);
calendar
.
set
(
Calendar
.
SECOND
,
59
);
Date
end
=
calendar
.
getTime
();
return
end
;
}
// TODO 使用远程调用替换
// TODO 使用远程调用替换
private
void
updateCheckInputDangerState
(
Long
id
,
int
code
)
{
private
void
updateCheckInputDangerState
(
Long
id
,
int
code
)
{
latentDangerMapper
.
updateCheckInputDangerState
(
id
,
code
);
latentDangerMapper
.
updateCheckInputDangerState
(
id
,
code
);
...
@@ -369,18 +371,18 @@ public class LatentDangerServiceImpl extends BaseService<LatentDangerBo, LatentD
...
@@ -369,18 +371,18 @@ public class LatentDangerServiceImpl extends BaseService<LatentDangerBo, LatentD
Bean
.
copyExistPropertis
(
dangerDto
,
latentDanger
);
Bean
.
copyExistPropertis
(
dangerDto
,
latentDanger
);
if
(
ValidationUtil
.
isEmpty
(
dangerDto
.
getId
()))
{
if
(
ValidationUtil
.
isEmpty
(
dangerDto
.
getId
()))
{
// 新增
// 新增
latentDanger
.
setBusinessKey
(
businessKey
==
null
?
""
:
businessKey
);
latentDanger
.
setBusinessKey
(
businessKey
==
null
?
""
:
businessKey
);
latentDanger
.
setDiscovererDepartmentId
(
departmentId
==
null
?
""
:
departmentId
);
latentDanger
.
setDiscovererDepartmentId
(
departmentId
==
null
?
""
:
departmentId
);
latentDanger
.
setDiscovererUserId
(
userId
==
null
?
""
:
userId
);
latentDanger
.
setDiscovererUserId
(
userId
==
null
?
""
:
userId
);
latentDanger
.
setOrgCode
(
orgCode
==
null
?
""
:
orgCode
);
latentDanger
.
setOrgCode
(
orgCode
==
null
?
""
:
orgCode
);
latentDanger
.
setDangerType
(
dangerTypeEnum
.
getCode
()
==
null
?
""
:
dangerTypeEnum
.
getCode
());
latentDanger
.
setDangerType
(
dangerTypeEnum
.
getCode
()
==
null
?
""
:
dangerTypeEnum
.
getCode
());
latentDanger
.
setDangerTypeName
(
dangerTypeEnum
.
getName
()
==
null
?
""
:
dangerTypeEnum
.
getName
());
latentDanger
.
setDangerTypeName
(
dangerTypeEnum
.
getName
()
==
null
?
""
:
dangerTypeEnum
.
getName
());
if
(
LatentDangerBizTypeEnum
.
防火监督
.
getCode
().
equals
(
bizType
))
{
if
(
LatentDangerBizTypeEnum
.
防火监督
.
getCode
().
equals
(
bizType
))
{
latentDanger
.
setDangerState
(
LatentDangerState
.
SupervisionDangerStateEnum
.
提交隐患
.
getCode
()
==
null
?
""
:
LatentDangerState
.
SupervisionDangerStateEnum
.
提交隐患
.
getCode
()
);
latentDanger
.
setDangerState
(
LatentDangerState
.
SupervisionDangerStateEnum
.
提交隐患
.
getCode
()
==
null
?
""
:
LatentDangerState
.
SupervisionDangerStateEnum
.
提交隐患
.
getCode
()
);
latentDanger
.
setDangerStateName
(
LatentDangerState
.
SupervisionDangerStateEnum
.
提交隐患
.
getName
()
==
null
?
""
:
LatentDangerState
.
SupervisionDangerStateEnum
.
提交隐患
.
getName
());
latentDanger
.
setDangerStateName
(
LatentDangerState
.
SupervisionDangerStateEnum
.
提交隐患
.
getName
()
==
null
?
""
:
LatentDangerState
.
SupervisionDangerStateEnum
.
提交隐患
.
getName
());
}
else
if
(
LatentDangerBizTypeEnum
.
巡检
.
getCode
().
equals
(
bizType
))
{
}
else
if
(
LatentDangerBizTypeEnum
.
巡检
.
getCode
().
equals
(
bizType
))
{
latentDanger
.
setDangerState
(
LatentDangerState
.
PatrolDangerStateEnum
.
待评审
.
getCode
()
==
null
?
""
:
LatentDangerState
.
PatrolDangerStateEnum
.
待评审
.
getCode
());
latentDanger
.
setDangerState
(
LatentDangerState
.
PatrolDangerStateEnum
.
待评审
.
getCode
()
==
null
?
""
:
LatentDangerState
.
PatrolDangerStateEnum
.
待评审
.
getCode
());
latentDanger
.
setDangerStateName
(
LatentDangerState
.
PatrolDangerStateEnum
.
待评审
.
getName
()
==
null
?
""
:
LatentDangerState
.
PatrolDangerStateEnum
.
待评审
.
getName
()
);
latentDanger
.
setDangerStateName
(
LatentDangerState
.
PatrolDangerStateEnum
.
待评审
.
getName
()
==
null
?
""
:
LatentDangerState
.
PatrolDangerStateEnum
.
待评审
.
getName
()
);
}
}
if
(
ValidationUtil
.
isEmpty
(
dangerDto
.
getDangerName
()))
{
if
(
ValidationUtil
.
isEmpty
(
dangerDto
.
getDangerName
()))
{
latentDanger
.
setDangerName
(
dangerDto
.
getInputItemName
());
latentDanger
.
setDangerName
(
dangerDto
.
getInputItemName
());
...
@@ -403,13 +405,16 @@ public class LatentDangerServiceImpl extends BaseService<LatentDangerBo, LatentD
...
@@ -403,13 +405,16 @@ public class LatentDangerServiceImpl extends BaseService<LatentDangerBo, LatentD
record
.
setExecuteUserName
(
userName
);
record
.
setExecuteUserName
(
userName
);
record
.
setExecuteDepartmentId
(
departmentId
);
record
.
setExecuteDepartmentId
(
departmentId
);
record
.
setExecuteDepartmentName
(
departmentName
);
record
.
setExecuteDepartmentName
(
departmentName
);
record
.
setFlowJson
(
flowJson
!=
null
?
flowJson
.
toJSONString
()
:
null
);
record
.
setFlowTaskName
(
taskName
);
record
.
setFlowTaskName
(
taskName
);
record
.
setDangerId
(
dangerId
);
record
.
setDangerId
(
dangerId
);
record
.
setExecuteState
(
executeState
);
record
.
setExecuteState
(
executeState
);
record
.
setExecuteResult
(
executeResult
);
record
.
setExecuteResult
(
executeResult
);
record
.
setActionFlag
(
dangerState
);
record
.
setActionFlag
(
dangerState
);
record
.
setRemark
(
remark
);
record
.
setRemark
(
remark
);
if
(!
ValidationUtil
.
isEmpty
(
flowJson
))
{
record
.
setFlowJson
(
flowJson
.
toJSONString
());
record
.
setRemark
(
ValidationUtil
.
isEmpty
(
remark
)
?
flowJson
.
getString
(
"remark"
)
:
remark
);
}
record
.
setUpdateDate
(
new
Date
());
record
.
setUpdateDate
(
new
Date
());
latentDangerFlowRecordService
.
saveOrUpdate
(
record
);
latentDangerFlowRecordService
.
saveOrUpdate
(
record
);
return
record
;
return
record
;
...
@@ -1148,13 +1153,14 @@ public class LatentDangerServiceImpl extends BaseService<LatentDangerBo, LatentD
...
@@ -1148,13 +1153,14 @@ public class LatentDangerServiceImpl extends BaseService<LatentDangerBo, LatentD
ReginParams
reginParams
)
throws
Exception
{
ReginParams
reginParams
)
throws
Exception
{
// 隐患的巡查信息
// 隐患的巡查信息
JSONObject
bizInfo
=
latentDanger
.
getBizInfo
();
JSONObject
bizInfo
=
latentDanger
.
getBizInfo
();
if
(
ValidationUtil
.
isEmpty
(
bizInfo
)
||
ValidationUtil
.
isEmpty
(
bizInfo
.
get
(
"planType"
))
||
ValidationUtil
.
isEmpty
(
bizInfo
.
get
(
"
accompanyingUser
Id"
)))
{
if
(
ValidationUtil
.
isEmpty
(
bizInfo
)
||
ValidationUtil
.
isEmpty
(
bizInfo
.
get
(
"planType"
))
||
ValidationUtil
.
isEmpty
(
bizInfo
.
get
(
"
leadPeople
Id"
)))
{
executeSubmitDto
.
setIsOk
(
false
);
executeSubmitDto
.
setIsOk
(
false
);
executeSubmitDto
.
setMsg
(
"业务信息错误"
);
executeSubmitDto
.
setMsg
(
"业务信息错误"
);
return
executeSubmitDto
;
return
executeSubmitDto
;
}
}
String
planType
=
bizInfo
.
get
(
"planType"
).
toString
();
String
planType
=
bizInfo
.
get
(
"planType"
).
toString
();
AgencyUserModel
userModel
=
jcsFeignClient
.
getAmosIdByUserId
((
String
)
bizInfo
.
get
(
"accompanyingUserId"
)).
getResult
();
// 获取检查组长
AgencyUserModel
userModel
=
jcsFeignClient
.
getAmosIdByUserId
((
String
)
bizInfo
.
get
(
"leadPeopleId"
)).
getResult
();
if
(
ValidationUtil
.
isEmpty
(
userModel
))
{
if
(
ValidationUtil
.
isEmpty
(
userModel
))
{
executeSubmitDto
.
setIsOk
(
false
);
executeSubmitDto
.
setIsOk
(
false
);
executeSubmitDto
.
setMsg
(
"业务信息错误"
);
executeSubmitDto
.
setMsg
(
"业务信息错误"
);
...
@@ -1264,6 +1270,20 @@ public class LatentDangerServiceImpl extends BaseService<LatentDangerBo, LatentD
...
@@ -1264,6 +1270,20 @@ public class LatentDangerServiceImpl extends BaseService<LatentDangerBo, LatentD
return
executeSubmitDto
;
return
executeSubmitDto
;
}
}
// 当隐患当前节点状态是现场确认,在执行完节点后需要将检查组长设置为下个节点执行人
if
(
LatentDangerState
.
SupervisionDangerStateEnum
.
现场确认
.
getCode
().
equals
(
latentDanger
.
getDangerState
())
&&
!
ValidationUtil
.
isEmpty
(
latentDanger
.
getInstanceId
())
&&
ExecuteTypeEnum
.
驳回
.
getCode
().
equals
(
preRecord
.
getExecuteState
()))
{
// 在检查组长驳回后再现场确认需要将检查组长id设置为下个节点执行人
Object
resultObj
=
workflowExecuteService
.
setTaskAssign
(
latentDanger
.
getInstanceId
(),
checkLeaderId
);
executeSubmitDto
.
setCheckLeaderId
(
userModel
.
getUserId
());
if
(!(
Boolean
)
resultObj
)
{
executeSubmitDto
.
setIsOk
(
false
);
executeSubmitDto
.
setMsg
(
"设置节点执行人失败"
);
return
executeSubmitDto
;
}
}
String
nextState
=
""
;
String
nextState
=
""
;
String
nextStateName
=
""
;
String
nextStateName
=
""
;
if
(
ExecuteTypeEnum
.
通过
.
getCode
().
equals
(
param
.
getExecuteType
()))
{
if
(
ExecuteTypeEnum
.
通过
.
getCode
().
equals
(
param
.
getExecuteType
()))
{
...
@@ -1292,18 +1312,32 @@ public class LatentDangerServiceImpl extends BaseService<LatentDangerBo, LatentD
...
@@ -1292,18 +1312,32 @@ public class LatentDangerServiceImpl extends BaseService<LatentDangerBo, LatentD
nextStateName
=
LatentDangerState
.
SupervisionDangerStateEnum
.
整改完毕
.
getName
();
nextStateName
=
LatentDangerState
.
SupervisionDangerStateEnum
.
整改完毕
.
getName
();
}
}
executeResultMsg
=
currentStateEnum
.
getName
()
+
ExecuteTypeEnum
.
通过
.
getName
();
executeResultMsg
=
currentStateEnum
.
getName
()
+
ExecuteTypeEnum
.
通过
.
getName
();
}
else
{
}
else
{
// 审核驳回
LatentDangerState
.
SupervisionDangerStateEnum
nextStateEnum
=
LatentDangerState
.
SupervisionDangerStateEnum
nextStateEnum
=
LatentDangerState
.
SupervisionDangerStateEnum
.
getEnumByCode
(
currentStateEnum
.
getRejectNext
());
LatentDangerState
.
SupervisionDangerStateEnum
.
getEnumByCode
(
currentStateEnum
.
getRejectNext
());
nextState
=
nextStateEnum
.
getCode
();
nextState
=
nextStateEnum
.
getCode
();
nextStateName
=
nextStateEnum
.
getName
();
nextStateName
=
nextStateEnum
.
getName
();
executeResultMsg
=
currentStateEnum
.
getName
()
+
ExecuteTypeEnum
.
驳回
.
getName
();
executeResultMsg
=
currentStateEnum
.
getName
()
+
ExecuteTypeEnum
.
驳回
.
getName
();
// 驳回到提交整改资料节点需重新设置工作流节点执行人为整改责任人
if
(
nextStateEnum
==
LatentDangerState
.
SupervisionDangerStateEnum
.
提交整改资料
)
{
JSONObject
reformJson
=
latentDanger
.
getReformJson
();
AgencyUserModel
checkLeader
=
jcsFeignClient
.
getAmosIdByUserId
((
String
)
reformJson
.
get
(
"reformLeaderId"
)).
getResult
();
Object
result
=
workflowExecuteService
.
setTaskAssign
(
processInstanceId
,
checkLeader
.
getUserName
());
if
(!(
Boolean
)
result
)
{
executeSubmitDto
.
setIsOk
(
false
);
executeResultMsg
=
"设置节点执行人失败"
;
executeSubmitDto
.
setMsg
(
executeResultMsg
);
return
executeSubmitDto
;
}
}
}
}
latentDanger
.
setDangerState
(
nextState
);
latentDanger
.
setDangerState
(
nextState
);
latentDanger
.
setDangerStateName
(
nextStateName
);
latentDanger
.
setDangerStateName
(
nextStateName
);
// 当隐患状态当前节点是整改任务分配时,在执行完节点后需要将整改分配责任人设置为下个节点执行人
// 当隐患状态当前节点是整改任务分配时,在执行完节点后需要将整改分配责任人设置为下个节点执行人
//
TODO
整改责任人需要保存(如果下一步审核驳回,需要能获取到这个指定的整改责任人)
// 整改责任人需要保存(如果下一步审核驳回,需要能获取到这个指定的整改责任人)
if
(
LatentDangerState
.
SupervisionDangerStateEnum
.
整改任务分配
.
getCode
().
equals
(
currentStateEnum
.
getCode
()))
{
if
(
LatentDangerState
.
SupervisionDangerStateEnum
.
整改任务分配
.
getCode
().
equals
(
currentStateEnum
.
getCode
()))
{
if
(
ValidationUtil
.
isEmpty
(
param
.
getReformLeaderId
()))
{
if
(
ValidationUtil
.
isEmpty
(
param
.
getReformLeaderId
()))
{
executeSubmitDto
.
setIsOk
(
false
);
executeSubmitDto
.
setIsOk
(
false
);
...
@@ -1854,13 +1888,15 @@ public class LatentDangerServiceImpl extends BaseService<LatentDangerBo, LatentD
...
@@ -1854,13 +1888,15 @@ public class LatentDangerServiceImpl extends BaseService<LatentDangerBo, LatentD
dangerIdList
=
Lists
.
newArrayList
(
idsStr
.
split
(
","
));
dangerIdList
=
Lists
.
newArrayList
(
idsStr
.
split
(
","
));
}
}
if
(
OwerEnum
.
MY
.
getCode
().
equals
(
pageParam
.
get
(
"my"
)))
{
if
(
OwerEnum
.
MY
.
getCode
().
equals
(
pageParam
.
get
(
"my"
)))
{
//
不指定隐患id-我
的任务
//
查询工作流待登录人执行
的任务
JSONObject
allTaskResult
=
workflowFeignService
.
getCurrentUserAllTaskList
(
workflowProcessDefinitionKey
);
JSONObject
allTaskResult
=
workflowFeignService
.
getCurrentUserAllTaskList
(
workflowProcessDefinitionKey
);
allTaskList
=
(
List
)
allTaskResult
.
get
(
"data"
);
allTaskList
=
(
List
)
allTaskResult
.
get
(
"data"
);
// 待执行任务对应instanceId列表
List
<
String
>
instanceIdList
=
Lists
.
newArrayList
();
List
<
String
>
instanceIdList
=
Lists
.
newArrayList
();
List
<
LatentDanger
>
dangers
;
List
<
LatentDanger
>
dangers
;
if
(!
ValidationUtil
.
isEmpty
(
allTaskList
))
{
if
(!
ValidationUtil
.
isEmpty
(
allTaskList
))
{
allTaskList
.
forEach
(
m
->
instanceIdList
.
add
(((
Map
)
m
).
get
(
"processInstanceId"
).
toString
()));
allTaskList
.
forEach
(
m
->
instanceIdList
.
add
(((
Map
)
m
).
get
(
"processInstanceId"
).
toString
()));
// 查询对应instanceId的隐患数据
dangers
=
dangers
=
this
.
baseMapper
.
selectList
(
new
LambdaQueryWrapper
<
LatentDanger
>().
in
(
LatentDanger:
:
getInstanceId
,
instanceIdList
));
this
.
baseMapper
.
selectList
(
new
LambdaQueryWrapper
<
LatentDanger
>().
in
(
LatentDanger:
:
getInstanceId
,
instanceIdList
));
List
<
String
>
finalDangerIdList
=
dangerIdList
;
List
<
String
>
finalDangerIdList
=
dangerIdList
;
...
@@ -1875,6 +1911,10 @@ public class LatentDangerServiceImpl extends BaseService<LatentDangerBo, LatentD
...
@@ -1875,6 +1911,10 @@ public class LatentDangerServiceImpl extends BaseService<LatentDangerBo, LatentD
pageParam
.
put
(
"dangerState"
,
LatentDangerState
.
PatrolDangerStateEnum
.
待评审
.
getCode
());
pageParam
.
put
(
"dangerState"
,
LatentDangerState
.
PatrolDangerStateEnum
.
待评审
.
getCode
());
}
}
}
}
// app待审核隐患须加上“提交隐患”状态的数据
if
(
AuditEnum
.
AUDIT
.
getCode
().
equals
(
pageParam
.
get
(
"type"
)))
{
pageParam
.
put
(
"submitDangerState"
,
LatentDangerState
.
SupervisionDangerStateEnum
.
提交隐患
.
getCode
());
}
}
}
// 获取隐患地点的子节点
// 获取隐患地点的子节点
Object
structureId
=
pageParam
.
get
(
"structureId"
);
Object
structureId
=
pageParam
.
get
(
"structureId"
);
...
@@ -2166,7 +2206,11 @@ public class LatentDangerServiceImpl extends BaseService<LatentDangerBo, LatentD
...
@@ -2166,7 +2206,11 @@ public class LatentDangerServiceImpl extends BaseService<LatentDangerBo, LatentD
throw
new
Exception
(
"隐患不存"
);
throw
new
Exception
(
"隐患不存"
);
}
}
latentDangerDto
.
setDangerPosition
(
null
);
latentDangerDto
.
setDangerPosition
(
null
);
Bean
.
copyExistPropertis
(
latentDangerDto
,
latentDanger
);
//以下方法存在bug会将数值类型的默认值0拷贝到对象上造成数据覆盖
//Bean.copyExistPropertis(latentDangerDto, latentDanger);
latentDanger
.
setId
(
latentDangerDto
.
getId
());
latentDanger
.
setFlowJson
(
latentDangerDto
.
getFlowJson
());
if
(!
ValidationUtil
.
isEmpty
(
latentDangerDto
.
getPhotoUrl
()))
{
if
(!
ValidationUtil
.
isEmpty
(
latentDangerDto
.
getPhotoUrl
()))
{
latentDanger
.
setPhotoUrls
(
Joiner
.
on
(
","
).
join
(
latentDangerDto
.
getPhotoUrl
()));
latentDanger
.
setPhotoUrls
(
Joiner
.
on
(
","
).
join
(
latentDangerDto
.
getPhotoUrl
()));
}
}
...
@@ -2199,7 +2243,7 @@ public class LatentDangerServiceImpl extends BaseService<LatentDangerBo, LatentD
...
@@ -2199,7 +2243,7 @@ public class LatentDangerServiceImpl extends BaseService<LatentDangerBo, LatentD
@Override
@Override
public
IPage
<
LatentDanger
>
reviewListDanger
(
PageParam
pageParam
)
throws
Exception
{
public
IPage
<
LatentDanger
>
reviewListDanger
(
PageParam
pageParam
)
throws
Exception
{
String
type
=
pageParam
.
get
(
"type"
).
toString
();
String
type
=
pageParam
.
get
(
"type"
).
toString
();
if
(
"audit"
.
equals
(
type
))
{
if
(
AuditEnum
.
AUDIT
.
getCode
()
.
equals
(
type
))
{
List
<
LatentDangerState
.
SupervisionDangerStateEnum
>
stateEnums
=
List
<
LatentDangerState
.
SupervisionDangerStateEnum
>
stateEnums
=
LatentDangerState
.
SupervisionDangerStateEnum
.
getEnumListByProcessState
(
LatentDangerProcessStateEnum
.
待审核
.
getCode
());
LatentDangerState
.
SupervisionDangerStateEnum
.
getEnumListByProcessState
(
LatentDangerProcessStateEnum
.
待审核
.
getCode
());
List
<
String
>
dangerState
=
stateEnums
.
stream
().
map
(
stateEnum
->
stateEnum
!=
null
?
List
<
String
>
dangerState
=
stateEnums
.
stream
().
map
(
stateEnum
->
stateEnum
!=
null
?
...
@@ -2207,7 +2251,7 @@ public class LatentDangerServiceImpl extends BaseService<LatentDangerBo, LatentD
...
@@ -2207,7 +2251,7 @@ public class LatentDangerServiceImpl extends BaseService<LatentDangerBo, LatentD
dangerState
.
add
(
LatentDangerState
.
SupervisionDangerStateEnum
.
提交隐患
.
getCode
());
dangerState
.
add
(
LatentDangerState
.
SupervisionDangerStateEnum
.
提交隐患
.
getCode
());
// 审核状态
// 审核状态
pageParam
.
put
(
"dangerState"
,
Joiner
.
on
(
","
).
join
(
dangerState
));
pageParam
.
put
(
"dangerState"
,
Joiner
.
on
(
","
).
join
(
dangerState
));
}
else
if
(
"review"
.
equals
(
type
))
{
}
else
if
(
AuditEnum
.
REVIEW
.
getCode
()
.
equals
(
type
))
{
List
<
LatentDangerState
.
SupervisionDangerStateEnum
>
stateEnums
=
List
<
LatentDangerState
.
SupervisionDangerStateEnum
>
stateEnums
=
LatentDangerState
.
SupervisionDangerStateEnum
.
getEnumListByProcessState
(
LatentDangerProcessStateEnum
.
待复核
.
getCode
());
LatentDangerState
.
SupervisionDangerStateEnum
.
getEnumListByProcessState
(
LatentDangerProcessStateEnum
.
待复核
.
getCode
());
List
<
String
>
dangerState
=
stateEnums
.
stream
().
map
(
stateEnum
->
stateEnum
!=
null
?
stateEnum
.
getCode
()
:
null
).
collect
(
Collectors
.
toList
());
List
<
String
>
dangerState
=
stateEnums
.
stream
().
map
(
stateEnum
->
stateEnum
!=
null
?
stateEnum
.
getCode
()
:
null
).
collect
(
Collectors
.
toList
());
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-latentdanger-biz/src/main/java/com/yeejoin/amos/latentdanger/business/service/impl/RuleDangerService.java
View file @
997d6888
package
com
.
yeejoin
.
amos
.
latentdanger
.
business
.
service
.
impl
;
package
com
.
yeejoin
.
amos
.
latentdanger
.
business
.
service
.
impl
;
import
com.google.common.collect.Sets
;
import
com.yeejoin.amos.boot.biz.common.constants.RuleConstant
;
import
com.yeejoin.amos.boot.biz.common.constants.RuleConstant
;
import
com.yeejoin.amos.boot.module.common.api.dto.CompanyPerson
;
import
com.yeejoin.amos.boot.module.common.api.dto.OrgUsrDto
;
import
com.yeejoin.amos.component.feign.model.FeignClientResult
;
import
com.yeejoin.amos.component.rule.RuleTrigger
;
import
com.yeejoin.amos.component.rule.RuleTrigger
;
import
com.yeejoin.amos.feign.privilege.Privilege
;
import
com.yeejoin.amos.feign.privilege.Privilege
;
import
com.yeejoin.amos.feign.privilege.model.AgencyUserModel
;
import
com.yeejoin.amos.feign.privilege.model.AgencyUserModel
;
import
com.yeejoin.amos.feign.privilege.model.CompanyModel
;
import
com.yeejoin.amos.feign.privilege.model.RoleModel
;
import
com.yeejoin.amos.feign.privilege.model.RoleModel
;
import
com.yeejoin.amos.latentdanger.business.dto.LatentDangerRo
;
import
com.yeejoin.amos.latentdanger.business.dto.LatentDangerRo
;
import
com.yeejoin.amos.latentdanger.business.feign.JcsFeignClient
;
import
com.yeejoin.amos.latentdanger.business.util.DateUtil
;
import
com.yeejoin.amos.latentdanger.business.util.DateUtil
;
import
com.yeejoin.amos.latentdanger.common.enums.LatentDangerState
;
import
com.yeejoin.amos.latentdanger.common.enums.LatentDangerState
;
import
com.yeejoin.amos.latentdanger.dao.entity.LatentDanger
;
import
com.yeejoin.amos.latentdanger.dao.entity.LatentDanger
;
...
@@ -14,11 +20,11 @@ import org.springframework.beans.factory.annotation.Autowired;
...
@@ -14,11 +20,11 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.typroject.tyboot.core.foundation.utils.ValidationUtil
;
import
org.typroject.tyboot.core.foundation.utils.ValidationUtil
;
import
java.util.Date
;
import
java.util.*
;
import
java.util.HashMap
;
import
java.util.function.Consumer
;
import
java.util.List
;
import
java.util.function.Predicate
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
import
java.util.stream.Stream
;
/**
/**
* @Author: xl
* @Author: xl
...
@@ -33,6 +39,8 @@ public class RuleDangerService {
...
@@ -33,6 +39,8 @@ public class RuleDangerService {
@Autowired
@Autowired
private
RuleTrigger
ruleTrigger
;
private
RuleTrigger
ruleTrigger
;
@Autowired
private
JcsFeignClient
jcsFeignClient
;
public
Boolean
addLatentDangerRule
(
LatentDanger
latentDanger
,
String
ruleType
,
String
roleName
)
throws
Exception
{
public
Boolean
addLatentDangerRule
(
LatentDanger
latentDanger
,
String
ruleType
,
String
roleName
)
throws
Exception
{
LatentDangerRo
latentDangerRo
=
buildLatentDangerRo
(
latentDanger
,
ruleType
);
LatentDangerRo
latentDangerRo
=
buildLatentDangerRo
(
latentDanger
,
ruleType
);
...
@@ -40,7 +48,27 @@ public class RuleDangerService {
...
@@ -40,7 +48,27 @@ public class RuleDangerService {
List
<
RoleModel
>
result
=
Privilege
.
roleClient
.
queryRoleList
(
roleName
,
null
).
getResult
();
List
<
RoleModel
>
result
=
Privilege
.
roleClient
.
queryRoleList
(
roleName
,
null
).
getResult
();
if
(
result
.
size
()
>
0
)
{
if
(
result
.
size
()
>
0
)
{
List
<
AgencyUserModel
>
userModels
=
Privilege
.
agencyUserClient
.
queryByRoleId
(
String
.
valueOf
(
result
.
get
(
0
).
getSequenceNbr
()),
null
).
getResult
();
List
<
AgencyUserModel
>
userModels
=
Privilege
.
agencyUserClient
.
queryByRoleId
(
String
.
valueOf
(
result
.
get
(
0
).
getSequenceNbr
()),
null
).
getResult
();
List
<
String
>
userIds
=
userModels
.
stream
().
map
(
AgencyUserModel:
:
getUserId
).
collect
(
Collectors
.
toList
());
//只发送给本部门的人员
Long
pointId
=
latentDanger
.
getBizInfo
().
getLong
(
"pointId"
);
if
(
pointId
==
null
||
pointId
==
0
)
{
return
false
;
}
FeignClientResult
<
List
<
CompanyPerson
>>
companyPersons
=
jcsFeignClient
.
selectCompanyPerson
(
Collections
.
singletonList
(
pointId
));
if
(
companyPersons
.
getStatus
()
!=
200
)
{
return
false
;
}
//本部门的人员列表
List
<
CompanyPerson
>
personList
=
companyPersons
.
getResult
();
List
<
OrgUsrDto
>
OrgUsrDtos
=
new
ArrayList
<>();
personList
.
forEach
(
companyPerson
->
OrgUsrDtos
.
addAll
(
companyPerson
.
getPersons
()));
//角色人员列表与本部门的人员列表取交集
List
<
AgencyUserModel
>
userModelList
=
userModels
.
stream
().
filter
(
agencyUserModel
->
OrgUsrDtos
.
stream
().
anyMatch
(
orgUsrDto
->
agencyUserModel
.
getUserId
().
equals
(
orgUsrDto
.
getAmosOrgId
())
)
).
collect
(
Collectors
.
toList
());
List
<
String
>
userIds
=
userModelList
.
stream
().
map
(
AgencyUserModel:
:
getUserId
).
collect
(
Collectors
.
toList
());
latentDangerRo
.
setRecivers
(
userIds
);
latentDangerRo
.
setRecivers
(
userIds
);
}
}
//触发规则
//触发规则
...
@@ -64,7 +92,7 @@ public class RuleDangerService {
...
@@ -64,7 +92,7 @@ public class RuleDangerService {
return
true
;
return
true
;
}
}
private
LatentDangerRo
buildLatentDangerRo
(
LatentDanger
latentDanger
,
String
ruleType
)
{
private
LatentDangerRo
buildLatentDangerRo
(
LatentDanger
latentDanger
,
String
ruleType
)
{
LatentDangerRo
latentDangerRo
=
new
LatentDangerRo
();
LatentDangerRo
latentDangerRo
=
new
LatentDangerRo
();
BeanUtils
.
copyProperties
(
latentDanger
,
latentDangerRo
);
BeanUtils
.
copyProperties
(
latentDanger
,
latentDangerRo
);
latentDangerRo
.
setMsgType
(
msgType
);
latentDangerRo
.
setMsgType
(
msgType
);
...
@@ -86,7 +114,7 @@ public class RuleDangerService {
...
@@ -86,7 +114,7 @@ public class RuleDangerService {
}
}
}
}
if
(!
ValidationUtil
.
isEmpty
(
type
)){
if
(!
ValidationUtil
.
isEmpty
(
type
))
{
Map
<
String
,
String
>
map
=
new
HashMap
<>();
Map
<
String
,
String
>
map
=
new
HashMap
<>();
map
.
put
(
"type"
,
type
);
map
.
put
(
"type"
,
type
);
map
.
put
(
"id"
,
String
.
valueOf
(
latentDanger
.
getId
()));
map
.
put
(
"id"
,
String
.
valueOf
(
latentDanger
.
getId
()));
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-supervision-biz/src/main/java/com/yeejoin/amos/supervision/business/controller/CheckController.java
View file @
997d6888
...
@@ -586,4 +586,16 @@ public class CheckController extends AbstractBaseController {
...
@@ -586,4 +586,16 @@ public class CheckController extends AbstractBaseController {
return
CommonResponseUtil
.
success
(
page
);
return
CommonResponseUtil
.
success
(
page
);
}
}
/**
* 根据检查记录查询照片
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"根据检查记录查询照片"
,
notes
=
"根据检查记录查询照片"
)
@RequestMapping
(
value
=
"/getPictureByCheckId"
,
method
=
RequestMethod
.
GET
)
public
CommonResponse
getPictureByCheckId
(
@ApiParam
(
value
=
"检查记录ID"
)
@RequestParam
String
checkId
,
@ApiParam
(
value
=
"检查项ID"
)
@RequestParam
String
id
)
{
List
<
String
>
pictures
=
checkService
.
getPictureByCheckId
(
checkId
,
id
);
return
CommonResponseUtil
.
success
(
pictures
);
}
}
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-supervision-biz/src/main/java/com/yeejoin/amos/supervision/business/dao/mapper/CheckMapper.java
View file @
997d6888
...
@@ -8,6 +8,7 @@ import com.yeejoin.amos.supervision.business.vo.CheckInfoVo;
...
@@ -8,6 +8,7 @@ import com.yeejoin.amos.supervision.business.vo.CheckInfoVo;
import
com.yeejoin.amos.supervision.business.vo.CheckVo
;
import
com.yeejoin.amos.supervision.business.vo.CheckVo
;
import
com.yeejoin.amos.supervision.core.common.response.PointCheckInfoBusinessRespone
;
import
com.yeejoin.amos.supervision.core.common.response.PointCheckInfoBusinessRespone
;
import
com.yeejoin.amos.supervision.core.common.response.PointCheckInfoRespone
;
import
com.yeejoin.amos.supervision.core.common.response.PointCheckInfoRespone
;
import
com.yeejoin.amos.supervision.dao.entity.Check
;
import
org.apache.ibatis.annotations.Param
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.HashMap
;
import
java.util.HashMap
;
...
@@ -295,4 +296,14 @@ public interface CheckMapper extends BaseMapper {
...
@@ -295,4 +296,14 @@ public interface CheckMapper extends BaseMapper {
long
queryPageCount
(
CheckPageParam
param
);
long
queryPageCount
(
CheckPageParam
param
);
List
<
CheckVo
>
queryPage
(
CheckPageParam
param
);
List
<
CheckVo
>
queryPage
(
CheckPageParam
param
);
/**
* 根据任务id获取相关检查记录
*
* @param id
* @return
*/
List
<
Check
>
getCheckListByTaskId
(
@Param
(
value
=
"planTaskId"
)
long
id
);
List
<
String
>
getPictureByCheckId
(
String
checkId
,
String
id
);
}
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-supervision-biz/src/main/java/com/yeejoin/amos/supervision/business/feign/JCSFeignClient.java
View file @
997d6888
package
com
.
yeejoin
.
amos
.
supervision
.
business
.
feign
;
package
com
.
yeejoin
.
amos
.
supervision
.
business
.
feign
;
import
com.yeejoin.amos.component.feign.model.FeignClientResult
;
import
com.yeejoin.amos.component.feign.model.FeignClientResult
;
import
com.yeejoin.amos.supervision.business.dto.OrgUsrFormDto
;
import
org.springframework.cloud.openfeign.FeignClient
;
import
org.springframework.cloud.openfeign.FeignClient
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.*
;
...
@@ -54,4 +55,13 @@ public interface JCSFeignClient {
...
@@ -54,4 +55,13 @@ public interface JCSFeignClient {
*/
*/
@RequestMapping
(
value
=
"jcs/org-usr/getUnit/{id}"
,
method
=
RequestMethod
.
GET
)
@RequestMapping
(
value
=
"jcs/org-usr/getUnit/{id}"
,
method
=
RequestMethod
.
GET
)
FeignClientResult
<
Map
<
String
,
Object
>>
getCompanyById
(
@PathVariable
(
"id"
)
String
companyId
);
FeignClientResult
<
Map
<
String
,
Object
>>
getCompanyById
(
@PathVariable
(
"id"
)
String
companyId
);
/**
* 根据机场单位id获取单位人员列表
*
* @param companyId 机场单位id
* @return
*/
@RequestMapping
(
value
=
"jcs/org-usr/{companyId}/person/list"
,
method
=
RequestMethod
.
GET
)
FeignClientResult
<
List
<
OrgUsrFormDto
>>
getPersonListByCompanyId
(
@PathVariable
(
"companyId"
)
String
companyId
);
}
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-supervision-biz/src/main/java/com/yeejoin/amos/supervision/business/service/impl/CheckReportServiceImpl.java
View file @
997d6888
...
@@ -41,17 +41,18 @@ import org.springframework.beans.BeanUtils;
...
@@ -41,17 +41,18 @@ import org.springframework.beans.BeanUtils;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.util.CollectionUtils
;
import
org.typroject.tyboot.core.foundation.utils.ValidationUtil
;
import
org.typroject.tyboot.core.foundation.utils.ValidationUtil
;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
import
javax.servlet.http.HttpServletResponse
;
import
javax.servlet.http.HttpServletResponse
;
import
java.io.*
;
import
java.io.BufferedOutputStream
;
import
java.io.IOException
;
import
java.io.InputStream
;
import
java.io.OutputStream
;
import
java.io.UnsupportedEncodingException
;
import
java.net.URLEncoder
;
import
java.net.URLEncoder
;
import
java.text.ParseException
;
import
java.text.ParseException
;
import
java.util.Arrays
;
import
java.util.Arrays
;
import
java.util.Collection
;
import
java.util.Collections
;
import
java.util.Date
;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.List
;
...
@@ -160,17 +161,26 @@ public class CheckReportServiceImpl extends BaseService<CheckReportDto, CheckRep
...
@@ -160,17 +161,26 @@ public class CheckReportServiceImpl extends BaseService<CheckReportDto, CheckRep
// 获取隐患信息
// 获取隐患信息
Map
<
String
,
String
>
dangerParamMap
=
Maps
.
newHashMap
();
Map
<
String
,
String
>
dangerParamMap
=
Maps
.
newHashMap
();
// 本次隐患id
// 本次隐患id
List
<
String
>
dangerIdList
=
Arrays
.
asList
(
checkReportDto
.
getDangerIds
().
split
(
","
));
List
<
String
>
dangerIdList
=
Lists
.
newArrayList
();
if
(!
ValidationUtil
.
isEmpty
(
checkReportDto
.
getDangerIds
()))
{
dangerIdList
=
Arrays
.
asList
(
checkReportDto
.
getDangerIds
().
split
(
","
));
}
// 复核隐患id
// 复核隐患id
List
<
String
>
reviewDangerIdList
=
Arrays
.
asList
(
checkReportDto
.
getReviewDangerIds
().
split
(
","
));
List
<
String
>
reviewDangerIdList
=
Lists
.
newArrayList
();
if
(!
ValidationUtil
.
isEmpty
(
checkReportDto
.
getReviewDangerIds
()))
{
reviewDangerIdList
=
Arrays
.
asList
(
checkReportDto
.
getReviewDangerIds
().
split
(
","
));
}
Set
<
String
>
allDangerIdSet
=
Sets
.
newHashSet
();
Set
<
String
>
allDangerIdSet
=
Sets
.
newHashSet
();
allDangerIdSet
.
addAll
(
dangerIdList
);
allDangerIdSet
.
addAll
(
dangerIdList
);
allDangerIdSet
.
addAll
(
reviewDangerIdList
);
allDangerIdSet
.
addAll
(
reviewDangerIdList
);
if
(!
ValidationUtil
.
isEmpty
(
allDangerIdSet
))
{
dangerParamMap
.
put
(
"dangerIds"
,
Joiner
.
on
(
","
).
join
(
allDangerIdSet
));
dangerParamMap
.
put
(
"dangerIds"
,
Joiner
.
on
(
","
).
join
(
allDangerIdSet
));
List
<
DangerDto
>
dangerDtoList
=
dangerFeignClient
.
listAll
(
dangerParamMap
).
getResult
();
List
<
DangerDto
>
dangerDtoList
=
dangerFeignClient
.
listAll
(
dangerParamMap
).
getResult
();
List
<
CheckReportDangerDto
>
dangerList
=
Lists
.
newArrayList
();
List
<
CheckReportDangerDto
>
dangerList
=
Lists
.
newArrayList
();
List
<
CheckReportDangerDto
>
reviewDangerList
=
Lists
.
newArrayList
();
List
<
CheckReportDangerDto
>
reviewDangerList
=
Lists
.
newArrayList
();
if
(!
ValidationUtil
.
isEmpty
(
dangerDtoList
))
{
if
(!
ValidationUtil
.
isEmpty
(
dangerDtoList
))
{
List
<
String
>
finalDangerIdList
=
dangerIdList
;
List
<
String
>
finalReviewDangerIdList
=
reviewDangerIdList
;
dangerDtoList
.
forEach
(
dangerDto
->
{
dangerDtoList
.
forEach
(
dangerDto
->
{
CheckReportDangerDto
checkReportDangerDto
=
new
CheckReportDangerDto
();
CheckReportDangerDto
checkReportDangerDto
=
new
CheckReportDangerDto
();
BeanUtils
.
copyProperties
(
dangerDto
,
checkReportDangerDto
);
BeanUtils
.
copyProperties
(
dangerDto
,
checkReportDangerDto
);
...
@@ -178,19 +188,19 @@ public class CheckReportServiceImpl extends BaseService<CheckReportDto, CheckRep
...
@@ -178,19 +188,19 @@ public class CheckReportServiceImpl extends BaseService<CheckReportDto, CheckRep
checkReportDangerDto
.
setCompanyId
(
bizInfo
.
get
(
"pointId"
));
checkReportDangerDto
.
setCompanyId
(
bizInfo
.
get
(
"pointId"
));
checkReportDangerDto
.
setCompanyName
(
bizInfo
.
get
(
"pointName"
));
checkReportDangerDto
.
setCompanyName
(
bizInfo
.
get
(
"pointName"
));
if
(
d
angerIdList
.
contains
(
dangerDto
.
getId
().
toString
()))
{
if
(
finalD
angerIdList
.
contains
(
dangerDto
.
getId
().
toString
()))
{
dangerList
.
add
(
checkReportDangerDto
);
dangerList
.
add
(
checkReportDangerDto
);
}
}
if
(
r
eviewDangerIdList
.
contains
(
dangerDto
.
getId
().
toString
()))
{
if
(
finalR
eviewDangerIdList
.
contains
(
dangerDto
.
getId
().
toString
()))
{
checkReportDangerDto
.
setReviewUser
(
dangerDto
.
getExecuteUserName
());
checkReportDangerDto
.
setReviewUser
(
dangerDto
.
getExecuteUserName
());
reviewDangerList
.
add
(
checkReportDangerDto
);
reviewDangerList
.
add
(
checkReportDangerDto
);
}
}
});
});
}
}
checkReportDto
.
setCheckDangerList
(
dangerList
);
checkReportDto
.
setCheckDangerList
(
dangerList
);
checkReportDto
.
setReviewDangerList
(
reviewDangerList
);
checkReportDto
.
setReviewDangerList
(
reviewDangerList
);
}
}
}
return
checkReportDto
;
return
checkReportDto
;
}
}
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-supervision-biz/src/main/java/com/yeejoin/amos/supervision/business/service/impl/CheckServiceImpl.java
View file @
997d6888
...
@@ -1577,8 +1577,8 @@ public class CheckServiceImpl implements ICheckService {
...
@@ -1577,8 +1577,8 @@ public class CheckServiceImpl implements ICheckService {
Plan
plan
=
planService
.
queryPlanById
(
planTask
.
getPlanId
());
Plan
plan
=
planService
.
queryPlanById
(
planTask
.
getPlanId
());
// 计划完成,规则推送消息
// 计划完成,规则推送消息
if
(
PlanStatusEnum
.
COMPLETED
.
getValue
()
==
plan
.
getStatus
()){
if
(
PlanStatusEnum
.
COMPLETED
.
getValue
()
==
plan
.
getStatus
())
{
rulePlanService
.
addPlanRule
(
plan
,
null
,
RuleTypeEnum
.
计划完成
);
rulePlanService
.
addPlanRule
(
plan
,
null
,
RuleTypeEnum
.
计划完成
,
null
);
}
}
// p_plan_task_detail更新隐患个数
// p_plan_task_detail更新隐患个数
...
@@ -1685,5 +1685,8 @@ public class CheckServiceImpl implements ICheckService {
...
@@ -1685,5 +1685,8 @@ public class CheckServiceImpl implements ICheckService {
return
result
;
return
result
;
}
}
@Override
public
List
<
String
>
getPictureByCheckId
(
String
checkId
,
String
id
)
{
return
checkMapper
.
getPictureByCheckId
(
checkId
,
id
);
}
}
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-supervision-biz/src/main/java/com/yeejoin/amos/supervision/business/service/impl/HiddenDangerServiceImpl.java
View file @
997d6888
...
@@ -38,6 +38,7 @@ import org.springframework.beans.factory.annotation.Autowired;
...
@@ -38,6 +38,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.util.StringUtils
;
import
org.typroject.tyboot.core.foundation.utils.Bean
;
import
org.typroject.tyboot.core.foundation.utils.Bean
;
import
org.typroject.tyboot.core.foundation.utils.ValidationUtil
;
import
org.typroject.tyboot.core.foundation.utils.ValidationUtil
;
import
org.typroject.tyboot.core.restful.exception.instance.DataNotFound
;
import
org.typroject.tyboot.core.restful.exception.instance.DataNotFound
;
...
@@ -207,14 +208,15 @@ public class HiddenDangerServiceImpl implements IHiddenDangerService {
...
@@ -207,14 +208,15 @@ public class HiddenDangerServiceImpl implements IHiddenDangerService {
//组织业务基本数据 对应bizInfo
//组织业务基本数据 对应bizInfo
HiddenDangerDto
hiddenDangerDto
=
new
HiddenDangerDto
();
HiddenDangerDto
hiddenDangerDto
=
new
HiddenDangerDto
();
hiddenDangerDto
.
setPlanId
(
planId
);
hiddenDangerDto
.
setPlanId
(
planId
);
hiddenDangerDto
.
setPointId
(
pointArray
.
length
>
1
?
Long
.
parseLong
(
pointArray
[
1
])
:
null
);
hiddenDangerDto
.
setPointId
(
pointArray
.
length
>
1
?
Long
.
parseLong
(
StringUtils
.
trimAllWhitespace
(
pointArray
[
1
]))
:
null
);
hiddenDangerDto
.
setPointName
(
pointArray
.
length
>
1
?
pointArray
[
0
]
:
null
);
hiddenDangerDto
.
setCheckInputId
(
seq
);
hiddenDangerDto
.
setCheckInputId
(
seq
);
hiddenDangerDto
.
setDangerType
(
DangerHandleTypeEnum
.
SELF
.
getCode
());
hiddenDangerDto
.
setDangerType
(
DangerHandleTypeEnum
.
SELF
.
getCode
());
try
{
try
{
dangerDto
.
setBizInfo
(
this
.
buildBizInfo
(
hiddenDangerDto
));
dangerDto
.
setBizInfo
(
this
.
buildBizInfo
(
hiddenDangerDto
));
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
log
.
error
(
e
.
getMessage
(),
e
);
log
.
error
(
e
.
getMessage
(),
e
);
throw
new
RuntimeException
(
"组织数据失败
"
);
throw
new
RuntimeException
(
"组织数据失败
!"
+
e
.
getMessage
()
);
}
}
return
dangerDto
;
return
dangerDto
;
}).
collect
(
Collectors
.
toList
());
}).
collect
(
Collectors
.
toList
());
...
@@ -273,6 +275,8 @@ public class HiddenDangerServiceImpl implements IHiddenDangerService {
...
@@ -273,6 +275,8 @@ public class HiddenDangerServiceImpl implements IHiddenDangerService {
Point
point
=
new
Point
();
Point
point
=
new
Point
();
if
(!
ObjectUtils
.
isEmpty
(
hiddenDangerDto
.
getPointId
()))
{
if
(!
ObjectUtils
.
isEmpty
(
hiddenDangerDto
.
getPointId
()))
{
point
=
iPointDao
.
findById
(
hiddenDangerDto
.
getPointId
()).
orElseThrow
(()
->
new
RuntimeException
(
"单位不存在"
));
point
=
iPointDao
.
findById
(
hiddenDangerDto
.
getPointId
()).
orElseThrow
(()
->
new
RuntimeException
(
"单位不存在"
));
}
else
{
throw
new
RuntimeException
(
"单位不存在"
);
}
}
//检查级别
//检查级别
DangerCheckTypeLevelEnum
dangerCheckTypeLevelEnum
=
DangerCheckTypeLevelEnum
.
getEumByCode
(
plan
.
getCheckLevel
());
DangerCheckTypeLevelEnum
dangerCheckTypeLevelEnum
=
DangerCheckTypeLevelEnum
.
getEumByCode
(
plan
.
getCheckLevel
());
...
@@ -288,10 +292,8 @@ public class HiddenDangerServiceImpl implements IHiddenDangerService {
...
@@ -288,10 +292,8 @@ public class HiddenDangerServiceImpl implements IHiddenDangerService {
result
.
put
(
"bizId"
,
hiddenDangerDto
.
getCheckInputId
());
result
.
put
(
"bizId"
,
hiddenDangerDto
.
getCheckInputId
());
result
.
put
(
"bizName"
,
hiddenDangerDto
.
getInputItemName
());
result
.
put
(
"bizName"
,
hiddenDangerDto
.
getInputItemName
());
result
.
put
(
"routeId"
,
plan
.
getRouteId
());
result
.
put
(
"routeId"
,
plan
.
getRouteId
());
result
.
put
(
"accompanyingUserId"
,
plan
.
getLeadPeopleIds
());
// 检查陪同人id
result
.
put
(
"checkUnitId"
,
plan
.
getCheckUnitId
());
// 检查人所在单位id逗号隔开
result
.
put
(
"accompanyingUserName"
,
plan
.
getLeadPeopleNames
());
// 检查陪同人名称
result
.
put
(
"checkUnitName"
,
plan
.
getCheckUnitName
());
// 检查人所在单位名称逗号隔开
result
.
put
(
"checkUnitId"
,
plan
.
getCheckUnitId
());
result
.
put
(
"checkUnitName"
,
plan
.
getCheckUnitName
());
result
.
put
(
"leadPeopleId"
,
plan
.
getLeadPeopleIds
());
// 牵头人id
result
.
put
(
"leadPeopleId"
,
plan
.
getLeadPeopleIds
());
// 牵头人id
result
.
put
(
"leadPeopleName"
,
plan
.
getLeadPeopleNames
());
// 牵头人名称
result
.
put
(
"leadPeopleName"
,
plan
.
getLeadPeopleNames
());
// 牵头人名称
result
.
put
(
"makerUserId"
,
plan
.
getMakerUserId
());
// 计划制定人id
result
.
put
(
"makerUserId"
,
plan
.
getMakerUserId
());
// 计划制定人id
...
@@ -313,13 +315,11 @@ public class HiddenDangerServiceImpl implements IHiddenDangerService {
...
@@ -313,13 +315,11 @@ public class HiddenDangerServiceImpl implements IHiddenDangerService {
return
;
return
;
}
}
List
<
CheckShot
>
shotList
=
iCheckShotDao
.
findAllByCheckIdAndCheckInputId
(
checkInput
.
getCheckId
(),
checkInput
.
getId
());
List
<
CheckShot
>
shotList
=
iCheckShotDao
.
findAllByCheckIdAndCheckInputId
(
checkInput
.
getCheckId
(),
checkInput
.
getId
());
result
.
put
(
"checkUserId"
,
checkInput
.
getUserId
());
result
.
put
(
"checkUserId"
,
checkInput
.
getUserId
());
// 任务执行人id
result
.
put
(
"checkUserName"
,
checkInput
.
getUserName
());
result
.
put
(
"checkUserName"
,
checkInput
.
getUserName
());
// 任务执行人名称
result
.
put
(
"accompanyUserId"
,
checkInput
.
getAccompanyUserId
());
result
.
put
(
"accompanyingUserId"
,
checkInput
.
getAccompanyUserId
());
// 检查陪同人id
result
.
put
(
"accompanyUserName"
,
checkInput
.
getAccompanyUserName
());
result
.
put
(
"accompanyingUserName"
,
checkInput
.
getAccompanyUserName
());
// 检查陪同人名称
result
.
put
(
"accompanyingUserId"
,
checkInput
.
getAccompanyUserId
());
result
.
put
(
"planExecuteTime"
,
checkInput
.
getCreateDate
());
// 计划任务执行时间
result
.
put
(
"accompanyingUserName"
,
checkInput
.
getAccompanyUserName
());
result
.
put
(
"planExecuteTime"
,
checkInput
.
getCreateDate
());
result
.
put
(
"checkPhotoUrl"
,
shotList
.
stream
().
map
(
CheckShot:
:
getPhotoData
).
collect
(
Collectors
.
joining
(
","
)));
result
.
put
(
"checkPhotoUrl"
,
shotList
.
stream
().
map
(
CheckShot:
:
getPhotoData
).
collect
(
Collectors
.
joining
(
","
)));
}
}
}
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-supervision-biz/src/main/java/com/yeejoin/amos/supervision/business/service/impl/PlanServiceImpl.java
View file @
997d6888
...
@@ -237,7 +237,7 @@ public class PlanServiceImpl implements IPlanService {
...
@@ -237,7 +237,7 @@ public class PlanServiceImpl implements IPlanService {
}
}
try
{
try
{
if
(
ValidationUtil
.
isEmpty
(
status
)){
if
(
ValidationUtil
.
isEmpty
(
status
)){
rulePlanService
.
addPlanRule
(
plan
,
userIds
,
RuleTypeEnum
.
计划提交
);
// 计划提交
rulePlanService
.
addPlanRule
(
plan
,
userIds
,
RuleTypeEnum
.
计划提交
,
null
);
// 计划提交
}
else
{
}
else
{
if
(
PlanStatusEnum
.
EXAMINE_THREE
.
getValue
()
!=
status
){
if
(
PlanStatusEnum
.
EXAMINE_THREE
.
getValue
()
!=
status
){
rulePlanService
.
addPlanAuditRule
(
plan
,
userIds
,
RuleTypeEnum
.
计划审核
,
ExecuteStateNameEnum
.
getNameByCode
(
excuteState
));
// 计划审核
rulePlanService
.
addPlanAuditRule
(
plan
,
userIds
,
RuleTypeEnum
.
计划审核
,
ExecuteStateNameEnum
.
getNameByCode
(
excuteState
));
// 计划审核
...
...
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 @
997d6888
...
@@ -536,8 +536,9 @@ public class PlanTaskServiceImpl implements IPlanTaskService {
...
@@ -536,8 +536,9 @@ public class PlanTaskServiceImpl implements IPlanTaskService {
// 2.保存执行数据明细表
// 2.保存执行数据明细表
planTaskDetail
.
saveAndFlush
(
planTaskDetailInstance
);
planTaskDetail
.
saveAndFlush
(
planTaskDetailInstance
);
// 规则推送消息
// 规则推送消息
rulePlanService
.
addPlanRule
(
plan
,
null
,
RuleTypeEnum
.
计划生成
);
rulePlanService
.
addPlanRule
(
plan
,
null
,
RuleTypeEnum
.
计划生成
,
pointId
.
longValue
()
);
}
}
// 定时任务监控
// 定时任务监控
jobService
.
planTaskAddJob
(
planTask
);
jobService
.
planTaskAddJob
(
planTask
);
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-supervision-biz/src/main/java/com/yeejoin/amos/supervision/business/service/impl/RulePlanService.java
View file @
997d6888
package
com
.
yeejoin
.
amos
.
supervision
.
business
.
service
.
impl
;
package
com
.
yeejoin
.
amos
.
supervision
.
business
.
service
.
impl
;
import
com.google.common.base.Joiner
;
import
com.google.common.collect.Lists
;
import
com.google.gson.JsonObject
;
import
com.yeejoin.amos.boot.biz.common.constants.RuleConstant
;
import
com.yeejoin.amos.boot.biz.common.constants.RuleConstant
;
import
com.yeejoin.amos.boot.biz.common.enums.RuleTypeEnum
;
import
com.yeejoin.amos.boot.biz.common.enums.RuleTypeEnum
;
import
com.yeejoin.amos.component.rule.RuleTrigger
;
import
com.yeejoin.amos.component.rule.RuleTrigger
;
import
com.yeejoin.amos.feign.privilege.Privilege
;
import
com.yeejoin.amos.feign.privilege.model.AgencyUserModel
;
import
com.yeejoin.amos.feign.privilege.model.RoleModel
;
import
com.yeejoin.amos.supervision.business.dao.mapper.PointMapper
;
import
com.yeejoin.amos.supervision.business.dto.OrgUsrFormDto
;
import
com.yeejoin.amos.supervision.business.dto.PlanRo
;
import
com.yeejoin.amos.supervision.business.dto.PlanRo
;
import
com.yeejoin.amos.supervision.business.feign.JCSFeignClient
;
import
com.yeejoin.amos.supervision.business.feign.JCSFeignClient
;
import
com.yeejoin.amos.supervision.business.util.DateUtil
;
import
com.yeejoin.amos.supervision.business.util.DateUtil
;
import
com.yeejoin.amos.supervision.business.util.Toke
;
import
com.yeejoin.amos.supervision.dao.entity.Plan
;
import
com.yeejoin.amos.supervision.dao.entity.Plan
;
import
com.yeejoin.amos.supervision.dao.entity.Point
;
import
com.yeejoin.amos.supervision.feign.RemoteSecurityService
;
import
org.bouncycastle.cert.ocsp.Req
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.scheduling.annotation.Async
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.typroject.tyboot.core.foundation.context.RequestContext
;
import
org.typroject.tyboot.core.foundation.utils.ValidationUtil
;
import
org.typroject.tyboot.core.foundation.utils.ValidationUtil
;
import
java.util.Date
;
import
java.util.Date
;
...
@@ -28,28 +43,47 @@ public class RulePlanService {
...
@@ -28,28 +43,47 @@ public class RulePlanService {
private
final
String
packageId
=
"消息/addPlanRule"
;
private
final
String
packageId
=
"消息/addPlanRule"
;
private
final
String
msgType
=
"supervision"
;
private
final
String
msgType
=
"supervision"
;
@Value
(
"${supervision.person.charger.role:Person_charge_unit_fire_protection_supervision_inspection}"
)
private
String
supervisionPersonChargerRole
;
@Autowired
@Autowired
private
RuleTrigger
ruleTrigger
;
private
RuleTrigger
ruleTrigger
;
@Autowired
@Autowired
private
JCSFeignClient
jcsFeignClient
;
private
JCSFeignClient
jcsFeignClient
;
public
Boolean
addPlanRule
(
Plan
plan
,
List
<
String
>
userIds
,
RuleTypeEnum
ruleType
)
throws
Exception
{
@Autowired
PlanRo
planRo
=
buildPlanRo
(
plan
,
userIds
,
ruleType
);
private
RemoteSecurityService
remoteSecurityService
;
@Autowired
private
PointServiceImpl
pointService
;
@Async
public
Boolean
addPlanRule
(
Plan
plan
,
List
<
String
>
userIds
,
RuleTypeEnum
ruleType
,
Long
pointId
)
throws
Exception
{
PlanRo
planRo
=
buildPlanRo
(
plan
,
userIds
,
ruleType
,
pointId
);
//触发规则
//触发规则
ruleTrigger
.
publish
(
planRo
,
packageId
,
new
String
[
0
]);
ruleTrigger
.
publish
(
planRo
,
packageId
,
new
String
[
0
]);
return
true
;
return
true
;
}
}
@Async
public
Boolean
addPlanAuditRule
(
Plan
plan
,
List
<
String
>
userIds
,
RuleTypeEnum
ruleType
,
String
excuteStateName
)
throws
Exception
{
public
Boolean
addPlanAuditRule
(
Plan
plan
,
List
<
String
>
userIds
,
RuleTypeEnum
ruleType
,
String
excuteStateName
)
throws
Exception
{
PlanRo
planRo
=
buildPlanRo
(
plan
,
userIds
,
ruleType
);
PlanRo
planRo
=
buildPlanRo
(
plan
,
userIds
,
ruleType
,
null
);
planRo
.
setExcuteStateName
(
excuteStateName
);
planRo
.
setExcuteStateName
(
excuteStateName
);
//触发规则
//触发规则
ruleTrigger
.
publish
(
planRo
,
packageId
,
new
String
[
0
]);
ruleTrigger
.
publish
(
planRo
,
packageId
,
new
String
[
0
]);
return
true
;
return
true
;
}
}
private
PlanRo
buildPlanRo
(
Plan
plan
,
List
<
String
>
userIds
,
RuleTypeEnum
ruleType
)
{
private
PlanRo
buildPlanRo
(
Plan
plan
,
List
<
String
>
userIds
,
RuleTypeEnum
ruleType
,
Long
pointId
)
{
// 设置token
if
(
ValidationUtil
.
isEmpty
(
RequestContext
.
getToken
()))
{
Toke
tokenObj
=
remoteSecurityService
.
getServerToken
();
RequestContext
.
setProduct
(
tokenObj
.
getProduct
());
RequestContext
.
setAppKey
(
tokenObj
.
getAppKey
());
RequestContext
.
setToken
(
tokenObj
.
getToke
());
}
PlanRo
planRo
=
new
PlanRo
();
PlanRo
planRo
=
new
PlanRo
();
BeanUtils
.
copyProperties
(
plan
,
planRo
);
BeanUtils
.
copyProperties
(
plan
,
planRo
);
planRo
.
setMsgType
(
msgType
);
planRo
.
setMsgType
(
msgType
);
...
@@ -74,11 +108,35 @@ public class RulePlanService {
...
@@ -74,11 +108,35 @@ public class RulePlanService {
}
}
if
(
ValidationUtil
.
isEmpty
(
userIds
))
{
if
(
ValidationUtil
.
isEmpty
(
userIds
))
{
// 计划牵头责任人
String
leadPeopleIds
=
plan
.
getLeadPeopleIds
();
String
leadPeopleIds
=
plan
.
getLeadPeopleIds
();
if
(!
ValidationUtil
.
isEmpty
(
plan
.
getUserId
())
&&
!
leadPeopleIds
.
contains
(
plan
.
getUserId
()))
{
if
(!
ValidationUtil
.
isEmpty
(
plan
.
getUserId
())
&&
!
leadPeopleIds
.
contains
(
plan
.
getUserId
()))
{
leadPeopleIds
+=
","
+
plan
.
getUserId
();
leadPeopleIds
+=
","
+
plan
.
getUserId
();
}
}
userIds
=
(
List
<
String
>)
jcsFeignClient
.
getAmosIdListByUserIds
(
leadPeopleIds
).
getResult
();
userIds
=
(
List
<
String
>)
jcsFeignClient
.
getAmosIdListByUserIds
(
leadPeopleIds
).
getResult
();
// pointId是被检查单位id
if
(!
ValidationUtil
.
isEmpty
(
pointId
))
{
List
<
String
>
userIdList
=
Lists
.
newArrayList
();
Point
point
=
pointService
.
queryPointById
(
pointId
);
List
<
OrgUsrFormDto
>
personList
=
jcsFeignClient
.
getPersonListByCompanyId
(
point
.
getOriginalId
()).
getResult
();
List
<
String
>
personIdList
=
Lists
.
transform
(
personList
,
OrgUsrFormDto:
:
getAmosOrgId
);
List
<
RoleModel
>
roleList
=
Privilege
.
roleClient
.
queryRoleList
(
supervisionPersonChargerRole
,
null
).
getResult
();
if
(!
ValidationUtil
.
isEmpty
(
roleList
))
{
List
<
AgencyUserModel
>
agencyUserModelList
=
Privilege
.
agencyUserClient
.
queryByRoleId
(
String
.
valueOf
(
roleList
.
get
(
0
).
getSequenceNbr
()),
null
).
getResult
();
if
(!
ValidationUtil
.
isEmpty
(
agencyUserModelList
))
{
List
<
String
>
finalUserIds
=
userIds
;
agencyUserModelList
.
forEach
(
userModel
->
{
if
(
personIdList
.
contains
(
userModel
.
getUserId
())
&&
!
finalUserIds
.
contains
(
userModel
.
getUserId
()))
{
finalUserIds
.
add
(
userModel
.
getUserId
());
}
});
userIds
=
finalUserIds
;
}
}
}
}
}
planRo
.
setSendTime
(
DateUtil
.
date2LongStr
(
new
Date
()));
planRo
.
setSendTime
(
DateUtil
.
date2LongStr
(
new
Date
()));
planRo
.
setRecivers
(
userIds
);
planRo
.
setRecivers
(
userIds
);
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-supervision-biz/src/main/java/com/yeejoin/amos/supervision/business/service/intfc/ICheckService.java
View file @
997d6888
...
@@ -282,4 +282,6 @@ public interface ICheckService {
...
@@ -282,4 +282,6 @@ public interface ICheckService {
int
checkHasRecord
(
Long
planTaskId
,
Long
pointId
);
int
checkHasRecord
(
Long
planTaskId
,
Long
pointId
);
Page
<
CheckVo
>
queryPage
(
CheckPageParam
criterias
);
Page
<
CheckVo
>
queryPage
(
CheckPageParam
criterias
);
List
<
String
>
getPictureByCheckId
(
String
checkId
,
String
id
);
}
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-supervision-biz/src/main/java/com/yeejoin/amos/supervision/business/vo/CheckVo.java
View file @
997d6888
...
@@ -9,7 +9,10 @@ import java.util.Date;
...
@@ -9,7 +9,10 @@ import java.util.Date;
*/
*/
@Data
@Data
public
class
CheckVo
{
public
class
CheckVo
{
/**
* checkId
*/
private
Long
checkId
;
/**
/**
* 主键id
* 主键id
*/
*/
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-supervision-biz/src/main/java/com/yeejoin/amos/supervision/quartz/JobService.java
View file @
997d6888
...
@@ -43,10 +43,12 @@ import org.springframework.beans.factory.annotation.Autowired;
...
@@ -43,10 +43,12 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.typroject.tyboot.core.foundation.utils.ValidationUtil
;
import
java.text.ParseException
;
import
java.text.ParseException
;
import
java.text.SimpleDateFormat
;
import
java.text.SimpleDateFormat
;
import
java.util.*
;
import
java.util.*
;
import
java.util.stream.Collectors
;
@Service
(
"jobService"
)
@Service
(
"jobService"
)
public
class
JobService
implements
IJobService
{
public
class
JobService
implements
IJobService
{
...
@@ -215,7 +217,13 @@ public class JobService implements IJobService {
...
@@ -215,7 +217,13 @@ public class JobService implements IJobService {
private
void
createOmissionCheckRecord
(
PlanTask
planTask
)
{
private
void
createOmissionCheckRecord
(
PlanTask
planTask
)
{
List
<
PlanTaskPointInputItemBo
>
planTaskPointInputItems
=
planTaskMapper
List
<
PlanTaskPointInputItemBo
>
planTaskPointInputItems
=
planTaskMapper
.
getPlanTaskPointInputItemByPlanTaskId
(
planTask
.
getId
(),
PlanTaskDetailStatusEnum
.
OMISSION
.
getValue
());
.
getPlanTaskPointInputItemByPlanTaskId
(
planTask
.
getId
(),
PlanTaskDetailStatusEnum
.
OMISSION
.
getValue
());
List
<
Check
>
checkList
=
checkMapper
.
getCheckListByTaskId
(
planTask
.
getId
());
Map
<
Long
,
Check
>
checkMap
=
new
HashMap
<>();
Map
<
Long
,
Check
>
checkMap
=
new
HashMap
<>();
if
(!
ValidationUtil
.
isEmpty
(
checkList
))
{
checkList
.
stream
().
collect
(
Collectors
.
groupingBy
(
Check:
:
getPointId
)).
forEach
((
e
,
v
)
->
{
checkMap
.
put
(
e
,
v
.
get
(
0
));
});
}
Set
<
Long
>
checkIds
=
new
HashSet
<
Long
>();
Set
<
Long
>
checkIds
=
new
HashSet
<
Long
>();
//查询用户名字
//查询用户名字
for
(
PlanTaskPointInputItemBo
arg
:
planTaskPointInputItems
)
{
for
(
PlanTaskPointInputItemBo
arg
:
planTaskPointInputItems
)
{
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-tzs-biz/src/main/java/com/yeejoin/amos/boot/module/tzs/flc/biz/controller/EquipmentAssociatedController.java
View file @
997d6888
...
@@ -2,19 +2,25 @@ package com.yeejoin.amos.boot.module.tzs.flc.biz.controller;
...
@@ -2,19 +2,25 @@ package com.yeejoin.amos.boot.module.tzs.flc.biz.controller;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.yeejoin.amos.boot.module.tzs.biz.utils.BeanDtoVoUtils
;
import
com.yeejoin.amos.boot.module.tzs.biz.utils.BeanDtoVoUtils
;
import
com.yeejoin.amos.boot.module.tzs.flc.api.dto.EquipmentDto
;
import
com.yeejoin.amos.boot.module.tzs.flc.api.dto.EquipmentDto
;
import
com.yeejoin.amos.boot.module.tzs.flc.api.entity.Equipment
;
import
com.yeejoin.amos.boot.module.tzs.flc.api.entity.Equipment
;
import
com.yeejoin.amos.boot.module.tzs.flc.api.entity.EquipmentAssociated
;
import
com.yeejoin.amos.boot.module.tzs.flc.api.entity.EquipmentAssociated
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.Api
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.bind.annotation.RestController
;
import
com.yeejoin.amos.boot.biz.common.controller.BaseController
;
import
com.yeejoin.amos.boot.biz.common.controller.BaseController
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.List
;
import
com.yeejoin.amos.boot.module.tzs.flc.biz.service.impl.EquipmentAssociatedServiceImpl
;
import
com.yeejoin.amos.boot.module.tzs.flc.biz.service.impl.EquipmentAssociatedServiceImpl
;
import
org.typroject.tyboot.core.foundation.utils.ValidationUtil
;
import
org.typroject.tyboot.core.restful.exception.instance.BadRequest
;
import
org.typroject.tyboot.core.restful.utils.ResponseHelper
;
import
org.typroject.tyboot.core.restful.utils.ResponseHelper
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
@@ -48,10 +54,64 @@ public class EquipmentAssociatedController extends BaseController {
...
@@ -48,10 +54,64 @@ public class EquipmentAssociatedController extends BaseController {
@PostMapping
(
value
=
"/save"
)
@PostMapping
(
value
=
"/save"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"新增配套设备设施部件"
,
notes
=
"新增配套设备设施部件"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"新增配套设备设施部件"
,
notes
=
"新增配套设备设施部件"
)
public
ResponseModel
<
EquipmentAssociatedDto
>
save
(
@RequestBody
EquipmentAssociatedDto
model
)
{
public
ResponseModel
<
EquipmentAssociatedDto
>
save
(
@RequestBody
EquipmentAssociatedDto
model
)
{
model
.
setIsDelete
(
false
);
model
=
equipmentAssociatedServiceImpl
.
createWithModel
(
model
);
model
=
equipmentAssociatedServiceImpl
.
createWithModel
(
model
);
return
ResponseHelper
.
buildResponse
(
model
);
return
ResponseHelper
.
buildResponse
(
model
);
}
}
/**
* 根据sequenceNbr删除
*
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@DeleteMapping
(
value
=
"/{sequenceNbr}"
)
@ApiOperation
(
httpMethod
=
"DELETE"
,
value
=
"删除配套设施"
,
notes
=
"删除配套设施"
)
public
ResponseModel
<
Boolean
>
deleteBySequenceNbr
(
@PathVariable
(
value
=
"sequenceNbr"
)
Long
sequenceNbr
){
Boolean
flag
=
equipmentAssociatedServiceImpl
.
update
(
new
LambdaUpdateWrapper
<
EquipmentAssociated
>().
eq
(
EquipmentAssociated:
:
getSequenceNbr
,
sequenceNbr
).
set
(
EquipmentAssociated:
:
getIsDelete
,
true
));
return
ResponseHelper
.
buildResponse
(
flag
);
}
/**
* 根据sequenceNbr更新
*
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@PutMapping
(
value
=
"/updateAssociated"
)
@ApiOperation
(
httpMethod
=
"PUT"
,
value
=
"根据sequenceNbr更新配套设备设施部件"
,
notes
=
"根据sequenceNbr配套设备设施部件"
)
public
ResponseModel
<
EquipmentAssociatedDto
>
updateAssociated
(
@RequestBody
EquipmentAssociatedDto
model
)
{
if
(
ValidationUtil
.
isEmpty
(
model
)
||
ValidationUtil
.
isEmpty
(
model
.
getSequenceNbr
()))
{
throw
new
BadRequest
(
"参数校验失败."
);
}
model
=
equipmentAssociatedServiceImpl
.
updateAssociated
(
model
);
return
ResponseHelper
.
buildResponse
(
model
);
}
/**
* 新增配套设备/设施/部件
*
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@GetMapping
(
value
=
"/{sequenceNbr}"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"根据设备id返回配套设施信息"
,
notes
=
"根据设备id返回配套设施信息"
)
public
ResponseModel
<
List
<
EquipmentAssociatedDto
>>
getAssociatedByEquipmentId
(
@PathVariable
(
value
=
"sequenceNbr"
)
Long
sequenceNbr
)
{
List
<
EquipmentAssociated
>
entity
=
equipmentAssociatedServiceImpl
.
list
(
new
LambdaQueryWrapper
<
EquipmentAssociated
>().
eq
(
EquipmentAssociated:
:
getIsDelete
,
false
).
eq
(
EquipmentAssociated:
:
getEquipmentId
,
sequenceNbr
));
List
<
EquipmentAssociatedDto
>
result
=
new
ArrayList
<>();
entity
.
stream
().
forEach
(
t
->
{
EquipmentAssociatedDto
temp
=
new
EquipmentAssociatedDto
();
BeanUtils
.
copyProperties
(
t
,
temp
);
result
.
add
(
temp
);
});
return
ResponseHelper
.
buildResponse
(
result
);
}
/**
/**
*
*
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-tzs-biz/src/main/java/com/yeejoin/amos/boot/module/tzs/flc/biz/controller/EquipmentController.java
View file @
997d6888
...
@@ -96,7 +96,7 @@ public class EquipmentController extends BaseController {
...
@@ -96,7 +96,7 @@ public class EquipmentController extends BaseController {
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@PutMapping
(
value
=
"/updateEquipment"
)
@PutMapping
(
value
=
"/updateEquipment"
)
@ApiOperation
(
httpMethod
=
"PUT"
,
value
=
"根据sequenceNbr更新装备信息表"
,
notes
=
"根据sequenceNbr更新装备信息表"
)
@ApiOperation
(
httpMethod
=
"PUT"
,
value
=
"根据sequenceNbr更新装备信息表"
,
notes
=
"根据sequenceNbr更新装备信息表"
)
public
ResponseModel
<
EquipmentDto
>
update
BySequenceNbrEquip
ment
(
@RequestBody
EquipmentDto
model
)
{
public
ResponseModel
<
EquipmentDto
>
update
Equip20
ment
(
@RequestBody
EquipmentDto
model
)
{
if
(
ValidationUtil
.
isEmpty
(
model
)
if
(
ValidationUtil
.
isEmpty
(
model
)
||
ValidationUtil
.
isEmpty
(
model
.
getSequenceNbr
()))
{
||
ValidationUtil
.
isEmpty
(
model
.
getSequenceNbr
()))
{
throw
new
BadRequest
(
"参数校验失败."
);
throw
new
BadRequest
(
"参数校验失败."
);
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-tzs-biz/src/main/java/com/yeejoin/amos/boot/module/tzs/flc/biz/controller/EquipmentUseInfoController.java
0 → 100644
View file @
997d6888
package
com
.
yeejoin
.
amos
.
boot
.
module
.
tzs
.
flc
.
biz
.
controller
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.Api
;
import
org.springframework.web.bind.annotation.RestController
;
import
com.yeejoin.amos.boot.biz.common.controller.BaseController
;
import
java.util.List
;
import
com.yeejoin.amos.boot.module.tzs.flc.biz.service.impl.EquipmentUseInfoServiceImpl
;
import
org.typroject.tyboot.core.restful.utils.ResponseHelper
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
javax.servlet.http.HttpServletRequest
;
import
org.springframework.web.bind.annotation.*
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.boot.module.tzs.flc.api.dto.EquipmentUseInfoDto
;
import
org.typroject.tyboot.core.restful.doc.TycloudOperation
;
import
org.typroject.tyboot.core.foundation.enumeration.UserType
;
/**
* 设备使用信息表
*
* @author system_generator
* @date 2022-01-05
*/
@RestController
@Api
(
tags
=
"设备使用信息表Api"
)
@RequestMapping
(
value
=
"/equipment-use-info"
)
public
class
EquipmentUseInfoController
extends
BaseController
{
@Autowired
EquipmentUseInfoServiceImpl
equipmentUseInfoServiceImpl
;
/**
* 新增设备使用信息表
*
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@PostMapping
(
value
=
"/save"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"新增设备使用信息表"
,
notes
=
"新增设备使用信息表"
)
public
ResponseModel
<
EquipmentUseInfoDto
>
save
(
@RequestBody
EquipmentUseInfoDto
model
)
{
model
=
equipmentUseInfoServiceImpl
.
createWithModel
(
model
);
return
ResponseHelper
.
buildResponse
(
model
);
}
/**
* 根据sequenceNbr更新
*
* @param sequenceNbr 主键
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@PutMapping
(
value
=
"/{sequenceNbr}"
)
@ApiOperation
(
httpMethod
=
"PUT"
,
value
=
"根据sequenceNbr更新设备使用信息表"
,
notes
=
"根据sequenceNbr更新设备使用信息表"
)
public
ResponseModel
<
EquipmentUseInfoDto
>
updateBySequenceNbrEquipmentUseInfo
(
@RequestBody
EquipmentUseInfoDto
model
,
@PathVariable
(
value
=
"sequenceNbr"
)
Long
sequenceNbr
)
{
model
.
setSequenceNbr
(
sequenceNbr
);
return
ResponseHelper
.
buildResponse
(
equipmentUseInfoServiceImpl
.
updateWithModel
(
model
));
}
/**
* 根据sequenceNbr删除
*
* @param sequenceNbr 主键
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@DeleteMapping
(
value
=
"/{sequenceNbr}"
)
@ApiOperation
(
httpMethod
=
"DELETE"
,
value
=
"根据sequenceNbr删除设备使用信息表"
,
notes
=
"根据sequenceNbr删除设备使用信息表"
)
public
ResponseModel
<
Boolean
>
deleteBySequenceNbr
(
HttpServletRequest
request
,
@PathVariable
(
value
=
"sequenceNbr"
)
Long
sequenceNbr
){
return
ResponseHelper
.
buildResponse
(
equipmentUseInfoServiceImpl
.
removeById
(
sequenceNbr
));
}
/**
* 根据sequenceNbr查询
*
* @param sequenceNbr 主键
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@GetMapping
(
value
=
"/{sequenceNbr}"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"根据sequenceNbr查询单个设备使用信息表"
,
notes
=
"根据sequenceNbr查询单个设备使用信息表"
)
public
ResponseModel
<
EquipmentUseInfoDto
>
selectOne
(
@PathVariable
Long
sequenceNbr
)
{
return
ResponseHelper
.
buildResponse
(
equipmentUseInfoServiceImpl
.
queryBySeq
(
sequenceNbr
));
}
/**
* 列表分页查询
*
* @param current 当前页
* @param current 每页大小
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@GetMapping
(
value
=
"/page"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"设备使用信息表分页查询"
,
notes
=
"设备使用信息表分页查询"
)
public
ResponseModel
<
Page
<
EquipmentUseInfoDto
>>
queryForPage
(
@RequestParam
(
value
=
"current"
)
int
current
,
@RequestParam
(
value
=
"size"
)
int
size
)
{
Page
<
EquipmentUseInfoDto
>
page
=
new
Page
<
EquipmentUseInfoDto
>();
page
.
setCurrent
(
current
);
page
.
setSize
(
size
);
return
ResponseHelper
.
buildResponse
(
equipmentUseInfoServiceImpl
.
queryForEquipmentUseInfoPage
(
page
));
}
/**
* 列表全部数据查询
*
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"设备使用信息表列表全部数据查询"
,
notes
=
"设备使用信息表列表全部数据查询"
)
@GetMapping
(
value
=
"/list"
)
public
ResponseModel
<
List
<
EquipmentUseInfoDto
>>
selectForList
()
{
return
ResponseHelper
.
buildResponse
(
equipmentUseInfoServiceImpl
.
queryForEquipmentUseInfoList
());
}
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-tzs-biz/src/main/java/com/yeejoin/amos/boot/module/tzs/flc/biz/service/impl/EquipmentAssociatedServiceImpl.java
View file @
997d6888
...
@@ -30,4 +30,10 @@ public class EquipmentAssociatedServiceImpl extends BaseService<EquipmentAssocia
...
@@ -30,4 +30,10 @@ public class EquipmentAssociatedServiceImpl extends BaseService<EquipmentAssocia
public
List
<
EquipmentAssociatedDto
>
queryForEquipmentAssociatedList
()
{
public
List
<
EquipmentAssociatedDto
>
queryForEquipmentAssociatedList
()
{
return
this
.
queryForList
(
""
,
false
);
return
this
.
queryForList
(
""
,
false
);
}
}
@Override
public
EquipmentAssociatedDto
updateAssociated
(
EquipmentAssociatedDto
model
)
{
this
.
updateWithModel
(
model
);
return
model
;
}
}
}
\ No newline at end of file
amos-boot-module/amos-boot-module-biz/amos-boot-module-tzs-biz/src/main/java/com/yeejoin/amos/boot/module/tzs/flc/biz/service/impl/EquipmentInformServiceImpl.java
View file @
997d6888
...
@@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSONObject;
...
@@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSONObject;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper
;
import
com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper
;
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.utils.DateUtils
;
import
com.yeejoin.amos.boot.biz.common.workflow.feign.WorkflowFeignService
;
import
com.yeejoin.amos.boot.biz.common.workflow.feign.WorkflowFeignService
;
import
com.yeejoin.amos.boot.module.common.api.dto.AttachmentDto
;
import
com.yeejoin.amos.boot.module.common.api.dto.AttachmentDto
;
import
com.yeejoin.amos.boot.module.common.api.dto.FailureDetailsDto
;
import
com.yeejoin.amos.boot.module.common.api.dto.FailureDetailsDto
;
...
@@ -16,11 +17,14 @@ import com.yeejoin.amos.boot.module.tzs.api.dto.AlertCalledQueryDto;
...
@@ -16,11 +17,14 @@ import com.yeejoin.amos.boot.module.tzs.api.dto.AlertCalledQueryDto;
import
com.yeejoin.amos.boot.module.tzs.api.enums.InformWorkFlowEnum
;
import
com.yeejoin.amos.boot.module.tzs.api.enums.InformWorkFlowEnum
;
import
com.yeejoin.amos.boot.module.tzs.flc.api.dto.EquipmentDto
;
import
com.yeejoin.amos.boot.module.tzs.flc.api.dto.EquipmentDto
;
import
com.yeejoin.amos.boot.module.tzs.flc.api.dto.EquipmentIndexDto
;
import
com.yeejoin.amos.boot.module.tzs.flc.api.dto.EquipmentIndexDto
;
import
com.yeejoin.amos.boot.module.tzs.flc.api.dto.EquipmentUseInfoDto
;
import
com.yeejoin.amos.boot.module.tzs.flc.api.dto.InformEquipmentDto
;
import
com.yeejoin.amos.boot.module.tzs.flc.api.dto.InformEquipmentDto
;
import
com.yeejoin.amos.boot.module.tzs.flc.api.entity.Equipment
;
import
com.yeejoin.amos.boot.module.tzs.flc.api.entity.Equipment
;
import
com.yeejoin.amos.boot.module.tzs.flc.api.entity.EquipmentIndex
;
import
com.yeejoin.amos.boot.module.tzs.flc.api.entity.EquipmentIndex
;
import
com.yeejoin.amos.boot.module.tzs.flc.api.entity.EquipmentIndexInform
;
import
com.yeejoin.amos.boot.module.tzs.flc.api.entity.EquipmentIndexInform
;
import
com.yeejoin.amos.boot.module.tzs.flc.api.entity.EquipmentInform
;
import
com.yeejoin.amos.boot.module.tzs.flc.api.entity.EquipmentInform
;
import
com.yeejoin.amos.boot.module.tzs.flc.api.entity.EquipmentUseInfo
;
import
com.yeejoin.amos.boot.module.tzs.flc.api.entity.UnitInfo
;
import
com.yeejoin.amos.boot.module.tzs.flc.api.enums.EquipmentInformStatusEnum
;
import
com.yeejoin.amos.boot.module.tzs.flc.api.enums.EquipmentInformStatusEnum
;
import
com.yeejoin.amos.boot.module.tzs.flc.api.enums.EquipmentStatusEnum
;
import
com.yeejoin.amos.boot.module.tzs.flc.api.enums.EquipmentStatusEnum
;
import
com.yeejoin.amos.boot.module.tzs.flc.api.mapper.EquipmentInformMapper
;
import
com.yeejoin.amos.boot.module.tzs.flc.api.mapper.EquipmentInformMapper
;
...
@@ -51,6 +55,7 @@ import java.util.HashMap;
...
@@ -51,6 +55,7 @@ import java.util.HashMap;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
import
java.util.Random
;
import
java.util.Random
;
import
java.util.UUID
;
/**
/**
* 设备告知单服务实现类
* 设备告知单服务实现类
...
@@ -89,7 +94,11 @@ public class EquipmentInformServiceImpl extends BaseService<EquipmentInformDto,E
...
@@ -89,7 +94,11 @@ public class EquipmentInformServiceImpl extends BaseService<EquipmentInformDto,E
@Autowired
@Autowired
EquipmentIndexInformServiceImpl
iEquipmentIndexInformService
;
EquipmentIndexInformServiceImpl
iEquipmentIndexInformService
;
@Autowired
EquipmentUseInfoServiceImpl
equipmentUseInfoServiceImpl
;
@Autowired
UnitInfoServiceImpl
unitInfoServiceImpl
;
/**
/**
* 分页查询
* 分页查询
...
@@ -199,7 +208,8 @@ public class EquipmentInformServiceImpl extends BaseService<EquipmentInformDto,E
...
@@ -199,7 +208,8 @@ public class EquipmentInformServiceImpl extends BaseService<EquipmentInformDto,E
public
Boolean
acceptInform
(
Long
sequenceNbr
)
{
public
Boolean
acceptInform
(
Long
sequenceNbr
)
{
// 接收告知书 更新告知书状态
// 接收告知书 更新告知书状态
Boolean
flag
=
false
;
Boolean
flag
=
false
;
flag
=
this
.
update
(
new
LambdaUpdateWrapper
<
EquipmentInform
>().
eq
(
EquipmentInform:
:
getSequenceNbr
,
sequenceNbr
).
set
(
EquipmentInform:
:
getInformStatus
,
"9"
));
EquipmentInform
inform
=
this
.
getById
(
sequenceNbr
);
flag
=
this
.
updateById
(
inform
);
if
(
flag
)
{
if
(
flag
)
{
// 更新设备相关参数
// 更新设备相关参数
List
<
InformEquipmentDto
>
equipmentList
=
informEquipmentServiceImpl
.
getEquipListByInformId
(
sequenceNbr
);
List
<
InformEquipmentDto
>
equipmentList
=
informEquipmentServiceImpl
.
getEquipListByInformId
(
sequenceNbr
);
...
@@ -209,6 +219,44 @@ public class EquipmentInformServiceImpl extends BaseService<EquipmentInformDto,E
...
@@ -209,6 +219,44 @@ public class EquipmentInformServiceImpl extends BaseService<EquipmentInformDto,E
BeanUtils
.
copyProperties
(
t
,
sourceEquip
);
BeanUtils
.
copyProperties
(
t
,
sourceEquip
);
sourceEquip
.
setSequenceNbr
(
t
.
getSourceEquipmentId
());
sourceEquip
.
setSequenceNbr
(
t
.
getSourceEquipmentId
());
equipmentServiceImpl
.
updateById
(
sourceEquip
);
equipmentServiceImpl
.
updateById
(
sourceEquip
);
// 保存设备相关使用信息
EquipmentUseInfo
useInfo
=
equipmentUseInfoServiceImpl
.
getOne
(
new
LambdaQueryWrapper
<
EquipmentUseInfo
>().
eq
(
EquipmentUseInfo:
:
getEquipmentId
,
t
.
getSourceEquipmentId
()));
if
(
useInfo
==
null
)
{
useInfo
=
new
EquipmentUseInfo
();
}
useInfo
.
setLatitude
(
t
.
getLatitude
());
useInfo
.
setLongitude
(
t
.
getLongitude
());
useInfo
.
setUseAddress
(
t
.
getAddress
());
useInfo
.
setUseSite
(
inform
.
getUseSite
());
useInfo
.
setUseSiteCode
(
inform
.
getUseSiteCode
());
//useInfo.setSpecialCode(UUID.randomUUID().toString().replaceAll("-",""));
//if(StringUtils.isEmpty(useInfo.getRegisterCode())) {
// useInfo.setRegisterCode(sourceEquip.getTypeId()+inform.getRegionCode()+ DateUtils.getYear(new Date())+"01");
//}
//useInfo.setRescueCode(UUID.randomUUID().toString().replaceAll("-",""));
//useInfo.setRegisterLicenceCode(UUID.randomUUID().toString().replaceAll("-",""));
if
(
useInfo
.
getRegisterTime
()
!=
null
)
{
useInfo
.
setRegisterTime
(
new
Date
());
}
useInfo
.
setStartUseTime
(
new
Date
());
useInfo
.
setIssueLicenceTime
(
new
Date
());
useInfo
.
setEquipmentId
(
t
.
getSourceEquipmentId
());
useInfo
.
setUseUnitName
(
inform
.
getUseUnit
());
useInfo
.
setUseUnitId
(
inform
.
getUseUnitId
());
UnitInfo
useUnit
=
unitInfoServiceImpl
.
getOne
(
new
LambdaQueryWrapper
<
UnitInfo
>().
eq
(
UnitInfo:
:
getIsDelete
,
false
).
eq
(
UnitInfo:
:
getOrgUserId
,
inform
.
getUseUnitId
()));
useInfo
.
setUseOrganizationCode
(
useUnit
.
getOrganizationCode
());
useInfo
.
setPropertyUnitName
(
inform
.
getPropertyUnit
());
useInfo
.
setPropertyUnitId
(
inform
.
getPropertyUnitId
());
UnitInfo
propertyUnit
=
unitInfoServiceImpl
.
getOne
(
new
LambdaQueryWrapper
<
UnitInfo
>().
eq
(
UnitInfo:
:
getIsDelete
,
false
).
eq
(
UnitInfo:
:
getOrgUserId
,
inform
.
getPropertyUnitId
()));
useInfo
.
setPropertyOrganizationCode
(
propertyUnit
.
getOrganizationCode
());
equipmentUseInfoServiceImpl
.
saveOrUpdate
(
useInfo
);
// 获取设备附件信息 保存附件信息
// 获取设备附件信息 保存附件信息
// 原附件信息
// 原附件信息
Map
<
String
,
List
<
AttachmentDto
>>
sourceAttach
=
sourceFileService
.
getAttachments
(
t
.
getSequenceNbr
());
Map
<
String
,
List
<
AttachmentDto
>>
sourceAttach
=
sourceFileService
.
getAttachments
(
t
.
getSequenceNbr
());
...
@@ -283,6 +331,7 @@ public class EquipmentInformServiceImpl extends BaseService<EquipmentInformDto,E
...
@@ -283,6 +331,7 @@ public class EquipmentInformServiceImpl extends BaseService<EquipmentInformDto,E
}
}
}
}
}
}
model
.
setProcessStatus
(
"0"
);
return
model
;
return
model
;
}
}
...
@@ -333,7 +382,6 @@ public class EquipmentInformServiceImpl extends BaseService<EquipmentInformDto,E
...
@@ -333,7 +382,6 @@ public class EquipmentInformServiceImpl extends BaseService<EquipmentInformDto,E
@Transactional
@Transactional
public
Boolean
acceptInform
(
Long
sequenceNbr
,
ReginParams
userInfo
)
throws
Exception
{
public
Boolean
acceptInform
(
Long
sequenceNbr
,
ReginParams
userInfo
)
throws
Exception
{
EquipmentInformDto
model
=
this
.
queryBySeq
(
sequenceNbr
);
EquipmentInformDto
model
=
this
.
queryBySeq
(
sequenceNbr
);
model
.
setInformStatus
(
"9"
);
InformWorkFlowEnum
submit
=
InformWorkFlowEnum
.
接收方接收告知书
;
InformWorkFlowEnum
submit
=
InformWorkFlowEnum
.
接收方接收告知书
;
model
.
setProcessStatus
(
submit
.
getProcessStatus
());
model
.
setProcessStatus
(
submit
.
getProcessStatus
());
// 流程流转
// 流程流转
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-tzs-biz/src/main/java/com/yeejoin/amos/boot/module/tzs/flc/biz/service/impl/EquipmentUseInfoServiceImpl.java
0 → 100644
View file @
997d6888
package
com
.
yeejoin
.
amos
.
boot
.
module
.
tzs
.
flc
.
biz
.
service
.
impl
;
import
com.yeejoin.amos.boot.module.tzs.flc.api.entity.EquipmentUseInfo
;
import
com.yeejoin.amos.boot.module.tzs.flc.api.mapper.EquipmentUseInfoMapper
;
import
com.yeejoin.amos.boot.module.tzs.flc.api.service.IEquipmentUseInfoService
;
import
com.yeejoin.amos.boot.module.tzs.flc.api.dto.EquipmentUseInfoDto
;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
import
org.springframework.stereotype.Service
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
java.util.List
;
/**
* 设备使用信息表服务实现类
*
* @author system_generator
* @date 2022-01-05
*/
@Service
public
class
EquipmentUseInfoServiceImpl
extends
BaseService
<
EquipmentUseInfoDto
,
EquipmentUseInfo
,
EquipmentUseInfoMapper
>
implements
IEquipmentUseInfoService
{
/**
* 分页查询
*/
public
Page
<
EquipmentUseInfoDto
>
queryForEquipmentUseInfoPage
(
Page
<
EquipmentUseInfoDto
>
page
)
{
return
this
.
queryForPage
(
page
,
null
,
false
);
}
/**
* 列表查询 示例
*/
public
List
<
EquipmentUseInfoDto
>
queryForEquipmentUseInfoList
()
{
return
this
.
queryForList
(
""
,
false
);
}
}
\ No newline at end of file
amos-boot-system-equip/src/main/resources/application-dev.properties
View file @
997d6888
...
@@ -66,8 +66,8 @@ dcs.url.sendalarm=http://198.87.103.158:8001/alarm-service/appalarm/sendalarm
...
@@ -66,8 +66,8 @@ dcs.url.sendalarm=http://198.87.103.158:8001/alarm-service/appalarm/sendalarm
#系统上线时间
#系统上线时间
param.system.online.date
=
2019-02-12
param.system.online.date
=
2019-02-12
# 视频转码服务开关
off/on
,默认关闭,数字换流站使用时开启
# 视频转码服务开关
hls(关)/flv(开)
,默认关闭,数字换流站使用时开启
param.isUseVideoTranscoding
=
off
window.vedioFormat
=
hls
# 航天视频服务地址
# 航天视频服务地址
param.htvideo.url
=
"http://192.168.4.174:9001";
param.htvideo.url
=
"http://192.168.4.174:9001";
# 南瑞视频转码服务地址
# 南瑞视频转码服务地址
...
...
amos-boot-system-equip/src/main/resources/application-docker.properties
0 → 100644
View file @
997d6888
spring.datasource.driver-class-name
=
com.mysql.cj.jdbc.Driver
spring.datasource.url
=
jdbc:mysql://172.16.11.20:3306/autosys_business_v3.0.0.2?useUnicode=true&characterEncoding=utf-8&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=Asia/Shanghai
spring.datasource.username
=
root
spring.datasource.password
=
root_123
spring.datasource.type
=
com.zaxxer.hikari.HikariDataSource
spring.datasource.hikari.pool-name
=
DatebookHikariCP
spring.datasource.hikari.minimum-idle
=
3
spring.datasource.hikari.maximum-pool-size
=
30
spring.datasource.hikari.auto-commit
=
true
spring.datasource.hikari.idle-timeout
=
10000
spring.datasource.hikari.max-lifetime
=
1800000
spring.datasource.hikari.connection-timeout
=
30000
spring.datasource.hikari.connection-test-query
=
SELECT 1
# 文件服务器地址
fileserver_domain
=
http://39.98.246.31:8888/
eureka.instance.hostname
=
172.16.11.20
eureka.instance.prefer-ip-address
=
true
eureka.client.serviceUrl.defaultZone
:
http://${eureka.instance.hostname}:10001/eureka/
#security config
security.password
=
a1234560
security.loginId
=
fas_system
security.productApp
=
STUDIO_APP_MOBILE
security.productWeb
=
STUDIO_APP_WEB
security.appKeyApp
=
studio_normalapp_3056965
#redis
spring.redis.database
=
1
spring.redis.host
=
172.16.11.20
spring.redis.port
=
6379
spring.redis.password
=
1234560
spring.redis.lettuce.pool.max-active
=
200
spring.redis.lettuce.pool.max-wait
=
-1
spring.redis.lettuce.pool.max-idle
=
10
spring.redis.lettuce.pool.min-idle
=
0
spring.redis.expire.time
=
300
## emqx
emqx.clean-session
=
true
emqx.client-id
=
${spring.application.name}-${random.int[1024,65536]}
emqx.broker
=
tcp://172.16.11.33:1883
emqx.user-name
=
admin
emqx.password
=
public
mqtt.scene.host
=
mqtt://172.16.11.33:8083/mqtt
mqtt.client.product.id
=
mqtt
mqtt.topic
=
topic_mqtt
spring.mqtt.completionTimeout
=
3000
#数据同步开关
systemctl.sync.switch
=
false
#数据JCS开关
systemctl.jcs.switch
=
false
#平台数据开关
systemctl.amos.switch
=
false
#报表数据地址
equip.report.url
=
/fire-fighting-system/ureport/preview?_u=file:
#数字化南瑞平台接口
dcs.url.token
=
http://198.87.103.158:8001/auth-service/oauth/token
dcs.url.sendalarm
=
http://198.87.103.158:8001/alarm-service/appalarm/sendalarm
#系统上线时间
param.system.online.date
=
2019-02-12
# 视频转码服务开关 hls(关)/flv(开),默认关闭,数字换流站使用时开启
window.vedioFormat
=
hls
# 航天视频服务地址
param.htvideo.url
=
"";
# 南瑞视频转码服务地址
param.nrvideo.url
=
"";
amos-boot-system-equip/src/main/resources/application-jcs.properties
0 → 100644
View file @
997d6888
spring.datasource.driver-class-name
=
com.mysql.cj.jdbc.Driver
spring.datasource.url
=
jdbc:mysql://172.16.10.66:3306/safety-business-3.0.1?useUnicode=true&characterEncoding=utf-8&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=Asia/Shanghai
spring.datasource.username
=
root
spring.datasource.password
=
root_123
spring.datasource.type
=
com.zaxxer.hikari.HikariDataSource
spring.datasource.hikari.pool-name
=
DatebookHikariCP
spring.datasource.hikari.minimum-idle
=
3
spring.datasource.hikari.maximum-pool-size
=
30
spring.datasource.hikari.auto-commit
=
true
spring.datasource.hikari.idle-timeout
=
10000
spring.datasource.hikari.max-lifetime
=
1800000
spring.datasource.hikari.connection-timeout
=
30000
spring.datasource.hikari.connection-test-query
=
SELECT 1
fdfs.so-timeout
=
1501
fdfs.connect-timeout
=
601
fdfs.thumb-image.height
=
200
fdfs.thumb-image.width
=
200
fdfs.tracker-list[0]=
39.98.246.31
:
22122
# 文件服务器地址
fileserver_domain
=
http://39.98.246.31:8888/
eureka.instance.hostname
=
172.16.10.72
eureka.instance.prefer-ip-address
=
true
eureka.client.serviceUrl.defaultZone
:
http://${eureka.instance.hostname}:10001/eureka/
#security config
security.password
=
a1234560
security.loginId
=
fas_system
security.productApp
=
STUDIO_APP_MOBILE
security.productWeb
=
STUDIO_APP_WEB
security.appKeyApp
=
studio_normalapp_3157169
#redis
spring.redis.database
=
0
spring.redis.host
=
172.16.10.85
spring.redis.port
=
6379
spring.redis.password
=
amos2019Redis
spring.redis.lettuce.pool.max-active
=
200
spring.redis.lettuce.pool.max-wait
=
-1
spring.redis.lettuce.pool.max-idle
=
10
spring.redis.lettuce.pool.min-idle
=
0
spring.redis.expire.time
=
300
mqtt.scene.host
=
mqtt://172.16.10.85:8083/mqtt
mqtt.client.product.id
=
mqtt
mqtt.topic
=
topic_mqtt
spring.mqtt.completionTimeout
=
3000
## emqx
emqx.clean-session
=
true
emqx.client-id
=
${spring.application.name}-${random.int[1024,65536]}
emqx.broker
=
tcp://172.16.10.85:1883
emqx.user-name
=
super
emqx.password
=
a123456
#数据同步开关
systemctl.sync.switch
=
false
#数据JCS开关
systemctl.jcs.switch
=
true
#平台数据开关
systemctl.amos.switch
=
true
#报表数据地址
equip.report.url
=
/fire-fighting-system/ureport/preview?_u=file:
#数字化南瑞平台接口
dcs.url.token
=
http://198.87.103.158:8001/auth-service/oauth/token
dcs.url.sendalarm
=
http://198.87.103.158:8001/alarm-service/appalarm/sendalarm
#系统上线时间
param.system.online.date
=
2019-02-12
# 视频转码服务开关 hls(关)/flv(开),默认关闭,数字换流站使用时开启
window.vedioFormat
=
hls
# 航天视频服务地址
param.htvideo.url
=
"";
# 南瑞视频转码服务地址
param.nrvideo.url
=
"";
amos-boot-system-equip/src/main/resources/application-qa.properties
0 → 100644
View file @
997d6888
spring.datasource.driver-class-name
=
com.mysql.cj.jdbc.Driver
spring.datasource.url
=
jdbc:mysql://172.16.11.20:3306/autosys_business_v3.0.0.2?useUnicode=true&characterEncoding=utf-8&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=Asia/Shanghai
spring.datasource.username
=
root
spring.datasource.password
=
root_123
spring.datasource.type
=
com.zaxxer.hikari.HikariDataSource
spring.datasource.hikari.pool-name
=
DatebookHikariCP
spring.datasource.hikari.minimum-idle
=
3
spring.datasource.hikari.maximum-pool-size
=
30
spring.datasource.hikari.auto-commit
=
true
spring.datasource.hikari.idle-timeout
=
10000
spring.datasource.hikari.max-lifetime
=
1800000
spring.datasource.hikari.connection-timeout
=
30000
spring.datasource.hikari.connection-test-query
=
SELECT 1
# 文件服务器地址
fileserver_domain
=
http://39.98.246.31:8888/
eureka.instance.hostname
=
172.16.11.20
eureka.instance.prefer-ip-address
=
true
eureka.client.serviceUrl.defaultZone
:
http://${eureka.instance.hostname}:10001/eureka/
#security config
security.password
=
a1234560
security.loginId
=
fas_system
security.productApp
=
STUDIO_APP_MOBILE
security.productWeb
=
STUDIO_APP_WEB
security.appKeyApp
=
studio_normalapp_3056965
#redis
spring.redis.database
=
1
spring.redis.host
=
172.16.11.20
spring.redis.port
=
6379
spring.redis.password
=
1234560
spring.redis.lettuce.pool.max-active
=
200
spring.redis.lettuce.pool.max-wait
=
-1
spring.redis.lettuce.pool.max-idle
=
10
spring.redis.lettuce.pool.min-idle
=
0
spring.redis.expire.time
=
300
## emqx
emqx.clean-session
=
true
emqx.client-id
=
${spring.application.name}-${random.int[1024,65536]}
emqx.broker
=
tcp://172.16.11.33:1883
emqx.user-name
=
admin
emqx.password
=
public
mqtt.scene.host
=
mqtt://172.16.11.33:8083/mqtt
mqtt.client.product.id
=
mqtt
mqtt.topic
=
topic_mqtt
spring.mqtt.completionTimeout
=
3000
#数据同步开关
systemctl.sync.switch
=
false
#数据JCS开关
systemctl.jcs.switch
=
false
#平台数据开关
systemctl.amos.switch
=
false
#报表数据地址
equip.report.url
=
/fire-fighting-system/ureport/preview?_u=file:
#数字化南瑞平台接口
dcs.url.token
=
http://198.87.103.158:8001/auth-service/oauth/token
dcs.url.sendalarm
=
http://198.87.103.158:8001/alarm-service/appalarm/sendalarm
#系统上线时间
param.system.online.date
=
2019-02-12
# 视频转码服务开关 hls(关)/flv(开),默认关闭,数字换流站使用时开启
window.vedioFormat
=
hls
# 航天视频服务地址
param.htvideo.url
=
"";
# 南瑞视频转码服务地址
param.nrvideo.url
=
"";
amos-boot-system-equip/src/main/resources/application-test.properties
0 → 100644
View file @
997d6888
spring.datasource.driver-class-name
=
com.mysql.cj.jdbc.Driver
spring.datasource.url
=
jdbc:mysql://172.16.11.20:3306/autosys_business_v3.0.0.2?useUnicode=true&characterEncoding=utf-8&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=Asia/Shanghai
spring.datasource.username
=
root
spring.datasource.password
=
root_123
spring.datasource.type
=
com.zaxxer.hikari.HikariDataSource
spring.datasource.hikari.pool-name
=
DatebookHikariCP
spring.datasource.hikari.minimum-idle
=
3
spring.datasource.hikari.maximum-pool-size
=
30
spring.datasource.hikari.auto-commit
=
true
spring.datasource.hikari.idle-timeout
=
10000
spring.datasource.hikari.max-lifetime
=
1800000
spring.datasource.hikari.connection-timeout
=
30000
spring.datasource.hikari.connection-test-query
=
SELECT 1
# 文件服务器地址
fileserver_domain
=
http://39.98.246.31:8888/
eureka.instance.hostname
=
172.16.11.20
eureka.instance.prefer-ip-address
=
true
eureka.client.serviceUrl.defaultZone
:
http://${eureka.instance.hostname}:10001/eureka/
#security config
security.password
=
a1234560
security.loginId
=
fas_system
security.productApp
=
STUDIO_APP_MOBILE
security.productWeb
=
STUDIO_APP_WEB
security.appKeyApp
=
studio_normalapp_3056965
#redis
spring.redis.database
=
1
spring.redis.host
=
172.16.11.20
spring.redis.port
=
6379
spring.redis.password
=
1234560
spring.redis.lettuce.pool.max-active
=
200
spring.redis.lettuce.pool.max-wait
=
-1
spring.redis.lettuce.pool.max-idle
=
10
spring.redis.lettuce.pool.min-idle
=
0
spring.redis.expire.time
=
300
## emqx
emqx.clean-session
=
true
emqx.client-id
=
${spring.application.name}-${random.int[1024,65536]}
emqx.broker
=
tcp://172.16.11.33:1883
emqx.user-name
=
admin
emqx.password
=
public
mqtt.scene.host
=
mqtt://172.16.11.33:8083/mqtt
mqtt.client.product.id
=
mqtt
mqtt.topic
=
topic_mqtt
spring.mqtt.completionTimeout
=
3000
#报表数据地址
equip.report.url
=
/fire-fighting-system/ureport/preview?_u=file:
#数字化南瑞平台接口
dcs.url.token
=
http://198.87.103.158:8001/auth-service/oauth/token
dcs.url.sendalarm
=
http://198.87.103.158:8001/alarm-service/appalarm/sendalarm
#系统上线时间
param.system.online.date
=
2019-02-12
# 视频转码服务开关 hls(关)/flv(开),默认关闭,数字换流站使用时开启
window.vedioFormat
=
hls
# 航天视频服务地址
param.htvideo.url
=
"";
# 南瑞视频转码服务地址
param.nrvideo.url
=
"";
amos-boot-system-equip/src/main/resources/changelog/init/view_all.sql
View file @
997d6888
...
@@ -632,23 +632,18 @@ ORDER BY
...
@@ -632,23 +632,18 @@ ORDER BY
-- ----------------------------
-- ----------------------------
DROP
VIEW
IF
EXISTS
`v_equip_alarm_today_statistics`
;
DROP
VIEW
IF
EXISTS
`v_equip_alarm_today_statistics`
;
CREATE
ALGORITHM
=
UNDEFINED
DEFINER
=
`root`
@
`%`
SQL
SECURITY
DEFINER
VIEW
`v_equip_alarm_today_statistics`
AS
SELECT
CREATE
ALGORITHM
=
UNDEFINED
DEFINER
=
`root`
@
`%`
SQL
SECURITY
DEFINER
VIEW
`v_equip_alarm_today_statistics`
AS
SELECT
count
(
(
`confirm_type`
count
(
1
)
-
count
(
)
AS
`confirmed`
,
`clean_time`
)
)
AS
`unCleaned`
,
(
(
count
(
1
)
-
count
(
count
(
1
)
-
count
(
`confirm_type`
`confirm_type`
)
)
)
AS
`pending`
)
AS
`pending`
FROM
FROM
`wl_equipment_specific_alarm_log`
`wl_equipment_specific_alarm_log`
;
WHERE
(
cast
(
now
()
AS
date
)
=
cast
(
`create_date`
AS
date
)
);
-- ----------------------------
-- ----------------------------
-- View structure for v_equip_fire_control_water
-- View structure for v_equip_fire_control_water
...
@@ -674,10 +669,8 @@ SELECT
...
@@ -674,10 +669,8 @@ SELECT
`sal`
.
`equipment_specific_index_key`
AS
`indexKey`
,
`sal`
.
`equipment_specific_index_key`
AS
`indexKey`
,
`sal`
.
`equipment_specific_index_name`
AS
`indexName`
,
`sal`
.
`equipment_specific_index_name`
AS
`indexName`
,
`sal`
.
`equipment_specific_id`
AS
`specificId`
,
`sal`
.
`equipment_specific_id`
AS
`specificId`
,
concat
(
IF
sal
.
equipment_specific_name
,
(
`sal`
.
`clean_time`
IS
NOT
NULL
,
'已消除'
,
'未消除'
)
`cleanStatus`
,
sal
.
equipment_specific_index_name
)
AS
alamReason
,
`sal`
.
`iot_code`
AS
`iotCode`
,
`sal`
.
`iot_code`
AS
`iotCode`
,
date_format
(
date_format
(
`sal`
.
`create_date`
,
`sal`
.
`create_date`
,
...
@@ -5794,27 +5787,153 @@ CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`%` SQL SECURITY DEFINER VIEW `v_equip
...
@@ -5794,27 +5787,153 @@ CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`%` SQL SECURITY DEFINER VIEW `v_equip
-- 火灾报警系统4小告警列表前60
-- 火灾报警系统4小告警列表前60
DROP
VIEW
IF
EXISTS
`v_fire_equip_alarm_60list_alarm`
;
DROP
VIEW
IF
EXISTS
`v_fire_equip_alarm_60list_alarm`
;
CREATE
ALGORITHM
=
UNDEFINED
DEFINER
=
`root`
@
`%`
SQL
SECURITY
DEFINER
VIEW
`v_fire_equip_alarm_60list_alarm`
AS
select
`sa`
.
`id`
AS
`id`
,
`ec`
.
`code`
AS
`mRid`
,
`sa`
.
`equipment_specific_name`
AS
`specificName`
,
`sa`
.
`equipment_specific_index_key`
AS
`indexKey`
,
`sa`
.
`equipment_specific_index_name`
AS
`indexName`
,
`sa`
.
`equipment_specific_id`
AS
`specificId`
,
concat
(
`sa`
.
`equipment_specific_name`
,
`sa`
.
`equipment_specific_index_name`
)
AS
`alamReason`
,
`sa`
.
`iot_code`
AS
`iotCode`
,
`sa`
.
`create_date`
AS
`createDate`
from
(
`wl_equipment_specific_alarm_log`
`sa`
left
join
`wl_equipment_specific`
`ec`
on
((
`sa`
.
`equipment_specific_id`
=
`ec`
.
`id`
)))
where
find_in_set
(
'029026401813010000000016'
,
`sa`
.
`system_codes`
)
order
by
`sa`
.
`create_date`
desc
limit
60
;
CREATE
ALGORITHM
=
UNDEFINED
DEFINER
=
`root`
@
`%`
SQL
SECURITY
DEFINER
VIEW
`v_fire_equip_alarm_60list_alarm`
AS
SELECT
`sa`
.
`id`
AS
`id`
,
`ec`
.
`code`
AS
`mRid`
,
`sa`
.
`equipment_specific_name`
AS
`specificName`
,
`sa`
.
`equipment_specific_index_key`
AS
`indexKey`
,
`sa`
.
`equipment_specific_index_name`
AS
`indexName`
,
`sa`
.
`equipment_specific_id`
AS
`specificId`
,
IF
(
`sa`
.
`clean_time`
IS
NOT
NULL
,
'已消除'
,
'未消除'
)
`cleanStatus`
,
`sa`
.
`iot_code`
AS
`iotCode`
,
`sa`
.
`create_date`
AS
`createDate`
FROM
(
`wl_equipment_specific_alarm_log`
`sa`
LEFT
JOIN
`wl_equipment_specific`
`ec`
ON
((
`sa`
.
`equipment_specific_id`
=
`ec`
.
`id`
)))
WHERE
find_in_set
(
'029026401813010000000016'
,
`sa`
.
`system_codes`
)
ORDER
BY
`sa`
.
`create_date`
DESC
LIMIT
60
;
-- CAFS系统4小告警列表前60
-- CAFS系统4小告警列表前60
DROP
VIEW
IF
EXISTS
`v_fire_equip_alarm_60list_cafs`
;
DROP
VIEW
IF
EXISTS
`v_fire_equip_alarm_60list_cafs`
;
CREATE
ALGORITHM
=
UNDEFINED
DEFINER
=
`root`
@
`%`
SQL
SECURITY
DEFINER
VIEW
`v_fire_equip_alarm_60list_cafs`
AS
select
`sa`
.
`id`
AS
`id`
,
`ec`
.
`code`
AS
`mRid`
,
`sa`
.
`equipment_specific_name`
AS
`specificName`
,
`sa`
.
`equipment_specific_index_key`
AS
`indexKey`
,
`sa`
.
`equipment_specific_index_name`
AS
`indexName`
,
`sa`
.
`equipment_specific_id`
AS
`specificId`
,
concat
(
`sa`
.
`equipment_specific_name`
,
`sa`
.
`equipment_specific_index_name`
)
AS
`alamReason`
,
`sa`
.
`iot_code`
AS
`iotCode`
,
`sa`
.
`create_date`
AS
`createDate`
from
(
`wl_equipment_specific_alarm_log`
`sa`
left
join
`wl_equipment_specific`
`ec`
on
((
`sa`
.
`equipment_specific_id`
=
`ec`
.
`id`
)))
where
find_in_set
(
'029026401813010000000023'
,
`sa`
.
`system_codes`
)
order
by
`sa`
.
`create_date`
desc
limit
60
;
CREATE
ALGORITHM
=
UNDEFINED
DEFINER
=
`root`
@
`%`
SQL
SECURITY
DEFINER
VIEW
`v_fire_equip_alarm_60list_cafs`
AS
SELECT
`sa`
.
`id`
AS
`id`
,
`ec`
.
`code`
AS
`mRid`
,
`sa`
.
`equipment_specific_name`
AS
`specificName`
,
`sa`
.
`equipment_specific_index_key`
AS
`indexKey`
,
`sa`
.
`equipment_specific_index_name`
AS
`indexName`
,
`sa`
.
`equipment_specific_id`
AS
`specificId`
,
IF
(
`sa`
.
`clean_time`
IS
NOT
NULL
,
'已消除'
,
'未消除'
)
`cleanStatus`
,
`sa`
.
`iot_code`
AS
`iotCode`
,
`sa`
.
`create_date`
AS
`createDate`
FROM
(
`wl_equipment_specific_alarm_log`
`sa`
LEFT
JOIN
`wl_equipment_specific`
`ec`
ON
((
`sa`
.
`equipment_specific_id`
=
`ec`
.
`id`
)))
WHERE
find_in_set
(
'029026401813010000000023'
,
`sa`
.
`system_codes`
)
ORDER
BY
`sa`
.
`create_date`
DESC
LIMIT
60
;
-- 预混泡沫灭火系统4小告警列表前60
-- 预混泡沫灭火系统4小告警列表前60
DROP
VIEW
IF
EXISTS
`v_fire_equip_alarm_60list_foam`
;
DROP
VIEW
IF
EXISTS
`v_fire_equip_alarm_60list_foam`
;
CREATE
ALGORITHM
=
UNDEFINED
DEFINER
=
`root`
@
`%`
SQL
SECURITY
DEFINER
VIEW
`v_fire_equip_alarm_60list_foam`
AS
select
`sa`
.
`id`
AS
`id`
,
`ec`
.
`code`
AS
`mRid`
,
`sa`
.
`equipment_specific_name`
AS
`specificName`
,
`sa`
.
`equipment_specific_index_key`
AS
`indexKey`
,
`sa`
.
`equipment_specific_index_name`
AS
`indexName`
,
`sa`
.
`equipment_specific_id`
AS
`specificId`
,
concat
(
`sa`
.
`equipment_specific_name`
,
`sa`
.
`equipment_specific_index_name`
)
AS
`alamReason`
,
`sa`
.
`iot_code`
AS
`iotCode`
,
`sa`
.
`create_date`
AS
`createDate`
from
(
`wl_equipment_specific_alarm_log`
`sa`
left
join
`wl_equipment_specific`
`ec`
on
((
`sa`
.
`equipment_specific_id`
=
`ec`
.
`id`
)))
where
find_in_set
(
'029026401813010000000054'
,
`sa`
.
`system_codes`
)
order
by
`sa`
.
`create_date`
desc
limit
60
;
CREATE
ALGORITHM
=
UNDEFINED
DEFINER
=
`root`
@
`%`
SQL
SECURITY
DEFINER
VIEW
`v_fire_equip_alarm_60list_foam`
AS
SELECT
`sa`
.
`id`
AS
`id`
,
`ec`
.
`code`
AS
`mRid`
,
`sa`
.
`equipment_specific_name`
AS
`specificName`
,
`sa`
.
`equipment_specific_index_key`
AS
`indexKey`
,
`sa`
.
`equipment_specific_index_name`
AS
`indexName`
,
`sa`
.
`equipment_specific_id`
AS
`specificId`
,
IF
(
`sa`
.
`clean_time`
IS
NOT
NULL
,
'已消除'
,
'未消除'
)
`cleanStatus`
,
`sa`
.
`iot_code`
AS
`iotCode`
,
`sa`
.
`create_date`
AS
`createDate`
FROM
(
`wl_equipment_specific_alarm_log`
`sa`
LEFT
JOIN
`wl_equipment_specific`
`ec`
ON
((
`sa`
.
`equipment_specific_id`
=
`ec`
.
`id`
)))
WHERE
find_in_set
(
'029026401813010000000054'
,
`sa`
.
`system_codes`
)
ORDER
BY
`sa`
.
`create_date`
DESC
LIMIT
60
;
-- 细水雾涡扇炮系统4小告警列表前60
-- 细水雾涡扇炮系统4小告警列表前60
DROP
VIEW
IF
EXISTS
`v_fire_equip_alarm_60list_foam_mist`
;
DROP
VIEW
IF
EXISTS
`v_fire_equip_alarm_60list_foam_mist`
;
CREATE
ALGORITHM
=
UNDEFINED
DEFINER
=
`root`
@
`%`
SQL
SECURITY
DEFINER
VIEW
`v_fire_equip_alarm_60list_foam_mist`
AS
select
`sa`
.
`id`
AS
`id`
,
`ec`
.
`code`
AS
`mRid`
,
`sa`
.
`equipment_specific_name`
AS
`specificName`
,
`sa`
.
`equipment_specific_index_key`
AS
`indexKey`
,
`sa`
.
`equipment_specific_index_name`
AS
`indexName`
,
`sa`
.
`equipment_specific_id`
AS
`specificId`
,
concat
(
`sa`
.
`equipment_specific_name`
,
`sa`
.
`equipment_specific_index_name`
)
AS
`alamReason`
,
`sa`
.
`iot_code`
AS
`iotCode`
,
`sa`
.
`create_date`
AS
`createDate`
from
(
`wl_equipment_specific_alarm_log`
`sa`
left
join
`wl_equipment_specific`
`ec`
on
((
`sa`
.
`equipment_specific_id`
=
`ec`
.
`id`
)))
where
find_in_set
(
'011023306003010000000082'
,
`sa`
.
`system_codes`
)
order
by
`sa`
.
`create_date`
desc
limit
60
;
CREATE
ALGORITHM
=
UNDEFINED
DEFINER
=
`root`
@
`%`
SQL
SECURITY
DEFINER
VIEW
`v_fire_equip_alarm_60list_foam_mist`
AS
SELECT
`sa`
.
`id`
AS
`id`
,
`ec`
.
`code`
AS
`mRid`
,
`sa`
.
`equipment_specific_name`
AS
`specificName`
,
`sa`
.
`equipment_specific_index_key`
AS
`indexKey`
,
`sa`
.
`equipment_specific_index_name`
AS
`indexName`
,
`sa`
.
`equipment_specific_id`
AS
`specificId`
,
IF
(
`sa`
.
`clean_time`
IS
NOT
NULL
,
'已消除'
,
'未消除'
)
`cleanStatus`
,
`sa`
.
`iot_code`
AS
`iotCode`
,
`sa`
.
`create_date`
AS
`createDate`
FROM
(
`wl_equipment_specific_alarm_log`
`sa`
LEFT
JOIN
`wl_equipment_specific`
`ec`
ON
((
`sa`
.
`equipment_specific_id`
=
`ec`
.
`id`
)))
WHERE
find_in_set
(
'011023306003010000000082'
,
`sa`
.
`system_codes`
)
ORDER
BY
`sa`
.
`create_date`
DESC
LIMIT
60
;
-- 排油系统4小告警列表前60
-- 排油系统4小告警列表前60
DROP
VIEW
IF
EXISTS
`v_fire_equip_alarm_60list_ONL`
;
DROP
VIEW
IF
EXISTS
`v_fire_equip_alarm_60list_onl`
;
CREATE
ALGORITHM
=
UNDEFINED
DEFINER
=
`root`
@
`%`
SQL
SECURITY
DEFINER
VIEW
`v_fire_equip_alarm_60list_onl`
AS
select
`sa`
.
`id`
AS
`id`
,
`ec`
.
`code`
AS
`mRid`
,
`sa`
.
`equipment_specific_name`
AS
`specificName`
,
`sa`
.
`equipment_specific_index_key`
AS
`indexKey`
,
`sa`
.
`equipment_specific_index_name`
AS
`indexName`
,
`sa`
.
`equipment_specific_id`
AS
`specificId`
,
concat
(
`sa`
.
`equipment_specific_name`
,
`sa`
.
`equipment_specific_index_name`
)
AS
`alamReason`
,
`sa`
.
`iot_code`
AS
`iotCode`
,
`sa`
.
`create_date`
AS
`createDate`
from
(
`wl_equipment_specific_alarm_log`
`sa`
left
join
`wl_equipment_specific`
`ec`
on
((
`sa`
.
`equipment_specific_id`
=
`ec`
.
`id`
)))
where
find_in_set
(
'029026401813010000000030'
,
`sa`
.
`system_codes`
)
order
by
`sa`
.
`create_date`
desc
limit
60
;
CREATE
ALGORITHM
=
UNDEFINED
DEFINER
=
`root`
@
`%`
SQL
SECURITY
DEFINER
VIEW
`v_fire_equip_alarm_60list_onl`
AS
SELECT
`sa`
.
`id`
AS
`id`
,
`ec`
.
`code`
AS
`mRid`
,
`sa`
.
`equipment_specific_name`
AS
`specificName`
,
`sa`
.
`equipment_specific_index_key`
AS
`indexKey`
,
`sa`
.
`equipment_specific_index_name`
AS
`indexName`
,
`sa`
.
`equipment_specific_id`
AS
`specificId`
,
IF
(
`sa`
.
`clean_time`
IS
NOT
NULL
,
'已消除'
,
'未消除'
)
`cleanStatus`
,
`sa`
.
`iot_code`
AS
`iotCode`
,
`sa`
.
`create_date`
AS
`createDate`
FROM
(
`wl_equipment_specific_alarm_log`
`sa`
LEFT
JOIN
`wl_equipment_specific`
`ec`
ON
((
`sa`
.
`equipment_specific_id`
=
`ec`
.
`id`
)))
WHERE
find_in_set
(
'029026401813010000000030'
,
`sa`
.
`system_codes`
)
ORDER
BY
`sa`
.
`create_date`
DESC
LIMIT
60
;
-- 消防给水系统4小告警列表前60
-- 消防给水系统4小告警列表前60
DROP
VIEW
IF
EXISTS
`v_fire_equip_alarm_60list_water`
;
DROP
VIEW
IF
EXISTS
`v_fire_equip_alarm_60list_water`
;
CREATE
ALGORITHM
=
UNDEFINED
DEFINER
=
`root`
@
`%`
SQL
SECURITY
DEFINER
VIEW
`v_fire_equip_alarm_60list_water`
AS
select
`sa`
.
`id`
AS
`id`
,
`ec`
.
`code`
AS
`mRid`
,
`sa`
.
`equipment_specific_name`
AS
`specificName`
,
`sa`
.
`equipment_specific_index_key`
AS
`indexKey`
,
`sa`
.
`equipment_specific_index_name`
AS
`indexName`
,
`sa`
.
`equipment_specific_id`
AS
`specificId`
,
concat
(
`sa`
.
`equipment_specific_name`
,
`sa`
.
`equipment_specific_index_name`
)
AS
`alamReason`
,
`sa`
.
`iot_code`
AS
`iotCode`
,
`sa`
.
`create_date`
AS
`createDate`
from
(
`wl_equipment_specific_alarm_log`
`sa`
left
join
`wl_equipment_specific`
`ec`
on
((
`sa`
.
`equipment_specific_id`
=
`ec`
.
`id`
)))
where
find_in_set
(
'029026401813010000000047'
,
`sa`
.
`system_codes`
)
order
by
`sa`
.
`create_date`
desc
limit
60
;
CREATE
ALGORITHM
=
UNDEFINED
DEFINER
=
`root`
@
`%`
SQL
SECURITY
DEFINER
VIEW
`v_fire_equip_alarm_60list_water`
AS
SELECT
`sa`
.
`id`
AS
`id`
,
`ec`
.
`code`
AS
`mRid`
,
`sa`
.
`equipment_specific_name`
AS
`specificName`
,
`sa`
.
`equipment_specific_index_key`
AS
`indexKey`
,
`sa`
.
`equipment_specific_index_name`
AS
`indexName`
,
`sa`
.
`equipment_specific_id`
AS
`specificId`
,
IF
(
`sa`
.
`clean_time`
IS
NOT
NULL
,
'已消除'
,
'未消除'
)
`cleanStatus`
,
`sa`
.
`iot_code`
AS
`iotCode`
,
`sa`
.
`create_date`
AS
`createDate`
FROM
(
`wl_equipment_specific_alarm_log`
`sa`
LEFT
JOIN
`wl_equipment_specific`
`ec`
ON
((
`sa`
.
`equipment_specific_id`
=
`ec`
.
`id`
)))
WHERE
find_in_set
(
'029026401813010000000047'
,
`sa`
.
`system_codes`
)
ORDER
BY
`sa`
.
`create_date`
DESC
LIMIT
60
;
-- 消防人员视图
-- 消防人员视图
DROP
VIEW
IF
EXISTS
`v_fire_fighter`
;
DROP
VIEW
IF
EXISTS
`v_fire_fighter`
;
...
...
amos-boot-system-equip/src/main/resources/changelog/wl-3.0.1.xml
View file @
997d6888
...
@@ -2238,6 +2238,7 @@
...
@@ -2238,6 +2238,7 @@
</sql>
</sql>
</changeSet>
</changeSet>
<changeSet
author=
"tw"
id=
"20220104-5"
>
<changeSet
author=
"tw"
id=
"20220104-5"
>
<preConditions
onFail=
"MARK_RAN"
>
<preConditions
onFail=
"MARK_RAN"
>
<not>
<not>
...
@@ -2275,4 +2276,26 @@
...
@@ -2275,4 +2276,26 @@
<changeSet
author=
"keyong"
id=
"1641367742-1"
>
<preConditions
onFail=
"MARK_RAN"
>
<not>
<columnExists
tableName=
"wl_equipment_specific_alarm_log"
columnName=
"clean_time"
/>
</not>
</preConditions>
<comment>
wl_equipment_specific_alarm_log add column clean_time
</comment>
<sql>
alter table `wl_equipment_specific_alarm_log` add column `clean_time` datetime DEFAULT NULL COMMENT '消除时间';
</sql>
</changeSet>
<changeSet
author=
"keyong"
id=
"1641367742-2"
>
<preConditions
onFail=
"MARK_RAN"
>
<not>
<columnExists
tableName=
"wl_equipment"
columnName=
"clean_type"
/>
</not>
</preConditions>
<comment>
wl_equipment add column clean_type
</comment>
<sql>
ALTER TABLE wl_equipment ADD COLUMN clean_type varchar(50) DEFAULT NULL COMMENT '警情消除方式(0:收到复位信号自动消除;1:警情处理确认后消除)';
</sql>
</changeSet>
</databaseChangeLog>
</databaseChangeLog>
\ No newline at end of file
amos-boot-system-equip/src/main/resources/mapper/ConfirmAlarmMapper.xml
View file @
997d6888
...
@@ -44,7 +44,9 @@
...
@@ -44,7 +44,9 @@
confirm_user,
confirm_user,
confirm_user_name,
confirm_user_name,
confirm_date,
confirm_date,
(SELECT GROUP_CONCAT(fem.name) FROM `f_fire_fighting_system` fem WHERE find_in_set(fem.id,spe.system_id)) as systemName
(SELECT GROUP_CONCAT(fem.name) FROM `f_fire_fighting_system` fem WHERE find_in_set(fem.id,spe.system_id)) as systemName,
if(ala.clean_time is null, '未清除', '已清除') AS cleanStatus,
ala.clean_time
from
from
wl_equipment_specific_alarm_log as ala
wl_equipment_specific_alarm_log as ala
left join wl_equipment_specific as spe on spe.id = ala.equipment_specific_id
left join wl_equipment_specific as spe on spe.id = ala.equipment_specific_id
...
...
amos-boot-system-equip/src/main/resources/mapper/EquipmentSpecificAlarmMapper.xml
View file @
997d6888
...
@@ -180,6 +180,11 @@
...
@@ -180,6 +180,11 @@
fireEquipmentName,
fireEquipmentName,
concat(wlesal.equipment_specific_name,wlesal.equipment_specific_index_name) as alamContent,
concat(wlesal.equipment_specific_name,wlesal.equipment_specific_index_name) as alamContent,
if(confirm_type is null,'未处理','已处理') handleStatus,
if(confirm_type is null,'未处理','已处理') handleStatus,
IF (
wlesal.clean_time IS NOT NULL,
'已消除',
'未消除'
) cleanStatus,
confirm_type as handleType,
confirm_type as handleType,
wlesal.equipment_index_id AS fireEquipmentIndexId,
wlesal.equipment_index_id AS fireEquipmentIndexId,
wlesal.equipment_specific_index_key AS fireEquipmentSpecificIndexKey,
wlesal.equipment_specific_index_key AS fireEquipmentSpecificIndexKey,
...
@@ -237,6 +242,13 @@
...
@@ -237,6 +242,13 @@
open=
"("
close=
")"
index=
""
>
#{item}
open=
"("
close=
")"
index=
""
>
#{item}
</foreach>
</foreach>
</if>
</if>
<if
test=
"param.id!=null and param.id!=''"
>
AND d.fireEquipmentId = #{param.id}
</if>
<if
test=
"param.cleanStatus != null and param.cleanStatus != '' and param.cleanStatus == 1"
>
AND
d.cleanStatus = '已消除'
</if>
<if
test=
"param.cleanStatus != null and param.cleanStatus != '' and param.cleanStatus == 2"
>
AND
d.cleanStatus = '未消除'
</if>
</where>
</where>
ORDER BY d.createDate DESC
ORDER BY d.createDate DESC
</select>
</select>
...
@@ -294,6 +306,16 @@
...
@@ -294,6 +306,16 @@
'已处理',
'已处理',
'去确认'
'去确认'
) handleStatus,
) handleStatus,
IF (
wlesal.clean_time IS NOT NULL,
'已消除',
'未消除'
) cleanStatus,
IF (
wlesal.clean_time IS NOT NULL,
'1',
'2'
) cleanStatusVal,
wlesal.confirm_type AS handleType,
wlesal.confirm_type AS handleType,
wlesal.system_codes AS systemCodes,
wlesal.system_codes AS systemCodes,
wlesal.equipment_index_id AS fireEquipmentIndexId,
wlesal.equipment_index_id AS fireEquipmentIndexId,
...
@@ -344,10 +366,16 @@
...
@@ -344,10 +366,16 @@
<when
test=
"param.confirmType != null and param.confirmType != '' and param.confirmType == 0"
>
<when
test=
"param.confirmType != null and param.confirmType != '' and param.confirmType == 0"
>
AND d.handleType IS NULL
AND d.handleType IS NULL
</when>
</when>
<when
test=
"param.confirmType != null and param.confirmType != '' and param.confirmType == 2"
>
AND d.cleanStatus = '未消除'
</when>
<when
test=
"param.confirmType != null and param.confirmType != '' and param.confirmType == 3"
>
AND d.cleanStatus = '已消除'
</when>
</choose>
</choose>
<if
test=
"param.beginDate!=null"
>
AND d.createDate
<![CDATA[>=]]>
#{param.beginDate}
</if>
<if
test=
"param.beginDate!=null"
>
AND d.createDate
<![CDATA[>=]]>
#{param.beginDate}
</if>
<if
test=
"param.endDate!=null"
>
AND d.createDate
<![CDATA[<=]]>
#{param.endDate}
</if>
<if
test=
"param.endDate!=null"
>
AND d.createDate
<![CDATA[<=]]>
#{param.endDate}
</if>
<if
test=
"param.alarmType
== 'BREAKDOWN' or param.alarmType == 'FIREALARM
'"
>
AND d.type = #{param.alarmType}
</if>
<if
test=
"param.alarmType
!= null and param.alarmType != '
'"
>
AND d.type = #{param.alarmType}
</if>
<if
test=
"param.systemCode != null and param.systemCode != ''"
>
<if
test=
"param.systemCode != null and param.systemCode != ''"
>
AND find_in_set(#{param.systemCode},d.systemCodes)
AND find_in_set(#{param.systemCode},d.systemCodes)
</if>
</if>
...
@@ -358,6 +386,12 @@
...
@@ -358,6 +386,12 @@
</if>
</if>
<if
test=
"param.id!=null and param.id!=''"
>
AND d.fireEquipmentId = #{param.id}
</if>
<if
test=
"param.id!=null and param.id!=''"
>
AND d.fireEquipmentId = #{param.id}
</if>
<if
test=
"param.status!=null and param.status!=3"
>
AND d.status = #{param.status}
</if>
<if
test=
"param.status!=null and param.status!=3"
>
AND d.status = #{param.status}
</if>
<if
test=
"param.cleanStatus != null and param.cleanStatus != '' and param.cleanStatus == 1"
>
AND
d.cleanStatus = '已消除'
</if>
<if
test=
"param.cleanStatus != null and param.cleanStatus != '' and param.cleanStatus == 2"
>
AND
d.cleanStatus = '未消除'
</if>
ORDER BY d.createDate DESC
ORDER BY d.createDate DESC
</select>
</select>
<select
id=
"getAlarmList"
resultType=
"java.util.HashMap"
>
<select
id=
"getAlarmList"
resultType=
"java.util.HashMap"
>
...
...
amos-boot-system-equip/src/main/resources/mapper/EquipmentSpecificMapper.xml
View file @
997d6888
...
@@ -1453,5 +1453,15 @@
...
@@ -1453,5 +1453,15 @@
and e.category_id = c.id
and e.category_id = c.id
and s.biz_org_code
<![CDATA[<>]]>
''
and s.biz_org_code
<![CDATA[<>]]>
''
GROUP BY s.biz_org_code ,c.code
GROUP BY s.biz_org_code ,c.code
<select
id=
"getEquipmentBySpecificId"
resultType=
"String"
>
select
we.clean_type
from
wl_Equipment we
LEFT JOIN `wl_equipment_detail` wed ON wed.equipment_id = we.id
LEFT JOIN `wl_equipment_specific` wes ON wes.equipment_detail_id = wed.id
where
wes.id = #{specificId}
</select>
</select>
</mapper>
</mapper>
\ No newline at end of file
amos-boot-system-equip/src/main/resources/mapper/FireFightingSystemMapper.xml
View file @
997d6888
...
@@ -489,8 +489,10 @@
...
@@ -489,8 +489,10 @@
d.fireEquipmentName,
d.fireEquipmentName,
d.warehouseStructureName,
d.warehouseStructureName,
d.fireEquipmentSpecificIndexName,
d.fireEquipmentSpecificIndexName,
d.createDate,d.confirmType,
d.createDate,
d.type
d.confirmType,
d.type,
d.cleanStatus
FROM
FROM
(
(
SELECT
SELECT
...
@@ -501,7 +503,8 @@
...
@@ -501,7 +503,8 @@
wlesal.equipment_index_id AS fireEquipmentIndexId,
wlesal.equipment_index_id AS fireEquipmentIndexId,
wlesal.equipment_specific_index_key AS fireEquipmentSpecificIndexKey,
wlesal.equipment_specific_index_key AS fireEquipmentSpecificIndexKey,
wlesal.equipment_specific_index_name AS fireEquipmentSpecificIndexName,
wlesal.equipment_specific_index_name AS fireEquipmentSpecificIndexName,
if(wlesal.confirm_type IS NULL,0,1) AS confirmType,
if(wlesal.confirm_type IS NULL, 0, 1) AS confirmType,
if(wlesal.clean_time IS NULL, 0, 1) AS cleanStatus,
CASE
CASE
wlesal.equipment_specific_index_value
wlesal.equipment_specific_index_value
WHEN 'true' THEN
WHEN 'true' THEN
...
@@ -549,6 +552,12 @@
...
@@ -549,6 +552,12 @@
<if
test=
'confirmType != null and confirmType == 1'
>
<if
test=
'confirmType != null and confirmType == 1'
>
and wlesal.confirm_type IS NOT NULL
and wlesal.confirm_type IS NOT NULL
</if>
</if>
<if
test=
'confirmType != null and confirmType == 2'
>
and wlesal.clean_time IS NULL
</if>
<if
test=
'confirmType != null and confirmType == 3'
>
and wlesal.clean_time IS NOT NULL
</if>
</where>
</where>
) d
) d
<where>
<where>
...
...
amos-boot-system-equip/src/main/resources/mapper/VideoEquipmentSpecificMapper.xml
0 → 100644
View file @
997d6888
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.yeejoin.equipmanage.mapper.VideoEquipmentSpecificMapper"
>
<select
id=
"findBySpecificIdAndVideoIdIn"
resultType=
"com.yeejoin.equipmanage.common.entity.VideoEquipmentSpecific"
>
SELECT
v.id,
v.equipment_specific_id AS equipmentSpecificId,
v.video_id AS videoId
FROM
`wl_video_equipment_specific` v
<where>
<if
test=
"equipmentSpecificId != null"
>
v.equipment_specific_id = #{equipmentSpecificId}
</if>
<if
test=
"list != null and list.size() >0"
>
AND v.video_id IN
<foreach
collection=
"list"
item=
"item"
index=
"index"
open=
"("
close=
")"
separator=
","
>
#{item}
</foreach>
</if>
</where>
</select>
</mapper>
amos-boot-system-latentdanger/src/main/resources/db/mapper/LatentDangerMapper.xml
View file @
997d6888
...
@@ -967,10 +967,13 @@
...
@@ -967,10 +967,13 @@
and a.biz_type = #{value}
and a.biz_type = #{value}
</if>
</if>
<if
test=
"key == 'dangerIds' and value != null"
>
<if
test=
"key == 'dangerIds' and value != null"
>
and a.id IN
and
(
a.id IN
<foreach
collection=
"value"
item=
"id"
open=
"("
separator=
","
close=
")"
>
<foreach
collection=
"value"
item=
"id"
open=
"("
separator=
","
close=
")"
>
#{id}
#{id}
</foreach>
</foreach>
<if
test=
"paramMap['my'] == 0"
>
or a.danger_state = #{paramMap[submitDangerState]}
</if>
)
</if>
</if>
<if
test=
"key == 'dangerState' and value != null and !value.isEmpty()"
>
<if
test=
"key == 'dangerState' and value != null and !value.isEmpty()"
>
and a.danger_state IN
and a.danger_state IN
...
...
amos-boot-system-maintenance/src/main/resources/db/changelog/mt-1.0.0.xml
View file @
997d6888
...
@@ -289,4 +289,15 @@
...
@@ -289,4 +289,15 @@
ALTER TABLE p_check add COLUMN `owner_name` varchar(255) DEFAULT NULL COMMENT '业主单位名称' after `owner_id`;
ALTER TABLE p_check add COLUMN `owner_name` varchar(255) DEFAULT NULL COMMENT '业主单位名称' after `owner_id`;
</sql>
</sql>
</changeSet>
</changeSet>
<changeSet
author=
"suhuiguang"
id=
"1641519644827-01"
>
<preConditions
onFail=
"MARK_RAN"
>
<columnExists
tableName=
"p_check"
columnName=
"point_no"
/>
</preConditions>
<comment>
p_check MODIFY `point_no`
</comment>
<sql>
alter table p_check MODIFY `point_no` varchar(100) DEFAULT NULL COMMENT '编号';
</sql>
</changeSet>
</databaseChangeLog>
</databaseChangeLog>
\ No newline at end of file
amos-boot-system-supervision/src/main/resources/db/mapper/HiddenDangerMapper.xml
View file @
997d6888
...
@@ -9,10 +9,10 @@
...
@@ -9,10 +9,10 @@
ci.input_name as inputItemName,
ci.input_name as inputItemName,
ci.user_name as checkUserName,
ci.user_name as checkUserName,
ci.create_date as checkTime,
ci.create_date as checkTime,
c.point_n
ame
pp.name as pointN
ame
FROM `p_hidden_danger` phd
FROM `p_hidden_danger` phd
left join p_check_input ci on phd.check_input_id = ci.id
left join p_check_input ci on phd.check_input_id = ci.id
left join p_
check c on c.id = phd.check
_id
left join p_
point pp on pp.id = phd.point
_id
<where>
<where>
<if
test=
"planId !=null and planId != ''"
>
and phd.plan_id=#{planId}
</if>
<if
test=
"planId !=null and planId != ''"
>
and phd.plan_id=#{planId}
</if>
<if
test=
"pointId !=null and pointId != ''"
>
and phd.point_id=#{pointId}
</if>
<if
test=
"pointId !=null and pointId != ''"
>
and phd.point_id=#{pointId}
</if>
...
...
amos-boot-system-supervision/src/main/resources/db/mapper/dbTemplate_check.xml
View file @
997d6888
...
@@ -51,7 +51,7 @@
...
@@ -51,7 +51,7 @@
<if
test=
"catalogId!=null"
>
and b.Catalog_Id = #{catalogId}
</if>
<if
test=
"catalogId!=null"
>
and b.Catalog_Id = #{catalogId}
</if>
<if
test=
"orgCode!=null"
>
and (a.org_Code like concat (#{orgCode},"-%")or a.org_Code= #{orgCode})
</if>
<if
test=
"orgCode!=null"
>
and (a.org_Code like concat (#{orgCode},"-%")or a.org_Code= #{orgCode})
</if>
<if
test=
"pointId!=null"
>
and a.point_id = #{pointId}
</if>
<if
test=
"pointId!=null"
>
and a.point_id = #{pointId}
</if>
<if
test=
"departmentId!=null and departmentId!='-1'"
>
and find_in_set(#{departmentId}, a.dep_id) > 0
</if>
<if
test=
"departmentId!=null and departmentId!='-1'"
>
and find_in_set(#{departmentId}, a.dep_id) > 0
</if>
<choose>
<choose>
<when
test=
"finishStatus == 0"
>
and (`a`.`plan_task_detail_id` = 0 OR `a`.`plan_task_detail_id` is
<when
test=
"finishStatus == 0"
>
and (`a`.`plan_task_detail_id` = 0 OR `a`.`plan_task_detail_id` is
null)
null)
...
@@ -109,7 +109,8 @@
...
@@ -109,7 +109,8 @@
LEFT JOIN `p_route` `d` ON `a`.`route_id` = `d`.`id`
LEFT JOIN `p_route` `d` ON `a`.`route_id` = `d`.`id`
LEFT JOIN `p_plan` `e` ON `a`.`plan_id` = `e`.`id`
LEFT JOIN `p_plan` `e` ON `a`.`plan_id` = `e`.`id`
<if
test=
"dangerId != null and dangerId != ''"
>
<if
test=
"dangerId != null and dangerId != ''"
>
LEFT JOIN ( SELECT check_id, GROUP_CONCAT( latent_danger_id ) dangerIds FROM p_latent_danger_patrol GROUP BY check_id ) t ON t.check_id = a.id
LEFT JOIN ( SELECT check_id, GROUP_CONCAT( latent_danger_id ) dangerIds FROM p_latent_danger_patrol GROUP BY
check_id ) t ON t.check_id = a.id
</if>
</if>
<trim
prefix=
"WHERE"
prefixOverrides=
"AND "
>
<trim
prefix=
"WHERE"
prefixOverrides=
"AND "
>
<if
test=
"beginDate!=null and endDate!=null"
>
and a.check_time BETWEEN #{beginDate} and #{endDate}
</if>
<if
test=
"beginDate!=null and endDate!=null"
>
and a.check_time BETWEEN #{beginDate} and #{endDate}
</if>
...
@@ -127,7 +128,7 @@
...
@@ -127,7 +128,7 @@
<if
test=
"orgCode!=null"
>
and (a.org_Code like concat (#{orgCode},"-%")or a.org_Code= #{orgCode})
</if>
<if
test=
"orgCode!=null"
>
and (a.org_Code like concat (#{orgCode},"-%")or a.org_Code= #{orgCode})
</if>
<if
test=
"pointId!=null"
>
and a.point_id = #{pointId}
</if>
<if
test=
"pointId!=null"
>
and a.point_id = #{pointId}
</if>
<if
test=
"checkTime!=null"
>
and TO_DAYS(a.check_time) = TO_DAYS('${checkTime}')
</if>
<if
test=
"checkTime!=null"
>
and TO_DAYS(a.check_time) = TO_DAYS('${checkTime}')
</if>
<if
test=
"departmentId!=null and departmentId!='-1'"
>
and find_in_set(#{departmentId}, a.dep_id) > 0
</if>
<if
test=
"departmentId!=null and departmentId!='-1'"
>
and find_in_set(#{departmentId}, a.dep_id) > 0
</if>
<if
test=
"checkType == '计划检查'"
>
and a.plan_task_id
>
0
</if>
<if
test=
"checkType == '计划检查'"
>
and a.plan_task_id
>
0
</if>
<if
test=
"checkType == '无计划检查'"
>
and a.plan_task_id
<
= 0
</if>
<if
test=
"checkType == '无计划检查'"
>
and a.plan_task_id
<
= 0
</if>
<choose>
<choose>
...
@@ -211,7 +212,8 @@
...
@@ -211,7 +212,8 @@
order by ci.order_no
order by ci.order_no
</select>
</select>
<select
id=
"findCheckPointInputItem"
resultType=
"com.yeejoin.amos.supervision.business.entity.mybatis.PointCheckDetailBo"
<select
id=
"findCheckPointInputItem"
resultType=
"com.yeejoin.amos.supervision.business.entity.mybatis.PointCheckDetailBo"
parameterType=
"long"
>
parameterType=
"long"
>
SELECT
SELECT
pp.id pointId,
pp.id pointId,
...
@@ -250,16 +252,16 @@
...
@@ -250,16 +252,16 @@
order by pci.order_no
order by pci.order_no
</select>
</select>
<!-- <select id="checkHasRecord" resultType="int">-->
<!-- <select id="checkHasRecord" resultType="int">-->
<!-- SELECT-->
<!-- SELECT-->
<!-- count(1) num-->
<!-- count(1) num-->
<!-- FROM-->
<!-- FROM-->
<!-- p_check c-->
<!-- p_check c-->
<!-- WHERE-->
<!-- WHERE-->
<!-- is_ok in (1,2)-->
<!-- is_ok in (1,2)-->
<!-- and c.point_id = #{pointId}-->
<!-- and c.point_id = #{pointId}-->
<!-- and c.plan_task_id = #{planTaskId}-->
<!-- and c.plan_task_id = #{planTaskId}-->
<!-- </select>-->
<!-- </select>-->
<select
id=
"pieChartData"
resultType=
"Map"
>
<select
id=
"pieChartData"
resultType=
"Map"
>
SELECT
SELECT
...
@@ -475,7 +477,7 @@
...
@@ -475,7 +477,7 @@
<when
test=
"finishStatus == 1"
>
and (`a`.`plan_task_detail_id` != 0 AND `a`.`is_ok` != 3)
</when>
<when
test=
"finishStatus == 1"
>
and (`a`.`plan_task_detail_id` != 0 AND `a`.`is_ok` != 3)
</when>
<when
test=
"finishStatus == 2"
>
and `a`.`is_ok` = 3
</when>
<when
test=
"finishStatus == 2"
>
and `a`.`is_ok` = 3
</when>
</choose>
</choose>
<if
test=
"departmentId!=null"
>
and find_in_set(#{departmentId},a.dep_id)>0
</if>
<if
test=
"departmentId!=null"
>
and find_in_set(#{departmentId},a.dep_id)>0
</if>
</trim>
</trim>
</select>
</select>
...
@@ -795,12 +797,13 @@
...
@@ -795,12 +797,13 @@
FROM
FROM
p_point_classify classify
p_point_classify classify
<where>
<where>
classify.id IN ( SELECT pci.point_classify_id FROM p_check_input pci WHERE
<if
test=
"checkID != null"
>
pci.check_id = #{checkID}
</if>
)
classify.id IN ( SELECT pci.point_classify_id FROM p_check_input pci WHERE
<if
test=
"checkID != null"
>
pci.check_id = #{checkID}
</if>
)
</where>
</where>
</select>
</select>
<!-- 根据巡检记录ID和巡检点ID获取巡检项信息 -->
<!-- 根据巡检记录ID和巡检点ID获取巡检项信息 -->
<select
id=
"getCheckInputByCheckId"
resultMap=
"checkInputResultMap"
>
<select
id=
"getCheckInputByCheckId"
resultMap=
"checkInputResultMap"
>
SELECT
SELECT
...
@@ -856,7 +859,8 @@
...
@@ -856,7 +859,8 @@
FROM p_check_input pci WHERE
FROM p_check_input pci WHERE
<if
test=
"pointID != null"
>
<if
test=
"pointID != null"
>
pci.check_id = #{checkID}
pci.check_id = #{checkID}
</if>
)
</if>
)
</select>
</select>
<!-- 根据巡检记录ID和巡检点ID获取巡检项信息 -->
<!-- 根据巡检记录ID和巡检点ID获取巡检项信息 -->
<select
id=
"getEquipInputByCheckId"
resultType=
"java.util.HashMap"
>
<select
id=
"getEquipInputByCheckId"
resultType=
"java.util.HashMap"
>
...
@@ -1092,7 +1096,8 @@
...
@@ -1092,7 +1096,8 @@
<!-- 风险点最新巡检信息查询,3d屏使用 -->
<!-- 风险点最新巡检信息查询,3d屏使用 -->
<resultMap
id=
"planRoutePointResultMap"
type=
"com.yeejoin.amos.supervision.business.entity.mybatis.PlanRoutePointBo"
>
<resultMap
id=
"planRoutePointResultMap"
type=
"com.yeejoin.amos.supervision.business.entity.mybatis.PlanRoutePointBo"
>
<result
property=
"routeName"
column=
"route_name"
/>
<result
property=
"routeName"
column=
"route_name"
/>
<result
property=
"planName"
column=
"plan_name"
/>
<result
property=
"planName"
column=
"plan_name"
/>
<result
property=
"deptName"
column=
"department_name"
/>
<result
property=
"deptName"
column=
"department_name"
/>
...
@@ -1189,7 +1194,7 @@
...
@@ -1189,7 +1194,7 @@
) sa
) sa
<where>
<where>
c.plan_id = sa.id
c.plan_id = sa.id
<if
test=
"userId != null"
>
AND find_in_set(#{userId}, sa.user_id) >0
</if>
<if
test=
"userId != null"
>
AND find_in_set(#{userId}, sa.user_id) >0
</if>
<if
test=
"checkDate != null"
>
AND DATE_FORMAT(c.check_time, '%Y%m%d') = DATE_FORMAT(#{checkDate}, '%Y%m%d')
<if
test=
"checkDate != null"
>
AND DATE_FORMAT(c.check_time, '%Y%m%d') = DATE_FORMAT(#{checkDate}, '%Y%m%d')
</if>
</if>
</where>
</where>
...
@@ -1235,7 +1240,7 @@
...
@@ -1235,7 +1240,7 @@
) sa
) sa
WHERE
WHERE
d.plan_id = sa.planID
d.plan_id = sa.planID
<if
test=
"userId != null"
>
AND find_in_set(#{userId},
sa.userID)>0
</if>
<if
test=
"userId != null"
>
AND find_in_set(#{userId},
sa.userID)>0
</if>
<if
test=
"checkDate != null"
>
AND DATE_FORMAT(d.check_time, '%y%m%d') = #{checkDate}
</if>
<if
test=
"checkDate != null"
>
AND DATE_FORMAT(d.check_time, '%y%m%d') = #{checkDate}
</if>
ORDER BY d.id DESC
ORDER BY d.id DESC
) temp_row
) temp_row
...
@@ -1685,7 +1690,7 @@
...
@@ -1685,7 +1690,7 @@
ADDDATE(#{startTime} , INTERVAL @d DAY)
<![CDATA[ < ]]>
DATE_FORMAT(#{endTime}, '%Y-%m-%d')
ADDDATE(#{startTime} , INTERVAL @d DAY)
<![CDATA[ < ]]>
DATE_FORMAT(#{endTime}, '%Y-%m-%d')
) d LEFT JOIN p_check c ON DATE_FORMAT(c.check_time, '%Y-%m-%d') = d.date
) d LEFT JOIN p_check c ON DATE_FORMAT(c.check_time, '%Y-%m-%d') = d.date
<if
test=
" orgCode != null and orgCode != '' "
>
and position( #{orgCode} in c.org_code )
</if>
<if
test=
" orgCode != null and orgCode != '' "
>
and position( #{orgCode} in c.org_code )
</if>
<if
test=
" userId != null and userId != '' "
>
and find_in_set(#{userId}, c.user_id)>0
</if>
<if
test=
" userId != null and userId != '' "
>
and find_in_set(#{userId}, c.user_id)>0
</if>
<if
test=
"type == 1"
>
and c.is_ok != #{param}
</if>
<if
test=
"type == 1"
>
and c.is_ok != #{param}
</if>
<if
test=
"type == 2"
>
and c.plan_id != #{param}
</if>
<if
test=
"type == 2"
>
and c.plan_id != #{param}
</if>
<if
test=
"type == 3"
>
and c.is_ok = #{param}
</if>
<if
test=
"type == 3"
>
and c.is_ok = #{param}
</if>
...
@@ -1698,50 +1703,50 @@
...
@@ -1698,50 +1703,50 @@
</select>
</select>
<!-- 巡检记录查询 -->
<!-- 巡检记录查询 -->
<!-- <select id="getCheckInfoList1" resultMap="CheckInfoResultMap">-->
<!-- <select id="getCheckInfoList1" resultMap="CheckInfoResultMap">-->
<!-- select * from (-->
<!-- select * from (-->
<!-- SELECT-->
<!-- SELECT-->
<!-- DATE_FORMAT(c.check_time, '%Y-%m-%d %T') as checkTime,-->
<!-- DATE_FORMAT(c.check_time, '%Y-%m-%d %T') as checkTime,-->
<!-- c.user_id as UserID,-->
<!-- c.user_id as UserID,-->
<!-- c.point_id as PointID,-->
<!-- c.point_id as PointID,-->
<!-- c.id as CheckID,-->
<!-- c.id as CheckID,-->
<!-- c.is_ok as IsOK,-->
<!-- c.is_ok as IsOK,-->
<!-- c.error as ErrorMsg,-->
<!-- c.error as ErrorMsg,-->
<!-- c.plan_task_id as ErrorID,-->
<!-- c.plan_task_id as ErrorID,-->
<!-- p.name as pointName,-->
<!-- p.name as pointName,-->
<!-- c.dep_name as NAME,-->
<!-- c.dep_name as NAME,-->
<!-- c.dep_id as GroupID,-->
<!-- c.dep_id as GroupID,-->
<!-- c.user_name as RealName,-->
<!-- c.user_name as RealName,-->
<!-- (SELECT-->
<!-- (SELECT-->
<!-- GROUP_CONCAT(-->
<!-- GROUP_CONCAT(-->
<!-- IFNULL(case when u.mobile = '' or u.mobile is null then null else u.mobile END,u.telephone)-->
<!-- IFNULL(case when u.mobile = '' or u.mobile is null then null else u.mobile END,u.telephone)-->
<!-- )-->
<!-- )-->
<!-- FROM-->
<!-- FROM-->
<!-- s_user u-->
<!-- s_user u-->
<!-- WHERE-->
<!-- WHERE-->
<!-- find_in_set(u.id,c.user_id)>0) as LoginName,-->
<!-- find_in_set(u.id,c.user_id)>0) as LoginName,-->
<!-- c.org_code as orgCode-->
<!-- c.org_code as orgCode-->
<!-- FROM-->
<!-- FROM-->
<!-- p_check c,-->
<!-- p_check c,-->
<!-- p_point p-->
<!-- p_point p-->
<!-- where-->
<!-- where-->
<!-- p.id =c.point_id ) as a-->
<!-- p.id =c.point_id ) as a-->
<!-- <trim prefix="WHERE" prefixOverrides="AND ">-->
<!-- <trim prefix="WHERE" prefixOverrides="AND ">-->
<!-- <if test="pointID!=null">AND a.PointID = #{pointID}</if>-->
<!-- <if test="pointID!=null">AND a.PointID = #{pointID}</if>-->
<!-- <if test="checkTime!=null">AND DATE_FORMAT(a.CheckTime, '%Y%m%d') = #{checkTime}</if>-->
<!-- <if test="checkTime!=null">AND DATE_FORMAT(a.CheckTime, '%Y%m%d') = #{checkTime}</if>-->
<!-- <if test="userID!=null and userID!=-1 ">AND find_in_set(#{userID}, a.userID)>0 </if>-->
<!-- <if test="userID!=null and userID!=-1 ">AND find_in_set(#{userID}, a.userID)>0 </if>-->
<!-- <if test="status!=null">AND a.IsOK = #{status}</if>-->
<!-- <if test="status!=null">AND a.IsOK = #{status}</if>-->
<!-- <if test="userName!=null">AND a.RealName LIKE concat(concat("%",#{userName}),"%")</if>-->
<!-- <if test="userName!=null">AND a.RealName LIKE concat(concat("%",#{userName}),"%")</if>-->
<!-- <if test="groupId!=null">AND find_in_set(#{groupId}, a.GroupID)>0</if>-->
<!-- <if test="groupId!=null">AND find_in_set(#{groupId}, a.GroupID)>0</if>-->
<!-- <if test="pointName!=null">AND a.pointName LIKE concat(concat("%",#{pointName}),"%")</if>-->
<!-- <if test="pointName!=null">AND a.pointName LIKE concat(concat("%",#{pointName}),"%")</if>-->
<!-- <if test="orgCode!=null">AND a.orgCode LIKE #{orgCode}</if>-->
<!-- <if test="orgCode!=null">AND a.orgCode LIKE #{orgCode}</if>-->
<!-- </trim>-->
<!-- </trim>-->
<!-- <choose>-->
<!-- <choose>-->
<!-- <when test="pageSize==-1"></when>-->
<!-- <when test="pageSize==-1"></when>-->
<!-- <when test="pageSize!=-1">limit #{offset},#{pageSize}</when>-->
<!-- <when test="pageSize!=-1">limit #{offset},#{pageSize}</when>-->
<!-- </choose>-->
<!-- </choose>-->
<!-- </select>!–>-->
<!-- </select>!–>-->
<select
id=
"getCheckInfoList1"
resultType=
"Map"
>
<select
id=
"getCheckInfoList1"
resultType=
"Map"
>
select
select
...
@@ -1763,7 +1768,7 @@
...
@@ -1763,7 +1768,7 @@
where c.point_id = p.id
where c.point_id = p.id
<if
test=
"pointID!=null"
>
AND c.point_id = #{pointID}
</if>
<if
test=
"pointID!=null"
>
AND c.point_id = #{pointID}
</if>
<if
test=
"checkTime!=null"
>
AND DATE_FORMAT(c.check_time, '%Y%m%d') = #{checkTime}
</if>
<if
test=
"checkTime!=null"
>
AND DATE_FORMAT(c.check_time, '%Y%m%d') = #{checkTime}
</if>
<if
test=
"userID!=null and userID!=-1 "
>
AND find_in_set(#{userID}, c.user_id)>0
</if>
<if
test=
"userID!=null and userID!=-1 "
>
AND find_in_set(#{userID}, c.user_id)>0
</if>
<if
test=
"status!=null"
>
AND c.is_ok = #{status}
</if>
<if
test=
"status!=null"
>
AND c.is_ok = #{status}
</if>
<if
test=
"userName!=null"
>
AND c.error LIKE concat(concat("%",#{userName}),"%")
</if>
<if
test=
"userName!=null"
>
AND c.error LIKE concat(concat("%",#{userName}),"%")
</if>
<if
test=
"groupId!=null"
>
AND find_in_set(#{groupId}, c.dep_id)>0
</if>
<if
test=
"groupId!=null"
>
AND find_in_set(#{groupId}, c.dep_id)>0
</if>
...
@@ -1788,7 +1793,7 @@
...
@@ -1788,7 +1793,7 @@
where c.point_id = p.id
where c.point_id = p.id
<if
test=
"pointID!=null"
>
AND c.point_id = #{pointID}
</if>
<if
test=
"pointID!=null"
>
AND c.point_id = #{pointID}
</if>
<if
test=
"checkTime!=null"
>
AND DATE_FORMAT(c.check_time, '%Y%m%d') = #{checkTime}
</if>
<if
test=
"checkTime!=null"
>
AND DATE_FORMAT(c.check_time, '%Y%m%d') = #{checkTime}
</if>
<if
test=
"userID!=null and userID!=-1 "
>
AND find_in_set(#{userID}, c.user_id)>0
</if>
<if
test=
"userID!=null and userID!=-1 "
>
AND find_in_set(#{userID}, c.user_id)>0
</if>
<if
test=
"status!=null"
>
AND c.is_ok = #{status}
</if>
<if
test=
"status!=null"
>
AND c.is_ok = #{status}
</if>
<if
test=
"userName!=null"
>
AND c.user_name LIKE concat(concat("%",#{userName}),"%")
</if>
<if
test=
"userName!=null"
>
AND c.user_name LIKE concat(concat("%",#{userName}),"%")
</if>
<if
test=
"groupId!=null"
>
AND find_in_set(#{groupId}, c.dep_id)>0
</if>
<if
test=
"groupId!=null"
>
AND find_in_set(#{groupId}, c.dep_id)>0
</if>
...
@@ -1886,8 +1891,8 @@
...
@@ -1886,8 +1891,8 @@
AND (c.org_code=#{orgCode} or c.org_code like CONCAT(#{orgCode},'-%'))
AND (c.org_code=#{orgCode} or c.org_code like CONCAT(#{orgCode},'-%'))
</if>
</if>
WHERE 1=1
WHERE 1=1
<if
test=
"startTime !=null and startTime!= '' "
>
AND d.date
<![CDATA[ >= ]]>
#{startTime}
</if>
<if
test=
"startTime !=null and startTime!= '' "
>
AND d.date
<![CDATA[ >= ]]>
#{startTime}
</if>
<if
test=
"endTime !=null and endTime!='' "
>
AND d.date
<![CDATA[ < ]]>
#{endTime}
</if>
<if
test=
"endTime !=null and endTime!='' "
>
AND d.date
<![CDATA[ < ]]>
#{endTime}
</if>
GROUP BY
GROUP BY
d.date
d.date
ORDER BY
ORDER BY
...
@@ -1955,12 +1960,12 @@
...
@@ -1955,12 +1960,12 @@
<if
test=
"teamId != null and teamId != ''"
>
<if
test=
"teamId != null and teamId != ''"
>
AND pp.original_id = #{teamId}
AND pp.original_id = #{teamId}
</if>
</if>
<!-- <if test="status != null and status != ''">-->
<!-- <if test="status != null and status != ''">-->
<!-- AND pc.point_id = #{status}-->
<!-- AND pc.point_id = #{status}-->
<!-- </if>-->
<!-- </if>-->
<!-- <if test="companyName != null and companyName != ''">-->
<!-- <if test="companyName != null and companyName != ''">-->
<!-- AND pc.company_name = #{company_name}-->
<!-- AND pc.company_name = #{company_name}-->
<!-- </if>-->
<!-- </if>-->
limit #{offset},#{pageSize}
limit #{offset},#{pageSize}
</select>
</select>
...
@@ -1999,13 +2004,14 @@
...
@@ -1999,13 +2004,14 @@
<if
test=
"pointId != null and pointId != -1"
>
<if
test=
"pointId != null and pointId != -1"
>
AND pp.id = #{pointId}
AND pp.id = #{pointId}
</if>
</if>
<!-- <if test="orgCode != null">-->
<!-- <if test="orgCode != null">-->
<!-- AND c.org_code = #{orgCode}-->
<!-- AND c.org_code = #{orgCode}-->
<!-- </if>-->
<!-- </if>-->
</where>
</where>
</select>
</select>
<select
id=
"queryPage"
resultType=
"com.yeejoin.amos.supervision.business.vo.CheckVo"
>
<select
id=
"queryPage"
resultType=
"com.yeejoin.amos.supervision.business.vo.CheckVo"
>
SELECT
SELECT
c.id checkId,
i.id,
i.id,
i.`name` inputItemName,
i.`name` inputItemName,
ci.safety_danger_num,
ci.safety_danger_num,
...
@@ -2015,7 +2021,6 @@
...
@@ -2015,7 +2021,6 @@
ci.accompany_user_name,
ci.accompany_user_name,
pp.original_id,
pp.original_id,
pp.name companyName,
pp.name companyName,
IF
IF
( c.check_time IS NULL, 0, 1 ) AS ext
( c.check_time IS NULL, 0, 1 ) AS ext
FROM
FROM
...
@@ -2033,9 +2038,9 @@
...
@@ -2033,9 +2038,9 @@
<if
test=
"pointId != null and pointId != -1"
>
<if
test=
"pointId != null and pointId != -1"
>
AND pp.id = #{pointId}
AND pp.id = #{pointId}
</if>
</if>
<!-- <if test="orgCode != null">-->
<!-- <if test="orgCode != null">-->
<!-- AND c.org_code = #{orgCode}-->
<!-- AND c.org_code = #{orgCode}-->
<!-- </if>-->
<!-- </if>-->
ORDER BY c.check_time DESC
ORDER BY c.check_time DESC
<choose>
<choose>
<when
test=
"pageSize==-1"
></when>
<when
test=
"pageSize==-1"
></when>
...
@@ -2043,4 +2048,23 @@
...
@@ -2043,4 +2048,23 @@
</choose>
</choose>
</where>
</where>
</select>
</select>
<select
id=
"getCheckListByTaskId"
resultType=
"com.yeejoin.amos.supervision.dao.entity.Check"
>
select * from p_check where plan_task_id = #{planTaskId}
</select>
<select
id=
"getPictureByCheckId"
resultType=
"java.lang.String"
>
SELECT
photo_data
FROM
p_check_shot a
LEFT JOIN
p_check_input b
ON
a.check_input_id=b.id
WHERE
a.check_id = #{checkId}
AND
b.input_id= #{id}
</select>
</mapper>
</mapper>
\ No newline at end of file
amos-boot-system-supervision/src/main/resources/db/mapper/dbTemplate_plan.xml
View file @
997d6888
...
@@ -118,6 +118,7 @@
...
@@ -118,6 +118,7 @@
p_route b
p_route b
WHERE
WHERE
a.route_Id = b.id and a.is_delete = 0
a.route_Id = b.id and a.is_delete = 0
and (a.status > 0 or a.maker_user_id = #{loginUserId})
<if
test=
"planName!=null"
>
and a.name like concat(concat("%",#{planName}),"%")
</if>
<if
test=
"planName!=null"
>
and a.name like concat(concat("%",#{planName}),"%")
</if>
<if
test=
"checkTypeId!=null and checkTypeId != '' "
>
and a.check_type_id = #{checkTypeId}
</if>
<if
test=
"checkTypeId!=null and checkTypeId != '' "
>
and a.check_type_id = #{checkTypeId}
</if>
<if
test=
"leadPerson!=null and leadPerson != '' "
>
and a.lead_people_ids = #{leadPerson}
</if>
<if
test=
"leadPerson!=null and leadPerson != '' "
>
and a.lead_people_ids = #{leadPerson}
</if>
...
@@ -167,6 +168,7 @@
...
@@ -167,6 +168,7 @@
p_route b
p_route b
WHERE
WHERE
a.route_Id = b.id and a.is_delete = 0
a.route_Id = b.id and a.is_delete = 0
and (a.status > 0 or a.maker_user_id = #{loginUserId})
<if
test=
"planName!=null"
>
and a.name like concat(concat("%",#{planName}),"%")
</if>
<if
test=
"planName!=null"
>
and a.name like concat(concat("%",#{planName}),"%")
</if>
<if
test=
"checkTypeId!=null and checkTypeId != '' "
>
and a.check_type_id = #{checkTypeId}
</if>
<if
test=
"checkTypeId!=null and checkTypeId != '' "
>
and a.check_type_id = #{checkTypeId}
</if>
<if
test=
"leadPerson!=null and leadPerson != '' "
>
and a.lead_people_ids = #{leadPerson}
</if>
<if
test=
"leadPerson!=null and leadPerson != '' "
>
and a.lead_people_ids = #{leadPerson}
</if>
...
...
amos-boot-system-supervision/src/main/resources/db/mapper/dbTemplate_plan_task.xml
View file @
997d6888
...
@@ -361,6 +361,7 @@
...
@@ -361,6 +361,7 @@
p.id pointId,
p.id pointId,
p.point_no pointNO,
p.point_no pointNO,
p.offline,
p.offline,
p.original_id originalId,
ptd.status,
ptd.status,
ptd.is_finish finish,
ptd.is_finish finish,
p.is_fixed isFixed,
p.is_fixed isFixed,
...
...
amos-boot-system-tzs/src/main/resources/db/changelog/tzs-1.0.0.0.xml
View file @
997d6888
...
@@ -805,5 +805,55 @@
...
@@ -805,5 +805,55 @@
</sql>
</sql>
</changeSet>
</changeSet>
<changeSet
author=
"kongfm"
id=
"2022-01-05-01"
>
<preConditions
onFail=
"MARK_RAN"
>
<not>
<tableExists
tableName=
"tcb_equipment_use_info"
/>
</not>
</preConditions>
<comment>
add tcb_equipment_use_info table
</comment>
<sql>
CREATE TABLE `tcb_equipment_use_info` (
`sequence_nbr` bigint(30) NOT NULL,
`use_unit_name` varchar(200) DEFAULT NULL COMMENT '使用单位名称',
`use_unit_id` bigint(30) DEFAULT NULL COMMENT '使用单位id',
`use_organization_code` varchar(30) DEFAULT NULL COMMENT '使用单位统一信用代码',
`property_unit_name` varchar(50) DEFAULT NULL COMMENT '产权单位名称',
`property_unit_id` bigint(30) DEFAULT NULL COMMENT '产权单位id',
`property_organization_code` varchar(30) DEFAULT NULL COMMENT '产权统一信用代码',
`use_address` varchar(300) DEFAULT NULL COMMENT '使用地址',
`longitude` varchar(50) DEFAULT NULL COMMENT '经度',
`latitude` varchar(255) DEFAULT NULL COMMENT '纬度',
`use_site` varchar(30) DEFAULT NULL COMMENT '使用场所',
`use_site_code` varchar(30) DEFAULT NULL COMMENT '使用场所编码',
`special_code` varchar(50) DEFAULT NULL COMMENT '特设编码',
`register_code` varchar(50) DEFAULT NULL COMMENT '设备注册代码',
`rescue_code` varchar(50) DEFAULT NULL COMMENT '96333识别码',
`register_licence_code` varchar(50) DEFAULT NULL COMMENT '使用登记证编码',
`register_org` varchar(30) DEFAULT NULL COMMENT '登记机关',
`register_org_id` bigint(30) DEFAULT NULL COMMENT '登记机关id',
`register_time` datetime DEFAULT NULL COMMENT '登记日期',
`issue_licence_time` datetime DEFAULT NULL COMMENT '发证日期',
`start_use_time` datetime DEFAULT NULL COMMENT '投入使用日期',
`rec_user_id` bigint(30) DEFAULT NULL COMMENT '更新人id',
`rec_user_name` varchar(100) DEFAULT NULL COMMENT '更新人名称',
`rec_date` datetime DEFAULT NULL COMMENT '更新时间',
`is_delete` bit(1) DEFAULT b'0' COMMENT '是否删除(0:未删除,1:已删除)',
PRIMARY KEY (`sequence_nbr`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='设备使用信息表';
</sql>
</changeSet>
<changeSet
author=
"kongfm"
id=
"2022-01-05-02"
>
<preConditions
onFail=
"MARK_RAN"
>
<tableExists
tableName=
"tcb_equipment_use_info"
/>
</preConditions>
<comment>
modify table tcb_equipment_use_info add equipment_id columns
</comment>
<sql>
ALTER TABLE `tcb_equipment_use_info` add equipment_id bigint(50) COMMENT '设备ID';
</sql>
</changeSet>
</databaseChangeLog>
</databaseChangeLog>
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