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
40856258
Commit
40856258
authored
Jul 25, 2022
by
hongguangwu
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/develop' into develop
parents
fcad5961
b08bd8c2
Show whitespace changes
Inline
Side-by-side
Showing
21 changed files
with
717 additions
and
144 deletions
+717
-144
EmpContractDispatchVo.java
...cloud/plus/v1/yifu/archives/vo/EmpContractDispatchVo.java
+3
-0
EmpProjectDispatchVo.java
.../cloud/plus/v1/yifu/archives/vo/EmpProjectDispatchVo.java
+8
-1
TEmployeeProjectService.java
...lus/v1/yifu/archives/service/TEmployeeProjectService.java
+3
-0
TEmpContractAlertServiceImpl.java
...u/archives/service/impl/TEmpContractAlertServiceImpl.java
+29
-5
TEmployeeInfoServiceImpl.java
.../yifu/archives/service/impl/TEmployeeInfoServiceImpl.java
+15
-13
TEmployeeProjectServiceImpl.java
...fu/archives/service/impl/TEmployeeProjectServiceImpl.java
+1
-0
CommonConstants.java
...ud.plus.v1/yifu/common/core/constant/CommonConstants.java
+5
-0
ExcelAttributeConstants.java
...v1/yifu/common/core/constant/ExcelAttributeConstants.java
+2
-0
ErrorCodes.java
....cloud.plus.v1/yifu/common/core/exception/ErrorCodes.java
+25
-3
ErrorMessage.java
...ifu/cloud/plus/v1/yifu/common/core/util/ErrorMessage.java
+1
-0
messages_zh_CN.properties
...on-core/src/main/resources/i18n/messages_zh_CN.properties
+13
-1
ArchivesDaprUtil.java
...cloud/plus/v1/yifu/common/dapr/util/ArchivesDaprUtil.java
+6
-9
HttpDaprUtil.java
...ifu/cloud/plus/v1/yifu/common/dapr/util/HttpDaprUtil.java
+0
-29
TDispatchInfo.java
.../yifu/cloud/plus/v1/yifu/social/entity/TDispatchInfo.java
+1
-0
TSocialFundInfo.java
...ifu/cloud/plus/v1/yifu/social/entity/TSocialFundInfo.java
+24
-0
TDispatchImportVo.java
.../yifu/cloud/plus/v1/yifu/social/vo/TDispatchImportVo.java
+8
-0
TDispatchReduceVo.java
.../yifu/cloud/plus/v1/yifu/social/vo/TDispatchReduceVo.java
+101
-0
TDispatchInfoController.java
...us/v1/yifu/social/controller/TDispatchInfoController.java
+16
-1
TDispatchInfoService.java
...oud/plus/v1/yifu/social/service/TDispatchInfoService.java
+4
-0
TDispatchInfoServiceImpl.java
...v1/yifu/social/service/impl/TDispatchInfoServiceImpl.java
+445
-80
TSocialFundInfoMapper.xml
...l-biz/src/main/resources/mapper/TSocialFundInfoMapper.xml
+7
-2
No files found.
yifu-archives/yifu-archives-api/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/vo/EmpContractDispatchVo.java
View file @
40856258
...
@@ -2,6 +2,7 @@ package com.yifu.cloud.plus.v1.yifu.archives.vo;
...
@@ -2,6 +2,7 @@ package com.yifu.cloud.plus.v1.yifu.archives.vo;
import
com.alibaba.excel.annotation.format.DateTimeFormat
;
import
com.alibaba.excel.annotation.format.DateTimeFormat
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute
;
import
com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute
;
import
com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttributeConstants
;
import
com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttributeConstants
;
import
io.swagger.v3.oas.annotations.media.Schema
;
import
io.swagger.v3.oas.annotations.media.Schema
;
...
@@ -123,6 +124,7 @@ public class EmpContractDispatchVo implements Serializable {
...
@@ -123,6 +124,7 @@ public class EmpContractDispatchVo implements Serializable {
*/
*/
@NotBlank
(
message
=
"起始日期不能为空"
)
@NotBlank
(
message
=
"起始日期不能为空"
)
@DateTimeFormat
(
"yyyy-MM-dd"
)
@DateTimeFormat
(
"yyyy-MM-dd"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd"
)
@ExcelAttribute
(
name
=
"起始日期"
,
isDate
=
true
)
@ExcelAttribute
(
name
=
"起始日期"
,
isDate
=
true
)
@Schema
(
description
=
"起始日期"
,
name
=
"contractStart"
)
@Schema
(
description
=
"起始日期"
,
name
=
"contractStart"
)
private
Date
contractStart
;
private
Date
contractStart
;
...
@@ -131,6 +133,7 @@ public class EmpContractDispatchVo implements Serializable {
...
@@ -131,6 +133,7 @@ public class EmpContractDispatchVo implements Serializable {
*/
*/
@ExcelAttribute
(
name
=
"截止日期"
,
needExport
=
true
,
isDate
=
true
)
@ExcelAttribute
(
name
=
"截止日期"
,
needExport
=
true
,
isDate
=
true
)
@DateTimeFormat
(
"yyyy-MM-dd"
)
@DateTimeFormat
(
"yyyy-MM-dd"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd"
)
@Schema
(
description
=
"截止日期"
,
name
=
"contractEnd"
)
@Schema
(
description
=
"截止日期"
,
name
=
"contractEnd"
)
private
Date
contractEnd
;
private
Date
contractEnd
;
...
...
yifu-archives/yifu-archives-api/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/vo/EmpProjectDispatchVo.java
View file @
40856258
...
@@ -35,7 +35,7 @@ public class EmpProjectDispatchVo implements Serializable {
...
@@ -35,7 +35,7 @@ public class EmpProjectDispatchVo implements Serializable {
*/
*/
@Schema
(
description
=
"员工编码"
)
@Schema
(
description
=
"员工编码"
)
@Size
(
max
=
20
,
message
=
"员工编码不可超过20位"
)
@Size
(
max
=
20
,
message
=
"员工编码不可超过20位"
)
private
String
emp
No
;
private
String
emp
Code
;
/**
/**
* 员工类型(字典值,0外包1派遣2代理)
* 员工类型(字典值,0外包1派遣2代理)
*/
*/
...
@@ -90,4 +90,11 @@ public class EmpProjectDispatchVo implements Serializable {
...
@@ -90,4 +90,11 @@ public class EmpProjectDispatchVo implements Serializable {
@ExcelProperty
(
value
=
"就职岗位"
)
@ExcelProperty
(
value
=
"就职岗位"
)
@ExcelAttribute
(
name
=
"就职岗位"
,
isNotEmpty
=
true
,
errorInfo
=
"就职岗位不能为空"
,
maxLength
=
20
)
@ExcelAttribute
(
name
=
"就职岗位"
,
isNotEmpty
=
true
,
errorInfo
=
"就职岗位不能为空"
,
maxLength
=
20
)
private
String
post
;
private
String
post
;
/**
* 员工编码
*/
@Schema
(
description
=
"员工编码"
)
@Size
(
max
=
20
,
message
=
"员工编码不可超过20位"
)
private
String
empNo
;
}
}
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/service/TEmployeeProjectService.java
View file @
40856258
...
@@ -187,4 +187,7 @@ public interface TEmployeeProjectService extends IService<TEmployeeProject> {
...
@@ -187,4 +187,7 @@ public interface TEmployeeProjectService extends IService<TEmployeeProject> {
TEmployeeProject
getByEmpIdAndDeptId
(
String
empId
,
String
deptId
);
TEmployeeProject
getByEmpIdAndDeptId
(
String
empId
,
String
deptId
);
R
<
Map
<
String
,
String
>>
getProjectByIdCard
(
String
empIdCard
);
R
<
Map
<
String
,
String
>>
getProjectByIdCard
(
String
empIdCard
);
//获取员工编码
String
getEmpNo
(
String
deptNo
);
}
}
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/service/impl/TEmpContractAlertServiceImpl.java
View file @
40856258
...
@@ -228,10 +228,12 @@ public class TEmpContractAlertServiceImpl extends ServiceImpl<TEmpContractAlertM
...
@@ -228,10 +228,12 @@ public class TEmpContractAlertServiceImpl extends ServiceImpl<TEmpContractAlertM
.
eq
(
TEmployeeContractInfo:
:
getWorkFlag
,
CommonConstants
.
ZERO_STRING
)
.
eq
(
TEmployeeContractInfo:
:
getWorkFlag
,
CommonConstants
.
ZERO_STRING
)
.
eq
(
TEmployeeContractInfo:
:
getDeleteFlag
,
CommonConstants
.
ZERO_STRING
));
.
eq
(
TEmployeeContractInfo:
:
getDeleteFlag
,
CommonConstants
.
ZERO_STRING
));
Map
<
String
,
TEmpContractAlert
>
alertMap
=
new
HashMap
<>();
Map
<
String
,
TEmpContractAlert
>
alertMap
=
new
HashMap
<>();
Map
<
String
,
TEmpContractAlert
>
existMap
=
new
HashMap
<>();
initExistMap
(
existMap
);
if
(
Common
.
isNotNull
(
alertList
)){
if
(
Common
.
isNotNull
(
alertList
)){
Date
nowDate
=
DateUtil
.
dateIncreaseByDay
(
new
Date
(),
CommonConstants
.
ONE_INT
);
Date
nowDate
=
DateUtil
.
dateIncreaseByDay
(
new
Date
(),
CommonConstants
.
ONE_INT
);
for
(
TEmployeeContractInfo
contract:
alertList
){
for
(
TEmployeeContractInfo
contract:
alertList
){
extracted
(
nowDate
,
contract
,
alertMap
);
extracted
(
nowDate
,
contract
,
alertMap
,
existMap
);
}
}
}
}
if
(
Common
.
isNotNull
(
notAccessList
)
&&
Common
.
isNotNull
(
alertMap
)){
if
(
Common
.
isNotNull
(
notAccessList
)
&&
Common
.
isNotNull
(
alertMap
)){
...
@@ -251,16 +253,29 @@ public class TEmpContractAlertServiceImpl extends ServiceImpl<TEmpContractAlertM
...
@@ -251,16 +253,29 @@ public class TEmpContractAlertServiceImpl extends ServiceImpl<TEmpContractAlertM
return
R
.
ok
();
return
R
.
ok
();
}
}
private
void
initExistMap
(
Map
<
String
,
TEmpContractAlert
>
existMap
)
{
List
<
TEmpContractAlert
>
exists
=
baseMapper
.
selectList
(
Wrappers
.<
TEmpContractAlert
>
query
());
if
(
Common
.
isNotNull
(
exists
)){
for
(
TEmpContractAlert
alert:
exists
){
existMap
.
put
(
alert
.
getEmpIdcard
()
+
CommonConstants
.
DOWN_LINE_STRING
+
alert
.
getProjectNo
()
+
CommonConstants
.
DOWN_LINE_STRING
+
alert
.
getContractId
(),
alert
);
}
}
}
private
void
extracted
(
Date
nowDate
,
private
void
extracted
(
Date
nowDate
,
TEmployeeContractInfo
contract
,
TEmployeeContractInfo
contract
,
Map
<
String
,
TEmpContractAlert
>
aler
tMap
)
{
Map
<
String
,
TEmpContractAlert
>
alertMap
,
Map
<
String
,
TEmpContractAlert
>
exis
tMap
)
{
TEmployeeInfo
employeeInfo
=
employeeInfoMapper
.
selectById
(
contract
.
getEmpId
());
TEmployeeInfo
employeeInfo
=
employeeInfoMapper
.
selectById
(
contract
.
getEmpId
());
if
(
Common
.
isNotNull
(
employeeInfo
)
if
(
Common
.
isNotNull
(
employeeInfo
)
&&
!
CommonConstants
.
ZERO_STRING
.
equals
(
employeeInfo
.
getEmpNatrue
())
&&
!
CommonConstants
.
ZERO_STRING
.
equals
(
employeeInfo
.
getEmpNatrue
())
&&
!
CommonConstants
.
ONE_STRING
.
equals
(
employeeInfo
.
getEmpNatrue
())){
&&
!
CommonConstants
.
ONE_STRING
.
equals
(
employeeInfo
.
getEmpNatrue
())){
return
;
return
;
}
}
TEmpContractAlert
alert
=
alertMap
.
get
(
contract
.
getEmpIdcard
());
TEmpContractAlert
alert
=
alertMap
.
get
(
contract
.
getEmpIdcard
()
+
CommonConstants
.
DOWN_LINE_STRING
+
contract
.
getDeptNo
()
);
// 存在多个审核通过的数据 用最新的审核通过的合同覆盖已有的
// 存在多个审核通过的数据 用最新的审核通过的合同覆盖已有的
if
(
Common
.
isNotNull
(
alert
)
if
(
Common
.
isNotNull
(
alert
)
&&
Common
.
isNotNull
(
alert
.
getContractEnd
())
&&
Common
.
isNotNull
(
alert
.
getContractEnd
())
...
@@ -268,7 +283,17 @@ public class TEmpContractAlertServiceImpl extends ServiceImpl<TEmpContractAlertM
...
@@ -268,7 +283,17 @@ public class TEmpContractAlertServiceImpl extends ServiceImpl<TEmpContractAlertM
&&
alert
.
getAuditTime
().
after
(
contract
.
getContractEnd
())){
&&
alert
.
getAuditTime
().
after
(
contract
.
getContractEnd
())){
return
;
return
;
}
}
TEmpContractAlert
exist
=
existMap
.
get
(
alert
.
getEmpIdcard
()
+
CommonConstants
.
DOWN_LINE_STRING
+
alert
.
getProjectNo
()
+
CommonConstants
.
DOWN_LINE_STRING
+
alert
.
getContractId
());
alert
=
new
TEmpContractAlert
();
alert
=
new
TEmpContractAlert
();
if
(
Common
.
isNotNull
(
exist
)
&&
Common
.
isNotNull
(
exist
.
getFirstAlertTime
())){
alert
.
setFirstAlertTime
(
exist
.
getFirstAlertTime
());
}
else
{
alert
.
setFirstAlertTime
(
new
Date
());
}
alert
.
setContractId
(
contract
.
getId
());
alert
.
setContractId
(
contract
.
getId
());
alert
.
setAlertPerson
(
contract
.
getCreateName
());
alert
.
setAlertPerson
(
contract
.
getCreateName
());
alert
.
setEmpName
(
contract
.
getEmpName
());
alert
.
setEmpName
(
contract
.
getEmpName
());
...
@@ -300,9 +325,8 @@ public class TEmpContractAlertServiceImpl extends ServiceImpl<TEmpContractAlertM
...
@@ -300,9 +325,8 @@ public class TEmpContractAlertServiceImpl extends ServiceImpl<TEmpContractAlertM
alert
.
setDaysDue
(
DateUtil
.
daysBetween
(
nowDate
,
alert
.
getContractEnd
()));
alert
.
setDaysDue
(
DateUtil
.
daysBetween
(
nowDate
,
alert
.
getContractEnd
()));
alert
.
setDueFlag
(
CommonConstants
.
ZERO_STRING
);
alert
.
setDueFlag
(
CommonConstants
.
ZERO_STRING
);
}
}
alert
.
setFirstAlertTime
(
DateUtil
.
dateIncreaseByMonth
(
alert
.
getContractEnd
(),
CommonConstants
.
THREE_INT_NEGATE
));
}
}
alert
.
setHandleStatus
(
CommonConstants
.
ZERO_STRING
);
alert
.
setHandleStatus
(
CommonConstants
.
ZERO_STRING
);
alertMap
.
put
(
alert
.
getEmpIdcard
(),
alert
);
alertMap
.
put
(
alert
.
getEmpIdcard
()
+
CommonConstants
.
DOWN_LINE_STRING
+
alert
.
getProjectNo
()
,
alert
);
}
}
}
}
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/service/impl/TEmployeeInfoServiceImpl.java
View file @
40856258
...
@@ -2079,14 +2079,14 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
...
@@ -2079,14 +2079,14 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
// 新增项目档案不需要返回ID
// 新增项目档案不需要返回ID
saveProject
(
empAddsMap
,
projectsMap
);
saveProject
(
empAddsMap
,
projectsMap
);
// 新增合同
// 新增合同
saveContract
(
empAdd
sMap
,
contractsMap
);
saveContract
(
project
sMap
,
contractsMap
);
addVo
.
setProjectsMap
(
projectsMap
);
addVo
.
setProjectsMap
(
projectsMap
);
addVo
.
setEmpAddsMap
(
empAddsMap
);
addVo
.
setEmpAddsMap
(
empAddsMap
);
addVo
.
setContractsMap
(
contractsMap
);
addVo
.
setContractsMap
(
contractsMap
);
return
addVo
;
return
addVo
;
}
}
private
void
saveContract
(
Map
<
String
,
Emp
AddDispatchVo
>
empAdd
sMap
,
Map
<
String
,
EmpContractDispatchVo
>
contractsMap
)
{
private
void
saveContract
(
Map
<
String
,
Emp
ProjectDispatchVo
>
project
sMap
,
Map
<
String
,
EmpContractDispatchVo
>
contractsMap
)
{
if
(
Common
.
isNotNull
(
contractsMap
))
{
if
(
Common
.
isNotNull
(
contractsMap
))
{
EmpContractDispatchVo
contractAdd
;
EmpContractDispatchVo
contractAdd
;
TEmployeeContractInfo
contract
;
TEmployeeContractInfo
contract
;
...
@@ -2096,19 +2096,19 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
...
@@ -2096,19 +2096,19 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
if
(
Common
.
isNotNull
(
contractAdd
))
{
if
(
Common
.
isNotNull
(
contractAdd
))
{
contract
=
new
TEmployeeContractInfo
();
contract
=
new
TEmployeeContractInfo
();
BeanUtil
.
copyProperties
(
contractAdd
,
contract
);
BeanUtil
.
copyProperties
(
contractAdd
,
contract
);
if
(
Common
.
isEmpty
(
contract
.
getEmpId
())
&&
Common
.
isNotNull
(
empAddsMap
))
{
if
(
Common
.
isEmpty
(
contract
.
getEmpId
())
&&
Common
.
isNotNull
(
projectsMap
))
{
EmpAddDispatchVo
emp
=
empAddsMap
.
get
(
contract
.
getEmpIdcard
());
EmpProjectDispatchVo
project
=
projectsMap
.
get
(
contract
.
getEmpIdcard
());
if
(
Common
.
isNotNull
(
emp
))
{
if
(
Common
.
isNotNull
(
project
))
{
contract
.
setEmpId
(
emp
.
getId
());
contract
.
setEmpId
(
project
.
getId
());
contract
.
setEmpNo
(
emp
.
getEmpCode
());
contract
.
setEmpNo
(
project
.
getEmpNo
());
}
}
}
contractMapper
.
insert
(
contract
);
contractMapper
.
insert
(
contract
);
contractAdd
.
setId
(
contract
.
getId
());
contractAdd
.
setId
(
contract
.
getId
());
contractsMap
.
put
(
contractAdd
.
getEmpIdcard
()
+
CommonConstants
.
DOWN_LINE_STRING
+
contractAdd
.
getDeptNo
(),
contractAdd
);
contractsMap
.
put
(
contractAdd
.
getEmpIdcard
()
+
CommonConstants
.
DOWN_LINE_STRING
+
contractAdd
.
getDeptNo
(),
contractAdd
);
}
}
}
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
log
.
error
(
contractAdd
.
getEmpIdcard
()
+
CommonConstants
.
COLON_STRING
+
"派单新增合同失败"
);
log
.
error
(
contractAdd
.
getEmpIdcard
()
+
CommonConstants
.
COLON_STRING
+
"派单新增合同失败"
,
e
);
}
}
}
}
}
}
...
@@ -2131,7 +2131,7 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
...
@@ -2131,7 +2131,7 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
empAddsMap
.
put
(
empAdd
.
getEmpIdcard
(),
empAdd
);
empAddsMap
.
put
(
empAdd
.
getEmpIdcard
(),
empAdd
);
}
}
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
log
.
error
(
empAdd
.
getEmpIdcard
()
+
CommonConstants
.
COLON_STRING
+
"派单新增档案失败"
);
log
.
error
(
empAdd
.
getEmpIdcard
()
+
CommonConstants
.
COLON_STRING
+
"派单新增档案失败"
,
e
);
}
}
}
}
}
}
...
@@ -2156,12 +2156,14 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
...
@@ -2156,12 +2156,14 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
project
.
setEmpId
(
emp
.
getId
());
project
.
setEmpId
(
emp
.
getId
());
}
}
}
}
project
.
setEmpNo
(
tEmployeeProjectService
.
getEmpNo
(
project
.
getDeptNo
()));
tEmployeeProjectService
.
save
(
project
);
tEmployeeProjectService
.
save
(
project
);
projectAdd
.
setId
(
project
.
getId
());
projectAdd
.
setId
(
project
.
getId
());
projectAdd
.
setEmpNo
(
project
.
getEmpNo
());
projectsMap
.
put
(
project
.
getEmpIdcard
()
+
CommonConstants
.
DOWN_LINE_STRING
+
project
.
getDeptNo
(),
projectAdd
);
projectsMap
.
put
(
project
.
getEmpIdcard
()
+
CommonConstants
.
DOWN_LINE_STRING
+
project
.
getDeptNo
(),
projectAdd
);
}
}
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
log
.
error
(
projectAdd
.
getEmpIdcard
()
+
CommonConstants
.
COLON_STRING
+
"派单新增项目档案失败"
);
log
.
error
(
projectAdd
.
getEmpIdcard
()
+
CommonConstants
.
COLON_STRING
+
"派单新增项目档案失败"
,
e
);
}
}
}
}
}
}
...
...
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/service/impl/TEmployeeProjectServiceImpl.java
View file @
40856258
...
@@ -1388,6 +1388,7 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
...
@@ -1388,6 +1388,7 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
}
}
//获取员工编码
//获取员工编码
@Override
public
String
getEmpNo
(
String
deptNo
)
{
public
String
getEmpNo
(
String
deptNo
)
{
String
str
=
""
;
String
str
=
""
;
String
EmpNo
=
baseMapper
.
findEmployeeMaxOnlyNoByDepId
(
deptNo
);
String
EmpNo
=
baseMapper
.
findEmployeeMaxOnlyNoByDepId
(
deptNo
);
...
...
yifu-common/yifu-common-core/src/main/java/com/yifu.cloud.plus.v1/yifu/common/core/constant/CommonConstants.java
View file @
40856258
...
@@ -375,6 +375,8 @@ public interface CommonConstants {
...
@@ -375,6 +375,8 @@ public interface CommonConstants {
public
static
final
int
SIXTEEN_INT
=
16
;
public
static
final
int
SIXTEEN_INT
=
16
;
public
static
final
String
FIFTEEN
=
"15"
;
public
static
final
String
FIFTEEN
=
"15"
;
public
static
final
String
NINETEEN
=
"19"
;
public
static
final
String
NINETEEN
=
"19"
;
public
static
final
String
NINE_STRING
=
"9"
;
String
EIGHT_STRING
=
"8"
;
//百分之一 1/100
//百分之一 1/100
public
static
final
BigDecimal
ONE_OF_PERCENT
=
new
BigDecimal
(
"0.01"
);
public
static
final
BigDecimal
ONE_OF_PERCENT
=
new
BigDecimal
(
"0.01"
);
...
@@ -382,4 +384,7 @@ public interface CommonConstants {
...
@@ -382,4 +384,7 @@ public interface CommonConstants {
// 1/2
// 1/2
public
static
final
BigDecimal
HALF_OF_ONE
=
new
BigDecimal
(
"0.5"
);
public
static
final
BigDecimal
HALF_OF_ONE
=
new
BigDecimal
(
"0.5"
);
public
static
final
BigDecimal
TWO_BIG
=
new
BigDecimal
(
"2"
);
public
static
final
BigDecimal
TWO_BIG
=
new
BigDecimal
(
"2"
);
String
SIX_STRING
=
"6"
;
String
SEVEN_STRING
=
"7"
;
}
}
yifu-common/yifu-common-core/src/main/java/com/yifu.cloud.plus.v1/yifu/common/core/constant/ExcelAttributeConstants.java
View file @
40856258
...
@@ -124,4 +124,6 @@ public class ExcelAttributeConstants {
...
@@ -124,4 +124,6 @@ public class ExcelAttributeConstants {
//区域字段组合
//区域字段组合
public
static
final
String
DEPARTID_PROVINCE_CITY_TOWN
=
"departId_province_city_town"
;
public
static
final
String
DEPARTID_PROVINCE_CITY_TOWN
=
"departId_province_city_town"
;
//派减离职原因
public
static
final
String
REDUCE_PROJECT_REASON
=
"reduce_project_reason"
;
}
}
yifu-common/yifu-common-core/src/main/java/com/yifu.cloud.plus.v1/yifu/common/core/exception/ErrorCodes.java
View file @
40856258
...
@@ -341,10 +341,8 @@ public interface ErrorCodes {
...
@@ -341,10 +341,8 @@ public interface ErrorCodes {
*/
*/
String
EMP_DISPATCH_FUND_NOT_EMPTY
=
"emp.dispatch.fund.not.empty"
;
String
EMP_DISPATCH_FUND_NOT_EMPTY
=
"emp.dispatch.fund.not.empty"
;
/**
/**
* 新增异常:
存在派增待审核|待办理|办理成功但未派减办理成功的
社保数据
* 新增异常:
已存在
社保数据
*/
*/
String
EMP_DISPATCH_SOCIAL_EXISTING
=
"emp.dispatch.social.existing"
;
String
EMP_DISPATCH_SOCIAL_EXISTING
=
"emp.dispatch.social.existing"
;
/**
/**
...
@@ -394,4 +392,28 @@ public interface ErrorCodes {
...
@@ -394,4 +392,28 @@ public interface ErrorCodes {
* 新增异常:派单新增项目档案失败,请重试
* 新增异常:派单新增项目档案失败,请重试
*/
*/
String
EMP_DISPATCH_ADD_PROJECT_ERROR
=
"emp.dispatch.add.project.error"
;
String
EMP_DISPATCH_ADD_PROJECT_ERROR
=
"emp.dispatch.add.project.error"
;
/**
* 新增异常:已存在公积金数据
*/
String
EMP_DISPATCH_FUND_EXISTING
=
"emp.dispatch.fund.existing"
;
/**
* 派减异常: 未找到社保及公积金信息
*/
String
EMP_DISPATCH_SOCIAL_FUND_NOT_EMPTY
=
"emp.dispatch.social.fund.not.empty"
;
/**
* 派减异常: 请选择社保停缴日期或公积金停缴日期
*/
String
EMP_DISPATCH_REDUCE_SOCIAL_FUND_NOT_EMPTY
=
"emp.dispatch.reduce.social.fund.not.empty"
;
/**
* 派减异常: 未找到办理成功的社保状态,或社保派减中,请确认后重试
*/
String
EMP_DISPATCH_REDUCE_SOCIAL_STATUS_ERROR
=
"emp.dispatch.reduce.social.status.error"
;
/**
* 派减异常: 未找到办理成功的公积金状态,或公积金派减中,请确认后重试
*/
String
EMP_DISPATCH_REDUCE_FUND_STATUS_ERROR
=
"emp.dispatch.reduce.fund.status.error"
;
/**
* 派减异常: 本次派增已存在对应身份证号的派减记录
*/
String
EMP_DISPATCH_REDUCE_EXISTS
=
"emp.dispatch.reduce.exists"
;
}
}
yifu-common/yifu-common-core/src/main/java/com/yifu/cloud/plus/v1/yifu/common/core/util/ErrorMessage.java
View file @
40856258
...
@@ -32,6 +32,7 @@ public class ErrorMessage implements Serializable {
...
@@ -32,6 +32,7 @@ public class ErrorMessage implements Serializable {
public
ErrorMessage
(
Integer
lineNum
,
String
message
)
{
public
ErrorMessage
(
Integer
lineNum
,
String
message
)
{
this
.
lineNum
=
lineNum
;
this
.
lineNum
=
lineNum
;
this
.
color
=
"red"
;
this
.
message
=
message
;
this
.
message
=
message
;
}
}
public
ErrorMessage
(
Integer
lineNum
,
String
message
,
String
color
)
{
public
ErrorMessage
(
Integer
lineNum
,
String
message
,
String
color
)
{
...
...
yifu-common/yifu-common-core/src/main/resources/i18n/messages_zh_CN.properties
View file @
40856258
...
@@ -115,7 +115,7 @@ emp.dispatch.social.not.empty=\u6D3E\u5355\u5458\u5DE5\u793E\u4FDD\u76F8\u5173\u
...
@@ -115,7 +115,7 @@ emp.dispatch.social.not.empty=\u6D3E\u5355\u5458\u5DE5\u793E\u4FDD\u76F8\u5173\u
emp.dispatch.fund.not.empty
=
\u
6D3E
\u5355\u5458\u
5DE5
\u
516C
\u
79EF
\u
91D1
\u
76F8
\u5173\u
4FE1
\u
606F
\u
4E0D
\u
53EF
\u
4E3A
\u
7A7A
emp.dispatch.fund.not.empty
=
\u
6D3E
\u5355\u5458\u
5DE5
\u
516C
\u
79EF
\u
91D1
\u
76F8
\u5173\u
4FE1
\u
606F
\u
4E0D
\u
53EF
\u
4E3A
\u
7A7A
emp.dispatch.social.existing
=
\u
65B0
\u
589E
\u
5F02
\u
5E38
\u
FF1A
\u
5
B58
\u5728\u
6D3E
\u
589E
\u
5F85
\u
5BA1
\u6838
|
\u
5F85
\u
529E
\u7406
|
\u
529E
\u7406\u6210\u
529F
\u
4F46
\u
672A
\u
6D3E
\u
51CF
\u
529E
\u7406\u6210\u
529F
\u7684
\u
793E
\u
4FDD
\u6570\u
636E
emp.dispatch.social.existing
=
\u
65B0
\u
589E
\u
5F02
\u
5E38
\u
FF1A
\u
5
DF2
\u
5B58
\u5728
\u
793E
\u
4FDD
\u6570\u
636E
emp.dispatch.social.injury.existing
=
\u
65B0
\u
589E
\u
5F02
\u
5E38
\u
FF1A
\u
5B58
\u5728\u
529E
\u7406\u6210\u
529F
\u
672A
\u
6D3E
\u
51CF
\u7684\u
5DE5
\u
4F24
\u
793E
\u
4FDD
\u6570\u
636E
emp.dispatch.social.injury.existing
=
\u
65B0
\u
589E
\u
5F02
\u
5E38
\u
FF1A
\u
5B58
\u5728\u
529E
\u7406\u6210\u
529F
\u
672A
\u
6D3E
\u
51CF
\u7684\u
5DE5
\u
4F24
\u
793E
\u
4FDD
\u6570\u
636E
...
@@ -139,6 +139,18 @@ emp.dispatch.add.contract.error=\u65B0\u589E\u5F02\u5E38\uFF1A\u6D3E\u5355\u65B0
...
@@ -139,6 +139,18 @@ emp.dispatch.add.contract.error=\u65B0\u589E\u5F02\u5E38\uFF1A\u6D3E\u5355\u65B0
emp.dispatch.add.project.error
=
\u
65B0
\u
589E
\u
5F02
\u
5E38
\u
FF1A
\u
6D3E
\u5355\u
65B0
\u
589E
\u9879\u
76EE
\u6863\u6848\u5931\u
8D25
\u
FF0C
\u
8BF7
\u
91CD
\u
8BD5
emp.dispatch.add.project.error
=
\u
65B0
\u
589E
\u
5F02
\u
5E38
\u
FF1A
\u
6D3E
\u5355\u
65B0
\u
589E
\u9879\u
76EE
\u6863\u6848\u5931\u
8D25
\u
FF0C
\u
8BF7
\u
91CD
\u
8BD5
emp.dispatch.fund.existing
=
\u
65B0
\u
589E
\u
5F02
\u
5E38
\u
FF1A
\u
5DF2
\u
5B58
\u5728\u
516C
\u
79EF
\u
91D1
\u6570\u
636E
emp.dispatch.social.fund.not.empty
=
\u
6D3E
\u
51CF
\u
5F02
\u
5E38
\u
FF1A
\u
672A
\u
627E
\u5230\u
793E
\u
4FDD
\u
53CA
\u
516C
\u
79EF
\u
91D1
\u
4FE1
\u
606F
emp.dispatch.reduce.social.fund.not.empty
=
\u
6D3E
\u
51CF
\u
5F02
\u
5E38
\u
FF1A
\u
8BF7
\u9009\u
62E9
\u
793E
\u
4FDD
\u
505C
\u
7F34
\u
65E5
\u
671F
\u6216\u
516C
\u
79EF
\u
91D1
\u
505C
\u
7F34
\u
65E5
\u
671F
emp.dispatch.reduce.social.status.error
=
\u
6D3E
\u
51CF
\u
5F02
\u
5E38
\u
FF1A
\u
672A
\u
627E
\u5230\u
529E
\u7406\u6210\u
529F
\u7684\u
793E
\u
4FDD
\u
72B6
\u6001\u
FF0C
\u6216\u
793E
\u
4FDD
\u
6D3E
\u
51CF
\u
4E2D
\u
FF0C
\u
8BF7
\u
786E
\u
8BA4
\u
540E
\u
91CD
\u
8BD5
emp.dispatch.reduce.fund.status.error
=
\u
6D3E
\u
51CF
\u
5F02
\u
5E38
\u
FF1A
\u
672A
\u
627E
\u5230\u
529E
\u7406\u6210\u
529F
\u7684\u
516C
\u
79EF
\u
91D1
\u
72B6
\u6001\u
FF0C
\u6216\u
516C
\u
79EF
\u
91D1
\u
6D3E
\u
51CF
\u
4E2D
\u
FF0C
\u
8BF7
\u
786E
\u
8BA4
\u
540E
\u
91CD
\u
8BD5
emp.dispatch.reduce.exists
=
\u
6D3E
\u
51CF
\u
5F02
\u
5E38
\u
FF1A
\u
672C
\u
6B21
\u
6D3E
\u
589E
\u
5DF2
\u
5B58
\u5728\u
5BF9
\u
5E94
\u
8EAB
\u
4EFD
\u
8BC1
\u
53F7
\u7684\u
6D3E
\u
51CF
\u
8BB0
\u
5F55
...
...
yifu-common/yifu-common-dapr/src/main/java/com/yifu/cloud/plus/v1/yifu/common/dapr/util/ArchivesDaprUtil.java
View file @
40856258
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
common
.
dapr
.
util
;
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
common
.
dapr
.
util
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.
JSONObject
;
import
com.alibaba.fastjson.
TypeReference
;
import
com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeInfo
;
import
com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeInfo
;
import
com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeProject
;
import
com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeProject
;
import
com.yifu.cloud.plus.v1.yifu.archives.vo.*
;
import
com.yifu.cloud.plus.v1.yifu.archives.vo.*
;
...
@@ -10,9 +10,11 @@ import com.yifu.cloud.plus.v1.yifu.common.core.util.Common;
...
@@ -10,9 +10,11 @@ import com.yifu.cloud.plus.v1.yifu.common.core.util.Common;
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.dapr.config.DaprArchivesProperties
;
import
com.yifu.cloud.plus.v1.yifu.common.dapr.config.DaprArchivesProperties
;
import
lombok.extern.log4j.Log4j2
;
import
lombok.extern.log4j.Log4j2
;
import
org.apache.poi.ss.formula.functions.T
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.boot.context.properties.EnableConfigurationProperties
;
import
org.springframework.boot.context.properties.EnableConfigurationProperties
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
...
@@ -48,18 +50,13 @@ public class ArchivesDaprUtil {
...
@@ -48,18 +50,13 @@ public class ArchivesDaprUtil {
* @Param
* @Param
* @return
* @return
**/
**/
public
R
<
Map
>
getDispatchEmpVo
(
DispatchCheckVo
checkVo
){
public
R
<
Map
<
String
,
DispatchEmpVo
>
>
getDispatchEmpVo
(
DispatchCheckVo
checkVo
){
R
<
Map
>
res
=
HttpDaprUtil
.
invokeMethodPost
(
daprArchivesProperties
.
getAppUrl
(),
daprArchivesProperties
.
getAppId
(),
"/temployeeinfo/getDispatchEmpVo"
,
JSON
.
toJSONString
(
checkVo
),
Map
.
class
,
SecurityConstants
.
FROM_IN
);
R
<
Map
>
res
=
HttpDaprUtil
.
invokeMethodPost
(
daprArchivesProperties
.
getAppUrl
(),
daprArchivesProperties
.
getAppId
(),
"/temployeeinfo/getDispatchEmpVo"
,
JSON
.
toJSONString
(
checkVo
),
Map
.
class
,
SecurityConstants
.
FROM_IN
);
if
(
Common
.
isEmpty
(
res
)){
if
(
Common
.
isEmpty
(
res
)){
return
R
.
failed
(
"获取档案派单信息失败!"
);
return
R
.
failed
(
"获取档案派单信息失败!"
);
}
}
R
<
String
>
test
=
HttpDaprUtil
.
invokeMethodObject
(
daprArchivesProperties
.
getAppUrl
(),
daprArchivesProperties
.
getAppId
(),
"/temployeeinfo/getDispatchEmpVo"
,
JSON
.
toJSONString
(
checkVo
),
String
.
class
,
SecurityConstants
.
FROM_IN
);
Map
<
String
,
DispatchEmpVo
>
map
=
JSON
.
parseObject
(
JSON
.
toJSONString
(
res
.
getData
()),
new
TypeReference
<
HashMap
<
String
,
DispatchEmpVo
>>(){});
//Map<String,DispatchEmpVo> map = JSON.parseArray()
return
R
.
ok
(
map
);
if
(
Common
.
isEmpty
(
res
)){
return
R
.
failed
(
"获取档案派单信息失败!"
);
}
return
res
;
}
}
/**
/**
* @Author fxj
* @Author fxj
...
...
yifu-common/yifu-common-dapr/src/main/java/com/yifu/cloud/plus/v1/yifu/common/dapr/util/HttpDaprUtil.java
View file @
40856258
...
@@ -120,35 +120,6 @@ public class HttpDaprUtil {
...
@@ -120,35 +120,6 @@ public class HttpDaprUtil {
return
R
.
failed
(
"获取信息失败!"
);
return
R
.
failed
(
"获取信息失败!"
);
}
}
}
public
static
<
T
>
R
<
T
>
invokeMethodObject
(
String
appUrl
,
String
appId
,
String
method
,
Object
param
,
Class
cs
,
@RequestHeader
(
SecurityConstants
.
FROM
)
String
from
){
// 实例化 RestTemplate
initResTemplate
();
// 初始化请求URL
initUrl
(
appUrl
,
appId
,
method
,
""
);
ResponseEntity
<
String
>
res
;
HttpHeaders
headers
=
new
HttpHeaders
();
headers
.
add
(
SecurityConstants
.
FROM
,
from
);
headers
.
setContentType
(
MediaType
.
APPLICATION_JSON
);
headers
.
add
(
"Authorization"
,
null
);
HttpEntity
<
String
>
entity
=
new
HttpEntity
(
param
,
headers
);
try
{
res
=
restTemplate
.
postForEntity
(
URI
.
create
(
stringBuffer
.
toString
()),
entity
,
cs
);
}
catch
(
Exception
e
)
{
log
.
error
(
"日志保存异常:"
,
e
);
return
R
.
failed
(
"获取信息失败:"
+
e
.
getMessage
());
}
if
(
null
!=
res
&&
CommonConstants
.
SUCCESS
==
res
.
getStatusCodeValue
())
{
return
(
R
<
T
>)
R
.
ok
(
res
.
getBody
());
}
else
{
return
R
.
failed
(
"获取信息失败!"
);
}
}
}
private
static
void
initResTemplate
()
{
private
static
void
initResTemplate
()
{
if
(
null
==
restTemplate
)
{
if
(
null
==
restTemplate
)
{
...
...
yifu-social/yifu-social-api/src/main/java/com/yifu/cloud/plus/v1/yifu/social/entity/TDispatchInfo.java
View file @
40856258
...
@@ -512,4 +512,5 @@ public class TDispatchInfo extends BaseEntity {
...
@@ -512,4 +512,5 @@ public class TDispatchInfo extends BaseEntity {
}
}
yifu-social/yifu-social-api/src/main/java/com/yifu/cloud/plus/v1/yifu/social/entity/TSocialFundInfo.java
View file @
40856258
...
@@ -961,4 +961,28 @@ public class TSocialFundInfo extends BaseEntity {
...
@@ -961,4 +961,28 @@ public class TSocialFundInfo extends BaseEntity {
@ExcelAttribute
(
name
=
"个人公积金金额"
)
@ExcelAttribute
(
name
=
"个人公积金金额"
)
@ExcelProperty
(
"个人公积金金额"
)
@ExcelProperty
(
"个人公积金金额"
)
private
BigDecimal
personalFundSum
;
private
BigDecimal
personalFundSum
;
/**
* 社保状态:派增(0待审核、1待办理、2办理中 3办理成功、4部分办理失败 5 办理失败)、派减(6待审核 7待办理 8办理成功 9 办理失败)
*/
@ExcelAttribute
(
name
=
"社保状态"
,
maxLength
=
1
)
@Schema
(
description
=
"社保状态:派增(0待审核、1待办理、2办理中 3办理成功、4部分办理失败 5 办理失败)、派减(6待审核 7待办理 8办理成功 9 办理失败)"
)
@ExcelProperty
(
"社保派增状态"
)
private
String
socialStatus
;
/**
* 公积金状态:派增(0待审核、1待办理、3办理成功、4办理失败)、派减(5待审核 6待办理 7 办理成功 8 办理失败)
*/
@Length
(
max
=
1
,
message
=
"公积金状态 不能超过1个字符"
)
@ExcelAttribute
(
name
=
"公积金状态"
,
maxLength
=
1
)
@Schema
(
description
=
"公积金状态:派增(0待审核、1待办理、3办理成功、4办理失败)、派减(5待审核 6待办理 7 办理成功 8 办理失败)"
)
@ExcelProperty
(
"公积金状态"
)
private
String
fundStatus
;
/**
* 派单ID (实时更新)
*/
@ExcelAttribute
(
name
=
"派单ID"
,
maxLength
=
32
)
@Schema
(
description
=
"派单ID"
)
@ExcelProperty
(
"派单ID"
)
private
String
dispatchId
;
}
}
yifu-social/yifu-social-api/src/main/java/com/yifu/cloud/plus/v1/yifu/social/vo/TDispatchImportVo.java
View file @
40856258
...
@@ -437,4 +437,12 @@ public class TDispatchImportVo extends RowIndex implements Serializable {
...
@@ -437,4 +437,12 @@ public class TDispatchImportVo extends RowIndex implements Serializable {
@ExcelIgnore
@ExcelIgnore
private
String
customerCode
;
private
String
customerCode
;
/**
* 派单ID (实时更新)
*/
@ExcelIgnore
@Schema
(
description
=
"派单ID"
)
@ExcelProperty
(
"派单ID"
)
private
String
dispatchId
;
}
}
yifu-social/yifu-social-api/src/main/java/com/yifu/cloud/plus/v1/yifu/social/vo/TDispatchReduceVo.java
0 → 100644
View file @
40856258
/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the yifu4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
social
.
vo
;
import
com.alibaba.excel.annotation.ExcelIgnore
;
import
com.alibaba.excel.annotation.ExcelProperty
;
import
com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute
;
import
com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttributeConstants
;
import
com.yifu.cloud.plus.v1.yifu.common.core.vo.RowIndex
;
import
io.swagger.v3.oas.annotations.media.Schema
;
import
lombok.Data
;
import
org.hibernate.validator.constraints.Length
;
import
javax.validation.constraints.NotBlank
;
import
javax.validation.constraints.NotNull
;
import
java.io.Serializable
;
import
java.math.BigDecimal
;
import
java.util.Date
;
/**
* 派单信息记录表-批量派减
*
* @author fxj
* @date 2022-07-15 11:38:05
*/
@Data
public
class
TDispatchReduceVo
extends
RowIndex
implements
Serializable
{
/**
* 员工姓名
*/
@Length
(
max
=
50
,
message
=
"员工姓名 不能超过50 个字符"
)
@ExcelAttribute
(
name
=
"员工姓名"
,
maxLength
=
50
,
isNotEmpty
=
true
)
@Schema
(
description
=
"员工姓名"
)
@ExcelProperty
(
"员工姓名"
)
private
String
empName
;
/**
* 身份证号
*/
@Length
(
max
=
20
,
message
=
"身份证号 不能超过20 个字符"
)
@ExcelAttribute
(
name
=
"身份证号"
,
maxLength
=
20
,
isNotEmpty
=
true
)
@Schema
(
description
=
"身份证号"
)
@ExcelProperty
(
"身份证号"
)
private
String
empIdcard
;
/**
* 社保停缴日期
*/
@ExcelAttribute
(
name
=
"社保停缴日期"
,
isDate
=
true
)
@Schema
(
description
=
"社保停缴日期:购买社保时必填"
)
@ExcelProperty
(
"社保停缴日期"
)
private
Date
socialReduceDate
;
/**
* 公积金停缴日期
*/
@ExcelAttribute
(
name
=
"公积金停缴日期"
,
isDate
=
true
)
@Schema
(
description
=
"公积金停缴日期"
)
@ExcelProperty
(
"公积金停缴日期"
)
private
Date
fundReduceDate
;
/**
* 离职日期
*/
@ExcelAttribute
(
name
=
"离职日期"
,
isDate
=
true
)
@Schema
(
description
=
"离职日期"
)
@ExcelProperty
(
"离职日期"
)
private
Date
leaveDate
;
/**
* 减少原因
*/
@ExcelAttribute
(
name
=
"减少原因"
,
isNotEmpty
=
true
,
isDataId
=
true
,
dataType
=
ExcelAttributeConstants
.
REDUCE_PROJECT_REASON
)
@Schema
(
description
=
"减少原因"
)
@ExcelProperty
(
"减少原因"
)
private
String
reasonType
;
/**
* 委托备注
*/
@ExcelAttribute
(
name
=
"委托备注"
)
@Schema
(
description
=
"委托备注"
)
@ExcelProperty
(
"委托备注"
)
private
String
trustRemark
;
}
yifu-social/yifu-social-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/social/controller/TDispatchInfoController.java
View file @
40856258
...
@@ -125,7 +125,7 @@ public class TDispatchInfoController {
...
@@ -125,7 +125,7 @@ public class TDispatchInfoController {
@DeleteMapping
(
"/{id}"
)
@DeleteMapping
(
"/{id}"
)
@PreAuthorize
(
"@pms.hasPermission('demo_tdispatchinfo_del')"
)
@PreAuthorize
(
"@pms.hasPermission('demo_tdispatchinfo_del')"
)
public
R
<
Boolean
>
removeById
(
@PathVariable
String
id
)
{
public
R
<
Boolean
>
removeById
(
@PathVariable
String
id
)
{
return
R
.
ok
(
tDispatchInfoService
.
removeById
(
id
)
);
return
tDispatchInfoService
.
removeByIdDiy
(
id
);
}
}
/**
/**
...
@@ -154,4 +154,19 @@ public class TDispatchInfoController {
...
@@ -154,4 +154,19 @@ public class TDispatchInfoController {
public
void
export
(
HttpServletResponse
response
,
@RequestBody
TDispatchInfoSearchVo
searchVo
)
{
public
void
export
(
HttpServletResponse
response
,
@RequestBody
TDispatchInfoSearchVo
searchVo
)
{
tDispatchInfoService
.
listExport
(
response
,
searchVo
);
tDispatchInfoService
.
listExport
(
response
,
searchVo
);
}
}
/**
* 派单信息记录表 批量导入-派减
*
* @author fxj
* @date 2022-07-15 11:38:05
**/
@SneakyThrows
@Operation
(
description
=
"派单信息记录表 批量导入-派减 hasPermission('demo_tdispatchinfo-batch-reduce')"
)
@SysLog
(
"派单信息记录表 批量导入-派减"
)
@PostMapping
(
"/importListReduce"
)
//@PreAuthorize("@pms.hasPermission('demo_tdispatchinfo-batch-reduce')")
public
R
<
List
<
ErrorMessage
>>
importListReduce
(
@RequestBody
MultipartFile
file
){
return
tDispatchInfoService
.
importReduceDiy
(
file
.
getInputStream
());
}
}
}
yifu-social/yifu-social-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/social/service/TDispatchInfoService.java
View file @
40856258
...
@@ -46,4 +46,8 @@ public interface TDispatchInfoService extends IService<TDispatchInfo> {
...
@@ -46,4 +46,8 @@ public interface TDispatchInfoService extends IService<TDispatchInfo> {
void
listExport
(
HttpServletResponse
response
,
TDispatchInfoSearchVo
searchVo
);
void
listExport
(
HttpServletResponse
response
,
TDispatchInfoSearchVo
searchVo
);
List
<
TDispatchInfo
>
noPageDiy
(
TDispatchInfoSearchVo
searchVo
);
List
<
TDispatchInfo
>
noPageDiy
(
TDispatchInfoSearchVo
searchVo
);
R
<
List
<
ErrorMessage
>>
importReduceDiy
(
InputStream
inputStream
);
R
<
Boolean
>
removeByIdDiy
(
String
id
);
}
}
yifu-social/yifu-social-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/social/service/impl/TDispatchInfoServiceImpl.java
View file @
40856258
...
@@ -16,7 +16,6 @@
...
@@ -16,7 +16,6 @@
*/
*/
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
social
.
service
.
impl
;
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
social
.
service
.
impl
;
import
cn.hutool.core.bean.BeanUtil
;
import
cn.hutool.core.collection.CollUtil
;
import
cn.hutool.core.collection.CollUtil
;
import
cn.hutool.core.util.ArrayUtil
;
import
cn.hutool.core.util.ArrayUtil
;
import
com.alibaba.excel.EasyExcel
;
import
com.alibaba.excel.EasyExcel
;
...
@@ -44,6 +43,7 @@ import com.yifu.cloud.plus.v1.yifu.social.mapper.*;
...
@@ -44,6 +43,7 @@ import com.yifu.cloud.plus.v1.yifu.social.mapper.*;
import
com.yifu.cloud.plus.v1.yifu.social.service.TDispatchInfoService
;
import
com.yifu.cloud.plus.v1.yifu.social.service.TDispatchInfoService
;
import
com.yifu.cloud.plus.v1.yifu.social.vo.TDispatchImportVo
;
import
com.yifu.cloud.plus.v1.yifu.social.vo.TDispatchImportVo
;
import
com.yifu.cloud.plus.v1.yifu.social.vo.TDispatchInfoSearchVo
;
import
com.yifu.cloud.plus.v1.yifu.social.vo.TDispatchInfoSearchVo
;
import
com.yifu.cloud.plus.v1.yifu.social.vo.TDispatchReduceVo
;
import
io.seata.spring.annotation.GlobalTransactional
;
import
io.seata.spring.annotation.GlobalTransactional
;
import
lombok.RequiredArgsConstructor
;
import
lombok.RequiredArgsConstructor
;
import
lombok.extern.log4j.Log4j2
;
import
lombok.extern.log4j.Log4j2
;
...
@@ -308,7 +308,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
...
@@ -308,7 +308,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
socialFund
=
getSocialFund
(
socialFundMap
,
excel
);
socialFund
=
getSocialFund
(
socialFundMap
,
excel
);
setInfoVo
=
getSetInfoVo
(
projectVoMap
,
excel
);
setInfoVo
=
getSetInfoVo
(
projectVoMap
,
excel
);
// 数据合法情况
// 数据合法情况
if
(
validImport
(
errorMessageList
,
excel
,
setInfoVo
))
{
if
(
validImport
(
errorMessageList
,
excel
,
setInfoVo
,
socialFundMap
))
{
excelVOTemp
.
put
(
excel
.
getEmpIdcard
(),
excel
.
getEmpIdcard
());
excelVOTemp
.
put
(
excel
.
getEmpIdcard
(),
excel
.
getEmpIdcard
());
continue
;
continue
;
}
}
...
@@ -337,9 +337,9 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
...
@@ -337,9 +337,9 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
// 初始化新增信息:档案、项目档案、员工合同
// 初始化新增信息:档案、项目档案、员工合同
initAddInfo
(
empAddsMap
,
contractsMap
,
projectsMap
,
empVo
,
excel
);
initAddInfo
(
empAddsMap
,
contractsMap
,
projectsMap
,
empVo
,
excel
);
// 新增社保
// 新增社保
initSocialAddInfo
(
socialsMap
,
empVo
,
socialSet
,
excel
);
initSocialAddInfo
(
socialsMap
,
empVo
,
socialSet
,
excel
,
socialFundMap
);
// 新增公积金
// 新增公积金
if
(
initFundAddInfo
(
errorMessageList
,
fundsMap
,
empVo
,
fundSet
,
excel
)){
if
(
initFundAddInfo
(
errorMessageList
,
fundsMap
,
empVo
,
fundSet
,
excel
,
socialFundMap
)){
excelVOTemp
.
put
(
excel
.
getEmpIdcard
(),
excel
.
getEmpIdcard
());
excelVOTemp
.
put
(
excel
.
getEmpIdcard
(),
excel
.
getEmpIdcard
());
continue
;
continue
;
}
}
...
@@ -395,7 +395,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
...
@@ -395,7 +395,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
TDispatchImportVo
excel
;
TDispatchImportVo
excel
;
DispatchEmpVo
empVo
;
DispatchEmpVo
empVo
;
EmpContractDispatchVo
contract
;
EmpContractDispatchVo
contract
;
EmpProjectDispatchVo
project
;
EmpProjectDispatchVo
project
=
null
;
EmpAddDispatchVo
emp
=
null
;
EmpAddDispatchVo
emp
=
null
;
TSocialInfo
social
=
null
;
TSocialInfo
social
=
null
;
TProvidentFund
fund
=
null
;
TProvidentFund
fund
=
null
;
...
@@ -451,23 +451,34 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
...
@@ -451,23 +451,34 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
// 插入派单信息
// 插入派单信息
if
(
Common
.
isNotNull
(
dispatchMap
)){
if
(
Common
.
isNotNull
(
dispatchMap
)){
dispatch
=
dispatchMap
.
get
(
excel
.
getEmpIdcard
());
dispatch
=
dispatchMap
.
get
(
excel
.
getEmpIdcard
());
if
(
Common
.
isNotNull
(
dispatch
)){
if
(
Common
.
isNotNull
(
social
)){
dispatch
.
setSocialId
(
social
.
getId
());
}
if
(
Common
.
isNotNull
(
fund
)){
dispatch
.
setFundId
(
fund
.
getId
());
}
}
insertDispatch
(
emp
,
dispatch
);
insertDispatch
(
emp
,
dispatch
);
}
}
// 插入或更新社保公积金查询信息 大病在封装社保的时候已经算了 大病技术和金额了
// 插入或更新社保公积金查询信息 大病在封装社保的时候已经算了 大病技术和金额了
if
(
Common
.
isNotNull
(
socialFundAddMap
)){
if
(
Common
.
isNotNull
(
socialFundAddMap
)){
socialFund
=
socialFundAddMap
.
get
(
excel
.
getEmpIdcard
());
socialFund
=
socialFundAddMap
.
get
(
excel
.
getEmpIdcard
());
initSocialFundAndInsert
(
emp
,
social
,
fund
,
socialFund
);
if
(
Common
.
isNotNull
(
socialFund
)
&&
Common
.
isNotNull
(
dispatch
)){
socialFund
.
setDispatchId
(
dispatch
.
getId
());
}
initSocialFundAndInsert
(
emp
,
social
,
fund
,
socialFund
,
project
);
}
}
}
catch
(
Exception
e
){
}
catch
(
Exception
e
){
log
.
error
(
"派单新增异常:"
,
e
);
log
.
error
(
"派单新增异常:"
,
e
);
errorMessageList
.
add
(
new
ErrorMessage
(
excel
.
getRowIndex
(),
"派单新增异常:"
+
e
.
getMessage
()));
errorMessageList
.
add
(
new
ErrorMessage
(
excel
.
getRowIndex
(),
"派单新增异常:"
+
e
.
getMessage
()));
continue
;
continue
;
}
}
errorMessageList
.
add
(
new
ErrorMessage
(
excel
.
getRowIndex
(),
CommonConstants
.
SAVE_SUCCESS
));
errorMessageList
.
add
(
new
ErrorMessage
(
excel
.
getRowIndex
(),
CommonConstants
.
SAVE_SUCCESS
,
CommonConstants
.
GREEN
));
// 清理map list 等数据
// 清理map list 等数据
empAddsMap
.
clear
(
);
Common
.
clear
(
empAddsMap
);
contractsMap
.
clear
(
);
Common
.
clear
(
contractsMap
);
projectsMap
.
clear
(
);
Common
.
clear
(
projectsMap
);
}
}
}
}
...
@@ -477,37 +488,52 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
...
@@ -477,37 +488,52 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
}
}
private
void
insertSocial
(
EmpAddDispatchVo
emp
,
TSocialInfo
social
)
{
private
void
insertSocial
(
EmpAddDispatchVo
emp
,
TSocialInfo
social
)
{
if
(
Common
.
isNotNull
(
emp
)
&&
Common
.
isNotNull
(
social
)){
if
(
Common
.
isNotNull
(
social
)){
if
(
Common
.
isNotNull
(
emp
)){
social
.
setEmpNo
(
emp
.
getEmpCode
());
social
.
setEmpNo
(
emp
.
getEmpCode
());
social
.
setEmpId
(
emp
.
getEmpIdcard
());
social
.
setEmpId
(
emp
.
getId
());
}
socialMapper
.
insert
(
social
);
socialMapper
.
insert
(
social
);
}
}
}
}
private
void
insertFund
(
EmpAddDispatchVo
emp
,
TProvidentFund
fund
)
{
private
void
insertFund
(
EmpAddDispatchVo
emp
,
TProvidentFund
fund
)
{
if
(
Common
.
isNotNull
(
emp
)
&&
Common
.
isNotNull
(
fund
)){
if
(
Common
.
isNotNull
(
fund
)){
if
(
Common
.
isNotNull
(
emp
)){
fund
.
setEmpNo
(
emp
.
getEmpCode
());
fund
.
setEmpNo
(
emp
.
getEmpCode
());
fund
.
setEmpId
(
emp
.
getId
());
fund
.
setEmpId
(
emp
.
getId
());
}
fundMapper
.
insert
(
fund
);
fundMapper
.
insert
(
fund
);
}
}
}
}
private
void
insertDispatch
(
EmpAddDispatchVo
emp
,
TDispatchInfo
dispatch
)
{
private
void
insertDispatch
(
EmpAddDispatchVo
emp
,
TDispatchInfo
dispatch
)
{
if
(
Common
.
isNotNull
(
emp
)
&&
Common
.
isNotNull
(
dispatch
)){
if
(
Common
.
isNotNull
(
dispatch
)){
if
(
Common
.
isNotNull
(
emp
)){
dispatch
.
setEmpNo
(
emp
.
getEmpCode
());
dispatch
.
setEmpNo
(
emp
.
getEmpCode
());
dispatch
.
setEmpId
(
emp
.
getId
());
dispatch
.
setEmpId
(
emp
.
getId
());
dispatch
.
setSettleDomainCode
(
emp
.
getDeptNo
());
dispatch
.
setSettleDomainCode
(
emp
.
getDeptNo
());
dispatch
.
setSettleDomain
(
emp
.
getDeptId
());
dispatch
.
setSettleDomain
(
emp
.
getDeptId
());
dispatch
.
setSettleDomainName
(
emp
.
getDeptName
());
dispatch
.
setSettleDomainName
(
emp
.
getDeptName
());
}
baseMapper
.
insert
(
dispatch
);
baseMapper
.
insert
(
dispatch
);
}
}
}
}
private
void
initSocialFundAndInsert
(
EmpAddDispatchVo
emp
,
TSocialInfo
social
,
TProvidentFund
fund
,
TSocialFundInfo
socialFund
)
{
private
void
initSocialFundAndInsert
(
EmpAddDispatchVo
emp
,
TSocialInfo
social
,
TProvidentFund
fund
,
TSocialFundInfo
socialFund
,
EmpProjectDispatchVo
project
)
{
if
(
Common
.
isNotNull
(
socialFund
)){
if
(
Common
.
isNotNull
(
socialFund
)){
if
(
Common
.
isNotNull
(
project
)){
socialFund
.
setEmpNo
(
project
.
getEmpCode
());
}
if
(
Common
.
isNotNull
(
emp
)){
if
(
Common
.
isNotNull
(
emp
)){
socialFund
.
setEmpNo
(
emp
.
getEmpCode
());
socialFund
.
setEmpId
(
emp
.
getId
());
socialFund
.
setEmpId
(
emp
.
getId
());
socialFund
.
setEmpName
(
emp
.
getEmpName
());
socialFund
.
setEmpIdcard
(
emp
.
getEmpIdcard
());
socialFund
.
setEmpType
(
emp
.
getEmpNatrue
());
}
}
if
(
Common
.
isNotNull
(
social
)){
if
(
Common
.
isNotNull
(
social
)){
socialFund
.
setSocialStartDate
(
social
.
getSocialStartDate
());
socialFund
.
setSocialStartDate
(
social
.
getSocialStartDate
());
...
@@ -595,6 +621,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
...
@@ -595,6 +621,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
,
socialFund
.
getPersonalUnemploymentMoney
()));
,
socialFund
.
getPersonalUnemploymentMoney
()));
}
}
if
(
Common
.
isNotNull
(
fund
)){
if
(
Common
.
isNotNull
(
fund
)){
socialFund
.
setFundId
(
fund
.
getId
());
socialFund
.
setUnitProvidengCardinal
(
fund
.
getUnitProvidengCardinal
());
socialFund
.
setUnitProvidengCardinal
(
fund
.
getUnitProvidengCardinal
());
socialFund
.
setUnitProvidentPer
(
fund
.
getUnitProvidentPer
());
socialFund
.
setUnitProvidentPer
(
fund
.
getUnitProvidentPer
());
socialFund
.
setPersonalProvidentCardinal
(
fund
.
getPersonalProvidentCardinal
());
socialFund
.
setPersonalProvidentCardinal
(
fund
.
getPersonalProvidentCardinal
());
...
@@ -620,6 +647,11 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
...
@@ -620,6 +647,11 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
socialFund
.
setPersonalFundSum
(
Common
.
formatMoneyForFund
(
BigDecimalUtils
.
safeMultiply
(
fund
.
getPersonalProvidentCardinal
(),
fund
.
getPersonalProvidentPer
(),
BigDecimal
.
valueOf
(
CommonConstants
.
ONE_OF_PERCENT
.
doubleValue
())),
Integer
.
valueOf
(
fund
.
getFundPayPoint
())));
socialFund
.
setPersonalFundSum
(
Common
.
formatMoneyForFund
(
BigDecimalUtils
.
safeMultiply
(
fund
.
getPersonalProvidentCardinal
(),
fund
.
getPersonalProvidentPer
(),
BigDecimal
.
valueOf
(
CommonConstants
.
ONE_OF_PERCENT
.
doubleValue
())),
Integer
.
valueOf
(
fund
.
getFundPayPoint
())));
}
}
}
}
if
(
Common
.
isNotNull
(
socialFund
.
getId
())){
socialFundMapper
.
updateById
(
socialFund
);
}
else
{
socialFundMapper
.
insert
(
socialFund
);
}
}
}
}
}
...
@@ -630,21 +662,31 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
...
@@ -630,21 +662,31 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
ProjectSetInfoVo
setInfoVo
,
ProjectSetInfoVo
setInfoVo
,
TSocialFundInfo
socialFund
,
TSocialFundInfo
socialFund
,
TDispatchImportVo
excel
)
{
TDispatchImportVo
excel
)
{
if
(
Common
.
is
NotNull
(
socialFund
)){
if
(
Common
.
is
Empty
(
socialFund
)){
socialFund
=
new
TSocialFundInfo
();
socialFund
=
new
TSocialFundInfo
();
if
(
Common
.
isNotNull
(
empVo
)){
socialFund
.
setEmpNo
(
empVo
.
getEmpCode
());
socialFund
.
setEmpNo
(
empVo
.
getEmpCode
());
socialFund
.
setEmpName
(
empVo
.
getEmpName
());
socialFund
.
setEmpName
(
empVo
.
getEmpName
());
socialFund
.
setEmpIdcard
(
empVo
.
getEmpIdcard
());
socialFund
.
setEmpIdcard
(
empVo
.
getEmpIdcard
());
socialFund
.
setEmpId
(
empVo
.
getId
());
socialFund
.
setEmpId
(
empVo
.
getId
());
socialFund
.
setEmpType
(
excel
.
getEmpType
());
socialFund
.
setEmpType
(
excel
.
getEmpType
());
}
}
// 按社保公积金户判断具体封装那些信息,如果社保或公积金新增失败,后面就不会去更新或插入社保公积金查询了
// 按社保公积金户判断具体封装那些信息,如果社保或公积金新增失败,后面就不会去更新或插入社保公积金查询了
if
(
Common
.
isNotNull
(
setInfoVo
)){
if
(
Common
.
isNotNull
(
setInfoVo
)){
if
(
Common
.
isNotNull
(
excel
.
getSocialHousehold
())){
if
(
Common
.
isNotNull
(
excel
.
getSocialHousehold
())){
socialFund
.
setSettleDomain
(
setInfoVo
.
getId
());
socialFund
.
setSettleDomain
(
setInfoVo
.
getId
());
socialFund
.
setSettleDomainName
(
setInfoVo
.
getDepartName
());
socialFund
.
setSettleDomainName
(
setInfoVo
.
getDepartName
());
socialFund
.
setSettleDomainCode
(
setInfoVo
.
getDepartNo
());
socialFund
.
setSettleDomainCode
(
setInfoVo
.
getDepartNo
());
socialFund
.
setSettleDomainFund
(
setInfoVo
.
getId
());
socialFund
.
setSettleDomainNameFund
(
setInfoVo
.
getDepartName
());
socialFund
.
setSettleDomainCodeFund
(
setInfoVo
.
getDepartNo
());
socialFund
.
setUnitName
(
setInfoVo
.
getCustomerName
());
socialFund
.
setUnitName
(
setInfoVo
.
getCustomerName
());
socialFund
.
setUnitId
(
setInfoVo
.
getCustomerId
());
socialFund
.
setUnitIdFund
(
setInfoVo
.
getCustomerId
());
socialFund
.
setUnitIdFund
(
setInfoVo
.
getCustomerId
());
socialFund
.
setUnitNameFund
(
setInfoVo
.
getCustomerName
());
socialFund
.
setSocialStatus
(
CommonConstants
.
ZERO_STRING
);
socialFund
.
setSocialStartDate
(
excel
.
getPensionStart
());
if
(
Common
.
isNotNull
(
socialSet
)){
if
(
Common
.
isNotNull
(
socialSet
)){
socialFund
.
setSocialHousehold
(
socialSet
.
getId
());
socialFund
.
setSocialHousehold
(
socialSet
.
getId
());
socialFund
.
setSocialHouseholdName
(
socialSet
.
getDepartName
());
socialFund
.
setSocialHouseholdName
(
socialSet
.
getDepartName
());
...
@@ -662,6 +704,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
...
@@ -662,6 +704,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
socialFund
.
setSettleDomainCode
(
setInfoVo
.
getDepartNo
());
socialFund
.
setSettleDomainCode
(
setInfoVo
.
getDepartNo
());
socialFund
.
setUnitName
(
setInfoVo
.
getCustomerName
());
socialFund
.
setUnitName
(
setInfoVo
.
getCustomerName
());
socialFund
.
setUnitIdFund
(
setInfoVo
.
getCustomerId
());
socialFund
.
setUnitIdFund
(
setInfoVo
.
getCustomerId
());
socialFund
.
setFundStatus
(
CommonConstants
.
ZERO_STRING
);
if
(
Common
.
isNotNull
(
fundSet
)){
if
(
Common
.
isNotNull
(
fundSet
)){
socialFund
.
setProvidentHousehold
(
fundSet
.
getId
());
socialFund
.
setProvidentHousehold
(
fundSet
.
getId
());
socialFund
.
setProvidentHouseholdName
(
fundSet
.
getDepartName
());
socialFund
.
setProvidentHouseholdName
(
fundSet
.
getDepartName
());
...
@@ -671,11 +714,11 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
...
@@ -671,11 +714,11 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
socialFund
.
setLowerLimitFund
(
fundSet
.
getLowerLimit
());
socialFund
.
setLowerLimitFund
(
fundSet
.
getLowerLimit
());
socialFund
.
setUpperLimitFund
(
fundSet
.
getUpperLimit
());
socialFund
.
setUpperLimitFund
(
fundSet
.
getUpperLimit
());
socialFund
.
setPayPolicyFund
(
fundSet
.
getPayPolicy
());
socialFund
.
setPayPolicyFund
(
fundSet
.
getPayPolicy
());
socialFund
.
setProvidentStart
(
excel
.
getProvidentStart
());
}
}
}
}
}
}
}
socialFundAddMap
.
put
(
excel
.
getEmpIdcard
(),
socialFund
);
socialFundAddMap
.
put
(
excel
.
getEmpIdcard
(),
socialFund
);
}
}
...
@@ -695,6 +738,8 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
...
@@ -695,6 +738,8 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
TDispatchImportVo
excel
)
{
TDispatchImportVo
excel
)
{
TDispatchInfo
dispatch
;
TDispatchInfo
dispatch
;
dispatch
=
new
TDispatchInfo
();
dispatch
=
new
TDispatchInfo
();
dispatch
.
setContractSubName
(
excel
.
getContractSubName
());
dispatch
.
setContractName
(
excel
.
getContractName
());
dispatch
.
setEmpIdcard
(
excel
.
getEmpIdcard
());
dispatch
.
setEmpIdcard
(
excel
.
getEmpIdcard
());
dispatch
.
setEmpName
(
excel
.
getEmpName
());
dispatch
.
setEmpName
(
excel
.
getEmpName
());
dispatch
.
setEmpNational
(
excel
.
getEmpNational
());
dispatch
.
setEmpNational
(
excel
.
getEmpNational
());
...
@@ -752,7 +797,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
...
@@ -752,7 +797,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
private
boolean
initFundAddInfo
(
List
<
ErrorMessage
>
errorMessageList
,
private
boolean
initFundAddInfo
(
List
<
ErrorMessage
>
errorMessageList
,
Map
<
String
,
TProvidentFund
>
funds
,
Map
<
String
,
TProvidentFund
>
funds
,
DispatchEmpVo
empVo
,
SysBaseSetInfo
fundSet
,
DispatchEmpVo
empVo
,
SysBaseSetInfo
fundSet
,
TDispatchImportVo
excel
)
{
TDispatchImportVo
excel
,
Map
<
String
,
TSocialFundInfo
>
socialFundMap
)
{
TProvidentFund
fund
;
TProvidentFund
fund
;
if
(
Common
.
isNotNull
(
excel
.
getProvidentHousehold
())){
if
(
Common
.
isNotNull
(
excel
.
getProvidentHousehold
())){
fund
=
new
TProvidentFund
();
fund
=
new
TProvidentFund
();
...
@@ -763,8 +808,10 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
...
@@ -763,8 +808,10 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
fund
.
setSettleDomain
(
excel
.
getSettleDomainId
());
fund
.
setSettleDomain
(
excel
.
getSettleDomainId
());
if
(
Common
.
isNotNull
(
empVo
)){
if
(
Common
.
isNotNull
(
empVo
)){
fund
.
setEmpId
(
empVo
.
getId
());
fund
.
setEmpId
(
empVo
.
getId
());
fund
.
setEmpNo
(
empVo
.
getEmpCode
());
}
}
fund
.
setEmpIdcard
(
excel
.
getEmpIdcard
());
fund
.
setEmpIdcard
(
excel
.
getEmpIdcard
());
fund
.
setEmpName
(
excel
.
getEmpName
());
fund
.
setTrustRemark
(
excel
.
getTrustRemark
());
fund
.
setTrustRemark
(
excel
.
getTrustRemark
());
fund
.
setUnitProvidengCardinal
(
excel
.
getProvidentPer
());
fund
.
setUnitProvidengCardinal
(
excel
.
getProvidentPer
());
fund
.
setPersonalProvidentPer
(
excel
.
getProvidentPer
());
fund
.
setPersonalProvidentPer
(
excel
.
getProvidentPer
());
...
@@ -772,6 +819,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
...
@@ -772,6 +819,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
fund
.
setPersonalProvidentCardinal
(
excel
.
getProvidentCardinal
());
fund
.
setPersonalProvidentCardinal
(
excel
.
getProvidentCardinal
());
fund
.
setProvidentStart
(
excel
.
getProvidentStart
());
fund
.
setProvidentStart
(
excel
.
getProvidentStart
());
if
(
Common
.
isNotNull
(
fundSet
)){
if
(
Common
.
isNotNull
(
fundSet
)){
fund
.
setProvidentHousehold
(
fundSet
.
getId
());
if
(!
checkFundPer
(
fundSet
.
getFundProList
(),
excel
)){
if
(!
checkFundPer
(
fundSet
.
getFundProList
(),
excel
)){
errorMessageList
.
add
(
new
ErrorMessage
(
excel
.
getRowIndex
(),
MsgUtils
.
getMessage
(
ErrorCodes
.
EMP_DISPATCH_FUND_PERCENT_NOT_EXIST
)));
errorMessageList
.
add
(
new
ErrorMessage
(
excel
.
getRowIndex
(),
MsgUtils
.
getMessage
(
ErrorCodes
.
EMP_DISPATCH_FUND_PERCENT_NOT_EXIST
)));
return
true
;
return
true
;
...
@@ -788,7 +836,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
...
@@ -788,7 +836,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
if
(
Common
.
isNotNull
(
fundSet
.
getTown
())){
if
(
Common
.
isNotNull
(
fundSet
.
getTown
())){
fund
.
setFundTown
(
Integer
.
toString
(
fundSet
.
getTown
()));
fund
.
setFundTown
(
Integer
.
toString
(
fundSet
.
getTown
()));
}
}
fund
.
setFundPayPoint
(
fundSet
.
getPayPolicy
(
));
fund
.
setFundPayPoint
(
Common
.
isNotNullToStr
(
fundSet
.
getFundPayPoint
()
));
fund
.
setHaveThisMonth
(
fundSet
.
getHaveThisMonth
());
fund
.
setHaveThisMonth
(
fundSet
.
getHaveThisMonth
());
}
}
funds
.
put
(
excel
.
getEmpIdcard
(),
fund
);
funds
.
put
(
excel
.
getEmpIdcard
(),
fund
);
...
@@ -840,18 +888,26 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
...
@@ -840,18 +888,26 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
}
}
}
}
private
void
initSocialAddInfo
(
Map
<
String
,
TSocialInfo
>
socials
,
DispatchEmpVo
empVo
,
SysBaseSetInfo
socialSet
,
TDispatchImportVo
excel
)
{
private
void
initSocialAddInfo
(
Map
<
String
,
TSocialInfo
>
socials
,
DispatchEmpVo
empVo
,
SysBaseSetInfo
socialSet
,
TDispatchImportVo
excel
,
Map
<
String
,
TSocialFundInfo
>
socialFundMap
)
{
TSocialInfo
social
;
TSocialInfo
social
;
if
(
Common
.
isNotNull
(
excel
.
getSocialHousehold
()))
{
if
(
Common
.
isNotNull
(
excel
.
getSocialHousehold
()))
{
social
=
new
TSocialInfo
();
social
=
new
TSocialInfo
();
social
.
setAuditStatus
(
CommonConstants
.
ZERO_STRING
);
social
.
setAuditStatus
(
CommonConstants
.
ZERO_STRING
);
social
.
setHandleStatus
(
CommonConstants
.
ZERO_STRING
);
social
.
setHandleStatus
(
CommonConstants
.
ZERO_STRING
);
social
.
setDeleteFlag
(
CommonConstants
.
ZERO_STRING
);
social
.
setDeleteFlag
(
CommonConstants
.
ZERO_STRING
);
social
.
setSocialStartDate
(
excel
.
getPensionStart
());
// 封装单位信息 结算信息
// 封装单位信息 结算信息
social
.
setBelongUnit
(
excel
.
getCustomerId
());
social
.
setBelongUnit
(
excel
.
getCustomerId
());
social
.
setSettleDomain
(
excel
.
getSettleDomainId
());
social
.
setSettleDomain
(
excel
.
getSettleDomainId
());
if
(
Common
.
isNotNull
(
empVo
)){
if
(
Common
.
isNotNull
(
empVo
)){
social
.
setEmpId
(
empVo
.
getId
());
social
.
setEmpId
(
empVo
.
getId
());
social
.
setEmpName
(
empVo
.
getEmpName
());
social
.
setEmpIdcard
(
empVo
.
getEmpIdcard
());
social
.
setEmpNo
(
empVo
.
getEmpCode
());
}
}
social
.
setEmpIdcard
(
excel
.
getEmpIdcard
());
social
.
setEmpIdcard
(
excel
.
getEmpIdcard
());
social
.
setBigailmentHandle
(
CommonConstants
.
ZERO_STRING
);
social
.
setBigailmentHandle
(
CommonConstants
.
ZERO_STRING
);
...
@@ -974,10 +1030,66 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
...
@@ -974,10 +1030,66 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
}
}
}
}
}
}
// 处理部分办理失败的情况
initHandleStatus
(
excel
,
socialFundMap
,
social
);
socials
.
put
(
excel
.
getEmpIdcard
(),
social
);
socials
.
put
(
excel
.
getEmpIdcard
(),
social
);
}
}
}
}
private
void
initHandleStatus
(
TDispatchImportVo
excel
,
Map
<
String
,
TSocialFundInfo
>
socialFundMap
,
TSocialInfo
social
)
{
TSocialFundInfo
socialFund
;
if
(
Common
.
isNotNull
(
socialFundMap
))
{
socialFund
=
socialFundMap
.
get
(
excel
.
getEmpIdcard
());
if
(
Common
.
isNotNull
(
socialFund
)){
if
(
CommonConstants
.
ONE_STRING
.
equals
(
socialFund
.
getPensionHandle
())){
social
.
setPensionHandle
(
socialFund
.
getPensionHandle
());
}
else
{
socialFund
.
setUnitPensionCardinal
(
social
.
getUnitPensionCardinal
());
socialFund
.
setUnitPensionPer
(
social
.
getUnitPensionPer
());
socialFund
.
setPersonalPensionCardinal
(
social
.
getPersonalPensionCardinal
());
socialFund
.
setPersonalPensionPer
(
social
.
getPersonalPensionPer
());
}
if
(
CommonConstants
.
ONE_STRING
.
equals
(
socialFund
.
getMedicalHandle
())){
social
.
setMedicalHandle
(
socialFund
.
getMedicalHandle
());
}
else
{
socialFund
.
setUnitMedicalCardinal
(
social
.
getUnitMedicalCardinal
());
socialFund
.
setUnitMedicalPer
(
social
.
getUnitMedicalPer
());
socialFund
.
setPersonalMedicalCardinal
(
social
.
getUnitMedicalCardinal
());
socialFund
.
setPersonalMedicalPer
(
social
.
getUnitMedicalPer
());
}
if
(
CommonConstants
.
ONE_STRING
.
equals
(
socialFund
.
getUnemployHandle
())){
social
.
setUnemployHandle
(
socialFund
.
getUnemployHandle
());
}
else
{
socialFund
.
setUnitUnemploymentCardinal
(
social
.
getUnitUnemploymentCardinal
());
socialFund
.
setUnitUnemploymentPer
(
social
.
getUnitUnemploymentPer
());
socialFund
.
setPersonalUnemploymentCardinal
(
social
.
getUnitUnemploymentCardinal
());
socialFund
.
setPersonalUnemploymentPer
(
social
.
getUnitUnemploymentPer
());
}
if
(
CommonConstants
.
ONE_STRING
.
equals
(
socialFund
.
getWorkInjuryHandle
())){
social
.
setWorkInjuryHandle
(
socialFund
.
getWorkInjuryHandle
());
}
else
{
socialFund
.
setUnitWorkInjuryCardinal
(
social
.
getUnitWorkInjuryCardinal
());
socialFund
.
setPersonalWorkInjuryCardinal
(
social
.
getUnitWorkInjuryCardinal
());
}
if
(
CommonConstants
.
ONE_STRING
.
equals
(
socialFund
.
getBirthHandle
())){
social
.
setBirthHandle
(
socialFund
.
getBirthHandle
());
}
else
{
socialFund
.
setUnitBirthCardinal
(
social
.
getUnitBirthCardinal
());
socialFund
.
setUnitBirthPer
(
social
.
getUnitBirthPer
());
}
if
(
CommonConstants
.
ONE_STRING
.
equals
(
socialFund
.
getBigailmentHandle
())){
social
.
setBigailmentHandle
(
socialFund
.
getBigailmentHandle
());
}
else
{
socialFund
.
setUnitBigailmentCardinal
(
social
.
getUnitBigailmentCardinal
());
socialFund
.
setUnitBigailmentPer
(
social
.
getUnitBigailmentPer
());
socialFund
.
setPersonalBigailmentCardinal
(
social
.
getUnitBigailmentCardinal
());
socialFund
.
setPersonalBigailmentPer
(
social
.
getUnitBigailmentPer
());
}
}
socialFundMap
.
put
(
excel
.
getEmpIdcard
(),
socialFund
);
}
}
private
BigDecimal
ifNull
(
BigDecimal
old
,
BigDecimal
last
){
private
BigDecimal
ifNull
(
BigDecimal
old
,
BigDecimal
last
){
if
(
Common
.
isEmpty
(
old
)){
if
(
Common
.
isEmpty
(
old
)){
return
last
;
return
last
;
...
@@ -1025,6 +1137,11 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
...
@@ -1025,6 +1137,11 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
private
void
initContractInfo
(
Map
<
String
,
EmpContractDispatchVo
>
contracts
,
private
void
initContractInfo
(
Map
<
String
,
EmpContractDispatchVo
>
contracts
,
TDispatchImportVo
excel
,
TDispatchImportVo
excel
,
DispatchEmpVo
empVo
)
{
DispatchEmpVo
empVo
)
{
// 合同开始时间和截止时间一致直接跳过
if
(
excel
.
getContractStart
().
equals
(
empVo
.
getContractStart
())
&&
excel
.
getContractEnd
().
equals
(
empVo
.
getContractEnd
())){
return
;
}
EmpContractDispatchVo
contract
;
EmpContractDispatchVo
contract
;
contract
=
new
EmpContractDispatchVo
();
contract
=
new
EmpContractDispatchVo
();
contract
.
setContractEnd
(
excel
.
getContractEnd
());
contract
.
setContractEnd
(
excel
.
getContractEnd
());
...
@@ -1060,7 +1177,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
...
@@ -1060,7 +1177,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
project
.
setWorkingHours
(
excel
.
getWorkingHours
());
project
.
setWorkingHours
(
excel
.
getWorkingHours
());
if
(
Common
.
isNotNull
(
empVo
))
{
if
(
Common
.
isNotNull
(
empVo
))
{
project
.
setEmpId
(
empVo
.
getId
());
project
.
setEmpId
(
empVo
.
getId
());
project
.
setEmp
No
(
empVo
.
getEmpCode
());
project
.
setEmp
Code
(
empVo
.
getEmpCode
());
}
}
projects
.
put
(
excel
.
getEmpIdcard
()+
CommonConstants
.
DOWN_LINE_STRING
+
excel
.
getSettleDomainCode
(),
project
);
projects
.
put
(
excel
.
getEmpIdcard
()+
CommonConstants
.
DOWN_LINE_STRING
+
excel
.
getSettleDomainCode
(),
project
);
}
}
...
@@ -1096,7 +1213,8 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
...
@@ -1096,7 +1213,8 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
empAdds
.
put
(
excel
.
getEmpIdcard
(),
emp
);
empAdds
.
put
(
excel
.
getEmpIdcard
(),
emp
);
}
}
private
boolean
validDdispatchStatus
(
List
<
ErrorMessage
>
errorMessageList
,
Map
<
String
,
TSocialFundInfo
>
socialFundMap
,
TDispatchImportVo
excel
)
{
private
boolean
validDdispatchStatus
(
List
<
ErrorMessage
>
errorMessageList
,
Map
<
String
,
TSocialFundInfo
>
socialFundMap
,
TDispatchImportVo
excel
)
{
TSocialFundInfo
sf
;
TSocialFundInfo
sf
;
if
(
Common
.
isNotNull
(
socialFundMap
))
{
if
(
Common
.
isNotNull
(
socialFundMap
))
{
sf
=
socialFundMap
.
get
(
excel
.
getEmpIdcard
());
sf
=
socialFundMap
.
get
(
excel
.
getEmpIdcard
());
...
@@ -1148,7 +1266,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
...
@@ -1148,7 +1266,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
if
(
Common
.
isNotNull
(
list
))
{
if
(
Common
.
isNotNull
(
list
))
{
Map
<
String
,
TSocialFundInfo
>
map
=
new
HashMap
<>();
Map
<
String
,
TSocialFundInfo
>
map
=
new
HashMap
<>();
for
(
TSocialFundInfo
info:
list
){
for
(
TSocialFundInfo
info:
list
){
map
.
put
(
info
.
getEmpIdcard
()
+
CommonConstants
.
DOWN_LINE_STRING
+
info
.
getSettleDomainCode
()
,
info
);
map
.
put
(
info
.
getEmpIdcard
(),
info
);
}
}
return
map
;
return
map
;
}
}
...
@@ -1179,7 +1297,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
...
@@ -1179,7 +1297,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
DispatchCheckVo
checkVo
=
new
DispatchCheckVo
();
DispatchCheckVo
checkVo
=
new
DispatchCheckVo
();
checkVo
.
setCodes
(
CollUtil
.
distinct
(
codes
));
checkVo
.
setCodes
(
CollUtil
.
distinct
(
codes
));
checkVo
.
setIdCards
(
CollUtil
.
distinct
(
idcards
));
checkVo
.
setIdCards
(
CollUtil
.
distinct
(
idcards
));
R
<
Map
>
res
=
archivesDaprUtil
.
getDispatchEmpVo
(
checkVo
);
R
<
Map
<
String
,
DispatchEmpVo
>
>
res
=
archivesDaprUtil
.
getDispatchEmpVo
(
checkVo
);
if
(
Common
.
isNotNull
(
res
)
&&
Common
.
isNotNull
(
res
.
getData
()))
{
if
(
Common
.
isNotNull
(
res
)
&&
Common
.
isNotNull
(
res
.
getData
()))
{
empVoMap
=
res
.
getData
();
empVoMap
=
res
.
getData
();
}
}
...
@@ -1189,7 +1307,8 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
...
@@ -1189,7 +1307,8 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
private
boolean
validImport
(
List
<
ErrorMessage
>
errorMessageList
,
private
boolean
validImport
(
List
<
ErrorMessage
>
errorMessageList
,
TDispatchImportVo
excel
,
TDispatchImportVo
excel
,
ProjectSetInfoVo
setInfoVo
)
{
ProjectSetInfoVo
setInfoVo
,
Map
<
String
,
TSocialFundInfo
>
socialFundMap
)
{
if
(
Common
.
isEmpty
(
setInfoVo
)){
if
(
Common
.
isEmpty
(
setInfoVo
)){
errorMessageList
.
add
(
new
ErrorMessage
(
excel
.
getRowIndex
(),
MsgUtils
.
getMessage
(
ErrorCodes
.
EMP_DISPATCH_PROJECT_NOT_FOUND
)));
errorMessageList
.
add
(
new
ErrorMessage
(
excel
.
getRowIndex
(),
MsgUtils
.
getMessage
(
ErrorCodes
.
EMP_DISPATCH_PROJECT_NOT_FOUND
)));
return
true
;
return
true
;
...
@@ -1229,16 +1348,262 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
...
@@ -1229,16 +1348,262 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
errorMessageList
.
add
(
new
ErrorMessage
(
excel
.
getRowIndex
(),
MsgUtils
.
getMessage
(
ErrorCodes
.
EMP_DISPATCH_FUND_NOT_EMPTY
)));
errorMessageList
.
add
(
new
ErrorMessage
(
excel
.
getRowIndex
(),
MsgUtils
.
getMessage
(
ErrorCodes
.
EMP_DISPATCH_FUND_NOT_EMPTY
)));
return
true
;
return
true
;
}
}
TSocialFundInfo
socialFund
=
null
;
if
(
Common
.
isNotNull
(
socialFundMap
)){
socialFund
=
socialFundMap
.
get
(
excel
.
getEmpIdcard
());
if
(
Common
.
isNotNull
(
socialFund
)){
// 社保状态:派增(0待审核、1待办理、2办理中 3办理成功、4部分办理失败 5 办理失败)、派减(6待审核 7待办理 8办理成功 9 办理失败)
if
(
Common
.
isNotNull
(
excel
.
getSocialHousehold
())
&&
(
Common
.
isEmpty
(
socialFund
.
getSocialStatus
())
||
CommonConstants
.
SIX_STRING
.
equals
(
socialFund
.
getSocialStatus
())
||
CommonConstants
.
SEVEN_STRING
.
equals
(
socialFund
.
getSocialStatus
())
||
CommonConstants
.
NINE_STRING
.
equals
(
socialFund
.
getSocialStatus
())
||
CommonConstants
.
FIVE_STRING
.
equals
(
socialFund
.
getSocialStatus
()))
){
errorMessageList
.
add
(
new
ErrorMessage
(
excel
.
getRowIndex
(),
MsgUtils
.
getMessage
(
ErrorCodes
.
EMP_DISPATCH_SOCIAL_EXISTING
)));
return
true
;
}
// 公积金状态:派增(0待审核、1待办理、3办理成功、4办理失败)、派减(5待审核 6待办理 7 办理成功 8 办理失败)
if
(
Common
.
isNotNull
(
excel
.
getProvidentHousehold
())
&&
(
CommonConstants
.
FIVE_STRING
.
equals
(
socialFund
.
getFundStatus
())
&&
CommonConstants
.
SIX_STRING
.
equals
(
socialFund
.
getFundStatus
())
&&
CommonConstants
.
EIGHT_STRING
.
equals
(
socialFund
.
getFundStatus
())
&&
CommonConstants
.
FOUR_STRING
.
equals
(
socialFund
.
getFundStatus
()))){
errorMessageList
.
add
(
new
ErrorMessage
(
excel
.
getRowIndex
(),
MsgUtils
.
getMessage
(
ErrorCodes
.
EMP_DISPATCH_FUND_EXISTING
)));
return
true
;
}
}
}
return
false
;
return
false
;
}
}
@Override
public
R
<
List
<
ErrorMessage
>>
importReduceDiy
(
InputStream
inputStream
)
{
YifuUser
user
=
SecurityUtils
.
getUser
();
if
(
Common
.
isEmpty
(
user
)){
R
.
failed
(
CommonConstants
.
USER_FAIL
);
}
List
<
ErrorMessage
>
errorMessageList
=
new
ArrayList
<>();
ExcelUtil
<
TDispatchReduceVo
>
util1
=
new
ExcelUtil
<>(
TDispatchReduceVo
.
class
);
;
// 写法2:
// 匿名内部类 不用额外写一个DemoDataListener
// 这里 需要指定读用哪个class去读,然后读取第一个sheet 文件流会自动关闭
try
{
EasyExcel
.
read
(
inputStream
,
TDispatchReduceVo
.
class
,
new
ReadListener
<
TDispatchReduceVo
>()
{
/**
/**
* 插入excel bad record
* 单次缓存的数据量
*/
*/
private
void
insertExcel
(
TDispatchImportVo
excel
)
{
public
static
final
int
BATCH_COUNT
=
CommonConstants
.
BATCH_COUNT
;
TDispatchInfo
insert
=
new
TDispatchInfo
();
/**
BeanUtil
.
copyProperties
(
excel
,
insert
);
*临时存储
this
.
save
(
insert
);
*/
private
List
<
TDispatchReduceVo
>
cachedDataList
=
ListUtils
.
newArrayListWithExpectedSize
(
BATCH_COUNT
);
@Override
public
void
invoke
(
TDispatchReduceVo
data
,
AnalysisContext
context
)
{
ReadRowHolder
readRowHolder
=
context
.
readRowHolder
();
Integer
rowIndex
=
readRowHolder
.
getRowIndex
();
data
.
setRowIndex
(
rowIndex
+
1
);
ErrorMessage
errorMessage
=
util1
.
checkEntity
(
data
,
data
.
getRowIndex
());
if
(
Common
.
isNotNull
(
errorMessage
))
{
errorMessageList
.
add
(
errorMessage
);
}
else
{
cachedDataList
.
add
(
data
);
}
if
(
cachedDataList
.
size
()
>=
BATCH_COUNT
)
{
saveData
();
// 存储完成清理 list
cachedDataList
=
ListUtils
.
newArrayListWithExpectedSize
(
BATCH_COUNT
);
}
}
@Override
public
void
doAfterAllAnalysed
(
AnalysisContext
context
)
{
saveData
();
}
/**
* 加上存储数据库
*/
private
void
saveData
()
{
log
.
info
(
"{}条数据,开始存储数据库!"
,
cachedDataList
.
size
());
batchReduceDispatch
(
cachedDataList
,
errorMessageList
,
user
);
log
.
info
(
"存储数据库成功!"
);
}
}).
sheet
().
doRead
();
}
catch
(
Exception
e
)
{
log
.
error
(
CommonConstants
.
IMPORT_DATA_ANALYSIS_ERROR
,
e
);
return
R
.
failed
(
CommonConstants
.
IMPORT_DATA_ANALYSIS_ERROR
);
}
return
R
.
ok
(
errorMessageList
);
}
private
void
batchReduceDispatch
(
List
<
TDispatchReduceVo
>
excelVOList
,
List
<
ErrorMessage
>
errorMessageList
,
YifuUser
user
)
{
if
(!
Common
.
isNotNull
(
excelVOList
)){
return
;
}
Map
<
String
,
String
>
excelVOTemp
=
new
HashMap
<>();
// 个性化校验逻辑
List
<
String
>
idcards
=
new
ArrayList
<>();
// 通过身份证和项目编码获取档案&项目档案&最新合同
Map
<
String
,
DispatchEmpVo
>
empVoMap
=
getDispatchEmpVo
(
idcards
,
null
);
// 初始化参数
initIdcard
(
excelVOList
,
idcards
);
// 通过身份证查询社保&公积金&社保公积金查询信息: 身份证维度唯一
Map
<
String
,
TSocialFundInfo
>
socialFundMap
=
getSocialFundMap
(
idcards
);
//新增派单信息
Map
<
String
,
TDispatchInfo
>
dispatchMap
=
new
HashMap
<>();
// 新增社保公积金查询
Map
<
String
,
TSocialFundInfo
>
socialFundAddMap
=
new
HashMap
<>();
DispatchEmpVo
empVo
=
null
;
TDispatchInfo
dispatch
;
TDispatchReduceVo
excel
;
TSocialFundInfo
socialFund
;
// 执行数据插入操作 组装
for
(
int
i
=
0
;
i
<
excelVOList
.
size
();
i
++)
{
excel
=
excelVOList
.
get
(
i
);
socialFund
=
socialFundMap
.
get
(
excel
.
getEmpIdcard
());
if
(
Common
.
isEmpty
(
socialFund
)){
errorMessageList
.
add
(
new
ErrorMessage
(
excel
.
getRowIndex
(),
MsgUtils
.
getMessage
(
ErrorCodes
.
EMP_DISPATCH_SOCIAL_FUND_NOT_EMPTY
)));
continue
;
}
// 自定义校验
if
(
validReduce
(
errorMessageList
,
excelVOTemp
,
socialFundMap
,
socialFund
,
excel
)){
continue
;
}
if
(
Common
.
isNotNull
(
empVoMap
))
{
empVo
=
empVoMap
.
get
(
excel
.
getEmpIdcard
());
}
excelVOTemp
.
put
(
excel
.
getEmpIdcard
(),
excel
.
getEmpIdcard
());
// 初始化派单 和 社保公积金查询信息
dispatch
=
gettDispatchInfo
(
empVo
,
excel
,
socialFund
);
try
{
baseMapper
.
insert
(
dispatch
);
socialFundMapper
.
updateById
(
socialFund
);
}
catch
(
Exception
e
){
log
.
error
(
"批量派减异常:"
,
e
);
errorMessageList
.
add
(
new
ErrorMessage
(
excel
.
getRowIndex
(),
CommonConstants
.
SAVE_FAILED
));
continue
;
}
errorMessageList
.
add
(
new
ErrorMessage
(
excel
.
getRowIndex
(),
CommonConstants
.
SAVE_SUCCESS
,
CommonConstants
.
GREEN
));
}
}
private
TDispatchInfo
gettDispatchInfo
(
DispatchEmpVo
empVo
,
TDispatchReduceVo
excel
,
TSocialFundInfo
socialFund
)
{
TDispatchInfo
dispatch
;
dispatch
=
new
TDispatchInfo
();
dispatch
.
setEmpId
(
socialFund
.
getEmpId
());
dispatch
.
setEmpName
(
socialFund
.
getEmpName
());
dispatch
.
setEmpNo
(
socialFund
.
getEmpNo
());
dispatch
.
setEmpType
(
socialFund
.
getEmpType
());
dispatch
.
setEmpIdcard
(
socialFund
.
getEmpIdcard
());
dispatch
.
setType
(
CommonConstants
.
ONE_STRING
);
dispatch
.
setLeaveDate
(
excel
.
getLeaveDate
());
dispatch
.
setDeleteFlag
(
CommonConstants
.
ZERO_STRING
);
dispatch
.
setReduceReason
(
excel
.
getReasonType
());
dispatch
.
setTrustRemark
(
excel
.
getTrustRemark
());
if
(
Common
.
isNotNull
(
excel
.
getSocialReduceDate
())){
dispatch
.
setSocialHandleStatus
(
CommonConstants
.
ZERO_STRING
);
dispatch
.
setSocialId
(
socialFund
.
getSocialId
());
dispatch
.
setSocialReduceDate
(
excel
.
getSocialReduceDate
());
dispatch
.
setSocialProvince
(
socialFund
.
getSocialProvince
());
dispatch
.
setSocialCity
(
socialFund
.
getSocialCity
());
dispatch
.
setSocialTown
(
socialFund
.
getSocialTown
());
socialFund
.
setSocialReduceStatus
(
CommonConstants
.
ZERO_STRING
);
socialFund
.
setSocialReduceDate
(
excel
.
getSocialReduceDate
());
socialFund
.
setSocialReduceStatus
(
CommonConstants
.
ZERO_STRING
);
socialFund
.
setSocialStatus
(
CommonConstants
.
SIX_STRING
);
}
if
(
Common
.
isNotNull
(
excel
.
getFundReduceDate
())){
dispatch
.
setFundHandleStatus
(
CommonConstants
.
ZERO_STRING
);
dispatch
.
setFundId
(
socialFund
.
getFundId
());
dispatch
.
setFundReduceDate
(
excel
.
getSocialReduceDate
());
dispatch
.
setFundProvince
(
socialFund
.
getFundProvince
());
dispatch
.
setFundCity
(
socialFund
.
getFundCity
());
dispatch
.
setFundTown
(
socialFund
.
getFundTown
());
socialFund
.
setFundReduceDate
(
excel
.
getFundReduceDate
());
socialFund
.
setFundStatus
(
CommonConstants
.
FIVE_STRING
);
socialFund
.
setFundReduceStatus
(
CommonConstants
.
ZERO_STRING
);
}
dispatch
.
setBelongUnitName
(
socialFund
.
getUnitName
());
dispatch
.
setBelongUnit
(
socialFund
.
getUnitId
());
if
(
Common
.
isNotNull
(
empVo
)){
dispatch
.
setEmpMobile
(
empVo
.
getEmpPhone
());
dispatch
.
setEmpNational
(
empVo
.
getEmpNational
());
dispatch
.
setEmpId
(
empVo
.
getId
());
dispatch
.
setEmpNo
(
empVo
.
getEmpCode
());
// 封装合同信息 如果有合同取值实际合同信息
dispatch
.
setSettleDomainName
(
empVo
.
getDeptName
());
dispatch
.
setContractStart
(
empVo
.
getContractStart
());
dispatch
.
setContractEnd
(
empVo
.
getContractEnd
());
dispatch
.
setContractTerm
(
empVo
.
getContractTerm
());
dispatch
.
setContractType
(
empVo
.
getContractType
());
dispatch
.
setFileProvince
(
empVo
.
getFileProvince
());
dispatch
.
setFileCity
(
empVo
.
getFileCity
());
dispatch
.
setFileTown
(
empVo
.
getFileTown
());
dispatch
.
setSettleDomainCode
(
empVo
.
getDeptNo
());
dispatch
.
setSettleDomain
(
empVo
.
getDeptId
());
}
return
dispatch
;
}
private
boolean
validReduce
(
List
<
ErrorMessage
>
errorMessageList
,
Map
<
String
,
String
>
excelVOTemp
,
Map
<
String
,
TSocialFundInfo
>
socialFundMap
,
TSocialFundInfo
socialFund
,
TDispatchReduceVo
excel
)
{
if
(
Common
.
isNotNull
(
excelVOTemp
.
get
(
excel
.
getEmpIdcard
()))){
errorMessageList
.
add
(
new
ErrorMessage
(
excel
.
getRowIndex
(),
MsgUtils
.
getMessage
(
ErrorCodes
.
EMP_DISPATCH_REDUCE_EXISTS
)));
return
true
;
}
if
(
Common
.
isEmpty
(
excel
.
getFundReduceDate
())
&&
Common
.
isEmpty
(
excel
.
getSocialReduceDate
())){
errorMessageList
.
add
(
new
ErrorMessage
(
excel
.
getRowIndex
(),
MsgUtils
.
getMessage
(
ErrorCodes
.
EMP_DISPATCH_REDUCE_SOCIAL_FUND_NOT_EMPTY
)));
return
true
;
}
if
(
Common
.
isEmpty
(
socialFundMap
)){
errorMessageList
.
add
(
new
ErrorMessage
(
excel
.
getRowIndex
(),
MsgUtils
.
getMessage
(
ErrorCodes
.
EMP_DISPATCH_SOCIAL_FUND_NOT_EMPTY
)));
return
true
;
}
//社保状态:派增(0待审核、1待办理、2办理中 3办理成功、4部分办理失败 5 办理失败)、派减(6待审核 7待办理 8办理成功 9 办理失败)
if
(
Common
.
isNotNull
(
excel
.
getSocialReduceDate
())
&&
!
socialFund
.
getSocialStatus
().
equals
(
CommonConstants
.
THREE_STRING
)){
errorMessageList
.
add
(
new
ErrorMessage
(
excel
.
getRowIndex
(),
MsgUtils
.
getMessage
(
ErrorCodes
.
EMP_DISPATCH_REDUCE_SOCIAL_STATUS_ERROR
)));
return
true
;
}
//公积金状态:派增(0待审核、1待办理、3办理成功、4办理失败)、派减(5待审核 6待办理 7 办理成功 8 办理失败)
if
(
Common
.
isNotNull
(
excel
.
getFundReduceDate
())
&&
!
socialFund
.
getFundStatus
().
equals
(
CommonConstants
.
THREE_STRING
)){
errorMessageList
.
add
(
new
ErrorMessage
(
excel
.
getRowIndex
(),
MsgUtils
.
getMessage
(
ErrorCodes
.
EMP_DISPATCH_REDUCE_FUND_STATUS_ERROR
)));
return
true
;
}
return
false
;
}
private
void
initIdcard
(
List
<
TDispatchReduceVo
>
excelVOList
,
List
<
String
>
idcards
)
{
if
(
Common
.
isNotNull
(
excelVOList
))
{
for
(
TDispatchReduceVo
vo
:
excelVOList
)
{
idcards
.
add
(
vo
.
getEmpIdcard
());
}
}
}
@Override
public
R
<
Boolean
>
removeByIdDiy
(
String
id
)
{
if
(
Common
.
isEmpty
(
id
)){
return
R
.
failed
(
CommonConstants
.
PARAM_IS_NOT_EMPTY
)
}
TDispatchInfo
dispatch
=
baseMapper
.
selectById
(
id
);
if
(
Common
.
isEmpty
(
dispatch
)){
return
R
.
failed
(
CommonConstants
.
PARAM_IS_NOT_ERROR
);
}
dispatch
.
setDeleteFlag
(
CommonConstants
.
ONE_STRING
);
if
(
baseMapper
.
updateById
(
dispatch
)>
0
){
return
R
.
ok
(
true
,
CommonConstants
.
SAVE_SUCCESS
);
}
else
{
return
R
.
failed
(
false
,
CommonConstants
.
SAVE_FAILED
);
}
}
}
}
}
yifu-social/yifu-social-biz/src/main/resources/mapper/TSocialFundInfoMapper.xml
View file @
40856258
...
@@ -152,7 +152,9 @@
...
@@ -152,7 +152,9 @@
<result
property=
"personalSocialSum"
column=
"PERSONAL_SOCIAL_SUM"
/>
<result
property=
"personalSocialSum"
column=
"PERSONAL_SOCIAL_SUM"
/>
<result
property=
"unitInterestFee"
column=
"UNIT_INTEREST_FEE"
/>
<result
property=
"unitInterestFee"
column=
"UNIT_INTEREST_FEE"
/>
<result
property=
"personalInterestFee"
column=
"PERSONAL_INTEREST_FEE"
/>
<result
property=
"personalInterestFee"
column=
"PERSONAL_INTEREST_FEE"
/>
<result
property=
"socialStatus"
column=
"SOCIAL_STATUS"
/>
<result
property=
"fundStatus"
column=
"FUND_STATUS"
/>
<result
property=
"dispatchId"
column=
"DISPATCH_ID"
/>
</resultMap>
</resultMap>
<sql
id=
"Base_Column_List"
>
<sql
id=
"Base_Column_List"
>
...
@@ -280,7 +282,10 @@
...
@@ -280,7 +282,10 @@
a.UNIT_SOCIAL_SUM,
a.UNIT_SOCIAL_SUM,
a.PERSONAL_SOCIAL_SUM,
a.PERSONAL_SOCIAL_SUM,
a.UNIT_INTEREST_FEE,
a.UNIT_INTEREST_FEE,
a.PERSONAL_INTEREST_FEE
a.PERSONAL_INTEREST_FEE,
a.SOCIAL_STATUS,
a.FUND_STATUS,
a.DISPATCH_ID
</sql>
</sql>
<sql
id=
"tSocialFundInfo_where"
>
<sql
id=
"tSocialFundInfo_where"
>
<if
test=
"tSocialFundInfo != null"
>
<if
test=
"tSocialFundInfo != null"
>
...
...
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