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
7380f8b2
Commit
7380f8b2
authored
Dec 18, 2024
by
fangxinjiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
社保批量办理事务控制范围减少-fxj
parent
b619bd72
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
428 additions
and
414 deletions
+428
-414
TDispatchInfoService.java
...oud/plus/v1/yifu/social/service/TDispatchInfoService.java
+6
-1
TDispatchInfoServiceImpl.java
...v1/yifu/social/service/impl/TDispatchInfoServiceImpl.java
+422
-413
No files found.
yifu-social/yifu-social-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/social/service/TDispatchInfoService.java
View file @
7380f8b2
...
@@ -25,6 +25,7 @@ import com.yifu.cloud.plus.v1.yifu.common.core.util.ErrorMessage;
...
@@ -25,6 +25,7 @@ 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.R
;
import
com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser
;
import
com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser
;
import
com.yifu.cloud.plus.v1.yifu.social.entity.TDispatchInfo
;
import
com.yifu.cloud.plus.v1.yifu.social.entity.TDispatchInfo
;
import
com.yifu.cloud.plus.v1.yifu.social.entity.TSocialFundInfo
;
import
com.yifu.cloud.plus.v1.yifu.social.vo.*
;
import
com.yifu.cloud.plus.v1.yifu.social.vo.*
;
import
org.apache.shardingsphere.transaction.annotation.ShardingTransactionType
;
import
org.apache.shardingsphere.transaction.annotation.ShardingTransactionType
;
import
org.apache.shardingsphere.transaction.core.TransactionType
;
import
org.apache.shardingsphere.transaction.core.TransactionType
;
...
@@ -34,6 +35,7 @@ import javax.servlet.http.HttpServletResponse;
...
@@ -34,6 +35,7 @@ import javax.servlet.http.HttpServletResponse;
import
java.io.InputStream
;
import
java.io.InputStream
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
import
java.util.concurrent.ConcurrentHashMap
;
/**
/**
* 派单信息记录表
* 派单信息记录表
...
@@ -84,7 +86,10 @@ public interface TDispatchInfoService extends IService<TDispatchInfo> {
...
@@ -84,7 +86,10 @@ public interface TDispatchInfoService extends IService<TDispatchInfo> {
// isAutoFlag:是否社保士兵的自动办理,true :是
// isAutoFlag:是否社保士兵的自动办理,true :是
R
<
List
<
ErrorMessage
>>
addApplyHandle
(
List
<
String
>
ids
,
String
typeSub
,
String
handleStatus
,
String
handleRemark
,
String
socialType
,
String
remark
,
YifuUser
user
,
boolean
isAutoHandle
);
R
<
List
<
ErrorMessage
>>
addApplyHandle
(
List
<
String
>
ids
,
String
typeSub
,
String
handleStatus
,
String
handleRemark
,
String
socialType
,
String
remark
,
YifuUser
user
,
boolean
isAutoHandle
);
/**
//代码优化-解决死锁问题:fxj 2024-12-18 事务控制集中到每次循环,而不是所有for循环
boolean
extracted
(
ConcurrentHashMap
<
String
,
String
>
socialMap
,
ConcurrentHashMap
<
String
,
String
>
fundMap
,
String
typeSub
,
YifuUser
user
,
int
flag
,
String
handleStatus
,
String
handleRemark
,
String
socialType
,
String
remark
,
boolean
isAutoHandle
,
List
<
ErrorMessage
>
errorList
,
Map
<
String
,
TSocialFundInfo
>
socialFundMap
,
TDispatchInfo
dis
);
/**
* @Description: 社保士兵导出
* @Description: 社保士兵导出
* @Author: hgw
* @Author: hgw
* @Date: 2024/5/13 11:34
* @Date: 2024/5/13 11:34
...
...
yifu-social/yifu-social-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/social/service/impl/TDispatchInfoServiceImpl.java
View file @
7380f8b2
...
@@ -3944,7 +3944,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
...
@@ -3944,7 +3944,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
* @Author fxj
* @Author fxj
* @Date 2022-07-26
* @Date 2022-07-26
**/
**/
@Transactional
(
rollbackFor
=
Exception
.
class
)
//
@Transactional(rollbackFor = Exception.class)
public
List
<
ErrorMessage
>
addBatchApplyHandle
(
ConcurrentHashMap
<
String
,
String
>
socialMap
,
ConcurrentHashMap
<
String
,
String
>
fundMap
,
public
List
<
ErrorMessage
>
addBatchApplyHandle
(
ConcurrentHashMap
<
String
,
String
>
socialMap
,
ConcurrentHashMap
<
String
,
String
>
fundMap
,
List
<
String
>
idsList
,
String
typeSub
,
YifuUser
user
List
<
String
>
idsList
,
String
typeSub
,
YifuUser
user
,
int
flag
,
String
handleStatus
,
String
handleRemark
,
String
socialType
,
String
remark
,
boolean
isAutoHandle
)
{
,
int
flag
,
String
handleStatus
,
String
handleRemark
,
String
socialType
,
String
remark
,
boolean
isAutoHandle
)
{
...
@@ -3958,436 +3958,445 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
...
@@ -3958,436 +3958,445 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
// 获取所有派单查询信息
// 获取所有派单查询信息
Map
<
String
,
TSocialFundInfo
>
socialFundMap
=
initSocialFundMap
(
disList
);
Map
<
String
,
TSocialFundInfo
>
socialFundMap
=
initSocialFundMap
(
disList
);
try
{
try
{
TSocialInfo
socialInfo
=
null
;
TProvidentFund
providentFund
=
null
;
TAuditInfo
auditInfo
=
null
;
StringBuilder
socialTypeRemark
=
new
StringBuilder
();
TSocialFundInfo
sf
=
null
;
Date
now
=
new
Date
();
StringBuilder
temp
=
new
StringBuilder
();
// 预估库同步社保还是公积金的标志,0:全部;1仅社保;2仅公积金
int
forecastFlag
=
CommonConstants
.
ZERO_INT
;
// auditFlag 表示社保办理无办理项是不保存
boolean
auditFlag
=
true
;
boolean
partSuccess
=
false
;
TDispatchSocialFundInfo
socialFundInfo
;
for
(
TDispatchInfo
dis
:
disList
)
{
for
(
TDispatchInfo
dis
:
disList
)
{
auditFlag
=
true
;
if
(
extracted
(
socialMap
,
fundMap
,
typeSub
,
user
,
flag
,
handleStatus
,
handleRemark
,
socialType
,
remark
,
isAutoHandle
,
errorList
,
socialFundMap
,
dis
))
if
(
CommonConstants
.
ZERO_STRING
.
equals
(
typeSub
))
{
forecastFlag
=
CommonConstants
.
ONE_INT
;
}
else
if
(
CommonConstants
.
ONE_STRING
.
equals
(
typeSub
))
{
forecastFlag
=
CommonConstants
.
TWO_INT
;
}
auditInfo
=
new
TAuditInfo
();
if
(
Common
.
isNotNull
(
socialFundMap
)){
sf
=
socialFundMap
.
get
(
dis
.
getEmpIdcard
());
}
if
(
Common
.
isEmpty
(
sf
)){
errorList
.
add
(
new
ErrorMessage
(-
1
,
"找不到员工社保公积金查询数据:"
+
dis
.
getEmpName
()));
continue
;
continue
;
}
}
partSuccess
=
Common
.
isNotNull
(
sf
)
&&
Common
.
isNotNull
(
dis
.
getSocialId
())
}
catch
(
Exception
e
){
&&
(
CommonConstants
.
ONE_STRING
.
equals
(
sf
.
getPensionHandle
())
log
.
error
(
DispatchConstants
.
DISPATCH_EXCEPTION
,
e
);
||
CommonConstants
.
ONE_STRING
.
equals
(
sf
.
getMedicalHandle
())
errorList
.
add
(
new
ErrorMessage
(-
1
,
DispatchConstants
.
DISPATCH_EXCEPTION
+
e
.
getMessage
()));
||
CommonConstants
.
ONE_STRING
.
equals
(
sf
.
getWorkInjuryHandle
())
return
errorList
;
||
CommonConstants
.
ONE_STRING
.
equals
(
sf
.
getBirthHandle
())
}
||
CommonConstants
.
ONE_STRING
.
equals
(
sf
.
getUnemployHandle
())
}
else
{
||
(
CommonConstants
.
ONE_STRING
.
equals
(
sf
.
getBigailmentHandle
())
errorList
.
add
(
new
ErrorMessage
(-
1
,
DispatchConstants
.
NO_OPERATOR_DATA
));
||
CommonConstants
.
FOUR_STRING
.
equals
(
sf
.
getPensionHandle
())
return
errorList
;
||
CommonConstants
.
FOUR_STRING
.
equals
(
sf
.
getMedicalHandle
())
}
||
CommonConstants
.
FOUR_STRING
.
equals
(
sf
.
getWorkInjuryHandle
())
return
errorList
;
||
CommonConstants
.
FOUR_STRING
.
equals
(
sf
.
getBirthHandle
())
}
||
CommonConstants
.
FOUR_STRING
.
equals
(
sf
.
getUnemployHandle
())
//代码优化-解决死锁问题:fxj 2024-12-18 事务控制集中到每次循环,而不是所有for循环 TODO参数过多需要二次优化
||
((
CommonConstants
.
ONE_STRING
.
equals
(
sf
.
getBigailmentHandle
())
@Override
||
CommonConstants
.
FOUR_STRING
.
equals
(
sf
.
getBigailmentHandle
()))
@Transactional
(
rollbackFor
=
Exception
.
class
)
&&
CommonConstants
.
ZERO_STRING
.
equals
(
sf
.
getIsIllness
()))
public
boolean
extracted
(
ConcurrentHashMap
<
String
,
String
>
socialMap
,
ConcurrentHashMap
<
String
,
String
>
fundMap
,
String
typeSub
,
YifuUser
user
,
int
flag
,
String
handleStatus
,
String
handleRemark
,
String
socialType
,
String
remark
,
boolean
isAutoHandle
,
List
<
ErrorMessage
>
errorList
,
Map
<
String
,
TSocialFundInfo
>
socialFundMap
,
TDispatchInfo
dis
)
{
))
TSocialInfo
socialInfo
=
null
;
&&
!((
CommonConstants
.
ONE_STRING
.
equals
(
sf
.
getPensionHandle
())
TProvidentFund
providentFund
=
null
;
||
CommonConstants
.
FOUR_STRING
.
equals
(
sf
.
getPensionHandle
()))
TAuditInfo
auditInfo
=
null
;
&&
(
CommonConstants
.
ONE_STRING
.
equals
(
sf
.
getMedicalHandle
())
StringBuilder
socialTypeRemark
=
new
StringBuilder
();
||
CommonConstants
.
FOUR_STRING
.
equals
(
sf
.
getMedicalHandle
()))
TSocialFundInfo
sf
=
null
;
&&
(
CommonConstants
.
ONE_STRING
.
equals
(
sf
.
getWorkInjuryHandle
())
Date
now
=
new
Date
();
||
CommonConstants
.
FOUR_STRING
.
equals
(
sf
.
getWorkInjuryHandle
()))
StringBuilder
temp
=
new
StringBuilder
();
&&
(
CommonConstants
.
ONE_STRING
.
equals
(
sf
.
getBirthHandle
())
// 预估库同步社保还是公积金的标志,0:全部;1仅社保;2仅公积金
||
CommonConstants
.
FOUR_STRING
.
equals
(
sf
.
getBirthHandle
()))
int
forecastFlag
=
CommonConstants
.
ZERO_INT
;
&&
(
CommonConstants
.
ONE_STRING
.
equals
(
sf
.
getUnemployHandle
())
// auditFlag 表示社保办理无办理项是不保存
||
CommonConstants
.
FOUR_STRING
.
equals
(
sf
.
getUnemployHandle
()))
boolean
auditFlag
=
true
;
&&
(
CommonConstants
.
ONE_STRING
.
equals
(
sf
.
getBigailmentHandle
())
boolean
partSuccess
=
false
;
||
CommonConstants
.
FOUR_STRING
.
equals
(
sf
.
getBigailmentHandle
())
TDispatchSocialFundInfo
socialFundInfo
;
||
Common
.
isEmpty
(
sf
.
getBigailmentHandle
()))
auditFlag
=
true
;
);
if
(
CommonConstants
.
ZERO_STRING
.
equals
(
typeSub
))
{
if
(!
CommonConstants
.
TWO_STRING
.
equals
(
dis
.
getStatus
()))
{
forecastFlag
=
CommonConstants
.
ONE_INT
;
errorList
.
add
(
new
ErrorMessage
(-
1
,
"已办理完结,请勿重复操作:"
+
dis
.
getEmpName
()));
}
else
if
(
CommonConstants
.
ONE_STRING
.
equals
(
typeSub
))
{
continue
;
forecastFlag
=
CommonConstants
.
TWO_INT
;
}
}
if
(
Common
.
isNotNull
(
dis
.
getSocialId
()))
{
auditInfo
=
new
TAuditInfo
();
// 无更新直接跳过
if
(
Common
.
isNotNull
(
socialFundMap
)){
if
(
Common
.
isEmpty
(
socialTypeRemark
)
sf
=
socialFundMap
.
get
(
dis
.
getEmpIdcard
());
&&
CommonConstants
.
ZERO_STRING
.
equals
(
typeSub
)
}
&&
Common
.
isEmpty
(
socialType
))
{
if
(
Common
.
isEmpty
(
sf
)){
continue
;
errorList
.
add
(
new
ErrorMessage
(-
1
,
"找不到员工社保公积金查询数据:"
+
dis
.
getEmpName
()));
}
return
true
;
socialInfo
=
socialMapper
.
selectById
(
dis
.
getSocialId
());
}
socialTypeRemark
=
getHandleRemark
(
socialType
,
socialInfo
,
dis
.
getType
(),
sf
);
partSuccess
=
Common
.
isNotNull
(
sf
)
&&
Common
.
isNotNull
(
dis
.
getSocialId
())
// 无更新直接跳过
&&
(
CommonConstants
.
ONE_STRING
.
equals
(
sf
.
getPensionHandle
())
if
(
Common
.
isEmpty
(
socialTypeRemark
.
toString
())
&&
CommonConstants
.
ZERO_STRING
.
equals
(
typeSub
))
{
||
CommonConstants
.
ONE_STRING
.
equals
(
sf
.
getMedicalHandle
())
continue
;
||
CommonConstants
.
ONE_STRING
.
equals
(
sf
.
getWorkInjuryHandle
())
||
CommonConstants
.
ONE_STRING
.
equals
(
sf
.
getBirthHandle
())
||
CommonConstants
.
ONE_STRING
.
equals
(
sf
.
getUnemployHandle
())
||
(
CommonConstants
.
ONE_STRING
.
equals
(
sf
.
getBigailmentHandle
())
||
CommonConstants
.
FOUR_STRING
.
equals
(
sf
.
getPensionHandle
())
||
CommonConstants
.
FOUR_STRING
.
equals
(
sf
.
getMedicalHandle
())
||
CommonConstants
.
FOUR_STRING
.
equals
(
sf
.
getWorkInjuryHandle
())
||
CommonConstants
.
FOUR_STRING
.
equals
(
sf
.
getBirthHandle
())
||
CommonConstants
.
FOUR_STRING
.
equals
(
sf
.
getUnemployHandle
())
||
((
CommonConstants
.
ONE_STRING
.
equals
(
sf
.
getBigailmentHandle
())
||
CommonConstants
.
FOUR_STRING
.
equals
(
sf
.
getBigailmentHandle
()))
&&
CommonConstants
.
ZERO_STRING
.
equals
(
sf
.
getIsIllness
()))
))
&&
!((
CommonConstants
.
ONE_STRING
.
equals
(
sf
.
getPensionHandle
())
||
CommonConstants
.
FOUR_STRING
.
equals
(
sf
.
getPensionHandle
()))
&&
(
CommonConstants
.
ONE_STRING
.
equals
(
sf
.
getMedicalHandle
())
||
CommonConstants
.
FOUR_STRING
.
equals
(
sf
.
getMedicalHandle
()))
&&
(
CommonConstants
.
ONE_STRING
.
equals
(
sf
.
getWorkInjuryHandle
())
||
CommonConstants
.
FOUR_STRING
.
equals
(
sf
.
getWorkInjuryHandle
()))
&&
(
CommonConstants
.
ONE_STRING
.
equals
(
sf
.
getBirthHandle
())
||
CommonConstants
.
FOUR_STRING
.
equals
(
sf
.
getBirthHandle
()))
&&
(
CommonConstants
.
ONE_STRING
.
equals
(
sf
.
getUnemployHandle
())
||
CommonConstants
.
FOUR_STRING
.
equals
(
sf
.
getUnemployHandle
()))
&&
(
CommonConstants
.
ONE_STRING
.
equals
(
sf
.
getBigailmentHandle
())
||
CommonConstants
.
FOUR_STRING
.
equals
(
sf
.
getBigailmentHandle
())
||
Common
.
isEmpty
(
sf
.
getBigailmentHandle
()))
);
if
(!
CommonConstants
.
TWO_STRING
.
equals
(
dis
.
getStatus
()))
{
errorList
.
add
(
new
ErrorMessage
(-
1
,
"已办理完结,请勿重复操作:"
+
dis
.
getEmpName
()));
return
true
;
}
if
(
Common
.
isNotNull
(
dis
.
getSocialId
()))
{
// 无更新直接跳过
if
(
Common
.
isEmpty
(
socialTypeRemark
)
&&
CommonConstants
.
ZERO_STRING
.
equals
(
typeSub
)
&&
Common
.
isEmpty
(
socialType
))
{
return
true
;
}
socialInfo
=
socialMapper
.
selectById
(
dis
.
getSocialId
());
socialTypeRemark
=
getHandleRemark
(
socialType
,
socialInfo
,
dis
.
getType
(),
sf
);
// 无更新直接跳过
if
(
Common
.
isEmpty
(
socialTypeRemark
.
toString
())
&&
CommonConstants
.
ZERO_STRING
.
equals
(
typeSub
))
{
return
true
;
}
}
else
{
socialInfo
=
null
;
}
if
(
Common
.
isNotNull
(
dis
.
getFundId
()))
{
providentFund
=
fundMapper
.
selectById
(
dis
.
getFundId
());
}
else
{
providentFund
=
null
;
}
//派增处理
if
(
CommonConstants
.
ZERO_STRING
.
equals
(
dis
.
getType
()))
{
//社保派增办理
if
(
CommonConstants
.
ZERO_STRING
.
equals
(
typeSub
))
{
if
(
Common
.
isNotNull
(
socialInfo
)
&&
Common
.
isNotNull
(
socialInfo
.
getId
()))
{
socialInfo
.
setHandleStatus
(
handleStatus
);
socialInfo
.
setHandleTime
(
now
);
socialInfo
.
setHandleUser
(
user
.
getId
());
socialInfo
.
setHandleUserName
(
user
.
getNickname
());
// 社保办理状态补充判断:
this
.
setSocialHandleStatus
(
handleStatus
,
socialType
,
flag
,
socialInfo
,
dis
,
sf
,
isAutoHandle
);
socialMapper
.
updateById
(
socialInfo
);
dis
.
setSocialHandleRemark
(
ServiceUtil
.
ifNullToEmpty
(
handleRemark
));
auditFlag
=
Common
.
isNotNull
(
Common
.
isNullToString
(
socialTypeRemark
));
if
(
auditFlag
){
auditInfo
.
setType
(
CommonConstants
.
ONE_STRING
);
if
(
CommonConstants
.
ZERO_INT
==
flag
)
{
temp
.
setLength
(
CommonConstants
.
ZERO_INT
);
temp
.
append
(
DispatchConstants
.
DISPATCH_SOCIAL_ADD
);
temp
.
append
(
Common
.
isNullToString
(
socialTypeRemark
));
temp
.
append
(
DispatchConstants
.
DISPATCH_HANDLE_SUCCESS
);
initAuditInfo
(
auditInfo
,
(
temp
+
ServiceUtil
.
ifNullToEmpty
(
handleRemark
)),
CommonConstants
.
THREE_STRING
,
user
,
temp
.
toString
().
concat
(
ServiceUtil
.
ifNullToEmpty
(
handleRemark
)),
remark
);
}
else
{
temp
.
setLength
(
CommonConstants
.
ZERO_INT
);
temp
.
append
(
DispatchConstants
.
DISPATCH_SOCIAL_ADD
);
temp
.
append
(
Common
.
isNullToString
(
socialTypeRemark
));
temp
.
append
(
DispatchConstants
.
DISPATCH_HANDLE_FAIL
);
initAuditInfo
(
auditInfo
,
(
temp
+
ServiceUtil
.
ifNullToEmpty
(
handleRemark
)),
CommonConstants
.
FOUR_STRING
,
user
,
temp
.
toString
().
concat
(
ServiceUtil
.
ifNullToEmpty
(
handleRemark
)),
remark
);
}
}
}
else
{
auditInfo
.
setSocialId
(
dis
.
getId
());
socialInfo
=
null
;
}
}
if
(
Common
.
isNotNull
(
dis
.
getFundId
()))
{
}
else
{
providentFund
=
fundMapper
.
selectById
(
dis
.
getFundId
());
errorList
.
add
(
new
ErrorMessage
(-
1
,
"找不到对应员工社保派增派单数据:"
+
dis
.
getEmpName
()));
}
else
{
return
true
;
providentFund
=
null
;
}
//公积金办理
}
else
if
(
CommonConstants
.
ONE_STRING
.
equals
(
typeSub
))
{
if
(
null
!=
providentFund
&&
Common
.
isNotNull
(
providentFund
.
getId
()))
{
// 办理状态(0待办理/1已办理2办理失败3已派减)
providentFund
.
setHandleStatus
(
handleStatus
);
providentFund
.
setHandleTime
(
now
);
providentFund
.
setHandleUser
(
user
.
getId
());
providentFund
.
setHandleUserName
(
user
.
getNickname
());
dis
.
setFundHandleStatus
(
handleStatus
);
if
(
CommonConstants
.
dingleDigitStrArray
[
0
].
equals
(
dis
.
getType
())
&&
CommonConstants
.
ZERO_INT
==
flag
)
{
//派增办理通过 改成可派减状态
providentFund
.
setReduceCan
(
CommonConstants
.
dingleDigitStrArray
[
0
]);
sf
.
setFundAddStatus
(
CommonConstants
.
TWO_STRING
);
sf
.
setFundStatus
(
CommonConstants
.
THREE_STRING
);
}
else
if
(
CommonConstants
.
dingleDigitStrArray
[
0
].
equals
(
dis
.
getType
())
&&
CommonConstants
.
ONE_INT
==
flag
)
{
//派增办理不通过 改成不可派减状态
providentFund
.
setReduceCan
(
CommonConstants
.
dingleDigitStrArray
[
1
]);
sf
.
setFundAddStatus
(
CommonConstants
.
THREE_STRING
);
sf
.
setFundStatus
(
CommonConstants
.
FOUR_STRING
);
}
}
//派增处理
fundMapper
.
updateById
(
providentFund
);
if
(
CommonConstants
.
ZERO_STRING
.
equals
(
dis
.
getType
()))
{
//公积金办理成功增加收入
//社保派增办理
if
(
Common
.
isNotNull
(
dis
.
getFundId
())
&&
if
(
CommonConstants
.
ZERO_STRING
.
equals
(
typeSub
))
{
CommonConstants
.
THREE_STRING
.
equals
(
sf
.
getFundStatus
())){
if
(
Common
.
isNotNull
(
socialInfo
)
&&
Common
.
isNotNull
(
socialInfo
.
getId
()))
{
int
monthDiff
;
socialInfo
.
setHandleStatus
(
handleStatus
);
// 获取最小的起缴月
socialInfo
.
setHandleTime
(
now
);
Date
minStartDate
=
this
.
getMinDate
(
sf
);
socialInfo
.
setHandleUser
(
user
.
getId
());
// 再计算月份
socialInfo
.
setHandleUserName
(
user
.
getNickname
());
monthDiff
=
DateUtil
.
getMonthDiff
(
minStartDate
,
new
Date
())
+
2
;
List
<
TForecastLibrary
>
libraryFundInfoList
;
// 社保办理状态补充判断:
for
(
int
i
=
0
;
i
<
monthDiff
;
i
++)
{
this
.
setSocialHandleStatus
(
handleStatus
,
socialType
,
flag
,
socialInfo
,
dis
,
sf
,
isAutoHandle
);
//获取所有的预估数据
//List<TForecastLibrary> libraryFundInfoList1 = new ArrayList<>();
socialMapper
.
updateById
(
socialInfo
);
libraryFundInfoList
=
forecastLibraryService
.
list
(
Wrappers
.<
TForecastLibrary
>
query
().
lambda
()
dis
.
setSocialHandleRemark
(
ServiceUtil
.
ifNullToEmpty
(
handleRemark
));
.
eq
(
TForecastLibrary:
:
getEmpIdcard
,
sf
.
getEmpIdcard
())
auditFlag
=
Common
.
isNotNull
(
Common
.
isNullToString
(
socialTypeRemark
));
.
eq
(
TForecastLibrary:
:
getDataType
,
CommonConstants
.
ONE_INT
)
if
(
auditFlag
){
.
eq
(
TForecastLibrary:
:
getSettleDomainId
,
sf
.
getSettleDomainFund
())
auditInfo
.
setType
(
CommonConstants
.
ONE_STRING
);
.
eq
(
TForecastLibrary:
:
getProvidentPayMonth
,
DateUtil
.
addMonth
(
1
-
i
)));
if
(
CommonConstants
.
ZERO_INT
==
flag
)
{
if
(
Common
.
isNotNull
(
libraryFundInfoList
))
{
temp
.
setLength
(
CommonConstants
.
ZERO_INT
);
for
(
TForecastLibrary
library
:
libraryFundInfoList
)
{
temp
.
append
(
DispatchConstants
.
DISPATCH_SOCIAL_ADD
);
//办理成功生成收入
temp
.
append
(
Common
.
isNullToString
(
socialTypeRemark
));
if
(
Common
.
isNotNull
(
library
.
getDataPush
())){
temp
.
append
(
DispatchConstants
.
DISPATCH_HANDLE_SUCCESS
);
socialTask
.
asynchronousDisPatchHandleForDispatch
(
library
,
CommonConstants
.
ZERO_INT
==
library
.
getDataPush
().
intValue
());
initAuditInfo
(
auditInfo
,
(
temp
+
ServiceUtil
.
ifNullToEmpty
(
handleRemark
)),
CommonConstants
.
THREE_STRING
,
user
,
temp
.
toString
().
concat
(
ServiceUtil
.
ifNullToEmpty
(
handleRemark
)),
remark
);
}
else
{
temp
.
setLength
(
CommonConstants
.
ZERO_INT
);
temp
.
append
(
DispatchConstants
.
DISPATCH_SOCIAL_ADD
);
temp
.
append
(
Common
.
isNullToString
(
socialTypeRemark
));
temp
.
append
(
DispatchConstants
.
DISPATCH_HANDLE_FAIL
);
initAuditInfo
(
auditInfo
,
(
temp
+
ServiceUtil
.
ifNullToEmpty
(
handleRemark
)),
CommonConstants
.
FOUR_STRING
,
user
,
temp
.
toString
().
concat
(
ServiceUtil
.
ifNullToEmpty
(
handleRemark
)),
remark
);
}
}
auditInfo
.
setSocialId
(
dis
.
getId
());
}
}
}
else
{
errorList
.
add
(
new
ErrorMessage
(-
1
,
"找不到对应员工社保派增派单数据:"
+
dis
.
getEmpName
()));
continue
;
}
//公积金办理
}
else
if
(
CommonConstants
.
ONE_STRING
.
equals
(
typeSub
))
{
if
(
null
!=
providentFund
&&
Common
.
isNotNull
(
providentFund
.
getId
()))
{
// 办理状态(0待办理/1已办理2办理失败3已派减)
providentFund
.
setHandleStatus
(
handleStatus
);
providentFund
.
setHandleTime
(
now
);
providentFund
.
setHandleUser
(
user
.
getId
());
providentFund
.
setHandleUserName
(
user
.
getNickname
());
dis
.
setFundHandleStatus
(
handleStatus
);
if
(
CommonConstants
.
dingleDigitStrArray
[
0
].
equals
(
dis
.
getType
())
&&
CommonConstants
.
ZERO_INT
==
flag
)
{
//派增办理通过 改成可派减状态
providentFund
.
setReduceCan
(
CommonConstants
.
dingleDigitStrArray
[
0
]);
sf
.
setFundAddStatus
(
CommonConstants
.
TWO_STRING
);
sf
.
setFundStatus
(
CommonConstants
.
THREE_STRING
);
}
else
if
(
CommonConstants
.
dingleDigitStrArray
[
0
].
equals
(
dis
.
getType
())
&&
CommonConstants
.
ONE_INT
==
flag
)
{
//派增办理不通过 改成不可派减状态
providentFund
.
setReduceCan
(
CommonConstants
.
dingleDigitStrArray
[
1
]);
sf
.
setFundAddStatus
(
CommonConstants
.
THREE_STRING
);
sf
.
setFundStatus
(
CommonConstants
.
FOUR_STRING
);
}
fundMapper
.
updateById
(
providentFund
);
//公积金办理成功增加收入
if
(
Common
.
isNotNull
(
dis
.
getFundId
())
&&
CommonConstants
.
THREE_STRING
.
equals
(
sf
.
getFundStatus
())){
int
monthDiff
;
// 获取最小的起缴月
Date
minStartDate
=
this
.
getMinDate
(
sf
);
// 再计算月份
monthDiff
=
DateUtil
.
getMonthDiff
(
minStartDate
,
new
Date
())
+
2
;
List
<
TForecastLibrary
>
libraryFundInfoList
;
for
(
int
i
=
0
;
i
<
monthDiff
;
i
++)
{
//获取所有的预估数据
//List<TForecastLibrary> libraryFundInfoList1 = new ArrayList<>();
libraryFundInfoList
=
forecastLibraryService
.
list
(
Wrappers
.<
TForecastLibrary
>
query
().
lambda
()
.
eq
(
TForecastLibrary:
:
getEmpIdcard
,
sf
.
getEmpIdcard
())
.
eq
(
TForecastLibrary:
:
getDataType
,
CommonConstants
.
ONE_INT
)
.
eq
(
TForecastLibrary:
:
getSettleDomainId
,
sf
.
getSettleDomainFund
())
.
eq
(
TForecastLibrary:
:
getProvidentPayMonth
,
DateUtil
.
addMonth
(
1
-
i
)));
if
(
Common
.
isNotNull
(
libraryFundInfoList
))
{
for
(
TForecastLibrary
library
:
libraryFundInfoList
)
{
//办理成功生成收入
if
(
Common
.
isNotNull
(
library
.
getDataPush
())){
socialTask
.
asynchronousDisPatchHandleForDispatch
(
library
,
CommonConstants
.
ZERO_INT
==
library
.
getDataPush
().
intValue
());
}
}
}
}
}
dis
.
setFundHandleRemark
(
ServiceUtil
.
ifNullToEmpty
(
handleRemark
));
if
(
CommonConstants
.
ZERO_INT
==
flag
)
{
initAuditInfo
(
auditInfo
,
(
DispatchConstants
.
DISPATCH_FUND_ADD_SUCCESS
+
handleRemark
),
CommonConstants
.
THREE_STRING
,
user
,
(
DispatchConstants
.
DISPATCH_FUND_ADD_SUCCESS
+
handleRemark
),
remark
);
}
else
{
initAuditInfo
(
auditInfo
,
(
DispatchConstants
.
DISPATCH_FUND_ADD_FAIL
+
handleRemark
),
CommonConstants
.
FOUR_STRING
,
user
,
(
DispatchConstants
.
DISPATCH_FUND_ADD_FAIL
+
handleRemark
),
remark
);
}
auditInfo
.
setProvidentId
(
dis
.
getId
());
}
else
{
errorList
.
add
(
new
ErrorMessage
(-
1
,
"找不到对应员工公积金派增派单数据:"
+
dis
.
getEmpName
()));
continue
;
}
}
//派减处理
}
else
if
(
CommonConstants
.
ONE_STRING
.
equals
(
dis
.
getType
()))
{
//社保派减办理
if
(
CommonConstants
.
ZERO_STRING
.
equals
(
typeSub
))
{
if
(
Common
.
isNotNull
(
socialInfo
)
&&
Common
.
isNotNull
(
socialInfo
.
getId
()))
{
// 社保办理状态补充判断:
this
.
setSocialHandleStatus
(
handleStatus
,
socialType
,
flag
,
socialInfo
,
dis
,
sf
,
isAutoHandle
);
socialInfo
.
setReduceHandleUser
(
user
.
getId
());
socialInfo
.
setReduceHandleTime
(
now
);
//社保派减办理成功才变更社保的办理状态
socialInfo
.
setHandleTime
(
now
);
socialInfo
.
setHandleUser
(
user
.
getId
());
socialInfo
.
setHandleUserName
(
user
.
getNickname
());
socialMapper
.
updateById
(
socialInfo
);
dis
.
setSocialHandleRemark
(
ServiceUtil
.
ifNullToEmpty
(
handleRemark
));
auditInfo
=
new
TAuditInfo
();
auditInfo
.
setType
(
CommonConstants
.
ONE_STRING
);
if
(
CommonConstants
.
ZERO_INT
==
flag
)
{
temp
.
setLength
(
CommonConstants
.
ZERO_INT
);
temp
.
append
(
DispatchConstants
.
DISPATCH_SOCIAL_REDUCE
);
temp
.
append
(
Common
.
isNullToString
(
socialTypeRemark
));
temp
.
append
(
DispatchConstants
.
DISPATCH_HANDLE_SUCCESS
);
temp
.
append
(
ServiceUtil
.
ifNullToEmpty
(
handleRemark
));
initAuditInfo
(
auditInfo
,
temp
.
toString
(),
CommonConstants
.
THREE_STRING
,
user
,
temp
.
toString
(),
remark
);
}
else
{
temp
.
setLength
(
CommonConstants
.
ZERO_INT
);
temp
.
append
(
DispatchConstants
.
DISPATCH_SOCIAL_REDUCE
);
temp
.
append
(
Common
.
isNullToString
(
socialTypeRemark
));
temp
.
append
(
DispatchConstants
.
DISPATCH_HANDLE_FAIL
);
temp
.
append
(
ServiceUtil
.
ifNullToEmpty
(
handleRemark
));
initAuditInfo
(
auditInfo
,
temp
.
toString
(),
CommonConstants
.
FOUR_STRING
,
user
,
temp
.
toString
(),
remark
);
}
auditInfo
.
setSocialId
(
dis
.
getId
());
}
else
{
errorList
.
add
(
new
ErrorMessage
(-
1
,
"找不到对应员工社保数据:"
+
dis
.
getEmpName
()));
continue
;
}
//公积金派减办理
}
else
if
(
CommonConstants
.
ONE_STRING
.
equals
(
typeSub
))
{
if
(
Common
.
isNotNull
(
providentFund
)
&&
Common
.
isNotNull
(
providentFund
.
getId
()))
{
//公积金派减办理成功才变更公积金的办理状态
if
(
CommonConstants
.
ZERO_INT
==
flag
)
{
providentFund
.
setHandleStatus
(
CommonConstants
.
THREE_STRING
);
providentFund
.
setReduceHandleTime
(
now
);
providentFund
.
setReduceHandleUser
(
user
.
getId
());
if
(
Common
.
isNotNull
(
dis
.
getFundReduceDate
()))
{
providentFund
.
setFundReduceDate
(
dis
.
getFundReduceDate
());
sf
.
setFundReduceDate
(
dis
.
getFundReduceDate
());
}
sf
.
setFundReduceStatus
(
CommonConstants
.
TWO_STRING
);
sf
.
setFundStatus
(
CommonConstants
.
SEVEN_STRING
);
}
if
(
CommonConstants
.
ONE_INT
==
flag
)
{
//派减办理不通过
providentFund
.
setReduceCan
(
CommonConstants
.
dingleDigitStrArray
[
0
]);
//改成可派减状态
sf
.
setFundReduceStatus
(
CommonConstants
.
THREE_STRING
);
sf
.
setFundStatus
(
CommonConstants
.
EIGHT_STRING
);
sf
.
setFundReduceDate
(
null
);
}
providentFund
.
setHandleTime
(
now
);
providentFund
.
setHandleUser
(
user
.
getId
());
providentFund
.
setHandleUserName
(
user
.
getNickname
());
fundMapper
.
updateFundInfoById
(
providentFund
);
dis
.
setFundHandleRemark
(
ServiceUtil
.
ifNullToEmpty
(
handleRemark
));
if
(
CommonConstants
.
ZERO_INT
==
flag
)
{
initAuditInfo
(
auditInfo
,
(
DispatchConstants
.
DISPATCH_FUND_REDUCE_SUCCESS
+
handleRemark
),
CommonConstants
.
SIX_STRING
,
user
,
(
DispatchConstants
.
DISPATCH_FUND_REDUCE_SUCCESS
+
handleRemark
),
remark
);
dis
.
setFundHandleStatus
(
CommonConstants
.
ONE_STRING
);
}
else
{
initAuditInfo
(
auditInfo
,
(
DispatchConstants
.
DISPATCH_FUND_REDUCE_FAIL
+
handleRemark
),
CommonConstants
.
FOUR_STRING
,
user
,
(
DispatchConstants
.
DISPATCH_FUND_REDUCE_SUCCESS
+
handleRemark
),
remark
);
dis
.
setFundHandleStatus
(
CommonConstants
.
TWO_STRING
);
}
auditInfo
.
setProvidentId
(
dis
.
getId
());
}
else
{
errorList
.
add
(
new
ErrorMessage
(-
1
,
"找不到对应员工公积金数据:"
+
dis
.
getEmpName
()));
continue
;
}
}
}
}
}
}
//更新派单状态
dis
.
setFundHandleRemark
(
ServiceUtil
.
ifNullToEmpty
(
handleRemark
));
if
(
Common
.
isNotNull
(
auditInfo
))
{
if
(
CommonConstants
.
ZERO_INT
==
flag
)
{
//派增判断
initAuditInfo
(
auditInfo
,
(
DispatchConstants
.
DISPATCH_FUND_ADD_SUCCESS
+
handleRemark
),
CommonConstants
.
THREE_STRING
,
user
,
(
DispatchConstants
.
DISPATCH_FUND_ADD_SUCCESS
+
handleRemark
),
remark
);
if
(
CommonConstants
.
ZERO_STRING
.
equals
(
dis
.
getType
()))
{
}
else
{
if
(
Common
.
isNotNull
(
dis
.
getSocialHandleStatus
())
initAuditInfo
(
auditInfo
,
(
DispatchConstants
.
DISPATCH_FUND_ADD_FAIL
+
handleRemark
),
CommonConstants
.
FOUR_STRING
,
user
,
(
DispatchConstants
.
DISPATCH_FUND_ADD_FAIL
+
handleRemark
),
remark
);
&&
Common
.
isNotNull
(
dis
.
getFundHandleStatus
())
}
&&
(
CommonConstants
.
ONE_STRING
.
equals
(
dis
.
getSocialHandleStatus
())
auditInfo
.
setProvidentId
(
dis
.
getId
());
||
CommonConstants
.
TWO_STRING
.
equals
(
dis
.
getSocialHandleStatus
())
}
else
{
||
CommonConstants
.
THREE_STRING
.
equals
(
dis
.
getSocialHandleStatus
()))
errorList
.
add
(
new
ErrorMessage
(-
1
,
"找不到对应员工公积金派增派单数据:"
+
dis
.
getEmpName
()));
&&
(
CommonConstants
.
ONE_STRING
.
equals
(
dis
.
getFundHandleStatus
())
return
true
;
||
CommonConstants
.
TWO_STRING
.
equals
(
dis
.
getFundHandleStatus
())))
{
}
//办理成功
}
dis
.
setStatus
(
CommonConstants
.
FOUR_STRING
);
//派减处理
}
}
else
if
(
CommonConstants
.
ONE_STRING
.
equals
(
dis
.
getType
()))
{
if
(
Common
.
isEmpty
(
dis
.
getSocialHandleStatus
())
//社保派减办理
&&
(
CommonConstants
.
ONE_STRING
.
equals
(
dis
.
getFundHandleStatus
())
if
(
CommonConstants
.
ZERO_STRING
.
equals
(
typeSub
))
{
||
CommonConstants
.
TWO_STRING
.
equals
(
dis
.
getFundHandleStatus
())))
{
if
(
Common
.
isNotNull
(
socialInfo
)
&&
Common
.
isNotNull
(
socialInfo
.
getId
()))
{
//办理成功
// 社保办理状态补充判断:
dis
.
setStatus
(
CommonConstants
.
FOUR_STRING
);
this
.
setSocialHandleStatus
(
handleStatus
,
socialType
,
flag
,
socialInfo
,
dis
,
sf
,
isAutoHandle
);
}
if
((
CommonConstants
.
ONE_STRING
.
equals
(
dis
.
getSocialHandleStatus
())
socialInfo
.
setReduceHandleUser
(
user
.
getId
());
||
CommonConstants
.
TWO_STRING
.
equals
(
dis
.
getSocialHandleStatus
())
socialInfo
.
setReduceHandleTime
(
now
);
||
CommonConstants
.
THREE_STRING
.
equals
(
dis
.
getSocialHandleStatus
()))
//社保派减办理成功才变更社保的办理状态
&&
Common
.
isEmpty
(
dis
.
getFundHandleStatus
()))
{
socialInfo
.
setHandleTime
(
now
);
//办理成功
socialInfo
.
setHandleUser
(
user
.
getId
());
dis
.
setStatus
(
CommonConstants
.
FOUR_STRING
);
socialInfo
.
setHandleUserName
(
user
.
getNickname
());
}
socialMapper
.
updateById
(
socialInfo
);
//派减判断
dis
.
setSocialHandleRemark
(
ServiceUtil
.
ifNullToEmpty
(
handleRemark
));
}
else
if
(
CommonConstants
.
ONE_STRING
.
equals
(
dis
.
getType
()))
{
auditInfo
=
new
TAuditInfo
();
if
(
Common
.
isNotNull
(
dis
.
getSocialId
())
auditInfo
.
setType
(
CommonConstants
.
ONE_STRING
);
&&
Common
.
isNotNull
(
dis
.
getFundId
())
if
(
CommonConstants
.
ZERO_INT
==
flag
)
{
&&
(
CommonConstants
.
ONE_STRING
.
equals
(
dis
.
getSocialHandleStatus
())
temp
.
setLength
(
CommonConstants
.
ZERO_INT
);
||
CommonConstants
.
TWO_STRING
.
equals
(
dis
.
getSocialHandleStatus
())
temp
.
append
(
DispatchConstants
.
DISPATCH_SOCIAL_REDUCE
);
||
CommonConstants
.
THREE_STRING
.
equals
(
dis
.
getSocialHandleStatus
()))
temp
.
append
(
Common
.
isNullToString
(
socialTypeRemark
));
&&
(
CommonConstants
.
ONE_STRING
.
equals
(
dis
.
getFundHandleStatus
())
temp
.
append
(
DispatchConstants
.
DISPATCH_HANDLE_SUCCESS
);
||
CommonConstants
.
TWO_STRING
.
equals
(
dis
.
getFundHandleStatus
())))
{
temp
.
append
(
ServiceUtil
.
ifNullToEmpty
(
handleRemark
));
//办理成功
initAuditInfo
(
auditInfo
,
temp
.
toString
(),
CommonConstants
.
THREE_STRING
,
user
,
temp
.
toString
(),
remark
);
dis
.
setStatus
(
CommonConstants
.
FOUR_STRING
);
}
else
{
}
temp
.
setLength
(
CommonConstants
.
ZERO_INT
);
if
(
Common
.
isEmpty
(
dis
.
getSocialId
())
&&
Common
.
isNotNull
(
dis
.
getFundId
())
temp
.
append
(
DispatchConstants
.
DISPATCH_SOCIAL_REDUCE
);
&&
(
CommonConstants
.
ONE_STRING
.
equals
(
dis
.
getFundHandleStatus
())
temp
.
append
(
Common
.
isNullToString
(
socialTypeRemark
));
||
CommonConstants
.
TWO_STRING
.
equals
(
dis
.
getFundHandleStatus
())))
{
temp
.
append
(
DispatchConstants
.
DISPATCH_HANDLE_FAIL
);
//办理成功
temp
.
append
(
ServiceUtil
.
ifNullToEmpty
(
handleRemark
));
dis
.
setStatus
(
CommonConstants
.
FOUR_STRING
);
initAuditInfo
(
auditInfo
,
temp
.
toString
(),
CommonConstants
.
FOUR_STRING
,
user
,
temp
.
toString
(),
remark
);
}
}
if
(
Common
.
isEmpty
(
dis
.
getFundId
())
&&
Common
.
isNotNull
(
dis
.
getSocialId
())
auditInfo
.
setSocialId
(
dis
.
getId
());
&&(
CommonConstants
.
ONE_STRING
.
equals
(
dis
.
getSocialHandleStatus
())
}
else
{
||
CommonConstants
.
TWO_STRING
.
equals
(
dis
.
getSocialHandleStatus
())
errorList
.
add
(
new
ErrorMessage
(-
1
,
"找不到对应员工社保数据:"
+
dis
.
getEmpName
()));
||
CommonConstants
.
THREE_STRING
.
equals
(
dis
.
getSocialHandleStatus
())))
{
return
true
;
//办理成功
}
dis
.
setStatus
(
CommonConstants
.
FOUR_STRING
);
//公积金派减办理
}
}
else
if
(
CommonConstants
.
ONE_STRING
.
equals
(
typeSub
))
{
}
if
(
Common
.
isNotNull
(
providentFund
)
&&
Common
.
isNotNull
(
providentFund
.
getId
()))
{
dis
.
setHandleRemark
(
ServiceUtil
.
ifNullToEmpty
(
handleRemark
));
//公积金派减办理成功才变更公积金的办理状态
//新增办理记录信息
if
(
CommonConstants
.
ZERO_INT
==
flag
)
{
auditInfo
.
setDispatchInfoId
(
dis
.
getId
());
providentFund
.
setHandleStatus
(
CommonConstants
.
THREE_STRING
);
auditInfo
.
setEmpIdcard
(
dis
.
getEmpIdcard
());
providentFund
.
setReduceHandleTime
(
now
);
if
(
auditFlag
){
providentFund
.
setReduceHandleUser
(
user
.
getId
());
auditInfoMapper
.
insert
(
auditInfo
);
if
(
Common
.
isNotNull
(
dis
.
getFundReduceDate
()))
{
}
providentFund
.
setFundReduceDate
(
dis
.
getFundReduceDate
());
baseMapper
.
updateById
(
dis
);
sf
.
setFundReduceDate
(
dis
.
getFundReduceDate
());
//v1.8.9更新社保公积金缴纳地和户数据
socialFundMapper
.
updateById
(
sf
);
//派减的申请审核完更新社保公积金查询快照表
if
(
CommonConstants
.
ONE_STRING
.
equals
(
dis
.
getType
()))
{
socialFundInfo
=
infoService
.
getOne
(
Wrappers
.<
TDispatchSocialFundInfo
>
query
().
lambda
()
.
eq
(
TDispatchSocialFundInfo:
:
getReduceSocialFundId
,
dis
.
getId
())
.
last
(
CommonConstants
.
LAST_ONE_SQL
));
if
(
Common
.
isNotNull
(
socialFundInfo
))
{
String
reduceSocialFundId
=
socialFundInfo
.
getReduceSocialFundId
();
String
id
=
socialFundInfo
.
getId
();
BeanUtils
.
copyProperties
(
sf
,
socialFundInfo
);
socialFundInfo
.
setId
(
id
);
socialFundInfo
.
setReduceSocialFundId
(
reduceSocialFundId
);
infoService
.
updateById
(
socialFundInfo
);
}
}
}
sf
.
setFundReduceStatus
(
CommonConstants
.
TWO_STRING
);
sf
.
setFundStatus
(
CommonConstants
.
SEVEN_STRING
);
}
if
(
CommonConstants
.
ONE_INT
==
flag
)
{
//派减办理不通过
providentFund
.
setReduceCan
(
CommonConstants
.
dingleDigitStrArray
[
0
]);
//改成可派减状态
sf
.
setFundReduceStatus
(
CommonConstants
.
THREE_STRING
);
sf
.
setFundStatus
(
CommonConstants
.
EIGHT_STRING
);
sf
.
setFundReduceDate
(
null
);
}
providentFund
.
setHandleTime
(
now
);
providentFund
.
setHandleUser
(
user
.
getId
());
providentFund
.
setHandleUserName
(
user
.
getNickname
());
fundMapper
.
updateFundInfoById
(
providentFund
);
dis
.
setFundHandleRemark
(
ServiceUtil
.
ifNullToEmpty
(
handleRemark
));
if
(
CommonConstants
.
ZERO_INT
==
flag
)
{
initAuditInfo
(
auditInfo
,
(
DispatchConstants
.
DISPATCH_FUND_REDUCE_SUCCESS
+
handleRemark
),
CommonConstants
.
SIX_STRING
,
user
,
(
DispatchConstants
.
DISPATCH_FUND_REDUCE_SUCCESS
+
handleRemark
),
remark
);
dis
.
setFundHandleStatus
(
CommonConstants
.
ONE_STRING
);
}
else
{
initAuditInfo
(
auditInfo
,
(
DispatchConstants
.
DISPATCH_FUND_REDUCE_FAIL
+
handleRemark
),
CommonConstants
.
FOUR_STRING
,
user
,
(
DispatchConstants
.
DISPATCH_FUND_REDUCE_SUCCESS
+
handleRemark
),
remark
);
dis
.
setFundHandleStatus
(
CommonConstants
.
TWO_STRING
);
}
auditInfo
.
setProvidentId
(
dis
.
getId
());
}
else
{
errorList
.
add
(
new
ErrorMessage
(-
1
,
"找不到对应员工公积金数据:"
+
dis
.
getEmpName
()));
return
true
;
}
}
//1.派增办理失败 刷新预估数据
}
if
(
CommonConstants
.
ZERO_STRING
.
equals
(
dis
.
getType
()))
{
//更新派单状态
// 全部办理失败 社保和公积金派增办理失败 减少预估
if
(
Common
.
isNotNull
(
auditInfo
))
{
if
(
CommonConstants
.
ONE_INT
==
flag
//派增判断
&&
(
CommonConstants
.
FIVE_STRING
.
equals
(
sf
.
getSocialStatus
())
if
(
CommonConstants
.
ZERO_STRING
.
equals
(
dis
.
getType
()))
{
||
CommonConstants
.
FOUR_STRING
.
equals
(
sf
.
getFundStatus
())))
{
if
(
Common
.
isNotNull
(
dis
.
getSocialHandleStatus
())
// 派增办理,全部失败 同步预估库数据
&&
Common
.
isNotNull
(
dis
.
getFundHandleStatus
())
socialTask
.
asynchronousDisPatchHandle
(
socialMap
,
fundMap
,
sf
,
forecastFlag
,
null
,
null
,
CommonConstants
.
ZERO_INT
);
&&
(
CommonConstants
.
ONE_STRING
.
equals
(
dis
.
getSocialHandleStatus
())
}
||
CommonConstants
.
TWO_STRING
.
equals
(
dis
.
getSocialHandleStatus
())
// 社保办理只要办理成功就刷新预估数据 公积金办理不用处理(前面公积金办理成功的时候处理过了)
||
CommonConstants
.
THREE_STRING
.
equals
(
dis
.
getSocialHandleStatus
()))
if
(
CommonConstants
.
ZERO_STRING
.
equals
(
typeSub
)
&&
(
CommonConstants
.
ONE_STRING
.
equals
(
dis
.
getFundHandleStatus
())
&&
(
Common
.
isNotNull
(
dis
.
getSocialId
())
||
CommonConstants
.
TWO_STRING
.
equals
(
dis
.
getFundHandleStatus
())))
{
&&
CommonConstants
.
FOUR_STRING
.
equals
(
sf
.
getSocialStatus
())
//办理成功
||
CommonConstants
.
THREE_STRING
.
equals
(
sf
.
getSocialStatus
())))
{
dis
.
setStatus
(
CommonConstants
.
FOUR_STRING
);
if
(
partSuccess
)
{
}
forecastLibraryService
.
updateForecastLibaryByDispatch
(
socialMap
,
fundMap
,
sf
);
if
(
Common
.
isEmpty
(
dis
.
getSocialHandleStatus
())
}
else
{
&&
(
CommonConstants
.
ONE_STRING
.
equals
(
dis
.
getFundHandleStatus
())
socialTask
.
asynchronousDisPatchHandle
(
socialMap
,
fundMap
,
sf
,
0
,
null
,
null
,
CommonConstants
.
ONE_INT
);
||
CommonConstants
.
TWO_STRING
.
equals
(
dis
.
getFundHandleStatus
())))
{
}
//办理成功
}
dis
.
setStatus
(
CommonConstants
.
FOUR_STRING
);
}
}
// 2.派减办理成功 处理预估 (不管社保还是公积金办理失败)
if
((
CommonConstants
.
ONE_STRING
.
equals
(
dis
.
getSocialHandleStatus
())
if
(
CommonConstants
.
ONE_STRING
.
equals
(
dis
.
getType
())
||
CommonConstants
.
TWO_STRING
.
equals
(
dis
.
getSocialHandleStatus
())
&&
CommonConstants
.
ZERO_INT
==
flag
||
CommonConstants
.
THREE_STRING
.
equals
(
dis
.
getSocialHandleStatus
()))
&&
(
CommonConstants
.
EIGHT_STRING
.
equals
(
sf
.
getSocialStatus
())
&&
Common
.
isEmpty
(
dis
.
getFundHandleStatus
()))
{
||
CommonConstants
.
SEVEN_STRING
.
equals
(
sf
.
getFundStatus
()))){
//办理成功
// 同步预估库数据
dis
.
setStatus
(
CommonConstants
.
FOUR_STRING
);
socialTask
.
asynchronousDisPatchHandle
(
socialMap
,
fundMap
,
sf
,
forecastFlag
,
null
,
null
,
CommonConstants
.
ZERO_INT
);
}
}
//派减判断
//社保公积金派减办理成功
}
else
if
(
CommonConstants
.
ONE_STRING
.
equals
(
dis
.
getType
()))
{
if
((
CommonConstants
.
ONE_STRING
.
equals
(
dis
.
getType
())
&&
CommonConstants
.
ZERO_INT
==
flag
if
(
Common
.
isNotNull
(
dis
.
getSocialId
())
&&
CommonConstants
.
EIGHT_STRING
.
equals
(
sf
.
getSocialStatus
())
&&
Common
.
isNotNull
(
dis
.
getFundId
())
&&
(
CommonConstants
.
SEVEN_STRING
.
equals
(
sf
.
getFundStatus
())
&&
(
CommonConstants
.
ONE_STRING
.
equals
(
dis
.
getSocialHandleStatus
())
||
Common
.
isEmpty
(
sf
.
getFundStatus
())))
||
||
CommonConstants
.
TWO_STRING
.
equals
(
dis
.
getSocialHandleStatus
())
(
CommonConstants
.
ZERO_STRING
.
equals
(
dis
.
getType
())
&&
CommonConstants
.
ONE_INT
==
flag
&&
||
CommonConstants
.
THREE_STRING
.
equals
(
dis
.
getSocialHandleStatus
()))
CommonConstants
.
EIGHT_STRING
.
equals
(
sf
.
getSocialStatus
())
&&
(
CommonConstants
.
ONE_STRING
.
equals
(
dis
.
getFundHandleStatus
())
&&
(
CommonConstants
.
FOUR_STRING
.
equals
(
sf
.
getFundStatus
())
||
CommonConstants
.
TWO_STRING
.
equals
(
dis
.
getFundHandleStatus
())))
{
||
CommonConstants
.
NINE_STRING
.
equals
(
sf
.
getFundStatus
()))))
{
//办理成功
UpProjectSocialFundVo
vo
=
new
UpProjectSocialFundVo
();
dis
.
setStatus
(
CommonConstants
.
FOUR_STRING
);
// 社保状态 社保状态(字典): 0 无社保 1 处理中 2.部分购买 3.正常 4.已派减
}
initSocialFundStatus
(
socialInfo
,
providentFund
,
vo
,
sf
);
if
(
Common
.
isEmpty
(
dis
.
getSocialId
())
&&
Common
.
isNotNull
(
dis
.
getFundId
())
vo
.
setEmpIdCard
(
dis
.
getEmpIdcard
());
&&
(
CommonConstants
.
ONE_STRING
.
equals
(
dis
.
getFundHandleStatus
())
vo
.
setDepartNo
(
dis
.
getSettleDomainCode
());
||
CommonConstants
.
TWO_STRING
.
equals
(
dis
.
getFundHandleStatus
())))
{
if
(
Common
.
isNotNull
(
dis
.
getChangeContractAndEmployee
())
//办理成功
&&
CommonConstants
.
ZERO_STRING
.
equals
(
dis
.
getChangeContractAndEmployee
())
dis
.
setStatus
(
CommonConstants
.
FOUR_STRING
);
&&
(
Common
.
isNotNull
(
vo
.
getSocialStatus
())
||
Common
.
isNotNull
(
vo
.
getFundStatus
())))
{
}
vo
.
setChangeContractAndEmployee
(
dis
.
getChangeContractAndEmployee
());
if
(
Common
.
isEmpty
(
dis
.
getFundId
())
&&
Common
.
isNotNull
(
dis
.
getSocialId
())
vo
.
setUserId
(
user
.
getId
());
&&(
CommonConstants
.
ONE_STRING
.
equals
(
dis
.
getSocialHandleStatus
())
vo
.
setUserName
(
user
.
getNickname
());
||
CommonConstants
.
TWO_STRING
.
equals
(
dis
.
getSocialHandleStatus
())
vo
.
setEmpName
(
dis
.
getEmpName
());
||
CommonConstants
.
THREE_STRING
.
equals
(
dis
.
getSocialHandleStatus
())))
{
vo
.
setDeptName
(
dis
.
getSettleDomainName
());
//办理成功
vo
.
setDetailId
(
dis
.
getId
());
dis
.
setStatus
(
CommonConstants
.
FOUR_STRING
);
}
}
R
<
Boolean
>
resUp
=
archivesDaprUtil
.
updateProjectSocialFund
(
vo
);
}
if
(
Common
.
isEmpty
(
resUp
)
||
!(
CommonConstants
.
SUCCESS
.
intValue
()
==
resUp
.
getCode
())
||
!
resUp
.
getData
().
booleanValue
())
{
dis
.
setHandleRemark
(
ServiceUtil
.
ifNullToEmpty
(
handleRemark
));
errorList
.
add
(
new
ErrorMessage
(-
1
,
vo
.
getEmpIdCard
()
+
DispatchConstants
.
DISPATCH_SYN_DOC_EXE
,
CommonConstants
.
RED
,
dis
.
getEmpName
()));
//新增办理记录信息
continue
;
auditInfo
.
setDispatchInfoId
(
dis
.
getId
());
}
auditInfo
.
setEmpIdcard
(
dis
.
getEmpIdcard
());
// 派减公积金办理失败不同步档案的相关字段信息
if
(
auditFlag
){
}
else
if
(!(
CommonConstants
.
ONE_STRING
.
equals
(
dis
.
getType
())
auditInfoMapper
.
insert
(
auditInfo
);
&&
CommonConstants
.
ONE_INT
==
flag
}
&&
CommonConstants
.
ONE_STRING
.
equals
(
typeSub
))){
baseMapper
.
updateById
(
dis
);
UpProjectSocialFundVo
vo
=
new
UpProjectSocialFundVo
();
//v1.8.9更新社保公积金缴纳地和户数据
// 社保状态 社保状态(字典): 0 无社保 1 处理中 2.部分购买 3.正常 4.已派减
initSocialFundStatus
(
socialInfo
,
providentFund
,
vo
,
sf
);
socialFundMapper
.
updateById
(
sf
);
if
(
Common
.
isNotNull
(
vo
.
getSocialStatus
())
||
Common
.
isNotNull
(
vo
.
getFundStatus
())){
//派减的申请审核完更新社保公积金查询快照表
vo
.
setEmpIdCard
(
dis
.
getEmpIdcard
());
if
(
CommonConstants
.
ONE_STRING
.
equals
(
dis
.
getType
()))
{
vo
.
setDepartNo
(
dis
.
getSettleDomainCode
());
socialFundInfo
=
infoService
.
getOne
(
Wrappers
.<
TDispatchSocialFundInfo
>
query
().
lambda
()
R
<
Boolean
>
resUp
=
archivesDaprUtil
.
updateProjectSocialFund
(
vo
);
.
eq
(
TDispatchSocialFundInfo:
:
getReduceSocialFundId
,
dis
.
getId
())
if
(
Common
.
isEmpty
(
resUp
)
||
!(
CommonConstants
.
SUCCESS
.
intValue
()
==
resUp
.
getCode
())
||
!
resUp
.
getData
().
booleanValue
()){
.
last
(
CommonConstants
.
LAST_ONE_SQL
));
errorList
.
add
(
new
ErrorMessage
(-
1
,
vo
.
getEmpIdCard
()+
DispatchConstants
.
DISPATCH_SYN_DOC_EXE
,
CommonConstants
.
RED
,
dis
.
getEmpName
()));
if
(
Common
.
isNotNull
(
socialFundInfo
))
{
continue
;
String
reduceSocialFundId
=
socialFundInfo
.
getReduceSocialFundId
();
}
String
id
=
socialFundInfo
.
getId
();
}
BeanUtils
.
copyProperties
(
sf
,
socialFundInfo
);
}
socialFundInfo
.
setId
(
id
);
socialFundInfo
.
setReduceSocialFundId
(
reduceSocialFundId
);
infoService
.
updateById
(
socialFundInfo
);
}
}
//1.派增办理失败 刷新预估数据
if
(
CommonConstants
.
ZERO_STRING
.
equals
(
dis
.
getType
()))
{
// 全部办理失败 社保和公积金派增办理失败 减少预估
if
(
CommonConstants
.
ONE_INT
==
flag
&&
(
CommonConstants
.
FIVE_STRING
.
equals
(
sf
.
getSocialStatus
())
||
CommonConstants
.
FOUR_STRING
.
equals
(
sf
.
getFundStatus
())))
{
// 派增办理,全部失败 同步预估库数据
socialTask
.
asynchronousDisPatchHandle
(
socialMap
,
fundMap
,
sf
,
forecastFlag
,
null
,
null
,
CommonConstants
.
ZERO_INT
);
}
// 社保办理只要办理成功就刷新预估数据 公积金办理不用处理(前面公积金办理成功的时候处理过了)
if
(
CommonConstants
.
ZERO_STRING
.
equals
(
typeSub
)
&&
(
Common
.
isNotNull
(
dis
.
getSocialId
())
&&
CommonConstants
.
FOUR_STRING
.
equals
(
sf
.
getSocialStatus
())
||
CommonConstants
.
THREE_STRING
.
equals
(
sf
.
getSocialStatus
())))
{
if
(
partSuccess
)
{
forecastLibraryService
.
updateForecastLibaryByDispatch
(
socialMap
,
fundMap
,
sf
);
}
else
{
}
else
{
errorList
.
add
(
new
ErrorMessage
(-
1
,
"派单数据错误!"
)
);
socialTask
.
asynchronousDisPatchHandle
(
socialMap
,
fundMap
,
sf
,
0
,
null
,
null
,
CommonConstants
.
ONE_INT
);
}
}
}
}
}
catch
(
Exception
e
){
log
.
error
(
DispatchConstants
.
DISPATCH_EXCEPTION
,
e
);
errorList
.
add
(
new
ErrorMessage
(-
1
,
DispatchConstants
.
DISPATCH_EXCEPTION
+
e
.
getMessage
()));
return
errorList
;
}
}
}
else
{
// 2.派减办理成功 处理预估 (不管社保还是公积金办理失败)
errorList
.
add
(
new
ErrorMessage
(-
1
,
DispatchConstants
.
NO_OPERATOR_DATA
));
if
(
CommonConstants
.
ONE_STRING
.
equals
(
dis
.
getType
())
return
errorList
;
&&
CommonConstants
.
ZERO_INT
==
flag
&&
(
CommonConstants
.
EIGHT_STRING
.
equals
(
sf
.
getSocialStatus
())
||
CommonConstants
.
SEVEN_STRING
.
equals
(
sf
.
getFundStatus
()))){
// 同步预估库数据
socialTask
.
asynchronousDisPatchHandle
(
socialMap
,
fundMap
,
sf
,
forecastFlag
,
null
,
null
,
CommonConstants
.
ZERO_INT
);
}
//社保公积金派减办理成功
if
((
CommonConstants
.
ONE_STRING
.
equals
(
dis
.
getType
())
&&
CommonConstants
.
ZERO_INT
==
flag
&&
CommonConstants
.
EIGHT_STRING
.
equals
(
sf
.
getSocialStatus
())
&&
(
CommonConstants
.
SEVEN_STRING
.
equals
(
sf
.
getFundStatus
())
||
Common
.
isEmpty
(
sf
.
getFundStatus
())))
||
(
CommonConstants
.
ZERO_STRING
.
equals
(
dis
.
getType
())
&&
CommonConstants
.
ONE_INT
==
flag
&&
CommonConstants
.
EIGHT_STRING
.
equals
(
sf
.
getSocialStatus
())
&&
(
CommonConstants
.
FOUR_STRING
.
equals
(
sf
.
getFundStatus
())
||
CommonConstants
.
NINE_STRING
.
equals
(
sf
.
getFundStatus
()))))
{
UpProjectSocialFundVo
vo
=
new
UpProjectSocialFundVo
();
// 社保状态 社保状态(字典): 0 无社保 1 处理中 2.部分购买 3.正常 4.已派减
initSocialFundStatus
(
socialInfo
,
providentFund
,
vo
,
sf
);
vo
.
setEmpIdCard
(
dis
.
getEmpIdcard
());
vo
.
setDepartNo
(
dis
.
getSettleDomainCode
());
if
(
Common
.
isNotNull
(
dis
.
getChangeContractAndEmployee
())
&&
CommonConstants
.
ZERO_STRING
.
equals
(
dis
.
getChangeContractAndEmployee
())
&&
(
Common
.
isNotNull
(
vo
.
getSocialStatus
())
||
Common
.
isNotNull
(
vo
.
getFundStatus
())))
{
vo
.
setChangeContractAndEmployee
(
dis
.
getChangeContractAndEmployee
());
vo
.
setUserId
(
user
.
getId
());
vo
.
setUserName
(
user
.
getNickname
());
vo
.
setEmpName
(
dis
.
getEmpName
());
vo
.
setDeptName
(
dis
.
getSettleDomainName
());
vo
.
setDetailId
(
dis
.
getId
());
}
R
<
Boolean
>
resUp
=
archivesDaprUtil
.
updateProjectSocialFund
(
vo
);
if
(
Common
.
isEmpty
(
resUp
)
||
!(
CommonConstants
.
SUCCESS
.
intValue
()
==
resUp
.
getCode
())
||
!
resUp
.
getData
().
booleanValue
())
{
errorList
.
add
(
new
ErrorMessage
(-
1
,
vo
.
getEmpIdCard
()
+
DispatchConstants
.
DISPATCH_SYN_DOC_EXE
,
CommonConstants
.
RED
,
dis
.
getEmpName
()));
return
true
;
}
// 派减公积金办理失败不同步档案的相关字段信息
}
else
if
(!(
CommonConstants
.
ONE_STRING
.
equals
(
dis
.
getType
())
&&
CommonConstants
.
ONE_INT
==
flag
&&
CommonConstants
.
ONE_STRING
.
equals
(
typeSub
))){
UpProjectSocialFundVo
vo
=
new
UpProjectSocialFundVo
();
// 社保状态 社保状态(字典): 0 无社保 1 处理中 2.部分购买 3.正常 4.已派减
initSocialFundStatus
(
socialInfo
,
providentFund
,
vo
,
sf
);
if
(
Common
.
isNotNull
(
vo
.
getSocialStatus
())
||
Common
.
isNotNull
(
vo
.
getFundStatus
())){
vo
.
setEmpIdCard
(
dis
.
getEmpIdcard
());
vo
.
setDepartNo
(
dis
.
getSettleDomainCode
());
R
<
Boolean
>
resUp
=
archivesDaprUtil
.
updateProjectSocialFund
(
vo
);
if
(
Common
.
isEmpty
(
resUp
)
||
!(
CommonConstants
.
SUCCESS
.
intValue
()
==
resUp
.
getCode
())
||
!
resUp
.
getData
().
booleanValue
()){
errorList
.
add
(
new
ErrorMessage
(-
1
,
vo
.
getEmpIdCard
()+
DispatchConstants
.
DISPATCH_SYN_DOC_EXE
,
CommonConstants
.
RED
,
dis
.
getEmpName
()));
return
true
;
}
}
}
}
else
{
errorList
.
add
(
new
ErrorMessage
(-
1
,
"派单数据错误!"
));
}
}
return
errorList
;
return
false
;
}
}
/**
/**
...
...
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