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
aa69d480
Commit
aa69d480
authored
Nov 30, 2022
by
fangxinjiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
派单批量办理优化
parent
9d4a0480
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
88 additions
and
81 deletions
+88
-81
TForecastLibraryServiceImpl.java
...yifu/social/service/impl/TForecastLibraryServiceImpl.java
+3
-0
DoJointSocialTask.java
...ifu/cloud/plus/v1/yifu/social/util/DoJointSocialTask.java
+11
-66
DoSocialTask.java
...com/yifu/cloud/plus/v1/yifu/social/util/DoSocialTask.java
+74
-15
No files found.
yifu-social/yifu-social-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/social/service/impl/TForecastLibraryServiceImpl.java
View file @
aa69d480
...
...
@@ -2391,6 +2391,9 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap
}
}
}
if
(
Common
.
isEmpty
(
listVo
)
||
CommonConstants
.
SUCCESS
!=
listVo
.
getCode
()){
ServiceUtil
.
runTimeExceptionDiy
(
"获取结算主体异常,请检查传参和档案服务状态!"
);
}
if
(
CommonConstants
.
ZERO_STRING
.
equals
(
settleDomain
.
getSocialType
()))
{
continue
;
}
...
...
yifu-social/yifu-social-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/social/util/DoJointSocialTask.java
View file @
aa69d480
...
...
@@ -439,41 +439,13 @@ public class DoJointSocialTask {
**/
@Async
public
void
asynchronousEkpForecastSocial
(
EkpPushSocialParam
socialParam
,
TForecastLibrary
library
)
{
log
.
info
(
"推送社保预估费用到EKP-线程开始"
);
try
{
String
body
=
ekpSocialUtil
.
sendToEKP
(
socialParam
);
if
(
Common
.
isEmpty
(
body
)
||
body
.
length
()
!=
32
)
{
body
=
ekpSocialUtil
.
sendToEKP
(
socialParam
);
}
if
(
Common
.
isNotNull
(
body
)
&&
body
.
length
()
==
32
)
{
library
.
setDataPush
(
CommonConstants
.
ONE_INT
);
forecastLibraryMapper
.
updateById
(
library
);
}
else
{
TSendEkpError
error
=
new
TSendEkpError
();
error
.
setCreateTime
(
new
Date
());
error
.
setCreateDay
(
DateUtil
.
getThisDay
());
error
.
setType
(
CommonConstants
.
TWO_STRING
);
error
.
setCreateUserName
(
"社保预估费用推送"
);
error
.
setLinkId
(
library
.
getId
());
error
.
setTitle
(
body
);
error
.
setNums
(
CommonConstants
.
ONE_INT
);
tSendEkpErrorService
.
saveError
(
error
);
}
}
catch
(
Exception
e
)
{
TSendEkpError
error
=
new
TSendEkpError
();
error
.
setCreateTime
(
new
Date
());
error
.
setCreateDay
(
DateUtil
.
getThisDay
());
error
.
setType
(
CommonConstants
.
TWO_STRING
);
error
.
setCreateUserName
(
"社保预估费用推送"
);
error
.
setLinkId
(
library
.
getId
());
error
.
setTitle
(
e
.
getMessage
());
error
.
setNums
(
CommonConstants
.
ONE_INT
);
tSendEkpErrorService
.
saveError
(
error
);
log
.
error
(
"推送社保预估费用到EKP错误"
,
e
);
}
log
.
info
(
"推送社保预估费用到EKP结束"
);
ekpForecastSocial
(
socialParam
,
library
);
}
public
void
asynchronousEkpForecastSocialAsso
(
EkpPushSocialParam
socialParam
,
TForecastLibrary
library
)
{
ekpForecastSocial
(
socialParam
,
library
);
}
private
void
ekpForecastSocial
(
EkpPushSocialParam
socialParam
,
TForecastLibrary
library
)
{
log
.
info
(
"推送社保预估费用到EKP-线程开始"
);
try
{
String
body
=
ekpSocialUtil
.
sendToEKP
(
socialParam
);
...
...
@@ -517,6 +489,11 @@ public class DoJointSocialTask {
**/
@Async
public
void
asynchronousEkpForecastFund
(
EkpPushFundParam
fundParam
,
TForecastLibrary
library
)
{
initEkpForecastFund
(
fundParam
,
library
);
}
private
void
initEkpForecastFund
(
EkpPushFundParam
fundParam
,
TForecastLibrary
library
)
{
initEkpForecastFund
(
fundParam
,
library
);
log
.
info
(
"推送公积金预估费用到EKP-线程开始"
);
try
{
String
body
=
ekpFundUtil
.
sendToEKP
(
fundParam
);
...
...
@@ -553,38 +530,6 @@ public class DoJointSocialTask {
}
public
void
asynchronousEkpForecastFundAsso
(
EkpPushFundParam
fundParam
,
TForecastLibrary
library
)
{
log
.
info
(
"推送公积金预估费用到EKP-线程开始"
);
try
{
String
body
=
ekpFundUtil
.
sendToEKP
(
fundParam
);
if
(
Common
.
isEmpty
(
body
)
||
body
.
length
()
!=
32
)
{
body
=
ekpFundUtil
.
sendToEKP
(
fundParam
);
}
if
(
Common
.
isNotNull
(
body
)
&&
body
.
length
()
==
32
)
{
library
.
setDataPush
(
CommonConstants
.
ONE_INT
);
forecastLibraryMapper
.
updateById
(
library
);
}
else
{
TSendEkpError
error
=
new
TSendEkpError
();
error
.
setCreateTime
(
new
Date
());
error
.
setCreateDay
(
DateUtil
.
getThisDay
());
error
.
setType
(
CommonConstants
.
TWO_STRING
);
error
.
setCreateUserName
(
"公积金预估费用推送"
);
error
.
setLinkId
(
library
.
getId
());
error
.
setTitle
(
body
);
error
.
setNums
(
CommonConstants
.
ONE_INT
);
tSendEkpErrorService
.
saveError
(
error
);
}
}
catch
(
Exception
e
)
{
TSendEkpError
error
=
new
TSendEkpError
();
error
.
setCreateTime
(
new
Date
());
error
.
setCreateDay
(
DateUtil
.
getThisDay
());
error
.
setType
(
CommonConstants
.
TWO_STRING
);
error
.
setCreateUserName
(
"公积金预估费用推送"
);
error
.
setLinkId
(
library
.
getId
());
error
.
setTitle
(
e
.
getMessage
());
error
.
setNums
(
CommonConstants
.
ONE_INT
);
tSendEkpErrorService
.
saveError
(
error
);
log
.
error
(
"推送公积金预估费用到EKP错误"
,
e
);
}
log
.
info
(
"推送公积金预估费用到EKP结束"
);
initEkpForecastFund
(
fundParam
,
library
);
}
}
yifu-social/yifu-social-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/social/util/DoSocialTask.java
View file @
aa69d480
...
...
@@ -11,11 +11,12 @@ import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import
com.yifu.cloud.plus.v1.yifu.common.dapr.util.ArchivesDaprUtil
;
import
com.yifu.cloud.plus.v1.yifu.social.entity.TForecastLibrary
;
import
com.yifu.cloud.plus.v1.yifu.social.entity.TIncomeDetail
;
import
com.yifu.cloud.plus.v1.yifu.social.entity.TSendEkpError
;
import
com.yifu.cloud.plus.v1.yifu.social.entity.TSocialFundInfo
;
import
com.yifu.cloud.plus.v1.yifu.social.mapper.TSendEkpErrorMapper
;
import
com.yifu.cloud.plus.v1.yifu.social.service.TForecastLibraryService
;
import
com.yifu.cloud.plus.v1.yifu.social.service.TIncomeDetailService
;
import
com.yifu.cloud.plus.v1.yifu.social.service.TIncomeService
;
import
lombok.Synchronized
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -23,6 +24,7 @@ import org.springframework.scheduling.annotation.Async;
import
org.springframework.stereotype.Component
;
import
java.math.BigDecimal
;
import
java.util.Date
;
import
java.util.List
;
/**
...
...
@@ -45,6 +47,9 @@ public class DoSocialTask {
@Autowired
private
TIncomeService
incomeService
;
@Autowired
private
TSendEkpErrorMapper
sendEkpErrorMapper
;
/**
* @Author fxj
* @Description 异步处理相关信息
...
...
@@ -54,22 +59,76 @@ public class DoSocialTask {
@Async
public
void
asynchronousDisPatchHandle
(
TSocialFundInfo
sf
,
int
forecastFlag
,
List
<
TForecastLibrary
>
libs
,
TForecastLibrary
library
,
int
type
)
{
synchronized
(
this
){
// 派单减少变更预估库-派减
if
(
type
==
CommonConstants
.
ZERO_INT
){
forecastLibraryService
.
updateForecastLibaryByDispatchReduce
(
sf
,
forecastFlag
);
}
// 派单变更预估库
if
(
type
==
CommonConstants
.
ONE_INT
){
forecastLibraryService
.
updateForecastLibaryByDispatch
(
sf
);
}
// 获取预估库数据并推送
if
(
type
==
CommonConstants
.
TWO_INT
){
forecastLibraryService
.
pushForecastFundInfo
(
libs
,
false
);
R
<
String
>
res
;
String
linkId
=
null
;
try
{
// 派单减少变更预估库-派减
if
(
type
==
CommonConstants
.
ZERO_INT
){
linkId
=
sf
.
getId
();
res
=
forecastLibraryService
.
updateForecastLibaryByDispatchReduce
(
sf
,
forecastFlag
);
if
(
Common
.
isEmpty
(
res
)
||
CommonConstants
.
SUCCESS
!=
res
.
getCode
()){
initSendError
(
library
.
getId
(),
res
.
getMsg
(),
"updateForecastLibaryByDispatchReduce:"
);
}
}
// 派单变更预估库
if
(
type
==
CommonConstants
.
ONE_INT
){
linkId
=
sf
.
getId
();
res
=
forecastLibraryService
.
updateForecastLibaryByDispatch
(
sf
);
if
(
Common
.
isEmpty
(
res
)
||
CommonConstants
.
SUCCESS
!=
res
.
getCode
()){
initSendError
(
sf
.
getId
(),
res
.
getMsg
(),
"updateForecastLibaryByDispatch:"
);
}
}
// 获取预估库数据并推送
if
(
type
==
CommonConstants
.
TWO_INT
){
if
(
Common
.
isNotNull
(
libs
)){
for
(
TForecastLibrary
lib:
libs
){
if
(
Common
.
isEmpty
(
linkId
)){
linkId
=
lib
.
getId
();
}
else
{
linkId
=
linkId
+
CommonConstants
.
COMMA_CHAR
+
lib
.
getId
();
}
}
}
forecastLibraryService
.
pushForecastFundInfo
(
libs
,
false
);
}
// 获取预估库数据并推送
if
(
type
==
CommonConstants
.
THREE_INT
){
linkId
=
library
.
getId
();
createIncomeInfo
(
library
);
}
}
catch
(
Exception
e
){
initSendError
(
linkId
,
e
.
getMessage
(),
"asynchronousDisPatchHandle:"
);
}
// 获取预估库数据并推送
if
(
type
==
CommonConstants
.
THREE_INT
){
createIncomeInfo
(
library
);
}
}
private
void
initSendError
(
String
linkId
,
String
msg
,
String
title
)
{
TSendEkpError
error
=
new
TSendEkpError
();
error
.
setCreateTime
(
new
Date
());
error
.
setCreateDay
(
DateUtil
.
getThisDay
());
error
.
setType
(
CommonConstants
.
TWO_STRING
);
error
.
setCreateUserName
(
"社保预估费用推送"
);
error
.
setLinkId
(
linkId
);
error
.
setTitle
(
title
+
msg
);
error
.
setNums
(
CommonConstants
.
ONE_INT
);
this
.
saveError
(
error
);
log
.
error
(
"推送社保预估费用到EKP错误"
,
msg
);
}
private
boolean
saveError
(
TSendEkpError
tSendEkpError
)
{
// 类型、创建日不可为空
if
(
Common
.
isEmpty
(
tSendEkpError
.
getType
())
||
Common
.
isEmpty
(
tSendEkpError
.
getCreateDay
()))
{
return
false
;
}
TSendEkpError
error
=
sendEkpErrorMapper
.
getByTitleTypeDay
(
tSendEkpError
);
if
(
error
==
null
)
{
return
sendEkpErrorMapper
.
insert
(
tSendEkpError
)
>
0
;
}
else
{
if
(
Common
.
isEmpty
(
tSendEkpError
.
getNums
()))
{
tSendEkpError
.
setNums
(
CommonConstants
.
ONE_INT
);
}
error
.
setNums
(
error
.
getNums
()
+
tSendEkpError
.
getNums
());
return
sendEkpErrorMapper
.
updateById
(
error
)
>=
0
;
}
}
public
void
createIncomeInfo
(
TForecastLibrary
library
)
{
...
...
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