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
1e5753fb
Commit
1e5753fb
authored
Aug 09, 2024
by
fangxinjiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
实缴查询优化-fxj
parent
4b880b73
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
105 additions
and
1 deletion
+105
-1
TPaymentInfoController.java
...lus/v1/yifu/social/controller/TPaymentInfoController.java
+11
-1
TPaymentInfoService.java
...loud/plus/v1/yifu/social/service/TPaymentInfoService.java
+4
-0
TPaymentInfoServiceImpl.java
.../v1/yifu/social/service/impl/TPaymentInfoServiceImpl.java
+90
-0
No files found.
yifu-social/yifu-social-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/social/controller/TPaymentInfoController.java
View file @
1e5753fb
...
@@ -87,6 +87,11 @@ public class TPaymentInfoController {
...
@@ -87,6 +87,11 @@ public class TPaymentInfoController {
if
(
Common
.
isEmpty
(
user
)){
if
(
Common
.
isEmpty
(
user
)){
return
R
.
failed
(
CommonConstants
.
USER_FAIL
);
return
R
.
failed
(
CommonConstants
.
USER_FAIL
);
}
}
//特殊条件如社保户、缴纳地的查询做限制处理,限制到所用用户,因为此部分数据量较大
R
<
IPage
<
TPaymentInfo
>>
res
=
tPaymentInfoService
.
specialHandle
(
page
,
tPaymentInfo
);
if
(
null
!=
res
){
return
res
;
}
// 获取redis分布式事务锁
// 获取redis分布式事务锁
String
key
=
CacheConstants
.
PAYMENT_SEARCH_REPEAT
+
CommonConstants
.
DOWN_LINE_STRING
+
user
.
getId
();
String
key
=
CacheConstants
.
PAYMENT_SEARCH_REPEAT
+
CommonConstants
.
DOWN_LINE_STRING
+
user
.
getId
();
String
requestId
;
String
requestId
;
...
@@ -119,6 +124,12 @@ public class TPaymentInfoController {
...
@@ -119,6 +124,12 @@ public class TPaymentInfoController {
@Operation
(
description
=
"简单分页查询"
)
@Operation
(
description
=
"简单分页查询"
)
@GetMapping
(
"/newPage"
)
@GetMapping
(
"/newPage"
)
public
R
<
IPage
<
TPaymentInfoNewVo
>>
getTPaymentInfoNewPage
(
Page
<
TPaymentInfo
>
page
,
TPaymentInfoSearchVo
tPaymentInfo
)
{
public
R
<
IPage
<
TPaymentInfoNewVo
>>
getTPaymentInfoNewPage
(
Page
<
TPaymentInfo
>
page
,
TPaymentInfoSearchVo
tPaymentInfo
)
{
//特殊条件如社保户、缴纳地的查询做限制处理,限制到所用用户,因为此部分数据量较大
R
<
IPage
<
TPaymentInfoNewVo
>>
res
=
tPaymentInfoService
.
specialHandleNew
(
page
,
tPaymentInfo
);
if
(
null
!=
res
){
return
res
;
}
YifuUser
user
=
SecurityUtils
.
getUser
();
YifuUser
user
=
SecurityUtils
.
getUser
();
if
(
Common
.
isEmpty
(
user
)){
if
(
Common
.
isEmpty
(
user
)){
return
R
.
failed
(
CommonConstants
.
USER_FAIL
);
return
R
.
failed
(
CommonConstants
.
USER_FAIL
);
...
@@ -153,7 +164,6 @@ public class TPaymentInfoController {
...
@@ -153,7 +164,6 @@ public class TPaymentInfoController {
}
}
}
}
/**
/**
* 实缴查询详情
* 实缴查询详情
*
*
...
...
yifu-social/yifu-social-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/social/service/TPaymentInfoService.java
View file @
1e5753fb
...
@@ -264,4 +264,8 @@ public interface TPaymentInfoService extends IService<TPaymentInfo> {
...
@@ -264,4 +264,8 @@ public interface TPaymentInfoService extends IService<TPaymentInfo> {
R
<
Integer
>
listSumExportCheck
(
HttpServletResponse
response
,
TPaymentInfoSearchVo
searchVo
);
R
<
Integer
>
listSumExportCheck
(
HttpServletResponse
response
,
TPaymentInfoSearchVo
searchVo
);
R
<
Integer
>
sumSearchExportCheck
(
HttpServletResponse
response
,
TPaymentInfoSearchVo
searchVo
);
R
<
Integer
>
sumSearchExportCheck
(
HttpServletResponse
response
,
TPaymentInfoSearchVo
searchVo
);
R
<
IPage
<
TPaymentInfo
>>
specialHandle
(
Page
<
TPaymentInfo
>
page
,
TPaymentInfoSearchVo
tPaymentInfo
);
R
<
IPage
<
TPaymentInfoNewVo
>>
specialHandleNew
(
Page
<
TPaymentInfo
>
page
,
TPaymentInfoSearchVo
tPaymentInfo
);
}
}
yifu-social/yifu-social-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/social/service/impl/TPaymentInfoServiceImpl.java
View file @
1e5753fb
...
@@ -5204,4 +5204,94 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
...
@@ -5204,4 +5204,94 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
}
}
return
R
.
ok
(
baseMapper
.
selectCountPaymentSearchInfo
(
searchVo
));
return
R
.
ok
(
baseMapper
.
selectCountPaymentSearchInfo
(
searchVo
));
}
}
private
boolean
socialFlag
(
TPaymentInfoSearchVo
tPaymentInfo
){
return
(
"安徽皖信人力资源管理有限公司"
.
equals
(
tPaymentInfo
.
getSocialHousehold
())
||
"安徽皖信人力资源管理有限公司肥东分公司"
.
equals
(
tPaymentInfo
.
getSocialHousehold
()))
&&
Common
.
isEmpty
(
tPaymentInfo
.
getEmpIdcard
())
&&
Common
.
isEmpty
(
tPaymentInfo
.
getUnitName
())
&&
Common
.
isEmpty
(
tPaymentInfo
.
getSettleDomainName
())
&&
Common
.
isEmpty
(
tPaymentInfo
.
getSocialCreateMonth
())
&&
Common
.
isEmpty
(
tPaymentInfo
.
getSocialPayMonth
())
&&
Common
.
isEmpty
(
tPaymentInfo
.
getSocialProvince
())
&&
Common
.
isEmpty
(
tPaymentInfo
.
getSecondIndicatorBelong
())
&&
Common
.
isEmpty
(
tPaymentInfo
.
getProvidentHousehold
());
}
private
boolean
cityFlag
(
TPaymentInfoSearchVo
tPaymentInfo
){
return
"135"
.
equals
(
tPaymentInfo
.
getSocialCity
())
&&
Common
.
isEmpty
(
tPaymentInfo
.
getEmpIdcard
())
&&
Common
.
isEmpty
(
tPaymentInfo
.
getUnitName
())
&&
Common
.
isEmpty
(
tPaymentInfo
.
getSettleDomainName
())
&&
Common
.
isEmpty
(
tPaymentInfo
.
getSocialCreateMonth
())
&&
Common
.
isEmpty
(
tPaymentInfo
.
getSocialPayMonth
())
&&
Common
.
isEmpty
(
tPaymentInfo
.
getSecondIndicatorBelong
())
&&
Common
.
isEmpty
(
tPaymentInfo
.
getProvidentHousehold
())
&&
Common
.
isEmpty
(
tPaymentInfo
.
getSocialHousehold
());
}
@Override
public
R
<
IPage
<
TPaymentInfo
>>
specialHandle
(
Page
<
TPaymentInfo
>
page
,
TPaymentInfoSearchVo
tPaymentInfo
)
{
//判断社保户
if
(
socialFlag
(
tPaymentInfo
)){
return
getLock
(
page
,
tPaymentInfo
);
}
//判断缴纳地
if
(
cityFlag
(
tPaymentInfo
)){
return
getLock
(
page
,
tPaymentInfo
);
}
return
null
;
}
@Override
public
R
<
IPage
<
TPaymentInfoNewVo
>>
specialHandleNew
(
Page
<
TPaymentInfo
>
page
,
TPaymentInfoSearchVo
tPaymentInfo
)
{
//判断社保户
if
(
socialFlag
(
tPaymentInfo
)){
return
getLockNew
(
page
,
tPaymentInfo
);
}
//判断缴纳地
if
(
cityFlag
(
tPaymentInfo
)){
return
getLockNew
(
page
,
tPaymentInfo
);
}
return
null
;
}
private
R
<
IPage
<
TPaymentInfoNewVo
>>
getLockNew
(
Page
<
TPaymentInfo
>
page
,
TPaymentInfoSearchVo
tPaymentInfo
)
{
String
keyTemp
=
CacheConstants
.
PAYMENT_SEARCH_REPEAT
;
String
requestId
;
try
{
requestId
=
RedisDistributedLock
.
getLock
(
keyTemp
,
"10"
);
}
catch
(
Exception
e
)
{
throw
new
RuntimeException
(
ResultConstants
.
NO_GETLOCK_DATA
+
CommonConstants
.
DOWN_LINE_STRING
+
e
.
getMessage
());
}
try
{
if
(
Common
.
isNotNull
(
requestId
))
{
//查询数据
return
new
R
<>(
this
.
getTPaymentInfoNewPage
(
page
,
tPaymentInfo
));
}
else
{
return
R
.
failed
(
ResultConstants
.
NO_GETLOCK_DATA
);
}
}
finally
{
//主动释放锁
RedisDistributedLock
.
unlock
(
keyTemp
,
requestId
);
}
}
private
R
<
IPage
<
TPaymentInfo
>>
getLock
(
Page
<
TPaymentInfo
>
page
,
TPaymentInfoSearchVo
tPaymentInfo
)
{
String
keyTemp
=
CacheConstants
.
PAYMENT_SEARCH_REPEAT
;
String
requestId
;
try
{
requestId
=
RedisDistributedLock
.
getLock
(
keyTemp
,
"10"
);
}
catch
(
Exception
e
)
{
throw
new
RuntimeException
(
ResultConstants
.
NO_GETLOCK_DATA
+
CommonConstants
.
DOWN_LINE_STRING
+
e
.
getMessage
());
}
try
{
if
(
Common
.
isNotNull
(
requestId
))
{
//查询数据
return
new
R
<>(
this
.
getTPaymentInfoPage
(
page
,
tPaymentInfo
));
}
else
{
return
R
.
failed
(
ResultConstants
.
NO_GETLOCK_DATA
);
}
}
finally
{
//主动释放锁
RedisDistributedLock
.
unlock
(
keyTemp
,
requestId
);
}
}
}
}
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