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
14af413e
Commit
14af413e
authored
Jul 29, 2021
by
tangwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加力量调派通知
parent
df89c009
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
94 additions
and
61 deletions
+94
-61
EquipFeignClient.java
...join/amos/boot/module/jcs/api/feign/EquipFeignClient.java
+1
-1
CommandController.java
...boot/module/command/biz/controller/CommandController.java
+12
-11
FrontlineLiaisonController.java
...le/command/biz/controller/FrontlineLiaisonController.java
+2
-2
FrontlineLiaisonServiceImpl.java
...command/biz/service/impl/FrontlineLiaisonServiceImpl.java
+3
-2
AlertCalledServiceImpl.java
...t/module/jcs/biz/service/impl/AlertCalledServiceImpl.java
+1
-2
AlertSubmittedServiceImpl.java
...odule/jcs/biz/service/impl/AlertSubmittedServiceImpl.java
+24
-14
PowerTransferServiceImpl.java
...module/jcs/biz/service/impl/PowerTransferServiceImpl.java
+47
-27
application.properties
...boot-system-jcs/src/main/resources/application.properties
+4
-2
No files found.
amos-boot-module/amos-boot-module-api/amos-boot-module-jcs-api/src/main/java/com/yeejoin/amos/boot/module/jcs/api/feign/EquipFeignClient.java
View file @
14af413e
...
...
@@ -118,7 +118,7 @@ public interface EquipFeignClient {
*
* **/
@RequestMapping
(
value
=
"/car/getTeamCarList"
,
method
=
RequestMethod
.
GET
)
ResponseModel
<
List
<
Map
<
String
,
Object
>>>
getTeamCarList
();
ResponseModel
<
List
<
Map
<
String
,
Object
>>>
getTeamCarList
(
@RequestParam
Double
longitude
,
@RequestParam
Double
latitude
);
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-command-biz/src/main/java/com/yeejoin/amos/boot/module/command/biz/controller/CommandController.java
View file @
14af413e
...
...
@@ -678,16 +678,17 @@ public class CommandController extends BaseController {
//平面图。待完成orgUsrzhDto.getBuildId()
List
<
Map
<
String
,
Object
>>
list
=
equipFeignClient
.
findImgByFileCategory
(
orgUsrzhDto
.
getBuildId
(),
"fourImg"
).
getResult
();
List
<
String
>
url
=
new
ArrayList
<>();
if
(
list
!=
null
&&
list
.
size
()>
0
)
{
list
.
stream
().
forEach
(
map
->{
url
.
add
(
map
.
get
(
"filePath"
).
toString
());
});
if
(
orgUsrzhDto
.
getBuildId
()!=
null
)
{
List
<
Map
<
String
,
Object
>>
list
=
equipFeignClient
.
findImgByFileCategory
(
orgUsrzhDto
.
getBuildId
(),
"fourImg"
).
getResult
();
List
<
String
>
url
=
new
ArrayList
<>();
if
(
list
!=
null
&&
list
.
size
()>
0
)
{
list
.
stream
().
forEach
(
map
->{
url
.
add
(
map
.
get
(
"filePath"
).
toString
());
});
}
orgusrDataxDto
.
setPlanePicture
(
url
);
}
orgusrDataxDto
.
setPlanePicture
(
url
);
return
ResponseHelper
.
buildResponse
(
orgusrDataxDto
);
return
ResponseHelper
.
buildResponse
(
orgusrDataxDto
);
}
...
...
@@ -764,9 +765,9 @@ public class CommandController extends BaseController {
@TycloudOperation
(
needAuth
=
false
,
ApiLevel
=
UserType
.
AGENCY
)
@GetMapping
(
value
=
"fireCar/list"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"车辆资源"
,
notes
=
"车辆资源"
)
public
ResponseModel
<
List
<
Map
<
String
,
Object
>>>
getTeamCarList
()
{
public
ResponseModel
<
List
<
Map
<
String
,
Object
>>>
getTeamCarList
(
RequestData
par
)
{
List
<
Map
<
String
,
Object
>>
list
=
equipFeignClient
.
getTeamCarList
().
getResult
();
List
<
Map
<
String
,
Object
>>
list
=
equipFeignClient
.
getTeamCarList
(
par
.
getLongitude
(),
par
.
getLatitude
()
).
getResult
();
return
ResponseHelper
.
buildResponse
(
list
);
}
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-command-biz/src/main/java/com/yeejoin/amos/boot/module/command/biz/controller/FrontlineLiaisonController.java
View file @
14af413e
...
...
@@ -110,7 +110,7 @@ public class FrontlineLiaisonController extends BaseController {
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"前线联络员列表全部数据查询"
,
notes
=
"前线联络员列表全部数据查询"
)
@GetMapping
(
value
=
"/list"
)
public
ResponseModel
<
List
<
FrontlineLiaisonDto
>>
selectForList
()
{
return
ResponseHelper
.
buildResponse
(
frontlineLiaisonServiceImpl
.
queryForFrontlineLiaisonList
());
public
ResponseModel
<
List
<
FrontlineLiaisonDto
>>
selectForList
(
@RequestParam
(
value
=
"alertCalledId"
)
Long
alertCalledId
)
{
return
ResponseHelper
.
buildResponse
(
frontlineLiaisonServiceImpl
.
queryForFrontlineLiaisonList
(
alertCalledId
));
}
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-command-biz/src/main/java/com/yeejoin/amos/boot/module/command/biz/service/impl/FrontlineLiaisonServiceImpl.java
View file @
14af413e
...
...
@@ -32,7 +32,7 @@ public class FrontlineLiaisonServiceImpl extends BaseService<FrontlineLiaisonDto
/**
* 列表查询 示例
*/
public
List
<
FrontlineLiaisonDto
>
queryForFrontlineLiaisonList
()
{
return
this
.
queryForList
(
""
,
false
);
public
List
<
FrontlineLiaisonDto
>
queryForFrontlineLiaisonList
(
@Condition
(
Operator
.
eq
)
Long
alertCalledId
)
{
return
this
.
queryForList
(
""
,
false
,
alertCalledId
);
}
}
\ No newline at end of file
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 @
14af413e
...
...
@@ -144,8 +144,7 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto,AlertCall
String
[]
data
=
alertCalled
.
getAddress
().
split
(
"@address@"
);
alertCalled
.
setAddress
(
data
[
0
]);
if
(
data
[
1
]!=
null
&&!
""
.
equals
(
data
[
1
])){
JSONObject
jSONObject
=
JSON
.
parseObject
(
data
[
1
]);
JSONObject
jSONObject
=
JSON
.
parseObject
(
data
[
1
]);
if
(
jSONObject
.
getString
(
"longitude"
)!=
null
&&!
""
.
equals
(
jSONObject
.
getString
(
"longitude"
)))
{
alertCalled
.
setCoordinateX
(
Double
.
valueOf
(
jSONObject
.
getString
(
"longitude"
)));
}
...
...
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 @
14af413e
...
...
@@ -8,6 +8,7 @@ import com.yeejoin.amos.boot.module.jcs.api.dto.*;
import
com.yeejoin.amos.boot.module.jcs.api.mapper.PowerTransferCompanyMapper
;
import
io.swagger.annotations.ApiModelProperty
;
import
org.apache.commons.lang3.ObjectUtils
;
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
;
...
...
@@ -83,6 +84,9 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
@Value
(
"${mqtt.topic.alert.reporting}"
)
private
String
topic
;
@Value
(
"${mqtt.topic.command.power.deployment}"
)
private
String
powertopic
;
@Autowired
EquipFeignClient
equipFeignClient
;
...
...
@@ -136,20 +140,26 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
@Override
public
Boolean
save
(
AlertSubmittedDto
alertSubmittedDto
,
String
userName
)
throws
Exception
{
Long
alertSubmittedId
=
saveAlertSubmitted
(
alertSubmittedDto
,
userName
);
// 组装规则入参
AlertCalled
alertCalled
=
alertCalledService
.
getById
(
alertSubmittedDto
.
getAlertCalledId
());
AlertCalledObjsDto
alertCalledVo
=
new
AlertCalledObjsDto
();
alertCalledVo
.
setAlertCalled
(
alertCalled
);
List
<
AlertFormValue
>
alertFormValue
=
new
ArrayList
<>();
AlertFormValue
formValue
=
new
AlertFormValue
();
formValue
.
setFieldCode
(
"alertSubmittedId"
);
formValue
.
setFieldValue
(
alertSubmittedId
.
toString
());
alertFormValue
.
add
(
formValue
);
alertCalledVo
.
setAlertFormValue
(
alertFormValue
);
// 调用规则
ruleAlertCalledService
.
fireAlertCalledRule
(
alertCalledVo
);
try
{
Long
alertSubmittedId
=
saveAlertSubmitted
(
alertSubmittedDto
,
userName
);
// 组装规则入参
AlertCalled
alertCalled
=
alertCalledService
.
getById
(
alertSubmittedDto
.
getAlertCalledId
());
AlertCalledObjsDto
alertCalledVo
=
new
AlertCalledObjsDto
();
alertCalledVo
.
setAlertCalled
(
alertCalled
);
List
<
AlertFormValue
>
alertFormValue
=
new
ArrayList
<>();
AlertFormValue
formValue
=
new
AlertFormValue
();
formValue
.
setFieldCode
(
"alertSubmittedId"
);
formValue
.
setFieldValue
(
alertSubmittedId
.
toString
());
alertFormValue
.
add
(
formValue
);
alertCalledVo
.
setAlertFormValue
(
alertFormValue
);
// 调用规则
ruleAlertCalledService
.
fireAlertCalledRule
(
alertCalledVo
);
//通知实战指挥页面发送mqtt 默认发送 String 类型 0, 新警情 1 警情状态变化
emqKeeper
.
getMqttClient
().
publish
(
powertopic
,
"0"
.
getBytes
(),
RuleConfig
.
DEFAULT_QOS
,
true
);
}
catch
(
MqttException
e
)
{
throw
new
RuntimeException
();
}
return
true
;
}
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-jcs-biz/src/main/java/com/yeejoin/amos/boot/module/jcs/biz/service/impl/PowerTransferServiceImpl.java
View file @
14af413e
...
...
@@ -8,13 +8,17 @@ import java.util.stream.Collectors;
import
com.yeejoin.amos.boot.module.jcs.api.dto.*
;
import
com.yeejoin.amos.boot.module.jcs.api.enums.DutyInfoEnum
;
import
com.yeejoin.amos.component.rule.config.RuleConfig
;
import
org.apache.commons.lang3.ObjectUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.eclipse.paho.client.mqttv3.MqttException
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.util.CollectionUtils
;
import
org.typroject.tyboot.component.emq.EmqKeeper
;
import
org.typroject.tyboot.core.foundation.utils.Bean
;
import
org.typroject.tyboot.core.foundation.utils.ValidationUtil
;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
...
...
@@ -68,6 +72,13 @@ public class PowerTransferServiceImpl extends BaseService<PowerTransferDto, Powe
@Autowired
PowerTransferMapper
powerTransferMapper
;
@Autowired
private
EmqKeeper
emqKeeper
;
@Value
(
"${mqtt.topic.command.power.deployment}"
)
private
String
topic
;
@Override
public
PowerTransferSimpleDto
getPowerTransferList
(
Long
alertCalledId
)
{
List
<
PowerTransferCompanyResourcesDto
>
powerTransferList
=
...
...
@@ -82,33 +93,42 @@ public class PowerTransferServiceImpl extends BaseService<PowerTransferDto, Powe
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
boolean
createPowerTransfer
(
PowerTransferDto
powerTransferDto
)
{
// 获取调派ID
Long
alertCalledId
=
powerTransferDto
.
getAlertCalledId
();
int
count
=
count
(
new
QueryWrapper
<
PowerTransfer
>().
eq
(
"alert_called_id"
,
alertCalledId
));
String
dispatch_num
=
alertCalledId
.
toString
()
+
(
count
+
1
);
// 获取警情详情
AlertCalled
alertCalled
=
alertCalledService
.
getById
(
alertCalledId
);
// 创建力量调派
PowerTransfer
powerTransfer
=
new
PowerTransfer
();
BeanUtils
.
copyProperties
(
powerTransferDto
,
powerTransfer
);
BeanUtils
.
copyProperties
(
alertCalled
,
powerTransfer
);
powerTransfer
.
setDispatchNum
(
dispatch_num
);
powerTransfer
.
setSequenceNbr
(
null
);
save
(
powerTransfer
);
Long
powerTransferSequenceNbr
=
powerTransfer
.
getSequenceNbr
();
// 获取任务派发模板
Template
template
=
templateService
.
getOne
(
new
QueryWrapper
<
Template
>().
eq
(
"type"
,
alertCalled
.
getAlertType
()).
eq
(
"format"
,
false
));
String
content
=
template
.
getContent
();
Map
<
String
,
String
>
definitions
=
new
HashMap
<>();
initDefinitions
(
definitions
,
alertCalled
,
powerTransferDto
);
// 创建力量调派单位
createPowerTransferCompany
(
powerTransferDto
,
powerTransferSequenceNbr
,
definitions
,
content
);
try
{
// 获取调派ID
Long
alertCalledId
=
powerTransferDto
.
getAlertCalledId
();
int
count
=
count
(
new
QueryWrapper
<
PowerTransfer
>().
eq
(
"alert_called_id"
,
alertCalledId
));
String
dispatch_num
=
alertCalledId
.
toString
()
+
(
count
+
1
);
// 获取警情详情
AlertCalled
alertCalled
=
alertCalledService
.
getById
(
alertCalledId
);
// 创建力量调派
PowerTransfer
powerTransfer
=
new
PowerTransfer
();
BeanUtils
.
copyProperties
(
powerTransferDto
,
powerTransfer
);
BeanUtils
.
copyProperties
(
alertCalled
,
powerTransfer
);
powerTransfer
.
setDispatchNum
(
dispatch_num
);
powerTransfer
.
setSequenceNbr
(
null
);
save
(
powerTransfer
);
Long
powerTransferSequenceNbr
=
powerTransfer
.
getSequenceNbr
();
// 获取任务派发模板
Template
template
=
templateService
.
getOne
(
new
QueryWrapper
<
Template
>().
eq
(
"type"
,
alertCalled
.
getAlertType
()).
eq
(
"format"
,
false
));
String
content
=
template
.
getContent
();
Map
<
String
,
String
>
definitions
=
new
HashMap
<>();
initDefinitions
(
definitions
,
alertCalled
,
powerTransferDto
);
// 创建力量调派单位
createPowerTransferCompany
(
powerTransferDto
,
powerTransferSequenceNbr
,
definitions
,
content
);
//发送调派通知
//通知实战指挥页面发送mqtt 默认发送 String 类型 0, 新警情 1 警情状态变化
emqKeeper
.
getMqttClient
().
publish
(
topic
,
"0"
.
getBytes
(),
RuleConfig
.
DEFAULT_QOS
,
true
);
}
catch
(
MqttException
e
)
{
throw
new
RuntimeException
();
}
return
true
;
}
...
...
amos-boot-system-jcs/src/main/resources/application.properties
View file @
14af413e
...
...
@@ -50,12 +50,14 @@ spring.redis.expire.time=300
## mqtt-警情初报消息主题
mqtt.topic.alert.reporting
=
alertReporting
## 实战指挥新警情
通
报主题
## 实战指挥新警情
?
报主题
mqtt.topic.command.alert.notice
=
alertNotice
## 跑马灯地震,天气预警信息
mqtt.topic.command.seismometeorology.notice
=
seismometeorology
security.systemctl.name
=
AMOS-API-SYSTEMCTL
mqtt.topic.command.power.deployment
=
power
security.systemctl.name
=
AMOS-API-SYSTEMCTL
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