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
f063f031
Commit
f063f031
authored
Aug 02, 2022
by
hongguangwu
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/develop' into develop
parents
ea857298
5ac1d4bc
Show whitespace changes
Inline
Side-by-side
Showing
30 changed files
with
775 additions
and
823 deletions
+775
-823
EmpProjectDispatchVo.java
.../cloud/plus/v1/yifu/archives/vo/EmpProjectDispatchVo.java
+7
-1
TEmployeeInfoController.java
.../v1/yifu/archives/controller/TEmployeeInfoController.java
+2
-1
TEmployeeInfoServiceImpl.java
.../yifu/archives/service/impl/TEmployeeInfoServiceImpl.java
+7
-5
ArchivesDaprUtil.java
...cloud/plus/v1/yifu/common/dapr/util/ArchivesDaprUtil.java
+1
-1
LdapProperties.java
...cloud/plus/v1/yifu/common/ldap/config/LdapProperties.java
+25
-0
PersonVo.java
.../yifu/cloud/plus/v1/yifu/common/ldap/entity/PersonVo.java
+2
-2
LdapCheck.java
...m/yifu/cloud/plus/v1/yifu/common/ldap/util/LdapCheck.java
+0
-121
LdapUtil.java
...om/yifu/cloud/plus/v1/yifu/common/ldap/util/LdapUtil.java
+17
-20
spring.factories
...-common-ldap/src/main/resources/META-INF/spring.factories
+1
-1
ldapConfig.properties
...yifu-common-ldap/src/main/resources/ldapConfig.properties
+6
-0
MybatisPlusMetaObjectHandler.java
...u/common/mybatis/config/MybatisPlusMetaObjectHandler.java
+5
-5
TInsuranceSettleCancel.java
...lus/v1/yifu/insurances/entity/TInsuranceSettleCancel.java
+7
-9
BigDecimalUtils.java
...u/cloud/plus/v1/yifu/insurances/util/BigDecimalUtils.java
+17
-0
InsuranceReplaceParam.java
...oud/plus/v1/yifu/insurances/vo/InsuranceReplaceParam.java
+8
-0
InsuredParam.java
...m/yifu/cloud/plus/v1/yifu/insurances/vo/InsuredParam.java
+9
-3
TInsuranceDetailController.java
...ifu/insurances/controller/TInsuranceDetailController.java
+2
-2
TInsuranceDetailMapper.java
...lus/v1/yifu/insurances/mapper/TInsuranceDetailMapper.java
+2
-2
TInsuranceDetailServiceImpl.java
.../insurances/service/impl/TInsuranceDetailServiceImpl.java
+252
-73
TInsuranceDetailMapper.xml
...-biz/src/main/resources/mapper/TInsuranceDetailMapper.xml
+24
-15
TInsuranceSettleCancelMapper.xml
...rc/main/resources/mapper/TInsuranceSettleCancelMapper.xml
+1
-2
TProvidentFund.java
...yifu/cloud/plus/v1/yifu/social/entity/TProvidentFund.java
+14
-0
TSocialInfo.java
...om/yifu/cloud/plus/v1/yifu/social/entity/TSocialInfo.java
+14
-0
TDispatchInfoServiceImpl.java
...v1/yifu/social/service/impl/TDispatchInfoServiceImpl.java
+58
-20
TPaymentInfoServiceImpl.java
.../v1/yifu/social/service/impl/TPaymentInfoServiceImpl.java
+262
-531
ServiceUtil.java
.../com/yifu/cloud/plus/v1/yifu/social/util/ServiceUtil.java
+0
-1
TProvidentFundMapper.xml
...al-biz/src/main/resources/mapper/TProvidentFundMapper.xml
+5
-1
TSocialInfoMapper.xml
...ocial-biz/src/main/resources/mapper/TSocialInfoMapper.xml
+5
-1
SysDeptServiceImpl.java
...d.plus.v1/yifu/admin/service/impl/SysDeptServiceImpl.java
+7
-4
SysUserServiceImpl.java
...d.plus.v1/yifu/admin/service/impl/SysUserServiceImpl.java
+6
-1
SysUserMapper.xml
...yifu-upms-biz/src/main/resources/mapper/SysUserMapper.xml
+9
-1
No files found.
yifu-archives/yifu-archives-api/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/vo/EmpProjectDispatchVo.java
View file @
f063f031
...
@@ -64,7 +64,13 @@ public class EmpProjectDispatchVo implements Serializable {
...
@@ -64,7 +64,13 @@ public class EmpProjectDispatchVo implements Serializable {
@ExcelAttribute
(
name
=
"身份证号"
,
isNotEmpty
=
true
,
errorInfo
=
"身份证号不能为空"
,
maxLength
=
20
)
@ExcelAttribute
(
name
=
"身份证号"
,
isNotEmpty
=
true
,
errorInfo
=
"身份证号不能为空"
,
maxLength
=
20
)
@ExcelProperty
(
value
=
"身份证号"
)
@ExcelProperty
(
value
=
"身份证号"
)
private
String
empIdcard
;
private
String
empIdcard
;
/**
* 项目编码
*/
@NotNull
(
message
=
"项目编码不能为空"
)
@ExcelProperty
(
value
=
"项目编码"
)
@ExcelAttribute
(
name
=
"项目编码"
,
isNotEmpty
=
true
,
errorInfo
=
"项目编码不能为空"
,
maxLength
=
20
)
private
String
deptId
;
/**
/**
* 项目编码
* 项目编码
*/
*/
...
...
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/controller/TEmployeeInfoController.java
View file @
f063f031
...
@@ -469,7 +469,8 @@ public class TEmployeeInfoController {
...
@@ -469,7 +469,8 @@ public class TEmployeeInfoController {
* @Date: 2022/08/01 18:52
* @Date: 2022/08/01 18:52
**/
**/
@Operation
(
summary
=
"通过EMP_ID查询人员档案变更日志"
,
description
=
"通过EMP_ID查询人员档案变更日志"
)
@Operation
(
summary
=
"通过EMP_ID查询人员档案变更日志"
,
description
=
"通过EMP_ID查询人员档案变更日志"
)
@GetMapping
(
"/inner/updateEmpInfo"
)
@Inner
@PostMapping
(
"/inner/updateEmpInfo"
)
public
Boolean
updateEmpInfo
(
@RequestBody
UpdateEmpVo
vo
)
{
public
Boolean
updateEmpInfo
(
@RequestBody
UpdateEmpVo
vo
)
{
return
tEmployeeInfoService
.
updateEmpInfo
(
vo
);
return
tEmployeeInfoService
.
updateEmpInfo
(
vo
);
}
}
...
...
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/service/impl/TEmployeeInfoServiceImpl.java
View file @
f063f031
...
@@ -32,7 +32,6 @@ import com.yifu.cloud.plus.v1.check.entity.TCheckIdCard;
...
@@ -32,7 +32,6 @@ import com.yifu.cloud.plus.v1.check.entity.TCheckIdCard;
import
com.yifu.cloud.plus.v1.check.entity.TCheckMobile
;
import
com.yifu.cloud.plus.v1.check.entity.TCheckMobile
;
import
com.yifu.cloud.plus.v1.yifu.archives.constants.EmployeeConstants
;
import
com.yifu.cloud.plus.v1.yifu.archives.constants.EmployeeConstants
;
import
com.yifu.cloud.plus.v1.yifu.archives.entity.*
;
import
com.yifu.cloud.plus.v1.yifu.archives.entity.*
;
import
com.yifu.cloud.plus.v1.yifu.archives.mapper.TEmployeeContractInfoMapper
;
import
com.yifu.cloud.plus.v1.yifu.archives.mapper.TEmployeeInfoMapper
;
import
com.yifu.cloud.plus.v1.yifu.archives.mapper.TEmployeeInfoMapper
;
import
com.yifu.cloud.plus.v1.yifu.archives.service.*
;
import
com.yifu.cloud.plus.v1.yifu.archives.service.*
;
import
com.yifu.cloud.plus.v1.yifu.archives.vo.*
;
import
com.yifu.cloud.plus.v1.yifu.archives.vo.*
;
...
@@ -2094,14 +2093,14 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
...
@@ -2094,14 +2093,14 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
**/
**/
@Override
@Override
public
Boolean
updateEmpInfo
(
UpdateEmpVo
vo
)
{
public
Boolean
updateEmpInfo
(
UpdateEmpVo
vo
)
{
if
(
Common
.
is
Empty
(
vo
)){
if
(
Common
.
is
NotNull
(
vo
)){
if
(
Common
.
is
Empty
(
vo
.
getEmpIdCard
())){
if
(
Common
.
is
NotNull
(
vo
.
getEmpIdCard
())){
TEmployeeInfo
employeeInfo
=
baseMapper
.
selectOne
(
Wrappers
.<
TEmployeeInfo
>
query
().
lambda
()
TEmployeeInfo
employeeInfo
=
baseMapper
.
selectOne
(
Wrappers
.<
TEmployeeInfo
>
query
().
lambda
()
.
eq
(
TEmployeeInfo:
:
getDeleteFlag
,
CommonConstants
.
ZERO_STRING
)
.
eq
(
TEmployeeInfo:
:
getDeleteFlag
,
CommonConstants
.
ZERO_STRING
)
.
eq
(
TEmployeeInfo:
:
getEmpIdcard
,
vo
.
getEmpIdCard
())
.
eq
(
TEmployeeInfo:
:
getEmpIdcard
,
vo
.
getEmpIdCard
())
.
eq
(
TEmployeeInfo:
:
getStatus
,
CommonConstants
.
ZERO_INT
)
.
eq
(
TEmployeeInfo:
:
getStatus
,
CommonConstants
.
ZERO_INT
)
.
last
(
CommonConstants
.
LAST_ONE_SQL
));
.
last
(
CommonConstants
.
LAST_ONE_SQL
));
if
(
Common
.
is
Empty
(
employeeInfo
)){
if
(
Common
.
is
NotNull
(
employeeInfo
)){
employeeInfo
.
setStatus
(
CommonConstants
.
ONE_INT
);
employeeInfo
.
setStatus
(
CommonConstants
.
ONE_INT
);
baseMapper
.
updateById
(
employeeInfo
);
baseMapper
.
updateById
(
employeeInfo
);
}
}
...
@@ -2120,11 +2119,13 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
...
@@ -2120,11 +2119,13 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
}
}
if
(
Common
.
isNotNull
(
vo
.
getProjectNo
())){
if
(
Common
.
isNotNull
(
vo
.
getProjectNo
())){
TEmployeeProject
p
=
tEmployeeProjectService
.
getOne
(
Wrappers
.<
TEmployeeProject
>
query
().
lambda
()
TEmployeeProject
p
=
tEmployeeProjectService
.
getOne
(
Wrappers
.<
TEmployeeProject
>
query
().
lambda
()
.
eq
(
TEmployeeProject:
:
getDeleteFlag
,
CommonConstants
.
ONE_STRING
)
.
eq
(
TEmployeeProject:
:
getDeleteFlag
,
CommonConstants
.
ZERO_INT
)
.
eq
(
TEmployeeProject:
:
getEmpIdcard
,
vo
.
getEmpIdCard
())
.
eq
(
TEmployeeProject:
:
getEmpIdcard
,
vo
.
getEmpIdCard
())
.
eq
(
TEmployeeProject:
:
getDeptNo
,
vo
.
getProjectNo
())
.
eq
(
TEmployeeProject:
:
getDeptNo
,
vo
.
getProjectNo
())
.
eq
(
TEmployeeProject:
:
getStatus
,
CommonConstants
.
ZERO_INT
)
.
last
(
CommonConstants
.
LAST_ONE_SQL
));
.
last
(
CommonConstants
.
LAST_ONE_SQL
));
if
(
Common
.
isNotNull
(
p
)){
if
(
Common
.
isNotNull
(
p
)){
p
.
setStatus
(
CommonConstants
.
ONE_INT
);
tEmployeeProjectService
.
updateById
(
p
);
tEmployeeProjectService
.
updateById
(
p
);
}
}
}
}
...
@@ -2162,6 +2163,7 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
...
@@ -2162,6 +2163,7 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
contract
.
setFileTown
(
emp
.
getFileTown
());
contract
.
setFileTown
(
emp
.
getFileTown
());
}
}
}
}
contract
.
setAuditStatus
(
CommonConstants
.
ONE_INT
);
contract
.
setApplyNo
(
contractServicer
.
getCode
(
false
));
contract
.
setApplyNo
(
contractServicer
.
getCode
(
false
));
contractServicer
.
save
(
contract
);
contractServicer
.
save
(
contract
);
contractAdd
.
setId
(
contract
.
getId
());
contractAdd
.
setId
(
contract
.
getId
());
...
...
yifu-common/yifu-common-dapr/src/main/java/com/yifu/cloud/plus/v1/yifu/common/dapr/util/ArchivesDaprUtil.java
View file @
f063f031
...
@@ -181,7 +181,7 @@ public class ArchivesDaprUtil {
...
@@ -181,7 +181,7 @@ public class ArchivesDaprUtil {
vo
.
setContractName
(
contractName
);
vo
.
setContractName
(
contractName
);
R
<
Boolean
>
res
=
HttpDaprUtil
.
invokeMethodPost
(
R
<
Boolean
>
res
=
HttpDaprUtil
.
invokeMethodPost
(
daprArchivesProperties
.
getAppUrl
(),
daprArchivesProperties
.
getAppId
()
daprArchivesProperties
.
getAppUrl
(),
daprArchivesProperties
.
getAppId
()
,
"/temployeeinfo/inner/updateEmpInfo"
,
JSON
.
toJSONString
(
vo
),
UpdateEmpVo
.
class
,
SecurityConstants
.
FROM_IN
);
,
"/temployeeinfo/inner/updateEmpInfo"
,
JSON
.
toJSONString
(
vo
),
Boolean
.
class
,
SecurityConstants
.
FROM_IN
);
if
(
Common
.
isEmpty
(
res
)){
if
(
Common
.
isEmpty
(
res
)){
return
R
.
failed
(
"更新人员档案、项目档案、合同状态信息失败!"
);
return
R
.
failed
(
"更新人员档案、项目档案、合同状态信息失败!"
);
}
}
...
...
yifu-common/yifu-common-ldap/src/main/java/com/yifu/cloud/plus/v1/yifu/common/ldap/config/LdapProperties.java
0 → 100644
View file @
f063f031
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
common
.
ldap
.
config
;
import
lombok.Data
;
import
org.springframework.boot.context.properties.ConfigurationProperties
;
import
org.springframework.context.annotation.PropertySource
;
import
org.springframework.stereotype.Component
;
@Data
@Component
@PropertySource
(
"classpath:ldapConfig.properties"
)
@ConfigurationProperties
(
value
=
"ldap"
,
ignoreInvalidFields
=
false
)
public
class
LdapProperties
{
String
url
;
String
dn
;
String
password
;
Integer
port
;
String
userName
;
String
baseDn
;
}
yifu-common/yifu-common-ldap/src/main/java/com/yifu/cloud/plus/v1/yifu/common/ldap/entity/PersonVo.java
View file @
f063f031
...
@@ -56,13 +56,13 @@ public class PersonVo {
...
@@ -56,13 +56,13 @@ public class PersonVo {
private
String
homeDirectory
;
private
String
homeDirectory
;
/**
/**
*
主键
*
部门名称
*/
*/
@Attribute
(
name
=
"ou"
)
@Attribute
(
name
=
"ou"
)
private
String
deptName
;
private
String
deptName
;
/**
/**
*
主键
*
用户密码
*/
*/
@Attribute
(
name
=
"userPassword"
)
@Attribute
(
name
=
"userPassword"
)
private
String
password
;
private
String
password
;
...
...
yifu-common/yifu-common-ldap/src/main/java/com/yifu/cloud/plus/v1/yifu/common/ldap/util/LdapCheck.java
deleted
100644 → 0
View file @
ea857298
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
common
.
ldap
.
util
;
import
javax.naming.AuthenticationException
;
import
javax.naming.Context
;
import
javax.naming.NamingEnumeration
;
import
javax.naming.NamingException
;
import
javax.naming.directory.SearchControls
;
import
javax.naming.directory.SearchResult
;
import
javax.naming.ldap.Control
;
import
javax.naming.ldap.InitialLdapContext
;
import
javax.naming.ldap.LdapContext
;
import
java.util.Hashtable
;
/**
* 用户登陆认证,LDAP跨域认证,通过LDAP对用户进行更新
*
*/
public
class
LdapCheck
{
private
static
LdapContext
ctx
=
null
;
private
static
Control
[]
connCtls
=
null
;
/**** 定义LDAP的基本连接信息 ******/
// LDAP的连接地址(ldap://ip:port/)port默认为389
private
static
String
URL
=
"192.168.1.65"
;
//port
private
static
String
port
=
"389"
;
// LDAP的根DN
private
static
String
BASEDN
=
"dc=worfu,dc=com"
;
// LDAP的连接账号(身份认证管理平台添加的应用账号,应用账号格式:uid=?,ou=?,dc=????)
private
static
String
PRINCIPAL
=
"cn=admin,dc=worfu,dc=com"
;
// LDAP的连接账号的密码(身份认证管理平台添加的应用账号的密码)
private
static
String
PASSWORD
=
"yifu123456!"
;
// 校验用户名密码的方法
public
static
boolean
authenticate
(
String
usr
,
String
pwd
)
{
boolean
valide
=
false
;
if
(
pwd
==
null
||
pwd
==
""
)
return
false
;
if
(
ctx
==
null
)
{
getCtx
();
}
String
userDN
=
getUserDN
(
usr
);
if
(
""
.
equals
(
userDN
)
||
userDN
==
null
)
{
return
false
;
}
try
{
ctx
.
addToEnvironment
(
Context
.
SECURITY_PRINCIPAL
,
userDN
);
ctx
.
addToEnvironment
(
Context
.
SECURITY_CREDENTIALS
,
pwd
);
ctx
.
reconnect
(
connCtls
);
valide
=
true
;
closeCtx
();
}
catch
(
AuthenticationException
e
)
{
System
.
out
.
println
(
userDN
+
" is not authenticated"
);
System
.
out
.
println
(
e
.
toString
());
valide
=
false
;
}
catch
(
NamingException
e
)
{
System
.
out
.
println
(
userDN
+
" is not authenticated"
);
valide
=
false
;
}
return
valide
;
}
public
static
void
getCtx
()
{
if
(
ctx
!=
null
)
{
return
;
}
Hashtable
<
String
,
String
>
env
=
new
Hashtable
<
String
,
String
>();
env
.
put
(
Context
.
INITIAL_CONTEXT_FACTORY
,
"com.sun.jndi.ldap.LdapCtxFactory"
);
env
.
put
(
Context
.
PROVIDER_URL
,
URL
+
":"
+
port
+
BASEDN
);
env
.
put
(
Context
.
SECURITY_AUTHENTICATION
,
"simple"
);
env
.
put
(
Context
.
SECURITY_PRINCIPAL
,
PRINCIPAL
);
env
.
put
(
Context
.
SECURITY_CREDENTIALS
,
PASSWORD
);
try
{
// 链接ldap
ctx
=
new
InitialLdapContext
(
env
,
connCtls
);
}
catch
(
AuthenticationException
e
)
{
System
.
out
.
println
(
"Authentication faild: "
+
e
.
toString
());
}
catch
(
Exception
e
)
{
System
.
out
.
println
(
"Something wrong while authenticating: "
+
e
.
toString
());
}
}
public
static
void
closeCtx
()
{
try
{
if
(
ctx
!=
null
)
ctx
.
close
();
}
catch
(
NamingException
ex
)
{
}
}
public
static
String
getUserDN
(
String
uid
)
{
String
userDN
=
""
;
try
{
SearchControls
constraints
=
new
SearchControls
();
constraints
.
setSearchScope
(
SearchControls
.
SUBTREE_SCOPE
);
NamingEnumeration
<?>
en
=
ctx
.
search
(
""
,
"uid="
+
uid
,
constraints
);
if
(
en
==
null
)
{
System
.
out
.
println
(
"Have no NamingEnumeration."
);
}
if
(!
en
.
hasMoreElements
())
{
System
.
out
.
println
(
"Have no element."
);
}
while
(
en
!=
null
&&
en
.
hasMoreElements
())
{
Object
obj
=
en
.
nextElement
();
if
(
obj
instanceof
SearchResult
)
{
SearchResult
si
=
(
SearchResult
)
obj
;
userDN
+=
si
.
getName
();
userDN
+=
","
+
BASEDN
;
}
else
{
System
.
out
.
println
(
obj
);
}
System
.
out
.
println
();
}
}
catch
(
Exception
e
)
{
System
.
out
.
println
(
"Exception in search():"
+
e
);
}
return
userDN
;
}
}
\ No newline at end of file
yifu-common/yifu-common-ldap/src/main/java/com/yifu/cloud/plus/v1/yifu/common/ldap/util/LdapUtil.java
View file @
f063f031
...
@@ -2,10 +2,12 @@ package com.yifu.cloud.plus.v1.yifu.common.ldap.util;
...
@@ -2,10 +2,12 @@ package com.yifu.cloud.plus.v1.yifu.common.ldap.util;
import
com.unboundid.ldap.sdk.*
;
import
com.unboundid.ldap.sdk.*
;
import
com.unboundid.ldap.sdk.controls.SubentriesRequestControl
;
import
com.unboundid.ldap.sdk.controls.SubentriesRequestControl
;
import
com.yifu.cloud.plus.v1.yifu.common.ldap.config.LdapProperties
;
import
com.yifu.cloud.plus.v1.yifu.common.ldap.entity.PersonVo
;
import
com.yifu.cloud.plus.v1.yifu.common.ldap.entity.PersonVo
;
import
com.yifu.cloud.plus.v1.yifu.common.ldap.mapper.PersonAttributesMapper
;
import
com.yifu.cloud.plus.v1.yifu.common.ldap.mapper.PersonAttributesMapper
;
import
lombok.extern.log4j.Log4j2
;
import
lombok.extern.log4j.Log4j2
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.boot.context.properties.EnableConfigurationProperties
;
import
org.springframework.ldap.core.LdapTemplate
;
import
org.springframework.ldap.core.LdapTemplate
;
import
javax.naming.AuthenticationException
;
import
javax.naming.AuthenticationException
;
...
@@ -23,26 +25,19 @@ import java.util.List;
...
@@ -23,26 +25,19 @@ import java.util.List;
import
static
org
.
springframework
.
ldap
.
query
.
LdapQueryBuilder
.
query
;
import
static
org
.
springframework
.
ldap
.
query
.
LdapQueryBuilder
.
query
;
@Log4j2
@Log4j2
@EnableConfigurationProperties
(
LdapProperties
.
class
)
public
class
LdapUtil
{
public
class
LdapUtil
{
@Autowired
@Autowired
private
LdapTemplate
ldapTemplate
;
private
LdapTemplate
ldapTemplate
;
@Autowired
private
LdapProperties
ldapProperties
;
private
static
LdapContext
ctx
=
null
;
private
static
LdapContext
ctx
=
null
;
private
static
Control
[]
connCtls
=
null
;
private
static
Control
[]
connCtls
=
null
;
/**** 定义LDAP的基本连接信息 ******/
// LDAP的连接地址(ldap://ip:port/)port默认为389
private
static
String
URL
=
"ldap://192.168.1.65:389/"
;
// LDAP的根DN
private
static
String
BASEDN
=
"dc=worfu,dc=com"
;
// LDAP的连接账号(身份认证管理平台添加的应用账号,应用账号格式:uid=?,ou=?,dc=????)
private
static
String
PRINCIPAL
=
"cn=admin,dc=worfu,dc=com"
;
// LDAP的连接账号的密码(身份认证管理平台添加的应用账号的密码)
private
static
String
PASSWORD
=
"yifu123456!"
;
/**
/**
* @return List<SearchResultEntry>
* @return List<SearchResultEntry>
* @author huyc
* @author huyc
...
@@ -52,8 +47,9 @@ public class LdapUtil {
...
@@ -52,8 +47,9 @@ public class LdapUtil {
public
List
<
SearchResultEntry
>
getAllPersonNamesWithTraditionalWay
()
{
public
List
<
SearchResultEntry
>
getAllPersonNamesWithTraditionalWay
()
{
List
<
SearchResultEntry
>
result
=
new
ArrayList
<
SearchResultEntry
>();
List
<
SearchResultEntry
>
result
=
new
ArrayList
<
SearchResultEntry
>();
try
{
try
{
LDAPConnection
connection
=
new
LDAPConnection
(
"192.168.1.65"
,
389
,
"cn=admin,dc=worfu,dc=com"
,
"yifu123456!"
);
LDAPConnection
connection
=
new
LDAPConnection
(
ldapProperties
.
getUrl
(),
ldapProperties
.
getPort
(),
SearchRequest
searchRequest
=
new
SearchRequest
(
"ou=安徽皖信人力资源管理有限公司,ou=wanxin,dc=worfu,dc=com"
,
SearchScope
.
SUB
,
"(objectclass=*)"
);
ldapProperties
.
getUserName
(),
ldapProperties
.
getPassword
());
SearchRequest
searchRequest
=
new
SearchRequest
(
ldapProperties
.
getBaseDn
(),
SearchScope
.
SUB
,
"(objectclass=*)"
);
searchRequest
.
addControl
(
new
SubentriesRequestControl
());
searchRequest
.
addControl
(
new
SubentriesRequestControl
());
SearchResult
searchResult
=
connection
.
search
(
searchRequest
);
SearchResult
searchResult
=
connection
.
search
(
searchRequest
);
for
(
SearchResultEntry
entry
:
searchResult
.
getSearchEntries
())
{
for
(
SearchResultEntry
entry
:
searchResult
.
getSearchEntries
())
{
...
@@ -99,16 +95,17 @@ public class LdapUtil {
...
@@ -99,16 +95,17 @@ public class LdapUtil {
return
valide
;
return
valide
;
}
}
public
static
void
getCtx
()
{
public
void
getCtx
()
{
if
(
ctx
!=
null
)
{
if
(
ctx
!=
null
)
{
return
;
return
;
}
}
Hashtable
<
String
,
String
>
env
=
new
Hashtable
<
String
,
String
>();
Hashtable
<
String
,
String
>
env
=
new
Hashtable
<
String
,
String
>();
env
.
put
(
Context
.
INITIAL_CONTEXT_FACTORY
,
"com.sun.jndi.ldap.LdapCtxFactory"
);
env
.
put
(
Context
.
INITIAL_CONTEXT_FACTORY
,
"com.sun.jndi.ldap.LdapCtxFactory"
);
env
.
put
(
Context
.
PROVIDER_URL
,
URL
+
BASEDN
);
env
.
put
(
Context
.
PROVIDER_URL
,
"ldap://"
+
ldapProperties
.
getUrl
()
+
":"
+
ldapProperties
.
getPort
()
+
"/"
+
ldapProperties
.
getDn
());
env
.
put
(
Context
.
SECURITY_AUTHENTICATION
,
"simple"
);
env
.
put
(
Context
.
SECURITY_AUTHENTICATION
,
"simple"
);
env
.
put
(
Context
.
SECURITY_PRINCIPAL
,
PRINCIPAL
);
env
.
put
(
Context
.
SECURITY_PRINCIPAL
,
ldapProperties
.
getUserName
()
);
env
.
put
(
Context
.
SECURITY_CREDENTIALS
,
PASSWORD
);
env
.
put
(
Context
.
SECURITY_CREDENTIALS
,
ldapProperties
.
getPassword
()
);
try
{
try
{
// 链接ldap
// 链接ldap
ctx
=
new
InitialLdapContext
(
env
,
connCtls
);
ctx
=
new
InitialLdapContext
(
env
,
connCtls
);
...
@@ -117,12 +114,12 @@ public class LdapUtil {
...
@@ -117,12 +114,12 @@ public class LdapUtil {
}
}
}
}
public
static
void
closeCtx
()
throws
NamingException
{
public
void
closeCtx
()
throws
NamingException
{
if
(
ctx
!=
null
)
if
(
ctx
!=
null
)
ctx
.
close
();
ctx
.
close
();
}
}
public
static
String
getUserDN
(
String
uid
)
{
public
String
getUserDN
(
String
uid
)
{
String
userDN
=
""
;
String
userDN
=
""
;
try
{
try
{
SearchControls
constraints
=
new
SearchControls
();
SearchControls
constraints
=
new
SearchControls
();
...
@@ -133,7 +130,7 @@ public class LdapUtil {
...
@@ -133,7 +130,7 @@ public class LdapUtil {
if
(
obj
instanceof
javax
.
naming
.
directory
.
SearchResult
)
{
if
(
obj
instanceof
javax
.
naming
.
directory
.
SearchResult
)
{
javax
.
naming
.
directory
.
SearchResult
si
=
(
javax
.
naming
.
directory
.
SearchResult
)
obj
;
javax
.
naming
.
directory
.
SearchResult
si
=
(
javax
.
naming
.
directory
.
SearchResult
)
obj
;
userDN
+=
si
.
getName
();
userDN
+=
si
.
getName
();
userDN
+=
","
+
BASEDN
;
userDN
+=
","
+
ldapProperties
.
getDn
()
;
}
}
}
}
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
...
...
yifu-common/yifu-common-ldap/src/main/resources/META-INF/spring.factories
View file @
f063f031
org.springframework.boot.autoconfigure.EnableAutoConfiguration=\
org.springframework.boot.autoconfigure.EnableAutoConfiguration=\
com.yifu.cloud.plus.v1.yifu.common.ldap.
config.LdapAutoConfigue
\
com.yifu.cloud.plus.v1.yifu.common.ldap.
util.LdapUtil
\
yifu-common/yifu-common-ldap/src/main/resources/ldapConfig.properties
0 → 100644
View file @
f063f031
ldap.url
=
192.168.1.65
ldap.port
=
389
ldap.userName
=
cn=admin,dc=worfu,dc=com
ldap.password
=
yifu123456!
ldap.dn
=
dc=worfu,dc=com
ldap.baseDn
=
ou=
\u
5B89
\u
5FBD
\u7696\u
4FE1
\u
4EBA
\u
529B
\u
8D44
\u
6E90
\u
7BA1
\u7406\u6709\u9650\u
516C
\u
53F8,ou=wanxin,dc=worfu,dc=com
\ No newline at end of file
yifu-common/yifu-common-mybatis/src/main/java/com/yifu.cloud.plus.v1/yifu/common/mybatis/config/MybatisPlusMetaObjectHandler.java
View file @
f063f031
...
@@ -27,13 +27,13 @@ public class MybatisPlusMetaObjectHandler implements MetaObjectHandler {
...
@@ -27,13 +27,13 @@ public class MybatisPlusMetaObjectHandler implements MetaObjectHandler {
log
.
debug
(
"mybatis plus start insert fill ...."
);
log
.
debug
(
"mybatis plus start insert fill ...."
);
LocalDateTime
now
=
LocalDateTime
.
now
();
LocalDateTime
now
=
LocalDateTime
.
now
();
fillValIfNullByName
(
"createTime"
,
now
,
metaObject
,
fals
e
);
fillValIfNullByName
(
"createTime"
,
now
,
metaObject
,
tru
e
);
fillValIfNullByName
(
"updateTime"
,
now
,
metaObject
,
fals
e
);
fillValIfNullByName
(
"updateTime"
,
now
,
metaObject
,
tru
e
);
YifuUser
yifuUser
=
getYifuUser
();
YifuUser
yifuUser
=
getYifuUser
();
if
(
Common
.
isNotNull
(
yifuUser
)){
if
(
Common
.
isNotNull
(
yifuUser
)){
fillValIfNullByName
(
"createBy"
,
yifuUser
.
getId
(),
metaObject
,
fals
e
);
fillValIfNullByName
(
"createBy"
,
yifuUser
.
getId
(),
metaObject
,
tru
e
);
fillValIfNullByName
(
"updateBy"
,
yifuUser
.
getId
(),
metaObject
,
fals
e
);
fillValIfNullByName
(
"updateBy"
,
yifuUser
.
getId
(),
metaObject
,
tru
e
);
fillValIfNullByName
(
"createName"
,
yifuUser
.
getNickname
(),
metaObject
,
fals
e
);
fillValIfNullByName
(
"createName"
,
yifuUser
.
getNickname
(),
metaObject
,
tru
e
);
}
}
}
}
...
...
yifu-insurances/yifu-insurances-api/src/main/java/com/yifu/cloud/plus/v1/yifu/insurances/entity/TInsuranceSettleCancel.java
View file @
f063f031
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
insurances
.
entity
;
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
insurances
.
entity
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
io.swagger.v3.oas.annotations.tags.Tag
;
import
io.swagger.v3.oas.annotations.tags.Tag
;
import
lombok.Data
;
import
lombok.Data
;
import
java.io.Serializable
;
import
java.io.Serializable
;
import
java.time.LocalDateTime
;
import
java.util.Date
;
import
java.util.Date
;
/**
/**
...
@@ -14,8 +17,9 @@ import java.util.Date;
...
@@ -14,8 +17,9 @@ import java.util.Date;
@Tag
(
name
=
"结算信息作废记录"
)
@Tag
(
name
=
"结算信息作废记录"
)
public
class
TInsuranceSettleCancel
implements
Serializable
{
public
class
TInsuranceSettleCancel
implements
Serializable
{
/**
/**
*
*
id
*/
*/
@TableId
(
type
=
IdType
.
ASSIGN_ID
)
private
String
id
;
private
String
id
;
/**
/**
...
@@ -37,21 +41,15 @@ public class TInsuranceSettleCancel implements Serializable {
...
@@ -37,21 +41,15 @@ public class TInsuranceSettleCancel implements Serializable {
* 项目名称
* 项目名称
*/
*/
private
String
deptName
;
private
String
deptName
;
/**
* 订单编号
*/
private
String
orderNo
;
/**
/**
* 推送标识 1成功 0失败
* 推送标识
未推送,
1成功 0失败
*/
*/
private
Integer
isCancelPush
;
private
Integer
isCancelPush
;
/**
/**
* 创建时间
* 创建时间
*/
*/
private
Dat
e
createTime
;
private
LocalDateTim
e
createTime
;
/**
/**
* 操作人
* 操作人
...
...
yifu-insurances/yifu-insurances-api/src/main/java/com/yifu/cloud/plus/v1/yifu/insurances/util/BigDecimalUtils.java
View file @
f063f031
...
@@ -237,6 +237,23 @@ public class BigDecimalUtils {
...
@@ -237,6 +237,23 @@ public class BigDecimalUtils {
}
}
return
bigDecimal
;
return
bigDecimal
;
}
}
/**
* null 默认 为 0
* @Author zhaji
* @Date 2022-08-02
* @param bigDecimal
* @return
**/
public
static
Boolean
isNullOrZero
(
BigDecimal
bigDecimal
){
if
(
null
==
bigDecimal
){
return
true
;
}
if
(
bigDecimal
.
compareTo
(
BigDecimal
.
ZERO
)
==
0
){
return
true
;
}
return
false
;
}
/**
/**
* 对象转为BigDecimal 数据 并四舍五入保留两位小数
* 对象转为BigDecimal 数据 并四舍五入保留两位小数
* @Author fxj
* @Author fxj
...
...
yifu-insurances/yifu-insurances-api/src/main/java/com/yifu/cloud/plus/v1/yifu/insurances/vo/InsuranceReplaceParam.java
View file @
f063f031
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
insurances
.
vo
;
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
insurances
.
vo
;
import
com.fasterxml.jackson.annotation.JsonIgnore
;
import
io.swagger.v3.oas.annotations.media.Schema
;
import
io.swagger.v3.oas.annotations.media.Schema
;
import
lombok.Data
;
import
lombok.Data
;
...
@@ -86,4 +87,11 @@ public class InsuranceReplaceParam implements Serializable {
...
@@ -86,4 +87,11 @@ public class InsuranceReplaceParam implements Serializable {
@Schema
(
description
=
"错误信息"
)
@Schema
(
description
=
"错误信息"
)
private
String
errorMessage
;
private
String
errorMessage
;
/***********************************以下字段由系统算出,前端不用传,是为了方便入库***********************************/
/**
* 结算类型 (1、单独结算 2、合并结算-和工资一起结算)
*/
@JsonIgnore
private
Integer
settleType
;
}
}
yifu-insurances/yifu-insurances-api/src/main/java/com/yifu/cloud/plus/v1/yifu/insurances/vo/InsuredParam.java
View file @
f063f031
...
@@ -100,9 +100,15 @@ public class InsuredParam implements Serializable {
...
@@ -100,9 +100,15 @@ public class InsuredParam implements Serializable {
private
Integer
isOverdue
;
private
Integer
isOverdue
;
/**
/**
* 派单日期
* 派单
开始
日期
*/
*/
@Schema
(
description
=
"派单日期"
)
@Schema
(
description
=
"派单开始日期"
)
private
String
createTime
;
private
String
createStartTime
;
/**
* 派单结束日期
*/
@Schema
(
description
=
"派单结束日期"
)
private
String
createEndTime
;
}
}
yifu-insurances/yifu-insurances-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/insurances/controller/TInsuranceDetailController.java
View file @
f063f031
...
@@ -327,8 +327,8 @@ public class TInsuranceDetailController {
...
@@ -327,8 +327,8 @@ public class TInsuranceDetailController {
* @return {@link R<IPage< RefundExportListVo >>}
* @return {@link R<IPage< RefundExportListVo >>}
*/
*/
@Operation
(
summary
=
"减员办理列表分页查询"
,
description
=
"减员办理列表分页查询"
)
@Operation
(
summary
=
"减员办理列表分页查询"
,
description
=
"减员办理列表分页查询"
)
@
Pos
tMapping
(
"/getInsuranceRefundHandlingPageList"
)
@
Ge
tMapping
(
"/getInsuranceRefundHandlingPageList"
)
public
R
<
IPage
<
RefundExportListVo
>>
getInsuranceRefundHandlingPageList
(
Page
<
InsuranceRefundHandlingParam
>
page
,
@RequestBody
InsuranceRefundHandlingParam
param
)
{
public
R
<
IPage
<
RefundExportListVo
>>
getInsuranceRefundHandlingPageList
(
Page
<
InsuranceRefundHandlingParam
>
page
,
InsuranceRefundHandlingParam
param
)
{
return
R
.
ok
(
tInsuranceDetailService
.
getInsuranceRefundHandlingPageList
(
page
,
param
));
return
R
.
ok
(
tInsuranceDetailService
.
getInsuranceRefundHandlingPageList
(
page
,
param
));
}
}
...
...
yifu-insurances/yifu-insurances-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/insurances/mapper/TInsuranceDetailMapper.java
View file @
f063f031
...
@@ -152,7 +152,7 @@ public interface TInsuranceDetailMapper extends BaseMapper<TInsuranceDetail> {
...
@@ -152,7 +152,7 @@ public interface TInsuranceDetailMapper extends BaseMapper<TInsuranceDetail> {
TInsuranceRefundDetail
selectRefundDetail
(
@Param
(
"param"
)
TInsuranceRefundDetail
refundDetail
);
TInsuranceRefundDetail
selectRefundDetail
(
@Param
(
"param"
)
TInsuranceRefundDetail
refundDetail
);
/**
/**
*
TODO
*
根据ID导出减员办理列表
*
*
* @author zhaji
* @author zhaji
* @param idList
* @param idList
...
@@ -161,7 +161,7 @@ public interface TInsuranceDetailMapper extends BaseMapper<TInsuranceDetail> {
...
@@ -161,7 +161,7 @@ public interface TInsuranceDetailMapper extends BaseMapper<TInsuranceDetail> {
List
<
RefundExportListVo
>
getRefundExportListBySelect
(
@Param
(
"idList"
)
List
<
String
>
idList
);
List
<
RefundExportListVo
>
getRefundExportListBySelect
(
@Param
(
"idList"
)
List
<
String
>
idList
);
/**
/**
*
TODO
*
导出减员办理列表
*
*
* @author zhaji
* @author zhaji
* @param param
* @param param
...
...
yifu-insurances/yifu-insurances-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/insurances/service/impl/TInsuranceDetailServiceImpl.java
View file @
f063f031
...
@@ -25,6 +25,7 @@ import com.yifu.cloud.plus.v1.yifu.insurances.entity.*;
...
@@ -25,6 +25,7 @@ import com.yifu.cloud.plus.v1.yifu.insurances.entity.*;
import
com.yifu.cloud.plus.v1.yifu.insurances.mapper.TInsuranceDetailMapper
;
import
com.yifu.cloud.plus.v1.yifu.insurances.mapper.TInsuranceDetailMapper
;
import
com.yifu.cloud.plus.v1.yifu.insurances.service.*
;
import
com.yifu.cloud.plus.v1.yifu.insurances.service.*
;
import
com.yifu.cloud.plus.v1.yifu.insurances.util.BeanCopyUtils
;
import
com.yifu.cloud.plus.v1.yifu.insurances.util.BeanCopyUtils
;
import
com.yifu.cloud.plus.v1.yifu.insurances.util.BigDecimalUtils
;
import
com.yifu.cloud.plus.v1.yifu.insurances.util.LocalDateUtil
;
import
com.yifu.cloud.plus.v1.yifu.insurances.util.LocalDateUtil
;
import
com.yifu.cloud.plus.v1.yifu.insurances.util.ValidityUtil
;
import
com.yifu.cloud.plus.v1.yifu.insurances.util.ValidityUtil
;
import
com.yifu.cloud.plus.v1.yifu.insurances.vo.*
;
import
com.yifu.cloud.plus.v1.yifu.insurances.vo.*
;
...
@@ -77,6 +78,10 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
...
@@ -77,6 +78,10 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
@Resource
@Resource
private
TInsuranceRefundService
tInsuranceRefundService
;
private
TInsuranceRefundService
tInsuranceRefundService
;
@Resource
private
TInsuranceSettleCancelService
tInsuranceSettleCancelService
;
/***********************商险办理********************************/
/***********************商险办理********************************/
/**
/**
...
@@ -312,14 +317,22 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
...
@@ -312,14 +317,22 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
newDetail
.
setEmpName
(
success
.
getReplaceEmpName
());
newDetail
.
setEmpName
(
success
.
getReplaceEmpName
());
newDetail
.
setEmpIdcardNo
(
success
.
getReplaceEmpIdcardNo
());
newDetail
.
setEmpIdcardNo
(
success
.
getReplaceEmpIdcardNo
());
newDetail
.
setDeptNo
(
success
.
getReplaceDeptNo
());
newDetail
.
setDeptNo
(
success
.
getReplaceDeptNo
());
//替换项目的结算方式
newDetail
.
setSettleType
(
success
.
getSettleType
());
newDetail
.
setPost
(
success
.
getPost
());
newDetail
.
setPost
(
success
.
getPost
());
//其他状态置为空
//其他状态置为空
newDetail
.
setIsOverdue
(
null
);
newDetail
.
setIsOverdue
(
null
);
newDetail
.
setIsUse
(
null
);
newDetail
.
setIsUse
(
null
);
newDetail
.
setIsEffect
(
null
);
newDetail
.
setIsEffect
(
null
);
newDetail
.
setReduceHandleStatus
(
null
);
newDetail
.
setReduceHandleStatus
(
null
);
//创建时间是新数据插入时间
newDetail
.
setCreateTime
(
LocalDateTime
.
now
());
newDetail
.
setCreateBy
(
user
.
getId
());
newDetail
.
setCreateName
(
user
.
getNickname
());
//替换不参与结算
//替换不参与结算
newDetail
.
setDefaultSettleId
(
null
);
newDetail
.
setDefaultSettleId
(
null
);
newDetail
.
setActualPremium
(
null
);
newDetail
.
setEstimatePremium
(
null
);
Boolean
insert
=
this
.
save
(
newDetail
);
Boolean
insert
=
this
.
save
(
newDetail
);
//替换记录
//替换记录
if
(
insert
){
if
(
insert
){
...
@@ -1813,6 +1826,16 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
...
@@ -1813,6 +1826,16 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
param
.
setErrorMessage
(
InsurancesConstants
.
DEPT_NO_IS_NOT_EXIST
);
param
.
setErrorMessage
(
InsurancesConstants
.
DEPT_NO_IS_NOT_EXIST
);
listResult
.
add
(
param
);
listResult
.
add
(
param
);
continue
;
continue
;
}
else
{
//结算类型,根据项目编码获取,并冗余到明细记录中
String
settleType
=
projectSetInfoVo
.
getInsuranceSettleType
();
if
(
StringUtils
.
isEmpty
(
settleType
)){
param
.
setErrorMessage
(
InsurancesConstants
.
PROJECT_NOT_FIND_SETTLE_TYPE
);
listResult
.
add
(
param
);
continue
;
}
else
{
param
.
setSettleType
(
Integer
.
parseInt
(
settleType
));
}
}
}
}
}
}
}
...
@@ -2616,19 +2639,82 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
...
@@ -2616,19 +2639,82 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
.
set
(
TInsuranceDetail
::
getSettleType
,
success
.
getNewSettleType
())
.
set
(
TInsuranceDetail
::
getSettleType
,
success
.
getNewSettleType
())
.
set
(
TInsuranceDetail
::
getUpdateBy
,
user
.
getId
())
.
set
(
TInsuranceDetail
::
getUpdateBy
,
user
.
getId
())
.
set
(
TInsuranceDetail
::
getUpdateTime
,
LocalDateTime
.
now
());
.
set
(
TInsuranceDetail
::
getUpdateTime
,
LocalDateTime
.
now
());
TInsuranceSettle
tInsuranceSettle
=
new
TInsuranceSettle
();
String
insuranceDetailId
=
success
.
getId
();
//如果旧项目为合并结算,且新项目也是合并结算,则计算新的预估保费,作废旧的预估保费
//结算信息id
if
(
CommonConstants
.
ZERO_INT
==
oldSettleType
&&
CommonConstants
.
ZERO_INT
==
newSettleType
){
String
defaultSettleId
=
success
.
getDefaultSettleId
();
//实际保费
BigDecimal
actualPremium
=
success
.
getActualPremium
();
//如果变更前为单独结算
if
(
CommonConstants
.
ONE_INT
==
oldSettleType
){
//登记了保单保费
if
(!
BigDecimalUtils
.
isNullOrZero
(
actualPremium
)){
//变更后为单独结算
if
(
CommonConstants
.
ONE_INT
==
newSettleType
){
update
(
updateWrapper
);
//作废旧的数据,生成作废结算信息记录
TInsuranceSettleCancel
cancel
=
new
TInsuranceSettleCancel
();
cancel
.
setDeptNo
(
success
.
getOldDeptNo
());
cancel
.
setInsDetailId
(
success
.
getId
());
cancel
.
setSettleId
(
defaultSettleId
);
cancel
.
setCreateUesr
(
user
.
getId
());
cancel
.
setCreateTime
(
LocalDateTime
.
now
());
tInsuranceSettleCancelService
.
save
(
cancel
);
//推送EKP // TODO: 2022/8/2
//新增新的结算数据
TInsuranceSettle
newInsuranceSettle
=
new
TInsuranceSettle
();
newInsuranceSettle
.
setInsDetailId
(
insuranceDetailId
);
newInsuranceSettle
.
setSettleType
(
newSettleType
);
newInsuranceSettle
.
setIsEstimatePush
(
CommonConstants
.
ZERO_INT
);
newInsuranceSettle
.
setIsActualPush
(
CommonConstants
.
ZERO_INT
);
newInsuranceSettle
.
setSettleHandleStatus
(
CommonConstants
.
ONE_STRING
);
newInsuranceSettle
.
setCreateTime
(
LocalDateTime
.
now
());
newInsuranceSettle
.
setActualPremium
(
success
.
getActualPremium
());
tInsuranceSettleService
.
save
(
newInsuranceSettle
);
//赋值新的预估费用和新的结算信息
updateWrapper
.
set
(
TInsuranceDetail
::
getDefaultSettleId
,
newInsuranceSettle
.
getId
());
update
(
updateWrapper
);
}
//变更后为合并结算
if
(
CommonConstants
.
ZERO_INT
==
newSettleType
){
//作废旧的数据,生成作废结算信息记录
TInsuranceSettleCancel
cancel
=
new
TInsuranceSettleCancel
();
cancel
.
setDeptNo
(
success
.
getOldDeptNo
());
cancel
.
setInsDetailId
(
success
.
getId
());
cancel
.
setSettleId
(
defaultSettleId
);
cancel
.
setCreateUesr
(
user
.
getId
());
cancel
.
setCreateTime
(
LocalDateTime
.
now
());
tInsuranceSettleCancelService
.
save
(
cancel
);
//推送EKP // TODO: 2022/8/2
//新增新的结算信息
TInsuranceSettle
newInsuranceSettle
=
new
TInsuranceSettle
();
newInsuranceSettle
.
setInsDetailId
(
insuranceDetailId
);
newInsuranceSettle
.
setSettleType
(
newSettleType
);
newInsuranceSettle
.
setIsEstimatePush
(
CommonConstants
.
ZERO_INT
);
newInsuranceSettle
.
setIsActualPush
(
CommonConstants
.
ZERO_INT
);
newInsuranceSettle
.
setSettleHandleStatus
(
CommonConstants
.
ONE_STRING
);
newInsuranceSettle
.
setCreateTime
(
LocalDateTime
.
now
());
newInsuranceSettle
.
setActualPremium
(
success
.
getActualPremium
());
newInsuranceSettle
.
setEstimatePremium
(
success
.
getEstimatePremium
());
//生成新的结算信息
tInsuranceSettleService
.
save
(
newInsuranceSettle
);
//赋值新的预估费用和新的结算信息
updateWrapper
.
set
(
TInsuranceDetail
::
getEstimatePremium
,
success
.
getEstimatePremium
());
updateWrapper
.
set
(
TInsuranceDetail
::
getEstimatePremium
,
success
.
getEstimatePremium
());
//如果存在则更新,不存在则新建
updateWrapper
.
set
(
TInsuranceDetail
::
getDefaultSettleId
,
newInsuranceSettle
.
getId
());
if
(
StringUtils
.
isNotBlank
(
success
.
getDefaultSettleId
())){
update
(
updateWrapper
);
tInsuranceSettle
.
setId
(
success
.
getDefaultSettleId
());
//推送EKP // TODO: 2022/8/2
tInsuranceSettle
.
setSettleType
(
success
.
getNewSettleType
());
}
tInsuranceSettle
.
setInsDetailId
(
success
.
getId
());
}
tInsuranceSettle
.
setEstimatePremium
(
success
.
getEstimatePremium
());
//未登记保单保费
tInsuranceSettle
.
setUpdateTime
(
LocalDateTime
.
now
());
if
(
BigDecimalUtils
.
isNullOrZero
(
actualPremium
)){
tInsuranceSettleService
.
updateById
(
tInsuranceSettle
);
//变更后为单独结算
}
else
{
if
(
CommonConstants
.
ONE_INT
==
newSettleType
){
//变更项目且不做处理
update
(
updateWrapper
);
}
//变更后为合并结算
if
(
CommonConstants
.
ZERO_INT
==
newSettleType
){
//生成预估结算信息
TInsuranceSettle
tInsuranceSettle
=
new
TInsuranceSettle
();
tInsuranceSettle
.
setInsDetailId
(
success
.
getId
());
tInsuranceSettle
.
setInsDetailId
(
success
.
getId
());
tInsuranceSettle
.
setSettleType
(
success
.
getNewSettleType
());
tInsuranceSettle
.
setSettleType
(
success
.
getNewSettleType
());
tInsuranceSettle
.
setSettleHandleStatus
(
CommonConstants
.
ONE_STRING
);
tInsuranceSettle
.
setSettleHandleStatus
(
CommonConstants
.
ONE_STRING
);
...
@@ -2637,60 +2723,118 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
...
@@ -2637,60 +2723,118 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
tInsuranceSettle
.
setIsEstimatePush
(
CommonConstants
.
ZERO_INT
);
tInsuranceSettle
.
setIsEstimatePush
(
CommonConstants
.
ZERO_INT
);
tInsuranceSettle
.
setCreateTime
(
LocalDateTime
.
now
());
tInsuranceSettle
.
setCreateTime
(
LocalDateTime
.
now
());
tInsuranceSettleService
.
save
(
tInsuranceSettle
);
tInsuranceSettleService
.
save
(
tInsuranceSettle
);
//将结算id赋值给保单信息
//将结算id赋值给保单信息,并新增预估费用
updateWrapper
.
set
(
TInsuranceDetail
::
getEstimatePremium
,
success
.
getEstimatePremium
());
updateWrapper
.
set
(
TInsuranceDetail
::
getDefaultSettleId
,
tInsuranceSettle
.
getId
());
updateWrapper
.
set
(
TInsuranceDetail
::
getDefaultSettleId
,
tInsuranceSettle
.
getId
());
}
update
(
updateWrapper
);
}
//推送结算信息至EKP // TODO: 2022/8/2
//如果旧项目为预估,且新的项目为单独结算,则作废旧的预估保费,更新项目信息
}
if
(
CommonConstants
.
ZERO_INT
==
oldSettleType
&&
CommonConstants
.
ONE_INT
==
newSettleType
){
}
//更新旧的结算信息
if
(
StringUtils
.
isNotBlank
(
success
.
getDefaultSettleId
())){
}
tInsuranceSettle
.
setId
(
success
.
getDefaultSettleId
());
//变更前为合并结算
tInsuranceSettle
.
setSettleType
(
success
.
getNewSettleType
());
if
(
CommonConstants
.
ZERO_INT
==
oldSettleType
){
tInsuranceSettle
.
setInsDetailId
(
success
.
getId
());
//如果已经登记保费
tInsuranceSettle
.
setEstimatePremium
(
new
BigDecimal
(
"0"
));
if
(!
BigDecimalUtils
.
isNullOrZero
(
actualPremium
)){
tInsuranceSettle
.
setUpdateTime
(
LocalDateTime
.
now
());
//变更为单独结算
tInsuranceSettleService
.
updateById
(
tInsuranceSettle
);
if
(
CommonConstants
.
ONE_INT
==
newSettleType
){
//生成一条作废数据并推送至EKP
//作废旧的结算信息
TInsuranceSettleCancel
tInsuranceSettleCancel
=
new
TInsuranceSettleCancel
();
TInsuranceSettleCancel
cancel
=
new
TInsuranceSettleCancel
();
tInsuranceSettleCancel
.
setInsDetailId
(
success
.
getId
());
cancel
.
setDeptNo
(
success
.
getOldDeptNo
());
tInsuranceSettleCancel
.
setSettleId
(
success
.
getDefaultSettleId
());
cancel
.
setInsDetailId
(
success
.
getId
());
cancel
.
setSettleId
(
defaultSettleId
);
cancel
.
setCreateUesr
(
user
.
getId
());
cancel
.
setCreateTime
(
LocalDateTime
.
now
());
tInsuranceSettleCancelService
.
save
(
cancel
);
//新增新的结算信息
TInsuranceSettle
newInsuranceSettle
=
new
TInsuranceSettle
();
newInsuranceSettle
.
setInsDetailId
(
insuranceDetailId
);
newInsuranceSettle
.
setSettleType
(
newSettleType
);
newInsuranceSettle
.
setIsEstimatePush
(
CommonConstants
.
ZERO_INT
);
newInsuranceSettle
.
setIsActualPush
(
CommonConstants
.
ZERO_INT
);
newInsuranceSettle
.
setSettleHandleStatus
(
CommonConstants
.
ONE_STRING
);
newInsuranceSettle
.
setCreateTime
(
LocalDateTime
.
now
());
newInsuranceSettle
.
setActualPremium
(
success
.
getActualPremium
());
tInsuranceSettleService
.
save
(
newInsuranceSettle
);
//更新预估费用为0.00
updateWrapper
.
set
(
TInsuranceDetail
::
getEstimatePremium
,
new
BigDecimal
(
"0.00"
));
updateWrapper
.
set
(
TInsuranceDetail
::
getDefaultSettleId
,
newInsuranceSettle
.
getId
());
update
(
updateWrapper
);
//推送新的结算信息
}
//变更为合并结算
if
(
CommonConstants
.
ZERO_INT
==
newSettleType
){
//作废旧的结算信息
TInsuranceSettleCancel
cancel
=
new
TInsuranceSettleCancel
();
cancel
.
setDeptNo
(
success
.
getOldDeptNo
());
cancel
.
setInsDetailId
(
success
.
getId
());
cancel
.
setSettleId
(
defaultSettleId
);
cancel
.
setCreateUesr
(
user
.
getId
());
cancel
.
setCreateTime
(
LocalDateTime
.
now
());
tInsuranceSettleCancelService
.
save
(
cancel
);
//新增新的结算信息
TInsuranceSettle
newInsuranceSettle
=
new
TInsuranceSettle
();
newInsuranceSettle
.
setInsDetailId
(
insuranceDetailId
);
newInsuranceSettle
.
setSettleType
(
newSettleType
);
newInsuranceSettle
.
setIsEstimatePush
(
CommonConstants
.
ZERO_INT
);
newInsuranceSettle
.
setIsActualPush
(
CommonConstants
.
ZERO_INT
);
newInsuranceSettle
.
setSettleHandleStatus
(
CommonConstants
.
ONE_STRING
);
newInsuranceSettle
.
setCreateTime
(
LocalDateTime
.
now
());
newInsuranceSettle
.
setActualPremium
(
success
.
getActualPremium
());
tInsuranceSettleService
.
save
(
newInsuranceSettle
);
//更新预估费用为新的预估费用
updateWrapper
.
set
(
TInsuranceDetail
::
getEstimatePremium
,
success
.
getEstimatePremium
());
updateWrapper
.
set
(
TInsuranceDetail
::
getDefaultSettleId
,
newInsuranceSettle
.
getId
());
update
(
updateWrapper
);
//推送新的结算信息 // TODO: 2022/8/2
}
}
//如果没有登记保费
if
(
BigDecimalUtils
.
isNullOrZero
(
actualPremium
)){
//变更为单独结算
if
(
CommonConstants
.
ONE_INT
==
newSettleType
){
//作废旧的结算信息
TInsuranceSettleCancel
cancel
=
new
TInsuranceSettleCancel
();
cancel
.
setDeptNo
(
success
.
getOldDeptNo
());
cancel
.
setInsDetailId
(
success
.
getId
());
cancel
.
setSettleId
(
defaultSettleId
);
cancel
.
setCreateUesr
(
user
.
getId
());
cancel
.
setCreateTime
(
LocalDateTime
.
now
());
tInsuranceSettleCancelService
.
save
(
cancel
);
//推送至EKP // TODO: 2022/8/2
updateWrapper
.
set
(
TInsuranceDetail
::
getEstimatePremium
,
new
BigDecimal
(
"0.00"
));
updateWrapper
.
set
(
TInsuranceDetail
::
getDefaultSettleId
,
null
);
update
(
updateWrapper
);
}
else
{
//更新预估保费
updateWrapper
.
set
(
TInsuranceDetail
::
getEstimatePremium
,
new
BigDecimal
(
"0"
));
}
}
}
//如果旧项目为单独结算,且新项目为合并结算,则计算预估保费,作废旧的预估保费
//变更为合并结算
if
(
CommonConstants
.
ONE_INT
==
oldSettleType
&&
CommonConstants
.
ZERO_INT
==
newSettleType
){
if
(
CommonConstants
.
ZERO_INT
==
newSettleType
){
//作废旧的结算信息
TInsuranceSettleCancel
cancel
=
new
TInsuranceSettleCancel
();
cancel
.
setDeptNo
(
success
.
getOldDeptNo
());
cancel
.
setInsDetailId
(
success
.
getId
());
cancel
.
setSettleId
(
defaultSettleId
);
cancel
.
setCreateUesr
(
user
.
getId
());
cancel
.
setCreateTime
(
LocalDateTime
.
now
());
tInsuranceSettleCancelService
.
save
(
cancel
);
//推送至EKP // TODO: 2022/8/2
TInsuranceSettle
newInsuranceSettle
=
new
TInsuranceSettle
();
newInsuranceSettle
.
setInsDetailId
(
insuranceDetailId
);
newInsuranceSettle
.
setSettleType
(
newSettleType
);
newInsuranceSettle
.
setIsEstimatePush
(
CommonConstants
.
ZERO_INT
);
newInsuranceSettle
.
setIsActualPush
(
CommonConstants
.
ZERO_INT
);
newInsuranceSettle
.
setSettleHandleStatus
(
CommonConstants
.
ONE_STRING
);
newInsuranceSettle
.
setCreateTime
(
LocalDateTime
.
now
());
newInsuranceSettle
.
setActualPremium
(
success
.
getActualPremium
());
tInsuranceSettleService
.
save
(
newInsuranceSettle
);
//更新预估费用为新的预估费用
updateWrapper
.
set
(
TInsuranceDetail
::
getEstimatePremium
,
success
.
getEstimatePremium
());
updateWrapper
.
set
(
TInsuranceDetail
::
getEstimatePremium
,
success
.
getEstimatePremium
());
//更新旧的结算信息
updateWrapper
.
set
(
TInsuranceDetail
::
getDefaultSettleId
,
newInsuranceSettle
.
getId
());
if
(
StringUtils
.
isNotBlank
(
success
.
getDefaultSettleId
())){
update
(
updateWrapper
);
tInsuranceSettle
.
setId
(
success
.
getDefaultSettleId
());
//推送新的结算信息 // TODO: 2022/8/2
tInsuranceSettle
.
setSettleType
(
success
.
getNewSettleType
());
tInsuranceSettle
.
setInsDetailId
(
success
.
getId
());
tInsuranceSettle
.
setEstimatePremium
(
success
.
getEstimatePremium
());
tInsuranceSettle
.
setUpdateTime
(
LocalDateTime
.
now
());
tInsuranceSettleService
.
updateById
(
tInsuranceSettle
);
//推送EKP
}
else
{
tInsuranceSettle
.
setInsDetailId
(
success
.
getId
());
tInsuranceSettle
.
setSettleType
(
success
.
getNewSettleType
());
tInsuranceSettle
.
setSettleHandleStatus
(
CommonConstants
.
ONE_STRING
);
tInsuranceSettle
.
setEstimatePremium
(
success
.
getEstimatePremium
());
tInsuranceSettle
.
setIsActualPush
(
CommonConstants
.
ZERO_INT
);
tInsuranceSettle
.
setIsEstimatePush
(
CommonConstants
.
ZERO_INT
);
tInsuranceSettle
.
setCreateTime
(
LocalDateTime
.
now
());
tInsuranceSettleService
.
save
(
tInsuranceSettle
);
//更新保单信息
updateWrapper
.
set
(
TInsuranceDetail:
:
getDefaultSettleId
,
tInsuranceSettle
.
getId
());
}
}
}
}
//如果旧项目为单独结算,且新项目也是单独结算,则更新单独结算信息
if
(
CommonConstants
.
ONE_INT
==
oldSettleType
&&
CommonConstants
.
ONE_INT
==
newSettleType
){
updateWrapper
.
set
(
TInsuranceDetail
::
getEstimatePremium
,
success
.
getEstimatePremium
());
}
}
update
(
updateWrapper
);
TInsuranceOperate
insuranceOperate
=
new
TInsuranceOperate
();
TInsuranceOperate
insuranceOperate
=
new
TInsuranceOperate
();
insuranceOperate
.
setInsuranceDetailId
(
success
.
getId
());
insuranceOperate
.
setInsuranceDetailId
(
success
.
getId
());
insuranceOperate
.
setCreateBy
(
user
.
getId
());
insuranceOperate
.
setCreateBy
(
user
.
getId
());
...
@@ -2704,8 +2848,29 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
...
@@ -2704,8 +2848,29 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
List
<
DeptChangeCheckParam
>
errorList
=
stringListMap
.
get
(
"errorList"
);
List
<
DeptChangeCheckParam
>
errorList
=
stringListMap
.
get
(
"errorList"
);
return
R
.
ok
(
errorList
,
"导入成功"
);
return
R
.
ok
(
errorList
,
"导入成功"
);
}
}
/**
/**
* 发送变更通知至EKP
* 发送变更结算月至EKP
*
* @author zhaji
* @param successList
* @return void
*/
private
void
updateMonth2EKP
(
List
<
DeptChangeCheckParam
>
successList
)
{
for
(
DeptChangeCheckParam
param
:
successList
)
{
String
newDeptNo
=
param
.
getNewDeptNo
();
String
oldDeptNo
=
param
.
getOldDeptNo
();
Integer
newSettleType
=
param
.
getNewSettleType
();
Integer
oldSettleType
=
param
.
getOldSettleType
();
String
defaultSettleId
=
param
.
getDefaultSettleId
();
if
(
StringUtils
.
isNotBlank
(
defaultSettleId
)
&&
CommonConstants
.
ZERO_INT
==
newSettleType
){
}
}
}
/**
* 发送变更项目至EKP
*
*
* @author zhaji
* @author zhaji
* @param successList
* @param successList
...
@@ -2724,6 +2889,19 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
...
@@ -2724,6 +2889,19 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
}
}
}
}
/**
* 发送作废信息至EKP
*
* @author zhaji
* @param cancelList 作废信息列表
* @return void
*/
private
void
pushSettleCancel2EKP
(
List
<
TInsuranceSettleCancel
>
cancelList
)
{
for
(
TInsuranceSettleCancel
param
:
cancelList
)
{
}
}
/**
/**
* 根据保险公司名称查询保单明细
* 根据保险公司名称查询保单明细
*
*
...
@@ -3438,7 +3616,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
...
@@ -3438,7 +3616,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
if
(
StringUtils
.
isNotBlank
(
defaultSettleId
)){
if
(
StringUtils
.
isNotBlank
(
defaultSettleId
)){
//查询结算状态
//查询结算状态
LambdaQueryWrapper
<
TInsuranceSettle
>
insuranceSettleQuery
=
new
LambdaQueryWrapper
<>();
LambdaQueryWrapper
<
TInsuranceSettle
>
insuranceSettleQuery
=
new
LambdaQueryWrapper
<>();
insuranceSettleQuery
.
eq
(
TInsuranceSettle
::
getI
nsDetailId
,
insuranceDetail
.
getId
()
);
insuranceSettleQuery
.
eq
(
TInsuranceSettle
::
getI
d
,
defaultSettleId
);
TInsuranceSettle
insuranceSettle
=
tInsuranceSettleService
.
getOne
(
insuranceSettleQuery
);
TInsuranceSettle
insuranceSettle
=
tInsuranceSettleService
.
getOne
(
insuranceSettleQuery
);
//当前结算状态为结算中时,不能变更结算项目
//当前结算状态为结算中时,不能变更结算项目
if
(
CommonConstants
.
TWO_STRING
.
equals
(
insuranceSettle
.
getSettleHandleStatus
())){
if
(
CommonConstants
.
TWO_STRING
.
equals
(
insuranceSettle
.
getSettleHandleStatus
())){
...
@@ -3469,7 +3647,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
...
@@ -3469,7 +3647,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
param
.
setEstimatePremium
(
estimatePremium
);
param
.
setEstimatePremium
(
estimatePremium
);
}
}
}
}
//
如果
//
去重
for
(
int
j
=
0
;
j
<
deptChangeCheckList
.
size
();
j
++)
{
for
(
int
j
=
0
;
j
<
deptChangeCheckList
.
size
();
j
++)
{
DeptChangeCheckParam
CheckParam
=
deptChangeCheckList
.
get
(
j
);
DeptChangeCheckParam
CheckParam
=
deptChangeCheckList
.
get
(
j
);
if
(
CheckParam
.
getEmpName
().
equals
(
param
.
getEmpName
())
if
(
CheckParam
.
getEmpName
().
equals
(
param
.
getEmpName
())
...
@@ -3489,6 +3667,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
...
@@ -3489,6 +3667,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
}
}
param
.
setOldSettleType
(
insuranceDetail
.
getSettleType
());
param
.
setOldSettleType
(
insuranceDetail
.
getSettleType
());
param
.
setDefaultSettleId
(
insuranceDetail
.
getDefaultSettleId
());
param
.
setDefaultSettleId
(
insuranceDetail
.
getDefaultSettleId
());
param
.
setActualPremium
(
insuranceDetail
.
getActualPremium
());
param
.
setId
(
insuranceDetail
.
getId
());
param
.
setId
(
insuranceDetail
.
getId
());
successList
.
add
(
param
);
successList
.
add
(
param
);
}
}
...
...
yifu-insurances/yifu-insurances-biz/src/main/resources/mapper/TInsuranceDetailMapper.xml
View file @
f063f031
...
@@ -334,8 +334,11 @@
...
@@ -334,8 +334,11 @@
<if
test=
"param.isOverdue != null"
>
<if
test=
"param.isOverdue != null"
>
and detail.IS_OVERDUE = #{param.isOverdue}
and detail.IS_OVERDUE = #{param.isOverdue}
</if>
</if>
<if
test=
"param.createTime != null and param.createTime.trim() != ''"
>
<if
test=
"param.createStartTime != null and param.createStartTime.trim() != ''"
>
AND detail.CREATE_TIME = concat(#{param.createTime}, ' 00:00:00')
AND detail.CREATE_TIME
<![CDATA[ >= ]]>
concat(#{param.createStartTime}, ' 00:00:00')
</if>
<if
test=
"param.createEndTime != null and param.createEndTime.trim() != ''"
>
AND detail.CREATE_TIME
<![CDATA[ <= ]]>
concat(#{param.createEndTime}, ' 23:59:59')
</if>
</if>
ORDER BY detail.CREATE_TIME DESC
ORDER BY detail.CREATE_TIME DESC
</select>
</select>
...
@@ -412,8 +415,11 @@
...
@@ -412,8 +415,11 @@
<if
test=
"param.isOverdue != null "
>
<if
test=
"param.isOverdue != null "
>
and detail.IS_OVERDUE = #{param.isOverdue}
and detail.IS_OVERDUE = #{param.isOverdue}
</if>
</if>
<if
test=
"param.createTime != null and param.createTime.trim() != ''"
>
<if
test=
"param.createStartTime != null and param.createStartTime.trim() != ''"
>
AND detail.CREATE_TIME = concat(#{param.createTime}, ' 00:00:00')
AND detail.CREATE_TIME
<![CDATA[ >= ]]>
concat(#{param.createStartTime}, ' 00:00:00')
</if>
<if
test=
"param.createEndTime != null and param.createEndTime.trim() != ''"
>
AND detail.CREATE_TIME
<![CDATA[ <= ]]>
concat(#{param.createEndTime}, ' 23:59:59')
</if>
</if>
ORDER BY detail.CREATE_TIME DESC
ORDER BY detail.CREATE_TIME DESC
</select>
</select>
...
@@ -564,16 +570,16 @@
...
@@ -564,16 +570,16 @@
and detail.EMP_IDCARD_NO like concat('%',replace(replace(#{param.empIdcardNo},'_','\_'),'%','\%'),'%')
and detail.EMP_IDCARD_NO like concat('%',replace(replace(#{param.empIdcardNo},'_','\_'),'%','\%'),'%')
</if>
</if>
<if
test=
"param.deptNo != null and param.deptNo.trim() != ''"
>
<if
test=
"param.deptNo != null and param.deptNo.trim() != ''"
>
and detail.DEPT_NO
like concat('%',replace(replace(#{param.deptNo},'_','\_'),'%','\%'),'%')
and detail.DEPT_NO
= #{param.deptNo}
</if>
</if>
<if
test=
"param.reduceHandleStatus != null"
>
<if
test=
"param.reduceHandleStatus != null"
>
and detail.REDUCE_HANDLE_STATUS = #{param.reduceHandleStatus}
and detail.REDUCE_HANDLE_STATUS = #{param.reduceHandleStatus}
</if>
</if>
<if
test=
"param.i
sOverdue != null
"
>
<if
test=
"param.i
nsuranceTypeName != null and param.insuranceTypeName.trim() != ''
"
>
and detail.I
S_OVERDUE like concat('%',replace(replace(#{param.isOverdu
e},'_','\_'),'%','\%'),'%')
and detail.I
NSURANCE_TYPE_NAME like concat('%',replace(replace(#{param.insuranceTypeNam
e},'_','\_'),'%','\%'),'%')
</if>
</if>
<if
test=
"param.i
sUse != null
"
>
<if
test=
"param.i
nsuranceCompanyName != null and param.insuranceCompanyName.trim() != ''
"
>
and detail.I
S_USE like concat('%',replace(replace(#{param.isUse},'_','\_'),'%','\%'),'%')
and detail.I
NSURANCE_COMPANY_NAME = #{param.insuranceCompanyName}
</if>
</if>
ORDER BY refund.CREATE_TIME DESC
ORDER BY refund.CREATE_TIME DESC
</select>
</select>
...
@@ -672,7 +678,7 @@
...
@@ -672,7 +678,7 @@
and detail.POLICY_NO = #{param.policyNo}
and detail.POLICY_NO = #{param.policyNo}
</if>
</if>
</select>
</select>
<!--
已投保列表分页查询
-->
<!--
根据ID导出减员办理列表
-->
<select
id=
"getRefundExportListBySelect"
resultType=
"com.yifu.cloud.plus.v1.yifu.insurances.vo.RefundExportListVo"
>
<select
id=
"getRefundExportListBySelect"
resultType=
"com.yifu.cloud.plus.v1.yifu.insurances.vo.RefundExportListVo"
>
select
select
detail.id as id,
detail.id as id,
...
@@ -705,7 +711,7 @@
...
@@ -705,7 +711,7 @@
</foreach>
</foreach>
ORDER BY detail.CREATE_TIME DESC
ORDER BY detail.CREATE_TIME DESC
</select>
</select>
<!--
已投保列表分页查询
-->
<!--
根据查询参数导出减员办理列表
-->
<select
id=
"getRefundExportList"
resultType=
"com.yifu.cloud.plus.v1.yifu.insurances.vo.RefundExportListVo"
>
<select
id=
"getRefundExportList"
resultType=
"com.yifu.cloud.plus.v1.yifu.insurances.vo.RefundExportListVo"
>
select
select
detail.id as id,
detail.id as id,
...
@@ -740,14 +746,17 @@
...
@@ -740,14 +746,17 @@
and detail.EMP_IDCARD_NO like concat('%',replace(replace(#{param.empIdcardNo},'_','\_'),'%','\%'),'%')
and detail.EMP_IDCARD_NO like concat('%',replace(replace(#{param.empIdcardNo},'_','\_'),'%','\%'),'%')
</if>
</if>
<if
test=
"param.deptNo != null and param.deptNo.trim() != ''"
>
<if
test=
"param.deptNo != null and param.deptNo.trim() != ''"
>
and detail.DEPT_NO like concat('%',replace(replace(#{param.deptNo},'_','\_'),'%','\%'),'%')
and detail.DEPT_NO = #{param.deptNo}
</if>
<if
test=
"param.insuranceTypeName != null and param.insuranceTypeName.trim() != ''"
>
and detail.INSURANCE_TYPE_NAME like concat('%',replace(replace(#{param.insuranceTypeName},'_','\_'),'%','\%'),'%')
</if>
</if>
<if
test=
"param.insuranceCompanyName != null and param.insuranceCompanyName.trim() != ''"
>
<if
test=
"param.insuranceCompanyName != null and param.insuranceCompanyName.trim() != ''"
>
and detail.INSURANCE_COMPANY_NAME
like concat('%',replace(replace(#{param.insuranceCompanyName},'_','\_'),'%','\%'),'%')
and detail.INSURANCE_COMPANY_NAME
= #{param.insuranceCompanyName}
</if>
</if>
ORDER BY detail.CREATE_TIME DESC
ORDER BY detail.CREATE_TIME DESC
</select>
</select>
<!--
已投保列表分页查询
-->
<!--
减员办理
-->
<update
id=
"updateInsuranceRefund"
>
<update
id=
"updateInsuranceRefund"
>
update
update
t_insurance_detail detail
t_insurance_detail detail
...
@@ -762,7 +771,7 @@
...
@@ -762,7 +771,7 @@
</foreach>
</foreach>
</update>
</update>
<!--
getInsuranceListByIdCard
-->
<!--
根据身份证查询商险信息
-->
<select
id=
"getInsuranceListByIdCard"
resultType=
"com.yifu.cloud.plus.v1.yifu.insurances.vo.InsuranceListByIdCardVo"
>
<select
id=
"getInsuranceListByIdCard"
resultType=
"com.yifu.cloud.plus.v1.yifu.insurances.vo.InsuranceListByIdCardVo"
>
SELECT
SELECT
<include
refid=
"Base_Column_List"
/>
<include
refid=
"Base_Column_List"
/>
...
...
yifu-insurances/yifu-insurances-biz/src/main/resources/mapper/TInsuranceSettleCancelMapper.xml
View file @
f063f031
...
@@ -10,7 +10,6 @@
...
@@ -10,7 +10,6 @@
<result
property=
"settleId"
column=
"SETTLE_ID"
jdbcType=
"VARCHAR"
/>
<result
property=
"settleId"
column=
"SETTLE_ID"
jdbcType=
"VARCHAR"
/>
<result
property=
"deptNo"
column=
"DEPT_NO"
jdbcType=
"VARCHAR"
/>
<result
property=
"deptNo"
column=
"DEPT_NO"
jdbcType=
"VARCHAR"
/>
<result
property=
"deptName"
column=
"DEPT_NAME"
jdbcType=
"VARCHAR"
/>
<result
property=
"deptName"
column=
"DEPT_NAME"
jdbcType=
"VARCHAR"
/>
<result
property=
"orderNo"
column=
"ORDER_NO"
jdbcType=
"VARCHAR"
/>
<result
property=
"isCancelPush"
column=
"IS_CANCEL_PUSH"
jdbcType=
"TINYINT"
/>
<result
property=
"isCancelPush"
column=
"IS_CANCEL_PUSH"
jdbcType=
"TINYINT"
/>
<result
property=
"createTime"
column=
"CREATE_TIME"
jdbcType=
"TIMESTAMP"
/>
<result
property=
"createTime"
column=
"CREATE_TIME"
jdbcType=
"TIMESTAMP"
/>
<result
property=
"createUesr"
column=
"CREATE_UESR"
jdbcType=
"VARCHAR"
/>
<result
property=
"createUesr"
column=
"CREATE_UESR"
jdbcType=
"VARCHAR"
/>
...
@@ -18,7 +17,7 @@
...
@@ -18,7 +17,7 @@
<sql
id=
"Base_Column_List"
>
<sql
id=
"Base_Column_List"
>
ID,INS_DETAIL_ID,SETTLE_ID,
ID,INS_DETAIL_ID,SETTLE_ID,
DEPT_NO,DEPT_NAME,
ORDER_NO,
DEPT_NO,DEPT_NAME,
IS_CANCEL_PUSH,CREATE_TIME,CREATE_UESR
IS_CANCEL_PUSH,CREATE_TIME,CREATE_UESR
</sql>
</sql>
</mapper>
</mapper>
yifu-social/yifu-social-api/src/main/java/com/yifu/cloud/plus/v1/yifu/social/entity/TProvidentFund.java
View file @
f063f031
...
@@ -404,5 +404,19 @@ public class TProvidentFund extends BaseEntity {
...
@@ -404,5 +404,19 @@ public class TProvidentFund extends BaseEntity {
@Schema
(
description
=
"电信编号"
)
@Schema
(
description
=
"电信编号"
)
@ExcelProperty
(
"电信编号"
)
@ExcelProperty
(
"电信编号"
)
private
String
telecomNumber
;
private
String
telecomNumber
;
/**
* 基数上限(社保或公积金)
*/
@ExcelAttribute
(
name
=
"基数上限(社保或公积金)"
)
@Schema
(
description
=
"基数上限(社保或公积金)"
)
@ExcelProperty
(
"基数上限(社保或公积金)"
)
private
BigDecimal
upperLimit
;
/**
* 基数下限(社保或公积金)
*/
@ExcelAttribute
(
name
=
"基数下限(社保或公积金)"
)
@Schema
(
description
=
"基数下限(社保或公积金)"
)
@ExcelProperty
(
"基数下限(社保或公积金)"
)
private
BigDecimal
lowerLimit
;
}
}
yifu-social/yifu-social-api/src/main/java/com/yifu/cloud/plus/v1/yifu/social/entity/TSocialInfo.java
View file @
f063f031
...
@@ -747,6 +747,20 @@ public class TSocialInfo extends BaseEntity {
...
@@ -747,6 +747,20 @@ public class TSocialInfo extends BaseEntity {
@Schema
(
description
=
"大病办理状态:0待办理1办理成功2办理失败3已派减"
)
@Schema
(
description
=
"大病办理状态:0待办理1办理成功2办理失败3已派减"
)
@ExcelProperty
(
"大病办理状态:0待办理1办理成功2办理失败3已派减"
)
@ExcelProperty
(
"大病办理状态:0待办理1办理成功2办理失败3已派减"
)
private
String
bigailmentHandle
;
private
String
bigailmentHandle
;
/**
* 基数上限(社保或公积金)
*/
@ExcelAttribute
(
name
=
"基数上限(社保或公积金)"
)
@Schema
(
description
=
"基数上限(社保或公积金)"
)
@ExcelProperty
(
"基数上限(社保或公积金)"
)
private
BigDecimal
upperLimit
;
/**
* 基数下限(社保或公积金)
*/
@ExcelAttribute
(
name
=
"基数下限(社保或公积金)"
)
@Schema
(
description
=
"基数下限(社保或公积金)"
)
@ExcelProperty
(
"基数下限(社保或公积金)"
)
private
BigDecimal
lowerLimit
;
}
}
yifu-social/yifu-social-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/social/service/impl/TDispatchInfoServiceImpl.java
View file @
f063f031
...
@@ -998,6 +998,8 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
...
@@ -998,6 +998,8 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
fund
.
setOverpayNumber
(
fundSet
.
getOverpayNumber
());
fund
.
setOverpayNumber
(
fundSet
.
getOverpayNumber
());
fund
.
setFundBaseSetId
(
fundSet
.
getId
());
fund
.
setFundBaseSetId
(
fundSet
.
getId
());
fund
.
setPayPolicy
(
fundSet
.
getPayPolicy
());
fund
.
setPayPolicy
(
fundSet
.
getPayPolicy
());
fund
.
setLowerLimit
(
fundSet
.
getLowerLimit
());
fund
.
setUpperLimit
(
fundSet
.
getUpperLimit
());
if
(
Common
.
isNotNull
(
fundSet
.
getProvince
())){
if
(
Common
.
isNotNull
(
fundSet
.
getProvince
())){
fund
.
setFundProvince
(
Integer
.
toString
(
fundSet
.
getProvince
()));
fund
.
setFundProvince
(
Integer
.
toString
(
fundSet
.
getProvince
()));
}
}
...
@@ -1140,6 +1142,8 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
...
@@ -1140,6 +1142,8 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
social
.
setOverpayNumber
(
socialSet
.
getOverpayNumber
());
social
.
setOverpayNumber
(
socialSet
.
getOverpayNumber
());
social
.
setValueType
(
socialSet
.
getValueType
());
social
.
setValueType
(
socialSet
.
getValueType
());
social
.
setPayPolicy
(
socialSet
.
getPayPolicy
());
social
.
setPayPolicy
(
socialSet
.
getPayPolicy
());
social
.
setLowerLimit
(
socialSet
.
getLowerLimit
());
social
.
setUpperLimit
(
socialSet
.
getUpperLimit
());
// 比例初始化
// 比例初始化
social
.
setPersonalPensionPer
(
socialSet
.
getPersonalPersionPro
());
social
.
setPersonalPensionPer
(
socialSet
.
getPersonalPersionPro
());
social
.
setPersonalMedicalPer
(
socialSet
.
getPersonalMedicalPro
());
social
.
setPersonalMedicalPer
(
socialSet
.
getPersonalMedicalPro
());
...
@@ -1380,6 +1384,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
...
@@ -1380,6 +1384,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
project
.
setUnitId
(
setInfoVo
.
getCustomerId
());
project
.
setUnitId
(
setInfoVo
.
getCustomerId
());
project
.
setUnitName
(
setInfoVo
.
getCustomerName
());
project
.
setUnitName
(
setInfoVo
.
getCustomerName
());
project
.
setUnitNo
(
setInfoVo
.
getCustomerCode
());
project
.
setUnitNo
(
setInfoVo
.
getCustomerCode
());
project
.
setDeptId
(
setInfoVo
.
getId
());
}
}
projects
.
put
(
excel
.
getEmpIdcard
()+
CommonConstants
.
DOWN_LINE_STRING
+
excel
.
getSettleDomainCode
(),
project
);
projects
.
put
(
excel
.
getEmpIdcard
()+
CommonConstants
.
DOWN_LINE_STRING
+
excel
.
getSettleDomainCode
(),
project
);
}
}
...
@@ -1562,8 +1567,12 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
...
@@ -1562,8 +1567,12 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
if
(
Common
.
isEmpty
(
empVo
.
getContractName
())
&&
validContractInfo
(
errorMessageList
,
excel
,
empVo
)){
if
(
Common
.
isEmpty
(
empVo
.
getContractName
())
&&
validContractInfo
(
errorMessageList
,
excel
,
empVo
)){
return
true
;
return
true
;
}
}
if
(
Common
.
isNotNull
(
empVo
.
getEmpNatrue
())){
excel
.
setEmpType
(
empVo
.
getEmpNatrue
());
excel
.
setEmpType
(
empVo
.
getEmpNatrue
());
}
if
(
Common
.
isNotNull
(
empVo
.
getEmpPhone
())){
excel
.
setEmpMobile
(
empVo
.
getEmpPhone
());
excel
.
setEmpMobile
(
empVo
.
getEmpPhone
());
}
excel
.
setFileProvince
(
Common
.
isNotNullToStr
(
empVo
.
getFileProvince
()));
excel
.
setFileProvince
(
Common
.
isNotNullToStr
(
empVo
.
getFileProvince
()));
excel
.
setFileCity
(
Common
.
isNotNullToStr
(
empVo
.
getFileCity
()));
excel
.
setFileCity
(
Common
.
isNotNullToStr
(
empVo
.
getFileCity
()));
excel
.
setFileTown
(
Common
.
isNotNullToStr
(
empVo
.
getFileTown
()));
excel
.
setFileTown
(
Common
.
isNotNullToStr
(
empVo
.
getFileTown
()));
...
@@ -1601,15 +1610,19 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
...
@@ -1601,15 +1610,19 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
errorMessageList
.
add
(
new
ErrorMessage
(
excel
.
getRowIndex
(),
MsgUtils
.
getMessage
(
ErrorCodes
.
EMP_DISPATCH_CONTRACT_NOT_EMPTY
)));
errorMessageList
.
add
(
new
ErrorMessage
(
excel
.
getRowIndex
(),
MsgUtils
.
getMessage
(
ErrorCodes
.
EMP_DISPATCH_CONTRACT_NOT_EMPTY
)));
return
true
;
return
true
;
}
}
if
(
Common
.
isNotNull
(
excel
.
getSocialHousehold
())
&&
(
// 非自定义的 基数 起缴日期不可空
Common
.
isEmpty
(
excel
.
getRecordBase
())
if
(
Common
.
isNotNull
(
excel
.
getSocialHousehold
())
&&
!
CommonConstants
.
ONE_STRING
.
equals
(
excel
.
getPaymentType
())
&&
(
Common
.
isEmpty
(
excel
.
getRecordBase
())
||
Common
.
isEmpty
(
excel
.
getPensionStart
())
||
Common
.
isEmpty
(
excel
.
getPensionStart
())
||
Common
.
isEmpty
(
excel
.
getPaymentType
())
))
{
))
{
errorMessageList
.
add
(
new
ErrorMessage
(
excel
.
getRowIndex
(),
MsgUtils
.
getMessage
(
ErrorCodes
.
EMP_DISPATCH_SOCIAL_NOT_EMPTY
)));
errorMessageList
.
add
(
new
ErrorMessage
(
excel
.
getRowIndex
(),
MsgUtils
.
getMessage
(
ErrorCodes
.
EMP_DISPATCH_SOCIAL_NOT_EMPTY
)));
return
true
;
return
true
;
}
}
if
(
CommonConstants
.
ONE_STRING
.
equals
(
excel
.
getPaymentType
())
&&
Common
.
isEmpty
(
excel
.
getPensionCardinal
())
// 兼职工伤 的起缴日期不可为空
if
(
CommonConstants
.
ONE_STRING
.
equals
(
excel
.
getPaymentType
())
&&
Common
.
isEmpty
(
excel
.
getPensionCardinal
())
&&
Common
.
isEmpty
(
excel
.
getWorkInjuryCardinal
())
){
){
errorMessageList
.
add
(
new
ErrorMessage
(
excel
.
getRowIndex
(),
MsgUtils
.
getMessage
(
ErrorCodes
.
EMP_DISPATCH_SOCIAL_DIY_NOT_EMPTY
)));
errorMessageList
.
add
(
new
ErrorMessage
(
excel
.
getRowIndex
(),
MsgUtils
.
getMessage
(
ErrorCodes
.
EMP_DISPATCH_SOCIAL_DIY_NOT_EMPTY
)));
return
true
;
return
true
;
...
@@ -1657,9 +1670,13 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
...
@@ -1657,9 +1670,13 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
// 各个社保基数和日期空 默认养老日期和基数
// 各个社保基数和日期空 默认养老日期和基数
initExcelBaseAndDate
(
excel
);
initExcelBaseAndDate
(
excel
);
// 校验各项起缴日期 查看是否符合社保补缴政策
// 校验各项起缴日期 查看是否符合社保补缴政策
if
(
validSocialStartDate
(
errorMessageList
,
excel
,
socialSet
))
return
true
;
if
(
validSocialStartDate
(
errorMessageList
,
excel
,
socialSet
)){
return
true
;
}
//校验各项基数
//校验各项基数
if
(
validSocialBaseInfo
(
errorMessageList
,
excel
,
empVo
,
socialSet
))
return
true
;
if
(
validSocialBaseInfo
(
errorMessageList
,
excel
,
empVo
,
socialSet
)){
return
true
;
}
}
}
// 校验公积金上下限和起缴日期
// 校验公积金上下限和起缴日期
if
(
Common
.
isNotNull
(
excel
.
getProvidentHousehold
())){
if
(
Common
.
isNotNull
(
excel
.
getProvidentHousehold
())){
...
@@ -1779,32 +1796,38 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
...
@@ -1779,32 +1796,38 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
}
}
private
boolean
validSocialStartDate
(
List
<
ErrorMessage
>
errorMessageList
,
TDispatchImportVo
excel
,
SysBaseSetInfo
socialSet
)
{
private
boolean
validSocialStartDate
(
List
<
ErrorMessage
>
errorMessageList
,
TDispatchImportVo
excel
,
SysBaseSetInfo
socialSet
)
{
if
(
ServiceUtil
.
checkDispatchDate
(
LocalDateTimeUtils
.
convertDateToLDT
(
excel
.
getPensionStart
()),
if
(
Common
.
isNotNull
(
excel
.
getPensionStart
())
&&
ServiceUtil
.
checkDispatchDate
(
LocalDateTimeUtils
.
convertDateToLDT
(
excel
.
getPensionStart
()),
socialSet
.
getCanOverpay
(),
socialSet
.
getOverpayNumber
(),
socialSet
.
getHaveThisMonth
())){
socialSet
.
getCanOverpay
(),
socialSet
.
getOverpayNumber
(),
socialSet
.
getHaveThisMonth
())){
errorMessageList
.
add
(
new
ErrorMessage
(
excel
.
getRowIndex
(),
MsgUtils
.
getMessage
(
ErrorCodes
.
EMP_DISPATCH_SOCIAL_START_IS_ERROR
)));
errorMessageList
.
add
(
new
ErrorMessage
(
excel
.
getRowIndex
(),
MsgUtils
.
getMessage
(
ErrorCodes
.
EMP_DISPATCH_SOCIAL_START_IS_ERROR
)));
return
true
;
return
true
;
}
}
if
(
ServiceUtil
.
checkDispatchDate
(
LocalDateTimeUtils
.
convertDateToLDT
(
excel
.
getMedicalStart
()),
if
(
Common
.
isNotNull
(
excel
.
getMedicalStart
())
&&
ServiceUtil
.
checkDispatchDate
(
LocalDateTimeUtils
.
convertDateToLDT
(
excel
.
getMedicalStart
()),
socialSet
.
getCanOverpay
(),
socialSet
.
getOverpayNumber
(),
socialSet
.
getHaveThisMonth
())){
socialSet
.
getCanOverpay
(),
socialSet
.
getOverpayNumber
(),
socialSet
.
getHaveThisMonth
())){
errorMessageList
.
add
(
new
ErrorMessage
(
excel
.
getRowIndex
(),
MsgUtils
.
getMessage
(
ErrorCodes
.
EMP_DISPATCH_SOCIAL_START_IS_ERROR
)));
errorMessageList
.
add
(
new
ErrorMessage
(
excel
.
getRowIndex
(),
MsgUtils
.
getMessage
(
ErrorCodes
.
EMP_DISPATCH_SOCIAL_START_IS_ERROR
)));
return
true
;
return
true
;
}
}
if
(
ServiceUtil
.
checkDispatchDate
(
LocalDateTimeUtils
.
convertDateToLDT
(
excel
.
getUnemployStart
()),
if
(
Common
.
isNotNull
(
excel
.
getUnemployStart
())
&&
ServiceUtil
.
checkDispatchDate
(
LocalDateTimeUtils
.
convertDateToLDT
(
excel
.
getUnemployStart
()),
socialSet
.
getCanOverpay
(),
socialSet
.
getOverpayNumber
(),
socialSet
.
getHaveThisMonth
())){
socialSet
.
getCanOverpay
(),
socialSet
.
getOverpayNumber
(),
socialSet
.
getHaveThisMonth
())){
errorMessageList
.
add
(
new
ErrorMessage
(
excel
.
getRowIndex
(),
MsgUtils
.
getMessage
(
ErrorCodes
.
EMP_DISPATCH_SOCIAL_START_IS_ERROR
)));
errorMessageList
.
add
(
new
ErrorMessage
(
excel
.
getRowIndex
(),
MsgUtils
.
getMessage
(
ErrorCodes
.
EMP_DISPATCH_SOCIAL_START_IS_ERROR
)));
return
true
;
return
true
;
}
}
if
(
ServiceUtil
.
checkDispatchDate
(
LocalDateTimeUtils
.
convertDateToLDT
(
excel
.
getWorkInjuryStart
()),
if
(
Common
.
isNotNull
(
excel
.
getWorkInjuryStart
())
&&
ServiceUtil
.
checkDispatchDate
(
LocalDateTimeUtils
.
convertDateToLDT
(
excel
.
getWorkInjuryStart
()),
socialSet
.
getCanOverpay
(),
socialSet
.
getOverpayNumber
(),
socialSet
.
getHaveThisMonth
())){
socialSet
.
getCanOverpay
(),
socialSet
.
getOverpayNumber
(),
socialSet
.
getHaveThisMonth
())){
errorMessageList
.
add
(
new
ErrorMessage
(
excel
.
getRowIndex
(),
MsgUtils
.
getMessage
(
ErrorCodes
.
EMP_DISPATCH_SOCIAL_START_IS_ERROR
)));
errorMessageList
.
add
(
new
ErrorMessage
(
excel
.
getRowIndex
(),
MsgUtils
.
getMessage
(
ErrorCodes
.
EMP_DISPATCH_SOCIAL_START_IS_ERROR
)));
return
true
;
return
true
;
}
}
if
(
ServiceUtil
.
checkDispatchDate
(
LocalDateTimeUtils
.
convertDateToLDT
(
excel
.
getBirthStart
()),
if
(
Common
.
isNotNull
(
excel
.
getBirthStart
())
&&
ServiceUtil
.
checkDispatchDate
(
LocalDateTimeUtils
.
convertDateToLDT
(
excel
.
getBirthStart
()),
socialSet
.
getCanOverpay
(),
socialSet
.
getOverpayNumber
(),
socialSet
.
getHaveThisMonth
())){
socialSet
.
getCanOverpay
(),
socialSet
.
getOverpayNumber
(),
socialSet
.
getHaveThisMonth
())){
errorMessageList
.
add
(
new
ErrorMessage
(
excel
.
getRowIndex
(),
MsgUtils
.
getMessage
(
ErrorCodes
.
EMP_DISPATCH_SOCIAL_START_IS_ERROR
)));
errorMessageList
.
add
(
new
ErrorMessage
(
excel
.
getRowIndex
(),
MsgUtils
.
getMessage
(
ErrorCodes
.
EMP_DISPATCH_SOCIAL_START_IS_ERROR
)));
return
true
;
return
true
;
}
}
if
(
ServiceUtil
.
checkDispatchDate
(
LocalDateTimeUtils
.
convertDateToLDT
(
excel
.
getBigailmentStart
()),
if
(
Common
.
isNotNull
(
excel
.
getBigailmentStart
())
&&
ServiceUtil
.
checkDispatchDate
(
LocalDateTimeUtils
.
convertDateToLDT
(
excel
.
getBigailmentStart
()),
socialSet
.
getCanOverpay
(),
socialSet
.
getOverpayNumber
(),
socialSet
.
getHaveThisMonth
())){
socialSet
.
getCanOverpay
(),
socialSet
.
getOverpayNumber
(),
socialSet
.
getHaveThisMonth
())){
errorMessageList
.
add
(
new
ErrorMessage
(
excel
.
getRowIndex
(),
MsgUtils
.
getMessage
(
ErrorCodes
.
EMP_DISPATCH_SOCIAL_START_IS_ERROR
)));
errorMessageList
.
add
(
new
ErrorMessage
(
excel
.
getRowIndex
(),
MsgUtils
.
getMessage
(
ErrorCodes
.
EMP_DISPATCH_SOCIAL_START_IS_ERROR
)));
return
true
;
return
true
;
...
@@ -2136,6 +2159,11 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
...
@@ -2136,6 +2159,11 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
detailVo
.
setEmployee
(
res
.
getData
());
detailVo
.
setEmployee
(
res
.
getData
());
}
}
}
}
detailVo
.
setAudits
(
auditInfoMapper
.
selectList
(
Wrappers
.<
TAuditInfo
>
query
().
lambda
()
.
eq
(
TAuditInfo:
:
getEmpIdcard
,
dispatch
.
getEmpIdcard
())
.
and
(
obj
->
obj
.
eq
(
TAuditInfo:
:
getDispatchInfoId
,
dispatch
.
getId
())
.
or
().
eq
(
TAuditInfo:
:
getSocialId
,
dispatch
.
getId
())
.
or
().
eq
(
TAuditInfo:
:
getProvidentId
,
dispatch
.
getId
()))));
}
}
return
detailVo
;
return
detailVo
;
}
}
...
@@ -2218,8 +2246,6 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
...
@@ -2218,8 +2246,6 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
// 待办理
// 待办理
sf
.
setSocialAddStatus
(
CommonConstants
.
ONE_STRING
);
sf
.
setSocialAddStatus
(
CommonConstants
.
ONE_STRING
);
sf
.
setSocialStatus
(
CommonConstants
.
ONE_STRING
);
sf
.
setSocialStatus
(
CommonConstants
.
ONE_STRING
);
// 要更新 人员档案 项目档案 合同的状态信息
archivesDaprUtil
.
updateEmpInfo
(
dis
.
getEmpIdcard
(),
dis
.
getSettleDomainCode
(),
dis
.
getContractName
());
//派增审核不通过 需要处理预估数据
//派增审核不通过 需要处理预估数据
}
else
if
(
CommonConstants
.
ONE_INT
==
flag
.
intValue
())
{
}
else
if
(
CommonConstants
.
ONE_INT
==
flag
.
intValue
())
{
socialInfo
.
setDeleteFlag
(
CommonConstants
.
ONE_STRING
);
socialInfo
.
setDeleteFlag
(
CommonConstants
.
ONE_STRING
);
...
@@ -2333,6 +2359,14 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
...
@@ -2333,6 +2359,14 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
dis
.
setStatus
(
CommonConstants
.
THREE_STRING
);
dis
.
setStatus
(
CommonConstants
.
THREE_STRING
);
auditInfo
.
setAuditStatus
(
CommonConstants
.
THREE_STRING
);
auditInfo
.
setAuditStatus
(
CommonConstants
.
THREE_STRING
);
}
}
// 派增审核通过 要更新 人员档案 项目档案 合同的状态信息
if
(
CommonConstants
.
dingleDigitStrArray
[
0
].
equals
(
dis
.
getType
())
&&
CommonConstants
.
ZERO_INT
==
flag
.
intValue
()){
R
<
Boolean
>
res
=
archivesDaprUtil
.
updateEmpInfo
(
dis
.
getEmpIdcard
(),
dis
.
getSettleDomainCode
(),
dis
.
getContractName
());
if
(
Common
.
isEmpty
(
res
)
||
CommonConstants
.
SUCCESS
!=
res
.
getCode
()){
ServiceUtil
.
runTimeExceptionDiy
(
"更新人员档案、项目档案、合同状态异常:"
+
(
Common
.
isNotNull
(
res
)?
res
.
getMsg
():
CommonConstants
.
EMPTY_STRING
));
}
}
//新增审核记录信息
//新增审核记录信息
auditInfoMapper
.
insert
(
auditInfo
);
auditInfoMapper
.
insert
(
auditInfo
);
dis
.
setAuditUser
(
user
.
getId
());
dis
.
setAuditUser
(
user
.
getId
());
...
@@ -2658,8 +2692,11 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
...
@@ -2658,8 +2692,11 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
if
(
Common
.
isNotNull
(
auditInfo
))
{
if
(
Common
.
isNotNull
(
auditInfo
))
{
//派增判断
//派增判断
if
(
CommonConstants
.
ZERO_STRING
.
equals
(
dis
.
getType
()))
{
if
(
CommonConstants
.
ZERO_STRING
.
equals
(
dis
.
getType
()))
{
if
((
CommonConstants
.
ONE_STRING
.
equals
(
dis
.
getSocialHandleStatus
())
if
(
Common
.
isNotNull
(
dis
.
getSocialHandleStatus
())
||
CommonConstants
.
TWO_STRING
.
equals
(
dis
.
getSocialHandleStatus
()))
&&
Common
.
isNotNull
(
dis
.
getFundHandleStatus
())
&&
(
CommonConstants
.
ONE_STRING
.
equals
(
dis
.
getSocialHandleStatus
())
||
CommonConstants
.
TWO_STRING
.
equals
(
dis
.
getSocialHandleStatus
())
||
CommonConstants
.
THREE_STRING
.
equals
(
dis
.
getSocialHandleStatus
()))
&&
((
CommonConstants
.
ONE_STRING
.
equals
(
dis
.
getFundHandleStatus
())
&&
((
CommonConstants
.
ONE_STRING
.
equals
(
dis
.
getFundHandleStatus
())
||
CommonConstants
.
TWO_STRING
.
equals
(
dis
.
getFundHandleStatus
()))))
{
||
CommonConstants
.
TWO_STRING
.
equals
(
dis
.
getFundHandleStatus
()))))
{
//办理成功
//办理成功
...
@@ -2672,7 +2709,8 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
...
@@ -2672,7 +2709,8 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
dis
.
setStatus
(
CommonConstants
.
FOUR_STRING
);
dis
.
setStatus
(
CommonConstants
.
FOUR_STRING
);
}
}
if
((
CommonConstants
.
ONE_STRING
.
equals
(
dis
.
getSocialHandleStatus
())
if
((
CommonConstants
.
ONE_STRING
.
equals
(
dis
.
getSocialHandleStatus
())
||
CommonConstants
.
TWO_STRING
.
equals
(
dis
.
getSocialHandleStatus
()))
||
CommonConstants
.
TWO_STRING
.
equals
(
dis
.
getSocialHandleStatus
())
||
CommonConstants
.
THREE_STRING
.
equals
(
dis
.
getSocialHandleStatus
()))
&&
Common
.
isEmpty
(
dis
.
getFundHandleStatus
()))
{
&&
Common
.
isEmpty
(
dis
.
getFundHandleStatus
()))
{
//办理成功
//办理成功
dis
.
setStatus
(
CommonConstants
.
FOUR_STRING
);
dis
.
setStatus
(
CommonConstants
.
FOUR_STRING
);
...
...
yifu-social/yifu-social-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/social/service/impl/TPaymentInfoServiceImpl.java
View file @
f063f031
...
@@ -30,7 +30,6 @@ import com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser;
...
@@ -30,7 +30,6 @@ import com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser;
import
com.yifu.cloud.plus.v1.yifu.common.dapr.util.ArchivesDaprUtil
;
import
com.yifu.cloud.plus.v1.yifu.common.dapr.util.ArchivesDaprUtil
;
import
com.yifu.cloud.plus.v1.yifu.common.dapr.util.UpmsDaprUtils
;
import
com.yifu.cloud.plus.v1.yifu.common.dapr.util.UpmsDaprUtils
;
import
com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils
;
import
com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils
;
import
com.yifu.cloud.plus.v1.yifu.insurances.vo.Dept
;
import
com.yifu.cloud.plus.v1.yifu.social.concurrent.threadpool.YFSocialImportThreadPoolExecutor
;
import
com.yifu.cloud.plus.v1.yifu.social.concurrent.threadpool.YFSocialImportThreadPoolExecutor
;
import
com.yifu.cloud.plus.v1.yifu.social.constants.PaymentConstants
;
import
com.yifu.cloud.plus.v1.yifu.social.constants.PaymentConstants
;
import
com.yifu.cloud.plus.v1.yifu.social.constants.SocialConstants
;
import
com.yifu.cloud.plus.v1.yifu.social.constants.SocialConstants
;
...
@@ -369,13 +368,6 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
...
@@ -369,13 +368,6 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
}
else
{
}
else
{
redisUtil
.
set
(
key
,
user
.
getId
(),
1800L
);
redisUtil
.
set
(
key
,
user
.
getId
(),
1800L
);
Map
<
String
,
TPaymentInfoVo
>
listMap
=
new
HashMap
<>();
initListToMap
(
list
,
listMap
);
// 把初步校验的内容返回给前端
if
(
Common
.
isNotNull
(
errorMessageList
))
{
getIntegerErrorMessageHashMap
(
user
,
errorMessageList
,
key
,
random
,
listMap
);
}
// 导入前做队列空闲判断,防止队列不足出现数据丢失的场景
// 导入前做队列空闲判断,防止队列不足出现数据丢失的场景
if
(
CollUtil
.
isNotEmpty
(
list
))
{
if
(
CollUtil
.
isNotEmpty
(
list
))
{
int
taskSize
=
list
.
size
()
/
partSize
+
CommonConstants
.
ONE_INT
;
int
taskSize
=
list
.
size
()
/
partSize
+
CommonConstants
.
ONE_INT
;
...
@@ -383,7 +375,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
...
@@ -383,7 +375,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
if
(
taskSize
>
residualCapacity
)
{
if
(
taskSize
>
residualCapacity
)
{
errorMessageList
.
add
(
new
ErrorMessage
(-
1
,
MsgUtils
.
getMessage
(
ErrorCodes
.
SOCIALINFO_LIST_NUM_LARGE
)));
errorMessageList
.
add
(
new
ErrorMessage
(-
1
,
MsgUtils
.
getMessage
(
ErrorCodes
.
SOCIALINFO_LIST_NUM_LARGE
)));
}
}
}
else
{
}
else
{
// -----------------------------生成paymentInfoMap本段开始--------------------------------
// -----------------------------生成paymentInfoMap本段开始--------------------------------
//已存在的档案数据
//已存在的档案数据
List
<
String
>
monthList
=
Common
.
listObjectToStrList
(
list
,
ExcelAttributeConstants
.
SOCIAL_PAY_MONTH
).
stream
().
distinct
().
collect
(
Collectors
.
toList
());
List
<
String
>
monthList
=
Common
.
listObjectToStrList
(
list
,
ExcelAttributeConstants
.
SOCIAL_PAY_MONTH
).
stream
().
distinct
().
collect
(
Collectors
.
toList
());
...
@@ -490,22 +482,14 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
...
@@ -490,22 +482,14 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
// -----------------------------线程池处理list,批量保存社保信息开始--------------------------------
// -----------------------------线程池处理list,批量保存社保信息开始--------------------------------
List
<
TPaymentInfoVo
>
tempList
=
new
ArrayList
<>();
List
<
TPaymentInfoVo
>
tempList
=
new
ArrayList
<>();
AtomicInteger
atomicLine
=
new
AtomicInteger
(
CommonConstants
.
ZERO_INT
);
AtomicInteger
atomicLine
=
new
AtomicInteger
(
CommonConstants
.
ZERO_INT
);
List
<
CompletableFuture
<
List
<
TPaymentInfoImportLog
>>>
completableFutureList
=
new
ArrayList
<>();
try
{
try
{
// 1.list.size()不足partSize,直接执行
// 1.list.size()不足partSize,直接执行
if
(
list
.
size
()
<
partSize
)
{
if
(
list
.
size
()
<
partSize
)
{
CompletableFuture
<
List
<
TPaymentInfoImportLog
>>
listCompletableFuture
=
CompletableFuture
.
supplyAsync
(()
->
CompletableFuture
.
supplyAsync
(()
->
executeImportSocialList
(
user
,
atomicLine
,
random
,
list
,
areaMap
,
areaMap2
,
executeImportSocialList
(
user
,
atomicLine
,
random
,
list
,
areaMap
,
areaMap2
,
paymentInfoPensionMap
,
paymentInfoBigMap
,
paymentInfoBirMap
,
paymentInfoPensionMap
,
paymentInfoBigMap
,
paymentInfoBirMap
,
paymentInfoMedicalMap
,
paymentInfoUnEmpMap
,
paymentInfoInjuryMap
,
paymentInfoMedicalMap
,
paymentInfoUnEmpMap
,
paymentInfoInjuryMap
,
CommonConstants
.
ONE_INT
),
yfSocialImportThreadPoolExecutor
)
CommonConstants
.
ONE_INT
,
errorMessageList
),
yfSocialImportThreadPoolExecutor
);
.
whenComplete
((
result
,
e
)
->
{
if
(
CollectionUtils
.
isNotEmpty
(
result
))
{
this
.
tPaymentInfoImportLogService
.
saveBatch
(
result
);
}
// ServiceUtil.initErrorMessage(atomicLine.get(), remotePushService, pushParam);
});
completableFutureList
.
add
(
listCompletableFuture
);
}
}
// 2.list.size()大于partSize,循环分批执行
// 2.list.size()大于partSize,循环分批执行
...
@@ -513,19 +497,12 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
...
@@ -513,19 +497,12 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
if
(
partSize
<=
list
.
size
())
{
if
(
partSize
<=
list
.
size
())
{
// 处理第一个0位元素
// 处理第一个0位元素
final
List
<
TPaymentInfoVo
>
finalList
=
list
.
subList
(
0
,
1
);
final
List
<
TPaymentInfoVo
>
finalList
=
list
.
subList
(
0
,
1
);
CompletableFuture
<
List
<
TPaymentInfoImportLog
>>
oneCompletableFuture
=
CompletableFuture
.
supplyAsync
(()
->
CompletableFuture
.
supplyAsync
(()
->
executeImportSocialList
(
user
,
atomicLine
,
random
,
list
,
areaMap
,
areaMap2
,
executeImportSocialList
(
user
,
atomicLine
,
random
,
list
,
areaMap
,
areaMap2
,
paymentInfoPensionMap
,
paymentInfoBigMap
,
paymentInfoBirMap
,
paymentInfoPensionMap
,
paymentInfoBigMap
,
paymentInfoBirMap
,
paymentInfoMedicalMap
,
paymentInfoUnEmpMap
,
paymentInfoInjuryMap
,
paymentInfoMedicalMap
,
paymentInfoUnEmpMap
,
paymentInfoInjuryMap
,
CommonConstants
.
ONE_INT
),
yfSocialImportThreadPoolExecutor
)
CommonConstants
.
ONE_INT
,
errorMessageList
),
yfSocialImportThreadPoolExecutor
);
.
whenComplete
((
result
,
e
)
->
{
if
(
CollectionUtils
.
isNotEmpty
(
result
))
{
this
.
tPaymentInfoImportLogService
.
saveBatch
(
result
);
}
// ServiceUtil.initErrorMessage(atomicLine.get(), remotePushService, pushParam);
});
lastIdx
=
1
;
lastIdx
=
1
;
completableFutureList
.
add
(
oneCompletableFuture
);
for
(
int
i
=
1
;
i
<
list
.
size
();
i
++)
{
for
(
int
i
=
1
;
i
<
list
.
size
();
i
++)
{
// partSize数量的list为一个执行单元
// partSize数量的list为一个执行单元
tempList
.
add
(
list
.
get
(
i
));
tempList
.
add
(
list
.
get
(
i
));
...
@@ -533,19 +510,11 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
...
@@ -533,19 +510,11 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
lastIdx
=
i
;
lastIdx
=
i
;
List
<
TPaymentInfoVo
>
finalTempList
=
tempList
;
List
<
TPaymentInfoVo
>
finalTempList
=
tempList
;
final
int
idx
=
i
-
partSize
+
2
;
final
int
idx
=
i
-
partSize
+
2
;
CompletableFuture
<
List
<
TPaymentInfoImportLog
>>
listCompletableFuture
=
CompletableFuture
.
supplyAsync
(()
->
CompletableFuture
.
supplyAsync
(()
->
executeImportSocialList
(
user
,
atomicLine
,
random
,
list
,
areaMap
,
areaMap2
,
executeImportSocialList
(
user
,
atomicLine
,
random
,
list
,
areaMap
,
areaMap2
,
paymentInfoPensionMap
,
paymentInfoBigMap
,
paymentInfoBirMap
,
paymentInfoPensionMap
,
paymentInfoBigMap
,
paymentInfoBirMap
,
paymentInfoMedicalMap
,
paymentInfoUnEmpMap
,
paymentInfoInjuryMap
,
paymentInfoMedicalMap
,
paymentInfoUnEmpMap
,
paymentInfoInjuryMap
,
idx
),
yfSocialImportThreadPoolExecutor
)
idx
,
errorMessageList
),
yfSocialImportThreadPoolExecutor
);
.
whenComplete
((
result
,
e
)
->
{
if
(
CollectionUtils
.
isNotEmpty
(
result
))
{
this
.
tPaymentInfoImportLogService
.
saveBatch
(
result
);
}
//todo
// ServiceUtil.initErrorMessage(atomicLine.get(), remotePushService, pushParam);
});
completableFutureList
.
add
(
listCompletableFuture
);
tempList
=
new
ArrayList
<>();
tempList
=
new
ArrayList
<>();
}
}
}
}
...
@@ -567,40 +536,19 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
...
@@ -567,40 +536,19 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
List
<
TPaymentInfoVo
>
finalTempList
=
tempList
;
List
<
TPaymentInfoVo
>
finalTempList
=
tempList
;
int
finalLastIdx
=
lastIdx
+
1
;
int
finalLastIdx
=
lastIdx
+
1
;
CompletableFuture
<
List
<
TPaymentInfoImportLog
>>
listCompletableFuture
=
CompletableFuture
.
supplyAsync
(()
->
CompletableFuture
.
supplyAsync
(()
->
executeImportSocialList
(
user
,
atomicLine
,
random
,
list
,
areaMap
,
areaMap2
,
executeImportSocialList
(
user
,
atomicLine
,
random
,
list
,
areaMap
,
areaMap2
,
paymentInfoPensionMap
,
paymentInfoBigMap
,
paymentInfoBirMap
,
paymentInfoPensionMap
,
paymentInfoBigMap
,
paymentInfoBirMap
,
paymentInfoMedicalMap
,
paymentInfoUnEmpMap
,
paymentInfoInjuryMap
,
paymentInfoMedicalMap
,
paymentInfoUnEmpMap
,
paymentInfoInjuryMap
,
finalLastIdx
),
yfSocialImportThreadPoolExecutor
)
finalLastIdx
,
errorMessageList
),
yfSocialImportThreadPoolExecutor
);
.
whenComplete
((
result
,
e
)
->
{
if
(
CollectionUtils
.
isNotEmpty
(
result
))
{
this
.
tPaymentInfoImportLogService
.
saveBatch
(
result
);
}
// ServiceUtil.initErrorMessage(atomicLine.get(), remotePushService, pushParam);
});
completableFutureList
.
add
(
listCompletableFuture
);
}
}
// 阻塞当前线程,等待所有的线程执行完毕
boolean
computeFlag
;
do
{
computeFlag
=
false
;
for
(
CompletableFuture
<
List
<
TPaymentInfoImportLog
>>
listCompletableFuture
:
completableFutureList
)
{
if
(!
listCompletableFuture
.
isDone
())
{
computeFlag
=
true
;
}
}
}
while
(
computeFlag
);
String
importSuccessKey
=
user
.
getId
()
+
CommonConstants
.
DOWN_LINE_STRING
+
CommonConstants
.
PAYMENT_SOCIAL_WAIT_EXPORT
;
String
importSuccessKey
=
user
.
getId
()
+
CommonConstants
.
DOWN_LINE_STRING
+
CommonConstants
.
PAYMENT_SOCIAL_WAIT_EXPORT
;
redisUtil
.
set
(
importSuccessKey
,
random
,
1800L
);
redisUtil
.
set
(
importSuccessKey
,
random
,
1800L
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
log
.
error
(
"社保缴费库数据批量导入异常:"
+
e
);
log
.
error
(
"社保缴费库数据批量导入异常:"
+
e
);
redisUtil
.
remove
(
key
);
redisUtil
.
remove
(
key
);
errorMessageList
.
add
(
new
ErrorMessage
(-
1
,
"数据批量导入异常:"
+
e
));
// errorMessageHashMap = ServiceUtil.initErrorMessage(
// errorMessageHashMap, new ErrorMessage(-1, "数据批量导入异常:" + e), remotePushService, pushParam);
}
finally
{
}
finally
{
paymentInfoPensionMap
.
clear
();
paymentInfoPensionMap
.
clear
();
paymentInfoBigMap
.
clear
();
paymentInfoBigMap
.
clear
();
...
@@ -612,37 +560,38 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
...
@@ -612,37 +560,38 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
// -----------------------------线程池处理list,批量保存社保信息结束--------------------------------
// -----------------------------线程池处理list,批量保存社保信息结束--------------------------------
//最后一个推送
//最后一个推送
log
.
info
(
"社保批量导入耗时:{}"
,
(
System
.
currentTimeMillis
()
-
start
)
+
""
);
log
.
info
(
"社保批量导入耗时:{}"
,
(
System
.
currentTimeMillis
()
-
start
)
+
""
);
// pushParam.setTips(null == errorMessageHashMap.get(list.size()) ? "导入完成!" :
// errorMessageHashMap.get(list.size()).getMessage());
// ServiceUtil.initErrorMessage(list.size(), remotePushService, pushParam);
redisUtil
.
remove
(
key
);
redisUtil
.
remove
(
key
);
}
}
}
}
}
}
private
void
initListToMap
(
List
<
TPaymentInfoVo
>
list
,
Map
<
String
,
TPaymentInfoVo
>
listMap
)
{
/**
if
(
Common
.
isNotNull
(
list
))
{
* 转换缴纳地址为省市县ID
for
(
TPaymentInfoVo
vo
:
list
)
{
**/
listMap
.
put
(
String
.
valueOf
(
list
.
indexOf
(
vo
)
+
2
),
vo
);
private
TPaymentInfoVo
initAddress
(
String
[]
areaArray
,
HashMap
<
String
,
String
>
areaMap2
,
TPaymentInfoVo
s
)
{
if
(
null
==
areaArray
||
null
==
areaMap2
||
null
==
s
)
{
return
s
;
}
}
String
temp
=
null
;
if
(
areaArray
.
length
>=
CommonConstants
.
TWO_INT
)
{
temp
=
areaMap2
.
get
(
areaArray
[
0
]
+
CommonConstants
.
DOWN_LINE_STRING
+
"null"
);
if
(
Common
.
isNotNull
(
temp
))
{
s
.
setSocialProvince
(
temp
);
}
}
temp
=
areaMap2
.
get
(
areaArray
[
1
]
+
CommonConstants
.
DOWN_LINE_STRING
+
(
null
==
s
.
getSocialProvince
()
?
"null"
:
s
.
getSocialProvince
()));
if
(
Common
.
isNotNull
(
temp
))
{
s
.
setSocialCity
(
temp
);
}
}
if
(
areaArray
.
length
>=
CommonConstants
.
THREE_INT
)
{
private
void
getIntegerErrorMessageHashMap
(
YifuUser
user
,
List
<
ErrorMessage
>
errorInfo
,
String
key
,
temp
=
areaMap2
.
get
(
areaArray
[
2
]
+
CommonConstants
.
DOWN_LINE_STRING
+
(
null
==
s
.
getSocialCity
()
String
random
,
Map
<
String
,
TPaymentInfoVo
>
listMap
)
{
?
"null"
:
s
.
getSocialCity
()));
List
<
TPaymentInfoImportLog
>
logList
=
new
ArrayList
<>();
if
(
Common
.
isNotNull
(
temp
))
{
TPaymentInfoVo
vo
=
null
;
s
.
setSocialTown
(
temp
);
for
(
ErrorMessage
error
:
errorInfo
)
{
vo
=
listMap
.
get
(
error
.
getLineNum
().
toString
());
logList
.
add
(
new
TPaymentInfoImportLog
(
null
,
null
==
vo
?
""
:
vo
.
getEmpName
(),
null
==
vo
?
""
:
vo
.
getEmpIdcard
(),
error
.
getMessage
(),
vo
.
getRowIndex
(),
random
));
}
}
if
(
Common
.
isNotNull
(
logList
))
{
this
.
tPaymentInfoImportLogService
.
saveBatch
(
logList
);
}
}
redisUtil
.
set
(
user
.
getId
()
+
CommonConstants
.
DOWN_LINE_STRING
+
CommonConstants
.
PAYMENT_SOCIAL_WAIT_EXPORT
}
,
random
,
1800L
);
return
s
;
redisUtil
.
remove
(
key
);
}
}
/**
/**
...
@@ -656,9 +605,9 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
...
@@ -656,9 +605,9 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
* @description:
* @description:
* @author: huyc
* @author: huyc
* @date: 2022/7/25
* @date: 2022/7/25
* @return:
List<TPaymentInfoImportLog>
* @return:
*/
*/
private
List
<
TPaymentInfoImportLog
>
executeImportSocialList
(
YifuUser
user
,
private
List
<
ErrorMessage
>
executeImportSocialList
(
YifuUser
user
,
AtomicInteger
atomicLine
,
AtomicInteger
atomicLine
,
String
random
,
String
random
,
List
<
TPaymentInfoVo
>
list
,
List
<
TPaymentInfoVo
>
list
,
...
@@ -670,9 +619,8 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
...
@@ -670,9 +619,8 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
ConcurrentHashMap
<
String
,
TPaymentInfo
>
paymentInfoMedicalMap
,
ConcurrentHashMap
<
String
,
TPaymentInfo
>
paymentInfoMedicalMap
,
ConcurrentHashMap
<
String
,
TPaymentInfo
>
paymentInfoUnEmpMap
,
ConcurrentHashMap
<
String
,
TPaymentInfo
>
paymentInfoUnEmpMap
,
ConcurrentHashMap
<
String
,
TPaymentInfo
>
paymentInfoInjuryMap
,
ConcurrentHashMap
<
String
,
TPaymentInfo
>
paymentInfoInjuryMap
,
int
idx
)
{
int
idx
,
List
<
ErrorMessage
>
errorMessageList
)
{
int
i
=
idx
;
int
i
=
idx
;
List
<
TPaymentInfoImportLog
>
logList
=
new
ArrayList
<>();
if
(
Common
.
isNotNull
(
list
))
{
if
(
Common
.
isNotNull
(
list
))
{
TPaymentInfo
paymentInfo
=
null
;
TPaymentInfo
paymentInfo
=
null
;
TSocialInfo
socialInfo
=
null
;
TSocialInfo
socialInfo
=
null
;
...
@@ -741,18 +689,15 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
...
@@ -741,18 +689,15 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
}
}
//导入校验
//导入校验
if
(!
Common
.
isNotNull
(
infoVo
.
getSocialPayMonth
()))
{
if
(!
Common
.
isNotNull
(
infoVo
.
getSocialPayMonth
()))
{
logList
.
add
(
new
TPaymentInfoImportLog
(
null
,
infoVo
.
getEmpName
(),
infoVo
.
getEmpIdcard
()
errorMessageList
.
add
(
new
ErrorMessage
(
infoVo
.
getRowIndex
(),
"社保缴纳月份不可为空!"
));
,
CommonConstants
.
ERROR_MSG_PRFIX
+
"社保缴纳月份不可为空!"
,
i
,
random
));
continue
;
continue
;
}
}
if
(!
Common
.
isNotNull
(
infoVo
.
getSocialCreateMonth
()))
{
if
(!
Common
.
isNotNull
(
infoVo
.
getSocialCreateMonth
()))
{
logList
.
add
(
new
TPaymentInfoImportLog
(
null
,
infoVo
.
getEmpName
(),
infoVo
.
getEmpIdcard
()
errorMessageList
.
add
(
new
ErrorMessage
(
infoVo
.
getRowIndex
(),
"社保生成月份不可为空!"
));
,
CommonConstants
.
ERROR_MSG_PRFIX
+
"社保生成月份不可为空!"
,
i
,
random
));
continue
;
continue
;
}
}
if
(!
Common
.
isNotNull
(
infoVo
.
getSocialPayAddr
()))
{
if
(!
Common
.
isNotNull
(
infoVo
.
getSocialPayAddr
()))
{
logList
.
add
(
new
TPaymentInfoImportLog
(
null
,
infoVo
.
getEmpName
(),
infoVo
.
getEmpIdcard
()
errorMessageList
.
add
(
new
ErrorMessage
(
infoVo
.
getRowIndex
(),
"社保缴纳地不可为空!"
));
,
CommonConstants
.
ERROR_MSG_PRFIX
+
"社保缴纳地不可为空!"
,
i
,
random
));
continue
;
continue
;
}
}
//无对应员工的社保数据
//无对应员工的社保数据
...
@@ -769,13 +714,11 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
...
@@ -769,13 +714,11 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
}
}
//对身份证与人员姓名的对应关系进行校验
//对身份证与人员姓名的对应关系进行校验
if
(
socialInfo
!=
null
&&
!
socialInfo
.
getEmpName
().
equals
(
infoVo
.
getEmpName
()))
{
if
(
socialInfo
!=
null
&&
!
socialInfo
.
getEmpName
().
equals
(
infoVo
.
getEmpName
()))
{
logList
.
add
(
new
TPaymentInfoImportLog
(
null
,
infoVo
.
getEmpName
(),
infoVo
.
getEmpIdcard
()
errorMessageList
.
add
(
new
ErrorMessage
(
infoVo
.
getRowIndex
(),
"姓名与身份证信息不一致,请核实后再次尝试!"
));
,
CommonConstants
.
ERROR_MSG_PRFIX
+
"姓名与身份证信息不一致,请核实后再次尝试!"
,
i
,
random
));
continue
;
continue
;
}
}
if
(
socialInfo
!=
null
&&
socialInfo
.
getSocialStartDate
()
==
null
)
{
if
(
socialInfo
!=
null
&&
socialInfo
.
getSocialStartDate
()
==
null
)
{
logList
.
add
(
new
TPaymentInfoImportLog
(
null
,
infoVo
.
getEmpName
(),
infoVo
.
getEmpIdcard
()
errorMessageList
.
add
(
new
ErrorMessage
(
infoVo
.
getRowIndex
(),
infoVo
.
getEmpIdcard
()
+
"的社保起缴日期为空!"
));
,
CommonConstants
.
ERROR_MSG_PRFIX
+
infoVo
.
getEmpIdcard
()
+
"的社保起缴日期为空!"
,
i
,
random
));
continue
;
continue
;
}
}
if
(
null
==
socialInfo
||
(
null
!=
socialInfo
&&
!
ServiceUtil
.
checkMothForPaymentImport
(
if
(
null
==
socialInfo
||
(
null
!=
socialInfo
&&
!
ServiceUtil
.
checkMothForPaymentImport
(
...
@@ -788,8 +731,8 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
...
@@ -788,8 +731,8 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
?
"null"
:
infoVo
.
getSocialTown
()));
?
"null"
:
infoVo
.
getSocialTown
()));
//对身份证与人员姓名的对应关系进行校验
//对身份证与人员姓名的对应关系进行校验
if
(
socialInfo
!=
null
&&
!
socialInfo
.
getEmpName
().
equals
(
infoVo
.
getEmpName
()))
{
if
(
socialInfo
!=
null
&&
!
socialInfo
.
getEmpName
().
equals
(
infoVo
.
getEmpName
()))
{
logList
.
add
(
new
TPaymentInfoImportLog
(
null
,
infoVo
.
getEmpName
(),
infoVo
.
getEmpIdcard
()
errorMessageList
.
add
(
new
ErrorMessage
(
infoVo
.
getRowIndex
(),
infoVo
.
getEmpIdcard
()
+
,
CommonConstants
.
ERROR_MSG_PRFIX
+
"姓名与身份证信息不一致,请核实后再次尝试!"
,
i
,
random
));
"姓名与身份证信息不一致,请核实后再次尝试!"
));
continue
;
continue
;
}
}
if
(
null
!=
socialInfo
&&
!
ServiceUtil
.
checkMothForPaymentImport
(
socialInfo
.
getSocialStartDate
()
if
(
null
!=
socialInfo
&&
!
ServiceUtil
.
checkMothForPaymentImport
(
socialInfo
.
getSocialStartDate
()
...
@@ -809,23 +752,20 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
...
@@ -809,23 +752,20 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
}
}
}
}
if
(
null
==
socialInfo
)
{
if
(
null
==
socialInfo
)
{
logList
.
add
(
new
TPaymentInfoImportLog
(
null
,
infoVo
.
getEmpName
(),
infoVo
.
getEmpIdcard
()
errorMessageList
.
add
(
new
ErrorMessage
(
infoVo
.
getRowIndex
(),
infoVo
.
getEmpIdcard
()
+
,
CommonConstants
.
ERROR_MSG_PRFIX
+
"无对应员工"
+
infoVo
.
getEmpIdcard
()
"无对应员工"
+
infoVo
.
getEmpIdcard
()
+
"的社保数据(请查验社保办理状态|缴纳地|起缴月份|停缴月份)"
));
+
"的社保数据(请查验社保办理状态|缴纳地|起缴月份|停缴月份)"
,
i
,
random
));
continue
;
continue
;
}
}
//如果导入项目数大于办理成功项目数给提示,少于给进,有问题自行删除后导入
//如果导入项目数大于办理成功项目数给提示,少于给进,有问题自行删除后导入
checkRes
=
checkRepeatInfo
(
socialInfo
,
infoVo
);
checkRes
=
checkRepeatInfo
(
socialInfo
,
infoVo
);
if
(
null
!=
checkRes
)
{
if
(
null
!=
checkRes
)
{
logList
.
add
(
new
TPaymentInfoImportLog
(
null
,
infoVo
.
getEmpName
(),
infoVo
.
getEmpIdcard
()
errorMessageList
.
add
(
new
ErrorMessage
(
infoVo
.
getRowIndex
(),
checkRes
));
,
CommonConstants
.
ERROR_MSG_PRFIX
+
checkRes
,
i
,
random
));
continue
;
continue
;
}
}
//查看缴纳月是否为空
//查看缴纳月是否为空
if
(!
Common
.
isNotNull
(
infoVo
.
getSocialPayMonth
()))
{
if
(!
Common
.
isNotNull
(
infoVo
.
getSocialPayMonth
()))
{
logList
.
add
(
new
TPaymentInfoImportLog
(
null
,
infoVo
.
getEmpName
(),
infoVo
.
getEmpIdcard
()
errorMessageList
.
add
(
new
ErrorMessage
(
infoVo
.
getRowIndex
(),
"必填项校验失败:社保缴纳月份不可为空!"
));
,
CommonConstants
.
ERROR_MSG_PRFIX
+
"必填项校验失败:社保缴纳月份不可为空!"
,
i
,
random
));
continue
;
continue
;
}
}
...
@@ -848,9 +788,8 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
...
@@ -848,9 +788,8 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
BigDecimalUtils
.
isNullToZero
(
infoVo
.
getPersonalPensionMoney
())),
BigDecimalUtils
.
safeAdd
(
BigDecimalUtils
.
isNullToZero
(
infoVo
.
getPersonalPensionMoney
())),
BigDecimalUtils
.
safeAdd
(
BigDecimalUtils
.
isNullToZero
(
paymentInfo
.
getUnitPensionMoney
()),
BigDecimalUtils
.
isNullToZero
(
paymentInfo
.
getUnitPensionMoney
()),
BigDecimalUtils
.
isNullToZero
(
paymentInfo
.
getPersonalPensionMoney
()))).
compareTo
(
BigDecimal
.
ZERO
)
>
0
)
{
BigDecimalUtils
.
isNullToZero
(
paymentInfo
.
getPersonalPensionMoney
()))).
compareTo
(
BigDecimal
.
ZERO
)
>
0
)
{
logList
.
add
(
new
TPaymentInfoImportLog
(
null
,
infoVo
.
getEmpName
(),
infoVo
.
getEmpIdcard
()
errorMessageList
.
add
(
new
ErrorMessage
(
infoVo
.
getRowIndex
(),
"已存在对应员工身份证"
+
infoVo
.
getEmpIdcard
()
,
CommonConstants
.
ERROR_MSG_PRFIX
+
"已存在对应员工身份证"
+
infoVo
.
getEmpIdcard
()
+
"的养老缴费数据,请勿重复导入!"
));
+
"的养老缴费数据,请勿重复导入!"
,
i
,
random
));
continue
;
continue
;
}
else
{
}
else
{
paymentInfo
=
null
;
paymentInfo
=
null
;
...
@@ -875,9 +814,8 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
...
@@ -875,9 +814,8 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
BigDecimalUtils
.
isNullToZero
(
infoVo
.
getPersonalUnemploymentMoney
())),
BigDecimalUtils
.
safeAdd
(
BigDecimalUtils
.
isNullToZero
(
infoVo
.
getPersonalUnemploymentMoney
())),
BigDecimalUtils
.
safeAdd
(
BigDecimalUtils
.
isNullToZero
(
paymentInfo
.
getUnitUnemploymentMoney
()),
BigDecimalUtils
.
isNullToZero
(
paymentInfo
.
getUnitUnemploymentMoney
()),
BigDecimalUtils
.
isNullToZero
(
paymentInfo
.
getPersonalUnemploymentMoney
()))).
compareTo
(
BigDecimal
.
ZERO
)
>
0
)
{
BigDecimalUtils
.
isNullToZero
(
paymentInfo
.
getPersonalUnemploymentMoney
()))).
compareTo
(
BigDecimal
.
ZERO
)
>
0
)
{
logList
.
add
(
new
TPaymentInfoImportLog
(
null
,
infoVo
.
getEmpName
(),
infoVo
.
getEmpIdcard
()
errorMessageList
.
add
(
new
ErrorMessage
(
infoVo
.
getRowIndex
(),
"已存在对应员工身份证"
+
infoVo
.
getEmpIdcard
()
,
CommonConstants
.
ERROR_MSG_PRFIX
+
"已存在对应员工身份证"
+
infoVo
.
getEmpIdcard
()
+
"的失业缴费数据,请勿重复导入!"
));
+
"的失业缴费数据,请勿重复导入!"
,
i
,
random
));
continue
;
continue
;
}
else
{
}
else
{
paymentInfo
=
null
;
paymentInfo
=
null
;
...
@@ -902,9 +840,8 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
...
@@ -902,9 +840,8 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
BigDecimalUtils
.
isNullToZero
(
infoVo
.
getPersonalMedicalMoney
())),
BigDecimalUtils
.
safeAdd
(
BigDecimalUtils
.
isNullToZero
(
infoVo
.
getPersonalMedicalMoney
())),
BigDecimalUtils
.
safeAdd
(
BigDecimalUtils
.
isNullToZero
(
paymentInfo
.
getUnitMedicalMoney
()),
BigDecimalUtils
.
isNullToZero
(
paymentInfo
.
getUnitMedicalMoney
()),
BigDecimalUtils
.
isNullToZero
(
paymentInfo
.
getPersonalMedicalMoney
()))).
compareTo
(
BigDecimal
.
ZERO
)
>
0
)
{
BigDecimalUtils
.
isNullToZero
(
paymentInfo
.
getPersonalMedicalMoney
()))).
compareTo
(
BigDecimal
.
ZERO
)
>
0
)
{
logList
.
add
(
new
TPaymentInfoImportLog
(
null
,
infoVo
.
getEmpName
(),
infoVo
.
getEmpIdcard
()
errorMessageList
.
add
(
new
ErrorMessage
(
infoVo
.
getRowIndex
(),
"已存在对应员工身份证"
+
infoVo
.
getEmpIdcard
()
,
CommonConstants
.
ERROR_MSG_PRFIX
+
"已存在对应员工身份证"
+
infoVo
.
getEmpIdcard
()
+
"的医保缴费数据,请勿重复导入!"
));
+
"的医保缴费数据,请勿重复导入!"
,
i
,
random
));
continue
;
continue
;
}
else
{
}
else
{
paymentInfo
=
null
;
paymentInfo
=
null
;
...
@@ -929,9 +866,8 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
...
@@ -929,9 +866,8 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
BigDecimalUtils
.
isNullToZero
(
infoVo
.
getPersonalBigmailmentMoney
())),
BigDecimalUtils
.
safeAdd
(
BigDecimalUtils
.
isNullToZero
(
infoVo
.
getPersonalBigmailmentMoney
())),
BigDecimalUtils
.
safeAdd
(
BigDecimalUtils
.
isNullToZero
(
paymentInfo
.
getUnitBigmailmentMoney
()),
BigDecimalUtils
.
isNullToZero
(
paymentInfo
.
getUnitBigmailmentMoney
()),
BigDecimalUtils
.
isNullToZero
(
paymentInfo
.
getPersonalBigmailmentMoney
()))).
compareTo
(
BigDecimal
.
ZERO
)
>
0
)
{
BigDecimalUtils
.
isNullToZero
(
paymentInfo
.
getPersonalBigmailmentMoney
()))).
compareTo
(
BigDecimal
.
ZERO
)
>
0
)
{
logList
.
add
(
new
TPaymentInfoImportLog
(
null
,
infoVo
.
getEmpName
(),
infoVo
.
getEmpIdcard
()
errorMessageList
.
add
(
new
ErrorMessage
(
infoVo
.
getRowIndex
(),
"已存在对应员工身份证"
+
infoVo
.
getEmpIdcard
()
,
CommonConstants
.
ERROR_MSG_PRFIX
+
"已存在对应员工身份证"
+
infoVo
.
getEmpIdcard
()
+
"的医疗救助金缴费数据,请勿重复导入!"
));
+
"的医疗救助金缴费数据,请勿重复导入!"
,
i
,
random
));
continue
;
continue
;
}
else
{
}
else
{
paymentInfo
=
null
;
paymentInfo
=
null
;
...
@@ -952,9 +888,8 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
...
@@ -952,9 +888,8 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
//存在社保缴费数据
//存在社保缴费数据
if
(
null
!=
paymentInfo
&&
BigDecimalUtils
.
safeMultiply
(
BigDecimalUtils
.
isNullToZero
(
infoVo
.
getUnitInjuryMoney
()),
if
(
null
!=
paymentInfo
&&
BigDecimalUtils
.
safeMultiply
(
BigDecimalUtils
.
isNullToZero
(
infoVo
.
getUnitInjuryMoney
()),
BigDecimalUtils
.
isNullToZero
(
paymentInfo
.
getUnitInjuryMoney
())).
compareTo
(
BigDecimal
.
ZERO
)
>
0
)
{
BigDecimalUtils
.
isNullToZero
(
paymentInfo
.
getUnitInjuryMoney
())).
compareTo
(
BigDecimal
.
ZERO
)
>
0
)
{
logList
.
add
(
new
TPaymentInfoImportLog
(
null
,
infoVo
.
getEmpName
(),
infoVo
.
getEmpIdcard
()
errorMessageList
.
add
(
new
ErrorMessage
(
infoVo
.
getRowIndex
(),
"已存在对应员工身份证"
+
infoVo
.
getEmpIdcard
()
,
CommonConstants
.
ERROR_MSG_PRFIX
+
"已存在对应员工身份证"
+
infoVo
.
getEmpIdcard
()
+
"的单位工伤缴费数据,请勿重复导入!"
));
+
"的单位工伤缴费数据,请勿重复导入!"
,
i
,
random
));
continue
;
continue
;
}
else
{
}
else
{
paymentInfo
=
null
;
paymentInfo
=
null
;
...
@@ -975,9 +910,8 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
...
@@ -975,9 +910,8 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
//存在社保缴费数据
//存在社保缴费数据
if
(
null
!=
paymentInfo
&&
BigDecimalUtils
.
safeMultiply
(
BigDecimalUtils
.
isNullToZero
(
infoVo
.
getUnitBirthMoney
()),
if
(
null
!=
paymentInfo
&&
BigDecimalUtils
.
safeMultiply
(
BigDecimalUtils
.
isNullToZero
(
infoVo
.
getUnitBirthMoney
()),
BigDecimalUtils
.
isNullToZero
(
paymentInfo
.
getUnitBirthMoney
())).
compareTo
(
BigDecimal
.
ZERO
)
>
0
)
{
BigDecimalUtils
.
isNullToZero
(
paymentInfo
.
getUnitBirthMoney
())).
compareTo
(
BigDecimal
.
ZERO
)
>
0
)
{
logList
.
add
(
new
TPaymentInfoImportLog
(
null
,
infoVo
.
getEmpName
(),
infoVo
.
getEmpIdcard
()
errorMessageList
.
add
(
new
ErrorMessage
(
infoVo
.
getRowIndex
(),
"已存在对应员工身份证"
+
infoVo
.
getEmpIdcard
()
,
CommonConstants
.
ERROR_MSG_PRFIX
+
"已存在对应员工身份证"
+
infoVo
.
getEmpIdcard
()
+
"的单位生育缴费数据,请勿重复导入!"
));
+
"的单位生育缴费数据,请勿重复导入!"
,
i
,
random
));
continue
;
continue
;
}
else
{
}
else
{
paymentInfo
=
null
;
paymentInfo
=
null
;
...
@@ -1080,60 +1014,21 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
...
@@ -1080,60 +1014,21 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
if
(
null
!=
paymentInfo
&&
Common
.
isNotNull
(
paymentInfo
.
getId
()))
{
if
(
null
!=
paymentInfo
&&
Common
.
isNotNull
(
paymentInfo
.
getId
()))
{
res
=
baseMapper
.
updateById
(
paymentInfo
);
res
=
baseMapper
.
updateById
(
paymentInfo
);
if
(
res
<
0
)
{
if
(
res
<
0
)
{
logList
.
add
(
new
TPaymentInfoImportLog
(
null
,
infoVo
.
getEmpName
(),
infoVo
.
getEmpIdcard
()
errorMessageList
.
add
(
new
ErrorMessage
(
infoVo
.
getRowIndex
(),
infoVo
.
getEmpName
()
+
"_缴费库更新失败!"
));
,
CommonConstants
.
ERROR_MSG_PRFIX
+
infoVo
.
getEmpName
()
+
"_缴费库更新失败!"
,
i
,
random
));
continue
;
}
else
{
logList
.
add
(
new
TPaymentInfoImportLog
(
null
,
infoVo
.
getEmpName
(),
infoVo
.
getEmpIdcard
()
,
CommonConstants
.
ERROR_MSG_PRFIX
+
infoVo
.
getEmpName
()
+
"_缴费库更新成功!"
,
i
,
random
));
continue
;
continue
;
}
}
}
else
{
}
else
{
res
=
insertAndSTimestamp
(
paymentInfo
);
res
=
insertAndSTimestamp
(
paymentInfo
);
if
(
res
<
0
)
{
if
(
res
<
0
)
{
logList
.
add
(
new
TPaymentInfoImportLog
(
null
,
infoVo
.
getEmpName
(),
infoVo
.
getEmpIdcard
()
errorMessageList
.
add
(
new
ErrorMessage
(
infoVo
.
getRowIndex
(),
infoVo
.
getEmpName
()
+
"_缴费库保存失败!"
));
,
CommonConstants
.
ERROR_MSG_PRFIX
+
infoVo
.
getEmpName
()
+
"_缴费库保存失败!"
,
i
,
random
));
continue
;
continue
;
}
}
}
}
logList
.
add
(
new
TPaymentInfoImportLog
(
null
,
infoVo
.
getEmpName
(),
infoVo
.
getEmpIdcard
()
,
CommonConstants
.
SUCCESS_MSG_PREFIX
+
"保存成功!"
,
i
,
random
));
}
}
itemMap
.
clear
();
itemMap
.
clear
();
cusMap
.
clear
();
cusMap
.
clear
();
}
else
{
return
null
;
}
}
return
logList
;
return
errorMessageList
;
}
/**
* 转换缴纳地址为省市县ID
**/
private
TPaymentInfoVo
initAddress
(
String
[]
areaArray
,
HashMap
<
String
,
String
>
areaMap2
,
TPaymentInfoVo
s
)
{
if
(
null
==
areaArray
||
null
==
areaMap2
||
null
==
s
)
{
return
s
;
}
String
temp
=
null
;
if
(
areaArray
.
length
>=
CommonConstants
.
TWO_INT
)
{
temp
=
areaMap2
.
get
(
areaArray
[
0
]
+
CommonConstants
.
DOWN_LINE_STRING
+
"null"
);
if
(
Common
.
isNotNull
(
temp
))
{
s
.
setSocialProvince
(
temp
);
}
temp
=
areaMap2
.
get
(
areaArray
[
1
]
+
CommonConstants
.
DOWN_LINE_STRING
+
(
null
==
s
.
getSocialProvince
()
?
"null"
:
s
.
getSocialProvince
()));
if
(
Common
.
isNotNull
(
temp
))
{
s
.
setSocialCity
(
temp
);
}
if
(
areaArray
.
length
>=
CommonConstants
.
THREE_INT
)
{
temp
=
areaMap2
.
get
(
areaArray
[
2
]
+
CommonConstants
.
DOWN_LINE_STRING
+
(
null
==
s
.
getSocialCity
()
?
"null"
:
s
.
getSocialCity
()));
if
(
Common
.
isNotNull
(
temp
))
{
s
.
setSocialTown
(
temp
);
}
}
}
return
s
;
}
}
//比对缴纳地是否一致
//比对缴纳地是否一致
...
@@ -1245,7 +1140,6 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
...
@@ -1245,7 +1140,6 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
YifuUser
user
=
SecurityUtils
.
getUser
();
YifuUser
user
=
SecurityUtils
.
getUser
();
List
<
ErrorMessage
>
errorMessageList
=
new
ArrayList
<>();
List
<
ErrorMessage
>
errorMessageList
=
new
ArrayList
<>();
ExcelUtil
<
TPaymentHeFeiVo
>
util1
=
new
ExcelUtil
<>(
TPaymentHeFeiVo
.
class
);
ExcelUtil
<
TPaymentHeFeiVo
>
util1
=
new
ExcelUtil
<>(
TPaymentHeFeiVo
.
class
);
;
// 写法2:
// 写法2:
// 匿名内部类 不用额外写一个DemoDataListener
// 匿名内部类 不用额外写一个DemoDataListener
// 这里 需要指定读用哪个class去读,然后读取第一个sheet 文件流会自动关闭
// 这里 需要指定读用哪个class去读,然后读取第一个sheet 文件流会自动关闭
...
@@ -1304,7 +1198,6 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
...
@@ -1304,7 +1198,6 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
YifuUser
user
=
SecurityUtils
.
getUser
();
YifuUser
user
=
SecurityUtils
.
getUser
();
List
<
ErrorMessage
>
errorMessageList
=
new
ArrayList
<>();
List
<
ErrorMessage
>
errorMessageList
=
new
ArrayList
<>();
ExcelUtil
<
TPaymentInfoVo
>
util1
=
new
ExcelUtil
<>(
TPaymentInfoVo
.
class
);
ExcelUtil
<
TPaymentInfoVo
>
util1
=
new
ExcelUtil
<>(
TPaymentInfoVo
.
class
);
;
// 写法2:
// 写法2:
// 匿名内部类 不用额外写一个DemoDataListener
// 匿名内部类 不用额外写一个DemoDataListener
// 这里 需要指定读用哪个class去读,然后读取第一个sheet 文件流会自动关闭
// 这里 需要指定读用哪个class去读,然后读取第一个sheet 文件流会自动关闭
...
@@ -1646,7 +1539,6 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
...
@@ -1646,7 +1539,6 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
private
void
importTPaymentSocialHeFei
(
List
<
TPaymentHeFeiVo
>
list
,
List
<
ErrorMessage
>
errorMessageList
,
private
void
importTPaymentSocialHeFei
(
List
<
TPaymentHeFeiVo
>
list
,
List
<
ErrorMessage
>
errorMessageList
,
String
random
,
YifuUser
user
,
String
type
)
{
String
random
,
YifuUser
user
,
String
type
)
{
long
start
=
System
.
currentTimeMillis
();
HashMap
<
String
,
String
>
areaMap
=
new
HashMap
<
String
,
String
>();
HashMap
<
String
,
String
>
areaMap
=
new
HashMap
<
String
,
String
>();
HashMap
<
String
,
String
>
areaMap2
=
new
HashMap
<
String
,
String
>();
HashMap
<
String
,
String
>
areaMap2
=
new
HashMap
<
String
,
String
>();
...
@@ -1666,13 +1558,6 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
...
@@ -1666,13 +1558,6 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
// 判断是否有相同的用户在导入社保费用 存在提示稍后重试
// 判断是否有相同的用户在导入社保费用 存在提示稍后重试
String
key
=
user
.
getId
()
+
CommonConstants
.
DOWN_LINE_STRING
+
CommonConstants
.
PAYMENT_SOCIAL_IMPORT
;
String
key
=
user
.
getId
()
+
CommonConstants
.
DOWN_LINE_STRING
+
CommonConstants
.
PAYMENT_SOCIAL_IMPORT
;
Map
<
String
,
TPaymentHeFeiVo
>
listMap
=
new
HashMap
<>();
initListToMapThree
(
list
,
listMap
);
// 把初步校验的内容返回给前端
if
(
Common
.
isNotNull
(
errorMessageList
))
{
getErrorMessageHashMapThree
(
user
,
random
,
errorMessageList
,
key
,
listMap
);
}
// 将以下代码提取出来,使用paymentInfoMap提升性能,避免list多次循环查询数据库浪费性能
// 将以下代码提取出来,使用paymentInfoMap提升性能,避免list多次循环查询数据库浪费性能
// 导入前做队列空闲判断,防止队列不足出现数据丢失的场景
// 导入前做队列空闲判断,防止队列不足出现数据丢失的场景
if
(
CollUtil
.
isNotEmpty
(
list
))
{
if
(
CollUtil
.
isNotEmpty
(
list
))
{
...
@@ -1680,9 +1565,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
...
@@ -1680,9 +1565,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
int
residualCapacity
=
yfSocialImportThreadPoolExecutor
.
getResidualCapacity
();
int
residualCapacity
=
yfSocialImportThreadPoolExecutor
.
getResidualCapacity
();
if
(
taskSize
>
residualCapacity
)
{
if
(
taskSize
>
residualCapacity
)
{
errorMessageList
.
add
(
new
ErrorMessage
(-
1
,
MsgUtils
.
getMessage
(
ErrorCodes
.
SOCIALINFO_LIST_NUM_LARGE
)));
errorMessageList
.
add
(
new
ErrorMessage
(-
1
,
MsgUtils
.
getMessage
(
ErrorCodes
.
SOCIALINFO_LIST_NUM_LARGE
)));
}
}
else
{
}
// -----------------------------生成paymentInfoMap本段开始--------------------------------
// -----------------------------生成paymentInfoMap本段开始--------------------------------
//已存在的档案数据
//已存在的档案数据
List
<
String
>
monthList
=
Common
.
listObjectToStrList
(
list
,
ExcelAttributeConstants
.
SOCIAL_PAY_MONTH
).
stream
().
distinct
().
collect
(
Collectors
.
toList
());
List
<
String
>
monthList
=
Common
.
listObjectToStrList
(
list
,
ExcelAttributeConstants
.
SOCIAL_PAY_MONTH
).
stream
().
distinct
().
collect
(
Collectors
.
toList
());
...
@@ -1765,22 +1648,13 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
...
@@ -1765,22 +1648,13 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
// -----------------------------线程池处理list,批量保存社保信息开始--------------------------------
// -----------------------------线程池处理list,批量保存社保信息开始--------------------------------
List
<
TPaymentHeFeiVo
>
tempList
=
new
ArrayList
<>();
List
<
TPaymentHeFeiVo
>
tempList
=
new
ArrayList
<>();
AtomicInteger
atomicLine
=
new
AtomicInteger
(
CommonConstants
.
ZERO_INT
);
AtomicInteger
atomicLine
=
new
AtomicInteger
(
CommonConstants
.
ZERO_INT
);
List
<
CompletableFuture
<
List
<
TPaymentInfoImportLog
>>>
completableFutureList
=
new
ArrayList
<>();
try
{
try
{
// 1.list.size()不足partSize,直接执行
// 1.list.size()不足partSize,直接执行
if
(
list
.
size
()
<
partSize
)
{
if
(
list
.
size
()
<
partSize
)
{
CompletableFuture
<
List
<
TPaymentInfoImportLog
>>
listCompletableFuture
=
CompletableFuture
.
supplyAsync
(()
CompletableFuture
.
supplyAsync
(()
->
executeImportSocialListThree
(
->
executeImportSocialListThree
(
user
,
atomicLine
,
random
,
list
,
areaMap
,
areaMap2
,
user
,
atomicLine
,
random
,
list
,
areaMap
,
areaMap2
,
paymentInfoPensionMap
,
paymentInfoPensionMap
,
paymentInfoMedicalMap
,
paymentInfoUnEmpMap
,
paymentInfoMedicalMap
,
paymentInfoUnEmpMap
,
paymentInfoInjuryMap
,
paymentInfoInjuryMap
,
CommonConstants
.
ONE_INT
,
type
),
yfSocialImportThreadPoolExecutor
)
CommonConstants
.
ONE_INT
,
type
,
errorMessageList
),
yfSocialImportThreadPoolExecutor
);
.
whenComplete
((
result
,
e
)
->
{
if
(
CollectionUtils
.
isNotEmpty
(
result
))
{
this
.
tPaymentInfoImportLogService
.
saveBatch
(
result
);
}
//todo
// ServiceUtil.initErrorMessage(atomicLine.get(), remotePushService, pushParam);
});
completableFutureList
.
add
(
listCompletableFuture
);
}
}
// 2.list.size()大于partSize,循环分批执行
// 2.list.size()大于partSize,循环分批执行
...
@@ -1788,18 +1662,12 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
...
@@ -1788,18 +1662,12 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
if
(
partSize
<=
list
.
size
())
{
if
(
partSize
<=
list
.
size
())
{
// 处理第一个0位元素
// 处理第一个0位元素
final
List
<
TPaymentHeFeiVo
>
finalList
=
list
.
subList
(
0
,
1
);
final
List
<
TPaymentHeFeiVo
>
finalList
=
list
.
subList
(
0
,
1
);
CompletableFuture
<
List
<
TPaymentInfoImportLog
>>
oneCompletableFuture
=
CompletableFuture
.
supplyAsync
(()
CompletableFuture
.
supplyAsync
(()
->
executeImportSocialListThree
(
->
executeImportSocialListThree
(
user
,
atomicLine
,
random
,
finalList
,
areaMap
,
areaMap2
,
user
,
atomicLine
,
random
,
finalList
,
areaMap
,
areaMap2
,
paymentInfoPensionMap
,
paymentInfoMedicalMap
,
paymentInfoUnEmpMap
,
paymentInfoPensionMap
,
paymentInfoMedicalMap
,
paymentInfoUnEmpMap
,
paymentInfoInjuryMap
,
CommonConstants
.
ONE_INT
,
type
),
yfSocialImportThreadPoolExecutor
)
paymentInfoInjuryMap
,
CommonConstants
.
ONE_INT
,
type
,
errorMessageList
)
.
whenComplete
((
result
,
e
)
->
{
,
yfSocialImportThreadPoolExecutor
);
if
(
CollectionUtils
.
isNotEmpty
(
result
))
{
this
.
tPaymentInfoImportLogService
.
saveBatch
(
result
);
}
// ServiceUtil.initErrorMessage(atomicLine.get(), remotePushService, pushParam);
});
lastIdx
=
1
;
lastIdx
=
1
;
completableFutureList
.
add
(
oneCompletableFuture
);
for
(
int
i
=
1
;
i
<
list
.
size
();
i
++)
{
for
(
int
i
=
1
;
i
<
list
.
size
();
i
++)
{
// partSize数量的list为一个执行单元
// partSize数量的list为一个执行单元
tempList
.
add
(
list
.
get
(
i
));
tempList
.
add
(
list
.
get
(
i
));
...
@@ -1807,17 +1675,11 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
...
@@ -1807,17 +1675,11 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
lastIdx
=
i
;
lastIdx
=
i
;
final
int
idx
=
i
-
partSize
+
2
;
final
int
idx
=
i
-
partSize
+
2
;
List
<
TPaymentHeFeiVo
>
finalTempList1
=
tempList
;
List
<
TPaymentHeFeiVo
>
finalTempList1
=
tempList
;
CompletableFuture
<
List
<
TPaymentInfoImportLog
>>
listCompletableFuture
=
CompletableFuture
.
supplyAsync
(()
CompletableFuture
.
supplyAsync
(()
->
executeImportSocialListThree
(
user
->
executeImportSocialListThree
(
user
,
atomicLine
,
random
,
finalTempList1
,
areaMap
,
,
atomicLine
,
random
,
finalTempList1
,
areaMap
,
areaMap2
,
paymentInfoPensionMap
,
paymentInfoMedicalMap
,
paymentInfoUnEmpMap
,
areaMap2
,
paymentInfoPensionMap
,
paymentInfoMedicalMap
,
paymentInfoUnEmpMap
,
paymentInfoInjuryMap
,
idx
,
type
),
yfSocialImportThreadPoolExecutor
)
paymentInfoInjuryMap
,
idx
,
type
,
errorMessageList
)
.
whenComplete
((
result
,
e
)
->
{
,
yfSocialImportThreadPoolExecutor
);
if
(
CollectionUtils
.
isNotEmpty
(
result
))
{
this
.
tPaymentInfoImportLogService
.
saveBatch
(
result
);
}
// ServiceUtil.initErrorMessage(atomicLine.get(), remotePushService, pushParam);
});
completableFutureList
.
add
(
listCompletableFuture
);
tempList
=
new
ArrayList
<>();
tempList
=
new
ArrayList
<>();
}
}
}
}
...
@@ -1839,37 +1701,19 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
...
@@ -1839,37 +1701,19 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
List
<
TPaymentHeFeiVo
>
finalTempList
=
tempList
;
List
<
TPaymentHeFeiVo
>
finalTempList
=
tempList
;
int
finalLastIdx
=
lastIdx
+
1
;
int
finalLastIdx
=
lastIdx
+
1
;
CompletableFuture
<
List
<
TPaymentInfoImportLog
>>
listCompletableFuture
=
CompletableFuture
.
supplyAsync
(()
CompletableFuture
.
supplyAsync
(()
->
executeImportSocialListThree
(
->
executeImportSocialListThree
(
user
,
atomicLine
,
random
,
finalTempList
,
areaMap
,
user
,
atomicLine
,
random
,
finalTempList
,
areaMap
,
areaMap2
,
paymentInfoPensionMap
,
paymentInfoMedicalMap
,
paymentInfoUnEmpMap
,
areaMap2
,
paymentInfoPensionMap
,
paymentInfoMedicalMap
,
paymentInfoUnEmpMap
,
paymentInfoInjuryMap
,
finalLastIdx
,
type
),
yfSocialImportThreadPoolExecutor
)
paymentInfoInjuryMap
,
finalLastIdx
,
type
,
errorMessageList
)
.
whenComplete
((
result
,
e
)
->
{
,
yfSocialImportThreadPoolExecutor
);
if
(
CollectionUtils
.
isNotEmpty
(
result
))
{
this
.
tPaymentInfoImportLogService
.
saveBatch
(
result
);
}
// ServiceUtil.initErrorMessage(atomicLine.get(), remotePushService, pushParam);
});
completableFutureList
.
add
(
listCompletableFuture
);
}
}
// 阻塞当前线程,等待所有的线程执行完毕
boolean
computeFlag
;
do
{
computeFlag
=
false
;
for
(
CompletableFuture
<
List
<
TPaymentInfoImportLog
>>
listCompletableFuture
:
completableFutureList
)
{
if
(!
listCompletableFuture
.
isDone
())
{
computeFlag
=
true
;
}
}
}
while
(
computeFlag
);
String
importSuccessKey
=
user
.
getId
()
+
CommonConstants
.
DOWN_LINE_STRING
+
CommonConstants
.
PAYMENT_SOCIAL_WAIT_EXPORT
;
String
importSuccessKey
=
user
.
getId
()
+
CommonConstants
.
DOWN_LINE_STRING
+
CommonConstants
.
PAYMENT_SOCIAL_WAIT_EXPORT
;
redisUtil
.
set
(
importSuccessKey
,
random
,
1800L
);
redisUtil
.
set
(
importSuccessKey
,
random
,
1800L
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
log
.
error
(
"社保缴费库数据批量导入异常:"
+
e
);
log
.
error
(
"社保缴费库数据批量导入异常:"
+
e
);
redisUtil
.
remove
(
key
);
redisUtil
.
remove
(
key
);
errorMessageList
.
add
(
new
ErrorMessage
(-
1
,
"数据批量导入异常:"
+
e
));
}
finally
{
}
finally
{
paymentInfoPensionMap
.
clear
();
paymentInfoPensionMap
.
clear
();
paymentInfoBigMap
.
clear
();
paymentInfoBigMap
.
clear
();
...
@@ -1878,38 +1722,10 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
...
@@ -1878,38 +1722,10 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
paymentInfoInjuryMap
.
clear
();
paymentInfoInjuryMap
.
clear
();
}
}
}
}
private
void
initListToMapThree
(
List
<
TPaymentHeFeiVo
>
list
,
Map
<
String
,
TPaymentHeFeiVo
>
listMap
)
{
if
(
Common
.
isNotNull
(
list
))
{
for
(
TPaymentHeFeiVo
vo
:
list
)
{
listMap
.
put
(
String
.
valueOf
(
list
.
indexOf
(
vo
)
+
2
),
vo
);
}
}
}
}
/*
* 保存初步校验
* */
private
void
getErrorMessageHashMapThree
(
YifuUser
user
,
String
random
,
List
<
ErrorMessage
>
errorInfo
,
String
key
,
Map
<
String
,
TPaymentHeFeiVo
>
listMap
)
{
List
<
TPaymentInfoImportLog
>
logList
=
new
ArrayList
<>();
TPaymentHeFeiVo
vo
=
null
;
for
(
ErrorMessage
error
:
errorInfo
)
{
vo
=
listMap
.
get
(
error
.
getLineNum
().
toString
());
logList
.
add
(
new
TPaymentInfoImportLog
(
null
,
null
==
vo
?
""
:
vo
.
getEmpName
(),
null
==
vo
?
""
:
vo
.
getEmpIdcard
(),
error
.
getMessage
(),
vo
.
getRowIndex
(),
random
));
}
if
(
Common
.
isNotNull
(
logList
))
{
this
.
tPaymentInfoImportLogService
.
saveBatch
(
logList
);
}
redisUtil
.
set
(
user
.
getId
()
+
CommonConstants
.
DOWN_LINE_STRING
+
CommonConstants
.
PAYMENT_SOCIAL_WAIT_EXPORT
,
random
,
1800L
);
redisUtil
.
remove
(
key
);
}
}
private
List
<
TPaymentInfoImportLog
>
executeImportSocialListThree
(
YifuUser
user
,
AtomicInteger
atomicLine
,
private
List
<
ErrorMessage
>
executeImportSocialListThree
(
YifuUser
user
,
AtomicInteger
atomicLine
,
String
random
,
String
random
,
List
<
TPaymentHeFeiVo
>
list
,
List
<
TPaymentHeFeiVo
>
list
,
HashMap
<
String
,
String
>
areaMap
,
HashMap
<
String
,
String
>
areaMap
,
...
@@ -1918,10 +1734,8 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
...
@@ -1918,10 +1734,8 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
ConcurrentHashMap
<
String
,
TPaymentInfo
>
paymentInfoMedicalMap
,
ConcurrentHashMap
<
String
,
TPaymentInfo
>
paymentInfoMedicalMap
,
ConcurrentHashMap
<
String
,
TPaymentInfo
>
paymentInfoUnEmpMap
,
ConcurrentHashMap
<
String
,
TPaymentInfo
>
paymentInfoUnEmpMap
,
ConcurrentHashMap
<
String
,
TPaymentInfo
>
paymentInfoInjuryMap
,
ConcurrentHashMap
<
String
,
TPaymentInfo
>
paymentInfoInjuryMap
,
int
idx
,
int
idx
,
String
type
,
List
<
ErrorMessage
>
errorMessageList
)
{
String
type
)
{
int
i
=
idx
;
int
i
=
idx
;
List
<
TPaymentInfoImportLog
>
logList
=
new
ArrayList
<>();
if
(
Common
.
isNotNull
(
list
))
{
if
(
Common
.
isNotNull
(
list
))
{
TPaymentInfo
payExists
=
null
;
TPaymentInfo
payExists
=
null
;
TSocialInfo
socialInfo
=
null
;
TSocialInfo
socialInfo
=
null
;
...
@@ -1989,7 +1803,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
...
@@ -1989,7 +1803,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
infoVo
.
setEmpIdcard
(
infoVo
.
getEmpIdcard
().
replace
(
"x"
,
"X"
));
infoVo
.
setEmpIdcard
(
infoVo
.
getEmpIdcard
().
replace
(
"x"
,
"X"
));
}
}
//导入校验
//导入校验
if
(
socialThreeCheckBase
(
random
,
i
,
log
List
,
infoVo
,
type
))
{
if
(
socialThreeCheckBase
(
random
,
i
,
errorMessage
List
,
infoVo
,
type
))
{
continue
;
continue
;
}
}
//无对应员工的社保数据
//无对应员工的社保数据
...
@@ -2005,13 +1819,10 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
...
@@ -2005,13 +1819,10 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
}
}
//对身份证与人员姓名的对应关系进行校验
//对身份证与人员姓名的对应关系进行校验
if
(
socialInfo
!=
null
&&
!
socialInfo
.
getEmpName
().
equals
(
infoVo
.
getEmpName
()))
{
if
(
socialInfo
!=
null
&&
!
socialInfo
.
getEmpName
().
equals
(
infoVo
.
getEmpName
()))
{
logList
.
add
(
new
TPaymentInfoImportLog
(
null
,
infoVo
.
getEmpName
(),
infoVo
.
getEmpIdcard
()
errorMessageList
.
add
(
new
ErrorMessage
(
infoVo
.
getRowIndex
(),
"姓名与身份证信息不一致,请核实后再次尝试!"
));
,
CommonConstants
.
ERROR_MSG_PRFIX
+
"姓名与身份证信息不一致,请核实后再次尝试!"
,
i
,
random
));
continue
;
}
}
if
(
socialInfo
!=
null
&&
socialInfo
.
getSocialStartDate
()
==
null
)
{
if
(
socialInfo
!=
null
&&
socialInfo
.
getSocialStartDate
()
==
null
)
{
logList
.
add
(
new
TPaymentInfoImportLog
(
null
,
infoVo
.
getEmpName
(),
infoVo
.
getEmpIdcard
()
errorMessageList
.
add
(
new
ErrorMessage
(
infoVo
.
getRowIndex
(),
infoVo
.
getEmpIdcard
()
+
"的社保起缴日期为空!"
));
,
CommonConstants
.
ERROR_MSG_PRFIX
+
infoVo
.
getEmpIdcard
()
+
"的社保起缴日期为空!"
,
i
,
random
));
continue
;
continue
;
}
}
if
(
null
==
socialInfo
||
(
null
!=
socialInfo
&&
!
ServiceUtil
.
checkMothForPaymentImport
(
if
(
null
==
socialInfo
||
(
null
!=
socialInfo
&&
!
ServiceUtil
.
checkMothForPaymentImport
(
...
@@ -2023,8 +1834,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
...
@@ -2023,8 +1834,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
+
CommonConstants
.
DOWN_LINE_STRING
+
(
null
==
infoVo
.
getSocialTown
()
?
"null"
:
infoVo
.
getSocialTown
()));
+
CommonConstants
.
DOWN_LINE_STRING
+
(
null
==
infoVo
.
getSocialTown
()
?
"null"
:
infoVo
.
getSocialTown
()));
//对身份证与人员姓名的对应关系进行校验
//对身份证与人员姓名的对应关系进行校验
if
(
socialInfo
!=
null
&&
!
socialInfo
.
getEmpName
().
equals
(
infoVo
.
getEmpName
()))
{
if
(
socialInfo
!=
null
&&
!
socialInfo
.
getEmpName
().
equals
(
infoVo
.
getEmpName
()))
{
logList
.
add
(
new
TPaymentInfoImportLog
(
null
,
infoVo
.
getEmpName
(),
infoVo
.
getEmpIdcard
()
errorMessageList
.
add
(
new
ErrorMessage
(
infoVo
.
getRowIndex
(),
"姓名与身份证信息不一致,请核实后再次尝试!"
));
,
CommonConstants
.
ERROR_MSG_PRFIX
+
"姓名与身份证信息不一致,请核实后再次尝试!"
,
i
,
random
));
continue
;
continue
;
}
}
if
(
null
!=
socialInfo
&&
!
ServiceUtil
.
checkMothForPaymentImport
(
socialInfo
.
getSocialStartDate
()
if
(
null
!=
socialInfo
&&
!
ServiceUtil
.
checkMothForPaymentImport
(
socialInfo
.
getSocialStartDate
()
...
@@ -2044,23 +1854,20 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
...
@@ -2044,23 +1854,20 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
}
}
}
}
if
(
null
==
socialInfo
)
{
if
(
null
==
socialInfo
)
{
logList
.
add
(
new
TPaymentInfoImportLog
(
null
,
infoVo
.
getEmpName
(),
infoVo
.
getEmpIdcard
()
errorMessageList
.
add
(
new
ErrorMessage
(
infoVo
.
getRowIndex
(),
"无对应员工"
+
infoVo
.
getEmpIdcard
()
+
,
CommonConstants
.
ERROR_MSG_PRFIX
+
"无对应员工"
+
infoVo
.
getEmpIdcard
()
+
"的社保数据(请查验社保办理状态|缴纳地|起缴月份|停缴月份)"
));
"的社保数据(请查验社保办理状态|缴纳地|起缴月份|停缴月份)"
,
i
,
random
));
continue
;
continue
;
}
}
//如果导入项目数大于办理成功项目数给提示,少于给进,有问题自行删除后导入
//如果导入项目数大于办理成功项目数给提示,少于给进,有问题自行删除后导入
checkRes
=
checkRepeatInfoThree
(
socialInfo
,
infoVo
,
type
);
checkRes
=
checkRepeatInfoThree
(
socialInfo
,
infoVo
,
type
);
if
(
null
!=
checkRes
)
{
if
(
null
!=
checkRes
)
{
logList
.
add
(
new
TPaymentInfoImportLog
(
null
,
infoVo
.
getEmpName
(),
infoVo
.
getEmpIdcard
()
errorMessageList
.
add
(
new
ErrorMessage
(
infoVo
.
getRowIndex
(),
checkRes
));
,
CommonConstants
.
ERROR_MSG_PRFIX
+
checkRes
,
i
,
random
));
continue
;
continue
;
}
}
//查看缴纳月是否为空
//查看缴纳月是否为空
if
(!
Common
.
isNotNull
(
infoVo
.
getSocialPayMonth
()))
{
if
(!
Common
.
isNotNull
(
infoVo
.
getSocialPayMonth
()))
{
logList
.
add
(
new
TPaymentInfoImportLog
(
null
,
infoVo
.
getEmpName
(),
infoVo
.
getEmpIdcard
()
errorMessageList
.
add
(
new
ErrorMessage
(
infoVo
.
getRowIndex
(),
"必填项校验失败:社保缴纳月份不可为空!"
));
,
CommonConstants
.
ERROR_MSG_PRFIX
+
"必填项校验失败:社保缴纳月份不可为空!"
,
i
,
random
));
continue
;
continue
;
}
}
...
@@ -2081,9 +1888,8 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
...
@@ -2081,9 +1888,8 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
BigDecimalUtils
.
isNullToZero
(
infoVo
.
getUnitSet
())),
BigDecimalUtils
.
safeAdd
(
BigDecimalUtils
.
isNullToZero
(
infoVo
.
getUnitSet
())),
BigDecimalUtils
.
safeAdd
(
BigDecimalUtils
.
isNullToZero
(
payExists
.
getUnitPensionMoney
()),
BigDecimalUtils
.
isNullToZero
(
payExists
.
getUnitPensionMoney
()),
BigDecimalUtils
.
isNullToZero
(
payExists
.
getPersonalPensionMoney
()))).
compareTo
(
BigDecimal
.
ZERO
)
>
0
)
{
BigDecimalUtils
.
isNullToZero
(
payExists
.
getPersonalPensionMoney
()))).
compareTo
(
BigDecimal
.
ZERO
)
>
0
)
{
logList
.
add
(
new
TPaymentInfoImportLog
(
null
,
infoVo
.
getEmpName
(),
infoVo
.
getEmpIdcard
()
errorMessageList
.
add
(
new
ErrorMessage
(
infoVo
.
getRowIndex
(),
"已存在对应员工身份证"
+
infoVo
.
getEmpIdcard
()
,
CommonConstants
.
ERROR_MSG_PRFIX
+
"已存在对应员工身份证"
+
infoVo
.
getEmpIdcard
()
+
"的养老缴费数据,请勿重复导入!"
));
+
"的养老缴费数据,请勿重复导入!"
,
i
,
random
));
continue
;
continue
;
}
else
{
}
else
{
payExists
=
null
;
payExists
=
null
;
...
@@ -2107,9 +1913,8 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
...
@@ -2107,9 +1913,8 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
BigDecimalUtils
.
isNullToZero
(
infoVo
.
getUnitSet
())),
BigDecimalUtils
.
safeAdd
(
BigDecimalUtils
.
isNullToZero
(
infoVo
.
getUnitSet
())),
BigDecimalUtils
.
safeAdd
(
BigDecimalUtils
.
isNullToZero
(
payExists
.
getUnitUnemploymentMoney
()),
BigDecimalUtils
.
isNullToZero
(
payExists
.
getUnitUnemploymentMoney
()),
BigDecimalUtils
.
isNullToZero
(
payExists
.
getPersonalUnemploymentMoney
()))).
compareTo
(
BigDecimal
.
ZERO
)
>
0
)
{
BigDecimalUtils
.
isNullToZero
(
payExists
.
getPersonalUnemploymentMoney
()))).
compareTo
(
BigDecimal
.
ZERO
)
>
0
)
{
logList
.
add
(
new
TPaymentInfoImportLog
(
null
,
infoVo
.
getEmpName
(),
infoVo
.
getEmpIdcard
()
errorMessageList
.
add
(
new
ErrorMessage
(
infoVo
.
getRowIndex
(),
"已存在对应员工身份证"
+
infoVo
.
getEmpIdcard
()
,
CommonConstants
.
ERROR_MSG_PRFIX
+
"已存在对应员工身份证"
+
infoVo
.
getEmpIdcard
()
+
"的失业缴费数据,请勿重复导入!"
));
+
"的失业缴费数据,请勿重复导入!"
,
i
,
random
));
continue
;
continue
;
}
else
{
}
else
{
payExists
=
null
;
payExists
=
null
;
...
@@ -2134,9 +1939,8 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
...
@@ -2134,9 +1939,8 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
BigDecimalUtils
.
isNullToZero
(
infoVo
.
getPersonalMedicalMoney
())),
BigDecimalUtils
.
safeAdd
(
BigDecimalUtils
.
isNullToZero
(
infoVo
.
getPersonalMedicalMoney
())),
BigDecimalUtils
.
safeAdd
(
BigDecimalUtils
.
isNullToZero
(
payExists
.
getUnitMedicalMoney
()),
BigDecimalUtils
.
isNullToZero
(
payExists
.
getUnitMedicalMoney
()),
BigDecimalUtils
.
isNullToZero
(
payExists
.
getPersonalMedicalMoney
()))).
compareTo
(
BigDecimal
.
ZERO
)
>
0
)
{
BigDecimalUtils
.
isNullToZero
(
payExists
.
getPersonalMedicalMoney
()))).
compareTo
(
BigDecimal
.
ZERO
)
>
0
)
{
logList
.
add
(
new
TPaymentInfoImportLog
(
null
,
infoVo
.
getEmpName
(),
infoVo
.
getEmpIdcard
()
errorMessageList
.
add
(
new
ErrorMessage
(
infoVo
.
getRowIndex
(),
"已存在对应员工身份证"
+
infoVo
.
getEmpIdcard
()
,
CommonConstants
.
ERROR_MSG_PRFIX
+
"已存在对应员工身份证"
+
infoVo
.
getEmpIdcard
()
+
"的医保缴费数据,请勿重复导入!"
));
+
"的医保缴费数据,请勿重复导入!"
,
i
,
random
));
continue
;
continue
;
}
else
{
}
else
{
payExists
=
null
;
payExists
=
null
;
...
@@ -2160,9 +1964,8 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
...
@@ -2160,9 +1964,8 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
BigDecimalUtils
.
isNullToZero
(
infoVo
.
getUnitMedicalMoney
()),
BigDecimalUtils
.
isNullToZero
(
infoVo
.
getUnitMedicalMoney
()),
BigDecimalUtils
.
isNullToZero
(
infoVo
.
getPersonalMedicalMoney
())),
BigDecimalUtils
.
isNullToZero
(
infoVo
.
getPersonalMedicalMoney
())),
BigDecimalUtils
.
isNullToZero
(
payExists
.
getUnitInjuryMoney
())).
compareTo
(
BigDecimal
.
ZERO
)
>
0
)
{
BigDecimalUtils
.
isNullToZero
(
payExists
.
getUnitInjuryMoney
())).
compareTo
(
BigDecimal
.
ZERO
)
>
0
)
{
logList
.
add
(
new
TPaymentInfoImportLog
(
null
,
infoVo
.
getEmpName
(),
infoVo
.
getEmpIdcard
()
errorMessageList
.
add
(
new
ErrorMessage
(
infoVo
.
getRowIndex
(),
"已存在对应员工身份证"
+
infoVo
.
getEmpIdcard
()
,
CommonConstants
.
ERROR_MSG_PRFIX
+
"已存在对应员工身份证"
+
infoVo
.
getEmpIdcard
()
+
"的单位工伤缴费数据,请勿重复导入!"
));
+
"的单位工伤缴费数据,请勿重复导入!"
,
i
,
random
));
continue
;
continue
;
}
else
{
}
else
{
payExists
=
null
;
payExists
=
null
;
...
@@ -2278,58 +2081,44 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
...
@@ -2278,58 +2081,44 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
if
(
null
!=
payExists
&&
Common
.
isNotNull
(
payExists
.
getId
()))
{
if
(
null
!=
payExists
&&
Common
.
isNotNull
(
payExists
.
getId
()))
{
res
=
baseMapper
.
updateById
(
payExists
);
res
=
baseMapper
.
updateById
(
payExists
);
if
(
res
<
0
)
{
if
(
res
<
0
)
{
logList
.
add
(
new
TPaymentInfoImportLog
(
null
,
infoVo
.
getEmpName
(),
infoVo
.
getEmpIdcard
()
errorMessageList
.
add
(
new
ErrorMessage
(
infoVo
.
getRowIndex
(),
infoVo
.
getEmpIdcard
()
+
"_缴费库更新失败!"
));
,
CommonConstants
.
ERROR_MSG_PRFIX
+
infoVo
.
getEmpIdcard
()
+
"_缴费库更新失败!"
,
i
,
random
));
continue
;
}
else
{
logList
.
add
(
new
TPaymentInfoImportLog
(
null
,
infoVo
.
getEmpName
(),
infoVo
.
getEmpIdcard
()
,
CommonConstants
.
SUCCESS_MSG_PREFIX
+
infoVo
.
getEmpIdcard
()
+
"_缴费库更新成功!"
,
i
,
random
));
continue
;
continue
;
}
}
}
else
{
}
else
{
res
=
insertAndSTimestamp
(
payExists
);
res
=
insertAndSTimestamp
(
payExists
);
if
(
res
<
0
)
{
if
(
res
<
0
)
{
logList
.
add
(
new
TPaymentInfoImportLog
(
null
,
infoVo
.
getEmpName
(),
infoVo
.
getEmpIdcard
()
errorMessageList
.
add
(
new
ErrorMessage
(
infoVo
.
getRowIndex
(),
infoVo
.
getEmpIdcard
()
+
"_缴费库保存失败!"
));
,
CommonConstants
.
ERROR_MSG_PRFIX
+
infoVo
.
getEmpIdcard
()
+
"_缴费库保存失败!"
,
i
,
random
));
continue
;
continue
;
}
}
}
}
logList
.
add
(
new
TPaymentInfoImportLog
(
null
,
infoVo
.
getEmpName
(),
infoVo
.
getEmpIdcard
()
,
CommonConstants
.
SUCCESS_MSG_PREFIX
+
"保存成功!"
,
i
,
random
));
}
}
itemMap
.
clear
();
itemMap
.
clear
();
cusMap
.
clear
();
cusMap
.
clear
();
}
else
{
return
null
;
}
}
return
log
List
;
return
errorMessage
List
;
}
}
/**
/**
* 导入校验
* 导入校验
**/
**/
private
boolean
socialThreeCheckBase
(
String
random
,
int
i
,
List
<
TPaymentInfoImportLog
>
log
List
,
TPaymentHeFeiVo
private
boolean
socialThreeCheckBase
(
String
random
,
int
i
,
List
<
ErrorMessage
>
errorMessage
List
,
TPaymentHeFeiVo
infoVo
,
String
type
)
{
infoVo
,
String
type
)
{
if
(!
Common
.
isNotNull
(
infoVo
.
getSocialPayMonth
()))
{
if
(!
Common
.
isNotNull
(
infoVo
.
getSocialPayMonth
()))
{
logList
.
add
(
new
TPaymentInfoImportLog
(
null
,
infoVo
.
getEmpName
(),
infoVo
.
getEmpIdcard
()
errorMessageList
.
add
(
new
ErrorMessage
(
infoVo
.
getRowIndex
(),
"社保缴纳月份不可为空!"
));
,
CommonConstants
.
ERROR_MSG_PRFIX
+
"社保缴纳月份不可为空!"
,
i
,
random
));
return
true
;
return
true
;
}
}
if
(!
Common
.
isNotNull
(
infoVo
.
getSocialCreateMonth
()))
{
if
(!
Common
.
isNotNull
(
infoVo
.
getSocialCreateMonth
()))
{
logList
.
add
(
new
TPaymentInfoImportLog
(
null
,
infoVo
.
getEmpName
(),
infoVo
.
getEmpIdcard
()
errorMessageList
.
add
(
new
ErrorMessage
(
infoVo
.
getRowIndex
(),
"社保生成月份不可为空!"
));
,
CommonConstants
.
ERROR_MSG_PRFIX
+
"社保生成月份不可为空!"
,
i
,
random
));
return
true
;
return
true
;
}
}
if
(!
Common
.
isNotNull
(
infoVo
.
getSocialPayAddr
()))
{
if
(!
Common
.
isNotNull
(
infoVo
.
getSocialPayAddr
()))
{
logList
.
add
(
new
TPaymentInfoImportLog
(
null
,
infoVo
.
getEmpName
(),
infoVo
.
getEmpIdcard
()
errorMessageList
.
add
(
new
ErrorMessage
(
infoVo
.
getRowIndex
(),
"社保缴纳地不可为空!"
));
,
CommonConstants
.
ERROR_MSG_PRFIX
+
"社保缴纳地不可为空!"
,
i
,
random
));
return
true
;
return
true
;
}
}
if
(
CommonConstants
.
ZERO_STRING
.
equals
(
type
)
&&
!
PaymentConstants
.
PENSION_RISK
.
equals
(
infoVo
.
getRiskType
())
if
(
CommonConstants
.
ZERO_STRING
.
equals
(
type
)
&&
!
PaymentConstants
.
PENSION_RISK
.
equals
(
infoVo
.
getRiskType
())
&&
!
PaymentConstants
.
UNEMPLOYEEMENT_RISK
.
equals
(
infoVo
.
getRiskType
())
&&
!
PaymentConstants
.
UNEMPLOYEEMENT_RISK
.
equals
(
infoVo
.
getRiskType
())
&&
!
PaymentConstants
.
INJURY_RISK
.
equals
(
infoVo
.
getRiskType
()))
{
&&
!
PaymentConstants
.
INJURY_RISK
.
equals
(
infoVo
.
getRiskType
()))
{
logList
.
add
(
new
TPaymentInfoImportLog
(
null
,
infoVo
.
getEmpName
(),
infoVo
.
getEmpIdcard
()
errorMessageList
.
add
(
new
ErrorMessage
(
infoVo
.
getRowIndex
(),
"无相关险种!"
));
,
CommonConstants
.
ERROR_MSG_PRFIX
+
"无相关险种!"
,
i
,
random
));
return
true
;
return
true
;
}
}
return
false
;
return
false
;
...
@@ -2365,64 +2154,6 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
...
@@ -2365,64 +2154,6 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
return
s
;
return
s
;
}
}
/**
* 检验每个险种是否可以导入
*
* @param random String
* @param i int
* @param logList List<TPaymentInfoImportLog>
* @param payExists TPaymentInfoVo
* @param infoVo TPaymentHeFeiVo
* @param type String
* @return
* @Author huyc
* @Date 2022-07-27
**/
private
boolean
checkImportInfo
(
String
random
,
int
i
,
List
<
TPaymentInfoImportLog
>
logList
,
TPaymentInfoVo
payExists
,
TPaymentHeFeiVo
infoVo
,
String
type
)
{
boolean
flag
;
if
(
CommonConstants
.
ZERO_STRING
.
equals
(
type
))
{
// 对应养老险种已经存在金额 不合并
flag
=
BigDecimalUtils
.
safeAdd
(
BigDecimalUtils
.
isNullToZero
(
payExists
.
getUnitPensionMoney
())
,
BigDecimalUtils
.
isNullToZero
(
payExists
.
getPersonalPensionMoney
())).
compareTo
(
BigDecimal
.
ZERO
)
==
0
;
if
(
PaymentConstants
.
PENSION_RISK
.
equals
(
infoVo
.
getRiskType
())
&&
!
flag
)
{
logList
.
add
(
new
TPaymentInfoImportLog
(
null
,
infoVo
.
getEmpName
(),
infoVo
.
getEmpIdcard
()
,
CommonConstants
.
ERROR_MSG_PRFIX
+
"对应员工身份证"
+
infoVo
.
getEmpIdcard
()
+
"养老数据已存在,请勿重复导入!"
,
i
,
random
));
return
true
;
}
// 对应失业险种已经存在金额 不合并
flag
=
BigDecimalUtils
.
safeAdd
(
BigDecimalUtils
.
isNullToZero
(
payExists
.
getUnitUnemploymentMoney
())
,
BigDecimalUtils
.
isNullToZero
(
payExists
.
getPersonalUnemploymentMoney
())).
compareTo
(
BigDecimal
.
ZERO
)
==
0
;
if
(
PaymentConstants
.
UNEMPLOYEEMENT_RISK
.
equals
(
infoVo
.
getRiskType
())
&&
!
flag
)
{
logList
.
add
(
new
TPaymentInfoImportLog
(
null
,
infoVo
.
getEmpName
(),
infoVo
.
getEmpIdcard
()
,
CommonConstants
.
ERROR_MSG_PRFIX
+
"对应员工身份证"
+
infoVo
.
getEmpIdcard
()
+
"失业数据已存在,请勿重复导入!"
,
i
,
random
));
return
true
;
}
// 对应工伤险种已经存在金额 不合并
flag
=
BigDecimalUtils
.
isNullToZero
(
payExists
.
getUnitInjuryMoney
()).
compareTo
(
BigDecimal
.
ZERO
)
==
0
;
if
(
PaymentConstants
.
INJURY_RISK
.
equals
(
infoVo
.
getRiskType
())
&&
!
flag
)
{
logList
.
add
(
new
TPaymentInfoImportLog
(
null
,
infoVo
.
getEmpName
(),
infoVo
.
getEmpIdcard
()
,
CommonConstants
.
ERROR_MSG_PRFIX
+
"对应员工身份证"
+
infoVo
.
getEmpIdcard
()
+
"工伤数据已存在,请勿重复导入!"
,
i
,
random
));
return
true
;
}
}
if
(
CommonConstants
.
ONE_STRING
.
equals
(
type
))
{
flag
=
BigDecimalUtils
.
safeAdd
(
BigDecimalUtils
.
isNullToZero
(
payExists
.
getUnitMedicalMoney
())
,
BigDecimalUtils
.
isNullToZero
(
payExists
.
getPersonalMedicalMoney
())).
compareTo
(
BigDecimal
.
ZERO
)
==
0
;
if
(!
flag
)
{
logList
.
add
(
new
TPaymentInfoImportLog
(
null
,
infoVo
.
getEmpName
(),
infoVo
.
getEmpIdcard
()
,
CommonConstants
.
ERROR_MSG_PRFIX
+
"对应员工身份证"
+
infoVo
.
getEmpIdcard
()
+
"医疗数据已存在,请勿重复导入!"
,
i
,
random
));
return
true
;
}
}
return
false
;
}
/**
/**
* 验证部分办理失败的导入是否有超出部分的数据导入
* 验证部分办理失败的导入是否有超出部分的数据导入
*
*
...
...
yifu-social/yifu-social-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/social/util/ServiceUtil.java
View file @
f063f031
...
@@ -177,7 +177,6 @@ public class ServiceUtil {
...
@@ -177,7 +177,6 @@ public class ServiceUtil {
}
else
if
(
CommonConstants
.
ONE_STRING
.
equals
(
canOverpay
)){
}
else
if
(
CommonConstants
.
ONE_STRING
.
equals
(
canOverpay
)){
temp
=
socialStartDate
;
temp
=
socialStartDate
;
}
}
boolean
falg
=
isaBoolean
(
temp
,
now
);
return
(
null
!=
temp
&&
(
temp
.
getYear
()
<
now
.
getYear
()
||
isaBoolean
(
temp
,
now
)));
return
(
null
!=
temp
&&
(
temp
.
getYear
()
<
now
.
getYear
()
||
isaBoolean
(
temp
,
now
)));
}
}
private
static
boolean
isaBoolean
(
LocalDateTime
temp
,
LocalDateTime
now
)
{
private
static
boolean
isaBoolean
(
LocalDateTime
temp
,
LocalDateTime
now
)
{
...
...
yifu-social/yifu-social-biz/src/main/resources/mapper/TProvidentFundMapper.xml
View file @
f063f031
...
@@ -74,6 +74,8 @@
...
@@ -74,6 +74,8 @@
<result
property=
"createName"
column=
"CREATE_NAME"
/>
<result
property=
"createName"
column=
"CREATE_NAME"
/>
<result
property=
"updateTime"
column=
"UPDATE_TIME"
/>
<result
property=
"updateTime"
column=
"UPDATE_TIME"
/>
<result
property=
"payPolicy"
column=
"PAY_POLICY"
/>
<result
property=
"payPolicy"
column=
"PAY_POLICY"
/>
<result
property=
"lowerLimit"
column=
"LOWER_LIMIT"
/>
<result
property=
"upperLimit"
column=
"UPPER_LIMIT"
/>
</resultMap>
</resultMap>
<sql
id=
"Base_Column_List"
>
<sql
id=
"Base_Column_List"
>
a.ID,
a.ID,
...
@@ -125,7 +127,9 @@
...
@@ -125,7 +127,9 @@
a.UPDATE_BY,
a.UPDATE_BY,
a.CREATE_NAME,
a.CREATE_NAME,
a.UPDATE_TIME,
a.UPDATE_TIME,
a.PAY_POLICY
a.PAY_POLICY,
a.LOWER_LIMIT,
a.UPPER_LIMIT
</sql>
</sql>
<sql
id=
"tProvidentFund_where"
>
<sql
id=
"tProvidentFund_where"
>
<if
test=
"tProvidentFund != null"
>
<if
test=
"tProvidentFund != null"
>
...
...
yifu-social/yifu-social-biz/src/main/resources/mapper/TSocialInfoMapper.xml
View file @
f063f031
...
@@ -121,6 +121,8 @@
...
@@ -121,6 +121,8 @@
<result
property=
"createName"
column=
"CREATE_NAME"
/>
<result
property=
"createName"
column=
"CREATE_NAME"
/>
<result
property=
"updateTime"
column=
"UPDATE_TIME"
/>
<result
property=
"updateTime"
column=
"UPDATE_TIME"
/>
<result
property=
"payPolicy"
column=
"PAY_POLICY"
/>
<result
property=
"payPolicy"
column=
"PAY_POLICY"
/>
<result
property=
"lowerLimit"
column=
"LOWER_LIMIT"
/>
<result
property=
"upperLimit"
column=
"UPPER_LIMIT"
/>
</resultMap>
</resultMap>
<sql
id=
"Base_Column_List"
>
<sql
id=
"Base_Column_List"
>
a.ID,
a.ID,
...
@@ -221,7 +223,9 @@
...
@@ -221,7 +223,9 @@
a.UPDATE_BY,
a.UPDATE_BY,
a.CREATE_NAME,
a.CREATE_NAME,
a.UPDATE_TIME,
a.UPDATE_TIME,
a.PAY_POLICY
a.PAY_POLICY,
a.LOWER_LIMIT,
a.UPPER_LIMIT
</sql>
</sql>
<sql
id=
"tSocialInfo_where"
>
<sql
id=
"tSocialInfo_where"
>
<if
test=
"tSocialInfo != null"
>
<if
test=
"tSocialInfo != null"
>
...
...
yifu-upms/yifu-upms-biz/src/main/java/com/yifu.cloud.plus.v1/yifu/admin/service/impl/SysDeptServiceImpl.java
View file @
f063f031
...
@@ -26,13 +26,11 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
...
@@ -26,13 +26,11 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import
com.unboundid.ldap.sdk.SearchResultEntry
;
import
com.unboundid.ldap.sdk.SearchResultEntry
;
import
com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysDept
;
import
com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysDept
;
import
com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysDeptRelation
;
import
com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysDeptRelation
;
import
com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysUser
;
import
com.yifu.cloud.plus.v1.yifu.admin.mapper.SysDeptMapper
;
import
com.yifu.cloud.plus.v1.yifu.admin.mapper.SysDeptMapper
;
import
com.yifu.cloud.plus.v1.yifu.admin.mapper.SysUserMapper
;
import
com.yifu.cloud.plus.v1.yifu.admin.mapper.SysUserMapper
;
import
com.yifu.cloud.plus.v1.yifu.admin.service.SysDeptRelationService
;
import
com.yifu.cloud.plus.v1.yifu.admin.service.SysDeptRelationService
;
import
com.yifu.cloud.plus.v1.yifu.admin.service.SysDeptService
;
import
com.yifu.cloud.plus.v1.yifu.admin.service.SysDeptService
;
import
com.yifu.cloud.plus.v1.yifu.admin.service.SysUserService
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.Common
;
import
com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.R
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.R
;
import
com.yifu.cloud.plus.v1.yifu.common.ldap.util.LdapUtil
;
import
com.yifu.cloud.plus.v1.yifu.common.ldap.util.LdapUtil
;
import
com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils
;
import
com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils
;
...
@@ -44,7 +42,6 @@ import org.springframework.transaction.annotation.Transactional;
...
@@ -44,7 +42,6 @@ import org.springframework.transaction.annotation.Transactional;
import
java.util.*
;
import
java.util.*
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
import
java.util.stream.Stream
;
/**
/**
* <p>
* <p>
...
@@ -214,6 +211,9 @@ public class SysDeptServiceImpl extends ServiceImpl<SysDeptMapper, SysDept> impl
...
@@ -214,6 +211,9 @@ public class SysDeptServiceImpl extends ServiceImpl<SysDeptMapper, SysDept> impl
SysDept
insertSysDept
=
new
SysDept
();
SysDept
insertSysDept
=
new
SysDept
();
insertSysDept
.
setName
(
deptName
);
insertSysDept
.
setName
(
deptName
);
insertSysDept
.
setParentId
(
0L
);
insertSysDept
.
setParentId
(
0L
);
if
(
Common
.
isNotNull
(
entry
.
getAttributeValue
(
"x-ouid"
)))
{
insertSysDept
.
setDeptId
(
Long
.
valueOf
(
entry
.
getAttributeValue
(
"x-ouid"
)));
}
insertSysDept
.
setDeptDn
(
dn
);
insertSysDept
.
setDeptDn
(
dn
);
this
.
save
(
insertSysDept
);
this
.
save
(
insertSysDept
);
}
else
{
}
else
{
...
@@ -231,6 +231,9 @@ public class SysDeptServiceImpl extends ServiceImpl<SysDeptMapper, SysDept> impl
...
@@ -231,6 +231,9 @@ public class SysDeptServiceImpl extends ServiceImpl<SysDeptMapper, SysDept> impl
insertSysDept
.
setName
(
deptName
);
insertSysDept
.
setName
(
deptName
);
insertSysDept
.
setParentId
(
sysDept
.
getDeptId
());
insertSysDept
.
setParentId
(
sysDept
.
getDeptId
());
insertSysDept
.
setDeptDn
(
dn
);
insertSysDept
.
setDeptDn
(
dn
);
if
(
Common
.
isNotNull
(
entry
.
getAttributeValue
(
"x-ouid"
)))
{
insertSysDept
.
setDeptId
(
Long
.
valueOf
(
entry
.
getAttributeValue
(
"x-ouid"
)));
}
this
.
save
(
insertSysDept
);
this
.
save
(
insertSysDept
);
}
}
}
else
{
}
else
{
...
...
yifu-upms/yifu-upms-biz/src/main/java/com/yifu.cloud.plus.v1/yifu/admin/service/impl/SysUserServiceImpl.java
View file @
f063f031
...
@@ -424,7 +424,6 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
...
@@ -424,7 +424,6 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
if
(
null
!=
list
)
{
if
(
null
!=
list
)
{
List
<
SysUser
>
listUser
=
this
.
list
(
Wrappers
.<
SysUser
>
query
().
lambda
().
eq
(
SysUser:
:
getDelFlag
,
CommonConstants
.
STATUS_NORMAL
));
List
<
SysUser
>
listUser
=
this
.
list
(
Wrappers
.<
SysUser
>
query
().
lambda
().
eq
(
SysUser:
:
getDelFlag
,
CommonConstants
.
STATUS_NORMAL
));
List
<
String
>
list1
=
listUser
.
stream
().
map
(
SysUser:
:
getUsername
).
collect
(
Collectors
.
toList
());
List
<
String
>
list1
=
listUser
.
stream
().
map
(
SysUser:
:
getUsername
).
collect
(
Collectors
.
toList
());
Map
<
String
,
String
>
map
=
listUser
.
stream
().
collect
(
HashMap:
:
new
,
(
m
,
v
)
->
m
.
put
(
v
.
getUsername
(),
v
.
getUserId
()),
HashMap:
:
putAll
);
List
<
PersonVo
>
updateList
=
new
ArrayList
<>();
List
<
PersonVo
>
updateList
=
new
ArrayList
<>();
List
<
PersonVo
>
insertList
=
new
ArrayList
<>();
List
<
PersonVo
>
insertList
=
new
ArrayList
<>();
for
(
PersonVo
personVo
:
list
)
{
for
(
PersonVo
personVo
:
list
)
{
...
@@ -469,6 +468,9 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
...
@@ -469,6 +468,9 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
insertSysDept
.
setName
(
deptName
);
insertSysDept
.
setName
(
deptName
);
insertSysDept
.
setParentId
(
0L
);
insertSysDept
.
setParentId
(
0L
);
insertSysDept
.
setDeptDn
(
dn
);
insertSysDept
.
setDeptDn
(
dn
);
if
(
Common
.
isNotNull
(
entry
.
getAttributeValue
(
"x-ouid"
)))
{
insertSysDept
.
setDeptId
(
Long
.
valueOf
(
entry
.
getAttributeValue
(
"x-ouid"
)));
}
sysDeptMapper
.
insert
(
insertSysDept
);
sysDeptMapper
.
insert
(
insertSysDept
);
}
else
{
}
else
{
sysDept
.
setName
(
deptName
);
sysDept
.
setName
(
deptName
);
...
@@ -484,6 +486,9 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
...
@@ -484,6 +486,9 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
insertSysDept
.
setName
(
deptName
);
insertSysDept
.
setName
(
deptName
);
insertSysDept
.
setParentId
(
sysDept
.
getDeptId
());
insertSysDept
.
setParentId
(
sysDept
.
getDeptId
());
insertSysDept
.
setDeptDn
(
dn
);
insertSysDept
.
setDeptDn
(
dn
);
if
(
Common
.
isNotNull
(
entry
.
getAttributeValue
(
"x-ouid"
)))
{
insertSysDept
.
setDeptId
(
Long
.
valueOf
(
entry
.
getAttributeValue
(
"x-ouid"
)));
}
sysDeptMapper
.
insert
(
insertSysDept
);
sysDeptMapper
.
insert
(
insertSysDept
);
}
}
}
else
{
}
else
{
...
...
yifu-upms/yifu-upms-biz/src/main/resources/mapper/SysUserMapper.xml
View file @
f063f031
...
@@ -210,7 +210,7 @@
...
@@ -210,7 +210,7 @@
<insert
id=
"batchInsertUser"
parameterType=
"java.util.List"
>
<insert
id=
"batchInsertUser"
parameterType=
"java.util.List"
>
insert into sys_user
insert into sys_user
(user_id,username,phone,email,password,nickname,create_time)
(user_id,username,phone,email,password,nickname,
deptId,
create_time)
VALUES
VALUES
<foreach
collection=
"list"
item=
"item"
index=
"index"
separator=
","
>
<foreach
collection=
"list"
item=
"item"
index=
"index"
separator=
","
>
(
(
...
@@ -220,6 +220,7 @@
...
@@ -220,6 +220,7 @@
#{item.email,jdbcType=VARCHAR},
#{item.email,jdbcType=VARCHAR},
#{item.password,jdbcType=VARCHAR},
#{item.password,jdbcType=VARCHAR},
#{item.personName,jdbcType=VARCHAR},
#{item.personName,jdbcType=VARCHAR},
#{item.deptId,jdbcType=VARCHAR},
now()
now()
)
)
</foreach>
</foreach>
...
@@ -256,6 +257,13 @@
...
@@ -256,6 +257,13 @@
</if>
</if>
</foreach>
</foreach>
</trim>
</trim>
<trim
prefix=
"deptId =case"
suffix=
"end,"
>
<foreach
collection=
"list"
item=
"i"
index=
"index"
>
<if
test=
"i.deptId!=null"
>
when username=#{i.uid} then #{i.deptId}
</if>
</foreach>
</trim>
<trim
prefix=
"update_time =case"
suffix=
"end,"
>
<trim
prefix=
"update_time =case"
suffix=
"end,"
>
<foreach
collection=
"list"
item=
"i"
index=
"index"
>
<foreach
collection=
"list"
item=
"i"
index=
"index"
>
when username=#{i.uid} then now()
when username=#{i.uid} then now()
...
...
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