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
b69335d0
Commit
b69335d0
authored
Jul 22, 2024
by
hongguangwu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MVP1.6.7-薪资导入相关
parent
0c66d60f
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
443 additions
and
256 deletions
+443
-256
TPreEmpMainServiceImpl.java
...v1/yifu/archives/service/impl/TPreEmpMainServiceImpl.java
+241
-230
TSalaryEmpModLog.java
...fu/cloud/plus/v1/yifu/salary/entity/TSalaryEmpModLog.java
+6
-6
TSalaryEmpModLogService.java
.../plus/v1/yifu/salary/service/TSalaryEmpModLogService.java
+2
-0
TSalaryEmployeeService.java
...d/plus/v1/yifu/salary/service/TSalaryEmployeeService.java
+8
-0
TSalaryEmpModLogServiceImpl.java
...yifu/salary/service/impl/TSalaryEmpModLogServiceImpl.java
+20
-10
TSalaryEmployeeServiceImpl.java
.../yifu/salary/service/impl/TSalaryEmployeeServiceImpl.java
+95
-0
SalaryAccountUtil.java
...ifu/cloud/plus/v1/yifu/salary/util/SalaryAccountUtil.java
+71
-10
No files found.
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/service/impl/TPreEmpMainServiceImpl.java
View file @
b69335d0
...
...
@@ -923,153 +923,72 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
* @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<java.lang.String>
**/
private
R
<
String
>
saveBase
(
PreEmpMainDetailVo
vo
,
String
status
)
{
YifuUser
user
=
getNewYifuUser
();
TPreEmpMain
main
=
vo
.
getMain
();
String
idCard
=
main
.
getEmpIdcard
();
if
(
Common
.
isNotNull
(
idCard
))
{
TPreEmployeeProject
tPreEmployeeProject
=
vo
.
getTpreEmployeeProject
();
if
(
tPreEmployeeProject
!=
null
&&
Common
.
isNotNull
(
tPreEmployeeProject
.
getOldId
()))
{
// 预入职-人员档案表
TPreEmployeeInfo
tPreEmployeeInfo
=
vo
.
getTpreEmployeeInfo
();
if
(
tPreEmployeeInfo
!=
null
&&
Common
.
isNotNull
(
tPreEmployeeInfo
.
getOldId
()))
{
// 转到更新档案去
return
updateToEmployeeByPre
(
vo
);
try
{
YifuUser
user
=
getNewYifuUser
();
String
idCard
=
main
.
getEmpIdcard
();
if
(
Common
.
isNotNull
(
idCard
))
{
TPreEmployeeProject
tPreEmployeeProject
=
vo
.
getTpreEmployeeProject
();
if
(
tPreEmployeeProject
!=
null
&&
Common
.
isNotNull
(
tPreEmployeeProject
.
getOldId
()))
{
// 预入职-人员档案表
TPreEmployeeInfo
tPreEmployeeInfo
=
vo
.
getTpreEmployeeInfo
();
if
(
tPreEmployeeInfo
!=
null
&&
Common
.
isNotNull
(
tPreEmployeeInfo
.
getOldId
()))
{
// 转到更新档案去
return
updateToEmployeeByPre
(
vo
);
}
else
{
return
R
.
failed
(
"档案原ID不可为空!"
);
}
}
else
{
return
R
.
failed
(
"档案原ID不可为空!"
);
}
}
else
{
main
.
setStatus
(
status
);
main
.
setCreateBy
(
user
.
getId
());
main
.
setCreateName
(
user
.
getNickname
());
main
.
setCreateTime
(
LocalDateTime
.
now
());
this
.
saveOrUpdate
(
main
);
String
mainId
=
main
.
getId
();
// 预入职-员工不良记录表
TPreEmpBadRecord
tPreEmpBadRecord
=
vo
.
getTpreEmpBadRecord
();
if
(
tPreEmpBadRecord
!=
null
)
{
tPreEmpBadRecord
.
setPreMainId
(
mainId
);
tPreEmpBadRecord
.
setCreateBy
(
user
.
getId
());
tPreEmpBadRecord
.
setCreateName
(
user
.
getNickname
());
tPreEmpBadRecord
.
setCreateTime
(
LocalDateTime
.
now
());
tPreEmpBadRecordService
.
saveOrUpdate
(
tPreEmpBadRecord
);
}
// 预入职-紧急联络人
TPreEmpContactInfo
tPreEmpContactInfo
=
vo
.
getTpreEmpContactInfo
();
if
(
tPreEmpContactInfo
!=
null
)
{
tPreEmpContactInfo
.
setPreMainId
(
mainId
);
tPreEmpContactInfo
.
setCreateBy
(
user
.
getId
());
tPreEmpContactInfo
.
setCreateName
(
user
.
getNickname
());
tPreEmpContactInfo
.
setCreateTime
(
LocalDateTime
.
now
());
tPreEmpContactInfoService
.
saveOrUpdate
(
tPreEmpContactInfo
);
}
// 预入职-员工伤残信息表
TPreEmpDisabilityInfo
tPreEmpDisabilityInfo
=
vo
.
getTpreEmpDisabilityInfo
();
if
(
tPreEmpDisabilityInfo
!=
null
)
{
tPreEmpDisabilityInfo
.
setPreMainId
(
mainId
);
tPreEmpDisabilityInfo
.
setCreateBy
(
user
.
getId
());
tPreEmpDisabilityInfo
.
setCreateName
(
user
.
getNickname
());
tPreEmpDisabilityInfo
.
setCreateTime
(
LocalDateTime
.
now
());
tPreEmpDisabilityInfoService
.
saveOrUpdate
(
tPreEmpDisabilityInfo
);
}
// 预入职-员工学历信息表
TPreEmpEducation
tPreEmpEducation
=
vo
.
getTpreEmpEducation
();
if
(
tPreEmpEducation
!=
null
)
{
tPreEmpEducation
.
setPreMainId
(
mainId
);
tPreEmpEducation
.
setCreateBy
(
user
.
getId
());
tPreEmpEducation
.
setCreateName
(
user
.
getNickname
());
tPreEmpEducation
.
setCreateTime
(
LocalDateTime
.
now
());
tPreEmpEducationService
.
saveOrUpdate
(
tPreEmpEducation
);
// 附件
if
(
tPreEmpEducation
.
getAttaList
()
!=
null
&&
!
tPreEmpEducation
.
getAttaList
().
isEmpty
())
{
List
<
TAttaInfo
>
attaList
=
tPreEmpEducation
.
getAttaList
();
if
(
attaList
!=
null
)
{
tAttaInfoService
.
deleteByDomainIdAndType
(
tPreEmpEducation
.
getId
(),
0
);
for
(
TAttaInfo
atta
:
attaList
)
{
atta
.
setId
(
null
);
atta
.
setDomainId
(
tPreEmpEducation
.
getId
());
atta
.
setCreateBy
(
user
.
getId
());
atta
.
setCreateName
(
user
.
getNickname
());
atta
.
setCreateTime
(
LocalDateTime
.
now
());
}
tAttaInfoService
.
saveBatch
(
attaList
);
}
main
.
setStatus
(
status
);
main
.
setCreateBy
(
user
.
getId
());
main
.
setCreateName
(
user
.
getNickname
());
main
.
setCreateTime
(
LocalDateTime
.
now
());
this
.
saveOrUpdate
(
main
);
String
mainId
=
main
.
getId
();
// 预入职-员工不良记录表
TPreEmpBadRecord
tPreEmpBadRecord
=
vo
.
getTpreEmpBadRecord
();
if
(
tPreEmpBadRecord
!=
null
)
{
tPreEmpBadRecord
.
setPreMainId
(
mainId
);
tPreEmpBadRecord
.
setCreateBy
(
user
.
getId
());
tPreEmpBadRecord
.
setCreateName
(
user
.
getNickname
());
tPreEmpBadRecord
.
setCreateTime
(
LocalDateTime
.
now
());
tPreEmpBadRecordService
.
saveOrUpdate
(
tPreEmpBadRecord
);
}
}
// 预入职-员工家庭信息表
List
<
TPreEmpFamily
>
tPreEmpFamily
=
vo
.
getTpreEmpFamilyList
();
if
(
tPreEmpFamily
!=
null
)
{
tPreEmpFamilyService
.
deleteFamilyByMainId
(
mainId
);
for
(
TPreEmpFamily
info
:
tPreEmpFamily
)
{
info
.
setEmpIdcard
(
idCard
);
info
.
setPreMainId
(
mainId
);
info
.
setCreateBy
(
user
.
getId
());
info
.
setCreateName
(
user
.
getNickname
());
info
.
setCreateTime
(
LocalDateTime
.
now
());
// 预入职-紧急联络人
TPreEmpContactInfo
tPreEmpContactInfo
=
vo
.
getTpreEmpContactInfo
();
if
(
tPreEmpContactInfo
!=
null
)
{
tPreEmpContactInfo
.
setPreMainId
(
mainId
);
tPreEmpContactInfo
.
setCreateBy
(
user
.
getId
());
tPreEmpContactInfo
.
setCreateName
(
user
.
getNickname
());
tPreEmpContactInfo
.
setCreateTime
(
LocalDateTime
.
now
());
tPreEmpContactInfoService
.
saveOrUpdate
(
tPreEmpContactInfo
);
}
tPreEmpFamilyService
.
saveOrUpdateBatch
(
tPreEmpFamily
);
}
// 预入职-人员档案表
TPreEmployeeInfo
tPreEmployeeInfo
=
vo
.
getTpreEmployeeInfo
();
if
(
tPreEmployeeInfo
!=
null
)
{
if
(
tPreEmpEducation
!=
null
)
{
if
(
Common
.
isNotNull
(
tPreEmpEducation
.
getEducationName
()))
{
// 5大专 6本科 7硕士 8博士
if
(
"5"
.
equals
(
tPreEmpEducation
.
getEducationName
())
||
"6"
.
equals
(
tPreEmpEducation
.
getEducationName
())
||
"7"
.
equals
(
tPreEmpEducation
.
getEducationName
())
||
"8"
.
equals
(
tPreEmpEducation
.
getEducationName
()))
{
tPreEmployeeInfo
.
setIsCollege
(
CommonConstants
.
ONE_INT
);
}
else
{
tPreEmployeeInfo
.
setIsCollege
(
CommonConstants
.
ZERO_INT
);
}
tPreEmployeeInfo
.
setHignEducation
(
tPreEmpEducation
.
getEducationName
());
}
tPreEmployeeInfo
.
setSchool
(
tPreEmpEducation
.
getSchool
());
tPreEmployeeInfo
.
setMajor
(
tPreEmpEducation
.
getMajor
());
tPreEmployeeInfo
.
setAdmissionDate
(
tPreEmpEducation
.
getEntryDate
());
tPreEmployeeInfo
.
setGradutionDate
(
tPreEmpEducation
.
getGradutionDate
());
// 预入职-员工伤残信息表
TPreEmpDisabilityInfo
tPreEmpDisabilityInfo
=
vo
.
getTpreEmpDisabilityInfo
();
if
(
tPreEmpDisabilityInfo
!=
null
)
{
tPreEmpDisabilityInfo
.
setPreMainId
(
mainId
);
tPreEmpDisabilityInfo
.
setCreateBy
(
user
.
getId
());
tPreEmpDisabilityInfo
.
setCreateName
(
user
.
getNickname
());
tPreEmpDisabilityInfo
.
setCreateTime
(
LocalDateTime
.
now
());
tPreEmpDisabilityInfoService
.
saveOrUpdate
(
tPreEmpDisabilityInfo
);
}
// 生成性别年龄等:
this
.
setBaseSexInfo
(
tPreEmployeeInfo
);
tPreEmployeeInfo
.
setPreMainId
(
mainId
);
tPreEmployeeInfo
.
setCreateBy
(
user
.
getId
());
tPreEmployeeInfo
.
setCreateName
(
user
.
getNickname
());
tPreEmployeeInfo
.
setCreateTime
(
LocalDateTime
.
now
());
// 塞计税月份标志
this
.
setTaxMonthAndFlag
(
status
,
tPreEmployeeInfo
);
tPreEmployeeInfoService
.
saveOrUpdate
(
tPreEmployeeInfo
);
}
// 预入职-项目档案表
if
(
tPreEmployeeProject
!=
null
)
{
tPreEmployeeProject
.
setPreMainId
(
mainId
);
tPreEmployeeProject
.
setCreateBy
(
user
.
getId
());
tPreEmployeeProject
.
setCreateName
(
user
.
getNickname
());
tPreEmployeeProject
.
setCreateTime
(
LocalDateTime
.
now
());
tPreEmployeeProjectService
.
saveOrUpdate
(
tPreEmployeeProject
);
}
// 预入职-员工职业资格信息表
List
<
TPreEmpProfessionalQualification
>
tPreEmpProfessionalQualification
=
vo
.
getTpreEmpProfessionalQualificationList
();
if
(
tPreEmpProfessionalQualification
!=
null
)
{
// 先删除后增加
tPreEmpProfessionalService
.
deleteProfessionalByMainId
(
mainId
);
for
(
TPreEmpProfessionalQualification
info
:
tPreEmpProfessionalQualification
)
{
info
.
setEmpIdcard
(
idCard
);
info
.
setPreMainId
(
mainId
);
info
.
setCreateBy
(
user
.
getId
());
info
.
setCreateName
(
user
.
getNickname
());
info
.
setCreateTime
(
LocalDateTime
.
now
());
tPreEmpProfessionalService
.
saveOrUpdate
(
info
);
// 预入职-员工学历信息表
TPreEmpEducation
tPreEmpEducation
=
vo
.
getTpreEmpEducation
();
if
(
tPreEmpEducation
!=
null
)
{
tPreEmpEducation
.
setPreMainId
(
mainId
);
tPreEmpEducation
.
setCreateBy
(
user
.
getId
());
tPreEmpEducation
.
setCreateName
(
user
.
getNickname
());
tPreEmpEducation
.
setCreateTime
(
LocalDateTime
.
now
());
tPreEmpEducationService
.
saveOrUpdate
(
tPreEmpEducation
);
// 附件
if
(
info
.
getAttaList
()
!=
null
&&
!
info
.
getAttaList
().
isEmpty
())
{
List
<
TAttaInfo
>
attaList
=
info
.
getAttaList
();
if
(
tPreEmpEducation
.
getAttaList
()
!=
null
&&
!
tPreEmpEducation
.
getAttaList
().
isEmpty
())
{
List
<
TAttaInfo
>
attaList
=
tPreEmpEducation
.
getAttaList
();
if
(
attaList
!=
null
)
{
tAttaInfoService
.
deleteByDomainIdAndType
(
info
.
getId
(),
1
);
tAttaInfoService
.
deleteByDomainIdAndType
(
tPreEmpEducation
.
getId
(),
0
);
for
(
TAttaInfo
atta
:
attaList
)
{
atta
.
setId
(
null
);
atta
.
setDomainId
(
info
.
getId
());
atta
.
setDomainId
(
tPreEmpEducation
.
getId
());
atta
.
setCreateBy
(
user
.
getId
());
atta
.
setCreateName
(
user
.
getNickname
());
atta
.
setCreateTime
(
LocalDateTime
.
now
());
...
...
@@ -1078,65 +997,151 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
}
}
}
}
// 预入职-其他附件
List
<
TPreEmpOtherFile
>
tPreOtherFileList
=
vo
.
getTpreEmpOtherFileList
();
if
(
tPreOtherFileList
!=
null
)
{
// 先删除后增加
tPreEmpOtherFileService
.
deleteOtherFileByMainId
(
mainId
);
for
(
TPreEmpOtherFile
info
:
tPreOtherFileList
)
{
info
.
setPreMainId
(
mainId
);
info
.
setCreateTime
(
LocalDateTime
.
now
());
tPreEmpOtherFileService
.
saveOrUpdate
(
info
);
// 附件
if
(
info
.
getAttaList
()
!=
null
&&
!
info
.
getAttaList
().
isEmpty
())
{
List
<
TAttaInfo
>
attaList
=
info
.
getAttaList
();
if
(
attaList
!=
null
)
{
tAttaInfoService
.
deleteByDomainIdAndType
(
info
.
getId
(),
2
);
for
(
TAttaInfo
atta
:
attaList
)
{
atta
.
setId
(
null
);
atta
.
setDomainId
(
info
.
getId
());
atta
.
setCreateBy
(
user
.
getId
());
atta
.
setCreateName
(
user
.
getNickname
());
atta
.
setCreateTime
(
LocalDateTime
.
now
());
// 预入职-员工家庭信息表
List
<
TPreEmpFamily
>
tPreEmpFamily
=
vo
.
getTpreEmpFamilyList
();
if
(
tPreEmpFamily
!=
null
)
{
tPreEmpFamilyService
.
deleteFamilyByMainId
(
mainId
);
for
(
TPreEmpFamily
info
:
tPreEmpFamily
)
{
info
.
setEmpIdcard
(
idCard
);
info
.
setPreMainId
(
mainId
);
info
.
setCreateBy
(
user
.
getId
());
info
.
setCreateName
(
user
.
getNickname
());
info
.
setCreateTime
(
LocalDateTime
.
now
());
}
tPreEmpFamilyService
.
saveOrUpdateBatch
(
tPreEmpFamily
);
}
// 预入职-人员档案表
TPreEmployeeInfo
tPreEmployeeInfo
=
vo
.
getTpreEmployeeInfo
();
if
(
tPreEmployeeInfo
!=
null
)
{
if
(
tPreEmpEducation
!=
null
)
{
if
(
Common
.
isNotNull
(
tPreEmpEducation
.
getEducationName
()))
{
// 5大专 6本科 7硕士 8博士
if
(
"5"
.
equals
(
tPreEmpEducation
.
getEducationName
())
||
"6"
.
equals
(
tPreEmpEducation
.
getEducationName
())
||
"7"
.
equals
(
tPreEmpEducation
.
getEducationName
())
||
"8"
.
equals
(
tPreEmpEducation
.
getEducationName
()))
{
tPreEmployeeInfo
.
setIsCollege
(
CommonConstants
.
ONE_INT
);
}
else
{
tPreEmployeeInfo
.
setIsCollege
(
CommonConstants
.
ZERO_INT
);
}
t
AttaInfoService
.
saveBatch
(
attaList
);
t
PreEmployeeInfo
.
setHignEducation
(
tPreEmpEducation
.
getEducationName
()
);
}
tPreEmployeeInfo
.
setSchool
(
tPreEmpEducation
.
getSchool
());
tPreEmployeeInfo
.
setMajor
(
tPreEmpEducation
.
getMajor
());
tPreEmployeeInfo
.
setAdmissionDate
(
tPreEmpEducation
.
getEntryDate
());
tPreEmployeeInfo
.
setGradutionDate
(
tPreEmpEducation
.
getGradutionDate
());
}
// 生成性别年龄等:
this
.
setBaseSexInfo
(
tPreEmployeeInfo
);
tPreEmployeeInfo
.
setPreMainId
(
mainId
);
tPreEmployeeInfo
.
setCreateBy
(
user
.
getId
());
tPreEmployeeInfo
.
setCreateName
(
user
.
getNickname
());
tPreEmployeeInfo
.
setCreateTime
(
LocalDateTime
.
now
());
// 塞计税月份标志
this
.
setTaxMonthAndFlag
(
status
,
tPreEmployeeInfo
);
tPreEmployeeInfoService
.
saveOrUpdate
(
tPreEmployeeInfo
);
}
}
// 预入职-员工工作履历信息表
List
<
TPreEmpWorkRecording
>
tPreEmpWorkRecording
=
vo
.
getTpreEmpWorkRecordingList
();
if
(
tPreEmpWorkRecording
!=
null
)
{
// 先删除后增加
tPreEmpWorkRecordingService
.
deleteByMainId
(
mainId
);
for
(
TPreEmpWorkRecording
info
:
tPreEmpWorkRecording
)
{
info
.
setEmpIdcard
(
idCard
);
info
.
setPreMainId
(
mainId
);
info
.
setCreateBy
(
user
.
getId
());
info
.
setCreateName
(
user
.
getNickname
());
info
.
setCreateTime
(
LocalDateTime
.
now
());
// 预入职-项目档案表
if
(
tPreEmployeeProject
!=
null
)
{
tPreEmployeeProject
.
setPreMainId
(
mainId
);
tPreEmployeeProject
.
setCreateBy
(
user
.
getId
());
tPreEmployeeProject
.
setCreateName
(
user
.
getNickname
());
tPreEmployeeProject
.
setCreateTime
(
LocalDateTime
.
now
());
tPreEmployeeProjectService
.
saveOrUpdate
(
tPreEmployeeProject
);
}
tPreEmpWorkRecordingService
.
saveOrUpdateBatch
(
tPreEmpWorkRecording
);
}
// 预入职-附件
List
<
TAttaInfo
>
attaInfoList
=
vo
.
getAttaInfoList
();
if
(
attaInfoList
!=
null
)
{
// 先删除后增加
tAttaInfoService
.
deleteByDomainId
(
mainId
);
for
(
TAttaInfo
info
:
attaInfoList
)
{
info
.
setId
(
null
);
info
.
setDomainId
(
mainId
);
info
.
setCreateBy
(
user
.
getId
());
info
.
setCreateName
(
user
.
getNickname
());
info
.
setCreateTime
(
LocalDateTime
.
now
());
// 预入职-员工职业资格信息表
List
<
TPreEmpProfessionalQualification
>
tPreEmpProfessionalQualification
=
vo
.
getTpreEmpProfessionalQualificationList
();
if
(
tPreEmpProfessionalQualification
!=
null
)
{
// 先删除后增加
tPreEmpProfessionalService
.
deleteProfessionalByMainId
(
mainId
);
for
(
TPreEmpProfessionalQualification
info
:
tPreEmpProfessionalQualification
)
{
info
.
setEmpIdcard
(
idCard
);
info
.
setPreMainId
(
mainId
);
info
.
setCreateBy
(
user
.
getId
());
info
.
setCreateName
(
user
.
getNickname
());
info
.
setCreateTime
(
LocalDateTime
.
now
());
tPreEmpProfessionalService
.
saveOrUpdate
(
info
);
// 附件
if
(
info
.
getAttaList
()
!=
null
&&
!
info
.
getAttaList
().
isEmpty
())
{
List
<
TAttaInfo
>
attaList
=
info
.
getAttaList
();
if
(
attaList
!=
null
)
{
tAttaInfoService
.
deleteByDomainIdAndType
(
info
.
getId
(),
1
);
for
(
TAttaInfo
atta
:
attaList
)
{
atta
.
setId
(
null
);
atta
.
setDomainId
(
info
.
getId
());
atta
.
setCreateBy
(
user
.
getId
());
atta
.
setCreateName
(
user
.
getNickname
());
atta
.
setCreateTime
(
LocalDateTime
.
now
());
}
tAttaInfoService
.
saveBatch
(
attaList
);
}
}
}
}
// 预入职-其他附件
List
<
TPreEmpOtherFile
>
tPreOtherFileList
=
vo
.
getTpreEmpOtherFileList
();
if
(
tPreOtherFileList
!=
null
)
{
// 先删除后增加
tPreEmpOtherFileService
.
deleteOtherFileByMainId
(
mainId
);
for
(
TPreEmpOtherFile
info
:
tPreOtherFileList
)
{
info
.
setPreMainId
(
mainId
);
info
.
setCreateTime
(
LocalDateTime
.
now
());
tPreEmpOtherFileService
.
saveOrUpdate
(
info
);
// 附件
if
(
info
.
getAttaList
()
!=
null
&&
!
info
.
getAttaList
().
isEmpty
())
{
List
<
TAttaInfo
>
attaList
=
info
.
getAttaList
();
if
(
attaList
!=
null
)
{
tAttaInfoService
.
deleteByDomainIdAndType
(
info
.
getId
(),
2
);
for
(
TAttaInfo
atta
:
attaList
)
{
atta
.
setId
(
null
);
atta
.
setDomainId
(
info
.
getId
());
atta
.
setCreateBy
(
user
.
getId
());
atta
.
setCreateName
(
user
.
getNickname
());
atta
.
setCreateTime
(
LocalDateTime
.
now
());
}
tAttaInfoService
.
saveBatch
(
attaList
);
}
}
}
}
// 预入职-员工工作履历信息表
List
<
TPreEmpWorkRecording
>
tPreEmpWorkRecording
=
vo
.
getTpreEmpWorkRecordingList
();
if
(
tPreEmpWorkRecording
!=
null
)
{
// 先删除后增加
tPreEmpWorkRecordingService
.
deleteByMainId
(
mainId
);
for
(
TPreEmpWorkRecording
info
:
tPreEmpWorkRecording
)
{
info
.
setEmpIdcard
(
idCard
);
info
.
setPreMainId
(
mainId
);
info
.
setCreateBy
(
user
.
getId
());
info
.
setCreateName
(
user
.
getNickname
());
info
.
setCreateTime
(
LocalDateTime
.
now
());
}
tPreEmpWorkRecordingService
.
saveOrUpdateBatch
(
tPreEmpWorkRecording
);
}
// 预入职-附件
List
<
TAttaInfo
>
attaInfoList
=
vo
.
getAttaInfoList
();
if
(
attaInfoList
!=
null
)
{
// 先删除后增加
tAttaInfoService
.
deleteByDomainId
(
mainId
);
for
(
TAttaInfo
info
:
attaInfoList
)
{
info
.
setId
(
null
);
info
.
setDomainId
(
mainId
);
info
.
setCreateBy
(
user
.
getId
());
info
.
setCreateName
(
user
.
getNickname
());
info
.
setCreateTime
(
LocalDateTime
.
now
());
}
tAttaInfoService
.
saveBatch
(
attaInfoList
);
}
tAttaInfoService
.
saveBatch
(
attaInfoList
);
}
return
R
.
ok
(
"成功"
);
}
else
{
return
R
.
failed
(
"身份证不可为空!"
);
}
return
R
.
ok
(
"成功"
);
}
else
{
return
R
.
failed
(
"身份证不可为空!"
);
}
catch
(
Exception
e
)
{
log
.
error
(
"档案预入职C端保存异常:"
,
e
);
throw
new
RuntimeException
(
"保存失败,请联系管理员!!主键【"
+
main
.
getId
()
+
"】详细信息:"
+
e
.
getMessage
()
);
}
}
...
...
@@ -1675,7 +1680,8 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
isNew
=
true
;
emp
=
new
TEmployeeInfo
();
}
BeanUtil
.
copyProperties
(
tPreEmployeeInfo
,
emp
,
ID
);
String
[]
ignoreProperties
=
new
String
[]{
"id"
,
"empCode"
};
BeanUtil
.
copyProperties
(
tPreEmployeeInfo
,
emp
,
ignoreProperties
);
if
(
isNew
)
{
// 新员工塞基本属性
this
.
setNewEmpBaseData
(
emp
,
user
);
...
...
@@ -2027,49 +2033,54 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
return
R
.
failed
(
"id、status不可为空!"
);
}
TPreEmpMain
preEmpMain
=
this
.
getById
(
id
);
if
(
preEmpMain
==
null
||
Common
.
isEmpty
(
preEmpMain
.
getStatus
())
||
!
CommonConstants
.
TWO_STRING
.
equals
(
preEmpMain
.
getStatus
()))
{
return
R
.
failed
(
"请确认ID与状态!"
);
}
if
(!
CommonConstants
.
THREE_STRING
.
equals
(
status
)
&&
!
CommonConstants
.
FOUR_STRING
.
equals
(
status
))
{
return
R
.
failed
(
"审核状态不对!"
);
}
if
(
CommonConstants
.
THREE_STRING
.
equals
(
status
)
&&
Common
.
isEmpty
(
auditRemark
))
{
return
R
.
failed
(
"审核不通过,原因必填!"
);
}
YifuUser
user
=
SecurityUtils
.
getUser
();
if
(
user
==
null
||
Common
.
isEmpty
(
user
.
getId
()))
{
return
R
.
failed
(
"未找到登录信息!"
);
}
preEmpMain
.
setStatus
(
status
);
preEmpMain
.
setAuditId
(
user
.
getId
());
preEmpMain
.
setAuditRemark
(
auditRemark
);
preEmpMain
.
setAuditName
(
user
.
getNickname
());
if
(
CommonConstants
.
FOUR_STRING
.
equals
(
status
))
{
preEmpMain
.
setAuditTime
(
new
Date
());
}
// 审核日志
TPreEmpMainLog
auditLog
=
new
TPreEmpMainLog
();
auditLog
.
setAuditId
(
user
.
getId
());
auditLog
.
setAuditName
(
user
.
getNickname
());
auditLog
.
setAuditTime
(
new
Date
());
auditLog
.
setAuditRemark
(
auditRemark
);
auditLog
.
setMainId
(
preEmpMain
.
getId
());
auditLog
.
setAuditResult
(
status
);
R
<
PreEmpMainDetailVo
>
voR
=
this
.
getInfoById
(
id
);
if
(
voR
!=
null
&&
voR
.
getCode
()
==
CommonConstants
.
SUCCESS
)
{
// 转到更新档案去
PreEmpMainDetailVo
vo
=
voR
.
getData
();
tPreEmpMainLogService
.
save
(
auditLog
);
this
.
updateById
(
preEmpMain
);
try
{
if
(
preEmpMain
==
null
||
Common
.
isEmpty
(
preEmpMain
.
getStatus
())
||
!
CommonConstants
.
TWO_STRING
.
equals
(
preEmpMain
.
getStatus
()))
{
return
R
.
failed
(
"请确认ID与状态!"
);
}
if
(!
CommonConstants
.
THREE_STRING
.
equals
(
status
)
&&
!
CommonConstants
.
FOUR_STRING
.
equals
(
status
))
{
return
R
.
failed
(
"审核状态不对!"
);
}
if
(
CommonConstants
.
THREE_STRING
.
equals
(
status
)
&&
Common
.
isEmpty
(
auditRemark
))
{
return
R
.
failed
(
"审核不通过,原因必填!"
);
}
YifuUser
user
=
SecurityUtils
.
getUser
();
if
(
user
==
null
||
Common
.
isEmpty
(
user
.
getId
()))
{
return
R
.
failed
(
"未找到登录信息!"
);
}
preEmpMain
.
setStatus
(
status
);
preEmpMain
.
setAuditId
(
user
.
getId
());
preEmpMain
.
setAuditRemark
(
auditRemark
);
preEmpMain
.
setAuditName
(
user
.
getNickname
());
if
(
CommonConstants
.
FOUR_STRING
.
equals
(
status
))
{
return
updateToEmployeeByPre
(
vo
);
preEmpMain
.
setAuditTime
(
new
Date
());
}
// 审核日志
TPreEmpMainLog
auditLog
=
new
TPreEmpMainLog
();
auditLog
.
setAuditId
(
user
.
getId
());
auditLog
.
setAuditName
(
user
.
getNickname
());
auditLog
.
setAuditTime
(
new
Date
());
auditLog
.
setAuditRemark
(
auditRemark
);
auditLog
.
setMainId
(
preEmpMain
.
getId
());
auditLog
.
setAuditResult
(
status
);
R
<
PreEmpMainDetailVo
>
voR
=
this
.
getInfoById
(
id
);
if
(
voR
!=
null
&&
voR
.
getCode
()
==
CommonConstants
.
SUCCESS
)
{
// 转到更新档案去
PreEmpMainDetailVo
vo
=
voR
.
getData
();
tPreEmpMainLogService
.
save
(
auditLog
);
this
.
updateById
(
preEmpMain
);
if
(
CommonConstants
.
FOUR_STRING
.
equals
(
status
))
{
return
updateToEmployeeByPre
(
vo
);
}
else
{
return
R
.
ok
(
"已审核"
);
}
}
else
{
return
R
.
ok
(
"已审核
"
);
return
R
.
failed
(
"未找到信息,未审核!
"
);
}
}
else
{
return
R
.
failed
(
"未找到信息,未审核!"
);
}
catch
(
Exception
e
)
{
log
.
error
(
"档案预入职审核异常:"
,
e
);
throw
new
RuntimeException
(
"保存失败,请联系管理员!!主键【"
+
preEmpMain
.
getId
()
+
"】详细信息:"
+
e
.
getMessage
());
}
}
...
...
yifu-salary/yifu-salary-api/src/main/java/com/yifu/cloud/plus/v1/yifu/salary/entity/TSalaryEmpModLog.java
View file @
b69335d0
...
...
@@ -58,13 +58,13 @@ public class TSalaryEmpModLog extends BaseEntity {
@Schema
(
description
=
"content"
)
private
String
content
;
/**
* 0编辑、1批量更新、2EKP变更银行卡号;3预入职更新
* 0编辑、1批量更新、2EKP变更银行卡号;3预入职更新
;4导入更新银行信息
*/
@ExcelAttribute
(
name
=
"
0编辑、1批量更新、2EKP变更银行卡号"
,
isNotEmpty
=
true
,
errorInfo
=
"0编辑、1批量更新、2EKP变更银行卡号
不能为空"
,
maxLength
=
1
)
@NotBlank
(
message
=
"
0编辑、1批量更新、2EKP变更银行卡号
不能为空"
)
@Length
(
max
=
1
,
message
=
"
0编辑、1批量更新、2EKP变更银行卡号
不能超过1个字符"
)
@ExcelProperty
(
"
0编辑、1批量更新、2EKP变更银行卡号
"
)
@Schema
(
description
=
"0编辑、1批量更新、2EKP变更银行卡号;3预入职更新"
)
@ExcelAttribute
(
name
=
"
类型"
,
isNotEmpty
=
true
,
errorInfo
=
"类型
不能为空"
,
maxLength
=
1
)
@NotBlank
(
message
=
"
类型
不能为空"
)
@Length
(
max
=
1
,
message
=
"
类型
不能超过1个字符"
)
@ExcelProperty
(
"
类型
"
)
@Schema
(
description
=
"0编辑、1批量更新、2EKP变更银行卡号;3预入职更新
;4导入更新银行信息
"
)
private
String
type
;
/**
...
...
yifu-salary/yifu-salary-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/salary/service/TSalaryEmpModLogService.java
View file @
b69335d0
...
...
@@ -45,4 +45,6 @@ public interface TSalaryEmpModLogService extends IService<TSalaryEmpModLog> {
List
<
TSalaryEmpModLog
>
noPageDiy
(
TSalaryEmpModLogSearchVo
searchVo
);
void
initModLog
(
TSalaryEmployee
newEntity
,
TSalaryEmployee
oldEntity
,
String
type
,
String
userName
,
ExcelUtil
<
TSalaryEmployee
>
util
);
TSalaryEmpModLog
checkEditToLog
(
TSalaryEmployee
newEntity
,
TSalaryEmployee
oldEntity
,
String
type
,
String
userName
,
ExcelUtil
<
TSalaryEmployee
>
util
);
}
yifu-salary/yifu-salary-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/salary/service/TSalaryEmployeeService.java
View file @
b69335d0
...
...
@@ -73,6 +73,14 @@ public interface TSalaryEmployeeService extends IService<TSalaryEmployee> {
**/
String
saveNewEmployeeList
(
List
<
TSalaryEmployee
>
saveNewEmpList
,
List
<
ErrorMessage
>
errorList
);
/**
* @Description: 更新卡号等信息
* @Author: hgw
* @Date: 2024/7/22 10:27
* @return: java.lang.String
**/
String
updateEmployeeBankList
(
List
<
TSalaryEmployee
>
updateEmpBankList
,
Map
<
String
,
TSalaryEmployee
>
updateEmpBankMap
,
List
<
ErrorMessage
>
errorList
);
/**
* @param inputStream
* @Description: 批量更新-薪资人员信息
...
...
yifu-salary/yifu-salary-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/salary/service/impl/TSalaryEmpModLogServiceImpl.java
View file @
b69335d0
...
...
@@ -22,7 +22,6 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.esotericsoftware.minlog.Log
;
import
com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.Common
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.ExcelUtil
;
...
...
@@ -77,8 +76,22 @@ public class TSalaryEmpModLogServiceImpl extends ServiceImpl<TSalaryEmpModLogMap
**/
@Override
public
void
initModLog
(
TSalaryEmployee
newEntity
,
TSalaryEmployee
oldEntity
,
String
type
,
String
userName
,
ExcelUtil
<
TSalaryEmployee
>
util
)
{
TSalaryEmpModLog
log
=
doCheckModCore
(
newEntity
,
oldEntity
,
type
,
userName
,
util
);
if
(
log
!=
null
&&
Common
.
isNotNull
(
log
.
getContent
())){
baseMapper
.
insert
(
log
);
}
}
@Override
public
TSalaryEmpModLog
checkEditToLog
(
TSalaryEmployee
newEntity
,
TSalaryEmployee
oldEntity
,
String
type
,
String
userName
,
ExcelUtil
<
TSalaryEmployee
>
util
)
{
return
doCheckModCore
(
newEntity
,
oldEntity
,
type
,
userName
,
util
);
}
private
TSalaryEmpModLog
doCheckModCore
(
TSalaryEmployee
newEntity
,
TSalaryEmployee
oldEntity
,
String
type
,
String
userName
,
ExcelUtil
<
TSalaryEmployee
>
util
)
{
TSalaryEmpModLog
log
=
null
;
if
(
Common
.
isNotNull
(
newEntity
)
&&
Common
.
isNotNull
(
oldEntity
)){
TSalaryEmpModLog
log
=
new
TSalaryEmpModLog
();
log
=
new
TSalaryEmpModLog
();
log
.
setIdNum
(
newEntity
.
getEmpIdcard
());
log
.
setParentId
(
newEntity
.
getId
());
log
.
setType
(
type
);
...
...
@@ -102,26 +115,23 @@ public class TSalaryEmpModLogServiceImpl extends ServiceImpl<TSalaryEmpModLogMap
if
(
Common
.
isNotNull
(
newEntity
.
getBankProvince
())
&&
Common
.
isNotNull
(
oldEntity
.
getBankProvince
())
&&
!
oldEntity
.
getBankProvince
().
equals
(
newEntity
.
getBankProvince
())){
str
.
append
(
"开户行省:"
);
str
.
append
(
Common
.
isEmpty
(
oldEntity
.
getBankProvince
())?
""
:
util
.
getAreaLabelPublic
(
oldEntity
.
getBankProvince
()));
str
.
append
(
Common
.
isEmpty
(
oldEntity
.
getBankProvince
())?
""
:
util
.
getAreaLabelPublic
(
oldEntity
.
getBankProvince
()));
str
.
append
(
"->"
);
str
.
append
(
Common
.
isEmpty
(
newEntity
.
getBankProvince
())?
""
:
util
.
getAreaLabelPublic
(
newEntity
.
getBankProvince
()));
str
.
append
(
Common
.
isEmpty
(
newEntity
.
getBankProvince
())?
""
:
util
.
getAreaLabelPublic
(
newEntity
.
getBankProvince
()));
str
.
append
(
" "
);
}
//开户行市
if
(
Common
.
isNotNull
(
newEntity
.
getBankCity
())
&&
Common
.
isNotNull
(
oldEntity
.
getBankCity
())
&&
!
oldEntity
.
getBankCity
().
equals
(
newEntity
.
getBankCity
())){
str
.
append
(
"开户行市:"
);
str
.
append
(
Common
.
isEmpty
(
oldEntity
.
getBankCity
())?
""
:
util
.
getAreaLabelPublic
(
oldEntity
.
getBankCity
()));
str
.
append
(
Common
.
isEmpty
(
oldEntity
.
getBankCity
())?
""
:
util
.
getAreaLabelPublic
(
oldEntity
.
getBankCity
()));
str
.
append
(
"->"
);
str
.
append
(
Common
.
isEmpty
(
newEntity
.
getBankCity
())?
""
:
util
.
getAreaLabelPublic
(
newEntity
.
getBankCity
()));
str
.
append
(
Common
.
isEmpty
(
newEntity
.
getBankCity
())?
""
:
util
.
getAreaLabelPublic
(
newEntity
.
getBankCity
()));
str
.
append
(
" "
);
}
log
.
setContent
(
str
.
toString
());
Log
.
error
(
"薪资人员变更记录表:"
+
str
.
toString
());
if
(
Common
.
isNotNull
(
log
.
getContent
())){
baseMapper
.
insert
(
log
);
}
}
return
log
;
}
private
void
extracted
(
TSalaryEmployee
newEntity
,
TSalaryEmployee
oldEntity
,
StringBuilder
str
)
{
...
...
yifu-salary/yifu-salary-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/salary/service/impl/TSalaryEmployeeServiceImpl.java
View file @
b69335d0
...
...
@@ -46,6 +46,7 @@ import com.yifu.cloud.plus.v1.yifu.common.dapr.config.DaprCheckProperties;
import
com.yifu.cloud.plus.v1.yifu.common.dapr.util.HttpDaprUtil
;
import
com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils
;
import
com.yifu.cloud.plus.v1.yifu.salary.entity.TSalaryAccountItem
;
import
com.yifu.cloud.plus.v1.yifu.salary.entity.TSalaryEmpModLog
;
import
com.yifu.cloud.plus.v1.yifu.salary.entity.TSalaryEmployee
;
import
com.yifu.cloud.plus.v1.yifu.salary.mapper.TSalaryAccountMapper
;
import
com.yifu.cloud.plus.v1.yifu.salary.mapper.TSalaryEmployeeMapper
;
...
...
@@ -386,6 +387,100 @@ public class TSalaryEmployeeServiceImpl extends ServiceImpl<TSalaryEmployeeMappe
return
null
;
}
@Override
public
String
updateEmployeeBankList
(
List
<
TSalaryEmployee
>
updateEmployeeBankList
,
Map
<
String
,
TSalaryEmployee
>
updateEmpBankMap
,
List
<
ErrorMessage
>
errorList
)
{
if
(
updateEmployeeBankList
!=
null
&&
!
updateEmployeeBankList
.
isEmpty
())
{
// 银行卡
List
<
TCheckBankNo
>
bankList
=
new
ArrayList
<>();
TCheckBankNo
checkBankNo
;
for
(
TSalaryEmployee
employee
:
updateEmployeeBankList
)
{
if
(
Common
.
isNotNull
(
employee
.
getBankNo
())
&&
(
Common
.
isEmpty
(
employee
.
getIssueStatus
())
||
employee
.
getIssueStatus
().
equals
(
CommonConstants
.
ZERO_INT
)))
{
checkBankNo
=
new
TCheckBankNo
();
checkBankNo
.
setName
(
employee
.
getEmpName
());
checkBankNo
.
setBankNo
(
employee
.
getBankNo
());
bankList
.
add
(
checkBankNo
);
}
}
// 批量校验 卡号与手机号
Map
<
String
,
Boolean
>
bankMap
=
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
)
{
bankMap
=
checkListR
.
getData
().
getCheckMap
();
}
}
boolean
isFalse
=
false
;
String
areaProvince
;
String
areaCity
;
TSalaryEmployee
oldEmp
;
ExcelUtil
<
TSalaryEmployee
>
util
=
new
ExcelUtil
<>(
TSalaryEmployee
.
class
);
TSalaryEmpModLog
log
;
List
<
TSalaryEmpModLog
>
saveLogList
=
new
ArrayList
<>();
for
(
TSalaryEmployee
employee
:
updateEmployeeBankList
)
{
if
(
Common
.
isNotNull
(
employee
.
getBankNo
())
&&
(
Common
.
isEmpty
(
employee
.
getIssueStatus
())
||
employee
.
getIssueStatus
().
equals
(
CommonConstants
.
ZERO_INT
)))
{
oldEmp
=
updateEmpBankMap
.
get
(
employee
.
getEmpIdcard
());
if
(
oldEmp
!=
null
)
{
// 有变更才更新
if
(
(
Common
.
isNotNull
(
employee
.
getBankNo
())
&&
!
employee
.
getBankNo
().
equals
(
oldEmp
.
getBankNo
()))
||
(
Common
.
isNotNull
(
employee
.
getBankProvince
())
&&
!
employee
.
getBankProvince
().
equals
(
oldEmp
.
getBankProvince
()))
||
(
Common
.
isNotNull
(
employee
.
getBankCity
())
&&
!
employee
.
getBankCity
().
equals
(
oldEmp
.
getBankCity
()))
||
(
Common
.
isNotNull
(
employee
.
getBankName
())
&&
!
employee
.
getBankName
().
equals
(
oldEmp
.
getBankName
()))
||
(
Common
.
isNotNull
(
employee
.
getBankSubName
())
&&
!
employee
.
getBankSubName
().
equals
(
oldEmp
.
getBankSubName
()))
)
{
if
(
bankMap
.
get
(
employee
.
getBankNo
())
!=
null
)
{
if
(
Boolean
.
FALSE
.
equals
(
bankMap
.
get
(
employee
.
getBankNo
())))
{
errorList
.
add
(
new
ErrorMessage
((
employee
.
getLineNums
()
),
"第"
+
(
employee
.
getLineNums
()
)
+
"行:该员工更新失败:【姓名与卡号验证:认证不一致】"
));
isFalse
=
true
;
}
}
else
{
errorList
.
add
(
new
ErrorMessage
((
employee
.
getLineNums
()
),
"第"
+
(
employee
.
getLineNums
()
)
+
"行:该员工更新失败:【姓名与卡号验证:"
+
SalaryConstants
.
CHECK_NO_RESPONSE
+
"】"
));
isFalse
=
true
;
}
if
(
Common
.
isNotNull
(
employee
.
getBankProvince
()))
{
areaProvince
=
ExcelUtil
.
getRedisAreaValue
(
CacheConstants
.
AREA_VALUE
+
employee
.
getBankProvince
().
trim
());
if
(
Common
.
isNotNull
(
areaProvince
))
{
if
(
Common
.
isNotNull
(
employee
.
getBankCity
()))
{
areaCity
=
ExcelUtil
.
getRedisAreaValue
(
CacheConstants
.
AREA_VALUE
+
employee
.
getBankCity
().
trim
()
+
CommonConstants
.
DOWN_LINE_STRING
+
employee
.
getBankProvince
().
trim
());
if
(
Common
.
isNotNull
(
areaCity
))
{
employee
.
setBankCity
(
areaCity
);
}
else
{
errorList
.
add
(
new
ErrorMessage
((
employee
.
getLineNums
()
),
"第"
+
(
employee
.
getLineNums
()
)
+
"行:该员工更新失败:【"
+
SalaryConstants
.
CITY_ERROR
+
"】"
));
isFalse
=
true
;
}
}
employee
.
setBankProvince
(
areaProvince
);
}
else
{
errorList
.
add
(
new
ErrorMessage
((
employee
.
getLineNums
()
),
"第"
+
(
employee
.
getLineNums
()
)
+
"行:该员工更新失败:【"
+
SalaryConstants
.
PROVINCE_ERROR
+
"】"
));
isFalse
=
true
;
}
}
if
(!
isFalse
)
{
log
=
logService
.
checkEditToLog
(
employee
,
oldEmp
,
CommonConstants
.
FOUR_STRING
,
employee
.
getCreateName
(),
util
);
if
(
log
!=
null
)
{
saveLogList
.
add
(
log
);
}
}
}
}
}
}
if
(
isFalse
)
{
return
null
;
}
// 更新人员
this
.
updateBatchById
(
updateEmployeeBankList
);
// 新增日志
logService
.
saveBatch
(
saveLogList
);
}
return
null
;
}
/**
* @param employee
* @Description: 校验卡号与手机号
...
...
yifu-salary/yifu-salary-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/salary/util/SalaryAccountUtil.java
View file @
b69335d0
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
salary
.
util
;
import
cn.hutool.core.bean.BeanUtil
;
import
com.alibaba.fastjson.JSONObject
;
import
com.yifu.cloud.plus.v1.yifu.archives.vo.TSettleDomainSelectVo
;
import
com.yifu.cloud.plus.v1.yifu.common.core.constant.CacheConstants
;
...
...
@@ -142,6 +143,11 @@ public class SalaryAccountUtil implements Serializable {
boolean
notLabour
=
!
CommonConstants
.
THREE_STRING
.
equals
(
salaryType
);
// 连接查询的数据集合
List
<
TSalaryEmployee
>
updateEmpList
=
new
ArrayList
<>();
// 2024-7-22 10:16:42 hgw 更新卡号等信息
List
<
TSalaryEmployee
>
updateEmpBankList
=
new
ArrayList
<>();
// 2024-7-22 10:16:42 hgw 更新卡号等信息,存储旧人员信息,以增加更新记录使用
Map
<
String
,
TSalaryEmployee
>
updateEmpBankMap
=
new
HashMap
<>();
List
<
TSalaryEmployee
>
checkBankInfoEmpList
=
new
ArrayList
<>();
List
<
TSalaryEmployee
>
newEmpList
=
new
ArrayList
<>();
Map
<
String
,
TSalaryAccountVo
>
entityMap
=
new
HashMap
<>();
...
...
@@ -477,7 +483,8 @@ public class SalaryAccountUtil implements Serializable {
// newEmpUpdateFlag = CommonConstants.ZERO_STRING
if
(
setEntityByEmpInfo
(
dept
,
ownEmployeeMap
,
ownDeptMap
,
salaryType
,
isIssue
,
errorList
,
entity
,
emp
,
saiList
,
salaryGiveTimeFlag
,
isNewEmployee
,
empName
,
salaryStyle
,
nowMonth
,
updateEmpList
,
checkBankInfoEmpList
,
i
+
dataRow
,
bankMap
,
newEmpUpdateFlag
))
,
nowMonth
,
updateEmpList
,
checkBankInfoEmpList
,
i
+
dataRow
,
bankMap
,
newEmpUpdateFlag
,
updateEmpBankList
,
updateEmpBankMap
))
continue
;
}
if
(
saiList
!=
null
&&
!
saiList
.
isEmpty
())
{
...
...
@@ -575,7 +582,8 @@ public class SalaryAccountUtil implements Serializable {
,
CommonConstants
.
ZERO_STRING
.
equals
(
entity
.
getSalaryGiveTime
())
,
CommonConstants
.
ONE_STRING
.
equals
(
entity
.
getIsNewEmployee
())
,
otherEmp
.
getEmpName
(),
entity
.
getSalaryStyle
()
,
nowMonth
,
updateEmpList
,
checkBankInfoEmpList
,
newEmps
.
getLineNums
()
+
dataRow
,
bankMap
,
newEmpUpdateFlag
))
{
,
nowMonth
,
updateEmpList
,
checkBankInfoEmpList
,
newEmps
.
getLineNums
()
+
dataRow
,
bankMap
,
newEmpUpdateFlag
,
updateEmpBankList
,
updateEmpBankMap
))
{
isContinue
=
false
;
}
}
...
...
@@ -603,9 +611,32 @@ public class SalaryAccountUtil implements Serializable {
}
}
}
if
(!
updateEmpBankList
.
isEmpty
())
{
TSalaryEmployee
saveNewEmp
;
for
(
int
i
=
0
;
i
<
updateEmpBankList
.
size
();
i
++)
{
saveNewEmp
=
updateEmpBankList
.
get
(
i
);
// 新员工校验计税月
if
(!
"3"
.
equals
(
salaryType
)
&&
!
"4"
.
equals
(
salaryType
))
{
entity
=
entityMap
.
get
(
saveNewEmp
.
getEmpIdcard
());
minTaxMonth
=
minTaxMonthMap
.
get
(
saveNewEmp
.
getEmpIdcard
());
if
(
Common
.
isNotNull
(
minTaxMonth
)
&&
!
minTaxMonth
.
equals
(
entity
.
getTaxMonth
()))
{
error
=
"第"
+
(
saveNewEmp
.
getLineNums
()
+
dataRow
)
+
"行:该员工已有发薪记录,计税月份请填写:【"
+
minTaxMonth
+
"】"
+
",你填写了计税月:【"
+
entity
.
getTaxMonth
()
+
"】"
;
errorList
.
add
(
new
ErrorMessage
((
saveNewEmp
.
getLineNums
()
+
dataRow
),
error
));
canSave
=
false
;
}
}
}
}
if
(
canSave
)
{
// 新增
tSalaryEmployeeService
.
saveNewEmployeeList
(
saveNewEmpList
,
errorList
);
if
(!
saveNewEmpList
.
isEmpty
())
{
tSalaryEmployeeService
.
saveNewEmployeeList
(
saveNewEmpList
,
errorList
);
}
// 更新人员信息
if
(!
updateEmpBankList
.
isEmpty
())
{
tSalaryEmployeeService
.
updateEmployeeBankList
(
updateEmpBankList
,
updateEmpBankMap
,
errorList
);
}
}
}
}
...
...
@@ -618,14 +649,25 @@ public class SalaryAccountUtil implements Serializable {
this
.
setErrorInfo
(
errorList
);
}
// updateEmpBankList hgw 2024-7-22 10:18:02 更新开户行卡号等信息,以表导入为准
private
boolean
setEntityByEmpInfo
(
TSettleDomainSelectVo
dept
,
Map
<
String
,
Integer
>
ownEmployeeMap
,
Map
<
String
,
Integer
>
ownDeptMap
,
String
salaryType
,
Integer
isIssue
,
List
<
ErrorMessage
>
errorList
,
TSalaryAccountVo
entity
,
TSalaryEmployee
emp
,
List
<
TSalaryAccountItemVo
>
saiList
,
boolean
salaryGiveTimeFlag
,
boolean
isNewEmployee
,
String
empName
,
String
salaryStyle
,
String
nowMonth
,
List
<
TSalaryEmployee
>
updateEmpList
,
List
<
TSalaryEmployee
>
checkBankInfoEmpList
,
int
i
,
Map
<
String
,
String
>
bankMap
,
String
newEmpUpdateFlag
)
{
,
Map
<
String
,
String
>
bankMap
,
String
newEmpUpdateFlag
,
List
<
TSalaryEmployee
>
updateEmpBankList
,
Map
<
String
,
TSalaryEmployee
>
updateEmpBankMap
)
{
TSalaryAccountItemVo
sai
;
String
error
;
emp
.
setLineNums
(
i
);
if
(
dept
!=
null
&&
dept
.
getId
()
!=
null
&&
!
dept
.
getId
().
equals
(
emp
.
getDeptId
()))
{
emp
.
setDeptId
(
dept
.
getId
());
emp
.
setDeptName
(
dept
.
getDepartName
());
emp
.
setDeptNo
(
dept
.
getDepartNo
());
emp
.
setUnitId
(
dept
.
getCustomerId
());
emp
.
setUnitNo
(
dept
.
getCustomerNo
());
emp
.
setUnitName
(
dept
.
getCustomerName
());
}
if
(
Common
.
isEmpty
(
emp
.
getEmpName
()))
{
error
=
"第"
+
i
+
"行:薪酬人员查询处-员工姓名-为空,请去薪酬人员查询处更新!"
;
errorList
.
add
(
new
ErrorMessage
(
i
,
error
));
...
...
@@ -696,9 +738,12 @@ public class SalaryAccountUtil implements Serializable {
// hgs 2024-7-19 09:33:29 新增按照页面开关与新员工字段,来更新员工信息:
if
(
SalaryConstants
.
SALARY_STYLE_BANK
.
equals
(
salaryStyle
))
{
if
(
CommonConstants
.
ONE_STRING
.
equals
(
newEmpUpdateFlag
)
&&
isNewEmployee
)
{
TSalaryEmployee
oldEmp
=
new
TSalaryEmployee
();
BeanUtil
.
copyProperties
(
emp
,
oldEmp
);
updateEmpBankMap
.
put
(
emp
.
getEmpIdcard
(),
oldEmp
);
if
(
Common
.
isEmpty
(
entity
.
getBankName
()))
{
if
(
Common
.
isEmpty
(
emp
.
getBankName
()))
{
error
=
"第"
+
i
+
SalaryConstants
.
LINE_EMP
+
emp
.
getEmpIdcard
()
+
"-发放方式为银行发放,但是-开户行总行-为空,请在工资模板填写!"
;
error
=
"第"
+
i
+
SalaryConstants
.
LINE_EMP
+
emp
.
getEmpIdcard
()
+
"-发放方式为银行发放,但是-开户行总行-为空,请在工资模板
正确
填写!"
;
errorList
.
add
(
new
ErrorMessage
(
i
,
error
));
return
true
;
}
else
{
...
...
@@ -709,7 +754,7 @@ public class SalaryAccountUtil implements Serializable {
}
if
(
Common
.
isEmpty
(
entity
.
getBankNo
()))
{
if
(
Common
.
isEmpty
(
emp
.
getBankNo
()))
{
error
=
"第"
+
i
+
SalaryConstants
.
LINE_EMP
+
emp
.
getEmpIdcard
()
+
"-发放方式为银行发放,但是-银行卡号-为空,请在工资模板填写!"
;
error
=
"第"
+
i
+
SalaryConstants
.
LINE_EMP
+
emp
.
getEmpIdcard
()
+
"-发放方式为银行发放,但是-银行卡号-为空,请在工资模板
正确
填写!"
;
errorList
.
add
(
new
ErrorMessage
(
i
,
error
));
return
true
;
}
else
{
...
...
@@ -720,7 +765,7 @@ public class SalaryAccountUtil implements Serializable {
}
if
(
Common
.
isEmpty
(
entity
.
getBankProvince
()))
{
if
(
Common
.
isEmpty
(
emp
.
getBankProvince
()))
{
error
=
"第"
+
i
+
SalaryConstants
.
LINE_EMP
+
emp
.
getEmpIdcard
()
+
"-发放方式为银行发放,但是-开户行省-为空,请在工资模板填写!"
;
error
=
"第"
+
i
+
SalaryConstants
.
LINE_EMP
+
emp
.
getEmpIdcard
()
+
"-发放方式为银行发放,但是-开户行省-为空,请在工资模板
正确
填写!"
;
errorList
.
add
(
new
ErrorMessage
(
i
,
error
));
return
true
;
}
else
{
...
...
@@ -731,7 +776,7 @@ public class SalaryAccountUtil implements Serializable {
}
if
(
Common
.
isEmpty
(
emp
.
getBankCity
()))
{
if
(
Common
.
isEmpty
(
emp
.
getBankCity
()))
{
error
=
"第"
+
i
+
SalaryConstants
.
LINE_EMP
+
emp
.
getEmpIdcard
()
+
"-发放方式为银行发放,但是-开户行市-为空,请在工资模板填写!"
;
error
=
"第"
+
i
+
SalaryConstants
.
LINE_EMP
+
emp
.
getEmpIdcard
()
+
"-发放方式为银行发放,但是-开户行市-为空,请在工资模板
正确
填写!"
;
errorList
.
add
(
new
ErrorMessage
(
i
,
error
));
return
true
;
}
else
{
...
...
@@ -740,6 +785,22 @@ public class SalaryAccountUtil implements Serializable {
}
else
{
emp
.
setBankCity
(
entity
.
getBankCity
());
}
if
(
Common
.
isNotNull
(
emp
.
getBankProvince
()))
{
String
areaInt
=
ExcelUtil
.
getRedisAreaValue
(
CacheConstants
.
AREA_VALUE
+
emp
.
getBankProvince
().
trim
());
if
(
Common
.
isNotNull
(
areaInt
))
{
entity
.
setBankProvince
(
areaInt
);
}
String
areaCityInt
=
null
;
if
(
Common
.
isNotNull
(
emp
.
getBankCity
()))
{
areaCityInt
=
ExcelUtil
.
getRedisAreaValue
(
CacheConstants
.
AREA_VALUE
+
emp
.
getBankCity
().
trim
()
+
CommonConstants
.
DOWN_LINE_STRING
+
emp
.
getBankProvince
().
trim
());
if
(
Common
.
isNotNull
(
areaCityInt
))
{
entity
.
setBankCity
(
areaCityInt
);
}
}
}
if
(
Common
.
isEmpty
(
entity
.
getBankSubName
())
){
if
(
Common
.
isNotNull
(
emp
.
getBankSubName
()))
{
entity
.
setBankSubName
(
emp
.
getBankSubName
());
...
...
@@ -748,11 +809,11 @@ public class SalaryAccountUtil implements Serializable {
emp
.
setBankSubName
(
entity
.
getBankSubName
());
}
if
(
bankMap
.
get
(
entity
.
getBankName
())
==
null
)
{
error
=
"第"
+
i
+
SalaryConstants
.
LINE_EMP
+
emp
.
getEmpIdcard
()
+
"-发放方式为银行发放,但是-开户行总行-不符合财务要求,请在工资模板填写!"
;
error
=
"第"
+
i
+
SalaryConstants
.
LINE_EMP
+
emp
.
getEmpIdcard
()
+
"-发放方式为银行发放,但是-开户行总行-不符合财务要求,请在工资模板
正确
填写!"
;
errorList
.
add
(
new
ErrorMessage
(
i
,
error
));
return
true
;
}
updateEmpList
.
add
(
emp
);
updateEmp
Bank
List
.
add
(
emp
);
}
else
if
(
salaryGiveTimeFlag
)
{
if
(
Common
.
isEmpty
(
emp
.
getBankName
()))
{
error
=
"第"
+
i
+
SalaryConstants
.
LINE_EMP
+
emp
.
getEmpIdcard
()
+
"-发放方式为银行发放,但是-开户行-为空,请去薪酬人员查询处更新!"
;
...
...
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