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
1ad2009a
Commit
1ad2009a
authored
Jul 14, 2022
by
hongguangwu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
空导出
parent
b25f5057
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
57 additions
and
14 deletions
+57
-14
EmployeeConstants.java
...ud/plus/v1/yifu/archives/constants/EmployeeConstants.java
+4
-0
TEmployeeContractInfoServiceImpl.java
...chives/service/impl/TEmployeeContractInfoServiceImpl.java
+26
-8
TEmployeeInfoServiceImpl.java
.../yifu/archives/service/impl/TEmployeeInfoServiceImpl.java
+27
-6
No files found.
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/constants/EmployeeConstants.java
View file @
1ad2009a
...
...
@@ -37,6 +37,10 @@ public class EmployeeConstants {
* 无数据可更新
**/
public
static
final
String
NO_DATA_UPDATE
=
"无数据可更新"
;
public
static
final
String
NO_DATA
=
"无数据"
;
public
static
final
String
FILE_EXPORT_EXCEPTION
=
"档案导出异常"
;
public
static
final
String
CONCART_EXPORT_EXCEPTION
=
"合同导出异常"
;
public
static
final
String
CONCART_ALL_EXPORT_EXCEPTION
=
"合同[合并]导出异常"
;
/**
* 数据更新是失败
...
...
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/service/impl/TEmployeeContractInfoServiceImpl.java
View file @
1ad2009a
...
...
@@ -26,14 +26,12 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.yifu.cloud.plus.v1.yifu.archives.constants.EmployeeConstants
;
import
com.yifu.cloud.plus.v1.yifu.archives.constants.EmployeeContractConstants
;
import
com.yifu.cloud.plus.v1.yifu.archives.entity.*
;
import
com.yifu.cloud.plus.v1.yifu.archives.mapper.TEmployeeContractInfoMapper
;
import
com.yifu.cloud.plus.v1.yifu.archives.service.*
;
import
com.yifu.cloud.plus.v1.yifu.archives.vo.EmployeeContractExportVO
;
import
com.yifu.cloud.plus.v1.yifu.archives.vo.EmployeeContractUpdateVO
;
import
com.yifu.cloud.plus.v1.yifu.archives.vo.EmployeeContractVO
;
import
com.yifu.cloud.plus.v1.yifu.archives.vo.ErrorVO
;
import
com.yifu.cloud.plus.v1.yifu.archives.vo.*
;
import
com.yifu.cloud.plus.v1.yifu.common.core.constant.CacheConstants
;
import
com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants
;
import
com.yifu.cloud.plus.v1.yifu.common.core.constant.ResultConstants
;
...
...
@@ -736,8 +734,8 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
String
fileName
=
"员工合同批量导出"
+
DateUtil
.
getThisTime
()
+
".xlsx"
;
//获取要导出的列表
List
<
EmployeeContractExportVO
>
list
=
baseMapper
.
getTEmployeeContractExportHistory
(
contractInfo
);
if
(
list
!=
null
&&
!
list
.
isEmpty
())
{
ServletOutputStream
out
=
null
;
if
(
list
!=
null
&&
!
list
.
isEmpty
())
{
try
{
ExcelUtil
<
EmployeeContractExportVO
>
util
=
new
ExcelUtil
<>(
EmployeeContractExportVO
.
class
);
for
(
EmployeeContractExportVO
vo
:
list
)
{
...
...
@@ -762,6 +760,16 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
log
.
error
(
"员工合同导出异常:"
,
e
);
}
}
}
else
{
EasyExcel
.
write
(
out
,
EmployeeExportVO
.
class
).
includeColumnFiledNames
(
contractInfo
.
getExportFields
())
.
sheet
(
EmployeeConstants
.
NO_DATA
).
doWrite
(
list
);
try
{
if
(
out
!=
null
)
{
out
.
close
();
}
}
catch
(
IOException
e
)
{
log
.
error
(
EmployeeConstants
.
CONCART_EXPORT_EXCEPTION
,
e
);
}
}
}
}
...
...
@@ -775,8 +783,8 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
String
fileName
=
"员工合同批量导出[合并]"
+
DateUtil
.
getThisTime
()
+
".xlsx"
;
//获取要导出的列表
List
<
EmployeeContractExportVO
>
list
=
baseMapper
.
getTEmployeeContractExportHistory
(
contractInfo
);
if
(
list
!=
null
&&
!
list
.
isEmpty
())
{
ServletOutputStream
out
=
null
;
if
(
list
!=
null
&&
!
list
.
isEmpty
())
{
try
{
ExcelUtil
<
EmployeeContractExportVO
>
util
=
new
ExcelUtil
<>(
EmployeeContractExportVO
.
class
);
for
(
EmployeeContractExportVO
vo
:
list
)
{
...
...
@@ -791,15 +799,25 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
.
sheet
(
"员工合同[合并]"
).
doWrite
(
list
);
out
.
flush
();
}
catch
(
Exception
e
)
{
log
.
error
(
"员工合同[合并]导出异常:"
,
e
);
log
.
error
(
EmployeeConstants
.
CONCART_ALL_EXPORT_EXCEPTION
,
e
);
}
finally
{
try
{
if
(
out
!=
null
)
{
out
.
close
();
}
}
catch
(
IOException
e
)
{
log
.
error
(
"员工合同[合并]导出异常:"
,
e
);
log
.
error
(
EmployeeConstants
.
CONCART_ALL_EXPORT_EXCEPTION
,
e
);
}
}
}
else
{
EasyExcel
.
write
(
out
,
EmployeeExportVO
.
class
).
includeColumnFiledNames
(
contractInfo
.
getExportFields
())
.
sheet
(
EmployeeConstants
.
NO_DATA
).
doWrite
(
list
);
try
{
if
(
out
!=
null
)
{
out
.
close
();
}
}
catch
(
IOException
e
)
{
log
.
error
(
EmployeeConstants
.
CONCART_ALL_EXPORT_EXCEPTION
,
e
);
}
}
}
...
...
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/service/impl/TEmployeeInfoServiceImpl.java
View file @
1ad2009a
...
...
@@ -50,6 +50,7 @@ import com.yifu.cloud.plus.v1.yifu.common.dapr.util.HttpDaprUtil;
import
com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils
;
import
lombok.RequiredArgsConstructor
;
import
lombok.extern.log4j.Log4j2
;
import
org.bouncycastle.jcajce.provider.asymmetric.ec.KeyFactorySpi
;
import
org.springframework.boot.context.properties.EnableConfigurationProperties
;
import
org.springframework.cache.Cache
;
import
org.springframework.cache.CacheManager
;
...
...
@@ -1968,8 +1969,8 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
//获取要导出的列表
employeeInfo
.
setFileStatus
(
CommonConstants
.
ZERO_INT
);
List
<
EmployeeExportVO
>
list
=
baseMapper
.
getTEmployeeExportList
(
employeeInfo
);
if
(
list
!=
null
&&
!
list
.
isEmpty
())
{
ServletOutputStream
out
=
null
;
if
(
list
!=
null
&&
!
list
.
isEmpty
())
{
try
{
ExcelUtil
<
EmployeeExportVO
>
util
=
new
ExcelUtil
<>(
EmployeeExportVO
.
class
);
for
(
EmployeeExportVO
vo
:
list
)
{
...
...
@@ -1984,15 +1985,25 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
.
sheet
(
"人员档案"
).
doWrite
(
list
);
out
.
flush
();
}
catch
(
Exception
e
)
{
log
.
error
(
"人员档案导出异常:"
,
e
);
log
.
error
(
EmployeeConstants
.
FILE_EXPORT_EXCEPTION
,
e
);
}
finally
{
try
{
if
(
out
!=
null
)
{
out
.
close
();
}
}
catch
(
IOException
e
)
{
log
.
error
(
"档案导出异常:"
,
e
);
log
.
error
(
EmployeeConstants
.
FILE_EXPORT_EXCEPTION
,
e
);
}
}
}
else
{
EasyExcel
.
write
(
out
,
EmployeeExportVO
.
class
).
includeColumnFiledNames
(
employeeInfo
.
getExportFields
())
.
sheet
(
EmployeeConstants
.
NO_DATA
).
doWrite
(
list
);
try
{
if
(
out
!=
null
)
{
out
.
close
();
}
}
catch
(
IOException
e
)
{
log
.
error
(
EmployeeConstants
.
FILE_EXPORT_EXCEPTION
,
e
);
}
}
}
...
...
@@ -2008,8 +2019,8 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
//获取要导出的列表
employeeInfo
.
setFileStatus
(
CommonConstants
.
ONE_INT
);
List
<
EmployeeExportVO
>
list
=
baseMapper
.
getTEmployeeLeaveExportList
(
employeeInfo
);
if
(
list
!=
null
&&
!
list
.
isEmpty
())
{
ServletOutputStream
out
=
null
;
if
(
list
!=
null
&&
!
list
.
isEmpty
())
{
try
{
ExcelUtil
<
EmployeeExportVO
>
util
=
new
ExcelUtil
<>(
EmployeeExportVO
.
class
);
for
(
EmployeeExportVO
vo
:
list
)
{
...
...
@@ -2024,15 +2035,25 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
.
sheet
(
"离职档案"
).
doWrite
(
list
);
out
.
flush
();
}
catch
(
Exception
e
)
{
log
.
error
(
"离职档案导出异常:"
,
e
);
log
.
error
(
EmployeeConstants
.
FILE_EXPORT_EXCEPTION
,
e
);
}
finally
{
try
{
if
(
out
!=
null
)
{
out
.
close
();
}
}
catch
(
IOException
e
)
{
log
.
error
(
"档案导出异常:"
,
e
);
log
.
error
(
EmployeeConstants
.
FILE_EXPORT_EXCEPTION
,
e
);
}
}
}
else
{
EasyExcel
.
write
(
out
,
EmployeeExportVO
.
class
).
includeColumnFiledNames
(
employeeInfo
.
getExportFields
())
.
sheet
(
EmployeeConstants
.
NO_DATA
).
doWrite
(
list
);
try
{
if
(
out
!=
null
)
{
out
.
close
();
}
}
catch
(
IOException
e
)
{
log
.
error
(
EmployeeConstants
.
FILE_EXPORT_EXCEPTION
,
e
);
}
}
}
...
...
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