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
2fd051b4
Commit
2fd051b4
authored
Aug 05, 2025
by
hongguangwu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MVP1.7.14-薪资人员导入校验优化
parent
02b99fa2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
113 additions
and
102 deletions
+113
-102
TSalaryEmployeeServiceImpl.java
.../yifu/salary/service/impl/TSalaryEmployeeServiceImpl.java
+113
-102
No files found.
yifu-salary/yifu-salary-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/salary/service/impl/TSalaryEmployeeServiceImpl.java
View file @
2fd051b4
...
@@ -870,7 +870,7 @@ public class TSalaryEmployeeServiceImpl extends ServiceImpl<TSalaryEmployeeMappe
...
@@ -870,7 +870,7 @@ public class TSalaryEmployeeServiceImpl extends ServiceImpl<TSalaryEmployeeMappe
if
(
Common
.
isNotNull
(
emp
.
getBankNo
())
&&
!
emp
.
getBankNo
().
equals
(
old
.
getBankNo
())
if
(
Common
.
isNotNull
(
emp
.
getBankNo
())
&&
!
emp
.
getBankNo
().
equals
(
old
.
getBankNo
())
&&
bankCheckMap
.
get
(
emp
.
getBankNo
())
!=
null
&&
bankCheckMap
.
get
(
emp
.
getBankNo
())
!=
null
&&
Boolean
.
FALSE
.
equals
(
bankCheckMap
.
get
(
emp
.
getBankNo
())))
{
&&
Boolean
.
FALSE
.
equals
(
bankCheckMap
.
get
(
emp
.
getBankNo
())))
{
errorMessageList
.
add
(
new
ErrorMessage
(
excel
.
getRowIndex
(),
"【姓名与卡号】校验结果:不匹配。请更改卡号或姓名后重试!
!
"
));
errorMessageList
.
add
(
new
ErrorMessage
(
excel
.
getRowIndex
(),
"【姓名与卡号】校验结果:不匹配。请更改卡号或姓名后重试!"
));
continue
;
continue
;
}
}
...
@@ -1003,8 +1003,24 @@ public class TSalaryEmployeeServiceImpl extends ServiceImpl<TSalaryEmployeeMappe
...
@@ -1003,8 +1003,24 @@ public class TSalaryEmployeeServiceImpl extends ServiceImpl<TSalaryEmployeeMappe
// 本表重复的手机号,不允许导入该行
// 本表重复的手机号,不允许导入该行
Map
<
String
,
Integer
>
phoneRepeatMap
=
new
HashMap
<>();
Map
<
String
,
Integer
>
phoneRepeatMap
=
new
HashMap
<>();
Integer
phoneCount
;
Integer
phoneCount
;
List
<
TCheckBankNo
>
bankList
=
new
ArrayList
<>();
TCheckBankNo
checkBankNo
;
List
<
TCheckIdCard
>
checkList
=
new
ArrayList
<>();
YifuUser
user
=
SecurityUtils
.
getUser
();
if
(
user
==
null
||
Common
.
isEmpty
(
user
.
getId
()))
{
return
R
.
failed
(
"请登录!"
);
}
TCheckIdCard
idCardCheck
;
for
(
TSalaryEmployee
emp
:
excelVOList
)
{
for
(
TSalaryEmployee
emp
:
excelVOList
)
{
idCardList
.
add
(
emp
.
getEmpIdcard
());
if
(
Common
.
isNotNull
(
emp
.
getEmpIdcard
()))
{
idCardCheck
=
new
TCheckIdCard
();
idCardCheck
.
setIdCard
(
emp
.
getEmpIdcard
());
idCardCheck
.
setName
(
emp
.
getEmpName
());
idCardCheck
.
setCreateUser
(
user
.
getId
());
idCardCheck
.
setReason
(
user
.
getNickname
());
checkList
.
add
(
idCardCheck
);
idCardList
.
add
(
emp
.
getEmpIdcard
());
}
if
(
Common
.
isNotNull
(
emp
.
getEmpPhone
()))
{
if
(
Common
.
isNotNull
(
emp
.
getEmpPhone
()))
{
phoneCount
=
phoneMap
.
get
(
emp
.
getEmpPhone
());
phoneCount
=
phoneMap
.
get
(
emp
.
getEmpPhone
());
if
(
phoneCount
==
null
)
{
if
(
phoneCount
==
null
)
{
...
@@ -1014,6 +1030,12 @@ public class TSalaryEmployeeServiceImpl extends ServiceImpl<TSalaryEmployeeMappe
...
@@ -1014,6 +1030,12 @@ public class TSalaryEmployeeServiceImpl extends ServiceImpl<TSalaryEmployeeMappe
phoneRepeatMap
.
put
(
emp
.
getEmpPhone
(),
CommonConstants
.
ONE_INT
);
phoneRepeatMap
.
put
(
emp
.
getEmpPhone
(),
CommonConstants
.
ONE_INT
);
}
}
}
}
if
(
Common
.
isNotNull
(
emp
.
getBankNo
())
&&
Common
.
isNotNull
(
emp
.
getEmpName
()))
{
checkBankNo
=
new
TCheckBankNo
();
checkBankNo
.
setName
(
emp
.
getEmpName
());
checkBankNo
.
setBankNo
(
emp
.
getBankNo
());
bankList
.
add
(
checkBankNo
);
}
}
}
List
<
TSalaryEmployee
>
empList
=
baseMapper
.
getListByIdCard
(
idCardList
);
List
<
TSalaryEmployee
>
empList
=
baseMapper
.
getListByIdCard
(
idCardList
);
...
@@ -1050,11 +1072,42 @@ public class TSalaryEmployeeServiceImpl extends ServiceImpl<TSalaryEmployeeMappe
...
@@ -1050,11 +1072,42 @@ public class TSalaryEmployeeServiceImpl extends ServiceImpl<TSalaryEmployeeMappe
// 校验卡号所用的
// 校验卡号所用的
Map
<
String
,
Boolean
>
bankCheckMap
=
new
HashMap
<>();
Map
<
String
,
Boolean
>
bankCheckMap
=
new
HashMap
<>();
List
<
TCheckBankNo
>
bankList
=
new
ArrayList
<>();
Map
<
String
,
Boolean
>
phoneCheckMap
=
new
HashMap
<>();
TCheckBankNo
checkBankNo
;
Map
<
String
,
Boolean
>
idCardMap
=
new
HashMap
<>();
if
(!
phoneList
.
isEmpty
())
{
R
<
CheckBatchVo
>
phoneR
=
HttpDaprUtil
.
invokeMethodPost
(
checkProperties
.
getAppUrl
(),
checkProperties
.
getAppId
()
,
"/tcheckmobile/inner/checkMobileBatch"
,
phoneList
,
CheckBatchVo
.
class
,
SecurityConstants
.
FROM_IN
);
if
(
phoneR
!=
null
&&
phoneR
.
getData
()
!=
null
)
{
phoneCheckMap
=
phoneR
.
getData
().
getCheckMap
();
}
}
if
(!
bankList
.
isEmpty
())
{
R
<
CheckBatchVo
>
checkListR
=
HttpDaprUtil
.
invokeMethodPost
(
checkProperties
.
getAppUrl
(),
checkProperties
.
getAppId
()
,
"/tcheckbankno/inner/checkBankNoBatch"
,
bankList
,
CheckBatchVo
.
class
,
SecurityConstants
.
FROM_IN
);
if
(
checkListR
!=
null
&&
checkListR
.
getData
()
!=
null
)
{
bankCheckMap
=
checkListR
.
getData
().
getCheckMap
();
}
}
if
(!
checkList
.
isEmpty
())
{
R
<
CheckBatchVo
>
idCardR
=
HttpDaprUtil
.
invokeMethodPost
(
checkProperties
.
getAppUrl
(),
checkProperties
.
getAppId
()
,
"/tcheckidcard/inner/checkIdCardBatch"
,
checkList
,
CheckBatchVo
.
class
,
SecurityConstants
.
FROM_IN
);
if
(
idCardR
!=
null
&&
idCardR
.
getData
()
!=
null
)
{
idCardMap
=
idCardR
.
getData
().
getCheckMap
();
}
}
int
idCardFlag
=
0
;
if
(
idCardMap
!=
null
&&
!
idCardMap
.
isEmpty
())
{
if
(
idCardMap
.
get
(
"全部正确"
)
!=
null
)
{
idCardFlag
=
1
;
}
if
(
idCardMap
.
get
(
"全部错误"
)
!=
null
)
{
idCardFlag
=
2
;
}
}
String
idCard
;
String
idCard
;
boolean
phoneFlag
;
boolean
phoneFlag
;
Boolean
resultB
;
for
(
int
i
=
0
;
i
<
excelVOList
.
size
();
i
++)
{
for
(
int
i
=
0
;
i
<
excelVOList
.
size
();
i
++)
{
excel
=
excelVOList
.
get
(
i
);
excel
=
excelVOList
.
get
(
i
);
if
(
excel
!=
null
)
{
if
(
excel
!=
null
)
{
...
@@ -1148,14 +1201,15 @@ public class TSalaryEmployeeServiceImpl extends ServiceImpl<TSalaryEmployeeMappe
...
@@ -1148,14 +1201,15 @@ public class TSalaryEmployeeServiceImpl extends ServiceImpl<TSalaryEmployeeMappe
emp
.
setDeptNo
(
dept
.
getDepartNo
());
emp
.
setDeptNo
(
dept
.
getDepartNo
());
emp
.
setInvoiceTitle
(
dept
.
getInvoiceTitleSalary
());
emp
.
setInvoiceTitle
(
dept
.
getInvoiceTitleSalary
());
if
(
Common
.
isNotNull
(
excel
.
getBankNo
()))
{
if
(
Common
.
isNotNull
(
excel
.
getBankNo
())
&&
bankCheckMap
.
get
(
excel
.
getBankNo
())
!=
null
checkBankNo
=
new
TCheckBankNo
();
&&
Boolean
.
FALSE
.
equals
(
bankCheckMap
.
get
(
excel
.
getBankNo
())))
{
emp
.
setLineNums
((
i
));
errorMessageList
.
add
(
new
ErrorMessage
((
i
),
"【姓名与卡号】校验结果:不匹配。请更改卡号或姓名后重试!"
));
checkBankNo
.
setName
(
excel
.
getEmpName
());
continue
;
checkBankNo
.
setBankNo
(
excel
.
getBankNo
());
bankList
.
add
(
checkBankNo
);
}
}
// 处理省市
doSetIntegerAreaByEmp
(
emp
);
emp
.
setIssueStatus
(
CommonConstants
.
ZERO_INT
);
emp
.
setLineNums
(
null
);
updateList
.
add
(
emp
);
updateList
.
add
(
emp
);
if
(
curTaxMonth
)
{
if
(
curTaxMonth
)
{
errorMessageList
.
add
(
new
ErrorMessage
((
i
),
SalaryConstants
.
CUR_TAX_INFO
));
errorMessageList
.
add
(
new
ErrorMessage
((
i
),
SalaryConstants
.
CUR_TAX_INFO
));
...
@@ -1189,43 +1243,57 @@ public class TSalaryEmployeeServiceImpl extends ServiceImpl<TSalaryEmployeeMappe
...
@@ -1189,43 +1243,57 @@ public class TSalaryEmployeeServiceImpl extends ServiceImpl<TSalaryEmployeeMappe
errorMessageList
.
add
(
new
ErrorMessage
((
i
),
SalaryConstants
.
BANK_NAME_ERROR
));
errorMessageList
.
add
(
new
ErrorMessage
((
i
),
SalaryConstants
.
BANK_NAME_ERROR
));
continue
;
continue
;
}
}
String
pre
=
this
.
checkNewEmpBankAndPhone
(
excel
,
true
);
if
(
idCardFlag
==
0
)
{
if
(
pre
!=
null
)
{
if
(
Common
.
isNotNull
(
idCard
))
{
errorMessageList
.
add
(
new
ErrorMessage
((
i
),
pre
));
resultB
=
idCardMap
.
get
(
idCard
+
CommonConstants
.
DOWN_LINE_STRING
+
excel
.
getEmpName
());
continue
;
if
(
resultB
!=
null
)
{
}
else
{
if
(
Boolean
.
FALSE
.
equals
(
resultB
))
{
areaProvince
=
ExcelUtil
.
getRedisAreaValue
(
CacheConstants
.
AREA_VALUE
+
excel
.
getBankProvince
().
trim
());
errorMessageList
.
add
(
new
ErrorMessage
((
i
),
"姓名&身份证号不一致,请检查并修改后重新导入"
));
if
(
Common
.
isNotNull
(
areaProvince
))
{
continue
;
areaCity
=
ExcelUtil
.
getRedisAreaValue
(
CacheConstants
.
AREA_VALUE
+
excel
.
getBankCity
().
trim
()
}
+
CommonConstants
.
DOWN_LINE_STRING
+
excel
.
getBankProvince
().
trim
());
excel
.
setBankProvince
(
areaProvince
);
if
(
Common
.
isNotNull
(
areaCity
))
{
excel
.
setBankCity
(
areaCity
);
}
else
{
}
else
{
errorMessageList
.
add
(
new
ErrorMessage
((
i
),
SalaryConstants
.
CITY_ERROR
));
errorMessageList
.
add
(
new
ErrorMessage
((
i
),
"姓名&身份证号不一致,请检查并修改后重新导入!"
));
continue
;
continue
;
}
}
}
}
else
if
(
idCardFlag
==
2
)
{
errorMessageList
.
add
(
new
ErrorMessage
((
i
),
"姓名&身份证号不一致,请检查并修改后重新导入!!"
));
continue
;
}
areaProvince
=
ExcelUtil
.
getRedisAreaValue
(
CacheConstants
.
AREA_VALUE
+
excel
.
getBankProvince
().
trim
());
if
(
Common
.
isNotNull
(
areaProvince
))
{
areaCity
=
ExcelUtil
.
getRedisAreaValue
(
CacheConstants
.
AREA_VALUE
+
excel
.
getBankCity
().
trim
()
+
CommonConstants
.
DOWN_LINE_STRING
+
excel
.
getBankProvince
().
trim
());
excel
.
setBankProvince
(
areaProvince
);
if
(
Common
.
isNotNull
(
areaCity
))
{
excel
.
setBankCity
(
areaCity
);
}
else
{
}
else
{
errorMessageList
.
add
(
new
ErrorMessage
((
i
),
SalaryConstants
.
PROVINCE
_ERROR
));
errorMessageList
.
add
(
new
ErrorMessage
((
i
),
SalaryConstants
.
CITY
_ERROR
));
continue
;
continue
;
}
}
excel
.
setUnitId
(
dept
.
getCustomerId
());
}
else
{
excel
.
setUnitName
(
dept
.
getCustomerName
());
errorMessageList
.
add
(
new
ErrorMessage
((
i
),
SalaryConstants
.
PROVINCE_ERROR
));
excel
.
setUnitNo
(
dept
.
getCustomerNo
());
continue
;
excel
.
setDeptId
(
dept
.
getId
());
}
excel
.
setDeptName
(
dept
.
getDepartName
());
excel
.
setUnitId
(
dept
.
getCustomerId
());
excel
.
setDeptNo
(
dept
.
getDepartNo
());
excel
.
setUnitName
(
dept
.
getCustomerName
());
excel
.
setInvoiceTitle
(
dept
.
getInvoiceTitleSalary
());
excel
.
setUnitNo
(
dept
.
getCustomerNo
());
if
(
Common
.
isNotNull
(
excel
.
getBankNo
()))
{
excel
.
setDeptId
(
dept
.
getId
());
checkBankNo
=
new
TCheckBankNo
();
excel
.
setDeptName
(
dept
.
getDepartName
());
excel
.
setLineNums
((
i
));
excel
.
setDeptNo
(
dept
.
getDepartNo
());
checkBankNo
.
setName
(
excel
.
getEmpName
());
excel
.
setInvoiceTitle
(
dept
.
getInvoiceTitleSalary
());
checkBankNo
.
setBankNo
(
excel
.
getBankNo
());
if
(
Common
.
isNotNull
(
excel
.
getBankNo
())
&&
bankCheckMap
.
get
(
excel
.
getBankNo
())
!=
null
bankList
.
add
(
checkBankNo
);
&&
Boolean
.
FALSE
.
equals
(
bankCheckMap
.
get
(
excel
.
getBankNo
())))
{
}
errorMessageList
.
add
(
new
ErrorMessage
((
i
),
"【姓名与卡号】校验结果:不匹配。请更改卡号或姓名后重试!!"
));
saveList
.
add
(
excel
);
continue
;
errorMessageList
.
add
(
new
ErrorMessage
((
i
),
CommonConstants
.
SAVE_SUCCESS
));
}
}
// 处理省市
doSetIntegerAreaByEmp
(
excel
);
excel
.
setIssueStatus
(
CommonConstants
.
ZERO_INT
);
excel
.
setLineNums
(
null
);
saveList
.
add
(
excel
);
errorMessageList
.
add
(
new
ErrorMessage
((
i
),
CommonConstants
.
SAVE_SUCCESS
));
}
}
}
}
}
else
{
}
else
{
...
@@ -1235,71 +1303,14 @@ public class TSalaryEmployeeServiceImpl extends ServiceImpl<TSalaryEmployeeMappe
...
@@ -1235,71 +1303,14 @@ public class TSalaryEmployeeServiceImpl extends ServiceImpl<TSalaryEmployeeMappe
errorMessageList
.
add
(
new
ErrorMessage
(
CommonConstants
.
ZERO_INT
,
SalaryConstants
.
DATA_MUST
));
errorMessageList
.
add
(
new
ErrorMessage
(
CommonConstants
.
ZERO_INT
,
SalaryConstants
.
DATA_MUST
));
}
}
}
}
Map
<
String
,
Boolean
>
phoneCheckMap
=
new
HashMap
<>();
if
(!
phoneList
.
isEmpty
())
{
R
<
CheckBatchVo
>
phoneR
=
HttpDaprUtil
.
invokeMethodPost
(
checkProperties
.
getAppUrl
(),
checkProperties
.
getAppId
()
,
"/tcheckmobile/inner/checkMobileBatch"
,
phoneList
,
CheckBatchVo
.
class
,
SecurityConstants
.
FROM_IN
);
if
(
phoneR
!=
null
&&
phoneR
.
getData
()
!=
null
)
{
phoneCheckMap
=
phoneR
.
getData
().
getCheckMap
();
}
}
if
(!
bankList
.
isEmpty
())
{
R
<
CheckBatchVo
>
checkListR
=
HttpDaprUtil
.
invokeMethodPost
(
checkProperties
.
getAppUrl
(),
checkProperties
.
getAppId
()
,
"/tcheckbankno/inner/checkBankNoBatch"
,
bankList
,
CheckBatchVo
.
class
,
SecurityConstants
.
FROM_IN
);
if
(
checkListR
!=
null
&&
checkListR
.
getData
()
!=
null
)
{
bankCheckMap
=
checkListR
.
getData
().
getCheckMap
();
}
}
boolean
isCanSave
;
if
(!
updateList
.
isEmpty
())
{
if
(!
updateList
.
isEmpty
())
{
List
<
TSalaryEmployee
>
newUpdateList
=
new
ArrayList
<>();
// 校验挪到上面循环里
for
(
TSalaryEmployee
employee
:
updateList
)
{
this
.
updateBatchById
(
updateList
);
isCanSave
=
true
;
if
(
Common
.
isNotNull
(
employee
.
getBankNo
())
&&
bankCheckMap
.
get
(
employee
.
getBankNo
())
!=
null
&&
Boolean
.
FALSE
.
equals
(
bankCheckMap
.
get
(
employee
.
getBankNo
())))
{
errorMessageList
.
add
(
new
ErrorMessage
(
employee
.
getLineNums
(),
"第"
+
employee
.
getLineNums
()
+
"行:-上次代发户未校验【姓名与卡号】,本次校验结果:不匹配。请去薪酬人员查询处更新卡号信息!!"
));
isCanSave
=
false
;
}
if
(
Common
.
isNotNull
(
employee
.
getEmpPhone
())
&&
phoneCheckMap
.
get
(
employee
.
getEmpPhone
())
!=
null
&&
Boolean
.
FALSE
.
equals
(
phoneCheckMap
.
get
(
employee
.
getEmpPhone
())))
{
errorMessageList
.
add
(
new
ErrorMessage
(
employee
.
getLineNums
(),
"第"
+
employee
.
getLineNums
()
+
"行:手机号校验不通过,请更改手机号后重试"
));
isCanSave
=
false
;
}
if
(
isCanSave
)
{
employee
.
setIssueStatus
(
CommonConstants
.
ZERO_INT
);
employee
.
setLineNums
(
null
);
newUpdateList
.
add
(
employee
);
}
}
doSetIntegerArea
(
newUpdateList
);
this
.
updateBatchById
(
newUpdateList
);
}
}
if
(!
saveList
.
isEmpty
())
{
if
(!
saveList
.
isEmpty
())
{
List
<
TSalaryEmployee
>
newSaveList
=
new
ArrayList
<>();
// 校验挪到上面循环里
for
(
TSalaryEmployee
employee
:
saveList
)
{
this
.
saveBatch
(
saveList
);
isCanSave
=
true
;
if
(
Common
.
isNotNull
(
employee
.
getBankNo
())
&&
bankCheckMap
.
get
(
employee
.
getBankNo
())
!=
null
&&
Boolean
.
FALSE
.
equals
(
bankCheckMap
.
get
(
employee
.
getBankNo
())))
{
errorMessageList
.
add
(
new
ErrorMessage
(
employee
.
getLineNums
(),
"第"
+
employee
.
getLineNums
()
+
"行:-上次代发户未校验【姓名与卡号】,本次校验结果:不匹配。请去薪酬人员查询处更新卡号信息!!!"
));
isCanSave
=
false
;
}
if
(
Common
.
isNotNull
(
employee
.
getEmpPhone
())
&&
phoneCheckMap
.
get
(
employee
.
getEmpPhone
())
!=
null
&&
Boolean
.
FALSE
.
equals
(
phoneCheckMap
.
get
(
employee
.
getEmpPhone
())))
{
errorMessageList
.
add
(
new
ErrorMessage
(
employee
.
getLineNums
(),
"第"
+
employee
.
getLineNums
()
+
"行:手机号校验不通过,请更改手机号后重试!"
));
isCanSave
=
false
;
}
if
(
isCanSave
)
{
employee
.
setIssueStatus
(
CommonConstants
.
ZERO_INT
);
employee
.
setLineNums
(
null
);
newSaveList
.
add
(
employee
);
}
}
doSetIntegerArea
(
newSaveList
);
this
.
saveBatch
(
newSaveList
);
}
}
boolean
isTrue
=
true
;
boolean
isTrue
=
true
;
for
(
ErrorMessage
message
:
errorMessageList
)
{
for
(
ErrorMessage
message
:
errorMessageList
)
{
...
...
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