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
052776ff
Commit
052776ff
authored
Sep 06, 2023
by
huyuchen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
实缴合并导出限制
parent
9712e08e
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
51 additions
and
2 deletions
+51
-2
CacheConstants.java
...oud/plus/v1/yifu/common/core/constant/CacheConstants.java
+2
-0
CommonConstants.java
...ud/plus/v1/yifu/common/core/constant/CommonConstants.java
+4
-0
TPaymentInfoController.java
...lus/v1/yifu/social/controller/TPaymentInfoController.java
+2
-0
TPaymentInfoServiceImpl.java
.../v1/yifu/social/service/impl/TPaymentInfoServiceImpl.java
+43
-1
TPaymentInfoMapper.xml
...cial-biz/src/main/resources/mapper/TPaymentInfoMapper.xml
+0
-1
No files found.
yifu-common/yifu-common-core/src/main/java/com/yifu/cloud/plus/v1/yifu/common/core/constant/CacheConstants.java
View file @
052776ff
...
...
@@ -146,6 +146,8 @@ public interface CacheConstants {
String
PAYMENT_SOCIAL_PUSH
=
"payment_social_push"
;
String
PAYMENT_SOCIAL_EXPORT
=
"payment_social_export"
;
String
PAYMENT_DISPATCH_BATCH_ADD_IMPORT
=
"payment_dispatch_batch_add_import"
;
String
PAYMENT_DISPATCH_BATCH_REDUCE_IMPORT
=
"payment_dispatch_batch_reduce_import"
;
...
...
yifu-common/yifu-common-core/src/main/java/com/yifu/cloud/plus/v1/yifu/common/core/constant/CommonConstants.java
View file @
052776ff
...
...
@@ -578,6 +578,10 @@ public interface CommonConstants {
String
HRO_EMPLOYEE_NULL
=
"Hro人员列表为空"
;
int
THIRTY_INT_NEGATIVE
=
-
30
;
public
static
final
String
SOCIAL_EXPORT_CONTINUE
=
"当前用户有未完成的实缴导出任务不可重复操作"
;
public
static
final
String
SOCIAL_EXPORT_LIMIT
=
"导出量过大,请选择更多查询条件!如果确定要导出这些数据请联系系统管理员操作"
;
/*
* 启用停用状态
*/
...
...
yifu-social/yifu-social-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/social/controller/TPaymentInfoController.java
View file @
052776ff
...
...
@@ -306,6 +306,7 @@ public class TPaymentInfoController {
* @author huyc
* @date 2022-07-22
**/
@SysLog
(
"实缴导入列表不合并导出"
)
@Operation
(
description
=
"导出缴费库 hasPermission('social_tpaymentinfo_export')"
)
@PostMapping
(
"/export"
)
@PreAuthorize
(
"@pms.hasPermission('social_tpaymentinfo_export')"
)
...
...
@@ -336,6 +337,7 @@ public class TPaymentInfoController {
@Operation
(
description
=
"缴费库查询合并导出 hasPermission('social_tpaymentinfo_export')"
)
@PostMapping
(
"/sumSearchExport"
)
@PreAuthorize
(
"@pms.hasPermission('social_tpaymentinfo_export')"
)
@SysLog
(
"实缴查询列表合并导出"
)
public
void
sumSearchExport
(
HttpServletResponse
response
,
@RequestBody
TPaymentInfoSearchVo
searchVo
)
{
YifuUser
user
=
SecurityUtils
.
getUser
();
menuUtil
.
setAuthSql
(
user
,
searchVo
);
...
...
yifu-social/yifu-social-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/social/service/impl/TPaymentInfoServiceImpl.java
View file @
052776ff
...
...
@@ -184,11 +184,20 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
List
<
TPaymentInfoBatchVo
>
list
=
new
ArrayList
<>();
Integer
count
=
baseMapper
.
selectCountTPaymentInfo
(
searchVo
);
ServletOutputStream
out
=
null
;
YifuUser
user
=
SecurityUtils
.
getUser
();
String
key
=
CacheConstants
.
PAYMENT_SOCIAL_EXPORT
+
CommonConstants
.
DOWN_LINE_STRING
+
user
.
getId
()
;
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"
));
if
(
Common
.
isNotNull
(
redisUtil
.
get
(
key
)))
{
out
.
write
(
CommonConstants
.
SOCIAL_EXPORT_CONTINUE
.
getBytes
(
"GBK"
));
out
.
close
();
return
;
}
else
{
redisUtil
.
set
(
key
,
user
.
getId
(),
600L
);
}
// 这里 需要指定写用哪个class去写,然后写到第一个sheet,然后文件流会自动关闭
ExcelWriter
excelWriter
=
EasyExcel
.
write
(
out
,
TPaymentInfoBatchVo
.
class
).
includeColumnFieldNames
(
searchVo
.
getExportFields
()).
build
();
int
index
=
0
;
...
...
@@ -220,13 +229,16 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
excelWriter
.
finish
();
}
}
catch
(
Exception
e
)
{
redisUtil
.
remove
(
key
);
log
.
error
(
"执行异常"
,
e
);
}
finally
{
try
{
if
(
null
!=
out
)
{
out
.
close
();
}
redisUtil
.
remove
(
key
);
}
catch
(
IOException
e
)
{
redisUtil
.
remove
(
key
);
log
.
error
(
"执行异常"
,
e
);
}
}
...
...
@@ -245,11 +257,26 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
List
<
TPaymentInfoExportVo
>
list
=
new
ArrayList
<>();
Integer
count
=
baseMapper
.
selectCountSumPaymentInfo
(
searchVo
);
ServletOutputStream
out
=
null
;
YifuUser
user
=
SecurityUtils
.
getUser
();
String
key
=
CacheConstants
.
PAYMENT_SOCIAL_EXPORT
+
CommonConstants
.
DOWN_LINE_STRING
+
user
.
getId
()
;
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"
));
if
(
Common
.
isNotNull
(
redisUtil
.
get
(
key
)))
{
out
.
write
(
CommonConstants
.
SOCIAL_EXPORT_CONTINUE
.
getBytes
(
"GBK"
));
out
.
close
();
return
;
}
else
{
redisUtil
.
set
(
key
,
user
.
getId
(),
600L
);
}
if
(
count
>
150000
&&
!
CommonConstants
.
ONE_STRING
.
equals
(
user
.
getId
()))
{
out
.
write
(
CommonConstants
.
SOCIAL_EXPORT_LIMIT
.
getBytes
(
"GBK"
));
out
.
close
();
redisUtil
.
remove
(
key
);
return
;
}
// 这里 需要指定写用哪个class去写,然后写到第一个sheet,然后文件流会自动关闭
ExcelWriter
excelWriter
=
EasyExcel
.
write
(
out
,
TPaymentInfoExportVo
.
class
).
includeColumnFieldNames
(
searchVo
.
getExportFields
()).
build
();
int
index
=
0
;
...
...
@@ -279,13 +306,16 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
out
.
flush
();
excelWriter
.
finish
();
}
catch
(
Exception
e
)
{
redisUtil
.
remove
(
key
);
log
.
error
(
"执行异常"
,
e
);
}
finally
{
try
{
if
(
null
!=
out
)
{
out
.
close
();
}
redisUtil
.
remove
(
key
);
}
catch
(
IOException
e
)
{
redisUtil
.
remove
(
key
);
log
.
error
(
"执行异常"
,
e
);
}
}
...
...
@@ -305,14 +335,23 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
List
<
TPaymentInfoNewExportVo
>
list
=
new
ArrayList
<>();
Integer
count
=
baseMapper
.
selectCountPaymentSearchInfo
(
searchVo
);
ServletOutputStream
out
=
null
;
String
key
=
CacheConstants
.
PAYMENT_SOCIAL_EXPORT
+
CommonConstants
.
DOWN_LINE_STRING
+
user
.
getId
()
;
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"
));
if
(
Common
.
isNotNull
(
redisUtil
.
get
(
key
)))
{
out
.
write
(
CommonConstants
.
SOCIAL_EXPORT_CONTINUE
.
getBytes
(
"GBK"
));
out
.
close
();
return
;
}
else
{
redisUtil
.
set
(
key
,
user
.
getId
(),
600L
);
}
if
(
count
>
150000
&&
!
CommonConstants
.
ONE_STRING
.
equals
(
user
.
getId
()))
{
out
.
write
(
"导出量过大,请选择更多查询条件!如果确定要导出这些数据请联系管理员操作"
.
getBytes
(
"GBK"
));
out
.
write
(
CommonConstants
.
SOCIAL_EXPORT_LIMIT
.
getBytes
(
"GBK"
));
out
.
close
();
redisUtil
.
remove
(
key
);
return
;
}
// 这里 需要指定写用哪个class去写,然后写到第一个sheet,然后文件流会自动关闭
...
...
@@ -344,13 +383,16 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
out
.
flush
();
excelWriter
.
finish
();
}
catch
(
Exception
e
)
{
redisUtil
.
remove
(
key
);
log
.
error
(
"执行异常"
,
e
);
}
finally
{
try
{
if
(
null
!=
out
)
{
out
.
close
();
}
redisUtil
.
remove
(
key
);
}
catch
(
IOException
e
)
{
redisUtil
.
remove
(
key
);
log
.
error
(
"执行异常"
,
e
);
}
}
...
...
yifu-social/yifu-social-biz/src/main/resources/mapper/TPaymentInfoMapper.xml
View file @
052776ff
...
...
@@ -1981,7 +1981,6 @@
)
) w
GROUP BY w.keyGroup
ORDER BY w.SOCIAL_CREATE_TIME desc
limit #{tPaymentInfo.limitStart},#{tPaymentInfo.limitEnd}
</select>
...
...
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