Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
Y
yifu-mvp
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
fangxinjiang
yifu-mvp
Commits
2bf47058
Commit
2bf47058
authored
Nov 03, 2022
by
fangxinjiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
权限配置页面
parent
8d240faf
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
129 additions
and
22 deletions
+129
-22
TEmpContractAreaExportVo.java
...ud/plus/v1/yifu/archives/vo/TEmpContractAreaExportVo.java
+8
-8
TEmployeeInfoServiceImpl.java
.../yifu/archives/service/impl/TEmployeeInfoServiceImpl.java
+4
-2
TEmployeeContractAreaResMapper.xml
.../main/resources/mapper/TEmployeeContractAreaResMapper.xml
+3
-2
ExcelUtil.java
...m/yifu/cloud/plus/v1/yifu/common/core/util/ExcelUtil.java
+103
-0
TInsuranceAreaExportVo.java
...ud/plus/v1/yifu/insurances/vo/TInsuranceAreaExportVo.java
+8
-8
TInsuranceAreaResMapper.xml
...n/resources/mapper/insurances/TInsuranceAreaResMapper.xml
+3
-2
No files found.
yifu-archives/yifu-archives-api/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/vo/TEmpContractAreaExportVo.java
View file @
2bf47058
...
...
@@ -45,6 +45,14 @@ public class TEmpContractAreaExportVo implements Serializable {
@ExcelProperty
(
"审核人"
)
@Schema
(
description
=
"审核人"
)
private
String
userName
;
/**
* 申請人所在部门
*/
@HeadFontStyle
(
fontHeightInPoints
=
11
)
@ExcelAttribute
(
name
=
"审核人所在部门"
)
@ExcelProperty
(
"审核人所在部门"
)
@Schema
(
description
=
"审核人所在部门"
)
private
String
organName
;
/**
* 档案-省
*/
...
...
@@ -71,14 +79,6 @@ public class TEmpContractAreaExportVo implements Serializable {
@Schema
(
description
=
"档案-县"
)
private
String
fileTown
;
/**
* 申請人所在部门
*/
@HeadFontStyle
(
fontHeightInPoints
=
11
)
@ExcelAttribute
(
name
=
"审核人所在部门"
)
@ExcelProperty
(
"办审核人所在部门"
)
@Schema
(
description
=
"审核人所在部门"
)
private
String
organName
;
/**
...
...
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/service/impl/TEmployeeInfoServiceImpl.java
View file @
2bf47058
...
...
@@ -61,6 +61,7 @@ import javax.servlet.ServletOutputStream;
import
javax.servlet.http.HttpServletResponse
;
import
java.io.IOException
;
import
java.io.InputStream
;
import
java.lang.reflect.Field
;
import
java.net.URLEncoder
;
import
java.time.LocalDateTime
;
import
java.util.*
;
...
...
@@ -2009,6 +2010,7 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
ExcelWriter
excelWriter
=
EasyExcel
.
write
(
out
,
EmployeeExportVO
.
class
).
includeColumnFieldNames
(
searchVo
.
getExportFields
()).
build
();
int
index
=
0
;
if
(
count
>
CommonConstants
.
ZERO_INT
){
Field
[]
allFields
=
EmployeeExportVO
.
class
.
getDeclaredFields
();
for
(
int
i
=
0
;
i
<=
count
;
)
{
// 获取实际记录
searchVo
.
setLimitStart
(
i
);
...
...
@@ -2017,11 +2019,11 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
if
(
Common
.
isNotNull
(
list
)){
ExcelUtil
<
EmployeeExportVO
>
util
=
new
ExcelUtil
<>(
EmployeeExportVO
.
class
);
for
(
EmployeeExportVO
vo:
list
){
util
.
convertEntity
(
vo
,(
String
[])
searchVo
.
getExportFields
().
toArray
(),
null
,
null
);
util
.
convertEntity
Asso
(
vo
,
null
,
null
,
null
,
allFields
);
}
}
if
(
Common
.
isNotNull
(
list
)){
WriteSheet
writeSheet
=
EasyExcel
.
writerSheet
(
"
不良记录
"
+
index
).
build
();
WriteSheet
writeSheet
=
EasyExcel
.
writerSheet
(
"
人员档案批量导出
"
+
index
).
build
();
excelWriter
.
write
(
list
,
writeSheet
);
index
++;
}
...
...
yifu-archives/yifu-archives-biz/src/main/resources/mapper/TEmployeeContractAreaResMapper.xml
View file @
2bf47058
...
...
@@ -69,10 +69,10 @@
AND a.status like CONCAT(#{tEmployeeContractAreaRes.status},'%')
</if>
<if
test=
"tEmployeeContractAreaRes.userName != null"
>
AND a.USER_NAME like CONCAT(#{tEmployeeContractAreaRes.userName},'%')
AND a.USER_NAME like CONCAT(
'%',
#{tEmployeeContractAreaRes.userName},'%')
</if>
<if
test=
"tEmployeeContractAreaRes.organName != null"
>
AND a.ORGAN_NAME like CONCAT(#{tEmployeeContractAreaRes.organName},'%')
AND a.ORGAN_NAME like CONCAT(
'%',
#{tEmployeeContractAreaRes.organName},'%')
</if>
</if>
</sql>
...
...
@@ -84,6 +84,7 @@
<where>
1=1
<include
refid=
"tEmployeeContractAreaRes_where"
/>
order by a.CREATE_TIME desc
</where>
</select>
...
...
yifu-common/yifu-common-core/src/main/java/com/yifu/cloud/plus/v1/yifu/common/core/util/ExcelUtil.java
View file @
2bf47058
...
...
@@ -1001,4 +1001,107 @@ public class ExcelUtil <T> implements Serializable {
}
return
R
.
ok
(
exportfieldsName
,
"成功"
);
}
public
void
convertEntityAsso
(
T
vo
,
String
[]
exportFields
,
Map
<
String
,
String
>
diyDicMap
,
String
dateFormat
,
Field
[]
allFields
)
{
// 得到所有定义字段
if
(
Common
.
isEmpty
(
allFields
)
||
allFields
.
length
==
0
){
allFields
=
clazz
.
getDeclaredFields
();
}
List
<
Field
>
fields
=
new
ArrayList
<>();
Class
<?>
superClazz
=
clazz
.
getSuperclass
();
// 将需要字典表头存起来备用,如果没传,则全部翻译
List
<
String
>
allField
=
new
ArrayList
<>();
ExcelAttribute
annotation
;
for
(
Field
field
:
allFields
)
{
if
(
field
.
isAnnotationPresent
(
ExcelAttribute
.
class
))
{
fields
.
add
(
field
);
annotation
=
field
.
getAnnotation
(
ExcelAttribute
.
class
);
if
(
annotation
!=
null
&&
Common
.
isNotNull
(
annotation
.
name
()))
{
allField
.
add
(
annotation
.
name
());
}
}
}
if
(
Common
.
isEmpty
(
exportFields
)
&&
!
allField
.
isEmpty
())
{
exportFields
=
new
String
[
allField
.
size
()];
for
(
int
i
=
0
;
i
<
allField
.
size
();
i
++)
{
exportFields
[
i
]
=
allField
.
get
(
i
);
}
}
if
(
superClazz
!=
null
)
{
Field
[]
superFields
=
superClazz
.
getDeclaredFields
();
for
(
Field
field
:
superFields
)
{
if
(
field
.
isAnnotationPresent
(
ExcelAttribute
.
class
))
{
fields
.
add
(
field
);
}
}
}
fields
=
getFiledsByParamFiled
(
fields
,
exportFields
);
ExcelAttribute
attr
;
Field
field
;
//分割符
String
divider
;
for
(
int
j
=
0
;
j
<
fields
.
size
();
j
++)
{
// 获得field
field
=
fields
.
get
(
j
);
// 设置实体类私有属性可访问
field
.
setAccessible
(
true
);
attr
=
field
.
getAnnotation
(
ExcelAttribute
.
class
);
if
(
attr
.
isExport
())
{
// 如果数据存在就填入,不存在填入空格
Class
<?>
classType
=
field
.
getType
();
String
value
=
null
;
Date
date
;
try
{
if
(
field
.
get
(
vo
)
!=
null
&&
(
classType
.
isAssignableFrom
(
Date
.
class
)
||
classType
.
isAssignableFrom
(
LocalDateTime
.
class
)
||
classType
.
isAssignableFrom
(
LocalDate
.
class
)))
{
if
(
Common
.
isNotNull
(
attr
.
dateFormatExport
()))
{
date
=
DateUtil
.
stringToDate2
(
String
.
valueOf
(
field
.
get
(
vo
)),
attr
.
dateFormatExport
());
if
(
classType
.
isAssignableFrom
(
LocalDateTime
.
class
)){
value
=
LocalDateTimeUtils
.
formatTime
((
LocalDateTime
)
field
.
get
(
vo
),
attr
.
dateFormatExport
());
}
else
{
value
=
DateUtil
.
dateToString
(
date
,
attr
.
dateFormatExport
());
}
}
else
{
date
=
DateUtil
.
stringToDate2
(
String
.
valueOf
(
field
.
get
(
vo
)),
!
Common
.
isNotNull
(
dateFormat
)
?
DateUtil
.
ISO_EXPANDED_DATE_FORMAT
:
dateFormat
);
if
(
classType
.
isAssignableFrom
(
LocalDateTime
.
class
)){
value
=
LocalDateTimeUtils
.
formatTime
((
LocalDateTime
)
field
.
get
(
vo
),!
Common
.
isNotNull
(
dateFormat
)
?
DateUtil
.
ISO_EXPANDED_DATE_FORMAT
:
dateFormat
);
}
else
{
value
=
cn
.
hutool
.
core
.
date
.
DateUtil
.
format
(
date
,
!
Common
.
isNotNull
(
dateFormat
)
?
DateUtil
.
ISO_EXPANDED_DATE_FORMAT
:
dateFormat
);
}
}
}
//如果有默认字典数据直接取值
if
(
Common
.
isNotNull
(
attr
.
readConverterExp
()))
{
value
=
convertByExp
(
field
.
get
(
vo
)
==
null
?
""
:
String
.
valueOf
(
field
.
get
(
vo
)),
attr
.
readConverterExp
());
}
else
if
(
attr
.
isDataId
())
{
//加入分割符逻辑
divider
=
attr
.
divider
();
if
(!
""
.
equals
(
divider
)
&&
field
.
get
(
vo
)
!=
null
){
try
{
value
=
""
;
for
(
String
key
:
String
.
valueOf
(
field
.
get
(
vo
)).
split
(
divider
)){
value
+=
getLableById
(
attr
,
diyDicMap
,
key
)
+
divider
;
}
if
(
Common
.
isNotNull
(
value
)){
value
=
value
.
substring
(
0
,
value
.
length
()-
1
);
}
}
catch
(
Exception
e
){
log
.
error
(
"excel数据导出字符切割错误"
,
e
);
value
=
"字符切割错误"
;
}
}
else
{
//如果是字典数据ID或区域ID 去dicMap(包含了区域) 取值 取不到返回空
value
=
getLableById
(
attr
,
diyDicMap
,
field
.
get
(
vo
)
==
null
?
""
:
String
.
valueOf
(
field
.
get
(
vo
)));
}
}
else
if
(
attr
.
isArea
()){
//区域字段处理 TODO
value
=
getAreaLabel
((
String
)
field
.
get
(
vo
));
}
field
.
set
(
vo
,
Common
.
isNotNull
(
value
)?
value:
field
.
get
(
vo
));
}
catch
(
Exception
e
){
log
.
error
(
"字典数据解析异常"
);
}
}
}
}
}
yifu-insurances/yifu-insurances-api/src/main/java/com/yifu/cloud/plus/v1/yifu/insurances/vo/TInsuranceAreaExportVo.java
View file @
2bf47058
...
...
@@ -46,6 +46,14 @@ public class TInsuranceAreaExportVo implements Serializable {
@ExcelProperty
(
"办理人"
)
@Schema
(
description
=
"办理人"
)
private
String
userName
;
/**
* 申請人所在部门
*/
@HeadFontStyle
(
fontHeightInPoints
=
11
)
@ExcelAttribute
(
name
=
"办理人所在部门"
)
@ExcelProperty
(
"办理人所在部门"
)
@Schema
(
description
=
"办理人所在部门"
)
private
String
organName
;
/**
* 档案-省
*/
...
...
@@ -65,14 +73,6 @@ public class TInsuranceAreaExportVo implements Serializable {
private
String
city
;
/**
* 申請人所在部门
*/
@HeadFontStyle
(
fontHeightInPoints
=
11
)
@ExcelAttribute
(
name
=
"办理人所在部门"
)
@ExcelProperty
(
"办理人所在部门"
)
@Schema
(
description
=
"办理人所在部门"
)
private
String
organName
;
/**
...
...
yifu-insurances/yifu-insurances-biz/src/main/resources/mapper/insurances/TInsuranceAreaResMapper.xml
View file @
2bf47058
...
...
@@ -63,10 +63,10 @@
AND a.status like CONCAT(#{tInsuranceAreaRes.status},'%')
</if>
<if
test=
"tInsuranceAreaRes.userName != null"
>
AND a.USER_NAME
tInsuranceAreaRes.organName like CONCAT(
#{tInsuranceAreaRes.userName},'%')
AND a.USER_NAME
like CONCAT('%',
#{tInsuranceAreaRes.userName},'%')
</if>
<if
test=
"tInsuranceAreaRes.organName != null"
>
AND a.ORGAN_NAME like CONCAT(#{tInsuranceAreaRes.organName},'%')
AND a.ORGAN_NAME like CONCAT(
'%',
#{tInsuranceAreaRes.organName},'%')
</if>
</if>
</sql>
...
...
@@ -78,6 +78,7 @@
<where>
1=1
<include
refid=
"tInsuranceAreaRes_where"
/>
order by a.CREATE_TIME desc
</where>
</select>
<select
id=
"noPageDiy"
resultMap=
"insuranceAreaResExportMap"
>
...
...
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