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
cc3257f9
Commit
cc3257f9
authored
Jun 25, 2021
by
taabe
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
警情报送相关接口修改
parent
d7bb897b
Hide whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
214 additions
and
92 deletions
+214
-92
AlertSubmittedDto.java
...ejoin/amos/boot/module/jcs/api/dto/AlertSubmittedDto.java
+1
-0
FireBrigadeResourceDto.java
.../amos/boot/module/jcs/api/dto/FireBrigadeResourceDto.java
+29
-7
FireTeamDto.java
...com/yeejoin/amos/boot/module/jcs/api/dto/FireTeamDto.java
+1
-1
FireTeamMapper.java
...ejoin/amos/boot/module/jcs/api/mapper/FireTeamMapper.java
+7
-0
IAlertSubmittedService.java
...s/boot/module/jcs/api/service/IAlertSubmittedService.java
+3
-1
IPowerTransferService.java
...os/boot/module/jcs/api/service/IPowerTransferService.java
+2
-1
AlertSubmittedExtVo.java
...join/amos/boot/module/jcs/api/vo/AlertSubmittedExtVo.java
+5
-0
AlertSubmittedMapper.xml
...cs-api/src/main/resources/mapper/AlertSubmittedMapper.xml
+5
-3
FireTeamMapper.xml
...dule-jcs-api/src/main/resources/mapper/FireTeamMapper.xml
+12
-0
AlertCalledController.java
...boot/module/jcs/biz/controller/AlertCalledController.java
+3
-2
AlertSubmittedController.java
...t/module/jcs/biz/controller/AlertSubmittedController.java
+27
-26
AlertSubmittedObjectController.java
...le/jcs/biz/controller/AlertSubmittedObjectController.java
+5
-5
PowerTransferController.java
...ot/module/jcs/biz/controller/PowerTransferController.java
+1
-2
AlertSubmittedServiceImpl.java
...odule/jcs/biz/service/impl/AlertSubmittedServiceImpl.java
+64
-16
FireTeamServiceImpl.java
...boot/module/jcs/biz/service/impl/FireTeamServiceImpl.java
+10
-0
PowerTransferServiceImpl.java
...module/jcs/biz/service/impl/PowerTransferServiceImpl.java
+39
-28
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/dto/AlertSubmittedDto.java
View file @
cc3257f9
...
...
@@ -53,6 +53,7 @@ public class AlertSubmittedDto extends BaseDto{
/**
* 报送内容
*/
@ApiModelProperty
(
value
=
"报送内容"
)
private
JSONObject
submitContent
;
/**
...
...
amos-boot-module/amos-boot-module-api/amos-boot-module-jcs-api/src/main/java/com/yeejoin/amos/boot/module/jcs/api/dto/Fire
Car
Dto.java
→
amos-boot-module/amos-boot-module-api/amos-boot-module-jcs-api/src/main/java/com/yeejoin/amos/boot/module/jcs/api/dto/Fire
BrigadeResource
Dto.java
View file @
cc3257f9
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jcs
.
api
.
dto
;
import
com.google.common.collect.Lists
;
import
com.yeejoin.amos.boot.biz.common.dto.BaseDto
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.util.List
;
/**
* 消防
车
dto
* 消防
队伍下资源
dto
*
* @author
tb
* @author
DELL
*/
@Data
@ApiModel
(
value
=
"FireCarDto"
,
description
=
"消防车dto"
)
public
class
FireCarDto
extends
BaseDto
{
public
class
FireBrigadeResourceDto
extends
BaseDto
{
private
static
final
long
serialVersionUID
=
1L
;
@ApiModelProperty
(
value
=
"
车辆
id"
)
@ApiModelProperty
(
value
=
"
资源
id"
)
private
String
id
;
@ApiModelProperty
(
value
=
"
车辆
名称"
)
@ApiModelProperty
(
value
=
"
资源
名称"
)
private
String
name
;
@ApiModelProperty
(
value
=
"资源图片"
)
private
String
img
;
@ApiModelProperty
(
value
=
"资源类型"
)
private
String
type
;
@ApiModelProperty
(
value
=
"所属队伍id"
)
private
String
teamId
;
...
...
@@ -36,4 +43,19 @@ public class FireCarDto extends BaseDto {
@ApiModelProperty
(
value
=
"车辆状态描述"
)
private
String
carStateDesc
;
@ApiModelProperty
(
value
=
"队伍下人员数量"
)
private
int
personCount
;
@ApiModelProperty
(
value
=
"车辆类型"
)
private
String
chassisBrand
;
@ApiModelProperty
(
value
=
"执勤车辆个数"
)
private
Integer
onDutyCount
;
@ApiModelProperty
(
value
=
"出动车辆个数"
)
private
Integer
outCount
;
@ApiModelProperty
(
value
=
"子资源节点"
)
private
List
<
FireBrigadeResourceDto
>
children
=
Lists
.
newArrayList
();
}
amos-boot-module/amos-boot-module-api/amos-boot-module-jcs-api/src/main/java/com/yeejoin/amos/boot/module/jcs/api/dto/FireTeamDto.java
View file @
cc3257f9
...
...
@@ -71,5 +71,5 @@ public class FireTeamDto extends BaseDto {
private
String
outCount
;
@ApiModelProperty
(
value
=
"队伍下车辆"
)
private
List
<
Fire
Car
Dto
>
children
;
private
List
<
Fire
BrigadeResource
Dto
>
children
;
}
amos-boot-module/amos-boot-module-api/amos-boot-module-jcs-api/src/main/java/com/yeejoin/amos/boot/module/jcs/api/mapper/FireTeamMapper.java
View file @
cc3257f9
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jcs
.
api
.
mapper
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.yeejoin.amos.boot.module.jcs.api.dto.FireBrigadeResourceDto
;
import
com.yeejoin.amos.boot.module.jcs.api.entity.FireTeam
;
import
com.yeejoin.amos.boot.module.jcs.api.vo.FireTeamListVo
;
import
com.yeejoin.amos.boot.module.jcs.api.vo.FireTeamVo
;
...
...
@@ -34,4 +35,10 @@ public interface FireTeamMapper extends BaseMapper<FireTeam> {
+
"</script>"
)
Map
<
String
,
Long
>
getFireTeamCount
(
int
pageNum
,
int
pageSize
,
FireTeamListVo
par
);
/**
* 返回监控大队信息列表
*
* @return
*/
List
<
FireBrigadeResourceDto
>
listMonitorFireBrigade
();
}
amos-boot-module/amos-boot-module-api/amos-boot-module-jcs-api/src/main/java/com/yeejoin/amos/boot/module/jcs/api/service/IAlertSubmittedService.java
View file @
cc3257f9
...
...
@@ -5,6 +5,7 @@ import com.yeejoin.amos.boot.module.jcs.api.dto.AlertSubmittedDto;
import
com.yeejoin.amos.boot.module.jcs.api.entity.AlertSubmitted
;
import
com.yeejoin.amos.boot.module.jcs.api.vo.AlertSubmittedSMSVo
;
import
com.yeejoin.amos.boot.module.jcs.api.vo.SchedulingReportingVo
;
import
com.yeejoin.amos.feign.privilege.model.AgencyUserModel
;
/**
* 警情报送记录 服务类
...
...
@@ -34,9 +35,10 @@ public interface IAlertSubmittedService extends IService<AlertSubmitted> {
* 警情报送保存
*
* @param alertSubmittedDto
* @param userInfo
* @return
*/
Boolean
save
(
AlertSubmittedDto
alertSubmittedDto
);
Boolean
save
(
AlertSubmittedDto
alertSubmittedDto
,
AgencyUserModel
userInfo
);
AlertSubmittedSMSVo
getSchedulingContent
(
Long
id
);
}
amos-boot-module/amos-boot-module-api/amos-boot-module-jcs-api/src/main/java/com/yeejoin/amos/boot/module/jcs/api/service/IPowerTransferService.java
View file @
cc3257f9
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jcs
.
api
.
service
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.yeejoin.amos.boot.module.jcs.api.dto.FireBrigadeResourceDto
;
import
com.yeejoin.amos.boot.module.jcs.api.dto.PowerTransferDto
;
import
com.yeejoin.amos.boot.module.jcs.api.entity.PowerTransfer
;
import
com.yeejoin.amos.boot.module.jcs.api.vo.PowerTransferCompanyVo
;
...
...
@@ -25,5 +26,5 @@ public interface IPowerTransferService extends IService<PowerTransfer> {
/**
* 获取力量调派资源树
*/
void
getPowerTree
();
List
<
FireBrigadeResourceDto
>
getPowerTree
();
}
amos-boot-module/amos-boot-module-api/amos-boot-module-jcs-api/src/main/java/com/yeejoin/amos/boot/module/jcs/api/vo/AlertSubmittedExtVo.java
View file @
cc3257f9
...
...
@@ -38,4 +38,9 @@ public class AlertSubmittedExtVo extends AlertSubmittedVo {
*/
private
String
communicationTime
;
/**
* 报送对象
*/
private
String
extraInfo
;
}
amos-boot-module/amos-boot-module-api/amos-boot-module-jcs-api/src/main/resources/mapper/AlertSubmittedMapper.xml
View file @
cc3257f9
...
...
@@ -31,6 +31,7 @@
<if
test=
"alertSubmittedDto.businessTypeCode != null and alertSubmittedDto.businessTypeCode != ''"
>
and jas.business_type_code = #{alertSubmittedDto.businessTypeCode}
</if>
order by jas.update_time desc
</select>
<select
id=
"listReportingByParam"
resultType=
"com.yeejoin.amos.boot.module.jcs.api.vo.AlertSubmittedExtVo"
>
select
...
...
@@ -46,8 +47,8 @@
jas.submission_method_code,
jas.update_time,
jaso.sequence_nbr,
group_concat(distinct jaso.company_name) companyName,
group_concat(distinct jaso.user_name) userName
group_concat(distinct jaso.company_name
Separator '、'
) companyName,
group_concat(distinct jaso.user_name
Separator '、'
) userName
from jc_alert_submitted jas
left join jc_alert_submitted_object jaso on jas.sequence_nbr = jaso.alert_submitted_id
where 1=1
...
...
@@ -60,7 +61,8 @@
<if
test=
"alertSubmittedDto.businessTypeCode != null and alertSubmittedDto.businessTypeCode != ''"
>
and jas.business_type_code = #{alertSubmittedDto.businessTypeCode}
</if>
group by jaso.alert_submitted_id
group by jas.sequence_nbr, jas.update_time
order by jas.update_time desc
</select>
<select
id=
"getSchedulingContent"
resultType=
"com.yeejoin.amos.boot.module.jcs.api.vo.AlertSubmittedSMSVo"
>
...
...
amos-boot-module/amos-boot-module-api/amos-boot-module-jcs-api/src/main/resources/mapper/FireTeamMapper.xml
View file @
cc3257f9
...
...
@@ -2,4 +2,16 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.yeejoin.amos.boot.module.jcs.api.mapper.FireTeamMapper"
>
<select
id=
"listMonitorFireBrigade"
resultType=
"com.yeejoin.amos.boot.module.jcs.api.dto.FireBrigadeResourceDto"
>
SELECT
ft.sequence_nbr id,
ft.NAME,
ft.img,
COUNT( DISTINCT ff.sequence_nbr ) personCount
FROM
cb_fire_team ft
LEFT JOIN cb_firefighters ff ON ff.fire_team_id = ft.sequence_nbr
GROUP BY
ff.fire_team_id
</select>
</mapper>
amos-boot-module/amos-boot-module-biz/amos-boot-module-jcs-biz/src/main/java/com/yeejoin/amos/boot/module/jcs/biz/controller/AlertCalledController.java
View file @
cc3257f9
...
...
@@ -9,6 +9,7 @@ import java.util.stream.Stream;
import
javax.servlet.http.HttpServletRequest
;
import
com.yeejoin.amos.boot.module.jcs.biz.service.impl.ESAlertCalledService
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
...
...
@@ -259,7 +260,7 @@ public class AlertCalledController extends BaseController {
try
{
field
.
setAccessible
(
true
);
Object
o
=
field
.
get
(
alertCalled
);
if
(
o
!=
null
)
{
if
(
o
!=
null
&&
!
"serialVersionUID"
.
equals
(
field
.
getName
())
)
{
Class
<?>
type
=
field
.
getType
();
String
name
=
NameUtils
.
camel2Underline
(
field
.
getName
());
if
(
type
.
equals
(
Integer
.
class
))
{
...
...
@@ -271,7 +272,7 @@ public class AlertCalledController extends BaseController {
}
else
if
(
type
.
equals
(
Boolean
.
class
))
{
Boolean
fileValue
=
(
Boolean
)
field
.
get
(
alertCalled
);
queryWrapper
.
eq
(
name
,
fileValue
);
}
else
if
(
type
.
equals
(
Long
.
class
))
{
}
else
if
(
type
.
equals
(
Long
.
class
)
||
"long"
.
equals
(
type
.
toString
())
)
{
Long
fileValue
=
(
Long
)
field
.
get
(
alertCalled
);
queryWrapper
.
eq
(
name
,
fileValue
);
}
...
...
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 @
cc3257f9
...
...
@@ -6,25 +6,33 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import
com.yeejoin.amos.boot.biz.common.controller.BaseController
;
import
com.yeejoin.amos.boot.biz.common.utils.NameUtils
;
import
com.yeejoin.amos.boot.module.jcs.api.dto.AlertSubmittedDto
;
import
com.yeejoin.amos.boot.module.jcs.api.entity.
*
;
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.vo.*
;
import
com.yeejoin.amos.boot.module.jcs.biz.service.impl.*
;
import
com.yeejoin.amos.boot.module.jcs.api.vo.AlertSubmittedSMSVo
;
import
com.yeejoin.amos.boot.module.jcs.api.vo.SchedulingReportingVo
;
import
com.yeejoin.amos.boot.module.jcs.api.vo.TemplateVo
;
import
com.yeejoin.amos.boot.module.jcs.biz.service.impl.AlertCalledServiceImpl
;
import
com.yeejoin.amos.boot.module.jcs.biz.service.impl.AlertSubmittedServiceImpl
;
import
com.yeejoin.amos.boot.module.jcs.biz.service.impl.DataDictionaryServiceImpl
;
import
com.yeejoin.amos.boot.module.jcs.biz.service.impl.PowerTransferServiceImpl
;
import
com.yeejoin.amos.boot.module.jcs.biz.service.impl.TemplateServiceImpl
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.typroject.tyboot.core.foundation.enumeration.UserType
;
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
javax.servlet.http.HttpServletRequest
;
import
javax.ws.rs.HEAD
;
import
java.lang.reflect.Field
;
import
java.util.*
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
/**
...
...
@@ -58,14 +66,12 @@ public class AlertSubmittedController extends BaseController {
*
* @return
*/
@TycloudOperation
(
needAuth
=
true
,
ApiLevel
=
UserType
.
AGENCY
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@RequestMapping
(
value
=
"/save"
,
method
=
RequestMethod
.
POST
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"新增警情报送记录"
,
notes
=
"新增警情报送记录"
)
public
ResponseModel
<
Object
>
saveAlertSubmitted
(
HttpServletRequest
request
,
@RequestBody
AlertSubmittedDto
alertSubmittedDto
)
{
return
ResponseHelper
.
buildResponse
(
alertSubmittedService
.
save
(
alertSubmittedDto
));
public
ResponseModel
<
Object
>
saveAlertSubmitted
(
@RequestBody
AlertSubmittedDto
alertSubmittedDto
)
{
return
ResponseHelper
.
buildResponse
(
alertSubmittedService
.
save
(
alertSubmittedDto
,
getUserInfo
()));
}
/**
...
...
@@ -74,14 +80,12 @@ public class AlertSubmittedController extends BaseController {
* @param id
* @return
*/
@TycloudOperation
(
needAuth
=
true
,
ApiLevel
=
UserType
.
AGENCY
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@RequestMapping
(
value
=
"/{id}"
,
method
=
RequestMethod
.
DELETE
)
@ApiOperation
(
httpMethod
=
"DELETE"
,
value
=
"根据id删除"
,
notes
=
"根据id删除"
)
public
ResponseModel
<
Boolean
>
deleteById
(
HttpServletRequest
request
,
@PathVariable
Long
id
)
{
public
ResponseModel
<
Boolean
>
deleteById
(
@PathVariable
Long
id
)
{
return
ResponseHelper
.
buildResponse
(
alertSubmittedService
.
removeById
(
id
));
}
/**
...
...
@@ -89,15 +93,12 @@ public class AlertSubmittedController extends BaseController {
*
* @return
*/
@TycloudOperation
(
needAuth
=
true
,
ApiLevel
=
UserType
.
AGENCY
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@RequestMapping
(
value
=
"/updateById"
,
method
=
RequestMethod
.
PUT
)
@ApiOperation
(
httpMethod
=
"PUT"
,
value
=
"修改警情报送记录"
,
notes
=
"修改警情报送记录"
)
public
ResponseModel
<
Boolean
>
updateByIdAlertSubmitted
(
HttpServletRequest
request
,
@RequestBody
AlertSubmitted
alertSubmitted
)
{
public
ResponseModel
<
Boolean
>
updateByIdAlertSubmitted
(
@RequestBody
AlertSubmitted
alertSubmitted
)
{
return
ResponseHelper
.
buildResponse
(
alertSubmittedService
.
updateById
(
alertSubmitted
));
}
/**
...
...
@@ -106,10 +107,10 @@ public class AlertSubmittedController extends BaseController {
* @param id
* @return
*/
@TycloudOperation
(
needAuth
=
true
,
ApiLevel
=
UserType
.
AGENCY
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@RequestMapping
(
value
=
"/{id}"
,
method
=
RequestMethod
.
GET
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"根据id查询"
,
notes
=
"根据id查询"
)
public
ResponseModel
<
AlertSubmitted
>
selectById
(
HttpServletRequest
request
,
@PathVariable
Long
id
)
{
public
ResponseModel
<
AlertSubmitted
>
selectById
(
@PathVariable
Long
id
)
{
return
ResponseHelper
.
buildResponse
(
alertSubmittedService
.
getById
(
id
));
}
...
...
@@ -126,7 +127,7 @@ public class AlertSubmittedController extends BaseController {
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"根据警情id查询警情报送列表"
,
notes
=
"根据警情id查询警情报送列表"
)
public
ResponseModel
<
SchedulingReportingVo
>
listReportingByParam
(
@RequestBody
AlertSubmittedDto
queryParam
)
{
queryParam
.
setSubmissionMethodCode
(
SubmissionMethodEnum
.
PHONE
.
getCode
());
queryParam
.
setSubmissionMethodCode
(
SubmissionMethodEnum
.
SMS
.
getCode
());
return
ResponseHelper
.
buildResponse
(
alertSubmittedService
.
listReportingByParam
(
queryParam
));
}
...
...
@@ -135,7 +136,7 @@ public class AlertSubmittedController extends BaseController {
*
* @return
*/
@TycloudOperation
(
needAuth
=
true
,
ApiLevel
=
UserType
.
AGENCY
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@RequestMapping
(
value
=
"/list"
,
method
=
RequestMethod
.
GET
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"列表分页查询"
,
notes
=
"列表分页查询"
)
public
IPage
<
AlertSubmitted
>
listPage
(
String
pageNum
,
String
pageSize
,
AlertSubmitted
alertSubmitted
)
{
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-jcs-biz/src/main/java/com/yeejoin/amos/boot/module/jcs/biz/controller/AlertSubmittedObjectController.java
View file @
cc3257f9
...
...
@@ -44,7 +44,7 @@ public class AlertSubmittedObjectController extends BaseController {
* 新增报送对象
* @return
*/
@TycloudOperation
(
needAuth
=
true
,
ApiLevel
=
UserType
.
AGENCY
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@RequestMapping
(
value
=
"/save"
,
method
=
RequestMethod
.
POST
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"新增报送对象"
,
notes
=
"新增报送对象"
)
public
boolean
saveAlertSubmittedObject
(
HttpServletRequest
request
,
@RequestBody
AlertSubmittedObject
alertSubmittedObject
){
...
...
@@ -56,7 +56,7 @@ public class AlertSubmittedObjectController extends BaseController {
* @param id
* @return
*/
@TycloudOperation
(
needAuth
=
true
,
ApiLevel
=
UserType
.
AGENCY
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@RequestMapping
(
value
=
"/{id}"
,
method
=
RequestMethod
.
DELETE
)
@ApiOperation
(
httpMethod
=
"DELETE"
,
value
=
"根据id删除"
,
notes
=
"根据id删除"
)
public
boolean
deleteById
(
HttpServletRequest
request
,
@PathVariable
Long
id
){
...
...
@@ -67,7 +67,7 @@ public class AlertSubmittedObjectController extends BaseController {
* 修改报送对象
* @return
*/
@TycloudOperation
(
needAuth
=
true
,
ApiLevel
=
UserType
.
AGENCY
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@RequestMapping
(
value
=
"/updateById"
,
method
=
RequestMethod
.
PUT
)
@ApiOperation
(
httpMethod
=
"PUT"
,
value
=
"修改报送对象"
,
notes
=
"修改报送对象"
)
public
boolean
updateByIdAlertSubmittedObject
(
HttpServletRequest
request
,
@RequestBody
AlertSubmittedObject
alertSubmittedObject
){
...
...
@@ -79,7 +79,7 @@ public class AlertSubmittedObjectController extends BaseController {
* @param id
* @return
*/
@TycloudOperation
(
needAuth
=
true
,
ApiLevel
=
UserType
.
AGENCY
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@RequestMapping
(
value
=
"/{id}"
,
method
=
RequestMethod
.
GET
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"根据id查询"
,
notes
=
"根据id查询"
)
public
AlertSubmittedObject
selectById
(
HttpServletRequest
request
,
@PathVariable
Long
id
){
...
...
@@ -90,7 +90,7 @@ public class AlertSubmittedObjectController extends BaseController {
* 列表分页查询
* @return
*/
@TycloudOperation
(
needAuth
=
true
,
ApiLevel
=
UserType
.
AGENCY
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@RequestMapping
(
value
=
"/list"
,
method
=
RequestMethod
.
GET
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"列表分页查询"
,
notes
=
"列表分页查询"
)
public
IPage
<
AlertSubmittedObject
>
listPage
(
String
pageNum
,
String
pageSize
,
AlertSubmittedObject
alertSubmittedObject
){
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-jcs-biz/src/main/java/com/yeejoin/amos/boot/module/jcs/biz/controller/PowerTransferController.java
View file @
cc3257f9
...
...
@@ -181,8 +181,7 @@ public class PowerTransferController extends BaseController {
@GetMapping
(
value
=
"/power/tree"
)
@ApiOperation
(
value
=
"力量调派资源树"
,
notes
=
"力量调派资源树"
)
public
ResponseModel
<
Object
>
getPowerTree
()
{
powerTransferService
.
getPowerTree
();
return
ResponseHelper
.
buildResponse
(
""
);
return
ResponseHelper
.
buildResponse
(
powerTransferService
.
getPowerTree
());
}
}
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 @
cc3257f9
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jcs
.
biz
.
service
.
impl
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.google.common.collect.Lists
;
import
com.google.common.collect.Maps
;
import
com.yeejoin.amos.boot.biz.common.utils.EnumsUtils
;
import
com.yeejoin.amos.boot.module.jcs.api.dto.AlertSubmittedDto
;
import
com.yeejoin.amos.boot.module.jcs.api.entity.*
;
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.AlertSubmitted
;
import
com.yeejoin.amos.boot.module.jcs.api.entity.AlertSubmittedObject
;
import
com.yeejoin.amos.boot.module.jcs.api.entity.DataDictionary
;
import
com.yeejoin.amos.boot.module.jcs.api.entity.Template
;
import
com.yeejoin.amos.boot.module.jcs.api.enums.AlertBusinessTypeEnum
;
import
com.yeejoin.amos.boot.module.jcs.api.enums.AlertSchedulingTypeEnum
;
import
com.yeejoin.amos.boot.module.jcs.api.enums.AlertSubmitTypeEnum
;
...
...
@@ -12,19 +20,26 @@ import com.yeejoin.amos.boot.module.jcs.api.enums.SubmissionMethodEnum;
import
com.yeejoin.amos.boot.module.jcs.api.mapper.AlertSubmittedMapper
;
import
com.yeejoin.amos.boot.module.jcs.api.service.IAlertSubmittedObjectService
;
import
com.yeejoin.amos.boot.module.jcs.api.service.IAlertSubmittedService
;
import
com.yeejoin.amos.boot.module.jcs.api.vo.*
;
import
org.springframework.beans.BeanUtils
;
import
com.yeejoin.amos.boot.module.jcs.api.vo.AlertSubmittedExtVo
;
import
com.yeejoin.amos.boot.module.jcs.api.vo.AlertSubmittedSMSVo
;
import
com.yeejoin.amos.boot.module.jcs.api.vo.FormValue
;
import
com.yeejoin.amos.boot.module.jcs.api.vo.PowerTransferCompanyVo
;
import
com.yeejoin.amos.boot.module.jcs.api.vo.SchedulingReportingVo
;
import
com.yeejoin.amos.boot.module.jcs.api.vo.TemplateVo
;
import
com.yeejoin.amos.feign.privilege.model.AgencyUserModel
;
import
org.apache.commons.lang3.ObjectUtils
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
import
java.lang.reflect.Field
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.
*
;
import
java.util.
Optional
;
import
java.util.stream.Collectors
;
/**
...
...
@@ -73,16 +88,39 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto,Ale
public
SchedulingReportingVo
listReportingByParam
(
AlertSubmittedDto
queryParam
)
{
SchedulingReportingVo
schedulingReportingVo
=
new
SchedulingReportingVo
();
List
<
AlertSubmittedExtVo
>
alertSubmittedExtVoList
=
this
.
baseMapper
.
listReportingByParam
(
queryParam
);
schedulingReportingVo
.
setSchedulingReportingList
(
alertSubmittedExtVoList
);
// TODO 填充短信报送内容
if
(
ObjectUtils
.
isNotEmpty
(
alertSubmittedExtVoList
))
{
// 组装额外信息
String
_extraInfo
=
"报送给%s、%s"
;
// TODO 调用规则查询默认报送人和单位
alertSubmittedExtVoList
.
forEach
(
alertSubmittedExtVo
->
{
alertSubmittedExtVo
.
setExtraInfo
(
String
.
format
(
_extraInfo
,
alertSubmittedExtVo
.
getCompanyName
(),
alertSubmittedExtVo
.
getUserName
()));
String
extraInfo
=
String
.
format
(
"已报送%d条"
,
alertSubmittedExtVoList
.
size
());
schedulingReportingVo
.
setExtraInfo
(
extraInfo
);
// TODO 填充短信报送内容
TemplateExtendDto
template
=
templateService
.
getByType
(
alertSubmittedExtVo
.
getBusinessTypeCode
());
String
richContent
=
template
.
getRichContent
();
JSONObject
objContent
=
JSON
.
parseObject
(
alertSubmittedExtVo
.
getSubmissionContent
());
alertSubmittedExtVo
.
setSubmissionContent
(
templateReplace
(
richContent
,
objContent
));
});
schedulingReportingVo
.
setSchedulingReportingList
(
alertSubmittedExtVoList
);
String
extraInfo
=
String
.
format
(
"已报送%d条"
,
alertSubmittedExtVoList
.
size
());
schedulingReportingVo
.
setExtraInfo
(
extraInfo
);
}
return
schedulingReportingVo
;
}
private
String
templateReplace
(
String
content
,
JSONObject
object
)
{
for
(
Map
.
Entry
<
String
,
Object
>
entry
:
object
.
entrySet
())
{
String
key
=
entry
.
getKey
();
Object
value
=
entry
.
getValue
();
content
=
content
.
replaceAll
(
key
,
String
.
valueOf
(
value
));
}
return
content
;
}
@Override
public
Boolean
save
(
AlertSubmittedDto
alertSubmittedDto
)
{
public
Boolean
save
(
AlertSubmittedDto
alertSubmittedDto
,
AgencyUserModel
userModel
)
{
// 1.保存警情记录主表
AlertSubmitted
alertSubmitted
=
new
AlertSubmitted
();
alertSubmitted
.
setAlertCalledId
(
alertSubmittedDto
.
getAlertCalledId
());
...
...
@@ -100,6 +138,10 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto,Ale
alertSubmitted
.
setSchedulingTypeCode
(
alertSubmittedDto
.
getSchedulingTypeCode
());
alertSubmitted
.
setSchedulingType
(
alertSchedulingTypeEnum
.
orElse
(
AlertSchedulingTypeEnum
.
融合调度
).
getName
());
alertSubmitted
.
setSubmissionContent
(
alertSubmittedDto
.
getSubmitContent
().
toJSONString
());
alertSubmitted
.
setSender
(
userModel
.
getUserName
());
alertSubmitted
.
setRecUserName
(
userModel
.
getUserName
());
alertSubmitted
.
setUpdateTime
(
new
Date
());
alertSubmitted
.
setSubmissionTime
(
new
Date
());
this
.
baseMapper
.
insert
(
alertSubmitted
);
...
...
@@ -113,6 +155,7 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto,Ale
alertSubmittedObject
.
setType
(
true
);
alertSubmittedObject
.
setCompanyId
(
company
.
getCompanyId
());
alertSubmittedObject
.
setCompanyName
(
company
.
getCompanyName
());
alertSubmittedObject
.
setRecUserName
(
userModel
.
getUserName
());
alertSubmittedObjectList
.
add
(
alertSubmittedObject
);
});
...
...
@@ -128,14 +171,19 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto,Ale
alertSubmittedObject
.
setUserId
(
person
.
getPersonId
());
alertSubmittedObject
.
setUserName
(
person
.
getPersonName
());
alertSubmittedObject
.
setUserPhone
(
person
.
getPersonPhone
());
alertSubmittedObject
.
setRecUserName
(
userModel
.
getUserName
());
alertSubmittedObjectList
.
add
(
alertSubmittedObject
);
});
});
}
alertSubmittedObjectServiceImpl
.
saveBatch
(
alertSubmittedObjectList
);
// 3.发送任务消息
// 3.更新警情状态
alertCalledService
.
updateAlertCalled
(
alertSubmittedDto
.
getAlertCalledId
(),
alertSubmittedDto
.
getBusinessTypeCode
());
// 4.发送任务消息
// 调用平台短信发送接口发送消息
return
true
;
}
...
...
@@ -173,6 +221,11 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto,Ale
}
}
@Override
public
AlertSubmittedSMSVo
getSchedulingContent
(
Long
id
)
{
return
this
.
baseMapper
.
getSchedulingContent
(
id
);
}
/**
* 将Object对象里面的属性和值转化成Map对象
*
...
...
@@ -201,9 +254,4 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto,Ale
}
return
map
;
}
@Override
public
AlertSubmittedSMSVo
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/FireTeamServiceImpl.java
View file @
cc3257f9
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jcs
.
biz
.
service
.
impl
;
import
com.yeejoin.amos.boot.module.jcs.api.dto.FireBrigadeResourceDto
;
import
com.yeejoin.amos.boot.module.jcs.api.dto.FireTeamDto
;
import
com.yeejoin.amos.boot.module.jcs.api.entity.FireTeam
;
import
com.yeejoin.amos.boot.module.jcs.api.mapper.FireTeamMapper
;
...
...
@@ -36,4 +37,13 @@ public class FireTeamServiceImpl extends BaseService<FireTeamDto, FireTeam,FireT
return
fireTeamMapper
.
getFireTeamCount
(
pageNum
,
pageSize
,
par
)
;
}
/**
* 获取监控大队列表
*
* @return
*/
public
List
<
FireBrigadeResourceDto
>
listMonitorFireBrigade
()
{
return
fireTeamMapper
.
listMonitorFireBrigade
();
}
}
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 @
cc3257f9
...
...
@@ -2,9 +2,7 @@ package com.yeejoin.amos.boot.module.jcs.biz.service.impl;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.google.common.collect.Lists
;
import
com.yeejoin.amos.boot.biz.common.utils.TreeParser
;
import
com.yeejoin.amos.boot.module.jcs.api.dto.FireCarDto
;
import
com.yeejoin.amos.boot.module.jcs.api.dto.FireTeamDto
;
import
com.yeejoin.amos.boot.module.jcs.api.dto.FireBrigadeResourceDto
;
import
com.yeejoin.amos.boot.module.jcs.api.dto.PowerTransferCompanyDto
;
import
com.yeejoin.amos.boot.module.jcs.api.dto.PowerTransferCompanyResourcesDto
;
import
com.yeejoin.amos.boot.module.jcs.api.dto.PowerTransferDto
;
...
...
@@ -29,7 +27,6 @@ import org.springframework.beans.BeanUtils;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.util.CollectionUtils
;
import
org.typroject.tyboot.core.foundation.utils.Bean
;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
...
...
@@ -115,46 +112,60 @@ public class PowerTransferServiceImpl extends BaseService<PowerTransferDto, Powe
}
@Override
public
void
getPowerTree
()
{
public
List
<
FireBrigadeResourceDto
>
getPowerTree
()
{
List
<
FireBrigadeResourceDto
>
fireBrigadeResourceList
=
Lists
.
newArrayList
();
// 1.调用装备服务接口查询车辆列表
List
<
Fire
Car
Dto
>
fireCarDtoList
=
Lists
.
newArrayList
();
List
<
Fire
BrigadeResource
Dto
>
fireCarDtoList
=
Lists
.
newArrayList
();
ResponseModel
<
Object
>
result
=
equipFeignService
.
getFireCarListAll
();
if
(!
ObjectUtils
.
isEmpty
(
result
))
{
List
<
Map
<
String
,
Object
>>
fireCarListMapList
=
(
List
<
Map
<
String
,
Object
>>)
result
.
getResult
();
fireCarListMapList
.
stream
().
filter
(
car
->
ObjectUtils
.
isNotEmpty
(
car
.
get
(
"teamId"
))).
forEach
(
car
->
{
Fire
CarDto
fireCarDto
=
(
FireCarDto
)
Bean
.
mapToBean
(
car
,
FireCar
Dto
.
class
);
Fire
BrigadeResourceDto
fireCarDto
=
(
FireBrigadeResourceDto
)
Bean
.
mapToBean
(
car
,
FireBrigadeResource
Dto
.
class
);
if
(
FireCarStatusEnum
.
onDuty
.
getCode
().
equals
(
fireCarDto
.
getCarState
()))
{
fireCarDto
.
setCarStateDesc
(
FireCarStatusEnum
.
onDuty
.
getName
());
}
else
{
fireCarDto
.
setCarState
(
FireCarStatusEnum
.
out
.
getCode
());
fireCarDto
.
setCarStateDesc
(
FireCarStatusEnum
.
out
.
getName
());
}
fireCarDtoList
.
add
(
fireCarDto
);
});
}
Long
onDutyCarCount
=
fireCarDtoList
.
stream
().
filter
(
car
->
FireCarStatusEnum
.
onDuty
.
getCode
().
equals
(
car
.
getCarState
())).
count
();
Long
outCarCount
=
fireCarDtoList
.
size
()
-
onDutyCarCount
;
// 2.查询消防队伍列表
List
<
FireTeam
>
fullTimeFireBrigadeList
=
fireTeamService
.
list
(
new
QueryWrapper
<
FireTeam
>().
eq
(
"type_code"
,
FireBrigadeTypeEnum
.
专职消防队
.
getCode
()));
List
<
FireTeam
>
monitorFireBrigadeList
=
fireTeamService
.
list
(
new
QueryWrapper
<
FireTeam
>().
eq
(
"type_code"
,
FireBrigadeTypeEnum
.
监控大队
.
getCode
()));
// 3.组装专职消防队伍车辆
// List<FireTeamDto> fireTeamDtoList = Lists.newArrayList();
// if (!CollectionUtils.isEmpty(fullTimeFireBrigadeList)) {
// fullTimeFireBrigadeList.forEach(brigade -> {
// FireTeamDto teamDto = new FireTeamDto();
// BeanUtils.copyProperties(brigade, teamDto);
// teamDto.setType(FireBrigadeTypeEnum.专职消防队.getKey());
//
//// teamDto.setChildren();
// });
// }
fireCarDtoList
.
stream
().
collect
(
Collectors
.
groupingBy
(
FireCarDto:
:
getTeamId
));
try
{
TreeParser
.
getTree
(
null
,
monitorFireBrigadeList
,
FireTeam
.
class
.
getName
(),
"getSequenceNbr"
,
2
,
"getName"
,
"getParent"
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
Map
<
String
,
List
<
FireBrigadeResourceDto
>>
resultMap
=
fireCarDtoList
.
stream
().
collect
(
Collectors
.
groupingBy
(
FireBrigadeResourceDto:
:
getTeamId
));
resultMap
.
keySet
().
forEach
(
brigadeId
->
{
FireBrigadeResourceDto
fireCarResourceDto
=
new
FireBrigadeResourceDto
();
FireTeam
fireTeam
=
fullTimeFireBrigadeList
.
stream
().
filter
(
team
->
brigadeId
.
equals
(
team
.
getSequenceNbr
().
toString
())).
findAny
().
orElse
(
new
FireTeam
());
if
(
ObjectUtils
.
isNotEmpty
(
fireTeam
.
getSequenceNbr
()))
{
fireCarResourceDto
.
setId
(
fireTeam
.
getSequenceNbr
().
toString
());
fireCarResourceDto
.
setType
(
FireBrigadeTypeEnum
.
专职消防队
.
getKey
());
fireCarResourceDto
.
setName
(
fireTeam
.
getName
());
fireCarResourceDto
.
getChildren
().
addAll
(
resultMap
.
get
(
brigadeId
));
fireCarResourceDto
.
setOutCount
(
outCarCount
.
intValue
());
fireCarResourceDto
.
setOnDutyCount
(
onDutyCarCount
.
intValue
());
fireBrigadeResourceList
.
add
(
fireCarResourceDto
);
}
});
// 3.消防队伍-监控大队
List
<
FireBrigadeResourceDto
>
monitorFireBrigadeList
=
fireTeamService
.
listMonitorFireBrigade
();
FireBrigadeResourceDto
monitorResourceDto
=
new
FireBrigadeResourceDto
();
monitorResourceDto
.
setId
(
"0"
);
monitorResourceDto
.
setName
(
FireBrigadeTypeEnum
.
监控大队
.
getName
());
monitorResourceDto
.
setType
(
FireBrigadeTypeEnum
.
监控大队
.
getKey
());
monitorResourceDto
.
setChildren
(
monitorFireBrigadeList
);
fireBrigadeResourceList
.
add
(
monitorResourceDto
);
return
fireBrigadeResourceList
;
}
private
List
<
PowerTransferCompanyResources
>
DtoEntityBatchConvert
(
List
<
PowerTransferCompanyResourcesDto
>
powerTransferCompanyResourcesDtoList
,
Long
powerTransferCompanySequenceNbr
)
{
...
...
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