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
2db856d8
You need to sign in or sign up before continuing.
Commit
2db856d8
authored
Jan 20, 2025
by
fangxinjiang
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/MVP1.7.5' into MVP1.7.5
parents
61ee2654
57465525
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
165 additions
and
109 deletions
+165
-109
CacheConstants.java
...oud/plus/v1/yifu/common/core/constant/CacheConstants.java
+6
-0
ResultConstants.java
...ud/plus/v1/yifu/common/core/constant/ResultConstants.java
+2
-0
AbastractAuditProcess.java
...us/v1/yifu/salary/service/impl/AbastractAuditProcess.java
+1
-1
TInsuranceUnpurchaseApplyServiceImpl.java
...ry/service/impl/TInsuranceUnpurchaseApplyServiceImpl.java
+154
-107
UserController.java
...u/cloud/plus/v1/yifu/admin/controller/UserController.java
+2
-1
No files found.
yifu-common/yifu-common-core/src/main/java/com/yifu/cloud/plus/v1/yifu/common/core/constant/CacheConstants.java
View file @
2db856d8
...
@@ -102,6 +102,10 @@ public interface CacheConstants {
...
@@ -102,6 +102,10 @@ public interface CacheConstants {
**/
**/
String
EVERYDAY_SALARY_FORM_CODE
=
"everyday_salary_form_code"
;
String
EVERYDAY_SALARY_FORM_CODE
=
"everyday_salary_form_code"
;
String
EVERYDAY_UNBUY_FORM_CODE
=
"everyday_unbuy_form_code"
;
String
EVERYDAY_UNBUYINFO_FORM_CODE
=
"everyday_unbuyinfo_form_code"
;
/**
/**
* @Description: 派单申请编码
* @Description: 派单申请编码
* @Author: fxj
* @Author: fxj
...
@@ -178,6 +182,8 @@ public interface CacheConstants {
...
@@ -178,6 +182,8 @@ public interface CacheConstants {
String
EMP_ADD_LOCK
=
"emp_add_lock"
;
String
EMP_ADD_LOCK
=
"emp_add_lock"
;
String
UNBUY_ADD_LOCK
=
"unbuy_add_lock"
;
String
SALARY_ACCOUNT_EXPORT_LOCK
=
"salary_account_export_lock"
;
String
SALARY_ACCOUNT_EXPORT_LOCK
=
"salary_account_export_lock"
;
String
SALARY_ACCOUNT_AUDIT_EXPORT_LOCK
=
"salary_account_audit_export_lock"
;
String
SALARY_ACCOUNT_AUDIT_EXPORT_LOCK
=
"salary_account_audit_export_lock"
;
...
...
yifu-common/yifu-common-core/src/main/java/com/yifu/cloud/plus/v1/yifu/common/core/constant/ResultConstants.java
View file @
2db856d8
...
@@ -22,6 +22,8 @@ public class ResultConstants {
...
@@ -22,6 +22,8 @@ public class ResultConstants {
public
static
final
String
NO_GETLOCK_DATA
=
"当前用户操作处理中,请稍后重试!"
;
public
static
final
String
NO_GETLOCK_DATA
=
"当前用户操作处理中,请稍后重试!"
;
public
static
final
String
NO_GETLOCK_DATA_SEARCH
=
"多用户同时请求中,请稍后重试!"
;
public
static
final
String
NO_GETLOCK_DATA_SEARCH
=
"多用户同时请求中,请稍后重试!"
;
public
static
final
String
NO_UNBUY_GETLOCK_DATA
=
"当前项目编码和不购买类型的数据处理中,请稍后重试!"
;
public
static
final
String
NO_ID
=
"操作失败,id不能为空!"
;
public
static
final
String
NO_ID
=
"操作失败,id不能为空!"
;
public
static
final
String
FILE_UPLOADING_DATA
=
"附件排队上传中,请稍后重试!"
;
public
static
final
String
FILE_UPLOADING_DATA
=
"附件排队上传中,请稍后重试!"
;
public
static
final
String
FILE_DOWN_LOAD_DATA
=
"导出排队下载中,请稍后重试!"
;
public
static
final
String
FILE_DOWN_LOAD_DATA
=
"导出排队下载中,请稍后重试!"
;
...
...
yifu-salary/yifu-salary-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/salary/service/impl/AbastractAuditProcess.java
View file @
2db856d8
...
@@ -210,7 +210,7 @@ public abstract class AbastractAuditProcess<T,E extends T> {
...
@@ -210,7 +210,7 @@ public abstract class AbastractAuditProcess<T,E extends T> {
* @return R<List<SysUser>>
* @return R<List<SysUser>>
**/
**/
public
R
<
List
<
SysUser
>>
getAuditUserList
(
String
entityId
,
YifuUser
loginUser
,
String
departId
,
String
processType
,
String
auditType
,
public
R
<
List
<
SysUser
>>
getAuditUserList
(
String
entityId
,
YifuUser
loginUser
,
String
departId
,
String
processType
,
String
auditType
,
String
reason
,
String
entityName
,
T
entity
,
Class
<
T
>
clazz
)
{
String
reason
,
String
entityName
,
T
entity
)
{
// 获取审批流程完整配置
// 获取审批流程完整配置
ProcessVo
processVo
=
this
.
getProcessVoByType
(
processType
);
ProcessVo
processVo
=
this
.
getProcessVoByType
(
processType
);
if
(
Common
.
isEmpty
(
processVo
))
{
if
(
Common
.
isEmpty
(
processVo
))
{
...
...
yifu-salary/yifu-salary-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/salary/service/impl/TInsuranceUnpurchaseApplyServiceImpl.java
View file @
2db856d8
...
@@ -9,9 +9,11 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
...
@@ -9,9 +9,11 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysUser
;
import
com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysUser
;
import
com.yifu.cloud.plus.v1.yifu.common.core.constant.CacheConstants
;
import
com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants
;
import
com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants
;
import
com.yifu.cloud.plus.v1.yifu.common.core.constant.ResultConstants
;
import
com.yifu.cloud.plus.v1.yifu.common.core.constant.ResultConstants
;
import
com.yifu.cloud.plus.v1.yifu.common.core.exception.CheckedException
;
import
com.yifu.cloud.plus.v1.yifu.common.core.exception.CheckedException
;
import
com.yifu.cloud.plus.v1.yifu.common.core.redis.RedisDistributedLock
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.Common
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.Common
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.DateUtil
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.DateUtil
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.OSSUtil
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.OSSUtil
;
...
@@ -37,6 +39,9 @@ import com.yifu.cloud.plus.v1.yifu.salary.vo.TInsuranceUnpurchasePersonCardVo;
...
@@ -37,6 +39,9 @@ import com.yifu.cloud.plus.v1.yifu.salary.vo.TInsuranceUnpurchasePersonCardVo;
import
lombok.extern.log4j.Log4j2
;
import
lombok.extern.log4j.Log4j2
;
import
org.apache.commons.lang.ArrayUtils
;
import
org.apache.commons.lang.ArrayUtils
;
import
org.apache.commons.lang.StringUtils
;
import
org.apache.commons.lang.StringUtils
;
import
org.springframework.cache.Cache
;
import
org.springframework.cache.CacheManager
;
import
org.springframework.cache.support.SimpleValueWrapper
;
import
org.springframework.context.annotation.Lazy
;
import
org.springframework.context.annotation.Lazy
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.annotation.Transactional
;
...
@@ -79,6 +84,9 @@ public class TInsuranceUnpurchaseApplyServiceImpl extends ServiceImpl<TInsurance
...
@@ -79,6 +84,9 @@ public class TInsuranceUnpurchaseApplyServiceImpl extends ServiceImpl<TInsurance
@Resource
@Resource
@Lazy
@Lazy
private
TInsuranceUnpurchaseApplyAuditProcess
tInsuranceUnpurchaseApplyAuditProcess
;
private
TInsuranceUnpurchaseApplyAuditProcess
tInsuranceUnpurchaseApplyAuditProcess
;
// 缓存信息
@Resource
private
CacheManager
cacheManager
;
/**
/**
* 含风险项目不购买申请表简单分页查询
* 含风险项目不购买申请表简单分页查询
...
@@ -158,118 +166,128 @@ public class TInsuranceUnpurchaseApplyServiceImpl extends ServiceImpl<TInsurance
...
@@ -158,118 +166,128 @@ public class TInsuranceUnpurchaseApplyServiceImpl extends ServiceImpl<TInsurance
@Override
@Override
public
R
addApply
(
TInsuranceUnpurchaseApply
tInsuranceUnpurchaseApply
)
{
public
R
addApply
(
TInsuranceUnpurchaseApply
tInsuranceUnpurchaseApply
)
{
YifuUser
user
=
SecurityUtils
.
getUser
();
YifuUser
user
=
SecurityUtils
.
getUser
();
//字段长度校验
// 获取redis分布式事务锁
if
(
Common
.
isNotNull
(
tInsuranceUnpurchaseApply
.
getReasonInfo
())
&&
tInsuranceUnpurchaseApply
.
getReasonInfo
().
length
()
>
200
)
{
String
key
=
CacheConstants
.
UNBUY_ADD_LOCK
+
CommonConstants
.
DOWN_LINE_STRING
return
R
.
failed
(
"原因说明不能超过两百个字符"
);
+
tInsuranceUnpurchaseApply
.
getDeptNo
()
+
CommonConstants
.
DOWN_LINE_STRING
+
tInsuranceUnpurchaseApply
.
getReasonType
();
String
requestId
;
try
{
requestId
=
RedisDistributedLock
.
getLock
(
key
,
"10"
);
}
catch
(
Exception
e
)
{
throw
new
RuntimeException
(
ResultConstants
.
NO_UNBUY_GETLOCK_DATA
+
CommonConstants
.
DOWN_LINE_STRING
+
e
.
getMessage
());
}
}
try
{
try
{
//获取明细当日最大申请编号
if
(
Common
.
isNotNull
(
requestId
))
{
String
applyDetail
;
//字段长度校验
applyDetail
=
baseMapper
.
getMaxInusuranceDetailCode
();
if
(
Common
.
isNotNull
(
tInsuranceUnpurchaseApply
.
getReasonInfo
())
&&
tInsuranceUnpurchaseApply
.
getReasonInfo
().
length
()
>
200
)
{
//暂存不做校验
return
R
.
failed
(
"原因说明不能超过两百个字符"
);
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
);
}
//更新附件
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
())
{
if
(
CommonConstants
.
ONE_STRING
.
equals
(
tInsuranceUnpurchaseApply
.
getSaveFlag
()))
{
for
(
TInsuranceUnpurchasePersonAddVo
vo
:
tInsuranceUnpurchaseApply
.
getPersonList
())
{
if
(
Common
.
isEmpty
(
tInsuranceUnpurchaseApply
.
getId
()))
{
TInsuranceUnpurchasePerson
person
=
new
TInsuranceUnpurchasePerson
();
// tInsuranceUnpurchaseApply.setApplyNo(applyNo);
person
.
setEmpIdcardNo
(
vo
.
getEmpIdcardNo
());
person
.
setEmpName
(
vo
.
getEmpName
());
person
.
setPost
(
vo
.
getPost
());
person
.
setApplyNoDetail
(
getDetailCode
(
applyDetail
,
vo
.
getRowIndex
()));
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
.
setCreateTimeZc
(
LocalDateTime
.
now
());
baseMapper
.
updateById
(
tInsuranceUnpurchaseApply
);
createProcessLog
(
tInsuranceUnpurchaseApply
,
user
);
//更新附件
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
);
tInsuranceUnpurchaseApply
.
setCreateTimeZc
(
LocalDateTime
.
now
());
tInsuranceUnpurchaseApply
.
setCreateBy
(
user
.
getId
());
tInsuranceUnpurchaseApply
.
setCreateBy
(
user
.
getId
());
tInsuranceUnpurchaseApply
.
setCreateName
(
user
.
getNickname
());
tInsuranceUnpurchaseApply
.
setCreateName
(
user
.
getNickname
());
tInsuranceUnpurchaseApply
.
setCreateUserDeptName
(
user
.
getDeptName
());
tInsuranceUnpurchaseApply
.
setCreateUserDeptName
(
user
.
getDeptName
());
tInsuranceUnpurchaseApply
.
setCreateUserDeptId
(
user
.
getDeptId
().
toString
());
tInsuranceUnpurchaseApply
.
setCreateUserDeptId
(
user
.
getDeptId
().
toString
());
tInsuranceUnpurchaseApply
.
setApplyNo
(
applyNo
);
baseMapper
.
insert
(
tInsuranceUnpurchaseApply
);
baseMapper
.
insert
(
tInsuranceUnpurchaseApply
);
createProcessLog
(
tInsuranceUnpurchaseApply
,
user
);
}
else
{
//更新附件
baseMapper
.
updateById
(
tInsuranceUnpurchaseApply
);
updateFileId
(
tInsuranceUnpurchaseApply
);
}
List
<
TInsuranceUnpurchasePerson
>
personInfoList
=
new
ArrayList
<>();
//更新附件
for
(
TInsuranceUnpurchasePersonAddVo
vo
:
personList
)
{
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
();
TInsuranceUnpurchasePerson
person
=
new
TInsuranceUnpurchasePerson
();
person
.
setEmpIdcardNo
(
vo
.
getEmpIdcardNo
());
person
.
setEmpIdcardNo
(
vo
.
getEmpIdcardNo
());
person
.
setEmpName
(
vo
.
getEmpName
());
person
.
setEmpName
(
vo
.
getEmpName
());
person
.
setPost
(
vo
.
getPost
());
person
.
setPost
(
vo
.
getPost
());
person
.
setApplyNoDetail
(
getDetailCode
(
applyDetail
,
vo
.
getRowIndex
()));
person
.
setCreateTime
(
tInsuranceUnpurchaseApply
.
getCreateTimeZc
());
initValue
(
tInsuranceUnpurchaseApply
,
person
);
initValue
(
tInsuranceUnpurchaseApply
,
person
);
person
Info
List
.
add
(
person
);
personList
.
add
(
person
);
}
}
personService
.
saveBatch
(
personInfoList
);
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
>
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
(
getCodeDetail
());
person
.
setCreateTime
(
tInsuranceUnpurchaseApply
.
getCreateTimeZc
());
initValue
(
tInsuranceUnpurchaseApply
,
person
);
personInfoList
.
add
(
person
);
}
personService
.
saveBatch
(
personInfoList
);
}
else
{
//申请人是否属于子分公司和该项目是否有审批通过记录赋值
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
(
getCodeDetail
());
person
.
setCreateTime
(
tInsuranceUnpurchaseApply
.
getCreateTimeZc
());
initValue
(
tInsuranceUnpurchaseApply
,
person
);
personInfoList
.
add
(
person
);
}
personService
.
saveBatch
(
personInfoList
);
}
}
else
{
return
R
.
failed
(
personList
);
}
}
}
else
{
return
R
.
failed
(
personList
);
}
}
return
R
.
ok
(
tInsuranceUnpurchaseApply
);
}
else
{
return
R
.
failed
(
ResultConstants
.
NO_UNBUY_GETLOCK_DATA
);
}
}
}
catch
(
Exception
e
)
{
}
finally
{
e
.
printStackTrace
();
//主动释放锁
return
R
.
failed
(
"系统异常,保存、更新失败!"
);
RedisDistributedLock
.
unlock
(
key
,
requestId
);
}
}
return
R
.
ok
(
tInsuranceUnpurchaseApply
);
}
}
@Override
@Override
...
@@ -433,27 +451,56 @@ public class TInsuranceUnpurchaseApplyServiceImpl extends ServiceImpl<TInsurance
...
@@ -433,27 +451,56 @@ public class TInsuranceUnpurchaseApplyServiceImpl extends ServiceImpl<TInsurance
}
}
//获取申请编码
//获取申请编码
public
String
getCode
()
{
public
synchronized
String
getCode
()
{
String
nowDay
=
DateUtil
.
getThisDay
();
String
nowDay
=
DateUtil
.
getThisDay
();
int
nowNums
=
1
;
int
nowNums
;
String
empCode
=
null
;
String
empCode
=
null
;
try
{
Cache
cache
=
cacheManager
.
getCache
(
CacheConstants
.
EVERYDAY_UNBUY_FORM_CODE
);
if
(
cache
!=
null
)
{
try
{
Object
nowNumObj
=
cache
.
get
(
nowDay
);
if
(
Common
.
isNotNull
(
nowNumObj
))
{
SimpleValueWrapper
value
=
(
SimpleValueWrapper
)
nowNumObj
;
nowNums
=
(
Integer
)
value
.
get
()
+
1
;
}
else
{
empCode
=
baseMapper
.
getMaxInusuranceCode
();
nowNums
=
Integer
.
parseInt
(
empCode
)
+
1
;
}
}
catch
(
NumberFormatException
e
)
{
log
.
error
(
"获取含风险项目不购买商险申请时出错:"
+
empCode
);
nowNums
=
1
;
}
cache
.
put
(
nowDay
,
nowNums
);
}
else
{
empCode
=
baseMapper
.
getMaxInusuranceCode
();
empCode
=
baseMapper
.
getMaxInusuranceCode
();
nowNums
=
Integer
.
parseInt
(
empCode
)
+
1
;
nowNums
=
Integer
.
parseInt
(
empCode
)
+
1
;
}
catch
(
NumberFormatException
e
)
{
log
.
error
(
"获取含风险项目不购买商险申请时出错:"
+
empCode
);
}
}
return
"SXBGM"
+
nowDay
+
this
.
getThreeNum
(
String
.
valueOf
(
nowNums
));
return
"SXBGM"
+
nowDay
+
this
.
getThreeNum
(
String
.
valueOf
(
nowNums
));
}
}
//获取申请编码
public
synchronized
String
getCodeDetail
()
{
public
String
getDetailCode
(
String
empCode
,
String
row
)
{
String
nowDay
=
DateUtil
.
getThisDay
();
String
nowDay
=
DateUtil
.
getThisDay
();
int
nowNums
=
1
;
int
nowNums
;
try
{
String
empCode
=
null
;
nowNums
=
Integer
.
parseInt
(
empCode
)
+
Integer
.
parseInt
(
row
);
Cache
cache
=
cacheManager
.
getCache
(
CacheConstants
.
EVERYDAY_UNBUYINFO_FORM_CODE
);
}
catch
(
NumberFormatException
e
)
{
if
(
cache
!=
null
)
{
log
.
error
(
"获取含风险项目不购买商险申请明细时出错:"
+
empCode
);
try
{
Object
nowNumObj
=
cache
.
get
(
nowDay
);
if
(
Common
.
isNotNull
(
nowNumObj
))
{
SimpleValueWrapper
value
=
(
SimpleValueWrapper
)
nowNumObj
;
nowNums
=
(
Integer
)
value
.
get
()
+
1
;
}
else
{
empCode
=
baseMapper
.
getMaxInusuranceDetailCode
();
nowNums
=
Integer
.
parseInt
(
empCode
)
+
1
;
}
}
catch
(
NumberFormatException
e
)
{
log
.
error
(
"获取含风险项目不购买商险申请明细时出错:"
+
empCode
);
nowNums
=
1
;
}
cache
.
put
(
nowDay
,
nowNums
);
}
else
{
empCode
=
baseMapper
.
getMaxInusuranceDetailCode
();
nowNums
=
Integer
.
parseInt
(
empCode
)
+
1
;
}
}
return
"SXBGMMX"
+
nowDay
+
this
.
getFiveNum
(
String
.
valueOf
(
nowNums
));
return
"SXBGMMX"
+
nowDay
+
this
.
getFiveNum
(
String
.
valueOf
(
nowNums
));
}
}
...
@@ -567,7 +614,7 @@ public class TInsuranceUnpurchaseApplyServiceImpl extends ServiceImpl<TInsurance
...
@@ -567,7 +614,7 @@ public class TInsuranceUnpurchaseApplyServiceImpl extends ServiceImpl<TInsurance
// 传:流程类型 1不购买商险申请;审核类型 0不购买商险审核
// 传:流程类型 1不购买商险申请;审核类型 0不购买商险审核
R
<
List
<
SysUser
>>
auditUserListR
=
tInsuranceUnpurchaseApplyAuditProcess
.
getAuditUserList
(
id
,
user
,
entity
.
getCreateUserDeptId
(),
R
<
List
<
SysUser
>>
auditUserListR
=
tInsuranceUnpurchaseApplyAuditProcess
.
getAuditUserList
(
id
,
user
,
entity
.
getCreateUserDeptId
(),
CommonConstants
.
ONE_STRING
,
CommonConstants
.
ZERO_STRING
,
CommonConstants
.
ONE_STRING
,
CommonConstants
.
ZERO_STRING
,
""
,
entity
.
getApplyNo
(),
entity
,
TInsuranceUnpurchaseApply
.
class
);
""
,
entity
.
getApplyNo
(),
entity
);
if
(
auditUserListR
==
null
||
auditUserListR
.
getCode
()
!=
CommonConstants
.
SUCCESS
||
auditUserListR
.
getData
()
==
null
)
{
if
(
auditUserListR
==
null
||
auditUserListR
.
getCode
()
!=
CommonConstants
.
SUCCESS
||
auditUserListR
.
getData
()
==
null
)
{
throw
new
CheckedException
(
"获取审批人失败,请联系管理员"
);
throw
new
CheckedException
(
"获取审批人失败,请联系管理员"
);
}
}
...
...
yifu-upms/yifu-upms-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/admin/controller/UserController.java
View file @
2db856d8
...
@@ -454,7 +454,8 @@ public class UserController {
...
@@ -454,7 +454,8 @@ public class UserController {
@Inner
@Inner
@PostMapping
(
value
=
{
"/inner/getSimpleUserByLoginName"
})
@PostMapping
(
value
=
{
"/inner/getSimpleUserByLoginName"
})
public
SysUser
getSimpleUserByLoginName
(
@RequestBody
String
loginName
)
{
public
SysUser
getSimpleUserByLoginName
(
@RequestBody
String
loginName
)
{
return
userService
.
getOne
(
Wrappers
.<
SysUser
>
query
().
lambda
().
eq
(
SysUser:
:
getUsername
,
loginName
).
last
(
CommonConstants
.
LAST_ONE_SQL
));
return
userService
.
getOne
(
Wrappers
.<
SysUser
>
query
().
lambda
().
eq
(
SysUser:
:
getUsername
,
loginName
)
.
eq
(
SysUser:
:
getDelFlag
,
CommonConstants
.
ZERO_STRING
).
last
(
CommonConstants
.
LAST_ONE_SQL
));
}
}
/**
/**
...
...
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