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
1735dbc1
Commit
1735dbc1
authored
4 years ago
by
ilal
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'develop' of 120.24.24.239:8timerv2/8timerapiv200 into lal
parents
a54fe5ac
cb98fecd
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
97 additions
and
11 deletions
+97
-11
src/main/java/cn/timer/api/config/enuminterface/YgEnumInterface.java
+1
-1
src/main/java/cn/timer/api/controller/LoginController.java
+1
-1
src/main/java/cn/timer/api/controller/spmk/SpmkController.java
+29
-6
src/main/java/cn/timer/api/controller/yggl/YgglController.java
+0
-0
src/main/java/cn/timer/api/controller/zzgl/ZzglController.java
+64
-0
src/main/java/cn/timer/api/utils/router/RouterUtils.java
+2
-3
No files found.
src/main/java/cn/timer/api/config/enuminterface/YgEnumInterface.java
View file @
1735dbc1
...
...
@@ -81,7 +81,7 @@ public interface YgEnumInterface {
*/
@Getter
enum
jobStatus
implements
YgEnumInterface
{
SHIYONG
(
0
,
"试用"
),
ZHENSHI
(
1
,
"正式"
),
LIZHIZHONG
(
2
,
"离职中"
),
YILIZHI
(
3
,
"已离职"
);
SHIYONG
(
1
,
"试用"
),
ZHENSHI
(
2
,
"正式"
),
LIZHIZHONG
(
3
,
"离职中"
),
YILIZHI
(
4
,
"已离职"
);
private
Integer
type
;
...
...
This diff is collapsed.
Click to expand it.
src/main/java/cn/timer/api/controller/LoginController.java
View file @
1735dbc1
...
...
@@ -508,7 +508,7 @@ public class LoginController {
}
boolean
b4
=
YgglMainEmp
.
builder
().
orgCode
(
qyzxEntInfoM
.
getId
()).
empNum
(
login
.
getId
()).
rzTime
(
new
Date
())
.
name
(
username
).
build
().
insert
();
.
name
(
username
).
jobStatus
(
1
).
build
().
insert
();
if
(!
b4
)
{
TransactionAspectSupport
.
currentTransactionStatus
().
setRollbackOnly
();
return
ResultUtil
.
error
(
"注册企业失败3"
);
...
...
This diff is collapsed.
Click to expand it.
src/main/java/cn/timer/api/controller/spmk/SpmkController.java
View file @
1735dbc1
...
...
@@ -4,11 +4,8 @@ import java.util.ArrayList;
import
java.util.Date
;
import
java.util.List
;
import
javax.validation.Valid
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.validation.BindingResult
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.web.bind.MethodArgumentNotValidException
;
import
org.springframework.web.bind.annotation.DeleteMapping
;
...
...
@@ -23,6 +20,7 @@ import org.springframework.web.bind.annotation.RestController;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.github.xiaoymin.knife4j.annotations.ApiOperationSupport
;
...
...
@@ -118,9 +116,14 @@ public class SpmkController {
@ApiOperationSupport
(
order
=
1
)
public
Result
<
Object
>
saveAtg
(
@RequestBody
SpmkApprovalTemplateG
spmkApprovalTemplateG
){
if
(
spmkApprovalTemplateG
.
selectCount
(
new
QueryWrapper
<
SpmkApprovalTemplateG
>().
lambda
()
.
eq
(
SpmkApprovalTemplateG:
:
getName
,
spmkApprovalTemplateG
.
getName
()))
>
0
)
{
return
ResultUtil
.
error
(
"审批模板组名重复!"
);
}
return
spmkApprovalTemplateG
.
insertOrUpdate
()
?
ResultUtil
.
data
(
spmkApprovalTemplateG
,
"操作成功!"
)
:
ResultUtil
.
error
(
"操作失败!"
);
}
/**
...
...
@@ -170,6 +173,7 @@ public class SpmkController {
@ApiOperation
(
value
=
"5.新增或编辑-审批模板"
,
httpMethod
=
"POST"
,
notes
=
"新增或编辑-审批模板"
)
@ApiOperationSupport
(
order
=
5
)
public
Result
<
Object
>
saveAt
(
@Validated
@RequestBody
SpmkApprovalTemplateDto
spmkApprovalTemplateDto
){
Integer
approvalTemplateGId
=
spmkApprovalTemplateDto
.
getApprovalTemplateGId
();
if
(
ObjectUtil
.
isNull
(
approvalTemplateGId
))
return
ResultUtil
.
error
(
"操作失败!-1"
);
...
...
@@ -182,6 +186,11 @@ public class SpmkController {
at
.
setFroms
(
ObjectUtil
.
serialize
((
List
<
JSONObject
>)
spmkApprovalTemplateDto
.
getFroms
()));
at
.
setRouter
(
ObjectUtil
.
serialize
(
spmkApprovalTemplateDto
.
getRouter
()));
if
(
at
.
selectCount
(
new
QueryWrapper
<
SpmkApprovalTemplate
>().
lambda
()
.
eq
(
SpmkApprovalTemplate:
:
getName
,
at
.
getName
()))
>
0
)
{
return
ResultUtil
.
error
(
"审批模板名重复!"
);
}
if
(!
at
.
insertOrUpdate
())
return
ResultUtil
.
error
(
"操作失败!-2"
);
...
...
@@ -243,6 +252,13 @@ public class SpmkController {
@ApiOperation
(
value
=
"9.新增或编辑-审批组"
,
httpMethod
=
"POST"
,
notes
=
"新增或编辑-审批组"
)
@ApiOperationSupport
(
order
=
9
)
public
Result
<
Object
>
saveAg
(
@CurrentUser
UserBean
userBean
,
@RequestBody
SpmkApprovalG
spmkApprovalG
){
if
(
spmkApprovalG
.
selectCount
(
new
QueryWrapper
<
SpmkApprovalG
>().
lambda
()
.
eq
(
SpmkApprovalG:
:
getName
,
spmkApprovalG
.
getName
())
.
eq
(
SpmkApprovalG:
:
getOrgCode
,
userBean
.
getOrgCode
()))
>
0
)
{
return
ResultUtil
.
error
(
"审批组名重复!"
);
}
spmkApprovalG
.
setOrgCode
(
userBean
.
getOrgCode
());
return
spmkApprovalG
.
insertOrUpdate
()
?
ResultUtil
.
data
(
spmkApprovalG
,
"操作成功!"
)
:
ResultUtil
.
error
(
"操作失败!"
);
...
...
@@ -310,7 +326,7 @@ public class SpmkController {
@ApiOperation
(
value
=
"13.新增或编辑-自定义审批"
,
httpMethod
=
"POST"
,
notes
=
"新增或编辑-自定义审批"
)
@ApiOperationSupport
(
order
=
13
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
Result
<
Object
>
saveCa
(
@RequestBody
SpmkCustomApprovalDto
spmkCustomApprovalDto
)
throws
Exception
{
public
Result
<
Object
>
saveCa
(
@
CurrentUser
UserBean
userBean
,
@
RequestBody
SpmkCustomApprovalDto
spmkCustomApprovalDto
)
throws
Exception
{
Integer
approvalGId
=
spmkCustomApprovalDto
.
getApprovalGId
();
if
(
ObjectUtil
.
isNull
(
approvalGId
))
return
ResultUtil
.
error
(
"操作失败!-1"
);
...
...
@@ -318,6 +334,13 @@ public class SpmkController {
SpmkCustomApproval
ca
=
SpmkCustomApproval
.
builder
().
build
();
BeanUtil
.
copyProperties
(
spmkCustomApprovalDto
,
ca
,
"froms"
,
"router"
,
"initiatorConfigs"
);
if
(
ca
.
selectCount
(
new
QueryWrapper
<
SpmkCustomApproval
>().
lambda
()
.
eq
(
SpmkCustomApproval:
:
getName
,
ca
.
getName
())
.
eq
(
SpmkCustomApproval:
:
getOrgCode
,
userBean
.
getOrgCode
()))
>
0
)
{
return
ResultUtil
.
error
(
"自定义审批名重复!"
);
}
ca
.
setFroms
(
ObjectUtil
.
serialize
(
spmkCustomApprovalDto
.
getFroms
()));
ca
.
setRouter
(
ObjectUtil
.
serialize
(
spmkCustomApprovalDto
.
getRouter
()));
...
...
@@ -645,7 +668,7 @@ public class SpmkController {
.
eq
(
SpmkApproveSummary:
:
getId
,
id
));
return
as
!=
null
&&
as
.
getSts
()
!=
2
?
(
SpmkApproveSummary
.
builder
().
id
(
id
).
endTime
(
new
Date
()).
sts
(
1
).
build
().
updateById
()
?
ResultUtil
.
success
(
"操作成功!"
)
:
ResultUtil
.
error
(
"操作失败_1!"
))
:
ResultUtil
.
error
(
"
操作失败_2
!"
);
ResultUtil
.
success
(
"操作成功!"
)
:
ResultUtil
.
error
(
"操作失败_1!"
))
:
ResultUtil
.
error
(
"
审批已结束,无法撤销
!"
);
}
/**
...
...
This diff is collapsed.
Click to expand it.
src/main/java/cn/timer/api/controller/yggl/YgglController.java
View file @
1735dbc1
This source diff could not be displayed because it is too large. You can
view the blob
instead.
This diff is collapsed.
Click to expand it.
src/main/java/cn/timer/api/controller/zzgl/ZzglController.java
View file @
1735dbc1
package
cn
.
timer
.
api
.
controller
.
zzgl
;
import
java.lang.reflect.Type
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.HashSet
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Set
;
import
javax.transaction.Transactional
;
...
...
@@ -22,8 +25,18 @@ import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.github.xiaoymin.knife4j.annotations.ApiOperationSupport
;
import
cn.hutool.core.bean.BeanUtil
;
import
cn.hutool.core.bean.copier.CopyOptions
;
import
cn.hutool.core.bean.copier.ValueProvider
;
import
cn.hutool.core.collection.CollUtil
;
import
cn.hutool.core.collection.ListUtil
;
import
cn.hutool.core.convert.Convert
;
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.timer.api.bean.yggl.YgglMainEmp
;
import
cn.timer.api.bean.zzgl.ZzglAuth
;
import
cn.timer.api.bean.zzgl.ZzglBmgwM
;
...
...
@@ -70,6 +83,50 @@ public class ZzglController {
return
ResultUtil
.
data
(
zzglBmgwMs
);
}
/**
* 架构树/架构图/导出
*
* @param
* @return
*/
@GetMapping
(
value
=
"/deptlist2"
)
@ApiOperation
(
value
=
"1.获取部门岗位-升级版"
,
httpMethod
=
"GET"
,
notes
=
"接口发布说明"
)
@ApiOperationSupport
(
order
=
1
)
public
Result
<
List
<
Tree
<
String
>>>
selectlistdept2
(
@CurrentUser
UserBean
userBean
)
{
Integer
orgCode
=
userBean
.
getOrgCode
();
List
<
ZzglBmgwM
>
zzglBmgwMs
=
new
LambdaQueryChainWrapper
<
ZzglBmgwM
>(
zzglBmgwMMapper
)
.
eq
(
ZzglBmgwM:
:
getOrgCode
,
orgCode
).
list
();
// 构建node列表
List
<
TreeNode
<
String
>>
nodeList
=
CollUtil
.
newArrayList
();
zzglBmgwMs
.
forEach
(
z
->
{
nodeList
.
add
(
new
TreeNode
<>(
Convert
.
toStr
(
z
.
getId
()),
Convert
.
toStr
(
z
.
getUpId
()),
z
.
getName
(),
0
));
});
//配置
TreeNodeConfig
treeNodeConfig
=
new
TreeNodeConfig
();
// 自定义属性名 都要默认值的
treeNodeConfig
.
setIdKey
(
"id"
);
treeNodeConfig
.
setParentIdKey
(
"upId"
);
// 最大递归深度
// treeNodeConfig.setDeep(10);
//转换器
List
<
Tree
<
String
>>
treeNodes
=
TreeUtil
.
build
(
nodeList
,
"0"
,
treeNodeConfig
,
(
treeNode
,
tree
)
->
{
tree
.
setId
(
treeNode
.
getId
());
tree
.
setParentId
(
treeNode
.
getParentId
());
tree
.
setWeight
(
treeNode
.
getWeight
());
tree
.
setName
(
treeNode
.
getName
());
// 扩展属性 ...
// tree.putExtra("extraField", 666);
// tree.putExtra("other", new Object());
});
return
ResultUtil
.
data
(
treeNodes
);
}
@GetMapping
(
value
=
"/depts"
)
@ApiOperation
(
value
=
"只获取部门"
,
httpMethod
=
"GET"
,
notes
=
"接口发布说明"
)
public
Result
<
List
<
ZzglBmgwM
>>
selectdepts
(
@CurrentUser
UserBean
userBean
)
{
...
...
@@ -176,6 +233,13 @@ public class ZzglController {
@PostMapping
(
value
=
"/dept"
)
@ApiOperation
(
value
=
"添加/修改部门"
,
httpMethod
=
"POST"
,
notes
=
"接口发布说明"
)
public
Result
<
ZzglBmgwM
>
adddept
(
@CurrentUser
UserBean
userBean
,
@RequestBody
ZzglBmgwM
zzglBmgwM
)
{
Integer
count
=
zzglBmgwMMapper
.
selectCount
(
new
QueryWrapper
<
ZzglBmgwM
>().
lambda
()
.
eq
(
ZzglBmgwM:
:
getOrgCode
,
userBean
.
getOrgCode
()));
if
(
count
<=
0
)
{
// 根部门upId 默认为0
zzglBmgwM
.
setUpId
(
0
);
}
if
(
zzglBmgwM
.
getName
().
trim
().
length
()==
0
)
return
ResultUtil
.
error
(
"部门岗位名称不能为空"
);
Boolean
a
=
zzglBmgwM
.
getId
()
==
null
;
...
...
This diff is collapsed.
Click to expand it.
src/main/java/cn/timer/api/utils/router/RouterUtils.java
View file @
1735dbc1
...
...
@@ -289,6 +289,7 @@ public class RouterUtils {
// 审批执行记录 持久化
public
static
void
insertogExecuteRecord
(
List
<
FlowChildren
>
listFlowChildren
,
Integer
asId
)
throws
Exception
{
for_insert:
for
(
int
i
=
0
,
m
=
listFlowChildren
.
size
()
;
i
<
m
;
i
++)
{
if
(
UNEXECUTED
.
equals
(
listFlowChildren
.
get
(
i
).
getExecute
()))
{
i
++;
...
...
@@ -345,14 +346,12 @@ public class RouterUtils {
case
EXECUTING:
executor
.
setSts
(
1
);
executor
.
insert
();
break
executor
;
break
for_insert
;
case
EXECUTED:
executor
.
setSts
(
2
);
executor
.
insert
();
break
;
}
}
break
;
case
COPY:
...
...
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