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
Hide whitespace changes
Inline
Side-by-side
Showing
34 changed files
with
2024 additions
and
878 deletions
+2024
-878
ExcelDto.java
...com/yeejoin/amos/boot/module/common/api/dto/ExcelDto.java
+26
-2
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
+3
-2
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
+53
-13
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
+33
-1
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
+17
-10
ExcelController.java
.../amos/boot/module/jcs/biz/controller/ExcelController.java
+39
-789
DataSourcesImpl.java
...mos/boot/module/jcs/biz/service/impl/DataSourcesImpl.java
+3
-1
ExcelServiceImpl.java
...os/boot/module/jcs/biz/service/impl/ExcelServiceImpl.java
+786
-0
AlertCalledController.java
...boot/module/tzs/biz/controller/AlertCalledController.java
+130
-40
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
;
import
com.yeejoin.amos.boot.biz.common.utils.DateUtils
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
org.springframework.util.StringUtils
;
import
java.util.Date
;
@Data
public
class
ExcelDto
{
@ApiModelProperty
(
value
=
"文件名称"
)
private
String
fileName
;
private
String
fileName
;
@ApiModelProperty
(
value
=
"sheet页名称"
)
private
String
sheetName
;
@ApiModelProperty
(
value
=
"类包全路径"
)
private
String
classUrl
;
@ApiModelProperty
(
value
=
"导出类型 来源于ExcelEnums常量"
)
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
...
...
@@ -90,5 +90,8 @@ public class KeySiteDto extends BaseDto implements Serializable{
@ApiModelProperty
(
value
=
"附件"
)
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 {
@ExcelProperty
(
value
=
"建筑高度(m)"
,
index
=
5
)
@ApiModelProperty
(
value
=
"建筑高度(m)"
)
private
String
buildingHeight
;
@ExplicitConstraint
(
type
=
"NHDJ"
,
indexNum
=
6
,
sourceClass
=
RoleNameExplicitConstraint
.
class
)
//动态下拉内容
@ExcelProperty
(
value
=
"耐火等级"
,
index
=
6
)
@ApiModelProperty
(
value
=
"耐火等级"
)
private
String
fireEnduranceRate
;
@ExplicitConstraint
(
type
=
"JZWSYXZ"
,
indexNum
=
7
,
sourceClass
=
RoleNameExplicitConstraint
.
class
)
//动态下拉内容
@ExcelProperty
(
value
=
"使用性质"
,
index
=
7
)
@ApiModelProperty
(
value
=
"使用性质"
)
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
;
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;
* @date 2021-07-16
*/
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 @@
<artifactId>
amos-boot-biz-common
</artifactId>
<version>
${amos-biz-boot.version}
</version>
</dependency>
<dependency>
<groupId>
com.amosframework.boot
</groupId>
<artifactId>
amos-boot-module-common-api
</artifactId>
<version>
${amos-biz-boot.version}
</version>
</dependency>
</dependencies>
</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
;
import
com.yeejoin.amos.boot.biz.common.dto.BaseDto
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
com.yeejoin.amos.boot.biz.common.dto.BaseDto
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
java.util.Date
;
/**
...
...
@@ -27,6 +28,9 @@ public class AlertCalledDto extends BaseDto {
@ApiModelProperty
(
value
=
"警情来源类型"
)
private
String
alertSource
;
@ApiModelProperty
(
value
=
"警情来源类型code"
)
private
String
alertSourceCode
;
@ApiModelProperty
(
value
=
"接警时间"
)
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
;
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.ApiModelProperty
;
import
lombok.Data
;
...
...
@@ -19,7 +19,7 @@ import java.util.Date;
@Accessors
(
chain
=
true
)
@TableName
(
"tcb_elevator"
)
@ApiModel
(
value
=
"ElevatorDto"
,
description
=
"ElevatorDto"
)
public
class
ElevatorDto
extends
Base
Entity
{
public
class
ElevatorDto
extends
Base
Dto
{
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
;
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.ApiModelProperty
;
import
lombok.Data
;
...
...
@@ -17,7 +17,7 @@ import lombok.experimental.Accessors;
@Accessors
(
chain
=
true
)
@TableName
(
"cb_maintenance_unit"
)
@ApiModel
(
value
=
"MaintenanceUnitDto"
,
description
=
"MaintenanceUnitDto"
)
public
class
MaintenanceUnitDto
extends
Base
Entity
{
public
class
MaintenanceUnitDto
extends
Base
Dto
{
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
;
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.ApiModelProperty
;
import
lombok.Data
;
...
...
@@ -17,7 +17,7 @@ import lombok.experimental.Accessors;
@Accessors
(
chain
=
true
)
@TableName
(
"tcb_rescue_station"
)
@ApiModel
(
value
=
"RescueStationDto"
,
description
=
"RescueStationDto"
)
public
class
RescueStationDto
extends
Base
Entity
{
public
class
RescueStationDto
extends
Base
Dto
{
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
;
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.ApiModelProperty
;
import
lombok.Data
;
...
...
@@ -17,7 +17,7 @@ import lombok.experimental.Accessors;
@Accessors
(
chain
=
true
)
@TableName
(
"tcb_use_unit"
)
@ApiModel
(
value
=
"UseUnitDto"
,
description
=
"UseUnitDto"
)
public
class
UseUnitDto
extends
Base
Entity
{
public
class
UseUnitDto
extends
Base
Dto
{
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;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
com.yeejoin.amos.boot.biz.common.entity.BaseEntity
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
lombok.experimental.Accessors
;
import
java.util.Date
;
/**
...
...
@@ -35,6 +37,12 @@ public class AlertCalled extends BaseEntity {
private
String
alertSource
;
/**
* 警情来源类型Code
*/
@TableField
(
"alert_source_code"
)
private
String
alertSourceCode
;
/**
* 接警时间
*/
@TableField
(
"call_time"
)
...
...
@@ -154,4 +162,26 @@ public class AlertCalled extends BaseEntity {
@TableField
(
"org_code"
)
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 {
DHBJ
(
"233"
,
"电话报警"
),
// 警情阶段
JJ
(
"
240
"
,
"接警"
),
JJ
(
"
JJQK-247
"
,
"接警"
),
PQ
(
"241"
,
"派遣"
),
DD
(
"242"
,
"抵达"
),
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
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
...
...
@@ -108,15 +109,18 @@ public class CommandController extends BaseController {
private
String
readUrl
;
@Autowired
EquipFeignClient
equipFeignClient
;
@Autowired
IKeySiteService
keySiteService
;
@Autowired
IPowerTransferCompanyService
powerTransferCompanyService
;
@Autowired
ISourceFileService
sourceFileService
;
@Value
(
"${video.url}"
)
private
String
videoUrl
;
@Autowired
IDutyPersonService
iDutyPersonService
;
/**
...
...
@@ -691,7 +695,10 @@ public class CommandController extends BaseController {
if
(
AlertCalled
.
getUnitInvolved
()!=
null
&&!
""
.
equals
(
AlertCalled
.
getUnitInvolved
()))
{
List
<
OrgUsrzhDto
>
orgUsrzhDto
=
iOrgUsrService
.
getOrgUsrzhDto
(
AlertCalled
.
getUnitInvolved
());
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 {
@GetMapping
(
value
=
"/AlertCalledcountTime"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"执勤动态警情信息统计"
,
notes
=
"执勤动态警情信息统计"
)
public
ResponseModel
<
Object
>
AlertCalledcountTime
()
{
List
<
KeyValueLabel
>
listdate
=
new
ArrayList
<>();
listdate
.
add
(
new
KeyValueLabel
(
"今年警情数量"
,
""
,
iAlertCalledService
.
AlertCalledcountTime
(
1
)));
listdate
.
add
(
new
KeyValueLabel
(
"当月警情数量"
,
""
,
iAlertCalledService
.
AlertCalledcountTime
(
2
)));
...
...
@@ -734,7 +740,6 @@ public class CommandController extends BaseController {
@GetMapping
(
value
=
"/getTodayPowerTransferCompany"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"当天力量调派"
,
notes
=
"当天力量调派"
)
public
ResponseModel
<
Object
>
getTodayPowerTransferCompany
()
{
return
ResponseHelper
.
buildResponse
(
powerTransferCompanyService
.
getTodayPowerTransferCompany
());
}
...
...
@@ -742,7 +747,6 @@ public class CommandController extends BaseController {
@GetMapping
(
value
=
"/getTodayAlertCalled"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"当天接警记录"
,
notes
=
"当天接警记录"
)
public
ResponseModel
<
Object
>
getTodayAlertCalled
()
{
return
ResponseHelper
.
buildResponse
(
iAlertCalledService
.
getTodayAlertCalled
());
}
...
...
@@ -750,7 +754,6 @@ public class CommandController extends BaseController {
@GetMapping
(
value
=
"/getFireTeamCountList"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"执勤力量"
,
notes
=
"执勤力量"
)
public
ResponseModel
<
Object
>
getFireTeamCountList
()
{
return
ResponseHelper
.
buildResponse
(
iFireTeamService
.
getFireTeamCountList
());
}
...
...
@@ -771,9 +774,7 @@ public class CommandController extends BaseController {
@RequestMapping
(
value
=
"/findDutyCarStateBy"
,
method
=
RequestMethod
.
GET
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"当日气象预警"
,
notes
=
"当日气象预警"
)
public
ResponseModel
<
Object
>
findDutyCarStateBy
()
throws
Exception
{
List
<
SeismometeorologyDto
>
li
=
seismometeorologyDtoDao
.
findDutyCarStateBy
();
return
ResponseHelper
.
buildResponse
(
li
);
}
...
...
@@ -785,9 +786,7 @@ public class CommandController extends BaseController {
@GetMapping
(
value
=
"fireCar/list"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"车辆资源"
,
notes
=
"车辆资源"
)
public
ResponseModel
<
List
<
Map
<
String
,
Object
>>>
getTeamCarList
(
RequestData
par
)
{
ResponseModel
<
List
<
Map
<
String
,
Object
>>>
date
=
equipFeignClient
.
getTeamCarList
(
par
.
getLongitude
(),
par
.
getLatitude
());
return
ResponseHelper
.
buildResponse
(
date
!=
null
?
date
.
getResult
():
null
);
}
...
...
@@ -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;
import
org.typroject.tyboot.core.restful.utils.ResponseHelper
;
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.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.boot.biz.common.controller.BaseController
;
...
...
@@ -107,11 +109,20 @@ public class KeySiteController extends BaseController {
@GetMapping
(
value
=
"find/{sequenceNbr}"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"根据sequenceNbr查询单个重点部位"
,
notes
=
"根据sequenceNbr查询单个重点部位"
)
public
ResponseModel
<
KeySiteDto
>
selectOne
(
@PathVariable
Long
sequenceNbr
)
{
List
<
String
>
list
=
new
ArrayList
<
String
>();
Map
<
String
,
List
<
AttachmentDto
>>
files
=
sourceFileService
.
getAttachments
(
sequenceNbr
);
KeySiteDto
dto
=
keySiteService
.
getSequenceNbr
(
sequenceNbr
);
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
);
}
...
...
@@ -123,7 +134,7 @@ public class KeySiteController extends BaseController {
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@
Pos
tMapping
(
value
=
"/page"
)
@
Ge
tMapping
(
value
=
"/page"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"重点部位分页查询"
,
notes
=
"重点部位分页查询"
)
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
,
...
...
@@ -149,19 +160,21 @@ public class KeySiteController extends BaseController {
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"机场单位部位树"
,
notes
=
"机场单位部位树"
)
@GetMapping
(
value
=
"/getOrguserTree"
)
public
ResponseModel
<
List
<
OrgMenuDto
>>
getOrguserTree
()
throws
Exception
{
public
ResponseModel
<
List
<
OrgMenuDto
>>
getOrguserTree
()
{
List
<
OrgMenuDto
>
list
=
new
ArrayList
<
OrgMenuDto
>();
OrgMenuDto
orgMenuDto
=
new
OrgMenuDto
();
orgMenuDto
.
setChildren
(
keySiteService
.
getOrguserTree
());
orgMenuDto
.
setName
(
"单位管理"
);
orgMenuDto
.
setKey
(-
1L
);
orgMenuDto
.
setTitle
(
"单位管理"
);
list
.
add
(
orgMenuDto
);
return
ResponseHelper
.
buildResponse
(
list
);
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"建筑部位树"
,
notes
=
"建筑部位树"
)
@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
));
}
}
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
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONArray
;
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.biz.common.controller.BaseController
;
...
...
@@ -88,6 +90,22 @@ public class WaterResourceController extends BaseController {
model
.
setResourceTypeName
(
resourceTypeEnum
.
get
().
getName
());
model
.
setRealityImg
(
JSONArray
.
toJSONString
(
model
.
getRealityImgList
()));
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
))
{
switch
(
resourceType
)
{
case
"hydrant"
:
...
...
@@ -156,6 +174,21 @@ public class WaterResourceController extends BaseController {
@ApiOperation
(
httpMethod
=
"PUT"
,
value
=
"根据sequenceNbr更新"
,
notes
=
"根据sequenceNbr更新"
)
public
ResponseModel
<
WaterResourceDto
>
updateBySequenceNbrWaterResource
(
@RequestBody
WaterResourceDto
model
,
@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
.
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;
import
org.apache.commons.lang3.ObjectUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.velocity.runtime.directive.Foreach
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
...
...
@@ -20,6 +21,7 @@ import org.typroject.tyboot.core.restful.utils.ResponseModel;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.core.toolkit.Sequence
;
...
...
@@ -189,7 +191,7 @@ public class KeySiteServiceImpl extends BaseService<KeySiteDto, KeySite, KeySite
public
List
<
OrgMenuDto
>
getOrguserTree
()
{
List
<
OrgUsrTreeDto
>
list
=
orgUsrMapper
.
getCompanyAndCountDepartment
();
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
,
o
.
getBizOrgCode
());
return
menu
;
...
...
@@ -250,6 +252,7 @@ public class KeySiteServiceImpl extends BaseService<KeySiteDto, KeySite, KeySite
if
(
fireEnduranceRateArray
.
length
>
1
)
{
keySiteDto
.
setFireEnduranceRate
(
fireEnduranceRateArray
[
1
]);
}
keySiteDto
.
setFireEnduranceRateName
(
fireEnduranceRateArray
[
0
]);
}
if
(
StringUtils
.
isNotBlank
(
keySiteExcleDto
.
getUseNature
())
&&
keySiteExcleDto
.
getUseNature
().
contains
(
"@"
))
{
...
...
@@ -257,6 +260,7 @@ public class KeySiteServiceImpl extends BaseService<KeySiteDto, KeySite, KeySite
if
(
useNatureArray
.
length
>
1
)
{
keySiteDto
.
setUseNature
(
useNatureArray
[
1
]);
}
keySiteDto
.
setUseNatureName
(
useNatureArray
[
0
]);
}
if
(
keySiteExcleDto
.
getFirePreventionFlagName
().
equals
(
"有"
))
{
keySiteDto
.
setFirePreventionFlag
(
true
);
...
...
@@ -286,6 +290,8 @@ public class KeySiteServiceImpl extends BaseService<KeySiteDto, KeySite, KeySite
}).
collect
(
Collectors
.
toList
());
List
<
OrgMenuDto
>
list1
=
new
ArrayList
<
OrgMenuDto
>();
OrgMenuDto
orgMenuDto
=
new
OrgMenuDto
();
orgMenuDto
.
setKey
(
sequenceNbr
);
orgMenuDto
.
setValue
(
sequenceNbr
);
orgMenuDto
.
setChildren
(
buildTreeParallel
(
menuList
));
orgMenuDto
.
setName
(
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
;
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.QueryWrapper
;
import
com.google.common.collect.Lists
;
...
...
@@ -81,7 +83,23 @@ public class LinkageUnitServiceImpl extends BaseService<LinkageUnitDto, LinkageU
*/
@Transactional
public
LinkageUnitDto
saveModel
(
LinkageUnitDto
linkageUnitDto
)
{
//1.保存行数据
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.保存行数据
String
groupCode
=
this
.
getGroupCode
();
Map
<
String
,
Object
>
map
=
Bean
.
BeantoMap
(
linkageUnitDto
);
Long
instanceId
=
dynamicFormInstanceService
.
commonSave
(
groupCode
,
map
);
...
...
@@ -126,6 +144,20 @@ public class LinkageUnitServiceImpl extends BaseService<LinkageUnitDto, LinkageU
@Transactional
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
);
// 修改行信息
...
...
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
@Override
public
List
<
OrgUsrzhDto
>
getOrgUsrzhDto
(
String
name
)
{
// TODO Auto-generated method stub
return
orgUsrMapper
.
getOrgUsrzhDto
(
name
);
List
<
OrgUsrzhDto
>
list
=
orgUsrMapper
.
getOrgUsrzhDto
(
name
);
return
list
;
}
@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
* @param sourceId
* @return
*/
@Override
public
Map
<
String
,
List
<
AttachmentDto
>>
getAttachments
(
Long
sourceId
)
{
Map
<
String
,
List
<
AttachmentDto
>>
attachmentMap
=
Maps
.
newHashMap
();
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;
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.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.AircraftListTreeDto
;
import
com.yeejoin.amos.boot.module.jcs.api.entity.Aircraft
;
...
...
@@ -48,7 +49,8 @@ public class AircraftController extends BaseController {
private
AircraftServiceImpl
aircraftServiceImpl
;
@Autowired
DataSourcesImpl
dataSourcesImpl
;
@Autowired
IotFeignClient
iotFeignClient
;
/**
* 新增航空器信息
*
...
...
@@ -159,9 +161,7 @@ public class AircraftController extends BaseController {
@GetMapping
(
value
=
"/getAircraftNum"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"获取24小时内的航班号"
,
notes
=
"获取24小时内的航班号"
)
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
>
map1
=
new
HashedMap
();
map
.
put
(
"id"
,
"1"
);
map
.
put
(
"name"
,
"测试"
);
...
...
@@ -181,13 +181,20 @@ public class AircraftController extends BaseController {
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"通过航班号,查询最新的航班信息"
,
notes
=
"通过航班号,查询最新的航班信息"
)
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"
);
map1
.
put
(
"passengerCapacity"
,
"测试2"
);
return
ResponseHelper
.
buildResponse
(
map1
);
ResponseModel
<
Map
<
String
,
Object
>>
dataModel
=
iotFeignClient
.
getDynamicFlightInfo
(
num
);
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
);
}
...
...
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
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jcs
.
biz
.
controller
;
import
java.io.InputStream
;
import
java.text.ParseException
;
import
java.text.SimpleDateFormat
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.concurrent.atomic.AtomicInteger
;
import
javax.servlet.http.HttpServletResponse
;
import
org.apache.commons.beanutils.ConvertUtils
;
import
org.apache.poi.ss.usermodel.Cell
;
import
org.apache.poi.ss.usermodel.Row
;
import
org.apache.poi.xssf.usermodel.XSSFSheet
;
import
org.apache.poi.xssf.usermodel.XSSFWorkbook
;
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.jcs.biz.service.impl.ExcelServiceImpl
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.util.StringUtils
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
...
...
@@ -28,69 +14,9 @@ import org.springframework.web.bind.annotation.RequestPart;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.multipart.MultipartFile
;
import
org.typroject.tyboot.core.foundation.enumeration.UserType
;
import
org.typroject.tyboot.core.foundation.utils.Bean
;
import
org.typroject.tyboot.core.foundation.utils.ValidationUtil
;
import
org.typroject.tyboot.core.restful.doc.TycloudOperation
;
import
com.alibaba.excel.support.ExcelTypeEnum
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.toolkit.Sequence
;
import
com.google.common.collect.Lists
;
import
com.yeejoin.amos.boot.biz.common.controller.BaseController
;
import
com.yeejoin.amos.boot.biz.common.feign.AmosFeignService
;
import
com.yeejoin.amos.boot.biz.common.utils.DateUtils
;
import
com.yeejoin.amos.boot.module.common.api.dto.CompanyPerson
;
import
com.yeejoin.amos.boot.module.common.api.dto.DutyCarDto
;
import
com.yeejoin.amos.boot.module.common.api.dto.DutyPersonDto
;
import
com.yeejoin.amos.boot.module.common.api.dto.DutyPersonShiftDto
;
import
com.yeejoin.amos.boot.module.common.api.dto.DutyShiftDto
;
import
com.yeejoin.amos.boot.module.common.api.dto.ExcelDto
;
import
com.yeejoin.amos.boot.module.common.api.dto.FireChemicalDto
;
import
com.yeejoin.amos.boot.module.common.api.dto.FireExpertsDto
;
import
com.yeejoin.amos.boot.module.common.api.dto.FireStationDto
;
import
com.yeejoin.amos.boot.module.common.api.dto.FireTeamDto
;
import
com.yeejoin.amos.boot.module.common.api.dto.FirefightersDto
;
import
com.yeejoin.amos.boot.module.common.api.dto.FirefightersExcelDto
;
import
com.yeejoin.amos.boot.module.common.api.dto.FirefightersInfoDto
;
import
com.yeejoin.amos.boot.module.common.api.dto.KeySiteExcleDto
;
import
com.yeejoin.amos.boot.module.common.api.dto.MaintenancePersonExcleDto
;
import
com.yeejoin.amos.boot.module.common.api.dto.OrgUsrDto
;
import
com.yeejoin.amos.boot.module.common.api.dto.WaterResourceDto
;
import
com.yeejoin.amos.boot.module.common.api.entity.DynamicFormColumn
;
import
com.yeejoin.amos.boot.module.common.api.entity.DynamicFormInstance
;
import
com.yeejoin.amos.boot.module.common.api.entity.FireChemical
;
import
com.yeejoin.amos.boot.module.common.api.entity.FireExperts
;
import
com.yeejoin.amos.boot.module.common.api.entity.FireStation
;
import
com.yeejoin.amos.boot.module.common.api.entity.FireTeam
;
import
com.yeejoin.amos.boot.module.common.api.entity.Firefighters
;
import
com.yeejoin.amos.boot.module.common.api.entity.FirefightersContacts
;
import
com.yeejoin.amos.boot.module.common.api.entity.MaintenanceCompany
;
import
com.yeejoin.amos.boot.module.common.api.excel.ExcelUtil
;
import
com.yeejoin.amos.boot.module.common.api.service.IDutyPersonService
;
import
com.yeejoin.amos.boot.module.common.api.service.IKeySiteService
;
import
com.yeejoin.amos.boot.module.common.api.service.IMaintenanceCompanyService
;
import
com.yeejoin.amos.boot.module.common.biz.service.impl.DutyCarServiceImpl
;
import
com.yeejoin.amos.boot.module.common.biz.service.impl.DutyCommonServiceImpl
;
import
com.yeejoin.amos.boot.module.common.biz.service.impl.DutyPersonServiceImpl
;
import
com.yeejoin.amos.boot.module.common.biz.service.impl.DutyPersonShiftServiceImpl
;
import
com.yeejoin.amos.boot.module.common.biz.service.impl.DutyShiftServiceImpl
;
import
com.yeejoin.amos.boot.module.common.biz.service.impl.DynamicFormColumnServiceImpl
;
import
com.yeejoin.amos.boot.module.common.biz.service.impl.FireChemicalServiceImpl
;
import
com.yeejoin.amos.boot.module.common.biz.service.impl.FireExpertsServiceImpl
;
import
com.yeejoin.amos.boot.module.common.biz.service.impl.FireStationServiceImpl
;
import
com.yeejoin.amos.boot.module.common.biz.service.impl.FirefightersServiceImpl
;
import
com.yeejoin.amos.boot.module.common.biz.service.impl.OrgUsrServiceImpl
;
import
com.yeejoin.amos.boot.module.common.biz.service.impl.WaterResourceServiceImpl
;
import
com.yeejoin.amos.boot.module.jcs.api.dto.AircraftDto
;
import
com.yeejoin.amos.boot.module.jcs.api.entity.Aircraft
;
import
com.yeejoin.amos.boot.module.jcs.api.enums.ExcelEnums
;
import
com.yeejoin.amos.boot.module.jcs.biz.service.impl.AircraftServiceImpl
;
import
com.yeejoin.amos.boot.module.jcs.biz.service.impl.DataSourcesImpl
;
import
com.yeejoin.amos.boot.module.jcs.biz.service.impl.EquipmentServiceImpl
;
import
com.yeejoin.amos.boot.module.jcs.biz.service.impl.FireTeamServiceImpl
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
javax.servlet.http.HttpServletResponse
;
/**
* 导出导入
...
...
@@ -104,67 +30,16 @@ import io.swagger.annotations.ApiOperation;
public
class
ExcelController
extends
BaseController
{
@Autowired
DataSourcesImpl
dataSourcesImpl
;
@Autowired
FireChemicalServiceImpl
fireChemicalServiceImpl
;
@Autowired
FireExpertsServiceImpl
fireExpertsServiceImpl
;
@Autowired
WaterResourceServiceImpl
waterResourceServiceImpl
;
@Autowired
AircraftServiceImpl
aircraftServiceImpl
;
@Autowired
FireTeamServiceImpl
fireTeamService
;
@Autowired
FireStationServiceImpl
fireStationService
;
@Autowired
FirefightersServiceImpl
firefightersService
;
@Autowired
DutyCarServiceImpl
dutyCarService
;
@Autowired
AmosFeignService
amosFeignService
;
@Autowired
EquipmentServiceImpl
equipmentService
;
@Autowired
DutyShiftServiceImpl
dutyShiftService
;
@Autowired
DutyCommonServiceImpl
dutyCommonServiceImpl
;
@Autowired
DutyPersonServiceImpl
dutyPersonService
;
@Autowired
DutyPersonShiftServiceImpl
dutyPersonShiftService
;
@Autowired
OrgUsrServiceImpl
orgUsrService
;
@Autowired
IDutyPersonService
iDutyPersonService
;
@Autowired
IMaintenanceCompanyService
maintenanceCompanyService
;
@Autowired
DynamicFormColumnServiceImpl
dynamicFormColumnService
;
@Autowired
Sequence
sequence
;
@Autowired
IKeySiteService
keySiteService
;
ExcelServiceImpl
excelService
;
private
static
final
String
NOT_DUTY
=
"休班"
;
private
static
final
String
PERSON
=
"PERSON"
;
private
static
final
String
MAINTENANCE_PERSON
=
"maintenancePerson"
;
@TycloudOperation
(
needAuth
=
false
,
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"下载模板"
)
@GetMapping
(
"/template"
)
public
void
template
(
HttpServletResponse
response
,
ExcelDto
excelDto
)
{
try
{
String
url
=
excelDto
.
getClassUrl
();
Class
<?>
clz
=
Class
.
forName
(
url
);
ExcelUtil
.
createTemplate
(
response
,
excelDto
.
getFileName
(),
excelDto
.
getSheetName
(),
null
,
clz
,
dataSourcesImpl
,
true
);
excelService
.
templateExport
(
response
,
excelDto
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
throw
new
RuntimeException
(
"系统异常!"
);
...
...
@@ -172,59 +47,13 @@ public class ExcelController extends BaseController {
}
@TycloudOperation
(
needAuth
=
false
,
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"导出公用类"
)
@GetMapping
(
"/export"
)
public
void
getFireStationFile
(
HttpServletResponse
response
,
ExcelDto
excelDto
)
{
@ApiOperation
(
value
=
"下载模板"
)
@GetMapping
(
"/download/template"
)
public
void
downloadTemplate
(
HttpServletResponse
response
,
@RequestParam
(
required
=
false
)
String
fileName
,
@RequestParam
(
required
=
false
)
String
sheetName
,
@RequestParam
String
classUrl
)
{
try
{
switch
(
excelDto
.
getType
())
{
case
ExcelEnums
.
WHP
:
List
<
FireChemicalDto
>
data
=
fireChemicalServiceImpl
.
queryForFireChemicalList
(
false
);
ExcelUtil
.
createTemplate
(
response
,
excelDto
.
getFileName
(),
excelDto
.
getSheetName
(),
data
,
FireChemicalDto
.
class
,
dataSourcesImpl
,
false
);
break
;
case
ExcelEnums
.
XFZJ
:
List
<
FireExpertsDto
>
fireExpertsDtoList
=
fireExpertsServiceImpl
.
queryForFireExpertsList
(
false
);
ExcelUtil
.
createTemplate
(
response
,
excelDto
.
getFileName
(),
excelDto
.
getSheetName
(),
fireExpertsDtoList
,
FireExpertsDto
.
class
,
dataSourcesImpl
,
false
);
break
;
case
ExcelEnums
.
SYXX
:
List
<
WaterResourceDto
>
waterResourceDtoList
=
waterResourceServiceImpl
.
exportToExcel
(
true
);
ExcelUtil
.
createTemplate
(
response
,
excelDto
.
getFileName
(),
excelDto
.
getSheetName
(),
waterResourceDtoList
,
WaterResourceDto
.
class
,
dataSourcesImpl
,
false
);
break
;
case
ExcelEnums
.
HKQ
:
List
<
AircraftDto
>
aircraftDtoList
=
aircraftServiceImpl
.
queryAircraftDtoForList
(
false
);
ExcelUtil
.
createTemplate
(
response
,
excelDto
.
getFileName
(),
excelDto
.
getSheetName
(),
aircraftDtoList
,
AircraftDto
.
class
,
dataSourcesImpl
,
false
);
break
;
case
ExcelEnums
.
XFDW
:
List
<
FireTeamDto
>
fireTeamDtoList
=
fireTeamService
.
queryFireTeamForList
(
false
);
ExcelUtil
.
createTemplate
(
response
,
excelDto
.
getFileName
(),
excelDto
.
getSheetName
(),
fireTeamDtoList
,
FireTeamDto
.
class
,
dataSourcesImpl
,
false
);
break
;
case
ExcelEnums
.
WXXFZ
:
List
<
FireStationDto
>
fireStationDtoList
=
fireStationService
.
queryForFireStationList
(
false
);
ExcelUtil
.
createTemplate
(
response
,
excelDto
.
getFileName
(),
excelDto
.
getSheetName
(),
fireStationDtoList
,
FireStationDto
.
class
,
null
,
false
);
break
;
case
ExcelEnums
.
XFRY
:
List
<
FirefightersExcelDto
>
firefightersExcelDtoList
=
firefightersService
.
exportToExcel
(
false
);
ExcelUtil
.
createTemplate
(
response
,
excelDto
.
getFileName
(),
excelDto
.
getSheetName
(),
firefightersExcelDtoList
,
FirefightersExcelDto
.
class
,
null
,
false
);
break
;
case
ExcelEnums
.
WBRY
:
List
<
MaintenancePersonExcleDto
>
maintenancePersonExcleDtoList
=
maintenanceCompanyService
.
exportToMaintenancePersonExcel
();
ExcelUtil
.
createTemplate
(
response
,
excelDto
.
getFileName
(),
excelDto
.
getSheetName
(),
maintenancePersonExcleDtoList
,
MaintenancePersonExcleDto
.
class
,
null
,
false
);
break
;
case
ExcelEnums
.
KEYSITE
:
List
<
KeySiteExcleDto
>
keySiteDtoList
=
keySiteService
.
exportToExcel
();
ExcelUtil
.
createTemplate
(
response
,
excelDto
.
getFileName
(),
excelDto
.
getSheetName
(),
keySiteDtoList
,
KeySiteExcleDto
.
class
,
null
,
false
);
break
;
}
ExcelDto
excelDto
=
new
ExcelDto
(
fileName
,
sheetName
,
classUrl
,
toString
());
excelService
.
templateExport
(
response
,
excelDto
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
throw
new
RuntimeException
(
"系统异常!"
);
...
...
@@ -232,459 +61,42 @@ public class ExcelController extends BaseController {
}
@TycloudOperation
(
needAuth
=
false
,
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"
上传文件数据-
"
)
@
PostMapping
(
"/upload
"
)
public
void
template2
(
@RequestPart
(
"file"
)
MultipartFile
multipartFil
e
,
ExcelDto
excelDto
)
{
@ApiOperation
(
value
=
"
导出公用类
"
)
@
GetMapping
(
"/export
"
)
public
void
getFireStationFile
(
HttpServletResponse
respons
e
,
ExcelDto
excelDto
)
{
try
{
switch
(
excelDto
.
getType
())
{
case
ExcelEnums
.
WHP
:
excelImportFireChemical
(
multipartFile
);
break
;
case
ExcelEnums
.
XFZJ
:
excelImportFireExperts
(
multipartFile
);
break
;
case
ExcelEnums
.
SYXX
:
excelImportWaterResource
(
multipartFile
);
break
;
case
ExcelEnums
.
HKQ
:
excelImportAircraft
(
multipartFile
);
break
;
case
ExcelEnums
.
XFDW
:
excelImportFireTeam
(
multipartFile
);
break
;
case
ExcelEnums
.
WXXFZ
:
excelImportFireStation
(
multipartFile
);
break
;
case
ExcelEnums
.
XFRY
:
excelImportFirefighters
(
multipartFile
);
break
;
case
ExcelEnums
.
CLZQ
:
excelImportDutyPerson
(
multipartFile
,
ExcelEnums
.
CLZQ
);
break
;
case
ExcelEnums
.
RYZB
:
excelImportDutyPerson
(
multipartFile
,
ExcelEnums
.
RYZB
);
case
ExcelEnums
.
WBRY
:
excelImportMaintenancePerson
(
multipartFile
,
ExcelEnums
.
WBRY
);
case
ExcelEnums
.
KEYSITE
:
excelImportkeySite
(
multipartFile
,
ExcelEnums
.
KEYSITE
);
}
excelService
.
commonExport
(
response
,
excelDto
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
throw
new
RuntimeException
(
"系统异常!"
);
}
}
/**
* @param multipartFile
* @param wbry
* @throws Exception
* @author chenhao
*/
@SuppressWarnings
(
"unused"
)
private
void
excelImportkeySite
(
MultipartFile
multipartFile
,
String
wbry
)
throws
Exception
{
List
<
KeySiteExcleDto
>
excelDtoList
=
ExcelUtil
.
readFirstSheetExcel
(
multipartFile
,
KeySiteExcleDto
.
class
,
1
);
keySiteService
.
saveExcel
(
excelDtoList
);
}
/**
* @param multipartFile
* @param wbry
* @throws Exception
* @author chenhao
*/
private
void
excelImportMaintenancePerson
(
MultipartFile
multipartFile
,
String
wbry
)
throws
Exception
{
List
<
MaintenancePersonExcleDto
>
excelDtoList
=
ExcelUtil
.
readFirstSheetExcel
(
multipartFile
,
MaintenancePersonExcleDto
.
class
,
1
);
List
<
DynamicFormColumn
>
columns
=
dynamicFormColumnService
.
list
(
new
LambdaQueryWrapper
<
DynamicFormColumn
>().
eq
(
DynamicFormColumn:
:
getGroupCode
,
MAINTENANCE_PERSON
));
List
<
MaintenanceCompany
>
maintenanceCompanyList
=
new
ArrayList
<
MaintenanceCompany
>();
List
<
DynamicFormInstance
>
dynamicFormInstanceList
=
new
ArrayList
<
DynamicFormInstance
>();
for
(
MaintenancePersonExcleDto
maintenancePersonExcleDto
:
excelDtoList
)
{
Long
instanceId
=
sequence
.
nextId
();
// 先填充主表的属性
MaintenanceCompany
maintenanceCompany
=
new
MaintenanceCompany
();
maintenanceCompany
=
Bean
.
toPo
(
maintenancePersonExcleDto
,
maintenanceCompany
);
maintenanceCompany
.
setType
(
PERSON
);
if
(
maintenanceCompany
.
getParentId
()
!=
null
)
{
long
getParentId
=
Long
.
valueOf
(
maintenancePersonExcleDto
.
getParentName
().
split
(
"@"
)[
1
]);
maintenanceCompany
.
setParentId
(
getParentId
);
}
if
(
maintenanceCompanyService
.
checkPersonCodeExists
(
maintenancePersonExcleDto
.
getCode
()))
{
maintenanceCompany
.
setBizCode
(
maintenancePersonExcleDto
.
getCode
());
}
else
{
maintenanceCompany
.
setCode
(
null
);
}
maintenanceCompany
.
setOrgCode
(
null
);
maintenanceCompany
.
setBizCode
(
sequence
.
nextId
()
+
""
);
maintenanceCompany
.
setInstanceId
(
instanceId
);
maintenanceCompanyList
.
add
(
maintenanceCompany
);
maintenanceCompanyService
.
maintenancePersonExcleDtoToDynamicFormInstanceList
(
columns
,
maintenancePersonExcleDto
,
instanceId
,
dynamicFormInstanceList
);
}
maintenanceCompanyService
.
saveMaintenanceCompanyBatch
(
maintenanceCompanyList
,
dynamicFormInstanceList
);
}
private
void
excelImportDutyPerson
(
MultipartFile
multipartFile
,
String
dutyType
)
throws
Exception
{
String
fileName
=
multipartFile
.
getOriginalFilename
();
if
(
fileName
==
null
)
{
throw
new
Exception
(
"文件不存在!"
);
}
if
(!
fileName
.
toLowerCase
().
endsWith
(
ExcelTypeEnum
.
XLS
.
getValue
())
&&
!
fileName
.
toLowerCase
().
endsWith
(
ExcelTypeEnum
.
XLSX
.
getValue
()))
{
throw
new
Exception
(
"文件类型异常!"
);
}
InputStream
input
=
multipartFile
.
getInputStream
();
XSSFWorkbook
workbook
=
new
XSSFWorkbook
(
input
);
XSSFSheet
sheet
=
workbook
.
getSheetAt
(
0
);
List
<
Map
<
String
,
Object
>>
dataList
=
new
ArrayList
<>();
if
(
sheet
!=
null
)
{
//获取表头月份
Row
titleRow
=
sheet
.
getRow
(
0
);
Cell
monthCell
=
titleRow
.
getCell
(
5
);
String
dateStr
=
monthCell
==
null
?
""
:
monthCell
.
toString
();
List
<
Date
>
dayByMonth
=
DateUtils
.
getDayByMonth
(
dateStr
);
if
(
ExcelEnums
.
CLZQ
.
equals
(
dutyType
))
{
initDutyCarData
(
sheet
,
dataList
,
dayByMonth
);
dutyCarService
.
saveImportData
(
dataList
);
}
else
if
(
ExcelEnums
.
RYZB
.
equals
(
dutyType
))
{
initDutyPersonData
(
sheet
,
dataList
,
dayByMonth
);
dutyPersonService
.
saveImportData
(
dataList
);
}
}
}
private
void
initDutyPersonData
(
XSSFSheet
sheet
,
List
<
Map
<
String
,
Object
>>
dataList
,
List
<
Date
>
dayByMonth
)
{
//遍历行,i = 1,从第二行开始,第一行是表头跳过。
for
(
int
i
=
1
;
i
<
sheet
.
getPhysicalNumberOfRows
();
i
++)
{
DutyPersonDto
dutyPersonDto
=
new
DutyPersonDto
();
//row是一行数据,row.getCell(i),代表拿到这一行,第i列数据
Row
row
=
sheet
.
getRow
(
i
);
if
(
row
==
null
)
{
continue
;
}
Cell
cell
=
row
.
getCell
(
1
);
if
(
cell
!=
null
)
{
dutyPersonDto
.
setUserId
(
cell
.
toString
());
cell
=
row
.
getCell
(
2
);
if
(
cell
!=
null
)
{
dutyPersonDto
.
setUserName
(
cell
.
toString
());
}
cell
=
row
.
getCell
(
3
);
if
(
cell
!=
null
)
{
String
[]
split
=
cell
.
toString
().
split
(
"@"
);
dutyPersonDto
.
setDeptName
(
split
[
0
]);
dutyPersonDto
.
setDeptId
(
split
[
1
]);
}
cell
=
row
.
getCell
(
4
);
if
(
cell
!=
null
)
{
String
[]
split
=
cell
.
toString
().
split
(
"@"
);
dutyPersonDto
.
setPostTypeName
(
split
[
0
]);
dutyPersonDto
.
setPostType
(
split
[
1
]);
}
List
<
DutyPersonShiftDto
>
dutyShift
=
new
ArrayList
<>();
for
(
int
j
=
0
;
j
<
dayByMonth
.
size
();
j
++)
{
cell
=
row
.
getCell
(
5
+
j
);
String
dutyType
=
cell
==
null
?
""
:
cell
.
toString
();
if
(!
StringUtils
.
isEmpty
(
dutyType
))
{
DutyPersonShiftDto
dutyPersonShiftDto
=
new
DutyPersonShiftDto
();
dutyPersonShiftDto
.
setDutyDate
(
dayByMonth
.
get
(
j
));
dutyPersonShiftDto
.
setShiftId
(
Long
.
valueOf
(
dutyType
.
split
(
"@"
)[
1
]));
dutyShift
.
add
(
dutyPersonShiftDto
);
}
}
dutyPersonDto
.
setDutyShift
(
dutyShift
);
Map
<
String
,
Object
>
dutyPersonDtoMap
=
Bean
.
BeantoMap
(
dutyPersonDto
);
dataList
.
add
(
dutyPersonDtoMap
);
}
@TycloudOperation
(
needAuth
=
false
,
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"导出公用类2"
)
@GetMapping
(
"/export/list"
)
public
void
exportByType
(
HttpServletResponse
response
,
@RequestParam
(
required
=
false
)
String
fileName
,
@RequestParam
(
required
=
false
)
String
sheetName
,
@RequestParam
String
type
)
{
try
{
excelService
.
commonExport
(
response
,
new
ExcelDto
(
fileName
,
sheetName
,
type
));
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
throw
new
RuntimeException
(
"系统异常!"
);
}
}
private
void
initDutyCarData
(
XSSFSheet
sheet
,
List
<
Map
<
String
,
Object
>>
dataList
,
List
<
Date
>
dayByMonth
)
{
//遍历行,i = 1,从第二行开始,第一行是表头跳过。
for
(
int
i
=
1
;
i
<
sheet
.
getPhysicalNumberOfRows
();
i
++)
{
DutyCarDto
dutyCarDto
=
new
DutyCarDto
();
//row是一行数据,row.getCell(i),代表拿到这一行,第i列数据
Row
row
=
sheet
.
getRow
(
i
);
if
(
row
==
null
)
{
continue
;
}
Cell
cell
=
row
.
getCell
(
1
);
if
(
cell
!=
null
)
{
String
[]
split
=
cell
.
toString
().
split
(
"@"
);
dutyCarDto
.
setTeamName
(
split
[
0
]);
dutyCarDto
.
setTeamId
(
split
[
1
]);
}
cell
=
row
.
getCell
(
2
);
if
(
cell
!=
null
)
{
String
[]
userName
=
cell
.
toString
().
split
(
"@"
);
dutyCarDto
.
setUserName
(
userName
[
0
]);
dutyCarDto
.
setUserId
(
userName
[
1
]);
cell
=
row
.
getCell
(
3
);
if
(
cell
!=
null
)
{
String
[]
postType
=
cell
.
toString
().
split
(
"@"
);
dutyCarDto
.
setPostTypeName
(
postType
[
0
]);
dutyCarDto
.
setPostType
(
postType
[
1
]);
}
cell
=
row
.
getCell
(
4
);
if
(
cell
!=
null
)
{
String
[]
carName
=
cell
.
toString
().
split
(
"@"
);
dutyCarDto
.
setCarName
(
carName
[
0
]);
dutyCarDto
.
setCarId
(
carName
[
1
]);
}
List
<
DutyPersonShiftDto
>
dutyShift
=
dutyCarDto
.
getDutyShift
();
for
(
int
j
=
0
;
j
<
dayByMonth
.
size
();
j
++)
{
cell
=
row
.
getCell
(
5
+
j
);
String
dutyType
=
cell
==
null
?
""
:
cell
.
toString
();
if
(!
StringUtils
.
isEmpty
(
dutyType
))
{
DutyPersonShiftDto
dutyPersonShiftDto
=
new
DutyPersonShiftDto
();
dutyPersonShiftDto
.
setDutyDate
(
dayByMonth
.
get
(
j
));
dutyPersonShiftDto
.
setShiftId
(
Long
.
valueOf
(
dutyType
.
split
(
"@"
)[
1
]));
dutyShift
.
add
(
dutyPersonShiftDto
);
}
}
Map
<
String
,
Object
>
dutyCarDtoMap
=
Bean
.
BeantoMap
(
dutyCarDto
);
dataList
.
add
(
dutyCarDtoMap
);
}
@TycloudOperation
(
needAuth
=
false
,
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"上传文件数据-"
)
@PostMapping
(
"/upload"
)
public
void
upload
(
@RequestPart
(
"file"
)
MultipartFile
multipartFile
,
ExcelDto
excelDto
)
{
try
{
excelService
.
commonUpload
(
multipartFile
,
excelDto
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
throw
new
RuntimeException
(
"系统异常!"
);
}
}
private
void
excelImportFirefighters
(
MultipartFile
multipartFile
)
throws
Exception
{
List
<
FirefightersExcelDto
>
excelDtoList
=
ExcelUtil
.
readFirstSheetExcel
(
multipartFile
,
FirefightersExcelDto
.
class
,
1
);
excelDtoList
.
forEach
(
item
->
{
Firefighters
firefighters
=
new
Firefighters
();
FirefightersContacts
firefightersContacts
=
new
FirefightersContacts
();
firefighters
=
Bean
.
toPo
(
item
,
firefighters
);
firefightersContacts
=
Bean
.
toPo
(
item
,
firefightersContacts
);
if
(
item
.
getFireTeam
()
!=
null
)
{
Long
fireTeamId
=
Long
.
valueOf
(
item
.
getFireTeam
().
split
(
"@"
)[
1
]);
firefighters
.
setFireTeamId
(
fireTeamId
);
}
if
(
firefighters
.
getCertificatesType
()
!=
null
)
{
String
[]
certificates
=
firefighters
.
getCertificatesType
().
split
(
"@"
);
firefighters
.
setCertificatesType
(
certificates
[
0
]);
firefighters
.
setCertificatesTypeCode
(
certificates
[
1
]);
}
if
(
firefighters
.
getState
()
!=
null
)
{
String
[]
state
=
firefighters
.
getState
().
split
(
"@"
);
firefighters
.
setState
(
state
[
0
]);
firefighters
.
setStateCode
(
state
[
1
]);
}
if
(
firefighters
.
getJobTitle
()
!=
null
)
{
String
[]
jobTitle
=
firefighters
.
getJobTitle
().
split
(
"@"
);
firefighters
.
setJobTitle
(
jobTitle
[
0
]);
firefighters
.
setJobTitleCode
(
jobTitle
[
1
]);
}
if
(
firefightersContacts
.
getRelationship
()
!=
null
)
{
String
relationship
=
firefightersContacts
.
getRelationship
().
split
(
"@"
)[
1
];
firefightersContacts
.
setRelationship
(
relationship
);
}
FirefightersInfoDto
firefightersInfo
=
new
FirefightersInfoDto
(
firefighters
,
firefightersContacts
);
firefightersService
.
saveFirefighters
(
firefightersInfo
);
}
);
}
private
void
excelImportFireStation
(
MultipartFile
multipartFile
)
throws
Exception
{
List
<
FireStationDto
>
excelDtoList
=
ExcelUtil
.
readFirstSheetExcel
(
multipartFile
,
FireStationDto
.
class
,
1
);
List
<
FireStation
>
excelEntityList
=
new
ArrayList
<>();
excelDtoList
.
forEach
(
item
->
{
FireStation
fireStation
=
new
FireStation
();
fireStation
=
Bean
.
toPo
(
item
,
fireStation
);
if
(
fireStation
.
getWhereBuilding
()
!=
null
)
{
String
[]
whereBuilding
=
fireStation
.
getWhereBuilding
().
split
(
"@"
);
fireStation
.
setWhereBuilding
(
whereBuilding
[
0
]);
fireStation
.
setWhereBuildingId
(
whereBuilding
[
1
]);
}
if
(
fireStation
.
getBizCompany
()
!=
null
)
{
String
[]
bizCompany
=
fireStation
.
getBizCompany
().
split
(
"@"
);
fireStation
.
setBizCompany
(
bizCompany
[
0
]);
fireStation
.
setBizCompanyId
(
Long
.
valueOf
(
bizCompany
[
1
]));
fireStation
.
setBizCompanyCode
(
bizCompany
[
2
]);
}
excelEntityList
.
add
(
fireStation
);
}
);
fireStationService
.
saveBatch
(
excelEntityList
);
}
private
void
excelImportFireTeam
(
MultipartFile
multipartFile
)
throws
Exception
{
List
<
FireTeamDto
>
excelDtoList
=
ExcelUtil
.
readFirstSheetExcel
(
multipartFile
,
FireTeamDto
.
class
,
1
);
List
<
FireTeam
>
excelEntityList
=
new
ArrayList
<>();
excelDtoList
.
forEach
(
item
->
{
FireTeam
fireTeam
=
new
FireTeam
();
fireTeam
=
Bean
.
toPo
(
item
,
fireTeam
);
if
(
fireTeam
.
getType
()
!=
null
)
{
String
[]
type
=
fireTeam
.
getType
().
split
(
"@"
);
fireTeam
.
setType
(
type
[
0
]);
fireTeam
.
setTypeCode
(
type
[
1
]);
}
if
(
fireTeam
.
getContactUser
()
!=
null
)
{
String
[]
contactUser
=
fireTeam
.
getContactUser
().
split
(
"@"
);
fireTeam
.
setContactUser
(
contactUser
[
0
]);
fireTeam
.
setContactUserId
(
Long
.
valueOf
(
contactUser
[
1
]));
}
if
(
item
.
getParentName
()
!=
null
)
{
String
[]
parentName
=
item
.
getParentName
().
split
(
"@"
);
fireTeam
.
setParent
(
Long
.
valueOf
(
parentName
[
1
]));
}
excelEntityList
.
add
(
fireTeam
);
}
);
fireTeamService
.
saveBatch
(
excelEntityList
);
}
private
void
excelImportAircraft
(
MultipartFile
multipartFile
)
throws
Exception
{
List
<
AircraftDto
>
excelDtoList
=
ExcelUtil
.
readFirstSheetExcel
(
multipartFile
,
AircraftDto
.
class
,
1
);
List
<
Aircraft
>
excelEntityList
=
new
ArrayList
<>();
excelDtoList
.
forEach
(
item
->
{
Aircraft
aircraft
=
new
Aircraft
();
aircraft
=
Bean
.
toPo
(
item
,
aircraft
);
if
(
aircraft
.
getEngineType
()
!=
null
)
{
String
[]
engineType
=
aircraft
.
getEngineType
().
split
(
"@"
);
aircraft
.
setEngineType
(
engineType
[
0
]);
aircraft
.
setEngineTypeCode
(
engineType
[
1
]);
}
if
(
aircraft
.
getFuelType
()
!=
null
)
{
String
[]
fuelType
=
aircraft
.
getFuelType
().
split
(
"@"
);
aircraft
.
setFuelType
(
fuelType
[
0
]);
aircraft
.
setFuelTypeCode
(
fuelType
[
1
]);
}
excelEntityList
.
add
(
aircraft
);
}
);
aircraftServiceImpl
.
saveBatch
(
excelEntityList
);
}
private
void
excelImportFireChemical
(
MultipartFile
multipartFile
)
throws
Exception
{
List
<
FireChemicalDto
>
excelDtoList
=
ExcelUtil
.
readFirstSheetExcel
(
multipartFile
,
FireChemicalDto
.
class
,
1
);
List
<
FireChemical
>
excelEntityList
=
new
ArrayList
<>();
excelDtoList
.
forEach
(
item
->
{
FireChemical
fireChemical
=
new
FireChemical
();
fireChemical
=
Bean
.
toPo
(
item
,
fireChemical
);
if
(
fireChemical
.
getType
()
!=
null
)
{
String
[]
type
=
fireChemical
.
getType
().
split
(
"@"
);
fireChemical
.
setType
(
type
[
0
]);
fireChemical
.
setTypeCode
(
type
[
1
]);
}
excelEntityList
.
add
(
fireChemical
);
}
);
fireChemicalServiceImpl
.
saveBatch
(
excelEntityList
);
}
private
void
excelImportWaterResource
(
MultipartFile
multipartFile
)
throws
Exception
{
List
<
WaterResourceDto
>
excelDtoList
=
ExcelUtil
.
readFirstSheetExcel
(
multipartFile
,
WaterResourceDto
.
class
,
1
);
excelDtoList
.
forEach
(
item
->
{
if
(
item
.
getResourceTypeName
()
!=
null
)
{
String
[]
resourceTypeName
=
item
.
getResourceTypeName
().
split
(
"@"
);
item
.
setResourceTypeName
(
resourceTypeName
[
0
]);
item
.
setResourceType
(
resourceTypeName
[
1
]);
}
if
(
item
.
getSystemType
()
!=
null
)
{
String
[]
systemType
=
item
.
getSystemType
().
split
(
"@"
);
item
.
setSystemType
(
systemType
[
0
]);
item
.
setSystemTypeCode
(
systemType
[
1
]);
}
if
(
item
.
getPlaceForm
()
!=
null
)
{
String
[]
placeForm
=
item
.
getPlaceForm
().
split
(
"@"
);
item
.
setPlaceForm
(
placeForm
[
0
]);
item
.
setPlaceFormCode
(
placeForm
[
1
]);
}
if
(
item
.
getBelongBuilding
()
!=
null
)
{
String
[]
belongBuilding
=
item
.
getBelongBuilding
().
split
(
"@"
);
item
.
setBelongBuilding
(
belongBuilding
[
0
]);
item
.
setBelongBuildingId
(
Long
.
valueOf
(
belongBuilding
[
1
]));
}
if
(
item
.
getBelongFightingSystem
()
!=
null
)
{
String
[]
belongFightingSystem
=
item
.
getBelongFightingSystem
().
split
(
"@"
);
item
.
setBelongFightingSystem
(
belongFightingSystem
[
0
]);
item
.
setBelongFightingSystemId
(
Long
.
valueOf
(
belongFightingSystem
[
1
]));
}
if
(
item
.
getManagementUnit
()
!=
null
)
{
String
[]
managementUnit
=
item
.
getManagementUnit
().
split
(
"@"
);
item
.
setManagementUnit
(
managementUnit
[
0
]);
item
.
setManagementUnitId
(
Long
.
valueOf
(
managementUnit
[
1
]));
}
if
(
item
.
getMaintenanceUnit
()
!=
null
)
{
String
[]
maintenanceUnit
=
item
.
getMaintenanceUnit
().
split
(
"@"
);
item
.
setMaintenanceUnit
(
maintenanceUnit
[
0
]);
item
.
setMaintenanceUnitId
(
Long
.
valueOf
(
maintenanceUnit
[
1
]));
}
if
(
item
.
getHoseConnection
()
!=
null
)
{
String
[]
hoseConnection
=
item
.
getHoseConnection
().
split
(
"@"
);
item
.
setHoseConnection
(
hoseConnection
[
0
]);
item
.
setHoseConnectionCode
(
hoseConnection
[
1
]);
}
if
(
item
.
getIntakeForm
()
!=
null
)
{
String
[]
intakeForm
=
item
.
getIntakeForm
().
split
(
"@"
);
item
.
setIntakeForm
(
intakeForm
[
0
]);
}
if
(
item
.
getPipeTypeName
()
!=
null
)
{
String
[]
pipeTypeName
=
item
.
getPipeTypeName
().
split
(
"@"
);
item
.
setPipeTypeName
(
pipeTypeName
[
0
]);
item
.
setPipeTypeCode
(
pipeTypeName
[
1
]);
}
if
(
item
.
getStatus
()
!=
null
)
{
String
[]
status
=
item
.
getStatus
().
split
(
"@"
);
item
.
setStatus
(
status
[
0
]);
item
.
setStatusCode
(
status
[
1
]);
}
if
(
item
.
getType
()
!=
null
)
{
String
[]
type
=
item
.
getType
().
split
(
"@"
);
item
.
setType
(
type
[
0
]);
item
.
setTypeCode
(
type
[
1
]);
}
waterResourceServiceImpl
.
importByExcel
(
item
);
}
);
}
private
void
excelImportFireExperts
(
MultipartFile
multipartFile
)
throws
Exception
{
List
<
FireExpertsDto
>
excelDtoList
=
ExcelUtil
.
readFirstSheetExcel
(
multipartFile
,
FireExpertsDto
.
class
,
1
);
List
<
FireExperts
>
excelEntityList
=
new
ArrayList
<>();
excelDtoList
.
forEach
(
fireExpertsDto
->
{
FireExperts
fireExperts
=
new
FireExperts
();
fireExperts
=
Bean
.
toPo
(
fireExpertsDto
,
fireExperts
);
if
(
fireExperts
.
getCertificatesType
()
!=
null
)
{
String
[]
certificates
=
fireExperts
.
getCertificatesType
().
split
(
"@"
);
fireExperts
.
setCertificatesType
(
certificates
[
0
]);
fireExperts
.
setCertificatesTypeCode
(
certificates
[
1
]);
}
if
(
fireExperts
.
getJobs
()
!=
null
)
{
String
[]
jobs
=
fireExperts
.
getJobs
().
split
(
"@"
);
fireExperts
.
setJobs
(
jobs
[
0
]);
fireExperts
.
setJobsCode
(
jobs
[
1
]);
}
if
(
fireExperts
.
getExpert
()
!=
null
)
{
String
[]
expert
=
fireExperts
.
getExpert
().
split
(
"@"
);
fireExperts
.
setExpert
(
expert
[
0
]);
fireExperts
.
setExpertCode
(
expert
[
1
]);
}
if
(
fireExperts
.
getHighestEducation
()
!=
null
)
{
String
[]
highestEducation
=
fireExperts
.
getHighestEducation
().
split
(
"@"
);
fireExperts
.
setHighestEducation
(
highestEducation
[
0
]);
}
excelEntityList
.
add
(
fireExperts
);
}
);
fireExpertsServiceImpl
.
saveBatch
(
excelEntityList
);
}
/**
* 导出值班模板
*
...
...
@@ -701,79 +113,11 @@ public class ExcelController extends BaseController {
@RequestParam
(
"endDate"
)
String
endDate
,
ExcelDto
excelDto
,
@RequestParam
(
"ids"
)
String
ids
)
{
try
{
List
<
List
<
Object
>>
data
=
new
ArrayList
<>();
if
(
ExcelEnums
.
CLZQ
.
equals
(
excelDto
.
getType
()))
{
data
=
initDutyCarTemplate
(
ids
);
}
else
if
(
ExcelEnums
.
RYZB
.
equals
(
excelDto
.
getType
()))
{
data
=
initDutyPersonTemplate
(
ids
);
}
// 获取日期
List
<
Map
<
String
,
Object
>>
rangeDate
=
dutyPersonShiftService
.
getBaseMapper
().
genRangeDate
(
beginDate
,
endDate
);
List
<
String
>
dayByMonth
=
new
ArrayList
<>();
rangeDate
.
forEach
(
item
->
dayByMonth
.
add
((
String
)
item
.
get
(
"date"
)));
exportDutyTemplate
(
response
,
excelDto
.
getClassUrl
(),
dayByMonth
,
excelDto
,
data
,
true
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
throw
new
RuntimeException
(
"系统异常!"
);
}
}
private
List
<
List
<
Object
>>
initDutyPersonTemplate
(
String
ids
)
{
List
<
List
<
Object
>>
data
=
new
ArrayList
<>();
// 根据id列表获取部门下的人
List
<
Long
>
idList
=
Lists
.
newArrayList
();
if
(!
ValidationUtil
.
isEmpty
(
ids
))
{
String
[]
strings
=
ids
.
split
(
","
);
Long
[]
convert
=
(
Long
[])
ConvertUtils
.
convert
(
strings
,
Long
.
class
);
idList
=
Arrays
.
asList
(
convert
);
}
try
{
List
<
CompanyPerson
>
companyPeople
=
orgUsrService
.
returnCompanyPerson
(
idList
);
if
(!
companyPeople
.
isEmpty
())
{
AtomicInteger
row
=
new
AtomicInteger
(
1
);
companyPeople
.
forEach
(
item
->
{
List
<
OrgUsrDto
>
persons
=
item
.
getPersons
();
if
(
persons
!=
null
&&
!
persons
.
isEmpty
())
{
persons
.
forEach
(
o
->
{
ArrayList
<
Object
>
list
=
new
ArrayList
<>();
list
.
add
(
row
.
getAndIncrement
());
list
.
add
(
o
.
getSequenceNbr
().
toString
());
list
.
add
(
o
.
getBizOrgName
());
list
.
add
(
item
.
getBizOrgName
()
+
"@"
+
item
.
getSequenceNbr
());
data
.
add
(
list
);
});
}
});
}
excelService
.
dutyTemplateExport
(
response
,
beginDate
,
endDate
,
excelDto
,
ids
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
throw
new
RuntimeException
(
"系统异常!"
);
}
return
data
;
}
private
List
<
List
<
Object
>>
initDutyCarTemplate
(
String
teamIds
)
{
List
<
List
<
Object
>>
data
=
new
ArrayList
<>();
// 根据id列表获取队伍下的人
List
<
String
>
teamIdList
=
Lists
.
newArrayList
();
if
(!
ValidationUtil
.
isEmpty
(
teamIds
))
{
teamIdList
=
Lists
.
newArrayList
(
teamIds
.
split
(
","
));
}
List
<
FirefightersDto
>
firefightersDtoList
=
fireTeamService
.
getFighterByTeamId
(
teamIdList
);
if
(!
firefightersDtoList
.
isEmpty
())
{
AtomicInteger
row
=
new
AtomicInteger
(
1
);
firefightersDtoList
.
forEach
(
o
->
{
ArrayList
<
Object
>
list
=
new
ArrayList
<>();
list
.
add
(
row
.
getAndIncrement
());
list
.
add
(
o
.
getFireTeamName
()
+
"@"
+
o
.
getFireTeamId
());
list
.
add
(
o
.
getName
()
+
"@"
+
o
.
getSequenceNbr
());
list
.
add
(
o
.
getJobTitle
()
+
"@"
+
o
.
getJobTitleCode
());
data
.
add
(
list
);
});
}
return
data
;
}
@TycloudOperation
(
needAuth
=
false
,
ApiLevel
=
UserType
.
AGENCY
)
...
...
@@ -782,104 +126,10 @@ public class ExcelController extends BaseController {
public
void
dutyCarDuty
(
HttpServletResponse
response
,
@RequestParam
(
"beginDate"
)
String
beginDate
,
@RequestParam
(
"endDate"
)
String
endDate
,
ExcelDto
excelDto
)
{
try
{
// 获取日期
List
<
Map
<
String
,
Object
>>
rangeDate
=
dutyPersonShiftService
.
getBaseMapper
().
genRangeDate
(
beginDate
,
endDate
);
List
<
String
>
dayByMonth
=
new
ArrayList
<>();
rangeDate
.
forEach
(
item
->
dayByMonth
.
add
((
String
)
item
.
get
(
"date"
)));
List
<
List
<
Object
>>
data
=
new
ArrayList
<>();
if
(
ExcelEnums
.
CLZQ
.
equals
(
excelDto
.
getType
()))
{
data
=
initDutyCarInfo
(
beginDate
,
endDate
,
dayByMonth
);
}
else
if
(
ExcelEnums
.
RYZB
.
equals
(
excelDto
.
getType
()))
{
data
=
initDutyPersonInfo
(
beginDate
,
endDate
,
dayByMonth
);
}
exportDutyTemplate
(
response
,
excelDto
.
getClassUrl
(),
dayByMonth
,
excelDto
,
data
,
false
);
excelService
.
dutyInfoExport
(
response
,
beginDate
,
endDate
,
excelDto
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
throw
new
RuntimeException
(
"系统异常!"
);
}
}
private
List
<
List
<
Object
>>
initDutyPersonInfo
(
String
beginDate
,
String
endDate
,
List
<
String
>
dayByMonth
)
throws
ParseException
{
// 查询已值班数据
List
<
DutyPersonDto
>
contentList
=
iDutyPersonService
.
downloadList
(
beginDate
,
endDate
);
List
<
List
<
Object
>>
data
=
new
ArrayList
<>();
// 组装导出数据
if
(!
contentList
.
isEmpty
())
{
AtomicInteger
row
=
new
AtomicInteger
(
1
);
contentList
.
forEach
(
o
->
{
ArrayList
<
Object
>
list
=
new
ArrayList
<>();
list
.
add
(
row
.
getAndIncrement
());
list
.
add
(
o
.
getUserId
());
list
.
add
(
o
.
getUserName
());
list
.
add
(
o
.
getDeptName
());
list
.
add
(
o
.
getPostTypeName
());
List
<
DutyPersonShiftDto
>
dutyShift
=
o
.
getDutyShift
();
initDutyShift
(
dayByMonth
,
dutyShift
,
list
);
data
.
add
(
list
);
});
}
return
data
;
}
private
List
<
List
<
Object
>>
initDutyCarInfo
(
String
beginDate
,
String
endDate
,
List
<
String
>
dayByMonth
)
throws
ParseException
{
// 查询已值班数据
List
<
DutyCarDto
>
contentList
=
dutyCarService
.
downloadList
(
beginDate
,
endDate
);
List
<
List
<
Object
>>
data
=
new
ArrayList
<>();
// 组装导出数据
if
(!
contentList
.
isEmpty
())
{
AtomicInteger
row
=
new
AtomicInteger
(
1
);
contentList
.
forEach
(
o
->
{
ArrayList
<
Object
>
list
=
new
ArrayList
<>();
list
.
add
(
row
.
getAndIncrement
());
list
.
add
(
o
.
getTeamName
());
list
.
add
(
o
.
getUserName
());
list
.
add
(
o
.
getPostTypeName
());
list
.
add
(
o
.
getCarName
());
List
<
DutyPersonShiftDto
>
dutyShift
=
o
.
getDutyShift
();
initDutyShift
(
dayByMonth
,
dutyShift
,
list
);
data
.
add
(
list
);
});
}
return
data
;
}
private
void
initDutyShift
(
List
<
String
>
dayByMonth
,
List
<
DutyPersonShiftDto
>
dutyShift
,
ArrayList
<
Object
>
list
)
{
HashMap
<
String
,
String
>
dutyShiftMap
=
new
HashMap
<>();
SimpleDateFormat
format
=
new
SimpleDateFormat
(
"yyyy-MM-dd"
);
dutyShift
.
forEach
(
item
->
dutyShiftMap
.
put
(
format
.
format
(
item
.
getDutyDate
()),
item
.
getShiftName
()));
for
(
int
i
=
0
;
i
<
dayByMonth
.
size
();
i
++)
{
if
(
dutyShiftMap
.
containsKey
(
dayByMonth
.
get
(
i
)))
{
list
.
add
(
dutyShiftMap
.
get
(
dayByMonth
.
get
(
i
)));
}
else
{
list
.
add
(
NOT_DUTY
);
}
}
}
private
void
exportDutyTemplate
(
HttpServletResponse
response
,
String
classUrl
,
List
<
String
>
dayByMonth
,
ExcelDto
excelDto
,
List
<?
extends
Object
>
data
,
Boolean
flag
)
{
try
{
// 获取排班类型
String
[]
dutyNameList
=
getDutyNameList
();
Class
<?>
clz
=
Class
.
forName
(
classUrl
);
ExcelUtil
.
createDutyTemplate
(
response
,
excelDto
.
getFileName
(),
excelDto
.
getSheetName
(),
data
,
clz
,
dayByMonth
,
dutyNameList
,
dataSourcesImpl
,
flag
);
}
catch
(
ClassNotFoundException
e
)
{
e
.
printStackTrace
();
}
}
private
String
[]
getDutyNameList
()
{
List
<
String
>
dutyShiftList
=
new
ArrayList
<>();
List
<
DutyShiftDto
>
dutyShiftDtoList
=
dutyShiftService
.
queryForDutyShiftList
(
null
,
false
);
dutyShiftDtoList
.
forEach
(
item
->
dutyShiftList
.
add
(
item
.
getName
()
+
"@"
+
item
.
getSequenceNbr
()));
return
dutyShiftList
.
toArray
(
new
String
[
dutyShiftList
.
size
()]);
}
}
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 {
private
void
initBuildTreeList
(
List
<
Object
>
menus
,
List
<
String
>
stringList
)
{
for
(
Object
orgMenuDto
:
menus
)
{
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"
);
if
(
children
!=
null
&&
children
.
size
()
>
0
)
{
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
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jcs
.
biz
.
service
.
impl
;
import
com.alibaba.excel.support.ExcelTypeEnum
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.toolkit.Sequence
;
import
com.google.common.collect.Lists
;
import
com.yeejoin.amos.boot.biz.common.utils.DateUtils
;
import
com.yeejoin.amos.boot.module.common.api.dto.CompanyPerson
;
import
com.yeejoin.amos.boot.module.common.api.dto.DutyCarDto
;
import
com.yeejoin.amos.boot.module.common.api.dto.DutyPersonDto
;
import
com.yeejoin.amos.boot.module.common.api.dto.DutyPersonShiftDto
;
import
com.yeejoin.amos.boot.module.common.api.dto.DutyShiftDto
;
import
com.yeejoin.amos.boot.module.common.api.dto.ExcelDto
;
import
com.yeejoin.amos.boot.module.common.api.dto.FireChemicalDto
;
import
com.yeejoin.amos.boot.module.common.api.dto.FireExpertsDto
;
import
com.yeejoin.amos.boot.module.common.api.dto.FireStationDto
;
import
com.yeejoin.amos.boot.module.common.api.dto.FireTeamDto
;
import
com.yeejoin.amos.boot.module.common.api.dto.FirefightersDto
;
import
com.yeejoin.amos.boot.module.common.api.dto.FirefightersExcelDto
;
import
com.yeejoin.amos.boot.module.common.api.dto.FirefightersInfoDto
;
import
com.yeejoin.amos.boot.module.common.api.dto.KeySiteExcleDto
;
import
com.yeejoin.amos.boot.module.common.api.dto.MaintenancePersonExcleDto
;
import
com.yeejoin.amos.boot.module.common.api.dto.OrgUsrDto
;
import
com.yeejoin.amos.boot.module.common.api.dto.WaterResourceDto
;
import
com.yeejoin.amos.boot.module.common.api.entity.DynamicFormColumn
;
import
com.yeejoin.amos.boot.module.common.api.entity.DynamicFormInstance
;
import
com.yeejoin.amos.boot.module.common.api.entity.FireChemical
;
import
com.yeejoin.amos.boot.module.common.api.entity.FireExperts
;
import
com.yeejoin.amos.boot.module.common.api.entity.FireStation
;
import
com.yeejoin.amos.boot.module.common.api.entity.FireTeam
;
import
com.yeejoin.amos.boot.module.common.api.entity.Firefighters
;
import
com.yeejoin.amos.boot.module.common.api.entity.FirefightersContacts
;
import
com.yeejoin.amos.boot.module.common.api.entity.MaintenanceCompany
;
import
com.yeejoin.amos.boot.module.common.api.excel.ExcelUtil
;
import
com.yeejoin.amos.boot.module.common.api.service.IDutyPersonService
;
import
com.yeejoin.amos.boot.module.common.api.service.IKeySiteService
;
import
com.yeejoin.amos.boot.module.common.api.service.IMaintenanceCompanyService
;
import
com.yeejoin.amos.boot.module.common.biz.service.impl.DutyCarServiceImpl
;
import
com.yeejoin.amos.boot.module.common.biz.service.impl.DutyPersonServiceImpl
;
import
com.yeejoin.amos.boot.module.common.biz.service.impl.DutyPersonShiftServiceImpl
;
import
com.yeejoin.amos.boot.module.common.biz.service.impl.DutyShiftServiceImpl
;
import
com.yeejoin.amos.boot.module.common.biz.service.impl.DynamicFormColumnServiceImpl
;
import
com.yeejoin.amos.boot.module.common.biz.service.impl.FireChemicalServiceImpl
;
import
com.yeejoin.amos.boot.module.common.biz.service.impl.FireExpertsServiceImpl
;
import
com.yeejoin.amos.boot.module.common.biz.service.impl.FireStationServiceImpl
;
import
com.yeejoin.amos.boot.module.common.biz.service.impl.FirefightersServiceImpl
;
import
com.yeejoin.amos.boot.module.common.biz.service.impl.OrgUsrServiceImpl
;
import
com.yeejoin.amos.boot.module.common.biz.service.impl.WaterResourceServiceImpl
;
import
com.yeejoin.amos.boot.module.jcs.api.dto.AircraftDto
;
import
com.yeejoin.amos.boot.module.jcs.api.entity.Aircraft
;
import
com.yeejoin.amos.boot.module.jcs.api.enums.ExcelEnums
;
import
org.apache.commons.beanutils.ConvertUtils
;
import
org.apache.poi.ss.usermodel.Cell
;
import
org.apache.poi.ss.usermodel.Row
;
import
org.apache.poi.xssf.usermodel.XSSFSheet
;
import
org.apache.poi.xssf.usermodel.XSSFWorkbook
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.StringUtils
;
import
org.springframework.web.multipart.MultipartFile
;
import
org.typroject.tyboot.core.foundation.utils.Bean
;
import
org.typroject.tyboot.core.foundation.utils.ValidationUtil
;
import
javax.servlet.http.HttpServletResponse
;
import
java.io.InputStream
;
import
java.text.ParseException
;
import
java.text.SimpleDateFormat
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.concurrent.atomic.AtomicInteger
;
/**
* @author tb
*/
@Service
public
class
ExcelServiceImpl
{
private
static
final
String
NOT_DUTY
=
"休班"
;
private
static
final
String
PERSON
=
"PERSON"
;
private
static
final
String
MAINTENANCE_PERSON
=
"maintenancePerson"
;
@Autowired
DataSourcesImpl
dataSourcesImpl
;
@Autowired
FireChemicalServiceImpl
fireChemicalServiceImpl
;
@Autowired
FireExpertsServiceImpl
fireExpertsServiceImpl
;
@Autowired
WaterResourceServiceImpl
waterResourceServiceImpl
;
@Autowired
AircraftServiceImpl
aircraftServiceImpl
;
@Autowired
FireTeamServiceImpl
fireTeamService
;
@Autowired
FireStationServiceImpl
fireStationService
;
@Autowired
FirefightersServiceImpl
firefightersService
;
@Autowired
IMaintenanceCompanyService
maintenanceCompanyService
;
@Autowired
IKeySiteService
keySiteService
;
@Autowired
DutyCarServiceImpl
dutyCarService
;
@Autowired
DutyPersonServiceImpl
dutyPersonService
;
@Autowired
Sequence
sequence
;
@Autowired
DynamicFormColumnServiceImpl
dynamicFormColumnService
;
@Autowired
DutyPersonShiftServiceImpl
dutyPersonShiftService
;
@Autowired
OrgUsrServiceImpl
orgUsrService
;
@Autowired
DutyShiftServiceImpl
dutyShiftService
;
@Autowired
IDutyPersonService
iDutyPersonService
;
public
void
templateExport
(
HttpServletResponse
response
,
ExcelDto
excelDto
)
throws
ClassNotFoundException
{
String
url
=
excelDto
.
getClassUrl
();
Class
<?>
clz
=
Class
.
forName
(
url
);
ExcelUtil
.
createTemplate
(
response
,
excelDto
.
getFileName
(),
excelDto
.
getSheetName
(),
null
,
clz
,
dataSourcesImpl
,
true
);
}
public
void
commonExport
(
HttpServletResponse
response
,
ExcelDto
excelDto
)
{
switch
(
excelDto
.
getType
())
{
case
ExcelEnums
.
WHP
:
List
<
FireChemicalDto
>
data
=
fireChemicalServiceImpl
.
queryForFireChemicalList
(
false
);
ExcelUtil
.
createTemplate
(
response
,
excelDto
.
getFileName
(),
excelDto
.
getSheetName
(),
data
,
FireChemicalDto
.
class
,
dataSourcesImpl
,
false
);
break
;
case
ExcelEnums
.
XFZJ
:
List
<
FireExpertsDto
>
fireExpertsDtoList
=
fireExpertsServiceImpl
.
queryForFireExpertsList
(
false
);
ExcelUtil
.
createTemplate
(
response
,
excelDto
.
getFileName
(),
excelDto
.
getSheetName
(),
fireExpertsDtoList
,
FireExpertsDto
.
class
,
dataSourcesImpl
,
false
);
break
;
case
ExcelEnums
.
SYXX
:
List
<
WaterResourceDto
>
waterResourceDtoList
=
waterResourceServiceImpl
.
exportToExcel
(
true
);
ExcelUtil
.
createTemplate
(
response
,
excelDto
.
getFileName
(),
excelDto
.
getSheetName
(),
waterResourceDtoList
,
WaterResourceDto
.
class
,
dataSourcesImpl
,
false
);
break
;
case
ExcelEnums
.
HKQ
:
List
<
AircraftDto
>
aircraftDtoList
=
aircraftServiceImpl
.
queryAircraftDtoForList
(
false
);
ExcelUtil
.
createTemplate
(
response
,
excelDto
.
getFileName
(),
excelDto
.
getSheetName
(),
aircraftDtoList
,
AircraftDto
.
class
,
dataSourcesImpl
,
false
);
break
;
case
ExcelEnums
.
XFDW
:
List
<
FireTeamDto
>
fireTeamDtoList
=
fireTeamService
.
queryFireTeamForList
(
false
);
ExcelUtil
.
createTemplate
(
response
,
excelDto
.
getFileName
(),
excelDto
.
getSheetName
(),
fireTeamDtoList
,
FireTeamDto
.
class
,
dataSourcesImpl
,
false
);
break
;
case
ExcelEnums
.
WXXFZ
:
List
<
FireStationDto
>
fireStationDtoList
=
fireStationService
.
queryForFireStationList
(
false
);
ExcelUtil
.
createTemplate
(
response
,
excelDto
.
getFileName
(),
excelDto
.
getSheetName
(),
fireStationDtoList
,
FireStationDto
.
class
,
null
,
false
);
break
;
case
ExcelEnums
.
XFRY
:
List
<
FirefightersExcelDto
>
firefightersExcelDtoList
=
firefightersService
.
exportToExcel
(
false
);
ExcelUtil
.
createTemplate
(
response
,
excelDto
.
getFileName
(),
excelDto
.
getSheetName
(),
firefightersExcelDtoList
,
FirefightersExcelDto
.
class
,
null
,
false
);
break
;
case
ExcelEnums
.
WBRY
:
List
<
MaintenancePersonExcleDto
>
maintenancePersonExcelDtoList
=
maintenanceCompanyService
.
exportToMaintenancePersonExcel
();
ExcelUtil
.
createTemplate
(
response
,
excelDto
.
getFileName
(),
excelDto
.
getSheetName
(),
maintenancePersonExcelDtoList
,
MaintenancePersonExcleDto
.
class
,
null
,
false
);
break
;
case
ExcelEnums
.
KEYSITE
:
List
<
KeySiteExcleDto
>
keySiteDtoList
=
keySiteService
.
exportToExcel
();
ExcelUtil
.
createTemplate
(
response
,
excelDto
.
getFileName
(),
excelDto
.
getSheetName
(),
keySiteDtoList
,
KeySiteExcleDto
.
class
,
null
,
false
);
break
;
default
:
break
;
}
}
public
void
commonUpload
(
MultipartFile
multipartFile
,
ExcelDto
excelDto
)
throws
Exception
{
switch
(
excelDto
.
getType
())
{
case
ExcelEnums
.
WHP
:
excelImportFireChemical
(
multipartFile
);
break
;
case
ExcelEnums
.
XFZJ
:
excelImportFireExperts
(
multipartFile
);
break
;
case
ExcelEnums
.
SYXX
:
excelImportWaterResource
(
multipartFile
);
break
;
case
ExcelEnums
.
HKQ
:
excelImportAircraft
(
multipartFile
);
break
;
case
ExcelEnums
.
XFDW
:
excelImportFireTeam
(
multipartFile
);
break
;
case
ExcelEnums
.
WXXFZ
:
excelImportFireStation
(
multipartFile
);
break
;
case
ExcelEnums
.
XFRY
:
excelImportFirefighters
(
multipartFile
);
break
;
case
ExcelEnums
.
CLZQ
:
excelImportDutyPerson
(
multipartFile
,
ExcelEnums
.
CLZQ
);
break
;
case
ExcelEnums
.
RYZB
:
excelImportDutyPerson
(
multipartFile
,
ExcelEnums
.
RYZB
);
case
ExcelEnums
.
WBRY
:
excelImportMaintenancePerson
(
multipartFile
);
case
ExcelEnums
.
KEYSITE
:
excelImportKeySite
(
multipartFile
);
}
return
;
}
private
void
excelImportFirefighters
(
MultipartFile
multipartFile
)
throws
Exception
{
List
<
FirefightersExcelDto
>
excelDtoList
=
ExcelUtil
.
readFirstSheetExcel
(
multipartFile
,
FirefightersExcelDto
.
class
,
1
);
excelDtoList
.
forEach
(
item
->
{
Firefighters
firefighters
=
new
Firefighters
();
FirefightersContacts
firefightersContacts
=
new
FirefightersContacts
();
firefighters
=
Bean
.
toPo
(
item
,
firefighters
);
firefightersContacts
=
Bean
.
toPo
(
item
,
firefightersContacts
);
if
(
item
.
getFireTeam
()
!=
null
)
{
Long
fireTeamId
=
Long
.
valueOf
(
item
.
getFireTeam
().
split
(
"@"
)[
1
]);
firefighters
.
setFireTeamId
(
fireTeamId
);
}
if
(
firefighters
.
getCertificatesType
()
!=
null
)
{
String
[]
certificates
=
firefighters
.
getCertificatesType
().
split
(
"@"
);
firefighters
.
setCertificatesType
(
certificates
[
0
]);
firefighters
.
setCertificatesTypeCode
(
certificates
[
1
]);
}
if
(
firefighters
.
getState
()
!=
null
)
{
String
[]
state
=
firefighters
.
getState
().
split
(
"@"
);
firefighters
.
setState
(
state
[
0
]);
firefighters
.
setStateCode
(
state
[
1
]);
}
if
(
firefighters
.
getJobTitle
()
!=
null
)
{
String
[]
jobTitle
=
firefighters
.
getJobTitle
().
split
(
"@"
);
firefighters
.
setJobTitle
(
jobTitle
[
0
]);
firefighters
.
setJobTitleCode
(
jobTitle
[
1
]);
}
if
(
firefightersContacts
.
getRelationship
()
!=
null
)
{
String
relationship
=
firefightersContacts
.
getRelationship
().
split
(
"@"
)[
1
];
firefightersContacts
.
setRelationship
(
relationship
);
}
FirefightersInfoDto
firefightersInfo
=
new
FirefightersInfoDto
(
firefighters
,
firefightersContacts
);
firefightersService
.
saveFirefighters
(
firefightersInfo
);
}
);
}
private
void
excelImportFireStation
(
MultipartFile
multipartFile
)
throws
Exception
{
List
<
FireStationDto
>
excelDtoList
=
ExcelUtil
.
readFirstSheetExcel
(
multipartFile
,
FireStationDto
.
class
,
1
);
List
<
FireStation
>
excelEntityList
=
new
ArrayList
<>();
excelDtoList
.
forEach
(
item
->
{
FireStation
fireStation
=
new
FireStation
();
fireStation
=
Bean
.
toPo
(
item
,
fireStation
);
if
(
fireStation
.
getWhereBuilding
()
!=
null
)
{
String
[]
whereBuilding
=
fireStation
.
getWhereBuilding
().
split
(
"@"
);
fireStation
.
setWhereBuilding
(
whereBuilding
[
0
]);
fireStation
.
setWhereBuildingId
(
whereBuilding
[
1
]);
}
if
(
fireStation
.
getBizCompany
()
!=
null
)
{
String
[]
bizCompany
=
fireStation
.
getBizCompany
().
split
(
"@"
);
fireStation
.
setBizCompany
(
bizCompany
[
0
]);
fireStation
.
setBizCompanyId
(
Long
.
valueOf
(
bizCompany
[
1
]));
fireStation
.
setBizCompanyCode
(
bizCompany
[
2
]);
}
excelEntityList
.
add
(
fireStation
);
}
);
fireStationService
.
saveBatch
(
excelEntityList
);
}
private
void
excelImportFireTeam
(
MultipartFile
multipartFile
)
throws
Exception
{
List
<
FireTeamDto
>
excelDtoList
=
ExcelUtil
.
readFirstSheetExcel
(
multipartFile
,
FireTeamDto
.
class
,
1
);
List
<
FireTeam
>
excelEntityList
=
new
ArrayList
<>();
excelDtoList
.
forEach
(
item
->
{
FireTeam
fireTeam
=
new
FireTeam
();
fireTeam
=
Bean
.
toPo
(
item
,
fireTeam
);
if
(
fireTeam
.
getType
()
!=
null
)
{
String
[]
type
=
fireTeam
.
getType
().
split
(
"@"
);
fireTeam
.
setType
(
type
[
0
]);
fireTeam
.
setTypeCode
(
type
[
1
]);
}
if
(
fireTeam
.
getContactUser
()
!=
null
)
{
String
[]
contactUser
=
fireTeam
.
getContactUser
().
split
(
"@"
);
fireTeam
.
setContactUser
(
contactUser
[
0
]);
fireTeam
.
setContactUserId
(
Long
.
valueOf
(
contactUser
[
1
]));
}
if
(
item
.
getParentName
()
!=
null
)
{
String
[]
parentName
=
item
.
getParentName
().
split
(
"@"
);
fireTeam
.
setParent
(
Long
.
valueOf
(
parentName
[
1
]));
}
excelEntityList
.
add
(
fireTeam
);
}
);
fireTeamService
.
saveBatch
(
excelEntityList
);
}
private
void
excelImportAircraft
(
MultipartFile
multipartFile
)
throws
Exception
{
List
<
AircraftDto
>
excelDtoList
=
ExcelUtil
.
readFirstSheetExcel
(
multipartFile
,
AircraftDto
.
class
,
1
);
List
<
Aircraft
>
excelEntityList
=
new
ArrayList
<>();
excelDtoList
.
forEach
(
item
->
{
Aircraft
aircraft
=
new
Aircraft
();
aircraft
=
Bean
.
toPo
(
item
,
aircraft
);
if
(
aircraft
.
getEngineType
()
!=
null
)
{
String
[]
engineType
=
aircraft
.
getEngineType
().
split
(
"@"
);
aircraft
.
setEngineType
(
engineType
[
0
]);
aircraft
.
setEngineTypeCode
(
engineType
[
1
]);
}
if
(
aircraft
.
getFuelType
()
!=
null
)
{
String
[]
fuelType
=
aircraft
.
getFuelType
().
split
(
"@"
);
aircraft
.
setFuelType
(
fuelType
[
0
]);
aircraft
.
setFuelTypeCode
(
fuelType
[
1
]);
}
excelEntityList
.
add
(
aircraft
);
}
);
aircraftServiceImpl
.
saveBatch
(
excelEntityList
);
}
private
void
excelImportFireChemical
(
MultipartFile
multipartFile
)
throws
Exception
{
List
<
FireChemicalDto
>
excelDtoList
=
ExcelUtil
.
readFirstSheetExcel
(
multipartFile
,
FireChemicalDto
.
class
,
1
);
List
<
FireChemical
>
excelEntityList
=
new
ArrayList
<>();
excelDtoList
.
forEach
(
item
->
{
FireChemical
fireChemical
=
new
FireChemical
();
fireChemical
=
Bean
.
toPo
(
item
,
fireChemical
);
if
(
fireChemical
.
getType
()
!=
null
)
{
String
[]
type
=
fireChemical
.
getType
().
split
(
"@"
);
fireChemical
.
setType
(
type
[
0
]);
fireChemical
.
setTypeCode
(
type
[
1
]);
}
excelEntityList
.
add
(
fireChemical
);
}
);
fireChemicalServiceImpl
.
saveBatch
(
excelEntityList
);
}
private
void
excelImportWaterResource
(
MultipartFile
multipartFile
)
throws
Exception
{
List
<
WaterResourceDto
>
excelDtoList
=
ExcelUtil
.
readFirstSheetExcel
(
multipartFile
,
WaterResourceDto
.
class
,
1
);
excelDtoList
.
forEach
(
item
->
{
if
(
item
.
getResourceTypeName
()
!=
null
)
{
String
[]
resourceTypeName
=
item
.
getResourceTypeName
().
split
(
"@"
);
item
.
setResourceTypeName
(
resourceTypeName
[
0
]);
item
.
setResourceType
(
resourceTypeName
[
1
]);
}
if
(
item
.
getSystemType
()
!=
null
)
{
String
[]
systemType
=
item
.
getSystemType
().
split
(
"@"
);
item
.
setSystemType
(
systemType
[
0
]);
item
.
setSystemTypeCode
(
systemType
[
1
]);
}
if
(
item
.
getPlaceForm
()
!=
null
)
{
String
[]
placeForm
=
item
.
getPlaceForm
().
split
(
"@"
);
item
.
setPlaceForm
(
placeForm
[
0
]);
item
.
setPlaceFormCode
(
placeForm
[
1
]);
}
if
(
item
.
getBelongBuilding
()
!=
null
)
{
String
[]
belongBuilding
=
item
.
getBelongBuilding
().
split
(
"@"
);
item
.
setBelongBuilding
(
belongBuilding
[
0
]);
item
.
setBelongBuildingId
(
Long
.
valueOf
(
belongBuilding
[
1
]));
}
if
(
item
.
getBelongFightingSystem
()
!=
null
)
{
String
[]
belongFightingSystem
=
item
.
getBelongFightingSystem
().
split
(
"@"
);
item
.
setBelongFightingSystem
(
belongFightingSystem
[
0
]);
item
.
setBelongFightingSystemId
(
Long
.
valueOf
(
belongFightingSystem
[
1
]));
}
if
(
item
.
getManagementUnit
()
!=
null
)
{
String
[]
managementUnit
=
item
.
getManagementUnit
().
split
(
"@"
);
item
.
setManagementUnit
(
managementUnit
[
0
]);
item
.
setManagementUnitId
(
Long
.
valueOf
(
managementUnit
[
1
]));
}
if
(
item
.
getMaintenanceUnit
()
!=
null
)
{
String
[]
maintenanceUnit
=
item
.
getMaintenanceUnit
().
split
(
"@"
);
item
.
setMaintenanceUnit
(
maintenanceUnit
[
0
]);
item
.
setMaintenanceUnitId
(
Long
.
valueOf
(
maintenanceUnit
[
1
]));
}
if
(
item
.
getHoseConnection
()
!=
null
)
{
String
[]
hoseConnection
=
item
.
getHoseConnection
().
split
(
"@"
);
item
.
setHoseConnection
(
hoseConnection
[
0
]);
item
.
setHoseConnectionCode
(
hoseConnection
[
1
]);
}
if
(
item
.
getIntakeForm
()
!=
null
)
{
String
[]
intakeForm
=
item
.
getIntakeForm
().
split
(
"@"
);
item
.
setIntakeForm
(
intakeForm
[
0
]);
}
if
(
item
.
getPipeTypeName
()
!=
null
)
{
String
[]
pipeTypeName
=
item
.
getPipeTypeName
().
split
(
"@"
);
item
.
setPipeTypeName
(
pipeTypeName
[
0
]);
item
.
setPipeTypeCode
(
pipeTypeName
[
1
]);
}
if
(
item
.
getStatus
()
!=
null
)
{
String
[]
status
=
item
.
getStatus
().
split
(
"@"
);
item
.
setStatus
(
status
[
0
]);
item
.
setStatusCode
(
status
[
1
]);
}
if
(
item
.
getType
()
!=
null
)
{
String
[]
type
=
item
.
getType
().
split
(
"@"
);
item
.
setType
(
type
[
0
]);
item
.
setTypeCode
(
type
[
1
]);
}
waterResourceServiceImpl
.
importByExcel
(
item
);
}
);
}
private
void
excelImportFireExperts
(
MultipartFile
multipartFile
)
throws
Exception
{
List
<
FireExpertsDto
>
excelDtoList
=
ExcelUtil
.
readFirstSheetExcel
(
multipartFile
,
FireExpertsDto
.
class
,
1
);
List
<
FireExperts
>
excelEntityList
=
new
ArrayList
<>();
excelDtoList
.
forEach
(
fireExpertsDto
->
{
FireExperts
fireExperts
=
new
FireExperts
();
fireExperts
=
Bean
.
toPo
(
fireExpertsDto
,
fireExperts
);
if
(
fireExperts
.
getCertificatesType
()
!=
null
)
{
String
[]
certificates
=
fireExperts
.
getCertificatesType
().
split
(
"@"
);
fireExperts
.
setCertificatesType
(
certificates
[
0
]);
fireExperts
.
setCertificatesTypeCode
(
certificates
[
1
]);
}
if
(
fireExperts
.
getJobs
()
!=
null
)
{
String
[]
jobs
=
fireExperts
.
getJobs
().
split
(
"@"
);
fireExperts
.
setJobs
(
jobs
[
0
]);
fireExperts
.
setJobsCode
(
jobs
[
1
]);
}
if
(
fireExperts
.
getExpert
()
!=
null
)
{
String
[]
expert
=
fireExperts
.
getExpert
().
split
(
"@"
);
fireExperts
.
setExpert
(
expert
[
0
]);
fireExperts
.
setExpertCode
(
expert
[
1
]);
}
if
(
fireExperts
.
getHighestEducation
()
!=
null
)
{
String
[]
highestEducation
=
fireExperts
.
getHighestEducation
().
split
(
"@"
);
fireExperts
.
setHighestEducation
(
highestEducation
[
0
]);
}
excelEntityList
.
add
(
fireExperts
);
}
);
fireExpertsServiceImpl
.
saveBatch
(
excelEntityList
);
}
private
void
excelImportDutyPerson
(
MultipartFile
multipartFile
,
String
dutyType
)
throws
Exception
{
String
fileName
=
multipartFile
.
getOriginalFilename
();
if
(
fileName
==
null
)
{
throw
new
Exception
(
"文件不存在!"
);
}
if
(!
fileName
.
toLowerCase
().
endsWith
(
ExcelTypeEnum
.
XLS
.
getValue
())
&&
!
fileName
.
toLowerCase
().
endsWith
(
ExcelTypeEnum
.
XLSX
.
getValue
()))
{
throw
new
Exception
(
"文件类型异常!"
);
}
InputStream
input
=
multipartFile
.
getInputStream
();
XSSFWorkbook
workbook
=
new
XSSFWorkbook
(
input
);
XSSFSheet
sheet
=
workbook
.
getSheetAt
(
0
);
List
<
Map
<
String
,
Object
>>
dataList
=
new
ArrayList
<>();
if
(
sheet
!=
null
)
{
//获取表头月份
Row
titleRow
=
sheet
.
getRow
(
0
);
Cell
monthCell
=
titleRow
.
getCell
(
5
);
String
dateStr
=
monthCell
==
null
?
""
:
monthCell
.
toString
();
List
<
Date
>
dayByMonth
=
DateUtils
.
getDayByMonth
(
dateStr
);
if
(
ExcelEnums
.
CLZQ
.
equals
(
dutyType
))
{
initDutyCarData
(
sheet
,
dataList
,
dayByMonth
);
dutyCarService
.
saveImportData
(
dataList
);
}
else
if
(
ExcelEnums
.
RYZB
.
equals
(
dutyType
))
{
initDutyPersonData
(
sheet
,
dataList
,
dayByMonth
);
dutyPersonService
.
saveImportData
(
dataList
);
}
}
}
private
void
initDutyCarData
(
XSSFSheet
sheet
,
List
<
Map
<
String
,
Object
>>
dataList
,
List
<
Date
>
dayByMonth
)
{
//遍历行,i = 1,从第二行开始,第一行是表头跳过。
for
(
int
i
=
1
;
i
<
sheet
.
getPhysicalNumberOfRows
();
i
++)
{
DutyCarDto
dutyCarDto
=
new
DutyCarDto
();
//row是一行数据,row.getCell(i),代表拿到这一行,第i列数据
Row
row
=
sheet
.
getRow
(
i
);
if
(
row
==
null
)
{
continue
;
}
Cell
cell
=
row
.
getCell
(
1
);
if
(
cell
!=
null
)
{
String
[]
split
=
cell
.
toString
().
split
(
"@"
);
dutyCarDto
.
setTeamName
(
split
[
0
]);
dutyCarDto
.
setTeamId
(
split
[
1
]);
}
cell
=
row
.
getCell
(
2
);
if
(
cell
!=
null
)
{
String
[]
userName
=
cell
.
toString
().
split
(
"@"
);
dutyCarDto
.
setUserName
(
userName
[
0
]);
dutyCarDto
.
setUserId
(
userName
[
1
]);
cell
=
row
.
getCell
(
3
);
if
(
cell
!=
null
)
{
String
[]
postType
=
cell
.
toString
().
split
(
"@"
);
dutyCarDto
.
setPostTypeName
(
postType
[
0
]);
dutyCarDto
.
setPostType
(
postType
[
1
]);
}
cell
=
row
.
getCell
(
4
);
if
(
cell
!=
null
)
{
String
[]
carName
=
cell
.
toString
().
split
(
"@"
);
dutyCarDto
.
setCarName
(
carName
[
0
]);
dutyCarDto
.
setCarId
(
carName
[
1
]);
}
List
<
DutyPersonShiftDto
>
dutyShift
=
dutyCarDto
.
getDutyShift
();
for
(
int
j
=
0
;
j
<
dayByMonth
.
size
();
j
++)
{
cell
=
row
.
getCell
(
5
+
j
);
String
dutyType
=
cell
==
null
?
""
:
cell
.
toString
();
if
(!
StringUtils
.
isEmpty
(
dutyType
))
{
DutyPersonShiftDto
dutyPersonShiftDto
=
new
DutyPersonShiftDto
();
dutyPersonShiftDto
.
setDutyDate
(
dayByMonth
.
get
(
j
));
dutyPersonShiftDto
.
setShiftId
(
Long
.
valueOf
(
dutyType
.
split
(
"@"
)[
1
]));
dutyShift
.
add
(
dutyPersonShiftDto
);
}
}
Map
<
String
,
Object
>
dutyCarDtoMap
=
Bean
.
BeantoMap
(
dutyCarDto
);
dataList
.
add
(
dutyCarDtoMap
);
}
}
}
private
void
initDutyPersonData
(
XSSFSheet
sheet
,
List
<
Map
<
String
,
Object
>>
dataList
,
List
<
Date
>
dayByMonth
)
{
//遍历行,i = 1,从第二行开始,第一行是表头跳过。
for
(
int
i
=
1
;
i
<
sheet
.
getPhysicalNumberOfRows
();
i
++)
{
DutyPersonDto
dutyPersonDto
=
new
DutyPersonDto
();
//row是一行数据,row.getCell(i),代表拿到这一行,第i列数据
Row
row
=
sheet
.
getRow
(
i
);
if
(
row
==
null
)
{
continue
;
}
Cell
cell
=
row
.
getCell
(
1
);
if
(
cell
!=
null
)
{
dutyPersonDto
.
setUserId
(
cell
.
toString
());
cell
=
row
.
getCell
(
2
);
if
(
cell
!=
null
)
{
dutyPersonDto
.
setUserName
(
cell
.
toString
());
}
cell
=
row
.
getCell
(
3
);
if
(
cell
!=
null
)
{
String
[]
split
=
cell
.
toString
().
split
(
"@"
);
dutyPersonDto
.
setDeptName
(
split
[
0
]);
dutyPersonDto
.
setDeptId
(
split
[
1
]);
}
cell
=
row
.
getCell
(
4
);
if
(
cell
!=
null
)
{
String
[]
split
=
cell
.
toString
().
split
(
"@"
);
dutyPersonDto
.
setPostTypeName
(
split
[
0
]);
dutyPersonDto
.
setPostType
(
split
[
1
]);
}
List
<
DutyPersonShiftDto
>
dutyShift
=
new
ArrayList
<>();
for
(
int
j
=
0
;
j
<
dayByMonth
.
size
();
j
++)
{
cell
=
row
.
getCell
(
5
+
j
);
String
dutyType
=
cell
==
null
?
""
:
cell
.
toString
();
if
(!
StringUtils
.
isEmpty
(
dutyType
))
{
DutyPersonShiftDto
dutyPersonShiftDto
=
new
DutyPersonShiftDto
();
dutyPersonShiftDto
.
setDutyDate
(
dayByMonth
.
get
(
j
));
dutyPersonShiftDto
.
setShiftId
(
Long
.
valueOf
(
dutyType
.
split
(
"@"
)[
1
]));
dutyShift
.
add
(
dutyPersonShiftDto
);
}
}
dutyPersonDto
.
setDutyShift
(
dutyShift
);
Map
<
String
,
Object
>
dutyPersonDtoMap
=
Bean
.
BeantoMap
(
dutyPersonDto
);
dataList
.
add
(
dutyPersonDtoMap
);
}
}
}
private
void
excelImportMaintenancePerson
(
MultipartFile
multipartFile
)
throws
Exception
{
List
<
MaintenancePersonExcleDto
>
excelDtoList
=
ExcelUtil
.
readFirstSheetExcel
(
multipartFile
,
MaintenancePersonExcleDto
.
class
,
1
);
List
<
DynamicFormColumn
>
columns
=
dynamicFormColumnService
.
list
(
new
LambdaQueryWrapper
<
DynamicFormColumn
>().
eq
(
DynamicFormColumn:
:
getGroupCode
,
MAINTENANCE_PERSON
));
List
<
MaintenanceCompany
>
maintenanceCompanyList
=
new
ArrayList
<
MaintenanceCompany
>();
List
<
DynamicFormInstance
>
dynamicFormInstanceList
=
new
ArrayList
<
DynamicFormInstance
>();
for
(
MaintenancePersonExcleDto
maintenancePersonExcleDto
:
excelDtoList
)
{
Long
instanceId
=
sequence
.
nextId
();
// 先填充主表的属性
MaintenanceCompany
maintenanceCompany
=
new
MaintenanceCompany
();
maintenanceCompany
=
Bean
.
toPo
(
maintenancePersonExcleDto
,
maintenanceCompany
);
maintenanceCompany
.
setType
(
PERSON
);
if
(
maintenanceCompany
.
getParentId
()
!=
null
)
{
long
getParentId
=
Long
.
valueOf
(
maintenancePersonExcleDto
.
getParentName
().
split
(
"@"
)[
1
]);
maintenanceCompany
.
setParentId
(
getParentId
);
}
if
(
maintenanceCompanyService
.
checkPersonCodeExists
(
maintenancePersonExcleDto
.
getCode
()))
{
maintenanceCompany
.
setBizCode
(
maintenancePersonExcleDto
.
getCode
());
}
else
{
maintenanceCompany
.
setCode
(
null
);
}
maintenanceCompany
.
setOrgCode
(
null
);
maintenanceCompany
.
setBizCode
(
sequence
.
nextId
()
+
""
);
maintenanceCompany
.
setInstanceId
(
instanceId
);
maintenanceCompanyList
.
add
(
maintenanceCompany
);
maintenanceCompanyService
.
maintenancePersonExcleDtoToDynamicFormInstanceList
(
columns
,
maintenancePersonExcleDto
,
instanceId
,
dynamicFormInstanceList
);
}
maintenanceCompanyService
.
saveMaintenanceCompanyBatch
(
maintenanceCompanyList
,
dynamicFormInstanceList
);
}
private
void
excelImportKeySite
(
MultipartFile
multipartFile
)
throws
Exception
{
List
<
KeySiteExcleDto
>
excelDtoList
=
ExcelUtil
.
readFirstSheetExcel
(
multipartFile
,
KeySiteExcleDto
.
class
,
1
);
keySiteService
.
saveExcel
(
excelDtoList
);
}
public
void
dutyTemplateExport
(
HttpServletResponse
response
,
String
beginDate
,
String
endDate
,
ExcelDto
excelDto
,
String
ids
)
{
List
<
List
<
Object
>>
data
=
new
ArrayList
<>();
if
(
ExcelEnums
.
CLZQ
.
equals
(
excelDto
.
getType
()))
{
data
=
initDutyCarTemplate
(
ids
);
}
else
if
(
ExcelEnums
.
RYZB
.
equals
(
excelDto
.
getType
()))
{
data
=
initDutyPersonTemplate
(
ids
);
}
// 获取日期
List
<
Map
<
String
,
Object
>>
rangeDate
=
dutyPersonShiftService
.
getBaseMapper
().
genRangeDate
(
beginDate
,
endDate
);
List
<
String
>
dayByMonth
=
new
ArrayList
<>();
rangeDate
.
forEach
(
item
->
dayByMonth
.
add
((
String
)
item
.
get
(
"date"
)));
exportDutyTemplate
(
response
,
excelDto
.
getClassUrl
(),
dayByMonth
,
excelDto
,
data
,
true
);
}
public
void
dutyInfoExport
(
HttpServletResponse
response
,
String
beginDate
,
String
endDate
,
ExcelDto
excelDto
)
throws
ParseException
{
// 获取日期
List
<
Map
<
String
,
Object
>>
rangeDate
=
dutyPersonShiftService
.
getBaseMapper
().
genRangeDate
(
beginDate
,
endDate
);
List
<
String
>
dayByMonth
=
new
ArrayList
<>();
rangeDate
.
forEach
(
item
->
dayByMonth
.
add
((
String
)
item
.
get
(
"date"
)));
List
<
List
<
Object
>>
data
=
new
ArrayList
<>();
if
(
ExcelEnums
.
CLZQ
.
equals
(
excelDto
.
getType
()))
{
data
=
initDutyCarInfo
(
beginDate
,
endDate
,
dayByMonth
);
}
else
if
(
ExcelEnums
.
RYZB
.
equals
(
excelDto
.
getType
()))
{
data
=
initDutyPersonInfo
(
beginDate
,
endDate
,
dayByMonth
);
}
exportDutyTemplate
(
response
,
excelDto
.
getClassUrl
(),
dayByMonth
,
excelDto
,
data
,
false
);
}
private
List
<
List
<
Object
>>
initDutyCarTemplate
(
String
teamIds
)
{
List
<
List
<
Object
>>
data
=
new
ArrayList
<>();
// 根据id列表获取队伍下的人
List
<
String
>
teamIdList
=
Lists
.
newArrayList
();
if
(!
ValidationUtil
.
isEmpty
(
teamIds
))
{
teamIdList
=
Lists
.
newArrayList
(
teamIds
.
split
(
","
));
}
List
<
FirefightersDto
>
firefightersDtoList
=
fireTeamService
.
getFighterByTeamId
(
teamIdList
);
if
(!
firefightersDtoList
.
isEmpty
())
{
AtomicInteger
row
=
new
AtomicInteger
(
1
);
firefightersDtoList
.
forEach
(
o
->
{
ArrayList
<
Object
>
list
=
new
ArrayList
<>();
list
.
add
(
row
.
getAndIncrement
());
list
.
add
(
o
.
getFireTeamName
()
+
"@"
+
o
.
getFireTeamId
());
list
.
add
(
o
.
getName
()
+
"@"
+
o
.
getSequenceNbr
());
list
.
add
(
o
.
getJobTitle
()
+
"@"
+
o
.
getJobTitleCode
());
data
.
add
(
list
);
});
}
return
data
;
}
private
List
<
List
<
Object
>>
initDutyPersonTemplate
(
String
ids
)
{
List
<
List
<
Object
>>
data
=
new
ArrayList
<>();
// 根据id列表获取部门下的人
List
<
Long
>
idList
=
Lists
.
newArrayList
();
if
(!
ValidationUtil
.
isEmpty
(
ids
))
{
String
[]
strings
=
ids
.
split
(
","
);
Long
[]
convert
=
(
Long
[])
ConvertUtils
.
convert
(
strings
,
Long
.
class
);
idList
=
Arrays
.
asList
(
convert
);
}
try
{
List
<
CompanyPerson
>
companyPeople
=
orgUsrService
.
returnCompanyPerson
(
idList
);
if
(!
companyPeople
.
isEmpty
())
{
AtomicInteger
row
=
new
AtomicInteger
(
1
);
companyPeople
.
forEach
(
item
->
{
List
<
OrgUsrDto
>
persons
=
item
.
getPersons
();
if
(
persons
!=
null
&&
!
persons
.
isEmpty
())
{
persons
.
forEach
(
o
->
{
ArrayList
<
Object
>
list
=
new
ArrayList
<>();
list
.
add
(
row
.
getAndIncrement
());
list
.
add
(
o
.
getSequenceNbr
().
toString
());
list
.
add
(
o
.
getBizOrgName
());
list
.
add
(
item
.
getBizOrgName
()
+
"@"
+
item
.
getSequenceNbr
());
data
.
add
(
list
);
});
}
});
}
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
throw
new
RuntimeException
(
"系统异常!"
);
}
return
data
;
}
private
void
exportDutyTemplate
(
HttpServletResponse
response
,
String
classUrl
,
List
<
String
>
dayByMonth
,
ExcelDto
excelDto
,
List
<?
extends
Object
>
data
,
Boolean
flag
)
{
try
{
// 获取排班类型
String
[]
dutyNameList
=
getDutyNameList
();
Class
<?>
clz
=
Class
.
forName
(
classUrl
);
ExcelUtil
.
createDutyTemplate
(
response
,
excelDto
.
getFileName
(),
excelDto
.
getSheetName
(),
data
,
clz
,
dayByMonth
,
dutyNameList
,
dataSourcesImpl
,
flag
);
}
catch
(
ClassNotFoundException
e
)
{
e
.
printStackTrace
();
}
}
private
String
[]
getDutyNameList
()
{
List
<
String
>
dutyShiftList
=
new
ArrayList
<>();
List
<
DutyShiftDto
>
dutyShiftDtoList
=
dutyShiftService
.
queryForDutyShiftList
(
null
,
false
);
dutyShiftDtoList
.
forEach
(
item
->
dutyShiftList
.
add
(
item
.
getName
()
+
"@"
+
item
.
getSequenceNbr
()));
return
dutyShiftList
.
toArray
(
new
String
[
dutyShiftList
.
size
()]);
}
private
List
<
List
<
Object
>>
initDutyCarInfo
(
String
beginDate
,
String
endDate
,
List
<
String
>
dayByMonth
)
throws
ParseException
{
// 查询已值班数据
List
<
DutyCarDto
>
contentList
=
dutyCarService
.
downloadList
(
beginDate
,
endDate
);
List
<
List
<
Object
>>
data
=
new
ArrayList
<>();
// 组装导出数据
if
(!
contentList
.
isEmpty
())
{
AtomicInteger
row
=
new
AtomicInteger
(
1
);
contentList
.
forEach
(
o
->
{
ArrayList
<
Object
>
list
=
new
ArrayList
<>();
list
.
add
(
row
.
getAndIncrement
());
list
.
add
(
o
.
getTeamName
());
list
.
add
(
o
.
getUserName
());
list
.
add
(
o
.
getPostTypeName
());
list
.
add
(
o
.
getCarName
());
List
<
DutyPersonShiftDto
>
dutyShift
=
o
.
getDutyShift
();
initDutyShift
(
dayByMonth
,
dutyShift
,
list
);
data
.
add
(
list
);
});
}
return
data
;
}
private
void
initDutyShift
(
List
<
String
>
dayByMonth
,
List
<
DutyPersonShiftDto
>
dutyShift
,
ArrayList
<
Object
>
list
)
{
HashMap
<
String
,
String
>
dutyShiftMap
=
new
HashMap
<>();
SimpleDateFormat
format
=
new
SimpleDateFormat
(
"yyyy-MM-dd"
);
dutyShift
.
forEach
(
item
->
dutyShiftMap
.
put
(
format
.
format
(
item
.
getDutyDate
()),
item
.
getShiftName
()));
for
(
int
i
=
0
;
i
<
dayByMonth
.
size
();
i
++)
{
if
(
dutyShiftMap
.
containsKey
(
dayByMonth
.
get
(
i
)))
{
list
.
add
(
dutyShiftMap
.
get
(
dayByMonth
.
get
(
i
)));
}
else
{
list
.
add
(
NOT_DUTY
);
}
}
}
private
List
<
List
<
Object
>>
initDutyPersonInfo
(
String
beginDate
,
String
endDate
,
List
<
String
>
dayByMonth
)
throws
ParseException
{
// 查询已值班数据
List
<
DutyPersonDto
>
contentList
=
iDutyPersonService
.
downloadList
(
beginDate
,
endDate
);
List
<
List
<
Object
>>
data
=
new
ArrayList
<>();
// 组装导出数据
if
(!
contentList
.
isEmpty
())
{
AtomicInteger
row
=
new
AtomicInteger
(
1
);
contentList
.
forEach
(
o
->
{
ArrayList
<
Object
>
list
=
new
ArrayList
<>();
list
.
add
(
row
.
getAndIncrement
());
list
.
add
(
o
.
getUserId
());
list
.
add
(
o
.
getUserName
());
list
.
add
(
o
.
getDeptName
());
list
.
add
(
o
.
getPostTypeName
());
List
<
DutyPersonShiftDto
>
dutyShift
=
o
.
getDutyShift
();
initDutyShift
(
dayByMonth
,
dutyShift
,
list
);
data
.
add
(
list
);
});
}
return
data
;
}
}
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
;
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.yeejoin.amos.boot.biz.common.bo.ReginParams
;
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.ESAlertCalledService
;
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.web.bind.annotation.DeleteMapping
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.PostMapping
;
...
...
@@ -16,12 +26,15 @@ import org.springframework.web.bind.annotation.RequestMapping;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RestController
;
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.exception.instance.BadRequest
;
import
org.typroject.tyboot.core.restful.utils.ResponseHelper
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
javax.servlet.http.HttpServletRequest
;
import
java.util.List
;
import
java.lang.reflect.Field
;
import
java.util.Arrays
;
import
java.util.stream.Stream
;
/**
* 警情接警填报记录
...
...
@@ -34,8 +47,12 @@ import java.util.List;
@RequestMapping
(
value
=
"/tzs/alert-called"
)
public
class
AlertCalledController
extends
BaseController
{
@Autowired
AlertCalledServiceImpl
alertCalledServiceImpl
;
@Autowired
RedisUtils
redisUtils
;
@Autowired
AlertCalledServiceImpl
iAlertCalledService
;
@Autowired
private
ESAlertCalledService
eSAlertCalledService
;
/**
* 新增警情接警填报记录
...
...
@@ -45,25 +62,47 @@ public class AlertCalledController extends BaseController {
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@PostMapping
(
value
=
"/save"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"新增警情接警填报记录"
,
notes
=
"新增警情接警填报记录"
)
public
ResponseModel
<
AlertCalledDto
>
save
(
@RequestBody
AlertCalledDto
model
)
{
model
=
alertCalledServiceImpl
.
createWithModel
(
model
);
return
ResponseHelper
.
buildResponse
(
model
);
public
ResponseModel
<
AlertCalled
>
save
(
@RequestBody
AlertCalledObjsDto
alertCalledObjsDto
)
{
if
(
ValidationUtil
.
isEmpty
(
alertCalledObjsDto
)
||
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 主键
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@DeleteMapping
(
value
=
"/{id}"
)
@ApiOperation
(
httpMethod
=
"DELETE"
,
value
=
"根据id删除警情接警填报记录"
,
notes
=
"根据id删除警情接警填报记录"
)
public
ResponseModel
<
Boolean
>
deleteByid
(
HttpServletRequest
request
,
@PathVariable
(
value
=
"id"
)
Long
id
){
return
ResponseHelper
.
buildResponse
(
alertCalledServiceImpl
.
removeById
(
id
));
*
* <pre>
* 相似警情分页查询
* </pre>
*
* @param
* @param current
* @param size
* @return
* @throws Exception
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@ApiOperation
(
value
=
"相似警情分页查询"
)
@PostMapping
(
value
=
"/page/similar"
)
public
ResponseModel
<
Page
<
ESAlertCalledDto
>>
pageBySimilar
(
@RequestBody
ESAlertCalledRequestDto
alertCalledVo
,
@RequestParam
(
value
=
"current"
)
int
current
,
@RequestParam
(
value
=
"size"
)
int
size
)
throws
Exception
{
return
ResponseHelper
.
buildResponse
(
eSAlertCalledService
.
queryByKeys
(
alertCalledVo
,
current
,
size
));
}
/**
* 根据id查询
*
...
...
@@ -73,37 +112,88 @@ public class AlertCalledController extends BaseController {
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@GetMapping
(
value
=
"/{id}"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"根据id查询单个警情接警填报记录"
,
notes
=
"根据id查询单个警情接警填报记录"
)
public
ResponseModel
<
AlertCalledDto
>
selectOne
(
@PathVariable
Long
id
)
{
return
ResponseHelper
.
buildResponse
(
alertCalledServiceImpl
.
queryBySeq
(
id
));
public
ResponseModel
<
Object
>
selectOne
(
@PathVariable
Long
id
)
{
return
ResponseHelper
.
buildResponse
(
iAlertCalledService
.
selectAlertCalledById
(
id
));
}
/**
* 列表分页查询
*
* @param
current
当前页
* @param
current
每页大小
* @param
pageNum
当前页
* @param
pageSize
每页大小
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@GetMapping
(
value
=
"/
page
"
)
@GetMapping
(
value
=
"/
list
"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"警情接警填报记录分页查询"
,
notes
=
"警情接警填报记录分页查询"
)
public
ResponseModel
<
Page
<
AlertCalledDto
>>
queryForPage
(
@RequestParam
(
value
=
"current"
)
int
current
,
@RequestParam
(
value
=
"size"
)
int
size
)
{
Page
<
AlertCalledDto
>
page
=
new
Page
<
AlertCalledDto
>();
page
.
setCurrent
(
current
);
page
.
setSize
(
size
);
return
ResponseHelper
.
buildResponse
(
alertCalledServiceImpl
.
queryForAlertCalledPage
(
page
));
public
ResponseModel
<
IPage
<
AlertCalled
>>
queryForPage
(
String
pageNum
,
String
pageSize
,
String
sort
,
AlertCalled
alertCalled
)
{
Page
<
AlertCalled
>
pageBean
;
IPage
<
AlertCalled
>
page
;
QueryWrapper
<
AlertCalled
>
alertCalledQueryWrapper
=
new
QueryWrapper
<>();
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
);
}
/**
* 列表全部数据查询
*
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"警情接警填报记录列表全部数据查询"
,
notes
=
"警情接警填报记录列表全部数据查询"
)
@GetMapping
(
value
=
"/list"
)
public
ResponseModel
<
List
<
AlertCalledDto
>>
selectForList
()
{
return
ResponseHelper
.
buildResponse
(
alertCalledServiceImpl
.
queryForAlertCalledList
());
private
QueryWrapper
<
AlertCalled
>
setQueryWrapper
(
QueryWrapper
<
AlertCalled
>
queryWrapper
,
AlertCalled
alertCalled
,
String
sort
){
Class
<?
extends
AlertCalled
>
aClass
=
alertCalled
.
getClass
();
queryWrapper
.
eq
(
"is_delete"
,
0
);
if
(
sort
!=
null
)
{
// String[] date= sort.split(",");
// if(date[1].equals("ascend")) {
// queryWrapper.orderByAsc(RedisKey.humpToLine(date[0]));
// }else {
// 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;
import
com.alibaba.fastjson.JSON
;
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.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.AlertCalledObjsDto
;
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.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.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.Value
;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
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.Date
;
import
java.util.List
;
/**
...
...
@@ -38,6 +46,15 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto,AlertCall
@Autowired
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
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;
"org.typroject.tyboot.face.*.orm.dao*"
,
"org.typroject.tyboot.core.auth.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"
})
public
class
AmosTzsApplication
{
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
spring.redis.lettuce.pool.max-idle
=
10
spring.redis.lettuce.pool.min-idle
=
0
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