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
6d3c21b8
Commit
6d3c21b8
authored
Jan 17, 2025
by
huyuchen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
huych-含风险项目商险不购买申请提交
parent
4577cd95
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
115 additions
and
139 deletions
+115
-139
TInsuranceUnpurchaseApplyServiceImpl.java
...ry/service/impl/TInsuranceUnpurchaseApplyServiceImpl.java
+115
-139
No files found.
yifu-salary/yifu-salary-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/salary/service/impl/TInsuranceUnpurchaseApplyServiceImpl.java
View file @
6d3c21b8
...
...
@@ -165,158 +165,104 @@ public class TInsuranceUnpurchaseApplyServiceImpl extends ServiceImpl<TInsurance
try
{
//获取明细当日最大申请编号
String
applyDetail
;
synchronized
(
this
)
{
applyDetail
=
baseMapper
.
getMaxInusuranceDetailCode
();
//暂存不做校验
if
(
CommonConstants
.
ONE_STRING
.
equals
(
tInsuranceUnpurchaseApply
.
getSaveFlag
()))
{
if
(
Common
.
isEmpty
(
tInsuranceUnpurchaseApply
.
getId
()))
{
applyDetail
=
baseMapper
.
getMaxInusuranceDetailCode
();
//暂存不做校验
if
(
CommonConstants
.
ONE_STRING
.
equals
(
tInsuranceUnpurchaseApply
.
getSaveFlag
()))
{
if
(
Common
.
isEmpty
(
tInsuranceUnpurchaseApply
.
getId
()))
{
// tInsuranceUnpurchaseApply.setApplyNo(applyNo);
tInsuranceUnpurchaseApply
.
setCreateBy
(
user
.
getId
());
tInsuranceUnpurchaseApply
.
setCreateName
(
user
.
getNickname
());
tInsuranceUnpurchaseApply
.
setCreateUserDeptName
(
user
.
getDeptName
());
tInsuranceUnpurchaseApply
.
setCreateUserDeptId
(
user
.
getDeptId
().
toString
());
baseMapper
.
insert
(
tInsuranceUnpurchaseApply
);
}
else
{
baseMapper
.
updateById
(
tInsuranceUnpurchaseApply
);
tInsuranceUnpurchaseApply
.
setCreateBy
(
user
.
getId
());
tInsuranceUnpurchaseApply
.
setCreateName
(
user
.
getNickname
());
tInsuranceUnpurchaseApply
.
setCreateUserDeptName
(
user
.
getDeptName
());
tInsuranceUnpurchaseApply
.
setCreateUserDeptId
(
user
.
getDeptId
().
toString
());
baseMapper
.
insert
(
tInsuranceUnpurchaseApply
);
}
else
{
baseMapper
.
updateById
(
tInsuranceUnpurchaseApply
);
}
//更新附件
updateFileId
(
tInsuranceUnpurchaseApply
);
//先删除明细表数据再重新生成
if
(
Common
.
isNotNull
(
tInsuranceUnpurchaseApply
.
getId
()))
{
personService
.
remove
(
Wrappers
.<
TInsuranceUnpurchasePerson
>
lambdaQuery
()
.
eq
(
TInsuranceUnpurchasePerson:
:
getParnetId
,
tInsuranceUnpurchaseApply
.
getId
()));
}
List
<
TInsuranceUnpurchasePerson
>
personList
=
new
ArrayList
<>();
if
(
Common
.
isNotNull
(
tInsuranceUnpurchaseApply
.
getPersonList
())
&&
!
tInsuranceUnpurchaseApply
.
getPersonList
().
isEmpty
())
{
for
(
TInsuranceUnpurchasePersonAddVo
vo
:
tInsuranceUnpurchaseApply
.
getPersonList
())
{
TInsuranceUnpurchasePerson
person
=
new
TInsuranceUnpurchasePerson
();
person
.
setEmpIdcardNo
(
vo
.
getEmpIdcardNo
());
person
.
setEmpName
(
vo
.
getEmpName
());
person
.
setPost
(
vo
.
getPost
());
person
.
setApplyNoDetail
(
getDetailCode
(
applyDetail
,
vo
.
getRowIndex
()));
initValue
(
tInsuranceUnpurchaseApply
,
person
);
personList
.
add
(
person
);
}
//更新附件
updateFileId
(
tInsuranceUnpurchaseApply
);
//先删除明细表数据再重新生成
personService
.
saveBatch
(
personList
);
}
return
R
.
ok
();
}
else
if
(
CommonConstants
.
TWO_STRING
.
equals
(
tInsuranceUnpurchaseApply
.
getSaveFlag
()))
{
//校验若该项目&该人员身份证号是否已经有过“已购买社保”的不购买商险明细,若有也会禁止重复提交!提示:姓名+身份证号、姓名+身份证号、已有申请记录,无需重复提交,可删除后再提交;
//校验该身份证&姓名组合的数据能否找到在途或在保的社保-工伤险数据,即是否为-“工伤”险正常参保的人员,不受项目限制,若“工伤”险皆正常在保或有在途“待审核、待办理”,则可正常提交,若未正常参保或无在途的参保数据,则提示“姓名+身份证号、姓名+身份证号无正常参保或派单中的数据,禁止提交!”
List
<
TInsuranceUnpurchasePersonAddVo
>
personList
=
addAndUpdCheck
(
tInsuranceUnpurchaseApply
);
if
(
Common
.
isNotNull
(
personList
)
&&
!
personList
.
isEmpty
()
&&
personList
.
stream
().
noneMatch
(
e
->
CommonConstants
.
ONE_STRING
.
equals
(
e
.
getCode
())))
{
//申请编号
String
applyNo
=
getCode
();
tInsuranceUnpurchaseApply
.
setUnbuyNum
(
String
.
valueOf
(
personList
.
size
()));
if
(
Common
.
isNotNull
(
tInsuranceUnpurchaseApply
.
getId
()))
{
if
(
Common
.
isEmpty
(
tInsuranceUnpurchaseApply
.
getApplyNo
()))
{
tInsuranceUnpurchaseApply
.
setApplyNo
(
applyNo
);
}
//申请人是否属于子分公司和该项目是否有审批通过记录赋值
setValue
(
tInsuranceUnpurchaseApply
,
user
);
tInsuranceUnpurchaseApply
.
setCreateTimeZc
(
LocalDateTime
.
now
());
baseMapper
.
updateById
(
tInsuranceUnpurchaseApply
);
createProcessLog
(
tInsuranceUnpurchaseApply
,
user
);
//更新附件
updateFileId
(
tInsuranceUnpurchaseApply
);
//先删除明细表数据再重新生成
personService
.
remove
(
Wrappers
.<
TInsuranceUnpurchasePerson
>
lambdaQuery
()
.
eq
(
TInsuranceUnpurchasePerson:
:
getParnetId
,
tInsuranceUnpurchaseApply
.
getId
()));
}
List
<
TInsuranceUnpurchasePerson
>
personList
=
new
ArrayList
<>();
if
(
Common
.
isNotNull
(
tInsuranceUnpurchaseApply
.
getPersonList
())
&&
!
tInsuranceUnpurchaseApply
.
getPersonList
().
isEmpty
())
{
for
(
TInsuranceUnpurchasePersonAddVo
vo
:
tInsuranceUnpurchaseApply
.
getPersonList
())
{
List
<
TInsuranceUnpurchasePerson
>
personInfoList
=
new
ArrayList
<>();
for
(
TInsuranceUnpurchasePersonAddVo
vo
:
personList
)
{
TInsuranceUnpurchasePerson
person
=
new
TInsuranceUnpurchasePerson
();
person
.
setEmpIdcardNo
(
vo
.
getEmpIdcardNo
());
person
.
setEmpName
(
vo
.
getEmpName
());
person
.
setPost
(
vo
.
getPost
());
person
.
setApplyNoDetail
(
getDetailCode
(
applyDetail
,
vo
.
getRowIndex
()));
person
.
setCreateTime
(
tInsuranceUnpurchaseApply
.
getCreateTimeZc
());
initValue
(
tInsuranceUnpurchaseApply
,
person
);
personList
.
add
(
person
);
}
personService
.
saveBatch
(
personList
);
}
return
R
.
ok
();
}
else
if
(
CommonConstants
.
TWO_STRING
.
equals
(
tInsuranceUnpurchaseApply
.
getSaveFlag
()))
{
//校验若该项目&该人员身份证号是否已经有过“已购买社保”的不购买商险明细,若有也会禁止重复提交!提示:姓名+身份证号、姓名+身份证号、已有申请记录,无需重复提交,可删除后再提交;
//校验该身份证&姓名组合的数据能否找到在途或在保的社保-工伤险数据,即是否为-“工伤”险正常参保的人员,不受项目限制,若“工伤”险皆正常在保或有在途“待审核、待办理”,则可正常提交,若未正常参保或无在途的参保数据,则提示“姓名+身份证号、姓名+身份证号无正常参保或派单中的数据,禁止提交!”
List
<
TInsuranceUnpurchasePersonAddVo
>
personList
=
addAndUpdCheck
(
tInsuranceUnpurchaseApply
);
if
(
Common
.
isNotNull
(
personList
)
&&
!
personList
.
isEmpty
()
&&
personList
.
stream
().
noneMatch
(
e
->
CommonConstants
.
ONE_STRING
.
equals
(
e
.
getCode
())))
{
//申请编号
String
applyNo
=
getCode
();
tInsuranceUnpurchaseApply
.
setUnbuyNum
(
String
.
valueOf
(
personList
.
size
()));
if
(
Common
.
isNotNull
(
tInsuranceUnpurchaseApply
.
getId
()))
{
if
(
Common
.
isEmpty
(
tInsuranceUnpurchaseApply
.
getApplyNo
()))
{
tInsuranceUnpurchaseApply
.
setApplyNo
(
applyNo
);
}
//申请人是否属于子分公司和该项目是否有审批通过记录赋值
setValue
(
tInsuranceUnpurchaseApply
,
user
,
tInsuranceUnpurchaseApply
.
getApplyNo
());
tInsuranceUnpurchaseApply
.
setCreateTimeZc
(
LocalDateTime
.
now
());
baseMapper
.
updateById
(
tInsuranceUnpurchaseApply
);
if
(
tInsuranceUnpurchaseApply
.
getAuditFlag
().
equals
(
CommonConstants
.
ZERO_STRING
))
{
// 记录提交审核日志
TAuditRecord
submitAuditRecord
=
new
TAuditRecord
();
submitAuditRecord
.
setDomainId
(
tInsuranceUnpurchaseApply
.
getId
());
submitAuditRecord
.
setFlowId
(
CommonConstants
.
EMPTY_STRING
);
submitAuditRecord
.
setNodeId
(
CommonConstants
.
EMPTY_STRING
);
submitAuditRecord
.
setApprovalMan
(
user
.
getId
());
submitAuditRecord
.
setApprovalManName
(
user
.
getNickname
());
// 审批结果为“提交”
submitAuditRecord
.
setApprovalResult
(
CommonConstants
.
dingleDigitStrArray
[
3
]);
submitAuditRecord
.
setDeleteFlag
(
CommonConstants
.
NOT_DELETE_FLAG
);
submitAuditRecord
.
setApprovalTime
(
LocalDateTime
.
now
());
// 审核记录标识 1当前审核记录
submitAuditRecord
.
setPreFlag
(
CommonConstants
.
ONE_STRING
);
submitAuditRecord
.
setSubmitMan
(
user
.
getId
());
submitAuditRecord
.
setSubmitManName
(
user
.
getNickname
());
// 申请原因
// submitAuditRecord.setReason(reason);
// 审核类型
submitAuditRecord
.
setAuditType
(
CommonConstants
.
ZERO_STRING
);
submitAuditRecord
.
setCreateTime
(
LocalDateTime
.
now
());
// 提交节点名称
submitAuditRecord
.
setNodeName
(
"提交即审核通过"
);
submitAuditRecord
.
setSubmitCreateTime
(
LocalDateTime
.
now
());
submitAuditRecord
.
setEntityName
(
applyNo
);
auditRecordService
.
save
(
submitAuditRecord
);
}
//更新附件
updateFileId
(
tInsuranceUnpurchaseApply
);
//先删除明细表数据再重新生成
personService
.
remove
(
Wrappers
.<
TInsuranceUnpurchasePerson
>
lambdaQuery
()
.
eq
(
TInsuranceUnpurchasePerson:
:
getParnetId
,
tInsuranceUnpurchaseApply
.
getId
()));
List
<
TInsuranceUnpurchasePerson
>
personInfoList
=
new
ArrayList
<>();
for
(
TInsuranceUnpurchasePersonAddVo
vo
:
personList
)
{
TInsuranceUnpurchasePerson
person
=
new
TInsuranceUnpurchasePerson
();
person
.
setEmpIdcardNo
(
vo
.
getEmpIdcardNo
());
person
.
setEmpName
(
vo
.
getEmpName
());
person
.
setPost
(
vo
.
getPost
());
person
.
setApplyNoDetail
(
getDetailCode
(
applyDetail
,
vo
.
getRowIndex
()));
person
.
setCreateTime
(
tInsuranceUnpurchaseApply
.
getCreateTimeZc
());
initValue
(
tInsuranceUnpurchaseApply
,
person
);
personInfoList
.
add
(
person
);
}
personService
.
saveBatch
(
personInfoList
);
}
else
{
//申请人是否属于子分公司和该项目是否有审批通过记录赋值
setValue
(
tInsuranceUnpurchaseApply
,
user
,
applyNo
);
tInsuranceUnpurchaseApply
.
setCreateTimeZc
(
LocalDateTime
.
now
());
tInsuranceUnpurchaseApply
.
setCreateBy
(
user
.
getId
());
tInsuranceUnpurchaseApply
.
setCreateName
(
user
.
getNickname
());
tInsuranceUnpurchaseApply
.
setCreateUserDeptName
(
user
.
getDeptName
());
tInsuranceUnpurchaseApply
.
setCreateUserDeptId
(
user
.
getDeptId
().
toString
());
tInsuranceUnpurchaseApply
.
setApplyNo
(
applyNo
);
baseMapper
.
insert
(
tInsuranceUnpurchaseApply
);
if
(
tInsuranceUnpurchaseApply
.
getAuditFlag
().
equals
(
CommonConstants
.
ZERO_STRING
))
{
// 记录提交审核日志
TAuditRecord
submitAuditRecord
=
new
TAuditRecord
();
submitAuditRecord
.
setDomainId
(
tInsuranceUnpurchaseApply
.
getId
());
submitAuditRecord
.
setFlowId
(
CommonConstants
.
EMPTY_STRING
);
submitAuditRecord
.
setNodeId
(
CommonConstants
.
EMPTY_STRING
);
submitAuditRecord
.
setApprovalMan
(
user
.
getId
());
submitAuditRecord
.
setApprovalManName
(
user
.
getNickname
());
// 审批结果为“提交”
submitAuditRecord
.
setApprovalResult
(
CommonConstants
.
dingleDigitStrArray
[
3
]);
submitAuditRecord
.
setDeleteFlag
(
CommonConstants
.
NOT_DELETE_FLAG
);
submitAuditRecord
.
setApprovalTime
(
LocalDateTime
.
now
());
// 审核记录标识 1当前审核记录
submitAuditRecord
.
setPreFlag
(
CommonConstants
.
ONE_STRING
);
submitAuditRecord
.
setSubmitMan
(
user
.
getId
());
submitAuditRecord
.
setSubmitManName
(
user
.
getNickname
());
// 申请原因
// submitAuditRecord.setReason(reason);
// 审核类型
submitAuditRecord
.
setAuditType
(
CommonConstants
.
ZERO_STRING
);
submitAuditRecord
.
setCreateTime
(
LocalDateTime
.
now
());
// 提交节点名称
submitAuditRecord
.
setNodeName
(
"提交即审核通过"
);
submitAuditRecord
.
setSubmitCreateTime
(
LocalDateTime
.
now
());
submitAuditRecord
.
setEntityName
(
applyNo
);
auditRecordService
.
save
(
submitAuditRecord
);
}
//更新附件
updateFileId
(
tInsuranceUnpurchaseApply
);
List
<
TInsuranceUnpurchasePerson
>
personInfoList
=
new
ArrayList
<>();
for
(
TInsuranceUnpurchasePersonAddVo
vo
:
personList
)
{
TInsuranceUnpurchasePerson
person
=
new
TInsuranceUnpurchasePerson
();
person
.
setEmpIdcardNo
(
vo
.
getEmpIdcardNo
());
person
.
setEmpName
(
vo
.
getEmpName
());
person
.
setPost
(
vo
.
getPost
());
person
.
setApplyNoDetail
(
getDetailCode
(
applyDetail
,
vo
.
getRowIndex
()));
person
.
setCreateTime
(
tInsuranceUnpurchaseApply
.
getCreateTimeZc
());
initValue
(
tInsuranceUnpurchaseApply
,
person
);
personInfoList
.
add
(
person
);
}
personService
.
saveBatch
(
personInfoList
);
personInfoList
.
add
(
person
);
}
personService
.
saveBatch
(
personInfoList
);
}
else
{
return
R
.
failed
(
personList
);
//申请人是否属于子分公司和该项目是否有审批通过记录赋值
setValue
(
tInsuranceUnpurchaseApply
,
user
);
tInsuranceUnpurchaseApply
.
setCreateTimeZc
(
LocalDateTime
.
now
());
tInsuranceUnpurchaseApply
.
setCreateBy
(
user
.
getId
());
tInsuranceUnpurchaseApply
.
setCreateName
(
user
.
getNickname
());
tInsuranceUnpurchaseApply
.
setCreateUserDeptName
(
user
.
getDeptName
());
tInsuranceUnpurchaseApply
.
setCreateUserDeptId
(
user
.
getDeptId
().
toString
());
tInsuranceUnpurchaseApply
.
setApplyNo
(
applyNo
);
baseMapper
.
insert
(
tInsuranceUnpurchaseApply
);
createProcessLog
(
tInsuranceUnpurchaseApply
,
user
);
//更新附件
updateFileId
(
tInsuranceUnpurchaseApply
);
List
<
TInsuranceUnpurchasePerson
>
personInfoList
=
new
ArrayList
<>();
for
(
TInsuranceUnpurchasePersonAddVo
vo
:
personList
)
{
TInsuranceUnpurchasePerson
person
=
new
TInsuranceUnpurchasePerson
();
person
.
setEmpIdcardNo
(
vo
.
getEmpIdcardNo
());
person
.
setEmpName
(
vo
.
getEmpName
());
person
.
setPost
(
vo
.
getPost
());
person
.
setApplyNoDetail
(
getDetailCode
(
applyDetail
,
vo
.
getRowIndex
()));
person
.
setCreateTime
(
tInsuranceUnpurchaseApply
.
getCreateTimeZc
());
initValue
(
tInsuranceUnpurchaseApply
,
person
);
personInfoList
.
add
(
person
);
}
personService
.
saveBatch
(
personInfoList
);
}
}
else
{
return
R
.
failed
(
personList
);
}
}
}
catch
(
Exception
e
)
{
...
...
@@ -403,8 +349,38 @@ public class TInsuranceUnpurchaseApplyServiceImpl extends ServiceImpl<TInsurance
return
personList
;
}
private
void
createProcessLog
(
TInsuranceUnpurchaseApply
tInsuranceUnpurchaseApply
,
YifuUser
user
){
if
(
tInsuranceUnpurchaseApply
.
getAuditFlag
().
equals
(
CommonConstants
.
ZERO_STRING
))
{
// 记录提交审核日志
TAuditRecord
submitAuditRecord
=
new
TAuditRecord
();
submitAuditRecord
.
setDomainId
(
tInsuranceUnpurchaseApply
.
getId
());
submitAuditRecord
.
setFlowId
(
CommonConstants
.
EMPTY_STRING
);
submitAuditRecord
.
setNodeId
(
CommonConstants
.
EMPTY_STRING
);
submitAuditRecord
.
setApprovalMan
(
user
.
getId
());
submitAuditRecord
.
setApprovalManName
(
user
.
getNickname
());
// 审批结果为“提交”
submitAuditRecord
.
setApprovalResult
(
CommonConstants
.
dingleDigitStrArray
[
3
]);
submitAuditRecord
.
setDeleteFlag
(
CommonConstants
.
NOT_DELETE_FLAG
);
submitAuditRecord
.
setApprovalTime
(
LocalDateTime
.
now
());
// 审核记录标识 1当前审核记录
submitAuditRecord
.
setPreFlag
(
CommonConstants
.
ONE_STRING
);
submitAuditRecord
.
setSubmitMan
(
user
.
getId
());
submitAuditRecord
.
setSubmitManName
(
user
.
getNickname
());
// 申请原因
// submitAuditRecord.setReason(reason);
// 审核类型
submitAuditRecord
.
setAuditType
(
CommonConstants
.
ZERO_STRING
);
submitAuditRecord
.
setCreateTime
(
LocalDateTime
.
now
());
// 提交节点名称
submitAuditRecord
.
setNodeName
(
"提交即审核通过"
);
submitAuditRecord
.
setSubmitCreateTime
(
LocalDateTime
.
now
());
submitAuditRecord
.
setEntityName
(
tInsuranceUnpurchaseApply
.
getApplyNo
());
auditRecordService
.
save
(
submitAuditRecord
);
}
}
//申请人是否属于子分公司和该项目是否有审批通过记录赋值
private
void
setValue
(
TInsuranceUnpurchaseApply
tInsuranceUnpurchaseApply
,
YifuUser
user
,
String
applyNo
)
{
private
void
setValue
(
TInsuranceUnpurchaseApply
tInsuranceUnpurchaseApply
,
YifuUser
user
)
{
if
(
Common
.
isNotNull
(
tInsuranceUnpurchaseApply
.
getDeptNo
()))
{
List
<
String
>
deptList
=
CommonConstants
.
deptList
;
tInsuranceUnpurchaseApply
.
setCompanyFlag
(
deptList
.
stream
().
noneMatch
(
e
->
e
.
equals
(
user
.
getDeptName
()))
?
CommonConstants
.
ONE_STRING
:
CommonConstants
.
ZERO_STRING
);
...
...
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