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
753db303
Commit
753db303
authored
Jun 22, 2022
by
huyuchen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
huyc 项目档案代码提交
parent
1779533d
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
288 additions
and
5 deletions
+288
-5
TEmpChangeInfo.java
...fu/cloud/plus/v1/yifu/archives/entity/TEmpChangeInfo.java
+23
-2
TEmpChangeInfoVO.java
...yifu/cloud/plus/v1/yifu/archives/vo/TEmpChangeInfoVO.java
+76
-0
TEmpChangeInfoController.java
...v1/yifu/archives/controller/TEmpChangeInfoController.java
+80
-0
TEmployeeProjectController.java
.../yifu/archives/controller/TEmployeeProjectController.java
+1
-1
TEmpChangeInfoService.java
.../plus/v1/yifu/archives/service/TEmpChangeInfoService.java
+20
-0
TEmpChangeInfoServiceImpl.java
...yifu/archives/service/impl/TEmpChangeInfoServiceImpl.java
+79
-0
TEmployeeProjectServiceImpl.java
...fu/archives/service/impl/TEmployeeProjectServiceImpl.java
+1
-1
TEmpChangeInfoMapper.xml
...es-biz/src/main/resources/mapper/TEmpChangeInfoMapper.xml
+1
-0
ErrorCodes.java
....cloud.plus.v1/yifu/common/core/exception/ErrorCodes.java
+4
-0
messages_zh_CN.properties
...on-core/src/main/resources/i18n/messages_zh_CN.properties
+3
-1
No files found.
yifu-archives/yifu-archives-api/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/entity/TEmpChangeInfo.java
View file @
753db303
...
...
@@ -17,6 +17,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.yifu.cloud.plus.v1.yifu.common.mybatis.base.BaseEntity
;
...
...
@@ -64,13 +65,13 @@ public class TEmpChangeInfo extends BaseEntity {
/**
* 原结算主体
*/
@Schema
(
description
=
"原
结算主体
"
)
@Schema
(
description
=
"原
项目名称
"
)
private
String
oldSettle
;
/**
* 新结算主体
*/
@Schema
(
description
=
"新
结算主体
"
)
@Schema
(
description
=
"新
项目名称
"
)
private
String
newSettle
;
/**
...
...
@@ -91,4 +92,24 @@ public class TEmpChangeInfo extends BaseEntity {
@Schema
(
description
=
"划转起始月"
)
private
String
changeStartMonth
;
/**
* 结算主体id
*/
@Schema
(
description
=
"结算主体id"
)
@TableField
(
exist
=
false
)
private
String
departId
;
/**
* 客户id
*/
@Schema
(
description
=
"客户id"
)
@TableField
(
exist
=
false
)
private
String
customerId
;
/**
* 身份证号码
*/
@Schema
(
description
=
"身份证号码"
)
private
String
empIdcard
;
}
yifu-archives/yifu-archives-api/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/vo/TEmpChangeInfoVO.java
0 → 100644
View file @
753db303
/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the yifu4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
archives
.
vo
;
import
com.alibaba.excel.annotation.ExcelProperty
;
import
com.alibaba.excel.annotation.write.style.ColumnWidth
;
import
lombok.Data
;
import
javax.validation.constraints.NotNull
;
import
java.io.Serializable
;
/**
* 档案划转日志表
*
* @author huyc
* @date 2022-06-22
*/
@Data
@ColumnWidth
(
30
)
public
class
TEmpChangeInfoVO
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
/**
* 员工姓名
*/
@NotNull
(
message
=
"员工姓名不可为空"
)
@ExcelProperty
(
value
=
"员工姓名"
)
private
String
empName
;
/**
* 身份证号
*/
@NotNull
(
message
=
"身份证号不可为空"
)
@ExcelProperty
(
value
=
"身份证号"
)
private
String
empIdcard
;
/**
* 原项目编码
*/
@ExcelProperty
(
value
=
"原项目编码"
)
private
String
oldSettleCode
;
/**
* 新项目编码
*/
@ExcelProperty
(
value
=
"新项目编码"
)
private
String
newSettleCode
;
/**
* 已产生未结算费用 0:划转 1:不划转
*/
@ExcelProperty
(
value
=
"已产生未结算费用"
)
private
String
unsettleDeal
;
/**
* 划转起始月
*/
@ExcelProperty
(
value
=
"划转起始月"
)
private
String
changeStartMonth
;
}
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/controller/TEmpChangeInfoController.java
View file @
753db303
...
...
@@ -19,16 +19,31 @@ package com.yifu.cloud.plus.v1.yifu.archives.controller;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.pig4cloud.plugin.excel.annotation.RequestExcel
;
import
com.pig4cloud.plugin.excel.vo.ErrorMessage
;
import
com.yifu.cloud.plus.v1.yifu.archives.entity.TCustomerInfo
;
import
com.yifu.cloud.plus.v1.yifu.archives.entity.TEmpChangeInfo
;
import
com.yifu.cloud.plus.v1.yifu.archives.entity.TSettleDomain
;
import
com.yifu.cloud.plus.v1.yifu.archives.service.TCustomerInfoService
;
import
com.yifu.cloud.plus.v1.yifu.archives.service.TEmpChangeInfoService
;
import
com.yifu.cloud.plus.v1.yifu.archives.service.TSettleDomainService
;
import
com.yifu.cloud.plus.v1.yifu.archives.vo.EmpEducationExcelVO
;
import
com.yifu.cloud.plus.v1.yifu.archives.vo.TEmpChangeInfoVO
;
import
com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.R
;
import
com.yifu.cloud.plus.v1.yifu.common.log.annotation.SysLog
;
import
io.swagger.v3.oas.annotations.Operation
;
import
io.swagger.v3.oas.annotations.tags.Tag
;
import
lombok.RequiredArgsConstructor
;
import
org.springframework.security.access.prepost.PreAuthorize
;
import
org.springframework.validation.BindingResult
;
import
org.springframework.web.bind.annotation.*
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
/**
* 档案划转日志表
...
...
@@ -44,6 +59,10 @@ public class TEmpChangeInfoController {
private
final
TEmpChangeInfoService
tEmpChangeInfoService
;
private
final
TCustomerInfoService
tCustomerInfoService
;
private
final
TSettleDomainService
tSettleDomainService
;
/**
* 分页查询
* @param page 分页对象
...
...
@@ -109,4 +128,65 @@ public class TEmpChangeInfoController {
return
R
.
ok
(
tEmpChangeInfoService
.
removeById
(
id
));
}
/**
* 获取所有项目名称
* @return R
* @Author huyc
* @Date 2022-06-22
*/
@Operation
(
summary
=
"获取所有项目名称"
,
description
=
"获取所有项目名称"
)
@SysLog
(
"获取所有项目名称"
)
@GetMapping
(
"/getAllDept"
)
public
R
<
Map
<
String
,
Object
>>
getAllDept
()
{
List
<
TSettleDomain
>
list
=
tSettleDomainService
.
list
(
Wrappers
.<
TSettleDomain
>
query
().
lambda
().
eq
(
TSettleDomain:
:
getDeleteFlag
,
CommonConstants
.
STATUS_NORMAL
));
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
=
list
.
stream
().
collect
(
HashMap:
:
new
,
(
m
,
v
)
->
m
.
put
(
v
.
getId
(),
v
.
getDepartName
()),
HashMap:
:
putAll
);
return
R
.
ok
(
map
);
}
/**
* 获取所有单位名称
* @return R
* @Author huyc
* @Date 2022-06-22
*/
@Operation
(
summary
=
"获取所有单位名称"
,
description
=
"获取所有单位名称"
)
@SysLog
(
"获取所有单位名称"
)
@GetMapping
(
"/getAllUint"
)
public
R
<
Map
<
String
,
Object
>>
getAllUint
()
{
List
<
TCustomerInfo
>
list
=
tCustomerInfoService
.
list
(
Wrappers
.<
TCustomerInfo
>
query
().
lambda
().
eq
(
TCustomerInfo:
:
getDeleteFlag
,
CommonConstants
.
STATUS_NORMAL
));
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
=
list
.
stream
().
collect
(
HashMap:
:
new
,
(
m
,
v
)
->
m
.
put
(
v
.
getId
(),
v
.
getCustomerName
()),
HashMap:
:
putAll
);
return
R
.
ok
(
map
);
}
/**
* 员工档案划转
* @return R
* @Author huyc
* @Date 2022-06-22
*/
@Operation
(
summary
=
"员工档案划转"
,
description
=
"员工档案划转"
)
@SysLog
(
"员工档案划转"
)
@PostMapping
(
"/empProArcChange"
)
@PreAuthorize
(
"@pms.hasPermission('archives_tempchangeinfo_change')"
)
public
R
empProArcChange
(
@RequestBody
TEmpChangeInfo
tEmpChangeInfo
)
{
return
tEmpChangeInfoService
.
changeEmpProArc
(
tEmpChangeInfo
);
}
/**
* 批量划转员工档案
* @return R
* @Author huyc
* @Date 2022-06-22
*/
@Operation
(
summary
=
"批量划转员工档案"
,
description
=
"批量划转员工档案"
)
@SysLog
(
"批量划转员工档案"
)
@PostMapping
(
"/batchChangeArc"
)
@PreAuthorize
(
"@pms.hasPermission('archives_tempchangeinfo_batchchange')"
)
public
R
<
List
<
ErrorMessage
>>
batchChangeArc
(
@RequestExcel
List
<
TEmpChangeInfoVO
>
excelVOList
,
BindingResult
bindingResult
)
{
return
tEmpChangeInfoService
.
batchChangeArc
(
excelVOList
,
bindingResult
);
}
}
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/controller/TEmployeeProjectController.java
View file @
753db303
...
...
@@ -214,7 +214,7 @@ public class TEmployeeProjectController {
@Operation
(
summary
=
"通过id批量删除项目档案"
,
description
=
"通过id批量删除项目档案"
)
@SysLog
(
"通过id批量删除项目档案"
)
@PostMapping
(
"/{ids}"
)
//
@PreAuthorize("@pms.hasPermission('archives_temployeeproject_batchdel')" )
@PreAuthorize
(
"@pms.hasPermission('archives_temployeeproject_batchdel')"
)
public
R
<
List
<
ErrorMessage
>>
removeByIds
(
@RequestParam
String
ids
)
{
return
tEmployeeProjectService
.
batchRemoveByIds
(
ids
);
}
...
...
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/service/TEmpChangeInfoService.java
View file @
753db303
...
...
@@ -18,7 +18,13 @@
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
archives
.
service
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.pig4cloud.plugin.excel.vo.ErrorMessage
;
import
com.yifu.cloud.plus.v1.yifu.archives.entity.TEmpChangeInfo
;
import
com.yifu.cloud.plus.v1.yifu.archives.vo.TEmpChangeInfoVO
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.R
;
import
org.springframework.validation.BindingResult
;
import
java.util.List
;
/**
* 档案划转日志表
...
...
@@ -28,4 +34,18 @@ import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmpChangeInfo;
*/
public
interface
TEmpChangeInfoService
extends
IService
<
TEmpChangeInfo
>
{
/**
* @Author huyc
* @Description 档案划转
* @Date 2022/6/22
**/
R
changeEmpProArc
(
TEmpChangeInfo
tEmpChangeInfo
);
/**
* @Author huyc
* @Description 批量化转员工档案
* @Date 2022/6/22
**/
R
<
List
<
ErrorMessage
>>
batchChangeArc
(
List
<
TEmpChangeInfoVO
>
excelVOList
,
BindingResult
bindingResult
);
}
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/service/impl/TEmpChangeInfoServiceImpl.java
View file @
753db303
...
...
@@ -16,11 +16,25 @@
*/
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
archives
.
service
.
impl
;
import
cn.hutool.core.collection.CollUtil
;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.pig4cloud.plugin.excel.vo.ErrorMessage
;
import
com.yifu.cloud.plus.v1.yifu.archives.entity.TEmpChangeInfo
;
import
com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeProject
;
import
com.yifu.cloud.plus.v1.yifu.archives.mapper.TEmpChangeInfoMapper
;
import
com.yifu.cloud.plus.v1.yifu.archives.service.TEmpChangeInfoService
;
import
com.yifu.cloud.plus.v1.yifu.archives.service.TEmployeeProjectService
;
import
com.yifu.cloud.plus.v1.yifu.archives.vo.TEmpChangeInfoVO
;
import
com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants
;
import
com.yifu.cloud.plus.v1.yifu.common.core.exception.ErrorCodes
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.Common
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.MsgUtils
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.R
;
import
org.springframework.stereotype.Service
;
import
org.springframework.validation.BindingResult
;
import
java.util.*
;
/**
* 档案划转日志表
...
...
@@ -31,4 +45,69 @@ import org.springframework.stereotype.Service;
@Service
public
class
TEmpChangeInfoServiceImpl
extends
ServiceImpl
<
TEmpChangeInfoMapper
,
TEmpChangeInfo
>
implements
TEmpChangeInfoService
{
private
TEmployeeProjectService
tEmployeeProjectService
;
/**
* @Author huyc
* @Description 档案划转
* @Date 2022/6/22
**/
@Override
public
R
changeEmpProArc
(
TEmpChangeInfo
tEmpChangeInfo
)
{
//待划转员工已在目标结算主体下不可划转
TEmployeeProject
tEmployeeProject
=
tEmployeeProjectService
.
getOne
(
Wrappers
.<
TEmployeeProject
>
query
().
lambda
()
.
eq
(
TEmployeeProject:
:
getEmpIdcard
,
tEmpChangeInfo
.
getEmpIdcard
()).
eq
(
TEmployeeProject:
:
getDeptId
,
tEmpChangeInfo
.
getDepartId
())
.
eq
(
TEmployeeProject:
:
getDeleteFlag
,
CommonConstants
.
STATUS_NORMAL
));
if
(
Common
.
isNotNull
(
tEmployeeProject
))
{
return
R
.
failed
(
"待划转员工已在目标项目下不可划转"
);
}
//TODO
//划转+已产生未结算金额划转,并且选择了划转月份
//社保公积金派单处需要直接修改为最新的项目
//社保预估库、缴费库、对比库、代理差额库,需要同步修改未结算(并且满足这个条件:数据 生成月≥此处划转起始月)的数据,已结算数据不变更;
//保存档案划转记录
this
.
save
(
tEmpChangeInfo
);
return
R
.
ok
();
}
@Override
public
R
<
List
<
ErrorMessage
>>
batchChangeArc
(
List
<
TEmpChangeInfoVO
>
excelVOList
,
BindingResult
bindingResult
)
{
// 通用校验获取失败的数据
List
<
ErrorMessage
>
errorMessageList
=
(
List
<
ErrorMessage
>)
bindingResult
.
getTarget
();
Map
<
Long
,
ErrorMessage
>
errorMsgMap
=
new
HashMap
<>();
if
(
Common
.
isNotNull
(
errorMessageList
)){
errorMessageList
.
stream
().
forEach
(
errorMessage
->
errorMsgMap
.
put
(
errorMessage
.
getLineNum
(),
errorMessage
));
}
Set
<
String
>
errorMsg
;
// 执行数据插入操作 组装
for
(
int
i
=
0
;
i
<
excelVOList
.
size
();
i
++)
{
// 已有验证报错直接下一个
if
(
Common
.
isNotNull
(
errorMsgMap
.
get
(
i
+
2
))){
continue
;
}
errorMsg
=
new
HashSet
<>();
TEmpChangeInfoVO
excel
=
excelVOList
.
get
(
i
);
//待划转员工已在目标结算主体下不可划转
TEmployeeProject
tEmployeeProject
=
tEmployeeProjectService
.
getOne
(
Wrappers
.<
TEmployeeProject
>
query
().
lambda
()
.
eq
(
TEmployeeProject:
:
getEmpIdcard
,
excel
.
getEmpIdcard
()).
eq
(
TEmployeeProject:
:
getDeptNo
,
excel
.
getNewSettleCode
())
.
eq
(
TEmployeeProject:
:
getDeleteFlag
,
CommonConstants
.
STATUS_NORMAL
));
if
(
Common
.
isNotNull
(
tEmployeeProject
))
{
errorMsg
.
add
(
MsgUtils
.
getMessage
(
ErrorCodes
.
CHECKS_CHANGE_EMP_PROJECT
,
excel
.
getNewSettleCode
()));
}
// 数据合法情况
if
(
CollUtil
.
isEmpty
(
errorMsg
))
{
}
else
{
// 数据不合法
errorMessageList
.
add
(
new
ErrorMessage
((
long
)
(
i
+
2
),
errorMsg
));
}
}
if
(
CollUtil
.
isNotEmpty
(
errorMessageList
))
{
return
R
.
failed
(
errorMessageList
);
}
return
R
.
ok
();
}
}
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/service/impl/TEmployeeProjectServiceImpl.java
View file @
753db303
...
...
@@ -425,7 +425,7 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
delProject
.
setDeleteFlag
(
CommonConstants
.
ONE_STRING
);
baseMapper
.
updateById
(
delProject
);
}
else
{
errorMsg
.
add
(
MsgUtils
.
getMessage
(
ErrorCodes
.
ARCHIVES_EMP_FAMILY_NAME_EXISTING
));
errorMsg
.
add
(
MsgUtils
.
getMessage
(
ErrorCodes
.
CHECKS_PROJECT_DELETE_ERROR
));
errorList
.
add
(
new
ErrorMessage
((
long
)
i
,
errorMsg
));
}
}
catch
(
Exception
e
)
{
...
...
yifu-archives/yifu-archives-biz/src/main/resources/mapper/TEmpChangeInfoMapper.xml
View file @
753db303
...
...
@@ -26,6 +26,7 @@
<resultMap
id=
"tEmpChangeInfoMap"
type=
"com.yifu.cloud.plus.v1.yifu.archives.entity.TEmpChangeInfo"
>
<id
property=
"id"
column=
"ID"
/>
<result
property=
"empName"
column=
"EMP_NAME"
/>
<result
property=
"empIdcard"
column=
"EMP_IDCARD"
/>
<result
property=
"oldDept"
column=
"OLD_DEPT"
/>
<result
property=
"newDept"
column=
"NEW_DEPT"
/>
<result
property=
"oldSettle"
column=
"OLD_SETTLE"
/>
...
...
yifu-common/yifu-common-core/src/main/java/com/yifu.cloud.plus.v1/yifu/common/core/exception/ErrorCodes.java
View file @
753db303
...
...
@@ -230,4 +230,8 @@ public interface ErrorCodes {
* 已存在对应身份证的证书信息
*/
String
ARCHIVES_EMP_CERTIFICATE_NAME_EXISTING
=
"archives.emp.certificate.name.existing"
;
/**
* 待划转员工已在目标项目下不可划转
*/
String
CHECKS_CHANGE_EMP_PROJECT
=
"checks.change.emp.project"
;
}
yifu-common/yifu-common-core/src/main/resources/i18n/messages_zh_CN.properties
View file @
753db303
...
...
@@ -61,7 +61,9 @@ checks.reduce.project.error=\u5B58\u5728\u5DF2\u51CF\u9879\u7684\u9879\u76EE\uFF
checks.emp.exit.error
=
\u
4EBA
\u5458\u
4E0D
\u5728\u
8BE5
\u9879\u
76EE
\u
FF0C
\u
65E0
\u
6CD5
\u
66F4
\u
65B0
checks.project.delete.error
=
\u9879\u
76EE
\u6863\u6848\u
72B6
\u6001\u
4E3A
\u
5DF2
\u
5BA1
\u6838\u
FF0C
\u7981\u
6B62
\u5220\u9664
archives.emp.certificate.name.existing
=
ARCHIVES_EMP_CERTIFICATE_NAME_EXISTING
archives.emp.certificate.name.existing
=
\u
5DF2
\u
5B58
\u5728\u
5BF9
\u
5E94
\u
8EAB
\u
4EFD
\u
8BC1
\u7684\u
8BC1
\u
4E66
\u
4FE1
\u
606F
checks.change.emp.project
=
\u
5F85
\u5212\u
8F6C
\u5458\u
5DE5
\u
5DF2
\u5728\u
76EE
\u6807\u9879\u
76EE
\u
4E0B
\u
4E0D
\u
53EF
\u5212\u
8F6C
...
...
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