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
57232dab
Commit
57232dab
authored
Jan 16, 2025
by
huyuchen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
huych-含风险项目商险不购买申请提交
parent
02534896
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
55 deletions
+17
-55
TInsuranceUnpurchaseApplyServiceImpl.java
...ry/service/impl/TInsuranceUnpurchaseApplyServiceImpl.java
+16
-54
TInsuranceUnpurchaseApplyMapper.xml
...main/resources/mapper/TInsuranceUnpurchaseApplyMapper.xml
+1
-1
No files found.
yifu-salary/yifu-salary-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/salary/service/impl/TInsuranceUnpurchaseApplyServiceImpl.java
View file @
57232dab
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
salary
.
service
.
impl
;
import
com.alibaba.excel.EasyExcel
;
import
com.alibaba.excel.EasyExcelFactory
;
import
com.alibaba.excel.ExcelWriter
;
import
com.alibaba.excel.write.metadata.WriteSheet
;
import
com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper
;
...
...
@@ -29,7 +28,10 @@ import com.yifu.cloud.plus.v1.yifu.salary.service.TInsuranceUnpurchaseApplyServi
import
com.yifu.cloud.plus.v1.yifu.salary.service.TInsuranceUnpurchasePersonService
;
import
com.yifu.cloud.plus.v1.yifu.salary.service.TSalaryAttaService
;
import
com.yifu.cloud.plus.v1.yifu.salary.service.impl.process.TInsuranceUnpurchaseApplyAuditProcess
;
import
com.yifu.cloud.plus.v1.yifu.salary.vo.*
;
import
com.yifu.cloud.plus.v1.yifu.salary.vo.TInsuranceUnpurchaseApplySearchVo
;
import
com.yifu.cloud.plus.v1.yifu.salary.vo.TInsuranceUnpurchaseApplyVo
;
import
com.yifu.cloud.plus.v1.yifu.salary.vo.TInsuranceUnpurchasePersonAddVo
;
import
com.yifu.cloud.plus.v1.yifu.salary.vo.TInsuranceUnpurchasePersonCardVo
;
import
lombok.extern.log4j.Log4j2
;
import
org.apache.commons.lang.ArrayUtils
;
import
org.apache.commons.lang.StringUtils
;
...
...
@@ -40,7 +42,6 @@ import org.springframework.transaction.annotation.Transactional;
import
javax.annotation.Resource
;
import
javax.servlet.ServletOutputStream
;
import
javax.servlet.http.HttpServletResponse
;
import
java.io.IOException
;
import
java.net.URL
;
import
java.net.URLEncoder
;
import
java.time.LocalDateTime
;
...
...
@@ -118,9 +119,6 @@ public class TInsuranceUnpurchaseApplyServiceImpl extends ServiceImpl<TInsurance
int
index
=
0
;
if
(
count
>
CommonConstants
.
ZERO_INT
)
{
if
(
count
>
CommonConstants
.
EXCEL_EXPORT_LIMIT_NEW
)
{
exportError
(
response
,
"数据超过2万条,请联系管理员后端导出"
);
}
else
{
for
(
int
i
=
0
;
i
<=
count
;
i
=
i
+
CommonConstants
.
EXCEL_EXPORT_LIMIT_NEW
)
{
// 获取实际记录
searchVo
.
setLimitStart
(
i
);
...
...
@@ -135,7 +133,6 @@ public class TInsuranceUnpurchaseApplyServiceImpl extends ServiceImpl<TInsurance
list
.
clear
();
}
}
}
}
else
{
WriteSheet
writeSheet
=
EasyExcel
.
writerSheet
(
"含风险项目不购买申请表"
+
index
).
build
();
excelWriter
.
write
(
list
,
writeSheet
);
...
...
@@ -562,39 +559,4 @@ public class TInsuranceUnpurchaseApplyServiceImpl extends ServiceImpl<TInsurance
return
tInsuranceUnpurchaseApplyAuditProcess
.
auditUserList
(
insuranceUnpurchaseApply
.
getId
(),
approvalResult
,
approvalOpinion
,
user
,
CommonConstants
.
ZERO_STRING
,
insuranceUnpurchaseApply
,
insuranceUnpurchaseApply
.
getCreateUserDeptId
());
}
private
void
exportError
(
HttpServletResponse
response
,
String
errorMessage
)
{
String
fileName
=
"导出异常"
+
DateUtil
.
getThisTime
()
+
CommonConstants
.
XLSX
;
//获取要导出的列表
List
<
ExportErrorVo
>
list
=
new
ArrayList
<>();
list
.
add
(
new
ExportErrorVo
(
errorMessage
));
ServletOutputStream
out
=
null
;
try
{
out
=
response
.
getOutputStream
();
response
.
setContentType
(
CommonConstants
.
MULTIPART_FORM_DATA
);
response
.
setCharacterEncoding
(
"utf-8"
);
response
.
setHeader
(
CommonConstants
.
CONTENT_DISPOSITION
,
CommonConstants
.
ATTACHMENT_FILENAME
+
URLEncoder
.
encode
(
fileName
,
"UTF-8"
));
// 这里 需要指定写用哪个class去写,然后写到第一个sheet,然后文件流会自动关闭
ExcelWriter
excelWriter
=
EasyExcelFactory
.
write
(
out
,
ExportErrorVo
.
class
).
build
();
int
index
=
0
;
WriteSheet
writeSheet
=
EasyExcelFactory
.
writerSheet
(
"异常信息"
+
index
).
build
();
excelWriter
.
write
(
list
,
writeSheet
);
if
(
Common
.
isNotNull
(
list
))
{
list
.
clear
();
}
out
.
flush
();
excelWriter
.
finish
();
}
catch
(
Exception
e
)
{
log
.
error
(
"执行异常"
,
e
);
}
finally
{
try
{
if
(
null
!=
out
)
{
out
.
close
();
}
}
catch
(
IOException
e
)
{
log
.
error
(
"执行异常"
,
e
);
}
}
}
}
yifu-salary/yifu-salary-biz/src/main/resources/mapper/TInsuranceUnpurchaseApplyMapper.xml
View file @
57232dab
...
...
@@ -140,7 +140,7 @@
a.DELETE_FLAG = '0'
<include
refid=
"tInsuranceUnpurchaseApply_where"
/>
</where>
ifnull(a.CREATE_TIME_ZC,'2999-12-31 00:00:00') DESC
order by
ifnull(a.CREATE_TIME_ZC,'2999-12-31 00:00:00') DESC
<if
test=
"tInsuranceUnpurchaseApply.limitStart != null"
>
limit #{tInsuranceUnpurchaseApply.limitStart},#{tInsuranceUnpurchaseApply.limitEnd}
</if>
...
...
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