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
7c05ea48
Commit
7c05ea48
authored
Jan 10, 2023
by
fangxinjiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
派单查询导出优化
parent
eb22fd4c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
170 additions
and
66 deletions
+170
-66
TDispatchInfoServiceImpl.java
...v1/yifu/social/service/impl/TDispatchInfoServiceImpl.java
+10
-14
TDispatchInfoMapper.xml
...ial-biz/src/main/resources/mapper/TDispatchInfoMapper.xml
+160
-52
No files found.
yifu-social/yifu-social-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/social/service/impl/TDispatchInfoServiceImpl.java
View file @
7c05ea48
...
...
@@ -165,28 +165,24 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
response
.
setCharacterEncoding
(
"utf-8"
);
response
.
setHeader
(
CommonConstants
.
CONTENT_DISPOSITION
,
CommonConstants
.
ATTACHMENT_FILENAME
+
URLEncoder
.
encode
(
fileName
,
"UTF-8"
));
// 这里 需要指定写用哪个class去写,然后写到第一个sheet,然后文件流会自动关闭
ExcelWriter
excelWriter
=
EasyExcel
.
write
(
out
,
TDispatchInfoExportVo
.
class
).
includeColumnFiledNames
(
searchVo
.
getExportFields
()).
build
();
ExcelUtil
<
TDispatchInfoExportVo
>
util
=
new
ExcelUtil
<>(
TDispatchInfoExportVo
.
class
);
// 获取所有字典type
Map
<
String
,
String
>
nameAndDicTypeMap
=
util
.
getConverterDicType
();
// 获取所有字典对应的值
Map
<
String
,
String
>
redisLabelMap
=
(
Map
<
String
,
String
>)
RedisUtil
.
redis
.
opsForValue
().
get
(
CacheConstants
.
REDIS_DICT_LABLE
);
redisLabelMap
.
putAll
(
userMap
);
// 这里 需要指定写用哪个class去写,然后写到第一个sheet,然后文件流会自动关闭
ExcelWriter
excelWriter
=
EasyExcel
.
write
(
out
,
TDispatchInfoExportVo
.
class
)
.
registerConverter
(
new
DictConverter
(
nameAndDicTypeMap
,
redisLabelMap
))
.
includeColumnFieldNames
(
searchVo
.
getExportFields
()).
build
();
int
index
=
0
;
if
(
count
>
CommonConstants
.
ZERO_INT
)
{
WriteSheet
writeSheet
;
ExcelUtil
<
TDispatchInfoExportVo
>
util
;
for
(
int
i
=
0
;
i
<=
count
;
)
{
// 获取实际记录
searchVo
.
setLimitStart
(
i
);
searchVo
.
setLimitEnd
(
CommonConstants
.
EXCEL_EXPORT_LIMIT
);
list
=
exportDispatch
(
searchVo
);
if
(
Common
.
isNotNull
(
list
))
{
util
=
new
ExcelUtil
<>(
TDispatchInfoExportVo
.
class
);
for
(
TDispatchInfoExportVo
vo
:
list
)
{
if
(!
userMap
.
isEmpty
())
{
vo
.
setFundHandleUser
(
null
!=
userMap
.
get
(
vo
.
getFundHandleUser
())
?
userMap
.
get
(
vo
.
getFundHandleUser
())
:
""
);
vo
.
setAuditUserName
(
null
!=
userMap
.
get
(
vo
.
getAuditUserName
())
?
userMap
.
get
(
vo
.
getAuditUserName
())
:
""
);
vo
.
setFundAuditUser
(
null
!=
userMap
.
get
(
vo
.
getFundAuditUser
())
?
userMap
.
get
(
vo
.
getFundAuditUser
())
:
""
);
vo
.
setHandleUser
(
null
!=
userMap
.
get
(
vo
.
getHandleUser
())
?
userMap
.
get
(
vo
.
getHandleUser
())
:
""
);
}
util
.
convertEntity
(
vo
,
null
,
null
,
null
);
}
}
if
(
Common
.
isNotNull
(
list
))
{
writeSheet
=
EasyExcel
.
writerSheet
(
"派单"
+
index
).
build
();
excelWriter
.
write
(
list
,
writeSheet
);
...
...
yifu-social/yifu-social-biz/src/main/resources/mapper/TDispatchInfoMapper.xml
View file @
7c05ea48
...
...
@@ -595,58 +595,166 @@
<!-- 派单导出 -->
<select
id=
"exportDispatch"
resultMap=
"exportMap"
>
select
a.EMP_NAME,
a.EMP_IDCARD,
a.EMP_TYPE,
a.BELONG_UNIT_NAME,
a.SETTLE_DOMAIN_NAME,
a.TYPE,
a.SOCIAL_HOUSEHOLD_NAME,
a.PROVIDENT_HOUSEHOLD_NAME,
a.SOCIAL_HANDLE_STATUS,
IF(a.TYPE='0',s.PENSION_HANDLE,IF(a.TYPE='1' and a.SOCIAL_HANDLE_STATUS = '1','3',a.SOCIAL_HANDLE_STATUS)) as PENSION_HANDLE,
IF(a.TYPE='0',s.MEDICAL_HANDLE,IF(a.TYPE='1' and a.SOCIAL_HANDLE_STATUS = '1','3',a.SOCIAL_HANDLE_STATUS)) as MEDICAL_HANDLE,
IF(a.TYPE='0',s.UNEMPLOY_HANDLE,IF(a.TYPE='1' and a.SOCIAL_HANDLE_STATUS = '1','3',a.SOCIAL_HANDLE_STATUS)) as UNEMPLOY_HANDLE,
IF(a.TYPE='0',s.WORK_INJURY_HANDLE,IF(a.TYPE='1' and a.SOCIAL_HANDLE_STATUS = '1','3',a.SOCIAL_HANDLE_STATUS)) as WORK_INJURY_HANDLE,
IF(a.TYPE='0',s.BIRTH_HANDLE,IF(a.TYPE='1' and a.SOCIAL_HANDLE_STATUS = '1','3',a.SOCIAL_HANDLE_STATUS)) as BIRTH_HANDLE,
IF(a.TYPE='0',s.BIGAILMENT_HANDLE,IF(a.TYPE='1' and a.SOCIAL_HANDLE_STATUS = '1','3',a.SOCIAL_HANDLE_STATUS)) as BIGAILMENT_HANDLE,
a.FUND_HANDLE_STATUS,
a.CREATE_NAME,
a.ORGAN_NAME,
a.CREATE_TIME,
a.CONTRACT_NAME AS CONTRACT_TYPE,
a.CONTRACT_SUB_NAME,
a.CONTRACT_TERM,
a.CONTRACT_START,
a.CONTRACT_END,
a.AUDIT_REMARK,
a.TRUST_REMARK,
a.LEAVE_DATE,
a.REDUCE_REASON,
a.STATUS,
a.AUDIT_USER_NAME as AUDIT_USER,
a.AUDIT_TIME,
a.FUND_HANDLE_REMARK,
a.SOCIAL_HANDLE_REMARK,
a.FUND_REDUCE_DATE,
c.PROVIDENT_START,
if(a.FUND_ID = NULL,'',a.STATUS) as FUND_AUDIT_STATUS,
c.AUDIT_USER as FUND_AUDIT_USER,
c.HANDLE_USER as FUND_HANDLE_USER,
c.HANDLE_TIME as FUND_HANDLE_TIME,
s.AUDIT_USER as AUDIT_USER_NAME,
if(a.SOCIAL_ID =NULL,'',a.STATUS) as AUDIT_STATUS,
s.SOCIAL_START_DATE,
a.SOCIAL_REDUCE_DATE,
s.RECORD_BASE,
s.HANDLE_USER,
s.HANDLE_TIME,
s.UNIT_PENSION_CARDINAL,
s.UNIT_MEDICAL_CARDINAL,
s.UNIT_UNEMPLOYMENT_CARDINAL,
s.UNIT_BIGAILMENT_CARDINAL,
s.UNIT_WORK_INJURY_CARDINAL,
s.UNIT_BIRTH_CARDINAL
a.EMP_NAME,
a.EMP_IDCARD,
a.EMP_TYPE,
a.BELONG_UNIT_NAME,
a.SETTLE_DOMAIN_NAME,
case when a.TYPE = 0 then "派增"
when a.TYPE = 1 then "派减"
else null end as "TYPE" ,
a.SOCIAL_HOUSEHOLD_NAME,
case when a.STATUS = 0 then "待办理"
when a.STATUS = 1 then "办理成功"
when a.STATUS = 2 then "办理失败"
when a.STATUS = 3 then "部分办理失败"
when a.STATUS = 4 then "办理中"
else null end as "SOCIAL_HANDLE_STATUS",
IF(a.TYPE='0',
case when s.PENSION_HANDLE = 0 then "待办理"
when s.PENSION_HANDLE = 1 then "办理成功"
when s.PENSION_HANDLE = 2 then "办理失败"
when s.PENSION_HANDLE = 3 then "已派减"
else null end,
IF(a.TYPE='1' and a.SOCIAL_HANDLE_STATUS = '1',"已派减",
case when a.SOCIAL_HANDLE_STATUS = 0 then "待办理"
when a.SOCIAL_HANDLE_STATUS = 1 then "办理成功"
when a.SOCIAL_HANDLE_STATUS = 2 then "办理失败"
when a.SOCIAL_HANDLE_STATUS = 3 then "已派减"
else null end
))
as PENSION_HANDLE,
IF(a.TYPE='0',
case when s.MEDICAL_HANDLE = 0 then "待办理"
when s.MEDICAL_HANDLE = 1 then "办理成功"
when s.MEDICAL_HANDLE = 2 then "办理失败"
when s.MEDICAL_HANDLE = 3 then "已派减"
else null end,
IF(a.TYPE='1' and a.SOCIAL_HANDLE_STATUS = '1',"已派减",
case when a.SOCIAL_HANDLE_STATUS = 0 then "待办理"
when a.SOCIAL_HANDLE_STATUS = 1 then "办理成功"
when a.SOCIAL_HANDLE_STATUS = 2 then "办理失败"
when a.SOCIAL_HANDLE_STATUS = 3 then "已派减"
else null end
))
as MEDICAL_HANDLE,
IF(a.TYPE='0',
case when s.UNEMPLOY_HANDLE = 0 then "待办理"
when s.UNEMPLOY_HANDLE = 1 then "办理成功"
when s.UNEMPLOY_HANDLE = 2 then "办理失败"
when s.UNEMPLOY_HANDLE = 3 then "已派减"
else null end,
IF(a.TYPE='1' and a.SOCIAL_HANDLE_STATUS = '1',"已派减",
case when a.SOCIAL_HANDLE_STATUS = 0 then "待办理"
when a.SOCIAL_HANDLE_STATUS = 1 then "办理成功"
when a.SOCIAL_HANDLE_STATUS = 2 then "办理失败"
when a.SOCIAL_HANDLE_STATUS = 3 then "已派减"
else null end
))
as UNEMPLOY_HANDLE,
IF(a.TYPE='0',
case when s.WORK_INJURY_HANDLE = 0 then "待办理"
when s.WORK_INJURY_HANDLE = 1 then "办理成功"
when s.WORK_INJURY_HANDLE = 2 then "办理失败"
when s.WORK_INJURY_HANDLE = 3 then "已派减"
else null end,
IF(a.TYPE='1' and a.SOCIAL_HANDLE_STATUS = '1',"已派减",
case when a.SOCIAL_HANDLE_STATUS = 0 then "待办理"
when a.SOCIAL_HANDLE_STATUS = 1 then "办理成功"
when a.SOCIAL_HANDLE_STATUS = 2 then "办理失败"
when a.SOCIAL_HANDLE_STATUS = 3 then "已派减"
else null end
))
as WORK_INJURY_HANDLE,
IF(a.TYPE='0',
case when s.BIRTH_HANDLE = 0 then "待办理"
when s.BIRTH_HANDLE = 1 then "办理成功"
when s.BIRTH_HANDLE = 2 then "办理失败"
when s.BIRTH_HANDLE = 3 then "已派减"
else null end,
IF(a.TYPE='1' and a.SOCIAL_HANDLE_STATUS = '1',"已派减",
case when a.SOCIAL_HANDLE_STATUS = 0 then "待办理"
when a.SOCIAL_HANDLE_STATUS = 1 then "办理成功"
when a.SOCIAL_HANDLE_STATUS = 2 then "办理失败"
when a.SOCIAL_HANDLE_STATUS = 3 then "已派减"
else null end
))
as BIRTH_HANDLE,
IF(a.TYPE='0',
case when s.BIGAILMENT_HANDLE = 0 then "待办理"
when s.BIGAILMENT_HANDLE = 1 then "办理成功"
when s.BIGAILMENT_HANDLE = 2 then "办理失败"
when s.BIGAILMENT_HANDLE = 3 then "已派减"
else null end,
IF(a.TYPE='1' and a.SOCIAL_HANDLE_STATUS = '1',"已派减",
case when a.SOCIAL_HANDLE_STATUS = 0 then "待办理"
when a.SOCIAL_HANDLE_STATUS = 1 then "办理成功"
when a.SOCIAL_HANDLE_STATUS = 2 then "办理失败"
when a.SOCIAL_HANDLE_STATUS = 3 then "已派减"
else null end
))
as BIGAILMENT_HANDLE,
case when a.FUND_HANDLE_STATUS = 0 then "待办理"
when a.FUND_HANDLE_STATUS = 1 then "办理成功"
when a.FUND_HANDLE_STATUS = 2 then "办理失败"
when a.FUND_HANDLE_STATUS = 3 then "已派减"
else null end as FUND_HANDLE_STATUS,
a.CREATE_NAME,
a.ORGAN_NAME,
a.CREATE_TIME,
a.CONTRACT_NAME AS CONTRACT_TYPE,
a.CONTRACT_SUB_NAME,
a.CONTRACT_TERM,
a.CONTRACT_START,
a.CONTRACT_END,
a.AUDIT_REMARK,
a.TRUST_REMARK,
a.LEAVE_DATE,
a.REDUCE_REASON,
case when a.STATUS = 0 then "未提交"
when a.STATUS = 1 then "待审核"
when a.STATUS = 2 then "审核通过"
when a.STATUS = 3 then "审核不通过"
when a.STATUS = 4 then "已办结"
else null end as STATUS,
a.AUDIT_USER_NAME as AUDIT_USER,
a.AUDIT_TIME,
a.FUND_HANDLE_REMARK,
a.SOCIAL_HANDLE_REMARK,
a.FUND_REDUCE_DATE,
c.PROVIDENT_START,
if(a.FUND_ID = NULL,'',
(case when a.STATUS = 0 then "未提交"
when a.STATUS = 1 then "待审核"
when a.STATUS = 2 then "审核通过"
when a.STATUS = 3 then "审核不通过"
when a.STATUS = 4 then "已办结"
else null end )
) as FUND_AUDIT_STATUS,
c.AUDIT_USER as FUND_AUDIT_USER,
c.HANDLE_USER as FUND_HANDLE_USER,
c.HANDLE_TIME as FUND_HANDLE_TIME,
s.AUDIT_USER as AUDIT_USER_NAME,
if(a.SOCIAL_ID =NULL,'',
(case when a.STATUS = 0 then "未提交"
when a.STATUS = 1 then "待审核"
when a.STATUS = 2 then "审核通过"
when a.STATUS = 3 then "审核不通过"
when a.STATUS = 4 then "已办结"
else null end )
) as AUDIT_STATUS,
s.SOCIAL_START_DATE,
a.SOCIAL_REDUCE_DATE,
s.RECORD_BASE,
s.HANDLE_USER,
s.HANDLE_TIME,
s.UNIT_PENSION_CARDINAL,
s.UNIT_MEDICAL_CARDINAL,
s.UNIT_UNEMPLOYMENT_CARDINAL,
s.UNIT_BIGAILMENT_CARDINAL,
s.UNIT_WORK_INJURY_CARDINAL,
s.UNIT_BIRTH_CARDINAL
from t_dispatch_info a
left join t_social_info s on s.id=a.SOCIAL_ID
left join t_provident_fund c on c.id=a.FUND_ID
...
...
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