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
5e125b03
Commit
5e125b03
authored
Jul 30, 2022
by
huyuchen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
缴费库 代码修改
parent
99796814
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
323 additions
and
302 deletions
+323
-302
TPaymentInfoMapper.java
.../cloud/plus/v1/yifu/social/mapper/TPaymentInfoMapper.java
+0
-8
TPaymentInfoServiceImpl.java
.../v1/yifu/social/service/impl/TPaymentInfoServiceImpl.java
+321
-262
TPreDispatchInfoServiceImpl.java
...yifu/social/service/impl/TPreDispatchInfoServiceImpl.java
+1
-1
TPaymentInfoMapper.xml
...cial-biz/src/main/resources/mapper/TPaymentInfoMapper.xml
+1
-31
No files found.
yifu-social/yifu-social-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/social/mapper/TPaymentInfoMapper.java
View file @
5e125b03
...
...
@@ -86,12 +86,4 @@ public interface TPaymentInfoMapper extends BaseMapper<TPaymentInfo> {
* */
List
<
TPaymentInfo
>
selectListForPaymentImport
(
@Param
(
"months"
)
List
<
String
>
months
,
@Param
(
"idcards"
)
List
<
String
>
idcards
);
/*
* 已存在社保缴费库数据 非删除状态
* @param months
* @param idcards
* @return
* */
List
<
TPaymentInfoVo
>
selectPaymentAllInfoByMonthAndIdCard
(
@Param
(
"months"
)
List
<
String
>
months
,
@Param
(
"idcards"
)
List
<
String
>
idcards
);
}
yifu-social/yifu-social-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/social/service/impl/TPaymentInfoServiceImpl.java
View file @
5e125b03
...
...
@@ -46,6 +46,7 @@ import com.yifu.cloud.plus.v1.yifu.social.vo.TPaymentInfoVo;
import
lombok.extern.log4j.Log4j2
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Qualifier
;
import
org.springframework.security.core.parameters.P
;
import
org.springframework.stereotype.Service
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.ErrorMessage
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.R
;
...
...
@@ -53,7 +54,6 @@ import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import
javax.servlet.http.HttpServletResponse
;
import
java.io.InputStream
;
import
java.math.BigDecimal
;
import
java.time.LocalDateTime
;
import
java.util.*
;
import
com.alibaba.excel.EasyExcel
;
...
...
@@ -136,7 +136,8 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
response
.
setCharacterEncoding
(
"utf-8"
);
response
.
setHeader
(
"Content-Disposition"
,
"attachment;filename="
+
URLEncoder
.
encode
(
fileName
,
"UTF-8"
));
// 这里 需要指定写用哪个class去写,然后写到第一个sheet,然后文件流会自动关闭
ExcelWriter
excelWriter
=
EasyExcel
.
write
(
out
,
TPaymentInfo
.
class
).
includeColumnFiledNames
(
searchVo
.
getExportFields
()).
build
();;
ExcelWriter
excelWriter
=
EasyExcel
.
write
(
out
,
TPaymentInfo
.
class
).
includeColumnFiledNames
(
searchVo
.
getExportFields
()).
build
();
;
int
index
=
0
;
if
(
count
>
CommonConstants
.
ZERO_INT
)
{
for
(
int
i
=
0
;
i
<=
count
;
)
{
...
...
@@ -202,7 +203,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
@Override
public
R
<
Boolean
>
removeAllInfoById
(
String
ids
)
{
YifuUser
user
=
SecurityUtils
.
getUser
();
if
(
Common
.
isEmpty
(
ids
)){
if
(
Common
.
isEmpty
(
ids
))
{
return
R
.
failed
(
CommonConstants
.
NO_DATA_TO_HANDLE
);
}
List
<
String
>
idList
=
Common
.
initStrToList
(
ids
,
CommonConstants
.
COMMA_STRING
);
...
...
@@ -341,7 +342,6 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
List
<
String
>
monthList
=
Common
.
listObjectToStrList
(
list
,
ExcelAttributeConstants
.
SOCIAL_PAY_MONTH
).
stream
().
distinct
().
collect
(
Collectors
.
toList
());
//已存在社保缴费库数据 非删除状态
List
<
TPaymentInfo
>
paymentInfos
=
baseMapper
.
selectListForPaymentImport
(
monthList
,
Common
.
listObjectToStrList
(
list
,
ExcelAttributeConstants
.
EMPIDCARD
));
//社保唯一性检验条件:身份证+社保缴纳月份+生成月份
//养老
ConcurrentHashMap
<
String
,
TPaymentInfo
>
paymentInfoPensionMap
=
new
ConcurrentHashMap
<>();
//大病救助金
...
...
@@ -358,7 +358,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
for
(
TPaymentInfo
info
:
paymentInfos
)
{
if
(
BigDecimalUtils
.
safeAdd
(
BigDecimalUtils
.
isNullToZero
(
info
.
getUnitPensionMoney
()),
BigDecimalUtils
.
isNullToZero
(
info
.
getPersonalPensionMoney
())).
compareTo
(
BigDecimal
.
ZERO
)
!=
0
)
{
paymentInfo
Big
Map
.
put
(
info
.
getSocialPayAddr
()
paymentInfo
Pension
Map
.
put
(
info
.
getSocialPayAddr
()
+
CommonConstants
.
DOWN_LINE_STRING
+
info
.
getEmpIdcard
()
+
CommonConstants
.
DOWN_LINE_STRING
...
...
@@ -371,7 +371,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
}
if
(
BigDecimalUtils
.
safeAdd
(
BigDecimalUtils
.
isNullToZero
(
info
.
getPersonalBigmailmentMoney
()),
BigDecimalUtils
.
isNullToZero
(
info
.
getUnitBigmailmentMoney
())).
compareTo
(
BigDecimal
.
ZERO
)
!=
0
)
{
paymentInfo
Pension
Map
.
put
(
info
.
getSocialPayAddr
()
paymentInfo
Big
Map
.
put
(
info
.
getSocialPayAddr
()
+
CommonConstants
.
DOWN_LINE_STRING
+
info
.
getEmpIdcard
()
+
CommonConstants
.
DOWN_LINE_STRING
...
...
@@ -667,10 +667,6 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
}
String
[]
areaArray
;
List
<
TPaymentInfo
>
paymentInfoListTemp
;
BigDecimal
cTemp
;
String
result
=
null
;
String
lockKey
;
String
checkRes
;
for
(
TPaymentInfoVo
infoVo
:
list
)
{
atomicLine
.
incrementAndGet
();
...
...
@@ -1587,15 +1583,6 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
getErrorMessageHashMapThree
(
user
,
random
,
errorMessageList
,
key
,
listMap
);
}
// 导入前做队列空闲判断,防止队列不足出现数据丢失的场景
if
(
CollUtil
.
isNotEmpty
(
list
))
{
int
taskSize
=
list
.
size
()
/
partSize
+
CommonConstants
.
ONE_INT
;
int
residualCapacity
=
yfSocialImportThreadPoolExecutor
.
getResidualCapacity
();
if
(
taskSize
>
residualCapacity
)
{
errorMessageList
.
add
(
new
ErrorMessage
(-
1
,
MsgUtils
.
getMessage
(
ErrorCodes
.
SOCIALINFO_LIST_NUM_LARGE
)));
}
}
// 将以下代码提取出来,使用paymentInfoMap提升性能,避免list多次循环查询数据库浪费性能
// 导入前做队列空闲判断,防止队列不足出现数据丢失的场景
if
(
CollUtil
.
isNotEmpty
(
list
))
{
...
...
@@ -1610,19 +1597,72 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
//已存在的档案数据
List
<
String
>
monthList
=
Common
.
listObjectToStrList
(
list
,
ExcelAttributeConstants
.
SOCIAL_PAY_MONTH
).
stream
().
distinct
().
collect
(
Collectors
.
toList
());
//已存在社保缴费库数据 非删除状态
List
<
TPaymentInfo
Vo
>
paymentInfos
=
baseMapper
.
selectPaymentAllInfoByMonthAndIdCard
(
monthList
,
List
<
TPaymentInfo
>
paymentInfos
=
baseMapper
.
selectListForPaymentImport
(
monthList
,
Common
.
listObjectToStrList
(
list
,
ExcelAttributeConstants
.
EMPIDCARD
));
//社保唯一性检验条件:身份证+社保缴纳月份+生成月份
ConcurrentHashMap
<
String
,
TPaymentInfoVo
>
paymentInfoMap
=
new
ConcurrentHashMap
<>();
//养老
ConcurrentHashMap
<
String
,
TPaymentInfo
>
paymentInfoPensionMap
=
new
ConcurrentHashMap
<>();
//大病救助金
ConcurrentHashMap
<
String
,
TPaymentInfo
>
paymentInfoBigMap
=
new
ConcurrentHashMap
<>();
//失业
ConcurrentHashMap
<
String
,
TPaymentInfo
>
paymentInfoUnEmpMap
=
new
ConcurrentHashMap
<>();
//工伤
ConcurrentHashMap
<
String
,
TPaymentInfo
>
paymentInfoInjuryMap
=
new
ConcurrentHashMap
<>();
//医保
ConcurrentHashMap
<
String
,
TPaymentInfo
>
paymentInfoMedicalMap
=
new
ConcurrentHashMap
<>();
if
(
Common
.
isNotNull
(
paymentInfos
))
{
for
(
TPaymentInfoVo
info
:
paymentInfos
)
{
paymentInfoMap
.
putIfAbsent
(
info
.
getSocialPayAddr
()
+
CommonConstants
.
DOWN_LINE_STRING
+
info
.
getEmpIdcard
()
+
CommonConstants
.
DOWN_LINE_STRING
+
info
.
getSocialPayMonth
()
+
CommonConstants
.
DOWN_LINE_STRING
+
info
.
getSocialCreateMonth
(),
info
);
for
(
TPaymentInfo
info
:
paymentInfos
)
{
if
(
BigDecimalUtils
.
safeAdd
(
BigDecimalUtils
.
isNullToZero
(
info
.
getUnitPensionMoney
()),
BigDecimalUtils
.
isNullToZero
(
info
.
getPersonalPensionMoney
())).
compareTo
(
BigDecimal
.
ZERO
)
!=
0
)
{
paymentInfoPensionMap
.
put
(
info
.
getSocialPayAddr
()
+
CommonConstants
.
DOWN_LINE_STRING
+
info
.
getEmpIdcard
()
+
CommonConstants
.
DOWN_LINE_STRING
+
info
.
getSocialPayMonth
()
+
CommonConstants
.
DOWN_LINE_STRING
+
info
.
getSocialCreateMonth
()
+
CommonConstants
.
DOWN_LINE_STRING
+
PaymentConstants
.
PENSION_RISK
,
info
);
}
if
(
BigDecimalUtils
.
safeAdd
(
BigDecimalUtils
.
isNullToZero
(
info
.
getUnitUnemploymentMoney
()),
BigDecimalUtils
.
isNullToZero
(
info
.
getPersonalUnemploymentMoney
())).
compareTo
(
BigDecimal
.
ZERO
)
!=
0
)
{
paymentInfoUnEmpMap
.
put
(
info
.
getSocialPayAddr
()
+
CommonConstants
.
DOWN_LINE_STRING
+
info
.
getEmpIdcard
()
+
CommonConstants
.
DOWN_LINE_STRING
+
info
.
getSocialPayMonth
()
+
CommonConstants
.
DOWN_LINE_STRING
+
info
.
getSocialCreateMonth
()
+
CommonConstants
.
DOWN_LINE_STRING
+
PaymentConstants
.
UNEMPLOYEEMENT_RISK
,
info
);
}
if
(
BigDecimalUtils
.
isNullToZero
(
info
.
getUnitInjuryMoney
()).
compareTo
(
BigDecimal
.
ZERO
)
!=
0
)
{
paymentInfoInjuryMap
.
put
(
info
.
getSocialPayAddr
()
+
CommonConstants
.
DOWN_LINE_STRING
+
info
.
getEmpIdcard
()
+
CommonConstants
.
DOWN_LINE_STRING
+
info
.
getSocialPayMonth
()
+
CommonConstants
.
DOWN_LINE_STRING
+
info
.
getSocialCreateMonth
()
+
CommonConstants
.
DOWN_LINE_STRING
+
PaymentConstants
.
INJURY_RISK
,
info
);
}
if
(
BigDecimalUtils
.
safeAdd
(
BigDecimalUtils
.
isNullToZero
(
info
.
getUnitMedicalMoney
()),
BigDecimalUtils
.
isNullToZero
(
info
.
getPersonalMedicalMoney
())).
compareTo
(
BigDecimal
.
ZERO
)
!=
0
)
{
paymentInfoMedicalMap
.
put
(
info
.
getSocialPayAddr
()
+
CommonConstants
.
DOWN_LINE_STRING
+
info
.
getEmpIdcard
()
+
CommonConstants
.
DOWN_LINE_STRING
+
info
.
getSocialPayMonth
()
+
CommonConstants
.
DOWN_LINE_STRING
+
info
.
getSocialCreateMonth
()
+
CommonConstants
.
DOWN_LINE_STRING
+
PaymentConstants
.
MEDICAL
,
info
);
}
}
}
// -----------------------------生成paymentInfoMap本段结束--------------------------------
...
...
@@ -1641,7 +1681,8 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
if
(
list
.
size
()
<
partSize
)
{
CompletableFuture
<
List
<
TPaymentInfoImportLog
>>
listCompletableFuture
=
CompletableFuture
.
supplyAsync
(()
->
executeImportSocialListThree
(
user
,
atomicLine
,
random
,
list
,
areaMap
,
areaMap2
,
paymentInfoMap
,
CommonConstants
.
ONE_INT
,
type
),
yfSocialImportThreadPoolExecutor
)
paymentInfoPensionMap
,
paymentInfoMedicalMap
,
paymentInfoUnEmpMap
,
paymentInfoInjuryMap
,
CommonConstants
.
ONE_INT
,
type
),
yfSocialImportThreadPoolExecutor
)
.
whenComplete
((
result
,
e
)
->
{
if
(
CollectionUtils
.
isNotEmpty
(
result
))
{
this
.
tPaymentInfoImportLogService
.
saveBatch
(
result
);
...
...
@@ -1659,7 +1700,8 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
final
List
<
TPaymentHeFeiVo
>
finalList
=
list
.
subList
(
0
,
1
);
CompletableFuture
<
List
<
TPaymentInfoImportLog
>>
oneCompletableFuture
=
CompletableFuture
.
supplyAsync
(()
->
executeImportSocialListThree
(
user
,
atomicLine
,
random
,
finalList
,
areaMap
,
areaMap2
,
paymentInfoMap
,
CommonConstants
.
ONE_INT
,
type
),
yfSocialImportThreadPoolExecutor
)
paymentInfoPensionMap
,
paymentInfoMedicalMap
,
paymentInfoUnEmpMap
,
paymentInfoInjuryMap
,
CommonConstants
.
ONE_INT
,
type
),
yfSocialImportThreadPoolExecutor
)
.
whenComplete
((
result
,
e
)
->
{
if
(
CollectionUtils
.
isNotEmpty
(
result
))
{
this
.
tPaymentInfoImportLogService
.
saveBatch
(
result
);
...
...
@@ -1677,7 +1719,8 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
List
<
TPaymentHeFeiVo
>
finalTempList1
=
tempList
;
CompletableFuture
<
List
<
TPaymentInfoImportLog
>>
listCompletableFuture
=
CompletableFuture
.
supplyAsync
(()
->
executeImportSocialListThree
(
user
,
atomicLine
,
random
,
finalTempList1
,
areaMap
,
areaMap2
,
paymentInfoMap
,
idx
,
type
),
yfSocialImportThreadPoolExecutor
)
areaMap2
,
paymentInfoPensionMap
,
paymentInfoMedicalMap
,
paymentInfoUnEmpMap
,
paymentInfoInjuryMap
,
idx
,
type
),
yfSocialImportThreadPoolExecutor
)
.
whenComplete
((
result
,
e
)
->
{
if
(
CollectionUtils
.
isNotEmpty
(
result
))
{
this
.
tPaymentInfoImportLogService
.
saveBatch
(
result
);
...
...
@@ -1708,7 +1751,8 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
int
finalLastIdx
=
lastIdx
+
1
;
CompletableFuture
<
List
<
TPaymentInfoImportLog
>>
listCompletableFuture
=
CompletableFuture
.
supplyAsync
(()
->
executeImportSocialListThree
(
user
,
atomicLine
,
random
,
finalTempList
,
areaMap
,
areaMap2
,
paymentInfoMap
,
finalLastIdx
,
type
),
yfSocialImportThreadPoolExecutor
)
areaMap2
,
paymentInfoPensionMap
,
paymentInfoMedicalMap
,
paymentInfoUnEmpMap
,
paymentInfoInjuryMap
,
finalLastIdx
,
type
),
yfSocialImportThreadPoolExecutor
)
.
whenComplete
((
result
,
e
)
->
{
if
(
CollectionUtils
.
isNotEmpty
(
result
))
{
this
.
tPaymentInfoImportLogService
.
saveBatch
(
result
);
...
...
@@ -1737,7 +1781,11 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
redisUtil
.
remove
(
key
);
errorMessageList
.
add
(
new
ErrorMessage
(-
1
,
"数据批量导入异常:"
+
e
));
}
finally
{
paymentInfoMap
.
clear
();
paymentInfoPensionMap
.
clear
();
paymentInfoBigMap
.
clear
();
paymentInfoMedicalMap
.
clear
();
paymentInfoUnEmpMap
.
clear
();
paymentInfoInjuryMap
.
clear
();
}
}
...
...
@@ -1776,16 +1824,18 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
List
<
TPaymentHeFeiVo
>
list
,
HashMap
<
String
,
String
>
areaMap
,
HashMap
<
String
,
String
>
areaMap2
,
ConcurrentHashMap
<
String
,
TPaymentInfoVo
>
paymentInfoMap
,
ConcurrentHashMap
<
String
,
TPaymentInfo
>
paymentInfoPensionMap
,
ConcurrentHashMap
<
String
,
TPaymentInfo
>
paymentInfoMedicalMap
,
ConcurrentHashMap
<
String
,
TPaymentInfo
>
paymentInfoUnEmpMap
,
ConcurrentHashMap
<
String
,
TPaymentInfo
>
paymentInfoInjuryMap
,
int
idx
,
String
type
)
{
int
i
=
idx
;
List
<
TPaymentInfoImportLog
>
logList
=
new
ArrayList
<>();
if
(
Common
.
isNotNull
(
list
))
{
TPaymentInfo
Vo
payExists
=
null
;
TPaymentInfo
payExists
=
null
;
TSocialInfo
socialInfo
=
null
;
String
temp
;
TPaymentInfo
tempPay
;
int
res
=
-
1
;
List
<
String
>
idcards
=
Common
.
listObjectToStrList
(
list
,
ExcelAttributeConstants
.
EMPIDCARD
);
// 全部办理成功 和 部分办理失败
...
...
@@ -1824,8 +1874,6 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
String
[]
areaArray
;
String
checkRes
;
String
result
=
null
;
String
lockKey
;
for
(
TPaymentHeFeiVo
infoVo
:
list
)
{
atomicLine
.
incrementAndGet
();
++
i
;
...
...
@@ -1907,185 +1955,237 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
,
CommonConstants
.
ERROR_MSG_PRFIX
+
"必填项校验失败:社保缴纳月份不可为空!"
,
i
,
random
));
continue
;
}
// 判重 此处代码块要同步,否则无法保证导入数据的重复性
lockKey
=
infoVo
.
getSocialPayAddr
()
+
CommonConstants
.
DOWN_LINE_STRING
+
infoVo
.
getEmpIdcard
().
trim
()
+
CommonConstants
.
DOWN_LINE_STRING
+
infoVo
.
getSocialPayMonth
().
trim
()
+
CommonConstants
.
DOWN_LINE_STRING
+
infoVo
.
getSocialCreateMonth
().
trim
();
try
{
result
=
RedisDistributedLock
.
tryLock
(
lockKey
,
CommonConstants
.
ONE_STRING
,
500
,
null
);
}
catch
(
InterruptedException
e
)
{
logList
.
add
(
new
TPaymentInfoImportLog
(
null
,
infoVo
.
getEmpName
(),
infoVo
.
getEmpIdcard
()
,
CommonConstants
.
ERROR_MSG_PRFIX
+
"竞争导入异常,请重新导入!"
,
i
,
random
));
RedisDistributedLock
.
unlock
(
lockKey
,
result
);
continue
;
//判断是否存在养老缴费数据
if
(
PaymentConstants
.
PENSION_RISK
.
equals
(
infoVo
.
getRiskType
()))
{
payExists
=
paymentInfoPensionMap
.
get
(
infoVo
.
getSocialPayAddr
()
+
CommonConstants
.
DOWN_LINE_STRING
+
infoVo
.
getEmpIdcard
().
trim
()
+
CommonConstants
.
DOWN_LINE_STRING
+
infoVo
.
getSocialPayMonth
().
trim
()
+
CommonConstants
.
DOWN_LINE_STRING
+
infoVo
.
getSocialCreateMonth
().
trim
()
+
CommonConstants
.
DOWN_LINE_STRING
+
PaymentConstants
.
PENSION_RISK
);
//存在社保缴费数据
if
(
null
!=
payExists
&&
BigDecimalUtils
.
safeMultiply
(
BigDecimalUtils
.
safeAdd
(
BigDecimalUtils
.
isNullToZero
(
infoVo
.
getPersonalMoney
()),
BigDecimalUtils
.
isNullToZero
(
infoVo
.
getUnitSet
())),
BigDecimalUtils
.
safeAdd
(
BigDecimalUtils
.
isNullToZero
(
payExists
.
getUnitPensionMoney
()),
BigDecimalUtils
.
isNullToZero
(
payExists
.
getPersonalPensionMoney
()))).
compareTo
(
BigDecimal
.
ZERO
)
>
0
)
{
logList
.
add
(
new
TPaymentInfoImportLog
(
null
,
infoVo
.
getEmpName
(),
infoVo
.
getEmpIdcard
()
,
CommonConstants
.
ERROR_MSG_PRFIX
+
"已存在对应员工身份证"
+
infoVo
.
getEmpIdcard
()
+
"的养老缴费数据,请勿重复导入!"
,
i
,
random
));
continue
;
}
else
{
payExists
=
null
;
}
}
if
(
Common
.
isNotNull
(
result
))
{
try
{
if
(
null
!=
paymentInfoMap
)
{
payExists
=
paymentInfoMap
.
get
(
lockKey
);
}
//存在社保缴费数据
if
(
Common
.
isNotNull
(
payExists
))
{
// 校验每种险种是否可以导入
if
(
checkImportInfo
(
random
,
i
,
logList
,
payExists
,
infoVo
,
type
))
{
continue
;
}
}
else
{
payExists
=
null
;
}
if
(
null
==
payExists
)
{
payExists
=
new
TPaymentInfoVo
();
payExists
.
setLockStatus
(
CommonConstants
.
ZERO_STRING
);
payExists
.
setEmpId
(
socialInfo
.
getEmpId
());
payExists
.
setEmpIdcard
(
socialInfo
.
getEmpIdcard
());
payExists
.
setEmpName
(
socialInfo
.
getEmpName
());
payExists
.
setEmpNo
(
socialInfo
.
getEmpNo
());
payExists
.
setSettleDomainId
(
socialInfo
.
getSettleDomain
());
payExists
.
setUnitId
(
socialInfo
.
getBelongUnit
());
payExists
.
setInauguralTeam
(
socialInfo
.
getInauguralTeam
());
payExists
.
setTelecomNumber
(
socialInfo
.
getTelecomNumber
());
}
payExists
.
setSocialProvince
(
socialInfo
.
getSocialProvince
());
payExists
.
setSocialCity
(
socialInfo
.
getSocialCity
());
payExists
.
setSocialTown
(
socialInfo
.
getSocialTown
());
payExists
.
setSocialHousehold
(
socialInfo
.
getSocialHousehold
());
payExists
.
setSocialPayMonth
(
infoVo
.
getSocialPayMonth
());
// 同时设置公积金缴纳日期方便导入处理
payExists
.
setProvidentPayMonth
(
infoVo
.
getSocialPayMonth
());
//判断是否存在失业缴费数据
if
(
PaymentConstants
.
UNEMPLOYEEMENT_RISK
.
equals
(
infoVo
.
getRiskType
()))
{
payExists
=
paymentInfoUnEmpMap
.
get
(
infoVo
.
getSocialPayAddr
()
+
CommonConstants
.
DOWN_LINE_STRING
+
infoVo
.
getEmpIdcard
().
trim
()
+
CommonConstants
.
DOWN_LINE_STRING
+
infoVo
.
getSocialPayMonth
().
trim
()
+
CommonConstants
.
DOWN_LINE_STRING
+
infoVo
.
getSocialCreateMonth
().
trim
()
+
CommonConstants
.
DOWN_LINE_STRING
+
PaymentConstants
.
UNEMPLOYEEMENT_RISK
);
//存在社保缴费数据
if
(
null
!=
payExists
&&
BigDecimalUtils
.
safeMultiply
(
BigDecimalUtils
.
safeAdd
(
BigDecimalUtils
.
isNullToZero
(
infoVo
.
getPersonalMoney
()),
BigDecimalUtils
.
isNullToZero
(
infoVo
.
getUnitSet
())),
BigDecimalUtils
.
safeAdd
(
BigDecimalUtils
.
isNullToZero
(
payExists
.
getUnitUnemploymentMoney
()),
BigDecimalUtils
.
isNullToZero
(
payExists
.
getPersonalUnemploymentMoney
()))).
compareTo
(
BigDecimal
.
ZERO
)
>
0
)
{
logList
.
add
(
new
TPaymentInfoImportLog
(
null
,
infoVo
.
getEmpName
(),
infoVo
.
getEmpIdcard
()
,
CommonConstants
.
ERROR_MSG_PRFIX
+
"已存在对应员工身份证"
+
infoVo
.
getEmpIdcard
()
+
"的失业缴费数据,请勿重复导入!"
,
i
,
random
));
continue
;
}
else
{
payExists
=
null
;
}
}
if
(
null
!=
payExists
.
getSocialProvince
())
{
temp
=
areaMap
.
get
(
payExists
.
getSocialProvince
());
if
(
Common
.
isNotNull
(
temp
))
{
payExists
.
setSocialPayAddr
(
temp
);
}
}
if
(
null
!=
payExists
.
getSocialCity
())
{
temp
=
areaMap
.
get
(
payExists
.
getSocialCity
());
if
(
Common
.
isNotNull
(
temp
))
{
payExists
.
setSocialPayAddr
(
payExists
.
getSocialPayAddr
()
+
CommonConstants
.
CENTER_SPLIT_LINE_STRING
+
temp
);
}
}
if
(
null
!=
payExists
.
getSocialTown
())
{
temp
=
areaMap
.
get
(
payExists
.
getSocialTown
());
if
(
Common
.
isNotNull
(
temp
))
{
payExists
.
setSocialPayAddr
(
payExists
.
getSocialPayAddr
()
+
CommonConstants
.
CENTER_SPLIT_LINE_STRING
+
temp
);
}
}
payExists
.
setSocialSecurityNo
(
infoVo
.
getSocialSecurityNo
());
payExists
.
setSocialCreateMonth
(
infoVo
.
getSocialCreateMonth
());
if
(
PaymentConstants
.
PENSION_RISK
.
equals
(
infoVo
.
getRiskType
()))
{
payExists
.
setUnitPensionMoney
(
infoVo
.
getUnitMoney
());
payExists
.
setPersonalPensionMoney
(
infoVo
.
getPersonalMoney
());
payExists
.
setUnitPensionSet
(
infoVo
.
getUnitSet
());
payExists
.
setPersonalPensionSet
(
infoVo
.
getPersonalSet
());
payExists
.
setUnitPensionMoney
(
infoVo
.
getUnitMoney
());
payExists
.
setPersonalPensionMoney
(
infoVo
.
getPersonalMoney
());
payExists
.
setUnitPensionSet
(
infoVo
.
getUnitSet
());
payExists
.
setPersonalPensionSet
(
infoVo
.
getPersonalSet
());
payExists
.
setUnitSocialSum
(
BigDecimalUtils
.
safeAdd
(
payExists
.
getUnitPensionMoney
()
,
payExists
.
getUnitSocialSum
()));
payExists
.
setSocialSecurityPersonalSum
(
BigDecimalUtils
.
safeAdd
(
payExists
.
getPersonalPensionMoney
()
,
payExists
.
getSocialSecurityPersonalSum
()));
}
if
(
PaymentConstants
.
UNEMPLOYEEMENT_RISK
.
equals
(
infoVo
.
getRiskType
()))
{
payExists
.
setUnitUnemploymentMoney
(
infoVo
.
getUnitMoney
());
payExists
.
setPersonalUnemploymentMoney
(
infoVo
.
getPersonalMoney
());
payExists
.
setUnitUnemploymentSet
(
infoVo
.
getUnitSet
());
payExists
.
setPersonalUnemploymentSet
(
infoVo
.
getPersonalSet
());
payExists
.
setUnitUnemploymentMoney
(
infoVo
.
getUnitMoney
());
payExists
.
setPersonalUnemploymentMoney
(
infoVo
.
getPersonalMoney
());
payExists
.
setUnitUnemploymentSet
(
infoVo
.
getUnitSet
());
payExists
.
setPersonalUnemploymentSet
(
infoVo
.
getPersonalSet
());
payExists
.
setUnitSocialSum
(
BigDecimalUtils
.
safeAdd
(
payExists
.
getUnitUnemploymentMoney
()
,
payExists
.
getUnitSocialSum
()));
payExists
.
setSocialSecurityPersonalSum
(
BigDecimalUtils
.
safeAdd
(
payExists
.
getPersonalUnemploymentMoney
()
,
payExists
.
getSocialSecurityPersonalSum
()));
}
if
(
PaymentConstants
.
INJURY_RISK
.
equals
(
infoVo
.
getRiskType
()))
{
payExists
.
setUnitInjuryMoney
(
infoVo
.
getUnitMoney
());
payExists
.
setUnitInjurySet
(
infoVo
.
getUnitSet
());
payExists
.
setUnitInjuryMoney
(
infoVo
.
getUnitMoney
());
payExists
.
setUnitInjurySet
(
infoVo
.
getUnitSet
());
payExists
.
setUnitSocialSum
(
BigDecimalUtils
.
safeAdd
(
payExists
.
getUnitInjuryMoney
()
,
payExists
.
getUnitSocialSum
()));
}
if
(
CommonConstants
.
ONE_STRING
.
equals
(
type
))
{
payExists
.
setUnitMedicalMoney
(
infoVo
.
getUnitMedicalMoney
());
payExists
.
setUnitMedicalSet
(
infoVo
.
getMedicalSet
());
payExists
.
setPersonalMedicalMoney
(
infoVo
.
getPersonalMedicalMoney
());
payExists
.
setPersonalMedicalSet
(
infoVo
.
getMedicalSet
());
payExists
.
setPersonalBigmailmentMoney
(
infoVo
.
getPersonalBigailmentMoney
());
payExists
.
setUnitBigmailmentMoney
(
infoVo
.
getUnitBigailmentMoney
());
payExists
.
setUnitMedicalMoney
(
infoVo
.
getUnitMedicalMoney
());
payExists
.
setUnitMedicalSet
(
infoVo
.
getMedicalSet
());
payExists
.
setPersonalMedicalMoney
(
infoVo
.
getPersonalMedicalMoney
());
payExists
.
setPersonalMedicalSet
(
infoVo
.
getMedicalSet
());
payExists
.
setPersonalBigmailmentMoney
(
infoVo
.
getPersonalBigailmentMoney
());
payExists
.
setUnitBigmailmentMoney
(
infoVo
.
getUnitBigailmentMoney
());
payExists
.
setSocialSecurityNo
(
infoVo
.
getSocialSecurityNo
());
payExists
.
setUnitSocialSum
(
BigDecimalUtils
.
safeAdd
(
payExists
.
getUnitMedicalMoney
()
,
payExists
.
getUnitBigmailmentMoney
()
,
payExists
.
getUnitSocialSum
()));
payExists
.
setSocialSecurityPersonalSum
(
BigDecimalUtils
.
safeAdd
(
payExists
.
getPersonalMedicalMoney
()
,
payExists
.
getPersonalBigmailmentMoney
()
,
payExists
.
getSocialSecurityPersonalSum
()));
}
payExists
.
setSocialSum
(
BigDecimalUtils
.
safeAdd
(
payExists
.
getUnitSocialSum
(),
payExists
.
getSocialSecurityPersonalSum
()));
payExists
.
setSumAll
(
payExists
.
getSocialSum
());
if
(
null
!=
payExists
&&
Common
.
isEmpty
(
payExists
.
getSocialId
()))
{
payExists
.
setSocialId
(
UUID
.
randomUUID
().
toString
());
}
tempPay
=
reflectionPaymentInfo
(
payExists
);
if
(
null
!=
payExists
&&
Common
.
isNotNull
(
payExists
.
getId
()))
{
res
=
baseMapper
.
updateById
(
tempPay
);
if
(
res
<
0
)
{
logList
.
add
(
new
TPaymentInfoImportLog
(
null
,
infoVo
.
getEmpName
(),
infoVo
.
getEmpIdcard
()
,
CommonConstants
.
ERROR_MSG_PRFIX
+
infoVo
.
getEmpIdcard
()
+
"_缴费库更新失败!"
,
i
,
random
));
continue
;
}
else
{
logList
.
add
(
new
TPaymentInfoImportLog
(
null
,
infoVo
.
getEmpName
(),
infoVo
.
getEmpIdcard
()
,
CommonConstants
.
SUCCESS_MSG_PREFIX
+
infoVo
.
getEmpIdcard
()
+
"_缴费库更新成功!"
,
i
,
random
));
paymentInfoMap
.
putIfAbsent
(
payExists
.
getSocialPayAddr
()
+
CommonConstants
.
DOWN_LINE_STRING
+
payExists
.
getEmpIdcard
().
trim
()
+
CommonConstants
.
DOWN_LINE_STRING
+
payExists
.
getSocialPayMonth
().
trim
()
+
CommonConstants
.
DOWN_LINE_STRING
+
payExists
.
getSocialCreateMonth
().
trim
(),
payExists
);
continue
;
}
}
else
{
res
=
insertAndSTimestamp
(
tempPay
);
if
(
res
<
0
)
{
logList
.
add
(
new
TPaymentInfoImportLog
(
null
,
infoVo
.
getEmpName
(),
infoVo
.
getEmpIdcard
()
,
CommonConstants
.
ERROR_MSG_PRFIX
+
infoVo
.
getEmpIdcard
()
+
"_缴费库保存失败!"
,
i
,
random
));
continue
;
}
payExists
.
setId
(
tempPay
.
getId
());
paymentInfoMap
.
putIfAbsent
(
payExists
.
getSocialPayAddr
()
+
CommonConstants
.
DOWN_LINE_STRING
+
payExists
.
getEmpIdcard
().
trim
()
+
CommonConstants
.
DOWN_LINE_STRING
+
payExists
.
getSocialPayMonth
().
trim
()
+
CommonConstants
.
DOWN_LINE_STRING
+
payExists
.
getSocialCreateMonth
().
trim
(),
payExists
);
}
//判断是否存在医保缴费数据
if
(
CommonConstants
.
ONE_STRING
.
equals
(
type
))
{
payExists
=
paymentInfoMedicalMap
.
get
(
infoVo
.
getSocialPayAddr
()
+
CommonConstants
.
DOWN_LINE_STRING
+
infoVo
.
getEmpIdcard
().
trim
()
+
CommonConstants
.
DOWN_LINE_STRING
+
infoVo
.
getSocialPayMonth
().
trim
()
+
CommonConstants
.
DOWN_LINE_STRING
+
infoVo
.
getSocialCreateMonth
().
trim
()
+
CommonConstants
.
DOWN_LINE_STRING
+
PaymentConstants
.
MEDICAL
);
//存在社保缴费数据
if
(
null
!=
payExists
&&
BigDecimalUtils
.
safeMultiply
(
BigDecimalUtils
.
safeAdd
(
BigDecimalUtils
.
isNullToZero
(
infoVo
.
getUnitMedicalMoney
()),
BigDecimalUtils
.
isNullToZero
(
infoVo
.
getPersonalMedicalMoney
())),
BigDecimalUtils
.
safeAdd
(
BigDecimalUtils
.
isNullToZero
(
payExists
.
getUnitMedicalMoney
()),
BigDecimalUtils
.
isNullToZero
(
payExists
.
getPersonalMedicalMoney
()))).
compareTo
(
BigDecimal
.
ZERO
)
>
0
)
{
logList
.
add
(
new
TPaymentInfoImportLog
(
null
,
infoVo
.
getEmpName
(),
infoVo
.
getEmpIdcard
()
,
CommonConstants
.
ERROR_MSG_PRFIX
+
"已存在对应员工身份证"
+
infoVo
.
getEmpIdcard
()
+
"的医保缴费数据,请勿重复导入!"
,
i
,
random
));
continue
;
}
else
{
payExists
=
null
;
}
}
//判断是否存在工伤缴费数据
if
(
PaymentConstants
.
INJURY_RISK
.
equals
(
infoVo
.
getRiskType
()))
{
payExists
=
paymentInfoInjuryMap
.
get
(
infoVo
.
getSocialPayAddr
()
+
CommonConstants
.
DOWN_LINE_STRING
+
infoVo
.
getEmpIdcard
().
trim
()
+
CommonConstants
.
DOWN_LINE_STRING
+
infoVo
.
getSocialPayMonth
().
trim
()
+
CommonConstants
.
DOWN_LINE_STRING
+
infoVo
.
getSocialCreateMonth
().
trim
()
+
CommonConstants
.
DOWN_LINE_STRING
+
PaymentConstants
.
INJURY_RISK
);
//存在社保缴费数据
if
(
null
!=
payExists
&&
BigDecimalUtils
.
safeMultiply
(
BigDecimalUtils
.
safeAdd
(
BigDecimalUtils
.
isNullToZero
(
infoVo
.
getUnitMedicalMoney
()),
BigDecimalUtils
.
isNullToZero
(
infoVo
.
getPersonalMedicalMoney
())),
BigDecimalUtils
.
isNullToZero
(
payExists
.
getUnitInjuryMoney
())).
compareTo
(
BigDecimal
.
ZERO
)
>
0
)
{
logList
.
add
(
new
TPaymentInfoImportLog
(
null
,
infoVo
.
getEmpName
(),
infoVo
.
getEmpIdcard
()
,
CommonConstants
.
ERROR_MSG_PRFIX
+
"已存在对应员工身份证"
+
infoVo
.
getEmpIdcard
()
+
"的单位工伤缴费数据,请勿重复导入!"
,
i
,
random
));
continue
;
}
else
{
payExists
=
null
;
}
}
if
(
null
==
payExists
)
{
payExists
=
new
TPaymentInfo
();
payExists
.
setLockStatus
(
CommonConstants
.
ZERO_STRING
);
payExists
.
setEmpId
(
socialInfo
.
getEmpId
());
payExists
.
setEmpIdcard
(
socialInfo
.
getEmpIdcard
());
payExists
.
setEmpName
(
socialInfo
.
getEmpName
());
payExists
.
setEmpNo
(
socialInfo
.
getEmpNo
());
payExists
.
setSettleDomainId
(
socialInfo
.
getSettleDomain
());
payExists
.
setUnitId
(
socialInfo
.
getBelongUnit
());
payExists
.
setInauguralTeam
(
socialInfo
.
getInauguralTeam
());
payExists
.
setTelecomNumber
(
socialInfo
.
getTelecomNumber
());
}
payExists
.
setSocialProvince
(
socialInfo
.
getSocialProvince
());
payExists
.
setSocialCity
(
socialInfo
.
getSocialCity
());
payExists
.
setSocialTown
(
socialInfo
.
getSocialTown
());
payExists
.
setSocialHousehold
(
socialInfo
.
getSocialHousehold
());
payExists
.
setSocialPayMonth
(
infoVo
.
getSocialPayMonth
());
// 同时设置公积金缴纳日期方便导入处理
payExists
.
setProvidentPayMonth
(
infoVo
.
getSocialPayMonth
());
if
(
null
!=
payExists
.
getSocialProvince
())
{
temp
=
areaMap
.
get
(
payExists
.
getSocialProvince
());
if
(
Common
.
isNotNull
(
temp
))
{
payExists
.
setSocialPayAddr
(
temp
);
}
}
if
(
null
!=
payExists
.
getSocialCity
())
{
temp
=
areaMap
.
get
(
payExists
.
getSocialCity
());
if
(
Common
.
isNotNull
(
temp
))
{
payExists
.
setSocialPayAddr
(
payExists
.
getSocialPayAddr
()
+
CommonConstants
.
CENTER_SPLIT_LINE_STRING
+
temp
);
}
}
if
(
null
!=
payExists
.
getSocialTown
())
{
temp
=
areaMap
.
get
(
payExists
.
getSocialTown
());
if
(
Common
.
isNotNull
(
temp
))
{
payExists
.
setSocialPayAddr
(
payExists
.
getSocialPayAddr
()
+
CommonConstants
.
CENTER_SPLIT_LINE_STRING
+
temp
);
}
}
payExists
.
setSocialSecurityNo
(
infoVo
.
getSocialSecurityNo
());
payExists
.
setSocialCreateMonth
(
infoVo
.
getSocialCreateMonth
());
if
(
PaymentConstants
.
PENSION_RISK
.
equals
(
infoVo
.
getRiskType
()))
{
payExists
.
setUnitPensionMoney
(
infoVo
.
getUnitMoney
());
payExists
.
setPersonalPensionMoney
(
infoVo
.
getPersonalMoney
());
payExists
.
setUnitPensionSet
(
infoVo
.
getUnitSet
());
payExists
.
setPersonalPensionSet
(
infoVo
.
getPersonalSet
());
payExists
.
setUnitPensionMoney
(
infoVo
.
getUnitMoney
());
payExists
.
setPersonalPensionMoney
(
infoVo
.
getPersonalMoney
());
payExists
.
setUnitPensionSet
(
infoVo
.
getUnitSet
());
payExists
.
setPersonalPensionSet
(
infoVo
.
getPersonalSet
());
payExists
.
setUnitSocialSum
(
BigDecimalUtils
.
safeAdd
(
payExists
.
getUnitPensionMoney
()
,
payExists
.
getUnitSocialSum
()));
payExists
.
setSocialSecurityPersonalSum
(
BigDecimalUtils
.
safeAdd
(
payExists
.
getPersonalPensionMoney
()
,
payExists
.
getSocialSecurityPersonalSum
()));
}
if
(
PaymentConstants
.
UNEMPLOYEEMENT_RISK
.
equals
(
infoVo
.
getRiskType
()))
{
payExists
.
setUnitUnemploymentMoney
(
infoVo
.
getUnitMoney
());
payExists
.
setPersonalUnemploymentMoney
(
infoVo
.
getPersonalMoney
());
payExists
.
setUnitUnemploymentSet
(
infoVo
.
getUnitSet
());
payExists
.
setPersonalUnemploymentSet
(
infoVo
.
getPersonalSet
());
payExists
.
setUnitUnemploymentMoney
(
infoVo
.
getUnitMoney
());
payExists
.
setPersonalUnemploymentMoney
(
infoVo
.
getPersonalMoney
());
payExists
.
setUnitUnemploymentSet
(
infoVo
.
getUnitSet
());
payExists
.
setPersonalUnemploymentSet
(
infoVo
.
getPersonalSet
());
payExists
.
setUnitSocialSum
(
BigDecimalUtils
.
safeAdd
(
payExists
.
getUnitUnemploymentMoney
()
,
payExists
.
getUnitSocialSum
()));
payExists
.
setSocialSecurityPersonalSum
(
BigDecimalUtils
.
safeAdd
(
payExists
.
getPersonalUnemploymentMoney
()
,
payExists
.
getSocialSecurityPersonalSum
()));
}
if
(
PaymentConstants
.
INJURY_RISK
.
equals
(
infoVo
.
getRiskType
()))
{
payExists
.
setUnitInjuryMoney
(
infoVo
.
getUnitMoney
());
payExists
.
setUnitInjurySet
(
infoVo
.
getUnitSet
());
payExists
.
setUnitInjuryMoney
(
infoVo
.
getUnitMoney
());
payExists
.
setUnitInjurySet
(
infoVo
.
getUnitSet
());
payExists
.
setUnitSocialSum
(
BigDecimalUtils
.
safeAdd
(
payExists
.
getUnitInjuryMoney
()
,
payExists
.
getUnitSocialSum
()));
}
if
(
CommonConstants
.
ONE_STRING
.
equals
(
type
))
{
payExists
.
setUnitMedicalMoney
(
infoVo
.
getUnitMedicalMoney
());
payExists
.
setUnitMedicalSet
(
infoVo
.
getMedicalSet
());
payExists
.
setPersonalMedicalMoney
(
infoVo
.
getPersonalMedicalMoney
());
payExists
.
setPersonalMedicalSet
(
infoVo
.
getMedicalSet
());
payExists
.
setPersonalBigmailmentMoney
(
infoVo
.
getPersonalBigailmentMoney
());
payExists
.
setUnitBigmailmentMoney
(
infoVo
.
getUnitBigailmentMoney
());
payExists
.
setUnitMedicalMoney
(
infoVo
.
getUnitMedicalMoney
());
payExists
.
setUnitMedicalSet
(
infoVo
.
getMedicalSet
());
payExists
.
setPersonalMedicalMoney
(
infoVo
.
getPersonalMedicalMoney
());
payExists
.
setPersonalMedicalSet
(
infoVo
.
getMedicalSet
());
payExists
.
setPersonalBigmailmentMoney
(
infoVo
.
getPersonalBigailmentMoney
());
payExists
.
setUnitBigmailmentMoney
(
infoVo
.
getUnitBigailmentMoney
());
payExists
.
setSocialSecurityNo
(
infoVo
.
getSocialSecurityNo
());
payExists
.
setUnitSocialSum
(
BigDecimalUtils
.
safeAdd
(
payExists
.
getUnitMedicalMoney
()
,
payExists
.
getUnitBigmailmentMoney
()
,
payExists
.
getUnitSocialSum
()));
payExists
.
setSocialSecurityPersonalSum
(
BigDecimalUtils
.
safeAdd
(
payExists
.
getPersonalMedicalMoney
()
,
payExists
.
getPersonalBigmailmentMoney
()
,
payExists
.
getSocialSecurityPersonalSum
()));
}
payExists
.
setSocialSum
(
BigDecimalUtils
.
safeAdd
(
payExists
.
getUnitSocialSum
(),
payExists
.
getSocialSecurityPersonalSum
()));
payExists
.
setSumAll
(
payExists
.
getSocialSum
());
if
(
null
!=
payExists
&&
Common
.
isEmpty
(
payExists
.
getSocialId
()))
{
payExists
.
setSocialId
(
UUID
.
randomUUID
().
toString
());
}
if
(
null
!=
payExists
&&
Common
.
isNotNull
(
payExists
.
getId
()))
{
res
=
baseMapper
.
updateById
(
payExists
);
if
(
res
<
0
)
{
logList
.
add
(
new
TPaymentInfoImportLog
(
null
,
infoVo
.
getEmpName
(),
infoVo
.
getEmpIdcard
()
,
CommonConstants
.
SUCCESS_MSG_PREFIX
+
"保存成功!"
,
i
,
random
));
}
finally
{
RedisDistributedLock
.
unlock
(
lockKey
,
result
);
,
CommonConstants
.
ERROR_MSG_PRFIX
+
infoVo
.
getEmpIdcard
()
+
"_缴费库更新失败!"
,
i
,
random
));
continue
;
}
else
{
logList
.
add
(
new
TPaymentInfoImportLog
(
null
,
infoVo
.
getEmpName
(),
infoVo
.
getEmpIdcard
()
,
CommonConstants
.
SUCCESS_MSG_PREFIX
+
infoVo
.
getEmpIdcard
()
+
"_缴费库更新成功!"
,
i
,
random
));
continue
;
}
}
else
{
logList
.
add
(
new
TPaymentInfoImportLog
(
null
,
infoVo
.
getEmpName
(),
infoVo
.
getEmpIdcard
()
,
CommonConstants
.
ERROR_MSG_PRFIX
+
"竞争导入失败,请重新导入!"
,
i
,
random
));
res
=
insertAndSTimestamp
(
payExists
);
if
(
res
<
0
)
{
logList
.
add
(
new
TPaymentInfoImportLog
(
null
,
infoVo
.
getEmpName
(),
infoVo
.
getEmpIdcard
()
,
CommonConstants
.
ERROR_MSG_PRFIX
+
infoVo
.
getEmpIdcard
()
+
"_缴费库保存失败!"
,
i
,
random
));
continue
;
}
}
logList
.
add
(
new
TPaymentInfoImportLog
(
null
,
infoVo
.
getEmpName
(),
infoVo
.
getEmpIdcard
()
,
CommonConstants
.
SUCCESS_MSG_PREFIX
+
"保存成功!"
,
i
,
random
));
}
}
else
{
return
null
;
...
...
@@ -2096,7 +2196,8 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
/**
* 导入校验
**/
private
boolean
socialThreeCheckBase
(
String
random
,
int
i
,
List
<
TPaymentInfoImportLog
>
logList
,
TPaymentHeFeiVo
infoVo
,
String
type
)
{
private
boolean
socialThreeCheckBase
(
String
random
,
int
i
,
List
<
TPaymentInfoImportLog
>
logList
,
TPaymentHeFeiVo
infoVo
,
String
type
)
{
if
(!
Common
.
isNotNull
(
infoVo
.
getSocialPayMonth
()))
{
logList
.
add
(
new
TPaymentInfoImportLog
(
null
,
infoVo
.
getEmpName
(),
infoVo
.
getEmpIdcard
()
,
CommonConstants
.
ERROR_MSG_PRFIX
+
"社保缴纳月份不可为空!"
,
i
,
random
));
...
...
@@ -2122,54 +2223,11 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
return
false
;
}
/**
* 字段对应
**/
private
TPaymentInfo
reflectionPaymentInfo
(
TPaymentInfoVo
from
)
{
TPaymentInfo
to
=
new
TPaymentInfo
();
if
(
Common
.
isNotNull
(
from
))
{
to
.
setId
(
from
.
getId
());
to
.
setEmpName
(
from
.
getEmpName
());
to
.
setEmpNo
(
from
.
getEmpNo
());
to
.
setEmpId
(
from
.
getEmpId
());
to
.
setEmpIdcard
(
from
.
getEmpIdcard
());
to
.
setUnitId
(
from
.
getUnitId
());
to
.
setSettleDomainId
(
from
.
getSettleDomainId
());
to
.
setSocialHousehold
(
from
.
getSocialHousehold
());
to
.
setSocialSecurityNo
(
from
.
getSocialSecurityNo
());
to
.
setSocialPayAddr
(
from
.
getSocialPayAddr
());
to
.
setSocialProvince
(
from
.
getSocialProvince
());
to
.
setSocialCity
(
from
.
getSocialCity
());
to
.
setSocialTown
(
from
.
getSocialTown
());
to
.
setSocialCreateMonth
(
from
.
getSocialCreateMonth
());
to
.
setSocialPayMonth
(
from
.
getSocialPayMonth
());
to
.
setLockStatus
(
from
.
getLockStatus
());
to
.
setProvidentPayMonth
(
from
.
getProvidentPayMonth
());
to
.
setProvidentCreateMonth
(
from
.
getProvidentCreateMonth
());
to
.
setProvidentHousehold
(
from
.
getProvidentHousehold
());
to
.
setProvidentPayAddr
(
from
.
getProvidentPayAddr
());
to
.
setFundProvince
(
from
.
getFundProvince
());
to
.
setFundCity
(
from
.
getFundCity
());
to
.
setFundTown
(
from
.
getFundTown
());
to
.
setSumAll
(
from
.
getSumAll
());
to
.
setSocialId
(
from
.
getSocialId
());
to
.
setFundId
(
from
.
getFundId
());
to
.
setSocialSum
(
from
.
getSocialSum
());
to
.
setUnitSocialSum
(
from
.
getUnitSocialSum
());
to
.
setSocialSecurityPersonalSum
(
from
.
getSocialSecurityPersonalSum
());
to
.
setProvidentSum
(
from
.
getProvidentSum
());
to
.
setSocialSettlementId
(
from
.
getSocialSettlementId
());
to
.
setFundSettlementId
(
from
.
getFundSettlementId
());
to
.
setInauguralTeam
(
from
.
getInauguralTeam
());
to
.
setTelecomNumber
(
from
.
getTelecomNumber
());
}
return
to
;
}
/**
* 转换缴纳地址为省市县ID
**/
private
TPaymentHeFeiVo
initAddressThree
(
String
[]
areaArray
,
HashMap
<
String
,
String
>
areaMap2
,
TPaymentHeFeiVo
s
)
{
private
TPaymentHeFeiVo
initAddressThree
(
String
[]
areaArray
,
HashMap
<
String
,
String
>
areaMap2
,
TPaymentHeFeiVo
s
)
{
if
(
null
==
areaArray
||
null
==
areaMap2
||
null
==
s
)
{
return
s
;
}
...
...
@@ -2208,7 +2266,8 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
* @Author huyc
* @Date 2022-07-27
**/
private
boolean
checkImportInfo
(
String
random
,
int
i
,
List
<
TPaymentInfoImportLog
>
logList
,
TPaymentInfoVo
payExists
private
boolean
checkImportInfo
(
String
random
,
int
i
,
List
<
TPaymentInfoImportLog
>
logList
,
TPaymentInfoVo
payExists
,
TPaymentHeFeiVo
infoVo
,
String
type
)
{
boolean
flag
;
if
(
CommonConstants
.
ZERO_STRING
.
equals
(
type
))
{
...
...
@@ -2318,17 +2377,17 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
}
}
}
else
{
}
else
{
return
null
;
}
}
else
if
(
areaArray
.
length
==
1
)
{
}
else
if
(
areaArray
.
length
==
1
)
{
if
(
null
!=
s
.
getFundProvince
()
&&
null
==
s
.
getFundCity
())
{
if
(
areaArray
[
0
].
equals
(
areaMap
.
get
(
String
.
valueOf
(
s
.
getFundProvince
()))))
{
return
s
;
}
}
else
{
return
null
;
}
else
{
return
null
;
}
}
return
null
;
...
...
yifu-social/yifu-social-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/social/service/impl/TPreDispatchInfoServiceImpl.java
View file @
5e125b03
...
...
@@ -1190,7 +1190,7 @@ public class TPreDispatchInfoServiceImpl extends ServiceImpl<TPreDispatchInfoMap
return
"公积金基数不可为空!"
;
}
if
(
Common
.
isNullOrZero
(
tPreDispatchInfo
.
getFundCompanyPer
()))
{
return
"公积金
单位
比例不可为空!"
;
return
"公积金
企业
比例不可为空!"
;
}
if
(
Common
.
isNullOrZero
(
tPreDispatchInfo
.
getFundPersonalPer
()))
{
return
"公积个人比例不可为空!"
;
...
...
yifu-social/yifu-social-biz/src/main/resources/mapper/TPaymentInfoMapper.xml
View file @
5e125b03
...
...
@@ -958,15 +958,10 @@
FROM t_payment_info a
where 1=1
<if
test=
"months != null and months.size > 0"
>
AND
(
a.SOCIAL_PAY_MONTH in
AND a.SOCIAL_PAY_MONTH in
<foreach
item=
"item"
index=
"index"
collection=
"months"
open=
"("
separator=
","
close=
")"
>
#{item}
</foreach>
or a.PROVIDENT_PAY_MONTH in
<foreach
item=
"item"
index=
"index"
collection=
"months"
open=
"("
separator=
","
close=
")"
>
#{item}
</foreach>
)
</if>
<if
test=
"idcards != null and idcards.size > 0"
>
AND a.EMP_IDCARD IN
...
...
@@ -976,31 +971,6 @@
</if>
</select>
<!--tPaymentInfo 按ID查收缴费库包含社保和公积金明细的数据查询-->
<select
id=
"selectPaymentAllInfoByMonthAndIdCard"
resultMap=
"tPaymentAllInfoMap"
>
SELECT
<include
refid=
"base_column_list_all"
/>
,
FROM t_payment_info a
where 1=1
<if
test=
"months != null and months.size > 0"
>
AND (a.SOCIAL_PAY_MONTH in
<foreach
item=
"item"
index=
"index"
collection=
"months"
open=
"("
separator=
","
close=
")"
>
#{item}
</foreach>
or a.PROVIDENT_PAY_MONTH in
<foreach
item=
"item"
index=
"index"
collection=
"months"
open=
"("
separator=
","
close=
")"
>
#{item}
</foreach>
)
</if>
<if
test=
"idcards != null and idcards.size > 0"
>
AND A.EMP_IDCARD IN
<foreach
item=
"item"
index=
"index"
collection=
"idcards"
open=
"("
separator=
","
close=
")"
>
#{item}
</foreach>
</if>
</select>
<!--tPaymentInfo 查询缴费库要删除的数据-->
<select
id=
"selectListForDelete"
resultType=
"com.yifu.cloud.plus.v1.yifu.social.entity.TPaymentInfo"
>
select
...
...
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