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
727e2d6b
Commit
727e2d6b
authored
Oct 11, 2022
by
hongguangwu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
薪资批量更新
parent
a1f6c0f0
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
176 additions
and
7 deletions
+176
-7
TSalaryEmployeeUpdateVo.java
...cloud/plus/v1/yifu/salary/vo/TSalaryEmployeeUpdateVo.java
+168
-0
TSalaryEmployeeServiceImpl.java
.../yifu/salary/service/impl/TSalaryEmployeeServiceImpl.java
+8
-7
No files found.
yifu-salary/yifu-salary-api/src/main/java/com/yifu/cloud/plus/v1/yifu/salary/vo/TSalaryEmployeeUpdateVo.java
0 → 100644
View file @
727e2d6b
/*
* 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
.
salary
.
vo
;
import
com.alibaba.excel.annotation.ExcelProperty
;
import
com.alibaba.excel.annotation.write.style.HeadFontStyle
;
import
com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute
;
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
java.io.Serializable
;
/**
* 薪酬人员表
*
* @author hgw
* @date 2022-08-05 11:40:14
*/
@Data
public
class
TSalaryEmployeeUpdateVo
extends
RowIndex
implements
Serializable
{
/**
* 员工姓名
*/
@Length
(
max
=
32
,
message
=
"员工姓名 不能超过32 个字符"
)
@ExcelAttribute
(
name
=
"员工姓名"
,
maxLength
=
32
)
@Schema
(
description
=
"员工姓名"
)
@HeadFontStyle
(
fontHeightInPoints
=
11
)
@ExcelProperty
(
"员工姓名"
)
private
String
empName
;
/**
* 身份证号
*/
@NotBlank
(
message
=
"身份证号 不能为空"
)
@Length
(
max
=
32
,
message
=
"身份证号 不能超过32 个字符"
)
@ExcelAttribute
(
name
=
"身份证号"
,
isNotEmpty
=
true
,
errorInfo
=
"身份证号 不能为空"
,
maxLength
=
32
)
@Schema
(
description
=
"身份证号"
)
@HeadFontStyle
(
fontHeightInPoints
=
11
)
@ExcelProperty
(
"身份证号"
)
private
String
empIdcard
;
/**
* 项目名称
*/
@Length
(
max
=
50
,
message
=
"项目名称 不能超过50 个字符"
)
@ExcelAttribute
(
name
=
"项目名称"
,
maxLength
=
50
)
@Schema
(
description
=
"项目名称"
)
@HeadFontStyle
(
fontHeightInPoints
=
11
)
@ExcelProperty
(
"项目名称"
)
private
String
deptName
;
/**
* 项目编码
*/
@NotBlank
(
message
=
"项目编码 不能为空"
)
@Length
(
max
=
30
,
message
=
"项目编码 不能超过30 个字符"
)
@ExcelAttribute
(
name
=
"项目编码"
,
isNotEmpty
=
true
,
errorInfo
=
"项目编码 不能为空"
,
maxLength
=
30
)
@Schema
(
description
=
"项目编码"
)
@HeadFontStyle
(
fontHeightInPoints
=
11
)
@ExcelProperty
(
"项目编码"
)
private
String
deptNo
;
/**
* 封面抬头
*/
@Length
(
max
=
50
,
message
=
"封面抬头 不能超过50 个字符"
)
@ExcelAttribute
(
name
=
"封面抬头"
,
maxLength
=
50
)
@Schema
(
description
=
"封面抬头"
)
@HeadFontStyle
(
fontHeightInPoints
=
11
)
@ExcelProperty
(
"封面抬头"
)
private
String
invoiceTitle
;
/**
* 客户名称
*/
@Length
(
max
=
50
,
message
=
"客户名称 不能超过50 个字符"
)
@ExcelAttribute
(
name
=
"客户名称"
,
maxLength
=
50
)
@Schema
(
description
=
"客户名称"
)
@HeadFontStyle
(
fontHeightInPoints
=
11
)
@ExcelProperty
(
"客户名称"
)
private
String
unitName
;
/**
* 开户行总行
*/
@Length
(
max
=
50
,
message
=
"开户行总行 不能超过50 个字符"
)
@ExcelAttribute
(
name
=
"开户行总行"
,
maxLength
=
50
)
@Schema
(
description
=
"开户行总行"
)
@HeadFontStyle
(
fontHeightInPoints
=
11
)
@ExcelProperty
(
"开户行总行"
)
private
String
bankName
;
/**
* 开户行省
*/
@ExcelAttribute
(
name
=
"开户行省"
)
@Schema
(
description
=
"开户行省"
)
@HeadFontStyle
(
fontHeightInPoints
=
11
)
@ExcelProperty
(
"开户行省"
)
private
String
bankProvince
;
/**
* 开户行市
*/
@ExcelAttribute
(
name
=
"开户行市"
)
@Schema
(
description
=
"开户行市"
)
@HeadFontStyle
(
fontHeightInPoints
=
11
)
@ExcelProperty
(
"开户行市"
)
private
String
bankCity
;
/**
* 开户行支行
*/
@Length
(
max
=
50
,
message
=
"开户行支行 不能超过50 个字符"
)
@ExcelAttribute
(
name
=
"开户行支行"
,
maxLength
=
50
)
@Schema
(
description
=
"开户行支行"
)
@HeadFontStyle
(
fontHeightInPoints
=
11
)
@ExcelProperty
(
"开户行支行"
)
private
String
bankSubName
;
/**
* 银行卡号
*/
@Length
(
max
=
50
,
message
=
"银行卡号 不能超过50 个字符"
)
@ExcelAttribute
(
name
=
"银行卡号"
,
maxLength
=
50
)
@Schema
(
description
=
"银行卡号"
)
@HeadFontStyle
(
fontHeightInPoints
=
11
)
@ExcelProperty
(
"银行卡号"
)
private
String
bankNo
;
/**
* 手机号码
*/
@Length
(
max
=
32
,
message
=
"手机号码 不能超过32 个字符"
)
@ExcelAttribute
(
name
=
"手机号码"
,
maxLength
=
32
)
@Schema
(
description
=
"手机号码"
)
@HeadFontStyle
(
fontHeightInPoints
=
11
)
@ExcelProperty
(
"手机号码"
)
private
String
empPhone
;
/**
* 计税月份
*/
@Length
(
max
=
6
,
message
=
"计税月份 不能超过6 个字符"
)
@ExcelAttribute
(
name
=
"计税月份"
,
maxLength
=
6
)
@Schema
(
description
=
"计税月份"
)
@HeadFontStyle
(
fontHeightInPoints
=
11
)
@ExcelProperty
(
"计税月份"
)
private
String
taxMonth
;
/**
* 在职状态(0在职;1离职)
*/
@ExcelAttribute
(
name
=
"在职状态(0在职;1离职)"
)
@Schema
(
description
=
"在职状态(0在职;1离职)"
)
@HeadFontStyle
(
fontHeightInPoints
=
11
)
@ExcelProperty
(
"在职状态(0在职;1离职)"
)
private
String
fileStatus
;
}
yifu-salary/yifu-salary-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/salary/service/impl/TSalaryEmployeeServiceImpl.java
View file @
727e2d6b
...
@@ -46,6 +46,7 @@ import com.yifu.cloud.plus.v1.yifu.salary.service.TSalaryEmployeeService;
...
@@ -46,6 +46,7 @@ import com.yifu.cloud.plus.v1.yifu.salary.service.TSalaryEmployeeService;
import
com.yifu.cloud.plus.v1.yifu.salary.util.SalaryConstants
;
import
com.yifu.cloud.plus.v1.yifu.salary.util.SalaryConstants
;
import
com.yifu.cloud.plus.v1.yifu.salary.vo.TSalaryEmployeeExportVo
;
import
com.yifu.cloud.plus.v1.yifu.salary.vo.TSalaryEmployeeExportVo
;
import
com.yifu.cloud.plus.v1.yifu.salary.vo.TSalaryEmployeeSearchVo
;
import
com.yifu.cloud.plus.v1.yifu.salary.vo.TSalaryEmployeeSearchVo
;
import
com.yifu.cloud.plus.v1.yifu.salary.vo.TSalaryEmployeeUpdateVo
;
import
com.yifu.cloud.plus.v1.yifu.salary.vo.TSalaryEmployeeVo
;
import
com.yifu.cloud.plus.v1.yifu.salary.vo.TSalaryEmployeeVo
;
import
lombok.extern.log4j.Log4j2
;
import
lombok.extern.log4j.Log4j2
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
@@ -348,13 +349,13 @@ public class TSalaryEmployeeServiceImpl extends ServiceImpl<TSalaryEmployeeMappe
...
@@ -348,13 +349,13 @@ public class TSalaryEmployeeServiceImpl extends ServiceImpl<TSalaryEmployeeMappe
@Override
@Override
public
R
<
List
<
ErrorMessage
>>
batchUpdateSalaryEmployee
(
InputStream
inputStream
)
{
public
R
<
List
<
ErrorMessage
>>
batchUpdateSalaryEmployee
(
InputStream
inputStream
)
{
List
<
ErrorMessage
>
errorMessageList
=
new
ArrayList
<>();
List
<
ErrorMessage
>
errorMessageList
=
new
ArrayList
<>();
ExcelUtil
<
TSalaryEmployee
Vo
>
util1
=
new
ExcelUtil
<>(
TSalaryEmploye
eVo
.
class
);
ExcelUtil
<
TSalaryEmployee
UpdateVo
>
util1
=
new
ExcelUtil
<>(
TSalaryEmployeeUpdat
eVo
.
class
);
// 写法2:
// 写法2:
// 匿名内部类 不用额外写一个DemoDataListener
// 匿名内部类 不用额外写一个DemoDataListener
// 这里 需要指定读用哪个class去读,然后读取第一个sheet 文件流会自动关闭
// 这里 需要指定读用哪个class去读,然后读取第一个sheet 文件流会自动关闭
try
{
try
{
EasyExcelFactory
.
read
(
inputStream
,
TSalaryEmployee
Vo
.
class
,
new
ReadListener
<
TSalaryEmploye
eVo
>()
{
EasyExcelFactory
.
read
(
inputStream
,
TSalaryEmployee
UpdateVo
.
class
,
new
ReadListener
<
TSalaryEmployeeUpdat
eVo
>()
{
/**
/**
* 单次缓存的数据量
* 单次缓存的数据量
*/
*/
...
@@ -362,10 +363,10 @@ public class TSalaryEmployeeServiceImpl extends ServiceImpl<TSalaryEmployeeMappe
...
@@ -362,10 +363,10 @@ public class TSalaryEmployeeServiceImpl extends ServiceImpl<TSalaryEmployeeMappe
/**
/**
*临时存储
*临时存储
*/
*/
private
List
<
TSalaryEmployeeVo
>
cachedDataList
=
ListUtils
.
newArrayListWithExpectedSize
(
BATCH_COUNT
);
private
List
<
TSalaryEmployee
Update
Vo
>
cachedDataList
=
ListUtils
.
newArrayListWithExpectedSize
(
BATCH_COUNT
);
@Override
@Override
public
void
invoke
(
TSalaryEmployeeVo
data
,
AnalysisContext
context
)
{
public
void
invoke
(
TSalaryEmployee
Update
Vo
data
,
AnalysisContext
context
)
{
ReadRowHolder
readRowHolder
=
context
.
readRowHolder
();
ReadRowHolder
readRowHolder
=
context
.
readRowHolder
();
Integer
rowIndex
=
readRowHolder
.
getRowIndex
();
Integer
rowIndex
=
readRowHolder
.
getRowIndex
();
data
.
setRowIndex
(
rowIndex
+
1
);
data
.
setRowIndex
(
rowIndex
+
1
);
...
@@ -422,12 +423,12 @@ public class TSalaryEmployeeServiceImpl extends ServiceImpl<TSalaryEmployeeMappe
...
@@ -422,12 +423,12 @@ public class TSalaryEmployeeServiceImpl extends ServiceImpl<TSalaryEmployeeMappe
* @Date: 2022/10/10 17:56
* @Date: 2022/10/10 17:56
* @return: void
* @return: void
**/
**/
public
void
updateTSalaryEmployee
(
List
<
TSalaryEmployeeVo
>
excelVOList
,
List
<
ErrorMessage
>
errorMessageList
)
{
public
void
updateTSalaryEmployee
(
List
<
TSalaryEmployee
Update
Vo
>
excelVOList
,
List
<
ErrorMessage
>
errorMessageList
)
{
/// 个性化校验逻辑
/// 个性化校验逻辑
TSalaryEmployeeVo
excel
;
TSalaryEmployee
Update
Vo
excel
;
List
<
String
>
idCardList
=
new
ArrayList
<>();
List
<
String
>
idCardList
=
new
ArrayList
<>();
// 执行数据插入操作 组装
// 执行数据插入操作 组装
for
(
TSalaryEmployeeVo
vo
:
excelVOList
)
{
for
(
TSalaryEmployee
Update
Vo
vo
:
excelVOList
)
{
idCardList
.
add
(
vo
.
getEmpIdcard
());
idCardList
.
add
(
vo
.
getEmpIdcard
());
}
}
List
<
TSalaryEmployee
>
empList
=
baseMapper
.
getListByIdCard
(
idCardList
);
List
<
TSalaryEmployee
>
empList
=
baseMapper
.
getListByIdCard
(
idCardList
);
...
...
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