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
868d0407
Commit
868d0407
authored
Dec 20, 2024
by
fangxinjiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
工资查询优化-fxj
parent
9b6098c3
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
63 additions
and
11 deletions
+63
-11
TMobileChangeInfoController.java
...1/yifu/salary/controller/TMobileChangeInfoController.java
+35
-9
TQuestionFeedbackInfoController.java
...fu/salary/controller/TQuestionFeedbackInfoController.java
+28
-2
No files found.
yifu-salary/yifu-salary-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/salary/controller/TMobileChangeInfoController.java
View file @
868d0407
...
...
@@ -19,11 +19,17 @@ package com.yifu.cloud.plus.v1.yifu.salary.controller;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yifu.cloud.plus.v1.yifu.common.core.constant.CacheConstants
;
import
com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants
;
import
com.yifu.cloud.plus.v1.yifu.common.core.constant.ResultConstants
;
import
com.yifu.cloud.plus.v1.yifu.common.core.redis.RedisDistributedLock
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.Common
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.ErrorMessage
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.R
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.RedisUtil
;
import
com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser
;
import
com.yifu.cloud.plus.v1.yifu.common.log.annotation.SysLog
;
import
com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils
;
import
com.yifu.cloud.plus.v1.yifu.salary.entity.TMobileChangeInfo
;
import
com.yifu.cloud.plus.v1.yifu.salary.service.TMobileChangeInfoService
;
import
com.yifu.cloud.plus.v1.yifu.salary.vo.TMobileChangeInfoSearchVo
;
...
...
@@ -97,10 +103,21 @@ public class TMobileChangeInfoController {
* @param tMobileChangeInfo
* @return R
*/
@Operation
(
summary
=
"新增"
,
description
=
"新增
:hasPermission('demo_tmobilechangeinfo_add')
"
)
@Operation
(
summary
=
"新增"
,
description
=
"新增"
)
@SysLog
(
"新增"
)
@PostMapping
(
"/add"
)
public
R
<
Boolean
>
save
(
@RequestBody
TMobileChangeInfo
tMobileChangeInfo
)
{
// 获取redis分布式事务锁
String
key
=
CacheConstants
.
MOBILE_CHANGE_LIMIT
+
CommonConstants
.
DOWN_LINE_STRING
+
"mobileChangeFlag"
;
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
))
{
//主动释放锁
tMobileChangeInfo
.
setHandleStatus
(
CommonConstants
.
ZERO_STRING
);
if
(
null
!=
redisUtil
.
get
(
CommonConstants
.
C_PREFIX
.
concat
(
tMobileChangeInfo
.
getMobileNew
())))
{
String
code
=
(
String
)
redisUtil
.
get
(
CommonConstants
.
C_PREFIX
.
concat
(
tMobileChangeInfo
.
getMobileNew
()));
...
...
@@ -111,6 +128,15 @@ public class TMobileChangeInfoController {
return
R
.
failed
(
"未找到手机号对应的验证码或验证码已超时,请重新获取"
);
}
return
R
.
ok
(
tMobileChangeInfoService
.
save
(
tMobileChangeInfo
));
}
else
{
return
R
.
failed
(
ResultConstants
.
NO_GETLOCK_DATA
);
}
}
finally
{
//主动释放锁
RedisDistributedLock
.
unlock
(
key
,
requestId
);
}
}
/**
...
...
yifu-salary/yifu-salary-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/salary/controller/TQuestionFeedbackInfoController.java
View file @
868d0407
...
...
@@ -19,6 +19,11 @@ package com.yifu.cloud.plus.v1.yifu.salary.controller;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yifu.cloud.plus.v1.yifu.common.core.constant.CacheConstants
;
import
com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants
;
import
com.yifu.cloud.plus.v1.yifu.common.core.constant.ResultConstants
;
import
com.yifu.cloud.plus.v1.yifu.common.core.redis.RedisDistributedLock
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.Common
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.ErrorMessage
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.R
;
import
com.yifu.cloud.plus.v1.yifu.common.log.annotation.SysLog
;
...
...
@@ -95,11 +100,32 @@ public class TQuestionFeedbackInfoController {
* @param tQuestionFeedbackInfo
* @return R
*/
@Operation
(
summary
=
"新增"
,
description
=
"新增
:hasPermission('demo_tquestionfeedbackinfo_add')
"
)
@Operation
(
summary
=
"新增"
,
description
=
"新增"
)
@SysLog
(
"新增"
)
@PostMapping
(
"/add"
)
public
R
<
Boolean
>
save
(
@RequestBody
TQuestionFeedbackInfo
tQuestionFeedbackInfo
)
{
String
key
=
CacheConstants
.
QUESTION_FEEDBACK_LIMIT
+
CommonConstants
.
DOWN_LINE_STRING
+
"questionFeedBackFlag"
;
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
))
{
if
(
Common
.
isNotNull
(
tQuestionFeedbackInfo
.
getQuestion
())
&&
tQuestionFeedbackInfo
.
getQuestion
().
length
()
>
200
){
return
R
.
failed
(
"你遇到的问题请控制在200字以内!"
);
}
return
tQuestionFeedbackInfoService
.
saveAsso
(
tQuestionFeedbackInfo
);
}
else
{
return
R
.
failed
(
ResultConstants
.
NO_GETLOCK_DATA
);
}
}
finally
{
//主动释放锁
RedisDistributedLock
.
unlock
(
key
,
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