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
b08bd8c2
Commit
b08bd8c2
authored
Jul 23, 2022
by
fangxinjiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
合同待办处理
parent
4bc7d3d1
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
373 additions
and
11 deletions
+373
-11
ExcelAttributeConstants.java
...v1/yifu/common/core/constant/ExcelAttributeConstants.java
+2
-0
ErrorCodes.java
....cloud.plus.v1/yifu/common/core/exception/ErrorCodes.java
+20
-0
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
+10
-0
TDispatchReduceVo.java
.../yifu/cloud/plus/v1/yifu/social/vo/TDispatchReduceVo.java
+101
-0
TDispatchInfoController.java
...us/v1/yifu/social/controller/TDispatchInfoController.java
+2
-2
TDispatchInfoService.java
...oud/plus/v1/yifu/social/service/TDispatchInfoService.java
+4
-0
TDispatchInfoServiceImpl.java
...v1/yifu/social/service/impl/TDispatchInfoServiceImpl.java
+233
-9
No files found.
yifu-common/yifu-common-core/src/main/java/com/yifu.cloud.plus.v1/yifu/common/core/constant/ExcelAttributeConstants.java
View file @
b08bd8c2
...
@@ -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 @
b08bd8c2
...
@@ -396,4 +396,24 @@ public interface ErrorCodes {
...
@@ -396,4 +396,24 @@ public interface ErrorCodes {
* 新增异常:已存在公积金数据
* 新增异常:已存在公积金数据
*/
*/
String
EMP_DISPATCH_FUND_EXISTING
=
"emp.dispatch.fund.existing"
;
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 @
b08bd8c2
...
@@ -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 @
b08bd8c2
...
@@ -141,6 +141,16 @@ emp.dispatch.add.project.error=\u65B0\u589E\u5F02\u5E38\uFF1A\u6D3E\u5355\u65B0\
...
@@ -141,6 +141,16 @@ emp.dispatch.add.project.error=\u65B0\u589E\u5F02\u5E38\uFF1A\u6D3E\u5355\u65B0\
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.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-social/yifu-social-api/src/main/java/com/yifu/cloud/plus/v1/yifu/social/vo/TDispatchReduceVo.java
0 → 100644
View file @
b08bd8c2
/*
* 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 @
b08bd8c2
...
@@ -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
);
}
}
/**
/**
...
@@ -167,6 +167,6 @@ public class TDispatchInfoController {
...
@@ -167,6 +167,6 @@ public class TDispatchInfoController {
@PostMapping
(
"/importListReduce"
)
@PostMapping
(
"/importListReduce"
)
//@PreAuthorize("@pms.hasPermission('demo_tdispatchinfo-batch-reduce')")
//@PreAuthorize("@pms.hasPermission('demo_tdispatchinfo-batch-reduce')")
public
R
<
List
<
ErrorMessage
>>
importListReduce
(
@RequestBody
MultipartFile
file
){
public
R
<
List
<
ErrorMessage
>>
importListReduce
(
@RequestBody
MultipartFile
file
){
return
tDispatchInfoService
.
importDiy
(
file
.
getInputStream
());
return
tDispatchInfoService
.
import
Reduce
Diy
(
file
.
getInputStream
());
}
}
}
}
yifu-social/yifu-social-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/social/service/TDispatchInfoService.java
View file @
b08bd8c2
...
@@ -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 @
b08bd8c2
...
@@ -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
;
...
@@ -474,7 +474,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
...
@@ -474,7 +474,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
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 等数据
Common
.
clear
(
empAddsMap
);
Common
.
clear
(
empAddsMap
);
Common
.
clear
(
contractsMap
);
Common
.
clear
(
contractsMap
);
...
@@ -1137,6 +1137,11 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
...
@@ -1137,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
());
...
@@ -1374,12 +1379,231 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
...
@@ -1374,12 +1379,231 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
}
}
/**
@Override
* 插入excel bad record
public
R
<
List
<
ErrorMessage
>>
importReduceDiy
(
InputStream
inputStream
)
{
*/
YifuUser
user
=
SecurityUtils
.
getUser
();
private
void
insertExcel
(
TDispatchImportVo
excel
)
{
if
(
Common
.
isEmpty
(
user
)){
TDispatchInfo
insert
=
new
TDispatchInfo
();
R
.
failed
(
CommonConstants
.
USER_FAIL
);
BeanUtil
.
copyProperties
(
excel
,
insert
);
}
this
.
save
(
insert
);
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
>()
{
/**
* 单次缓存的数据量
*/
public
static
final
int
BATCH_COUNT
=
CommonConstants
.
BATCH_COUNT
;
/**
*临时存储
*/
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
);
}
}
}
}
}
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