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
95c720d3
Commit
95c720d3
authored
Aug 04, 2021
by
changhong
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'developer' of
http://172.16.10.76/moa/amos-boot-biz
into developer
parents
a3f0e296
9f0fb557
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
34 changed files
with
1187 additions
and
77 deletions
+1187
-77
ExcelDto.java
...com/yeejoin/amos/boot/module/common/api/dto/ExcelDto.java
+25
-1
KeySiteDto.java
...m/yeejoin/amos/boot/module/common/api/dto/KeySiteDto.java
+3
-0
KeySiteExcleDto.java
...join/amos/boot/module/common/api/dto/KeySiteExcleDto.java
+2
-1
IotFeignClient.java
...oin/amos/boot/module/common/api/feign/IotFeignClient.java
+28
-0
ISourceFileService.java
...os/boot/module/common/api/service/ISourceFileService.java
+6
-1
pom.xml
...ule/amos-boot-module-api/amos-boot-module-tzs-api/pom.xml
+5
-0
AlertCalledDto.java
.../yeejoin/amos/boot/module/tzs/api/dto/AlertCalledDto.java
+5
-1
ESAlertCalledDto.java
...eejoin/amos/boot/module/tzs/api/dto/ESAlertCalledDto.java
+93
-0
ESAlertCalledRequestDto.java
...amos/boot/module/tzs/api/dto/ESAlertCalledRequestDto.java
+23
-0
ElevatorDto.java
...com/yeejoin/amos/boot/module/tzs/api/dto/ElevatorDto.java
+2
-2
MaintenanceUnitDto.java
...join/amos/boot/module/tzs/api/dto/MaintenanceUnitDto.java
+2
-2
RescueStationDto.java
...eejoin/amos/boot/module/tzs/api/dto/RescueStationDto.java
+2
-2
UseUnitDto.java
.../com/yeejoin/amos/boot/module/tzs/api/dto/UseUnitDto.java
+2
-2
AlertCalled.java
.../yeejoin/amos/boot/module/tzs/api/entity/AlertCalled.java
+30
-0
ESAlertCalled.java
...eejoin/amos/boot/module/tzs/api/entity/ESAlertCalled.java
+99
-0
AlertStageEnums.java
...ejoin/amos/boot/module/tzs/api/enums/AlertStageEnums.java
+1
-1
CommandController.java
...boot/module/command/biz/controller/CommandController.java
+50
-10
KeySiteController.java
.../boot/module/common/biz/controller/KeySiteController.java
+16
-3
WaterResourceController.java
...module/common/biz/controller/WaterResourceController.java
+33
-0
KeySiteServiceImpl.java
...ot/module/common/biz/service/impl/KeySiteServiceImpl.java
+7
-1
LinkageUnitServiceImpl.java
...odule/common/biz/service/impl/LinkageUnitServiceImpl.java
+32
-0
OrgUsrServiceImpl.java
...oot/module/common/biz/service/impl/OrgUsrServiceImpl.java
+2
-1
SourceFileServiceImpl.java
...module/common/biz/service/impl/SourceFileServiceImpl.java
+1
-0
AircraftController.java
...os/boot/module/jcs/biz/controller/AircraftController.java
+15
-8
ExcelController.java
.../amos/boot/module/jcs/biz/controller/ExcelController.java
+0
-0
DataSourcesImpl.java
...mos/boot/module/jcs/biz/service/impl/DataSourcesImpl.java
+3
-1
ExcelServiceImpl.java
...os/boot/module/jcs/biz/service/impl/ExcelServiceImpl.java
+0
-0
AlertCalledController.java
...boot/module/tzs/biz/controller/AlertCalledController.java
+126
-36
AlertFormController.java
...s/boot/module/tzs/biz/controller/AlertFormController.java
+177
-0
ESAlertCalledRepository.java
...amos/boot/module/tzs/biz/dao/ESAlertCalledRepository.java
+18
-0
AlertCalledServiceImpl.java
...t/module/tzs/biz/service/impl/AlertCalledServiceImpl.java
+122
-3
ESAlertCalledService.java
...oot/module/tzs/biz/service/impl/ESAlertCalledService.java
+245
-0
AmosTzsApplication.java
...zs/src/main/java/com/yeejoin/amos/AmosTzsApplication.java
+2
-1
application-dev.properties
...-system-tzs/src/main/resources/application-dev.properties
+10
-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/dto/ExcelDto.java
View file @
95c720d3
package
com
.
yeejoin
.
amos
.
boot
.
module
.
common
.
api
.
dto
;
package
com
.
yeejoin
.
amos
.
boot
.
module
.
common
.
api
.
dto
;
import
com.yeejoin.amos.boot.biz.common.utils.DateUtils
;
import
io.swagger.annotations.ApiModelProperty
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.Data
;
import
org.springframework.util.StringUtils
;
import
java.util.Date
;
@Data
@Data
public
class
ExcelDto
{
public
class
ExcelDto
{
...
@@ -14,4 +17,25 @@ public class ExcelDto {
...
@@ -14,4 +17,25 @@ public class ExcelDto {
private
String
classUrl
;
private
String
classUrl
;
@ApiModelProperty
(
value
=
"导出类型 来源于ExcelEnums常量"
)
@ApiModelProperty
(
value
=
"导出类型 来源于ExcelEnums常量"
)
private
String
type
;
private
String
type
;
public
ExcelDto
(
String
fileName
,
String
sheetName
,
String
classUrl
,
String
type
)
{
this
.
fileName
=
fileName
;
this
.
sheetName
=
sheetName
;
this
.
classUrl
=
classUrl
;
this
.
type
=
type
;
}
public
ExcelDto
(
String
fileName
,
String
sheetName
,
String
type
)
{
this
.
fileName
=
fileName
;
this
.
sheetName
=
sheetName
;
this
.
type
=
type
;
}
public
String
getFileName
()
{
return
StringUtils
.
isEmpty
(
fileName
)
?
DateUtils
.
convertDateToString
(
new
Date
(),
"yyyyMMddHHmmss"
)
:
fileName
;
}
public
String
getSheetName
()
{
return
StringUtils
.
isEmpty
(
sheetName
)
?
"Sheet1"
:
sheetName
;
}
}
}
amos-boot-module/amos-boot-module-api/amos-boot-module-common-api/src/main/java/com/yeejoin/amos/boot/module/common/api/dto/KeySiteDto.java
View file @
95c720d3
...
@@ -91,4 +91,7 @@ public class KeySiteDto extends BaseDto implements Serializable{
...
@@ -91,4 +91,7 @@ public class KeySiteDto extends BaseDto implements Serializable{
@ApiModelProperty
(
value
=
"附件"
)
@ApiModelProperty
(
value
=
"附件"
)
private
Map
<
String
,
List
<
AttachmentDto
>>
attachments
;
private
Map
<
String
,
List
<
AttachmentDto
>>
attachments
;
@ApiModelProperty
(
value
=
"数组形式附件"
)
private
List
<
String
>
attachmentsList
;
}
}
amos-boot-module/amos-boot-module-api/amos-boot-module-common-api/src/main/java/com/yeejoin/amos/boot/module/common/api/dto/KeySiteExcleDto.java
View file @
95c720d3
...
@@ -55,11 +55,12 @@ public class KeySiteExcleDto implements Serializable {
...
@@ -55,11 +55,12 @@ public class KeySiteExcleDto implements Serializable {
@ExcelProperty
(
value
=
"建筑高度(m)"
,
index
=
5
)
@ExcelProperty
(
value
=
"建筑高度(m)"
,
index
=
5
)
@ApiModelProperty
(
value
=
"建筑高度(m)"
)
@ApiModelProperty
(
value
=
"建筑高度(m)"
)
private
String
buildingHeight
;
private
String
buildingHeight
;
@ExplicitConstraint
(
type
=
"NHDJ"
,
indexNum
=
6
,
sourceClass
=
RoleNameExplicitConstraint
.
class
)
//动态下拉内容
@ExcelProperty
(
value
=
"耐火等级"
,
index
=
6
)
@ExcelProperty
(
value
=
"耐火等级"
,
index
=
6
)
@ApiModelProperty
(
value
=
"耐火等级"
)
@ApiModelProperty
(
value
=
"耐火等级"
)
private
String
fireEnduranceRate
;
private
String
fireEnduranceRate
;
@ExplicitConstraint
(
type
=
"JZWSYXZ"
,
indexNum
=
7
,
sourceClass
=
RoleNameExplicitConstraint
.
class
)
//动态下拉内容
@ExcelProperty
(
value
=
"使用性质"
,
index
=
7
)
@ExcelProperty
(
value
=
"使用性质"
,
index
=
7
)
@ApiModelProperty
(
value
=
"使用性质"
)
@ApiModelProperty
(
value
=
"使用性质"
)
private
String
useNature
;
private
String
useNature
;
...
...
amos-boot-module/amos-boot-module-api/amos-boot-module-common-api/src/main/java/com/yeejoin/amos/boot/module/common/api/feign/IotFeignClient.java
0 → 100644
View file @
95c720d3
package
com
.
yeejoin
.
amos
.
boot
.
module
.
common
.
api
.
feign
;
import
org.springframework.cloud.openfeign.FeignClient
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
java.util.Map
;
/**
* iot feign
*
* @author Dell
*/
@FeignClient
(
name
=
"AMOS-API-IOT-PLATFORM"
,
path
=
"iot"
,
configuration
=
{
MultipartSupportConfig
.
class
})
public
interface
IotFeignClient
{
/**
* 根据航班号查询航班信息
**/
@RequestMapping
(
value
=
"/v1/iot/DynamicFlightInfo/{flightNo}"
,
method
=
RequestMethod
.
GET
)
ResponseModel
<
Map
<
String
,
Object
>>
getDynamicFlightInfo
(
@PathVariable
String
flightNo
);
}
amos-boot-module/amos-boot-module-api/amos-boot-module-common-api/src/main/java/com/yeejoin/amos/boot/module/common/api/service/ISourceFileService.java
View file @
95c720d3
package
com
.
yeejoin
.
amos
.
boot
.
module
.
common
.
api
.
service
;
package
com
.
yeejoin
.
amos
.
boot
.
module
.
common
.
api
.
service
;
import
com.yeejoin.amos.boot.module.common.api.dto.AttachmentDto
;
import
java.util.List
;
import
java.util.Map
;
/**
/**
* 公共附件接口类
* 公共附件接口类
*
*
...
@@ -8,5 +13,5 @@ package com.yeejoin.amos.boot.module.common.api.service;
...
@@ -8,5 +13,5 @@ package com.yeejoin.amos.boot.module.common.api.service;
* @date 2021-07-16
* @date 2021-07-16
*/
*/
public
interface
ISourceFileService
{
public
interface
ISourceFileService
{
public
Map
<
String
,
List
<
AttachmentDto
>>
getAttachments
(
Long
sourceId
);
}
}
amos-boot-module/amos-boot-module-api/amos-boot-module-tzs-api/pom.xml
View file @
95c720d3
...
@@ -15,6 +15,11 @@
...
@@ -15,6 +15,11 @@
<artifactId>
amos-boot-biz-common
</artifactId>
<artifactId>
amos-boot-biz-common
</artifactId>
<version>
${amos-biz-boot.version}
</version>
<version>
${amos-biz-boot.version}
</version>
</dependency>
</dependency>
<dependency>
<groupId>
com.amosframework.boot
</groupId>
<artifactId>
amos-boot-module-common-api
</artifactId>
<version>
${amos-biz-boot.version}
</version>
</dependency>
</dependencies>
</dependencies>
</project>
</project>
amos-boot-module/amos-boot-module-api/amos-boot-module-tzs-api/src/main/java/com/yeejoin/amos/boot/module/tzs/api/dto/AlertCalledDto.java
View file @
95c720d3
package
com
.
yeejoin
.
amos
.
boot
.
module
.
tzs
.
api
.
dto
;
package
com
.
yeejoin
.
amos
.
boot
.
module
.
tzs
.
api
.
dto
;
import
com.yeejoin.amos.boot.biz.common.dto.BaseDto
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
io.swagger.annotations.ApiModelProperty
;
import
com.yeejoin.amos.boot.biz.common.dto.BaseDto
;
import
lombok.Data
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
lombok.EqualsAndHashCode
;
import
java.util.Date
;
import
java.util.Date
;
/**
/**
...
@@ -27,6 +28,9 @@ public class AlertCalledDto extends BaseDto {
...
@@ -27,6 +28,9 @@ public class AlertCalledDto extends BaseDto {
@ApiModelProperty
(
value
=
"警情来源类型"
)
@ApiModelProperty
(
value
=
"警情来源类型"
)
private
String
alertSource
;
private
String
alertSource
;
@ApiModelProperty
(
value
=
"警情来源类型code"
)
private
String
alertSourceCode
;
@ApiModelProperty
(
value
=
"接警时间"
)
@ApiModelProperty
(
value
=
"接警时间"
)
private
Date
callTime
;
private
Date
callTime
;
...
...
amos-boot-module/amos-boot-module-api/amos-boot-module-tzs-api/src/main/java/com/yeejoin/amos/boot/module/tzs/api/dto/ESAlertCalledDto.java
0 → 100644
View file @
95c720d3
package
com
.
yeejoin
.
amos
.
boot
.
module
.
tzs
.
api
.
dto
;
import
com.yeejoin.amos.boot.biz.common.dto.BaseDto
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
java.util.Date
;
/**
*
* <pre>
* 警情信息ES dto对象
* </pre>
*
* @author gwb
* @version $Id: ESAlertCalledDto.java, v 0.1 2021年6月23日 下午1:52:07 gwb Exp $
*/
@Data
@EqualsAndHashCode
(
callSuper
=
true
)
@ApiModel
(
value
=
"ESAlertCalledDto"
,
description
=
"ES警情信息"
)
public
class
ESAlertCalledDto
extends
BaseDto
{
/**
*
*/
private
static
final
long
serialVersionUID
=
1L
;
/**
* 警情状态
*/
@ApiModelProperty
(
value
=
"警情状态"
)
private
Boolean
alertStatus
;
/**
* 警情阶段
*/
@ApiModelProperty
(
value
=
"警情阶段"
)
private
String
alertStage
;
/**
* 联系人姓名
*/
@ApiModelProperty
(
value
=
"联系人姓名"
)
private
String
contactUser
;
/**
* 联系人电话
*/
@ApiModelProperty
(
value
=
"联系人电话"
)
private
String
contactPhone
;
/**
* 接警时间
*/
@ApiModelProperty
(
value
=
"接警时间"
)
private
Date
callTime
;
/**
* 接警时间
*/
@ApiModelProperty
(
value
=
"接警时间戳"
)
private
Long
callTimeLong
;
/**
* 警情类型
*/
@ApiModelProperty
(
value
=
"警情类型"
)
private
String
alarmType
;
/**
* 警情类型code
*/
@ApiModelProperty
(
value
=
"警情类型code"
)
private
String
alarmTypeCode
;
/**
* 事发单位
*/
@ApiModelProperty
(
value
=
"使用单位"
)
private
String
useUnit
;
/**
* 地址
*/
@ApiModelProperty
(
value
=
"地址"
)
private
String
address
;
/**
* 设备识别码
*/
@ApiModelProperty
(
value
=
"设备识别码"
)
private
String
deviceId
;
/**
* 求援人电话
*/
@ApiModelProperty
(
value
=
"求援人电话"
)
private
String
emergencyCall
;
}
amos-boot-module/amos-boot-module-api/amos-boot-module-tzs-api/src/main/java/com/yeejoin/amos/boot/module/tzs/api/dto/ESAlertCalledRequestDto.java
0 → 100644
View file @
95c720d3
package
com
.
yeejoin
.
amos
.
boot
.
module
.
tzs
.
api
.
dto
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
/**
*
* <pre>
* 警情信息ES请求参数对象
* </pre>
*
* @author gwb
* @version $Id: ESAlertCalledRequestDto.java, v 0.1 2021年6月24日 下午3:30:40 gwb Exp $
*/
@Data
@EqualsAndHashCode
(
callSuper
=
true
)
public
class
ESAlertCalledRequestDto
extends
AlertCalledObjsDto
{
private
static
final
long
serialVersionUID
=
1L
;
@ApiModelProperty
(
value
=
"警情状态"
)
private
String
[]
alertStatus
;
}
amos-boot-module/amos-boot-module-api/amos-boot-module-tzs-api/src/main/java/com/yeejoin/amos/boot/module/tzs/api/dto/ElevatorDto.java
View file @
95c720d3
package
com
.
yeejoin
.
amos
.
boot
.
module
.
tzs
.
api
.
dto
;
package
com
.
yeejoin
.
amos
.
boot
.
module
.
tzs
.
api
.
dto
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
com.yeejoin.amos.boot.biz.common.
entity.BaseEntity
;
import
com.yeejoin.amos.boot.biz.common.
dto.BaseDto
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.Data
;
...
@@ -19,7 +19,7 @@ import java.util.Date;
...
@@ -19,7 +19,7 @@ import java.util.Date;
@Accessors
(
chain
=
true
)
@Accessors
(
chain
=
true
)
@TableName
(
"tcb_elevator"
)
@TableName
(
"tcb_elevator"
)
@ApiModel
(
value
=
"ElevatorDto"
,
description
=
"ElevatorDto"
)
@ApiModel
(
value
=
"ElevatorDto"
,
description
=
"ElevatorDto"
)
public
class
ElevatorDto
extends
Base
Entity
{
public
class
ElevatorDto
extends
Base
Dto
{
private
static
final
long
serialVersionUID
=
1L
;
private
static
final
long
serialVersionUID
=
1L
;
...
...
amos-boot-module/amos-boot-module-api/amos-boot-module-tzs-api/src/main/java/com/yeejoin/amos/boot/module/tzs/api/dto/MaintenanceUnitDto.java
View file @
95c720d3
package
com
.
yeejoin
.
amos
.
boot
.
module
.
tzs
.
api
.
dto
;
package
com
.
yeejoin
.
amos
.
boot
.
module
.
tzs
.
api
.
dto
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
com.yeejoin.amos.boot.biz.common.
entity.BaseEntity
;
import
com.yeejoin.amos.boot.biz.common.
dto.BaseDto
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.Data
;
...
@@ -17,7 +17,7 @@ import lombok.experimental.Accessors;
...
@@ -17,7 +17,7 @@ import lombok.experimental.Accessors;
@Accessors
(
chain
=
true
)
@Accessors
(
chain
=
true
)
@TableName
(
"cb_maintenance_unit"
)
@TableName
(
"cb_maintenance_unit"
)
@ApiModel
(
value
=
"MaintenanceUnitDto"
,
description
=
"MaintenanceUnitDto"
)
@ApiModel
(
value
=
"MaintenanceUnitDto"
,
description
=
"MaintenanceUnitDto"
)
public
class
MaintenanceUnitDto
extends
Base
Entity
{
public
class
MaintenanceUnitDto
extends
Base
Dto
{
private
static
final
long
serialVersionUID
=
1L
;
private
static
final
long
serialVersionUID
=
1L
;
...
...
amos-boot-module/amos-boot-module-api/amos-boot-module-tzs-api/src/main/java/com/yeejoin/amos/boot/module/tzs/api/dto/RescueStationDto.java
View file @
95c720d3
package
com
.
yeejoin
.
amos
.
boot
.
module
.
tzs
.
api
.
dto
;
package
com
.
yeejoin
.
amos
.
boot
.
module
.
tzs
.
api
.
dto
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
com.yeejoin.amos.boot.biz.common.
entity.BaseEntity
;
import
com.yeejoin.amos.boot.biz.common.
dto.BaseDto
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.Data
;
...
@@ -17,7 +17,7 @@ import lombok.experimental.Accessors;
...
@@ -17,7 +17,7 @@ import lombok.experimental.Accessors;
@Accessors
(
chain
=
true
)
@Accessors
(
chain
=
true
)
@TableName
(
"tcb_rescue_station"
)
@TableName
(
"tcb_rescue_station"
)
@ApiModel
(
value
=
"RescueStationDto"
,
description
=
"RescueStationDto"
)
@ApiModel
(
value
=
"RescueStationDto"
,
description
=
"RescueStationDto"
)
public
class
RescueStationDto
extends
Base
Entity
{
public
class
RescueStationDto
extends
Base
Dto
{
private
static
final
long
serialVersionUID
=
1L
;
private
static
final
long
serialVersionUID
=
1L
;
...
...
amos-boot-module/amos-boot-module-api/amos-boot-module-tzs-api/src/main/java/com/yeejoin/amos/boot/module/tzs/api/dto/UseUnitDto.java
View file @
95c720d3
package
com
.
yeejoin
.
amos
.
boot
.
module
.
tzs
.
api
.
dto
;
package
com
.
yeejoin
.
amos
.
boot
.
module
.
tzs
.
api
.
dto
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
com.yeejoin.amos.boot.biz.common.
entity.BaseEntity
;
import
com.yeejoin.amos.boot.biz.common.
dto.BaseDto
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.Data
;
...
@@ -17,7 +17,7 @@ import lombok.experimental.Accessors;
...
@@ -17,7 +17,7 @@ import lombok.experimental.Accessors;
@Accessors
(
chain
=
true
)
@Accessors
(
chain
=
true
)
@TableName
(
"tcb_use_unit"
)
@TableName
(
"tcb_use_unit"
)
@ApiModel
(
value
=
"UseUnitDto"
,
description
=
"UseUnitDto"
)
@ApiModel
(
value
=
"UseUnitDto"
,
description
=
"UseUnitDto"
)
public
class
UseUnitDto
extends
Base
Entity
{
public
class
UseUnitDto
extends
Base
Dto
{
private
static
final
long
serialVersionUID
=
1L
;
private
static
final
long
serialVersionUID
=
1L
;
...
...
amos-boot-module/amos-boot-module-api/amos-boot-module-tzs-api/src/main/java/com/yeejoin/amos/boot/module/tzs/api/entity/AlertCalled.java
View file @
95c720d3
...
@@ -3,9 +3,11 @@ package com.yeejoin.amos.boot.module.tzs.api.entity;
...
@@ -3,9 +3,11 @@ package com.yeejoin.amos.boot.module.tzs.api.entity;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
com.yeejoin.amos.boot.biz.common.entity.BaseEntity
;
import
com.yeejoin.amos.boot.biz.common.entity.BaseEntity
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
lombok.EqualsAndHashCode
;
import
lombok.experimental.Accessors
;
import
lombok.experimental.Accessors
;
import
java.util.Date
;
import
java.util.Date
;
/**
/**
...
@@ -35,6 +37,12 @@ public class AlertCalled extends BaseEntity {
...
@@ -35,6 +37,12 @@ public class AlertCalled extends BaseEntity {
private
String
alertSource
;
private
String
alertSource
;
/**
/**
* 警情来源类型Code
*/
@TableField
(
"alert_source_code"
)
private
String
alertSourceCode
;
/**
* 接警时间
* 接警时间
*/
*/
@TableField
(
"call_time"
)
@TableField
(
"call_time"
)
...
@@ -154,4 +162,26 @@ public class AlertCalled extends BaseEntity {
...
@@ -154,4 +162,26 @@ public class AlertCalled extends BaseEntity {
@TableField
(
"org_code"
)
@TableField
(
"org_code"
)
private
String
orgCode
;
private
String
orgCode
;
@TableField
(
exist
=
false
)
@ApiModelProperty
(
value
=
"使用单位"
)
private
String
useUnit
;
@TableField
(
exist
=
false
)
@ApiModelProperty
(
value
=
"地址"
)
private
String
address
;
@ApiModelProperty
(
value
=
"接警时间开始---用于列表过滤"
)
@TableField
(
exist
=
false
)
private
Date
callTimeStart
;
@ApiModelProperty
(
value
=
"接警时间结束---用于列表过滤"
)
@TableField
(
exist
=
false
)
private
Date
callTimeEnd
;
@TableField
(
exist
=
false
)
@ApiModelProperty
(
value
=
"是否处警"
)
private
Boolean
isFatherAlert
=
false
;
}
}
amos-boot-module/amos-boot-module-api/amos-boot-module-tzs-api/src/main/java/com/yeejoin/amos/boot/module/tzs/api/entity/ESAlertCalled.java
0 → 100644
View file @
95c720d3
package
com
.
yeejoin
.
amos
.
boot
.
module
.
tzs
.
api
.
entity
;
import
lombok.Data
;
import
lombok.experimental.Accessors
;
import
org.springframework.data.annotation.Id
;
import
org.springframework.data.elasticsearch.annotations.DateFormat
;
import
org.springframework.data.elasticsearch.annotations.Document
;
import
org.springframework.data.elasticsearch.annotations.Field
;
import
org.springframework.data.elasticsearch.annotations.FieldType
;
import
java.util.Date
;
/**
*
* <pre>
* 警情信息ES实体
* </pre>
*
* @author litw
* @date 2021-08-04
*/
@Data
@Accessors
(
chain
=
true
)
@Document
(
indexName
=
"tzs"
,
type
=
"alertCalled"
,
shards
=
1
,
replicas
=
0
)
public
class
ESAlertCalled
{
/** 主键 */
@Id
private
Long
sequenceNbr
;
/**
* 警情状态
*/
@Field
(
type
=
FieldType
.
Boolean
,
index
=
false
)
private
Boolean
alertStatus
;
/**
* 警情状态
*/
@Field
(
type
=
FieldType
.
Text
)
private
String
alertStatusStr
;
/**
* 警情阶段
*/
@Field
(
type
=
FieldType
.
Text
,
index
=
false
)
private
String
alertStage
;
/**
* 联系人姓名
*/
@Field
(
type
=
FieldType
.
Text
)
private
String
contactUser
;
/**
* 联系人电话
*/
@Field
(
type
=
FieldType
.
Text
)
private
String
contactPhone
;
/**
* 接警时间
*/
@Field
(
type
=
FieldType
.
Date
,
format
=
DateFormat
.
basic_date_time
,
index
=
false
)
private
Date
callTime
;
/**
* 接警时间
*/
@Field
(
type
=
FieldType
.
Long
)
private
Long
callTimeLong
;
/**
* 警情类型
*/
@Field
(
type
=
FieldType
.
Text
,
index
=
false
)
private
String
alarmType
;
/**
* 警情类型Code
*/
@Field
(
type
=
FieldType
.
Text
)
private
String
alarmTypeCode
;
/**
* 使用单位
*/
@Field
(
type
=
FieldType
.
Text
,
searchAnalyzer
=
"ik_max_word"
,
analyzer
=
"ik_max_word"
)
private
String
useUnit
;
/**
* 地址
*/
@Field
(
type
=
FieldType
.
Text
,
searchAnalyzer
=
"ik_max_word"
,
analyzer
=
"ik_max_word"
)
private
String
address
;
/**
* 电梯识别码
*/
@Field
(
type
=
FieldType
.
Text
,
searchAnalyzer
=
"ik_max_word"
,
analyzer
=
"ik_max_word"
)
private
String
deviceId
;
/**
* 求援人电话
*/
@Field
(
type
=
FieldType
.
Text
)
private
String
emergencyCall
;
}
amos-boot-module/amos-boot-module-api/amos-boot-module-tzs-api/src/main/java/com/yeejoin/amos/boot/module/tzs/api/enums/AlertStageEnums.java
View file @
95c720d3
...
@@ -22,7 +22,7 @@ public enum AlertStageEnums {
...
@@ -22,7 +22,7 @@ public enum AlertStageEnums {
DHBJ
(
"233"
,
"电话报警"
),
DHBJ
(
"233"
,
"电话报警"
),
// 警情阶段
// 警情阶段
JJ
(
"
240
"
,
"接警"
),
JJ
(
"
JJQK-247
"
,
"接警"
),
PQ
(
"241"
,
"派遣"
),
PQ
(
"241"
,
"派遣"
),
DD
(
"242"
,
"抵达"
),
DD
(
"242"
,
"抵达"
),
HF
(
"243"
,
"回访"
),
HF
(
"243"
,
"回访"
),
...
...
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 @
95c720d3
package
com
.
yeejoin
.
amos
.
boot
.
module
.
command
.
biz
.
controller
;
package
com
.
yeejoin
.
amos
.
boot
.
module
.
command
.
biz
.
controller
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
...
@@ -108,10 +109,13 @@ public class CommandController extends BaseController {
...
@@ -108,10 +109,13 @@ public class CommandController extends BaseController {
private
String
readUrl
;
private
String
readUrl
;
@Autowired
@Autowired
EquipFeignClient
equipFeignClient
;
EquipFeignClient
equipFeignClient
;
@Autowired
IKeySiteService
keySiteService
;
@Autowired
@Autowired
IPowerTransferCompanyService
powerTransferCompanyService
;
IPowerTransferCompanyService
powerTransferCompanyService
;
@Autowired
ISourceFileService
sourceFileService
;
@Value
(
"${video.url}"
)
@Value
(
"${video.url}"
)
private
String
videoUrl
;
private
String
videoUrl
;
...
@@ -691,7 +695,10 @@ public class CommandController extends BaseController {
...
@@ -691,7 +695,10 @@ public class CommandController extends BaseController {
if
(
AlertCalled
.
getUnitInvolved
()!=
null
&&!
""
.
equals
(
AlertCalled
.
getUnitInvolved
()))
{
if
(
AlertCalled
.
getUnitInvolved
()!=
null
&&!
""
.
equals
(
AlertCalled
.
getUnitInvolved
()))
{
List
<
OrgUsrzhDto
>
orgUsrzhDto
=
iOrgUsrService
.
getOrgUsrzhDto
(
AlertCalled
.
getUnitInvolved
());
List
<
OrgUsrzhDto
>
orgUsrzhDto
=
iOrgUsrService
.
getOrgUsrzhDto
(
AlertCalled
.
getUnitInvolved
());
orgusrDataxDto
.
setOrgUsrzhDto
(
orgUsrzhDto
!=
null
&&
orgUsrzhDto
.
size
()>
0
?
orgUsrzhDto
.
get
(
0
):
null
);
orgusrDataxDto
.
setOrgUsrzhDto
(
orgUsrzhDto
!=
null
&&
orgUsrzhDto
.
size
()>
0
?
orgUsrzhDto
.
get
(
0
):
null
);
buildId
=
orgUsrzhDto
!=
null
&&
orgUsrzhDto
.
size
()>
0
?
orgUsrzhDto
.
get
(
0
).
getBuildId
():
null
;
// buildId=orgUsrzhDto!=null&&orgUsrzhDto.size()>0?orgUsrzhDto.get(0).getBuildId():null;
if
(
orgUsrzhDto
!=
null
&&
orgUsrzhDto
.
size
()>
0
&&
orgUsrzhDto
.
get
(
0
)!=
null
){
buildId
=
orgUsrzhDto
.
get
(
0
).
getBuildId
()==
null
?
null
:
orgUsrzhDto
.
get
(
0
).
getBuildId
();
}
}
}
//现场照片 待完成,
//现场照片 待完成,
...
@@ -720,7 +727,6 @@ public class CommandController extends BaseController {
...
@@ -720,7 +727,6 @@ public class CommandController extends BaseController {
@GetMapping
(
value
=
"/AlertCalledcountTime"
)
@GetMapping
(
value
=
"/AlertCalledcountTime"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"执勤动态警情信息统计"
,
notes
=
"执勤动态警情信息统计"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"执勤动态警情信息统计"
,
notes
=
"执勤动态警情信息统计"
)
public
ResponseModel
<
Object
>
AlertCalledcountTime
()
{
public
ResponseModel
<
Object
>
AlertCalledcountTime
()
{
List
<
KeyValueLabel
>
listdate
=
new
ArrayList
<>();
List
<
KeyValueLabel
>
listdate
=
new
ArrayList
<>();
listdate
.
add
(
new
KeyValueLabel
(
"今年警情数量"
,
""
,
iAlertCalledService
.
AlertCalledcountTime
(
1
)));
listdate
.
add
(
new
KeyValueLabel
(
"今年警情数量"
,
""
,
iAlertCalledService
.
AlertCalledcountTime
(
1
)));
listdate
.
add
(
new
KeyValueLabel
(
"当月警情数量"
,
""
,
iAlertCalledService
.
AlertCalledcountTime
(
2
)));
listdate
.
add
(
new
KeyValueLabel
(
"当月警情数量"
,
""
,
iAlertCalledService
.
AlertCalledcountTime
(
2
)));
...
@@ -734,7 +740,6 @@ public class CommandController extends BaseController {
...
@@ -734,7 +740,6 @@ public class CommandController extends BaseController {
@GetMapping
(
value
=
"/getTodayPowerTransferCompany"
)
@GetMapping
(
value
=
"/getTodayPowerTransferCompany"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"当天力量调派"
,
notes
=
"当天力量调派"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"当天力量调派"
,
notes
=
"当天力量调派"
)
public
ResponseModel
<
Object
>
getTodayPowerTransferCompany
()
{
public
ResponseModel
<
Object
>
getTodayPowerTransferCompany
()
{
return
ResponseHelper
.
buildResponse
(
powerTransferCompanyService
.
getTodayPowerTransferCompany
());
return
ResponseHelper
.
buildResponse
(
powerTransferCompanyService
.
getTodayPowerTransferCompany
());
}
}
...
@@ -742,7 +747,6 @@ public class CommandController extends BaseController {
...
@@ -742,7 +747,6 @@ public class CommandController extends BaseController {
@GetMapping
(
value
=
"/getTodayAlertCalled"
)
@GetMapping
(
value
=
"/getTodayAlertCalled"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"当天接警记录"
,
notes
=
"当天接警记录"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"当天接警记录"
,
notes
=
"当天接警记录"
)
public
ResponseModel
<
Object
>
getTodayAlertCalled
()
{
public
ResponseModel
<
Object
>
getTodayAlertCalled
()
{
return
ResponseHelper
.
buildResponse
(
iAlertCalledService
.
getTodayAlertCalled
());
return
ResponseHelper
.
buildResponse
(
iAlertCalledService
.
getTodayAlertCalled
());
}
}
...
@@ -750,7 +754,6 @@ public class CommandController extends BaseController {
...
@@ -750,7 +754,6 @@ public class CommandController extends BaseController {
@GetMapping
(
value
=
"/getFireTeamCountList"
)
@GetMapping
(
value
=
"/getFireTeamCountList"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"执勤力量"
,
notes
=
"执勤力量"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"执勤力量"
,
notes
=
"执勤力量"
)
public
ResponseModel
<
Object
>
getFireTeamCountList
()
{
public
ResponseModel
<
Object
>
getFireTeamCountList
()
{
return
ResponseHelper
.
buildResponse
(
iFireTeamService
.
getFireTeamCountList
());
return
ResponseHelper
.
buildResponse
(
iFireTeamService
.
getFireTeamCountList
());
}
}
...
@@ -771,9 +774,7 @@ public class CommandController extends BaseController {
...
@@ -771,9 +774,7 @@ public class CommandController extends BaseController {
@RequestMapping
(
value
=
"/findDutyCarStateBy"
,
method
=
RequestMethod
.
GET
)
@RequestMapping
(
value
=
"/findDutyCarStateBy"
,
method
=
RequestMethod
.
GET
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"当日气象预警"
,
notes
=
"当日气象预警"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"当日气象预警"
,
notes
=
"当日气象预警"
)
public
ResponseModel
<
Object
>
findDutyCarStateBy
()
throws
Exception
{
public
ResponseModel
<
Object
>
findDutyCarStateBy
()
throws
Exception
{
List
<
SeismometeorologyDto
>
li
=
seismometeorologyDtoDao
.
findDutyCarStateBy
();
List
<
SeismometeorologyDto
>
li
=
seismometeorologyDtoDao
.
findDutyCarStateBy
();
return
ResponseHelper
.
buildResponse
(
li
);
return
ResponseHelper
.
buildResponse
(
li
);
}
}
...
@@ -785,9 +786,7 @@ public class CommandController extends BaseController {
...
@@ -785,9 +786,7 @@ public class CommandController extends BaseController {
@GetMapping
(
value
=
"fireCar/list"
)
@GetMapping
(
value
=
"fireCar/list"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"车辆资源"
,
notes
=
"车辆资源"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"车辆资源"
,
notes
=
"车辆资源"
)
public
ResponseModel
<
List
<
Map
<
String
,
Object
>>>
getTeamCarList
(
RequestData
par
)
{
public
ResponseModel
<
List
<
Map
<
String
,
Object
>>>
getTeamCarList
(
RequestData
par
)
{
ResponseModel
<
List
<
Map
<
String
,
Object
>>>
date
=
equipFeignClient
.
getTeamCarList
(
par
.
getLongitude
(),
par
.
getLatitude
());
ResponseModel
<
List
<
Map
<
String
,
Object
>>>
date
=
equipFeignClient
.
getTeamCarList
(
par
.
getLongitude
(),
par
.
getLatitude
());
return
ResponseHelper
.
buildResponse
(
date
!=
null
?
date
.
getResult
():
null
);
return
ResponseHelper
.
buildResponse
(
date
!=
null
?
date
.
getResult
():
null
);
}
}
...
@@ -823,6 +822,46 @@ public class CommandController extends BaseController {
...
@@ -823,6 +822,46 @@ public class CommandController extends BaseController {
}
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"根据灾情id建筑部位树"
,
notes
=
"根据灾情id建筑部位树"
)
@GetMapping
(
value
=
"/getBuildTree/{id}"
)
public
ResponseModel
<
List
<
OrgMenuDto
>>
getBuildTree
(
@PathVariable
Long
id
)
throws
Exception
{
AlertCalled
AlertCalled
=
iAlertCalledService
.
getAlertCalledById
(
id
);
Long
buildId
=
null
;
OrgusrDataxDto
orgusrDataxDto
=
new
OrgusrDataxDto
();
if
(
AlertCalled
.
getUnitInvolved
()!=
null
&&!
""
.
equals
(
AlertCalled
.
getUnitInvolved
()))
{
List
<
OrgUsrzhDto
>
orgUsrzhDto
=
iOrgUsrService
.
getOrgUsrzhDto
(
AlertCalled
.
getUnitInvolved
());
if
(
orgUsrzhDto
!=
null
&&
orgUsrzhDto
.
size
()>
0
&&
orgUsrzhDto
.
get
(
0
)!=
null
){
buildId
=
orgUsrzhDto
.
get
(
0
).
getBuildId
()==
null
?
null
:
Long
.
valueOf
(
orgUsrzhDto
.
get
(
0
).
getBuildId
());
}
}
return
ResponseHelper
.
buildResponse
(
buildId
==
null
?
null
:
keySiteService
.
getBuildAndKeyTree
(
buildId
));
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"根据重点部位id查询详情"
,
notes
=
"根据重点部位id查询详情"
)
@GetMapping
(
value
=
"/getkeySite/{sequenceNbr}"
)
public
ResponseModel
<
KeySiteDto
>
getkeySite
(
@PathVariable
Long
sequenceNbr
)
{
Map
<
String
,
List
<
AttachmentDto
>>
files
=
sourceFileService
.
getAttachments
(
sequenceNbr
);
KeySiteDto
dto
=
keySiteService
.
getSequenceNbr
(
sequenceNbr
);
List
<
String
>
list
=
new
ArrayList
<
String
>();
if
(
files
!=
null
&&
dto
!=
null
)
{
if
(
files
!=
null
&&
dto
!=
null
)
{
dto
.
setAttachments
(
files
);
JSONArray
array
=
JSONArray
.
parseArray
(
JSONArray
.
toJSONString
(
files
.
get
(
"keySitePhoto"
)));
if
(
array
!=
null
&&
array
.
size
()>
0
)
{
for
(
Object
i
:
array
)
{
JSONObject
object
=
JSONObject
.
parseObject
(
JSONObject
.
toJSONString
(
i
));
list
.
add
(
object
.
getString
(
"url"
));
}
}
}
dto
.
setAttachmentsList
(
list
);
}
return
ResponseHelper
.
buildResponse
(
dto
);
}
}
}
\ No newline at end of file
amos-boot-module/amos-boot-module-biz/amos-boot-module-common-biz/src/main/java/com/yeejoin/amos/boot/module/common/biz/controller/KeySiteController.java
View file @
95c720d3
...
@@ -21,6 +21,8 @@ import org.typroject.tyboot.core.restful.doc.TycloudOperation;
...
@@ -21,6 +21,8 @@ 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
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.boot.biz.common.controller.BaseController
;
import
com.yeejoin.amos.boot.biz.common.controller.BaseController
;
...
@@ -107,11 +109,20 @@ public class KeySiteController extends BaseController {
...
@@ -107,11 +109,20 @@ public class KeySiteController extends BaseController {
@GetMapping
(
value
=
"find/{sequenceNbr}"
)
@GetMapping
(
value
=
"find/{sequenceNbr}"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"根据sequenceNbr查询单个重点部位"
,
notes
=
"根据sequenceNbr查询单个重点部位"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"根据sequenceNbr查询单个重点部位"
,
notes
=
"根据sequenceNbr查询单个重点部位"
)
public
ResponseModel
<
KeySiteDto
>
selectOne
(
@PathVariable
Long
sequenceNbr
)
{
public
ResponseModel
<
KeySiteDto
>
selectOne
(
@PathVariable
Long
sequenceNbr
)
{
List
<
String
>
list
=
new
ArrayList
<
String
>();
Map
<
String
,
List
<
AttachmentDto
>>
files
=
sourceFileService
.
getAttachments
(
sequenceNbr
);
Map
<
String
,
List
<
AttachmentDto
>>
files
=
sourceFileService
.
getAttachments
(
sequenceNbr
);
KeySiteDto
dto
=
keySiteService
.
getSequenceNbr
(
sequenceNbr
);
KeySiteDto
dto
=
keySiteService
.
getSequenceNbr
(
sequenceNbr
);
if
(
files
!=
null
&&
dto
!=
null
)
{
if
(
files
!=
null
&&
dto
!=
null
)
{
dto
.
setAttachments
(
files
);
dto
.
setAttachments
(
files
);
JSONArray
array
=
JSONArray
.
parseArray
(
JSONArray
.
toJSONString
(
files
.
get
(
"keySitePhoto"
)));
if
(
array
!=
null
&&
array
.
size
()>
0
)
{
for
(
Object
i
:
array
)
{
JSONObject
object
=
JSONObject
.
parseObject
(
JSONObject
.
toJSONString
(
i
));
list
.
add
(
object
.
getString
(
"url"
));
}
}
}
}
dto
.
setAttachmentsList
(
list
);
return
ResponseHelper
.
buildResponse
(
dto
);
return
ResponseHelper
.
buildResponse
(
dto
);
}
}
...
@@ -123,7 +134,7 @@ public class KeySiteController extends BaseController {
...
@@ -123,7 +134,7 @@ public class KeySiteController extends BaseController {
* @return
* @return
*/
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@
Pos
tMapping
(
value
=
"/page"
)
@
Ge
tMapping
(
value
=
"/page"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"重点部位分页查询"
,
notes
=
"重点部位分页查询"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"重点部位分页查询"
,
notes
=
"重点部位分页查询"
)
public
ResponseModel
<
IPage
<
KeySiteDto
>>
queryForPage
(
@RequestParam
(
value
=
"current"
)
int
current
,
@RequestParam
public
ResponseModel
<
IPage
<
KeySiteDto
>>
queryForPage
(
@RequestParam
(
value
=
"current"
)
int
current
,
@RequestParam
(
value
=
"size"
)
int
size
,
@RequestParam
(
required
=
false
)
String
name
,
@RequestParam
(
required
=
false
)
Long
buildingId
,
@RequestParam
(
required
=
false
)
String
fireEnduranceRate
,
(
value
=
"size"
)
int
size
,
@RequestParam
(
required
=
false
)
String
name
,
@RequestParam
(
required
=
false
)
Long
buildingId
,
@RequestParam
(
required
=
false
)
String
fireEnduranceRate
,
...
@@ -149,19 +160,21 @@ public class KeySiteController extends BaseController {
...
@@ -149,19 +160,21 @@ public class KeySiteController extends BaseController {
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"机场单位部位树"
,
notes
=
"机场单位部位树"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"机场单位部位树"
,
notes
=
"机场单位部位树"
)
@GetMapping
(
value
=
"/getOrguserTree"
)
@GetMapping
(
value
=
"/getOrguserTree"
)
public
ResponseModel
<
List
<
OrgMenuDto
>>
getOrguserTree
()
throws
Exception
{
public
ResponseModel
<
List
<
OrgMenuDto
>>
getOrguserTree
()
{
List
<
OrgMenuDto
>
list
=
new
ArrayList
<
OrgMenuDto
>();
List
<
OrgMenuDto
>
list
=
new
ArrayList
<
OrgMenuDto
>();
OrgMenuDto
orgMenuDto
=
new
OrgMenuDto
();
OrgMenuDto
orgMenuDto
=
new
OrgMenuDto
();
orgMenuDto
.
setChildren
(
keySiteService
.
getOrguserTree
());
orgMenuDto
.
setChildren
(
keySiteService
.
getOrguserTree
());
orgMenuDto
.
setName
(
"单位管理"
);
orgMenuDto
.
setName
(
"单位管理"
);
orgMenuDto
.
setKey
(-
1L
);
orgMenuDto
.
setTitle
(
"单位管理"
);
orgMenuDto
.
setTitle
(
"单位管理"
);
list
.
add
(
orgMenuDto
);
list
.
add
(
orgMenuDto
);
return
ResponseHelper
.
buildResponse
(
list
);
return
ResponseHelper
.
buildResponse
(
list
);
}
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"建筑部位树"
,
notes
=
"建筑部位树"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"建筑部位树"
,
notes
=
"建筑部位树"
)
@GetMapping
(
value
=
"/getBuildTree/{buildingId}"
)
@GetMapping
(
value
=
"/getBuildTree/{buildingId}"
)
public
ResponseModel
<
List
<
OrgMenuDto
>>
getBuildTree
(
@PathVariable
Long
buildingId
)
throws
Exception
{
public
ResponseModel
<
List
<
OrgMenuDto
>>
getBuildTree
(
@PathVariable
Long
buildingId
)
{
return
ResponseHelper
.
buildResponse
(
keySiteService
.
getBuildAndKeyTree
(
buildingId
));
return
ResponseHelper
.
buildResponse
(
keySiteService
.
getBuildAndKeyTree
(
buildingId
));
}
}
}
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-common-biz/src/main/java/com/yeejoin/amos/boot/module/common/biz/controller/WaterResourceController.java
View file @
95c720d3
package
com
.
yeejoin
.
amos
.
boot
.
module
.
common
.
biz
.
controller
;
package
com
.
yeejoin
.
amos
.
boot
.
module
.
common
.
biz
.
controller
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
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
;
...
@@ -88,6 +90,22 @@ public class WaterResourceController extends BaseController {
...
@@ -88,6 +90,22 @@ public class WaterResourceController extends BaseController {
model
.
setResourceTypeName
(
resourceTypeEnum
.
get
().
getName
());
model
.
setResourceTypeName
(
resourceTypeEnum
.
get
().
getName
());
model
.
setRealityImg
(
JSONArray
.
toJSONString
(
model
.
getRealityImgList
()));
model
.
setRealityImg
(
JSONArray
.
toJSONString
(
model
.
getRealityImgList
()));
model
.
setOrientationImg
(
JSONArray
.
toJSONString
(
model
.
getOrientationImgList
()));
model
.
setOrientationImg
(
JSONArray
.
toJSONString
(
model
.
getOrientationImgList
()));
if
(
model
.
getAddress
()!=
null
){
String
[]
data
=
model
.
getAddress
().
split
(
"@address@"
);
model
.
setAddress
(
data
[
0
]);
if
(
data
[
1
]!=
null
&&!
""
.
equals
(
data
[
1
])){
JSONObject
jSONObject
=
JSON
.
parseObject
(
data
[
1
]);
if
(
jSONObject
.
getString
(
"longitude"
)!=
null
&&!
""
.
equals
(
jSONObject
.
getString
(
"longitude"
)))
{
model
.
setLongitude
(
Double
.
valueOf
(
jSONObject
.
getString
(
"longitude"
)));
}
if
(
jSONObject
.
getString
(
"longitude"
)!=
null
&&!
""
.
equals
(
jSONObject
.
getString
(
"longitude"
)))
{
model
.
setLatitude
(
Double
.
valueOf
(
jSONObject
.
getString
(
"latitude"
)));
}
}
}
if
(!
StringUtils
.
isEmpty
(
resourceType
))
{
if
(!
StringUtils
.
isEmpty
(
resourceType
))
{
switch
(
resourceType
)
{
switch
(
resourceType
)
{
case
"hydrant"
:
case
"hydrant"
:
...
@@ -156,6 +174,21 @@ public class WaterResourceController extends BaseController {
...
@@ -156,6 +174,21 @@ public class WaterResourceController extends BaseController {
@ApiOperation
(
httpMethod
=
"PUT"
,
value
=
"根据sequenceNbr更新"
,
notes
=
"根据sequenceNbr更新"
)
@ApiOperation
(
httpMethod
=
"PUT"
,
value
=
"根据sequenceNbr更新"
,
notes
=
"根据sequenceNbr更新"
)
public
ResponseModel
<
WaterResourceDto
>
updateBySequenceNbrWaterResource
(
@RequestBody
WaterResourceDto
model
,
public
ResponseModel
<
WaterResourceDto
>
updateBySequenceNbrWaterResource
(
@RequestBody
WaterResourceDto
model
,
@PathVariable
(
value
=
"sequenceNbr"
)
Long
sequenceNbr
)
{
@PathVariable
(
value
=
"sequenceNbr"
)
Long
sequenceNbr
)
{
if
(
model
.
getAddress
()!=
null
){
String
[]
data
=
model
.
getAddress
().
split
(
"@address@"
);
model
.
setAddress
(
data
[
0
]);
if
(
data
[
1
]!=
null
&&!
""
.
equals
(
data
[
1
])){
JSONObject
jSONObject
=
JSON
.
parseObject
(
data
[
1
]);
if
(
jSONObject
.
getString
(
"longitude"
)!=
null
&&!
""
.
equals
(
jSONObject
.
getString
(
"longitude"
)))
{
model
.
setLongitude
(
Double
.
valueOf
(
jSONObject
.
getString
(
"longitude"
)));
}
if
(
jSONObject
.
getString
(
"longitude"
)!=
null
&&!
""
.
equals
(
jSONObject
.
getString
(
"longitude"
)))
{
model
.
setLatitude
(
Double
.
valueOf
(
jSONObject
.
getString
(
"latitude"
)));
}
}
}
// 更新基本信息
// 更新基本信息
model
.
setSequenceNbr
(
sequenceNbr
);
model
.
setSequenceNbr
(
sequenceNbr
);
model
.
setRealityImg
(
JSONArray
.
toJSONString
(
model
.
getRealityImgList
()));
model
.
setRealityImg
(
JSONArray
.
toJSONString
(
model
.
getRealityImgList
()));
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-common-biz/src/main/java/com/yeejoin/amos/boot/module/common/biz/service/impl/KeySiteServiceImpl.java
View file @
95c720d3
...
@@ -10,6 +10,7 @@ import java.util.stream.Collectors;
...
@@ -10,6 +10,7 @@ import java.util.stream.Collectors;
import
org.apache.commons.lang3.ObjectUtils
;
import
org.apache.commons.lang3.ObjectUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.velocity.runtime.directive.Foreach
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.annotation.Transactional
;
...
@@ -20,6 +21,7 @@ import org.typroject.tyboot.core.restful.utils.ResponseModel;
...
@@ -20,6 +21,7 @@ import org.typroject.tyboot.core.restful.utils.ResponseModel;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.core.toolkit.Sequence
;
import
com.baomidou.mybatisplus.core.toolkit.Sequence
;
...
@@ -189,7 +191,7 @@ public class KeySiteServiceImpl extends BaseService<KeySiteDto, KeySite, KeySite
...
@@ -189,7 +191,7 @@ public class KeySiteServiceImpl extends BaseService<KeySiteDto, KeySite, KeySite
public
List
<
OrgMenuDto
>
getOrguserTree
()
{
public
List
<
OrgMenuDto
>
getOrguserTree
()
{
List
<
OrgUsrTreeDto
>
list
=
orgUsrMapper
.
getCompanyAndCountDepartment
();
List
<
OrgUsrTreeDto
>
list
=
orgUsrMapper
.
getCompanyAndCountDepartment
();
List
<
OrgMenuDto
>
menuList
=
list
.
stream
().
map
(
o
->
{
List
<
OrgMenuDto
>
menuList
=
list
.
stream
().
map
(
o
->
{
OrgMenuDto
menu
=
new
OrgMenuDto
(
o
.
getSequenceNbr
(),
o
.
getBizOrgName
()+
"
"
+
o
.
getNum
()
,
OrgMenuDto
menu
=
new
OrgMenuDto
(
o
.
getSequenceNbr
(),
o
.
getBizOrgName
()+
"
("
+
o
.
getNum
()
+
")"
,
ObjectUtils
.
isEmpty
(
o
.
getParentId
())
?
0L
:
Long
.
valueOf
(
o
.
getParentId
()),
o
.
getBizOrgType
(),
false
,
ObjectUtils
.
isEmpty
(
o
.
getParentId
())
?
0L
:
Long
.
valueOf
(
o
.
getParentId
()),
o
.
getBizOrgType
(),
false
,
o
.
getBizOrgCode
());
o
.
getBizOrgCode
());
return
menu
;
return
menu
;
...
@@ -250,6 +252,7 @@ public class KeySiteServiceImpl extends BaseService<KeySiteDto, KeySite, KeySite
...
@@ -250,6 +252,7 @@ public class KeySiteServiceImpl extends BaseService<KeySiteDto, KeySite, KeySite
if
(
fireEnduranceRateArray
.
length
>
1
)
{
if
(
fireEnduranceRateArray
.
length
>
1
)
{
keySiteDto
.
setFireEnduranceRate
(
fireEnduranceRateArray
[
1
]);
keySiteDto
.
setFireEnduranceRate
(
fireEnduranceRateArray
[
1
]);
}
}
keySiteDto
.
setFireEnduranceRateName
(
fireEnduranceRateArray
[
0
]);
}
}
if
(
StringUtils
.
isNotBlank
(
keySiteExcleDto
.
getUseNature
())
if
(
StringUtils
.
isNotBlank
(
keySiteExcleDto
.
getUseNature
())
&&
keySiteExcleDto
.
getUseNature
().
contains
(
"@"
))
{
&&
keySiteExcleDto
.
getUseNature
().
contains
(
"@"
))
{
...
@@ -257,6 +260,7 @@ public class KeySiteServiceImpl extends BaseService<KeySiteDto, KeySite, KeySite
...
@@ -257,6 +260,7 @@ public class KeySiteServiceImpl extends BaseService<KeySiteDto, KeySite, KeySite
if
(
useNatureArray
.
length
>
1
)
{
if
(
useNatureArray
.
length
>
1
)
{
keySiteDto
.
setUseNature
(
useNatureArray
[
1
]);
keySiteDto
.
setUseNature
(
useNatureArray
[
1
]);
}
}
keySiteDto
.
setUseNatureName
(
useNatureArray
[
0
]);
}
}
if
(
keySiteExcleDto
.
getFirePreventionFlagName
().
equals
(
"有"
))
{
if
(
keySiteExcleDto
.
getFirePreventionFlagName
().
equals
(
"有"
))
{
keySiteDto
.
setFirePreventionFlag
(
true
);
keySiteDto
.
setFirePreventionFlag
(
true
);
...
@@ -286,6 +290,8 @@ public class KeySiteServiceImpl extends BaseService<KeySiteDto, KeySite, KeySite
...
@@ -286,6 +290,8 @@ public class KeySiteServiceImpl extends BaseService<KeySiteDto, KeySite, KeySite
}).
collect
(
Collectors
.
toList
());
}).
collect
(
Collectors
.
toList
());
List
<
OrgMenuDto
>
list1
=
new
ArrayList
<
OrgMenuDto
>();
List
<
OrgMenuDto
>
list1
=
new
ArrayList
<
OrgMenuDto
>();
OrgMenuDto
orgMenuDto
=
new
OrgMenuDto
();
OrgMenuDto
orgMenuDto
=
new
OrgMenuDto
();
orgMenuDto
.
setKey
(
sequenceNbr
);
orgMenuDto
.
setValue
(
sequenceNbr
);
orgMenuDto
.
setChildren
(
buildTreeParallel
(
menuList
));
orgMenuDto
.
setChildren
(
buildTreeParallel
(
menuList
));
orgMenuDto
.
setName
(
buildNameString
);
orgMenuDto
.
setName
(
buildNameString
);
orgMenuDto
.
setTitle
(
buildNameString
);
orgMenuDto
.
setTitle
(
buildNameString
);
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-common-biz/src/main/java/com/yeejoin/amos/boot/module/common/biz/service/impl/LinkageUnitServiceImpl.java
View file @
95c720d3
package
com
.
yeejoin
.
amos
.
boot
.
module
.
common
.
biz
.
service
.
impl
;
package
com
.
yeejoin
.
amos
.
boot
.
module
.
common
.
biz
.
service
.
impl
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.google.common.collect.Lists
;
import
com.google.common.collect.Lists
;
...
@@ -81,6 +83,22 @@ public class LinkageUnitServiceImpl extends BaseService<LinkageUnitDto, LinkageU
...
@@ -81,6 +83,22 @@ public class LinkageUnitServiceImpl extends BaseService<LinkageUnitDto, LinkageU
*/
*/
@Transactional
@Transactional
public
LinkageUnitDto
saveModel
(
LinkageUnitDto
linkageUnitDto
)
{
public
LinkageUnitDto
saveModel
(
LinkageUnitDto
linkageUnitDto
)
{
if
(
linkageUnitDto
.
getAddress
()!=
null
){
String
[]
data
=
linkageUnitDto
.
getAddress
().
split
(
"@address@"
);
linkageUnitDto
.
setAddress
(
data
[
0
]);
if
(
data
[
1
]!=
null
&&!
""
.
equals
(
data
[
1
])){
JSONObject
jSONObject
=
JSON
.
parseObject
(
data
[
1
]);
if
(
jSONObject
.
getString
(
"longitude"
)!=
null
&&!
""
.
equals
(
jSONObject
.
getString
(
"longitude"
)))
{
linkageUnitDto
.
setLongitude
(
Double
.
valueOf
(
jSONObject
.
getString
(
"longitude"
)));
}
if
(
jSONObject
.
getString
(
"longitude"
)!=
null
&&!
""
.
equals
(
jSONObject
.
getString
(
"longitude"
)))
{
linkageUnitDto
.
setLatitude
(
Double
.
valueOf
(
jSONObject
.
getString
(
"latitude"
)));
}
}
}
//1.保存行数据
//1.保存行数据
String
groupCode
=
this
.
getGroupCode
();
String
groupCode
=
this
.
getGroupCode
();
Map
<
String
,
Object
>
map
=
Bean
.
BeantoMap
(
linkageUnitDto
);
Map
<
String
,
Object
>
map
=
Bean
.
BeantoMap
(
linkageUnitDto
);
...
@@ -126,6 +144,20 @@ public class LinkageUnitServiceImpl extends BaseService<LinkageUnitDto, LinkageU
...
@@ -126,6 +144,20 @@ public class LinkageUnitServiceImpl extends BaseService<LinkageUnitDto, LinkageU
@Transactional
@Transactional
public
LinkageUnitDto
updateById
(
LinkageUnitDto
linkageUnitDto
)
{
public
LinkageUnitDto
updateById
(
LinkageUnitDto
linkageUnitDto
)
{
if
(
linkageUnitDto
.
getAddress
()!=
null
){
String
[]
data
=
linkageUnitDto
.
getAddress
().
split
(
"@address@"
);
linkageUnitDto
.
setAddress
(
data
[
0
]);
if
(
data
[
1
]!=
null
&&!
""
.
equals
(
data
[
1
])){
JSONObject
jSONObject
=
JSON
.
parseObject
(
data
[
1
]);
if
(
jSONObject
.
getString
(
"longitude"
)!=
null
&&!
""
.
equals
(
jSONObject
.
getString
(
"longitude"
)))
{
linkageUnitDto
.
setLongitude
(
Double
.
valueOf
(
jSONObject
.
getString
(
"longitude"
)));
}
if
(
jSONObject
.
getString
(
"longitude"
)!=
null
&&!
""
.
equals
(
jSONObject
.
getString
(
"longitude"
)))
{
linkageUnitDto
.
setLatitude
(
Double
.
valueOf
(
jSONObject
.
getString
(
"latitude"
)));
}
}
}
// 修改基本信息
// 修改基本信息
updateWithModel
(
linkageUnitDto
);
updateWithModel
(
linkageUnitDto
);
// 修改行信息
// 修改行信息
...
...
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 @
95c720d3
...
@@ -949,7 +949,8 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
...
@@ -949,7 +949,8 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
@Override
@Override
public
List
<
OrgUsrzhDto
>
getOrgUsrzhDto
(
String
name
)
{
public
List
<
OrgUsrzhDto
>
getOrgUsrzhDto
(
String
name
)
{
// TODO Auto-generated method stub
// TODO Auto-generated method stub
return
orgUsrMapper
.
getOrgUsrzhDto
(
name
);
List
<
OrgUsrzhDto
>
list
=
orgUsrMapper
.
getOrgUsrzhDto
(
name
);
return
list
;
}
}
@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/SourceFileServiceImpl.java
View file @
95c720d3
...
@@ -117,6 +117,7 @@ public class SourceFileServiceImpl extends BaseService<SourceFileDto, SourceFile
...
@@ -117,6 +117,7 @@ public class SourceFileServiceImpl extends BaseService<SourceFileDto, SourceFile
* @param sourceId
* @param sourceId
* @return
* @return
*/
*/
@Override
public
Map
<
String
,
List
<
AttachmentDto
>>
getAttachments
(
Long
sourceId
)
{
public
Map
<
String
,
List
<
AttachmentDto
>>
getAttachments
(
Long
sourceId
)
{
Map
<
String
,
List
<
AttachmentDto
>>
attachmentMap
=
Maps
.
newHashMap
();
Map
<
String
,
List
<
AttachmentDto
>>
attachmentMap
=
Maps
.
newHashMap
();
List
<
SourceFile
>
sourceFileList
=
findBySourceId
(
sourceId
);
List
<
SourceFile
>
sourceFileList
=
findBySourceId
(
sourceId
);
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-jcs-biz/src/main/java/com/yeejoin/amos/boot/module/jcs/biz/controller/AircraftController.java
View file @
95c720d3
...
@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
...
@@ -4,6 +4,7 @@ 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.module.common.api.dto.ExcelDto
;
import
com.yeejoin.amos.boot.module.common.api.dto.ExcelDto
;
import
com.yeejoin.amos.boot.module.common.api.excel.ExcelUtil
;
import
com.yeejoin.amos.boot.module.common.api.excel.ExcelUtil
;
import
com.yeejoin.amos.boot.module.common.api.feign.IotFeignClient
;
import
com.yeejoin.amos.boot.module.jcs.api.dto.AircraftDto
;
import
com.yeejoin.amos.boot.module.jcs.api.dto.AircraftDto
;
import
com.yeejoin.amos.boot.module.jcs.api.dto.AircraftListTreeDto
;
import
com.yeejoin.amos.boot.module.jcs.api.dto.AircraftListTreeDto
;
import
com.yeejoin.amos.boot.module.jcs.api.entity.Aircraft
;
import
com.yeejoin.amos.boot.module.jcs.api.entity.Aircraft
;
...
@@ -48,7 +49,8 @@ public class AircraftController extends BaseController {
...
@@ -48,7 +49,8 @@ public class AircraftController extends BaseController {
private
AircraftServiceImpl
aircraftServiceImpl
;
private
AircraftServiceImpl
aircraftServiceImpl
;
@Autowired
@Autowired
DataSourcesImpl
dataSourcesImpl
;
DataSourcesImpl
dataSourcesImpl
;
@Autowired
IotFeignClient
iotFeignClient
;
/**
/**
* 新增航空器信息
* 新增航空器信息
*
*
...
@@ -159,8 +161,6 @@ public class AircraftController extends BaseController {
...
@@ -159,8 +161,6 @@ public class AircraftController extends BaseController {
@GetMapping
(
value
=
"/getAircraftNum"
)
@GetMapping
(
value
=
"/getAircraftNum"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"获取24小时内的航班号"
,
notes
=
"获取24小时内的航班号"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"获取24小时内的航班号"
,
notes
=
"获取24小时内的航班号"
)
public
ResponseModel
<
List
<
Map
<
String
,
Object
>>>
getAircraftNum
()
{
public
ResponseModel
<
List
<
Map
<
String
,
Object
>>>
getAircraftNum
()
{
List
<
Map
<
String
,
Object
>>
list
=
new
ArrayList
<>();
List
<
Map
<
String
,
Object
>>
list
=
new
ArrayList
<>();
Map
<
String
,
Object
>
map
=
new
HashedMap
();
Map
<
String
,
Object
>
map
=
new
HashedMap
();
Map
<
String
,
Object
>
map1
=
new
HashedMap
();
Map
<
String
,
Object
>
map1
=
new
HashedMap
();
...
@@ -181,12 +181,19 @@ public class AircraftController extends BaseController {
...
@@ -181,12 +181,19 @@ public class AircraftController extends BaseController {
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"通过航班号,查询最新的航班信息"
,
notes
=
"通过航班号,查询最新的航班信息"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"通过航班号,查询最新的航班信息"
,
notes
=
"通过航班号,查询最新的航班信息"
)
public
ResponseModel
<
Map
<
String
,
Object
>>
getAircraftDetails
(
@PathVariable
String
num
)
{
public
ResponseModel
<
Map
<
String
,
Object
>>
getAircraftDetails
(
@PathVariable
String
num
)
{
Map
<
String
,
Object
>
map1
=
new
HashedMap
();
Map
<
String
,
Object
>
map1
=
new
HashedMap
();
map1
.
put
(
"aircraftModel"
,
"型号1"
);
map1
.
put
(
"landingTime"
,
new
Date
());
map1
.
put
(
"fuelQuantity"
,
"12"
);
ResponseModel
<
Map
<
String
,
Object
>>
dataModel
=
iotFeignClient
.
getDynamicFlightInfo
(
num
);
map1
.
put
(
"passengerCapacity"
,
"测试2"
);
if
(
dataModel
!=
null
)
{
Map
<
String
,
Object
>
map
=
dataModel
.
getResult
();
if
(
map
!=
null
)
{
map1
.
put
(
"aircraftModel"
,
map
.
get
(
"aircraftType"
));
map1
.
put
(
"landingTime"
,
map
.
get
(
"sta"
));
// map1.put("fuelQuantity", map.get(""));
map1
.
put
(
"passengerCapacity"
,
map
.
get
(
"psgNumTotal"
));
}
}
return
ResponseHelper
.
buildResponse
(
map1
);
return
ResponseHelper
.
buildResponse
(
map1
);
}
}
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-jcs-biz/src/main/java/com/yeejoin/amos/boot/module/jcs/biz/controller/ExcelController.java
View file @
95c720d3
This diff is collapsed.
Click to expand it.
amos-boot-module/amos-boot-module-biz/amos-boot-module-jcs-biz/src/main/java/com/yeejoin/amos/boot/module/jcs/biz/service/impl/DataSourcesImpl.java
View file @
95c720d3
...
@@ -252,7 +252,9 @@ public class DataSourcesImpl implements DataSources {
...
@@ -252,7 +252,9 @@ public class DataSourcesImpl implements DataSources {
private
void
initBuildTreeList
(
List
<
Object
>
menus
,
List
<
String
>
stringList
)
{
private
void
initBuildTreeList
(
List
<
Object
>
menus
,
List
<
String
>
stringList
)
{
for
(
Object
orgMenuDto
:
menus
)
{
for
(
Object
orgMenuDto
:
menus
)
{
JSONObject
detailObject
=
JSONObject
.
parseObject
(
orgMenuDto
.
toString
());
JSONObject
detailObject
=
JSONObject
.
parseObject
(
orgMenuDto
.
toString
());
stringList
.
add
(
detailObject
.
getString
(
"id"
)
+
"@"
+
detailObject
.
getString
(
"name"
));
if
(
detailObject
.
containsKey
(
"id"
))
{
stringList
.
add
(
detailObject
.
getString
(
"name"
)
+
"@"
+
detailObject
.
getString
(
"id"
));
}
JSONArray
children
=
detailObject
.
getJSONArray
(
"children"
);
JSONArray
children
=
detailObject
.
getJSONArray
(
"children"
);
if
(
children
!=
null
&&
children
.
size
()
>
0
)
{
if
(
children
!=
null
&&
children
.
size
()
>
0
)
{
initBuildTreeList
(
children
,
stringList
);
initBuildTreeList
(
children
,
stringList
);
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-jcs-biz/src/main/java/com/yeejoin/amos/boot/module/jcs/biz/service/impl/ExcelServiceImpl.java
0 → 100644
View file @
95c720d3
This diff is collapsed.
Click to expand it.
amos-boot-module/amos-boot-module-biz/amos-boot-module-tzs-biz/src/main/java/com/yeejoin/amos/boot/module/tzs/biz/controller/AlertCalledController.java
View file @
95c720d3
package
com
.
yeejoin
.
amos
.
boot
.
module
.
tzs
.
biz
.
controller
;
package
com
.
yeejoin
.
amos
.
boot
.
module
.
tzs
.
biz
.
controller
;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
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.bo.ReginParams
;
import
com.yeejoin.amos.boot.biz.common.controller.BaseController
;
import
com.yeejoin.amos.boot.biz.common.controller.BaseController
;
import
com.yeejoin.amos.boot.module.tzs.api.dto.AlertCalledDto
;
import
com.yeejoin.amos.boot.biz.common.utils.NameUtils
;
import
com.yeejoin.amos.boot.biz.common.utils.RedisUtils
;
import
com.yeejoin.amos.boot.module.tzs.api.dto.AlertCalledObjsDto
;
import
com.yeejoin.amos.boot.module.tzs.api.dto.ESAlertCalledDto
;
import
com.yeejoin.amos.boot.module.tzs.api.dto.ESAlertCalledRequestDto
;
import
com.yeejoin.amos.boot.module.tzs.api.entity.AlertCalled
;
import
com.yeejoin.amos.boot.module.tzs.biz.service.impl.AlertCalledServiceImpl
;
import
com.yeejoin.amos.boot.module.tzs.biz.service.impl.AlertCalledServiceImpl
;
import
com.yeejoin.amos.boot.module.tzs.biz.service.impl.ESAlertCalledService
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiOperation
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.DeleteMapping
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.PostMapping
;
...
@@ -16,12 +26,15 @@ import org.springframework.web.bind.annotation.RequestMapping;
...
@@ -16,12 +26,15 @@ import org.springframework.web.bind.annotation.RequestMapping;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.typroject.tyboot.core.foundation.enumeration.UserType
;
import
org.typroject.tyboot.core.foundation.enumeration.UserType
;
import
org.typroject.tyboot.core.foundation.utils.ValidationUtil
;
import
org.typroject.tyboot.core.restful.doc.TycloudOperation
;
import
org.typroject.tyboot.core.restful.doc.TycloudOperation
;
import
org.typroject.tyboot.core.restful.exception.instance.BadRequest
;
import
org.typroject.tyboot.core.restful.utils.ResponseHelper
;
import
org.typroject.tyboot.core.restful.utils.ResponseHelper
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
javax.servlet.http.HttpServletRequest
;
import
java.lang.reflect.Field
;
import
java.util.List
;
import
java.util.Arrays
;
import
java.util.stream.Stream
;
/**
/**
* 警情接警填报记录
* 警情接警填报记录
...
@@ -35,7 +48,11 @@ import java.util.List;
...
@@ -35,7 +48,11 @@ import java.util.List;
public
class
AlertCalledController
extends
BaseController
{
public
class
AlertCalledController
extends
BaseController
{
@Autowired
@Autowired
AlertCalledServiceImpl
alertCalledServiceImpl
;
RedisUtils
redisUtils
;
@Autowired
AlertCalledServiceImpl
iAlertCalledService
;
@Autowired
private
ESAlertCalledService
eSAlertCalledService
;
/**
/**
* 新增警情接警填报记录
* 新增警情接警填报记录
...
@@ -45,25 +62,47 @@ public class AlertCalledController extends BaseController {
...
@@ -45,25 +62,47 @@ public class AlertCalledController extends BaseController {
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@PostMapping
(
value
=
"/save"
)
@PostMapping
(
value
=
"/save"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"新增警情接警填报记录"
,
notes
=
"新增警情接警填报记录"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"新增警情接警填报记录"
,
notes
=
"新增警情接警填报记录"
)
public
ResponseModel
<
AlertCalledDto
>
save
(
@RequestBody
AlertCalledDto
model
)
{
public
ResponseModel
<
AlertCalled
>
save
(
@RequestBody
AlertCalledObjsDto
alertCalledObjsDto
)
{
model
=
alertCalledServiceImpl
.
createWithModel
(
model
);
if
(
ValidationUtil
.
isEmpty
(
alertCalledObjsDto
)
return
ResponseHelper
.
buildResponse
(
model
);
||
ValidationUtil
.
isEmpty
(
alertCalledObjsDto
.
getAlertCalled
())){
throw
new
BadRequest
(
"参数校验失败."
);
}
ReginParams
reginParams
=
JSONObject
.
parseObject
(
null
!=
redisUtils
.
get
(
buildKey
(
getToken
()))
?
redisUtils
.
get
(
buildKey
(
getToken
())).
toString
()
:
null
,
ReginParams
.
class
);
//获取当前登录人公司
Integer
code
=
reginParams
.
getCompany
().
getCompanyOrgCode
();
AlertCalled
alertCalled
=
alertCalledObjsDto
.
getAlertCalled
();
alertCalled
.
setOrgCode
(
String
.
valueOf
(
code
));
alertCalledObjsDto
.
setAlertCalled
(
alertCalled
);
alertCalledObjsDto
=
iAlertCalledService
.
createAlertCalled
(
alertCalledObjsDto
);
return
ResponseHelper
.
buildResponse
(
alertCalledObjsDto
.
getAlertCalled
());
}
}
/**
/**
* 根据id删除
*
*
* @param id 主键
* <pre>
* 相似警情分页查询
* </pre>
*
* @param
* @param current
* @param size
* @return
* @return
* @throws Exception
*/
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@DeleteMapping
(
value
=
"/{id}"
)
@ApiOperation
(
value
=
"相似警情分页查询"
)
@ApiOperation
(
httpMethod
=
"DELETE"
,
value
=
"根据id删除警情接警填报记录"
,
notes
=
"根据id删除警情接警填报记录"
)
@PostMapping
(
value
=
"/page/similar"
)
public
ResponseModel
<
Boolean
>
deleteByid
(
HttpServletRequest
request
,
@PathVariable
(
value
=
"id"
)
Long
id
){
public
ResponseModel
<
Page
<
ESAlertCalledDto
>>
pageBySimilar
(
return
ResponseHelper
.
buildResponse
(
alertCalledServiceImpl
.
removeById
(
id
));
@RequestBody
ESAlertCalledRequestDto
alertCalledVo
,
@RequestParam
(
value
=
"current"
)
int
current
,
@RequestParam
(
value
=
"size"
)
int
size
)
throws
Exception
{
return
ResponseHelper
.
buildResponse
(
eSAlertCalledService
.
queryByKeys
(
alertCalledVo
,
current
,
size
));
}
}
/**
/**
* 根据id查询
* 根据id查询
*
*
...
@@ -73,37 +112,88 @@ public class AlertCalledController extends BaseController {
...
@@ -73,37 +112,88 @@ public class AlertCalledController extends BaseController {
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@GetMapping
(
value
=
"/{id}"
)
@GetMapping
(
value
=
"/{id}"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"根据id查询单个警情接警填报记录"
,
notes
=
"根据id查询单个警情接警填报记录"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"根据id查询单个警情接警填报记录"
,
notes
=
"根据id查询单个警情接警填报记录"
)
public
ResponseModel
<
AlertCalledDto
>
selectOne
(
@PathVariable
Long
id
)
{
public
ResponseModel
<
Object
>
selectOne
(
@PathVariable
Long
id
)
{
return
ResponseHelper
.
buildResponse
(
alertCalledServiceImpl
.
queryBySeq
(
id
));
return
ResponseHelper
.
buildResponse
(
iAlertCalledService
.
selectAlertCalledById
(
id
));
}
}
/**
/**
* 列表分页查询
* 列表分页查询
*
*
* @param
current
当前页
* @param
pageNum
当前页
* @param
current
每页大小
* @param
pageSize
每页大小
* @return
* @return
*/
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@GetMapping
(
value
=
"/
page
"
)
@GetMapping
(
value
=
"/
list
"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"警情接警填报记录分页查询"
,
notes
=
"警情接警填报记录分页查询"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"警情接警填报记录分页查询"
,
notes
=
"警情接警填报记录分页查询"
)
public
ResponseModel
<
Page
<
AlertCalledDto
>>
queryForPage
(
@RequestParam
(
value
=
"current"
)
int
current
,
@RequestParam
public
ResponseModel
<
IPage
<
AlertCalled
>>
queryForPage
(
String
pageNum
,
String
pageSize
,
String
sort
,
AlertCalled
alertCalled
)
{
(
value
=
"size"
)
int
size
)
{
Page
<
AlertCalled
>
pageBean
;
Page
<
AlertCalledDto
>
page
=
new
Page
<
AlertCalledDto
>();
IPage
<
AlertCalled
>
page
;
page
.
setCurrent
(
current
);
QueryWrapper
<
AlertCalled
>
alertCalledQueryWrapper
=
new
QueryWrapper
<>();
page
.
setSize
(
size
);
return
ResponseHelper
.
buildResponse
(
alertCalledServiceImpl
.
queryForAlertCalledPage
(
page
));
setQueryWrapper
(
alertCalledQueryWrapper
,
alertCalled
,
sort
);
if
(
StringUtils
.
isBlank
(
pageNum
)
||
StringUtils
.
isBlank
(
pageSize
))
{
pageBean
=
new
Page
<>(
0
,
Long
.
MAX_VALUE
);
}
else
{
pageBean
=
new
Page
<>(
Integer
.
parseInt
(
pageNum
),
Integer
.
parseInt
(
pageSize
));
}
page
=
iAlertCalledService
.
page
(
pageBean
,
alertCalledQueryWrapper
);
return
ResponseHelper
.
buildResponse
(
page
);
}
}
/**
private
QueryWrapper
<
AlertCalled
>
setQueryWrapper
(
QueryWrapper
<
AlertCalled
>
queryWrapper
,
AlertCalled
alertCalled
,
String
sort
){
* 列表全部数据查询
Class
<?
extends
AlertCalled
>
aClass
=
alertCalled
.
getClass
();
*
queryWrapper
.
eq
(
"is_delete"
,
0
);
* @return
*/
if
(
sort
!=
null
)
{
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
// String[] date= sort.split(",");
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"警情接警填报记录列表全部数据查询"
,
notes
=
"警情接警填报记录列表全部数据查询"
)
// if(date[1].equals("ascend")) {
@GetMapping
(
value
=
"/list"
)
// queryWrapper.orderByAsc(RedisKey.humpToLine(date[0]));
public
ResponseModel
<
List
<
AlertCalledDto
>>
selectForList
()
{
// }else {
return
ResponseHelper
.
buildResponse
(
alertCalledServiceImpl
.
queryForAlertCalledList
());
// queryWrapper.orderByDesc(RedisKey.humpToLine(date[0]));
// }
}
else
{
queryWrapper
.
orderByDesc
(
"call_time"
);
}
if
(
alertCalled
.
getCallTimeStart
()
!=
null
&&
alertCalled
.
getCallTimeEnd
()
!=
null
)
{
queryWrapper
.
between
(
"call_time"
,
alertCalled
.
getCallTimeStart
(),
alertCalled
.
getCallTimeEnd
());
}
if
(
alertCalled
.
getIsFatherAlert
())
{
// 0:接警;1:处警
queryWrapper
.
isNull
(
"father_alert"
);
}
Stream
<
Field
>
fieldStream
=
Arrays
.
stream
(
aClass
.
getDeclaredFields
()).
filter
(
field
->
{
String
name
=
NameUtils
.
camel2Underline
(
field
.
getName
());
return
!(
"IS_FATHER_ALERT"
.
equals
(
name
));
});
fieldStream
.
forEach
(
field
->
{
try
{
field
.
setAccessible
(
true
);
Object
o
=
field
.
get
(
alertCalled
);
if
(
o
!=
null
&&
!
"serialVersionUID"
.
equals
(
field
.
getName
()))
{
Class
<?>
type
=
field
.
getType
();
String
name
=
NameUtils
.
camel2Underline
(
field
.
getName
());
if
(
type
.
equals
(
Integer
.
class
))
{
Integer
fileValue
=
(
Integer
)
field
.
get
(
alertCalled
);
queryWrapper
.
eq
(
name
,
fileValue
);
}
else
if
(
type
.
equals
(
String
.
class
))
{
String
fileValue
=
(
String
)
field
.
get
(
alertCalled
);
queryWrapper
.
eq
(
name
,
fileValue
);
}
else
if
(
type
.
equals
(
Boolean
.
class
))
{
Boolean
fileValue
=
(
Boolean
)
field
.
get
(
alertCalled
);
queryWrapper
.
eq
(
name
,
fileValue
);
}
else
if
(
type
.
equals
(
Long
.
class
)
||
"long"
.
equals
(
type
.
toString
()))
{
Long
fileValue
=
(
Long
)
field
.
get
(
alertCalled
);
queryWrapper
.
eq
(
name
,
fileValue
);
}
}
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
throw
new
RuntimeException
(
"系统异常"
);
}
});
return
queryWrapper
;
}
}
}
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-tzs-biz/src/main/java/com/yeejoin/amos/boot/module/tzs/biz/controller/AlertFormController.java
0 → 100644
View file @
95c720d3
package
com
.
yeejoin
.
amos
.
boot
.
module
.
tzs
.
biz
.
controller
;
import
com.alibaba.fastjson.JSON
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
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.utils.NameUtils
;
import
com.yeejoin.amos.boot.biz.common.utils.RedisKey
;
import
com.yeejoin.amos.boot.biz.common.utils.RedisUtils
;
import
com.yeejoin.amos.boot.module.tzs.api.dto.AlertFormInitDto
;
import
com.yeejoin.amos.boot.module.tzs.api.entity.AlertForm
;
import
com.yeejoin.amos.boot.module.tzs.biz.service.impl.AlertFormServiceImpl
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
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
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.List
;
/**
* 警情表单
*
* @author tb
* @date 2021-06-17
*/
@RestController
@Api
(
tags
=
"警情表单Api"
)
@RequestMapping
(
value
=
"/alert-form"
)
public
class
AlertFormController
extends
BaseController
{
@Autowired
AlertFormServiceImpl
iAlertFormService
;
@Autowired
RedisUtils
redisUtils
;
@Value
(
"${redis.cache.failure.time}"
)
private
long
time
;
/**
* 新增警情表单
* @return
*/
@TycloudOperation
(
needAuth
=
true
,
ApiLevel
=
UserType
.
AGENCY
)
@RequestMapping
(
value
=
"/save"
,
method
=
RequestMethod
.
POST
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"新增警情表单"
,
notes
=
"新增警情表单"
)
public
boolean
saveAlertForm
(
HttpServletRequest
request
,
@RequestBody
AlertForm
alertForm
){
return
iAlertFormService
.
save
(
alertForm
);
}
/**
* 根据id删除
* @param id
* @return
*/
@TycloudOperation
(
needAuth
=
true
,
ApiLevel
=
UserType
.
AGENCY
)
@RequestMapping
(
value
=
"/{id}"
,
method
=
RequestMethod
.
DELETE
)
@ApiOperation
(
httpMethod
=
"DELETE"
,
value
=
"根据id删除"
,
notes
=
"根据id删除"
)
public
boolean
deleteById
(
HttpServletRequest
request
,
@PathVariable
Long
id
){
return
iAlertFormService
.
removeById
(
id
);
}
/**
* 修改警情表单
* @return
*/
@TycloudOperation
(
needAuth
=
true
,
ApiLevel
=
UserType
.
AGENCY
)
@RequestMapping
(
value
=
"/updateById"
,
method
=
RequestMethod
.
PUT
)
@ApiOperation
(
httpMethod
=
"PUT"
,
value
=
"修改警情表单"
,
notes
=
"修改警情表单"
)
public
boolean
updateByIdAlertForm
(
HttpServletRequest
request
,
@RequestBody
AlertForm
alertForm
){
return
iAlertFormService
.
updateById
(
alertForm
);
}
/**
* 根据id查询
* @param id
* @return
*/
@TycloudOperation
(
needAuth
=
true
,
ApiLevel
=
UserType
.
AGENCY
)
@RequestMapping
(
value
=
"/{id}"
,
method
=
RequestMethod
.
GET
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"根据id查询"
,
notes
=
"根据id查询"
)
public
AlertForm
selectById
(
HttpServletRequest
request
,
@PathVariable
Long
id
){
return
iAlertFormService
.
getById
(
id
);
}
/**
* 根据表态类型code查询表单数据项
* @param code
* @return
*/
@TycloudOperation
(
needAuth
=
true
,
ApiLevel
=
UserType
.
AGENCY
)
@RequestMapping
(
value
=
"/form/{code}"
,
method
=
RequestMethod
.
GET
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"根据表态类型code查询表单数据项"
,
notes
=
"根据表态类型code查询表单数据项"
)
public
ResponseModel
<
Object
>
selectFormdItem
(
HttpServletRequest
request
,
@PathVariable
String
code
){
List
<
AlertFormInitDto
>
list
=
new
ArrayList
<
AlertFormInitDto
>();
if
(
redisUtils
.
hasKey
(
RedisKey
.
FORM_CODE
+
code
)){
Object
obj
=
redisUtils
.
get
(
RedisKey
.
FORM_CODE
+
code
);
return
ResponseHelper
.
buildResponse
(
obj
);
}
else
{
list
=
iAlertFormService
.
getFormlist
(
code
);
redisUtils
.
set
(
RedisKey
.
FORM_CODE
+
code
,
JSON
.
toJSON
(
list
),
time
);
return
ResponseHelper
.
buildResponse
(
list
);
}
}
/**
* 列表分页查询
* @return
*/
@TycloudOperation
(
needAuth
=
true
,
ApiLevel
=
UserType
.
AGENCY
)
@RequestMapping
(
value
=
"/list"
,
method
=
RequestMethod
.
GET
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"列表分页查询"
,
notes
=
"列表分页查询"
)
public
IPage
<
AlertForm
>
listPage
(
String
pageNum
,
String
pageSize
,
AlertForm
alertForm
){
Page
<
AlertForm
>
pageBean
;
QueryWrapper
<
AlertForm
>
alertFormQueryWrapper
=
new
QueryWrapper
<>();
Class
<?
extends
AlertForm
>
aClass
=
alertForm
.
getClass
();
Arrays
.
stream
(
aClass
.
getDeclaredFields
()).
forEach
(
field
->
{
try
{
field
.
setAccessible
(
true
);
Object
o
=
field
.
get
(
alertForm
);
if
(
o
!=
null
)
{
Class
<?>
type
=
field
.
getType
();
String
name
=
NameUtils
.
camel2Underline
(
field
.
getName
());
if
(
type
.
equals
(
Integer
.
class
))
{
Integer
fileValue
=
(
Integer
)
field
.
get
(
alertForm
);
alertFormQueryWrapper
.
eq
(
name
,
fileValue
);
}
else
if
(
type
.
equals
(
Long
.
class
))
{
Long
fileValue
=
(
Long
)
field
.
get
(
alertForm
);
alertFormQueryWrapper
.
eq
(
name
,
fileValue
);
}
else
if
(
type
.
equals
(
String
.
class
))
{
String
fileValue
=
(
String
)
field
.
get
(
alertForm
);
alertFormQueryWrapper
.
eq
(
name
,
fileValue
);
}
else
{
String
fileValue
=
(
String
)
field
.
get
(
alertForm
);
alertFormQueryWrapper
.
eq
(
name
,
fileValue
);
}
}
}
catch
(
Exception
e
)
{
throw
new
RuntimeException
(
"系统异常"
);
}
});
IPage
<
AlertForm
>
page
;
if
(
StringUtils
.
isBlank
(
pageNum
)
||
StringUtils
.
isBlank
(
pageSize
))
{
pageBean
=
new
Page
<>(
0
,
Long
.
MAX_VALUE
);
}
else
{
pageBean
=
new
Page
<>(
Integer
.
parseInt
(
pageNum
),
Integer
.
parseInt
(
pageSize
));
}
page
=
iAlertFormService
.
page
(
pageBean
,
alertFormQueryWrapper
);
return
page
;
}
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-tzs-biz/src/main/java/com/yeejoin/amos/boot/module/tzs/biz/dao/ESAlertCalledRepository.java
0 → 100644
View file @
95c720d3
package
com
.
yeejoin
.
amos
.
boot
.
module
.
tzs
.
biz
.
dao
;
import
com.yeejoin.amos.boot.module.tzs.api.entity.ESAlertCalled
;
import
org.springframework.data.repository.PagingAndSortingRepository
;
import
org.springframework.stereotype.Repository
;
/**
*
* <pre>
* 警情信息ES数据查询
* </pre>
*
* @author gwb
* @version $Id: ESAlertCalledRepository.java, v 0.1 2021年6月19日 下午5:12:50 gwb Exp $
*/
@Repository
public
interface
ESAlertCalledRepository
extends
PagingAndSortingRepository
<
ESAlertCalled
,
Long
>
{
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-tzs-biz/src/main/java/com/yeejoin/amos/boot/module/tzs/biz/service/impl/AlertCalledServiceImpl.java
View file @
95c720d3
...
@@ -2,22 +2,30 @@ package com.yeejoin.amos.boot.module.tzs.biz.service.impl;
...
@@ -2,22 +2,30 @@ package com.yeejoin.amos.boot.module.tzs.biz.service.impl;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSON
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.boot.biz.common.utils.DateUtils
;
import
com.yeejoin.amos.boot.biz.common.utils.RedisKey
;
import
com.yeejoin.amos.boot.biz.common.utils.RedisKey
;
import
com.yeejoin.amos.boot.biz.common.utils.RedisUtils
;
import
com.yeejoin.amos.boot.biz.common.utils.RedisUtils
;
import
com.yeejoin.amos.boot.module.tzs.api.dto.AlertCalledDto
;
import
com.yeejoin.amos.boot.module.tzs.api.dto.AlertCalledFormDto
;
import
com.yeejoin.amos.boot.module.tzs.api.dto.AlertCalledFormDto
;
import
com.yeejoin.amos.boot.module.tzs.api.dto.AlertCalledObjsDto
;
import
com.yeejoin.amos.boot.module.tzs.api.dto.FormValue
;
import
com.yeejoin.amos.boot.module.tzs.api.dto.FormValue
;
import
com.yeejoin.amos.boot.module.tzs.api.entity.AlertCalled
;
import
com.yeejoin.amos.boot.module.tzs.api.entity.AlertCalled
;
import
com.yeejoin.amos.boot.module.tzs.api.entity.AlertFormValue
;
import
com.yeejoin.amos.boot.module.tzs.api.entity.AlertFormValue
;
import
com.yeejoin.amos.boot.module.tzs.api.entity.RepairConsult
;
import
com.yeejoin.amos.boot.module.tzs.api.entity.Template
;
import
com.yeejoin.amos.boot.module.tzs.api.enums.AlertStageEnums
;
import
com.yeejoin.amos.boot.module.tzs.api.mapper.AlertCalledMapper
;
import
com.yeejoin.amos.boot.module.tzs.api.mapper.AlertCalledMapper
;
import
com.yeejoin.amos.boot.module.tzs.api.service.IAlertCalledService
;
import
com.yeejoin.amos.boot.module.tzs.api.service.IAlertCalledService
;
import
com.yeejoin.amos.boot.module.tzs.api.dto.AlertCalledDto
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
import
java.text.ParseException
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.List
;
/**
/**
...
@@ -38,6 +46,15 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto,AlertCall
...
@@ -38,6 +46,15 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto,AlertCall
@Autowired
@Autowired
private
AlertFormValueServiceImpl
iAlertFormValueService
;
private
AlertFormValueServiceImpl
iAlertFormValueService
;
@Autowired
TemplateServiceImpl
templateService
;
@Autowired
private
ESAlertCalledService
eSAlertCalledService
;
@Autowired
private
RepairConsultServiceImpl
repairConsultService
;
/**
/**
* 分页查询
* 分页查询
...
@@ -80,4 +97,105 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto,AlertCall
...
@@ -80,4 +97,105 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto,AlertCall
return
alertCalledFormVo
;
return
alertCalledFormVo
;
}
}
}
}
/**
*
* <pre>
* 保存警情信息
* </pre>
*
* @param alertCalledObjsDto
* @return
*/
@Transactional
(
rollbackFor
=
RuntimeException
.
class
)
public
AlertCalledObjsDto
createAlertCalled
(
AlertCalledObjsDto
alertCalledObjsDto
)
{
try
{
// 警情基本信息
AlertCalled
alertCalled
=
alertCalledObjsDto
.
getAlertCalled
();
alertCalled
.
setCallTime
(
new
Date
());
// 判断是否归并警情
if
(
alertCalled
.
getFatherAlert
()
!=
null
)
{
// 警情归并,设置当前警情状态为结束。
alertCalled
.
setAlertStatus
(
true
);
alertCalled
.
setAlertStage
(
AlertStageEnums
.
JJ
.
getValue
());
alertCalled
.
setAlertStageCode
(
AlertStageEnums
.
JJ
.
getCode
());
alertCalled
.
setType
(
AlertStageEnums
.
JQGB
.
getValue
());
alertCalled
.
setTypeCode
(
AlertStageEnums
.
JQGB
.
getCode
());
this
.
save
(
alertCalled
);
// 动态表单
List
<
AlertFormValue
>
alertFormValuelist
=
alertCalledObjsDto
.
getAlertFormValue
();
// 填充警情主键
alertFormValuelist
.
stream
().
forEach
(
alertFormValue
->
{
alertFormValue
.
setAlertCalledId
(
alertCalled
.
getSequenceNbr
());
alertFormValue
.
setAlertTypeCode
(
alertCalled
.
getAlarmTypeCode
());
});
// 保存动态表单数据
iAlertFormValueService
.
saveBatch
(
alertFormValuelist
);
}
else
{
// 警情报送
// ****************************************************待确认开发
alertCalled
.
setAlertStatus
(
false
);
alertCalled
.
setIsDelete
(
false
);
alertCalled
.
setAlertStage
(
AlertStageEnums
.
JJ
.
getValue
());
alertCalled
.
setAlertStageCode
(
AlertStageEnums
.
JJ
.
getCode
());
alertCalled
.
setType
(
AlertStageEnums
.
JQCB
.
getValue
());
alertCalled
.
setTypeCode
(
AlertStageEnums
.
JQCB
.
getCode
());
this
.
save
(
alertCalled
);
// 动态表单
List
<
AlertFormValue
>
alertFormValuelist
=
alertCalledObjsDto
.
getAlertFormValue
();
// 填充警情主键
alertFormValuelist
.
stream
().
forEach
(
alertFormValue
->
{
alertFormValue
.
setAlertCalledId
(
alertCalled
.
getSequenceNbr
());
alertFormValue
.
setAlertTypeCode
(
alertCalled
.
getAlarmTypeCode
());
});
// 保存动态表单数据
iAlertFormValueService
.
saveBatch
(
alertFormValuelist
);
alertCalledObjsDto
.
setAlertCalled
(
alertCalled
);
alertCalledObjsDto
.
setAlertFormValue
(
alertFormValuelist
);
//保存处置记录-接警
if
(
AlertStageEnums
.
KRJY
.
getCode
().
equals
(
alertCalled
.
getAlarmTypeCode
()))
{
saveRapairConsylt
(
AlertStageEnums
.
JJ
.
getCode
(),
alertCalled
);
}
else
if
(
AlertStageEnums
.
GZWX
.
getCode
().
equals
(
alertCalled
.
getAlarmTypeCode
()))
{
saveRapairConsylt
(
AlertStageEnums
.
JJ
.
getCode
(),
alertCalled
);
}
else
{
saveRapairConsylt
(
AlertStageEnums
.
JJ
.
getCode
(),
alertCalled
);
}
}
/**
* 同步保存ES
*/
eSAlertCalledService
.
saveAlertCalledToES
(
alertCalled
);
return
alertCalledObjsDto
;
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
throw
new
RuntimeException
(
"报送失败,系统异常!"
);
}
}
private
void
saveRapairConsylt
(
String
typeCode
,
AlertCalled
alertCalled
)
throws
ParseException
{
// 获取警情接警处置记录模板
Template
template
=
templateService
.
getOne
(
new
QueryWrapper
<
Template
>().
eq
(
"type_code"
,
typeCode
).
eq
(
"format"
,
false
));
String
templateContent
=
template
.
getContent
();
String
transferDetails
=
templateContent
.
replace
(
"callTime"
,
DateUtils
.
dateTimeToDateString
(
alertCalled
.
getCallTime
()))
.
replace
(
"user"
,
alertCalled
.
getRecUserName
()).
replace
(
"emergencyCall"
,
alertCalled
.
getEmergencyCall
());
RepairConsult
repairConsult
=
new
RepairConsult
();
repairConsult
.
setParentId
(
alertCalled
.
getSequenceNbr
());
repairConsult
.
setType
(
alertCalled
.
getAlarmTypeCode
());
repairConsult
.
setAlertStageCode
(
alertCalled
.
getAlertStageCode
());
repairConsult
.
setAlertStatus
(
alertCalled
.
getAlertStage
());
repairConsult
.
setContactUser
(
alertCalled
.
getEmergencyPerson
());
repairConsult
.
setContactPhone
(
alertCalled
.
getContactPhone
());
repairConsult
.
setDescription
(
transferDetails
);
repairConsultService
.
save
(
repairConsult
);
}
}
}
\ No newline at end of file
amos-boot-module/amos-boot-module-biz/amos-boot-module-tzs-biz/src/main/java/com/yeejoin/amos/boot/module/tzs/biz/service/impl/ESAlertCalledService.java
0 → 100644
View file @
95c720d3
package
com
.
yeejoin
.
amos
.
boot
.
module
.
tzs
.
biz
.
service
.
impl
;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.boot.module.tzs.api.dto.ESAlertCalledDto
;
import
com.yeejoin.amos.boot.module.tzs.api.dto.ESAlertCalledRequestDto
;
import
com.yeejoin.amos.boot.module.tzs.api.entity.AlertCalled
;
import
com.yeejoin.amos.boot.module.tzs.api.entity.ESAlertCalled
;
import
com.yeejoin.amos.boot.module.tzs.api.enums.AlertStatusEnum
;
import
com.yeejoin.amos.boot.module.tzs.biz.dao.ESAlertCalledRepository
;
import
org.elasticsearch.index.query.BoolQueryBuilder
;
import
org.elasticsearch.index.query.QueryBuilders
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.data.domain.PageRequest
;
import
org.springframework.data.elasticsearch.core.ElasticsearchRestTemplate
;
import
org.springframework.data.elasticsearch.core.SearchHit
;
import
org.springframework.data.elasticsearch.core.SearchHits
;
import
org.springframework.data.elasticsearch.core.query.NativeSearchQueryBuilder
;
import
org.springframework.stereotype.Service
;
import
org.typroject.tyboot.core.foundation.utils.ValidationUtil
;
import
javax.annotation.PostConstruct
;
import
java.util.Date
;
import
java.util.LinkedList
;
import
java.util.List
;
/**
*
* <pre>
* 警情信息ES检索服务
* </pre>
*
* @author gwb
* @version $Id: ESAlertCalledService.java, v 0.1 2021年6月19日 下午5:12:01 gwb Exp $
*/
@Service
public
class
ESAlertCalledService
{
@Autowired
private
ElasticsearchRestTemplate
elasticsearchTemplate
;
@Autowired
private
ESAlertCalledRepository
esAlertCalledRepository
;
@Autowired
private
AlertCalledServiceImpl
alertCalledService
;
@Value
(
"${alertcall.es.synchrony.time}"
)
private
Long
time
;
@PostConstruct
public
void
init
()
throws
Exception
{
//初始化ES,重建索引
initEs
();
}
/**
* 重建索引
*/
public
Boolean
initEs
()
throws
Exception
{
esAlertCalledRepository
.
deleteAll
();
/**
* 同步历史48小时以内的警情处置记录
*/
QueryWrapper
<
AlertCalled
>
wrapper
=
new
QueryWrapper
<>();
long
currentTime
=
System
.
currentTimeMillis
()
;
if
(
ValidationUtil
.
isEmpty
(
time
))
//默认为同步48小时
{
currentTime
=
currentTime
-
48
*
60
*
60
*
1000
;
}
else
{
currentTime
=
currentTime
-
time
*
60
*
60
*
1000
;
}
Date
date
=
new
Date
(
currentTime
);
wrapper
.
ge
(
"call_time"
,
date
);
List
<
AlertCalled
>
alertCalleds
=
alertCalledService
.
list
(
wrapper
);
if
(!
ValidationUtil
.
isEmpty
(
alertCalleds
))
{
for
(
AlertCalled
alertCalled
:
alertCalleds
)
{
saveAlertCalledToES
(
alertCalled
);
}
}
return
true
;
}
/**
*
* <pre>
* 根据警情记录批量保存
* </pre>
*
* @param alertCalled 警情信息列表
*/
public
ESAlertCalled
saveAlertCalledToES
(
AlertCalled
alertCalled
)
throws
Exception
{
ESAlertCalled
esAlertCalled
=
new
ESAlertCalled
();
esAlertCalled
.
setSequenceNbr
(
alertCalled
.
getSequenceNbr
());
esAlertCalled
.
setAlarmType
(
alertCalled
.
getAlarmType
());
esAlertCalled
.
setAlarmTypeCode
(
alertCalled
.
getAlarmTypeCode
());
esAlertCalled
.
setCallTime
(
alertCalled
.
getCallTime
());
esAlertCalled
.
setCallTimeLong
(
alertCalled
.
getCallTime
()!=
null
?
alertCalled
.
getCallTime
().
getTime
():
null
);
esAlertCalled
.
setContactPhone
(
alertCalled
.
getContactPhone
());
esAlertCalled
.
setAddress
(
alertCalled
.
getAddress
());
esAlertCalled
.
setAlertStage
(
alertCalled
.
getAlertStage
());
esAlertCalled
.
setAlertStatus
(
alertCalled
.
getAlertStatus
());
esAlertCalled
.
setEmergencyCall
(
alertCalled
.
getEmergencyCall
());
esAlertCalled
.
setDeviceId
(
alertCalled
.
getDeviceId
());
if
(
alertCalled
.
getAlertStatus
())
{
esAlertCalled
.
setAlertStatusStr
(
AlertStatusEnum
.
CLOSED
.
getCode
());
}
else
{
esAlertCalled
.
setAlertStatusStr
(
AlertStatusEnum
.
UNCLOSED
.
getCode
());
}
esAlertCalledRepository
.
save
(
esAlertCalled
);
return
esAlertCalled
;
}
/**
* 根据关键字查询文档,关键字不为空时按相关性从大到小排序
*
* @param alertCalledVo 关键字
* @param current 当前页码
* @param size 页面大小
* @return
*/
@SuppressWarnings
({
"rawtypes"
})
public
Page
<
ESAlertCalledDto
>
queryByKeys
(
ESAlertCalledRequestDto
alertCalledVo
,
int
current
,
int
size
)
{
Page
<
ESAlertCalledDto
>
result
=
new
Page
<
ESAlertCalledDto
>(
current
,
size
);
String
[]
alertStatus
=
alertCalledVo
.
getAlertStatus
();
if
(
ValidationUtil
.
isEmpty
(
alertStatus
))
{
return
result
;
}
AlertCalled
alertCalled
=
alertCalledVo
.
getAlertCalled
();
if
(
ValidationUtil
.
isEmpty
(
alertCalled
))
{
return
result
;
}
/**
* 通用匹配规则,条件构建
*/
BoolQueryBuilder
boolMust
=
QueryBuilders
.
boolQuery
();
//警情状态
BoolQueryBuilder
qb0
=
QueryBuilders
.
boolQuery
();
for
(
String
status
:
alertStatus
)
{
AlertStatusEnum
alertStatusEnum
=
AlertStatusEnum
.
getEnum
(
status
);
if
(!
ValidationUtil
.
isEmpty
(
alertStatusEnum
))
{
qb0
.
should
(
QueryBuilders
.
termQuery
(
"alertStatusStr.keyword"
,
alertStatusEnum
.
getCode
()));
}
}
boolMust
.
must
(
qb0
);
//接警时间,距离当前时间不超过两个小时的
long
currentTime
=
System
.
currentTimeMillis
()
;
currentTime
=
currentTime
-
120
*
60
*
1000
;
BoolQueryBuilder
qb1
=
QueryBuilders
.
boolQuery
()
.
must
(
QueryBuilders
.
rangeQuery
(
"callTimeLong"
).
gte
(
currentTime
));
boolMust
.
should
(
qb1
);
//报警电话一致
if
(!
ValidationUtil
.
isEmpty
(
alertCalled
.
getEmergencyCall
())
&&
!
ValidationUtil
.
isEmpty
(
alertCalled
.
getContactPhone
()))
{
BoolQueryBuilder
qb2
=
QueryBuilders
.
boolQuery
()
.
must
(
QueryBuilders
.
termQuery
(
"emergencyCall.keyword"
,
alertCalled
.
getEmergencyCall
()))
.
must
(
QueryBuilders
.
termQuery
(
"contactPhone.keyword"
,
alertCalled
.
getContactPhone
()));
boolMust
.
should
(
qb2
);
}
//事发地点一致,或相距不超过200米的
if
(!
ValidationUtil
.
isEmpty
(
alertCalled
.
getAddress
()))
{
BoolQueryBuilder
qb3
=
QueryBuilders
.
boolQuery
()
.
should
(
QueryBuilders
.
matchQuery
(
"address"
,
alertCalled
.
getAddress
()));
boolMust
.
should
(
qb3
);
}
//警情类型一致
BoolQueryBuilder
qb4
=
QueryBuilders
.
boolQuery
()
.
must
(
QueryBuilders
.
termQuery
(
"alertTypeCode.keyword"
,
alertCalled
.
getAlarmTypeCode
()));
boolMust
.
should
(
qb4
);
//使用单位名称一致
if
(!
ValidationUtil
.
isEmpty
(
alertCalled
.
getUseUnit
()))
{
BoolQueryBuilder
qb5
=
QueryBuilders
.
boolQuery
()
.
must
(
QueryBuilders
.
termQuery
(
"useUnit.keyword"
,
alertCalled
.
getUseUnit
()));
boolMust
.
should
(
qb5
);
}
//电梯识别码一致
if
(!
ValidationUtil
.
isEmpty
(
alertCalled
.
getDeviceId
()))
{
BoolQueryBuilder
qb6
=
QueryBuilders
.
boolQuery
()
.
must
(
QueryBuilders
.
termQuery
(
"deviceId.keyword"
,
alertCalled
.
getDeviceId
()));
boolMust
.
should
(
qb6
);
}
/**
* 困人救援,故障报修,投诉咨询 条件构造
*/
// 创建查询构造器
NativeSearchQueryBuilder
queryBuilder
=
new
NativeSearchQueryBuilder
()
// 分页
.
withPageable
(
PageRequest
.
of
(
current
,
size
))
// 排序
// .withSort(SortBuilders.fieldSort("callTimeLong").order(SortOrder.DESC))
//过滤条件
.
withQuery
(
boolMust
);
List
<
ESAlertCalledDto
>
list
=
new
LinkedList
<>();
long
totle
=
0
;
try
{
SearchHits
<
ESAlertCalled
>
searchHits
=
elasticsearchTemplate
.
search
(
queryBuilder
.
build
(),
ESAlertCalled
.
class
);
for
(
SearchHit
searchHit
:
searchHits
.
getSearchHits
())
{
JSONObject
jsonObject
=
(
JSONObject
)
JSONObject
.
toJSON
(
searchHit
.
getContent
());
ESAlertCalledDto
eSAlertCalled
=
JSONObject
.
toJavaObject
(
jsonObject
,
ESAlertCalledDto
.
class
);
list
.
add
(
eSAlertCalled
);
}
totle
=
searchHits
.
getTotalHits
();
}
catch
(
Exception
e
)
{
// TODO: handle exception
}
result
.
setRecords
(
list
);
result
.
setTotal
(
totle
);
return
result
;
}
}
amos-boot-system-tzs/src/main/java/com/yeejoin/amos/AmosTzsApplication.java
View file @
95c720d3
...
@@ -40,7 +40,8 @@ import java.net.UnknownHostException;
...
@@ -40,7 +40,8 @@ import java.net.UnknownHostException;
"org.typroject.tyboot.face.*.orm.dao*"
,
"org.typroject.tyboot.face.*.orm.dao*"
,
"org.typroject.tyboot.core.auth.face.orm.dao*"
,
"org.typroject.tyboot.core.auth.face.orm.dao*"
,
"org.typroject.tyboot.component.*.face.orm.dao*"
,
"org.typroject.tyboot.component.*.face.orm.dao*"
,
"com.yeejoin.amos.boot.module.tzs.api.mapper"
})
"com.yeejoin.amos.boot.module.tzs.api.mapper"
,
"com.yeejoin.amos.boot.biz.common.dao.mapper"
})
@ComponentScan
(
basePackages
=
{
"org.typroject"
,
"com.yeejoin.amos"
})
@ComponentScan
(
basePackages
=
{
"org.typroject"
,
"com.yeejoin.amos"
})
public
class
AmosTzsApplication
{
public
class
AmosTzsApplication
{
private
static
final
Logger
logger
=
LoggerFactory
.
getLogger
(
AmosTzsApplication
.
class
);
private
static
final
Logger
logger
=
LoggerFactory
.
getLogger
(
AmosTzsApplication
.
class
);
...
...
amos-boot-system-tzs/src/main/resources/application-dev.properties
View file @
95c720d3
...
@@ -19,3 +19,13 @@ spring.redis.lettuce.pool.max-wait=-1
...
@@ -19,3 +19,13 @@ spring.redis.lettuce.pool.max-wait=-1
spring.redis.lettuce.pool.max-idle
=
10
spring.redis.lettuce.pool.max-idle
=
10
spring.redis.lettuce.pool.min-idle
=
0
spring.redis.lettuce.pool.min-idle
=
0
spring.redis.expire.time
=
300
spring.redis.expire.time
=
300
## emqx properties:
emqx.clean-session
=
true
emqx.client-id
=
${spring.application.name}-${random.int[1024,65536]}
emqx.broker
=
tcp://172.16.10.85:1883
emqx.user-name
=
super
emqx.password
=
a123456
## redisʱʱ
redis.cache.failure.time
=
10800
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