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
0dff6e7b
Commit
0dff6e7b
authored
Aug 09, 2024
by
fangxinjiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
实缴查询优化-fxj
parent
72e97794
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
122 additions
and
23 deletions
+122
-23
yifu-social-deployment.yaml
k8s-bash-test/yifu-social-deployment.yaml
+1
-1
CacheConstants.java
...oud/plus/v1/yifu/common/core/constant/CacheConstants.java
+4
-0
TPaymentInfoController.java
...lus/v1/yifu/social/controller/TPaymentInfoController.java
+116
-21
application.yml
...social/yifu-social-biz/src/main/resources/application.yml
+1
-1
No files found.
k8s-bash-test/yifu-social-deployment.yaml
View file @
0dff6e7b
...
...
@@ -59,7 +59,7 @@ spec: # 资源规范字段
value
:
Asia/Shanghai
resources
:
#资源配置限制
limits
:
# 最大使用
memory
:
"
4
096Mi"
memory
:
"
8
096Mi"
#cpu: 300m # CPU,1核心 = 1000m
requests
:
# 容器运行时,最低资源需求,也就是说最少需要多少资源容器才能正常运行
#cpu: 100m
...
...
yifu-common/yifu-common-core/src/main/java/com/yifu/cloud/plus/v1/yifu/common/core/constant/CacheConstants.java
View file @
0dff6e7b
...
...
@@ -150,6 +150,10 @@ public interface CacheConstants {
String
PAYMENT_DISPATCH_BATCH_ADD_IMPORT
=
"payment_dispatch_batch_add_import"
;
String
PAYMENT_SEARCH_REPEAT
=
"payment_search_repeat"
;
String
PAYMENT_EXPORT_REPEAT
=
"payment_export_repeat"
;
String
PAYMENT_DISPATCH_BATCH_REDUCE_IMPORT
=
"payment_dispatch_batch_reduce_import"
;
String
PAYMENT_PRE_DISPATCH_BATCH_ADD_IMPORT
=
"payment_pre_dispatch_batch_add_import"
;
...
...
yifu-social/yifu-social-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/social/controller/TPaymentInfoController.java
View file @
0dff6e7b
...
...
@@ -83,7 +83,26 @@ public class TPaymentInfoController {
@Operation
(
description
=
"简单分页查询"
)
@GetMapping
(
"/page"
)
public
R
<
IPage
<
TPaymentInfo
>>
getTPaymentInfoPage
(
Page
<
TPaymentInfo
>
page
,
TPaymentInfoSearchVo
tPaymentInfo
)
{
return
new
R
<>(
tPaymentInfoService
.
getTPaymentInfoPage
(
page
,
tPaymentInfo
));
// 获取redis分布式事务锁
String
key
=
CacheConstants
.
PAYMENT_SEARCH_REPEAT
+
CommonConstants
.
DOWN_LINE_STRING
;
String
requestId
;
try
{
requestId
=
RedisDistributedLock
.
getLock
(
key
,
"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
<>(
tPaymentInfoService
.
getTPaymentInfoPage
(
page
,
tPaymentInfo
));
}
else
{
return
R
.
failed
(
ResultConstants
.
NO_GETLOCK_DATA
);
}
}
finally
{
//主动释放锁
RedisDistributedLock
.
unlock
(
key
,
requestId
);
}
}
/**
...
...
@@ -96,17 +115,36 @@ public class TPaymentInfoController {
@Operation
(
description
=
"简单分页查询"
)
@GetMapping
(
"/newPage"
)
public
R
<
IPage
<
TPaymentInfoNewVo
>>
getTPaymentInfoNewPage
(
Page
<
TPaymentInfo
>
page
,
TPaymentInfoSearchVo
tPaymentInfo
)
{
YifuUser
user
=
SecurityUtils
.
getUser
();
menuUtil
.
setAuthSql
(
user
,
tPaymentInfo
);
if
(
Common
.
isNotNull
(
tPaymentInfo
.
getAuthSql
()))
{
if
(
tPaymentInfo
.
getAuthSql
().
contains
(
CommonConstants
.
A_DEPT_ID
))
{
tPaymentInfo
.
setAuthSql
(
tPaymentInfo
.
getAuthSql
().
replace
(
CommonConstants
.
A_DEPT_ID
,
"a.SETTLE_DOMAIN_ID"
));
}
if
(
tPaymentInfo
.
getAuthSql
().
contains
(
"1=2 EXISTS"
))
{
tPaymentInfo
.
setAuthSql
(
tPaymentInfo
.
getAuthSql
().
replace
(
"1=2 EXISTS"
,
"EXISTS"
));
// 获取redis分布式事务锁
String
key
=
CacheConstants
.
PAYMENT_SEARCH_REPEAT
+
CommonConstants
.
DOWN_LINE_STRING
;
String
requestId
;
try
{
requestId
=
RedisDistributedLock
.
getLock
(
key
,
"10"
);
}
catch
(
Exception
e
)
{
throw
new
RuntimeException
(
ResultConstants
.
NO_GETLOCK_DATA
+
CommonConstants
.
DOWN_LINE_STRING
+
e
.
getMessage
());
}
try
{
if
(
Common
.
isNotNull
(
requestId
))
{
//查询数据
YifuUser
user
=
SecurityUtils
.
getUser
();
menuUtil
.
setAuthSql
(
user
,
tPaymentInfo
);
if
(
Common
.
isNotNull
(
tPaymentInfo
.
getAuthSql
()))
{
if
(
tPaymentInfo
.
getAuthSql
().
contains
(
CommonConstants
.
A_DEPT_ID
))
{
tPaymentInfo
.
setAuthSql
(
tPaymentInfo
.
getAuthSql
().
replace
(
CommonConstants
.
A_DEPT_ID
,
"a.SETTLE_DOMAIN_ID"
));
}
if
(
tPaymentInfo
.
getAuthSql
().
contains
(
"1=2 EXISTS"
))
{
tPaymentInfo
.
setAuthSql
(
tPaymentInfo
.
getAuthSql
().
replace
(
"1=2 EXISTS"
,
"EXISTS"
));
}
}
return
new
R
<>(
tPaymentInfoService
.
getTPaymentInfoNewPage
(
page
,
tPaymentInfo
));
}
else
{
return
R
.
failed
(
ResultConstants
.
NO_GETLOCK_DATA
);
}
}
finally
{
//主动释放锁
RedisDistributedLock
.
unlock
(
key
,
requestId
);
}
return
new
R
<>(
tPaymentInfoService
.
getTPaymentInfoNewPage
(
page
,
tPaymentInfo
));
}
/**
...
...
@@ -329,7 +367,26 @@ public class TPaymentInfoController {
@Operation
(
description
=
"导出缴费库检测 "
)
@PostMapping
(
"/exportCheck"
)
public
R
<
Integer
>
exportCheck
(
HttpServletResponse
response
,
@RequestBody
TPaymentInfoSearchVo
searchVo
)
{
return
tPaymentInfoService
.
listExportCheck
(
response
,
searchVo
);
// 获取redis分布式事务锁
String
key
=
CacheConstants
.
PAYMENT_EXPORT_REPEAT
+
CommonConstants
.
DOWN_LINE_STRING
;
String
requestId
;
try
{
requestId
=
RedisDistributedLock
.
getLock
(
key
,
"10"
);
}
catch
(
Exception
e
)
{
throw
new
RuntimeException
(
ResultConstants
.
NO_GETLOCK_DATA
+
CommonConstants
.
DOWN_LINE_STRING
+
e
.
getMessage
());
}
try
{
if
(
Common
.
isNotNull
(
requestId
))
{
//查询数据
return
tPaymentInfoService
.
listExportCheck
(
response
,
searchVo
);
}
else
{
return
R
.
failed
(
ResultConstants
.
NO_GETLOCK_DATA
);
}
}
finally
{
//主动释放锁
RedisDistributedLock
.
unlock
(
key
,
requestId
);
}
}
/**
...
...
@@ -357,7 +414,26 @@ public class TPaymentInfoController {
@Operation
(
description
=
"合并导出缴费库检测"
)
@PostMapping
(
"/sumExportCheck"
)
public
R
<
Integer
>
sumExportCheck
(
HttpServletResponse
response
,
@RequestBody
TPaymentInfoSearchVo
searchVo
)
{
return
tPaymentInfoService
.
listSumExportCheck
(
response
,
searchVo
);
// 获取redis分布式事务锁
String
key
=
CacheConstants
.
PAYMENT_EXPORT_REPEAT
+
CommonConstants
.
DOWN_LINE_STRING
;
String
requestId
;
try
{
requestId
=
RedisDistributedLock
.
getLock
(
key
,
"10"
);
}
catch
(
Exception
e
)
{
throw
new
RuntimeException
(
ResultConstants
.
NO_GETLOCK_DATA
+
CommonConstants
.
DOWN_LINE_STRING
+
e
.
getMessage
());
}
try
{
if
(
Common
.
isNotNull
(
requestId
))
{
//查询数据
return
tPaymentInfoService
.
listSumExportCheck
(
response
,
searchVo
);
}
else
{
return
R
.
failed
(
ResultConstants
.
NO_GETLOCK_DATA
);
}
}
finally
{
//主动释放锁
RedisDistributedLock
.
unlock
(
key
,
requestId
);
}
}
/**
...
...
@@ -395,17 +471,36 @@ public class TPaymentInfoController {
@PostMapping
(
"/sumSearchExportCheck"
)
@SysLog
(
"实缴查询列表合并导出检测"
)
public
R
<
Integer
>
sumSearchExportCheck
(
HttpServletResponse
response
,
@RequestBody
TPaymentInfoSearchVo
searchVo
)
{
YifuUser
user
=
SecurityUtils
.
getUser
();
menuUtil
.
setAuthSql
(
user
,
searchVo
);
if
(
Common
.
isNotNull
(
searchVo
.
getAuthSql
()))
{
if
(
searchVo
.
getAuthSql
().
contains
(
CommonConstants
.
A_DEPT_ID
))
{
searchVo
.
setAuthSql
(
searchVo
.
getAuthSql
().
replace
(
CommonConstants
.
A_DEPT_ID
,
"a.SETTLE_DOMAIN_ID"
));
}
if
(
searchVo
.
getAuthSql
().
contains
(
"1=2 EXISTS"
))
{
searchVo
.
setAuthSql
(
searchVo
.
getAuthSql
().
replace
(
"1=2 EXISTS"
,
"EXISTS"
));
// 获取redis分布式事务锁
String
key
=
CacheConstants
.
PAYMENT_EXPORT_REPEAT
+
CommonConstants
.
DOWN_LINE_STRING
;
String
requestId
;
try
{
requestId
=
RedisDistributedLock
.
getLock
(
key
,
"10"
);
}
catch
(
Exception
e
)
{
throw
new
RuntimeException
(
ResultConstants
.
NO_GETLOCK_DATA
+
CommonConstants
.
DOWN_LINE_STRING
+
e
.
getMessage
());
}
try
{
if
(
Common
.
isNotNull
(
requestId
))
{
//查询数据
YifuUser
user
=
SecurityUtils
.
getUser
();
menuUtil
.
setAuthSql
(
user
,
searchVo
);
if
(
Common
.
isNotNull
(
searchVo
.
getAuthSql
()))
{
if
(
searchVo
.
getAuthSql
().
contains
(
CommonConstants
.
A_DEPT_ID
))
{
searchVo
.
setAuthSql
(
searchVo
.
getAuthSql
().
replace
(
CommonConstants
.
A_DEPT_ID
,
"a.SETTLE_DOMAIN_ID"
));
}
if
(
searchVo
.
getAuthSql
().
contains
(
"1=2 EXISTS"
))
{
searchVo
.
setAuthSql
(
searchVo
.
getAuthSql
().
replace
(
"1=2 EXISTS"
,
"EXISTS"
));
}
}
return
tPaymentInfoService
.
sumSearchExportCheck
(
response
,
searchVo
);
}
else
{
return
R
.
failed
(
ResultConstants
.
NO_GETLOCK_DATA
);
}
}
finally
{
//主动释放锁
RedisDistributedLock
.
unlock
(
key
,
requestId
);
}
return
tPaymentInfoService
.
sumSearchExportCheck
(
response
,
searchVo
);
}
/**
...
...
yifu-social/yifu-social-biz/src/main/resources/application.yml
View file @
0dff6e7b
...
...
@@ -26,7 +26,7 @@ mybatis-plus:
logic-not-delete-value
:
0
configuration
:
map-underscore-to-camel-case
:
true
#
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
log-impl
:
org.apache.ibatis.logging.stdout.StdOutImpl
# spring security 配置
security
:
...
...
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