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
8ff85070
Commit
8ff85070
authored
Apr 06, 2023
by
huyuchen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
派单优化修改
parent
bc9c3206
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
46 additions
and
26 deletions
+46
-26
CacheConstants.java
...oud/plus/v1/yifu/common/core/constant/CacheConstants.java
+3
-0
TDispatchInfoServiceImpl.java
...v1/yifu/social/service/impl/TDispatchInfoServiceImpl.java
+43
-26
No files found.
yifu-common/yifu-common-core/src/main/java/com/yifu/cloud/plus/v1/yifu/common/core/constant/CacheConstants.java
View file @
8ff85070
...
...
@@ -151,4 +151,7 @@ public interface CacheConstants {
String
PAYMENT_DISPATCH_BATCH_REDUCE_IMPORT
=
"payment_dispatch_batch_reduce_import"
;
String
PAYMENT_PRE_DISPATCH_BATCH_ADD_IMPORT
=
"payment_pre_dispatch_batch_add_import"
;
//社保公积金派单
String
PAYMENT_DISPATCH_BATCH_IMPORT
=
"payment_dispatch_batch_import"
;
}
yifu-social/yifu-social-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/social/service/impl/TDispatchInfoServiceImpl.java
View file @
8ff85070
...
...
@@ -40,7 +40,9 @@ import com.yifu.cloud.plus.v1.yifu.archives.vo.*;
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.ExcelAttributeConstants
;
import
com.yifu.cloud.plus.v1.yifu.common.core.constant.ResultConstants
;
import
com.yifu.cloud.plus.v1.yifu.common.core.exception.ErrorCodes
;
import
com.yifu.cloud.plus.v1.yifu.common.core.redis.RedisDistributedLock
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.*
;
import
com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser
;
import
com.yifu.cloud.plus.v1.yifu.common.dapr.util.ArchivesDaprUtil
;
...
...
@@ -3364,34 +3366,49 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
@Override
public
R
<
List
<
ErrorMessage
>>
addApplyHandle
(
List
<
String
>
ids
,
String
typeSub
,
String
handleStatus
,
String
handleRemark
,
String
socialType
,
String
remark
)
{
YifuUser
user
=
SecurityUtils
.
getUser
();
if
(
null
==
user
)
{
return
R
.
failed
(
CommonConstants
.
USER_FAIL
);
}
if
(
Common
.
isEmpty
(
ids
))
{
return
R
.
failed
(
DispatchConstants
.
DISPATCH_ID_NOT_EMPTY
);
}
int
flag
;
if
(
CommonConstants
.
ONE_STRING
.
equals
(
handleStatus
))
{
//办理成功
flag
=
CommonConstants
.
ZERO_INT
;
}
else
if
(
CommonConstants
.
TWO_STRING
.
equals
(
handleStatus
))
{
//办理失败
flag
=
CommonConstants
.
ONE_INT
;
}
else
{
return
R
.
failed
(
"派单办理状态参数异常:0待办理 1办理通过 2办理不通过"
);
}
String
key
=
CacheConstants
.
PAYMENT_DISPATCH_BATCH_IMPORT
+
CommonConstants
.
DOWN_LINE_STRING
+
user
.
getId
()
;
// 获取redis分布式事务锁
String
requestId
;
try
{
YifuUser
user
=
SecurityUtils
.
getUser
();
if
(
null
==
user
)
{
return
R
.
failed
(
CommonConstants
.
USER_FAIL
);
}
if
(
Common
.
isEmpty
(
ids
))
{
return
R
.
failed
(
DispatchConstants
.
DISPATCH_ID_NOT_EMPTY
);
}
int
flag
;
if
(
CommonConstants
.
ONE_STRING
.
equals
(
handleStatus
))
{
//办理成功
flag
=
CommonConstants
.
ZERO_INT
;
}
else
if
(
CommonConstants
.
TWO_STRING
.
equals
(
handleStatus
))
{
//办理失败
flag
=
CommonConstants
.
ONE_INT
;
}
else
{
return
R
.
failed
(
"派单办理状态参数异常:0待办理 1办理通过 2办理不通过"
);
}
List
<
ErrorMessage
>
errorInfo
=
addBatchApplyHandle
(
ids
,
typeSub
,
user
,
flag
,
handleStatus
,
Common
.
isNullToString
(
handleRemark
),
socialType
,
remark
);
if
(
errorInfo
==
null
||
errorInfo
.
isEmpty
())
{
return
R
.
ok
(
null
,
"办理成功!"
);
}
else
{
return
R
.
ok
(
errorInfo
,
"派单办理结果:"
);
}
requestId
=
RedisDistributedLock
.
getLock
(
key
,
"10"
);
}
catch
(
Exception
e
)
{
log
.
error
(
DispatchConstants
.
DISPATCH_EXCEPTION
+
e
.
getMessage
());
return
R
.
failed
(
"数据异常,办理失败!"
);
throw
new
RuntimeException
(
ResultConstants
.
NO_GETLOCK_DATA
+
CommonConstants
.
DOWN_LINE_STRING
+
e
.
getMessage
());
}
if
(
Common
.
isNotNull
(
requestId
))
{
try
{
List
<
ErrorMessage
>
errorInfo
=
addBatchApplyHandle
(
ids
,
typeSub
,
user
,
flag
,
handleStatus
,
Common
.
isNullToString
(
handleRemark
),
socialType
,
remark
);
if
(
errorInfo
==
null
||
errorInfo
.
isEmpty
())
{
return
R
.
ok
(
null
,
"办理成功!"
);
}
else
{
return
R
.
ok
(
errorInfo
,
"派单办理结果:"
);
}
}
catch
(
Exception
e
)
{
log
.
error
(
DispatchConstants
.
DISPATCH_EXCEPTION
+
e
.
getMessage
());
return
R
.
failed
(
"数据异常,办理失败!"
);
}
finally
{
//主动释放锁
RedisDistributedLock
.
unlock
(
key
,
requestId
);
}
}
else
{
return
R
.
failed
(
ResultConstants
.
NO_GETLOCK_DATA
);
}
}
...
...
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