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
6965cfaa
Commit
6965cfaa
authored
Jun 20, 2022
by
fangxinjiang
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/develop' into develop
parents
e71b5dd4
30157b35
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
182 additions
and
4 deletions
+182
-4
TEmployeeProjectController.java
.../yifu/archives/controller/TEmployeeProjectController.java
+27
-0
TEmployeeProjectService.java
...lus/v1/yifu/archives/service/TEmployeeProjectService.java
+4
-0
TEmployeeProjectServiceImpl.java
...fu/archives/service/impl/TEmployeeProjectServiceImpl.java
+141
-1
YifuUser.java
.../com/yifu/cloud/plus/v1/yifu/common/core/vo/YifuUser.java
+8
-1
YifuUserDetailsService.java
.../yifu/common/security/service/YifuUserDetailsService.java
+2
-2
No files found.
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/controller/TEmployeeProjectController.java
View file @
6965cfaa
...
...
@@ -17,6 +17,7 @@
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
archives
.
controller
;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeProject
;
...
...
@@ -121,4 +122,30 @@ public class TEmployeeProjectController {
public
R
addCheck
(
@RequestBody
TEmployeeProject
tEmployeeProject
)
{
return
R
.
ok
(
tEmployeeProjectService
.
addCheck
(
tEmployeeProject
));
}
/**
* 复档复项相关操作
* @param jsonObject
* @return R
*/
@Operation
(
summary
=
"复档复项相关操作"
,
description
=
"复档复项相关操作"
)
@SysLog
(
"复档复项相关操作"
)
@PostMapping
(
"/reEmpInfo"
)
@PreAuthorize
(
"@pms.hasPermission('archives_temployeeproject_reempinfo')"
)
public
R
reEmpInfo
(
@RequestBody
JSONObject
jsonObject
)
{
return
R
.
ok
(
tEmployeeProjectService
.
reEmpInfo
(
jsonObject
));
}
/**
* 减项
* @param tEmployeeProject
* @return R
*/
@Operation
(
summary
=
"减项"
,
description
=
"减项"
)
@SysLog
(
"减项"
)
@PostMapping
(
"/deleteEmpPro"
)
@PreAuthorize
(
"@pms.hasPermission('archives_temployeeproject_delempproinfo')"
)
public
R
deleteEmpPro
(
@RequestBody
TEmployeeProject
tEmployeeProject
)
{
return
R
.
ok
(
tEmployeeProjectService
.
deleteEmpPro
(
tEmployeeProject
));
}
}
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/service/TEmployeeProjectService.java
View file @
6965cfaa
...
...
@@ -17,6 +17,7 @@
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
archives
.
service
;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeProject
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.R
;
...
...
@@ -31,4 +32,7 @@ public interface TEmployeeProjectService extends IService<TEmployeeProject> {
R
addCheck
(
TEmployeeProject
tEmployeeProject
);
R
reEmpInfo
(
JSONObject
jsonObject
);
R
deleteEmpPro
(
TEmployeeProject
tEmployeeProject
);
}
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/service/impl/TEmployeeProjectServiceImpl.java
View file @
6965cfaa
...
...
@@ -16,13 +16,25 @@
*/
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
archives
.
service
.
impl
;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysDict
;
import
com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeInfo
;
import
com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeLog
;
import
com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeProject
;
import
com.yifu.cloud.plus.v1.yifu.archives.mapper.TEmployeeProjectMapper
;
import
com.yifu.cloud.plus.v1.yifu.archives.service.TEmployeeInfoService
;
import
com.yifu.cloud.plus.v1.yifu.archives.service.TEmployeeLogService
;
import
com.yifu.cloud.plus.v1.yifu.archives.service.TEmployeeProjectService
;
import
com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.Common
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.R
;
import
org.springframework.stereotype.Service
;
import
java.util.HashMap
;
import
java.util.Map
;
/**
* 项目档案表
*
...
...
@@ -32,8 +44,136 @@ import org.springframework.stereotype.Service;
@Service
public
class
TEmployeeProjectServiceImpl
extends
ServiceImpl
<
TEmployeeProjectMapper
,
TEmployeeProject
>
implements
TEmployeeProjectService
{
private
TEmployeeInfoService
tEmployeeInfoService
;
private
TEmployeeLogService
tEmployeeLogService
;
private
final
String
content1
=
"减档"
;
private
final
String
content2
=
"减项"
;
private
final
String
content3
=
"减档减项"
;
@Override
public
R
addCheck
(
TEmployeeProject
tEmployeeProject
)
{
return
null
;
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
//身份证系统中是否已有
TEmployeeInfo
tEmployeeInfo
=
tEmployeeInfoService
.
getOne
(
Wrappers
.<
TEmployeeInfo
>
query
().
lambda
()
.
eq
(
TEmployeeInfo:
:
getEmpIdcard
,
tEmployeeProject
.
getEmpIdcard
())
.
eq
(
TEmployeeInfo:
:
getDeleteFlag
,
CommonConstants
.
STATUS_NORMAL
));
//项目下已有身份证信息
TEmployeeProject
employeeProject
=
this
.
getOne
(
Wrappers
.<
TEmployeeProject
>
query
().
lambda
()
.
eq
(
TEmployeeProject:
:
getEmpIdcard
,
tEmployeeProject
.
getEmpIdcard
())
.
eq
(
TEmployeeProject:
:
getDeptNo
,
tEmployeeProject
.
getDeptNo
())
.
eq
(
TEmployeeProject:
:
getDeleteFlag
,
CommonConstants
.
STATUS_NORMAL
));
if
(!
Common
.
isEmpty
(
employeeProject
))
{
//身份证实名认证
if
(!
tEmployeeProject
.
getEmpName
().
equals
(
tEmployeeInfo
.
getEmpName
()))
{
return
R
.
failed
(
"姓名和身份证不一致,请确认后再次新增"
);
}
//项目状态为已减项
if
(
CommonConstants
.
dingleDigitIntArray
[
1
]
==
employeeProject
.
getProjectStatus
())
{
if
(!
Common
.
isEmpty
(
tEmployeeInfo
))
{
map
.
put
(
"empProId"
,
tEmployeeProject
.
getId
());
if
(
CommonConstants
.
STATUS_NORMAL
.
equals
(
tEmployeeInfo
.
getFileStatus
()))
{
return
R
.
ok
(
map
,
"该人员已减项,是否“复项”"
);
}
else
{
map
.
put
(
"employeeId"
,
tEmployeeInfo
.
getId
());
return
R
.
ok
(
map
,
"该人员已减档减项,是否“复档复项”"
);
}
}
}
//状态为草稿、已审核
if
(
CommonConstants
.
dingleDigitIntArray
[
0
]
==
employeeProject
.
getStatus
()
||
CommonConstants
.
dingleDigitIntArray
[
1
]
==
employeeProject
.
getStatus
())
{
return
R
.
failed
(
"人员已有该项目信息,禁止重复添加!"
);
}
}
else
{
if
(
Common
.
isEmpty
(
tEmployeeInfo
))
{
return
R
.
failed
(
"该人员暂无档案信息,禁止关联项目,如要添加,请先至“在档人员”处建档"
);
}
//判断是否已经减档
if
(
CommonConstants
.
ONE_STRING
.
equals
(
tEmployeeInfo
.
getFileStatus
()))
{
map
.
put
(
"employeeId"
,
tEmployeeInfo
.
getId
());
return
R
.
ok
(
null
,
"该人员在离职库已存在,是否“恢复档案”"
);
}
}
return
R
.
ok
();
}
@Override
public
R
reEmpInfo
(
JSONObject
jsonObject
)
{
if
(
Common
.
isNotNull
(
jsonObject
))
{
String
empId
=
jsonObject
.
getString
(
"empId"
);
String
empProId
=
jsonObject
.
getString
(
"empProId"
);
if
(!
Common
.
isEmpty
(
empId
)
&&
Common
.
isEmpty
(
empProId
))
{
//复档
TEmployeeInfo
tEmployeeInfo
=
tEmployeeInfoService
.
getById
(
empId
);
tEmployeeInfo
.
setFileStatus
(
CommonConstants
.
dingleDigitIntArray
[
0
]);
tEmployeeInfoService
.
updateById
(
tEmployeeInfo
);
addEmpLog
(
CommonConstants
.
dingleDigitIntArray
[
0
],
empId
,
""
,
content1
);
}
else
if
(
Common
.
isEmpty
(
empId
)
&&
!
Common
.
isEmpty
(
empProId
))
{
//复项
TEmployeeProject
tEmployeeProject
=
this
.
getById
(
empProId
);
tEmployeeProject
.
setProjectStatus
(
CommonConstants
.
dingleDigitIntArray
[
0
]);
this
.
updateById
(
tEmployeeProject
);
addEmpLog
(
CommonConstants
.
dingleDigitIntArray
[
1
],
""
,
empProId
,
content2
);
}
else
{
//复档复项
TEmployeeInfo
tEmployeeInfo
=
tEmployeeInfoService
.
getById
(
empId
);
TEmployeeProject
tEmployeeProject
=
this
.
getById
(
empProId
);
tEmployeeInfo
.
setFileStatus
(
CommonConstants
.
dingleDigitIntArray
[
0
]);
tEmployeeInfoService
.
updateById
(
tEmployeeInfo
);
tEmployeeProject
.
setProjectStatus
(
CommonConstants
.
dingleDigitIntArray
[
0
]);
this
.
updateById
(
tEmployeeProject
);
addEmpLog
(
CommonConstants
.
dingleDigitIntArray
[
2
],
empId
,
empProId
,
content3
);
}
}
else
{
return
R
.
failed
(
"传参为空!"
);
}
return
R
.
ok
();
}
@Override
public
R
deleteEmpPro
(
TEmployeeProject
tEmployeeProject
)
{
if
(
Common
.
isNotNull
(
tEmployeeProject
))
{
if
(
tEmployeeProject
.
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
)
{
return
R
.
failed
(
"该人员存在其他进行中的项目,禁止同步减档!"
);
}
TEmployeeInfo
tEmployeeInfo
=
tEmployeeInfoService
.
getById
(
tEmployeeProject
.
getEmpId
());
tEmployeeInfo
.
setFileStatus
(
CommonConstants
.
dingleDigitIntArray
[
1
]);
tEmployeeInfoService
.
updateById
(
tEmployeeInfo
);
}
tEmployeeProject
.
setProjectStatus
(
CommonConstants
.
dingleDigitIntArray
[
1
]);
this
.
updateById
(
tEmployeeProject
);
return
R
.
ok
();
}
return
R
.
failed
(
"传参为空!"
);
}
/**
* 新增档案操作记录
* @param type
* @param empId
* @param empProId
* @param content
* @author huyc
* @date 2022-06-20 17:19:40
*/
public
void
addEmpLog
(
int
type
,
String
empId
,
String
empProId
,
String
content
)
{
TEmployeeLog
tEmployeeLog
=
new
TEmployeeLog
();
tEmployeeLog
.
setEmpId
(
empId
);
tEmployeeLog
.
setType
(
type
);
tEmployeeLog
.
setProjectId
(
empProId
);
tEmployeeLog
.
setContent
(
content
);
tEmployeeLogService
.
save
(
tEmployeeLog
);
}
}
yifu-common/yifu-common-core/src/main/java/com/yifu/cloud/plus/v1/yifu/common/core/vo/YifuUser.java
View file @
6965cfaa
...
...
@@ -58,8 +58,14 @@ public class YifuUser extends User {
@Getter
private
String
systemFlag
;
/**
* 用户组
*/
@Getter
private
final
String
userGroup
;
public
YifuUser
(
String
id
,
Long
deptId
,
String
username
,
String
nickname
,
String
systemFlag
,
String
password
,
String
phone
,
boolean
enabled
,
boolean
accountNonExpired
,
boolean
credentialsNonExpired
,
boolean
accountNonLocked
,
boolean
accountNonExpired
,
boolean
credentialsNonExpired
,
boolean
accountNonLocked
,
String
userGroup
,
Collection
<?
extends
GrantedAuthority
>
authorities
)
{
super
(
username
,
password
,
enabled
,
accountNonExpired
,
credentialsNonExpired
,
accountNonLocked
,
authorities
);
this
.
id
=
id
;
...
...
@@ -67,6 +73,7 @@ public class YifuUser extends User {
this
.
phone
=
phone
;
this
.
nickname
=
nickname
;
this
.
systemFlag
=
systemFlag
;
this
.
userGroup
=
userGroup
;
}
}
yifu-common/yifu-common-security/src/main/java/com/yifu.cloud.plus.v1/yifu/common/security/service/YifuUserDetailsService.java
View file @
6965cfaa
...
...
@@ -70,8 +70,8 @@ public interface YifuUserDetailsService extends UserDetailsService, Ordered {
// 构造security用户
return
new
YifuUser
(
user
.
getUserId
(),
user
.
getDeptId
(),
user
.
getUsername
(),
user
.
getNickname
(),
user
.
getSystemFlag
(),
SecurityConstants
.
BCRYPT
+
user
.
getPassword
(),
user
.
getPhone
(),
true
,
true
,
true
,
StrUtil
.
equals
(
user
.
getLockFlag
(),
CommonConstants
.
STATUS_NORMAL
),
authorities
);
SecurityConstants
.
BCRYPT
+
user
.
getPassword
(),
user
.
getPhone
(),
true
,
true
,
true
,
StrUtil
.
equals
(
user
.
getLockFlag
(),
CommonConstants
.
STATUS_NORMAL
),
user
.
getUserGroup
(),
authorities
);
}
/**
...
...
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