Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
8
8timerapiv200
Overview
Overview
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
8timerv2
8timerapiv200
Commits
a70ae404
Commit
a70ae404
authored
4 years ago
by
tangzhaoqian
Committed by
chenzg
3 years ago
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
审批人审批优化,员工管理、组织管理Bug修复
parent
c6c493f2
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
244 additions
and
104 deletions
+244
-104
src/main/java/cn/timer/api/aspect/LogAspect.java
+1
-1
src/main/java/cn/timer/api/config/enuminterface/SpmkEnumInterface.java
+25
-0
src/main/java/cn/timer/api/config/enuminterface/YgEnumInterface.java
+18
-7
src/main/java/cn/timer/api/controller/qyzx/QyzxController.java
+19
-5
src/main/java/cn/timer/api/controller/spmk/SpmkController.java
+17
-1
src/main/java/cn/timer/api/controller/yggl/YgglController.java
+125
-73
src/main/java/cn/timer/api/controller/zzgl/ZzglController.java
+17
-11
src/main/java/cn/timer/api/dto/yggl/AddygdaDto.java
+14
-0
src/main/resources/application-dev.yml
+1
-1
src/main/resources/application-pro.yml
+3
-2
src/main/resources/application-test.yml
+3
-2
src/main/resources/mapping/qyzx/QyzxOperLogMapper.xml
+1
-1
No files found.
src/main/java/cn/timer/api/aspect/LogAspect.java
View file @
a70ae404
...
...
@@ -94,7 +94,7 @@ public class LogAspect
// 获取当前的用户
// LoginUser loginUser = SpringUtils.getBean(TokenService.class).getLoginUser(ServletUtils.getRequest());
QyzxEmpLogin
eld
=
(
QyzxEmpLogin
)
session
.
getAttribute
(
"ui"
);
System
.
out
.
println
(
eld
);
// *========数据库日志=========*//
QyzxOperLog
operLog
=
new
QyzxOperLog
();
...
...
This diff is collapsed.
Click to expand it.
src/main/java/cn/timer/api/config/enuminterface/SpmkEnumInterface.java
0 → 100644
View file @
a70ae404
package
cn
.
timer
.
api
.
config
.
enuminterface
;
import
lombok.Getter
;
public
interface
SpmkEnumInterface
{
/**
* 员工类型
*/
@Getter
enum
ExecutorSts
implements
SpmkEnumInterface
{
NON_EXECUTION
(
0
,
"未执行"
),
IN_EXECUTION
(
1
,
"执行中"
),
AGREE
(
2
,
"同意"
),
REFUSE
(
3
,
"拒绝"
),
REDEPLOY
(
4
,
"转派"
);
private
Integer
type
;
private
String
name
;
ExecutorSts
(
Integer
type
,
String
name
)
{
this
.
type
=
type
;
this
.
name
=
name
;
}
}
}
This diff is collapsed.
Click to expand it.
src/main/java/cn/timer/api/config/enuminterface/YgEnumInterface.java
View file @
a70ae404
/**
* @date 2020年3月23日
* @author 翁东州
* @方法中文名称:
*/
package
cn
.
timer
.
api
.
config
.
enuminterface
;
import
java.text.DateFormat
;
import
java.text.ParseException
;
import
java.text.SimpleDateFormat
;
import
java.util.Date
;
import
java.util.HashMap
;
...
...
@@ -46,6 +39,24 @@ public interface YgEnumInterface {
return
mow
.
type
.
toString
();
}
}
/**
* 部门 岗位
*/
@Getter
enum
OrgType
implements
YgEnumInterface
{
DEPARTMENT
(
0
,
"部门"
),
POST
(
1
,
"岗位"
);
private
Integer
type
;
private
String
name
;
OrgType
(
Integer
type
,
String
name
)
{
this
.
type
=
type
;
this
.
name
=
name
;
}
}
/**
* 员工类型
...
...
This diff is collapsed.
Click to expand it.
src/main/java/cn/timer/api/controller/qyzx/QyzxController.java
View file @
a70ae404
...
...
@@ -9,6 +9,7 @@ import javax.servlet.http.HttpSession;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.DeleteMapping
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.PostMapping
;
...
...
@@ -326,11 +327,8 @@ public class QyzxController {
wp
.
select
(
ZzglAuth:
:
getMenuId
).
eq
(
ZzglAuth:
:
getOrgCode
,
ctrl
.
getId
())
.
and
(
i
->
i
.
in
(
ZzglAuth:
:
getBmgwId
,
list
.
toArray
()));
List
<
ZzglAuth
>
zas
=
ZzglAuth
.
builder
().
build
().
selectList
(
wp
);
if
(
zas
.
size
()
==
0
)
return
ResultUtil
.
error
(
null
,
"切换企业失败,在该公司没有权限"
);
zas
.
stream
().
forEach
(
o
->
menus
.
add
(
o
.
getMenuId
()));
}
else
{
return
ResultUtil
.
error
(
null
,
"切换企业失败,在该公司没有权限"
);
if
(
zas
!=
null
&&
zas
.
size
()
!=
0
)
zas
.
stream
().
forEach
(
o
->
menus
.
add
(
o
.
getMenuId
()));
}
}
emp
.
setOrgId
(
orgCode
);
...
...
@@ -538,5 +536,21 @@ public class QyzxController {
return
ResultUtil
.
data
(
pages
,
listOl
,
"操作成功!"
);
}
/**
* 删除-操作日志
*
* @param
* @return
*/
@DeleteMapping
(
value
=
"/delete_oper_log"
)
@ApiOperation
(
value
=
"删除-操作日志"
,
httpMethod
=
"DELETE"
,
notes
=
"查询-操作日志"
)
public
Result
<
Object
>
deleteOperLog
(
@CurrentUser
UserBean
userBean
,
@RequestBody
Integer
[]
ids
)
{
ArrayList
<
Integer
>
list
=
CollUtil
.
toList
(
ids
);
int
delCount
=
qyzxOperLogMapper
.
deleteBatchIds
(
list
);
return
ResultUtil
.
data
(
delCount
,
"操作成功!"
);
}
}
This diff is collapsed.
Click to expand it.
src/main/java/cn/timer/api/controller/spmk/SpmkController.java
View file @
a70ae404
...
...
@@ -18,6 +18,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RestController
;
import
com.alibaba.druid.sql.visitor.functions.Nil
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
...
...
@@ -45,6 +46,7 @@ import cn.timer.api.bean.spmk.SpmkInitiatorConfig;
import
cn.timer.api.bean.yggl.YgglMainEmp
;
import
cn.timer.api.config.annotation.CurrentUser
;
import
cn.timer.api.config.annotation.UserBean
;
import
cn.timer.api.config.enuminterface.SpmkEnumInterface
;
import
cn.timer.api.config.exception.CustomException
;
import
cn.timer.api.controller.spmk.service.SpmkServiceImpl
;
import
cn.timer.api.controller.zzgl.service.ZzglBmgwMService
;
...
...
@@ -119,6 +121,7 @@ public class SpmkController {
public
Result
<
Object
>
saveAtg
(
@RequestBody
SpmkApprovalTemplateG
spmkApprovalTemplateG
){
if
(
spmkApprovalTemplateG
.
selectCount
(
new
QueryWrapper
<
SpmkApprovalTemplateG
>().
lambda
()
.
ne
(
SpmkApprovalTemplateG:
:
getId
,
spmkApprovalTemplateG
.
getId
())
.
eq
(
SpmkApprovalTemplateG:
:
getName
,
spmkApprovalTemplateG
.
getName
()))
>
0
)
{
return
ResultUtil
.
error
(
"审批模板组名重复!"
);
}
...
...
@@ -189,6 +192,7 @@ public class SpmkController {
at
.
setRouter
(
ObjectUtil
.
serialize
(
spmkApprovalTemplateDto
.
getRouter
()));
if
(
at
.
selectCount
(
new
QueryWrapper
<
SpmkApprovalTemplate
>().
lambda
()
.
ne
(
SpmkApprovalTemplate:
:
getId
,
at
.
getId
())
.
eq
(
SpmkApprovalTemplate:
:
getName
,
at
.
getName
()))
>
0
)
{
return
ResultUtil
.
error
(
"审批模板名重复!"
);
}
...
...
@@ -256,6 +260,7 @@ public class SpmkController {
public
Result
<
Object
>
saveAg
(
@CurrentUser
UserBean
userBean
,
@RequestBody
SpmkApprovalG
spmkApprovalG
){
if
(
spmkApprovalG
.
selectCount
(
new
QueryWrapper
<
SpmkApprovalG
>().
lambda
()
.
ne
(
SpmkApprovalG:
:
getId
,
spmkApprovalG
.
getId
())
.
eq
(
SpmkApprovalG:
:
getName
,
spmkApprovalG
.
getName
())
.
eq
(
SpmkApprovalG:
:
getOrgCode
,
userBean
.
getOrgCode
()))
>
0
)
{
return
ResultUtil
.
error
(
"审批组名重复!"
);
...
...
@@ -338,6 +343,7 @@ public class SpmkController {
BeanUtil
.
copyProperties
(
spmkCustomApprovalDto
,
ca
,
"froms"
,
"router"
,
"initiatorConfigs"
);
if
(
ca
.
selectCount
(
new
QueryWrapper
<
SpmkCustomApproval
>().
lambda
()
.
ne
(
SpmkCustomApproval:
:
getId
,
ca
.
getId
())
.
eq
(
SpmkCustomApproval:
:
getName
,
ca
.
getName
())
.
eq
(
SpmkCustomApproval:
:
getOrgCode
,
userBean
.
getOrgCode
()))
>
0
)
{
return
ResultUtil
.
error
(
"自定义审批名重复!"
);
...
...
@@ -575,7 +581,15 @@ public class SpmkController {
@ApiOperationSupport
(
order
=
20
)
@Log
(
title
=
"审批-审批流程"
,
businessType
=
BusinessType
.
UPDATE
)
// @BindingResultCtrol(title = "审批人审批")
public
Result
<
Object
>
approving
(
@Validated
@RequestBody
ApprovingDto
approvingDto
)
throws
Exception
{
public
Result
<
Object
>
approving
(
@CurrentUser
UserBean
userBean
,
@Validated
@RequestBody
ApprovingDto
approvingDto
)
throws
Exception
{
if
(
spmkExecutorMapper
.
selectCount
(
new
QueryWrapper
<
SpmkExecutor
>().
lambda
()
.
eq
(
SpmkExecutor:
:
getId
,
approvingDto
.
getExecutorId
())
.
eq
(
SpmkExecutor:
:
getEmpNum
,
userBean
.
getEmpNum
())
.
eq
(
SpmkExecutor:
:
getSts
,
SpmkEnumInterface
.
ExecutorSts
.
NON_EXECUTION
))
==
0
)
{
return
ResultUtil
.
error
(
"非当前审批人,无法审批!"
);
}
SpmkApproveDetail
ad
=
SpmkApproveDetail
.
builder
().
build
().
selectOne
(
new
QueryWrapper
<
SpmkApproveDetail
>()
.
lambda
()
.
select
(
SpmkApproveDetail:
:
getId
,
...
...
@@ -588,6 +602,8 @@ public class SpmkController {
.
select
(
SpmkApproveSummary:
:
getSts
)
.
eq
(
SpmkApproveSummary:
:
getId
,
approvingDto
.
getAsId
()));
if
(
aSummary
.
getSts
()
==
1
||
aSummary
.
getSts
()
==
2
||
aSummary
.
getSts
()
==
3
)
{
return
ResultUtil
.
error
(
"该审批已结束!"
);
}
...
...
This diff is collapsed.
Click to expand it.
src/main/java/cn/timer/api/controller/yggl/YgglController.java
View file @
a70ae404
...
...
@@ -11,12 +11,10 @@ import java.util.ArrayList;
import
java.util.Collections
;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.HashSet
;
import
java.util.Iterator
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map.Entry
;
import
java.util.Set
;
import
java.util.regex.Matcher
;
import
java.util.regex.Pattern
;
import
java.util.stream.Collectors
;
...
...
@@ -24,7 +22,9 @@ import java.util.stream.Collectors;
import
javax.transaction.Transactional
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.transaction.interceptor.TransactionAspectSupport
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.web.bind.annotation.DeleteMapping
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.PathVariable
;
...
...
@@ -33,6 +33,7 @@ import org.springframework.web.bind.annotation.RequestBody;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
...
...
@@ -45,11 +46,14 @@ import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import
cn.hutool.core.bean.BeanUtil
;
import
cn.hutool.core.bean.copier.CopyOptions
;
import
cn.hutool.core.collection.CollUtil
;
import
cn.hutool.core.collection.ListUtil
;
import
cn.hutool.core.date.BetweenFormater.Level
;
import
cn.hutool.core.date.DateUtil
;
import
cn.hutool.core.lang.tree.Tree
;
import
cn.hutool.core.lang.tree.TreeNodeConfig
;
import
cn.hutool.core.lang.tree.TreeUtil
;
import
cn.hutool.core.util.StrUtil
;
import
cn.timer.api.bean.clazz.CommonArea
;
import
cn.timer.api.bean.clazz.SysRegion
;
import
cn.timer.api.bean.qyzx.QyzxEmpEntAsso
;
import
cn.timer.api.bean.qyzx.QyzxEmpLogin
;
import
cn.timer.api.bean.yggl.YgglAttaClfjb
;
...
...
@@ -71,7 +75,6 @@ import cn.timer.api.config.annotation.CurrentUser;
import
cn.timer.api.config.annotation.UserBean
;
import
cn.timer.api.config.enuminterface.YgEnumInterface
;
import
cn.timer.api.config.enums.CommonEnum
;
import
cn.timer.api.controller.yggl.service.YgglService
;
import
cn.timer.api.dao.clazz.CommonAreaMapper
;
import
cn.timer.api.dao.qyzx.QyzxEmpLoginMapper
;
import
cn.timer.api.dao.yggl.YgAreaDtoMapper
;
...
...
@@ -112,10 +115,13 @@ import io.swagger.annotations.ApiOperation;
*/
@Api
(
tags
=
"3.员工管理"
)
@RestController
@Transactional
@Transactional
(
rollbackOn
=
Exception
.
class
)
@RequestMapping
(
value
=
"/yggl"
,
produces
=
{
"application/json"
})
public
class
YgglController
{
@Value
(
value
=
"${config-8timer.init-password}"
)
private
String
pwd
;
@Autowired
private
YgglMainEmpMapper
ygglMainEmpMapper
;
...
...
@@ -154,14 +160,12 @@ public class YgglController {
Integer
orgCode
=
userBean
.
getOrgCode
();
LoginInfoDto
loginInfo
=
LoginInfoDto
.
builder
().
build
();
YgglMainEmp
ygglMainEmp
=
new
LambdaQueryChainWrapper
<
YgglMainEmp
>(
ygglMainEmpMapper
)
.
select
(
YgglMainEmp:
:
getBmgwId
,
YgglMainEmp:
:
getName
,
YgglMainEmp:
:
getRzTime
,
YgglMainEmp:
:
getZzTime
,
.
select
(
YgglMainEmp:
:
getBmgwId
,
YgglMainEmp:
:
getName
,
YgglMainEmp:
:
getRzTime
,
YgglMainEmp:
:
getZzTime
,
YgglMainEmp:
:
getEmpNum
)
.
eq
(
YgglMainEmp:
:
getEmpNum
,
empNum
).
eq
(
YgglMainEmp:
:
getOrgCode
,
orgCode
).
one
();
if
(
ygglMainEmp
!=
null
)
{
Integer
gw
=
ygglMainEmp
.
getBmgwId
();
ZzglBmgwM
gwObj
=
new
LambdaQueryChainWrapper
<
ZzglBmgwM
>(
zzglBmgwMMapper
).
select
(
ZzglBmgwM:
:
getUpId
,
ZzglBmgwM:
:
getName
)
.
eq
(
ZzglBmgwM:
:
getId
,
gw
).
eq
(
ZzglBmgwM:
:
getOrgCode
,
orgCode
).
one
();
...
...
@@ -171,7 +175,7 @@ public class YgglController {
loginInfo
.
setBmId
(
bmObj
!=
null
?
bmObj
.
getId
()
:
null
);
loginInfo
.
setBmName
(
bmObj
!=
null
?
bmObj
.
getName
()
:
null
);
}
loginInfo
.
setEmpNum
(
ygglMainEmp
.
getEmpNum
());
loginInfo
.
setName
(
ygglMainEmp
.
getName
());
loginInfo
.
setGwId
(
gw
);
...
...
@@ -246,7 +250,6 @@ public class YgglController {
return
one
;
}
/**
* 获取用户头像
*
...
...
@@ -333,8 +336,6 @@ public class YgglController {
gw
=
zzglBmgwM
.
getName
();
bmid
=
zzglBmgwM
.
getUpId
();
}
// QueryWrapper<ZzglBmgwM> queryWrapper1 = new QueryWrapper<>();
// queryWrapper1.eq("org_code", orgCode).eq("up_dept_id", gwid);
ZzglBmgwM
z
=
ZzglBmgwM
.
builder
().
build
()
.
selectOne
(
new
QueryWrapper
<
ZzglBmgwM
>().
eq
(
"org_code"
,
orgCode
).
eq
(
"id"
,
bmid
));
String
bm
=
null
;
...
...
@@ -346,22 +347,21 @@ public class YgglController {
}
/**
* 添加员工档案
(weng)
*
* @param
* 添加员工档案
*
@param userBean
* @param
addygdaDto
* @return
*/
@PostMapping
(
value
=
"/addygda"
)
@ApiOperation
(
value
=
"添加员工档案"
,
httpMethod
=
"POST"
,
notes
=
"接口发布说明"
)
@ApiOperationSupport
(
order
=
4
)
public
Result
<
Object
>
addygda
(
@CurrentUser
UserBean
userBean
,
@RequestBody
AddygdaDto
addygdaDto
)
{
public
Result
<
Object
>
addygda
(
@CurrentUser
UserBean
userBean
,
@Validated
@RequestBody
AddygdaDto
addygdaDto
)
throws
Exception
{
Integer
orgCode
=
userBean
.
getOrgCode
();
String
name
=
addygdaDto
.
getName
();
String
phone
=
addygdaDto
.
getPhone
();
Integer
zjType
=
addygdaDto
.
getZjType
();
String
zjNum
=
addygdaDto
.
getZjNum
();
Integer
jobType
=
addygdaDto
.
getJobType
();
// Date rzTime = addygdaDto.getRzTime();// ?????????????为什么新添加员工不给默认入职日期?????????????????????????
Date
rzTime
=
new
Date
();
Integer
syq
=
addygdaDto
.
getSyq
();
Integer
sex
=
addygdaDto
.
getSex
();
...
...
@@ -371,7 +371,8 @@ public class YgglController {
QyzxEmpLogin
login
=
new
LambdaQueryChainWrapper
<
QyzxEmpLogin
>(
qyzxEmpLoginMapper
)
.
eq
(!
StrUtil
.
hasBlank
(
phone
),
QyzxEmpLogin:
:
getPhone
,
phone
).
one
();
if
(
login
==
null
)
{
QyzxEmpLogin
qyzxEmpLogin
=
QyzxEmpLogin
.
builder
().
phone
(
phone
).
pw
(
Md5
.
md5
(
"123456"
))
// 初始化密码 pwd
QyzxEmpLogin
qyzxEmpLogin
=
QyzxEmpLogin
.
builder
().
phone
(
phone
).
pw
(
Md5
.
md5
(
pwd
))
.
sts
(
CommonEnum
.
U_STS_ON
.
getType
()).
orgId
(
userBean
.
getOrgCode
()).
username
(
name
).
build
();
if
(!
qyzxEmpLogin
.
insert
())
{
TransactionAspectSupport
.
currentTransactionStatus
().
setRollbackOnly
();
...
...
@@ -380,38 +381,72 @@ public class YgglController {
// 添加三张表
// 员工权限表(未定)
// 员工企业关联表和员工档案,员工成长表(未定)
QyzxEmpEntAsso
.
builder
().
empNum
(
qyzxEmpLogin
.
getId
()).
orgCode
(
orgCode
)
.
userType
(
CommonEnum
.
U_TYPE_EMP
.
getType
()).
status
(
1
).
build
().
insert
();
// usertype2普通员工 status1正常
YgglMainEmp
ygglMainEmp
=
YgglMainEmp
.
builder
().
name
(
name
).
phone
(
phone
).
zjType
(
zjType
).
zjNum
(
zjNum
)
.
jobType
(
jobType
).
rzTime
(
rzTime
).
syq
(
syq
).
sex
(
sex
).
empNum
(
qyzxEmpLogin
.
getId
()).
orgCode
(
orgCode
)
QyzxEmpEntAsso
.
builder
()
.
empNum
(
qyzxEmpLogin
.
getId
())
.
orgCode
(
orgCode
)
.
userType
(
CommonEnum
.
U_TYPE_EMP
.
getType
())
.
status
(
1
)
.
build
()
.
insert
();
// usertype2普通员工 status1正常
YgglMainEmp
ygglMainEmp
=
YgglMainEmp
.
builder
()
.
name
(
name
)
.
phone
(
phone
)
.
zjType
(
zjType
)
.
zjNum
(
zjNum
)
.
jobType
(
jobType
)
.
jobStatus
(
YgEnumInterface
.
jobStatus
.
SHIYONG
.
getType
())
.
rzTime
(
rzTime
)
.
syq
(
syq
)
.
sex
(
sex
)
.
empNum
(
qyzxEmpLogin
.
getId
())
.
orgCode
(
orgCode
)
.
build
();
ygglMainEmp
.
insert
();
if
(
addygdaDto
.
getBmgwId
()
!=
null
)
{
if
(
addygdaDto
.
getBmgwId
()
!=
null
)
{
new
LambdaUpdateChainWrapper
<
YgglMainEmp
>(
ygglMainEmpMapper
)
.
set
(
addygdaDto
.
getBmgwId
()
!=
null
,
YgglMainEmp:
:
getBmgwId
,
addygdaDto
.
getBmgwId
())
.
eq
(
YgglMainEmp:
:
getOrgCode
,
orgCode
).
eq
(
YgglMainEmp:
:
getId
,
ygglMainEmp
.
getId
()).
update
();
.
set
(
YgglMainEmp:
:
getBmgwId
,
addygdaDto
.
getBmgwId
())
.
eq
(
YgglMainEmp:
:
getOrgCode
,
orgCode
).
eq
(
YgglMainEmp:
:
getId
,
ygglMainEmp
.
getId
()).
update
();
}
return
ResultUtil
.
data
(
ygglMainEmp
,
"新添加员工档案成功!"
);
}
else
{
YgglMainEmp
ishad
=
YgglMainEmp
.
builder
().
build
()
.
selectOne
(
new
QueryWrapper
<
YgglMainEmp
>().
eq
(
"phone"
,
phone
).
eq
(
"org_code"
,
orgCode
));
YgglMainEmp
ishad
=
ygglMainEmpMapper
.
selectOne
(
new
QueryWrapper
<
YgglMainEmp
>()
.
lambda
()
.
eq
(
YgglMainEmp:
:
getPhone
,
phone
)
.
eq
(
YgglMainEmp:
:
getOrgCode
,
orgCode
));
if
(
ishad
==
null
)
{
// 添加三张表
// 员工权限表(未定)
QyzxEmpEntAsso
.
builder
().
empNum
(
login
.
getId
()).
orgCode
(
orgCode
).
userType
(
2
).
status
(
1
).
build
().
insert
();
// usertype2普通员工
QyzxEmpEntAsso
.
builder
()
.
empNum
(
login
.
getId
())
.
orgCode
(
orgCode
)
.
userType
(
2
)
.
status
(
1
)
.
build
()
.
insert
();
// usertype2普通员工
// status1正常
YgglMainEmp
ygglMainEmp
=
YgglMainEmp
.
builder
().
name
(
name
).
phone
(
phone
).
zjType
(
zjType
).
zjNum
(
zjNum
)
.
jobType
(
jobType
).
rzTime
(
rzTime
).
syq
(
syq
).
sex
(
sex
).
empNum
(
login
.
getId
()).
orgCode
(
orgCode
)
YgglMainEmp
ygglMainEmp
=
YgglMainEmp
.
builder
()
.
name
(
name
)
.
phone
(
phone
)
.
zjType
(
zjType
)
.
zjNum
(
zjNum
)
.
jobType
(
jobType
)
.
jobStatus
(
YgEnumInterface
.
jobStatus
.
SHIYONG
.
getType
())
.
rzTime
(
rzTime
)
.
syq
(
syq
)
.
sex
(
sex
)
.
empNum
(
login
.
getId
())
.
orgCode
(
orgCode
)
.
build
();
ygglMainEmp
.
insert
();
new
LambdaUpdateChainWrapper
<
YgglMainEmp
>(
ygglMainEmpMapper
)
.
set
(
addygdaDto
.
getBmgwId
()
!=
null
,
YgglMainEmp:
:
getBmgwId
,
addygdaDto
.
getBmgwId
())
.
eq
(
YgglMainEmp:
:
getOrgCode
,
orgCode
).
eq
(
YgglMainEmp:
:
getId
,
ygglMainEmp
.
getId
()).
update
();
if
(
addygdaDto
.
getBmgwId
()
!=
null
)
{
new
LambdaUpdateChainWrapper
<
YgglMainEmp
>(
ygglMainEmpMapper
)
.
set
(
YgglMainEmp:
:
getBmgwId
,
addygdaDto
.
getBmgwId
())
.
eq
(
YgglMainEmp:
:
getOrgCode
,
orgCode
).
eq
(
YgglMainEmp:
:
getId
,
ygglMainEmp
.
getId
()).
update
();
}
return
ResultUtil
.
data
(
ygglMainEmp
,
"添加员工档案成功!"
);
}
else
{
return
ResultUtil
.
error
(
"该手机号已被使用,请输入正确手机号"
);
...
...
@@ -428,13 +463,14 @@ public class YgglController {
@PostMapping
(
value
=
"/updateygda"
)
@ApiOperation
(
value
=
"修改员工档案"
,
httpMethod
=
"POST"
,
notes
=
"接口发布说明"
)
@ApiOperationSupport
(
order
=
5
)
public
Result
<
Object
>
updateygda
(
@CurrentUser
UserBean
userBean
,
@RequestBody
YgglMainEmp
ygglMainEmp
)
throws
Exception
{
public
Result
<
Object
>
updateygda
(
@CurrentUser
UserBean
userBean
,
@RequestBody
YgglMainEmp
ygglMainEmp
)
throws
Exception
{
if
(
ygglMainEmp
.
getEmpNum
()
!=
null
)
{
UpdateWrapper
<
YgglMainEmp
>
updateWrapper
=
new
UpdateWrapper
<
YgglMainEmp
>();
updateWrapper
.
eq
(
"org_code"
,
userBean
.
getOrgCode
()).
eq
(
"emp_num"
,
ygglMainEmp
.
getEmpNum
());
ygglMainEmp
.
update
(
updateWrapper
);
// Integer count = qyzxEmpLoginMapper.selectCount(new QueryWrapper<QyzxEmpLogin>().lambda().eq(QyzxEmpLogin::getPhone, ygglMainEmp.getPhone()));
// if (count >= 1) {
// return ResultUtil.error("手机号已被使用!");
...
...
@@ -463,8 +499,7 @@ public class YgglController {
List
<
ZzglBmgwM
>
zzglBmgwMs
=
new
LambdaQueryChainWrapper
<
ZzglBmgwM
>(
zzglBmgwMMapper
)
.
eq
(
ZzglBmgwM:
:
getOrgCode
,
orgCode
).
list
();
ZzglBmgwM
.
getDepts
(
bList
,
b
,
zzglBmgwMs
);
Integer
j
=
ygQueryDto
.
getJobStatus
();
Integer
t
=
ygQueryDto
.
getJobType
();
String
q
=
ygQueryDto
.
getQuery
();
...
...
@@ -473,13 +508,11 @@ public class YgglController {
ygQueryDto
.
getTotalPage
()
==
null
?
10
:
ygQueryDto
.
getTotalPage
());
QueryWrapper
<
YgglMainEmp
>
queryWrapper
=
new
QueryWrapper
<>();
queryWrapper
.
select
(
"name"
,
"emp_num"
,
"bmgw_id"
,
"rz_time"
,
"job_type"
,
"phone"
,
"job_status"
)
.
ne
(
"job_status"
,
YgEnumInterface
.
jobStatus
.
YILIZHI
.
getType
())
.
eq
(
"org_code"
,
orgCode
)
.
ne
(
"job_status"
,
YgEnumInterface
.
jobStatus
.
YILIZHI
.
getType
()).
eq
(
"org_code"
,
orgCode
)
.
eq
(
t
!=
null
&&
t
>
-
1
,
"job_type"
,
t
).
eq
(
j
!=
null
&&
j
>
-
1
,
"job_status"
,
j
)
.
in
(!
bList
.
isEmpty
(),
"bmgw_id"
,
bList
)
.
and
(!
StrUtil
.
hasBlank
(
q
),
wq
->
wq
.
like
(
"name"
,
q
).
or
().
like
(
"phone"
,
q
));
// List<YgglMainEmp> lo = YgglMainEmp.builder().build().selectList(queryWrapper);
IPage
<
YgglMainEmp
>
ygglMainEmpPage
=
YgglMainEmp
.
builder
().
build
().
selectPage
(
page
,
queryWrapper
);
// List<YgglMainEmp> ygglMainEmps = ygglMainEmpPage.getRecords();
...
...
@@ -799,7 +832,8 @@ public class YgglController {
// 员工状态(最大优化)
d
.
setJobStatus
(
YgEnumInterface
.
jobStatus
.
isZhen
(
jobStatus
));
// 入职日期(最大优化)
d
.
setRzTime
(
rzTime
!=
null
?
YgEnumInterface
.
rzTime
.
tranTime2
(
YgEnumInterface
.
rzTime
.
tranTime
(
rzTime
))
:
null
);
d
.
setRzTime
(
rzTime
!=
null
?
YgEnumInterface
.
rzTime
.
tranTime2
(
YgEnumInterface
.
rzTime
.
tranTime
(
rzTime
))
:
null
);
// 试用期(最大优化)
d
.
setSyq
(
YgEnumInterface
.
syq
.
choose
(
syq
));
}
...
...
@@ -810,10 +844,10 @@ public class YgglController {
// 浴池,洗去选填项字节大于100的选项
public
boolean
takeshower
(
String
[]
bathroom
)
{
for
(
String
b
:
bathroom
)
{
if
(
b
!=
null
&&
b
.
length
()
>
100
)
{
if
(
b
!=
null
&&
b
.
length
()
>
100
)
{
return
false
;
}
}
return
true
;
}
...
...
@@ -1536,9 +1570,9 @@ public class YgglController {
@ApiOperation
(
value
=
"添加离职计划"
,
httpMethod
=
"POST"
,
notes
=
"接口发布说明"
)
@ApiOperationSupport
(
order
=
54
)
public
Result
<
YgglMainLzb
>
addjhlz
(
@CurrentUser
UserBean
userBean
,
@RequestBody
LzygQueryDto
lzygQueryDto
)
{
Integer
empNum
=
lzygQueryDto
.
getEmpNum
();
QueryWrapper
<
YgglMainEmp
>
queryWrapper
=
new
QueryWrapper
<
YgglMainEmp
>();
queryWrapper
.
eq
(
"emp_num"
,
empNum
).
eq
(
"org_code"
,
userBean
.
getOrgCode
());
YgglMainEmp
ygglMainEmp
=
YgglMainEmp
.
builder
().
build
().
selectOne
(
queryWrapper
);
...
...
@@ -1569,28 +1603,20 @@ public class YgglController {
@ApiOperationSupport
(
order
=
55
)
public
Result
<
Void
>
addlzb
(
@CurrentUser
UserBean
userBean
,
@RequestBody
LzygQueryDto
lzygQueryDto
)
{
Integer
empNum
=
lzygQueryDto
.
getEmpNum
();
QueryWrapper
<
YgglMainEmp
>
queryWrapper
=
new
QueryWrapper
<
YgglMainEmp
>();
queryWrapper
.
eq
(
"emp_num"
,
empNum
);
UpdateWrapper
<
YgglMainEmp
>
updateWrapper
=
new
UpdateWrapper
<
YgglMainEmp
>();
updateWrapper
.
eq
(
"emp_num"
,
empNum
);
UpdateWrapper
<
YgglMainLzb
>
updateWrapper1
=
new
UpdateWrapper
<
YgglMainLzb
>();
updateWrapper1
.
eq
(
"emp_num"
,
empNum
);
YgglMainEmp
.
builder
().
empNum
(
empNum
).
jobStatus
(
YgEnumInterface
.
jobStatus
.
YILIZHI
.
getType
())
.
build
().
update
(
updateWrapper
);
YgglMainLzb
.
builder
().
empNum
(
empNum
).
jobStatus
(
YgEnumInterface
.
jobStatus
.
YILIZHI
.
getType
())
.
sjlzTime
(
new
Date
()).
build
().
update
(
updateWrapper1
);
// 查询该员工的关联表
QueryWrapper
<
QyzxEmpEntAsso
>
queryWrapper1
=
new
QueryWrapper
<
QyzxEmpEntAsso
>();
queryWrapper1
.
eq
(
"emp_num"
,
empNum
);
// 确认离职 删除员工关联表
QyzxEmpEntAsso
qyzxEmpEntAsso
=
QyzxEmpEntAsso
.
builder
().
empNum
(
lzygQueryDto
.
getEmpNum
()).
build
();
qyzxEmpEntAsso
.
delete
(
queryWrapper1
);
// 删除员工档案表
ygglMainEmpMapper
.
delete
(
new
QueryWrapper
<
YgglMainEmp
>().
lambda
().
eq
(
YgglMainEmp:
:
getEmpNum
,
empNum
));
// 初始化 部门主管
zzglBmgwMMapper
.
update
(
ZzglBmgwM
.
builder
().
leader
(
null
).
build
(),
new
UpdateWrapper
<
ZzglBmgwM
>()
.
lambda
()
.
eq
(
ZzglBmgwM:
:
getLeader
,
empNum
));
YgglMainLzb
.
builder
().
empNum
(
empNum
).
jobStatus
(
YgEnumInterface
.
jobStatus
.
YILIZHI
.
getType
()).
sjlzTime
(
new
Date
())
.
build
().
update
(
new
UpdateWrapper
<
YgglMainLzb
>().
lambda
().
eq
(
YgglMainLzb:
:
getEmpNum
,
empNum
));
// 确认离职 删除员工关联表
QyzxEmpEntAsso
.
builder
().
empNum
(
lzygQueryDto
.
getEmpNum
()).
build
()
.
delete
(
new
QueryWrapper
<
QyzxEmpEntAsso
>().
lambda
().
eq
(
QyzxEmpEntAsso:
:
getEmpNum
,
empNum
));
// 初始化 部门主管
zzglBmgwMMapper
.
update
(
ZzglBmgwM
.
builder
().
leader
(
null
).
build
(),
new
UpdateWrapper
<
ZzglBmgwM
>().
lambda
().
eq
(
ZzglBmgwM:
:
getLeader
,
empNum
));
return
ResultUtil
.
success
(
"确认离职员工成功"
);
}
...
...
@@ -1666,10 +1692,10 @@ public class YgglController {
List
<
YgmzDto
>
mz
=
new
LambdaQueryChainWrapper
<
YgmzDto
>(
ygMzDtoMapper
).
eq
(
YgmzDto:
:
getNumber
,
id
).
list
();
return
ResultUtil
.
data
(
mz
,
"展示该民族"
);
}
@Autowired
CommonAreaMapper
commonAreaMapper
;
/**
* 籍贯树-Mini
*
...
...
@@ -1680,10 +1706,10 @@ public class YgglController {
@ApiOperation
(
value
=
"籍贯树-Mini"
,
httpMethod
=
"GET"
,
notes
=
"籍贯树-Mini"
)
@ApiOperationSupport
(
order
=
60
)
public
Result
<
List
<
CommonArea
>>
selectNativePlace
()
{
List
<
CommonArea
>
listCommonArea
=
commonAreaMapper
.
AllAreaForTree
();
return
ResultUtil
.
data
(
listCommonArea
,
"操作成功!"
);
}
/**
...
...
@@ -2032,4 +2058,30 @@ public class YgglController {
.
delete
(
new
QueryWrapper
<
YgglAttaSbgjj
>().
eq
(
"org_code"
,
orgCode
).
eq
(
"id"
,
id
)),
"删除员工社保公积金成功"
);
}
@GetMapping
(
value
=
"/sysRegion"
)
@ApiOperation
(
value
=
"省市区字典(贼全)"
,
httpMethod
=
"GET"
,
notes
=
"接口发布说明"
)
public
Result
<
List
<
Tree
<
String
>>>
sysRegion
()
{
List
<
SysRegion
>
nodeList
=
SysRegion
.
builder
().
build
()
.
selectList
(
new
LambdaQueryWrapper
<
SysRegion
>().
select
(
SysRegion:
:
getKeyId
,
SysRegion:
:
getRegionCode
,
SysRegion:
:
getRegionName
,
SysRegion:
:
getMerName
,
SysRegion:
:
getLevel
));
// 配置
TreeNodeConfig
treeNodeConfig
=
new
TreeNodeConfig
();
// 自定义属性名 都要默认值的
treeNodeConfig
.
setIdKey
(
"key_id"
);
treeNodeConfig
.
setParentIdKey
(
"region_code"
);
// 最大递归深度
treeNodeConfig
.
setDeep
(
4
);
List
<
Tree
<
String
>>
treeNodes
=
TreeUtil
.
build
(
nodeList
,
"0"
,
treeNodeConfig
,
(
treeNode
,
tree
)
->
{
tree
.
setId
(
treeNode
.
getKeyId
().
toString
());
tree
.
setParentId
(
treeNode
.
getRegionCode
());
tree
.
setName
(
treeNode
.
getRegionName
());
// 扩展属性 ...
tree
.
putExtra
(
"mer_name"
,
treeNode
.
getMerName
());
});
return
ResultUtil
.
data
(
treeNodes
,
"获取成功"
);
}
}
This diff is collapsed.
Click to expand it.
src/main/java/cn/timer/api/controller/zzgl/ZzglController.java
View file @
a70ae404
...
...
@@ -37,11 +37,13 @@ import cn.hutool.core.lang.tree.Tree;
import
cn.hutool.core.lang.tree.TreeNode
;
import
cn.hutool.core.lang.tree.TreeNodeConfig
;
import
cn.hutool.core.lang.tree.TreeUtil
;
import
cn.hutool.core.util.StrUtil
;
import
cn.timer.api.bean.yggl.YgglMainEmp
;
import
cn.timer.api.bean.zzgl.ZzglAuth
;
import
cn.timer.api.bean.zzgl.ZzglBmgwM
;
import
cn.timer.api.config.annotation.CurrentUser
;
import
cn.timer.api.config.annotation.UserBean
;
import
cn.timer.api.config.enuminterface.YgEnumInterface
;
import
cn.timer.api.dao.yggl.YgglMainEmpMapper
;
import
cn.timer.api.dao.zzgl.ZzglBmgwMMapper
;
import
cn.timer.api.dao.zzgl.ZzglLogDgjlMapper
;
...
...
@@ -89,7 +91,7 @@ public class ZzglController {
* @param
* @return
*/
@GetMapping
(
value
=
"/deptlist
2
"
)
@GetMapping
(
value
=
"/deptlist
_plus
"
)
@ApiOperation
(
value
=
"1.获取部门岗位-升级版"
,
httpMethod
=
"GET"
,
notes
=
"接口发布说明"
)
@ApiOperationSupport
(
order
=
1
)
public
Result
<
List
<
Tree
<
String
>>>
selectlistdept2
(
@CurrentUser
UserBean
userBean
)
{
...
...
@@ -128,11 +130,14 @@ public class ZzglController {
}
@GetMapping
(
value
=
"/depts"
)
@ApiOperation
(
value
=
"只获取部门"
,
httpMethod
=
"GET"
,
notes
=
"接口发布说明"
)
@ApiOperation
(
value
=
"2.获取部门"
,
httpMethod
=
"GET"
,
notes
=
"接口发布说明"
)
@ApiOperationSupport
(
order
=
2
)
public
Result
<
List
<
ZzglBmgwM
>>
selectdepts
(
@CurrentUser
UserBean
userBean
)
{
Integer
orgCode
=
userBean
.
getOrgCode
();
List
<
ZzglBmgwM
>
zzglBmgwMs
=
new
LambdaQueryChainWrapper
<
ZzglBmgwM
>(
zzglBmgwMMapper
)
.
eq
(
ZzglBmgwM:
:
getOrgCode
,
orgCode
).
eq
(
ZzglBmgwM:
:
getType
,
0
).
list
();
//0:部门;1:岗位
.
eq
(
ZzglBmgwM:
:
getOrgCode
,
orgCode
)
.
eq
(
ZzglBmgwM:
:
getType
,
YgEnumInterface
.
OrgType
.
DEPARTMENT
)
.
list
();
return
ResultUtil
.
data
(
zzglBmgwMs
);
}
...
...
@@ -240,16 +245,17 @@ public class ZzglController {
// 根部门upId 默认为0
zzglBmgwM
.
setUpId
(
0
);
}
if
(
zzglBmgwM
.
getName
().
trim
().
length
()==
0
)
if
(
zzglBmgwM
.
getLeader
()
==
null
&&
StrUtil
.
length
(
StrUtil
.
trim
(
zzglBmgwM
.
getName
()))
==
0
)
return
ResultUtil
.
error
(
"部门岗位名称不能为空"
);
Boolean
a
=
zzglBmgwM
.
getId
()
==
null
;
if
(
a
&&
zzglBmgwM
.
getType
()
==
null
)
Boolean
notId
=
zzglBmgwM
.
getId
()
==
null
;
if
(
notId
&&
zzglBmgwM
.
getType
()
==
null
)
zzglBmgwM
.
setType
((
Integer
)
0
);
zzglBmgwM
.
setOrgCode
(
userBean
.
getOrgCode
());
zzglBmgwM
.
insertOrUpdate
();
if
(
a
)
return
ResultUtil
.
data
(
zzglBmgwM
);
return
ResultUtil
.
success
();
zzglBmgwM
.
setOrgCode
(
userBean
.
getOrgCode
());
zzglBmgwM
.
insertOrUpdate
();
return
notId
?
ResultUtil
.
data
(
zzglBmgwM
)
:
ResultUtil
.
success
();
}
...
...
This diff is collapsed.
Click to expand it.
src/main/java/cn/timer/api/dto/yggl/AddygdaDto.java
View file @
a70ae404
...
...
@@ -8,6 +8,11 @@ package cn.timer.api.dto.yggl;
import
java.io.Serializable
;
import
java.util.Date
;
import
javax.validation.constraints.NotBlank
;
import
javax.validation.constraints.NotEmpty
;
import
javax.validation.constraints.NotNull
;
import
cn.timer.api.config.exception.ValidationMsg
;
import
cn.timer.api.utils.Page
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.AllArgsConstructor
;
...
...
@@ -28,30 +33,39 @@ public class AddygdaDto extends Page implements Serializable{
private
static
final
long
serialVersionUID
=
-
1230023773946170942L
;
@NotBlank
(
message
=
ValidationMsg
.
NOTBLANK
)
@ApiModelProperty
(
value
=
"员工姓名"
,
example
=
"华仔"
)
private
String
name
;
@NotBlank
(
message
=
ValidationMsg
.
NOTBLANK
)
@ApiModelProperty
(
value
=
"手机号"
,
example
=
"101"
)
private
String
phone
;
@NotNull
(
message
=
ValidationMsg
.
NOTNULL
)
@ApiModelProperty
(
value
=
"证件类型 0:身份证;1:港澳居民来往内地通行证;2:台湾居民来往大陆通行证;3:外国护照;4:其他"
,
example
=
"0"
)
private
Integer
zjType
;
@NotBlank
(
message
=
ValidationMsg
.
NOTBLANK
)
@ApiModelProperty
(
value
=
"证件号码 "
,
example
=
"证件号码"
)
private
String
zjNum
;
@NotNull
(
message
=
ValidationMsg
.
NOTNULL
)
@ApiModelProperty
(
value
=
"工作性质 0全职、1实习生、2兼职、3劳务派遣、4劳务、5派遣、6外包、7退休返聘"
,
example
=
"0"
)
private
Integer
jobType
;
@NotNull
(
message
=
ValidationMsg
.
NOTNULL
)
@ApiModelProperty
(
value
=
"入职日期 "
,
example
=
"客户注册后的时间为入职时间"
)
private
Date
rzTime
;
@NotNull
(
message
=
ValidationMsg
.
NOTNULL
)
@ApiModelProperty
(
value
=
"试用期 0:无试用期;1:1个月;2:2个月;3:3个月;4:4个月;5:5个月;6:6个月(有试用期显示选项)"
,
example
=
"0"
)
private
Integer
syq
;
@NotNull
(
message
=
ValidationMsg
.
NOTNULL
)
@ApiModelProperty
(
value
=
"性别 0:男;1:女"
,
example
=
"0"
)
private
Integer
sex
;
@NotNull
(
message
=
ValidationMsg
.
NOTNULL
)
@ApiModelProperty
(
value
=
"部门岗位id"
,
example
=
"0"
)
private
Integer
bmgwId
;
...
...
This diff is collapsed.
Click to expand it.
src/main/resources/application-dev.yml
View file @
a70ae404
...
...
@@ -175,7 +175,7 @@ config-8timer:
one
:
3
two
:
7
three
:
30
init-password
:
123456
This diff is collapsed.
Click to expand it.
src/main/resources/application-pro.yml
View file @
a70ae404
...
...
@@ -146,4 +146,5 @@ config-8timer:
remind
:
#合同提醒时间 默认小于等于1天会提醒+三个配置项
one
:
3
two
:
7
three
:
30
\ No newline at end of file
three
:
30
init-password
:
123456
\ No newline at end of file
This diff is collapsed.
Click to expand it.
src/main/resources/application-test.yml
View file @
a70ae404
...
...
@@ -146,4 +146,5 @@ config-8timer:
remind
:
#合同提醒时间 默认小于等于1天会提醒+三个配置项
one
:
3
two
:
7
three
:
30
\ No newline at end of file
three
:
30
init-password
:
123456
\ No newline at end of file
This diff is collapsed.
Click to expand it.
src/main/resources/mapping/qyzx/QyzxOperLogMapper.xml
View file @
a70ae404
...
...
@@ -38,7 +38,7 @@
oper_url,
oper_ip,
oper_location,
oper_param,
<!-- oper_param, -->
json_result,
status,
error_msg,
...
...
This diff is collapsed.
Click to expand it.
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