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
6b2584cf
Commit
6b2584cf
authored
Nov 17, 2021
by
李腾威
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
融合调度规则 任务 4318 4326 4327
parent
675a52c3
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
391 additions
and
259 deletions
+391
-259
DutyPersonShiftMapper.java
.../boot/module/common/api/mapper/DutyPersonShiftMapper.java
+1
-1
OrgUsrMapper.java
...join/amos/boot/module/common/api/mapper/OrgUsrMapper.java
+1
-1
IDutyPersonService.java
...os/boot/module/common/api/service/IDutyPersonService.java
+1
-1
DutyPersonShiftMapper.xml
...n-api/src/main/resources/mapper/DutyPersonShiftMapper.xml
+5
-2
OrgUsrMapper.xml
...ule-common-api/src/main/resources/mapper/OrgUsrMapper.xml
+6
-2
AlertCalledRo.java
...m/yeejoin/amos/boot/module/jcs/api/dto/AlertCalledRo.java
+5
-2
AlertSubmittedSMSDto.java
...in/amos/boot/module/jcs/api/dto/AlertSubmittedSMSDto.java
+3
-0
AlertSubmittedMapper.xml
...cs-api/src/main/resources/mapper/AlertSubmittedMapper.xml
+3
-2
DutyPersonServiceImpl.java
...module/common/biz/service/impl/DutyPersonServiceImpl.java
+3
-13
OrgUsrServiceImpl.java
...oot/module/common/biz/service/impl/OrgUsrServiceImpl.java
+2
-2
AlertSubmittedController.java
...t/module/jcs/biz/controller/AlertSubmittedController.java
+34
-1
AlertCalledServiceImpl.java
...t/module/jcs/biz/service/impl/AlertCalledServiceImpl.java
+1
-4
AlertSubmittedServiceImpl.java
...odule/jcs/biz/service/impl/AlertSubmittedServiceImpl.java
+148
-109
RuleAlertCalledService.java
...t/module/jcs/biz/service/impl/RuleAlertCalledService.java
+126
-119
jcs-1.0.0.0.xml
...ystem-jcs/src/main/resources/db/changelog/jcs-1.0.0.0.xml
+52
-0
No files found.
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 @
6b2584cf
...
@@ -134,7 +134,7 @@ public interface DutyPersonShiftMapper extends BaseMapper<DutyPersonShift> {
...
@@ -134,7 +134,7 @@ public interface DutyPersonShiftMapper extends BaseMapper<DutyPersonShift> {
List
<
Map
<
String
,
Object
>>
getFirstAidForTypeCodeAndCompanyId
(
long
company
);
List
<
Map
<
String
,
Object
>>
getFirstAidForTypeCodeAndCompanyId
(
long
company
);
List
<
Map
<
String
,
Object
>>
queryByCompanyId
();
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
);
}
}
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 @
6b2584cf
...
@@ -92,7 +92,7 @@ public interface OrgUsrMapper extends BaseMapper<OrgUsr> {
...
@@ -92,7 +92,7 @@ public interface OrgUsrMapper extends BaseMapper<OrgUsr> {
List
<
Map
<
String
,
Long
>>
countDeptByCompanyId
(
@Param
(
"companyIdList"
)
List
<
String
>
companyIdList
);
List
<
Map
<
String
,
Long
>>
countDeptByCompanyId
(
@Param
(
"companyIdList"
)
List
<
String
>
companyIdList
);
List
<
Map
<
String
,
Object
>>
queryCompanyId
(
String
bizOrgName
);
List
<
Map
<
String
,
Object
>>
queryCompanyId
(
String
bizOrgName
,
@Param
(
"codes"
)
List
<
String
>
codes
);
List
<
Map
<
String
,
Object
>>
queryCompanyIdNew
(
String
bizOrgName
);
List
<
Map
<
String
,
Object
>>
queryCompanyIdNew
(
String
bizOrgName
);
...
...
amos-boot-module/amos-boot-module-api/amos-boot-module-common-api/src/main/java/com/yeejoin/amos/boot/module/common/api/service/IDutyPersonService.java
View file @
6b2584cf
...
@@ -34,7 +34,7 @@ public interface IDutyPersonService extends IDutyCommonService {
...
@@ -34,7 +34,7 @@ public interface IDutyPersonService extends IDutyCommonService {
*/
*/
List
<
DutyPersonDto
>
findByDutyAreaId
(
Long
dutyAreaId
);
List
<
DutyPersonDto
>
findByDutyAreaId
(
Long
dutyAreaId
);
List
<
Map
<
String
,
Object
>>
queryByCompanyId
();
List
<
Map
<
String
,
Object
>>
queryByCompanyId
(
List
<
String
>
bizNames
);
List
<
Map
<
String
,
Object
>>
queryByCompanyNew
(
String
bizOrgName
);
List
<
Map
<
String
,
Object
>>
queryByCompanyNew
(
String
bizOrgName
);
}
}
amos-boot-module/amos-boot-module-api/amos-boot-module-common-api/src/main/resources/mapper/DutyPersonShiftMapper.xml
View file @
6b2584cf
...
@@ -358,8 +358,11 @@ AND cft.type_code = (
...
@@ -358,8 +358,11 @@ AND cft.type_code = (
where i.field_code = 'userId' and i.field_value is not null) c
where i.field_code = 'userId' and i.field_value is not null) c
on cb.instance_id = c.id3
on cb.instance_id = c.id3
where to_days(cb.duty_date) = to_days(now()) and
where to_days(cb.duty_date) = to_days(now()) and
a.deptId in ( select sequence_nbr from cb_org_usr cou where biz_org_name = '消防救援保障部' or
a.deptId in ( select sequence_nbr from cb_org_usr cou where biz_org_name in
biz_org_name = '综合办公室' or biz_org_name = '消防支队' or biz_org_name = '应急指挥科' )) r )
<foreach
item=
"item"
index=
"index"
collection=
"bizNames"
open=
"("
separator=
","
close=
")"
>
#{item}
</foreach>
)) r )
</select>
</select>
...
...
amos-boot-module/amos-boot-module-api/amos-boot-module-common-api/src/main/resources/mapper/OrgUsrMapper.xml
View file @
6b2584cf
...
@@ -691,13 +691,17 @@ LEFT JOIN (
...
@@ -691,13 +691,17 @@ LEFT JOIN (
select cou.biz_org_name bizOrgName,cou.sequence_nbr sequenceNbr ,cou .parent_id parentId,
select cou.biz_org_name bizOrgName,cou.sequence_nbr sequenceNbr ,cou .parent_id parentId,
a.fireManagementPostCode, b.telephone from cb_org_usr cou
a.fireManagementPostCode, b.telephone from cb_org_usr cou
left join (select i.instance_id id1 ,if(i.field_code = 'fireManagementPostCode',
left join (select i.instance_id id1 ,if(i.field_code = 'fireManagementPostCode',
i.field_value
_label
, null) as 'fireManagementPostCode' from cb_dynamic_form_instance i where i.field_code = 'fireManagementPostCode'
i.field_value, null) as 'fireManagementPostCode' from cb_dynamic_form_instance i where i.field_code = 'fireManagementPostCode'
and i.field_value_label is not null) a on cou .sequence_nbr = a.id1
and i.field_value_label is not null) a on cou .sequence_nbr = a.id1
left join (select i.instance_id id2,if(i.field_code = 'telephone',
left join (select i.instance_id id2,if(i.field_code = 'telephone',
i.field_value, null) as 'telephone' from cb_dynamic_form_instance i where i.field_code = 'telephone'
i.field_value, null) as 'telephone' from cb_dynamic_form_instance i where i.field_code = 'telephone'
and i.field_value is not null) b on cou .sequence_nbr = b.id2
and i.field_value is not null) b on cou .sequence_nbr = b.id2
) d where d.parentId in (select sequence_nbr from cb_org_usr cou where biz_org_name = #{bizOrgName})
) d where d.parentId in (select sequence_nbr from cb_org_usr cou where biz_org_name = #{bizOrgName})
and (d.fireManagementPostCode = '消防安全管理人' or d.fireManagementPostCode = '消防安全责任人')
and (d.fireManagementPostCode in
<foreach
item=
"item"
index=
"index"
collection=
"codes"
open=
"("
separator=
","
close=
")"
>
#{item}
</foreach>
)
</select>
</select>
<select
id=
"queryCompanyIdNew"
resultType=
"map"
>
<select
id=
"queryCompanyIdNew"
resultType=
"map"
>
...
...
amos-boot-module/amos-boot-module-api/amos-boot-module-jcs-api/src/main/java/com/yeejoin/amos/boot/module/jcs/api/dto/AlertCalledRo.java
View file @
6b2584cf
...
@@ -26,7 +26,7 @@ public class AlertCalledRo implements Serializable{
...
@@ -26,7 +26,7 @@ public class AlertCalledRo implements Serializable{
*
*
* </pre>
* </pre>
*/
*/
private
static
final
long
serialVersionUID
=
529623529216238088
L
;
private
static
final
long
serialVersionUID
=
-
8755622977733065123
L
;
/**
/**
* 通用属性
* 通用属性
...
@@ -73,9 +73,12 @@ public class AlertCalledRo implements Serializable{
...
@@ -73,9 +73,12 @@ public class AlertCalledRo implements Serializable{
@Label
(
value
=
"警情报送类型(0,警情报送,1,警情续报,2,非警情确认,3,警情结案)"
)
@Label
(
value
=
"警情报送类型(0,警情报送,1,警情续报,2,非警情确认,3,警情结案)"
)
private
String
alertWay
;
private
String
alertWay
;
@Label
(
value
=
"警情续报,非警情确认,警情结案,选择人员
ids
"
)
@Label
(
value
=
"警情续报,非警情确认,警情结案,选择人员
电话号码
"
)
private
String
ids
;
private
String
ids
;
@Label
(
value
=
"警情续报,非警情确认,警情结案,选择人员AmousIds"
)
private
String
usIds
;
@Label
(
value
=
"警情续报自定义内容"
)
@Label
(
value
=
"警情续报自定义内容"
)
private
String
feedback
;
private
String
feedback
;
...
...
amos-boot-module/amos-boot-module-api/amos-boot-module-jcs-api/src/main/java/com/yeejoin/amos/boot/module/jcs/api/dto/AlertSubmittedSMSDto.java
View file @
6b2584cf
...
@@ -30,6 +30,9 @@ public class AlertSubmittedSMSDto {
...
@@ -30,6 +30,9 @@ public class AlertSubmittedSMSDto {
@ApiModelProperty
(
value
=
"联系电话"
)
@ApiModelProperty
(
value
=
"联系电话"
)
private
String
userPhone
;
private
String
userPhone
;
@ApiModelProperty
(
value
=
"警情Id"
)
private
String
alertCallId
;
@ApiModelProperty
(
value
=
"协调单位"
)
@ApiModelProperty
(
value
=
"协调单位"
)
private
String
companyName
;
private
String
companyName
;
...
...
amos-boot-module/amos-boot-module-api/amos-boot-module-jcs-api/src/main/resources/mapper/AlertSubmittedMapper.xml
View file @
6b2584cf
...
@@ -15,12 +15,12 @@
...
@@ -15,12 +15,12 @@
jas.submission_method,
jas.submission_method,
jas.submission_method_code,
jas.submission_method_code,
jas.update_time,
jas.update_time,
jaso.sequence_nbr,
jaso.sequence_nbr
sequenceNbr
,
jaso.company_name,
jaso.company_name,
jaso.user_name,
jaso.user_name,
jaso.user_phone
jaso.user_phone
from jc_alert_submitted jas
from jc_alert_submitted jas
lef
t join jc_alert_submitted_object jaso on jas.sequence_nbr = jaso.alert_submitted_id
righ
t join jc_alert_submitted_object jaso on jas.sequence_nbr = jaso.alert_submitted_id
where 1=1
where 1=1
<if
test=
"alertSubmittedDto.alertCalledId != null and alertSubmittedDto.alertCalledId != ''"
>
<if
test=
"alertSubmittedDto.alertCalledId != null and alertSubmittedDto.alertCalledId != ''"
>
and jas.alert_called_id = #{alertSubmittedDto.alertCalledId}
and jas.alert_called_id = #{alertSubmittedDto.alertCalledId}
...
@@ -68,6 +68,7 @@
...
@@ -68,6 +68,7 @@
<select
id=
"getSchedulingContent"
resultType=
"com.yeejoin.amos.boot.module.jcs.api.dto.AlertSubmittedSMSDto"
>
<select
id=
"getSchedulingContent"
resultType=
"com.yeejoin.amos.boot.module.jcs.api.dto.AlertSubmittedSMSDto"
>
SELECT
SELECT
s.sequence_nbr,
s.sequence_nbr,
s.alert_called_id alertCallId,
s.submission_time,
s.submission_time,
o.user_phone,
o.user_phone,
o.company_name,
o.company_name,
...
...
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 @
6b2584cf
...
@@ -286,26 +286,16 @@ public Object BuildScheduleDetails(String dutyDay, Long shiftId, String postType
...
@@ -286,26 +286,16 @@ public Object BuildScheduleDetails(String dutyDay, Long shiftId, String postType
if
(!
map20
.
containsKey
(
i
.
get
(
"shiftName"
).
toString
()))
{
if
(!
map20
.
containsKey
(
i
.
get
(
"shiftName"
).
toString
()))
{
map20
.
put
(
ssString
,
ssString
);
map20
.
put
(
ssString
,
ssString
);
}
}
System
.
out
.
println
(
"ssssssssss"
);
System
.
out
.
println
(
"ssssssssss"
);
});
});
}
}
@Override
@Override
public
List
<
Map
<
String
,
Object
>>
queryByCompanyId
(){
public
List
<
Map
<
String
,
Object
>>
queryByCompanyId
(
List
<
String
>
bizNames
){
return
dutyPersonShiftMapper
.
queryByCompanyId
();
return
dutyPersonShiftMapper
.
queryByCompanyId
(
bizNames
);
}
}
@Override
@Override
...
...
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 @
6b2584cf
...
@@ -1861,9 +1861,9 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
...
@@ -1861,9 +1861,9 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
return
resultMap
;
return
resultMap
;
}
}
public
List
<
Map
<
String
,
Object
>>
queryCompanyId
(
String
bizOrgName
)
{
public
List
<
Map
<
String
,
Object
>>
queryCompanyId
(
String
bizOrgName
,
List
<
String
>
codes
)
{
return
orgUsrMapper
.
queryCompanyId
(
bizOrgName
);
return
orgUsrMapper
.
queryCompanyId
(
bizOrgName
,
codes
);
}
}
public
List
<
Map
<
String
,
Object
>>
queryCompanyIdNew
(
String
bizOrgName
)
{
public
List
<
Map
<
String
,
Object
>>
queryCompanyIdNew
(
String
bizOrgName
)
{
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-jcs-biz/src/main/java/com/yeejoin/amos/boot/module/jcs/biz/controller/AlertSubmittedController.java
View file @
6b2584cf
...
@@ -7,17 +7,22 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
...
@@ -7,17 +7,22 @@ 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.yeejoin.amos.boot.biz.common.controller.BaseController
;
import
com.yeejoin.amos.boot.biz.common.controller.BaseController
;
import
com.yeejoin.amos.boot.biz.common.service.impl.DataDictionaryServiceImpl
;
import
com.yeejoin.amos.boot.biz.common.service.impl.DataDictionaryServiceImpl
;
import
com.yeejoin.amos.boot.biz.common.utils.DateUtils
;
import
com.yeejoin.amos.boot.biz.common.utils.NameUtils
;
import
com.yeejoin.amos.boot.biz.common.utils.NameUtils
;
import
com.yeejoin.amos.boot.module.jcs.api.dto.AlertCalledObjsDto
;
import
com.yeejoin.amos.boot.module.jcs.api.dto.AlertCalledRo
;
import
com.yeejoin.amos.boot.module.jcs.api.dto.AlertSubmittedDto
;
import
com.yeejoin.amos.boot.module.jcs.api.dto.AlertSubmittedDto
;
import
com.yeejoin.amos.boot.module.jcs.api.dto.AlertSubmittedSMSDto
;
import
com.yeejoin.amos.boot.module.jcs.api.dto.AlertSubmittedSMSDto
;
import
com.yeejoin.amos.boot.module.jcs.api.dto.SchedulingReportingDto
;
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.TemplateDto
;
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.enums.SubmissionMethodEnum
;
import
com.yeejoin.amos.boot.module.jcs.api.enums.SubmissionMethodEnum
;
import
com.yeejoin.amos.boot.module.jcs.biz.service.impl.AlertCalledServiceImpl
;
import
com.yeejoin.amos.boot.module.jcs.biz.service.impl.AlertCalledServiceImpl
;
import
com.yeejoin.amos.boot.module.jcs.biz.service.impl.AlertSubmittedObjectServiceImpl
;
import
com.yeejoin.amos.boot.module.jcs.biz.service.impl.AlertSubmittedObjectServiceImpl
;
import
com.yeejoin.amos.boot.module.jcs.biz.service.impl.AlertSubmittedServiceImpl
;
import
com.yeejoin.amos.boot.module.jcs.biz.service.impl.AlertSubmittedServiceImpl
;
import
com.yeejoin.amos.boot.module.jcs.biz.service.impl.PowerTransferServiceImpl
;
import
com.yeejoin.amos.boot.module.jcs.biz.service.impl.PowerTransferServiceImpl
;
import
com.yeejoin.amos.boot.module.jcs.biz.service.impl.RuleAlertCalledService
;
import
com.yeejoin.amos.boot.module.jcs.biz.service.impl.TemplateServiceImpl
;
import
com.yeejoin.amos.boot.module.jcs.biz.service.impl.TemplateServiceImpl
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiOperation
;
...
@@ -34,8 +39,11 @@ import org.typroject.tyboot.core.restful.doc.TycloudOperation;
...
@@ -34,8 +39,11 @@ import org.typroject.tyboot.core.restful.doc.TycloudOperation;
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.text.ParseException
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.Arrays
;
import
java.util.HashMap
;
import
java.util.Map
;
/**
/**
...
@@ -203,6 +211,8 @@ public class AlertSubmittedController extends BaseController {
...
@@ -203,6 +211,8 @@ public class AlertSubmittedController extends BaseController {
alertSubmittedService
.
getAlertSubmittedContent
(
alertCalledId
,
templateVos
,
companyName
);
alertSubmittedService
.
getAlertSubmittedContent
(
alertCalledId
,
templateVos
,
companyName
);
}
catch
(
IllegalAccessException
e
)
{
}
catch
(
IllegalAccessException
e
)
{
throw
new
RuntimeException
(
"系统异常"
);
throw
new
RuntimeException
(
"系统异常"
);
}
catch
(
ParseException
e
)
{
e
.
printStackTrace
();
}
}
return
ResponseHelper
.
buildResponse
(
templateVos
);
return
ResponseHelper
.
buildResponse
(
templateVos
);
}
}
...
@@ -216,10 +226,26 @@ public class AlertSubmittedController extends BaseController {
...
@@ -216,10 +226,26 @@ public class AlertSubmittedController extends BaseController {
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@RequestMapping
(
value
=
"/{id}/scheduling_content"
,
method
=
RequestMethod
.
GET
)
@RequestMapping
(
value
=
"/{id}/scheduling_content"
,
method
=
RequestMethod
.
GET
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"获取融合调度短信内容"
,
notes
=
"获取融合调度短信内容"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"获取融合调度短信内容"
,
notes
=
"获取融合调度短信内容"
)
public
ResponseModel
<
AlertSubmittedSMSDto
>
getSchedulingContent
(
@PathVariable
Long
id
)
{
public
ResponseModel
<
AlertSubmittedSMSDto
>
getSchedulingContent
(
@PathVariable
Long
id
)
throws
ParseException
{
// 获取报送内容
// 获取报送内容
// 任务 4174 日常值班---融合调度----短信模版中的内容用户可以全部删除掉,按照自定义内容重新录入发送内容 by litw 2021年10月27日
// 任务 4174 日常值班---融合调度----短信模版中的内容用户可以全部删除掉,按照自定义内容重新录入发送内容 by litw 2021年10月27日
AlertSubmittedSMSDto
schedulingContent
=
alertSubmittedService
.
getSchedulingContent
(
id
);
AlertSubmittedSMSDto
schedulingContent
=
alertSubmittedService
.
getSchedulingContent
(
id
);
AlertCalledObjsDto
alertCalledVo
=
(
AlertCalledObjsDto
)
alertCalledService
.
selectAlertCalledByIdNoRedisNew
(
Long
.
valueOf
(
schedulingContent
.
getAlertCallId
()));
/**
* 构建警情报送规则对象
*/
AlertCalledRo
alertCalledRo
=
new
AlertCalledRo
();
AlertCalled
alertCalled
=
alertCalledVo
.
getAlertCalled
();
String
replaceContent
=
RuleAlertCalledService
.
init
(
alertCalledRo
,
alertCalledVo
);
Map
<
String
,
String
>
definitions
=
new
HashMap
<>();
definitions
.
put
(
"$type"
,
alertCalled
.
getAlertType
());
definitions
.
put
(
"$callTime"
,
DateUtils
.
dateTimeToDateString
(
alertCalled
.
getCallTime
()));
definitions
.
put
(
"$replaceContent"
,
replaceContent
);
definitions
.
put
(
"$address"
,
alertCalled
.
getAddress
());
String
content
=
getTaskInformation
(
schedulingContent
.
getSubmissionTemplate
(),
definitions
);
schedulingContent
.
setSubmissionTemplate
(
content
);
if
(!
ValidationUtil
.
isEmpty
(
schedulingContent
.
getSubmissionContent
()))
{
if
(!
ValidationUtil
.
isEmpty
(
schedulingContent
.
getSubmissionContent
()))
{
try
{
try
{
JSON
.
parseObject
(
schedulingContent
.
getSubmissionContent
());
JSON
.
parseObject
(
schedulingContent
.
getSubmissionContent
());
...
@@ -230,5 +256,12 @@ public class AlertSubmittedController extends BaseController {
...
@@ -230,5 +256,12 @@ public class AlertSubmittedController extends BaseController {
}
}
return
ResponseHelper
.
buildResponse
(
schedulingContent
);
return
ResponseHelper
.
buildResponse
(
schedulingContent
);
}
}
private
String
getTaskInformation
(
String
content
,
Map
<
String
,
String
>
definitions
)
{
int
size
=
definitions
.
size
();
String
[]
keys
=
definitions
.
keySet
().
toArray
(
new
String
[
size
]);
String
[]
values
=
definitions
.
values
().
toArray
(
new
String
[
size
]);
return
StringUtils
.
replaceEach
(
content
,
keys
,
values
);
}
}
}
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 @
6b2584cf
...
@@ -369,7 +369,7 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal
...
@@ -369,7 +369,7 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal
alertCalledObjsDto
.
setAlertFormValue
(
alertFormValuelist
);
alertCalledObjsDto
.
setAlertFormValue
(
alertFormValuelist
);
// 警情报送
// 警情报送
// 调用规则 警情初报
// 调用规则 警情初报
ruleAlertCalledService
.
fireAlertCalledRule
(
alertCalledObjsDto
,
AlertBusinessTypeEnum
.
警情初报
.
getCode
(),
null
);
ruleAlertCalledService
.
fireAlertCalledRule
(
alertCalledObjsDto
,
AlertBusinessTypeEnum
.
警情初报
.
getCode
(),
null
,
null
,
null
);
// 通知实战指挥页面发送mqtt 默认发送 String 类型 0, 新警情 1 警情状态变化
// 通知实战指挥页面发送mqtt 默认发送 String 类型 0, 新警情 1 警情状态变化
emqKeeper
.
getMqttClient
().
publish
(
topic
,
"0"
.
getBytes
(),
RuleConfig
.
DEFAULT_QOS
,
true
);
emqKeeper
.
getMqttClient
().
publish
(
topic
,
"0"
.
getBytes
(),
RuleConfig
.
DEFAULT_QOS
,
true
);
/**
/**
...
@@ -377,9 +377,6 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal
...
@@ -377,9 +377,6 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal
*/
*/
eSAlertCalledService
.
saveAlertCalledToES
(
alertCalled
);
eSAlertCalledService
.
saveAlertCalledToES
(
alertCalled
);
}
}
return
alertCalledObjsDto
;
return
alertCalledObjsDto
;
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
e
.
printStackTrace
();
...
...
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 @
6b2584cf
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jcs
.
biz
.
service
.
impl
;
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jcs
.
biz
.
service
.
impl
;
import
java.lang.reflect.Field
;
import
java.lang.reflect.Field
;
import
java.text.ParseException
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.Collections
;
import
java.util.Collections
;
import
java.util.Comparator
;
import
java.util.Comparator
;
...
@@ -13,6 +14,8 @@ import java.util.Optional;
...
@@ -13,6 +14,8 @@ import java.util.Optional;
import
java.util.Set
;
import
java.util.Set
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
import
com.yeejoin.amos.boot.biz.common.utils.DateUtils
;
import
com.yeejoin.amos.boot.module.common.api.entity.OrgUsr
;
import
org.apache.commons.lang3.ObjectUtils
;
import
org.apache.commons.lang3.ObjectUtils
;
import
org.eclipse.paho.client.mqttv3.MqttException
;
import
org.eclipse.paho.client.mqttv3.MqttException
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.BeanUtils
;
...
@@ -21,11 +24,9 @@ import org.springframework.beans.factory.annotation.Value;
...
@@ -21,11 +24,9 @@ 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.component.emq.EmqKeeper
;
import
org.typroject.tyboot.component.emq.EmqKeeper
;
import
org.typroject.tyboot.core.foundation.utils.StringUtil
;
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
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONException
;
import
com.alibaba.fastjson.JSONException
;
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
;
...
@@ -56,7 +57,6 @@ import com.yeejoin.amos.boot.module.jcs.api.dto.SchedulingReportingDto;
...
@@ -56,7 +57,6 @@ 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.TemplateDto
;
import
com.yeejoin.amos.boot.module.jcs.api.dto.TemplateExtendDto
;
import
com.yeejoin.amos.boot.module.jcs.api.dto.TemplateExtendDto
;
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.AlertFormValue
;
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
;
...
@@ -72,32 +72,14 @@ import com.yeejoin.amos.boot.module.jcs.api.service.IAlertSubmittedObjectService
...
@@ -72,32 +72,14 @@ import com.yeejoin.amos.boot.module.jcs.api.service.IAlertSubmittedObjectService
import
com.yeejoin.amos.boot.module.jcs.api.service.IAlertSubmittedService
;
import
com.yeejoin.amos.boot.module.jcs.api.service.IAlertSubmittedService
;
import
com.yeejoin.amos.boot.module.jcs.biz.rule.action.AlertCalledAction
;
import
com.yeejoin.amos.boot.module.jcs.biz.rule.action.AlertCalledAction
;
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.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.typroject.tyboot.component.emq.EmqKeeper
;
import
org.typroject.tyboot.core.foundation.utils.ValidationUtil
;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
import
java.lang.reflect.Field
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
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.LinkedList
;
import
java.util.LinkedList
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Optional
;
import
java.util.Set
;
import
java.util.stream.Collectors
;
/**
/**
* 警情报送记录 服务实现类
* 警情报送记录 服务实现类
...
@@ -186,11 +168,29 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
...
@@ -186,11 +168,29 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
alertSubmittedExtDto
.
setExtraInfo
(
String
.
format
(
_extraInfo
,
alertSubmittedExtDto
.
getCompanyName
(),
alertSubmittedExtDto
.
setExtraInfo
(
String
.
format
(
_extraInfo
,
alertSubmittedExtDto
.
getCompanyName
(),
alertSubmittedExtDto
.
getUserName
()));
alertSubmittedExtDto
.
getUserName
()));
TemplateExtendDto
template
=
templateService
.
getByType
(
alertSubmittedExtDto
.
getBusinessTypeCode
());
TemplateExtendDto
template
=
templateService
.
getByType
(
alertSubmittedExtDto
.
getBusinessTypeCode
());
String
richContent
=
template
.
getRichContent
();
AlertCalledObjsDto
alertCalledVo
=
(
AlertCalledObjsDto
)
alertCalledService
.
selectAlertCalledByIdNoRedisNew
(
queryParam
.
getAlertCalledId
());
AlertCalled
alertCalled
=
alertCalledVo
.
getAlertCalled
();
/**
* 构建警情报送规则对象
*/
AlertCalledRo
alertCalledRo
=
new
AlertCalledRo
();
String
replaceContent
=
RuleAlertCalledService
.
init
(
alertCalledRo
,
alertCalledVo
);
Map
<
String
,
String
>
definitions
=
new
HashMap
<>();
definitions
.
put
(
"$type"
,
alertCalled
.
getAlertType
());
definitions
.
put
(
"$callTime"
,
DateUtils
.
dateTimeToDateString
(
alertCalled
.
getCallTime
()));
definitions
.
put
(
"$replaceContent"
,
replaceContent
);
definitions
.
put
(
"$address"
,
alertCalled
.
getAddress
());
String
content
=
getTaskInformation
(
template
.
getRichContent
(),
definitions
);
alertSubmittedExtDto
.
setSubmissionContentValue
(
JSONObject
.
parseObject
(
alertSubmittedExtDto
.
getSubmissionContent
()));
alertSubmittedExtDto
.
setSubmissionContentValue
(
JSONObject
.
parseObject
(
alertSubmittedExtDto
.
getSubmissionContent
()));
alertSubmittedExtDto
.
setSubmissionContent
(
richC
ontent
);
alertSubmittedExtDto
.
setSubmissionContent
(
c
ontent
);
}
catch
(
JSONException
e
)
{
}
catch
(
JSONException
e
)
{
alertSubmittedExtDto
.
setSubmissionContentValue
(
alertSubmittedExtDto
.
getSubmitContent
());
alertSubmittedExtDto
.
setSubmissionContentValue
(
alertSubmittedExtDto
.
getSubmitContent
());
}
catch
(
ParseException
e
)
{
e
.
printStackTrace
();
}
}
});
});
schedulingReportingDto
.
setSchedulingReportingList
(
alertSubmittedExtDtoList
);
schedulingReportingDto
.
setSchedulingReportingList
(
alertSubmittedExtDtoList
);
...
@@ -211,7 +211,7 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
...
@@ -211,7 +211,7 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
alertCalledVo
.
setAlertCalled
(
alertCalled
);
alertCalledVo
.
setAlertCalled
(
alertCalled
);
// 调用规则
// 调用规则
ruleAlertCalledService
.
fireAlertCalledRule
(
alertCalledVo
,
map
.
get
(
"alertWay"
),
map
.
get
(
"mobiles"
));
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
)
{
...
@@ -256,7 +256,10 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
...
@@ -256,7 +256,10 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
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"
))
{
// 当日值班人员:获值班表中包括消救部、综合办公室、消防支队、应急指挥科的值班人员。
// 当日值班人员:获值班表中包括消救部、综合办公室、消防支队、应急指挥科的值班人员。
List
<
Map
<
String
,
Object
>>
mapList
=
iDutyPersonService
.
queryByCompanyId
();
String
[]
arr
=
e
.
get
(
"onDuty"
).
toString
().
split
(
","
);
List
<
String
>
list
=
Arrays
.
asList
(
arr
);
List
<
Map
<
String
,
Object
>>
mapList
=
iDutyPersonService
.
queryByCompanyId
(
list
);
orgUsers
.
addAll
(
mapList
);
orgUsers
.
addAll
(
mapList
);
}
}
if
(
e
.
containsKey
(
"fireBrigade"
))
{
if
(
e
.
containsKey
(
"fireBrigade"
))
{
...
@@ -271,16 +274,20 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
...
@@ -271,16 +274,20 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
});
});
}
}
if
(
e
.
containsKey
(
"airportUnit"
))
{
// 根据人员职务:干部&领导 机场单位 模块 消防急救保障部中,“人员职务”不为空的人员
if
(
e
.
containsKey
(
"name"
))
{
List
<
Map
<
String
,
Object
>>
mapList
=
iOrgUsrService
.
queryCompanyIdNew
(
"消防救援保障部"
);
// 消防救援保障部
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
(
"airportPost"
))
{
if
(
e
.
containsKey
(
"name"
))
{
List
<
Map
<
String
,
Object
>>
mapList
=
iOrgUsrService
.
queryCompanyId
(
"安运部"
);
String
[]
arr
=
e
.
get
(
"airportPost"
).
toString
().
split
(
","
);
List
<
String
>
list
=
Arrays
.
asList
(
arr
);
List
<
Map
<
String
,
Object
>>
mapList
=
iOrgUsrService
.
queryCompanyId
(
e
.
get
(
"name"
).
toString
(),
list
);
orgUsers
.
addAll
(
mapList
);
orgUsers
.
addAll
(
mapList
);
}
}
}
}
...
@@ -288,7 +295,9 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
...
@@ -288,7 +295,9 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
// 事发单位
// 事发单位
if
(
e
.
get
(
"type"
).
toString
().
equals
(
"SF"
))
{
if
(
e
.
get
(
"type"
).
toString
().
equals
(
"SF"
))
{
if
(
e
.
containsKey
(
"airportPost"
))
{
if
(
e
.
containsKey
(
"airportPost"
))
{
List
<
Map
<
String
,
Object
>>
mapList
=
iOrgUsrService
.
queryCompanyId
(
unitInvolved
);
String
[]
arr
=
e
.
get
(
"airportPost"
).
toString
().
split
(
","
);
List
<
String
>
list
=
Arrays
.
asList
(
arr
);
List
<
Map
<
String
,
Object
>>
mapList
=
iOrgUsrService
.
queryCompanyId
(
unitInvolved
,
list
);
orgUsers
.
addAll
(
mapList
);
orgUsers
.
addAll
(
mapList
);
}
}
}
}
...
@@ -298,20 +307,19 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
...
@@ -298,20 +307,19 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
if
(
alertTypeCode
.
equals
(
AlertStageEnums
.
HKJY
.
getCode
())
||
alertTypeCode
.
equals
(
AlertStageEnums
.
LYXC
.
getCode
())
if
(
alertTypeCode
.
equals
(
AlertStageEnums
.
HKJY
.
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
(
"消防支队"
);
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
(
"onDuty"
))
{
if
(
e
.
containsKey
(
"name"
))
{
List
<
Map
<
String
,
Object
>>
mapList
=
iDutyPersonService
.
queryByCompanyNew
(
"急救科"
);
List
<
Map
<
String
,
Object
>>
mapList
=
iDutyPersonService
.
queryByCompanyNew
(
e
.
get
(
"name"
).
toString
());
orgUsers
.
addAll
(
mapList
);
}
if
(
e
.
containsKey
(
"airportUnit"
))
{
List
<
Map
<
String
,
Object
>>
mapList
=
iOrgUsrService
.
queryCompanyId
(
"急救科"
);
orgUsers
.
addAll
(
mapList
);
orgUsers
.
addAll
(
mapList
);
List
<
Map
<
String
,
Object
>>
mapList1
=
iOrgUsrService
.
queryCompanyIdNew
(
e
.
get
(
"name"
).
toString
());
orgUsers
.
addAll
(
mapList1
);
}
}
}
}
});
});
...
@@ -325,6 +333,21 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
...
@@ -325,6 +333,21 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
// 警情初报 --- 续报 结案
// 警情初报 --- 续报 结案
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
);
alertSubmitted
.
setSubmissionMethodCode
(
submissionMethodEnum
.
get
().
getCode
());
alertSubmitted
.
setSubmissionMethod
(
submissionMethodEnum
.
get
().
getName
());
Optional
<
AlertSchedulingTypeEnum
>
alertSchedulingTypeEnum
=
Optional
.
of
(
AlertSchedulingTypeEnum
.
融合调度
);
alertSubmitted
.
setSchedulingTypeCode
(
alertSchedulingTypeEnum
.
get
().
getCode
());
alertSubmitted
.
setSchedulingType
(
alertSchedulingTypeEnum
.
get
().
getName
());
alertSubmitted
.
setSubmissionContent
(
JSONObject
.
toJSONString
(
objectToMap
(
calledRo
)));
alertSubmitted
.
setUpdateTime
(
new
Date
());
alertSubmitted
.
setSubmissionTime
(
new
Date
());
this
.
baseMapper
.
insert
(
alertSubmitted
);
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"
;
...
@@ -336,35 +359,33 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
...
@@ -336,35 +359,33 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
sCode
=
"SMS_JCS_QR"
;
sCode
=
"SMS_JCS_QR"
;
}
}
Optional
<
SubmissionMethodEnum
>
submissionMethodEnum
=
Optional
.
of
(
SubmissionMethodEnum
.
SMS
);
AlertSubmitted
alertSubmittedNew
=
null
;
alertSubmitted
.
setSubmissionMethodCode
(
submissionMethodEnum
.
get
().
getCode
());
Optional
<
AlertBusinessTypeEnum
>
alertBusinessTypeEnum
=
alertSubmitted
.
setSubmissionMethod
(
submissionMethodEnum
.
get
().
getName
());
EnumsUtils
.
getEnumObject
(
AlertBusinessTypeEnum
.
class
,
Optional
<
AlertSchedulingTypeEnum
>
alertSchedulingTypeEnum
=
Optional
.
of
(
AlertSchedulingTypeEnum
.
融合调度
);
e
->
e
.
getCode
().
equals
(
calledRo
.
getAlertTypeCode
()));
alertSubmitted
.
setSchedulingTypeCode
(
alertSchedulingTypeEnum
.
get
().
getCode
());
smsCode
=
alertBusinessTypeEnum
.
get
().
getSms_code
();
alertSubmitted
.
setSchedulingType
(
alertSchedulingTypeEnum
.
get
().
getName
());
alertSubmitted
.
setSubmissionContent
(
JSONObject
.
toJSONString
(
objectToMap
(
calledRo
)));
// String token = RequestContext.getToken();
// ReginParams reginParams = JSONObject.parseObject(.get(RedisredisUtilsKey.buildReginKey(RequestContext.getExeUserId(),token)).toString(),
// ReginParams.class);
// alertSubmitted.setRecUserName(reginParams.getUserModel().getUserName());
// alertSubmitted.setSender(reginParams.getUserModel().getUserName());
alertSubmitted
.
setUpdateTime
(
new
Date
());
alertSubmitted
.
setSubmissionTime
(
new
Date
());
this
.
baseMapper
.
insert
(
alertSubmitted
);
alertSubmittedId
=
alertSubmitted
.
getSequenceNbr
().
toString
();
Optional
<
AlertBusinessTypeEnum
>
alertBusinessTypeEnum
=
EnumsUtils
.
getEnumObject
(
AlertBusinessTypeEnum
.
class
,
e
->
e
.
getCode
().
equals
(
calledRo
.
getAlertTypeCode
()));
smsCode
=
alertBusinessTypeEnum
.
get
().
getSms_code
();
// 组装人员信息
if
(!
alertWay
.
equals
(
AlertBusinessTypeEnum
.
警情初报
.
getCode
()))
{
LambdaQueryWrapper
<
AlertSubmitted
>
queryWrapper
=
new
LambdaQueryWrapper
<>();
queryWrapper
.
eq
(
AlertSubmitted:
:
getAlertCalledId
,
alertCalledId
);
queryWrapper
.
orderByDesc
(
AlertSubmitted:
:
getSequenceNbr
);
List
<
AlertSubmitted
>
alertSubmitteds
=
alertSubmittedMapper
.
selectList
(
queryWrapper
);
alertSubmittedNew
=
alertSubmitteds
.
get
(
0
);
}
// 组装人员信息
for
(
Map
<
String
,
Object
>
orgUser
:
orgUsers
)
{
for
(
Map
<
String
,
Object
>
orgUser
:
orgUsers
)
{
AlertSubmittedObject
alertSubmittedObject
=
new
AlertSubmittedObject
();
AlertSubmittedObject
alertSubmittedObject
=
new
AlertSubmittedObject
();
alertSubmittedObject
.
setAlertSubmittedId
(
Long
.
parseLong
(
alertSubmittedId
));
if
(!
alertWay
.
equals
(
AlertBusinessTypeEnum
.
警情初报
.
getCode
()))
{
alertSubmittedObject
.
setAlertSubmittedId
(
alertSubmittedNew
.
getSequenceNbr
());
}
else
{
alertSubmittedObject
.
setAlertSubmittedId
(
Long
.
parseLong
(
alertSubmittedId
));
}
alertSubmittedObject
.
setType
(
false
);
alertSubmittedObject
.
setType
(
false
);
// alertSubmittedObject.setCompanyId(Long.valueOf((String) orgUser.get("parentId")));
// alertSubmittedObject.setCompanyName((String) orgUser.get("parenName"));
alertSubmittedObject
.
setUserId
(
Long
.
valueOf
(
String
.
valueOf
(
orgUser
.
get
(
"sequenceNbr"
))));
alertSubmittedObject
.
setUserId
(
Long
.
valueOf
(
String
.
valueOf
(
orgUser
.
get
(
"sequenceNbr"
))));
alertSubmittedObject
.
setUserName
((
String
)
orgUser
.
get
(
"bizOrgName"
));
alertSubmittedObject
.
setUserName
((
String
)
orgUser
.
get
(
"bizOrgName"
));
...
@@ -374,6 +395,7 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
...
@@ -374,6 +395,7 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
}
}
alertSubmittedObjectList
.
add
(
alertSubmittedObject
);
alertSubmittedObjectList
.
add
(
alertSubmittedObject
);
}
}
// 组装报送内容
// 组装报送内容
smsParams
.
put
(
"callTimeStr"
,
calledRo
.
getCallTimeStr
());
smsParams
.
put
(
"callTimeStr"
,
calledRo
.
getCallTimeStr
());
smsParams
.
put
(
"address"
,
calledRo
.
getAddress
());
smsParams
.
put
(
"address"
,
calledRo
.
getAddress
());
...
@@ -416,20 +438,15 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
...
@@ -416,20 +438,15 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
String
alertWay
=
""
;
String
alertWay
=
""
;
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
<>();
if
(
alertSubmittedId
==
null
)
{
if
(
alertSubmittedId
==
null
)
{
// 1.保存警情记录主表
// 1.保存警情记录主表
AlertSubmitted
alertSubmitted
=
new
AlertSubmitted
();
AlertSubmitted
alertSubmitted
=
new
AlertSubmitted
();
String
bussTypeCode
;
String
bussTypeCode
;
alertSubmitted
.
setAlertCalledId
(
alertSubmittedDto
.
getAlertCalledId
());
alertSubmitted
.
setAlertCalledId
(
alertSubmittedDto
.
getAlertCalledId
());
// 任务 4174 日常值班---融合调度----短信模版中的内容用户可以全部删除掉,按照自定义内容重新录入发送内容 by litw 2021年10月27日
// 任务 4174 日常值班---融合调度----短信模版中的内容用户可以全部删除掉,按照自定义内容重新录入发送内容 by litw 2021年10月27日
if
(
"316"
.
equals
(
alertSubmittedDto
.
getBusinessTypeCode
()))
{
alertSubmitted
.
setBusinessTypeCode
(
alertSubmittedDto
.
getBusinessTypeCode
());
alertSubmitted
.
setBusinessTypeCode
(
AlertBusinessTypeEnum
.
警情续报
.
getCode
());
bussTypeCode
=
alertSubmittedDto
.
getBusinessTypeCode
();
bussTypeCode
=
AlertBusinessTypeEnum
.
警情续报
.
getCode
();
}
else
{
alertSubmitted
.
setBusinessTypeCode
(
alertSubmittedDto
.
getBusinessTypeCode
());
bussTypeCode
=
alertSubmittedDto
.
getBusinessTypeCode
();
}
Optional
<
AlertBusinessTypeEnum
>
businessTypeEnum
=
EnumsUtils
.
getEnumObject
(
AlertBusinessTypeEnum
.
class
,
Optional
<
AlertBusinessTypeEnum
>
businessTypeEnum
=
EnumsUtils
.
getEnumObject
(
AlertBusinessTypeEnum
.
class
,
e
->
e
.
getCode
().
equals
(
bussTypeCode
));
e
->
e
.
getCode
().
equals
(
bussTypeCode
));
...
@@ -446,13 +463,8 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
...
@@ -446,13 +463,8 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
alertSubmitted
.
setSchedulingType
(
alertSchedulingTypeEnum
.
get
().
getName
());
alertSubmitted
.
setSchedulingType
(
alertSchedulingTypeEnum
.
get
().
getName
());
// 任务 4174 日常值班---融合调度----短信模版中的内容用户可以全部删除掉,按照自定义内容重新录入发送内容 by litw 2021年10月27日
// 任务 4174 日常值班---融合调度----短信模版中的内容用户可以全部删除掉,按照自定义内容重新录入发送内容 by litw 2021年10月27日
if
(
"316"
.
equals
(
alertSubmittedDto
.
getBusinessTypeCode
()))
{
alertSubmitted
.
setBusinessTypeCode
(
alertSubmittedDto
.
getBusinessTypeCode
());
JSONObject
jsonObject
=
JSON
.
parseObject
(
alertSubmittedDto
.
getSubmitContent
().
toJSONString
());
alertSubmitted
.
setSubmissionContent
(
alertSubmittedDto
.
getSubmitContent
().
toJSONString
());
alertSubmitted
.
setSubmissionContent
(
jsonObject
.
get
(
"custom"
).
toString
());
}
else
{
alertSubmitted
.
setBusinessTypeCode
(
alertSubmittedDto
.
getBusinessTypeCode
());
alertSubmitted
.
setSubmissionContent
(
alertSubmittedDto
.
getSubmitContent
().
toJSONString
());
}
alertSubmitted
.
setSender
(
userName
);
alertSubmitted
.
setSender
(
userName
);
alertSubmitted
.
setRecUserName
(
userName
);
alertSubmitted
.
setRecUserName
(
userName
);
...
@@ -489,6 +501,7 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
...
@@ -489,6 +501,7 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
alertSubmittedObject
.
setCompanyId
(
company
.
getCompanyId
());
alertSubmittedObject
.
setCompanyId
(
company
.
getCompanyId
());
alertSubmittedObject
.
setCompanyName
(
company
.
getCompanyName
());
alertSubmittedObject
.
setCompanyName
(
company
.
getCompanyName
());
alertSubmittedObject
.
setUserId
(
person
.
getPersonId
());
alertSubmittedObject
.
setUserId
(
person
.
getPersonId
());
userIds
.
add
(
person
.
getPersonId
());
alertSubmittedObject
.
setUserName
(
person
.
getPersonName
());
alertSubmittedObject
.
setUserName
(
person
.
getPersonName
());
alertSubmittedObject
.
setUserPhone
(
person
.
getPersonPhone
());
alertSubmittedObject
.
setUserPhone
(
person
.
getPersonPhone
());
alertSubmittedObject
.
setRecUserName
(
userName
);
alertSubmittedObject
.
setRecUserName
(
userName
);
...
@@ -499,6 +512,24 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
...
@@ -499,6 +512,24 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
});
});
});
});
}
}
// 查询AmousUserId
LambdaQueryWrapper
<
OrgUsr
>
queryWrapper
=
new
LambdaQueryWrapper
<>();
queryWrapper
.
in
(
true
,
OrgUsr:
:
getSequenceNbr
,
userIds
);
List
<
String
>
usIds
=
new
ArrayList
<>();
List
<
OrgUsr
>
list
=
orgUsrService
.
getBaseMapper
().
selectList
(
queryWrapper
);
if
(
null
!=
list
&&
list
.
size
()
>
0
)
{
list
.
stream
().
forEach
(
e
->{
if
(!
ValidationUtil
.
isEmpty
(
e
.
getAmosOrgId
()))
{
usIds
.
add
(
e
.
getAmosOrgId
());
}
});
map
.
put
(
"usIds"
,
StringUtils
.
join
(
usIds
.
toArray
(
new
String
[
userIds
.
size
()]),
","
));
}
else
{
map
.
put
(
"usIds"
,
""
);
}
alertSubmittedObjectServiceImpl
.
saveBatch
(
alertSubmittedObjectList
);
alertSubmittedObjectServiceImpl
.
saveBatch
(
alertSubmittedObjectList
);
// 3.更新警情状态
// 3.更新警情状态
...
@@ -544,18 +575,17 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
...
@@ -544,18 +575,17 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
}
}
// 4.发送任务消息
// 4.发送任务消息
// 4.1组织短信内容
// 4.1组织短信内容 废弃
// HashMap<String, String> smsParams = new HashMap<>();
// JSONObject submitContent = alertSubmittedDto.getSubmitContent();
JSONObject
submitContent
=
alertSubmittedDto
.
getSubmitContent
();
// if(!"316".equals(alertSubmittedDto.getBusinessTypeCode())) {
// smsParams.put("alertType", submitContent.get("alertType").toString());
String
feedBack
=
submitContent
.
get
(
"editContent"
)
!=
null
?
submitContent
.
get
(
"editContent"
).
toString
():
""
;
// smsParams.put("trappedNum", submitContent.get("trappedNum").toString());
// smsParams.put("companyName", submitContent.get("companyName").toString());
// }
// 4.2调用短信发送接口
// alertCalledAction.sendAlertCalleCmd(smsCode, mobiles, smsParams);
// 4.2调用短信发送接口 废弃
// alertCalledAction.sendAlertCalleCmd(smsCode, mobiles, smsParams);\
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
;
...
@@ -580,10 +610,20 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
...
@@ -580,10 +610,20 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
alertCalledAction
.
sendAlertCalleCmd
(
smsCode
,
mobiles
,
smsParams
);
alertCalledAction
.
sendAlertCalleCmd
(
smsCode
,
mobiles
,
smsParams
);
}
}
public
void
getAlertSubmittedContent
(
Long
alertCalledId
,
ArrayList
<
TemplateDto
>
templateDtos
,
String
companyName
)
throws
IllegalAccessException
{
public
void
getAlertSubmittedContent
(
Long
alertCalledId
,
ArrayList
<
TemplateDto
>
templateDtos
,
String
companyName
)
throws
IllegalAccessException
,
ParseException
{
AlertCalled
alertCalled
=
alertCalledService
.
getById
(
alertCalledId
);
AlertCalled
alertCalled
=
alertCalledService
.
getById
(
alertCalledId
);
Map
<
String
,
Object
>
map
=
objectToMap
(
alertCalled
);
Map
<
String
,
Object
>
map
=
objectToMap
(
alertCalled
);
map
.
put
(
"companyName"
,
companyName
);
map
.
put
(
"companyName"
,
companyName
);
map
.
put
(
"editContent"
,
"可自编辑续报内容"
);
AlertCalledObjsDto
alertCalledVo
=
(
AlertCalledObjsDto
)
alertCalledService
.
selectAlertCalledByIdNoRedisNew
(
alertCalled
.
getSequenceNbr
());
/**
* 构建警情报送规则对象
*/
AlertCalledRo
alertCalledRo
=
new
AlertCalledRo
();
String
replaceContent
=
RuleAlertCalledService
.
init
(
alertCalledRo
,
alertCalledVo
);
// 获取模板内容
// 获取模板内容
List
<
DataDictionary
>
dataDictionaries
=
List
<
DataDictionary
>
dataDictionaries
=
...
@@ -592,21 +632,13 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
...
@@ -592,21 +632,13 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
for
(
DataDictionary
dataDictionary
:
dataDictionaries
)
{
for
(
DataDictionary
dataDictionary
:
dataDictionaries
)
{
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
));
List
<
PowerTransferCompanyDto
>
lastPowerTransferCompany
;
Map
<
String
,
String
>
definitions
=
new
HashMap
<>();
if
(
"警情续报"
.
equals
(
template
.
getType
())
&&
(
lastPowerTransferCompany
=
definitions
.
put
(
"$type"
,
alertCalled
.
getAlertType
());
powerTransferService
.
getLastPowerTransferCompany
(
alertCalledId
)).
size
()
>
0
)
{
definitions
.
put
(
"$callTime"
,
DateUtils
.
dateTimeToDateString
(
alertCalled
.
getCallTime
()));
map
.
put
(
"businessType"
,
template
.
getType
());
definitions
.
put
(
"$replaceContent"
,
replaceContent
);
// 获取力量调派内容
definitions
.
put
(
"$address"
,
alertCalled
.
getAddress
());
StringBuilder
companyNames
=
new
StringBuilder
();
String
content
=
getTaskInformation
(
template
.
getContent
(),
definitions
);
StringBuilder
resourcesInfo
=
new
StringBuilder
();
template
.
setContent
(
content
);
for
(
PowerTransferCompanyDto
powerTransferCompanyDto
:
lastPowerTransferCompany
)
{
companyNames
.
append
(
powerTransferCompanyDto
.
getCompanyName
()).
append
(
"、"
);
resourcesInfo
.
append
(
powerTransferCompanyDto
.
getType
()).
append
(
powerTransferCompanyDto
.
getResourcesCount
()).
append
(
"辆、"
);
}
map
.
put
(
"companyNames"
,
companyNames
.
deleteCharAt
(
companyNames
.
length
()
-
1
).
toString
());
map
.
put
(
"resourcesInfo"
,
resourcesInfo
.
deleteCharAt
(
resourcesInfo
.
length
()
-
1
).
toString
());
map
.
put
(
"transferTime"
,
lastPowerTransferCompany
.
get
(
0
).
getRecDate
());
}
TemplateDto
templateDto
=
new
TemplateDto
();
TemplateDto
templateDto
=
new
TemplateDto
();
BeanUtils
.
copyProperties
(
template
,
templateDto
);
BeanUtils
.
copyProperties
(
template
,
templateDto
);
templateDto
.
setData
(
map
);
templateDto
.
setData
(
map
);
...
@@ -614,6 +646,13 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
...
@@ -614,6 +646,13 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
}
}
}
}
private
String
getTaskInformation
(
String
content
,
Map
<
String
,
String
>
definitions
)
{
int
size
=
definitions
.
size
();
String
[]
keys
=
definitions
.
keySet
().
toArray
(
new
String
[
size
]);
String
[]
values
=
definitions
.
values
().
toArray
(
new
String
[
size
]);
return
StringUtils
.
replaceEach
(
content
,
keys
,
values
);
}
@Override
@Override
public
AlertSubmittedSMSDto
getSchedulingContent
(
Long
id
)
{
public
AlertSubmittedSMSDto
getSchedulingContent
(
Long
id
)
{
return
this
.
baseMapper
.
getSchedulingContent
(
id
);
return
this
.
baseMapper
.
getSchedulingContent
(
id
);
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-jcs-biz/src/main/java/com/yeejoin/amos/boot/module/jcs/biz/service/impl/RuleAlertCalledService.java
View file @
6b2584cf
...
@@ -51,7 +51,7 @@ public class RuleAlertCalledService {
...
@@ -51,7 +51,7 @@ public class RuleAlertCalledService {
* @return
* @return
* @throws Exception
* @throws Exception
*/
*/
public
Boolean
fireAlertCalledRule
(
AlertCalledObjsDto
alertCalledVo
,
String
alertWay
,
String
mobiles
)
throws
Exception
{
public
Boolean
fireAlertCalledRule
(
AlertCalledObjsDto
alertCalledVo
,
String
alertWay
,
String
mobiles
,
String
usIds
,
String
feedBack
)
throws
Exception
{
AlertCalled
alertCalled
=
alertCalledVo
.
getAlertCalled
();
AlertCalled
alertCalled
=
alertCalledVo
.
getAlertCalled
();
if
(
ValidationUtil
.
isEmpty
(
alertCalled
))
{
if
(
ValidationUtil
.
isEmpty
(
alertCalled
))
{
throw
new
BadRequest
(
"参数校验失败."
);
throw
new
BadRequest
(
"参数校验失败."
);
...
@@ -60,136 +60,154 @@ public class RuleAlertCalledService {
...
@@ -60,136 +60,154 @@ public class RuleAlertCalledService {
* 构建警情报送规则对象
* 构建警情报送规则对象
*/
*/
AlertCalledRo
alertCalledRo
=
new
AlertCalledRo
();
AlertCalledRo
alertCalledRo
=
new
AlertCalledRo
();
alertCalledRo
.
setFeedback
(
feedBack
);
String
replaceContent
=
init
(
alertCalledRo
,
alertCalledVo
);
//通用属性
// 警情 报送类型
alertCalledRo
.
setSequenceNbr
(
String
.
valueOf
(
alertCalled
.
getSequenceNbr
()));
alertCalledRo
.
setAlertWay
(
alertWay
);
alertCalledRo
.
setAddress
(
alertCalled
.
getAddress
());
alertCalledRo
.
setReplaceContent
(
replaceContent
);
alertCalledRo
.
setUsIds
(
usIds
);
if
(!
ValidationUtil
.
isEmpty
(
mobiles
))
{
alertCalledRo
.
setIds
(
mobiles
);
}
//触发规则
ruleTrigger
.
publish
(
alertCalledRo
,
"西咸机场119接处警规则/alertCalledRule"
,
new
String
[
0
]);
return
true
;
}
public
static
String
init
(
AlertCalledRo
alertCalledRo
,
AlertCalledObjsDto
alertCalledVo
)
{
AlertCalled
alertCalled
=
alertCalledVo
.
getAlertCalled
();
//通用属性
alertCalledRo
.
setSequenceNbr
(
String
.
valueOf
(
alertCalled
.
getSequenceNbr
()));
alertCalledRo
.
setAddress
(
alertCalled
.
getAddress
());
alertCalledRo
.
setUnitInvolved
(
alertCalled
.
getUnitInvolved
());
alertCalledRo
.
setUnitInvolved
(
alertCalled
.
getUnitInvolved
());
alertCalledRo
.
setContactUser
(
alertCalled
.
getContactUser
());
alertCalledRo
.
setContactUser
(
alertCalled
.
getContactUser
());
alertCalledRo
.
setContactPhone
(
alertCalled
.
getContactPhone
());
alertCalledRo
.
setContactPhone
(
alertCalled
.
getContactPhone
());
alertCalledRo
.
setAlertType
(
alertCalled
.
getAlertType
());
alertCalledRo
.
setAlertType
(
alertCalled
.
getAlertType
());
alertCalledRo
.
setAlertTypeCode
(
alertCalled
.
getAlertTypeCode
());
alertCalledRo
.
setAlertTypeCode
(
alertCalled
.
getAlertTypeCode
());
alertCalledRo
.
setCasualtiesNum
(
alertCalled
.
getCasualtiesNum
()
!=
null
?
String
.
valueOf
(
alertCalled
.
getCasualtiesNum
())
:
"无"
);
alertCalledRo
.
setCasualtiesNum
(
alertCalled
.
getCasualtiesNum
()
!=
null
?
String
.
valueOf
(
alertCalled
.
getCasualtiesNum
())
:
"无"
);
alertCalledRo
.
setTrappedNum
(
alertCalled
.
getTrappedNum
()
!=
null
?
String
.
valueOf
(
alertCalled
.
getTrappedNum
())
:
"无"
);
alertCalledRo
.
setTrappedNum
(
alertCalled
.
getTrappedNum
()
!=
null
?
String
.
valueOf
(
alertCalled
.
getTrappedNum
())
:
"无"
);
alertCalledRo
.
setCompanyName
(
alertCalled
.
getCompanyName
());
alertCalledRo
.
setCompanyName
(
alertCalled
.
getCompanyName
());
List
<
AlertFormValue
>
alertFormValues
=
alertCalledVo
.
getAlertFormValue
();
List
<
AlertFormValue
>
alertFormValues
=
alertCalledVo
.
getAlertFormValue
();
if
(!
ValidationUtil
.
isEmpty
(
alertFormValues
))
if
(!
ValidationUtil
.
isEmpty
(
alertFormValues
))
{
for
(
AlertFormValue
alertFormValue
:
alertFormValues
)
{
{
for
(
AlertFormValue
alertFormValue
:
alertFormValues
)
if
(
alertFormValue
.
getFieldCode
().
equals
(
"alertSubmittedId"
)
)
{
{
if
(
alertFormValue
.
getFieldCode
().
equals
(
"alertSubmittedId"
))
alertCalledRo
.
setAlertSubmittedId
(
alertFormValue
.
getFieldValue
());
{
}
alertCalledRo
.
setAlertSubmittedId
(
alertFormValue
.
getFieldValue
());
//一般火灾
}
if
(
alertFormValue
.
getFieldCode
().
equals
(
"fireLocation"
))
//一般火灾
{
if
(
alertFormValue
.
getFieldCode
().
equals
(
"fireLocation"
))
alertCalledRo
.
setFireLocation
(
alertFormValue
.
getFieldValue
());
{
}
alertCalledRo
.
setFireLocation
(
alertFormValue
.
getFieldValue
());
if
(
alertFormValue
.
getFieldCode
().
equals
(
"burningMaterial"
))
}
{
if
(
alertFormValue
.
getFieldCode
().
equals
(
"burningMaterial"
))
alertCalledRo
.
setBurningMaterial
(
alertFormValue
.
getFieldValue
());
{
}
alertCalledRo
.
setBurningMaterial
(
alertFormValue
.
getFieldValue
());
if
(
alertFormValue
.
getFieldCode
().
equals
(
"fireSituation"
))
}
{
if
(
alertFormValue
.
getFieldCode
().
equals
(
"fireSituation"
))
alertCalledRo
.
setFireSituation
(
alertFormValue
.
getFieldValue
());
{
}
alertCalledRo
.
setFireSituation
(
alertFormValue
.
getFieldValue
());
if
(
alertFormValue
.
getFieldCode
().
equals
(
"dangerousExplosives"
))
}
{
if
(
alertFormValue
.
getFieldCode
().
equals
(
"dangerousExplosives"
))
alertCalledRo
.
setDangerousExplosives
(
alertFormValue
.
getFieldValue
());
{
}
alertCalledRo
.
setDangerousExplosives
(
alertFormValue
.
getFieldValue
());
if
(
alertFormValue
.
getFieldCode
().
equals
(
"fireTime"
))
}
{
if
(
alertFormValue
.
getFieldCode
().
equals
(
"fireTime"
))
alertCalledRo
.
setCallTimeStr
(
alertFormValue
.
getFieldValue
());
{
}
alertCalledRo
.
setCallTimeStr
(
alertFormValue
.
getFieldValue
());
//航空器救援
}
if
(
alertFormValue
.
getFieldCode
().
equals
(
"flightNumber"
))
{
//航空器救援
alertCalledRo
.
setFlightNumber
(
alertFormValue
.
getFieldValue
());
if
(
alertFormValue
.
getFieldCode
().
equals
(
"flightNumber"
))
{
}
alertCalledRo
.
setFlightNumber
(
alertFormValue
.
getFieldValue
());
if
(
alertFormValue
.
getFieldCode
().
equals
(
"aircraftModel"
))
{
}
alertCalledRo
.
setAircraftModel
(
alertFormValue
.
getFieldValue
());
if
(
alertFormValue
.
getFieldCode
().
equals
(
"aircraftModel"
))
{
}
alertCalledRo
.
setAircraftModel
(
alertFormValue
.
getFieldValue
());
if
(
alertFormValue
.
getFieldCode
().
equals
(
"landingTime"
))
{
}
alertCalledRo
.
setLandingTime
(
alertFormValue
.
getFieldValue
());
if
(
alertFormValue
.
getFieldCode
().
equals
(
"landingTime"
))
{
}
alertCalledRo
.
setLandingTime
(
alertFormValue
.
getFieldValue
());
if
(
alertFormValue
.
getFieldCode
().
equals
(
"developmentTrend"
))
{
}
alertCalledRo
.
setDevelopmentTrend
(
alertFormValue
.
getFieldValue
());
if
(
alertFormValue
.
getFieldCode
().
equals
(
"developmentTrend"
))
{
}
alertCalledRo
.
setDevelopmentTrend
(
alertFormValue
.
getFieldValue
());
if
(
alertFormValue
.
getFieldCode
().
equals
(
"fuelQuantity"
))
{
}
alertCalledRo
.
setFuelQuantity
(
alertFormValue
.
getFieldValue
());
if
(
alertFormValue
.
getFieldCode
().
equals
(
"fuelQuantity"
))
{
}
alertCalledRo
.
setFuelQuantity
(
alertFormValue
.
getFieldValue
());
if
(
alertFormValue
.
getFieldCode
().
equals
(
"passengerCapacity"
))
{
}
alertCalledRo
.
setPassengerCapacity
(
alertFormValue
.
getFieldValue
());
if
(
alertFormValue
.
getFieldCode
().
equals
(
"passengerCapacity"
))
{
}
alertCalledRo
.
setPassengerCapacity
(
alertFormValue
.
getFieldValue
());
if
(
alertFormValue
.
getFieldCode
().
equals
(
"damageLocation"
))
{
}
alertCalledRo
.
setDamageLocation
(
alertFormValue
.
getFieldValue
());
if
(
alertFormValue
.
getFieldCode
().
equals
(
"damageLocation"
))
{
}
alertCalledRo
.
setDamageLocation
(
alertFormValue
.
getFieldValue
());
if
(
alertFormValue
.
getFieldCode
().
equals
(
"forcedLandingTrack"
))
{
}
alertCalledRo
.
setForcedLandingTrack
(
alertFormValue
.
getFieldValue
());
if
(
alertFormValue
.
getFieldCode
().
equals
(
"forcedLandingTrack"
))
{
}
alertCalledRo
.
setForcedLandingTrack
(
alertFormValue
.
getFieldValue
());
if
(
alertFormValue
.
getFieldCode
().
equals
(
"accidentSituation"
))
{
}
alertCalledRo
.
setAccidentSituationHkq
(
alertFormValue
.
getFieldValue
());
if
(
alertFormValue
.
getFieldCode
().
equals
(
"accidentSituation"
))
{
}
alertCalledRo
.
setAccidentSituationHkq
(
alertFormValue
.
getFieldValue
());
}
//突发事件救援
if
(
alertFormValue
.
getFieldCode
().
equals
(
"accidentSituation"
))
{
//突发事件救援
alertCalledRo
.
setAccidentSituation
(
alertFormValue
.
getFieldValue
());
if
(
alertFormValue
.
getFieldCode
().
equals
(
"accidentSituation"
))
{
}
alertCalledRo
.
setAccidentSituation
(
alertFormValue
.
getFieldValue
());
}
//漏油现场安全保障
if
(
alertFormValue
.
getFieldCode
().
equals
(
"flightNumber"
))
{
alertCalledRo
.
setFlightNumberLy
(
alertFormValue
.
getFieldValue
());
}
if
(
alertFormValue
.
getFieldCode
().
equals
(
"seat"
))
{
alertCalledRo
.
setSeat
(
alertFormValue
.
getFieldValue
());
}
if
(
alertFormValue
.
getFieldCode
().
equals
(
"oilLeakageArea"
))
{
alertCalledRo
.
setOilLeakageArea
(
alertFormValue
.
getFieldValue
());
}
//专机保障
if
(
alertFormValue
.
getFieldCode
().
equals
(
"securityLevel"
))
{
alertCalledRo
.
setSecurityLevel
(
alertFormValue
.
getFieldValue
());
}
if
(
alertFormValue
.
getFieldCode
().
equals
(
"seat"
))
{
alertCalledRo
.
setSeatBz
(
alertFormValue
.
getFieldValue
());
}
//120 急救
if
(
alertFormValue
.
getFieldCode
().
equals
(
"patientStatus"
))
{
alertCalledRo
.
setPatientStatus
(
alertFormValue
.
getFieldValue
());
}
if
(
alertFormValue
.
getFieldCode
().
equals
(
"gender"
))
{
alertCalledRo
.
setGender
(
alertFormValue
.
getFieldValue
());
}
if
(
alertFormValue
.
getFieldCode
().
equals
(
"ageGroup"
))
{
alertCalledRo
.
setAgeGroup
(
alertFormValue
.
getFieldValue
());
}
//漏油现场安全保障
if
(
alertFormValue
.
getFieldCode
().
equals
(
"flightNumber"
))
{
alertCalledRo
.
setFlightNumberLy
(
alertFormValue
.
getFieldValue
());
}
if
(
alertFormValue
.
getFieldCode
().
equals
(
"seat"
))
{
alertCalledRo
.
setSeat
(
alertFormValue
.
getFieldValue
());
}
if
(
alertFormValue
.
getFieldCode
().
equals
(
"oilLeakageArea"
))
{
alertCalledRo
.
setOilLeakageArea
(
alertFormValue
.
getFieldValue
());
}
//专机保障
if
(
alertFormValue
.
getFieldCode
().
equals
(
"securityLevel"
))
{
alertCalledRo
.
setSecurityLevel
(
alertFormValue
.
getFieldValue
());
}
if
(
alertFormValue
.
getFieldCode
().
equals
(
"seat"
))
{
alertCalledRo
.
setSeatBz
(
alertFormValue
.
getFieldValue
());
}
//120 急救
if
(
alertFormValue
.
getFieldCode
().
equals
(
"patientStatus"
))
{
alertCalledRo
.
setPatientStatus
(
alertFormValue
.
getFieldValue
());
}
if
(
alertFormValue
.
getFieldCode
().
equals
(
"gender"
))
{
alertCalledRo
.
setGender
(
alertFormValue
.
getFieldValue
());
}
if
(
alertFormValue
.
getFieldCode
().
equals
(
"ageGroup"
))
{
alertCalledRo
.
setAgeGroup
(
alertFormValue
.
getFieldValue
());
}
}
}
}
}
// 警情初报模板替换规则
// 警情初报模板替换规则
String
replaceContent
=
""
;
String
replaceContent
=
""
;
if
(
alertCalled
.
getAlertTypeCode
().
equals
(
AlertStageEnums
.
YBHZ
.
getCode
()))
{
if
(
alertCalled
.
getAlertTypeCode
().
equals
(
AlertStageEnums
.
YBHZ
.
getCode
()))
{
replaceContent
=
"失火位置:"
.
concat
(
ValidationUtil
.
isEmpty
(
alertCalled
.
getAddress
())
?
"无"
:
alertCalled
.
getAddress
()).
concat
(
replaceContent
=
"失火位置:"
.
concat
(
ValidationUtil
.
isEmpty
(
alertCalled
.
getAddress
())
?
"无"
:
alertCalled
.
getAddress
()).
concat
(
";燃烧物质:"
).
concat
(
ValidationUtil
.
isEmpty
(
alertCalledRo
.
getFireLocation
()
)?
"无"
:
alertCalledRo
.
getFireLocation
()).
concat
(
";燃烧物质:"
).
concat
(
ValidationUtil
.
isEmpty
(
alertCalledRo
.
getFireLocation
()
)?
"无"
:
alertCalledRo
.
getFireLocation
()).
concat
(
";火势情况:"
).
concat
(
ValidationUtil
.
isEmpty
(
alertCalledRo
.
getFireLocation
()
)
?
"无"
:
alertCalledRo
.
getFireSituation
());
";火势情况:"
).
concat
(
ValidationUtil
.
isEmpty
(
alertCalledRo
.
getFireLocation
()
)
?
"无"
:
alertCalledRo
.
getFireSituation
());
}
}
if
(
alertCalled
.
getAlertTypeCode
().
equals
(
AlertStageEnums
.
HKJY
.
getCode
()))
{
if
(
alertCalled
.
getAlertTypeCode
().
equals
(
AlertStageEnums
.
HKJY
.
getCode
()))
{
replaceContent
=
"航班号:"
.
concat
(
ValidationUtil
.
isEmpty
(
alertCalledRo
.
getFlightNumber
())
?
"无"
:
alertCalledRo
.
getFlightNumber
()).
concat
(
replaceContent
=
"航班号:"
.
concat
(
ValidationUtil
.
isEmpty
(
alertCalledRo
.
getFlightNumber
())
?
"无"
:
alertCalledRo
.
getFlightNumber
()).
concat
(
";飞机型号:"
).
concat
(
ValidationUtil
.
isEmpty
(
alertCalledRo
.
getAircraftModel
()
)?
"无"
:
alertCalledRo
.
getAircraftModel
()).
concat
(
";飞机型号:"
).
concat
(
ValidationUtil
.
isEmpty
(
alertCalledRo
.
getAircraftModel
()
)?
"无"
:
alertCalledRo
.
getAircraftModel
()).
concat
(
";落地时间:"
).
concat
(
ValidationUtil
.
isEmpty
(
alertCalledRo
.
getLandingTime
()
)
?
"无"
:
alertCalledRo
.
getLandingTime
()).
concat
(
";落地时间:"
).
concat
(
ValidationUtil
.
isEmpty
(
alertCalledRo
.
getLandingTime
()
)
?
"无"
:
alertCalledRo
.
getLandingTime
()).
concat
(
"发生"
.
concat
(
ValidationUtil
.
isEmpty
(
alertCalledRo
.
getAccidentSituationHkq
())
?
"无"
:
alertCalledRo
.
getAccidentSituationHkq
()).
concat
(
"发生"
.
concat
(
ValidationUtil
.
isEmpty
(
alertCalledRo
.
getAccidentSituationHkq
())
?
"无"
:
alertCalledRo
.
getAccidentSituationHkq
()).
concat
(
";飞机受损位置:"
).
concat
(
ValidationUtil
.
isEmpty
(
alertCalledRo
.
getDamageLocation
()
)?
"无"
:
alertCalledRo
.
getDamageLocation
()).
concat
(
";飞机受损位置:"
).
concat
(
ValidationUtil
.
isEmpty
(
alertCalledRo
.
getDamageLocation
()
)?
"无"
:
alertCalledRo
.
getDamageLocation
()).
concat
(
";燃油量:"
).
concat
(
ValidationUtil
.
isEmpty
(
alertCalledRo
.
getFuelQuantity
()
)
?
"无"
:
alertCalledRo
.
getFuelQuantity
()).
concat
(
";燃油量:"
).
concat
(
ValidationUtil
.
isEmpty
(
alertCalledRo
.
getFuelQuantity
()
)
?
"无"
:
alertCalledRo
.
getFuelQuantity
()).
concat
(
"载客量:"
.
concat
(
ValidationUtil
.
isEmpty
(
alertCalledRo
.
getPassengerCapacity
())
?
"无"
:
alertCalledRo
.
getPassengerCapacity
()).
concat
(
"载客量:"
.
concat
(
ValidationUtil
.
isEmpty
(
alertCalledRo
.
getPassengerCapacity
())
?
"无"
:
alertCalledRo
.
getPassengerCapacity
()).
concat
(
";迫降跑道:"
).
concat
(
ValidationUtil
.
isEmpty
(
alertCalledRo
.
getForcedLandingTrack
()
)?
"无"
:
alertCalledRo
.
getForcedLandingTrack
()).
concat
(
";迫降跑道:"
).
concat
(
ValidationUtil
.
isEmpty
(
alertCalledRo
.
getForcedLandingTrack
()
)?
"无"
:
alertCalledRo
.
getForcedLandingTrack
()).
concat
(
";发展态势:"
).
concat
(
ValidationUtil
.
isEmpty
(
alertCalledRo
.
getDevelopmentTrend
()
)
?
"无"
:
alertCalledRo
.
getDevelopmentTrend
())
";发展态势:"
).
concat
(
ValidationUtil
.
isEmpty
(
alertCalledRo
.
getDevelopmentTrend
()
)
?
"无"
:
alertCalledRo
.
getDevelopmentTrend
())
));
));
}
}
...
@@ -214,18 +232,7 @@ public class RuleAlertCalledService {
...
@@ -214,18 +232,7 @@ public class RuleAlertCalledService {
";年龄段:"
).
concat
(
ValidationUtil
.
isEmpty
(
alertCalledRo
.
getAgeGroup
()
)
?
"无"
:
alertCalledRo
.
getAgeGroup
());
";年龄段:"
).
concat
(
ValidationUtil
.
isEmpty
(
alertCalledRo
.
getAgeGroup
()
)
?
"无"
:
alertCalledRo
.
getAgeGroup
());
}
}
// 警情 报送类型
return
replaceContent
;
alertCalledRo
.
setAlertWay
(
alertWay
);
alertCalledRo
.
setReplaceContent
(
replaceContent
);
if
(!
ValidationUtil
.
isEmpty
(
mobiles
))
{
alertCalledRo
.
setIds
(
mobiles
);
}
//触发规则
ruleTrigger
.
publish
(
alertCalledRo
,
"西咸机场119接处警规则/alertCalledRule"
,
new
String
[
0
]);
return
true
;
}
}
public
boolean
powerTransferCalledRule
(
Set
<
PowerTransferCompanyDto
>
i
,
Long
alertCalledId
,
String
type
)
throws
Exception
{
public
boolean
powerTransferCalledRule
(
Set
<
PowerTransferCompanyDto
>
i
,
Long
alertCalledId
,
String
type
)
throws
Exception
{
...
...
amos-boot-system-jcs/src/main/resources/db/changelog/jcs-1.0.0.0.xml
View file @
6b2584cf
...
@@ -2163,8 +2163,60 @@
...
@@ -2163,8 +2163,60 @@
</sql>
</sql>
</changeSet>
</changeSet>
<changeSet
author=
"litw"
id=
"2021-11-15-1"
>
<preConditions
onFail=
"MARK_RAN"
>
<tableExists
tableName=
"jc_template"
/>
<primaryKeyExists
primaryKeyName=
"sequence_nbr"
tableName=
"jc_template"
/>
</preConditions>
<comment>
insert data jc_template
</comment>
<sql>
INSERT INTO `jc_template` (sequence_nbr, type_code, `type`, content, format, rec_user_name, rec_user_id, rec_date, is_delete) VALUES(26, 'LLDP', '力量调派统一模板', '【力量调派】调派departmentName content 赶往rescueGrid 位置。responseLevel 联系人: contactUser 联系电话: contactPhone 相关警情:【type】时间:callTime replaceContent', 0, NULL, NULL, NULL, 0);
</sql>
</changeSet>
<changeSet
author=
"litengwei"
id=
"2021-11-17-litengwei-1"
>
<preConditions
onFail=
"MARK_RAN"
>
<tableExists
tableName=
"jc_template"
/>
</preConditions>
<comment>
update data jc_template
</comment>
<sql>
update
`jc_template` jc
set
content = '
<![CDATA[<p>【警情续报】<span contenteditable="true" data-name="editContent" data-type="input"></span><p>相关警情:时间:$callTime 地点: $address 发生$type 警情 $replaceContent 被困人数:<span contenteditable="true" data-name="trappedNum" data-type="input"></span>;伤亡人数:<span contenteditable="true" data-name="casualtiesNum" data-type="input"></span>;<p>发送单位:<span contentEditable data-name="companyName" data-type="input"></span></p> ]]>
'
where jc.type_code = '313'
</sql>
</changeSet>
<changeSet
author=
"litengwei"
id=
"2021-11-17-litengwei-2"
>
<preConditions
onFail=
"MARK_RAN"
>
<tableExists
tableName=
"jc_template"
/>
</preConditions>
<comment>
update data jc_template
</comment>
<sql>
update
jc_template jc
set
content = '
<![CDATA[<p>【非警情确认】根据现场反馈信息、视频监控信息和消防物联监控信息,判断 【时间:$callTime 地点: $address 发生$type 警情 $replaceContent ;被困人数:<span contenteditable="true" data-name="trappedNum" data-type="input"></span>;伤亡人数:<span contenteditable="true" data-name="casualtiesNum" data-type="input"></span>; 】 为非警情,请个单位、部门尽快 进行恢复到日常执勤状态。</p><p>发送单位:<span contenteditable="true" data-name="companyName" data-type="input"></span></p>]]>
'
where
jc.type_code = '314'
</sql>
</changeSet>
<changeSet
author=
"litengwei"
id=
"2021-11-17-litengwei-3"
>
<preConditions
onFail=
"MARK_RAN"
>
<tableExists
tableName=
"jc_template"
/>
</preConditions>
<comment>
update data jc_template
</comment>
<sql>
update
jc_template jc
set
content = '
<![CDATA[<p>【警情结案】当前警情已于<span contenteditable="true" data-name="recDate" data-type="input"></span> 当前警情已经结案。</p>相关警情:时间:$callTime 地点: $address 发生$type 警情 $replaceContent;被困人数:<span contenteditable="true" data-name="trappedNum" data-type="input"></span>;伤亡人数:<span contenteditable="true" data-name="casualtiesNum" data-type="input"></span>;<p>发送单位:<span contentEditable data-name="companyName" data-type="input"></span></p>]]>
'
where
jc.type_code = '315'
</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