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
67506bc9
Commit
67506bc9
authored
Jul 06, 2022
by
fangxinjiang
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/develop' into develop
parents
daff768f
1169719f
Hide whitespace changes
Inline
Side-by-side
Showing
19 changed files
with
418 additions
and
193 deletions
+418
-193
TEmployeeInfo.java
...ifu/cloud/plus/v1/yifu/archives/entity/TEmployeeInfo.java
+7
-1
TEmployeeProject.java
.../cloud/plus/v1/yifu/archives/entity/TEmployeeProject.java
+5
-4
EmployeeExportVO.java
...yifu/cloud/plus/v1/yifu/archives/vo/EmployeeExportVO.java
+8
-8
EmployeeVO.java
...a/com/yifu/cloud/plus/v1/yifu/archives/vo/EmployeeVO.java
+0
-2
EmployeeXProjectVO.java
...fu/cloud/plus/v1/yifu/archives/vo/EmployeeXProjectVO.java
+1
-1
TEmpChangeInfoVO.java
...yifu/cloud/plus/v1/yifu/archives/vo/TEmpChangeInfoVO.java
+10
-2
TEmployeeProjectController.java
.../yifu/archives/controller/TEmployeeProjectController.java
+1
-1
TEmployeeProjectService.java
...lus/v1/yifu/archives/service/TEmployeeProjectService.java
+2
-0
TEmpChangeInfoServiceImpl.java
...yifu/archives/service/impl/TEmpChangeInfoServiceImpl.java
+26
-4
TEmployeeInfoServiceImpl.java
.../yifu/archives/service/impl/TEmployeeInfoServiceImpl.java
+54
-25
TEmployeeProjectServiceImpl.java
...fu/archives/service/impl/TEmployeeProjectServiceImpl.java
+249
-125
FddContractAttachInfoMapper.xml
...src/main/resources/mapper/FddContractAttachInfoMapper.xml
+0
-3
TElecEmployeeInfoMapper.xml
...biz/src/main/resources/mapper/TElecEmployeeInfoMapper.xml
+1
-4
TEmployeeInfoMapper.xml
...ves-biz/src/main/resources/mapper/TEmployeeInfoMapper.xml
+6
-6
TEmployeeProjectMapper.xml
...-biz/src/main/resources/mapper/TEmployeeProjectMapper.xml
+8
-4
CommonConstants.java
...ud.plus.v1/yifu/common/core/constant/CommonConstants.java
+3
-0
ErrorCodes.java
....cloud.plus.v1/yifu/common/core/exception/ErrorCodes.java
+25
-0
messages_zh_CN.properties
...on-core/src/main/resources/i18n/messages_zh_CN.properties
+9
-0
AreaController.java
...u.cloud.plus.v1/yifu/admin/controller/AreaController.java
+3
-3
No files found.
yifu-archives/yifu-archives-api/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/entity/TEmployeeInfo.java
View file @
67506bc9
...
...
@@ -244,8 +244,9 @@ public class TEmployeeInfo extends BaseEntity {
/**
* 人员档案来源(字典:4人员档案新建、5项目档案新建、1社保/公积金、3商险、2薪酬)
* 1=社保、公积金派单,2=人员发薪,3=商险派单,4=档案新建,5=批量导入
*/
@Schema
(
description
=
"人员档案来源(字典:
4人员档案新建、5项目档案新建、1社保/公积金、3商险、2薪酬
)"
)
@Schema
(
description
=
"人员档案来源(字典:
1=社保、公积金派单,2=人员发薪,3=商险派单,4=档案新建,5=批量导入
)"
)
private
String
fileSource
;
/**
...
...
@@ -306,29 +307,34 @@ public class TEmployeeInfo extends BaseEntity {
* 减档操作人id
*/
@Schema
(
description
=
"减档操作人id"
)
@TableField
(
updateStrategy
=
FieldStrategy
.
IGNORED
)
private
String
leaveUser
;
/**
* 减档操作人姓名
*/
@Schema
(
description
=
"离职操作姓名"
)
@TableField
(
updateStrategy
=
FieldStrategy
.
IGNORED
)
private
String
leaveUserName
;
/**
* 离职时间
*/
@Schema
(
description
=
"离职时间"
)
@TableField
(
updateStrategy
=
FieldStrategy
.
IGNORED
)
private
LocalDateTime
leaveTime
;
/**
* 离职原因
*/
@Schema
(
description
=
"离职原因"
)
@TableField
(
updateStrategy
=
FieldStrategy
.
IGNORED
)
private
String
leaveReason
;
/**
* 离职备注
*/
@Schema
(
description
=
"离职备注"
)
@TableField
(
updateStrategy
=
FieldStrategy
.
IGNORED
)
private
String
leaveRemark
;
/**
...
...
yifu-archives/yifu-archives-api/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/entity/TEmployeeProject.java
View file @
67506bc9
...
...
@@ -16,10 +16,7 @@
*/
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
archives
.
entity
;
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.baomidou.mybatisplus.annotation.*
;
import
com.yifu.cloud.plus.v1.yifu.common.mybatis.base.BaseEntity
;
import
io.swagger.v3.oas.annotations.media.Schema
;
import
lombok.Data
;
...
...
@@ -110,24 +107,28 @@ public class TEmployeeProject extends BaseEntity {
* 减项操作人id
*/
@Schema
(
description
=
"减项操作人id"
)
@TableField
(
updateStrategy
=
FieldStrategy
.
IGNORED
)
private
String
leaveUser
;
/**
* 减项时间
*/
@Schema
(
description
=
"减项时间"
)
@TableField
(
updateStrategy
=
FieldStrategy
.
IGNORED
)
private
LocalDateTime
leaveTime
;
/**
* 减项原因
*/
@Schema
(
description
=
"减项原因"
)
@TableField
(
updateStrategy
=
FieldStrategy
.
IGNORED
)
private
String
leaveReason
;
/**
* 减项备注
*/
@Schema
(
description
=
"减项备注"
)
@TableField
(
updateStrategy
=
FieldStrategy
.
IGNORED
)
private
String
leaveRemark
;
/**
...
...
yifu-archives/yifu-archives-api/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/vo/EmployeeExportVO.java
View file @
67506bc9
...
...
@@ -17,6 +17,7 @@
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
archives
.
vo
;
import
com.alibaba.excel.annotation.ExcelProperty
;
import
com.alibaba.excel.annotation.format.DateTimeFormat
;
import
com.alibaba.excel.annotation.write.style.ColumnWidth
;
import
com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute
;
import
com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttributeConstants
;
...
...
@@ -55,9 +56,11 @@ public class EmployeeExportVO extends BaseEntity {
private
String
empIdcard
;
@ExcelProperty
(
value
=
"身份证开始日期"
)
@DateTimeFormat
(
"yyyy-MM-dd"
)
private
LocalDateTime
validityStart
;
@ExcelProperty
(
value
=
"身份证截止日期"
)
@DateTimeFormat
(
"yyyy-MM-dd"
)
private
LocalDateTime
validityEnd
;
@ExcelAttribute
(
name
=
"婚姻状况"
,
isDataId
=
true
,
dataType
=
ExcelAttributeConstants
.
EMP_MARRIED
)
...
...
@@ -121,18 +124,21 @@ public class EmployeeExportVO extends BaseEntity {
private
String
major
;
@ExcelProperty
(
value
=
"入学时间"
)
@DateTimeFormat
(
"yyyy-MM-dd"
)
private
LocalDateTime
admissionDate
;
@ExcelProperty
(
value
=
"毕业时间"
)
@DateTimeFormat
(
"yyyy-MM-dd"
)
private
LocalDateTime
gradutionDate
;
@ExcelProperty
(
value
=
"档案备注"
)
private
String
remark
;
/**
* 人员档案来源(字典:4人员档案新建、5项目档案新建、1社保/公积金、3商险、2薪酬)
* 人员档案来源(字典:4档案新增、5项目档案新建、1社保/公积金、3商险、2薪酬)
* 档案新建、批量导入、社保/公积金派单、商险派单、人员发薪
*/
@ExcelAttribute
(
name
=
"人员档案来源"
,
readConverterExp
=
"1=社保
公积金,2=薪酬,3=商险,4=人员档案新建
"
)
@ExcelAttribute
(
name
=
"人员档案来源"
,
readConverterExp
=
"1=社保
、公积金派单,2=人员发薪,3=商险派单,4=档案新建,5=批量导入
"
)
@ExcelProperty
(
value
=
"人员档案来源"
)
private
String
fileSource
;
...
...
@@ -183,12 +189,6 @@ public class EmployeeExportVO extends BaseEntity {
@ExcelProperty
(
value
=
"近3个月发薪"
)
private
String
salaryStatus
;
@ExcelProperty
(
value
=
"创建人"
)
private
String
createName
;
@ExcelProperty
(
value
=
"创建时间"
)
private
LocalDateTime
proCreateTime
;
@ExcelProperty
(
value
=
"减档操作人"
)
private
String
leaveUserName
;
...
...
yifu-archives/yifu-archives-api/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/vo/EmployeeVO.java
View file @
67506bc9
...
...
@@ -21,7 +21,6 @@ import com.alibaba.excel.annotation.write.style.ColumnWidth;
import
io.swagger.v3.oas.annotations.media.Schema
;
import
lombok.Data
;
import
javax.validation.constraints.Max
;
import
javax.validation.constraints.NotNull
;
import
javax.validation.constraints.Size
;
import
java.io.Serializable
;
...
...
@@ -42,7 +41,6 @@ public class EmployeeVO implements Serializable {
/**
* 员工类型(字典值,0外包1派遣2代理)
*/
@NotNull
(
message
=
"员工类型不能为空"
)
@ExcelProperty
(
value
=
"员工类型"
)
private
String
empNatrue
;
...
...
yifu-archives/yifu-archives-api/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/vo/EmployeeXProjectVO.java
View file @
67506bc9
...
...
@@ -80,5 +80,5 @@ public class EmployeeXProjectVO extends RowIndex implements Serializable {
@ExcelProperty
(
value
=
"是否同步减档"
)
@NotNull
(
message
=
"是否同步减档不能为空"
)
@ExcelAttribute
(
name
=
"是否同步减档"
,
isNotEmpty
=
true
,
errorInfo
=
"是否同步减档不能为空"
,
maxLength
=
1
)
private
Integer
isLeaveEmployee
;
private
String
isLeaveEmployee
;
}
yifu-archives/yifu-archives-api/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/vo/TEmpChangeInfoVO.java
View file @
67506bc9
...
...
@@ -18,6 +18,7 @@ package com.yifu.cloud.plus.v1.yifu.archives.vo;
import
com.alibaba.excel.annotation.ExcelProperty
;
import
com.alibaba.excel.annotation.write.style.ColumnWidth
;
import
com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute
;
import
lombok.Data
;
import
javax.validation.constraints.NotNull
;
...
...
@@ -38,14 +39,16 @@ public class TEmpChangeInfoVO implements Serializable {
/**
* 员工姓名
*/
@NotNull
(
message
=
"员工姓名不可为空"
)
@NotNull
(
message
=
"员工姓名不能为空"
)
@ExcelAttribute
(
name
=
"员工姓名"
,
isNotEmpty
=
true
,
errorInfo
=
"员工姓名不能为空"
,
maxLength
=
20
)
@ExcelProperty
(
value
=
"员工姓名"
)
private
String
empName
;
/**
* 身份证号
*/
@NotNull
(
message
=
"身份证号不可为空"
)
@NotNull
(
message
=
"身份证号不能为空"
)
@ExcelAttribute
(
name
=
"身份证号"
,
isNotEmpty
=
true
,
errorInfo
=
"身份证号不能为空"
,
maxLength
=
20
)
@ExcelProperty
(
value
=
"身份证号"
)
private
String
empIdcard
;
...
...
@@ -53,18 +56,23 @@ public class TEmpChangeInfoVO implements Serializable {
* 原项目编码
*/
@ExcelProperty
(
value
=
"原项目编码"
)
@NotNull
(
message
=
"原项目编码不能为空"
)
@ExcelAttribute
(
name
=
"原项目编码"
,
isNotEmpty
=
true
,
errorInfo
=
"原项目编码不能为空"
,
maxLength
=
20
)
private
String
oldSettleCode
;
/**
* 新项目编码
*/
@ExcelProperty
(
value
=
"新项目编码"
)
@NotNull
(
message
=
"新项目编码不能为空"
)
@ExcelAttribute
(
name
=
"新项目编码"
,
isNotEmpty
=
true
,
errorInfo
=
"新项目编码不能为空"
,
maxLength
=
20
)
private
String
newSettleCode
;
/**
* 已产生未结算费用 0:划转 1:不划转
*/
@ExcelProperty
(
value
=
"已产生未结算费用"
)
@NotNull
(
message
=
"已产生未结算费用不能为空"
)
private
String
unsettleDeal
;
/**
...
...
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/controller/TEmployeeProjectController.java
View file @
67506bc9
...
...
@@ -133,7 +133,7 @@ public class TEmployeeProjectController {
@DeleteMapping
(
"/{id}"
)
@PreAuthorize
(
"@pms.hasPermission('archives_temployeeproject_del')"
)
public
R
removeById
(
@PathVariable
String
id
)
{
return
R
.
ok
(
tEmployeeProjectService
.
remove
ById
(
id
));
return
R
.
ok
(
tEmployeeProjectService
.
remove
ProjectInfo
(
id
));
}
/**
...
...
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/service/TEmployeeProjectService.java
View file @
67506bc9
...
...
@@ -50,6 +50,8 @@ public interface TEmployeeProjectService extends IService<TEmployeeProject> {
R
updateProject
(
TEmployeeProject
tEmployeeProject
);
R
removeProjectInfo
(
String
id
);
/**
* @param tEmployeeProject
* @Description: 减项
...
...
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/service/impl/TEmpChangeInfoServiceImpl.java
View file @
67506bc9
...
...
@@ -115,6 +115,26 @@ public class TEmpChangeInfoServiceImpl extends ServiceImpl<TEmpChangeInfoMapper,
errorMsg
=
new
HashSet
<>();
TEmpChangeInfoVO
excel
=
excelVOList
.
get
(
i
);
Calendar
calendar
=
Calendar
.
getInstance
();
int
month
=
calendar
.
get
(
Calendar
.
MONTH
)
+
1
;
if
(
excel
.
getUnsettleDeal
().
equals
(
CommonConstants
.
IS_CHANGE
))
{
if
(
Common
.
isEmpty
(
excel
.
getChangeStartMonth
()))
{
errorMsg
.
add
(
MsgUtils
.
getMessage
(
ErrorCodes
.
CHANGE_START_MONTH_EXIT
,
excel
.
getNewSettleCode
()));
}
else
if
(
Integer
.
parseInt
(
excel
.
getChangeStartMonth
())
>
month
)
{
errorMsg
.
add
(
MsgUtils
.
getMessage
(
ErrorCodes
.
CHANGE_LESS_MONTH_EXIT
,
excel
.
getNewSettleCode
()));
}
}
//项目编码校验
TSettleDomain
tSettleDomain
=
tSettleDomainService
.
getOne
(
Wrappers
.<
TSettleDomain
>
query
().
lambda
()
.
eq
(
TSettleDomain:
:
getDepartNo
,
excel
.
getNewSettleCode
())
.
eq
(
TSettleDomain:
:
getStopFlag
,
CommonConstants
.
ZERO_STRING
)
.
eq
(
TSettleDomain:
:
getDeleteFlag
,
CommonConstants
.
ZERO_STRING
));
if
(
Common
.
isEmpty
(
tSettleDomain
))
{
errorMsg
.
add
(
MsgUtils
.
getMessage
(
ErrorCodes
.
PROJECT_SEARCH_NOT_EXIST
,
excel
.
getNewSettleCode
()));
}
//待划转员工已在目标结算主体下不可划转
TEmployeeProject
tEmployeeProject
=
tEmployeeProjectService
.
getOne
(
Wrappers
.<
TEmployeeProject
>
query
().
lambda
()
.
eq
(
TEmployeeProject:
:
getEmpIdcard
,
excel
.
getEmpIdcard
()).
eq
(
TEmployeeProject:
:
getDeptNo
,
excel
.
getNewSettleCode
())
...
...
@@ -129,14 +149,14 @@ public class TEmpChangeInfoServiceImpl extends ServiceImpl<TEmpChangeInfoMapper,
.
eq
(
TEmployeeProject:
:
getEmpIdcard
,
excel
.
getEmpIdcard
()).
eq
(
TEmployeeProject:
:
getDeptNo
,
excel
.
getOldSettleCode
())
.
eq
(
TEmployeeProject:
:
getDeleteFlag
,
CommonConstants
.
STATUS_NORMAL
));
if
(
Common
.
isNotNull
(
updateTEmployeePro
))
{
TSettleDomain
tSettleDomain
=
tSettleDomainService
.
getOne
(
Wrappers
.<
TSettleDomain
>
query
().
lambda
()
.
eq
(
TSettleDomain:
:
getDepartNo
,
updateTEmployeePro
.
getDeptNo
()).
eq
(
TSettleDomain:
:
getDeleteFlag
,
CommonConstants
.
STATUS_NORMAL
));
if
(
Common
.
isNotNull
(
tSettleDomain
))
{
if
(
CommonConstants
.
ONE_STRING
.
equals
(
updateTEmployeePro
.
getProjectStatus
()))
{
errorMsg
.
add
(
MsgUtils
.
getMessage
(
ErrorCodes
.
PROJECT_PERSON_DELETE_EXIT
,
excel
.
getOldSettleCode
()
));
}
else
if
(
Common
.
isNotNull
(
tSettleDomain
))
{
updateTEmployeePro
.
setDeptNo
(
tSettleDomain
.
getDepartNo
());
updateTEmployeePro
.
setDeptId
(
tSettleDomain
.
getId
());
updateTEmployeePro
.
setDeptName
(
tSettleDomain
.
getDepartName
());
TCustomerInfo
tCustomerInfo
=
tCustomerInfoService
.
getById
(
tSettleDomain
.
getCustomerId
());
if
(
Common
.
isNotNull
(
tCustomerInfo
))
{;
if
(
Common
.
isNotNull
(
tCustomerInfo
))
{
updateTEmployeePro
.
setUnitId
(
tCustomerInfo
.
getId
());
updateTEmployeePro
.
setUnitNo
(
tCustomerInfo
.
getCustomerCode
());
updateTEmployeePro
.
setUnitName
(
tCustomerInfo
.
getCustomerName
());
...
...
@@ -146,6 +166,8 @@ public class TEmpChangeInfoServiceImpl extends ServiceImpl<TEmpChangeInfoMapper,
TEmployeeProject
tEmployeeProjectOld
=
tEmployeeProjectService
.
getById
(
updateTEmployeePro
.
getId
());
tEmployeeLogService
.
saveModificationRecord
(
CommonConstants
.
dingleDigitIntArray
[
1
],
""
,
tEmployeeProjectOld
.
getId
(),
tEmployeeProjectOld
,
updateTEmployeePro
);
}
}
else
{
errorMsg
.
add
(
MsgUtils
.
getMessage
(
ErrorCodes
.
PROJECT_PERSON_SEARCH_EXIT
,
excel
.
getOldSettleCode
()));
}
}
else
{
// 数据不合法
...
...
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/service/impl/TEmployeeInfoServiceImpl.java
View file @
67506bc9
...
...
@@ -308,6 +308,10 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
for
(
String
pid
:
idArr
)
{
for
(
TEmployeeProject
project
:
projectList
)
{
if
(
project
.
getId
().
equals
(
pid
))
{
project
.
setLeaveReason
(
""
);
project
.
setLeaveRemark
(
""
);
project
.
setLeaveUser
(
""
);
project
.
setLeaveTime
(
null
);
project
.
setProjectStatus
(
CommonConstants
.
ZERO_INT
);
tEmployeeProjectService
.
updateById
(
project
);
}
...
...
@@ -316,6 +320,10 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
}
}
employee
.
setFileStatus
(
CommonConstants
.
ZERO_INT
);
employee
.
setLeaveReason
(
""
);
employee
.
setLeaveRemark
(
""
);
employee
.
setLeaveUser
(
""
);
employee
.
setLeaveTime
(
null
);
this
.
updateById
(
employee
);
// 记录变更日志
...
...
@@ -340,8 +348,12 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
ErrorMessageVO
errorMessageVO
;
Map
<
Integer
,
Integer
>
errorMsgMap
=
new
HashMap
<>();
TEmployeeInfo
oldEmployee
;
TEmployeeInfo
employee
;
// 可以更新的列表
List
<
TEmployeeInfo
>
canDeleteList
=
new
ArrayList
<>();
// 为了记录变更日志而加的
List
<
TEmployeeInfo
>
deleteOldList
=
new
ArrayList
<>();
Set
<
String
>
errorMsg
;
EmployeeLeaveVO
excel
;
...
...
@@ -405,13 +417,16 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
if
(
projectList
!=
null
&&
!
projectList
.
isEmpty
())
{
errorMsg
.
add
(
MsgUtils
.
getMessage
(
ErrorCodes
.
ARCHIVES_IMPORT_EMP_HAVE_PROJECT
,
employee
.
getEmpIdcard
()));
}
else
{
oldEmployee
=
existEmpMap
.
get
(
excel
.
getEmpIdcard
());
// 开始减档
employee
.
setFileStatus
(
CommonConstants
.
ONE_INT
);
employee
.
setLeaveUser
(
user
.
getId
());
employee
.
setLeaveUserName
(
user
.
getNickname
());
employee
.
setLeaveTime
(
LocalDateTime
.
now
());
employee
.
setLeaveReason
(
excel
.
getLeaveReason
());
employee
.
setLeaveRemark
(
excel
.
getLeaveRemark
());
canDeleteList
.
add
(
employee
);
deleteOldList
.
add
(
oldEmployee
);
}
}
else
{
errorMsg
.
add
(
MsgUtils
.
getMessage
(
ErrorCodes
.
ARCHIVES_IMPORT_EMP_NOT_EXISTS
,
excel
.
getEmpIdcard
()));
...
...
@@ -435,12 +450,18 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
}
else
{
// 仅更新自己
this
.
updateBatchById
(
canDeleteList
);
for
(
int
i
=
0
;
i
<
canDeleteList
.
size
();
i
++)
{
this
.
updateById
(
canDeleteList
.
get
(
i
));
// 记录变更日志
tEmployeeLogService
.
saveModificationRecord
(
CommonConstants
.
dingleDigitIntArray
[
0
],
canDeleteList
.
get
(
i
).
getId
(),
""
,
deleteOldList
.
get
(
i
),
canDeleteList
.
get
(
i
));
}
}
return
R
.
ok
();
}
@Override
public
R
<
String
>
minusEmployee
(
String
id
,
String
leaveReason
,
String
leaveRemark
)
{
TEmployeeInfo
oldEmp
=
this
.
getById
(
id
);
TEmployeeInfo
employee
=
this
.
getById
(
id
);
if
(
employee
!=
null
)
{
// 获取项目档案,传参0,过滤项目状态
...
...
@@ -455,9 +476,12 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
employee
.
setFileStatus
(
CommonConstants
.
ONE_INT
);
employee
.
setLeaveUser
(
user
.
getId
());
employee
.
setLeaveUserName
(
user
.
getNickname
());
employee
.
setLeaveTime
(
LocalDateTime
.
now
());
employee
.
setLeaveReason
(
leaveReason
);
employee
.
setLeaveRemark
(
leaveRemark
);
this
.
updateById
(
employee
);
// 记录变更日志
tEmployeeLogService
.
saveModificationRecord
(
CommonConstants
.
dingleDigitIntArray
[
0
],
id
,
""
,
oldEmp
,
employee
);
return
R
.
ok
(
"已减档"
);
}
else
{
return
R
.
failed
(
"未找到人员档案信息"
);
...
...
@@ -658,7 +682,7 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
for
(
int
i
=
0
;
i
<
excelVOList
.
size
();
i
++)
{
errorMsg
=
new
HashSet
<>();
// 判空
this
.
checkEmployeeVOR
((
i
+
2L
),
excelVOList
.
get
(
i
),
errorMsgMap
,
errorMsg
);
this
.
checkEmployeeVOR
((
i
+
2L
),
excelVOList
.
get
(
i
),
errorMsgMap
,
errorMsg
);
idCard
=
excelVOList
.
get
(
i
).
getEmpIdcard
();
if
(
Common
.
isEmpty
(
idCard
))
{
...
...
@@ -737,13 +761,15 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
}
// 调用区域服务,渲染区域值
R
<
Map
<
String
,
String
>>
areaR
=
HttpDaprUtil
.
invokeMethodPost
(
daprUpmsProperties
.
getAppUrl
(),
daprUpmsProperties
.
getAppId
()
R
<
Map
<
String
,
Map
<
String
,
String
>
>>
areaR
=
HttpDaprUtil
.
invokeMethodPost
(
daprUpmsProperties
.
getAppUrl
(),
daprUpmsProperties
.
getAppId
()
,
"/area/inner/getAreaToName"
,
null
,
Map
.
class
,
SecurityConstants
.
FROM_IN
);
Map
<
String
,
Map
<
String
,
String
>>
areaMapR
;
Map
<
String
,
String
>
areaMap
;
if
(
areaR
==
null
)
{
return
R
.
failed
(
"获取区域失败!"
);
}
else
{
areaMap
=
areaR
.
getData
();
areaMapR
=
areaR
.
getData
();
areaMap
=
areaMapR
.
get
(
"data"
);
}
TEmployeeInfo
checkPhone
;
...
...
@@ -922,7 +948,7 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
if
(
Common
.
isEmpty
(
excel
.
getHignEducation
()))
{
errorMsg
.
add
(
MsgUtils
.
getMessage
(
ErrorCodes
.
ARCHIVES_IMPORT_EMP_HIGH_EDUCATION_ERROR
,
excel
.
getEmpIdcard
()));
}
}
else
if
(
CommonConstants
.
IS_FALSE
.
equals
(
excel
.
getIsCollege
())){
}
else
if
(
CommonConstants
.
IS_FALSE
.
equals
(
excel
.
getIsCollege
()))
{
saveEmp
.
setIsCollege
(
CommonConstants
.
ZERO_INT
);
}
else
{
errorMsg
.
add
(
EmployeeConstants
.
IS_OR_NOT
);
...
...
@@ -991,7 +1017,7 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
saveEmp
.
setDeptNo
(
excel
.
getDeptNo
());
}
}
this
.
setBaseData
(
saveEmp
,
CommonConstants
.
dingleDigitStrArray
[
4
],
user
);
this
.
setBaseData
(
saveEmp
,
CommonConstants
.
dingleDigitStrArray
[
5
],
user
);
saveList
.
add
(
saveEmp
);
}
// 数据合法情况
...
...
@@ -1010,7 +1036,7 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
}
/**
* @Description: // 字典:
4人员档案新建、5项目档案新建、1社保/公积金、3商险、2薪酬
* @Description: // 字典:
1=社保、公积金派单,2=人员发薪,3=商险派单,4=档案新建,5=批量导入
* @Description: 加载初始数据
* @Author: hgw
* @Date: 2022/6/22 20:21
...
...
@@ -1202,13 +1228,13 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
}
// 调用区域服务,渲染区域值
R
<
Map
<
String
,
Map
<
String
,
String
>>>
areaMapR
=
HttpDaprUtil
.
invokeMethodPost
(
daprUpmsProperties
.
getAppUrl
(),
daprUpmsProperties
.
getAppId
()
R
<
Map
<
String
,
Map
<
String
,
String
>>>
areaMapR
=
HttpDaprUtil
.
invokeMethodPost
(
daprUpmsProperties
.
getAppUrl
(),
daprUpmsProperties
.
getAppId
()
,
"/area/inner/getAreaToName"
,
null
,
Map
.
class
,
SecurityConstants
.
FROM_IN
);
Map
<
String
,
String
>
areaMap
;
if
(
areaMapR
==
null
)
{
return
R
.
failed
(
"获取区域失败!"
);
}
else
{
Map
<
String
,
Map
<
String
,
String
>>
areaMaps
=
areaMapR
.
getData
();
Map
<
String
,
Map
<
String
,
String
>>
areaMaps
=
areaMapR
.
getData
();
areaMap
=
areaMaps
.
get
(
"data"
);
}
...
...
@@ -1229,10 +1255,6 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
oldEmp
=
existEmpMap
.
get
(
excel
.
getEmpIdcard
());
// 校验身份证实名
if
(
Common
.
isNotNull
(
excel
.
getEmpName
()))
{
saveEmp
.
setEmpName
(
excel
.
getEmpName
());
}
if
(
Common
.
isNotNull
(
excel
.
getEmpPhone
()))
{
saveEmp
.
setEmpPhone
(
excel
.
getEmpPhone
());
}
...
...
@@ -1361,7 +1383,7 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
if
(
Common
.
isEmpty
(
excel
.
getHignEducation
()))
{
errorMsg
.
add
(
MsgUtils
.
getMessage
(
ErrorCodes
.
ARCHIVES_IMPORT_EMP_HIGH_EDUCATION_ERROR
,
excel
.
getEmpIdcard
()));
}
}
else
if
(
CommonConstants
.
IS_FALSE
.
equals
(
excel
.
getIsCollege
())){
}
else
if
(
CommonConstants
.
IS_FALSE
.
equals
(
excel
.
getIsCollege
()))
{
saveEmp
.
setIsCollege
(
CommonConstants
.
ZERO_INT
);
}
else
{
errorMsg
.
add
(
EmployeeConstants
.
IS_OR_NOT
);
...
...
@@ -1482,17 +1504,24 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
// 更新学历-核心
private
void
doUpdateEducationCore
(
TEmpEducation
education
,
TEmployeeInfo
employeeInfo
)
{
education
.
setEmpId
(
employeeInfo
.
getId
());
education
.
setEmpName
(
employeeInfo
.
getEmpName
());
education
.
setEmpCode
(
employeeInfo
.
getEmpCode
());
education
.
setEmpIdcard
(
employeeInfo
.
getEmpIdcard
());
education
.
setEducationName
(
employeeInfo
.
getHignEducation
());
education
.
setHighIdentification
(
CommonConstants
.
ZERO_STRING
);
education
.
setSchool
(
employeeInfo
.
getSchool
());
education
.
setMajor
(
employeeInfo
.
getMajor
());
education
.
setEntryDate
(
LocalDateTimeUtils
.
convertLDToDate
(
employeeInfo
.
getAdmissionDate
()));
education
.
setGradutionDate
(
LocalDateTimeUtils
.
convertLDToDate
(
employeeInfo
.
getGradutionDate
()));
tEmpEducationService
.
insertEducationOfEmp
(
education
);
// 派遣/外包+大专及以上=是 才根据学历(本科、大专这些)去更新 或者新建一条学历信息
if
(
Common
.
isNotNull
(
employeeInfo
.
getEmpNatrue
())
&&
(
CommonConstants
.
ZERO_STRING
.
equals
(
employeeInfo
.
getEmpNatrue
())
||
CommonConstants
.
ONE_STRING
.
equals
(
employeeInfo
.
getEmpNatrue
()))
&&
Common
.
isNotNull
(
employeeInfo
.
getIsCollege
())
&&
employeeInfo
.
getIsCollege
()
==
CommonConstants
.
ONE_INT
)
{
education
.
setEmpId
(
employeeInfo
.
getId
());
education
.
setEmpName
(
employeeInfo
.
getEmpName
());
education
.
setEmpCode
(
employeeInfo
.
getEmpCode
());
education
.
setEmpIdcard
(
employeeInfo
.
getEmpIdcard
());
education
.
setEducationName
(
employeeInfo
.
getHignEducation
());
education
.
setHighIdentification
(
CommonConstants
.
ZERO_STRING
);
education
.
setSchool
(
employeeInfo
.
getSchool
());
education
.
setMajor
(
employeeInfo
.
getMajor
());
education
.
setEntryDate
(
LocalDateTimeUtils
.
convertLDToDate
(
employeeInfo
.
getAdmissionDate
()));
education
.
setGradutionDate
(
LocalDateTimeUtils
.
convertLDToDate
(
employeeInfo
.
getGradutionDate
()));
tEmpEducationService
.
insertEducationOfEmp
(
education
);
}
}
/**
...
...
@@ -1510,7 +1539,7 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
try
{
ExcelUtil
<
EmployeeExportVO
>
util
=
new
ExcelUtil
<>(
EmployeeExportVO
.
class
);
for
(
EmployeeExportVO
vo
:
list
)
{
util
.
convertEntity
(
vo
,
null
,
null
,
null
);
util
.
convertEntity
(
vo
,
null
,
null
,
null
);
}
out
=
response
.
getOutputStream
();
response
.
setContentType
(
"multipart/form-data"
);
...
...
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/service/impl/TEmployeeProjectServiceImpl.java
View file @
67506bc9
...
...
@@ -83,18 +83,27 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
@Override
public
R
addCheck
(
TEmployeeProject
tEmployeeProject
)
{
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
//身份证系统中是否已有
TEmployeeInfo
tEmployeeInfo
=
tEmployeeInfoMapper
.
selectOne
(
Wrappers
.<
TEmployeeInfo
>
query
().
lambda
()
.
eq
(
TEmployeeInfo:
:
getEmpIdcard
,
tEmployeeProject
.
getEmpIdcard
())
.
eq
(
TEmployeeInfo:
:
getDeleteFlag
,
CommonConstants
.
STATUS_NORMAL
));
//项目编码校验
TSettleDomain
tSettleDomain
=
tSettleDomainService
.
getOne
(
Wrappers
.<
TSettleDomain
>
query
().
lambda
()
.
eq
(
TSettleDomain:
:
getDepartNo
,
tEmployeeProject
.
getDeptNo
())
.
eq
(
TSettleDomain:
:
getStopFlag
,
CommonConstants
.
ZERO_STRING
)
.
eq
(
TSettleDomain:
:
getDeleteFlag
,
CommonConstants
.
ZERO_STRING
));
if
(
Common
.
isEmpty
(
tSettleDomain
))
{
return
R
.
failed
(
"未找到对应的项目,请核实"
);
}
//项目下已有身份证信息
TEmployeeProject
employeeProject
=
this
.
getOne
(
Wrappers
.<
TEmployeeProject
>
query
().
lambda
()
.
eq
(
TEmployeeProject:
:
getEmpIdcard
,
tEmployeeProject
.
getEmpIdcard
())
.
eq
(
TEmployeeProject:
:
getDeptNo
,
tEmployeeProject
.
getDeptNo
())
.
eq
(
TEmployeeProject:
:
getDeleteFlag
,
CommonConstants
.
STATUS_NORMAL
));
.
eq
(
TEmployeeProject:
:
getEmpIdcard
,
tEmployeeProject
.
getEmpIdcard
())
.
eq
(
TEmployeeProject:
:
getDeptNo
,
tEmployeeProject
.
getDeptNo
())
.
eq
(
TEmployeeProject:
:
getDeleteFlag
,
CommonConstants
.
STATUS_NORMAL
));
if
(!
Common
.
isEmpty
(
employeeProject
))
{
//身份证实名认证
...
...
@@ -103,24 +112,16 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
return
R
.
failed
(
"姓名和身份证不一致,请确认后再次新增"
);
}
}
//项目编码校验
TSettleDomain
tSettleDomain
=
tSettleDomainService
.
getOne
(
Wrappers
.<
TSettleDomain
>
query
().
lambda
()
.
eq
(
TSettleDomain:
:
getDepartNo
,
tEmployeeProject
.
getDeptNo
())
.
eq
(
TSettleDomain:
:
getStopFlag
,
CommonConstants
.
ZERO_STRING
)
.
eq
(
TSettleDomain:
:
getDeleteFlag
,
CommonConstants
.
ZERO_STRING
));
if
(
Common
.
isEmpty
(
tSettleDomain
))
{
return
R
.
failed
(
"未找到对应的项目,请核实"
);
}
//项目状态为已减项
if
(
CommonConstants
.
dingleDigitIntArray
[
1
]
==
employeeProject
.
getProjectStatus
())
{
if
(!
Common
.
isEmpty
(
tEmployeeInfo
))
{
map
.
put
(
"empProId"
,
employeeProject
.
getId
());
map
.
put
(
"empProId"
,
employeeProject
.
getId
());
if
(
CommonConstants
.
dingleDigitIntArray
[
0
]
==
tEmployeeInfo
.
getFileStatus
())
{
return
new
R
<>(
CommonConstants
.
dingleDigitIntArray
[
4
],
"该人员已减项,是否“复项”"
,
map
);
return
new
R
<>(
CommonConstants
.
dingleDigitIntArray
[
4
],
"该人员已减项,是否“复项”"
,
map
);
}
else
{
map
.
put
(
"employeeId"
,
tEmployeeInfo
.
getId
());
return
new
R
<>(
CommonConstants
.
dingleDigitIntArray
[
2
],
"该人员已减档减项,是否“复档复项”"
,
map
);
return
new
R
<>(
CommonConstants
.
dingleDigitIntArray
[
2
],
"该人员已减档减项,是否“复档复项”"
,
map
);
}
}
}
...
...
@@ -136,7 +137,7 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
//判断是否已经减档
if
(
tEmployeeInfo
.
getFileStatus
()
==
CommonConstants
.
dingleDigitIntArray
[
1
])
{
map
.
put
(
"employeeId"
,
tEmployeeInfo
.
getId
());
return
new
R
<>(
CommonConstants
.
dingleDigitIntArray
[
3
],
"该人员在离职库已存在,是否“恢复档案”"
,
map
);
return
new
R
<>(
CommonConstants
.
dingleDigitIntArray
[
3
],
"该人员在离职库已存在,是否“恢复档案”"
,
map
);
}
}
return
R
.
ok
();
...
...
@@ -159,7 +160,7 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
if
(
CommonConstants
.
ZERO_STRING
.
equals
(
tEmployeeProject
.
getEmpNatrue
()))
{
tEmployeeInfo
.
setEmpNatrue
(
CommonConstants
.
ZERO_STRING
);
}
else
if
(
CommonConstants
.
ONE_STRING
.
equals
(
tEmployeeProject
.
getEmpNatrue
())
&&
!
CommonConstants
.
ZERO_STRING
.
equals
(
tEmployeeInfo
.
getEmpNatrue
()))
{
}
else
if
(
CommonConstants
.
ONE_STRING
.
equals
(
tEmployeeProject
.
getEmpNatrue
())
&&
!
CommonConstants
.
ZERO_STRING
.
equals
(
tEmployeeInfo
.
getEmpNatrue
()))
{
tEmployeeInfo
.
setEmpNatrue
(
CommonConstants
.
ONE_STRING
);
}
tEmployeeInfo
.
setProjectNum
(
tEmployeeInfo
.
getProjectNum
().
intValue
()
+
CommonConstants
.
ONE_INT
);
...
...
@@ -178,18 +179,39 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
.
eq
(
TEmployeeInfo:
:
getDeleteFlag
,
CommonConstants
.
STATUS_NORMAL
));
if
(
Common
.
isNotNull
(
tEmployeeInfo
))
{
TEmployeeInfo
tEmployeeInfoCompare
=
tEmployeeInfoMapper
.
selectById
(
tEmployeeInfo
.
getId
());
if
(
CommonConstants
.
ZERO_STRING
.
equals
(
tEmployee
Info
.
getEmpNatrue
()))
{
if
(
CommonConstants
.
ZERO_STRING
.
equals
(
tEmployee
Project
.
getEmpNatrue
()))
{
tEmployeeInfo
.
setEmpNatrue
(
CommonConstants
.
ZERO_STRING
);
}
else
if
(
CommonConstants
.
ONE_STRING
.
equals
(
tEmployee
Info
.
getEmpNatrue
())
&&
!
CommonConstants
.
ZERO_STRING
.
equals
(
tEmployeeInfo
.
getEmpNatrue
()))
{
}
else
if
(
CommonConstants
.
ONE_STRING
.
equals
(
tEmployee
Project
.
getEmpNatrue
())
&&
!
CommonConstants
.
ZERO_STRING
.
equals
(
tEmployeeInfo
.
getEmpNatrue
()))
{
tEmployeeInfo
.
setEmpNatrue
(
CommonConstants
.
ONE_STRING
);
}
tEmployeeInfoMapper
.
updateById
(
tEmployeeInfo
);
tEmployeeLogService
.
saveModificationRecord
(
CommonConstants
.
dingleDigitIntArray
[
1
],
tEmployeeInfoCompare
.
getId
(),
""
,
tEmployeeInfoCompare
,
tEmployeeInfo
);
tEmployeeLogService
.
saveModificationRecord
(
CommonConstants
.
dingleDigitIntArray
[
0
],
tEmployeeInfoCompare
.
getId
(),
""
,
tEmployeeInfoCompare
,
tEmployeeInfo
);
}
tEmployeeLogService
.
saveModificationRecord
(
CommonConstants
.
dingleDigitIntArray
[
1
],
""
,
tEmployeeProject
.
getId
(),
compareProject
,
tEmployeeProject
);
tEmployeeLogService
.
saveModificationRecord
(
CommonConstants
.
dingleDigitIntArray
[
1
],
""
,
tEmployeeProject
.
getId
(),
compareProject
,
tEmployeeProject
);
return
R
.
ok
(
flag
);
}
@Override
public
R
removeProjectInfo
(
String
id
)
{
TEmployeeProject
tEmployeeProject
=
this
.
getById
(
id
);
TEmployeeInfo
tEmployeeInfo
=
tEmployeeInfoMapper
.
selectOne
(
Wrappers
.<
TEmployeeInfo
>
query
().
lambda
()
.
eq
(
TEmployeeInfo:
:
getEmpIdcard
,
tEmployeeProject
.
getEmpIdcard
())
.
eq
(
TEmployeeInfo:
:
getDeleteFlag
,
CommonConstants
.
STATUS_NORMAL
));
//删除项目档案
this
.
removeById
(
id
);
TEmployeeInfo
tEmployeeInfoCop
=
tEmployeeInfoMapper
.
selectById
(
tEmployeeInfo
.
getId
());
//从剩下的项目档案中查找员工类型并更新
setEmpNature
(
tEmployeeProject
.
getEmpIdcard
(),
tEmployeeInfo
);
tEmployeeInfoMapper
.
updateById
(
tEmployeeInfo
);
//更新操作日志
tEmployeeLogService
.
saveModificationRecord
(
CommonConstants
.
dingleDigitIntArray
[
0
],
tEmployeeInfoCop
.
getId
(),
""
,
tEmployeeInfoCop
,
tEmployeeInfo
);
return
R
.
ok
();
}
@Override
public
R
reEmpInfo
(
JSONObject
jsonObject
)
{
if
(
Common
.
isNotNull
(
jsonObject
))
{
...
...
@@ -202,13 +224,13 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
TEmployeeInfo
tEmployeeInfo
=
tEmployeeInfoMapper
.
selectById
(
empId
);
tEmployeeInfo
.
setFileStatus
(
CommonConstants
.
dingleDigitIntArray
[
0
]);
tEmployeeInfoMapper
.
updateById
(
tEmployeeInfo
);
tEmployeeLogService
.
saveModificationRecord
(
CommonConstants
.
dingleDigitIntArray
[
0
],
empId
,
""
,
tEmployeeInfoOld
,
tEmployeeInfo
);
tEmployeeLogService
.
saveModificationRecord
(
CommonConstants
.
dingleDigitIntArray
[
0
],
empId
,
""
,
tEmployeeInfoOld
,
tEmployeeInfo
);
}
else
if
(
Common
.
isEmpty
(
empId
)
&&
!
Common
.
isEmpty
(
empProId
))
{
//复项
TEmployeeProject
tEmployeeProject
=
this
.
getById
(
empProId
);
tEmployeeProject
.
setProjectStatus
(
CommonConstants
.
dingleDigitIntArray
[
0
]);
this
.
updateById
(
tEmployeeProject
);
tEmployeeLogService
.
saveModificationRecord
(
CommonConstants
.
dingleDigitIntArray
[
1
],
""
,
empProId
,
tEmployeeProjectOld
,
tEmployeeProject
);
tEmployeeLogService
.
saveModificationRecord
(
CommonConstants
.
dingleDigitIntArray
[
1
],
""
,
empProId
,
tEmployeeProjectOld
,
tEmployeeProject
);
}
else
{
//复档复项
TEmployeeInfo
tEmployeeInfo
=
tEmployeeInfoMapper
.
selectById
(
empId
);
...
...
@@ -217,8 +239,8 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
tEmployeeInfoMapper
.
updateById
(
tEmployeeInfo
);
tEmployeeProject
.
setProjectStatus
(
CommonConstants
.
dingleDigitIntArray
[
0
]);
this
.
updateById
(
tEmployeeProject
);
tEmployeeLogService
.
saveModificationRecord
(
CommonConstants
.
dingleDigitIntArray
[
1
],
""
,
empProId
,
tEmployeeProjectOld
,
tEmployeeProject
);
tEmployeeLogService
.
saveModificationRecord
(
CommonConstants
.
dingleDigitIntArray
[
0
],
empId
,
""
,
tEmployeeInfoOld
,
tEmployeeInfo
);
tEmployeeLogService
.
saveModificationRecord
(
CommonConstants
.
dingleDigitIntArray
[
1
],
""
,
empProId
,
tEmployeeProjectOld
,
tEmployeeProject
);
tEmployeeLogService
.
saveModificationRecord
(
CommonConstants
.
dingleDigitIntArray
[
0
],
empId
,
""
,
tEmployeeInfoOld
,
tEmployeeInfo
);
}
}
else
{
return
R
.
failed
(
"传参为空!"
);
...
...
@@ -229,24 +251,56 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
@Override
public
R
deleteEmpPro
(
TEmployeeProject
tEmployeeProject
)
{
Long
count
=
this
.
count
(
Wrappers
.<
TEmployeeProject
>
query
().
lambda
()
.
eq
(
TEmployeeProject:
:
getId
,
tEmployeeProject
.
getId
())
.
eq
(
TEmployeeProject:
:
getInsuranceStatus
,
CommonConstants
.
dingleDigitIntArray
[
0
])
.
eq
(
TEmployeeProject:
:
getSocialStatus
,
CommonConstants
.
dingleDigitIntArray
[
0
])
.
eq
(
TEmployeeProject:
:
getFundStatus
,
CommonConstants
.
dingleDigitIntArray
[
0
]));
.
eq
(
TEmployeeProject:
:
getId
,
tEmployeeProject
.
getId
())
.
eq
(
TEmployeeProject:
:
getInsuranceStatus
,
CommonConstants
.
dingleDigitIntArray
[
0
])
.
eq
(
TEmployeeProject:
:
getSocialStatus
,
CommonConstants
.
dingleDigitIntArray
[
0
])
.
eq
(
TEmployeeProject:
:
getFundStatus
,
CommonConstants
.
dingleDigitIntArray
[
0
]));
if
(
count
==
CommonConstants
.
ONE_INT
)
{
TEmployeeInfo
tEmployeeInfoOld
=
tEmployeeInfoMapper
.
selectById
(
tEmployeeProject
.
getEmpId
());
TEmployeeProject
tEmployeeProjectOld
=
this
.
getById
(
tEmployeeProject
.
getId
());
String
code
=
""
;
if
(
Common
.
isNotNull
(
tEmployeeProject
))
{
tEmployeeProject
.
setProjectStatus
(
CommonConstants
.
dingleDigitIntArray
[
1
]);
this
.
updateById
(
tEmployeeProject
);
TEmployeeInfo
tEmployeeInfo
=
tEmployeeInfoMapper
.
selectById
(
tEmployeeProject
.
getEmpId
());
//查询该人员其他的项目档案
List
<
TEmployeeProject
>
list
=
this
.
list
(
Wrappers
.<
TEmployeeProject
>
query
().
lambda
()
.
eq
(
TEmployeeProject:
:
getEmpIdcard
,
tEmployeeProject
.
getEmpIdcard
())
.
eq
(
TEmployeeProject:
:
getDeleteFlag
,
CommonConstants
.
STATUS_NORMAL
)
.
eq
(
TEmployeeProject:
:
getProjectStatus
,
CommonConstants
.
ZERO_INT
));
if
(
tEmployeeProject
.
getIsLeaveEmployee
()
==
CommonConstants
.
dingleDigitIntArray
[
1
])
{
if
(
Common
.
isNotNull
(
list
))
{
return
R
.
failed
(
"存在草稿/已审核的状态的项目,不允许同步减档"
);
}
tEmployeeInfo
.
setFileStatus
(
CommonConstants
.
dingleDigitIntArray
[
1
]);
tEmployeeInfoMapper
.
updateById
(
tEmployeeInfo
)
;
code
=
CommonConstants
.
ONE_STRING
;
}
tEmployeeProject
.
setProjectStatus
(
CommonConstants
.
dingleDigitIntArray
[
1
]);
this
.
updateById
(
tEmployeeProject
);
//从剩下的项目档案中查找员工类型并更新
if
(
Common
.
isNotNull
(
list
))
{
for
(
TEmployeeProject
t
:
list
)
{
if
(
CommonConstants
.
ZERO_STRING
.
equals
(
t
.
getEmpNatrue
()))
{
tEmployeeInfo
.
setEmpNatrue
(
CommonConstants
.
ZERO_STRING
);
break
;
}
if
(
CommonConstants
.
ONE_STRING
.
equals
(
t
.
getEmpNatrue
())
&&
!
CommonConstants
.
ONE_STRING
.
equals
(
tEmployeeInfo
.
getEmpNatrue
()))
{
tEmployeeInfo
.
setEmpNatrue
(
CommonConstants
.
ONE_STRING
);
break
;
}
}
}
tEmployeeInfoMapper
.
updateById
(
tEmployeeInfo
);
tEmployeeLogService
.
saveModificationRecord
(
CommonConstants
.
dingleDigitIntArray
[
0
],
tEmployeeInfo
.
getId
(),
""
,
tEmployeeProjectOld
,
tEmployeeInfo
);
tEmployeeLogService
.
saveModificationRecord
(
CommonConstants
.
dingleDigitIntArray
[
1
],
""
,
tEmployeeProject
.
getId
(),
tEmployeeInfoOld
,
tEmployeeProject
);
return
R
.
ok
();
if
(
CommonConstants
.
ONE_STRING
.
equals
(
code
))
{
return
R
.
ok
(
null
,
"减项减档成功"
);
}
else
{
return
R
.
ok
(
null
,
"减项成功,项目状态已更新为“已减项”"
);
}
}
}
return
R
.
failed
(
"人员在该项目下存在进行中/未完结的服务"
);
...
...
@@ -269,35 +323,53 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
TEmployeeInfo
tEmployeeInfoOld
=
tEmployeeInfoMapper
.
selectById
(
tEmployeeProject
.
getEmpId
());
TEmployeeProject
tEmployeeProjectOld
=
this
.
getById
(
tEmployeeProject
.
getId
());
if
(
Common
.
isNotNull
(
tEmployeeProject
))
{
TEmployeeInfo
tEmployeeInfo
=
tEmployeeInfoMapper
.
selectById
(
tEmployeeProject
.
getEmpId
());
if
(
excel
.
getIsLeaveEmployee
()
==
CommonConstants
.
dingleDigitIntArray
[
1
])
{
Long
count
=
this
.
count
(
Wrappers
.<
TEmployeeProject
>
query
().
lambda
()
.
eq
(
TEmployeeProject:
:
getEmpId
,
tEmployeeProject
.
getEmpId
())
.
eq
(
TEmployeeProject:
:
getProjectStatus
,
CommonConstants
.
dingleDigitIntArray
[
0
]));
if
(
count
.
compareTo
(
CommonConstants
.
DEPT_TREE_ROOT_ID
)
>
0
)
{
errorMessageList
.
add
(
new
ErrorMessage
(
excel
.
getRowIndex
(),
MsgUtils
.
getMessage
(
ErrorCodes
.
ARCHIVES_PROJECT_CHANGE_NOT_EXIST
)));
if
(
tEmployeeProject
.
getInsuranceStatus
()
!=
CommonConstants
.
dingleDigitIntArray
[
0
]
||
tEmployeeProject
.
getSocialStatus
()
!=
CommonConstants
.
dingleDigitIntArray
[
0
]
||
tEmployeeProject
.
getFundStatus
()
!=
CommonConstants
.
dingleDigitIntArray
[
0
])
{
errorMessageList
.
add
(
new
ErrorMessage
(
excel
.
getRowIndex
(),
MsgUtils
.
getMessage
(
ErrorCodes
.
ARCHIVES_PROJECT_CHANGE_NOT_EXIST
)));
}
else
{
TEmployeeInfo
tEmployeeInfo
=
tEmployeeInfoMapper
.
selectById
(
tEmployeeProject
.
getEmpId
());
if
(
CommonConstants
.
ONE_STRING
.
equals
(
excel
.
getIsLeaveEmployee
()))
{
//查询该人员其他的项目档案
List
<
TEmployeeProject
>
list
=
this
.
list
(
Wrappers
.<
TEmployeeProject
>
query
().
lambda
()
.
ne
(
TEmployeeProject:
:
getDeptNo
,
tEmployeeProject
.
getDeptNo
())
.
eq
(
TEmployeeProject:
:
getEmpIdcard
,
tEmployeeProject
.
getEmpIdcard
())
.
eq
(
TEmployeeProject:
:
getDeleteFlag
,
CommonConstants
.
STATUS_NORMAL
)
.
eq
(
TEmployeeProject:
:
getProjectStatus
,
CommonConstants
.
ZERO_INT
));
if
(
tEmployeeProject
.
getIsLeaveEmployee
()
==
CommonConstants
.
dingleDigitIntArray
[
1
])
{
if
(
Common
.
isNotNull
(
list
))
{
errorMessageList
.
add
(
new
ErrorMessage
(
excel
.
getRowIndex
(),
MsgUtils
.
getMessage
(
ErrorCodes
.
QT_PROJECT_CHANGE_NOT_EXIST
)));
}
else
{
tEmployeeInfo
.
setFileStatus
(
CommonConstants
.
dingleDigitIntArray
[
1
]);
tEmployeeInfo
.
setLeaveReason
(
excel
.
getLeaveReason
());
tEmployeeInfo
.
setLeaveRemark
(
excel
.
getLeaveRemark
());
tEmployeeInfo
.
setLeaveTime
(
LocalDateTime
.
now
());
}
}
}
tEmployeeInfo
.
setFileStatus
(
CommonConstants
.
dingleDigitIntArray
[
1
]);
tEmployeeInfo
.
setLeaveReason
(
excel
.
getLeaveReason
());
tEmployeeInfo
.
setLeaveRemark
(
excel
.
getLeaveRemark
());
tEmployeeProject
.
setProjectStatus
(
CommonConstants
.
dingleDigitIntArray
[
1
]);
tEmployeeProject
.
setLeaveReason
(
excel
.
getLeaveReason
());
tEmployeeProject
.
setLeaveRemark
(
excel
.
getLeaveRemark
());
tEmployeeProject
.
setLeaveTime
(
LocalDateTime
.
now
());
this
.
updateById
(
tEmployeeProject
);
//从剩下的项目档案中查找员工类型并更新
setEmpNature
(
tEmployeeProject
.
getEmpIdcard
(),
tEmployeeInfo
);
tEmployeeInfoMapper
.
updateById
(
tEmployeeInfo
);
tEmployeeLogService
.
saveModificationRecord
(
CommonConstants
.
dingleDigitIntArray
[
0
],
tEmployeeInfo
.
getId
(),
""
,
tEmployeeProjectOld
,
tEmployeeInfo
);
tEmployeeLogService
.
saveModificationRecord
(
CommonConstants
.
dingleDigitIntArray
[
1
],
""
,
tEmployeeProject
.
getId
(),
tEmployeeInfoOld
,
tEmployeeProject
);
}
tEmployeeProject
.
setProjectStatus
(
CommonConstants
.
dingleDigitIntArray
[
1
]);
tEmployeeProject
.
setLeaveReason
(
excel
.
getLeaveReason
());
tEmployeeProject
.
setLeaveRemark
(
excel
.
getLeaveRemark
());
this
.
updateById
(
tEmployeeProject
);
tEmployeeLogService
.
saveModificationRecord
(
CommonConstants
.
dingleDigitIntArray
[
1
],
""
,
tEmployeeProject
.
getId
(),
tEmployeeInfoOld
,
tEmployeeProject
);
}
}
if
(
errorMessageList
.
size
()>
CommonConstants
.
ZERO_INT
)
{
if
(
errorMessageList
.
size
()
>
CommonConstants
.
ZERO_INT
)
{
return
R
.
failed
(
errorMessageList
);
}
return
R
.
ok
();
}
@Override
public
R
<
List
<
ErrorMessage
>>
importListAdd
(
InputStream
inputStream
,
String
isAdd
)
{
public
R
<
List
<
ErrorMessage
>>
importListAdd
(
InputStream
inputStream
,
String
isAdd
)
{
List
<
ErrorMessage
>
errorMessageList
=
new
ArrayList
<>();
ExcelUtil
<
EmployeeProjectVO
>
util1
=
new
ExcelUtil
<>(
EmployeeProjectVO
.
class
);
// 写法2:
...
...
@@ -343,7 +415,7 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
*/
private
void
saveData
()
{
log
.
info
(
"{}条数据,开始存储数据库!"
,
cachedDataList
.
size
());
importListAdd
(
cachedDataList
,
errorMessageList
,
isAdd
);
importListAdd
(
cachedDataList
,
errorMessageList
,
isAdd
);
log
.
info
(
"存储数据库成功!"
);
}
}).
sheet
().
doRead
();
...
...
@@ -363,7 +435,7 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
* @date 2022-06-20 18:52:16
*/
@Transactional
public
void
importListAdd
(
List
<
EmployeeProjectVO
>
excelVOList
,
List
<
ErrorMessage
>
errorMessageList
,
String
idAdd
)
{
public
void
importListAdd
(
List
<
EmployeeProjectVO
>
excelVOList
,
List
<
ErrorMessage
>
errorMessageList
,
String
idAdd
)
{
// 通用校验获取失败的数据
List
<
TEmployeeInfo
>
updateList
=
new
ArrayList
();
List
<
TEmployeeProject
>
proInsList
=
new
ArrayList
();
...
...
@@ -394,11 +466,20 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
}
}
if
(
idCardMap
.
get
(
idCard
.
concat
(
deptNo
))
!=
null
)
{
errorMessageList
.
add
(
new
ErrorMessage
(
excel
.
getRowIndex
(),
"第"
+
(
excel
.
getRowIndex
())
+
"行身份证号+项目编码与第"
+
idCardMap
.
get
(
idCard
)
+
"行重复!"
));
errorMessageList
.
add
(
new
ErrorMessage
(
excel
.
getRowIndex
(),
"第"
+
(
excel
.
getRowIndex
())
+
"行身份证号+项目编码与第"
+
idCardMap
.
get
(
idCard
)
+
"行重复!"
));
}
else
{
idCardMap
.
put
(
idCard
.
concat
(
deptNo
),
i
+
2
);
}
//项目编码校验
TSettleDomain
tSettleDomain
=
tSettleDomainService
.
getOne
(
Wrappers
.<
TSettleDomain
>
query
().
lambda
()
.
eq
(
TSettleDomain:
:
getDepartNo
,
excel
.
getDeptNo
())
.
eq
(
TSettleDomain:
:
getStopFlag
,
CommonConstants
.
ZERO_STRING
)
.
eq
(
TSettleDomain:
:
getDeleteFlag
,
CommonConstants
.
ZERO_STRING
));
if
(
Common
.
isEmpty
(
tSettleDomain
))
{
errorMessageList
.
add
(
new
ErrorMessage
(
excel
.
getRowIndex
(),
MsgUtils
.
getMessage
(
ErrorCodes
.
PROJECT_SEARCH_NOT_EXIST
)));
}
//根据身份证获取人员档案
TEmployeeInfo
tEmployeeInfo
=
tEmployeeInfoMapper
.
selectOne
(
Wrappers
.<
TEmployeeInfo
>
query
().
lambda
()
.
eq
(
TEmployeeInfo:
:
getEmpIdcard
,
excel
.
getEmpIdcard
())
...
...
@@ -412,17 +493,17 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
//不存在复档或复项的情况
//档案无(在档人员、离职库皆无),项目无
if
(
Common
.
isEmpty
(
tEmployeeInfo
)
&&
Common
.
isEmpty
(
tEmployeeProject
))
{
errorMessageList
.
add
(
new
ErrorMessage
(
excel
.
getRowIndex
(),
MsgUtils
.
getMessage
(
ErrorCodes
.
CHECKS_EXIT_EMPPROJECT_ERROR
)));
errorMessageList
.
add
(
new
ErrorMessage
(
excel
.
getRowIndex
(),
MsgUtils
.
getMessage
(
ErrorCodes
.
CHECKS_EXIT_EMPPROJECT_ERROR
)));
//档案有(在档人员),项目无
}
else
if
(
Common
.
isNotNull
(
tEmployeeInfo
)
&&
Common
.
isEmpty
(
tEmployeeProject
)
&&
CommonConstants
.
dingleDigitIntArray
[
0
]
==
tEmployeeInfo
.
getFileStatus
())
{
updateExcelPost
(
excel
,
updateList
,
tEmployeeInfo
,
CommonConstants
.
ONE_INT
);
updateExcelPost
(
excel
,
updateList
,
tEmployeeInfo
,
CommonConstants
.
ONE_INT
);
insertExcelPro
(
excel
,
proInsList
);
//档案有(在档人员),项目有(草稿/已审核);
}
else
if
(
Common
.
isNotNull
(
tEmployeeInfo
)
&&
CommonConstants
.
dingleDigitIntArray
[
0
]
==
tEmployeeInfo
.
getFileStatus
()
&&
Common
.
isNotNull
(
tEmployeeProject
)
&&
CommonConstants
.
dingleDigitIntArray
[
0
]
==
tEmployeeProject
.
getProjectStatus
())
{
updateExcelPost
(
excel
,
updateList
,
tEmployeeInfo
,
CommonConstants
.
ZERO_INT
);
updateExcelPost
(
excel
,
updateList
,
tEmployeeInfo
,
CommonConstants
.
ZERO_INT
);
updateExcelPro
(
excel
,
proupdateList
,
tEmployeeProject
);
}
...
...
@@ -430,18 +511,18 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
if
(
CommonConstants
.
ONE_STRING
.
equals
(
idAdd
))
{
//档案有(离职库),项目(已减档)
if
(
Common
.
isNotNull
(
tEmployeeInfo
)
&&
CommonConstants
.
dingleDigitIntArray
[
1
]
==
tEmployeeInfo
.
getFileStatus
()
&&
Common
.
isNotNull
(
tEmployeeProject
)
&&
CommonConstants
.
dingleDigitIntArray
[
1
]
==
tEmployeeProject
.
getProjectStatus
())
{
updateExcelPost
(
excel
,
updateList
,
tEmployeeInfo
,
CommonConstants
.
ZERO_INT
);
&&
Common
.
isNotNull
(
tEmployeeProject
)
&&
CommonConstants
.
dingleDigitIntArray
[
1
]
==
tEmployeeProject
.
getProjectStatus
())
{
updateExcelPost
(
excel
,
updateList
,
tEmployeeInfo
,
CommonConstants
.
ZERO_INT
);
updateExcelPro
(
excel
,
proupdateList
,
tEmployeeProject
);
//档案有(离职库),项目无;
}
else
if
(
Common
.
isNotNull
(
tEmployeeInfo
)
&&
CommonConstants
.
dingleDigitIntArray
[
1
]
==
tEmployeeInfo
.
getFileStatus
()
&&
Common
.
isEmpty
(
tEmployeeProject
)
)
{
updateExcelPost
(
excel
,
updateList
,
tEmployeeInfo
,
CommonConstants
.
ONE_INT
);
&&
Common
.
isEmpty
(
tEmployeeProject
)
)
{
updateExcelPost
(
excel
,
updateList
,
tEmployeeInfo
,
CommonConstants
.
ONE_INT
);
insertExcelPro
(
excel
,
proInsList
);
//档案有(在档人员),项目(已减档)
}
else
if
(
Common
.
isNotNull
(
tEmployeeInfo
)
&&
CommonConstants
.
dingleDigitIntArray
[
0
]
==
tEmployeeInfo
.
getFileStatus
()
&&
Common
.
isNotNull
(
tEmployeeProject
)
&&
CommonConstants
.
dingleDigitIntArray
[
1
]
==
tEmployeeProject
.
getProjectStatus
())
{
updateExcelPost
(
excel
,
updateList
,
tEmployeeInfo
,
CommonConstants
.
ZERO_INT
);
&&
Common
.
isNotNull
(
tEmployeeProject
)
&&
CommonConstants
.
dingleDigitIntArray
[
1
]
==
tEmployeeProject
.
getProjectStatus
())
{
updateExcelPost
(
excel
,
updateList
,
tEmployeeInfo
,
CommonConstants
.
ZERO_INT
);
updateExcelPro
(
excel
,
proupdateList
,
tEmployeeProject
);
}
//不允许复档复项
...
...
@@ -449,14 +530,15 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
//档案有(离职库),项目(已减档)
if
(
Common
.
isNotNull
(
tEmployeeInfo
)
&&
CommonConstants
.
dingleDigitIntArray
[
1
]
==
tEmployeeInfo
.
getFileStatus
()
&&
Common
.
isNotNull
(
tEmployeeProject
)
&&
CommonConstants
.
dingleDigitIntArray
[
1
]
==
tEmployeeProject
.
getProjectStatus
())
{
errorMessageList
.
add
(
new
ErrorMessage
(
excel
.
getRowIndex
(),
MsgUtils
.
getMessage
(
ErrorCodes
.
CHECKS_EMP_PROJECT_ERROR
)));
errorMessageList
.
add
(
new
ErrorMessage
(
excel
.
getRowIndex
(),
MsgUtils
.
getMessage
(
ErrorCodes
.
CHECKS_EMP_PROJECT_ERROR
)));
}
else
if
(
Common
.
isNotNull
(
tEmployeeInfo
)
&&
CommonConstants
.
dingleDigitIntArray
[
1
]
==
tEmployeeInfo
.
getFileStatus
()
&&
Common
.
isEmpty
(
tEmployeeProject
))
{
errorMessageList
.
add
(
new
ErrorMessage
(
excel
.
getRowIndex
(),
MsgUtils
.
getMessage
(
ErrorCodes
.
CHECKS_REDUCE_EMP_ERROR
)));
errorMessageList
.
add
(
new
ErrorMessage
(
excel
.
getRowIndex
(),
MsgUtils
.
getMessage
(
ErrorCodes
.
CHECKS_REDUCE_EMP_ERROR
)));
//档案有(在档人员),项目(已减档)
}
else
if
(
Common
.
isNotNull
(
tEmployeeInfo
)
&&
CommonConstants
.
dingleDigitIntArray
[
0
]
==
tEmployeeInfo
.
getFileStatus
()
&&
Common
.
isNotNull
(
tEmployeeProject
)
&&
CommonConstants
.
dingleDigitIntArray
[
1
]
==
tEmployeeProject
.
getProjectStatus
()){
errorMessageList
.
add
(
new
ErrorMessage
(
excel
.
getRowIndex
(),
MsgUtils
.
getMessage
(
ErrorCodes
.
CHECKS_REDUCE_PROJECT_ERROR
)));
}
&&
Common
.
isNotNull
(
tEmployeeProject
)
&&
CommonConstants
.
dingleDigitIntArray
[
1
]
==
tEmployeeProject
.
getProjectStatus
())
{
errorMessageList
.
add
(
new
ErrorMessage
(
excel
.
getRowIndex
(),
MsgUtils
.
getMessage
(
ErrorCodes
.
CHECKS_REDUCE_PROJECT_ERROR
)));
}
}
}
...
...
@@ -467,21 +549,23 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
if
(
proInsList
.
size
()
>
CommonConstants
.
dingleDigitIntArray
[
0
])
{
baseMapper
.
insertExcelEmpProject
(
proInsList
);
List
<
String
>
idList
=
proInsList
.
stream
().
map
(
TEmployeeProject:
:
getEmpIdcard
).
collect
(
Collectors
.
toList
());
List
<
TEmployeeInfo
>
updList
=
tEmployeeInfoMapper
.
selectList
(
Wrappers
.<
TEmployeeInfo
>
query
().
lambda
().
in
(
TEmployeeInfo:
:
getEmpIdcard
,
idList
));
List
<
TEmployeeInfo
>
updList
=
tEmployeeInfoMapper
.
selectList
(
Wrappers
.<
TEmployeeInfo
>
query
().
lambda
().
in
(
TEmployeeInfo:
:
getEmpIdcard
,
idList
));
baseMapper
.
updateEmpIdById
(
updList
);
}
if
(
proupdateList
.
size
()
>
CommonConstants
.
dingleDigitIntArray
[
0
])
{
baseMapper
.
updateExcelEmpProject
(
proupdateList
);
}
}
catch
(
Exception
e
)
{
log
.
error
(
"数据更新异常"
,
e
);
log
.
error
(
"数据更新异常"
,
e
);
}
}
@Override
@Transactional
public
R
<
List
<
ErrorMessage
>>
importEmpProjectUpdate
(
InputStream
inputStream
)
{
List
<
ErrorMessage
>
errorMessageList
=
new
ArrayList
<>();
ExcelUtil
<
EmployeeProjectVO
>
util1
=
new
ExcelUtil
<>(
EmployeeProjectVO
.
class
);;
ExcelUtil
<
EmployeeProjectVO
>
util1
=
new
ExcelUtil
<>(
EmployeeProjectVO
.
class
);
;
// 写法2:
// 匿名内部类 不用额外写一个DemoDataListener
// 这里 需要指定读用哪个class去读,然后读取第一个sheet 文件流会自动关闭
...
...
@@ -500,11 +584,11 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
public
void
invoke
(
EmployeeProjectVO
data
,
AnalysisContext
context
)
{
ReadRowHolder
readRowHolder
=
context
.
readRowHolder
();
Integer
rowIndex
=
readRowHolder
.
getRowIndex
();
data
.
setRowIndex
(
rowIndex
+
1
);
data
.
setRowIndex
(
rowIndex
+
1
);
ErrorMessage
errorMessage
=
util1
.
checkEntity
(
data
,
data
.
getRowIndex
());
if
(
Common
.
isNotNull
(
errorMessage
)){
if
(
Common
.
isNotNull
(
errorMessage
))
{
errorMessageList
.
add
(
errorMessage
);
}
else
{
}
else
{
cachedDataList
.
add
(
data
);
}
if
(
cachedDataList
.
size
()
>=
BATCH_COUNT
)
{
...
...
@@ -524,25 +608,25 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
*/
private
void
saveData
()
{
log
.
info
(
"{}条数据,开始存储数据库!"
,
cachedDataList
.
size
());
importEmpProjectUpdate
(
cachedDataList
,
errorMessageList
);
importEmpProjectUpdate
(
cachedDataList
,
errorMessageList
);
log
.
info
(
"存储数据库成功!"
);
}
}).
sheet
().
doRead
();
}
catch
(
Exception
e
)
{
log
.
error
(
CommonConstants
.
IMPORT_DATA_ANALYSIS_ERROR
,
e
);
}
catch
(
Exception
e
)
{
log
.
error
(
CommonConstants
.
IMPORT_DATA_ANALYSIS_ERROR
,
e
);
return
R
.
failed
(
CommonConstants
.
IMPORT_DATA_ANALYSIS_ERROR
);
}
return
R
.
ok
(
errorMessageList
);
return
R
.
ok
(
errorMessageList
);
}
/**
* @Author huyc
* @Description
批量更新项目档案信息
* @Description 批量更新项目档案信息
* @Date 19:25 2022/6/21
**/
public
void
importEmpProjectUpdate
(
List
<
EmployeeProjectVO
>
excelVOList
,
List
<
ErrorMessage
>
errorMessageList
)
{
// 通用校验获取失败的数据
Map
<
Long
,
ErrorMessage
>
errorMsgMap
=
new
HashMap
<>();
Map
<
Long
,
ErrorMessage
>
errorMsgMap
=
new
HashMap
<>();
List
<
TEmployeeProject
>
updateList
=
new
ArrayList
<>();
...
...
@@ -557,7 +641,7 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
String
checkCount
=
excel
.
getEmpIdcard
().
concat
(
excel
.
getDeptNo
());
if
(
Common
.
isNotNull
(
checkCountMap
.
get
(
checkCount
)))
{
errorMessageList
.
add
(
new
ErrorMessage
(
excel
.
getRowIndex
(),
"第"
+
(
excel
.
getRowIndex
())
+
"行身份证号+项目编码与第"
+
checkCountMap
.
get
(
checkCount
)
+
"行重复!"
));
errorMessageList
.
add
(
new
ErrorMessage
(
excel
.
getRowIndex
(),
"第"
+
(
excel
.
getRowIndex
())
+
"行身份证号+项目编码与第"
+
checkCountMap
.
get
(
checkCount
)
+
"行重复!"
));
}
else
{
checkCountMap
.
put
(
checkCount
,
i
+
2
);
}
...
...
@@ -567,12 +651,29 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
.
eq
(
TEmployeeProject:
:
getDeptNo
,
excel
.
getDeptNo
())
.
eq
(
TEmployeeProject:
:
getDeleteFlag
,
CommonConstants
.
STATUS_NORMAL
));
if
(
Common
.
isEmpty
(
tEmployeeProject
))
{
errorMessageList
.
add
(
new
ErrorMessage
(
excel
.
getRowIndex
(),
MsgUtils
.
getMessage
(
ErrorCodes
.
CHECKS_EMP_EXIT_ERROR
)));
errorMessageList
.
add
(
new
ErrorMessage
(
excel
.
getRowIndex
(),
MsgUtils
.
getMessage
(
ErrorCodes
.
CHECKS_EMP_EXIT_ERROR
)));
}
// 数据合法情况
if
(
CollUtil
.
isEmpty
(
errorMessageList
))
{
updateExcelPro
(
excel
,
updateList
,
tEmployeeProject
);
updateExcelPro
(
excel
,
updateList
,
tEmployeeProject
);
if
(!
excel
.
getEmpNatrue
().
equals
(
tEmployeeProject
.
getEmpNatrue
()))
{
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
);
}
tEmployeeInfoMapper
.
updateById
(
tEmployeeInfo
);
tEmployeeLogService
.
saveModificationRecord
(
CommonConstants
.
dingleDigitIntArray
[
0
],
tEmployeeInfo
.
getId
(),
""
,
tEmployeeInfoCof
,
tEmployeeInfo
);
}
}
}
}
try
{
...
...
@@ -580,18 +681,18 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
baseMapper
.
updateExcelEmpProject
(
updateList
);
}
}
catch
(
Exception
e
)
{
log
.
error
(
"数据更新异常"
,
e
);
log
.
error
(
"数据更新异常"
,
e
);
}
}
/**
* 插入excel Pro
*/
private
void
insertExcelPro
(
EmployeeProjectVO
excel
,
List
<
TEmployeeProject
>
proInsList
)
{
private
void
insertExcelPro
(
EmployeeProjectVO
excel
,
List
<
TEmployeeProject
>
proInsList
)
{
TEmployeeProject
insTEmployeePro
=
new
TEmployeeProject
();
BeanUtil
.
copyProperties
(
excel
,
insTEmployeePro
);
insTEmployeePro
.
setId
(
String
.
valueOf
(
UUID
.
randomUUID
()).
replaceAll
(
"-"
,
""
));
insTEmployeePro
.
setId
(
String
.
valueOf
(
UUID
.
randomUUID
()).
replaceAll
(
"-"
,
""
));
insTEmployeePro
.
setDeleteFlag
(
CommonConstants
.
STATUS_NORMAL
);
insTEmployeePro
.
setStatus
(
CommonConstants
.
dingleDigitIntArray
[
0
]);
//人员档案主表id先设置成空,后面更新id
...
...
@@ -599,13 +700,13 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
//获取项目和单位信息
TSettleDomain
tSettleDomain
=
tSettleDomainService
.
getOne
(
Wrappers
.<
TSettleDomain
>
query
().
lambda
()
.
eq
(
TSettleDomain:
:
getDepartNo
,
insTEmployeePro
.
getDeptNo
()).
eq
(
TSettleDomain:
:
getDeleteFlag
,
CommonConstants
.
STATUS_NORMAL
)
.
eq
(
TSettleDomain:
:
getStopFlag
,
CommonConstants
.
STATUS_NORMAL
));
.
eq
(
TSettleDomain:
:
getDepartNo
,
insTEmployeePro
.
getDeptNo
()).
eq
(
TSettleDomain:
:
getDeleteFlag
,
CommonConstants
.
STATUS_NORMAL
)
.
eq
(
TSettleDomain:
:
getStopFlag
,
CommonConstants
.
STATUS_NORMAL
));
if
(
Common
.
isNotNull
(
tSettleDomain
))
{
insTEmployeePro
.
setDeptId
(
tSettleDomain
.
getId
());
insTEmployeePro
.
setDeptName
(
tSettleDomain
.
getDepartName
());
TCustomerInfo
tCustomerInfo
=
tCustomerInfoMapper
.
selectById
(
tSettleDomain
.
getCustomerId
());
if
(
Common
.
isNotNull
(
tCustomerInfo
))
{;
if
(
Common
.
isNotNull
(
tCustomerInfo
))
{
insTEmployeePro
.
setUnitId
(
tCustomerInfo
.
getId
());
insTEmployeePro
.
setUnitNo
(
tCustomerInfo
.
getCustomerCode
());
insTEmployeePro
.
setUnitName
(
tCustomerInfo
.
getCustomerName
());
...
...
@@ -639,21 +740,21 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
if
(
Common
.
isNotEmpty
(
idsList
))
{
list
=
baseMapper
.
selectList
(
Wrappers
.<
TEmployeeProject
>
query
().
lambda
().
in
(
TEmployeeProject:
:
getId
,
idsList
));
}
if
(
Common
.
isNotEmpty
(
list
))
{
if
(
Common
.
isNotEmpty
(
list
))
{
int
i
=
0
;
for
(
TEmployeeProject
delProject
:
list
)
{
++
i
;
try
{
if
(
CommonConstants
.
dingleDigitIntArray
[
0
]
==
delProject
.
getStatus
())
{
if
(
CommonConstants
.
dingleDigitIntArray
[
0
]
==
delProject
.
getStatus
())
{
delProject
.
setDeleteFlag
(
CommonConstants
.
ONE_STRING
);
baseMapper
.
updateById
(
delProject
);
}
else
{
errorList
.
add
(
new
ErrorMessage
(
i
,
MsgUtils
.
getMessage
(
ErrorCodes
.
CHECKS_PROJECT_DELETE_ERROR
)));
}
else
{
errorList
.
add
(
new
ErrorMessage
(
i
,
MsgUtils
.
getMessage
(
ErrorCodes
.
CHECKS_PROJECT_DELETE_ERROR
)));
}
}
catch
(
Exception
e
)
{
log
.
error
(
"项目档案批量删除异常:"
+
e
.
getMessage
());
errorList
.
add
(
new
ErrorMessage
(
i
,
MsgUtils
.
getMessage
(
"项目档案批量删除异常:"
,
e
.
getMessage
())));
return
R
.
failed
(
errorList
,
CommonConstants
.
RESULT_DATA_FAIL
);
errorList
.
add
(
new
ErrorMessage
(
i
,
MsgUtils
.
getMessage
(
"项目档案批量删除异常:"
,
e
.
getMessage
())));
return
R
.
failed
(
errorList
,
CommonConstants
.
RESULT_DATA_FAIL
);
}
}
}
...
...
@@ -665,13 +766,13 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
@Override
public
IPage
<
TEmployeeProject
>
getTEmployeeProjectInfoPage
(
Page
page
,
TEmployeeProject
tEmployeeProject
)
{
return
baseMapper
.
getTEmployeeProjectInfoPage
(
page
,
tEmployeeProject
);
return
baseMapper
.
getTEmployeeProjectInfoPage
(
page
,
tEmployeeProject
);
}
/**
* @Author huyc
* @Description
批量导出项目档案信息
* @Description 批量导出项目档案信息
* @Date 10:55 2022/6/23
**/
@Override
...
...
@@ -690,28 +791,28 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
//获取记录
list
=
gettEmpProInfoExportVos
(
idstr
,
projectDTO
);
if
(
Common
.
isNotNull
(
list
)){
if
(
Common
.
isNotNull
(
list
))
{
ExcelUtil
<
EmployeeProjectExportVO
>
util
=
new
ExcelUtil
<>(
EmployeeProjectExportVO
.
class
);
for
(
EmployeeProjectExportVO
vo
:
list
)
{
util
.
convertEntity
(
vo
,
null
,
null
,
null
);
for
(
EmployeeProjectExportVO
vo
:
list
)
{
util
.
convertEntity
(
vo
,
null
,
null
,
null
);
}
}
ServletOutputStream
out
=
null
;
try
{
if
(
list
.
size
()
>
0
)
{
if
(
list
.
size
()
>
0
)
{
out
=
response
.
getOutputStream
();
response
.
setContentType
(
"multipart/form-data"
);
response
.
setCharacterEncoding
(
"utf-8"
);
response
.
setHeader
(
"Content-Disposition"
,
"attachment;filename*=utf-8'zh_cn'"
+
URLEncoder
.
encode
(
fileName
,
"UTF-8"
));
response
.
setHeader
(
"Content-Disposition"
,
"attachment;filename*=utf-8'zh_cn'"
+
URLEncoder
.
encode
(
fileName
,
"UTF-8"
));
// 这里 需要指定写用哪个class去写,然后写到第一个sheet,然后文件流会自动关闭
EasyExcel
.
write
(
out
,
EmployeeProjectExportVO
.
class
).
includeColumnFiledNames
(
includeColumnFiledNames
).
sheet
(
"项目档案"
)
.
doWrite
(
list
);
out
.
flush
();
}
}
catch
(
Exception
e
)
{
log
.
error
(
"执行异常"
,
e
);
}
finally
{
}
catch
(
Exception
e
)
{
log
.
error
(
"执行异常"
,
e
);
}
finally
{
try
{
if
(
null
!=
out
)
{
out
.
close
();
...
...
@@ -744,13 +845,14 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
tEmployeeProject
.
setDeptNo
(
employeeInfo
.
getDeptNo
());
TSettleDomain
tSettleDomain
=
tSettleDomainService
.
getOne
(
Wrappers
.<
TSettleDomain
>
query
().
lambda
()
.
eq
(
TSettleDomain:
:
getDepartNo
,
employeeInfo
.
getDeptNo
()).
eq
(
TSettleDomain:
:
getDeleteFlag
,
CommonConstants
.
STATUS_NORMAL
)
.
eq
(
TSettleDomain:
:
getStopFlag
,
CommonConstants
.
STATUS_NORMAL
));
.
eq
(
TSettleDomain:
:
getDepartNo
,
employeeInfo
.
getDeptNo
()).
eq
(
TSettleDomain:
:
getDeleteFlag
,
CommonConstants
.
STATUS_NORMAL
)
.
eq
(
TSettleDomain:
:
getStopFlag
,
CommonConstants
.
STATUS_NORMAL
));
if
(
Common
.
isNotNull
(
tSettleDomain
))
{
tEmployeeProject
.
setDeptId
(
tSettleDomain
.
getId
());
tEmployeeProject
.
setDeptName
(
tSettleDomain
.
getDepartName
());
TCustomerInfo
tCustomerInfo
=
tCustomerInfoMapper
.
selectById
(
tSettleDomain
.
getCustomerId
());
if
(
Common
.
isNotNull
(
tCustomerInfo
))
{;
if
(
Common
.
isNotNull
(
tCustomerInfo
))
{
;
tEmployeeProject
.
setUnitId
(
tCustomerInfo
.
getId
());
tEmployeeProject
.
setUnitNo
(
tCustomerInfo
.
getCustomerCode
());
tEmployeeProject
.
setUnitName
(
tCustomerInfo
.
getCustomerName
());
...
...
@@ -762,7 +864,7 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
/**
* 获取导出的项目档案列表
*/
private
List
<
EmployeeProjectExportVO
>
gettEmpProInfoExportVos
(
String
idstr
,
EmployeeProjectExportVO
projectDTO
)
{
private
List
<
EmployeeProjectExportVO
>
gettEmpProInfoExportVos
(
String
idstr
,
EmployeeProjectExportVO
projectDTO
)
{
List
<
EmployeeProjectExportVO
>
list
;
if
(!
Common
.
isEmpty
(
idstr
))
{
projectDTO
.
setIdList
(
Common
.
initStrToList
(
idstr
,
CommonConstants
.
COMMA_STRING
));
...
...
@@ -774,7 +876,8 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
/**
* 更新人员档案
*/
private
void
updateExcelPost
(
EmployeeProjectVO
excel
,
List
<
TEmployeeInfo
>
updateList
,
TEmployeeInfo
tEmployeeInfo
,
int
num
)
{
private
void
updateExcelPost
(
EmployeeProjectVO
excel
,
List
<
TEmployeeInfo
>
updateList
,
TEmployeeInfo
tEmployeeInfo
,
int
num
)
{
String
empNature
=
tEmployeeInfo
.
getEmpNatrue
();
BeanUtil
.
copyProperties
(
excel
,
tEmployeeInfo
);
YifuUser
user
=
SecurityUtils
.
getUser
();
tEmployeeInfo
.
setUpdateBy
(
user
.
getId
());
...
...
@@ -783,7 +886,7 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
}
if
(
CommonConstants
.
ZERO_STRING
.
equals
(
tEmployeeInfo
.
getEmpNatrue
()))
{
tEmployeeInfo
.
setEmpNatrue
(
CommonConstants
.
ZERO_STRING
);
}
else
if
(
CommonConstants
.
ONE_STRING
.
equals
(
tEmployeeInfo
.
getEmpNatrue
())
&&
!
CommonConstants
.
ZERO_STRING
.
equals
(
tEmployeeInfo
.
getEmpNatrue
()
))
{
}
else
if
(
CommonConstants
.
ONE_STRING
.
equals
(
tEmployeeInfo
.
getEmpNatrue
())
&&
!
CommonConstants
.
ZERO_STRING
.
equals
(
empNature
))
{
tEmployeeInfo
.
setEmpNatrue
(
CommonConstants
.
ONE_STRING
);
}
updateList
.
add
(
tEmployeeInfo
);
...
...
@@ -795,7 +898,7 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
/**
* 更新项目档案
*/
private
void
updateExcelPro
(
EmployeeProjectVO
excel
,
List
<
TEmployeeProject
>
proupdateList
,
TEmployeeProject
tEmployeeProject
)
{
private
void
updateExcelPro
(
EmployeeProjectVO
excel
,
List
<
TEmployeeProject
>
proupdateList
,
TEmployeeProject
tEmployeeProject
)
{
BeanUtil
.
copyProperties
(
excel
,
tEmployeeProject
);
YifuUser
user
=
SecurityUtils
.
getUser
();
tEmployeeProject
.
setUpdateBy
(
user
.
getId
());
...
...
@@ -828,10 +931,10 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
@Override
public
R
getItemByEmpNo
(
String
empIdcard
,
String
empNo
)
{
TSettleDomain
tSettleDomain
=
tSettleDomainService
.
getOne
(
Wrappers
.<
TSettleDomain
>
query
().
lambda
()
.
eq
(
TSettleDomain:
:
getDepartNo
,
empNo
));
.
eq
(
TSettleDomain:
:
getDepartNo
,
empNo
));
TEmployeeInfo
tEmployeeInfo
=
tEmployeeInfoMapper
.
selectOne
(
Wrappers
.<
TEmployeeInfo
>
query
().
lambda
()
.
eq
(
TEmployeeInfo:
:
getEmpIdcard
,
empIdcard
));
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
.
eq
(
TEmployeeInfo:
:
getEmpIdcard
,
empIdcard
));
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
String
empCode
=
""
;
if
(
Common
.
isNotNull
(
tEmployeeInfo
))
{
empCode
=
tEmployeeInfo
.
getEmpCode
();
...
...
@@ -839,27 +942,27 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
String
customerName
=
""
;
if
(
Common
.
isNotNull
(
tSettleDomain
))
{
TCustomerInfo
tCustomerInfo
=
tCustomerInfoMapper
.
selectOne
(
Wrappers
.<
TCustomerInfo
>
query
().
lambda
()
.
eq
(
TCustomerInfo:
:
getId
,
tSettleDomain
.
getCustomerId
()));
.
eq
(
TCustomerInfo:
:
getId
,
tSettleDomain
.
getCustomerId
()));
if
(
Common
.
isNotNull
(
tCustomerInfo
))
{
customerName
=
tCustomerInfo
.
getCustomerName
();
}
}
map
.
put
(
"empCode"
,
empCode
);
map
.
put
(
"itemInfo"
,
tSettleDomain
);
map
.
put
(
"customerName"
,
customerName
);
map
.
put
(
"empCode"
,
empCode
);
map
.
put
(
"itemInfo"
,
tSettleDomain
);
map
.
put
(
"customerName"
,
customerName
);
return
R
.
ok
(
map
);
}
@Override
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:
:
getEmpIdcard
,
empIdCard
));
Map
<
String
,
String
>
projectMap
=
new
HashMap
<>();
if
(
Common
.
isNotNull
(
projects
)){
for
(
TEmployeeProject
project
:
projects
)
{
projectMap
.
put
(
project
.
getDeptName
(),
project
.
getDeptNo
());
List
<
TEmployeeProject
>
projects
=
baseMapper
.
selectList
(
Wrappers
.<
TEmployeeProject
>
query
().
lambda
()
.
eq
(
TEmployeeProject:
:
getDeleteFlag
,
CommonConstants
.
ZERO_STRING
)
.
eq
(
TEmployeeProject:
:
getProjectStatus
,
CommonConstants
.
ZERO_STRING
)
.
eq
(
TEmployeeProject:
:
getEmpIdcard
,
empIdCard
));
Map
<
String
,
String
>
projectMap
=
new
HashMap
<>();
if
(
Common
.
isNotNull
(
projects
))
{
for
(
TEmployeeProject
project
:
projects
)
{
projectMap
.
put
(
project
.
getDeptName
(),
project
.
getDeptNo
());
}
}
return
R
.
ok
(
projectMap
);
...
...
@@ -876,4 +979,25 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
}
return
str
;
}
//从剩下的项目档案中查找员工类型
public
void
setEmpNature
(
String
empIdcard
,
TEmployeeInfo
tEmployeeInfo
)
{
List
<
TEmployeeProject
>
list
=
this
.
list
(
Wrappers
.<
TEmployeeProject
>
query
().
lambda
()
.
eq
(
TEmployeeProject:
:
getEmpIdcard
,
empIdcard
)
.
eq
(
TEmployeeProject:
:
getDeleteFlag
,
CommonConstants
.
STATUS_NORMAL
)
.
eq
(
TEmployeeProject:
:
getProjectStatus
,
CommonConstants
.
ZERO_INT
));
if
(
Common
.
isNotNull
(
list
))
{
for
(
TEmployeeProject
t
:
list
)
{
if
(
CommonConstants
.
ZERO_STRING
.
equals
(
t
.
getEmpNatrue
()))
{
tEmployeeInfo
.
setEmpNatrue
(
CommonConstants
.
ZERO_STRING
);
break
;
}
if
(
CommonConstants
.
ONE_STRING
.
equals
(
t
.
getEmpNatrue
())
&&
!
CommonConstants
.
ONE_STRING
.
equals
(
tEmployeeInfo
.
getEmpNatrue
()))
{
tEmployeeInfo
.
setEmpNatrue
(
CommonConstants
.
ONE_STRING
);
break
;
}
}
}
}
}
yifu-archives/yifu-archives-biz/src/main/resources/mapper/FddContractAttachInfoMapper.xml
View file @
67506bc9
...
...
@@ -104,9 +104,6 @@
<if
test=
"fddContractAttachInfo.salaryStandardPerPiece != null"
>
AND a.SALARY_STANDARD_PER_PIECE = #{fddContractAttachInfo.salaryStandardPerPiece}
</if>
<if
test=
"fddContractAttachInfo.createUserId != null and fddContractAttachInfo.createUserId.trim() != ''"
>
AND a.CREATE_USER_ID = #{fddContractAttachInfo.createUserId}
</if>
<if
test=
"fddContractAttachInfo.fddTemplateId != null and fddContractAttachInfo.fddTemplateId.trim() != ''"
>
AND a.FDD_TEMPLATE_ID = #{fddContractAttachInfo.fddTemplateId}
</if>
...
...
yifu-archives/yifu-archives-biz/src/main/resources/mapper/TElecEmployeeInfoMapper.xml
View file @
67506bc9
...
...
@@ -48,7 +48,7 @@
a.EMP_IDCARD,
b.EMP_NO,
b.UNIT_NAME,
b.
deptNo
,
b.
DEPT_NO
,
b.DEPT_NAME,
a.DATA_TYPE,
a.ATTA_INFO,
...
...
@@ -72,9 +72,6 @@
<if
test=
"tElecEmployeeInfo.empIdcard != null and tElecEmployeeInfo.empIdcard.trim() != ''"
>
AND a.EMP_IDCARD = #{tElecEmployeeInfo.empIdcard}
</if>
<if
test=
"tElecEmployeeInfo.empCode != null and tElecEmployeeInfo.empCode.trim() != ''"
>
AND b.EMP_CODE = #{tElecEmployeeInfo.empCode}
</if>
<if
test=
"tElecEmployeeInfo.unitName != null and tElecEmployeeInfo.unitName.trim() != ''"
>
AND b.UNIT_NAME like concat('%',#{tElecEmployeeInfo.unitName},'%')
</if>
...
...
yifu-archives/yifu-archives-biz/src/main/resources/mapper/TEmployeeInfoMapper.xml
View file @
67506bc9
...
...
@@ -207,8 +207,8 @@
a.FILE_SOURCE,
if(count(b.id)>1,'是','否') IS_PROJECTS,
a.PROJECT_NUM,
GROUP_CONCAT(b.DEPT_NAME) DEPT_NAME,
GROUP_CONCAT(b.DEPT_NO) DEPT_NO,
GROUP_CONCAT(
DISTINCT
b.DEPT_NAME) DEPT_NAME,
GROUP_CONCAT(
DISTINCT
b.DEPT_NO) DEPT_NO,
a.CONTRACT_STATUS,
a.INSURANCE_STATUS,
a.SOCIAL_STATUS,
...
...
@@ -426,8 +426,8 @@
SELECT
a.ID,
<include
refid=
"Base_Export_List"
/>
,GROUP_CONCAT(b.unit_name) UNIT_NAME
,GROUP_CONCAT(b.unit_no) UNIT_NO
,GROUP_CONCAT(
DISTINCT
b.unit_name) UNIT_NAME
,GROUP_CONCAT(
DISTINCT
b.unit_no) UNIT_NO
,a.LEAVE_TIME
,a.LEAVE_USER
,a.LEAVE_REASON
...
...
@@ -544,8 +544,8 @@
<select
id=
"getTEmployeeLeaveExportList"
resultMap=
"tEmployeeExportMap"
>
SELECT
<include
refid=
"Base_Export_List"
/>
,GROUP_CONCAT(b.unit_name) UNIT_NAME
,GROUP_CONCAT(b.unit_no) UNIT_NO
,GROUP_CONCAT(
DISTINCT
b.unit_name) UNIT_NAME
,GROUP_CONCAT(
DISTINCT
b.unit_no) UNIT_NO
,a.LEAVE_TIME
,a.LEAVE_USER
,a.LEAVE_REASON
...
...
yifu-archives/yifu-archives-biz/src/main/resources/mapper/TEmployeeProjectMapper.xml
View file @
67506bc9
...
...
@@ -595,12 +595,11 @@
ID=#{i.id}
</foreach>
</update>
<insert
id=
"insertExcelEmpProject"
parameterType=
"java.util.List"
>
insert into t_employee_project
(ID,EMP_ID,EMP_NATRUE,EMP_NAME,EMP_IDCARD,STATUS,PROJECT_STATUS,EMP_CODE,DEPT_NO,CONTRACT_TYPE,POST,
EMP_NO,
TRY_PERIOD,ENJOIN_DATE,BANK_NAME,BANK_NO,BANK_SUB_NAME,DELETE_FLAG,CREATE_BY,CREATE_NAME,CREATE_TIME,INSURANCE_STATUS
,SOCIAL_STATUS,FUND_STATUS)
(ID,EMP_ID,EMP_NATRUE,EMP_NAME,EMP_IDCARD,STATUS,PROJECT_STATUS,EMP_CODE,DEPT_NO,CONTRACT_TYPE,POST,
DEPT_ID,DEPT_NAME,UNIT_ID,UNIT_NAME,UNIT_NO,EMP_NO,TRY_PERIOD,ENJOIN_DATE,BANK_NAME,BANK_NO,BANK_SUB_NAME,
DELETE_FLAG,CREATE_BY,CREATE_NAME,CREATE_TIME,INSURANCE_STATUS
,SOCIAL_STATUS,FUND_STATUS)
VALUES
<foreach
collection=
"list"
item=
"item"
index=
"index"
separator=
","
>
(
...
...
@@ -615,6 +614,11 @@
#{item.deptNo,jdbcType=VARCHAR},
#{item.contractType,jdbcType=VARCHAR},
#{item.post,jdbcType=VARCHAR},
#{item.deptId,jdbcType=VARCHAR},
#{item.deptName,jdbcType=VARCHAR},
#{item.unitId,jdbcType=VARCHAR},
#{item.unitName,jdbcType=VARCHAR},
#{item.unitNo,jdbcType=VARCHAR},
#{item.empNo,jdbcType=VARCHAR},
#{item.tryPeriod,jdbcType=VARCHAR},
#{item.enjoinDate,jdbcType=DATE},
...
...
yifu-common/yifu-common-core/src/main/java/com/yifu.cloud.plus.v1/yifu/common/core/constant/CommonConstants.java
View file @
67506bc9
...
...
@@ -317,4 +317,7 @@ public interface CommonConstants {
* @author fxj
*/
int
THREE_INT_NEGATE
=
-
3
;
// 是否
String
IS_CHANGE
=
"划转"
;
}
yifu-common/yifu-common-core/src/main/java/com/yifu.cloud.plus.v1/yifu/common/core/exception/ErrorCodes.java
View file @
67506bc9
...
...
@@ -295,8 +295,33 @@ public interface ErrorCodes {
* 人员在该项目下存在进行中/未完结的服务
*/
String
ARCHIVES_PROJECT_CHANGE_NOT_EXIST
=
"archives.project.change.not.exist"
;
/**
* 存在其他草稿/已审核的状态的项目,不允许同步减档
*/
String
QT_PROJECT_CHANGE_NOT_EXIST
=
"qt.project.change.not.exist"
;
/**
* 未找到对应的项目,请核实
*/
String
PROJECT_SEARCH_NOT_EXIST
=
"project.search.not.exist"
;
/**
* 不良记录费用损失和其他损失不可同时为空
*/
String
ARCHIVES_PROJECT_EMP_LOSE_FEE_NOT_EMPTY
=
"archives.project.emp.lose.fee.not.empty"
;
/**
* 划转起始月不能为空
*/
String
CHANGE_START_MONTH_EXIT
=
"change.strat.month.exit"
;
/**
* 划转起始月要小于等于当前月
*/
String
CHANGE_LESS_MONTH_EXIT
=
"change.less.month.exit"
;
/**
* 未找到该人员的项目档案,请核实
*/
String
PROJECT_PERSON_SEARCH_EXIT
=
"project.person.search.exit"
;
/**
* 该人员项目档案已减项,不允许划转
*/
String
PROJECT_PERSON_DELETE_EXIT
=
"project.person.delete.exit"
;
}
yifu-common/yifu-common-core/src/main/resources/i18n/messages_zh_CN.properties
View file @
67506bc9
...
...
@@ -98,6 +98,15 @@ archives.project.change.not.exist=\u4EBA\u5458\u5728\u8BE5\u9879\u76EE\u4E0B\u5B
archives.project.emp.lose.fee.not.empty
=
\u
4E0D
\u
826F
\u
8BB0
\u
5F55
\u
8D39
\u7528\u
635F
\u5931\u
548C
\u5176\u
4ED6
\u
635F
\u5931\u
4E0D
\u
53EF
\u
540C
\u
65F6
\u
4E3A
\u
7A7A
qt.project.change.not.exist
=
\u
5B58
\u5728\u5176\u
4ED6
\u8349\u
7A3F/
\u
5DF2
\u
5BA1
\u6838\u7684\u
72B6
\u6001\u7684\u9879\u
76EE
\u
FF0C
\u
4E0D
\u5141\u
8BB8
\u
540C
\u
6B65
\u
51CF
\u6863
project.search.not.exist
=
\u
672A
\u
627E
\u5230\u
5BF9
\u
5E94
\u7684\u9879\u
76EE
\u
FF0C
\u
8BF7
\u6838\u
5B9E
change.strat.month.exit
=
\u5212\u
8F6C
\u
8D77
\u
59CB
\u6708\u
4E0D
\u
80FD
\u
4E3A
\u
7A7A
change.less.month.exit
=
\u5212\u
8F6C
\u
8D77
\u
59CB
\u6708\u8981\u
5C0F
\u
4E8E
\u
7B49
\u
4E8E
\u
5F53
\u
524D
\u6708
project.person.search.exit
=
\u
672A
\u
627E
\u5230\u
8BE5
\u
4EBA
\u5458\u7684\u9879\u
76EE
\u6863\u6848\u
FF0C
\u
8BF7
\u6838\u
5B9E
project.person.delete.exit
=
\u
8BE5
\u
4EBA
\u5458\u9879\u
76EE
\u6863\u6848\u
5DF2
\u
51CF
\u9879\u
FF0C
\u
4E0D
\u5141\u
8BB8
\u5212\u
8F6C
...
...
yifu-upms/yifu-upms-biz/src/main/java/com/yifu.cloud.plus.v1/yifu/admin/controller/AreaController.java
View file @
67506bc9
...
...
@@ -21,7 +21,7 @@ import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import
com.yifu.cloud.plus.v1.yifu.common.security.annotation.Inner
;
import
io.swagger.v3.oas.annotations.tags.Tag
;
import
lombok.RequiredArgsConstructor
;
import
org.springframework.web.bind.annotation.
Ge
tMapping
;
import
org.springframework.web.bind.annotation.
Pos
tMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
...
...
@@ -50,7 +50,7 @@ public class AreaController {
* @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<java.util.Map < java.lang.Integer, java.lang.String>>
**/
@Inner
@
Ge
tMapping
(
"/inner/getAreaToId"
)
@
Pos
tMapping
(
"/inner/getAreaToId"
)
public
R
<
Map
<
String
,
String
>>
getAreaToId
()
{
return
sysAreaService
.
getAreaToId
();
}
...
...
@@ -63,7 +63,7 @@ public class AreaController {
* @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<java.util.Map < java.lang.String, java.util.Map < java.lang.String, java.lang.String>>>
**/
@Inner
@
Ge
tMapping
(
"/inner/getAreaToName"
)
@
Pos
tMapping
(
"/inner/getAreaToName"
)
public
R
<
Map
<
String
,
String
>>
getAreaToName
()
{
return
sysAreaService
.
getAreaToName
();
}
...
...
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