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
82c47d75
Commit
82c47d75
authored
Nov 17, 2021
by
kongfm
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/developer' into developer
parents
a0c72061
b5bdce97
Show whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
275 additions
and
143 deletions
+275
-143
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
+2
-12
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
+137
-98
RuleAlertCalledService.java
...t/module/jcs/biz/service/impl/RuleAlertCalledService.java
+21
-14
jcs-1.0.0.0.xml
...ystem-jcs/src/main/resources/db/changelog/jcs-1.0.0.0.xml
+52
-0
pom.xml
pom.xml
+1
-1
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 @
82c47d75
...
...
@@ -134,7 +134,7 @@ public interface DutyPersonShiftMapper extends BaseMapper<DutyPersonShift> {
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
);
}
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 @
82c47d75
...
...
@@ -92,7 +92,7 @@ public interface OrgUsrMapper extends BaseMapper<OrgUsr> {
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
);
...
...
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 @
82c47d75
...
...
@@ -34,7 +34,7 @@ public interface IDutyPersonService extends IDutyCommonService {
*/
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
);
}
amos-boot-module/amos-boot-module-api/amos-boot-module-common-api/src/main/resources/mapper/DutyPersonShiftMapper.xml
View file @
82c47d75
...
...
@@ -358,8 +358,11 @@ AND cft.type_code = (
where i.field_code = 'userId' and i.field_value is not null) c
on cb.instance_id = c.id3
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
biz_org_name = '综合办公室' or biz_org_name = '消防支队' or biz_org_name = '应急指挥科' )) r )
a.deptId in ( select sequence_nbr from cb_org_usr cou where biz_org_name in
<foreach
item=
"item"
index=
"index"
collection=
"bizNames"
open=
"("
separator=
","
close=
")"
>
#{item}
</foreach>
)) r )
</select>
...
...
amos-boot-module/amos-boot-module-api/amos-boot-module-common-api/src/main/resources/mapper/OrgUsrMapper.xml
View file @
82c47d75
...
...
@@ -691,13 +691,17 @@ LEFT JOIN (
select cou.biz_org_name bizOrgName,cou.sequence_nbr sequenceNbr ,cou .parent_id parentId,
a.fireManagementPostCode, b.telephone from cb_org_usr cou
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
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'
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})
and (d.fireManagementPostCode = '消防安全管理人' or d.fireManagementPostCode = '消防安全责任人')
and (d.fireManagementPostCode in
<foreach
item=
"item"
index=
"index"
collection=
"codes"
open=
"("
separator=
","
close=
")"
>
#{item}
</foreach>
)
</select>
<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 @
82c47d75
...
...
@@ -26,7 +26,7 @@ public class AlertCalledRo implements Serializable{
*
* </pre>
*/
private
static
final
long
serialVersionUID
=
529623529216238088
L
;
private
static
final
long
serialVersionUID
=
-
8755622977733065123
L
;
/**
* 通用属性
...
...
@@ -73,9 +73,12 @@ public class AlertCalledRo implements Serializable{
@Label
(
value
=
"警情报送类型(0,警情报送,1,警情续报,2,非警情确认,3,警情结案)"
)
private
String
alertWay
;
@Label
(
value
=
"警情续报,非警情确认,警情结案,选择人员
ids
"
)
@Label
(
value
=
"警情续报,非警情确认,警情结案,选择人员
电话号码
"
)
private
String
ids
;
@Label
(
value
=
"警情续报,非警情确认,警情结案,选择人员AmousIds"
)
private
String
usIds
;
@Label
(
value
=
"警情续报自定义内容"
)
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 @
82c47d75
...
...
@@ -30,6 +30,9 @@ public class AlertSubmittedSMSDto {
@ApiModelProperty
(
value
=
"联系电话"
)
private
String
userPhone
;
@ApiModelProperty
(
value
=
"警情Id"
)
private
String
alertCallId
;
@ApiModelProperty
(
value
=
"协调单位"
)
private
String
companyName
;
...
...
amos-boot-module/amos-boot-module-api/amos-boot-module-jcs-api/src/main/resources/mapper/AlertSubmittedMapper.xml
View file @
82c47d75
...
...
@@ -15,12 +15,12 @@
jas.submission_method,
jas.submission_method_code,
jas.update_time,
jaso.sequence_nbr,
jaso.sequence_nbr
sequenceNbr
,
jaso.company_name,
jaso.user_name,
jaso.user_phone
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
<if
test=
"alertSubmittedDto.alertCalledId != null and alertSubmittedDto.alertCalledId != ''"
>
and jas.alert_called_id = #{alertSubmittedDto.alertCalledId}
...
...
@@ -68,6 +68,7 @@
<select
id=
"getSchedulingContent"
resultType=
"com.yeejoin.amos.boot.module.jcs.api.dto.AlertSubmittedSMSDto"
>
SELECT
s.sequence_nbr,
s.alert_called_id alertCallId,
s.submission_time,
o.user_phone,
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 @
82c47d75
...
...
@@ -287,25 +287,15 @@ public Object BuildScheduleDetails(String dutyDay, Long shiftId, String postType
map20
.
put
(
ssString
,
ssString
);
}
System
.
out
.
println
(
"ssssssssss"
);
});
}
@Override
public
List
<
Map
<
String
,
Object
>>
queryByCompanyId
(){
return
dutyPersonShiftMapper
.
queryByCompanyId
();
public
List
<
Map
<
String
,
Object
>>
queryByCompanyId
(
List
<
String
>
bizNames
){
return
dutyPersonShiftMapper
.
queryByCompanyId
(
bizNames
);
}
@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 @
82c47d75
...
...
@@ -1861,9 +1861,9 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
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
)
{
...
...
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 @
82c47d75
...
...
@@ -7,17 +7,22 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.boot.biz.common.controller.BaseController
;
import
com.yeejoin.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.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.AlertSubmittedSMSDto
;
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.entity.AlertCalled
;
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.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.AlertSubmittedServiceImpl
;
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
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
...
...
@@ -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.ResponseModel
;
import
java.text.ParseException
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.HashMap
;
import
java.util.Map
;
/**
...
...
@@ -203,6 +211,8 @@ public class AlertSubmittedController extends BaseController {
alertSubmittedService
.
getAlertSubmittedContent
(
alertCalledId
,
templateVos
,
companyName
);
}
catch
(
IllegalAccessException
e
)
{
throw
new
RuntimeException
(
"系统异常"
);
}
catch
(
ParseException
e
)
{
e
.
printStackTrace
();
}
return
ResponseHelper
.
buildResponse
(
templateVos
);
}
...
...
@@ -216,10 +226,26 @@ public class AlertSubmittedController extends BaseController {
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@RequestMapping
(
value
=
"/{id}/scheduling_content"
,
method
=
RequestMethod
.
GET
)
@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日
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
()))
{
try
{
JSON
.
parseObject
(
schedulingContent
.
getSubmissionContent
());
...
...
@@ -230,5 +256,12 @@ public class AlertSubmittedController extends BaseController {
}
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 @
82c47d75
...
...
@@ -369,7 +369,7 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal
alertCalledObjsDto
.
setAlertFormValue
(
alertFormValuelist
);
// 警情报送
// 调用规则 警情初报
ruleAlertCalledService
.
fireAlertCalledRule
(
alertCalledObjsDto
,
AlertBusinessTypeEnum
.
警情初报
.
getCode
(),
null
);
ruleAlertCalledService
.
fireAlertCalledRule
(
alertCalledObjsDto
,
AlertBusinessTypeEnum
.
警情初报
.
getCode
(),
null
,
null
,
null
);
// 通知实战指挥页面发送mqtt 默认发送 String 类型 0, 新警情 1 警情状态变化
emqKeeper
.
getMqttClient
().
publish
(
topic
,
"0"
.
getBytes
(),
RuleConfig
.
DEFAULT_QOS
,
true
);
/**
...
...
@@ -377,9 +377,6 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal
*/
eSAlertCalledService
.
saveAlertCalledToES
(
alertCalled
);
}
return
alertCalledObjsDto
;
}
catch
(
Exception
e
)
{
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 @
82c47d75
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jcs
.
biz
.
service
.
impl
;
import
java.lang.reflect.Field
;
import
java.text.ParseException
;
import
java.util.ArrayList
;
import
java.util.Collections
;
import
java.util.Comparator
;
...
...
@@ -13,6 +14,8 @@ import java.util.Optional;
import
java.util.Set
;
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.eclipse.paho.client.mqttv3.MqttException
;
import
org.springframework.beans.BeanUtils
;
...
...
@@ -21,11 +24,9 @@ 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.StringUtil
;
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.JSONException
;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
...
...
@@ -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.TemplateExtendDto
;
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.AlertSubmittedObject
;
import
com.yeejoin.amos.boot.module.jcs.api.entity.Template
;
...
...
@@ -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.biz.rule.action.AlertCalledAction
;
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.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.Collections
;
import
java.util.Comparator
;
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.Optional
;
import
java.util.Set
;
import
java.util.stream.Collectors
;
/**
* 警情报送记录 服务实现类
...
...
@@ -186,11 +168,29 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
alertSubmittedExtDto
.
setExtraInfo
(
String
.
format
(
_extraInfo
,
alertSubmittedExtDto
.
getCompanyName
(),
alertSubmittedExtDto
.
getUserName
()));
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
.
setSubmissionContent
(
richC
ontent
);
alertSubmittedExtDto
.
setSubmissionContent
(
c
ontent
);
}
catch
(
JSONException
e
)
{
alertSubmittedExtDto
.
setSubmissionContentValue
(
alertSubmittedExtDto
.
getSubmitContent
());
}
catch
(
ParseException
e
)
{
e
.
printStackTrace
();
}
});
schedulingReportingDto
.
setSchedulingReportingList
(
alertSubmittedExtDtoList
);
...
...
@@ -211,7 +211,7 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
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 警情状态变化
emqKeeper
.
getMqttClient
().
publish
(
powertopic
,
"0"
.
getBytes
(),
RuleConfig
.
DEFAULT_QOS
,
true
);
}
catch
(
MqttException
e
)
{
...
...
@@ -256,7 +256,10 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
if
(
alertTypeCode
.
equals
(
AlertStageEnums
.
YBHZ
.
getCode
())
||
alertTypeCode
.
equals
(
AlertStageEnums
.
HKJY
.
getCode
()))
{
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
);
}
if
(
e
.
containsKey
(
"fireBrigade"
))
{
...
...
@@ -271,16 +274,20 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
});
}
if
(
e
.
containsKey
(
"airportUnit"
))
{
// 根据人员职务:干部&领导 机场单位 模块 消防急救保障部中,“人员职务”不为空的人员
List
<
Map
<
String
,
Object
>>
mapList
=
iOrgUsrService
.
queryCompanyIdNew
(
"消防救援保障部"
);
if
(
e
.
containsKey
(
"name"
))
{
// 消防救援保障部
List
<
Map
<
String
,
Object
>>
mapList
=
iOrgUsrService
.
queryCompanyIdNew
(
e
.
get
(
"name"
).
toString
());
orgUsers
.
addAll
(
mapList
);
}
// 安运部
if
(
e
.
get
(
"type"
).
toString
().
equals
(
"AY"
))
{
if
(
e
.
containsKey
(
"airportPost"
))
{
List
<
Map
<
String
,
Object
>>
mapList
=
iOrgUsrService
.
queryCompanyId
(
"安运部"
);
if
(
e
.
containsKey
(
"name"
))
{
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
);
}
}
...
...
@@ -288,7 +295,9 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
// 事发单位
if
(
e
.
get
(
"type"
).
toString
().
equals
(
"SF"
))
{
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
);
}
}
...
...
@@ -298,20 +307,19 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
if
(
alertTypeCode
.
equals
(
AlertStageEnums
.
HKJY
.
getCode
())
||
alertTypeCode
.
equals
(
AlertStageEnums
.
LYXC
.
getCode
())
||
alertTypeCode
.
equals
(
AlertStageEnums
.
ZJBZ
.
getCode
())
||
alertTypeCode
.
equals
(
AlertStageEnums
.
QTJQ
.
getCode
()))
{
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
);
}
}
// 120急救
if
(
alertTypeCode
.
equals
(
AlertStageEnums
.
JJJQ
.
getCode
()))
{
if
(
e
.
containsKey
(
"onDuty"
))
{
List
<
Map
<
String
,
Object
>>
mapList
=
iDutyPersonService
.
queryByCompanyNew
(
"急救科"
);
orgUsers
.
addAll
(
mapList
);
}
if
(
e
.
containsKey
(
"airportUnit"
))
{
List
<
Map
<
String
,
Object
>>
mapList
=
iOrgUsrService
.
queryCompanyId
(
"急救科"
);
if
(
e
.
containsKey
(
"name"
))
{
List
<
Map
<
String
,
Object
>>
mapList
=
iDutyPersonService
.
queryByCompanyNew
(
e
.
get
(
"name"
).
toString
());
orgUsers
.
addAll
(
mapList
);
List
<
Map
<
String
,
Object
>>
mapList1
=
iOrgUsrService
.
queryCompanyIdNew
(
e
.
get
(
"name"
).
toString
());
orgUsers
.
addAll
(
mapList1
);
}
}
});
...
...
@@ -325,16 +333,6 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
// 警情初报 --- 续报 结案
if
(
alertWay
.
equals
(
AlertBusinessTypeEnum
.
警情初报
.
getCode
()))
{
alertSubmitted
.
setBusinessType
(
AlertBusinessTypeEnum
.
警情初报
.
getName
());
}
else
if
(
alertWay
.
equals
(
AlertBusinessTypeEnum
.
警情续报
.
getCode
()))
{
alertSubmitted
.
setBusinessType
(
AlertBusinessTypeEnum
.
警情续报
.
getName
());
sCode
=
"SMS_JCS_XB"
;
}
else
if
(
alertWay
.
equals
(
AlertBusinessTypeEnum
.
警情结案
.
getCode
()))
{
alertSubmitted
.
setBusinessType
(
AlertBusinessTypeEnum
.
警情结案
.
getName
());
sCode
=
"SMS_JCS_JA"
;
}
else
{
alertSubmitted
.
setBusinessType
(
AlertBusinessTypeEnum
.
非警情确认
.
getName
());
sCode
=
"SMS_JCS_QR"
;
}
Optional
<
SubmissionMethodEnum
>
submissionMethodEnum
=
Optional
.
of
(
SubmissionMethodEnum
.
SMS
);
alertSubmitted
.
setSubmissionMethodCode
(
submissionMethodEnum
.
get
().
getCode
());
...
...
@@ -343,28 +341,51 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
alertSubmitted
.
setSchedulingTypeCode
(
alertSchedulingTypeEnum
.
get
().
getCode
());
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
();
}
else
if
(
alertWay
.
equals
(
AlertBusinessTypeEnum
.
警情续报
.
getCode
()))
{
alertSubmitted
.
setBusinessType
(
AlertBusinessTypeEnum
.
警情续报
.
getName
());
sCode
=
"SMS_JCS_XB"
;
}
else
if
(
alertWay
.
equals
(
AlertBusinessTypeEnum
.
警情结案
.
getCode
()))
{
alertSubmitted
.
setBusinessType
(
AlertBusinessTypeEnum
.
警情结案
.
getName
());
sCode
=
"SMS_JCS_JA"
;
}
else
{
alertSubmitted
.
setBusinessType
(
AlertBusinessTypeEnum
.
非警情确认
.
getName
());
sCode
=
"SMS_JCS_QR"
;
}
AlertSubmitted
alertSubmittedNew
=
null
;
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
)
{
AlertSubmittedObject
alertSubmittedObject
=
new
AlertSubmittedObject
();
if
(!
alertWay
.
equals
(
AlertBusinessTypeEnum
.
警情初报
.
getCode
()))
{
alertSubmittedObject
.
setAlertSubmittedId
(
alertSubmittedNew
.
getSequenceNbr
());
}
else
{
alertSubmittedObject
.
setAlertSubmittedId
(
Long
.
parseLong
(
alertSubmittedId
));
}
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
.
setUserName
((
String
)
orgUser
.
get
(
"bizOrgName"
));
...
...
@@ -374,6 +395,7 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
}
alertSubmittedObjectList
.
add
(
alertSubmittedObject
);
}
// 组装报送内容
smsParams
.
put
(
"callTimeStr"
,
calledRo
.
getCallTimeStr
());
smsParams
.
put
(
"address"
,
calledRo
.
getAddress
());
...
...
@@ -416,20 +438,15 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
String
alertWay
=
""
;
Map
<
String
,
String
>
map
=
new
HashMap
<>();
Set
<
String
>
mobiles
=
new
HashSet
<>();
List
<
Long
>
userIds
=
new
ArrayList
<>();
if
(
alertSubmittedId
==
null
)
{
// 1.保存警情记录主表
AlertSubmitted
alertSubmitted
=
new
AlertSubmitted
();
String
bussTypeCode
;
alertSubmitted
.
setAlertCalledId
(
alertSubmittedDto
.
getAlertCalledId
());
// 任务 4174 日常值班---融合调度----短信模版中的内容用户可以全部删除掉,按照自定义内容重新录入发送内容 by litw 2021年10月27日
if
(
"316"
.
equals
(
alertSubmittedDto
.
getBusinessTypeCode
()))
{
alertSubmitted
.
setBusinessTypeCode
(
AlertBusinessTypeEnum
.
警情续报
.
getCode
());
bussTypeCode
=
AlertBusinessTypeEnum
.
警情续报
.
getCode
();
}
else
{
alertSubmitted
.
setBusinessTypeCode
(
alertSubmittedDto
.
getBusinessTypeCode
());
bussTypeCode
=
alertSubmittedDto
.
getBusinessTypeCode
();
}
Optional
<
AlertBusinessTypeEnum
>
businessTypeEnum
=
EnumsUtils
.
getEnumObject
(
AlertBusinessTypeEnum
.
class
,
e
->
e
.
getCode
().
equals
(
bussTypeCode
));
...
...
@@ -446,13 +463,8 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
alertSubmitted
.
setSchedulingType
(
alertSchedulingTypeEnum
.
get
().
getName
());
// 任务 4174 日常值班---融合调度----短信模版中的内容用户可以全部删除掉,按照自定义内容重新录入发送内容 by litw 2021年10月27日
if
(
"316"
.
equals
(
alertSubmittedDto
.
getBusinessTypeCode
()))
{
JSONObject
jsonObject
=
JSON
.
parseObject
(
alertSubmittedDto
.
getSubmitContent
().
toJSONString
());
alertSubmitted
.
setSubmissionContent
(
jsonObject
.
get
(
"custom"
).
toString
());
}
else
{
alertSubmitted
.
setBusinessTypeCode
(
alertSubmittedDto
.
getBusinessTypeCode
());
alertSubmitted
.
setSubmissionContent
(
alertSubmittedDto
.
getSubmitContent
().
toJSONString
());
}
alertSubmitted
.
setSender
(
userName
);
alertSubmitted
.
setRecUserName
(
userName
);
...
...
@@ -489,6 +501,7 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
alertSubmittedObject
.
setCompanyId
(
company
.
getCompanyId
());
alertSubmittedObject
.
setCompanyName
(
company
.
getCompanyName
());
alertSubmittedObject
.
setUserId
(
person
.
getPersonId
());
userIds
.
add
(
person
.
getPersonId
());
alertSubmittedObject
.
setUserName
(
person
.
getPersonName
());
alertSubmittedObject
.
setUserPhone
(
person
.
getPersonPhone
());
alertSubmittedObject
.
setRecUserName
(
userName
);
...
...
@@ -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
);
// 3.更新警情状态
...
...
@@ -544,18 +575,17 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
}
// 4.发送任务消息
// 4.1组织短信内容
// HashMap<String, String> smsParams = new HashMap<>();
// JSONObject submitContent = alertSubmittedDto.getSubmitContent();
// if(!"316".equals(alertSubmittedDto.getBusinessTypeCode())) {
// smsParams.put("alertType", submitContent.get("alertType").toString());
// smsParams.put("trappedNum", submitContent.get("trappedNum").toString());
// smsParams.put("companyName", submitContent.get("companyName").toString());
// }
// 4.2调用短信发送接口
// alertCalledAction.sendAlertCalleCmd(smsCode, mobiles, smsParams);
// 4.1组织短信内容 废弃
JSONObject
submitContent
=
alertSubmittedDto
.
getSubmitContent
();
String
feedBack
=
submitContent
.
get
(
"editContent"
)
!=
null
?
submitContent
.
get
(
"editContent"
).
toString
():
""
;
// 4.2调用短信发送接口 废弃
// alertCalledAction.sendAlertCalleCmd(smsCode, mobiles, smsParams);\
map
.
put
(
"feedBack"
,
feedBack
);
map
.
put
(
"alertWay"
,
alertWay
);
map
.
put
(
"mobiles"
,
StringUtils
.
join
(
mobiles
,
","
));
return
map
;
...
...
@@ -580,10 +610,20 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
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
);
Map
<
String
,
Object
>
map
=
objectToMap
(
alertCalled
);
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
=
...
...
@@ -592,21 +632,13 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
for
(
DataDictionary
dataDictionary
:
dataDictionaries
)
{
Template
template
=
templateService
.
getOne
(
new
QueryWrapper
<
Template
>().
eq
(
"type_code"
,
dataDictionary
.
getCode
()).
eq
(
"format"
,
true
));
List
<
PowerTransferCompanyDto
>
lastPowerTransferCompany
;
if
(
"警情续报"
.
equals
(
template
.
getType
())
&&
(
lastPowerTransferCompany
=
powerTransferService
.
getLastPowerTransferCompany
(
alertCalledId
)).
size
()
>
0
)
{
map
.
put
(
"businessType"
,
template
.
getType
());
// 获取力量调派内容
StringBuilder
companyNames
=
new
StringBuilder
();
StringBuilder
resourcesInfo
=
new
StringBuilder
();
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
());
}
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
.
getContent
(),
definitions
);
template
.
setContent
(
content
);
TemplateDto
templateDto
=
new
TemplateDto
();
BeanUtils
.
copyProperties
(
template
,
templateDto
);
templateDto
.
setData
(
map
);
...
...
@@ -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
public
AlertSubmittedSMSDto
getSchedulingContent
(
Long
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 @
82c47d75
...
...
@@ -51,7 +51,7 @@ public class RuleAlertCalledService {
* @return
* @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
();
if
(
ValidationUtil
.
isEmpty
(
alertCalled
))
{
throw
new
BadRequest
(
"参数校验失败."
);
...
...
@@ -60,8 +60,27 @@ public class RuleAlertCalledService {
* 构建警情报送规则对象
*/
AlertCalledRo
alertCalledRo
=
new
AlertCalledRo
();
alertCalledRo
.
setFeedback
(
feedBack
);
String
replaceContent
=
init
(
alertCalledRo
,
alertCalledVo
);
// 警情 报送类型
alertCalledRo
.
setAlertWay
(
alertWay
);
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
());
...
...
@@ -168,7 +187,6 @@ public class RuleAlertCalledService {
if
(
alertFormValue
.
getFieldCode
().
equals
(
"ageGroup"
))
{
alertCalledRo
.
setAgeGroup
(
alertFormValue
.
getFieldValue
());
}
}
}
...
...
@@ -214,18 +232,7 @@ public class RuleAlertCalledService {
";年龄段:"
).
concat
(
ValidationUtil
.
isEmpty
(
alertCalledRo
.
getAgeGroup
()
)
?
"无"
:
alertCalledRo
.
getAgeGroup
());
}
// 警情 报送类型
alertCalledRo
.
setAlertWay
(
alertWay
);
alertCalledRo
.
setReplaceContent
(
replaceContent
);
if
(!
ValidationUtil
.
isEmpty
(
mobiles
))
{
alertCalledRo
.
setIds
(
mobiles
);
}
//触发规则
ruleTrigger
.
publish
(
alertCalledRo
,
"西咸机场119接处警规则/alertCalledRule"
,
new
String
[
0
]);
return
true
;
return
replaceContent
;
}
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 @
82c47d75
...
...
@@ -2163,8 +2163,60 @@
</sql>
</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>
pom.xml
View file @
82c47d75
...
...
@@ -210,7 +210,7 @@
<dependency>
<groupId>
com.yeejoin
</groupId>
<artifactId>
amos-feign-systemctl
</artifactId>
<version>
${amos.version}
</version>
<version>
1.6.4-SNAPSHOT
</version>
</dependency>
<dependency>
<groupId>
io.swagger
</groupId>
...
...
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