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
b88c39cf
Commit
b88c39cf
authored
Jul 03, 2023
by
huyuchen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化修改
parent
1ea9af7b
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
46 additions
and
2 deletions
+46
-2
TEmployeeLogService.java
...ud/plus/v1/yifu/archives/service/TEmployeeLogService.java
+14
-0
TEmployeeLogServiceImpl.java
...1/yifu/archives/service/impl/TEmployeeLogServiceImpl.java
+30
-0
TEmployeeProjectServiceImpl.java
...fu/archives/service/impl/TEmployeeProjectServiceImpl.java
+2
-2
No files found.
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/service/TEmployeeLogService.java
View file @
b88c39cf
...
...
@@ -20,6 +20,7 @@ package com.yifu.cloud.plus.v1.yifu.archives.service;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.yifu.cloud.plus.v1.yifu.archives.entity.FddContractAttachInfo
;
import
com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeLog
;
import
com.yifu.cloud.plus.v1.yifu.archives.vo.UpProjectSocialFundVo
;
import
com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser
;
/**
...
...
@@ -56,6 +57,19 @@ public interface TEmployeeLogService extends IService<TEmployeeLog> {
**/
<
T
>
TEmployeeLog
saveModificationRecord
(
Integer
type
,
String
empId
,
String
projectId
,
T
oldInfo
,
T
newInfo
,
YifuUser
user
);
/**
* 生成修改记录
* @Author pwang
* @Date 2022-06-22 11:32
* @param type 类型:0人员档案;1项目档案;2人员和项目档案;3员工合同更新
* @param empId 档案id
* @param projectId 项目id
* @param oldInfo
* @param newInfo
* @return
**/
<
T
>
TEmployeeLog
saveModificationRecord
(
Integer
type
,
String
empId
,
String
projectId
,
T
oldInfo
,
T
newInfo
,
UpProjectSocialFundVo
vo
);
/**
* 生成修改记录
* @Author pwang
...
...
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/service/impl/TEmployeeLogServiceImpl.java
View file @
b88c39cf
...
...
@@ -23,6 +23,7 @@ import com.yifu.cloud.plus.v1.yifu.archives.entity.FddContractAttachInfo;
import
com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeLog
;
import
com.yifu.cloud.plus.v1.yifu.archives.mapper.TEmployeeLogMapper
;
import
com.yifu.cloud.plus.v1.yifu.archives.service.TEmployeeLogService
;
import
com.yifu.cloud.plus.v1.yifu.archives.vo.UpProjectSocialFundVo
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.Common
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.equator.HrEquator
;
import
com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser
;
...
...
@@ -95,6 +96,35 @@ public class TEmployeeLogServiceImpl extends ServiceImpl<TEmployeeLogMapper, TEm
return
null
;
}
@Override
public
<
T
>
TEmployeeLog
saveModificationRecord
(
Integer
type
,
String
empId
,
String
projectId
,
T
oldInfo
,
T
newInfo
,
UpProjectSocialFundVo
vo
)
{
try
{
//比较记录不影响业务逻辑,用try套住
//比较差异
String
differenceKey
=
HrEquator
.
comparisonValue
(
oldInfo
,
newInfo
);
//如果有差异保存差异
if
(!
Common
.
isEmpty
(
differenceKey
)){
TEmployeeLog
employeeLog
=
new
TEmployeeLog
();
employeeLog
.
setProjectId
(
projectId
);
employeeLog
.
setType
(
type
);
employeeLog
.
setEmpId
(
empId
);
employeeLog
.
setCreateTime
(
LocalDateTime
.
now
());
if
(
Common
.
isNotNull
(
vo
))
{
employeeLog
.
setCreateBy
(
vo
.
getUserId
());
employeeLog
.
setCreateName
(
vo
.
getUserName
());
}
employeeLog
.
setOldInfo
(
JSON
.
toJSONString
(
oldInfo
,
features
));
employeeLog
.
setNewInfo
(
JSON
.
toJSONString
(
newInfo
,
features
));
employeeLog
.
setDifferenceInfo
(
differenceKey
);
baseMapper
.
insert
(
employeeLog
);
return
employeeLog
;
}
}
catch
(
Exception
e
){
log
.
error
(
JSON
.
toJSON
(
oldInfo
)+
"插入修改记录报错>>>"
,
e
);
}
return
null
;
}
@Override
public
<
T
>
TEmployeeLog
saveModificationRecord
(
Integer
type
,
String
empId
,
String
projectId
,
T
oldInfo
,
T
newInfo
,
FddContractAttachInfo
fddContractAttachInfo
)
{
try
{
...
...
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/service/impl/TEmployeeProjectServiceImpl.java
View file @
b88c39cf
...
...
@@ -1491,7 +1491,7 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
failueInfo
.
append
(
"存在社保/公积金,无法减项"
);
}
tEmployeeLogService
.
saveModificationRecord
(
CommonConstants
.
dingleDigitIntArray
[
1
],
""
,
tEmployeeProject
.
getId
(),
tEmployeeProjectOld
,
tEmployeeProject
);
tEmployeeProject
.
getId
(),
tEmployeeProjectOld
,
tEmployeeProject
,
vo
);
baseMapper
.
updateById
(
tEmployeeProject
);
//如果项目档案已减项,如果人员存在多个项目不处理,反之则减档
TEmployeeInfo
tEmployeeInfo
=
tEmployeeInfoMapper
.
selectById
(
tEmployeeProject
.
getEmpId
());
...
...
@@ -1527,7 +1527,7 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
}
}
tEmployeeLogService
.
saveModificationRecord
(
CommonConstants
.
dingleDigitIntArray
[
0
],
tEmployeeInfo
.
getId
(),
""
,
tEmployeeInfoOld
,
tEmployeeInfo
);
""
,
tEmployeeInfoOld
,
tEmployeeInfo
,
vo
);
tEmployeeInfoMapper
.
updateById
(
tEmployeeInfo
);
}
}
...
...
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