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
3bfb032d
Commit
3bfb032d
authored
Aug 12, 2021
by
tangwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
导入,导出 ,模板
parent
03350ab1
Hide whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
496 additions
and
162 deletions
+496
-162
FireChemicalDto.java
...join/amos/boot/module/common/api/dto/FireChemicalDto.java
+1
-1
FireTeamDto.java
.../yeejoin/amos/boot/module/common/api/dto/FireTeamDto.java
+1
-1
LinkageUnitDto.java
...ejoin/amos/boot/module/common/api/dto/LinkageUnitDto.java
+36
-21
OrgUsrExcelDto.java
...ejoin/amos/boot/module/common/api/dto/OrgUsrExcelDto.java
+140
-0
LinkageUnitMapper.java
...amos/boot/module/common/api/mapper/LinkageUnitMapper.java
+2
-2
OrgUsrMapper.java
...join/amos/boot/module/common/api/mapper/OrgUsrMapper.java
+4
-0
ILinkageUnitService.java
...s/boot/module/common/api/service/ILinkageUnitService.java
+1
-0
IOrgUsrService.java
...n/amos/boot/module/common/api/service/IOrgUsrService.java
+3
-0
LinkageUnitMapper.xml
...ommon-api/src/main/resources/mapper/LinkageUnitMapper.xml
+23
-0
OrgUsrMapper.xml
...ule-common-api/src/main/resources/mapper/OrgUsrMapper.xml
+39
-0
ExcelEnums.java
...om/yeejoin/amos/boot/module/jcs/api/enums/ExcelEnums.java
+37
-12
LinkageUnitServiceImpl.java
...odule/common/biz/service/impl/LinkageUnitServiceImpl.java
+27
-0
OrgUsrServiceImpl.java
...oot/module/common/biz/service/impl/OrgUsrServiceImpl.java
+12
-16
ExcelController.java
.../amos/boot/module/jcs/biz/controller/ExcelController.java
+46
-52
DataSourcesImpl.java
...mos/boot/module/jcs/biz/service/impl/DataSourcesImpl.java
+21
-0
ExcelServiceImpl.java
...os/boot/module/jcs/biz/service/impl/ExcelServiceImpl.java
+103
-57
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/FireChemicalDto.java
View file @
3bfb032d
...
...
@@ -14,7 +14,7 @@ import lombok.EqualsAndHashCode;
import
java.util.Date
;
/**
*
危化品
*
'
*
* @author system_generator
* @date 2021-06-29
...
...
amos-boot-module/amos-boot-module-api/amos-boot-module-common-api/src/main/java/com/yeejoin/amos/boot/module/common/api/dto/FireTeamDto.java
View file @
3bfb032d
...
...
@@ -39,7 +39,7 @@ public class FireTeamDto extends BaseDto {
private
String
companyCode
;
@ExplicitConstraint
(
indexNum
=
1
,
sourceClass
=
RoleNameExplicitConstraint
.
class
,
method
=
"getFireTeam"
)
//动态下拉内容
@ExcelProperty
(
value
=
"上级
单位
"
,
index
=
1
)
@ExcelProperty
(
value
=
"上级
队伍
"
,
index
=
1
)
@ApiModelProperty
(
value
=
"父级名称"
)
private
String
parentName
;
...
...
amos-boot-module/amos-boot-module-api/amos-boot-module-common-api/src/main/java/com/yeejoin/amos/boot/module/common/api/dto/LinkageUnitDto.java
View file @
3bfb032d
package
com
.
yeejoin
.
amos
.
boot
.
module
.
common
.
api
.
dto
;
import
com.alibaba.excel.annotation.ExcelIgnore
;
import
com.alibaba.excel.annotation.ExcelProperty
;
import
com.yeejoin.amos.boot.module.common.api.entity.SourceFile
;
import
com.yeejoin.amos.boot.module.common.api.excel.ExplicitConstraint
;
import
com.yeejoin.amos.boot.module.common.api.excel.RoleNameExplicitConstraint
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
com.yeejoin.amos.boot.biz.common.dto.BaseDto
;
...
...
@@ -22,88 +26,99 @@ import org.omg.CORBA.PRIVATE_MEMBER;
@EqualsAndHashCode
(
callSuper
=
true
)
@ApiModel
(
value
=
"LinkageUnitDto"
,
description
=
"联动单位"
)
public
class
LinkageUnitDto
extends
BaseDto
{
@ExcelIgnore
private
static
final
long
serialVersionUID
=
1L
;
@ExcelProperty
(
value
=
"单位名称"
,
index
=
0
)
@ApiModelProperty
(
value
=
"单位名称"
)
private
String
unitName
;
@ExcelIgnore
@ApiModelProperty
(
value
=
"单位code"
)
private
String
unitCode
;
@ExcelIgnore
@ApiModelProperty
(
value
=
"父级单位id"
)
private
String
parentId
;
@ApiModelProperty
(
value
=
"联动单位类别"
)
@ExcelProperty
(
value
=
"服务类别"
,
index
=
1
)
@ExplicitConstraint
(
type
=
"LDDWLB"
,
indexNum
=
1
,
sourceClass
=
RoleNameExplicitConstraint
.
class
)
//动态下拉内容
@ApiModelProperty
(
value
=
"服务类别"
)
private
String
linkageUnitType
;
@ExcelIgnore
@ApiModelProperty
(
value
=
"联动单位类别code"
)
private
String
linkageUnitTypeCode
;
@ExcelIgnore
@ApiModelProperty
(
value
=
"行政区划"
)
private
String
administrativeDivisions
;
@ExcelIgnore
@ApiModelProperty
(
value
=
"行政区划代码"
)
private
String
administrativeDivisionsCode
;
@ExcelProperty
(
value
=
"地址"
,
index
=
2
)
@ApiModelProperty
(
value
=
"地址"
)
private
String
address
;
@ExcelProperty
(
value
=
"经度"
,
index
=
3
)
@ApiModelProperty
(
value
=
"经度"
)
private
Double
longitude
;
@ExcelProperty
(
value
=
"纬度"
,
index
=
4
)
@ApiModelProperty
(
value
=
"纬度"
)
private
Double
latitude
;
@ExcelProperty
(
value
=
"协议开始日期"
,
index
=
5
)
@ApiModelProperty
(
value
=
"协议开始日期"
)
private
Date
agreementStartDate
;
@ExcelProperty
(
value
=
"协议结束日期"
,
index
=
6
)
@ApiModelProperty
(
value
=
"协议结束日期"
)
private
Date
agreementEndDate
;
@ExcelProperty
(
value
=
"应急联动单位类别"
,
index
=
7
)
@ExplicitConstraint
(
type
=
"YJLDDW"
,
indexNum
=
7
,
sourceClass
=
RoleNameExplicitConstraint
.
class
)
//动态下拉内容
@ApiModelProperty
(
value
=
"应急联动单位类别"
)
private
String
emergencyLinkageUnit
;
@ExcelIgnore
@ApiModelProperty
(
value
=
"应急联动单位类别code"
)
private
String
emergencyLinkageUnitCode
;
@ExcelProperty
(
value
=
"联系人"
,
index
=
8
)
@ApiModelProperty
(
value
=
"联系人 "
)
private
String
contactUser
;
@ExcelProperty
(
value
=
"联系人电话"
,
index
=
9
)
@ApiModelProperty
(
value
=
"联系人电话"
)
private
String
contactPhone
;
@ExcelIgnore
@ApiModelProperty
(
value
=
"实例id"
)
private
Long
instanceId
;
@ExcelIgnore
@ApiModelProperty
(
value
=
"组织机构代码"
)
private
String
orgCode
;
@ExcelIgnore
@ApiModelProperty
(
value
=
"操作人名称"
)
private
String
recUserName
;
@ExcelIgnore
@ApiModelProperty
(
value
=
"是否在协议期 "
)
private
String
inAgreement
;
@ExcelProperty
(
value
=
"消防救援能力"
,
index
=
10
)
@ApiModelProperty
(
value
=
"消防救援能力"
)
private
String
fireRescueCapability
;
@ExcelProperty
(
value
=
"职责_简要情况"
,
index
=
11
)
@ApiModelProperty
(
value
=
"职责_简要情况"
)
private
String
responsibilitiesSituation
;
@ExcelProperty
(
value
=
"应急服务内容"
,
index
=
12
)
@ApiModelProperty
(
value
=
"应急服务内容"
)
private
String
emergencyServiceContent
;
@ExcelProperty
(
value
=
"单位_简要情况"
,
index
=
13
)
@ApiModelProperty
(
value
=
"单位_简要情况"
)
private
String
unitSituation
;
@ExcelIgnore
@ApiModelProperty
(
value
=
"联动单位图片"
)
private
List
<
SourceFile
>
image
;
@ExcelIgnore
@ApiModelProperty
(
value
=
"车辆数量"
)
private
String
vehicleNumber
;
@ExcelIgnore
@ApiModelProperty
(
value
=
"特岗人数"
)
private
String
personNumber
;
}
amos-boot-module/amos-boot-module-api/amos-boot-module-common-api/src/main/java/com/yeejoin/amos/boot/module/common/api/dto/OrgUsrExcelDto.java
0 → 100644
View file @
3bfb032d
package
com
.
yeejoin
.
amos
.
boot
.
module
.
common
.
api
.
dto
;
import
com.alibaba.excel.annotation.ExcelIgnore
;
import
com.alibaba.excel.annotation.ExcelProperty
;
import
com.baomidou.mybatisplus.annotation.FieldFill
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.yeejoin.amos.boot.biz.common.dto.BaseDto
;
import
com.yeejoin.amos.boot.module.common.api.entity.DynamicFormInstance
;
import
com.yeejoin.amos.boot.module.common.api.excel.ExplicitConstraint
;
import
com.yeejoin.amos.boot.module.common.api.excel.RoleNameExplicitConstraint
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
java.util.List
;
/**
* 机构/部门/人员表
*
* @author tb
* @date 2021-06-18
*/
@Data
@EqualsAndHashCode
(
callSuper
=
true
)
@ApiModel
(
value
=
"OrgUsrExcelDto"
,
description
=
"机构/部门/人员表"
)
public
class
OrgUsrExcelDto
extends
BaseDto
{
@ExcelProperty
(
value
=
"姓名"
,
index
=
0
)
@ApiModelProperty
(
value
=
"机构/部门名称"
)
private
String
bizOrgName
;
@ExcelIgnore
@ApiModelProperty
(
value
=
"机构编码"
)
private
String
bizOrgCode
;
@ExcelIgnore
@ApiModelProperty
(
value
=
"amos中公司/部门ID"
)
private
String
amosOrgId
;
@ExcelIgnore
@ApiModelProperty
(
value
=
"amos中公司/部门编码"
)
private
String
amosOrgCode
;
@ExcelIgnore
@ApiModelProperty
(
value
=
"机构类型(部门:DEPARTMENT,单位:COMPANY,人员:PERSON)"
)
private
String
bizOrgType
;
@ExcelIgnore
@ApiModelProperty
(
value
=
"所属建筑名称"
)
private
String
buildName
;
@ExcelIgnore
@ApiModelProperty
(
value
=
"所属建筑ID"
)
private
String
buildId
;
@ExcelProperty
(
value
=
"所属单位部门"
,
index
=
1
)
@ExplicitConstraint
(
indexNum
=
1
,
sourceClass
=
RoleNameExplicitConstraint
.
class
,
method
=
"getparent"
)
//固定下拉内容
@ApiModelProperty
(
value
=
"归属机构/部门/人员"
)
private
String
parentId
;
@ExcelIgnore
@ApiModelProperty
(
value
=
"扩展属性1"
)
private
String
orgExpandAttr1
;
@ExcelIgnore
@ApiModelProperty
(
value
=
"扩展属性2"
)
private
String
orgExpandAttr2
;
@ExcelIgnore
@ApiModelProperty
(
value
=
"扩展属性3"
)
private
String
orgExpandAttr3
;
@ExcelIgnore
@ApiModelProperty
(
value
=
"扩展属性4"
)
private
String
orgExpandAttr4
;
@ExcelIgnore
private
String
orgExpandAttr5
;
@ExcelIgnore
private
String
orgExpandAttr6
;
@ExcelIgnore
private
String
orgExpandAttr7
;
@ExcelIgnore
private
String
orgExpandAttr8
;
@ExcelIgnore
@ApiModelProperty
(
value
=
"更新人"
)
@TableField
(
fill
=
FieldFill
.
INSERT_UPDATE
)
private
String
recUserName
;
@ExcelIgnore
@ApiModelProperty
(
value
=
"动态表单值"
)
private
List
<
DynamicFormInstance
>
dynamicFormValue
;
@ExcelProperty
(
value
=
"行政职务"
,
index
=
2
)
@ExplicitConstraint
(
type
=
"XZZW"
,
indexNum
=
2
,
sourceClass
=
RoleNameExplicitConstraint
.
class
)
//动态下拉内
private
String
administrativePositionCode
;
// 行政职务
@ExcelProperty
(
value
=
"审核周期"
,
index
=
3
)
@ExplicitConstraint
(
type
=
"SHZQ"
,
indexNum
=
3
,
sourceClass
=
RoleNameExplicitConstraint
.
class
)
//动态下拉内
private
String
auditCycle
;
//审核周期
@ExcelProperty
(
value
=
"证件号码"
,
index
=
4
)
private
String
certificatesNumber
;
// 证件号码
@ExcelProperty
(
value
=
"证件类型"
,
index
=
5
)
@ExplicitConstraint
(
type
=
"RYZJLX"
,
indexNum
=
5
,
sourceClass
=
RoleNameExplicitConstraint
.
class
)
//动态下拉内
private
String
certificatesTypeCode
;
//证件类型
@ExcelProperty
(
value
=
"持证类别"
,
index
=
6
)
@ExplicitConstraint
(
type
=
"CZLB"
,
indexNum
=
6
,
sourceClass
=
RoleNameExplicitConstraint
.
class
)
//动态下拉内
private
String
certificateType
;
//持证类别
@ExcelProperty
(
value
=
"消防管理岗位"
,
index
=
7
)
@ExplicitConstraint
(
type
=
"XFGLGW"
,
indexNum
=
7
,
sourceClass
=
RoleNameExplicitConstraint
.
class
)
//动态下拉内
private
String
fireManagementPostCode
;
//消防管理岗位
@ExcelProperty
(
value
=
"性别"
,
index
=
8
)
@ExplicitConstraint
(
type
=
"XB"
,
indexNum
=
8
,
sourceClass
=
RoleNameExplicitConstraint
.
class
)
//动态下拉内
private
String
gender
;
//性别
@ExcelProperty
(
value
=
"消防管理组织机构内部职务"
,
index
=
9
)
@ExplicitConstraint
(
type
=
"JGNBZW"
,
indexNum
=
9
,
sourceClass
=
RoleNameExplicitConstraint
.
class
)
//动态下拉内
private
String
internalPositionCode
;
//消防管理组织机构内部职务
@ExcelProperty
(
value
=
"员工编号"
,
index
=
10
)
private
String
personNumber
;
//员工编号
@ExcelProperty
(
value
=
"岗位类型"
,
index
=
11
)
@ExplicitConstraint
(
type
=
"GWMC"
,
indexNum
=
11
,
sourceClass
=
RoleNameExplicitConstraint
.
class
)
//动态下拉内
private
String
positionType
;
//岗位类型
@ExcelProperty
(
value
=
"是否进行安全培训"
,
index
=
12
)
@ExplicitConstraint
(
type
=
"AQPX"
,
indexNum
=
12
,
sourceClass
=
RoleNameExplicitConstraint
.
class
)
//动态下拉内
private
String
safetyTraining
;
//是否进行安全培训
@ExcelProperty
(
value
=
"人员状态"
,
index
=
13
)
@ExplicitConstraint
(
type
=
"RYZT"
,
indexNum
=
13
,
sourceClass
=
RoleNameExplicitConstraint
.
class
)
//动态下拉内
private
String
stateCode
;
//人员状态
@ExcelProperty
(
value
=
"联系电话"
,
index
=
14
)
private
String
telephone
;
//联系电话
}
amos-boot-module/amos-boot-module-api/amos-boot-module-common-api/src/main/java/com/yeejoin/amos/boot/module/common/api/mapper/LinkageUnitMapper.java
View file @
3bfb032d
...
...
@@ -60,7 +60,7 @@ public interface LinkageUnitMapper extends BaseMapper<LinkageUnit> {
*/
Page
<
List
<
LinkageUnitDto
>>
getEmergencyLinkageUnitList
(
IPage
<
LinkageUnitDto
>
page
,
String
unitName
,
String
linkageUnitTypeCode
,
String
emergencyLinkageUnitCode
);
List
<
LinkageUnitDto
>
exportToExcel
();
}
amos-boot-module/amos-boot-module-api/amos-boot-module-common-api/src/main/java/com/yeejoin/amos/boot/module/common/api/mapper/OrgUsrMapper.java
View file @
3bfb032d
...
...
@@ -59,4 +59,8 @@ public interface OrgUsrMapper extends BaseMapper<OrgUsr> {
List
<
OrgUsrzhDto
>
getOrgUsrzhDto
(
@Param
(
"bizOrgName"
)
String
bizOrgName
);
List
<
Map
<
String
,
Object
>>
getparent
();
List
<
OrgUsrExcelDto
>
exportToExcel
();
}
amos-boot-module/amos-boot-module-api/amos-boot-module-common-api/src/main/java/com/yeejoin/amos/boot/module/common/api/service/ILinkageUnitService.java
View file @
3bfb032d
...
...
@@ -48,5 +48,6 @@ public interface ILinkageUnitService {
* @return
*/
public
List
<
Menu
>
getEmergencyLinkageUnitCodeGroupBy
(
String
type
,
String
rootName
)
;
List
<
LinkageUnitDto
>
exportToExcel
();
}
amos-boot-module/amos-boot-module-api/amos-boot-module-common-api/src/main/java/com/yeejoin/amos/boot/module/common/api/service/IOrgUsrService.java
View file @
3bfb032d
...
...
@@ -173,4 +173,7 @@ public interface IOrgUsrService {
List
<
ESOrgUsrDto
>
selectByIddata
(
String
name
);
List
<
Map
<
String
,
Object
>>
getparent
();
List
<
OrgUsrExcelDto
>
exportToExcel
();
}
amos-boot-module/amos-boot-module-api/amos-boot-module-common-api/src/main/resources/mapper/LinkageUnitMapper.xml
View file @
3bfb032d
...
...
@@ -87,6 +87,29 @@
emergency_linkage_unit_code
</select>
<select
id=
"exportToExcel"
resultType=
"com.yeejoin.amos.boot.module.common.api.dto.LinkageUnitDto"
>
select
a.unit_name unitName,
a.linkage_unit_type linkageUnitType,
a.address ,
a.latitude,
a.longitude,
a.agreement_start_date agreementStartDate,
a.agreement_end_date agreementEndDate,
a.contact_user contactUser,
a.contact_phone contactPhone,
b.*
from cb_linkage_unit a LEFT JOIN
(SELECT
m.instance_id,
max(case m.field_code when 'emergencyServiceContent' then m.field_value end) emergencyServiceContent,
max(case m.field_code when 'fireRescueCapability' then m.field_value end) fireRescueCapability,
max(case m.field_code when 'responsibilitiesSituation' then m.field_value end) responsibilitiesSituation,
max(case m.field_code when 'unitSituation' then m.field_value end) unitSituation
FROM cb_dynamic_form_instance m GROUP BY m.instance_id) b
on b.instance_id=a.instance_id where a.unit_name is not null
</select>
<select
id=
"getEmergencyLinkageUnitList"
...
...
amos-boot-module/amos-boot-module-api/amos-boot-module-common-api/src/main/resources/mapper/OrgUsrMapper.xml
View file @
3bfb032d
...
...
@@ -297,4 +297,43 @@ LEFT JOIN (
keysite.belong_id
) keysite_sur ON company_sur.sequence_nbr = keysite_sur.belong_id
</select>
<select
id=
"getparent"
resultType=
"Map"
>
SELECT important_companys.id ,important_companys.name
FROM important_companys
</select>
<select
id=
"exportToExcel"
resultType=
"com.yeejoin.amos.boot.module.common.api.dto.OrgUsrExcelDto"
>
select
a.biz_org_name bizOrgName,
(select c.biz_org_name from cb_org_usr c where c.sequence_nbr=a.parent_id) parentId,
b.*
from cb_org_usr a LEFT JOIN
(SELECT
instance_id,
max(case field_code when 'administrativePositionCode' then field_value_label end) administrativePositionCode,
max(case field_code when 'auditCycle' then field_value_label end) auditCycle,
max(case field_code when 'certificatesNumber' then field_value end) certificatesNumber,
max(case field_code when 'certificatesTypeCode' then field_value_label end) certificatesTypeCode,
max(case field_code when 'certificateType' then field_value_label end) certificateType,
max(case field_code when 'fireManagementPostCode' then field_value_label end) fireManagementPostCode,
max(case field_code when 'gender' then field_value_label end) gender,
max(case field_code when 'internalPositionCode' then field_value_label end) internalPositionCode,
max(case field_code when 'personNumber' then field_value end) personNumber,
max(case field_code when 'positionType' then field_value_label end) positionType,
max(case field_code when 'safetyTraining' then field_value_label end) safetyTraining,
max(case field_code when 'stateCode' then field_value_label end) stateCode,
max(case field_code when 'telephone' then field_value end) telephone
FROM cb_dynamic_form_instance GROUP BY instance_id) b
on b.instance_id=a.sequence_nbr where a.biz_org_name is not null
</select>
</mapper>
amos-boot-module/amos-boot-module-api/amos-boot-module-jcs-api/src/main/java/com/yeejoin/amos/boot/module/jcs/api/enums/ExcelEnums.java
View file @
3bfb032d
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jcs
.
api
.
enums
;
import
lombok.AllArgsConstructor
;
import
lombok.Getter
;
/**
* 导出类型常量
***/
public
class
ExcelEnums
{
public
static
final
String
WHP
=
"WHP"
;
// ("WHP","危险品"),
public
static
final
String
XFZJ
=
"XFZJ"
;
//("XFZJ","消防专家"),
public
static
final
String
SYXX
=
"SYXX"
;
//("SYXX","水源信息"),
public
static
final
String
HKQ
=
"HKQ"
;
//("HKQ","航空器");
public
static
final
String
XFDW
=
"XFDW"
;
//("XFDW","消防队伍")
public
static
final
String
WXXFZ
=
"WXXFZ"
;
//("WXXFZ","微型消防站")
public
static
final
String
XFRY
=
"XFRY"
;
//("XFRY","消防人员")
public
static
final
String
CLZQ
=
"CLZQ"
;
//("CLZQ","车辆执勤")
public
static
final
String
RYZB
=
"RYZB"
;
//("RYZB","人员值班")
public
static
final
String
WBRY
=
"WBRY"
;
//("WBRY",维保人员)
public
static
final
String
KEYSITE
=
"KEYSITE"
;
//{"KEYSITE":重點部位}
@Getter
@AllArgsConstructor
public
enum
ExcelEnums
{
WHP
(
"危险品"
,
"危险品"
,
"com.yeejoin.amos.boot.module.common.api.dto.FireChemicalDto"
,
"WHP"
),
// ("WHP","危险品"),
XFZJ
(
"消防专家"
,
"消防专家"
,
"com.yeejoin.amos.boot.module.common.api.dto.FireExpertsDto"
,
"XFZJ"
),
//("XFZJ","消防专家"),
SYXX
(
"水源信息"
,
"水源信息"
,
"com.yeejoin.amos.boot.module.common.api.dto.WaterResourceDto"
,
"SYXX"
),
//("SYXX","水源信息"),
HKQ
(
"航空器"
,
"航空器"
,
"com.yeejoin.amos.boot.module.jcs.api.dto.AircraftDto"
,
"HKQ"
),
//("HKQ","航空器");
XFDW
(
"消防队伍"
,
"消防队伍"
,
"com.yeejoin.amos.boot.module.common.api.dto.FireTeamDto"
,
"XFDW"
),
//("XFDW","消防队伍")
WXXFZ
(
"微型消防站"
,
"微型消防站"
,
"com.yeejoin.amos.boot.module.common.api.dto.FireStationDto"
,
"WXXFZ"
),
//("WXXFZ","微型消防站")
XFRY
(
"消防人员"
,
"消防人员"
,
"com.yeejoin.amos.boot.module.common.api.dto.FirefightersExcelDto"
,
"XFRY"
),
//("XFRY","消防人员")
WBRY
(
"维保人员"
,
"维保人员"
,
"com.yeejoin.amos.boot.module.common.api.dto.MaintenancePersonExcleDto"
,
"WBRY"
),
//("WBRY",维保人员)
KEYSITE
(
"重點部位"
,
"重點部位"
,
"com.yeejoin.amos.boot.module.common.api.dto.KeySiteExcleDto"
,
"KEYSITE"
),
//{"KEYSITE":重點部位}
CLZQ
(
"车辆执勤"
,
"车辆执勤"
,
"com.yeejoin.amos.boot.module.common.api.dto.DutyCarExcelDto"
,
"CLZQ"
),
//("CLZQ","车辆执勤")
JCDWRY
(
"机场单位人员"
,
"机场单位人员"
,
"com.yeejoin.amos.boot.module.common.api.dto.OrgUsrExcelDto"
,
"JCDWRY"
),
//("JCDW","机场单位")
LDDW
(
"联动单位"
,
"联动单位"
,
"com.yeejoin.amos.boot.module.common.api.dto.LinkageUnitDto"
,
"LDDW"
),
//("JCDW","机场单位")
RYZB
(
"人员值班"
,
"人员值班"
,
"com.yeejoin.amos.boot.module.common.api.dto.DutyPersonDto"
,
"RYZB"
);
//("RYZB","人员值班")
private
String
fileName
;
private
String
sheetName
;
private
String
classUrl
;
private
String
type
;
public
static
ExcelEnums
getByKey
(
String
type
)
{
for
(
ExcelEnums
status
:
ExcelEnums
.
values
())
{
if
(
status
.
getType
().
equals
(
type
))
{
return
status
;
}
}
return
null
;
}
}
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 @
3bfb032d
...
...
@@ -152,6 +152,27 @@ public class LinkageUnitServiceImpl extends BaseService<LinkageUnitDto, LinkageU
return
model
;
}
public
LinkageUnitDto
saveLinkageModel
(
LinkageUnitDto
linkageUnitDto
)
{
// 1.保存行数据
String
groupCode
=
this
.
getGroupCode
();
Map
<
String
,
Object
>
map
=
Bean
.
BeantoMap
(
linkageUnitDto
);
Long
instanceId
=
dynamicFormInstanceService
.
commonSave
(
groupCode
,
map
);
linkageUnitDto
.
setInstanceId
(
instanceId
);
// 2.保存基本信息
linkageUnitDto
.
setUnitCode
(
getUnitCodeStr
());
LinkageUnitDto
model
=
createWithModel
(
linkageUnitDto
);
// 3.保存照片信息
sourceFileServiceImpl
.
saveSourceFile
(
model
.
getSequenceNbr
(),
model
.
getImage
());
// 3.返回保存后的数据
return
model
;
}
@Override
public
LinkageUnitDto
queryOne
(
Long
sequenceNbr
)
{
String
groupCode
=
getGroupCode
();
...
...
@@ -290,4 +311,9 @@ public class LinkageUnitServiceImpl extends BaseService<LinkageUnitDto, LinkageU
return
menuList
;
}
@Override
public
List
<
LinkageUnitDto
>
exportToExcel
()
{
return
linkageUnitMapper
.
exportToExcel
();
}
}
\ 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/service/impl/OrgUsrServiceImpl.java
View file @
3bfb032d
...
...
@@ -6,21 +6,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.boot.biz.common.constants.CommonConstant
;
import
com.yeejoin.amos.boot.biz.common.utils.TreeParser
;
import
com.yeejoin.amos.boot.module.common.api.dto.CompanyDto
;
import
com.yeejoin.amos.boot.module.common.api.dto.CompanyPerson
;
import
com.yeejoin.amos.boot.module.common.api.dto.DynamicFormInstanceDto
;
import
com.yeejoin.amos.boot.module.common.api.dto.ESOrgUsrDto
;
import
com.yeejoin.amos.boot.module.common.api.dto.FormValue
;
import
com.yeejoin.amos.boot.module.common.api.dto.OrgDepartmentDto
;
import
com.yeejoin.amos.boot.module.common.api.dto.OrgDepartmentFormDto
;
import
com.yeejoin.amos.boot.module.common.api.dto.OrgMenuDto
;
import
com.yeejoin.amos.boot.module.common.api.dto.OrgPersonDto
;
import
com.yeejoin.amos.boot.module.common.api.dto.OrgPersonExcelDto
;
import
com.yeejoin.amos.boot.module.common.api.dto.OrgPersonFormDto
;
import
com.yeejoin.amos.boot.module.common.api.dto.OrgUsrDto
;
import
com.yeejoin.amos.boot.module.common.api.dto.OrgUsrFormDto
;
import
com.yeejoin.amos.boot.module.common.api.dto.OrgUsrzhDto
;
import
com.yeejoin.amos.boot.module.common.api.dto.RequestData
;
import
com.yeejoin.amos.boot.module.common.api.dto.*
;
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.OrgUsr
;
...
...
@@ -974,7 +960,17 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
});
return
lidataDtos
;
}
@Override
public
List
<
Map
<
String
,
Object
>>
getparent
()
{
return
orgUsrMapper
.
getparent
();
}
@Override
public
List
<
OrgUsrExcelDto
>
exportToExcel
()
{
return
orgUsrMapper
.
exportToExcel
();
}
public
List
<
OrgUsr
>
getCompanyDetailTree
()
{
LambdaQueryWrapper
<
OrgUsr
>
wrapper
=
new
LambdaQueryWrapper
<
OrgUsr
>();
wrapper
.
eq
(
OrgUsr:
:
getBizOrgType
,
"COMPANY"
);
...
...
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 @
3bfb032d
...
...
@@ -2,16 +2,12 @@ package com.yeejoin.amos.boot.module.jcs.biz.controller;
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.api.enums.ExcelEnums
;
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.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RequestPart
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.multipart.MultipartFile
;
import
org.typroject.tyboot.core.foundation.enumeration.UserType
;
import
org.typroject.tyboot.core.restful.doc.TycloudOperation
;
...
...
@@ -34,25 +30,15 @@ public class ExcelController extends BaseController {
private
static
final
String
NOT_DUTY
=
"休班"
;
@TycloudOperation
(
needAuth
=
false
,
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"下载模板"
)
@GetMapping
(
"/template"
)
public
void
template
(
HttpServletResponse
response
,
ExcelDto
excelDto
)
{
try
{
excelService
.
templateExport
(
response
,
excelDto
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
throw
new
RuntimeException
(
"系统异常!"
);
}
}
@TycloudOperation
(
needAuth
=
false
,
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"下载模板"
)
@GetMapping
(
"/download/template"
)
public
void
downloadTemplate
(
HttpServletResponse
response
,
@RequestParam
(
required
=
false
)
String
fileName
,
@RequestParam
(
required
=
false
)
String
sheetName
,
@RequestParam
String
classUrl
)
{
@GetMapping
(
"/download/template/{type}"
)
public
void
downloadTemplate
(
HttpServletResponse
response
,
@PathVariable
(
value
=
"type"
)
String
type
)
{
try
{
ExcelDto
excelDto
=
new
ExcelDto
(
fileName
,
sheetName
,
classUrl
,
toString
());
ExcelEnums
excelEnums
=
ExcelEnums
.
getByKey
(
type
);
ExcelDto
excelDto
=
new
ExcelDto
(
excelEnums
.
getFileName
(),
excelEnums
.
getSheetName
(),
excelEnums
.
getClassUrl
(),
excelEnums
.
getType
());
excelService
.
templateExport
(
response
,
excelDto
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
...
...
@@ -62,9 +48,11 @@ public class ExcelController extends BaseController {
@TycloudOperation
(
needAuth
=
false
,
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"导出公用类"
)
@GetMapping
(
"/export"
)
public
void
getFireStationFile
(
HttpServletResponse
response
,
ExcelDto
excelDto
)
{
@GetMapping
(
"/export
/{type}
"
)
public
void
getFireStationFile
(
HttpServletResponse
response
,
@PathVariable
(
value
=
"type"
)
String
type
)
{
try
{
ExcelEnums
excelEnums
=
ExcelEnums
.
getByKey
(
type
);
ExcelDto
excelDto
=
new
ExcelDto
(
excelEnums
.
getFileName
(),
excelEnums
.
getSheetName
(),
excelEnums
.
getClassUrl
(),
excelEnums
.
getType
());
excelService
.
commonExport
(
response
,
excelDto
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
...
...
@@ -72,24 +60,15 @@ public class ExcelController extends BaseController {
}
}
@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
(
"系统异常!"
);
}
}
@TycloudOperation
(
needAuth
=
false
,
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"
上传文件数据-
"
)
@PostMapping
(
"/upload"
)
public
void
upload
(
@RequestPart
(
"file"
)
MultipartFile
multipartFile
,
ExcelDto
excelDto
)
{
@ApiOperation
(
value
=
"
导入公用
"
)
@PostMapping
(
"/upload
/{type}
"
)
public
void
upload
(
@RequestPart
(
"file"
)
MultipartFile
multipartFile
,
@PathVariable
(
value
=
"type"
)
String
type
)
{
try
{
ExcelEnums
excelEnums
=
ExcelEnums
.
getByKey
(
type
);
ExcelDto
excelDto
=
new
ExcelDto
(
excelEnums
.
getFileName
(),
excelEnums
.
getSheetName
(),
excelEnums
.
getClassUrl
(),
excelEnums
.
getType
());
excelService
.
commonUpload
(
multipartFile
,
excelDto
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
...
...
@@ -97,21 +76,36 @@ public class ExcelController extends BaseController {
}
}
@TycloudOperation
(
needAuth
=
false
,
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"上传文件数据-2"
)
@PostMapping
(
"/upload2"
)
public
void
upload2
(
@RequestPart
(
"file"
)
MultipartFile
multipartFile
,
@RequestParam
(
required
=
false
)
String
fileName
,
@RequestParam
(
required
=
false
)
String
sheetName
,
@RequestParam
String
type
)
{
try
{
excelService
.
commonUpload
(
multipartFile
,
new
ExcelDto
(
fileName
,
sheetName
,
type
));
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
throw
new
RuntimeException
(
"系统异常!"
);
}
}
// @TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
// @ApiOperation(value = "上传文件数据-2")
// @PostMapping("/upload2")
// public void upload2(@RequestPart("file") MultipartFile multipartFile,
// @RequestParam(required = false) String fileName,
// @RequestParam(required = false) String sheetName,
// @RequestParam String type) {
// try {
// excelService.commonUpload(multipartFile, new ExcelDto(fileName, sheetName, type));
// } catch (Exception e) {
// e.printStackTrace();
// throw new RuntimeException("系统异常!");
// }
// }
// @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("系统异常!");
// }
// }
/**
* 导出值班模板
*
...
...
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 @
3bfb032d
...
...
@@ -127,6 +127,12 @@ public class DataSourcesImpl implements DataSources {
case
"getCompanyDetailTree"
:
str
=
getCompanyDetailTree
();
break
;
case
"getparent"
:
str
=
getparent
();
break
;
}
}
return
str
;
...
...
@@ -273,4 +279,19 @@ public class DataSourcesImpl implements DataSources {
String
[]
str
=
stringList
.
toArray
(
new
String
[
stringList
.
size
()]);
return
str
;
}
private
String
[]
getparent
()
throws
Exception
{
String
[]
str
=
null
;
List
<
Map
<
String
,
Object
>>
orgUsrTree
=
orgUsrService
.
getparent
();
if
(
orgUsrTree
!=
null
&&
orgUsrTree
.
size
()>
0
){
List
<
String
>
buildingNames
=
orgUsrTree
.
stream
().
map
(
item
->
{
return
item
.
get
(
"name"
)
+
"@"
+
item
.
get
(
"id"
);
}).
collect
(
Collectors
.
toList
());
str
=
buildingNames
.
toArray
(
new
String
[
buildingNames
.
size
()]);
}
return
str
;
}
}
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
View file @
3bfb032d
...
...
@@ -5,23 +5,7 @@ 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.dto.*
;
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
;
...
...
@@ -35,17 +19,7 @@ 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.common.biz.service.impl.*
;
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
;
...
...
@@ -119,6 +93,9 @@ public class ExcelServiceImpl {
@Autowired
IDutyPersonService
iDutyPersonService
;
@Autowired
LinkageUnitServiceImpl
linkageUnitServiceImpl
;
public
void
templateExport
(
HttpServletResponse
response
,
ExcelDto
excelDto
)
throws
ClassNotFoundException
{
String
url
=
excelDto
.
getClassUrl
();
Class
<?>
clz
=
Class
.
forName
(
url
);
...
...
@@ -129,53 +106,65 @@ public class ExcelServiceImpl {
public
void
commonExport
(
HttpServletResponse
response
,
ExcelDto
excelDto
)
{
switch
(
excelDto
.
getType
())
{
case
ExcelEnums
.
WHP
:
case
"WHP"
:
List
<
FireChemicalDto
>
data
=
fireChemicalServiceImpl
.
queryForFireChemicalList
(
false
);
ExcelUtil
.
createTemplate
(
response
,
excelDto
.
getFileName
(),
excelDto
.
getSheetName
(),
data
,
FireChemicalDto
.
class
,
dataSourcesImpl
,
false
);
break
;
case
ExcelEnums
.
XFZJ
:
case
"XFZJ"
:
List
<
FireExpertsDto
>
fireExpertsDtoList
=
fireExpertsServiceImpl
.
queryForFireExpertsList
(
false
);
ExcelUtil
.
createTemplate
(
response
,
excelDto
.
getFileName
(),
excelDto
.
getSheetName
(),
fireExpertsDtoList
,
FireExpertsDto
.
class
,
dataSourcesImpl
,
false
);
break
;
case
ExcelEnums
.
SYXX
:
case
"SYXX"
:
List
<
WaterResourceDto
>
waterResourceDtoList
=
waterResourceServiceImpl
.
exportToExcel
(
true
);
ExcelUtil
.
createTemplate
(
response
,
excelDto
.
getFileName
(),
excelDto
.
getSheetName
(),
waterResourceDtoList
,
WaterResourceDto
.
class
,
dataSourcesImpl
,
false
);
break
;
case
ExcelEnums
.
HKQ
:
case
"HKQ"
:
List
<
AircraftDto
>
aircraftDtoList
=
aircraftServiceImpl
.
queryAircraftDtoForList
(
false
);
ExcelUtil
.
createTemplate
(
response
,
excelDto
.
getFileName
(),
excelDto
.
getSheetName
(),
aircraftDtoList
,
AircraftDto
.
class
,
dataSourcesImpl
,
false
);
break
;
case
ExcelEnums
.
XFDW
:
case
"XFDW"
:
List
<
FireTeamDto
>
fireTeamDtoList
=
fireTeamService
.
queryFireTeamForList
(
false
);
ExcelUtil
.
createTemplate
(
response
,
excelDto
.
getFileName
(),
excelDto
.
getSheetName
(),
fireTeamDtoList
,
FireTeamDto
.
class
,
dataSourcesImpl
,
false
);
break
;
case
ExcelEnums
.
WXXFZ
:
case
"WXXFZ"
:
List
<
FireStationDto
>
fireStationDtoList
=
fireStationService
.
queryForFireStationList
(
false
);
ExcelUtil
.
createTemplate
(
response
,
excelDto
.
getFileName
(),
excelDto
.
getSheetName
(),
fireStationDtoList
,
FireStationDto
.
class
,
null
,
false
);
break
;
case
ExcelEnums
.
XFRY
:
case
"XFRY"
:
List
<
FirefightersExcelDto
>
firefightersExcelDtoList
=
firefightersService
.
exportToExcel
(
false
);
ExcelUtil
.
createTemplate
(
response
,
excelDto
.
getFileName
(),
excelDto
.
getSheetName
(),
firefightersExcelDtoList
,
FirefightersExcelDto
.
class
,
null
,
false
);
break
;
case
ExcelEnums
.
WBRY
:
case
"WBRY"
:
List
<
MaintenancePersonExcleDto
>
maintenancePersonExcelDtoList
=
maintenanceCompanyService
.
exportToMaintenancePersonExcel
();
ExcelUtil
.
createTemplate
(
response
,
excelDto
.
getFileName
(),
excelDto
.
getSheetName
(),
maintenancePersonExcelDtoList
,
MaintenancePersonExcleDto
.
class
,
null
,
false
);
break
;
case
ExcelEnums
.
KEYSITE
:
case
"KEYSITE"
:
List
<
KeySiteExcleDto
>
keySiteDtoList
=
keySiteService
.
exportToExcel
();
ExcelUtil
.
createTemplate
(
response
,
excelDto
.
getFileName
(),
excelDto
.
getSheetName
(),
keySiteDtoList
,
KeySiteExcleDto
.
class
,
null
,
false
);
break
;
default
:
case
"JCDWRY"
:
List
<
OrgUsrExcelDto
>
orgUsrList
=
orgUsrService
.
exportToExcel
();
ExcelUtil
.
createTemplate
(
response
,
excelDto
.
getFileName
(),
excelDto
.
getSheetName
(),
orgUsrList
,
OrgUsrExcelDto
.
class
,
null
,
false
);
break
;
case
"LDDW"
:
List
<
LinkageUnitDto
>
LinkageUnitDtoList
=
linkageUnitServiceImpl
.
exportToExcel
();
ExcelUtil
.
createTemplate
(
response
,
excelDto
.
getFileName
(),
excelDto
.
getSheetName
(),
LinkageUnitDtoList
,
LinkageUnitDto
.
class
,
null
,
false
);
break
;
default
:
break
;
}
}
...
...
@@ -183,40 +172,90 @@ public class ExcelServiceImpl {
public
void
commonUpload
(
MultipartFile
multipartFile
,
ExcelDto
excelDto
)
throws
Exception
{
switch
(
excelDto
.
getType
())
{
case
ExcelEnums
.
WHP
:
case
"WHP"
:
excelImportFireChemical
(
multipartFile
);
break
;
case
ExcelEnums
.
XFZJ
:
case
"XFZJ"
:
excelImportFireExperts
(
multipartFile
);
break
;
case
ExcelEnums
.
SYXX
:
case
"SYXX"
:
excelImportWaterResource
(
multipartFile
);
break
;
case
ExcelEnums
.
HKQ
:
case
"HKQ"
:
excelImportAircraft
(
multipartFile
);
break
;
case
ExcelEnums
.
XFDW
:
case
"XFDW"
:
excelImportFireTeam
(
multipartFile
);
break
;
case
ExcelEnums
.
WXXFZ
:
case
"WXXFZ"
:
excelImportFireStation
(
multipartFile
);
break
;
case
ExcelEnums
.
XFRY
:
case
"XFRY"
:
excelImportFirefighters
(
multipartFile
);
break
;
case
ExcelEnums
.
CLZQ
:
excelImportDutyPerson
(
multipartFile
,
ExcelEnums
.
CLZQ
);
case
"CLZQ"
:
excelImportDutyPerson
(
multipartFile
,
"CLZQ"
);
break
;
case
"RYZB"
:
excelImportDutyPerson
(
multipartFile
,
"RYZB"
);
break
;
case
ExcelEnums
.
RYZB
:
excelImportDutyPerson
(
multipartFile
,
ExcelEnums
.
RYZB
);
case
ExcelEnums
.
WBRY
:
case
"WBRY"
:
excelImportMaintenancePerson
(
multipartFile
);
case
ExcelEnums
.
KEYSITE
:
break
;
case
"KEYSITE"
:
excelImportKeySite
(
multipartFile
);
break
;
case
"JCDWRY"
:
excelImportOrgUsrExcelDto
(
multipartFile
);
case
"LDDW"
:
excelImportLinkageUnitZhDto
(
multipartFile
);
}
return
;
}
private
void
excelImportLinkageUnitZhDto
(
MultipartFile
multipartFile
)
throws
Exception
{
List
<
LinkageUnitDto
>
excelDtoList
=
ExcelUtil
.
readFirstSheetExcel
(
multipartFile
,
LinkageUnitDto
.
class
,
1
);
if
(
excelDtoList
!=
null
&&
excelDtoList
.
size
()>
0
){
excelDtoList
.
forEach
(
linkageUnitDto
->{
if
(
linkageUnitDto
.
getLinkageUnitType
()!=
null
){
String
[]
certificates
=
linkageUnitDto
.
getLinkageUnitType
().
split
(
"@"
);
linkageUnitDto
.
setLinkageUnitType
(
certificates
[
0
]);
linkageUnitDto
.
setLinkageUnitTypeCode
(
certificates
[
1
]);
}
if
(
linkageUnitDto
.
getEmergencyLinkageUnit
()!=
null
){
String
[]
certificates
=
linkageUnitDto
.
getEmergencyLinkageUnit
().
split
(
"@"
);
linkageUnitDto
.
setEmergencyLinkageUnit
(
certificates
[
0
]);
linkageUnitDto
.
setEmergencyLinkageUnitCode
(
certificates
[
1
]);
}
linkageUnitServiceImpl
.
saveLinkageModel
(
linkageUnitDto
);
});
}
}
private
void
excelImportOrgUsrExcelDto
(
MultipartFile
multipartFile
)
throws
Exception
{
List
<
OrgUsrExcelDto
>
excelDtoList
=
ExcelUtil
.
readFirstSheetExcel
(
multipartFile
,
OrgUsrExcelDto
.
class
,
1
);
// keySiteService.saveExcel(excelDtoList);
}
private
void
excelImportFirefighters
(
MultipartFile
multipartFile
)
throws
Exception
{
List
<
FirefightersExcelDto
>
excelDtoList
=
ExcelUtil
.
readFirstSheetExcel
(
multipartFile
,
FirefightersExcelDto
.
class
,
1
);
...
...
@@ -469,10 +508,10 @@ public class ExcelServiceImpl {
String
dateStr
=
monthCell
==
null
?
""
:
monthCell
.
toString
();
List
<
Date
>
dayByMonth
=
DateUtils
.
getDayByMonth
(
dateStr
);
if
(
ExcelEnums
.
CLZQ
.
equals
(
dutyType
))
{
if
(
ExcelEnums
.
CLZQ
.
getType
().
equals
(
dutyType
))
{
initDutyCarData
(
sheet
,
dataList
,
dayByMonth
);
dutyCarService
.
saveImportData
(
dataList
);
}
else
if
(
ExcelEnums
.
RYZB
.
equals
(
dutyType
))
{
}
else
if
(
ExcelEnums
.
RYZB
.
getType
().
equals
(
dutyType
))
{
initDutyPersonData
(
sheet
,
dataList
,
dayByMonth
);
dutyPersonService
.
saveImportData
(
dataList
);
}
...
...
@@ -613,12 +652,19 @@ public class ExcelServiceImpl {
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
()))
{
if
(
ExcelEnums
.
CLZQ
.
getType
().
equals
(
excelDto
.
getType
()))
{
data
=
initDutyCarTemplate
(
ids
);
}
else
if
(
ExcelEnums
.
RYZB
.
equals
(
excelDto
.
getType
()))
{
}
else
if
(
ExcelEnums
.
RYZB
.
getType
().
equals
(
excelDto
.
getType
()))
{
data
=
initDutyPersonTemplate
(
ids
);
}
// 获取日期
...
...
@@ -636,9 +682,9 @@ public class ExcelServiceImpl {
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
()))
{
if
(
ExcelEnums
.
CLZQ
.
getType
().
equals
(
excelDto
.
getType
()))
{
data
=
initDutyCarInfo
(
beginDate
,
endDate
,
dayByMonth
);
}
else
if
(
ExcelEnums
.
RYZB
.
equals
(
excelDto
.
getType
()))
{
}
else
if
(
ExcelEnums
.
RYZB
.
getType
().
equals
(
excelDto
.
getType
()))
{
data
=
initDutyPersonInfo
(
beginDate
,
endDate
,
dayByMonth
);
}
...
...
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