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
340a3375
Commit
340a3375
authored
Jul 08, 2022
by
huyuchen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
huyc 项目档案代码提交
parent
d5b0fb68
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
212 additions
and
87 deletions
+212
-87
FddContractAttachInfo.java
...d/plus/v1/yifu/archives/entity/FddContractAttachInfo.java
+24
-6
FddContractAttachInfoController.java
.../archives/controller/FddContractAttachInfoController.java
+14
-13
FddContractInfoServiceImpl.java
...ifu/archives/service/impl/FddContractInfoServiceImpl.java
+23
-12
TEmployeeLogServiceImpl.java
...1/yifu/archives/service/impl/TEmployeeLogServiceImpl.java
+1
-0
TEmployeeProjectServiceImpl.java
...fu/archives/service/impl/TEmployeeProjectServiceImpl.java
+77
-56
DoJointTask.java
...m/yifu/cloud/plus/v1/yifu/archives/utils/DoJointTask.java
+73
-0
No files found.
yifu-archives/yifu-archives-api/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/entity/FddContractAttachInfo.java
View file @
340a3375
...
...
@@ -20,12 +20,15 @@ import com.baomidou.mybatisplus.annotation.IdType;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute
;
import
com.yifu.cloud.plus.v1.yifu.common.mybatis.base.BaseEntity
;
import
io.swagger.v3.oas.annotations.media.Schema
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
org.hibernate.validator.constraints.Length
;
import
java.math.BigDecimal
;
import
java.time.LocalDate
;
import
java.time.LocalDateTime
;
import
java.util.Date
;
...
...
@@ -52,66 +55,79 @@ public class FddContractAttachInfo extends BaseEntity {
* 合同id
*/
@Schema
(
description
=
"合同id"
)
@ExcelAttribute
(
name
=
"合同id"
,
errorInfo
=
"员工合同id主键不能为空"
,
maxLength
=
32
)
private
String
contractId
;
/**
* 合同试用期开始时间
*/
@Schema
(
description
=
"合同试用期开始时间"
)
private
Date
periodStart
;
@ExcelAttribute
(
name
=
"合同试用期开始时间"
)
private
LocalDate
periodStart
;
/**
* 合同试用期结束时间
*/
@Schema
(
description
=
"合同试用期结束时间"
)
private
Date
periodEnd
;
@ExcelAttribute
(
name
=
"合同试用期结束时间"
)
private
LocalDate
periodEnd
;
/**
* 合同起始时间
*/
@Schema
(
description
=
"合同起始时间"
)
@ExcelAttribute
(
name
=
"合同起始时间"
,
isNotEmpty
=
true
,
errorInfo
=
"合同起始时间不能为空"
)
private
Date
contractStart
;
/**
* 合同到期时间
*/
@Schema
(
description
=
"合同到期时间"
)
@ExcelAttribute
(
name
=
"合同到期时间"
,
needExport
=
true
)
private
Date
contractEnd
;
/**
* 试用期工资 元/月
*/
@Schema
(
description
=
"试用期工资 元/月"
)
@ExcelAttribute
(
name
=
"试用期工资"
)
private
BigDecimal
periodSalaryPerMonth
;
/**
* 工资形式 1.计时工资 2.计件工资 3.其他
*/
@Schema
(
description
=
"工资形式 1.计时工资 2.计件工资 3.其他"
)
@ExcelAttribute
(
name
=
"工资形式"
,
isDataId
=
true
,
dataType
=
"salary_type"
)
private
String
salaryType
;
/**
* 计时工资 工资标准 元/月
*/
@Schema
(
description
=
"计时工资 工资标准 元/月"
)
@ExcelAttribute
(
name
=
"计时工资"
)
private
BigDecimal
salaryStandardPerHour
;
/**
* 计件工资 工资标准单价/元
*/
@Schema
(
description
=
"计件工资 工资标准单价/元"
)
@ExcelAttribute
(
name
=
"计件工资"
)
private
BigDecimal
salaryStandardPerPiece
;
/**
* 工作地点
*/
@Schema
(
description
=
"工作地点"
)
@Length
(
max
=
200
,
message
=
"工作地点不能超过200个字符"
)
@ExcelAttribute
(
name
=
"工作地点"
,
maxLength
=
200
)
private
String
workSpace
;
/**
* 岗位
*/
@Schema
(
description
=
"岗位"
)
@Length
(
max
=
200
,
message
=
"岗位不能超过200个字符"
)
@ExcelAttribute
(
name
=
"岗位"
,
isNotEmpty
=
true
,
errorInfo
=
"岗位不能为空"
,
maxLength
=
200
,
needExport
=
true
)
private
String
post
;
/**
...
...
@@ -142,12 +158,14 @@ public class FddContractAttachInfo extends BaseEntity {
* 员工姓名
*/
@Schema
(
description
=
"员工姓名"
)
@ExcelAttribute
(
name
=
"员工姓名"
,
isNotEmpty
=
true
,
errorInfo
=
"员工合同id姓名不能为空"
,
maxLength
=
32
,
needExport
=
true
)
private
String
empName
;
/**
* 身份证号码
*/
@Schema
(
description
=
"身份证号码"
)
@ExcelAttribute
(
name
=
"身份证号码"
,
isNotEmpty
=
true
,
errorInfo
=
"身份证号码不能为空"
,
maxLength
=
32
,
needExport
=
true
)
private
String
empIdcard
;
/**
...
...
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/controller/FddContractAttachInfoController.java
View file @
340a3375
...
...
@@ -139,25 +139,25 @@ public class FddContractAttachInfoController {
@PostMapping
(
"/batchAddFddEmpInfo"
)
public
R
batchAddFddEmpInfo
(
@RequestBody
String
jsonString
)
{
R
<
List
<
SysDictItem
>>
res
=
null
;
R
<
Map
<
String
,
List
<
SysDictItem
>
>>
res
=
null
;
ExcelUtil
<
FddContractAttachInfo
>
util1
=
null
;
try
{
// 调用字典服务,渲染字典值
res
=
HttpDaprUtil
.
invokeMethodPost
(
daprUpmsProperties
.
getAppUrl
(),
daprUpmsProperties
.
getAppId
()
,
"/dict/inner/getDictList"
,
null
,
Map
.
class
,
SecurityConstants
.
FROM_IN
);
Map
<
String
,
String
>
dicMap
=
new
HashMap
<>();
if
(
null
!=
res
.
getData
(
))
{
for
(
SysDictItem
dict
:
res
.
getData
(
))
{
dicMap
.
put
(
dict
.
getType
()
+
CommonConstants
.
DOWN_LINE_STRING
+
dict
.
getLabel
(),
dict
.
getValue
());
}
}
//
// 调用字典服务,渲染字典值
//
res = HttpDaprUtil.invokeMethodPost(daprUpmsProperties.getAppUrl(), daprUpmsProperties.getAppId()
//
, "/dict/inner/getDictList", null, Map.class, SecurityConstants.FROM_IN);
//
//
Map<String, String> dicMap = new HashMap<>();
// if (null != res.getData().get("data"
)) {
// for (SysDictItem dict : res.getData().get("data"
)) {
//
dicMap.put(dict.getType() + CommonConstants.DOWN_LINE_STRING + dict.getLabel(), dict.getValue());
//
}
//
}
jsonString
=
URLDecoder
.
decode
(
jsonString
,
CommonConstants
.
UTF8
).
replace
(
"="
,
""
);
util1
=
new
ExcelUtil
<>(
FddContractAttachInfo
.
class
);
//传参字典数据MAP具体见方法实现
util1
.
getJsonStringToList
(
jsonString
,
dicMap
);
util1
.
getJsonStringToList
(
jsonString
,
null
);
if
(
null
!=
util1
.
getErrorInfo
()
&&
!
util1
.
getErrorInfo
().
isEmpty
())
{
return
R
.
failed
(
util1
.
getErrorInfo
(),
"数据异常"
);
}
else
{
...
...
@@ -172,8 +172,9 @@ public class FddContractAttachInfoController {
map
.
put
(
errorMessage
.
getLineNum
(),
util1
.
getEntityList
().
get
(
errorMessage
.
getLineNum
()-
2
));
}
variableMap
.
put
(
"data"
,
map
);
}
return
R
.
ok
(
variableMap
);
}
return
new
R
<>(
CommonConstants
.
dingleDigitIntArray
[
1
],
""
,
errorInfo
);
}
else
{
return
R
.
ok
(
null
,
"无数据可导入"
);
}
...
...
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/service/impl/FddContractInfoServiceImpl.java
View file @
340a3375
...
...
@@ -71,6 +71,9 @@ import javax.servlet.http.HttpServletResponse;
import
java.io.BufferedOutputStream
;
import
java.io.IOException
;
import
java.net.URLEncoder
;
import
java.time.LocalDate
;
import
java.time.ZoneId
;
import
java.time.ZonedDateTime
;
import
java.util.*
;
import
java.util.stream.Collectors
;
...
...
@@ -668,17 +671,17 @@ public class FddContractInfoServiceImpl extends ServiceImpl<FddContractInfoMappe
if
(
attachInfo
.
getPeriodStart
()
==
null
)
{
return
R
.
failed
(
"新签试用期开始时间为空"
);
}
paramter
.
put
(
"fPeriodStartY"
,
DateUtil
.
format
(
attachInfo
.
getPeriodStart
(
),
"yyyy"
));
paramter
.
put
(
"fPeriodStartM"
,
DateUtil
.
format
(
attachInfo
.
getPeriodStart
(
),
"MM"
));
paramter
.
put
(
"fPeriodStartD"
,
DateUtil
.
format
(
attachInfo
.
getPeriodStart
(
),
"dd"
));
paramter
.
put
(
"fPeriodStartY"
,
DateUtil
.
format
(
localDate2Date
(
attachInfo
.
getPeriodStart
()
),
"yyyy"
));
paramter
.
put
(
"fPeriodStartM"
,
DateUtil
.
format
(
localDate2Date
(
attachInfo
.
getPeriodStart
()
),
"MM"
));
paramter
.
put
(
"fPeriodStartD"
,
DateUtil
.
format
(
localDate2Date
(
attachInfo
.
getPeriodStart
()
),
"dd"
));
}
if
(
Common
.
isNotNull
(
companyFieldMap
.
get
(
"fPeriodEndY"
))){
if
(
attachInfo
.
getPeriodEnd
()
==
null
)
{
return
R
.
failed
(
"新签试用期结束时间为空"
);
}
paramter
.
put
(
"fPeriodEndY"
,
DateUtil
.
format
(
attachInfo
.
getPeriodEnd
(
),
"yyyy"
));
paramter
.
put
(
"fPeriodEndM"
,
DateUtil
.
format
(
attachInfo
.
getPeriodEnd
(
),
"MM"
));
paramter
.
put
(
"fPeriodEndD"
,
DateUtil
.
format
(
attachInfo
.
getPeriodEnd
(
),
"dd"
));
paramter
.
put
(
"fPeriodEndY"
,
DateUtil
.
format
(
localDate2Date
(
attachInfo
.
getPeriodEnd
()
),
"yyyy"
));
paramter
.
put
(
"fPeriodEndM"
,
DateUtil
.
format
(
localDate2Date
(
attachInfo
.
getPeriodEnd
()
),
"MM"
));
paramter
.
put
(
"fPeriodEndD"
,
DateUtil
.
format
(
localDate2Date
(
attachInfo
.
getPeriodEnd
()
),
"dd"
));
}
if
(
Common
.
isNotNull
(
companyFieldMap
.
get
(
"periodSalaryPerMonth"
))){
if
(
attachInfo
.
getPeriodSalaryPerMonth
()
==
null
)
{
...
...
@@ -807,15 +810,15 @@ public class FddContractInfoServiceImpl extends ServiceImpl<FddContractInfoMappe
if
(
attachInfo
.
getPeriodStart
()
==
null
)
{
return
R
.
failed
(
"新签试用期开始时间为空"
);
}
paramter
.
put
(
"fPeriodStartY"
,
DateUtil
.
format
(
attachInfo
.
getPeriodStart
(
),
"yyyy"
));
paramter
.
put
(
"fPeriodStartM"
,
DateUtil
.
format
(
attachInfo
.
getPeriodStart
(
),
"MM"
));
paramter
.
put
(
"fPeriodStartD"
,
DateUtil
.
format
(
attachInfo
.
getPeriodStart
(
),
"dd"
));
paramter
.
put
(
"fPeriodStartY"
,
DateUtil
.
format
(
localDate2Date
(
attachInfo
.
getPeriodStart
()
),
"yyyy"
));
paramter
.
put
(
"fPeriodStartM"
,
DateUtil
.
format
(
localDate2Date
(
attachInfo
.
getPeriodStart
()
),
"MM"
));
paramter
.
put
(
"fPeriodStartD"
,
DateUtil
.
format
(
localDate2Date
(
attachInfo
.
getPeriodStart
()
),
"dd"
));
if
(
attachInfo
.
getPeriodEnd
()
==
null
)
{
return
R
.
failed
(
"新签试用期结束时间为空"
);
}
paramter
.
put
(
"fPeriodEndY"
,
DateUtil
.
format
(
attachInfo
.
getPeriodEnd
(
),
"yyyy"
));
paramter
.
put
(
"fPeriodEndM"
,
DateUtil
.
format
(
attachInfo
.
getPeriodEnd
(
),
"MM"
));
paramter
.
put
(
"fPeriodEndD"
,
DateUtil
.
format
(
attachInfo
.
getPeriodEnd
(
),
"dd"
));
paramter
.
put
(
"fPeriodEndY"
,
DateUtil
.
format
(
localDate2Date
(
attachInfo
.
getPeriodEnd
()
),
"yyyy"
));
paramter
.
put
(
"fPeriodEndM"
,
DateUtil
.
format
(
localDate2Date
(
attachInfo
.
getPeriodEnd
()
),
"MM"
));
paramter
.
put
(
"fPeriodEndD"
,
DateUtil
.
format
(
localDate2Date
(
attachInfo
.
getPeriodEnd
()
),
"dd"
));
if
(
attachInfo
.
getPeriodSalaryPerMonth
()
==
null
)
{
return
R
.
failed
(
"新签试用期工资为空"
);
}
...
...
@@ -859,6 +862,14 @@ public class FddContractInfoServiceImpl extends ServiceImpl<FddContractInfoMappe
return
new
R
<>(
paramter
.
toJSONString
());
}
public
static
Date
localDate2Date
(
LocalDate
localDate
)
{
if
(
null
==
localDate
)
{
return
null
;
}
ZonedDateTime
zonedDateTime
=
localDate
.
atStartOfDay
(
ZoneId
.
systemDefault
());
return
Date
.
from
(
zonedDateTime
.
toInstant
());
}
/**
* @param entity
* @Author: huyc
...
...
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/service/impl/TEmployeeLogServiceImpl.java
View file @
340a3375
...
...
@@ -47,6 +47,7 @@ public class TEmployeeLogServiceImpl extends ServiceImpl<TEmployeeLogMapper, TEm
String
differenceKey
=
HrEquator
.
comparisonValue
(
oldInfo
,
newInfo
);
//如果有差异保存差异
if
(!
Common
.
isEmpty
(
differenceKey
)){
YifuUser
user
=
SecurityUtils
.
getUser
();
TEmployeeLog
record
=
new
TEmployeeLog
();
record
.
setProjectId
(
projectId
);
record
.
setType
(
type
);
...
...
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/service/impl/TEmployeeProjectServiceImpl.java
View file @
340a3375
...
...
@@ -38,6 +38,7 @@ import com.yifu.cloud.plus.v1.yifu.archives.mapper.TEmployeeProjectMapper;
import
com.yifu.cloud.plus.v1.yifu.archives.service.TEmployeeLogService
;
import
com.yifu.cloud.plus.v1.yifu.archives.service.TEmployeeProjectService
;
import
com.yifu.cloud.plus.v1.yifu.archives.service.TSettleDomainService
;
import
com.yifu.cloud.plus.v1.yifu.archives.utils.DoJointTask
;
import
com.yifu.cloud.plus.v1.yifu.archives.vo.*
;
import
com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants
;
import
com.yifu.cloud.plus.v1.yifu.common.core.exception.ErrorCodes
;
...
...
@@ -46,6 +47,8 @@ import com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser;
import
com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils
;
import
lombok.RequiredArgsConstructor
;
import
lombok.extern.log4j.Log4j2
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.context.annotation.Lazy
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.validation.BindingResult
;
...
...
@@ -70,13 +73,21 @@ import java.util.stream.Collectors;
@Log4j2
public
class
TEmployeeProjectServiceImpl
extends
ServiceImpl
<
TEmployeeProjectMapper
,
TEmployeeProject
>
implements
TEmployeeProjectService
{
private
final
TEmployeeLogService
tEmployeeLogService
;
@Autowired
private
TEmployeeLogService
tEmployeeLogService
;
private
final
TEmployeeInfoMapper
tEmployeeInfoMapper
;
@Autowired
private
TEmployeeInfoMapper
tEmployeeInfoMapper
;
private
final
TSettleDomainService
tSettleDomainService
;
@Autowired
private
TSettleDomainService
tSettleDomainService
;
private
final
TCustomerInfoMapper
tCustomerInfoMapper
;
@Autowired
private
TCustomerInfoMapper
tCustomerInfoMapper
;
@Autowired
@Lazy
private
DoJointTask
doJointTask
;
@Override
public
R
addCheck
(
TEmployeeProject
tEmployeeProject
)
{
...
...
@@ -334,7 +345,7 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
.
eq
(
TEmployeeProject:
:
getEmpIdcard
,
excel
.
getEmpIdcard
())
.
eq
(
TEmployeeProject:
:
getDeptNo
,
excel
.
getDeptNo
())
.
eq
(
TEmployeeProject:
:
getDeleteFlag
,
CommonConstants
.
STATUS_NORMAL
)
.
eq
(
TEmployeeProject:
:
getProjectStatus
,
CommonConstants
.
STATUS_NORMAL
));
.
eq
(
TEmployeeProject:
:
getProjectStatus
,
CommonConstants
.
ZERO_INT
));
if
(
Common
.
isNotNull
(
tEmployeeProject
))
{
if
(
tEmployeeProject
.
getInsuranceStatus
()
!=
CommonConstants
.
dingleDigitIntArray
[
0
]
||
tEmployeeProject
.
getSocialStatus
()
!=
CommonConstants
.
dingleDigitIntArray
[
0
]
||
...
...
@@ -368,11 +379,6 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
}
}
}
}
}
else
{
idList
.
add
(
tEmployeeProject
);
errorMessageList
.
add
(
new
ErrorMessage
(
excel
.
getRowIndex
(),
MsgUtils
.
getMessage
(
ErrorCodes
.
PROJECT_PERSON_SEARCH_EXIT
)));
}
TEmployeeInfo
tEmployeeInfoOld
=
tEmployeeInfoMapper
.
selectById
(
tEmployeeProject
.
getEmpId
());
TEmployeeInfo
tEmployeeInfo
=
tEmployeeInfoMapper
.
selectById
(
tEmployeeProject
.
getEmpId
());
List
<
String
>
projectIdList
=
idList
.
stream
().
map
(
TEmployeeProject:
:
getId
).
collect
(
Collectors
.
toList
());
...
...
@@ -384,6 +390,11 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
newOld
.
setNewEmployee
(
tEmployeeInfo
);
updateList
.
add
(
newOld
);
}
}
else
{
idList
.
add
(
tEmployeeProject
);
errorMessageList
.
add
(
new
ErrorMessage
(
excel
.
getRowIndex
(),
MsgUtils
.
getMessage
(
ErrorCodes
.
PROJECT_PERSON_SEARCH_EXIT
)));
}
}
if
(
errorMessageList
.
size
()
>
CommonConstants
.
ZERO_INT
)
{
return
R
.
failed
(
errorMessageList
);
}
else
{
...
...
@@ -679,11 +690,22 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
// 通用校验获取失败的数据
Map
<
Long
,
ErrorMessage
>
errorMsgMap
=
new
HashMap
<>();
// 项目档案更新List
List
<
TEmployeeProject
>
updateList
=
new
ArrayList
<>();
// 人员档案更新List
List
<
TEmployeeInfo
>
updTEmployeeList
=
new
ArrayList
();
Map
<
String
,
Integer
>
checkCountMap
=
new
HashMap
<>();
// 新老档案List
List
<
EmployeeNewOldVO
>
updateInfoList
=
new
ArrayList
<>();
// 新老档案vo
EmployeeNewOldVO
newOld
;
// 新老项目档案vo
EmployeeProjectNewOldVO
newOldProject
;
// 新老项目档案List
List
<
EmployeeProjectNewOldVO
>
updateProjectList
=
new
ArrayList
<>();
// 执行数据插入操作 组装
for
(
int
i
=
0
;
i
<
excelVOList
.
size
();
i
++)
{
// 已有验证报错直接下一个
...
...
@@ -711,25 +733,17 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
}
}
else
{
updateExcelProj
(
excel
,
updateList
,
tEmployeeProject
);
if
(
Common
.
isNotNull
(
excel
.
getEmpNatrue
()))
{
if
(!
excel
.
getEmpNatrue
().
equals
(
tEmployeeProject
.
getEmpNatrue
()))
{
TEmployeeProject
tEmployeeProjectOld
=
this
.
getById
(
tEmployeeProject
.
getId
());
newOldProject
=
new
EmployeeProjectNewOldVO
();
newOldProject
.
setOldProjectEmployee
(
tEmployeeProjectOld
);
newOldProject
.
setNewProjectEmployee
(
tEmployeeProject
);
updateProjectList
.
add
(
newOldProject
);
TEmployeeInfo
tEmployeeInfo
=
tEmployeeInfoMapper
.
selectOne
(
Wrappers
.<
TEmployeeInfo
>
query
().
lambda
()
.
eq
(
TEmployeeInfo:
:
getEmpIdcard
,
excel
.
getEmpIdcard
())
.
eq
(
TEmployeeInfo:
:
getFileStatus
,
CommonConstants
.
ZERO_INT
)
.
eq
(
TEmployeeInfo:
:
getDeleteFlag
,
CommonConstants
.
STATUS_NORMAL
));
if
(
Common
.
isNotNull
(
tEmployeeInfo
))
{
TEmployeeInfo
tEmployeeInfoCof
=
tEmployeeInfoMapper
.
selectById
(
tEmployeeInfo
.
getId
());
String
empNature
=
tEmployeeInfo
.
getEmpNatrue
();
if
(
CommonConstants
.
ZERO_STRING
.
equals
(
excel
.
getEmpNatrue
()))
{
tEmployeeInfo
.
setEmpNatrue
(
CommonConstants
.
ZERO_STRING
);
}
else
if
(
CommonConstants
.
ONE_STRING
.
equals
(
excel
.
getEmpNatrue
())
&&
!
CommonConstants
.
ZERO_STRING
.
equals
(
empNature
))
{
tEmployeeInfo
.
setEmpNatrue
(
CommonConstants
.
ONE_STRING
);
}
updTEmployeeList
.
add
(
tEmployeeInfo
);
tEmployeeLogService
.
saveModificationRecord
(
CommonConstants
.
dingleDigitIntArray
[
0
],
tEmployeeInfo
.
getId
(),
""
,
tEmployeeInfoCof
,
tEmployeeInfo
);
}
}
}
}
}
...
...
@@ -740,10 +754,18 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
baseMapper
.
updateExcelEmpProject
(
updateList
);
}
if
(
updTEmployeeList
.
size
()>
CommonConstants
.
dingleDigitIntArray
[
0
])
{
for
(
TEmployeeInfo
tEmployeeInfo
:
updTEmployeeList
)
{
tEmployeeInfoMapper
.
updateById
(
tEmployeeInfo
);
List
<
TEmployeeInfo
>
updEmpInfoList
=
updTEmployeeList
.
stream
().
distinct
().
collect
(
Collectors
.
toList
());
doJointTask
.
doUpdateEmployeeInfo
(
updEmpInfoList
);
}
// 记录变更日志
if
(
updateInfoList
.
size
()
>
CommonConstants
.
dingleDigitIntArray
[
0
])
{
for
(
EmployeeNewOldVO
newOldInfo
:
updateInfoList
)
{
tEmployeeLogService
.
saveModificationRecord
(
CommonConstants
.
dingleDigitIntArray
[
0
]
,
newOldInfo
.
getOldEmployee
().
getId
(),
""
,
newOldInfo
.
getOldEmployee
(),
newOldInfo
.
getNewEmployee
());
}
}
}
catch
(
Exception
e
)
{
log
.
error
(
"数据更新异常"
,
e
);
}
...
...
@@ -978,9 +1000,6 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
YifuUser
user
=
SecurityUtils
.
getUser
();
tEmployeeProject
.
setUpdateBy
(
user
.
getId
());
proupdateList
.
add
(
tEmployeeProject
);
// 记录变更日志
TEmployeeProject
tEmployeeProjectOld
=
this
.
getById
(
tEmployeeProject
.
getId
());
tEmployeeLogService
.
saveModificationRecord
(
CommonConstants
.
dingleDigitIntArray
[
1
],
""
,
tEmployeeProject
.
getId
(),
tEmployeeProjectOld
,
tEmployeeProject
);
}
@Override
...
...
@@ -1032,7 +1051,7 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
public
R
<
Map
<
String
,
String
>>
getProjectByIdCard
(
String
empIdCard
)
{
List
<
TEmployeeProject
>
projects
=
baseMapper
.
selectList
(
Wrappers
.<
TEmployeeProject
>
query
().
lambda
()
.
eq
(
TEmployeeProject:
:
getDeleteFlag
,
CommonConstants
.
ZERO_STRING
)
.
eq
(
TEmployeeProject:
:
getProjectStatus
,
CommonConstants
.
ZERO_
STRING
)
.
eq
(
TEmployeeProject:
:
getProjectStatus
,
CommonConstants
.
ZERO_
INT
)
.
eq
(
TEmployeeProject:
:
getEmpIdcard
,
empIdCard
));
Map
<
String
,
String
>
projectMap
=
new
HashMap
<>();
if
(
Common
.
isNotNull
(
projects
))
{
...
...
@@ -1057,6 +1076,7 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
//从剩下的项目档案中查找员工类型
public
void
setEmpNature
(
String
empIdcard
,
TEmployeeInfo
tEmployeeInfo
,
List
<
String
>
idlist
)
{
if
(
Common
.
isNotNull
(
idlist
))
{
List
<
TEmployeeProject
>
list
=
this
.
list
(
Wrappers
.<
TEmployeeProject
>
query
().
lambda
()
.
in
(
TEmployeeProject:
:
getId
,
idlist
)
.
eq
(
TEmployeeProject:
:
getEmpIdcard
,
empIdcard
)
...
...
@@ -1076,6 +1096,7 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
}
}
}
}
public
boolean
saveCheck
(
EmployeeXProjectVO
employeeXProjectVO
,
TEmployeeProject
tEmployeeProject
)
{
if
(
employeeXProjectVO
.
getDeptNo
().
equals
(
tEmployeeProject
.
getDeptNo
())
&&
...
...
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/utils/DoJointTask.java
0 → 100644
View file @
340a3375
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
archives
.
utils
;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
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.service.TEmployeeInfoService
;
import
com.yifu.cloud.plus.v1.yifu.archives.service.TEmployeeLogService
;
import
com.yifu.cloud.plus.v1.yifu.archives.service.TEmployeeProjectService
;
import
com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.scheduling.annotation.Async
;
import
org.springframework.stereotype.Component
;
import
java.util.List
;
/**
* 主要执行人员档案的员工类型同步更新
* @author huyc
* @Date 2022-07-08
* @Description 多线程的执行demo
*/
@Slf4j
@Component
public
class
DoJointTask
{
@Autowired
private
TEmployeeInfoService
tEmployeeInfoService
;
@Autowired
private
TEmployeeProjectService
tEmployeeProjectService
;
@Autowired
private
TEmployeeLogService
tEmployeeLogService
;
/**
* @Description: 合同-批量更换负责人
* @Author: huyc
* @Date: 2022-7-8
* @return: void
**/
@Async
public
void
doUpdateEmployeeInfo
(
List
<
TEmployeeInfo
>
tEmployeeInfoList
)
{
log
.
info
(
"档案-批量更新人员档案-线程开始"
);
try
{
for
(
TEmployeeInfo
tEmployeeInfo:
tEmployeeInfoList
)
{
TEmployeeInfo
tEmployeeInfoOld
=
tEmployeeInfoService
.
getById
(
tEmployeeInfo
.
getId
());
//查询该人员所有的项目档案
List
<
TEmployeeProject
>
list
=
tEmployeeProjectService
.
list
(
Wrappers
.<
TEmployeeProject
>
query
().
lambda
()
.
eq
(
TEmployeeProject:
:
getEmpIdcard
,
tEmployeeInfo
.
getEmpIdcard
())
.
eq
(
TEmployeeProject:
:
getDeleteFlag
,
CommonConstants
.
STATUS_NORMAL
)
.
eq
(
TEmployeeProject:
:
getProjectStatus
,
CommonConstants
.
ZERO_INT
));
for
(
TEmployeeProject
tEmployeeProject:
list
)
{
if
(
CommonConstants
.
ZERO_STRING
.
equals
(
tEmployeeProject
.
getEmpNatrue
()))
{
tEmployeeInfo
.
setEmpNatrue
(
CommonConstants
.
ZERO_STRING
);
break
;
}
else
if
(
CommonConstants
.
ONE_STRING
.
equals
(
tEmployeeProject
.
getEmpNatrue
())
&&
!
CommonConstants
.
ZERO_STRING
.
equals
(
tEmployeeInfo
.
getEmpNatrue
()))
{
tEmployeeInfo
.
setEmpNatrue
(
CommonConstants
.
ONE_STRING
);
break
;
}
tEmployeeInfo
.
setEmpNatrue
(
CommonConstants
.
TWO_STRING
);
}
tEmployeeInfoService
.
updateById
(
tEmployeeInfo
);
tEmployeeLogService
.
saveModificationRecord
(
CommonConstants
.
dingleDigitIntArray
[
0
]
,
tEmployeeInfo
.
getId
(),
""
,
tEmployeeInfoOld
,
tEmployeeInfo
);
}
}
catch
(
Exception
e
)
{
log
.
error
(
"档案-批量更新人员档案错误"
,
e
);
}
log
.
info
(
"档案-批量更新人员档案结束"
);
}
}
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