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
02b99fa2
Commit
02b99fa2
authored
Aug 05, 2025
by
hongguangwu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MVP1.7.14-手机号导入校验
parent
3baf1f8a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
98 additions
and
6 deletions
+98
-6
TSalaryEmployeeServiceImpl.java
.../yifu/salary/service/impl/TSalaryEmployeeServiceImpl.java
+98
-6
No files found.
yifu-salary/yifu-salary-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/salary/service/impl/TSalaryEmployeeServiceImpl.java
View file @
02b99fa2
...
...
@@ -712,28 +712,112 @@ public class TSalaryEmployeeServiceImpl extends ServiceImpl<TSalaryEmployeeMappe
/// 个性化校验逻辑
TSalaryEmployeeUpdateVo
excel
;
List
<
String
>
idCardList
=
new
ArrayList
<>();
// 查重,查非自己的手机号是否存在
List
<
String
>
phoneList
=
new
ArrayList
<>();
// 查本表重
Map
<
String
,
Integer
>
phoneMap
=
new
HashMap
<>();
// 本表重复的手机号,不允许导入该行
Map
<
String
,
Integer
>
phoneRepeatMap
=
new
HashMap
<>();
Integer
phoneCount
;
TCheckBankNo
checkBankNo
;
List
<
TCheckBankNo
>
bankList
=
new
ArrayList
<>();
// 执行数据插入操作 组装
for
(
TSalaryEmployeeUpdateVo
vo
:
excelVOList
)
{
idCardList
.
add
(
vo
.
getEmpIdcard
());
if
(
Common
.
isNotNull
(
vo
.
getEmpPhone
()))
{
phoneCount
=
phoneMap
.
get
(
vo
.
getEmpPhone
());
if
(
phoneCount
==
null
)
{
phoneMap
.
put
(
vo
.
getEmpPhone
(),
CommonConstants
.
ONE_INT
);
phoneList
.
add
(
vo
.
getEmpPhone
());
}
else
{
phoneRepeatMap
.
put
(
vo
.
getEmpPhone
(),
CommonConstants
.
ONE_INT
);
}
}
if
(
Common
.
isNotNull
(
vo
.
getBankNo
())
&&
Common
.
isNotNull
(
vo
.
getEmpName
()))
{
checkBankNo
=
new
TCheckBankNo
();
checkBankNo
.
setName
(
vo
.
getEmpName
());
checkBankNo
.
setBankNo
(
vo
.
getBankNo
());
bankList
.
add
(
checkBankNo
);
}
}
List
<
TSalaryEmployee
>
empList
=
baseMapper
.
getListByIdCard
(
idCardList
);
// 人员Map
Map
<
String
,
TSalaryEmployee
>
empMap
=
new
HashMap
<>();
for
(
TSalaryEmployee
e
:
empList
)
{
empMap
.
put
(
e
.
getEmpIdcard
(),
e
);
}
List
<
TSalaryEmployee
>
empPhoneList
=
baseMapper
.
getListByPhone
(
phoneList
);
// 人员手机号Map
Map
<
String
,
List
<
String
>>
empPhoneMap
=
new
HashMap
<>();
List
<
String
>
phoneIdCardList
;
for
(
TSalaryEmployee
e
:
empPhoneList
)
{
phoneIdCardList
=
empPhoneMap
.
get
(
e
.
getEmpPhone
());
if
(
phoneIdCardList
==
null
)
{
phoneIdCardList
=
new
ArrayList
<>();
}
phoneIdCardList
.
add
(
e
.
getEmpIdcard
());
empPhoneMap
.
put
(
e
.
getEmpPhone
(),
phoneIdCardList
);
}
TSalaryEmployee
emp
;
// 开户行省市的区域暂存
String
areaStr
;
boolean
curTaxMonth
;
Map
<
String
,
String
>
bankMap
=
tBankSetService
.
getBankMap
(
null
);
ExcelUtil
<
TSalaryEmployee
>
util
=
new
ExcelUtil
<>(
TSalaryEmployee
.
class
);
TSalaryEmployee
old
=
null
;
TSalaryEmployee
old
;
String
idCard
;
boolean
phoneFlag
;
// 校验卡号所用的
Map
<
String
,
Boolean
>
bankCheckMap
=
new
HashMap
<>();
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
();
}
}
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
();
}
}
for
(
int
i
=
0
;
i
<
excelVOList
.
size
();
i
++)
{
excel
=
excelVOList
.
get
(
i
);
if
(
excel
!=
null
)
{
if
(
Common
.
isNotNull
(
excel
.
getEmpIdcard
()))
{
emp
=
empMap
.
get
(
excel
.
getEmpIdcard
());
idCard
=
excel
.
getEmpIdcard
();
if
(
Common
.
isNotNull
(
idCard
))
{
if
(
Common
.
isNotNull
(
excel
.
getEmpPhone
()))
{
// 手机号本表重复,该条直接不给导入
if
(
phoneRepeatMap
.
get
(
excel
.
getEmpPhone
())
!=
null
)
{
errorMessageList
.
add
(
new
ErrorMessage
((
i
),
"该手机号在本次导入表中有重复,请检查并修改后重新导入"
));
continue
;
}
// 手机号与系统里重复
phoneIdCardList
=
empPhoneMap
.
get
(
excel
.
getEmpPhone
());
if
(
phoneIdCardList
!=
null
)
{
phoneFlag
=
false
;
for
(
String
phoneIdCard
:
phoneIdCardList
)
{
if
(!
idCard
.
equals
(
phoneIdCard
))
{
phoneFlag
=
true
;
break
;
}
}
if
(
phoneFlag
)
{
errorMessageList
.
add
(
new
ErrorMessage
((
i
),
"手机号已被占用,请更改手机号后重试"
));
continue
;
}
}
}
emp
=
empMap
.
get
(
idCard
);
old
=
new
TSalaryEmployee
();
if
(
Common
.
isNotNull
(
emp
)
&&
Common
.
isNotNull
(
emp
.
getId
()))
{
BeanUtil
.
copyProperties
(
emp
,
old
);
...
...
@@ -782,9 +866,17 @@ public class TSalaryEmployeeServiceImpl extends ServiceImpl<TSalaryEmployeeMappe
emp
.
setEmpName
(
excel
.
getEmpName
());
}
// 2024-2-4 16:05:56 hgw 银行卡需要校验
String
pre
=
getCheckBankNo
(
emp
,
old
);
if
(
pre
!=
null
)
{
errorMessageList
.
add
(
new
ErrorMessage
(
excel
.
getRowIndex
(),
pre
));
// 改为批量
if
(
Common
.
isNotNull
(
emp
.
getBankNo
())
&&
!
emp
.
getBankNo
().
equals
(
old
.
getBankNo
())
&&
bankCheckMap
.
get
(
emp
.
getBankNo
())
!=
null
&&
Boolean
.
FALSE
.
equals
(
bankCheckMap
.
get
(
emp
.
getBankNo
())))
{
errorMessageList
.
add
(
new
ErrorMessage
(
excel
.
getRowIndex
(),
"【姓名与卡号】校验结果:不匹配。请更改卡号或姓名后重试!!"
));
continue
;
}
if
(
Common
.
isNotNull
(
emp
.
getEmpPhone
())
&&
phoneCheckMap
.
get
(
emp
.
getEmpPhone
())
!=
null
&&
Boolean
.
FALSE
.
equals
(
phoneCheckMap
.
get
(
emp
.
getEmpPhone
())))
{
errorMessageList
.
add
(
new
ErrorMessage
(
excel
.
getRowIndex
(),
"手机号校验不通过,请更改手机号后重试!"
));
continue
;
}
// 变更日志 fxj 2023-10-24
...
...
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