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
512fab2b
Commit
512fab2b
authored
Apr 24, 2023
by
tangwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
人员导出,模板下载
parent
6dba9259
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
382 additions
and
7 deletions
+382
-7
ExcelEnums.java
...m/yeejoin/amos/boot/module/jxiop/api/Enum/ExcelEnums.java
+2
-2
EXPersonUser.java
.../yeejoin/amos/boot/module/jxiop/api/dto/EXPersonUser.java
+206
-0
PersonAccountDto.java
...join/amos/boot/module/jxiop/api/dto/PersonAccountDto.java
+5
-0
PersonBasicMapper.java
.../amos/boot/module/jxiop/api/mapper/PersonBasicMapper.java
+11
-0
PersonBasicMapper.xml
...jxiop-api/src/main/resources/mapper/PersonBasicMapper.xml
+107
-0
ExcelServiceImpl.java
.../boot/module/jxiop/biz/service/impl/ExcelServiceImpl.java
+51
-5
No files found.
amos-boot-system-jxiop/amos-boot-module-jxiop-api/src/main/java/com/yeejoin/amos/boot/module/jxiop/api/Enum/ExcelEnums.java
View file @
512fab2b
...
...
@@ -7,8 +7,8 @@ import lombok.Getter;
@Getter
@AllArgsConstructor
public
enum
ExcelEnums
{
CZXX
(
"场站信息"
,
"场站信息"
,
"com.yeejoin.amos.boot.module.jxiop.api.dto.ExStationBasicDto"
,
"CZXX"
)
;
//RYXX("人员信息", "人员信息", "com.yeejoin.amos.boot.module.jcs.api.dto.OrgUsrSafeReportExcelDto
","RYXX");
CZXX
(
"场站信息"
,
"场站信息"
,
"com.yeejoin.amos.boot.module.jxiop.api.dto.ExStationBasicDto"
,
"CZXX"
)
,
RYXX
(
"人员信息"
,
"人员信息"
,
"com.yeejoin.amos.boot.module.jcs.api.dto.EXPersonUser
"
,
"RYXX"
);
private
String
fileName
;
private
String
sheetName
;
private
String
classUrl
;
...
...
amos-boot-system-jxiop/amos-boot-module-jxiop-api/src/main/java/com/yeejoin/amos/boot/module/jxiop/api/dto/EXPersonUser.java
0 → 100644
View file @
512fab2b
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jxiop
.
api
.
dto
;
import
com.yeejoin.amos.boot.biz.common.excel.ExplicitConstraint
;
import
com.alibaba.excel.annotation.ExcelProperty
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.util.Date
;
/**
* @description:
* @author: tw
* @createDate: 2023/4/24
*/
@Data
@ApiModel
(
value
=
"EXPersonUser"
,
description
=
""
)
public
class
EXPersonUser
{
@ExcelProperty
(
value
=
"姓名"
,
index
=
1
)
@ApiModelProperty
(
value
=
"姓名"
)
private
String
name
;
@ExcelProperty
(
value
=
"工号"
,
index
=
2
)
@ApiModelProperty
(
value
=
"工号"
)
private
String
jobNumber
;
@ExcelProperty
(
value
=
"所属场站"
,
index
=
3
)
@ApiModelProperty
(
value
=
"所属场站"
)
private
String
projectName
;
@ExcelProperty
(
value
=
"部门"
,
index
=
4
)
@ApiModelProperty
(
value
=
"部门"
)
private
String
departmentName
;
@ExcelProperty
(
value
=
"证件类型"
,
index
=
5
)
@ApiModelProperty
(
value
=
"证件类型(0-身份证)"
)
private
String
idType
;
@ExcelProperty
(
value
=
"证件编号"
,
index
=
6
)
@ApiModelProperty
(
value
=
"证件编号"
)
private
String
idNumber
;
@ExcelProperty
(
value
=
"平台账号名称"
,
index
=
7
)
@ApiModelProperty
(
value
=
"平台账号名称"
)
private
String
accountName
;
@ExplicitConstraint
(
indexNum
=
8
,
source
=
{
"男"
,
"女"
})
//固定下拉内容
@ExcelProperty
(
value
=
"性别"
,
index
=
8
)
@ApiModelProperty
(
value
=
"性别( 0-男 1-女 )"
)
private
String
sex
;
@ExcelProperty
(
value
=
"生日"
,
index
=
9
)
@ApiModelProperty
(
value
=
"生日"
)
private
Date
birthday
;
@ExcelProperty
(
value
=
"年龄"
,
index
=
10
)
@ApiModelProperty
(
value
=
"年龄"
)
private
Integer
age
;
@ExcelProperty
(
value
=
"籍贯"
,
index
=
11
)
@ApiModelProperty
(
value
=
"籍贯"
)
private
String
nativePlace
;
@ExcelProperty
(
value
=
"民族"
,
index
=
12
)
@ExplicitConstraint
(
indexNum
=
12
,
type
=
"MZ"
)
//固定下拉内容
@ApiModelProperty
(
value
=
"民族"
)
private
String
folkKey
;
@ExcelProperty
(
value
=
"政治面貌"
,
index
=
13
)
@ExplicitConstraint
(
indexNum
=
13
,
source
=
{
"群众"
,
"共青团员"
,
"预备党员"
,
"中共党员"
})
//固定下拉内容
@ApiModelProperty
(
value
=
"政治面貌"
)
private
String
politicCountenance
;
@ExcelProperty
(
value
=
"户籍地址"
,
index
=
14
)
@ApiModelProperty
(
value
=
"户籍地址"
)
private
String
registeredResidenceAddress
;
@ExcelProperty
(
value
=
"现住址"
,
index
=
15
)
@ApiModelProperty
(
value
=
"现住址"
)
private
String
presentAddress
;
@ExcelProperty
(
value
=
"应急电话"
,
index
=
16
)
@ApiModelProperty
(
value
=
"应急电话"
)
private
String
emergencyPhone
;
@ExcelProperty
(
value
=
"电话"
,
index
=
17
)
@ApiModelProperty
(
value
=
"电话"
)
private
String
phone
;
@ExcelProperty
(
value
=
"身高(厘米)"
,
index
=
18
)
@ApiModelProperty
(
value
=
"身高(厘米)"
)
private
Integer
height
;
@ExcelProperty
(
value
=
"体重(千克)"
,
index
=
19
)
@ApiModelProperty
(
value
=
"体重(千克)"
)
private
Integer
weight
;
@ExcelProperty
(
value
=
"参加工作时间"
,
index
=
20
)
@ApiModelProperty
(
value
=
"参加工作时间"
)
private
Date
workTime
;
@ExcelProperty
(
value
=
"进入本单位工作时间"
,
index
=
21
)
@ApiModelProperty
(
value
=
"进入本单位工作时间"
)
private
Date
stationWorkTime
;
@ExcelProperty
(
value
=
"工作所在地"
,
index
=
22
)
@ExplicitConstraint
(
indexNum
=
22
,
source
=
{
"国内"
,
"国外"
})
//固定下拉内容
@ApiModelProperty
(
value
=
"工作所在地key"
)
private
String
workPlaceKey
;
@ExcelProperty
(
value
=
"岗位"
,
index
=
23
)
@ExplicitConstraint
(
indexNum
=
23
,
type
=
"YGZYJNJDZS"
)
//固定下拉内容
@ApiModelProperty
(
value
=
"岗位"
)
private
String
postName
;
@ExcelProperty
(
value
=
"是否特殊工种"
,
index
=
24
)
@ExplicitConstraint
(
indexNum
=
24
,
source
=
{
"是"
,
"否"
})
//固定下拉内容
@ApiModelProperty
(
value
=
"是否特殊工种"
)
private
Integer
isSpecialWork
;
@ExcelProperty
(
value
=
"技能鉴定工种"
,
index
=
25
)
@ExplicitConstraint
(
indexNum
=
25
,
type
=
"JNDDGZ"
)
//固定下拉内容
@ApiModelProperty
(
value
=
"技能鉴定工种key"
)
private
String
workTypeKey
;
@ExcelProperty
(
value
=
"工种名称"
,
index
=
26
)
@ExplicitConstraint
(
indexNum
=
26
,
type
=
"JNJDGZ"
)
//固定下拉内容
@ApiModelProperty
(
value
=
"工种名称"
)
private
String
workName
;
@ExcelProperty
(
value
=
"专业技术资格名称"
,
index
=
27
)
@ExplicitConstraint
(
indexNum
=
27
,
type
=
"ZYJSZGMC"
)
//固定下拉内容
@ApiModelProperty
(
value
=
"专业技术资格名称"
)
private
String
professionalTechnologyName
;
@ExcelProperty
(
value
=
"技能等级"
,
index
=
28
)
@ExplicitConstraint
(
indexNum
=
28
,
source
=
{
"无"
,
"初级工"
,
"中级工"
,
"高级工"
,
"技师"
,
"高级技师"
,
"其他"
})
//固定下拉内容
@ApiModelProperty
(
value
=
"技能等级key"
)
private
String
skillLevelKey
;
@ExcelProperty
(
value
=
"专业技术资格等级"
,
index
=
29
)
@ExplicitConstraint
(
indexNum
=
29
,
source
=
{
"初级"
,
"中级"
,
"副高级"
,
"正高级"
,
"教授级"
})
//固定下拉内容
@ApiModelProperty
(
value
=
"专业技术资格等级"
)
private
String
professionalTechnologyLevelKey
;
@ExcelProperty
(
value
=
"岗位执业鉴定证书"
,
index
=
30
)
@ApiModelProperty
(
value
=
"岗位执业鉴定证书"
)
@ExplicitConstraint
(
indexNum
=
30
,
type
=
"POST_PRACTICE_CERTIFICATE"
)
//固定下拉内容
private
String
professionalQualificationCertificate
;
@ExcelProperty
(
value
=
"岗位职业鉴定证书"
,
index
=
31
)
@ApiModelProperty
(
value
=
" 岗位职业鉴定证书"
)
@ExplicitConstraint
(
indexNum
=
31
,
type
=
"POST_OCCUPATION_CERTIFICATE"
)
//固定下拉内容
private
String
professionalCareerCertificate
;
@ExcelProperty
(
value
=
"初始学历"
,
index
=
32
)
@ApiModelProperty
(
value
=
"初始学历key"
)
@ExplicitConstraint
(
indexNum
=
32
,
type
=
"CSXL"
)
//固定下拉内容
private
String
initialEducationKey
;
@ExcelProperty
(
value
=
"现学历"
,
index
=
33
)
@ExplicitConstraint
(
indexNum
=
33
,
type
=
"XXL"
)
//固定下拉内容
@ApiModelProperty
(
value
=
"现学历key"
)
private
String
currentEducationKey
;
@ExcelProperty
(
value
=
"现学历学校名称"
,
index
=
34
)
@ApiModelProperty
(
value
=
"现学历学校名称"
)
private
String
currentSchool
;
@ExcelProperty
(
value
=
"现学历所学专业"
,
index
=
35
)
@ApiModelProperty
(
value
=
"现学历所学专业"
)
private
String
currentMajor
;
@ExcelProperty
(
value
=
"证件类型"
,
index
=
36
)
@ApiModelProperty
(
value
=
"证件类型"
)
@ExplicitConstraint
(
indexNum
=
36
,
type
=
"ZDLX"
)
//固定下拉内容
private
String
documentType
;
@ExcelProperty
(
value
=
"证书名称"
,
index
=
37
)
@ApiModelProperty
(
value
=
"证书名称"
)
@ExplicitConstraint
(
indexNum
=
37
,
type
=
"ZYJSZGMC"
)
//固定下拉内容
private
String
certificateName
;
@ExcelProperty
(
value
=
"取证时间"
,
index
=
38
)
@ApiModelProperty
(
value
=
"取证时间"
)
private
Date
certificateTime
;
@ExcelProperty
(
value
=
"发证机关"
,
index
=
39
)
@ApiModelProperty
(
value
=
"发证机关"
)
private
String
issuingAuthority
;
@ExcelProperty
(
value
=
"证书编号"
,
index
=
40
)
@ApiModelProperty
(
value
=
"证书编号"
)
private
String
certificateNum
;
@ExcelProperty
(
value
=
"取证项目"
,
index
=
41
)
@ApiModelProperty
(
value
=
"取证项目"
)
private
String
certificateProject
;
@ExcelProperty
(
value
=
"有效期限"
,
index
=
42
)
@ApiModelProperty
(
value
=
"有效期限"
)
private
String
validPeriod
;
@ExcelProperty
(
value
=
"证书等级"
,
index
=
43
)
@ApiModelProperty
(
value
=
"证书等级"
)
@ExplicitConstraint
(
indexNum
=
43
,
type
=
"ZYJSZGMC"
)
//固定下拉内容
private
String
certificateGrade
;
}
amos-boot-system-jxiop/amos-boot-module-jxiop-api/src/main/java/com/yeejoin/amos/boot/module/jxiop/api/dto/PersonAccountDto.java
View file @
512fab2b
...
...
@@ -62,6 +62,11 @@ public class PersonAccountDto extends BaseDto {
@ApiModelProperty
(
value
=
"工号"
)
private
String
jobNumber
;
private
String
departmentName
;
private
String
projectName
;
@ApiModelProperty
(
value
=
"证件类型(0-身份证)"
)
private
String
idType
;
...
...
amos-boot-system-jxiop/amos-boot-module-jxiop-api/src/main/java/com/yeejoin/amos/boot/module/jxiop/api/mapper/PersonBasicMapper.java
View file @
512fab2b
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jxiop
.
api
.
mapper
;
import
com.yeejoin.amos.boot.module.jxiop.api.dto.EXPersonUser
;
import
com.yeejoin.amos.boot.module.jxiop.api.dto.StationBasicDto
;
import
com.yeejoin.amos.boot.module.jxiop.api.dto.UserMapperDto
;
import
com.yeejoin.amos.boot.module.jxiop.api.entity.PersonBasic
;
...
...
@@ -28,5 +29,15 @@ public interface PersonBasicMapper extends BaseMapper<PersonBasic> {
int
deleteList
(
String
[]
ids
);
List
<
EXPersonUser
>
getEXPersonUser
(
String
name
,
String
accountName
,
String
projectName
,
String
orgCode
);
List
<
EXPersonUser
>
getEXPersonUserAll
(
String
name
,
String
accountName
,
String
projectName
,
String
orgCode
);
}
amos-boot-system-jxiop/amos-boot-module-jxiop-api/src/main/resources/mapper/PersonBasicMapper.xml
View file @
512fab2b
...
...
@@ -74,4 +74,111 @@
</foreach>
</delete>
<select
id=
"getEXPersonUser"
resultType=
"com.yeejoin.amos.boot.module.jxiop.api.dto.EXPersonUser"
>
select
person_account.`name` name,
person_account.job_number jobNumber,
person_account.project_name projectName,
person_account.department_name departmentName,
person_account.ID_type idType,
person_account.ID_number idNumber,
person_account.account_name accountName
from person_basic
LEFT JOIN person_account
on person_account.person_id=person_basic.sequence_nbr
<where>
person_basic.is_delete=0
<if
test=
"name != null and name != ''"
>
AND person_basic.name like concat('%',#{name},'%')
</if>
<if
test=
"accountName != null and accountName != ''"
>
AND person_account.account_name like concat('%',#{accountName},'%')
</if>
<if
test=
"projectName != null and projectName != ''"
>
AND person_account.project_name like concat('%',#{projectName},'%')
</if>
<if
test=
"orgCode != null and orgCode != ''"
>
AND person_basic.org_code like concat('%',#{orgCode},'%')
</if>
</where>
ORDER BY person_basic.rec_date DESC
</select>
<select
id=
"getEXPersonUserAll"
resultType=
"com.yeejoin.amos.boot.module.jxiop.api.dto.EXPersonUser"
>
select
person_account.`name` name,
person_account.job_number jobNumber,
person_account.project_name projectName,
person_account.department_name departmentName,
person_account.ID_type idType,
person_account.ID_number idNumber,
person_account.account_name accountName
person_basic.sex sex,
person_basic.birthday birthday,
person_basic.age age,
person_basic.native_place nativePlace,
person_basic.folk_key folkKey,
person_basic.politic_countenance politicCountenance,
person_basic.registered_residence_address registeredResidenceAddress,
person_basic.present_address presentAddress,
person_basic.emergency_phone emergencyPhone,
person_basic.phone,
person_basic.height,
person_basic.weight,
person_basic.work_time workTime,
person_basic.station_work_time stationWorkTime,
person_basic.work_place_key workPlaceKey,
person_basic.post_name postName,
person_skill_education.is_special_work isSpecialWork,
person_skill_education.work_type_key workTypeKey,
person_skill_education.work_name workName,
person_skill_education.professional_technology_name professionalTechnologyName,
person_skill_education.skill_level_key skillLevelKey,
person_skill_education.professional_technology_key professionalTechnologyLevelKey,
person_skill_education.professional_qualification_certificate professionalQualificationCertificate,
person_skill_education.professional_career_certificate professionalCareerCertificate,
person_skill_education.initial_education_key initialEducationKey,
person_skill_education.current_education_key currentEducationKey,
person_skill_education.current_school currentSchool,
person_skill_education.current_major currentMajor,
person_certificate.document_type documentType,
person_certificate.certificate_name certificateName,
person_certificate.certificate_time certificateTime,
person_certificate.issuing_authority issuingAuthority,
person_certificate.certificate_num certificateNum,
person_certificate.certificate_project certificateProject,
person_certificate.valid_period validPeriod,
person_certificate.certificate_grade certificateGrade
from person_basic
LEFT JOIN person_account
on person_account.person_id=person_basic.sequence_nbr
LEFT JOIN person_certificate
on person_certificate.person_id=person_basic.sequence_nbr
LEFT JOIN person_skill_education
on person_skill_education.person_id=person_basic.sequence_nbr
<where>
person_basic.is_delete=0
<if
test=
"name != null and name != ''"
>
AND person_basic.name like concat('%',#{name},'%')
</if>
<if
test=
"accountName != null and accountName != ''"
>
AND person_account.account_name like concat('%',#{accountName},'%')
</if>
<if
test=
"projectName != null and projectName != ''"
>
AND person_account.project_name like concat('%',#{projectName},'%')
</if>
<if
test=
"orgCode != null and orgCode != ''"
>
AND person_basic.org_code like concat('%',#{orgCode},'%')
</if>
</where>
ORDER BY person_basic.rec_date DESC
</select>
</mapper>
amos-boot-system-jxiop/amos-boot-module-jxiop-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/service/impl/ExcelServiceImpl.java
View file @
512fab2b
...
...
@@ -2,9 +2,10 @@ package com.yeejoin.amos.boot.module.jxiop.biz.service.impl;
import
com.yeejoin.amos.boot.biz.common.excel.ExcelUtil
;
import
com.yeejoin.amos.boot.module.common.api.dto.*
;
import
com.yeejoin.amos.boot.module.
common.api.entity.FireChemical
;
import
com.yeejoin.amos.boot.module.
jxiop.api.dto.EXPersonUser
;
import
com.yeejoin.amos.boot.module.jxiop.api.dto.ExStationBasicDto
;
import
com.yeejoin.amos.boot.module.jxiop.api.entity.StationBasic
;
import
com.yeejoin.amos.boot.module.jxiop.api.mapper.PersonBasicMapper
;
import
com.yeejoin.amos.boot.module.jxiop.api.mapper.StationBasicMapper
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
...
...
@@ -21,17 +22,31 @@ import java.util.*;
public
class
ExcelServiceImpl
{
@Autowired
PersonBasicMapper
personBasicMapper
;
@Autowired
ExDataSourcesImpl
dataSourcesImpl
;
@Autowired
StationBasicMapper
stationBasicMapper
;
@Autowired
StationBasicServiceImpl
stationBasicServiceImpl
;
public
void
templateExport
(
HttpServletResponse
response
,
ExcelDto
excelDto
)
throws
ClassNotFoundException
{
public
void
templateExport
(
HttpServletResponse
response
,
ExcelDto
excelDto
,
Map
par
)
throws
ClassNotFoundException
{
String
url
=
excelDto
.
getClassUrl
();
Class
<?>
clz
=
Class
.
forName
(
url
);
ExcelUtil
.
createTemplate
(
response
,
excelDto
.
getFileName
(),
excelDto
.
getSheetName
(),
null
,
clz
,
dataSourcesImpl
,
true
);
switch
(
excelDto
.
getType
())
{
case
"RYXX"
:
List
<
EXPersonUser
>
data
=
this
.
getEXPersonUser
(
par
);
ExcelUtil
.
createTemplate
(
response
,
excelDto
.
getFileName
(),
excelDto
.
getSheetName
(),
data
,
clz
,
dataSourcesImpl
,
true
);
break
;
default
:
ExcelUtil
.
createTemplate
(
response
,
excelDto
.
getFileName
(),
excelDto
.
getSheetName
(),
null
,
clz
,
dataSourcesImpl
,
true
);
break
;
}
}
public
void
commonExport
(
HttpServletResponse
response
,
ExcelDto
excelDto
,
Map
par
)
{
...
...
@@ -41,7 +56,13 @@ public class ExcelServiceImpl {
case
"CZXX"
:
List
<
ExStationBasicDto
>
data
=
this
.
getExStationBasicDto
(
par
);
ExcelUtil
.
createTemplate
(
response
,
excelDto
.
getFileName
(),
excelDto
.
getSheetName
(),
data
,
WaterResourceDto
.
class
,
dataSourcesImpl
,
false
);
ExStationBasicDto
.
class
,
dataSourcesImpl
,
false
);
break
;
case
"RYXX"
:
List
<
EXPersonUser
>
datad
=
this
.
getEXPersonUserAll
(
par
);
ExcelUtil
.
createTemplate
(
response
,
excelDto
.
getFileName
(),
excelDto
.
getSheetName
(),
datad
,
EXPersonUser
.
class
,
dataSourcesImpl
,
false
);
break
;
default
:
break
;
}
...
...
@@ -85,5 +106,30 @@ public class ExcelServiceImpl {
stationBasicServiceImpl
.
saveBatch
(
excelEntityList
);
}
//获取人员数据
public
List
<
EXPersonUser
>
getEXPersonUser
(
Map
map
){
List
<
EXPersonUser
>
listdata
=
personBasicMapper
.
getEXPersonUser
(
map
.
get
(
"name"
).
toString
(),
map
.
get
(
"accountName"
).
toString
(),
map
.
get
(
"projectName"
).
toString
(),
map
.
get
(
"orgCode"
).
toString
());
return
listdata
;
}
//人员导出
public
List
<
EXPersonUser
>
getEXPersonUserAll
(
Map
map
){
List
<
EXPersonUser
>
listdata
=
personBasicMapper
.
getEXPersonUserAll
(
map
.
get
(
"name"
).
toString
(),
map
.
get
(
"accountName"
).
toString
(),
map
.
get
(
"projectName"
).
toString
(),
map
.
get
(
"orgCode"
).
toString
());
return
listdata
;
}
}
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